@synnaxlabs/x 0.43.0 → 0.44.1

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 (288) hide show
  1. package/.turbo/turbo-build.log +105 -93
  2. package/dist/base-BAM2mqCy.cjs +1 -0
  3. package/dist/base-DFq0vvGn.js +38 -0
  4. package/dist/binary.cjs +1 -1
  5. package/dist/binary.js +1 -1
  6. package/dist/bounds-D6e9xoHt.cjs +1 -0
  7. package/dist/bounds-Dj9nG39I.js +174 -0
  8. package/dist/bounds.cjs +1 -1
  9. package/dist/bounds.js +2 -2
  10. package/dist/box-CO_2_DGG.js +209 -0
  11. package/dist/box-Cxki783Y.cjs +1 -0
  12. package/dist/box.cjs +1 -1
  13. package/dist/box.js +1 -1
  14. package/dist/caseconv.cjs +1 -1
  15. package/dist/caseconv.js +2 -2
  16. package/dist/change-C-YELKx6.cjs +1 -0
  17. package/dist/change-DLl6DccR.js +12 -0
  18. package/dist/change.cjs +1 -1
  19. package/dist/change.js +2 -10
  20. package/dist/compare.cjs +1 -1
  21. package/dist/compare.js +1 -1
  22. package/dist/deep.cjs +1 -1
  23. package/dist/deep.js +95 -96
  24. package/dist/dimensions-CRgergMS.js +43 -0
  25. package/dist/dimensions-D2QGoNXO.cjs +1 -0
  26. package/dist/dimensions.cjs +1 -1
  27. package/dist/dimensions.js +2 -41
  28. package/dist/direction-386XDm2w.cjs +1 -0
  29. package/dist/{index-DxU1zwsd.js → direction-8etxfKaR.js} +4 -3
  30. package/dist/direction.cjs +1 -1
  31. package/dist/direction.js +1 -1
  32. package/dist/external-B9AAGv50.cjs +1 -0
  33. package/dist/external-BFgJjMcS.js +23 -0
  34. package/dist/external-BPgtxa8d.js +29 -0
  35. package/dist/external-BYuXBYJh.js +40 -0
  36. package/dist/external-mffsMzJx.cjs +1 -0
  37. package/dist/external-uXk0Avrg.cjs +1 -0
  38. package/dist/index-B1m2qvBT.cjs +1 -0
  39. package/dist/{index-4GlOgZuh.js → index-B5l_quQn.js} +35 -42
  40. package/dist/index-BQe8OIgm.cjs +3 -0
  41. package/dist/index-D2xcvEO5.js +46 -0
  42. package/dist/index-DdhM_E4k.cjs +1 -0
  43. package/dist/index-PNh31WTW.js +125 -0
  44. package/dist/index.cjs +3 -5
  45. package/dist/index.js +685 -5363
  46. package/dist/kv.cjs +1 -1
  47. package/dist/kv.js +2 -45
  48. package/dist/{index-D6V-8SKw.js → location-Ar5y2DX2.js} +26 -26
  49. package/dist/location-DZi8ftXp.cjs +1 -0
  50. package/dist/location.cjs +1 -1
  51. package/dist/location.js +1 -1
  52. package/dist/observe.cjs +1 -1
  53. package/dist/observe.js +16 -20
  54. package/dist/path-BXdMenka.js +101 -0
  55. package/dist/path-st_E5-LJ.cjs +1 -0
  56. package/dist/position-DSy2hONH.cjs +1 -0
  57. package/dist/position-PQ6op54I.js +85 -0
  58. package/dist/position.cjs +1 -1
  59. package/dist/position.js +2 -83
  60. package/dist/record-CAcQ5PNX.js +14 -0
  61. package/dist/record-YvCh7bzB.cjs +1 -0
  62. package/dist/record.cjs +1 -1
  63. package/dist/record.js +2 -8
  64. package/dist/runtime.cjs +1 -1
  65. package/dist/runtime.js +2 -27
  66. package/dist/scale-C6qKDbRb.cjs +1 -0
  67. package/dist/{index-BUa-NXAX.js → scale-EWNUk-bn.js} +55 -59
  68. package/dist/scale.cjs +1 -1
  69. package/dist/scale.js +1 -1
  70. package/dist/{index-DBGAIs_7.js → series-Bn5y1tD1.js} +835 -759
  71. package/dist/series-CYAhDD6B.cjs +6 -0
  72. package/dist/spatial-BSWPzMkK.js +11 -0
  73. package/dist/spatial-DGpZ2sO3.cjs +1 -0
  74. package/dist/spatial.cjs +1 -1
  75. package/dist/spatial.js +18 -25
  76. package/dist/src/binary/codec.d.ts +1 -1
  77. package/dist/src/binary/codec.d.ts.map +1 -1
  78. package/dist/src/breaker/breaker.d.ts +2 -2
  79. package/dist/src/breaker/breaker.d.ts.map +1 -1
  80. package/dist/src/caseconv/caseconv.d.ts +0 -1
  81. package/dist/src/caseconv/caseconv.d.ts.map +1 -1
  82. package/dist/src/change/change.d.ts +1 -1
  83. package/dist/src/change/change.d.ts.map +1 -1
  84. package/dist/src/color/color.d.ts +2 -2
  85. package/dist/src/color/color.d.ts.map +1 -1
  86. package/dist/src/color/gradient.d.ts +1 -1
  87. package/dist/src/color/gradient.d.ts.map +1 -1
  88. package/dist/src/color/palette.d.ts +3 -3
  89. package/dist/src/color/palette.d.ts.map +1 -1
  90. package/dist/src/compare/compare.d.ts +4 -4
  91. package/dist/src/compare/compare.d.ts.map +1 -1
  92. package/dist/src/control/control.d.ts +9 -9
  93. package/dist/src/control/control.d.ts.map +1 -1
  94. package/dist/src/deep/merge.d.ts +1 -1
  95. package/dist/src/deep/merge.d.ts.map +1 -1
  96. package/dist/src/deep/path.d.ts +6 -6
  97. package/dist/src/deep/path.d.ts.map +1 -1
  98. package/dist/src/destructor.d.ts +6 -2
  99. package/dist/src/destructor.d.ts.map +1 -1
  100. package/dist/src/errors/errors.d.ts +5 -1
  101. package/dist/src/errors/errors.d.ts.map +1 -1
  102. package/dist/src/flush.d.ts +11 -0
  103. package/dist/src/flush.d.ts.map +1 -0
  104. package/dist/src/id/id.d.ts +1 -0
  105. package/dist/src/id/id.d.ts.map +1 -1
  106. package/dist/src/identity.d.ts +2 -2
  107. package/dist/src/identity.d.ts.map +1 -1
  108. package/dist/src/index.d.ts +3 -1
  109. package/dist/src/index.d.ts.map +1 -1
  110. package/dist/src/jsonrpc/jsonrpc.d.ts +1 -1
  111. package/dist/src/jsonrpc/jsonrpc.d.ts.map +1 -1
  112. package/dist/src/kv/types.d.ts +1 -1
  113. package/dist/src/kv/types.d.ts.map +1 -1
  114. package/dist/src/map/index.d.ts +2 -0
  115. package/dist/src/map/index.d.ts.map +1 -0
  116. package/dist/src/map/map.d.ts +2 -0
  117. package/dist/src/map/map.d.ts.map +1 -0
  118. package/dist/src/map/map.spec.d.ts +2 -0
  119. package/dist/src/map/map.spec.d.ts.map +1 -0
  120. package/dist/src/math/math.d.ts +2 -4
  121. package/dist/src/math/math.d.ts.map +1 -1
  122. package/dist/src/migrate/migrate.d.ts +1 -1
  123. package/dist/src/migrate/migrate.d.ts.map +1 -1
  124. package/dist/src/notation/notation.d.ts +1 -1
  125. package/dist/src/notation/notation.d.ts.map +1 -1
  126. package/dist/src/optional.d.ts +0 -3
  127. package/dist/src/optional.d.ts.map +1 -1
  128. package/dist/src/record/index.d.ts +2 -0
  129. package/dist/src/record/index.d.ts.map +1 -0
  130. package/dist/src/record/record.d.ts +90 -0
  131. package/dist/src/record/record.d.ts.map +1 -0
  132. package/dist/src/record/record.spec.d.ts.map +1 -0
  133. package/dist/src/runtime/os.d.ts +1 -1
  134. package/dist/src/runtime/os.d.ts.map +1 -1
  135. package/dist/src/spatial/base.d.ts +1 -1
  136. package/dist/src/spatial/base.d.ts.map +1 -1
  137. package/dist/src/spatial/box/box.d.ts +2 -1
  138. package/dist/src/spatial/box/box.d.ts.map +1 -1
  139. package/dist/src/spatial/dimensions/dimensions.d.ts +1 -1
  140. package/dist/src/spatial/dimensions/dimensions.d.ts.map +1 -1
  141. package/dist/src/spatial/direction/direction.d.ts +3 -3
  142. package/dist/src/spatial/direction/direction.d.ts.map +1 -1
  143. package/dist/src/spatial/location/location.d.ts +1 -1
  144. package/dist/src/spatial/location/location.d.ts.map +1 -1
  145. package/dist/src/spatial/scale/scale.d.ts +1 -1
  146. package/dist/src/spatial/scale/scale.d.ts.map +1 -1
  147. package/dist/src/spatial/xy/xy.d.ts +2 -1
  148. package/dist/src/spatial/xy/xy.d.ts.map +1 -1
  149. package/dist/src/status/index.d.ts +1 -1
  150. package/dist/src/status/index.d.ts.map +1 -1
  151. package/dist/src/status/status.d.ts +42 -0
  152. package/dist/src/status/status.d.ts.map +1 -0
  153. package/dist/src/status/status.spec.d.ts +2 -0
  154. package/dist/src/status/status.spec.d.ts.map +1 -0
  155. package/dist/src/strings/strings.d.ts +16 -0
  156. package/dist/src/strings/strings.d.ts.map +1 -1
  157. package/dist/src/telem/gl.d.ts +1 -1
  158. package/dist/src/telem/gl.d.ts.map +1 -1
  159. package/dist/src/telem/series.d.ts +17 -16
  160. package/dist/src/telem/series.d.ts.map +1 -1
  161. package/dist/src/telem/telem.d.ts +42 -19
  162. package/dist/src/telem/telem.d.ts.map +1 -1
  163. package/dist/src/testutil/testutil.d.ts +1 -0
  164. package/dist/src/testutil/testutil.d.ts.map +1 -1
  165. package/dist/src/testutil/testutil.spec.d.ts +2 -0
  166. package/dist/src/testutil/testutil.spec.d.ts.map +1 -0
  167. package/dist/src/zod/external.d.ts +1 -0
  168. package/dist/src/zod/external.d.ts.map +1 -1
  169. package/dist/src/zod/nullToUndefined.d.ts +1 -1
  170. package/dist/src/zod/nullToUndefined.d.ts.map +1 -1
  171. package/dist/src/zod/toArray.d.ts +3 -0
  172. package/dist/src/zod/toArray.d.ts.map +1 -0
  173. package/dist/src/zod/toArray.spec.d.ts +2 -0
  174. package/dist/src/zod/toArray.spec.d.ts.map +1 -0
  175. package/dist/src/zod/util.d.ts +1 -1
  176. package/dist/src/zod/util.d.ts.map +1 -1
  177. package/dist/telem.cjs +1 -1
  178. package/dist/telem.js +10 -11
  179. package/dist/url.cjs +1 -1
  180. package/dist/url.js +16 -19
  181. package/dist/worker.cjs +1 -1
  182. package/dist/worker.js +18 -22
  183. package/dist/xy-CUE3QDNn.cjs +1 -0
  184. package/dist/{index-C-qYOegc.js → xy-C_-hb3Q2.js} +67 -62
  185. package/dist/xy.cjs +1 -1
  186. package/dist/xy.js +1 -1
  187. package/dist/zod.cjs +1 -1
  188. package/dist/zod.js +2 -19
  189. package/package.json +13 -18
  190. package/src/binary/codec.spec.ts +1 -1
  191. package/src/binary/codec.ts +1 -1
  192. package/src/breaker/breaker.ts +1 -1
  193. package/src/caseconv/caseconv.ts +10 -12
  194. package/src/change/change.ts +1 -1
  195. package/src/color/color.ts +1 -1
  196. package/src/color/gradient.ts +1 -1
  197. package/src/color/palette.ts +1 -1
  198. package/src/compare/compare.ts +5 -5
  199. package/src/control/control.ts +2 -2
  200. package/src/deep/merge.spec.ts +2 -15
  201. package/src/deep/merge.ts +1 -1
  202. package/src/deep/path.spec.ts +41 -0
  203. package/src/deep/path.ts +48 -17
  204. package/src/destructor.ts +6 -2
  205. package/src/errors/errors.spec.ts +20 -20
  206. package/src/errors/errors.ts +4 -1
  207. package/src/flush.ts +21 -0
  208. package/src/id/id.spec.ts +1 -1
  209. package/src/id/id.ts +3 -1
  210. package/src/identity.ts +2 -2
  211. package/src/index.ts +3 -1
  212. package/src/instance/matcher.spec.ts +7 -7
  213. package/src/jsonrpc/jsonrpc.ts +1 -1
  214. package/src/kv/types.ts +1 -1
  215. package/src/map/index.ts +10 -0
  216. package/src/map/map.spec.ts +132 -0
  217. package/src/map/map.ts +17 -0
  218. package/src/math/math.ts +19 -27
  219. package/src/migrate/migrate.spec.ts +2 -2
  220. package/src/migrate/migrate.ts +2 -2
  221. package/src/notation/notation.ts +1 -1
  222. package/src/optional.ts +0 -4
  223. package/src/primitive/primitive.spec.ts +1 -1
  224. package/src/record/index.ts +10 -0
  225. package/src/record/record.spec.ts +319 -0
  226. package/src/record/record.ts +118 -0
  227. package/src/runtime/os.ts +1 -1
  228. package/src/spatial/base.ts +1 -1
  229. package/src/spatial/box/box.ts +6 -1
  230. package/src/spatial/dimensions/dimensions.ts +1 -1
  231. package/src/spatial/direction/direction.ts +1 -1
  232. package/src/spatial/location/location.ts +1 -1
  233. package/src/spatial/scale/scale.ts +1 -1
  234. package/src/spatial/xy/xy.ts +6 -1
  235. package/src/status/index.ts +1 -1
  236. package/src/status/status.spec.ts +25 -0
  237. package/src/status/status.ts +91 -0
  238. package/src/strings/strings.spec.ts +51 -13
  239. package/src/strings/strings.ts +20 -0
  240. package/src/telem/gl.ts +1 -1
  241. package/src/telem/series.spec.ts +193 -53
  242. package/src/telem/series.ts +53 -18
  243. package/src/telem/telem.spec.ts +202 -83
  244. package/src/telem/telem.ts +53 -35
  245. package/src/testutil/testutil.spec.ts +161 -0
  246. package/src/testutil/testutil.ts +12 -0
  247. package/src/zod/external.ts +1 -0
  248. package/src/zod/nullToUndefined.spec.ts +1 -1
  249. package/src/zod/nullToUndefined.ts +1 -1
  250. package/src/zod/toArray.spec.ts +182 -0
  251. package/src/{status/types.ts → zod/toArray.ts} +3 -12
  252. package/src/zod/util.spec.ts +2 -2
  253. package/src/zod/util.ts +3 -3
  254. package/tsconfig.tsbuildinfo +1 -1
  255. package/vite.config.ts +1 -2
  256. package/dist/base-B5lQIJKc.js +0 -38
  257. package/dist/base-CTq-lhpU.cjs +0 -1
  258. package/dist/index-B58dnYRu.cjs +0 -1
  259. package/dist/index-BMGaoK93.cjs +0 -1
  260. package/dist/index-BTet04Hd.cjs +0 -6
  261. package/dist/index-C07SBJhr.js +0 -128
  262. package/dist/index-C9EdKeu1.js +0 -174
  263. package/dist/index-CM8ZDZ6s.cjs +0 -1
  264. package/dist/index-CV2JaHfw.cjs +0 -1
  265. package/dist/index-CeBvOwG8.cjs +0 -3
  266. package/dist/index-ClrGyGDp.js +0 -205
  267. package/dist/index-CqQXXeCI.cjs +0 -1
  268. package/dist/index-DEdq2tza.cjs +0 -1
  269. package/dist/index-DKMnHBGR.cjs +0 -1
  270. package/dist/index-Dql5FMcH.js +0 -47
  271. package/dist/index-WwMnwoLy.cjs +0 -1
  272. package/dist/path-1tZLZ4AN.cjs +0 -1
  273. package/dist/path-DD6ytXzr.js +0 -76
  274. package/dist/schemas-55Usj0Fg.js +0 -3998
  275. package/dist/schemas-DbXuI2Qr.cjs +0 -27
  276. package/dist/search.cjs +0 -1
  277. package/dist/search.js +0 -14
  278. package/dist/src/record.d.ts +0 -18
  279. package/dist/src/record.d.ts.map +0 -1
  280. package/dist/src/record.spec.d.ts.map +0 -1
  281. package/dist/src/search.d.ts +0 -18
  282. package/dist/src/search.d.ts.map +0 -1
  283. package/dist/src/status/types.d.ts +0 -11
  284. package/dist/src/status/types.d.ts.map +0 -1
  285. package/src/record.spec.ts +0 -38
  286. package/src/record.ts +0 -45
  287. package/src/search.ts +0 -42
  288. /package/dist/src/{record.spec.d.ts → record/record.spec.d.ts} +0 -0
package/dist/kv.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var o=Object.defineProperty;var l=(s,e,t)=>e in s?o(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var r=(s,e,t)=>l(s,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./schemas-DbXuI2Qr.cjs");class c{constructor(){r(this,"store",new Map)}async get(e){return this.store.get(e)??null}async set(e,t){this.store.set(e,t)}async delete(e){this.store.delete(e)}async length(){return this.store.size}async clear(){this.store.clear()}}class a{constructor(){r(this,"store",new Map)}get(e){return this.store.get(e)??null}set(e,t){this.store.set(e,t)}delete(e){this.store.delete(e)}}const i=n.object({key:n.string(),value:n.string()}),u=Object.freeze(Object.defineProperty({__proto__:null,MockAsync:c,MockSync:a,stringPairZ:i},Symbol.toStringTag,{value:"Module"}));exports.kv=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./external-B9AAGv50.cjs");exports.kv=e.external;
package/dist/kv.js CHANGED
@@ -1,47 +1,4 @@
1
- var n = Object.defineProperty;
2
- var l = (s, e, t) => e in s ? n(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
3
- var r = (s, e, t) => l(s, typeof e != "symbol" ? e + "" : e, t);
4
- import { o as a, s as o } from "./schemas-55Usj0Fg.js";
5
- class c {
6
- constructor() {
7
- r(this, "store", /* @__PURE__ */ new Map());
8
- }
9
- async get(e) {
10
- return this.store.get(e) ?? null;
11
- }
12
- async set(e, t) {
13
- this.store.set(e, t);
14
- }
15
- async delete(e) {
16
- this.store.delete(e);
17
- }
18
- async length() {
19
- return this.store.size;
20
- }
21
- async clear() {
22
- this.store.clear();
23
- }
24
- }
25
- class i {
26
- constructor() {
27
- r(this, "store", /* @__PURE__ */ new Map());
28
- }
29
- get(e) {
30
- return this.store.get(e) ?? null;
31
- }
32
- set(e, t) {
33
- this.store.set(e, t);
34
- }
35
- delete(e) {
36
- this.store.delete(e);
37
- }
38
- }
39
- const y = a({ key: o(), value: o() }), u = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
40
- __proto__: null,
41
- MockAsync: c,
42
- MockSync: i,
43
- stringPairZ: y
44
- }, Symbol.toStringTag, { value: "Module" }));
1
+ import { e as r } from "./external-BYuXBYJh.js";
45
2
  export {
46
- u as kv
3
+ r as kv
47
4
  };
@@ -1,6 +1,6 @@
1
- import { b as m } from "./index-Dql5FMcH.js";
2
- import { y as f, e as y, f as a, g, D as C, C as L, X as h, Y as z, l as S, o as d } from "./base-B5lQIJKc.js";
3
- import { o as O } from "./schemas-55Usj0Fg.js";
1
+ import { z as O } from "zod";
2
+ import { c as m } from "./index-D2xcvEO5.js";
3
+ import { y as f, e as y, f as a, g, D as C, C as h, X as z, Y as L, l as S, h as d } from "./base-DFq0vvGn.js";
4
4
  const N = y, R = f, I = a, X = {
5
5
  top: "bottom",
6
6
  right: "left",
@@ -13,13 +13,13 @@ const N = y, R = f, I = a, X = {
13
13
  bottom: "right",
14
14
  left: "bottom",
15
15
  center: "center"
16
- }, A = g, c = (t) => t instanceof String || !C.includes(t) ? t : t === "x" ? "left" : "top", P = (t) => X[c(t)], k = (t) => Y[c(t)], s = (t) => {
17
- const o = c(t);
16
+ }, A = g, r = (t) => t instanceof String || !C.includes(t) ? t : t === "x" ? "left" : "top", P = (t) => X[r(t)], k = (t) => Y[r(t)], s = (t) => {
17
+ const o = r(t);
18
18
  return o === "top" || o === "bottom" ? "y" : "x";
19
- }, w = O({
19
+ }, w = O.object({
20
20
  x: y.or(a),
21
21
  y: f.or(a)
22
- }), M = O({ x: y, y: f }), T = Object.freeze({ x: "left", y: "top" }), b = Object.freeze({ x: "right", y: "top" }), l = Object.freeze({ x: "left", y: "bottom" }), u = Object.freeze({ x: "right", y: "bottom" }), x = Object.freeze({ x: "center", y: "center" }), p = Object.freeze({ x: "center", y: "top" }), _ = Object.freeze({ x: "center", y: "bottom" }), E = Object.freeze({ x: "right", y: "center" }), j = Object.freeze({ x: "left", y: "center" }), $ = Object.freeze([
22
+ }), M = O.object({ x: y, y: f }), T = Object.freeze({ x: "left", y: "top" }), b = Object.freeze({ x: "right", y: "top" }), l = Object.freeze({ x: "left", y: "bottom" }), u = Object.freeze({ x: "right", y: "bottom" }), x = Object.freeze({ x: "center", y: "center" }), p = Object.freeze({ x: "center", y: "top" }), _ = Object.freeze({ x: "center", y: "bottom" }), E = Object.freeze({ x: "right", y: "center" }), j = Object.freeze({ x: "left", y: "center" }), $ = Object.freeze([
23
23
  j,
24
24
  E,
25
25
  p,
@@ -35,14 +35,14 @@ const N = y, R = f, I = a, X = {
35
35
  return "x" in o && (t.x === o.x || (e = !1)), "y" in o && (t.y === o.y || (e = !1)), e;
36
36
  }
37
37
  return t.x === o || t.y === o;
38
- }, F = (t) => [t.x, t.y], i = (t) => s(c(t)) === "x", G = (t) => s(c(t)) === "y", H = (t) => `${t.x}${m(t.y)}`, q = (t, o) => {
38
+ }, F = (t) => [t.x, t.y], i = (t) => s(r(t)) === "x", G = (t) => s(r(t)) === "y", H = (t) => `${t.x}${m(t.y)}`, q = (t, o) => {
39
39
  let e, n;
40
- if (typeof t == "object" && "x" in t ? (e = t.x, n = t.y) : (e = c(t), n = c(o ?? t)), s(e) === s(n) && e !== "center" && n !== "center")
40
+ if (typeof t == "object" && "x" in t ? (e = t.x, n = t.y) : (e = r(t), n = r(o ?? t)), s(e) === s(n) && e !== "center" && n !== "center")
41
41
  throw new Error(
42
42
  `[XYLocation] - encountered two locations with the same direction: ${e.toString()} - ${n.toString()}`
43
43
  );
44
- const r = { ...x };
45
- return e === "center" ? i(n) ? [r.x, r.y] = [n, e] : [r.x, r.y] = [e, n] : n === "center" ? i(e) ? [r.x, r.y] = [e, n] : [r.x, r.y] = [n, e] : i(e) ? [r.x, r.y] = [e, n] : [r.x, r.y] = [n, e], r;
44
+ const c = { ...x };
45
+ return e === "center" ? i(n) ? [c.x, c.y] = [n, e] : [c.x, c.y] = [e, n] : n === "center" ? i(e) ? [c.x, c.y] = [e, n] : [c.x, c.y] = [n, e] : i(e) ? [c.x, c.y] = [e, n] : [c.x, c.y] = [n, e], c;
46
46
  }, K = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
47
47
  __proto__: null,
48
48
  BOTTOM_CENTER: _,
@@ -50,16 +50,16 @@ const N = y, R = f, I = a, X = {
50
50
  BOTTOM_RIGHT: u,
51
51
  CENTER: x,
52
52
  CENTER_LEFT: j,
53
- CENTER_LOCATIONS: L,
53
+ CENTER_LOCATIONS: h,
54
54
  CENTER_RIGHT: E,
55
55
  TOP_CENTER: p,
56
56
  TOP_LEFT: T,
57
57
  TOP_RIGHT: b,
58
58
  XY_LOCATIONS: $,
59
- X_LOCATIONS: h,
60
- Y_LOCATIONS: z,
59
+ X_LOCATIONS: z,
60
+ Y_LOCATIONS: L,
61
61
  center: I,
62
- construct: c,
62
+ construct: r,
63
63
  constructXY: q,
64
64
  corner: M,
65
65
  crude: A,
@@ -80,20 +80,20 @@ const N = y, R = f, I = a, X = {
80
80
  }, Symbol.toStringTag, { value: "Module" }));
81
81
  export {
82
82
  l as B,
83
- j as C,
83
+ x as C,
84
84
  T,
85
85
  $ as X,
86
- F as a,
87
- p as b,
86
+ D as a,
87
+ B as b,
88
88
  M as c,
89
- b as d,
90
- _ as e,
91
- u as f,
92
- E as g,
93
- w as h,
94
- D as i,
95
- x as j,
89
+ F as d,
90
+ p as e,
91
+ b as f,
92
+ _ as g,
93
+ u as h,
94
+ j as i,
95
+ E as j,
96
96
  K as l,
97
97
  P as s,
98
- B as x
98
+ w as x
99
99
  };
@@ -0,0 +1 @@
1
+ "use strict";const L=require("zod"),S=require("./index-DdhM_E4k.cjs"),o=require("./base-BAM2mqCy.cjs"),z=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",b=t=>d[s(t)],M=t=>m[s(t)],i=t=>{const n=s(t);return n==="top"||n==="bottom"?"y":"x"},C=L.z.object({x:o.xLocation.or(o.centerLocation),y:o.yLocation.or(o.centerLocation)}),N=L.z.object({x:o.xLocation,y:o.yLocation}),y=Object.freeze({x:"left",y:"top"}),f=Object.freeze({x:"right",y:"top"}),x=Object.freeze({x:"left",y:"bottom"}),E=Object.freeze({x:"right",y:"bottom"}),O=Object.freeze({x:"center",y:"center"}),_=Object.freeze({x:"center",y:"top"}),a=Object.freeze({x:"center",y:"bottom"}),u=Object.freeze({x:"right",y:"center"}),l=Object.freeze({x:"left",y:"center"}),p=Object.freeze([l,u,_,a,y,f,x,E,O]),R=(t,n)=>t.x===n.x&&t.y===n.y,j=(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},I=t=>[t.x,t.y],T=t=>i(s(t))==="x",P=t=>i(s(t))==="y",X=t=>`${t.x}${S.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={...O};return e==="center"?T(c)?[r.x,r.y]=[c,e]:[r.x,r.y]=[e,c]:c==="center"?T(e)?[r.x,r.y]=[e,c]:[r.x,r.y]=[c,e]:T(e)?[r.x,r.y]=[e,c]:[r.x,r.y]=[c,e],r},w=Object.freeze(Object.defineProperty({__proto__:null,BOTTOM_CENTER:a,BOTTOM_LEFT:x,BOTTOM_RIGHT:E,CENTER:O,CENTER_LEFT:l,CENTER_LOCATIONS:o.CENTER_LOCATIONS,CENTER_RIGHT:u,TOP_CENTER:_,TOP_LEFT:y,TOP_RIGHT:f,XY_LOCATIONS:p,X_LOCATIONS:o.X_LOCATIONS,Y_LOCATIONS:o.Y_LOCATIONS,center:h,construct:s,constructXY:Y,corner:N,crude:A,direction:i,isX:T,isY:P,location:o.location,outer:o.outerLocation,rotate90:M,swap:b,x:z,xy:C,xyCouple:I,xyEquals:R,xyMatches:j,xyToString:X,y:g},Symbol.toStringTag,{value:"Module"}));exports.BOTTOM_CENTER=a;exports.BOTTOM_LEFT=x;exports.BOTTOM_RIGHT=E;exports.CENTER=O;exports.CENTER_LEFT=l;exports.CENTER_RIGHT=u;exports.TOP_CENTER=_;exports.TOP_LEFT=y;exports.TOP_RIGHT=f;exports.XY_LOCATIONS=p;exports.corner=N;exports.location=w;exports.swap=b;exports.xy=C;exports.xyCouple=I;exports.xyEquals=R;exports.xyMatches=j;
package/dist/location.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-CqQXXeCI.cjs");exports.location=o.location;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./location-DZi8ftXp.cjs");exports.location=o.location;
package/dist/location.js CHANGED
@@ -1,4 +1,4 @@
1
- import { l } from "./index-D6V-8SKw.js";
1
+ import { l } from "./location-Ar5y2DX2.js";
2
2
  export {
3
3
  l as location
4
4
  };
package/dist/observe.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var l=Object.defineProperty;var a=(r,e,s)=>e in r?l(r,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):r[e]=s;var t=(r,e,s)=>a(r,typeof e!="symbol"?e+"":e,s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class h{constructor(e,s){t(this,"handlers");t(this,"transform");t(this,"closer");this.transform=e,this.handlers=s??new Map}onChange(e){return this.handlers.set(e,null),()=>this.handlers.delete(e)}notify(e){let s=e;if(this.transform!=null){const[n,o]=this.transform(e);if(!o)return;s=n}this.handlers.forEach((n,o)=>o(s))}setCloser(e){this.closer=e}async close(){var e;return await((e=this.closer)==null?void 0:e.call(this))}}class i{constructor(e){t(this,"handlers");this.handlers=e??new Map}onChange(e){return this.handlers.set(e,null),()=>this.handlers.delete(e)}notify(e){this.handlers.forEach((s,n)=>n(e))}}const c=Object.freeze(Object.defineProperty({__proto__:null,BaseObserver:i,Observer:h},Symbol.toStringTag,{value:"Module"}));exports.observe=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class o{handlers;transform;closer;constructor(e,s){this.transform=e,this.handlers=s??new Map}onChange(e){return this.handlers.set(e,null),()=>this.handlers.delete(e)}notify(e){let s=e;if(this.transform!=null){const[r,t]=this.transform(e);if(!t)return;s=r}this.handlers.forEach((r,t)=>t(s))}setCloser(e){this.closer=e}async close(){return await this.closer?.()}}class l{handlers;constructor(e){this.handlers=e??new Map}onChange(e){return this.handlers.set(e,null),()=>this.handlers.delete(e)}notify(e){this.handlers.forEach((s,r)=>r(e))}}const a=Object.freeze(Object.defineProperty({__proto__:null,BaseObserver:l,Observer:o},Symbol.toStringTag,{value:"Module"}));exports.observe=a;
package/dist/observe.js CHANGED
@@ -1,11 +1,8 @@
1
- var o = Object.defineProperty;
2
- var a = (r, e, s) => e in r ? o(r, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : r[e] = s;
3
- var t = (r, e, s) => a(r, typeof e != "symbol" ? e + "" : e, s);
4
- class h {
1
+ class l {
2
+ handlers;
3
+ transform;
4
+ closer;
5
5
  constructor(e, s) {
6
- t(this, "handlers");
7
- t(this, "transform");
8
- t(this, "closer");
9
6
  this.transform = e, this.handlers = s ?? /* @__PURE__ */ new Map();
10
7
  }
11
8
  /** Implements the observable interface. */
@@ -16,37 +13,36 @@ class h {
16
13
  notify(e) {
17
14
  let s = e;
18
15
  if (this.transform != null) {
19
- const [n, l] = this.transform(e);
20
- if (!l) return;
21
- s = n;
16
+ const [r, t] = this.transform(e);
17
+ if (!t) return;
18
+ s = r;
22
19
  }
23
- this.handlers.forEach((n, l) => l(s));
20
+ this.handlers.forEach((r, t) => t(s));
24
21
  }
25
22
  setCloser(e) {
26
23
  this.closer = e;
27
24
  }
28
25
  async close() {
29
- var e;
30
- return await ((e = this.closer) == null ? void 0 : e.call(this));
26
+ return await this.closer?.();
31
27
  }
32
28
  }
33
- class i {
29
+ class o {
30
+ handlers;
34
31
  constructor(e) {
35
- t(this, "handlers");
36
32
  this.handlers = e ?? /* @__PURE__ */ new Map();
37
33
  }
38
34
  onChange(e) {
39
35
  return this.handlers.set(e, null), () => this.handlers.delete(e);
40
36
  }
41
37
  notify(e) {
42
- this.handlers.forEach((s, n) => n(e));
38
+ this.handlers.forEach((s, r) => r(e));
43
39
  }
44
40
  }
45
- const d = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
41
+ const a = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
46
42
  __proto__: null,
47
- BaseObserver: i,
48
- Observer: h
43
+ BaseObserver: o,
44
+ Observer: l
49
45
  }, Symbol.toStringTag, { value: "Module" }));
50
46
  export {
51
- d as observe
47
+ a as observe
52
48
  };
@@ -0,0 +1,101 @@
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
+ };
@@ -0,0 +1 @@
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;
@@ -0,0 +1 @@
1
+ "use strict";const c=require("./box-Cxki783Y.cjs"),T=require("./direction-386XDm2w.cjs"),s=require("./location-DZi8ftXp.cjs"),b=require("./base-BAM2mqCy.cjs"),P=t=>{if(t==null)return{x:void 0,y:void 0};const n=s.xy.safeParse(t);if(n.success)return n.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:n,dialog:e,initial:u,prefer:a,alignments:f=["start"],disable:x=[]})=>{const i=P(u);let l=s.XY_LOCATIONS;if(a!=null){const o=a.map(r=>P(r));l=l.slice().sort((r,p)=>{const d=o.findIndex(h=>s.xyMatches(r,h)),g=o.findIndex(h=>s.xyMatches(p,h));return d>-1&&g>-1?d-g:d>-1?-1:g>-1?1:0})}const O=l.filter(o=>!s.xyEquals(o,s.CENTER)&&(i.x==null||o.x===i.x)&&(i.y==null||o.y===i.y)&&!x.some(r=>s.xyMatches(o,r))).map(o=>f?.map(r=>[o,r])).flat(),A=c.construct(t),M=c.construct(n),_=c.construct(e);let E=-1/0;const y={location:s.CENTER,adjustedDialog:_};return O.forEach(([o,r])=>{const[p,d]=m({option:o,alignment:r,container:A,target:M,dialog:_});d>E&&(E=d,y.location=o,y.adjustedDialog=p)}),y},m=({option:t,alignment:n,container:e,target:u,dialog:a})=>{const f=L(t,n),x=c.xyLoc(u,t),i=c.constructWithAlternateRoot(x.x,x.y,c.width(a),c.height(a),f,s.TOP_LEFT),l=c.area(c.intersection(i,e));return[i,l]},v={start:"left",center:"center",end:"right"},I={start:"bottom",center:"center",end:"top"},L=(t,n)=>{const e={x:"center",y:"center"};if(t.y!=="center"){e.y=s.swap(t.y);const u=t.x==="left"?s.swap:a=>a;e.x=u(v[n])}else e.x=s.swap(t.x),e.y=I[n];return e},j=Object.freeze(Object.defineProperty({__proto__:null,dialog:N,getRoot:L,parseLocationOptions:P},Symbol.toStringTag,{value:"Module"}));exports.position=j;
@@ -0,0 +1,85 @@
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-CO_2_DGG.js";
2
+ import { c as w } from "./direction-8etxfKaR.js";
3
+ import { x as B, X as C, a as m, b as R, C as O, s as h, T as S } from "./location-Ar5y2DX2.js";
4
+ import { l as Y } from "./base-DFq0vvGn.js";
5
+ const P = (t) => {
6
+ if (t == null) return { x: void 0, y: void 0 };
7
+ const o = B.safeParse(t);
8
+ if (o.success) return o.data;
9
+ const e = Y.safeParse(t);
10
+ return e.success ? w(e.data) === "x" ? { x: e.data, y: void 0 } : { x: void 0, y: e.data } : t;
11
+ }, D = ({
12
+ container: t,
13
+ target: o,
14
+ dialog: e,
15
+ initial: c,
16
+ prefer: r,
17
+ alignments: u = ["start"],
18
+ disable: l = []
19
+ }) => {
20
+ const n = P(c);
21
+ let d = C;
22
+ if (r != null) {
23
+ const s = r.map((a) => P(a));
24
+ d = d.slice().sort((a, x) => {
25
+ const i = s.findIndex((y) => m(a, y)), p = s.findIndex((y) => m(x, y));
26
+ return i > -1 && p > -1 ? i - p : i > -1 ? -1 : p > -1 ? 1 : 0;
27
+ });
28
+ }
29
+ const T = d.filter(
30
+ (s) => !R(s, O) && (n.x == null || s.x === n.x) && (n.y == null || s.y === n.y) && !l.some((a) => m(s, a))
31
+ ).map((s) => u?.map((a) => [s, a])).flat(), E = g(t), b = g(o), _ = g(e);
32
+ let L = -1 / 0;
33
+ const f = { location: O, adjustedDialog: _ };
34
+ return T.forEach(([s, a]) => {
35
+ const [x, i] = G({
36
+ option: s,
37
+ alignment: a,
38
+ container: E,
39
+ target: b,
40
+ dialog: _
41
+ });
42
+ i > L && (L = i, f.location = s, f.adjustedDialog = x);
43
+ }), f;
44
+ }, G = ({
45
+ option: t,
46
+ alignment: o,
47
+ container: e,
48
+ target: c,
49
+ dialog: r
50
+ }) => {
51
+ const u = A(t, o), l = v(c, t), n = I(
52
+ l.x,
53
+ l.y,
54
+ N(r),
55
+ M(r),
56
+ u,
57
+ S
58
+ ), d = X(j(n, e));
59
+ return [n, d];
60
+ }, $ = {
61
+ start: "left",
62
+ center: "center",
63
+ end: "right"
64
+ }, q = {
65
+ start: "bottom",
66
+ center: "center",
67
+ end: "top"
68
+ }, A = (t, o) => {
69
+ const e = { x: "center", y: "center" };
70
+ if (t.y !== "center") {
71
+ e.y = h(t.y);
72
+ const c = t.x === "left" ? h : (r) => r;
73
+ e.x = c($[o]);
74
+ } else
75
+ e.x = h(t.x), e.y = q[o];
76
+ return e;
77
+ }, H = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
78
+ __proto__: null,
79
+ dialog: D,
80
+ getRoot: A,
81
+ parseLocationOptions: P
82
+ }, Symbol.toStringTag, { value: "Module" }));
83
+ export {
84
+ H as p
85
+ };
package/dist/position.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index-BMGaoK93.cjs"),T=require("./index-B58dnYRu.cjs"),r=require("./index-CqQXXeCI.cjs"),A=require("./base-CTq-lhpU.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=A.location.safeParse(t);return e.success?T.construct(e.data)==="x"?{x:e.data,y:void 0}:{x:void 0,y:e.data}:t},v=({container:t,target:s,dialog:e,initial:u,prefer:a,alignments:l=["start"],disable:x=[]})=>{const i=P(u);let f=r.XY_LOCATIONS;if(a!=null){const o=a.map(n=>P(n));f=f.slice().sort((n,p)=>{const d=o.findIndex(h=>r.xyMatches(n,h)),g=o.findIndex(h=>r.xyMatches(p,h));return d>-1&&g>-1?d-g:d>-1?-1:g>-1?1:0})}const E=f.filter(o=>!r.xyEquals(o,r.CENTER)&&(i.x==null||o.x===i.x)&&(i.y==null||o.y===i.y)&&!x.some(n=>r.xyMatches(o,n))).map(o=>l==null?void 0:l.map(n=>[o,n])).flat(),L=c.construct(t),M=c.construct(s),O=c.construct(e);let _=-1/0;const y={location:r.CENTER,adjustedDialog:O};return E.forEach(([o,n])=>{const[p,d]=N({option:o,alignment:n,container:L,target:M,dialog:O});d>_&&(_=d,y.location=o,y.adjustedDialog=p)}),y},N=({option:t,alignment:s,container:e,target:u,dialog:a})=>{const l=b(t,s),x=c.xyLoc(u,t),i=c.constructWithAlternateRoot(x.x,x.y,c.width(a),c.height(a),l,r.TOP_LEFT),f=c.area(c.intersection(i,e));return[i,f]},j={start:"left",center:"center",end:"right"},I={start:"bottom",center:"center",end:"top"},b=(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(j[s])}else e.x=r.swap(t.x),e.y=I[s];return e},q=Object.freeze(Object.defineProperty({__proto__:null,dialog:v,getRoot:b,parseLocationOptions:P},Symbol.toStringTag,{value:"Module"}));exports.position=q;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./position-DSy2hONH.cjs");exports.position=o.position;
package/dist/position.js CHANGED
@@ -1,85 +1,4 @@
1
- import { c as h, x as v, a as I, h as M, w as N, d as X, i as b } from "./index-ClrGyGDp.js";
2
- import { c as w } from "./index-DxU1zwsd.js";
3
- import { h as B, X as R, i as g, x as S, j as O, s as m, T as Y } from "./index-D6V-8SKw.js";
4
- import { l as C } from "./base-B5lQIJKc.js";
5
- const P = (t) => {
6
- if (t == null) return { x: void 0, y: void 0 };
7
- const s = B.safeParse(t);
8
- if (s.success) return s.data;
9
- const o = C.safeParse(t);
10
- return o.success ? w(o.data) === "x" ? { x: o.data, y: void 0 } : { x: void 0, y: o.data } : t;
11
- }, D = ({
12
- container: t,
13
- target: s,
14
- dialog: o,
15
- initial: c,
16
- prefer: a,
17
- alignments: d = ["start"],
18
- disable: f = []
19
- }) => {
20
- const n = P(c);
21
- let u = R;
22
- if (a != null) {
23
- const e = a.map((r) => P(r));
24
- u = u.slice().sort((r, x) => {
25
- const i = e.findIndex((y) => g(r, y)), p = e.findIndex((y) => g(x, y));
26
- return i > -1 && p > -1 ? i - p : i > -1 ? -1 : p > -1 ? 1 : 0;
27
- });
28
- }
29
- const T = u.filter(
30
- (e) => !S(e, O) && (n.x == null || e.x === n.x) && (n.y == null || e.y === n.y) && !f.some((r) => g(e, r))
31
- ).map((e) => d == null ? void 0 : d.map((r) => [e, r])).flat(), E = h(t), j = h(s), _ = h(o);
32
- let L = -1 / 0;
33
- const l = { location: O, adjustedDialog: _ };
34
- return T.forEach(([e, r]) => {
35
- const [x, i] = G({
36
- option: e,
37
- alignment: r,
38
- container: E,
39
- target: j,
40
- dialog: _
41
- });
42
- i > L && (L = i, l.location = e, l.adjustedDialog = x);
43
- }), l;
44
- }, G = ({
45
- option: t,
46
- alignment: s,
47
- container: o,
48
- target: c,
49
- dialog: a
50
- }) => {
51
- const d = A(t, s), f = v(c, t), n = I(
52
- f.x,
53
- f.y,
54
- N(a),
55
- M(a),
56
- d,
57
- Y
58
- ), u = X(b(n, o));
59
- return [n, u];
60
- }, $ = {
61
- start: "left",
62
- center: "center",
63
- end: "right"
64
- }, q = {
65
- start: "bottom",
66
- center: "center",
67
- end: "top"
68
- }, A = (t, s) => {
69
- const o = { x: "center", y: "center" };
70
- if (t.y !== "center") {
71
- o.y = m(t.y);
72
- const c = t.x === "left" ? m : (a) => a;
73
- o.x = c($[s]);
74
- } else
75
- o.x = m(t.x), o.y = q[s];
76
- return o;
77
- }, H = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
78
- __proto__: null,
79
- dialog: D,
80
- getRoot: A,
81
- parseLocationOptions: P
82
- }, Symbol.toStringTag, { value: "Module" }));
1
+ import { p as i } from "./position-PQ6op54I.js";
83
2
  export {
84
- H as position
3
+ i as position
85
4
  };
@@ -0,0 +1,14 @@
1
+ import { z as e } from "zod";
2
+ const i = e.record(
3
+ e.union([e.number(), e.string(), e.symbol()]),
4
+ e.unknown()
5
+ ), r = (n) => Object.entries(n), s = (n, t) => Object.fromEntries(r(n).map(([o, c]) => [o, t(c, o)])), m = (n) => Object.fromEntries(r(n).filter(([t, o]) => o !== void 0)), u = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
6
+ __proto__: null,
7
+ entries: r,
8
+ map: s,
9
+ purgeUndefined: m,
10
+ unknownZ: i
11
+ }, Symbol.toStringTag, { value: "Module" }));
12
+ export {
13
+ u as r
14
+ };
@@ -0,0 +1 @@
1
+ "use strict";const e=require("zod"),s=e.z.record(e.z.union([e.z.number(),e.z.string(),e.z.symbol()]),e.z.unknown()),t=n=>Object.entries(n),i=(n,o)=>Object.fromEntries(t(n).map(([r,c])=>[r,o(c,r)])),u=n=>Object.fromEntries(t(n).filter(([o,r])=>r!==void 0)),b=Object.freeze(Object.defineProperty({__proto__:null,entries:t,map:i,purgeUndefined:u,unknownZ:s},Symbol.toStringTag,{value:"Module"}));exports.record=b;
package/dist/record.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./schemas-DbXuI2Qr.cjs"),c=e.record(e.union([e.number(),e.string(),e.symbol()]),e.unknown()),o=n=>Object.entries(n),u=(n,r)=>Object.fromEntries(o(n).map(([t,s])=>[t,r(s,t)]));exports.getEntries=o;exports.mapValues=u;exports.unknownRecordZ=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./record-YvCh7bzB.cjs");exports.record=e.record;
package/dist/record.js CHANGED
@@ -1,10 +1,4 @@
1
- import { r as t, c as e, u as a, n as c, s as m, d as i } from "./schemas-55Usj0Fg.js";
2
- const p = t(
3
- a([c(), m(), i()]),
4
- e()
5
- ), u = (n) => Object.entries(n), d = (n, o) => Object.fromEntries(u(n).map(([s, r]) => [s, o(r, s)]));
1
+ import { r as e } from "./record-CAcQ5PNX.js";
6
2
  export {
7
- u as getEntries,
8
- d as mapValues,
9
- p as unknownRecordZ
3
+ e as record
10
4
  };
package/dist/runtime.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./schemas-DbXuI2Qr.cjs"),t=()=>typeof process<"u"&&process.versions!=null&&process.versions.node!=null?"node":typeof window>"u"||window.document===void 0?"webworker":"browser",u=t(),i=["macOS","Windows","Linux"],c=["macos","windows","linux"],d={macos:"macOS",windows:"Windows",linux:"Linux"},l=r._enum(i).or(r._enum(c).transform(e=>d[e])),f=()=>{if(typeof window>"u")return;const e=window.navigator.userAgent.toLowerCase();if(e.includes("mac"))return"macOS";if(e.includes("win"))return"Windows";if(e.includes("linux"))return"Linux"};let n;const w=(e={})=>{const{force:o,default:s}=e;return o??n??(n=f(),n??s)},a=Object.freeze(Object.defineProperty({__proto__:null,OPERATING_SYSTEMS:i,RUNTIME:u,detect:t,getOS:w,osZ:l},Symbol.toStringTag,{value:"Module"}));exports.runtime=a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./external-uXk0Avrg.cjs");exports.runtime=e.external;
package/dist/runtime.js CHANGED
@@ -1,29 +1,4 @@
1
- import { _ as r } from "./schemas-55Usj0Fg.js";
2
- const t = () => typeof process < "u" && process.versions != null && process.versions.node != null ? "node" : typeof window > "u" || window.document === void 0 ? "webworker" : "browser", u = t(), i = ["macOS", "Windows", "Linux"], d = ["macos", "windows", "linux"], c = {
3
- macos: "macOS",
4
- windows: "Windows",
5
- linux: "Linux"
6
- }, l = r(i).or(
7
- r(d).transform((n) => c[n])
8
- ), f = () => {
9
- if (typeof window > "u") return;
10
- const n = window.navigator.userAgent.toLowerCase();
11
- if (n.includes("mac")) return "macOS";
12
- if (n.includes("win")) return "Windows";
13
- if (n.includes("linux")) return "Linux";
14
- };
15
- let e;
16
- const w = (n = {}) => {
17
- const { force: o, default: s } = n;
18
- return o ?? e ?? (e = f(), e ?? s);
19
- }, S = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
20
- __proto__: null,
21
- OPERATING_SYSTEMS: i,
22
- RUNTIME: u,
23
- detect: t,
24
- getOS: w,
25
- osZ: l
26
- }, Symbol.toStringTag, { value: "Module" }));
1
+ import { e as m } from "./external-BPgtxa8d.js";
27
2
  export {
28
- S as runtime
3
+ m as runtime
29
4
  };
@@ -0,0 +1 @@
1
+ "use strict";const l=require("zod"),y=require("./bounds-D6e9xoHt.cjs"),u=require("./box-Cxki783Y.cjs"),m=require("./location-DZi8ftXp.cjs"),h=require("./xy-CUE3QDNn.cjs"),f=(n,t,e)=>t!==void 0&&n<t?t:e!==void 0&&n>e?e:n,B=l.z.object({offset:h.crudeZ,scale:h.crudeZ}),g=l.z.object({offset:l.z.number(),scale:l.z.number()}),v=n=>(t,e,s,r)=>e==="dimension"?[t,s]:[t,r?s-n:s+n],R=n=>(t,e,s,r)=>[t,r?s/n:s*n],T=n=>(t,e,s)=>{if(t===null)return[n,s];const{lower:r,upper:o}=t,{lower:a,upper:p}=n,x=o-r,d=p-a;if(e==="dimension")return[n,s*(d/x)];const w=(s-r)*(d/x)+a;return[n,w]},q=n=>(t,e,s)=>[n,s],z=()=>(n,t,e)=>{if(n===null)throw new Error("cannot invert without bounds");if(t==="dimension")return[n,e];const{lower:s,upper:r}=n;return[n,r-(e-s)]},E=n=>(t,e,s)=>{const{lower:r,upper:o}=n;return s=f(s,r,o),[t,s]};class i{ops=[];currBounds=null;currType=null;reversed=!1;constructor(){this.ops=[]}static translate(t){return new i().translate(t)}static magnify(t){return new i().magnify(t)}static scale(t,e){return new i().scale(t,e)}translate(t){const e=this.new(),s=v(t);return s.type="translate",e.ops.push(s),e}magnify(t){const e=this.new(),s=R(t);return s.type="magnify",e.ops.push(s),e}scale(t,e){const s=y.construct(t,e),r=this.new(),o=T(s);return o.type="scale",r.ops.push(o),r}clamp(t,e){const s=y.construct(t,e),r=this.new(),o=E(s);return o.type="clamp",r.ops.push(o),r}reBound(t,e){const s=y.construct(t,e),r=this.new(),o=q(s);return o.type="re-bound",r.ops.push(o),r}invert(){const t=z();t.type="invert";const e=this.new();return e.ops.push(t),e}pos(t){return this.exec("position",t)}dim(t){return this.exec("dimension",t)}new(){const t=new i;return t.ops=this.ops.slice(),t.reversed=this.reversed,t}exec(t,e){return this.currBounds=null,this.ops.reduce(([s,r],o)=>o(s,t,r,this.reversed),[null,e])[1]}reverse(){const t=this.new();t.ops.reverse();const e=[];return t.ops.forEach((s,r)=>{if(s.type==="scale"||e.some(([a,p])=>r>=a&&r<=p))return;const o=t.ops.findIndex((a,p)=>a.type==="scale"&&p>r);o!==-1&&e.push([r,o])}),e.forEach(([s,r])=>{const o=t.ops.slice(s,r);o.unshift(t.ops[r]),t.ops.splice(s,r-s+1,...o)}),t.reversed=!t.reversed,t}get transform(){return{scale:this.dim(1),offset:this.pos(0)}}static IDENTITY=new i}class c{x;y;currRoot;constructor(t=new i,e=new i,s=null){this.x=t,this.y=e,this.currRoot=s}static translate(t,e){return new c().translate(t,e)}static translateX(t){return new c().translateX(t)}static translateY(t){return new c().translateY(t)}static clamp(t){return new c().clamp(t)}static magnify(t){return new c().magnify(t)}static scale(t){return new c().scale(t)}static reBound(t){return new c().reBound(t)}translate(t,e){const s=h.construct(t,e),r=this.copy();return r.x=this.x.translate(s.x),r.y=this.y.translate(s.y),r}translateX(t){const e=this.copy();return e.x=this.x.translate(t),e}translateY(t){const e=this.copy();return e.y=this.y.translate(t),e}magnify(t){const e=this.copy();return e.x=this.x.magnify(t.x),e.y=this.y.magnify(t.y),e}scale(t){const e=this.copy();if(u.isBox(t)){const s=this.currRoot;return e.currRoot=t.root,s!=null&&!m.xyEquals(s,t.root)&&(s.x!==t.root.x&&(e.x=e.x.invert()),s.y!==t.root.y&&(e.y=e.y.invert())),e.x=e.x.scale(u.xBounds(t)),e.y=e.y.scale(u.yBounds(t)),e}return e.x=e.x.scale(t.width),e.y=e.y.scale(t.height),e}reBound(t){const e=this.copy();return e.x=this.x.reBound(u.xBounds(t)),e.y=this.y.reBound(u.yBounds(t)),e}clamp(t){const e=this.copy();return e.x=this.x.clamp(u.xBounds(t)),e.y=this.y.clamp(u.yBounds(t)),e}copy(){const t=new c;return t.currRoot=this.currRoot,t.x=this.x,t.y=this.y,t}reverse(){const t=this.copy();return t.x=this.x.reverse(),t.y=this.y.reverse(),t}pos(t){return{x:this.x.pos(t.x),y:this.y.pos(t.y)}}dim(t){return{x:this.x.dim(t.x),y:this.y.dim(t.y)}}box(t){return u.construct(this.pos(t.one),this.pos(t.two),0,0,this.currRoot??t.root)}get transform(){return{scale:this.dim({x:1,y:1}),offset:this.pos({x:0,y:0})}}static IDENTITY=new c}const I=Object.freeze(Object.defineProperty({__proto__:null,Scale:i,XY:c,crudeXYTransform:B,transform:g},Symbol.toStringTag,{value:"Module"}));exports.clamp=f;exports.scale=I;