@performant-software/visualize 3.1.0-beta.2 → 3.1.0-beta.3

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 (362) hide show
  1. package/dist/index.cjs189.js +1 -1
  2. package/dist/index.cjs189.js.map +1 -1
  3. package/dist/index.cjs190.js +1 -1
  4. package/dist/index.cjs190.js.map +1 -1
  5. package/dist/index.cjs191.js +1 -1
  6. package/dist/index.cjs191.js.map +1 -1
  7. package/dist/index.cjs192.js +1 -2
  8. package/dist/index.cjs192.js.map +1 -1
  9. package/dist/index.cjs193.js +1 -1
  10. package/dist/index.cjs193.js.map +1 -1
  11. package/dist/index.cjs194.js +2 -1
  12. package/dist/index.cjs194.js.map +1 -1
  13. package/dist/index.cjs195.js +1 -1
  14. package/dist/index.cjs195.js.map +1 -1
  15. package/dist/index.cjs196.js +3 -1
  16. package/dist/index.cjs196.js.map +1 -1
  17. package/dist/index.cjs197.js +1 -1
  18. package/dist/index.cjs197.js.map +1 -1
  19. package/dist/index.cjs198.js +1 -5
  20. package/dist/index.cjs198.js.map +1 -1
  21. package/dist/index.cjs199.js +1 -1
  22. package/dist/index.cjs199.js.map +1 -1
  23. package/dist/index.cjs2.js.map +1 -1
  24. package/dist/index.cjs200.js +1 -3
  25. package/dist/index.cjs200.js.map +1 -1
  26. package/dist/index.cjs201.js +1 -1
  27. package/dist/index.cjs201.js.map +1 -1
  28. package/dist/index.cjs202.js +1 -1
  29. package/dist/index.cjs202.js.map +1 -1
  30. package/dist/index.cjs203.js +5 -1
  31. package/dist/index.cjs203.js.map +1 -1
  32. package/dist/index.cjs204.js +1 -1
  33. package/dist/index.cjs204.js.map +1 -1
  34. package/dist/index.cjs218.js +1 -1
  35. package/dist/index.cjs219.js +1 -1
  36. package/dist/index.cjs220.js +1 -1
  37. package/dist/index.cjs238.js +1 -1
  38. package/dist/index.cjs244.js +1 -1
  39. package/dist/index.cjs245.js +1 -1
  40. package/dist/index.cjs250.js +1 -1
  41. package/dist/index.cjs250.js.map +1 -1
  42. package/dist/index.cjs251.js +1 -1
  43. package/dist/index.cjs251.js.map +1 -1
  44. package/dist/index.cjs252.js +1 -1
  45. package/dist/index.cjs252.js.map +1 -1
  46. package/dist/index.cjs253.js +1 -1
  47. package/dist/index.cjs253.js.map +1 -1
  48. package/dist/index.cjs254.js +1 -1
  49. package/dist/index.cjs254.js.map +1 -1
  50. package/dist/index.cjs255.js +2 -1
  51. package/dist/index.cjs255.js.map +1 -1
  52. package/dist/index.cjs256.js +1 -1
  53. package/dist/index.cjs256.js.map +1 -1
  54. package/dist/index.cjs257.js +1 -1
  55. package/dist/index.cjs257.js.map +1 -1
  56. package/dist/index.cjs258.js +1 -2
  57. package/dist/index.cjs258.js.map +1 -1
  58. package/dist/index.cjs259.js +1 -1
  59. package/dist/index.cjs261.js +1 -1
  60. package/dist/index.cjs268.js +1 -1
  61. package/dist/index.cjs268.js.map +1 -1
  62. package/dist/index.cjs269.js +1 -1
  63. package/dist/index.cjs269.js.map +1 -1
  64. package/dist/index.cjs270.js +1 -1
  65. package/dist/index.cjs270.js.map +1 -1
  66. package/dist/index.cjs271.js +1 -1
  67. package/dist/index.cjs271.js.map +1 -1
  68. package/dist/index.cjs272.js +1 -1
  69. package/dist/index.cjs272.js.map +1 -1
  70. package/dist/index.cjs273.js +1 -1
  71. package/dist/index.cjs273.js.map +1 -1
  72. package/dist/index.cjs274.js +1 -1
  73. package/dist/index.cjs274.js.map +1 -1
  74. package/dist/index.cjs275.js +1 -1
  75. package/dist/index.cjs275.js.map +1 -1
  76. package/dist/index.cjs276.js +1 -1
  77. package/dist/index.cjs276.js.map +1 -1
  78. package/dist/index.cjs277.js +1 -1
  79. package/dist/index.cjs277.js.map +1 -1
  80. package/dist/index.cjs278.js +1 -1
  81. package/dist/index.cjs278.js.map +1 -1
  82. package/dist/index.cjs279.js +1 -1
  83. package/dist/index.cjs279.js.map +1 -1
  84. package/dist/index.cjs280.js +1 -1
  85. package/dist/index.cjs280.js.map +1 -1
  86. package/dist/index.cjs281.js +1 -1
  87. package/dist/index.cjs281.js.map +1 -1
  88. package/dist/index.cjs282.js +1 -1
  89. package/dist/index.cjs282.js.map +1 -1
  90. package/dist/index.cjs283.js +1 -1
  91. package/dist/index.cjs283.js.map +1 -1
  92. package/dist/index.cjs284.js +1 -1
  93. package/dist/index.cjs284.js.map +1 -1
  94. package/dist/index.cjs285.js +1 -1
  95. package/dist/index.cjs285.js.map +1 -1
  96. package/dist/index.cjs286.js +1 -1
  97. package/dist/index.cjs286.js.map +1 -1
  98. package/dist/index.cjs287.js +1 -1
  99. package/dist/index.cjs287.js.map +1 -1
  100. package/dist/index.cjs288.js +1 -1
  101. package/dist/index.cjs288.js.map +1 -1
  102. package/dist/index.cjs289.js +1 -1
  103. package/dist/index.cjs289.js.map +1 -1
  104. package/dist/index.cjs290.js +1 -1
  105. package/dist/index.cjs290.js.map +1 -1
  106. package/dist/index.cjs291.js +1 -1
  107. package/dist/index.cjs291.js.map +1 -1
  108. package/dist/index.cjs292.js +1 -1
  109. package/dist/index.cjs293.js +1 -1
  110. package/dist/index.cjs295.js +1 -1
  111. package/dist/index.cjs296.js +1 -1
  112. package/dist/index.cjs3.js.map +1 -1
  113. package/dist/index.cjs34.js +1 -1
  114. package/dist/index.cjs35.js +1 -1
  115. package/dist/index.cjs36.js +1 -1
  116. package/dist/index.cjs39.js +1 -1
  117. package/dist/index.cjs40.js +1 -1
  118. package/dist/index.cjs41.js +1 -1
  119. package/dist/index.cjs42.js +1 -1
  120. package/dist/index.cjs43.js +1 -1
  121. package/dist/index.cjs44.js +1 -1
  122. package/dist/index.cjs45.js +1 -1
  123. package/dist/index.cjs46.js +1 -1
  124. package/dist/index.cjs47.js +1 -1
  125. package/dist/index.cjs48.js +1 -1
  126. package/dist/index.cjs49.js +1 -1
  127. package/dist/index.cjs50.js +1 -1
  128. package/dist/index.cjs51.js.map +1 -1
  129. package/dist/index.cjs53.js +1 -1
  130. package/dist/index.cjs54.js +1 -1
  131. package/dist/index.cjs59.js +1 -1
  132. package/dist/index.cjs59.js.map +1 -1
  133. package/dist/index.cjs63.js +1 -1
  134. package/dist/index.cjs63.js.map +1 -1
  135. package/dist/index.cjs64.js +1 -1
  136. package/dist/index.cjs64.js.map +1 -1
  137. package/dist/index.cjs65.js +1 -1
  138. package/dist/index.cjs65.js.map +1 -1
  139. package/dist/index.cjs66.js +1 -1
  140. package/dist/index.cjs66.js.map +1 -1
  141. package/dist/index.cjs67.js +1 -1
  142. package/dist/index.cjs67.js.map +1 -1
  143. package/dist/index.cjs68.js +1 -1
  144. package/dist/index.cjs68.js.map +1 -1
  145. package/dist/index.cjs69.js +1 -1
  146. package/dist/index.cjs69.js.map +1 -1
  147. package/dist/index.cjs70.js +1 -1
  148. package/dist/index.cjs70.js.map +1 -1
  149. package/dist/index.cjs71.js +1 -1
  150. package/dist/index.cjs71.js.map +1 -1
  151. package/dist/index.cjs72.js +1 -1
  152. package/dist/index.cjs72.js.map +1 -1
  153. package/dist/index.cjs73.js +1 -1
  154. package/dist/index.cjs73.js.map +1 -1
  155. package/dist/index.cjs74.js +1 -1
  156. package/dist/index.cjs74.js.map +1 -1
  157. package/dist/index.cjs75.js +1 -1
  158. package/dist/index.cjs75.js.map +1 -1
  159. package/dist/index.cjs76.js +1 -1
  160. package/dist/index.cjs76.js.map +1 -1
  161. package/dist/index.cjs77.js +1 -1
  162. package/dist/index.cjs77.js.map +1 -1
  163. package/dist/index.cjs78.js +1 -1
  164. package/dist/index.cjs78.js.map +1 -1
  165. package/dist/index.cjs79.js +1 -1
  166. package/dist/index.cjs79.js.map +1 -1
  167. package/dist/index.cjs8.js +1 -1
  168. package/dist/index.cjs80.js +1 -1
  169. package/dist/index.cjs80.js.map +1 -1
  170. package/dist/index.cjs81.js +1 -1
  171. package/dist/index.cjs81.js.map +1 -1
  172. package/dist/index.cjs82.js +1 -1
  173. package/dist/index.cjs82.js.map +1 -1
  174. package/dist/index.cjs83.js +1 -1
  175. package/dist/index.cjs83.js.map +1 -1
  176. package/dist/index.es189.js +33 -14
  177. package/dist/index.es189.js.map +1 -1
  178. package/dist/index.es190.js +16 -2
  179. package/dist/index.es190.js.map +1 -1
  180. package/dist/index.es191.js +14 -7
  181. package/dist/index.es191.js.map +1 -1
  182. package/dist/index.es192.js +2 -327
  183. package/dist/index.es192.js.map +1 -1
  184. package/dist/index.es193.js +7 -49
  185. package/dist/index.es193.js.map +1 -1
  186. package/dist/index.es194.js +319 -50
  187. package/dist/index.es194.js.map +1 -1
  188. package/dist/index.es195.js +48 -9
  189. package/dist/index.es195.js.map +1 -1
  190. package/dist/index.es196.js +234 -9
  191. package/dist/index.es196.js.map +1 -1
  192. package/dist/index.es197.js +989 -22
  193. package/dist/index.es197.js.map +1 -1
  194. package/dist/index.es198.js +5 -39
  195. package/dist/index.es198.js.map +1 -1
  196. package/dist/index.es199.js +58 -2
  197. package/dist/index.es199.js.map +1 -1
  198. package/dist/index.es2.js.map +1 -1
  199. package/dist/index.es200.js +9 -234
  200. package/dist/index.es200.js.map +1 -1
  201. package/dist/index.es201.js +9 -991
  202. package/dist/index.es201.js.map +1 -1
  203. package/dist/index.es202.js +25 -5
  204. package/dist/index.es202.js.map +1 -1
  205. package/dist/index.es203.js +39 -33
  206. package/dist/index.es203.js.map +1 -1
  207. package/dist/index.es204.js +2 -16
  208. package/dist/index.es204.js.map +1 -1
  209. package/dist/index.es218.js +1 -1
  210. package/dist/index.es219.js +1 -1
  211. package/dist/index.es220.js +1 -1
  212. package/dist/index.es238.js +1 -1
  213. package/dist/index.es244.js +1 -1
  214. package/dist/index.es245.js +1 -1
  215. package/dist/index.es250.js +6 -8
  216. package/dist/index.es250.js.map +1 -1
  217. package/dist/index.es251.js +5 -11
  218. package/dist/index.es251.js.map +1 -1
  219. package/dist/index.es252.js +3 -12
  220. package/dist/index.es252.js.map +1 -1
  221. package/dist/index.es253.js +3 -6
  222. package/dist/index.es253.js.map +1 -1
  223. package/dist/index.es254.js +9 -5
  224. package/dist/index.es254.js.map +1 -1
  225. package/dist/index.es255.js +4 -3
  226. package/dist/index.es255.js.map +1 -1
  227. package/dist/index.es256.js +8 -3
  228. package/dist/index.es256.js.map +1 -1
  229. package/dist/index.es257.js +10 -8
  230. package/dist/index.es257.js.map +1 -1
  231. package/dist/index.es258.js +12 -4
  232. package/dist/index.es258.js.map +1 -1
  233. package/dist/index.es259.js +4 -4
  234. package/dist/index.es261.js +1 -1
  235. package/dist/index.es268.js +6 -3
  236. package/dist/index.es268.js.map +1 -1
  237. package/dist/index.es269.js +2 -6
  238. package/dist/index.es269.js.map +1 -1
  239. package/dist/index.es270.js +2 -8
  240. package/dist/index.es270.js.map +1 -1
  241. package/dist/index.es271.js +3 -6
  242. package/dist/index.es271.js.map +1 -1
  243. package/dist/index.es272.js +8 -2
  244. package/dist/index.es272.js.map +1 -1
  245. package/dist/index.es273.js +12 -2
  246. package/dist/index.es273.js.map +1 -1
  247. package/dist/index.es274.js +68 -9
  248. package/dist/index.es274.js.map +1 -1
  249. package/dist/index.es275.js +17 -12
  250. package/dist/index.es275.js.map +1 -1
  251. package/dist/index.es276.js +6 -13
  252. package/dist/index.es276.js.map +1 -1
  253. package/dist/index.es277.js +2 -10
  254. package/dist/index.es277.js.map +1 -1
  255. package/dist/index.es278.js +5 -12
  256. package/dist/index.es278.js.map +1 -1
  257. package/dist/index.es279.js +12 -67
  258. package/dist/index.es279.js.map +1 -1
  259. package/dist/index.es280.js +2 -18
  260. package/dist/index.es280.js.map +1 -1
  261. package/dist/index.es281.js +32 -6
  262. package/dist/index.es281.js.map +1 -1
  263. package/dist/index.es282.js +13 -2
  264. package/dist/index.es282.js.map +1 -1
  265. package/dist/index.es283.js +14 -5
  266. package/dist/index.es283.js.map +1 -1
  267. package/dist/index.es284.js +9 -12
  268. package/dist/index.es284.js.map +1 -1
  269. package/dist/index.es285.js +9 -2
  270. package/dist/index.es285.js.map +1 -1
  271. package/dist/index.es286.js +5 -32
  272. package/dist/index.es286.js.map +1 -1
  273. package/dist/index.es287.js +12 -9
  274. package/dist/index.es287.js.map +1 -1
  275. package/dist/index.es288.js +7 -19
  276. package/dist/index.es288.js.map +1 -1
  277. package/dist/index.es289.js +8 -10
  278. package/dist/index.es289.js.map +1 -1
  279. package/dist/index.es290.js +19 -12
  280. package/dist/index.es290.js.map +1 -1
  281. package/dist/index.es291.js +11 -7
  282. package/dist/index.es291.js.map +1 -1
  283. package/dist/index.es292.js +1 -1
  284. package/dist/index.es293.js +1 -1
  285. package/dist/index.es295.js +2 -2
  286. package/dist/index.es296.js +1 -1
  287. package/dist/index.es3.js.map +1 -1
  288. package/dist/index.es34.js +4 -4
  289. package/dist/index.es35.js +2 -2
  290. package/dist/index.es36.js +5 -5
  291. package/dist/index.es39.js +1 -1
  292. package/dist/index.es40.js +1 -1
  293. package/dist/index.es41.js +1 -1
  294. package/dist/index.es42.js +1 -1
  295. package/dist/index.es43.js +1 -1
  296. package/dist/index.es44.js +1 -1
  297. package/dist/index.es45.js +1 -1
  298. package/dist/index.es46.js +1 -1
  299. package/dist/index.es47.js +1 -1
  300. package/dist/index.es48.js +1 -1
  301. package/dist/index.es49.js +1 -1
  302. package/dist/index.es50.js +1 -1
  303. package/dist/index.es51.js +2 -2
  304. package/dist/index.es51.js.map +1 -1
  305. package/dist/index.es53.js +2 -2
  306. package/dist/index.es54.js +3 -3
  307. package/dist/index.es59.js +11 -10
  308. package/dist/index.es59.js.map +1 -1
  309. package/dist/index.es63.js +19 -8
  310. package/dist/index.es63.js.map +1 -1
  311. package/dist/index.es64.js +27 -4
  312. package/dist/index.es64.js.map +1 -1
  313. package/dist/index.es65.js +5 -13
  314. package/dist/index.es65.js.map +1 -1
  315. package/dist/index.es66.js +32 -5
  316. package/dist/index.es66.js.map +1 -1
  317. package/dist/index.es67.js +93 -13
  318. package/dist/index.es67.js.map +1 -1
  319. package/dist/index.es68.js +8 -9
  320. package/dist/index.es68.js.map +1 -1
  321. package/dist/index.es69.js +4 -5
  322. package/dist/index.es69.js.map +1 -1
  323. package/dist/index.es70.js +12 -9
  324. package/dist/index.es70.js.map +1 -1
  325. package/dist/index.es71.js +5 -7
  326. package/dist/index.es71.js.map +1 -1
  327. package/dist/index.es72.js +15 -5
  328. package/dist/index.es72.js.map +1 -1
  329. package/dist/index.es73.js +9 -32
  330. package/dist/index.es73.js.map +1 -1
  331. package/dist/index.es74.js +5 -94
  332. package/dist/index.es74.js.map +1 -1
  333. package/dist/index.es75.js +10 -5
  334. package/dist/index.es75.js.map +1 -1
  335. package/dist/index.es76.js +8 -5
  336. package/dist/index.es76.js.map +1 -1
  337. package/dist/index.es77.js +5 -29
  338. package/dist/index.es77.js.map +1 -1
  339. package/dist/index.es78.js +28 -39
  340. package/dist/index.es78.js.map +1 -1
  341. package/dist/index.es79.js +38 -35
  342. package/dist/index.es79.js.map +1 -1
  343. package/dist/index.es8.js +1 -1
  344. package/dist/index.es80.js +4 -22
  345. package/dist/index.es80.js.map +1 -1
  346. package/dist/index.es81.js +36 -82
  347. package/dist/index.es81.js.map +1 -1
  348. package/dist/index.es82.js +21 -18
  349. package/dist/index.es82.js.map +1 -1
  350. package/dist/index.es83.js +76 -21
  351. package/dist/index.es83.js.map +1 -1
  352. package/package.json +1 -1
  353. package/src/components/TreeGraph.js +1 -1
  354. package/src/hooks/Zoom.js +1 -1
  355. package/src/i18n/i18n.js +3 -3
  356. package/types/components/TreeGraph.js.flow +1 -1
  357. package/types/hooks/Zoom.js.flow +1 -1
  358. package/types/i18n/i18n.js.flow +3 -3
  359. package/build/index.js +0 -2
  360. package/build/index.js.map +0 -1
  361. package/build/main.css +0 -46
  362. package/index.js +0 -1
@@ -1,29 +1,996 @@
1
- import { __require as c } from "./index.es251.js";
2
- import { __require as u } from "./index.es195.js";
3
- import { __require as y } from "./index.es252.js";
4
- var e, n;
5
- function T() {
6
- if (n) return e;
7
- n = 1;
8
- var o = c(), t = u(), m = y(), s = NaN, b = /^[-+]0x[0-9a-f]+$/i, _ = /^0b[01]+$/i, q = /^0o[0-7]+$/i, a = parseInt;
9
- function p(r) {
10
- if (typeof r == "number")
11
- return r;
12
- if (m(r))
1
+ import { V as a, c as et } from "./index.es281.js";
2
+ function st(s, t) {
3
+ if (typeof s != "object" || s === null) return s;
4
+ var e = s[Symbol.toPrimitive];
5
+ if (e !== void 0) {
6
+ var i = e.call(s, t);
7
+ if (typeof i != "object") return i;
8
+ throw new TypeError("@@toPrimitive must return a primitive value.");
9
+ }
10
+ return (t === "string" ? String : Number)(s);
11
+ }
12
+ function it(s) {
13
+ var t = st(s, "string");
14
+ return typeof t == "symbol" ? t : String(t);
15
+ }
16
+ function f(s, t, e) {
17
+ return t = it(t), t in s ? Object.defineProperty(s, t, {
18
+ value: e,
19
+ enumerable: !0,
20
+ configurable: !0,
21
+ writable: !0
22
+ }) : s[t] = e, s;
23
+ }
24
+ function P(s, t) {
25
+ var e = Object.keys(s);
26
+ if (Object.getOwnPropertySymbols) {
27
+ var i = Object.getOwnPropertySymbols(s);
28
+ t && (i = i.filter(function(o) {
29
+ return Object.getOwnPropertyDescriptor(s, o).enumerable;
30
+ })), e.push.apply(e, i);
31
+ }
32
+ return e;
33
+ }
34
+ function h(s) {
35
+ for (var t = 1; t < arguments.length; t++) {
36
+ var e = arguments[t] != null ? arguments[t] : {};
37
+ t % 2 ? P(Object(e), !0).forEach(function(i) {
38
+ f(s, i, e[i]);
39
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(s, Object.getOwnPropertyDescriptors(e)) : P(Object(e)).forEach(function(i) {
40
+ Object.defineProperty(s, i, Object.getOwnPropertyDescriptor(e, i));
41
+ });
42
+ }
43
+ return s;
44
+ }
45
+ const j = {
46
+ pointer: {
47
+ start: "down",
48
+ change: "move",
49
+ end: "up"
50
+ },
51
+ mouse: {
52
+ start: "down",
53
+ change: "move",
54
+ end: "up"
55
+ },
56
+ touch: {
57
+ start: "start",
58
+ change: "move",
59
+ end: "end"
60
+ },
61
+ gesture: {
62
+ start: "start",
63
+ change: "change",
64
+ end: "end"
65
+ }
66
+ };
67
+ function M(s) {
68
+ return s ? s[0].toUpperCase() + s.slice(1) : "";
69
+ }
70
+ const ot = ["enter", "leave"];
71
+ function nt(s = !1, t) {
72
+ return s && !ot.includes(t);
73
+ }
74
+ function jt(s, t = "", e = !1) {
75
+ const i = j[s], o = i && i[t] || t;
76
+ return "on" + M(s) + M(o) + (nt(e, o) ? "Capture" : "");
77
+ }
78
+ const rt = ["gotpointercapture", "lostpointercapture"];
79
+ function Ht(s) {
80
+ let t = s.substring(2).toLowerCase();
81
+ const e = !!~t.indexOf("passive");
82
+ e && (t = t.replace("passive", ""));
83
+ const i = rt.includes(t) ? "capturecapture" : "capture", o = !!~t.indexOf(i);
84
+ return o && (t = t.replace("capture", "")), {
85
+ device: t,
86
+ capture: o,
87
+ passive: e
88
+ };
89
+ }
90
+ function Xt(s, t = "") {
91
+ const e = j[s], i = e && e[t] || t;
92
+ return s + i;
93
+ }
94
+ function C(s) {
95
+ return "touches" in s;
96
+ }
97
+ function H(s) {
98
+ return C(s) ? "touch" : "pointerType" in s ? s.pointerType : "mouse";
99
+ }
100
+ function at(s) {
101
+ return Array.from(s.touches).filter((t) => {
102
+ var e, i;
103
+ return t.target === s.currentTarget || ((e = s.currentTarget) === null || e === void 0 || (i = e.contains) === null || i === void 0 ? void 0 : i.call(e, t.target));
104
+ });
105
+ }
106
+ function ct(s) {
107
+ return s.type === "touchend" || s.type === "touchcancel" ? s.changedTouches : s.targetTouches;
108
+ }
109
+ function X(s) {
110
+ return C(s) ? ct(s)[0] : s;
111
+ }
112
+ function x(s, t) {
113
+ try {
114
+ const e = t.clientX - s.clientX, i = t.clientY - s.clientY, o = (t.clientX + s.clientX) / 2, n = (t.clientY + s.clientY) / 2, r = Math.hypot(e, i);
115
+ return {
116
+ angle: -(Math.atan2(e, i) * 180) / Math.PI,
117
+ distance: r,
118
+ origin: [o, n]
119
+ };
120
+ } catch {
121
+ }
122
+ return null;
123
+ }
124
+ function Wt(s) {
125
+ return at(s).map((t) => t.identifier);
126
+ }
127
+ function L(s, t) {
128
+ const [e, i] = Array.from(s.touches).filter((o) => t.includes(o.identifier));
129
+ return x(e, i);
130
+ }
131
+ function k(s) {
132
+ const t = X(s);
133
+ return C(s) ? t.identifier : t.pointerId;
134
+ }
135
+ function _(s) {
136
+ const t = X(s);
137
+ return [t.clientX, t.clientY];
138
+ }
139
+ const N = 40, V = 800;
140
+ function W(s) {
141
+ let {
142
+ deltaX: t,
143
+ deltaY: e,
144
+ deltaMode: i
145
+ } = s;
146
+ return i === 1 ? (t *= N, e *= N) : i === 2 && (t *= V, e *= V), [t, e];
147
+ }
148
+ function ht(s) {
149
+ var t, e;
150
+ const {
151
+ scrollX: i,
152
+ scrollY: o,
153
+ scrollLeft: n,
154
+ scrollTop: r
155
+ } = s.currentTarget;
156
+ return [(t = i ?? n) !== null && t !== void 0 ? t : 0, (e = o ?? r) !== null && e !== void 0 ? e : 0];
157
+ }
158
+ function ut(s) {
159
+ const t = {};
160
+ if ("buttons" in s && (t.buttons = s.buttons), "shiftKey" in s) {
161
+ const {
162
+ shiftKey: e,
163
+ altKey: i,
164
+ metaKey: o,
165
+ ctrlKey: n
166
+ } = s;
167
+ Object.assign(t, {
168
+ shiftKey: e,
169
+ altKey: i,
170
+ metaKey: o,
171
+ ctrlKey: n
172
+ });
173
+ }
174
+ return t;
175
+ }
176
+ function I(s, ...t) {
177
+ return typeof s == "function" ? s(...t) : s;
178
+ }
179
+ function lt() {
180
+ }
181
+ function zt(...s) {
182
+ return s.length === 0 ? lt : s.length === 1 ? s[0] : function() {
183
+ let t;
184
+ for (const e of s)
185
+ t = e.apply(this, arguments) || t;
186
+ return t;
187
+ };
188
+ }
189
+ function K(s, t) {
190
+ return Object.assign({}, t, s || {});
191
+ }
192
+ const ft = 32;
193
+ class z {
194
+ constructor(t, e, i) {
195
+ this.ctrl = t, this.args = e, this.key = i, this.state || (this.state = {}, this.computeValues([0, 0]), this.computeInitial(), this.init && this.init(), this.reset());
196
+ }
197
+ get state() {
198
+ return this.ctrl.state[this.key];
199
+ }
200
+ set state(t) {
201
+ this.ctrl.state[this.key] = t;
202
+ }
203
+ get shared() {
204
+ return this.ctrl.state.shared;
205
+ }
206
+ get eventStore() {
207
+ return this.ctrl.gestureEventStores[this.key];
208
+ }
209
+ get timeoutStore() {
210
+ return this.ctrl.gestureTimeoutStores[this.key];
211
+ }
212
+ get config() {
213
+ return this.ctrl.config[this.key];
214
+ }
215
+ get sharedConfig() {
216
+ return this.ctrl.config.shared;
217
+ }
218
+ get handler() {
219
+ return this.ctrl.handlers[this.key];
220
+ }
221
+ reset() {
222
+ const {
223
+ state: t,
224
+ shared: e,
225
+ ingKey: i,
226
+ args: o
227
+ } = this;
228
+ e[i] = t._active = t.active = t._blocked = t._force = !1, t._step = [!1, !1], t.intentional = !1, t._movement = [0, 0], t._distance = [0, 0], t._direction = [0, 0], t._delta = [0, 0], t._bounds = [[-1 / 0, 1 / 0], [-1 / 0, 1 / 0]], t.args = o, t.axis = void 0, t.memo = void 0, t.elapsedTime = t.timeDelta = 0, t.direction = [0, 0], t.distance = [0, 0], t.overflow = [0, 0], t._movementBound = [!1, !1], t.velocity = [0, 0], t.movement = [0, 0], t.delta = [0, 0], t.timeStamp = 0;
229
+ }
230
+ start(t) {
231
+ const e = this.state, i = this.config;
232
+ e._active || (this.reset(), this.computeInitial(), e._active = !0, e.target = t.target, e.currentTarget = t.currentTarget, e.lastOffset = i.from ? I(i.from, e) : e.offset, e.offset = e.lastOffset, e.startTime = e.timeStamp = t.timeStamp);
233
+ }
234
+ computeValues(t) {
235
+ const e = this.state;
236
+ e._values = t, e.values = this.config.transform(t);
237
+ }
238
+ computeInitial() {
239
+ const t = this.state;
240
+ t._initial = t._values, t.initial = t.values;
241
+ }
242
+ compute(t) {
243
+ const {
244
+ state: e,
245
+ config: i,
246
+ shared: o
247
+ } = this;
248
+ e.args = this.args;
249
+ let n = 0;
250
+ if (t && (e.event = t, i.preventDefault && t.cancelable && e.event.preventDefault(), e.type = t.type, o.touches = this.ctrl.pointerIds.size || this.ctrl.touchIds.size, o.locked = !!document.pointerLockElement, Object.assign(o, ut(t)), o.down = o.pressed = o.buttons % 2 === 1 || o.touches > 0, n = t.timeStamp - e.timeStamp, e.timeStamp = t.timeStamp, e.elapsedTime = e.timeStamp - e.startTime), e._active) {
251
+ const m = e._delta.map(Math.abs);
252
+ a.addTo(e._distance, m);
253
+ }
254
+ this.axisIntent && this.axisIntent(t);
255
+ const [r, u] = e._movement, [p, v] = i.threshold, {
256
+ _step: c,
257
+ values: y
258
+ } = e;
259
+ if (i.hasCustomTransform ? (c[0] === !1 && (c[0] = Math.abs(r) >= p && y[0]), c[1] === !1 && (c[1] = Math.abs(u) >= v && y[1])) : (c[0] === !1 && (c[0] = Math.abs(r) >= p && Math.sign(r) * p), c[1] === !1 && (c[1] = Math.abs(u) >= v && Math.sign(u) * v)), e.intentional = c[0] !== !1 || c[1] !== !1, !e.intentional) return;
260
+ const d = [0, 0];
261
+ if (i.hasCustomTransform) {
262
+ const [m, tt] = y;
263
+ d[0] = c[0] !== !1 ? m - c[0] : 0, d[1] = c[1] !== !1 ? tt - c[1] : 0;
264
+ } else
265
+ d[0] = c[0] !== !1 ? r - c[0] : 0, d[1] = c[1] !== !1 ? u - c[1] : 0;
266
+ this.restrictToAxis && !e._blocked && this.restrictToAxis(d);
267
+ const w = e.offset, T = e._active && !e._blocked || e.active;
268
+ T && (e.first = e._active && !e.active, e.last = !e._active && e.active, e.active = o[this.ingKey] = e._active, t && (e.first && ("bounds" in i && (e._bounds = I(i.bounds, e)), this.setup && this.setup()), e.movement = d, this.computeOffset()));
269
+ const [D, A] = e.offset, [[S, F], [J, Q]] = e._bounds;
270
+ e.overflow = [D < S ? -1 : D > F ? 1 : 0, A < J ? -1 : A > Q ? 1 : 0], e._movementBound[0] = e.overflow[0] ? e._movementBound[0] === !1 ? e._movement[0] : e._movementBound[0] : !1, e._movementBound[1] = e.overflow[1] ? e._movementBound[1] === !1 ? e._movement[1] : e._movementBound[1] : !1;
271
+ const Z = e._active ? i.rubberband || [0, 0] : [0, 0];
272
+ if (e.offset = et(e._bounds, e.offset, Z), e.delta = a.sub(e.offset, w), this.computeMovement(), T && (!e.last || n > ft)) {
273
+ e.delta = a.sub(e.offset, w);
274
+ const m = e.delta.map(Math.abs);
275
+ a.addTo(e.distance, m), e.direction = e.delta.map(Math.sign), e._direction = e._delta.map(Math.sign), !e.first && n > 0 && (e.velocity = [m[0] / n, m[1] / n], e.timeDelta = n);
276
+ }
277
+ }
278
+ emit() {
279
+ const t = this.state, e = this.shared, i = this.config;
280
+ if (t._active || this.clean(), (t._blocked || !t.intentional) && !t._force && !i.triggerAllEvents) return;
281
+ const o = this.handler(h(h(h({}, e), t), {}, {
282
+ [this.aliasKey]: t.values
283
+ }));
284
+ o !== void 0 && (t.memo = o);
285
+ }
286
+ clean() {
287
+ this.eventStore.clean(), this.timeoutStore.clean();
288
+ }
289
+ }
290
+ function dt([s, t], e) {
291
+ const i = Math.abs(s), o = Math.abs(t);
292
+ if (i > o && i > e)
293
+ return "x";
294
+ if (o > i && o > e)
295
+ return "y";
296
+ }
297
+ class b extends z {
298
+ constructor(...t) {
299
+ super(...t), f(this, "aliasKey", "xy");
300
+ }
301
+ reset() {
302
+ super.reset(), this.state.axis = void 0;
303
+ }
304
+ init() {
305
+ this.state.offset = [0, 0], this.state.lastOffset = [0, 0];
306
+ }
307
+ computeOffset() {
308
+ this.state.offset = a.add(this.state.lastOffset, this.state.movement);
309
+ }
310
+ computeMovement() {
311
+ this.state.movement = a.sub(this.state.offset, this.state.lastOffset);
312
+ }
313
+ axisIntent(t) {
314
+ const e = this.state, i = this.config;
315
+ if (!e.axis && t) {
316
+ const o = typeof i.axisThreshold == "object" ? i.axisThreshold[H(t)] : i.axisThreshold;
317
+ e.axis = dt(e._movement, o);
318
+ }
319
+ e._blocked = (i.lockDirection || !!i.axis) && !e.axis || !!i.axis && i.axis !== e.axis;
320
+ }
321
+ restrictToAxis(t) {
322
+ if (this.config.axis || this.config.lockDirection)
323
+ switch (this.state.axis) {
324
+ case "x":
325
+ t[1] = 0;
326
+ break;
327
+ case "y":
328
+ t[0] = 0;
329
+ break;
330
+ }
331
+ }
332
+ }
333
+ const R = (s) => s, U = 0.15, O = {
334
+ enabled(s = !0) {
335
+ return s;
336
+ },
337
+ eventOptions(s, t, e) {
338
+ return h(h({}, e.shared.eventOptions), s);
339
+ },
340
+ preventDefault(s = !1) {
341
+ return s;
342
+ },
343
+ triggerAllEvents(s = !1) {
344
+ return s;
345
+ },
346
+ rubberband(s = 0) {
347
+ switch (s) {
348
+ case !0:
349
+ return [U, U];
350
+ case !1:
351
+ return [0, 0];
352
+ default:
353
+ return a.toVector(s);
354
+ }
355
+ },
356
+ from(s) {
357
+ if (typeof s == "function") return s;
358
+ if (s != null) return a.toVector(s);
359
+ },
360
+ transform(s, t, e) {
361
+ const i = s || e.shared.transform;
362
+ if (this.hasCustomTransform = !!i, process.env.NODE_ENV === "development") {
363
+ const o = i || R;
364
+ return (n) => {
365
+ const r = o(n);
366
+ return (!isFinite(r[0]) || !isFinite(r[1])) && console.warn(`[@use-gesture]: config.transform() must produce a valid result, but it was: [${r[0]},${[1]}]`), r;
367
+ };
368
+ }
369
+ return i || R;
370
+ },
371
+ threshold(s) {
372
+ return a.toVector(s, 0);
373
+ }
374
+ };
375
+ process.env.NODE_ENV === "development" && Object.assign(O, {
376
+ domTarget(s) {
377
+ if (s !== void 0)
378
+ throw Error("[@use-gesture]: `domTarget` option has been renamed to `target`.");
379
+ return NaN;
380
+ },
381
+ lockDirection(s) {
382
+ if (s !== void 0)
383
+ throw Error("[@use-gesture]: `lockDirection` option has been merged with `axis`. Use it as in `{ axis: 'lock' }`");
384
+ return NaN;
385
+ },
386
+ initial(s) {
387
+ if (s !== void 0)
388
+ throw Error("[@use-gesture]: `initial` option has been renamed to `from`.");
389
+ return NaN;
390
+ }
391
+ });
392
+ const pt = 0, g = h(h({}, O), {}, {
393
+ axis(s, t, {
394
+ axis: e
395
+ }) {
396
+ if (this.lockDirection = e === "lock", !this.lockDirection) return e;
397
+ },
398
+ axisThreshold(s = pt) {
399
+ return s;
400
+ },
401
+ bounds(s = {}) {
402
+ if (typeof s == "function")
403
+ return (n) => g.bounds(s(n));
404
+ if ("current" in s)
405
+ return () => s.current;
406
+ if (typeof HTMLElement == "function" && s instanceof HTMLElement)
13
407
  return s;
14
- if (t(r)) {
15
- var i = typeof r.valueOf == "function" ? r.valueOf() : r;
16
- r = t(i) ? i + "" : i;
408
+ const {
409
+ left: t = -1 / 0,
410
+ right: e = 1 / 0,
411
+ top: i = -1 / 0,
412
+ bottom: o = 1 / 0
413
+ } = s;
414
+ return [[t, e], [i, o]];
415
+ }
416
+ }), B = {
417
+ ArrowRight: (s, t = 1) => [s * t, 0],
418
+ ArrowLeft: (s, t = 1) => [-1 * s * t, 0],
419
+ ArrowUp: (s, t = 1) => [0, -1 * s * t],
420
+ ArrowDown: (s, t = 1) => [0, s * t]
421
+ };
422
+ class mt extends b {
423
+ constructor(...t) {
424
+ super(...t), f(this, "ingKey", "dragging");
425
+ }
426
+ reset() {
427
+ super.reset();
428
+ const t = this.state;
429
+ t._pointerId = void 0, t._pointerActive = !1, t._keyboardActive = !1, t._preventScroll = !1, t._delayed = !1, t.swipe = [0, 0], t.tap = !1, t.canceled = !1, t.cancel = this.cancel.bind(this);
430
+ }
431
+ setup() {
432
+ const t = this.state;
433
+ if (t._bounds instanceof HTMLElement) {
434
+ const e = t._bounds.getBoundingClientRect(), i = t.currentTarget.getBoundingClientRect(), o = {
435
+ left: e.left - i.left + t.offset[0],
436
+ right: e.right - i.right + t.offset[0],
437
+ top: e.top - i.top + t.offset[1],
438
+ bottom: e.bottom - i.bottom + t.offset[1]
439
+ };
440
+ t._bounds = g.bounds(o);
441
+ }
442
+ }
443
+ cancel() {
444
+ const t = this.state;
445
+ t.canceled || (t.canceled = !0, t._active = !1, setTimeout(() => {
446
+ this.compute(), this.emit();
447
+ }, 0));
448
+ }
449
+ setActive() {
450
+ this.state._active = this.state._pointerActive || this.state._keyboardActive;
451
+ }
452
+ clean() {
453
+ this.pointerClean(), this.state._pointerActive = !1, this.state._keyboardActive = !1, super.clean();
454
+ }
455
+ pointerDown(t) {
456
+ const e = this.config, i = this.state;
457
+ if (t.buttons != null && (Array.isArray(e.pointerButtons) ? !e.pointerButtons.includes(t.buttons) : e.pointerButtons !== -1 && e.pointerButtons !== t.buttons)) return;
458
+ const o = this.ctrl.setEventIds(t);
459
+ e.pointerCapture && t.target.setPointerCapture(t.pointerId), !(o && o.size > 1 && i._pointerActive) && (this.start(t), this.setupPointer(t), i._pointerId = k(t), i._pointerActive = !0, this.computeValues(_(t)), this.computeInitial(), e.preventScrollAxis && H(t) !== "mouse" ? (i._active = !1, this.setupScrollPrevention(t)) : e.delay > 0 ? (this.setupDelayTrigger(t), e.triggerAllEvents && (this.compute(t), this.emit())) : this.startPointerDrag(t));
460
+ }
461
+ startPointerDrag(t) {
462
+ const e = this.state;
463
+ e._active = !0, e._preventScroll = !0, e._delayed = !1, this.compute(t), this.emit();
464
+ }
465
+ pointerMove(t) {
466
+ const e = this.state, i = this.config;
467
+ if (!e._pointerActive) return;
468
+ const o = k(t);
469
+ if (e._pointerId !== void 0 && o !== e._pointerId) return;
470
+ const n = _(t);
471
+ if (document.pointerLockElement === t.target ? e._delta = [t.movementX, t.movementY] : (e._delta = a.sub(n, e._values), this.computeValues(n)), a.addTo(e._movement, e._delta), this.compute(t), e._delayed && e.intentional) {
472
+ this.timeoutStore.remove("dragDelay"), e.active = !1, this.startPointerDrag(t);
473
+ return;
17
474
  }
18
- if (typeof r != "string")
19
- return r === 0 ? r : +r;
20
- r = o(r);
21
- var f = _.test(r);
22
- return f || q.test(r) ? a(r.slice(2), f ? 2 : 8) : b.test(r) ? s : +r;
475
+ if (i.preventScrollAxis && !e._preventScroll)
476
+ if (e.axis)
477
+ if (e.axis === i.preventScrollAxis || i.preventScrollAxis === "xy") {
478
+ e._active = !1, this.clean();
479
+ return;
480
+ } else {
481
+ this.timeoutStore.remove("startPointerDrag"), this.startPointerDrag(t);
482
+ return;
483
+ }
484
+ else
485
+ return;
486
+ this.emit();
487
+ }
488
+ pointerUp(t) {
489
+ this.ctrl.setEventIds(t);
490
+ try {
491
+ this.config.pointerCapture && t.target.hasPointerCapture(t.pointerId) && t.target.releasePointerCapture(t.pointerId);
492
+ } catch {
493
+ process.env.NODE_ENV === "development" && console.warn("[@use-gesture]: If you see this message, it's likely that you're using an outdated version of `@react-three/fiber`. \n\nPlease upgrade to the latest version.");
494
+ }
495
+ const e = this.state, i = this.config;
496
+ if (!e._active || !e._pointerActive) return;
497
+ const o = k(t);
498
+ if (e._pointerId !== void 0 && o !== e._pointerId) return;
499
+ this.state._pointerActive = !1, this.setActive(), this.compute(t);
500
+ const [n, r] = e._distance;
501
+ if (e.tap = n <= i.tapsThreshold && r <= i.tapsThreshold, e.tap && i.filterTaps)
502
+ e._force = !0;
503
+ else {
504
+ const [u, p] = e._delta, [v, c] = e._movement, [y, d] = i.swipe.velocity, [w, T] = i.swipe.distance, D = i.swipe.duration;
505
+ if (e.elapsedTime < D) {
506
+ const A = Math.abs(u / e.timeDelta), S = Math.abs(p / e.timeDelta);
507
+ A > y && Math.abs(v) > w && (e.swipe[0] = Math.sign(u)), S > d && Math.abs(c) > T && (e.swipe[1] = Math.sign(p));
508
+ }
509
+ }
510
+ this.emit();
511
+ }
512
+ pointerClick(t) {
513
+ !this.state.tap && t.detail > 0 && (t.preventDefault(), t.stopPropagation());
514
+ }
515
+ setupPointer(t) {
516
+ const e = this.config, i = e.device;
517
+ if (process.env.NODE_ENV === "development")
518
+ try {
519
+ if (i === "pointer" && e.preventScrollDelay === void 0) {
520
+ const o = "uv" in t ? t.sourceEvent.currentTarget : t.currentTarget;
521
+ window.getComputedStyle(o).touchAction === "auto" && console.warn("[@use-gesture]: The drag target has its `touch-action` style property set to `auto`. It is recommended to add `touch-action: 'none'` so that the drag gesture behaves correctly on touch-enabled devices. For more information read this: https://use-gesture.netlify.app/docs/extras/#touch-action.\n\nThis message will only show in development mode. It won't appear in production. If this is intended, you can ignore it.", o);
522
+ }
523
+ } catch {
524
+ }
525
+ e.pointerLock && t.currentTarget.requestPointerLock(), e.pointerCapture || (this.eventStore.add(this.sharedConfig.window, i, "change", this.pointerMove.bind(this)), this.eventStore.add(this.sharedConfig.window, i, "end", this.pointerUp.bind(this)), this.eventStore.add(this.sharedConfig.window, i, "cancel", this.pointerUp.bind(this)));
526
+ }
527
+ pointerClean() {
528
+ this.config.pointerLock && document.pointerLockElement === this.state.currentTarget && document.exitPointerLock();
529
+ }
530
+ preventScroll(t) {
531
+ this.state._preventScroll && t.cancelable && t.preventDefault();
532
+ }
533
+ setupScrollPrevention(t) {
534
+ this.state._preventScroll = !1, gt(t);
535
+ const e = this.eventStore.add(this.sharedConfig.window, "touch", "change", this.preventScroll.bind(this), {
536
+ passive: !1
537
+ });
538
+ this.eventStore.add(this.sharedConfig.window, "touch", "end", e), this.eventStore.add(this.sharedConfig.window, "touch", "cancel", e), this.timeoutStore.add("startPointerDrag", this.startPointerDrag.bind(this), this.config.preventScrollDelay, t);
539
+ }
540
+ setupDelayTrigger(t) {
541
+ this.state._delayed = !0, this.timeoutStore.add("dragDelay", () => {
542
+ this.state._step = [0, 0], this.startPointerDrag(t);
543
+ }, this.config.delay);
544
+ }
545
+ keyDown(t) {
546
+ const e = B[t.key];
547
+ if (e) {
548
+ const i = this.state, o = t.shiftKey ? 10 : t.altKey ? 0.1 : 1;
549
+ this.start(t), i._delta = e(this.config.keyboardDisplacement, o), i._keyboardActive = !0, a.addTo(i._movement, i._delta), this.compute(t), this.emit();
550
+ }
551
+ }
552
+ keyUp(t) {
553
+ t.key in B && (this.state._keyboardActive = !1, this.setActive(), this.compute(t), this.emit());
554
+ }
555
+ bind(t) {
556
+ const e = this.config.device;
557
+ t(e, "start", this.pointerDown.bind(this)), this.config.pointerCapture && (t(e, "change", this.pointerMove.bind(this)), t(e, "end", this.pointerUp.bind(this)), t(e, "cancel", this.pointerUp.bind(this)), t("lostPointerCapture", "", this.pointerUp.bind(this))), this.config.keys && (t("key", "down", this.keyDown.bind(this)), t("key", "up", this.keyUp.bind(this))), this.config.filterTaps && t("click", "", this.pointerClick.bind(this), {
558
+ capture: !0,
559
+ passive: !1
560
+ });
561
+ }
562
+ }
563
+ function gt(s) {
564
+ "persist" in s && typeof s.persist == "function" && s.persist();
565
+ }
566
+ const E = typeof window < "u" && window.document && window.document.createElement;
567
+ function G() {
568
+ return E && "ontouchstart" in window;
569
+ }
570
+ function _t() {
571
+ return G() || E && window.navigator.maxTouchPoints > 1;
572
+ }
573
+ function vt() {
574
+ return E && "onpointerdown" in window;
575
+ }
576
+ function yt() {
577
+ return E && "exitPointerLock" in window.document;
578
+ }
579
+ function bt() {
580
+ try {
581
+ return "constructor" in GestureEvent;
582
+ } catch {
583
+ return !1;
23
584
  }
24
- return e = p, e;
25
585
  }
586
+ const l = {
587
+ isBrowser: E,
588
+ gesture: bt(),
589
+ touch: G(),
590
+ touchscreen: _t(),
591
+ pointer: vt(),
592
+ pointerLock: yt()
593
+ }, Et = 250, wt = 180, Tt = 0.5, Dt = 50, At = 250, It = 10, Y = {
594
+ mouse: 0,
595
+ touch: 0,
596
+ pen: 8
597
+ }, $ = h(h({}, g), {}, {
598
+ device(s, t, {
599
+ pointer: {
600
+ touch: e = !1,
601
+ lock: i = !1,
602
+ mouse: o = !1
603
+ } = {}
604
+ }) {
605
+ return this.pointerLock = i && l.pointerLock, l.touch && e ? "touch" : this.pointerLock ? "mouse" : l.pointer && !o ? "pointer" : l.touch ? "touch" : "mouse";
606
+ },
607
+ preventScrollAxis(s, t, {
608
+ preventScroll: e
609
+ }) {
610
+ if (this.preventScrollDelay = typeof e == "number" ? e : e || e === void 0 && s ? Et : void 0, !(!l.touchscreen || e === !1))
611
+ return s || (e !== void 0 ? "y" : void 0);
612
+ },
613
+ pointerCapture(s, t, {
614
+ pointer: {
615
+ capture: e = !0,
616
+ buttons: i = 1,
617
+ keys: o = !0
618
+ } = {}
619
+ }) {
620
+ return this.pointerButtons = i, this.keys = o, !this.pointerLock && this.device === "pointer" && e;
621
+ },
622
+ threshold(s, t, {
623
+ filterTaps: e = !1,
624
+ tapsThreshold: i = 3,
625
+ axis: o = void 0
626
+ }) {
627
+ const n = a.toVector(s, e ? i : o ? 1 : 0);
628
+ return this.filterTaps = e, this.tapsThreshold = i, n;
629
+ },
630
+ swipe({
631
+ velocity: s = Tt,
632
+ distance: t = Dt,
633
+ duration: e = At
634
+ } = {}) {
635
+ return {
636
+ velocity: this.transform(a.toVector(s)),
637
+ distance: this.transform(a.toVector(t)),
638
+ duration: e
639
+ };
640
+ },
641
+ delay(s = 0) {
642
+ switch (s) {
643
+ case !0:
644
+ return wt;
645
+ case !1:
646
+ return 0;
647
+ default:
648
+ return s;
649
+ }
650
+ },
651
+ axisThreshold(s) {
652
+ return s ? h(h({}, Y), s) : Y;
653
+ },
654
+ keyboardDisplacement(s = It) {
655
+ return s;
656
+ }
657
+ });
658
+ process.env.NODE_ENV === "development" && Object.assign($, {
659
+ useTouch(s) {
660
+ if (s !== void 0)
661
+ throw Error("[@use-gesture]: `useTouch` option has been renamed to `pointer.touch`. Use it as in `{ pointer: { touch: true } }`.");
662
+ return NaN;
663
+ },
664
+ experimental_preventWindowScrollY(s) {
665
+ if (s !== void 0)
666
+ throw Error("[@use-gesture]: `experimental_preventWindowScrollY` option has been renamed to `preventScroll`.");
667
+ return NaN;
668
+ },
669
+ swipeVelocity(s) {
670
+ if (s !== void 0)
671
+ throw Error("[@use-gesture]: `swipeVelocity` option has been renamed to `swipe.velocity`. Use it as in `{ swipe: { velocity: 0.5 } }`.");
672
+ return NaN;
673
+ },
674
+ swipeDistance(s) {
675
+ if (s !== void 0)
676
+ throw Error("[@use-gesture]: `swipeDistance` option has been renamed to `swipe.distance`. Use it as in `{ swipe: { distance: 50 } }`.");
677
+ return NaN;
678
+ },
679
+ swipeDuration(s) {
680
+ if (s !== void 0)
681
+ throw Error("[@use-gesture]: `swipeDuration` option has been renamed to `swipe.duration`. Use it as in `{ swipe: { duration: 250 } }`.");
682
+ return NaN;
683
+ }
684
+ });
685
+ function q(s) {
686
+ const [t, e] = s.overflow, [i, o] = s._delta, [n, r] = s._direction;
687
+ (t < 0 && i > 0 && n < 0 || t > 0 && i < 0 && n > 0) && (s._movement[0] = s._movementBound[0]), (e < 0 && o > 0 && r < 0 || e > 0 && o < 0 && r > 0) && (s._movement[1] = s._movementBound[1]);
688
+ }
689
+ const St = 30, kt = 100;
690
+ class xt extends z {
691
+ constructor(...t) {
692
+ super(...t), f(this, "ingKey", "pinching"), f(this, "aliasKey", "da");
693
+ }
694
+ init() {
695
+ this.state.offset = [1, 0], this.state.lastOffset = [1, 0], this.state._pointerEvents = /* @__PURE__ */ new Map();
696
+ }
697
+ reset() {
698
+ super.reset();
699
+ const t = this.state;
700
+ t._touchIds = [], t.canceled = !1, t.cancel = this.cancel.bind(this), t.turns = 0;
701
+ }
702
+ computeOffset() {
703
+ const {
704
+ type: t,
705
+ movement: e,
706
+ lastOffset: i
707
+ } = this.state;
708
+ t === "wheel" ? this.state.offset = a.add(e, i) : this.state.offset = [(1 + e[0]) * i[0], e[1] + i[1]];
709
+ }
710
+ computeMovement() {
711
+ const {
712
+ offset: t,
713
+ lastOffset: e
714
+ } = this.state;
715
+ this.state.movement = [t[0] / e[0], t[1] - e[1]];
716
+ }
717
+ axisIntent() {
718
+ const t = this.state, [e, i] = t._movement;
719
+ if (!t.axis) {
720
+ const o = Math.abs(e) * St - Math.abs(i);
721
+ o < 0 ? t.axis = "angle" : o > 0 && (t.axis = "scale");
722
+ }
723
+ }
724
+ restrictToAxis(t) {
725
+ this.config.lockDirection && (this.state.axis === "scale" ? t[1] = 0 : this.state.axis === "angle" && (t[0] = 0));
726
+ }
727
+ cancel() {
728
+ const t = this.state;
729
+ t.canceled || setTimeout(() => {
730
+ t.canceled = !0, t._active = !1, this.compute(), this.emit();
731
+ }, 0);
732
+ }
733
+ touchStart(t) {
734
+ this.ctrl.setEventIds(t);
735
+ const e = this.state, i = this.ctrl.touchIds;
736
+ if (e._active && e._touchIds.every((n) => i.has(n)) || i.size < 2) return;
737
+ this.start(t), e._touchIds = Array.from(i).slice(0, 2);
738
+ const o = L(t, e._touchIds);
739
+ o && this.pinchStart(t, o);
740
+ }
741
+ pointerStart(t) {
742
+ if (t.buttons != null && t.buttons % 2 !== 1) return;
743
+ this.ctrl.setEventIds(t), t.target.setPointerCapture(t.pointerId);
744
+ const e = this.state, i = e._pointerEvents, o = this.ctrl.pointerIds;
745
+ if (e._active && Array.from(i.keys()).every((r) => o.has(r)) || (i.size < 2 && i.set(t.pointerId, t), e._pointerEvents.size < 2)) return;
746
+ this.start(t);
747
+ const n = x(...Array.from(i.values()));
748
+ n && this.pinchStart(t, n);
749
+ }
750
+ pinchStart(t, e) {
751
+ const i = this.state;
752
+ i.origin = e.origin, this.computeValues([e.distance, e.angle]), this.computeInitial(), this.compute(t), this.emit();
753
+ }
754
+ touchMove(t) {
755
+ if (!this.state._active) return;
756
+ const e = L(t, this.state._touchIds);
757
+ e && this.pinchMove(t, e);
758
+ }
759
+ pointerMove(t) {
760
+ const e = this.state._pointerEvents;
761
+ if (e.has(t.pointerId) && e.set(t.pointerId, t), !this.state._active) return;
762
+ const i = x(...Array.from(e.values()));
763
+ i && this.pinchMove(t, i);
764
+ }
765
+ pinchMove(t, e) {
766
+ const i = this.state, o = i._values[1], n = e.angle - o;
767
+ let r = 0;
768
+ Math.abs(n) > 270 && (r += Math.sign(n)), this.computeValues([e.distance, e.angle - 360 * r]), i.origin = e.origin, i.turns = r, i._movement = [i._values[0] / i._initial[0] - 1, i._values[1] - i._initial[1]], this.compute(t), this.emit();
769
+ }
770
+ touchEnd(t) {
771
+ this.ctrl.setEventIds(t), this.state._active && this.state._touchIds.some((e) => !this.ctrl.touchIds.has(e)) && (this.state._active = !1, this.compute(t), this.emit());
772
+ }
773
+ pointerEnd(t) {
774
+ const e = this.state;
775
+ this.ctrl.setEventIds(t);
776
+ try {
777
+ t.target.releasePointerCapture(t.pointerId);
778
+ } catch {
779
+ }
780
+ e._pointerEvents.has(t.pointerId) && e._pointerEvents.delete(t.pointerId), e._active && e._pointerEvents.size < 2 && (e._active = !1, this.compute(t), this.emit());
781
+ }
782
+ gestureStart(t) {
783
+ t.cancelable && t.preventDefault();
784
+ const e = this.state;
785
+ e._active || (this.start(t), this.computeValues([t.scale, t.rotation]), e.origin = [t.clientX, t.clientY], this.compute(t), this.emit());
786
+ }
787
+ gestureMove(t) {
788
+ if (t.cancelable && t.preventDefault(), !this.state._active) return;
789
+ const e = this.state;
790
+ this.computeValues([t.scale, t.rotation]), e.origin = [t.clientX, t.clientY];
791
+ const i = e._movement;
792
+ e._movement = [t.scale - 1, t.rotation], e._delta = a.sub(e._movement, i), this.compute(t), this.emit();
793
+ }
794
+ gestureEnd(t) {
795
+ this.state._active && (this.state._active = !1, this.compute(t), this.emit());
796
+ }
797
+ wheel(t) {
798
+ const e = this.config.modifierKey;
799
+ e && (Array.isArray(e) ? !e.find((i) => t[i]) : !t[e]) || (this.state._active ? this.wheelChange(t) : this.wheelStart(t), this.timeoutStore.add("wheelEnd", this.wheelEnd.bind(this)));
800
+ }
801
+ wheelStart(t) {
802
+ this.start(t), this.wheelChange(t);
803
+ }
804
+ wheelChange(t) {
805
+ "uv" in t || (t.cancelable && t.preventDefault(), process.env.NODE_ENV === "development" && !t.defaultPrevented && console.warn("[@use-gesture]: To properly support zoom on trackpads, try using the `target` option.\n\nThis message will only appear in development mode."));
806
+ const i = this.state;
807
+ i._delta = [-W(t)[1] / kt * i.offset[0], 0], a.addTo(i._movement, i._delta), q(i), this.state.origin = [t.clientX, t.clientY], this.compute(t), this.emit();
808
+ }
809
+ wheelEnd() {
810
+ this.state._active && (this.state._active = !1, this.compute(), this.emit());
811
+ }
812
+ bind(t) {
813
+ const e = this.config.device;
814
+ e && (t(e, "start", this[e + "Start"].bind(this)), t(e, "change", this[e + "Move"].bind(this)), t(e, "end", this[e + "End"].bind(this)), t(e, "cancel", this[e + "End"].bind(this)), t("lostPointerCapture", "", this[e + "End"].bind(this))), this.config.pinchOnWheel && t("wheel", "", this.wheel.bind(this), {
815
+ passive: !1
816
+ });
817
+ }
818
+ }
819
+ const Ct = h(h({}, O), {}, {
820
+ device(s, t, {
821
+ shared: e,
822
+ pointer: {
823
+ touch: i = !1
824
+ } = {}
825
+ }) {
826
+ if (e.target && !l.touch && l.gesture) return "gesture";
827
+ if (l.touch && i) return "touch";
828
+ if (l.touchscreen) {
829
+ if (l.pointer) return "pointer";
830
+ if (l.touch) return "touch";
831
+ }
832
+ },
833
+ bounds(s, t, {
834
+ scaleBounds: e = {},
835
+ angleBounds: i = {}
836
+ }) {
837
+ const o = (r) => {
838
+ const u = K(I(e, r), {
839
+ min: -1 / 0,
840
+ max: 1 / 0
841
+ });
842
+ return [u.min, u.max];
843
+ }, n = (r) => {
844
+ const u = K(I(i, r), {
845
+ min: -1 / 0,
846
+ max: 1 / 0
847
+ });
848
+ return [u.min, u.max];
849
+ };
850
+ return typeof e != "function" && typeof i != "function" ? [o(), n()] : (r) => [o(r), n(r)];
851
+ },
852
+ threshold(s, t, e) {
853
+ return this.lockDirection = e.axis === "lock", a.toVector(s, this.lockDirection ? [0.1, 3] : 0);
854
+ },
855
+ modifierKey(s) {
856
+ return s === void 0 ? "ctrlKey" : s;
857
+ },
858
+ pinchOnWheel(s = !0) {
859
+ return s;
860
+ }
861
+ });
862
+ class Ot extends b {
863
+ constructor(...t) {
864
+ super(...t), f(this, "ingKey", "moving");
865
+ }
866
+ move(t) {
867
+ this.config.mouseOnly && t.pointerType !== "mouse" || (this.state._active ? this.moveChange(t) : this.moveStart(t), this.timeoutStore.add("moveEnd", this.moveEnd.bind(this)));
868
+ }
869
+ moveStart(t) {
870
+ this.start(t), this.computeValues(_(t)), this.compute(t), this.computeInitial(), this.emit();
871
+ }
872
+ moveChange(t) {
873
+ if (!this.state._active) return;
874
+ const e = _(t), i = this.state;
875
+ i._delta = a.sub(e, i._values), a.addTo(i._movement, i._delta), this.computeValues(e), this.compute(t), this.emit();
876
+ }
877
+ moveEnd(t) {
878
+ this.state._active && (this.state._active = !1, this.compute(t), this.emit());
879
+ }
880
+ bind(t) {
881
+ t("pointer", "change", this.move.bind(this)), t("pointer", "leave", this.moveEnd.bind(this));
882
+ }
883
+ }
884
+ const Pt = h(h({}, g), {}, {
885
+ mouseOnly: (s = !0) => s
886
+ });
887
+ class Mt extends b {
888
+ constructor(...t) {
889
+ super(...t), f(this, "ingKey", "scrolling");
890
+ }
891
+ scroll(t) {
892
+ this.state._active || this.start(t), this.scrollChange(t), this.timeoutStore.add("scrollEnd", this.scrollEnd.bind(this));
893
+ }
894
+ scrollChange(t) {
895
+ t.cancelable && t.preventDefault();
896
+ const e = this.state, i = ht(t);
897
+ e._delta = a.sub(i, e._values), a.addTo(e._movement, e._delta), this.computeValues(i), this.compute(t), this.emit();
898
+ }
899
+ scrollEnd() {
900
+ this.state._active && (this.state._active = !1, this.compute(), this.emit());
901
+ }
902
+ bind(t) {
903
+ t("scroll", "", this.scroll.bind(this));
904
+ }
905
+ }
906
+ const Lt = g;
907
+ class Nt extends b {
908
+ constructor(...t) {
909
+ super(...t), f(this, "ingKey", "wheeling");
910
+ }
911
+ wheel(t) {
912
+ this.state._active || this.start(t), this.wheelChange(t), this.timeoutStore.add("wheelEnd", this.wheelEnd.bind(this));
913
+ }
914
+ wheelChange(t) {
915
+ const e = this.state;
916
+ e._delta = W(t), a.addTo(e._movement, e._delta), q(e), this.compute(t), this.emit();
917
+ }
918
+ wheelEnd() {
919
+ this.state._active && (this.state._active = !1, this.compute(), this.emit());
920
+ }
921
+ bind(t) {
922
+ t("wheel", "", this.wheel.bind(this));
923
+ }
924
+ }
925
+ const Vt = g;
926
+ class Kt extends b {
927
+ constructor(...t) {
928
+ super(...t), f(this, "ingKey", "hovering");
929
+ }
930
+ enter(t) {
931
+ this.config.mouseOnly && t.pointerType !== "mouse" || (this.start(t), this.computeValues(_(t)), this.compute(t), this.emit());
932
+ }
933
+ leave(t) {
934
+ if (this.config.mouseOnly && t.pointerType !== "mouse") return;
935
+ const e = this.state;
936
+ if (!e._active) return;
937
+ e._active = !1;
938
+ const i = _(t);
939
+ e._movement = e._delta = a.sub(i, e._values), this.computeValues(i), this.compute(t), e.delta = e.movement, this.emit();
940
+ }
941
+ bind(t) {
942
+ t("pointer", "enter", this.enter.bind(this)), t("pointer", "leave", this.leave.bind(this));
943
+ }
944
+ }
945
+ const Rt = h(h({}, g), {}, {
946
+ mouseOnly: (s = !0) => s
947
+ }), Ut = /* @__PURE__ */ new Map(), Bt = /* @__PURE__ */ new Map();
948
+ function Gt(s) {
949
+ Ut.set(s.key, s.engine), Bt.set(s.key, s.resolver);
950
+ }
951
+ const $t = {
952
+ key: "drag",
953
+ engine: mt,
954
+ resolver: $
955
+ }, qt = {
956
+ key: "hover",
957
+ engine: Kt,
958
+ resolver: Rt
959
+ }, Ft = {
960
+ key: "move",
961
+ engine: Ot,
962
+ resolver: Pt
963
+ }, Jt = {
964
+ key: "pinch",
965
+ engine: xt,
966
+ resolver: Ct
967
+ }, Qt = {
968
+ key: "scroll",
969
+ engine: Mt,
970
+ resolver: Lt
971
+ }, Zt = {
972
+ key: "wheel",
973
+ engine: Nt,
974
+ resolver: Vt
975
+ };
26
976
  export {
27
- T as __require
977
+ Bt as C,
978
+ Ut as E,
979
+ l as S,
980
+ h as _,
981
+ f as a,
982
+ Wt as b,
983
+ zt as c,
984
+ jt as d,
985
+ $t as e,
986
+ Jt as f,
987
+ qt as h,
988
+ C as i,
989
+ Ft as m,
990
+ Ht as p,
991
+ Gt as r,
992
+ Qt as s,
993
+ Xt as t,
994
+ Zt as w
28
995
  };
29
996
  //# sourceMappingURL=index.es197.js.map