@wandelbots/wandelbots-js-react-components 6.4.0-pr.revamp.667.4e5a9e6 → 6.4.0-pr.revamp.667.4ee5f82

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 (203) hide show
  1. package/README.md +207 -40
  2. package/dist/3d.cjs +1 -1
  3. package/dist/3d.d.ts +10 -3
  4. package/dist/3d.js +41 -31
  5. package/dist/CurrentPose/index.cjs +1 -1
  6. package/dist/CurrentPose/index.js +2 -2
  7. package/dist/CurrentPoseBar/index.cjs +1 -1
  8. package/dist/CurrentPoseBar/index.js +1 -1
  9. package/dist/JoggingButtons/index.cjs +1 -1
  10. package/dist/JoggingButtons/index.js +1 -1
  11. package/dist/JoggingGizmo/index.cjs +1 -1
  12. package/dist/JoggingGizmo/index.d.ts +1 -0
  13. package/dist/JoggingGizmo/index.js +2 -2
  14. package/dist/JoggingJointSlider/index.cjs +1 -1
  15. package/dist/JoggingJointSlider/index.js +1 -1
  16. package/dist/RobotControl/index.cjs +1 -1
  17. package/dist/RobotControl/index.js +2 -2
  18. package/dist/RobotControlPanel/index.cjs +1 -1
  19. package/dist/RobotControlPanel/index.d.ts +1 -1
  20. package/dist/RobotControlPanel/index.js +1 -1
  21. package/dist/RobotHeader/index.cjs +1 -1
  22. package/dist/RobotHeader/index.d.ts +2 -0
  23. package/dist/RobotHeader/index.js +6 -4
  24. package/dist/RobotScene/index.cjs +1 -0
  25. package/dist/RobotScene/index.d.ts +5 -0
  26. package/dist/RobotScene/index.js +11 -0
  27. package/dist/RobotView/index.cjs +1 -0
  28. package/dist/RobotView/index.d.ts +4 -0
  29. package/dist/RobotView/index.js +9 -0
  30. package/dist/SafetyBar/IndicatorWithExplanation.d.ts +12 -1
  31. package/dist/SafetyBar/index.cjs +1 -1
  32. package/dist/SafetyBar/index.js +1 -1
  33. package/dist/chunks/ConnectedMotionGroup-770Xppk7.cjs +3 -0
  34. package/dist/chunks/ConnectedMotionGroup-CjhZTmlT.js +1822 -0
  35. package/dist/chunks/CurrentPose-DxeimMeU.cjs +1 -0
  36. package/dist/chunks/{CurrentPose-DYKoKD2D.js → CurrentPose-jTdJrjYe.js} +13 -12
  37. package/dist/chunks/{CurrentPoseBar-Cb_Pk2jp.js → CurrentPoseBar--HkZBGnN.js} +17 -16
  38. package/dist/chunks/CurrentPoseBar-DoOUfRRs.cjs +1 -0
  39. package/dist/chunks/{JoggingButtons-DluWqNuO.js → JoggingButtons-BNOnpcTH.js} +2 -2
  40. package/dist/chunks/{JoggingButtons-DC0jII72.cjs → JoggingButtons-Boaym2hQ.cjs} +1 -1
  41. package/dist/chunks/JoggingGizmo-CNFjpWDv.cjs +1 -0
  42. package/dist/chunks/JoggingGizmo-RDiEVQes.js +847 -0
  43. package/dist/chunks/{JoggingGizmoOrientation-Bba8HLQJ.js → JoggingGizmoOrientation-Dzzz2gEz.js} +1 -1
  44. package/dist/chunks/{JoggingGizmoOrientation-l2slmUE_.cjs → JoggingGizmoOrientation-laUrgY0N.cjs} +1 -1
  45. package/dist/chunks/JoggingJointSlider-BY-Tof8G.js +378 -0
  46. package/dist/chunks/JoggingJointSlider-Dm3vILd3.cjs +1 -0
  47. package/dist/chunks/JoggingRefusedError-C4D8_YR_.js +38 -0
  48. package/dist/chunks/JoggingRefusedError-DqyrfUcc.cjs +1 -0
  49. package/dist/chunks/Pose3-BfBNPRDM.cjs +1 -0
  50. package/dist/chunks/{Pose3-B_fLR-Wv.js → Pose3-DWxfC6Dj.js} +1 -2
  51. package/dist/chunks/PoseTransformer-2QIzECOZ.cjs +1 -0
  52. package/dist/chunks/PoseTransformer-CmuoS76S.js +364 -0
  53. package/dist/chunks/Robot-BI3OpLBC.cjs +1 -0
  54. package/dist/chunks/Robot-DzVgWIyl.js +428 -0
  55. package/dist/chunks/RobotActivation-BaPImZRq.cjs +1 -0
  56. package/dist/chunks/RobotActivation-CXUp6Szs.js +131 -0
  57. package/dist/chunks/RobotControl-Do-oagek.cjs +1 -0
  58. package/dist/chunks/RobotControl-Un5D1r8T.js +318 -0
  59. package/dist/chunks/RobotControlPanel-BJ80O4ER.cjs +1 -0
  60. package/dist/chunks/RobotControlPanel-CxTEIelh.js +1019 -0
  61. package/dist/chunks/RobotScene-C1DNfxXU.js +1246 -0
  62. package/dist/chunks/RobotScene-hUDf_S6f.cjs +1 -0
  63. package/dist/chunks/RobotSessionProvider--AekyPqD.cjs +1 -0
  64. package/dist/chunks/RobotSessionProvider-TVaKGzqa.js +25 -0
  65. package/dist/chunks/RobotView-Cx_eOS9N.js +158 -0
  66. package/dist/chunks/RobotView-KFlt_Isi.cjs +1 -0
  67. package/dist/chunks/coordSystemLabel-BThpFG9n.cjs +1 -0
  68. package/dist/chunks/coordSystemLabel-Bfy9MUsV.js +6 -0
  69. package/dist/chunks/externalizeComponent-CA_sHzyH.cjs +2 -0
  70. package/dist/chunks/{externalizeComponent-CSzPVfuG.js → externalizeComponent-CChY_1bN.js} +66 -14
  71. package/dist/chunks/holdSafety-Cbej6-Kc.js +62 -0
  72. package/dist/chunks/holdSafety-TeMXlYQe.cjs +1 -0
  73. package/dist/chunks/joggingColors-Cqpfuw4G.cjs +1 -0
  74. package/dist/chunks/joggingColors-sb6IFdj2.js +133 -0
  75. package/dist/chunks/json-3cqBD7UQ.js +18 -0
  76. package/dist/chunks/json-Bd6uGfgP.cjs +1 -0
  77. package/dist/chunks/loadRobotSession-BRuiCc0r.cjs +1 -0
  78. package/dist/chunks/loadRobotSession-IuZ-zs8x.js +3055 -0
  79. package/dist/chunks/poseText-BxG4Caa-.js +48 -0
  80. package/dist/chunks/poseText-CwplkbDM.cjs +1 -0
  81. package/dist/chunks/robotActivationOf-BsFcsAdF.cjs +1 -0
  82. package/dist/chunks/robotActivationOf-SqnXGdFY.js +368 -0
  83. package/dist/chunks/robotSafetyOf-Cbp35lO-.cjs +1 -0
  84. package/dist/chunks/{robotSafetyOf-Dr5Q4rCp.js → robotSafetyOf-kNLaX0_5.js} +255 -228
  85. package/dist/chunks/useEveryFrame-D04ygIe7.js +116 -0
  86. package/dist/chunks/useEveryFrame-NeKiPXY-.cjs +1 -0
  87. package/dist/chunks/useSmoothedMotionState-B9WO73k0.cjs +1 -0
  88. package/dist/chunks/{useSmoothedMotionState-COMJRcOt.js → useSmoothedMotionState-BSSV8aZN.js} +74 -86
  89. package/dist/chunks/useWebGLRenderer-BozrbZz-.js +45 -0
  90. package/dist/chunks/useWebGLRenderer-CtddVDDb.cjs +1 -0
  91. package/dist/components/VelocitySlider.d.ts +14 -1
  92. package/dist/components/connectionWarning/ConnectionWarning.d.ts +21 -0
  93. package/dist/components/connectionWarning/connectionWarningOf.d.ts +18 -0
  94. package/dist/components/connectionWarning/timeAgo.d.ts +5 -0
  95. package/dist/components/jogging/JoggingButtons.d.ts +3 -1
  96. package/dist/components/jogging/JoggingCartesianAxisControl.d.ts +7 -1
  97. package/dist/components/jogging/JoggingCartesianTab.d.ts +6 -0
  98. package/dist/components/jogging/JoggingJointTab.d.ts +5 -0
  99. package/dist/components/jogging/JoggingJointValueControl.d.ts +7 -1
  100. package/dist/components/jogging/JoggingPanel.d.ts +11 -0
  101. package/dist/components/jogging/JoggingRefusedError.d.ts +24 -0
  102. package/dist/components/jogging/JoggingStore.d.ts +229 -12
  103. package/dist/components/jogging/gizmo/JoggingGizmo.d.ts +14 -4
  104. package/dist/components/jogging/gizmo/RotationHandles.d.ts +3 -3
  105. package/dist/components/jogging/gizmo/gizmoShared.d.ts +19 -9
  106. package/dist/components/jogging/holdSafety.d.ts +51 -13
  107. package/dist/components/jogging/joggingColors.d.ts +6 -0
  108. package/dist/components/jogging/joint/JoggingJointSlider.d.ts +9 -5
  109. package/dist/components/jogging/joint/useJointJogHold.d.ts +10 -15
  110. package/dist/components/jogging/useHold.d.ts +17 -13
  111. package/dist/components/jogging/useJogControls.d.ts +2 -3
  112. package/dist/components/robotControl/CartesianJogTab.d.ts +14 -3
  113. package/dist/components/robotControl/HoldToMoveButton.d.ts +8 -7
  114. package/dist/components/robotControl/JogArea.d.ts +10 -4
  115. package/dist/components/robotControl/JogDisabledReason.d.ts +15 -0
  116. package/dist/components/robotControl/JointJogTab.d.ts +10 -2
  117. package/dist/components/robotControl/MoveToTab.d.ts +22 -4
  118. package/dist/components/robotControl/PoseField.d.ts +3 -1
  119. package/dist/components/robotControl/RobotControl.d.ts +3 -0
  120. package/dist/components/robotControl/RobotControlPanel.d.ts +84 -22
  121. package/dist/components/robotControl/VelocityRow.d.ts +8 -2
  122. package/dist/components/robotControl/atPose.d.ts +6 -0
  123. package/dist/components/robotControl/poseText.d.ts +13 -1
  124. package/dist/components/robotControl/units.d.ts +10 -2
  125. package/dist/components/robotControl/useRobotControlProps.d.ts +11 -2
  126. package/dist/components/robotControl/velocityText.d.ts +18 -0
  127. package/dist/components/robotHeader/robotActivationOf.d.ts +5 -0
  128. package/dist/components/robotHeader/robotSafetyOf.d.ts +8 -1
  129. package/dist/components/robotScene/JoggingAxes.d.ts +38 -0
  130. package/dist/components/robotScene/RobotScene.d.ts +28 -0
  131. package/dist/components/robotScene/RobotSceneView.d.ts +53 -0
  132. package/dist/components/robotScene/useRobotSceneProps.d.ts +18 -0
  133. package/dist/components/robotView/RobotCanvas.d.ts +42 -0
  134. package/dist/components/robotView/RobotView.d.ts +23 -0
  135. package/dist/components/robotView/WebGLUnavailable.d.ts +5 -0
  136. package/dist/components/robots/DHRobot.d.ts +1 -1
  137. package/dist/components/robots/GenericRobot.d.ts +16 -1
  138. package/dist/components/robots/LinearAxisAnimator.d.ts +1 -1
  139. package/dist/components/robots/SupportedLinearAxis.d.ts +16 -3
  140. package/dist/components/robots/SupportedRobot.d.ts +21 -3
  141. package/dist/components/robots/ghostStyle.d.ts +21 -0
  142. package/dist/components/robots/modelRotation.d.ts +14 -0
  143. package/dist/components/robots/robotModelLogic.d.ts +138 -6
  144. package/dist/components/robots/robotModelSource.d.ts +14 -1
  145. package/dist/components/utils/converters.d.ts +0 -2
  146. package/dist/components/utils/json.d.ts +4 -0
  147. package/dist/components/utils/useWebGLRenderer.d.ts +32 -0
  148. package/dist/components/utils/webglSupport.d.ts +11 -0
  149. package/dist/core.cjs +1 -1
  150. package/dist/core.d.ts +8 -5
  151. package/dist/core.js +70 -70
  152. package/dist/index.cjs +1 -1
  153. package/dist/index.js +110 -100
  154. package/dist/lib/ConnectedMotionGroup.d.ts +11 -0
  155. package/dist/lib/ControllerStateStream.d.ts +3 -8
  156. package/dist/lib/JoggerConnection.d.ts +32 -13
  157. package/dist/lib/MotionStreamConnection.d.ts +3 -2
  158. package/dist/lib/TrajectoryExecutionStore.d.ts +103 -10
  159. package/dist/lib/controllerStateSource.d.ts +6 -5
  160. package/dist/lib/incrementalCartesianMotion.d.ts +2 -2
  161. package/dist/lib/poseMath.d.ts +51 -0
  162. package/dist/lib/robotSession/RobotActivation.d.ts +43 -12
  163. package/dist/lib/robotSession/RobotLiveState.d.ts +13 -4
  164. package/dist/lib/robotSession/RobotSession.d.ts +28 -2
  165. package/dist/lib/robotSession/RobotTargetPose.d.ts +44 -8
  166. package/dist/lib/robotSession/loadRobotSession.d.ts +1 -1
  167. package/dist/lib/robotSession/robotPose.d.ts +5 -0
  168. package/dist/nats.cjs +1 -1
  169. package/dist/nats.js +1 -1
  170. package/dist/session.cjs +1 -0
  171. package/dist/session.d.ts +22 -0
  172. package/dist/session.js +37 -0
  173. package/package.json +27 -1
  174. package/dist/chunks/CurrentPose-BIPvpQLG.cjs +0 -1
  175. package/dist/chunks/CurrentPoseBar-CAEEifBY.cjs +0 -1
  176. package/dist/chunks/JoggingGizmo-DT7iX5Ka.cjs +0 -1
  177. package/dist/chunks/JoggingGizmo-Hy42DAQU.js +0 -810
  178. package/dist/chunks/JoggingJointSlider-C0lI_9W5.cjs +0 -1
  179. package/dist/chunks/JoggingJointSlider-DePZ3JHW.js +0 -406
  180. package/dist/chunks/Pose3-Ch4xVeXV.cjs +0 -1
  181. package/dist/chunks/RobotControl-C1JzXIAa.js +0 -285
  182. package/dist/chunks/RobotControl-ku4CNQCb.cjs +0 -1
  183. package/dist/chunks/RobotControlPanel-B4u3D3yO.cjs +0 -1
  184. package/dist/chunks/RobotControlPanel-Cy5LwU1h.js +0 -827
  185. package/dist/chunks/converters-BsXgcxCW.cjs +0 -1
  186. package/dist/chunks/converters-D9KpJ2HD.js +0 -47
  187. package/dist/chunks/coordSystemLabel-BJKeaGA3.cjs +0 -1
  188. package/dist/chunks/coordSystemLabel-C1jfhEh5.js +0 -29
  189. package/dist/chunks/externalizeComponent-Bl23ayrr.cjs +0 -2
  190. package/dist/chunks/holdSafety-BtoZ5We3.cjs +0 -1
  191. package/dist/chunks/holdSafety-Di1GZAWg.js +0 -37
  192. package/dist/chunks/joggingColors-CuT5u0H8.js +0 -135
  193. package/dist/chunks/joggingColors-ZDc_2UCp.cjs +0 -1
  194. package/dist/chunks/loadRobotSession-DVkuHA-V.js +0 -4624
  195. package/dist/chunks/loadRobotSession-cQNeaBOf.cjs +0 -3
  196. package/dist/chunks/robotActivationOf-DUHukd46.js +0 -371
  197. package/dist/chunks/robotActivationOf-DeJsI4H5.cjs +0 -1
  198. package/dist/chunks/robotModelSource-C2Mi0LtR.js +0 -1296
  199. package/dist/chunks/robotModelSource-D7VR89r_.cjs +0 -1
  200. package/dist/chunks/robotSafetyOf-Cb4qlwd_.cjs +0 -1
  201. package/dist/chunks/useEveryFrame-CHxg25f4.cjs +0 -1
  202. package/dist/chunks/useEveryFrame-DAuNawGP.js +0 -155
  203. package/dist/chunks/useSmoothedMotionState-Con0E5Bx.cjs +0 -1
@@ -0,0 +1 @@
1
+ "use strict";const P=require("react/jsx-runtime"),S=require("mobx-react-lite"),b=require("./RobotSessionProvider--AekyPqD.cjs"),f=require("./CurrentPoseBar-DoOUfRRs.cjs"),p=require("react"),q=require("react-i18next"),v=require("./externalizeComponent-CA_sHzyH.cjs"),x=require("./coordSystemLabel-BThpFG9n.cjs");function m(n){var u,d,l;const e=n.jogging,{t:r}=q.useTranslation(void 0,{i18n:v.i18n}),[o,s]=p.useState(e.selectedTcpId),[i,g]=p.useState(e.selectedCoordSystemId),c=e.tcpsById[o]?o:e.selectedTcpId,a=e.coordSystemsById[i]?i:e.selectedCoordSystemId,C=(l=(d=(u=e.jogger.motionStream.rapidlyChangingMotionState.execute)==null?void 0:u.details)==null?void 0:d.state)==null?void 0:l.kind,y=e.lastJogErrorTranslationKey?r(e.lastJogErrorTranslationKey):e.lastJogError;function I(){const t=e.tcpPoseIn(c,a);return!(t!=null&&t.position)||!t.orientation?null:{position:t.position,orientation:t.orientation}}return{getCurrentPose:I,tcp:e.tcps.length>0?{options:e.tcps.map(t=>({id:t.id,label:t.id})),value:c,onChange:s}:void 0,frame:{options:e.coordSystems.map(t=>({id:t.coordinate_system,label:x.coordSystemLabel(e,t)})),value:a,onChange:g},state:C,error:y}}const T=S.observer(function({session:e,...r}){const o=b.useRobotSessionOf(e),s=m(o);return P.jsx(f.CurrentPoseBar,{...s,...r})});exports.CurrentPose=T;exports.useCurrentPoseProps=m;
@@ -1,13 +1,14 @@
1
1
  import { jsx as y } from "react/jsx-runtime";
2
2
  import { observer as I } from "mobx-react-lite";
3
- import { c as S, a as P } from "./coordSystemLabel-C1jfhEh5.js";
4
- import { C as b } from "./CurrentPoseBar-Cb_Pk2jp.js";
3
+ import { a as S } from "./RobotSessionProvider-TVaKGzqa.js";
4
+ import { C as P } from "./CurrentPoseBar--HkZBGnN.js";
5
5
  import { useState as l } from "react";
6
- import { useTranslation as T } from "react-i18next";
7
- import { i as v } from "./externalizeComponent-CSzPVfuG.js";
6
+ import { useTranslation as b } from "react-i18next";
7
+ import { i as T } from "./externalizeComponent-CChY_1bN.js";
8
+ import { c as v } from "./coordSystemLabel-Bfy9MUsV.js";
8
9
  function h(n) {
9
- var d, p, m;
10
- const o = n.jogging, { t: r } = T(void 0, { i18n: v }), [e, s] = l(o.selectedTcpId), [i, u] = l(o.selectedCoordSystemId), a = o.tcpsById[e] ? e : o.selectedTcpId, c = o.coordSystemsById[i] ? i : o.selectedCoordSystemId, f = (m = (p = (d = o.jogger.motionStream.rapidlyChangingMotionState.execute) == null ? void 0 : d.details) == null ? void 0 : p.state) == null ? void 0 : m.kind, g = o.lastJogErrorTranslationKey ? r(o.lastJogErrorTranslationKey) : o.lastJogError;
10
+ var d, m, p;
11
+ const o = n.jogging, { t: e } = b(void 0, { i18n: T }), [r, s] = l(o.selectedTcpId), [i, u] = l(o.selectedCoordSystemId), a = o.tcpsById[r] ? r : o.selectedTcpId, c = o.coordSystemsById[i] ? i : o.selectedCoordSystemId, f = (p = (m = (d = o.jogger.motionStream.rapidlyChangingMotionState.execute) == null ? void 0 : d.details) == null ? void 0 : m.state) == null ? void 0 : p.kind, g = o.lastJogErrorTranslationKey ? e(o.lastJogErrorTranslationKey) : o.lastJogError;
11
12
  function C() {
12
13
  const t = o.tcpPoseIn(a, c);
13
14
  return !(t != null && t.position) || !t.orientation ? null : {
@@ -29,7 +30,7 @@ function h(n) {
29
30
  frame: {
30
31
  options: o.coordSystems.map((t) => ({
31
32
  id: t.coordinate_system,
32
- label: S(o, t)
33
+ label: v(o, t)
33
34
  })),
34
35
  value: c,
35
36
  onChange: u
@@ -38,14 +39,14 @@ function h(n) {
38
39
  error: g
39
40
  };
40
41
  }
41
- const F = I(function({
42
+ const L = I(function({
42
43
  session: o,
43
- ...r
44
+ ...e
44
45
  }) {
45
- const e = P(o), s = h(e);
46
- return /* @__PURE__ */ y(b, { ...s, ...r });
46
+ const r = S(o), s = h(r);
47
+ return /* @__PURE__ */ y(P, { ...s, ...e });
47
48
  });
48
49
  export {
49
- F as C,
50
+ L as C,
50
51
  h as u
51
52
  };
@@ -8,9 +8,10 @@ import { ContentCopyFilled as tn } from "@wandelbots/icons/ContentCopyFilled";
8
8
  import { Settings as on } from "@wandelbots/icons/Settings";
9
9
  import { memo as rn, useId as K, useRef as $, useState as j, useCallback as T } from "react";
10
10
  import { useTranslation as U } from "react-i18next";
11
- import { e as an } from "./externalizeComponent-CSzPVfuG.js";
12
- import { P as B, c as sn, u as ln, b as cn } from "./useEveryFrame-DAuNawGP.js";
13
- import { S as un } from "./SmallSelect-BdD9uLKK.js";
11
+ import { e as an } from "./externalizeComponent-CChY_1bN.js";
12
+ import { p as sn } from "./poseText-BxG4Caa-.js";
13
+ import { S as ln } from "./SmallSelect-BdD9uLKK.js";
14
+ import { P as B, a as cn, u as un } from "./useEveryFrame-D04ygIe7.js";
14
15
  import pn from "@mui/material/ListSubheader";
15
16
  import dn from "@mui/material/MenuItem";
16
17
  import hn from "@mui/material/Popover";
@@ -52,8 +53,8 @@ const X = { X: 0, Y: 1, Z: 2 };
52
53
  function Cn(n) {
53
54
  return n > Math.PI ? n - 2 * Math.PI : n < -Math.PI ? n + 2 * Math.PI : n;
54
55
  }
55
- function bn(n, e) {
56
- const { intrinsic: t, axes: r } = y(e), c = t ? [...r].reverse() : r, i = X[c[0]], s = X[c[1]], p = c[0] === c[2], a = p ? 3 - i - s : X[c[2]], h = (i - s) * (s - a) * (a - i) / 2, F = Math.hypot(...n) || 1, [M, A, v, b] = n.map((en) => en / F), I = [M, A, v], S = I[i] ?? 0, E = I[s] ?? 0, f = (I[a] ?? 0) * h, [O, g, _, w] = p ? [b, S, E, f] : [b - E, S + f, E + b, f - S];
56
+ function fn(n, e) {
57
+ const { intrinsic: t, axes: r } = y(e), c = t ? [...r].reverse() : r, i = X[c[0]], s = X[c[1]], p = c[0] === c[2], a = p ? 3 - i - s : X[c[2]], h = (i - s) * (s - a) * (a - i) / 2, F = Math.hypot(...n) || 1, [M, A, v, f] = n.map((en) => en / F), I = [M, A, v], S = I[i] ?? 0, E = I[s] ?? 0, b = (I[a] ?? 0) * h, [O, g, _, w] = p ? [f, S, E, b] : [f - E, S + b, E + f, b - S];
57
58
  let x = 2 * Math.atan2(Math.hypot(_, w), Math.hypot(O, g));
58
59
  const N = Math.atan2(g, O), P = Math.atan2(w, _);
59
60
  let l, u;
@@ -64,7 +65,7 @@ function Z({ children: n }) {
64
65
  return /* @__PURE__ */ o(pn, { children: n });
65
66
  }
66
67
  Z.muiSkipListHighlight = !0;
67
- function fn({
68
+ function bn({
68
69
  value: n,
69
70
  onChange: e
70
71
  }) {
@@ -173,7 +174,7 @@ function In({
173
174
  }
174
175
  ),
175
176
  r.type === "eulerAngles" && /* @__PURE__ */ o(
176
- fn,
177
+ bn,
177
178
  {
178
179
  value: r.eulerConvention,
179
180
  onChange: (a) => p({ eulerConvention: a })
@@ -213,7 +214,7 @@ function Nn(n, e) {
213
214
  case "quaternion":
214
215
  return Q(n).map((t) => L(t, 3));
215
216
  case "eulerAngles":
216
- return bn(
217
+ return fn(
217
218
  Q(n),
218
219
  e.eulerConvention
219
220
  ).map((t) => V(t, e.angleUnit));
@@ -306,10 +307,10 @@ function q({
306
307
  const t = K();
307
308
  return /* @__PURE__ */ d(C, { direction: "row", sx: { gap: "8px", alignItems: "center" }, children: [
308
309
  /* @__PURE__ */ o(nn, { id: t, children: n }),
309
- /* @__PURE__ */ o(un, { labelId: t, width: "172px", ...e })
310
+ /* @__PURE__ */ o(ln, { labelId: t, width: "172px", ...e })
310
311
  ] });
311
312
  }
312
- const Y = () => /* @__PURE__ */ o(J, { orientation: "vertical", flexItem: !1, sx: { height: "16px" } }), Gn = an(
313
+ const Y = () => /* @__PURE__ */ o(J, { orientation: "vertical", flexItem: !1, sx: { height: "16px" } }), Qn = an(
313
314
  ({
314
315
  getCurrentPose: n,
315
316
  tcp: e,
@@ -320,7 +321,7 @@ const Y = () => /* @__PURE__ */ o(J, { orientation: "vertical", flexItem: !1, sx
320
321
  onOrientationFormatChange: s,
321
322
  sx: p
322
323
  }) => {
323
- const { t: a } = U(), h = $(null), [F, M] = j(Sn), A = i ?? F, [v, b] = j(null), { copied: I, copy: S } = sn(), E = ln(() => JSON.stringify(n()), !0), f = JSON.parse(E), O = Pn(f, A), g = $({ tcp: e, frame: t, onOrientationFormatChange: s });
324
+ const { t: a } = U(), h = $(null), [F, M] = j(Sn), A = i ?? F, [v, f] = j(null), { copied: I, copy: S } = cn(), E = un(() => JSON.stringify(n()), !0), b = JSON.parse(E), O = Pn(b, A), g = $({ tcp: e, frame: t, onOrientationFormatChange: s });
324
325
  g.current = { tcp: e, frame: t, onOrientationFormatChange: s };
325
326
  const _ = T(
326
327
  (l) => {
@@ -337,10 +338,10 @@ const Y = () => /* @__PURE__ */ o(J, { orientation: "vertical", flexItem: !1, sx
337
338
  ), x = T((l) => {
338
339
  var u, m;
339
340
  M(l), (m = (u = g.current).onOrientationFormatChange) == null || m.call(u, l);
340
- }, []), N = T(() => b(null), []);
341
+ }, []), N = T(() => f(null), []);
341
342
  function P() {
342
343
  const l = n();
343
- l && S(cn(l));
344
+ l && S(sn(l));
344
345
  }
345
346
  return /* @__PURE__ */ d(
346
347
  C,
@@ -380,7 +381,7 @@ const Y = () => /* @__PURE__ */ o(J, { orientation: "vertical", flexItem: !1, sx
380
381
  "aria-label": a("CurrentPose.OrientationFormat.ti"),
381
382
  "aria-haspopup": "dialog",
382
383
  "aria-expanded": v !== null,
383
- onClick: () => b(h.current),
384
+ onClick: () => f(h.current),
384
385
  sx: { padding: "3px", margin: "-3px", color: "text.secondary" },
385
386
  children: /* @__PURE__ */ o(on, {})
386
387
  }
@@ -467,7 +468,7 @@ const Y = () => /* @__PURE__ */ o(J, { orientation: "vertical", flexItem: !1, sx
467
468
  {
468
469
  "aria-label": a("CurrentPose.Copy.bt"),
469
470
  onClick: P,
470
- disabled: !f,
471
+ disabled: !b,
471
472
  sx: {
472
473
  width: "30px",
473
474
  height: "30px",
@@ -501,5 +502,5 @@ const Y = () => /* @__PURE__ */ o(J, { orientation: "vertical", flexItem: !1, sx
501
502
  }
502
503
  );
503
504
  export {
504
- Gn as C
505
+ Qn as C
505
506
  };
@@ -0,0 +1 @@
1
+ "use strict";const t=require("react/jsx-runtime"),$=require("@mui/material/Divider"),Z=require("@mui/material/IconButton"),b=require("@mui/material/Stack"),G=require("@mui/material/Tooltip"),N=require("@mui/material/Typography"),J=require("@wandelbots/icons/ContentCopyFilled"),H=require("@wandelbots/icons/Settings"),d=require("react"),q=require("react-i18next"),K=require("./externalizeComponent-CA_sHzyH.cjs"),ee=require("./poseText-CwplkbDM.cjs"),ne=require("./SmallSelect-Dcsd7_6_.cjs"),_=require("./useEveryFrame-NeKiPXY-.cjs"),te=require("@mui/material/ListSubheader"),re=require("@mui/material/MenuItem"),oe=require("@mui/material/Popover"),ie=require("@wandelbots/mui"),se=require("@mui/material/Box"),D=["XYZ","XZY","YXZ","YZX","ZXY","ZYX","XYX","XZX","YXY","YZY","ZXZ","ZYZ"],ae=[...D.map(e=>`EULER_ANGLES_INTRINSIC_${e}`),...D.map(e=>`EULER_ANGLES_EXTRINSIC_${e}`)];function y(e){const n=e.slice(e.lastIndexOf("_")+1);return{intrinsic:e.includes("_INTRINSIC_"),axes:[...n]}}function z([e,n,r]){const o=Math.hypot(e,n,r);if(o<1e-12)return[0,0,0,1];const c=Math.sin(o/2)/o;return[e*c,n*c,r*c,Math.cos(o/2)]}const U={X:0,Y:1,Z:2};function le(e){return e>Math.PI?e-2*Math.PI:e<-Math.PI?e+2*Math.PI:e}function ce(e,n){const{intrinsic:r,axes:o}=y(n),c=r?[...o].reverse():o,i=U[c[0]],a=U[c[1]],p=c[0]===c[2],s=p?3-i-a:U[c[2]],x=(i-a)*(a-s)*(s-i)/2,F=Math.hypot(...e)||1,[L,R,I,m]=e.map(V=>V/F),S=[L,R,I],j=S[i]??0,f=S[a]??0,v=(S[s]??0)*x,[T,g,A,O]=p?[m,j,f,v]:[m-f,j+v,f+m,v-j];let C=2*Math.atan2(Math.hypot(A,O),Math.hypot(T,g));const E=Math.atan2(g,T),P=Math.atan2(O,A);let l,u;const h=1e-7;return Math.abs(C)<=h?(l=2*E,u=0):Math.abs(C-Math.PI)<=h?(l=-2*P,u=0):(l=E-P,u=E+P),p||(u*=x,C-=Math.PI/2),(r?[u,C,l]:[l,C,u]).map(le)}function X({children:e}){return t.jsx(te,{children:e})}X.muiSkipListHighlight=!0;function ue({value:e,onChange:n}){const{t:r}=q.useTranslation(),o=d.useId(),c=a=>{const{intrinsic:p,axes:s}=y(a);return r(p?"CurrentPose.EulerConvention.Intrinsic.lb":"CurrentPose.EulerConvention.Extrinsic.lb",{axes:s.join("")})},i=a=>ae.filter(p=>y(p).intrinsic===a).map(p=>t.jsx(re,{value:p,children:y(p).axes.join("")},p));return t.jsxs(ie.AdornedSelect,{label:r("CurrentPose.EulerConvention.lb"),labelId:o,value:e,renderValue:a=>c(a),onChange:a=>n(a.target.value),children:[t.jsx(X,{children:r("CurrentPose.EulerConvention.Intrinsic.hlb")}),i(!0),t.jsx(X,{children:r("CurrentPose.EulerConvention.Extrinsic.hlb")}),i(!1)]})}const pe=d.memo(de,(e,n)=>e.anchor===n.anchor&&e.open===n.open&&e.onClose===n.onClose&&e.onChange===n.onChange&&e.format.type===n.format.type&&e.format.angleUnit===n.format.angleUnit&&e.format.eulerConvention===n.format.eulerConvention);function de({anchor:e,open:n,onClose:r,format:o,onChange:c}){const{t:i}=q.useTranslation(),a=i("CurrentPose.OrientationFormat.ti"),p=s=>c({...o,...s});return t.jsxs(oe,{open:n,anchorEl:e,onClose:r,anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"bottom",horizontal:"left"},slotProps:{paper:{role:"dialog","aria-label":a,sx:s=>{var x;return{width:"264px",padding:"16px",display:"flex",flexDirection:"column",gap:"16px",borderRadius:"10px",border:`1px solid ${s.palette.divider}`,background:(x=s.palette.backgroundPaperElevation)==null?void 0:x[2],backgroundImage:"none",boxShadow:s.shadows[16]}}}},children:[t.jsx(N,{variant:"subtitle2",color:"text.primary",children:a}),t.jsx($,{}),t.jsxs(b,{sx:{gap:"8px"},children:[t.jsx(_.PanelSelect,{label:i("CurrentPose.Format.lb"),options:[{id:"rotationVector",label:i("CurrentPose.Format.RotationVector.lb")},{id:"eulerAngles",label:i("CurrentPose.Format.EulerAngles.lb")},{id:"quaternion",label:i("CurrentPose.Format.Quaternion.lb")}],value:o.type,onChange:s=>p({type:s}),disabled:!1}),o.type!=="quaternion"&&t.jsx(_.PanelSelect,{label:i("CurrentPose.AngleUnit.lb"),options:[{id:"rad",label:i("CurrentPose.AngleUnit.Radians.lb")},{id:"deg",label:i("CurrentPose.AngleUnit.Degrees.lb")}],value:o.angleUnit,onChange:s=>p({angleUnit:s}),disabled:!1}),o.type==="eulerAngles"&&t.jsx(ue,{value:o.eulerConvention,onChange:s=>p({eulerConvention:s})})]})]})}const xe={type:"rotationVector",angleUnit:"rad",eulerConvention:"EULER_ANGLES_EXTRINSIC_XYZ"};function w(e,n){const r=e.toFixed(n);return Number(r)===0?0 .toFixed(n):r}function B(e,n){return n==="deg"?`${w(e*180/Math.PI,1)}°`:`${w(e,3)} rad`}function he(e){switch(e.type){case"quaternion":return["Qx","Qy","Qz","Qw"];case"eulerAngles":return y(e.eulerConvention).axes.map(n=>`R${n.toLowerCase()}`);default:return["Rx","Ry","Rz"]}}function ge(e,n){switch(n.type){case"quaternion":return z(e).map(r=>w(r,3));case"eulerAngles":return ce(z(e),n.eulerConvention).map(r=>B(r,n.angleUnit));default:return e.map(r=>B(r,n.angleUnit))}}function Ce(e,n){const r=["x","y","z"].map((i,a)=>({label:i.toUpperCase(),value:e?w(e.position[a]??0,1):"–",kind:i})),o=e?ge(e.orientation,n):null,c=he(n).map((i,a)=>({label:i,value:(o==null?void 0:o[a])??"–",kind:"orientation"}));return[...r,...c]}const be={KIND_UNKNOWN:"success.main",RUNNING:"info.main",PAUSED_NEAR_COLLISION:"warning.main",PAUSED_NEAR_JOINT_LIMIT:"warning.main",PAUSED_NEAR_SINGULARITY:"warning.main"};function me({state:e,error:n}){const{t:r}=q.useTranslation(),o=e??"KIND_UNKNOWN",c=n||r(`Jogging.StreamStateSection.${o}.lb`),i=n?"error.main":be[o]??"text.secondary";return t.jsx(G,{title:n?c:"",placement:"top-end",children:t.jsxs(b,{direction:"row","data-testid":n?"JOG_ERROR":o,sx:{gap:"5px",alignItems:"center",minWidth:0},children:[t.jsx(se,{sx:{width:"6px",height:"6px",borderRadius:"50%",flexShrink:0,bgcolor:i}}),t.jsx(N,{variant:"caption",noWrap:!0,sx:{color:i,letterSpacing:"0.17px"},children:c})]})})}const k={letterSpacing:"0.17px"},ve={x:"error.main",y:"success.main",z:"info.main",orientation:"grey.600"};function Q({children:e,id:n}){return t.jsx(N,{id:n,variant:"caption",color:"text.secondary",noWrap:!0,sx:k,children:e})}function W({label:e,...n}){const r=d.useId();return t.jsxs(b,{direction:"row",sx:{gap:"8px",alignItems:"center"},children:[t.jsx(Q,{id:r,children:e}),t.jsx(ne.SmallSelect,{labelId:r,width:"172px",...n})]})}const M=()=>t.jsx($,{orientation:"vertical",flexItem:!1,sx:{height:"16px"}}),Ie=K.externalizeComponent(({getCurrentPose:e,tcp:n,frame:r,state:o,error:c,orientationFormat:i,onOrientationFormatChange:a,sx:p})=>{const{t:s}=q.useTranslation(),x=d.useRef(null),[F,L]=d.useState(xe),R=i??F,[I,m]=d.useState(null),{copied:S,copy:j}=_.useCopyText(),f=_.useEveryFrame(()=>JSON.stringify(e()),!0),v=JSON.parse(f),T=Ce(v,R),g=d.useRef({tcp:n,frame:r,onOrientationFormatChange:a});g.current={tcp:n,frame:r,onOrientationFormatChange:a};const A=d.useCallback(l=>{var u;return(u=g.current.tcp)==null?void 0:u.onChange(l)},[]),O=d.useCallback(l=>{var u;return(u=g.current.frame)==null?void 0:u.onChange(l)},[]),C=d.useCallback(l=>{var u,h;L(l),(h=(u=g.current).onOrientationFormatChange)==null||h.call(u,l)},[]),E=d.useCallback(()=>m(null),[]);function P(){const l=e();l&&j(ee.poseToText(l))}return t.jsxs(b,{ref:x,direction:"row","data-testid":"current-pose-bar",sx:[l=>{var u;return{alignItems:"center",justifyContent:"space-between",gap:"12px",padding:"8px 16px",minHeight:"54px",boxSizing:"border-box",borderRadius:"10px",border:`1px solid ${l.palette.divider}`,background:(u=l.palette.backgroundPaperElevation)==null?void 0:u[2],boxShadow:l.shadows[16]}},...Array.isArray(p)?p:[p]],children:[t.jsxs(b,{direction:"row",sx:{gap:"12px",alignItems:"center",minWidth:0},children:[t.jsx(Q,{children:s("CurrentPose.Title.lb")}),t.jsx(Z,{"aria-label":s("CurrentPose.OrientationFormat.ti"),"aria-haspopup":"dialog","aria-expanded":I!==null,onClick:()=>m(x.current),sx:{padding:"3px",margin:"-3px",color:"text.secondary"},children:t.jsx(H.Settings,{})}),n&&t.jsxs(t.Fragment,{children:[t.jsx(M,{}),t.jsx(W,{label:s("RobotControl.Tcp.lb"),options:n.options,value:n.value,onChange:A})]}),r&&t.jsxs(t.Fragment,{children:[t.jsx(M,{}),t.jsx(W,{label:s("CurrentPose.RelativeTo.lb"),options:r.options,value:r.value,onChange:O})]}),t.jsx(M,{}),t.jsx(b,{direction:"row","data-testid":"current-pose-values",sx:{gap:"12px",alignItems:"center",minWidth:0,overflow:"hidden"},children:T.map(({label:l,value:u,kind:h},Y)=>t.jsxs(b,{direction:"row",sx:{gap:h==="orientation"?"1px":"2px"},children:[t.jsx(N,{variant:"caption",sx:{...k,color:ve[h]},children:l}),t.jsx(N,{variant:"caption",noWrap:!0,sx:{...k,color:"text.secondary",fontVariantNumeric:"tabular-nums"},children:u})]},Y))}),t.jsx(G,{title:s("CurrentPose.Copied.lb"),open:S,disableHoverListener:!0,placement:"top",children:t.jsx("span",{children:t.jsx(Z,{"aria-label":s("CurrentPose.Copy.bt"),onClick:P,disabled:!v,sx:{width:"30px",height:"30px",padding:"5px",borderRadius:"10px",color:"text.secondary","& svg":{width:"20px",height:"20px"}},children:t.jsx(J.ContentCopyFilled,{})})})})]}),t.jsx(me,{state:o,error:c}),t.jsx(pe,{anchor:I,open:I!==null,onClose:E,format:R,onChange:C})]})});exports.CurrentPoseBar=Ie;
@@ -6,8 +6,8 @@ import { alpha as d } from "@mui/material/styles";
6
6
  import I from "@mui/material/Typography";
7
7
  import { Rotation as j } from "@wandelbots/icons/Rotation";
8
8
  import { SecondaryButton as y } from "@wandelbots/mui";
9
- import { e as v } from "./externalizeComponent-CSzPVfuG.js";
10
- import { u as J, J as S, a as k, j as u, b as R } from "./joggingColors-CuT5u0H8.js";
9
+ import { e as v } from "./externalizeComponent-CChY_1bN.js";
10
+ import { u as J, J as S, a as k, j as u, b as R } from "./joggingColors-sb6IFdj2.js";
11
11
  function $({
12
12
  axis: o,
13
13
  motion: r,
@@ -1 +1 @@
1
- "use strict";const o=require("react/jsx-runtime"),j=require("@mui/material/Box"),d=require("@mui/material/Button"),x=require("@mui/material/Stack"),l=require("@mui/material/styles"),m=require("@mui/material/Typography"),q=require("@wandelbots/icons/Rotation"),f=require("@wandelbots/mui"),I=require("./externalizeComponent-Bl23ayrr.cjs"),t=require("./joggingColors-ZDc_2UCp.cjs");function y({axis:e,motion:n,disabled:i}){const r=t.jogAxisColors[e];return o.jsx(j,{"aria-hidden":!0,sx:{opacity:i?.4:1,width:30,height:30,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:1,backgroundColor:l.alpha(r,.15),border:`1px solid ${l.alpha(r,.4)}`},children:o.jsx(m,{variant:"caption",sx:{color:r},children:n==="rotate"?`R${e}`:e.toUpperCase()})})}function R(e){return o.jsx(q.Rotation,{style:e.direction==="-"?{transform:"scaleX(-1)"}:void 0})}const v=I.externalizeComponent(e=>{const{motion:n="translate",disabled:i=!1}=e,{handlersFor:r,label:C,isPressed:b}=t.useJogControls(e);return o.jsx(x,{"data-testid":"jogging-buttons",sx:{gap:"16px",width:280,maxWidth:"100%"},children:t.JOG_AXES.map(a=>o.jsxs(x,{direction:"row",sx:{alignItems:"center",gap:"16px"},children:[o.jsx(y,{axis:a,motion:n,disabled:i}),t.JOG_DIRECTIONS.map(c=>{const s={axis:a,direction:c},u=b(s),g=n==="rotate"?R(s):void 0,h=t.jogAxisColors[a],p={backgroundColor:l.alpha(h,.25),borderColor:l.alpha(h,.4)};return o.jsx(f.SecondaryButton,{size:"large",disabled:i,"aria-label":C(s),"aria-pressed":u,startIcon:c==="-"?g:void 0,endIcon:c==="+"?g:void 0,...r(s),sx:{flex:1,touchAction:"none",userSelect:"none","& svg":{width:24,height:24},[`& .${d.buttonClasses.startIcon}`]:{marginLeft:"-6px"},[`& .${d.buttonClasses.endIcon}`]:{marginRight:"-6px"},...u&&{...p,[`&.${d.buttonClasses.disabled}`]:p}},children:t.jogHandleName(s,n)},c)})]},a))})});exports.JoggingButtons=v;
1
+ "use strict";const o=require("react/jsx-runtime"),j=require("@mui/material/Box"),d=require("@mui/material/Button"),x=require("@mui/material/Stack"),l=require("@mui/material/styles"),m=require("@mui/material/Typography"),q=require("@wandelbots/icons/Rotation"),f=require("@wandelbots/mui"),I=require("./externalizeComponent-CA_sHzyH.cjs"),t=require("./joggingColors-Cqpfuw4G.cjs");function y({axis:e,motion:n,disabled:i}){const r=t.jogAxisColors[e];return o.jsx(j,{"aria-hidden":!0,sx:{opacity:i?.4:1,width:30,height:30,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:1,backgroundColor:l.alpha(r,.15),border:`1px solid ${l.alpha(r,.4)}`},children:o.jsx(m,{variant:"caption",sx:{color:r},children:n==="rotate"?`R${e}`:e.toUpperCase()})})}function R(e){return o.jsx(q.Rotation,{style:e.direction==="-"?{transform:"scaleX(-1)"}:void 0})}const v=I.externalizeComponent(e=>{const{motion:n="translate",disabled:i=!1}=e,{handlersFor:r,label:C,isPressed:b}=t.useJogControls(e);return o.jsx(x,{"data-testid":"jogging-buttons",sx:{gap:"16px",width:280,maxWidth:"100%"},children:t.JOG_AXES.map(a=>o.jsxs(x,{direction:"row",sx:{alignItems:"center",gap:"16px"},children:[o.jsx(y,{axis:a,motion:n,disabled:i}),t.JOG_DIRECTIONS.map(c=>{const s={axis:a,direction:c},u=b(s),g=n==="rotate"?R(s):void 0,h=t.jogAxisColors[a],p={backgroundColor:l.alpha(h,.25),borderColor:l.alpha(h,.4)};return o.jsx(f.SecondaryButton,{size:"large",disabled:i,"aria-label":C(s),"aria-pressed":u,startIcon:c==="-"?g:void 0,endIcon:c==="+"?g:void 0,...r(s),sx:{flex:1,touchAction:"none",userSelect:"none","& svg":{width:24,height:24},[`& .${d.buttonClasses.startIcon}`]:{marginLeft:"-6px"},[`& .${d.buttonClasses.endIcon}`]:{marginRight:"-6px"},...u&&{...p,[`&.${d.buttonClasses.disabled}`]:p}},children:t.jogHandleName(s,n)},c)})]},a))})});exports.JoggingButtons=v;
@@ -0,0 +1 @@
1
+ "use strict";const p=require("react/jsx-runtime"),_=require("@mui/material/Box"),pt=require("@mui/material/Typography"),q=require("@react-three/fiber"),M=require("react"),dt=require("react-i18next"),m=require("three"),ft=require("./externalizeComponent-CA_sHzyH.cjs"),xt=require("./useWebGLRenderer-CtddVDDb.cjs"),E=require("./joggingColors-Cqpfuw4G.cjs"),$=require("@mui/material/styles"),tt=new m.Vector3(0,1,0),G=.26,et=.1,gt={x:"X",y:"Y",z:"Z"};function F(t){var e;return((e=E.cartesianAxisColors[gt[t]].buttonBackgroundColor)==null?void 0:e.default)??"currentColor"}const yt=200;function N(t){const e=t/yt;return{marginPx:30*e,gripPx:30*e,grab:{innerPx:10*e,beyondTipPx:10*e,minTipPx:16*e},labelFontPx:Math.max(10,13*e)}}function mt(t,e,n){return Math.max(1,Math.min(t,e)/2-n)}function bt(t,e){const{gripPx:n,grab:c}=N(t);return{radiusPx:e,gripPx:n,headLength:G,...c}}function St(t,e){const{gripPx:n,grab:c}=N(t);return{radiusPx:e,gripPx:n,beyondTipPx:c.beyondTipPx,headLength:G}}function T(t,e){return n=>{n?t.current.set(e,n):t.current.delete(e)}}const R=t=>`${t.axis}${t.direction}`,nt=t=>`label:${t}`,D=[0,1],k=(t,e)=>`half:${R(t)}:${e}`,ot=t=>`halo:${R(t)}`,st=t=>`focus:${R(t)}`,C="polygon(0 0, 0 0, 0 0)";function rt(t,{isPressed:e,hovered:n,disabled:c}){const r=e(t),o=!c&&(r||E.isSameJogHandle(n,t));return{pressed:r,lit:o}}function at(t,{pressed:e,lit:n}){return e?$.alpha(t,.25):n?$.alpha(t,.12):"transparent"}function At(t,e){return[R(t),...D.map(c=>k(t,c))].flatMap(c=>e.current.get(c)??[])}function ct(t,{onHover:e,handlersFor:n,overlay:c}){const r=n(t,o=>At(t,c).some(a=>a.contains(o)));return{...r,onPointerEnter:()=>e(t),onPointerLeave:o=>{e(null),r.onPointerLeave(o)}}}const L=t=>({cursor:t?"default":"pointer",touchAction:"none",userSelect:"none"}),it=t=>`2px solid ${t.palette.primary.main}`,J={x:new m.Vector3(1,0,0),y:new m.Vector3(0,1,0),z:new m.Vector3(0,0,1)};function Mt(t,e,n=new m.Quaternion){return n.copy(t).invert().multiply(e)}const Et=new m.Quaternion().setFromRotationMatrix(new m.Matrix4().makeBasis(new m.Vector3(1,0,0),new m.Vector3(0,0,-1),new m.Vector3(0,1,0))),B=new m.Quaternion,jt=new m.Quaternion;function wt(t){return t.up.z>.5?jt:Et}function Rt(t,e=new m.Quaternion){return t.getWorldQuaternion(B),Mt(B,wt(t),e)}function Ot(t,e,n=new m.Quaternion){return n.copy(t).multiply(e)}const _t=1e-8;function Q(t,e){return t?Math.abs(t.dot(e))<1-_t:!0}function vt(t){const{disabled:e,label:n,overlay:c,size:r}=t,o=$.useTheme(),{gripPx:a}=N(r);return E.JOG_AXES.flatMap(u=>E.JOG_DIRECTIONS.map(s=>{const l={axis:u,direction:s},f=rt(l,t),i=ct(l,t);return p.jsxs(M.Fragment,{children:[p.jsx(_,{component:"span","aria-hidden":!0,ref:T(c,ot(l)),sx:{position:"absolute",inset:0,clipPath:C,pointerEvents:"none",background:at(F(u),f)}}),D.map(h=>p.jsx(_,{component:"span","aria-hidden":!0,ref:T(c,k(l,h)),...i,sx:{position:"absolute",inset:0,clipPath:C,...L(e)}},h)),p.jsx(_,{component:"button",type:"button",ref:T(c,R(l)),disabled:e,"aria-label":n(l),"aria-pressed":f.pressed,...i,sx:{position:"absolute",width:a,height:a,transform:"translate(-50%, -50%)",padding:0,border:"none",borderRadius:"50%",background:"transparent","&:focus-visible":{outline:it(o)},"&[data-band='shown']:focus-visible":{outline:"none"},...L(e)}}),p.jsx(_,{component:"svg","aria-hidden":!0,sx:{position:"absolute",left:0,top:0,width:r,height:r,overflow:"visible",pointerEvents:"none",display:"none",zIndex:100,"button[data-band='shown']:focus-visible + &":{display:"block"}},children:p.jsx("path",{ref:T(c,st(l)),fill:"none",stroke:o.palette.primary.main,strokeWidth:2,strokeLinejoin:"round"})})]},R(l))}))}const P=.8,U=.45,lt=2.25,ut={x:[new m.Vector3(0,1,0),new m.Vector3(0,0,1)],y:[new m.Vector3(-1,0,0),new m.Vector3(0,0,1)],z:[new m.Vector3(1,0,0),new m.Vector3(0,1,0)]};function H(t){const e=t==="+"?U:U+Math.PI,n=e+lt;return{start:e,end:n,head:t==="+"?n:e}}const It=new m.Vector3,V=new m.Vector3,Tt=new m.Vector3;function Gt(t,e=24){const n=[];for(const c of E.JOG_AXES){const[r,o]=ut[c],a=s=>It.copy(r).multiplyScalar(Math.cos(s)*P).addScaledVector(o,Math.sin(s)*P).applyQuaternion(t),u=Math.abs(Tt.copy(J[c]).applyQuaternion(t).z);for(const s of E.JOG_DIRECTIONS){const{start:l,end:f,head:i}=H(s),h=[];for(let A=0;A<=e;A++){const w=a(l+(f-l)*A/e);h.push({x:w.x+0,y:-w.y+0,depth:w.z})}const g=a(i),d={x:g.x+0,y:-g.y+0,depth:g.z},x=s==="+"?1:-1;V.copy(r).multiplyScalar(-Math.sin(i)*x).addScaledVector(o,Math.cos(i)*x).applyQuaternion(t);const y=Math.hypot(V.x,V.y),b=y>1e-9?V.x/y:0,S=y>1e-9?-V.y/y:0;n.push({axis:c,direction:s,points:h,head:{...d,dx:b+0,dy:S+0},openness:u})}}return n}function Pt(t,e,n){let c={distance:Number.POSITIVE_INFINITY,depth:0};for(let r=1;r<t.length;r++){const o=t[r-1],a=t[r],u=(a.x-o.x)**2+(a.y-o.y)**2,s=u===0?0:Math.min(1,Math.max(0,((e-o.x)*(a.x-o.x)+(n-o.y)*(a.y-o.y))/u)),l=Math.hypot(e-(o.x+s*(a.x-o.x)),n-(o.y+s*(a.y-o.y)));l<c.distance&&(c={distance:l,depth:o.depth+s*(a.depth-o.depth)})}return c}function Vt(t,e){const n=t.length,c=t.map(()=>new Array(n).fill(!1));for(let s=0;s<n;s++)for(let l=s+1;l<n;l++){if(t[s].arc===t[l].arc)continue;let f=0;for(const i of t[s].line){const h=Pt(t[l].line,i.x,i.y);h.distance<e&&(f+=i.depth-h.depth)}f>0?c[s][l]=!0:f<0&&(c[l][s]=!0)}const r=t.map(({line:s})=>s.reduce((l,f)=>l+f.depth,0)/s.length),o=(s,l)=>r[s]-r[l],a=new Array(n).fill(0),u=new Set(t.keys());for(let s=1;u.size>0;s++){const l=[...u],f=l.filter(h=>!l.some(g=>c[h][g])),i=(f.length>0?f:l).sort(o)[0];a[i]=s,u.delete(i)}return a}const W=8;function z(t,e){const n=[...t];if(e>=0){const r=n[n.length-1],o=n[n.length-2],a=Math.hypot(r.x-o.x,r.y-o.y)||1;return n.push({x:r.x+(r.x-o.x)/a*e,y:r.y+(r.y-o.y)/a*e,depth:r.depth}),n}let c=-e;for(;n.length>2;){const r=n[n.length-1],o=n[n.length-2],a=Math.hypot(r.x-o.x,r.y-o.y);if(a>c){const u=c/a;return n[n.length-1]={x:r.x+(o.x-r.x)*u,y:r.y+(o.y-r.y)*u,depth:r.depth+(o.depth-r.depth)*u},n}c-=a,n.pop()}return n}const X=(t,e)=>z([...t].reverse(),e).reverse();function Ft(t,e){const n=e/2,c=[],r=[],o=[];let a={x:0,y:0};for(const[s,l]of t.entries()){const f=t[Math.max(0,s-1)],i=t[Math.min(t.length-1,s+1)],h=i.x-f.x,g=i.y-f.y,d=Math.hypot(h,g);d>1e-9&&(a={x:-g/d,y:h/d}),o.push(a),c.push({x:l.x+a.x*n,y:l.y+a.y*n}),r.push({x:l.x-a.x*n,y:l.y-a.y*n})}const u=(s,l)=>{const f=o[s],i={x:f.y,y:-f.x},h=l?1:-1;return Array.from({length:W-1},(g,d)=>{const x=Math.PI*(d+1)/W,y=Math.cos(x)*h,b=Math.sin(x)*h;return{x:t[s].x+(f.x*y+i.x*b)*n,y:t[s].y+(f.y*y+i.y*b)*n}})};return(s,l)=>[...c.slice(s,l+1),...l===t.length-1?u(l,!0):[],...r.slice(s,l+1).reverse(),...s===0?u(s,!1):[]]}function Nt(t,e){return[{from:0,to:Math.min(t-1,e+1)},{from:Math.max(0,e-1),to:t-1}]}function $t(t,{radiusPx:e,gripPx:n,beyondTipPx:c,headLength:r}){const o=n/2,a=r/2*e+c-o,u=c-o,s=t.map(d=>{const x=d.points.map(S=>({x:S.x*e,y:S.y*e,depth:S.depth})),y=x[x.length>>1],b=d.direction==="+"?X(z(x,a),u):z(X(x,a),u);return{line:b,middle:b.indexOf(y)}}),l=s.map(({line:d})=>d),f=t.map(d=>2*P*e*d.openness>=n),i=l.flatMap((d,x)=>f[x]?Nt(d.length,s[x].middle).map(({from:y,to:b})=>({arc:x,from:y,to:b,line:d.slice(y,b+1)})):[]),h=Vt(i,n),g=t.map((d,x)=>x).sort((d,x)=>t[d].head.depth-t[x].head.depth);return t.map((d,x)=>{if(!f[x])return null;const y=Ft(l[x],n),b=i.flatMap((S,A)=>S.arc===x?[{...S,layer:h[A]}]:[]);return{band:y(0,l[x].length-1),halves:b.map(({from:S,to:A,layer:w})=>({polygon:y(S,A),layer:w})),head:{x:d.head.x*e,y:d.head.y*e},headLayer:i.length+1+g.indexOf(x)}})}function ht(t,e,n,c){const r=M.useRef(null),o=q.useThree(a=>a.invalidate);M.useEffect(()=>{r.current=null,o()},[c,o]),M.useEffect(()=>{let a=requestAnimationFrame(function u(){const s=t.current;s&&Q(r.current,s)&&o(),a=requestAnimationFrame(u)});return()=>cancelAnimationFrame(a)},[t,o]),q.useFrame(()=>{const a=t.current;!a||!e.current||Q(r.current,a)&&(e.current.quaternion.copy(a),n(a)&&(r.current=a.clone()))})}const K=.03;function Ct({orientation:t,lit:e,disabled:n,size:c,radius:r,overlay:o}){const a=M.useRef(null),u=c/2,s=i=>`${(u+i).toFixed(2)}px`,l=i=>`polygon(${i.map(h=>`${s(h.x)} ${s(h.y)}`).join(", ")})`,f=i=>`M${i.map(h=>`${(u+h.x).toFixed(2)} ${(u+h.y).toFixed(2)}`).join("L")}Z`;return ht(t,a,i=>{let h=!0;const g=Gt(i),d=$t(g,St(c,r));for(const[x,y]of g.entries()){const b=o.current.get(R(y)),S=o.current.get(ot(y)),A=o.current.get(st(y)),w=D.map(v=>o.current.get(k(y,v)));if(!b||!S||!A||w.some(v=>!v)){h=!1;continue}const j=d[x];b.style.left=s(y.head.x*r),b.style.top=s(y.head.y*r),b.style.zIndex=j?String(j.headLayer):"0",b.style.pointerEvents=j?"":"none",b.dataset.band=j?"shown":"none",S.style.clipPath=j?l(j.band):C,A.setAttribute("d",j?f(j.band):"");for(const[v,I]of w.entries()){if(!I)continue;const O=j==null?void 0:j.halves[v];I.style.clipPath=O?l(O.polygon):C,I.style.zIndex=O?String(O.layer):"0",I.style.pointerEvents=O?"":"none"}}return h},`${c}:${r}`),p.jsxs("group",{ref:a,children:[p.jsxs("mesh",{children:[p.jsx("sphereGeometry",{args:[.07,16,16]}),p.jsx("meshBasicMaterial",{color:"#c4c8d0"})]}),E.JOG_AXES.map(i=>p.jsx(Jt,{axis:i,color:F(i),lit:(e==null?void 0:e.axis)===i?e.direction:null,disabled:n},i))]})}function Jt({axis:t,color:e,lit:n,disabled:c}){const r=M.useMemo(()=>{const[o,a]=ut[t];return new m.Quaternion().setFromRotationMatrix(new m.Matrix4().makeBasis(o,a,J[t]))},[t]);return p.jsx("group",{quaternion:r,children:E.JOG_DIRECTIONS.map(o=>{const a=n===o,u=a?1:c?.35:.8,s=a?K*1.5:K;return p.jsxs("group",{children:[p.jsxs("mesh",{rotation:[0,0,H(o).start],children:[p.jsx("torusGeometry",{args:[P,s,12,48,lt]}),p.jsx("meshBasicMaterial",{color:e,transparent:!0,opacity:u})]}),p.jsx(qt,{direction:o,color:e,opacity:u,lit:a})]},o)})})}function qt({direction:t,color:e,opacity:n,lit:c}){const{position:r,rotation:o}=M.useMemo(()=>{const{head:a}=H(t),u=t==="+"?1:-1;return{position:new m.Vector3(Math.cos(a)*P,Math.sin(a)*P,0),rotation:new m.Quaternion().setFromUnitVectors(tt,new m.Vector3(-Math.sin(a)*u,Math.cos(a)*u,0))}},[t]);return p.jsxs("mesh",{position:r,quaternion:o,scale:c?1.2:1,children:[p.jsx("coneGeometry",{args:[et,G,20]}),p.jsx("meshBasicMaterial",{color:e,transparent:!0,opacity:n})]})}function Lt(t){const{disabled:e,label:n,overlay:c,size:r}=t,o=$.useTheme(),{gripPx:a,labelFontPx:u}=N(r);return p.jsxs(p.Fragment,{children:[E.JOG_AXES.map(s=>p.jsx(_,{component:"span","aria-hidden":!0,ref:T(c,nt(s)),sx:{position:"absolute",transform:"translate(-50%, -50%)",pointerEvents:"none",fontSize:u,color:F(s),opacity:e?.4:1},children:s.toUpperCase()},s)),E.JOG_AXES.flatMap(s=>E.JOG_DIRECTIONS.map(l=>{const f={axis:s,direction:l},i=rt(f,t);return p.jsx(_,{component:"button",type:"button",ref:T(c,R(f)),disabled:e,"aria-label":n(f),"aria-pressed":i.pressed,...ct(f,t),sx:{position:"absolute",height:a,transformOrigin:"0 50%",padding:0,borderRadius:`${a/2}px`,border:"none",background:at(F(s),i),"&:focus-visible":{outline:it(o)},...L(e)}},R(f))}))]})}function zt(t){const e=[];for(const n of E.JOG_AXES)for(const c of E.JOG_DIRECTIONS){const r=J[n].clone().multiplyScalar(c==="+"?1:-1).applyQuaternion(t);e.push({axis:n,direction:c,x:r.x+0,y:-r.y+0,depth:r.z})}return e}function Dt(t,e){const{radiusPx:n,gripPx:c,innerPx:r,beyondTipPx:o,minTipPx:a,headLength:u}=e,s=t.map(i=>{const h=Math.hypot(i.x,i.y)*n;return{tip:h,angle:Math.atan2(i.y,i.x),start:r,end:h+o,depth:i.depth,grabbed:h>=a}});for(const[i,h]of s.entries())for(const g of s.slice(i+1)){if(!h.grabbed||!g.grabbed)continue;const[d,x]=h.tip<=g.tip?[h,g]:[g,h],y=h.angle-g.angle,b=d.tip*Math.abs(Math.sin(y));if(Math.cos(y)<=0||b>=c)continue;const S=x.tip*(1-u);if(d.tip>S){const A=h.depth<g.depth?h:g;A.grabbed=!1}else{const A=(d.tip+S)/2;d.end=Math.min(d.end,A),x.start=Math.max(x.start,A)}}const l=s.map((i,h)=>h);l.sort((i,h)=>s[i].depth-s[h].depth);const f=new Map(l.map((i,h)=>[i,h+1]));return s.map((i,h)=>!i.grabbed||i.end<=i.start?null:{x:Math.cos(i.angle)*i.start,y:Math.sin(i.angle)*i.start,length:i.end-i.start,angle:i.angle,layer:f.get(h)??0})}const Y=.035,Z=1.28;function kt({orientation:t,lit:e,disabled:n,size:c,radius:r,overlay:o}){const a=M.useRef(null),u=c/2;return ht(t,a,s=>{let l=!0;const f=zt(s),i=Dt(f,bt(c,r));for(const[h,g]of f.entries()){const d=o.current.get(R(g)),x=i[h];if(d?x?(d.style.left=`${u+x.x}px`,d.style.top=`${u+x.y}px`,d.style.width=`${x.length}px`,d.style.transform=`translateY(-50%) rotate(${x.angle}rad)`,d.style.zIndex=String(x.layer),d.style.pointerEvents=""):d.style.pointerEvents="none":l=!1,g.direction!=="+")continue;const y=o.current.get(nt(g.axis));y?(y.style.left=`${u+g.x*r*Z}px`,y.style.top=`${u+g.y*r*Z}px`):l=!1}return l},`${c}:${r}`),p.jsxs("group",{ref:a,children:[p.jsxs("mesh",{children:[p.jsx("sphereGeometry",{args:[.07,16,16]}),p.jsx("meshBasicMaterial",{color:"#c4c8d0"})]}),E.JOG_AXES.map(s=>p.jsx(Ht,{axis:s,color:F(s),lit:(e==null?void 0:e.axis)===s?e.direction:null,disabled:n},s))]})}function Ht({axis:t,color:e,lit:n,disabled:c}){const r=M.useMemo(()=>new m.Quaternion().setFromUnitVectors(tt,J[t]),[t]),o=1-G;return p.jsx("group",{quaternion:r,children:E.JOG_DIRECTIONS.map(a=>{const u=n===a,s=u?1:c?.35:.8,l=u?Y*1.5:Y;return p.jsxs("group",{rotation:[a==="+"?0:Math.PI,0,0],children:[p.jsxs("mesh",{position:[0,o/2,0],children:[p.jsx("cylinderGeometry",{args:[l,l,o,12]}),p.jsx("meshBasicMaterial",{color:e,transparent:!0,opacity:s})]}),p.jsxs("mesh",{position:[0,1-G/2,0],scale:u?1.2:1,children:[p.jsx("coneGeometry",{args:[et,G,20]}),p.jsx("meshBasicMaterial",{color:e,transparent:!0,opacity:s})]})]},a)})})}const Bt=new m.Quaternion;function Qt(t,e=Bt){const n=M.useRef(e);return n.current=e,M.useMemo(()=>{const c=new m.Quaternion;return{get current(){const r=t.current;if(!r)return null;const o=n.current;return Ot(r,typeof o=="function"?o():o,c)}}},[t])}const Ut=3e3;function Wt(t){const[e,n]=M.useState(()=>t.current!==null);return M.useEffect(()=>{if(e)return;let c=requestAnimationFrame(function o(){t.current!==null?n(!0):c=requestAnimationFrame(o)});const r=setTimeout(()=>{t.current===null&&console.warn("JoggingGizmo has no orientation, so it stays disabled. Put a JoggingGizmoOrientation with the same ref into the app's 3D scene.")},Ut);return()=>{cancelAnimationFrame(c),clearTimeout(r)}},[e,t]),e}const Xt=ft.externalizeComponent(({orientation:t,frameQuaternion:e,motion:n="translate",onJogStart:c,onJogStop:r,activeHandle:o,disabled:a=!1,size:u=200,onWebGLUnavailable:s})=>{const{t:l}=dt.useTranslation(),{unavailable:f,makeRenderer:i}=xt.useWebGLRenderer({onWebGLUnavailable:s}),h=Wt(t),g=a||!h,d=Qt(t,e),{held:x,handlersFor:y,label:b,isPressed:S}=E.useJogControls({motion:n,onJogStart:c,onJogStop:r,activeHandle:o,disabled:g}),[A,w]=M.useState(null);M.useEffect(()=>w(null),[n]);const j=n==="rotate"?Ct:kt,v=n==="rotate"?vt:Lt,I=M.useRef(new Map),O=mt(u,u,N(u).marginPx);return f?p.jsx(_,{"data-testid":"jogging-gizmo-unavailable",sx:{width:u,height:u,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",textAlign:"center"},children:p.jsx(pt,{variant:"body2",color:"text.secondary",children:l("JoggingGizmo.WebGLUnavailable.lb")})}):p.jsxs(_,{"data-testid":"jogging-gizmo",sx:{position:"relative",width:u,height:u,flexShrink:0,isolation:"isolate"},children:[p.jsx(q.Canvas,{orthographic:!0,flat:!0,frameloop:"demand",camera:{position:[0,0,10],up:[0,1,0],zoom:O,near:.1,far:100},gl:i,style:{position:"absolute",inset:0,pointerEvents:"none"},children:p.jsx(j,{orientation:d,lit:x??o??A,disabled:g,size:u,radius:O,overlay:I})}),p.jsx(v,{isPressed:S,hovered:A,disabled:g,size:u,onHover:w,handlersFor:y,label:b,overlay:I})]})});exports.JoggingGizmo=Xt;exports.novaAxesSeenBy=Rt;