@alfadocs/ui-kit 1.149.0 → 1.150.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (183) hide show
  1. package/dist/_chunks/{ai-summary-panel-Cdsve-XN.js → ai-summary-panel-D-RNe-_n.js} +3 -3
  2. package/dist/_chunks/{anamnesis-summary-rows-QCv6zW-J.js → anamnesis-summary-rows-CE-i9j-s.js} +2 -2
  3. package/dist/_chunks/{appointment-card-HOZrABrQ.js → appointment-card-BPZggqck.js} +2 -2
  4. package/dist/_chunks/{appointment-details-panel.history-BxNqcA-r.js → appointment-details-panel.history-BO31ZFQp.js} +2 -2
  5. package/dist/_chunks/{appointment-details-panel.identity--_j07UG1.js → appointment-details-panel.identity-C9kWtC6m.js} +90 -78
  6. package/dist/_chunks/appointment-peek-CGJ6kUvM.js +213 -0
  7. package/dist/_chunks/{appointment-timeline-CuZW-CGT.js → appointment-timeline-ynFqcw0S.js} +3 -3
  8. package/dist/_chunks/{appointment-tray-CFCxukwq.js → appointment-tray-Dx5VDREk.js} +2 -2
  9. package/dist/_chunks/{balance-badge-cell-BPz9bQAB.js → balance-badge-cell-DiyJQcmA.js} +2 -2
  10. package/dist/_chunks/{calendar-appointment-editor-dialog-Dx9_KIWA.js → calendar-appointment-editor-dialog-BfoEpFVx.js} +360 -356
  11. package/dist/_chunks/{calendar-editor-discard-host-DWS_kM-a.js → calendar-editor-discard-host-DO506cJu.js} +4 -4
  12. package/dist/_chunks/{calendar-waiting-list-panel-BKBHfBpn.js → calendar-waiting-list-panel-CyMTv2y3.js} +7 -7
  13. package/dist/_chunks/{calendar-workspace.model-4zmA3BFE.js → calendar-workspace.model-X3aXbDTo.js} +2 -2
  14. package/dist/_chunks/{calendar.sheets-lgAqJB34.js → calendar.sheets-C8x8kPb4.js} +10 -10
  15. package/dist/_chunks/{calls-panel-BTTfHnPD.js → calls-panel-Bpemmnpd.js} +4 -4
  16. package/dist/_chunks/{care-plan-card-2U2LuIJD.js → care-plan-card-DJXNWjKB.js} +3 -3
  17. package/dist/_chunks/{care-plan-entry-card-CUAlQv1c.js → care-plan-entry-card-W5QvNv8m.js} +2 -2
  18. package/dist/_chunks/{communications-panel-DDzUyoHi.js → communications-panel-Cd0TBEhL.js} +2 -2
  19. package/dist/_chunks/{control-room-rail-BQvaYowi.js → control-room-rail-4W1MFY-g.js} +3 -3
  20. package/dist/_chunks/{document-preview-oSuJsJ3k.js → document-preview-Zws6CHhK.js} +3 -3
  21. package/dist/_chunks/{editable-description-BsSjLnSx.js → editable-description-B2F54K4T.js} +34 -33
  22. package/dist/_chunks/{entity-summary-CZmGcWi2.js → entity-summary-BNnTP1F6.js} +62 -50
  23. package/dist/_chunks/feature-preview-switch-PKeLaFry.js +75 -0
  24. package/dist/_chunks/{file-manager-Cp3Z4VvM.js → file-manager-DzOCQBAO.js} +163 -178
  25. package/dist/_chunks/folder-CH9PJHou.js +36 -0
  26. package/dist/_chunks/{help-me-write-templates-DlA54nu5.js → help-me-write-templates-B_wMJ82X.js} +2 -2
  27. package/dist/_chunks/message-square-warning-DsGGfd0K.js +22 -0
  28. package/dist/_chunks/{notes-panel-Cw06dLDm.js → notes-panel-BguRX8VC.js} +374 -341
  29. package/dist/_chunks/{optical-prescription-DZvauMiM.js → optical-prescription-BzGnlIjq.js} +2 -2
  30. package/dist/_chunks/{panel-header-CbtlTe85.js → panel-header-DTc5OFUg.js} +78 -66
  31. package/dist/_chunks/{panel-subview-DjBwNV16.js → panel-subview-Om_yZvFG.js} +2 -2
  32. package/dist/_chunks/{patient-account-settings-Do0QbDJe.js → patient-account-settings-YKnBzmwE.js} +3 -3
  33. package/dist/_chunks/{patient-check-in-resume-Bxy1_Pfo.js → patient-check-in-resume-DERfQbp5.js} +5 -5
  34. package/dist/_chunks/{patient-details-Cj3dp9GB.js → patient-details-BUD0UbmT.js} +3 -3
  35. package/dist/_chunks/{patient-field-row-DDjsUsc_.js → patient-field-row-DytaHdGw.js} +201 -200
  36. package/dist/_chunks/{patient-summary-card-roM9Esfb.js → patient-summary-card-7Werxl48.js} +126 -139
  37. package/dist/_chunks/{payment-request-card-C9VglWsV.js → payment-request-card-BF3rakTQ.js} +2 -2
  38. package/dist/_chunks/{portal-details-CKF4yFHs.js → portal-details-C1QQGPQf.js} +3 -3
  39. package/dist/_chunks/{portal-documents-DvpAwmSI.js → portal-documents-CzEuCaqv.js} +3 -3
  40. package/dist/_chunks/{portal-parts-Cvu4PfIY.js → portal-parts-BMW4t57s.js} +2 -2
  41. package/dist/_chunks/{privacy-mask-zVh0ntm0.js → privacy-mask-CrjD5PYW.js} +2 -2
  42. package/dist/_chunks/{radiograph-panel.agent-BUZPsuSP.js → radiograph-panel.agent-Kl1M0dtT.js} +3 -3
  43. package/dist/_chunks/{registry-connection-panel-ACOsXu3F.js → registry-connection-panel-kdKbGQE6.js} +3 -3
  44. package/dist/_chunks/{reserved.agent-DjvapRF1.js → reserved.agent-CW0frsMv.js} +2 -2
  45. package/dist/_chunks/{reviews-panel-Cw5ygAxs.js → reviews-panel-54AFY6uy.js} +2 -2
  46. package/dist/_chunks/{rich-text-editor-eGdYDPK2.js → rich-text-editor-DCQEpaIv.js} +1398 -1280
  47. package/dist/_chunks/{task-editor-4zFL10oM.js → task-editor-CIHQQRtP.js} +219 -210
  48. package/dist/_chunks/{tasks-panel-BDPQPOP6.js → tasks-panel-Bc_odkQN.js} +2 -2
  49. package/dist/_chunks/text-area-DbxGkpzE.js +269 -0
  50. package/dist/_chunks/{tool-rail-DjPEiBa2.js → tool-rail-CJBtqzMs.js} +337 -320
  51. package/dist/_chunks/{transaction-chip-CkYd-3ky.js → transaction-chip-6jToArJn.js} +45 -43
  52. package/dist/_chunks/{transcript-panel-Wr8e4Zgi.js → transcript-panel-Dc0fK4WO.js} +2 -2
  53. package/dist/_chunks/{treatment-receipt-BZzwvsnY.js → treatment-receipt-B6m47Jie.js} +44 -46
  54. package/dist/_chunks/{use-appointment-details-read-Bl1DHXQ2.js → use-appointment-details-read-HVHbR0Zl.js} +769 -745
  55. package/dist/agent-catalog.json +15 -1
  56. package/dist/appointment-editor-panel/index.js +4 -4
  57. package/dist/booking-tools-data/index.js +1 -1
  58. package/dist/browser-support.js +1 -1
  59. package/dist/calendar-action-buttons/index.js +1 -1
  60. package/dist/components/_shared/appointment-format.d.ts +4 -0
  61. package/dist/components/_shared/patient-field-row.d.ts +5 -1
  62. package/dist/components/ai-summary-panel/index.js +1 -1
  63. package/dist/components/appointment-card/index.js +2 -2
  64. package/dist/components/appointment-details-panel/appointment-details-panel.d.ts +5 -2
  65. package/dist/components/appointment-details-panel/appointment-details-panel.sections.d.ts +3 -1
  66. package/dist/components/appointment-details-panel/appointment-details-panel.types.d.ts +3 -0
  67. package/dist/components/appointment-details-panel/index.js +2 -2
  68. package/dist/components/appointment-peek/appointment-peek.d.ts +45 -1
  69. package/dist/components/appointment-peek/index.js +1 -1
  70. package/dist/components/appointment-timeline/index.js +1 -1
  71. package/dist/components/booking/index.js +1 -1
  72. package/dist/components/calls-panel/index.js +1 -1
  73. package/dist/components/care-plan-card/index.js +1 -1
  74. package/dist/components/care-plan-entry-card/index.js +1 -1
  75. package/dist/components/communications-panel/index.js +1 -1
  76. package/dist/components/control-room-rail/index.js +1 -1
  77. package/dist/components/document-preview/index.js +1 -1
  78. package/dist/components/editable-description/editable-description.d.ts +7 -0
  79. package/dist/components/editable-description/index.js +1 -1
  80. package/dist/components/entity-summary/index.js +1 -1
  81. package/dist/components/feature-preview-switch/feature-preview-switch.d.ts +55 -0
  82. package/dist/components/feature-preview-switch/index.d.ts +2 -0
  83. package/dist/components/feature-preview-switch/index.js +5 -0
  84. package/dist/components/file-manager/index.js +1 -1
  85. package/dist/components/index.d.ts +1 -0
  86. package/dist/components/notes-panel/index.js +1 -1
  87. package/dist/components/notes-panel/notes-panel.d.ts +20 -0
  88. package/dist/components/optical-prescription/index.js +1 -1
  89. package/dist/components/panel-header/index.js +1 -1
  90. package/dist/components/panel-header/panel-header.d.ts +8 -0
  91. package/dist/components/panel-subview/index.js +1 -1
  92. package/dist/components/patient-details/index.js +1 -1
  93. package/dist/components/patient-summary-card/index.js +1 -1
  94. package/dist/components/patient-summary-card/patient-summary-card.d.ts +9 -0
  95. package/dist/components/patient-table/index.js +1 -1
  96. package/dist/components/payment-card/index.js +1 -1
  97. package/dist/components/radiograph-panel/index.js +1 -1
  98. package/dist/components/registry-connection-panel/index.js +1 -1
  99. package/dist/components/reviews-panel/index.js +1 -1
  100. package/dist/components/rich-text-editor/editor-toolbar.d.ts +4 -1
  101. package/dist/components/rich-text-editor/index.js +1 -1
  102. package/dist/components/task-editor/index.js +1 -1
  103. package/dist/components/tasks-panel/index.js +1 -1
  104. package/dist/components/text-area/index.js +1 -1
  105. package/dist/components/text-area/text-area.d.ts +15 -0
  106. package/dist/components/tool-rail/index.js +1 -1
  107. package/dist/components/tool-rail/tool-rail.d.ts +12 -1
  108. package/dist/components/transaction-chip/index.js +1 -1
  109. package/dist/components/transaction-chip/transaction-chip.d.ts +7 -0
  110. package/dist/components/transcript-panel/index.js +1 -1
  111. package/dist/components/treatment-receipt/index.js +1 -1
  112. package/dist/core.css +1 -1
  113. package/dist/find-free-slots-panel/index.js +1 -1
  114. package/dist/host-legacy.css +51 -4
  115. package/dist/i18n/locales/ar.d.ts +9 -0
  116. package/dist/i18n/locales/ar.js +8 -2
  117. package/dist/i18n/locales/de.d.ts +9 -0
  118. package/dist/i18n/locales/de.js +8 -2
  119. package/dist/i18n/locales/el.d.ts +9 -0
  120. package/dist/i18n/locales/el.js +10 -1
  121. package/dist/i18n/locales/en.d.ts +9 -0
  122. package/dist/i18n/locales/en.js +11 -2
  123. package/dist/i18n/locales/es.d.ts +9 -0
  124. package/dist/i18n/locales/es.js +10 -1
  125. package/dist/i18n/locales/fr.d.ts +9 -0
  126. package/dist/i18n/locales/fr.js +10 -1
  127. package/dist/i18n/locales/hi.d.ts +9 -0
  128. package/dist/i18n/locales/hi.js +8 -2
  129. package/dist/i18n/locales/it.d.ts +19 -10
  130. package/dist/i18n/locales/it.js +20 -11
  131. package/dist/i18n/locales/ja.d.ts +9 -0
  132. package/dist/i18n/locales/ja.js +8 -2
  133. package/dist/i18n/locales/nl.d.ts +9 -0
  134. package/dist/i18n/locales/nl.js +8 -2
  135. package/dist/i18n/locales/pl.d.ts +9 -0
  136. package/dist/i18n/locales/pl.js +10 -1
  137. package/dist/i18n/locales/pt.d.ts +9 -0
  138. package/dist/i18n/locales/pt.js +10 -1
  139. package/dist/i18n/locales/ro.d.ts +9 -0
  140. package/dist/i18n/locales/ro.js +10 -1
  141. package/dist/i18n/locales/ru.d.ts +9 -0
  142. package/dist/i18n/locales/ru.js +8 -2
  143. package/dist/i18n/locales/sq.d.ts +9 -0
  144. package/dist/i18n/locales/sq.js +10 -1
  145. package/dist/i18n/locales/sv.d.ts +9 -0
  146. package/dist/i18n/locales/sv.js +8 -2
  147. package/dist/i18n/locales/tr.d.ts +9 -0
  148. package/dist/i18n/locales/tr.js +8 -2
  149. package/dist/i18n/locales/zh.d.ts +9 -0
  150. package/dist/i18n/locales/zh.js +8 -2
  151. package/dist/index.js +775 -773
  152. package/dist/locales/ar.json +10 -1
  153. package/dist/locales/de.json +10 -1
  154. package/dist/locales/el.json +10 -1
  155. package/dist/locales/en.json +11 -2
  156. package/dist/locales/es.json +10 -1
  157. package/dist/locales/fr.json +10 -1
  158. package/dist/locales/hi.json +10 -1
  159. package/dist/locales/it.json +20 -11
  160. package/dist/locales/ja.json +10 -1
  161. package/dist/locales/nl.json +10 -1
  162. package/dist/locales/pl.json +10 -1
  163. package/dist/locales/pt.json +10 -1
  164. package/dist/locales/ro.json +10 -1
  165. package/dist/locales/ru.json +10 -1
  166. package/dist/locales/sq.json +10 -1
  167. package/dist/locales/sv.json +10 -1
  168. package/dist/locales/tr.json +10 -1
  169. package/dist/locales/zh.json +10 -1
  170. package/dist/online-bookings-panel/index.js +2 -2
  171. package/dist/patterns/anamnesis/index.js +1 -1
  172. package/dist/patterns/calendar/index.js +4 -4
  173. package/dist/patterns/help-me-write-templates/index.js +1 -1
  174. package/dist/patterns/patient-account-settings/index.js +1 -1
  175. package/dist/patterns/patient-check-in/index.js +1 -1
  176. package/dist/patterns/patient-portal/index.js +2 -2
  177. package/dist/tokens.css +1 -1
  178. package/dist/waiting-list-panel/index.js +3 -3
  179. package/package.json +5 -1
  180. package/dist/_chunks/appointment-peek-B3raO90X.js +0 -123
  181. package/dist/_chunks/contact-round-DiSvB3LP.js +0 -18
  182. package/dist/_chunks/folder-BghC8_S2.js +0 -20
  183. package/dist/_chunks/text-area-COMVJ1yE.js +0 -258
@@ -1,24 +1,24 @@
1
- import { jsxs as I, jsx as c } from "react/jsx-runtime";
2
- import { forwardRef as kt, useRef as m, useState as R, useMemo as q, useId as Nt, useCallback as B, useEffect as te, useImperativeHandle as zt, Fragment as Lt } from "react";
3
- import * as K from "@radix-ui/react-dialog";
1
+ import { jsxs as w, jsx as c } from "react/jsx-runtime";
2
+ import { forwardRef as Lt, useRef as m, useState as I, useMemo as K, useId as Ct, useCallback as j, useEffect as ae, useImperativeHandle as Dt, Fragment as _t } from "react";
3
+ import * as H from "@radix-ui/react-dialog";
4
4
  import { c as N } from "./index-D2ZczOXr.js";
5
- import { useTranslation as Ct } from "react-i18next";
6
- import { u as Dt } from "./app-frame-context-CPszhDDb.js";
7
- import { I as he } from "./icon-button-u9VMQn3x.js";
8
- import { D as _t, a as Pt } from "./dialog-container-DHR0byah.js";
9
- import { a as Vt } from "./panel-header-CbtlTe85.js";
10
- import { S as Ze } from "./scroll-area-CY5SLYNw.js";
11
- import { a as Bt } from "./tooltip-uEBdD1-5.js";
12
- import { u as jt } from "./use-controllable-state-BiY4xTzM.js";
13
- import { u as Mt } from "./use-edge-resize-CBtem0j2.js";
5
+ import { useTranslation as Pt } from "react-i18next";
6
+ import { u as Vt } from "./app-frame-context-CPszhDDb.js";
7
+ import { I as xe } from "./icon-button-u9VMQn3x.js";
8
+ import { D as Bt, a as jt } from "./dialog-container-DHR0byah.js";
9
+ import { a as Ft } from "./panel-header-DTc5OFUg.js";
10
+ import { S as Qe } from "./scroll-area-CY5SLYNw.js";
11
+ import { a as Mt } from "./tooltip-uEBdD1-5.js";
12
+ import { u as Ot } from "./use-controllable-state-BiY4xTzM.js";
13
+ import { u as qt } from "./use-edge-resize-CBtem0j2.js";
14
14
  import { u as k } from "./use-isomorphic-layout-effect-BGfaCOP1.js";
15
- import { a as Ft, u as Ge, R as Ot } from "./use-list-reflow-C7O4Uqnl.js";
16
- import { u as qt } from "./use-prefers-reduced-motion-BMwIQRjB.js";
17
- import { u as Kt } from "./use-presence-transition-cDwWUXV-.js";
18
- import { u as Ht } from "./use-resolved-theme-B0f1_oyq.js";
19
- import { u as $t } from "./registry-DvAUVLHh.js";
20
- import { X as Ut } from "./x-B5YnXwCz.js";
21
- const Wt = {
15
+ import { a as Kt, u as et, R as Ht } from "./use-list-reflow-C7O4Uqnl.js";
16
+ import { u as $t } from "./use-prefers-reduced-motion-BMwIQRjB.js";
17
+ import { u as Ut } from "./use-presence-transition-cDwWUXV-.js";
18
+ import { u as Wt } from "./use-resolved-theme-B0f1_oyq.js";
19
+ import { u as Yt } from "./registry-DvAUVLHh.js";
20
+ import { X as Zt } from "./x-B5YnXwCz.js";
21
+ const Gt = {
22
22
  id: "tool-rail",
23
23
  capabilities: ["open", "close", "select_single"],
24
24
  state: {
@@ -26,13 +26,13 @@ const Wt = {
26
26
  type: "string | null",
27
27
  descriptionKey: "ui.toolRail.agent.state.activeToolId",
28
28
  description: "Id of the tool whose panel is currently open, or null when the rail is collapsed to its strip. No panel content is ever exposed.",
29
- read: (l) => l.getActiveToolId()
29
+ read: (i) => i.getActiveToolId()
30
30
  },
31
31
  panelMode: {
32
32
  type: "'docked' | 'overlay' | 'full-screen'",
33
33
  descriptionKey: "ui.agent.toolRail.state.panelMode",
34
34
  description: "How an open panel shows: docked beside the content, over it because the frame keeps a minimum width for main, or full screen on a phone.",
35
- read: (l) => l.getPanelMode()
35
+ read: (i) => i.getPanelMode()
36
36
  }
37
37
  },
38
38
  actions: {
@@ -51,8 +51,8 @@ const Wt = {
51
51
  descriptionKey: "ui.toolRail.agent.actions.open",
52
52
  description: "Open the given tool's panel.",
53
53
  examples: [{ args: { id: "inbox" }, note: "Open the inbox tool panel." }],
54
- invoke: (l, a) => {
55
- l.open(a.id);
54
+ invoke: (i, a) => {
55
+ i.open(a.id);
56
56
  }
57
57
  },
58
58
  close: {
@@ -60,8 +60,8 @@ const Wt = {
60
60
  idempotent: !0,
61
61
  descriptionKey: "ui.toolRail.agent.actions.close",
62
62
  description: "Collapse the rail to its strip (no active tool).",
63
- invoke: (l) => {
64
- l.close();
63
+ invoke: (i) => {
64
+ i.close();
65
65
  }
66
66
  },
67
67
  select_tool: {
@@ -75,8 +75,8 @@ const Wt = {
75
75
  idempotent: !0,
76
76
  descriptionKey: "ui.toolRail.agent.actions.selectTool",
77
77
  description: "Set the active tool by id (opens its panel), or pass null to collapse.",
78
- invoke: (l, a) => {
79
- l.setActiveTool(a.id);
78
+ invoke: (i, a) => {
79
+ i.setActiveTool(a.id);
80
80
  }
81
81
  }
82
82
  },
@@ -96,11 +96,14 @@ const Wt = {
96
96
  description: "Stable tool id emitted on each strip IconButton. The active icon also carries data-active set to its id."
97
97
  }
98
98
  }
99
- }, Yt = "ds:[inline-size:3rem]", Zt = "ds:[inline-size:var(--tool-rail-panel-inline-size,var(--ai-tools-rail-panel-inline-size,22rem))]", Xe = "--tool-rail-panel-inline-size", Gt = 288, Xt = 880, Jt = 352, Qt = 24;
100
- function en(l, a, D) {
101
- return a === void 0 || !Number.isFinite(a) || a <= 0 ? !1 : l === null || !Number.isFinite(l) ? D : D ? l < a + Qt : l < a;
99
+ }, Xt = "ds:[inline-size:3rem]", Jt = "ds:[inline-size:var(--tool-rail-panel-inline-size,var(--ai-tools-rail-panel-inline-size,22rem))]", tt = "--tool-rail-panel-inline-size", Qt = 288, en = 880, tn = 352, nn = 24;
100
+ function an(i, a, _) {
101
+ return a === void 0 || !Number.isFinite(a) || a <= 0 ? !1 : i === null || !Number.isFinite(i) ? _ : _ ? i < a + nn : i < a;
102
102
  }
103
- const tn = N(
103
+ function $(i) {
104
+ return !!(i != null && i.disabled) && !i.disabledReason;
105
+ }
106
+ const sn = N(
104
107
  [
105
108
  // `relative`: an overlaid panel is positioned against the rail.
106
109
  "ds:relative ds:flex ds:shrink-0 ds:h-full",
@@ -125,19 +128,19 @@ const tn = N(
125
128
  },
126
129
  defaultVariants: { side: "end" }
127
130
  }
128
- ), nn = N(
131
+ ), rn = N(
129
132
  [
130
133
  "ds:flex ds:shrink-0 ds:flex-col ds:items-center",
131
134
  "ds:pt-[var(--spacing-md)] ds:pb-[var(--spacing-md)]",
132
135
  "ds:gap-[var(--spacing-xs)]",
133
- Yt
136
+ Xt
134
137
  ].join(" ")
135
- ), an = N(
138
+ ), on = N(
136
139
  [
137
140
  // Positioned by the caller: `relative` docked, absolute when overlaid.
138
141
  "ds:flex ds:min-h-0 ds:flex-col ds:h-full",
139
142
  "ds:bg-[var(--background)]",
140
- Zt,
143
+ Jt,
141
144
  // Open / collapse: the panel fades and slides from the strip. The WIDTH
142
145
  // snaps on purpose — animating it would re-lay-out the main area (a
143
146
  // calendar grid) on every frame. Declared at rest so both directions
@@ -158,7 +161,7 @@ const tn = N(
158
161
  },
159
162
  defaultVariants: { side: "end" }
160
163
  }
161
- ), sn = N("", {
164
+ ), ln = N("", {
162
165
  variants: {
163
166
  mode: {
164
167
  docked: "ds:relative ds:z-[1]",
@@ -186,12 +189,12 @@ const tn = N(
186
189
  }
187
190
  ],
188
191
  defaultVariants: { mode: "docked", side: "end" }
189
- }), rn = [
192
+ }), dn = [
190
193
  "ds:fixed ds:inset-0 ds:z-[var(--z-modal)]",
191
194
  "ds:flex ds:flex-col",
192
195
  "ds:bg-[var(--background)] ds:text-[color:var(--foreground)]",
193
196
  "ds:focus-visible:outline-none"
194
- ].join(" "), on = "ds:relative ds:flex ds:min-h-0 ds:flex-1 ds:flex-col ds:overflow-clip", Je = N(
197
+ ].join(" "), cn = "ds:relative ds:flex ds:min-h-0 ds:flex-1 ds:flex-col ds:overflow-clip", nt = N(
195
198
  [
196
199
  "ds:flex ds:min-h-0 ds:flex-col",
197
200
  "ds:transition-[opacity,translate] ds:duration-[var(--animation-duration)]",
@@ -216,7 +219,7 @@ const tn = N(
216
219
  },
217
220
  defaultVariants: { layer: "live" }
218
221
  }
219
- ), ln = 500, dn = [
222
+ ), un = 500, fn = [
220
223
  "id",
221
224
  "name",
222
225
  "for",
@@ -224,29 +227,29 @@ const tn = N(
224
227
  "data-component-id",
225
228
  "data-testid"
226
229
  ];
227
- function cn(l) {
228
- return window.getComputedStyle(l).transitionDuration.split(",").some((a) => Number.parseFloat(a) > 0);
230
+ function pn(i) {
231
+ return window.getComputedStyle(i).transitionDuration.split(",").some((a) => Number.parseFloat(a) > 0);
229
232
  }
230
- function un(l) {
231
- const a = l.cloneNode(!0), D = l.querySelectorAll("*"), H = a.querySelectorAll("*"), $ = [];
232
- return D.forEach((u, j) => {
233
- var U;
234
- const v = H[j];
235
- if (v && ((u.scrollTop !== 0 || u.scrollLeft !== 0) && $.push([v, u.scrollTop, u.scrollLeft]), u instanceof HTMLCanvasElement && v instanceof HTMLCanvasElement))
233
+ function vn(i) {
234
+ const a = i.cloneNode(!0), _ = i.querySelectorAll("*"), U = a.querySelectorAll("*"), W = [];
235
+ return _.forEach((u, F) => {
236
+ var Y;
237
+ const v = U[F];
238
+ if (v && ((u.scrollTop !== 0 || u.scrollLeft !== 0) && W.push([v, u.scrollTop, u.scrollLeft]), u instanceof HTMLCanvasElement && v instanceof HTMLCanvasElement))
236
239
  try {
237
- (U = v.getContext("2d")) == null || U.drawImage(u, 0, 0);
240
+ (Y = v.getContext("2d")) == null || Y.drawImage(u, 0, 0);
238
241
  } catch {
239
242
  }
240
- }), H.forEach((u) => {
241
- const j = u instanceof SVGElement;
242
- for (const v of dn)
243
- j && v === "id" || u.removeAttribute(v);
243
+ }), U.forEach((u) => {
244
+ const F = u instanceof SVGElement;
245
+ for (const v of fn)
246
+ F && v === "id" || u.removeAttribute(v);
244
247
  if (u.matches("iframe, video, audio, embed, object, source"))
245
248
  for (const v of ["src", "srcdoc", "data", "autoplay"])
246
249
  u.removeAttribute(v);
247
- }), { nodes: Array.from(a.childNodes), scrolls: $ };
250
+ }), { nodes: Array.from(a.childNodes), scrolls: W };
248
251
  }
249
- const fn = N(
252
+ const mn = N(
250
253
  [
251
254
  "ds:absolute ds:[inset-block:0] ds:z-[1] ds:select-none ds:touch-none",
252
255
  "ds:[inline-size:var(--resizable-handle-size)] ds:cursor-col-resize",
@@ -270,7 +273,7 @@ const fn = N(
270
273
  },
271
274
  defaultVariants: { edge: "inline-start" }
272
275
  }
273
- ), pn = N(
276
+ ), gn = N(
274
277
  [
275
278
  "ds:absolute ds:-top-[var(--spacing-xs)] ds:-end-[var(--spacing-xs)]",
276
279
  "ds:inline-flex ds:items-center ds:justify-center",
@@ -283,7 +286,7 @@ const fn = N(
283
286
  "ds:pointer-events-none ds:select-none",
284
287
  "ds:forced-colors:outline ds:forced-colors:outline-1 ds:forced-colors:outline-[CanvasText]"
285
288
  ].join(" ")
286
- ), Qe = N(
289
+ ), at = N(
287
290
  // `group/rail-tool` lets an affordance overlay (e.g. a pin star) reveal on
288
291
  // hover / focus-within of the whole slot.
289
292
  ["ds:group/rail-tool ds:relative", "ds:rounded-[var(--radius-sm)]"],
@@ -305,68 +308,68 @@ const fn = N(
305
308
  reorderable: !1
306
309
  }
307
310
  }
308
- ), vn = "ds:opacity-0", et = [
311
+ ), hn = "ds:opacity-0", st = [
309
312
  "ds:transition-opacity ds:duration-[var(--animation-duration)]",
310
313
  "ds:ease-[var(--ease-out)] ds:motion-reduce:transition-none"
311
314
  ].join(" ");
312
- function mn(l, a) {
313
- return l > 99 ? a : String(l);
315
+ function bn(i, a) {
316
+ return i > 99 ? a : String(i);
314
317
  }
315
- const gn = kt(
318
+ const yn = Lt(
316
319
  ({
317
- id: l,
320
+ id: i,
318
321
  tools: a,
319
- activeToolId: D,
320
- defaultActiveToolId: H = null,
321
- onActiveToolChange: $,
322
+ activeToolId: _,
323
+ defaultActiveToolId: U = null,
324
+ onActiveToolChange: W,
322
325
  side: u = "end",
323
- railLabel: j,
326
+ railLabel: F,
324
327
  resizablePanel: v = !1,
325
- panelWidth: U,
326
- onPanelWidthChange: tt,
327
- onReorder: W,
328
- formatReorderAnnouncement: ne,
329
- renderToolAffordance: ae,
330
- renderPanelHeader: be,
331
- dataComponent: nt = "tool-rail",
332
- agentAdapter: at = Wt,
333
- className: st
334
- }, rt) => {
335
- var $e, Ue;
336
- const { t: S } = Ct("ui"), [ot, g] = jt({
337
- value: D,
338
- defaultValue: H,
339
- onChange: $
340
- }), h = ot ?? null, se = m([]), z = m(null), [ye, re] = R(0), _ = m(!1), oe = m(!1), L = q(
328
+ panelWidth: Y,
329
+ onPanelWidthChange: rt,
330
+ onReorder: Z,
331
+ formatReorderAnnouncement: se,
332
+ renderToolAffordance: re,
333
+ renderPanelHeader: we,
334
+ dataComponent: ot = "tool-rail",
335
+ agentAdapter: it = Gt,
336
+ className: lt
337
+ }, dt) => {
338
+ var Ze, Ge;
339
+ const { t: R } = Pt("ui"), [ct, g] = Ot({
340
+ value: _,
341
+ defaultValue: U,
342
+ onChange: W
343
+ }), h = ct ?? null, oe = m([]), z = m(null), [Ie, ie] = I(0), P = m(!1), le = m(!1), L = K(
341
344
  () => a.findIndex((e) => e.id === h),
342
345
  [a, h]
343
- ), o = L >= 0 ? a[L] : null, ie = m(o);
344
- o && (ie.current = o);
345
- const it = q(
346
- () => a.findIndex((e) => !e.disabled),
346
+ ), o = L >= 0 ? a[L] : null, de = m(o);
347
+ o && (de.current = o);
348
+ const ut = K(
349
+ () => a.findIndex((e) => !$(e)),
347
350
  [a]
348
- ), xe = q(() => {
351
+ ), Re = K(() => {
349
352
  var t;
350
353
  const e = (t = a[0]) == null ? void 0 : t.scope;
351
354
  return e ? a.findIndex((n) => n.scope && n.scope !== e) : -1;
352
- }, [a]), lt = xe > 0, b = q(() => {
355
+ }, [a]), ft = Re > 0, b = K(() => {
353
356
  var n;
354
357
  const e = a.findIndex((s) => s.reorderable);
355
358
  if (e < 0) return null;
356
359
  let t = e;
357
360
  for (; t + 1 < a.length && ((n = a[t + 1]) != null && n.reorderable); ) t += 1;
358
361
  return { first: e, last: t };
359
- }, [a]), we = !!W && b !== null, dt = Nt(), [M, le] = R(null), [Ie, Y] = R(null), T = m(null), { isAccessible: ct } = Ht(T), P = ct || void 0, { containerRef: Re } = Ft({
362
+ }, [a]), Se = !!Z && b !== null, Ee = Ct(), [M, ce] = I(null), [Te, G] = I(null), T = m(null), { isAccessible: pt } = Wt(T), V = pt || void 0, { containerRef: Ae } = Kt({
360
363
  key: a.map((e) => e.id).join(),
361
- reduceMotion: P
362
- }), de = Ge({ reduceMotion: P }), ce = Kt(
364
+ reduceMotion: V
365
+ }), ue = et({ reduceMotion: V }), fe = Ut(
363
366
  o !== null,
364
- { reduceMotion: P }
365
- ), C = o === null && ce.mounted, w = o ?? (C ? ie.current : null), { ref: Se } = ce, [ut, ft] = R(null), pt = B(
367
+ { reduceMotion: V }
368
+ ), C = o === null && fe.mounted, x = o ?? (C ? de.current : null), { ref: ke } = fe, [vt, mt] = I(null), gt = j(
366
369
  (e) => {
367
- z.current = e, ft(e), Se(e);
370
+ z.current = e, mt(e), ke(e);
368
371
  },
369
- [Se]
372
+ [ke]
370
373
  );
371
374
  k(() => {
372
375
  var n;
@@ -374,7 +377,7 @@ const gn = kt(
374
377
  if (!e) return;
375
378
  const t = document.activeElement;
376
379
  if (C && t instanceof HTMLElement && e.contains(t)) {
377
- const s = (n = ie.current) == null ? void 0 : n.id, r = T.current, d = (s ? r == null ? void 0 : r.querySelector(
380
+ const s = (n = de.current) == null ? void 0 : n.id, r = T.current, d = (s ? r == null ? void 0 : r.querySelector(
378
381
  `[data-tool-id="${CSS.escape(s)}"]`
379
382
  ) : null) ?? /* The tool left the strip with its panel (a host removed it as it
380
383
  closed): the strip's tab stop, else its first enabled icon, so
@@ -389,70 +392,70 @@ const gn = kt(
389
392
  }
390
393
  e.toggleAttribute("inert", C);
391
394
  }, [C]);
392
- const Ee = qt(), [Z, Te] = R(
395
+ const Ne = $t(), [X, ze] = I(
393
396
  (o == null ? void 0 : o.id) ?? null
394
- ), y = (o == null ? void 0 : o.id) ?? null, G = !P && !Ee && y !== null && Z !== null && Z !== y;
397
+ ), y = (o == null ? void 0 : o.id) ?? null, J = !V && !Ne && y !== null && X !== null && X !== y;
395
398
  k(() => {
396
- if (Z === y) return;
397
- if (!G) {
398
- Te(y);
399
+ if (X === y) return;
400
+ if (!J) {
401
+ ze(y);
399
402
  return;
400
403
  }
401
404
  let e = 0;
402
- const t = () => Te(y), n = requestAnimationFrame(() => {
405
+ const t = () => ze(y), n = requestAnimationFrame(() => {
403
406
  e = requestAnimationFrame(t);
404
407
  }), s = window.setTimeout(t, 64);
405
408
  return () => {
406
409
  cancelAnimationFrame(n), cancelAnimationFrame(e), window.clearTimeout(s);
407
410
  };
408
- }, [y, Z, G]);
409
- const vt = !!P || Ee, Ae = m(null), [f, ke] = R({ liveId: y, serial: 0, focusLost: !1, leaving: [] });
411
+ }, [y, X, J]);
412
+ const ht = !!V || Ne, Le = m(null), [f, Ce] = I({ liveId: y, serial: 0, focusLost: !1, leaving: [] });
410
413
  if (f.liveId !== y) {
411
- const e = f.liveId !== null && y !== null ? (($e = Ae.current) == null ? void 0 : $e.querySelector(
414
+ const e = f.liveId !== null && y !== null ? ((Ze = Le.current) == null ? void 0 : Ze.querySelector(
412
415
  ':scope > [data-tool-rail-layer="live"]'
413
416
  )) ?? null : null, t = f.leaving.filter(
414
417
  (n) => n.toolId !== y
415
418
  );
416
- ke({
419
+ Ce({
417
420
  liveId: y,
418
421
  serial: f.serial + 1,
419
422
  focusLost: (e == null ? void 0 : e.contains(document.activeElement)) ?? !1,
420
- leaving: e && !vt ? [
423
+ leaving: e && !ht ? [
421
424
  ...t.filter((n) => n.toolId !== f.liveId),
422
425
  {
423
426
  exitId: `${f.liveId}:${f.serial}`,
424
427
  toolId: f.liveId,
425
- ...un(e)
428
+ ...vn(e)
426
429
  }
427
430
  ] : t
428
431
  });
429
432
  }
430
- const F = B((e) => {
431
- ke(
433
+ const O = j((e) => {
434
+ Ce(
432
435
  (t) => t.leaving.some((n) => n.exitId === e) ? {
433
436
  ...t,
434
437
  leaving: t.leaving.filter((n) => n.exitId !== e)
435
438
  } : t
436
439
  );
437
- }, []), { leave: Ne } = Ge({
438
- reduceMotion: P,
439
- durationMs: ln
440
+ }, []), { leave: De } = et({
441
+ reduceMotion: V,
442
+ durationMs: un
440
443
  });
441
- te(() => {
444
+ ae(() => {
442
445
  for (const { exitId: e } of f.leaving)
443
- Ne(e, () => F(e));
444
- }, [f.leaving, Ne, F]);
445
- const mt = w ? f.leaving : [], gt = ((Ue = f.leaving[f.leaving.length - 1]) == null ? void 0 : Ue.exitId) ?? null, ze = m(f.leaving);
446
- ze.current = f.leaving;
447
- const ht = B(
446
+ De(e, () => O(e));
447
+ }, [f.leaving, De, O]);
448
+ const bt = x ? f.leaving : [], yt = ((Ge = f.leaving[f.leaving.length - 1]) == null ? void 0 : Ge.exitId) ?? null, _e = m(f.leaving);
449
+ _e.current = f.leaving;
450
+ const xt = j(
448
451
  (e) => {
449
452
  if (!e || e.childNodes.length > 0) return;
450
- const t = ze.current.find(
453
+ const t = _e.current.find(
451
454
  (n) => n.exitId === e.dataset.exitId
452
455
  );
453
456
  if (t) {
454
- if (!cn(e)) {
455
- F(t.exitId);
457
+ if (!pn(e)) {
458
+ O(t.exitId);
456
459
  return;
457
460
  }
458
461
  e.setAttribute("inert", ""), e.append(...t.nodes);
@@ -460,7 +463,7 @@ const gn = kt(
460
463
  n.scrollTop = s, n.scrollLeft = r;
461
464
  }
462
465
  },
463
- [F]
466
+ [O]
464
467
  );
465
468
  k(() => {
466
469
  var t, n;
@@ -470,11 +473,11 @@ const gn = kt(
470
473
  `[data-tool-id="${CSS.escape(y)}"]`
471
474
  )) == null || n.focus();
472
475
  }, [f.serial]);
473
- const [bt, Le] = R([]), Ce = m(a);
474
- te(() => {
475
- const e = Ce.current, t = new Set(a.map((s) => s.id)), n = e.filter((s) => !t.has(s.id));
476
+ const [wt, Pe] = I([]), Ve = m(a);
477
+ ae(() => {
478
+ const e = Ve.current, t = new Set(a.map((s) => s.id)), n = e.filter((s) => !t.has(s.id));
476
479
  if (n.length > 0) {
477
- Le((s) => {
480
+ Pe((s) => {
478
481
  const r = new Set(s.map((d) => d.id));
479
482
  return [
480
483
  ...s,
@@ -482,89 +485,89 @@ const gn = kt(
482
485
  ];
483
486
  });
484
487
  for (const s of n)
485
- de.leave(s.id, () => {
486
- Le(
488
+ ue.leave(s.id, () => {
489
+ Pe(
487
490
  (r) => r.filter((d) => d.id !== s.id)
488
491
  );
489
492
  });
490
493
  }
491
- Ce.current = a;
492
- }, [a, de]);
493
- const [yt, xt] = R(""), ue = m(!1), De = B(
494
+ Ve.current = a;
495
+ }, [a, ue]);
496
+ const [It, Rt] = I(""), pe = m(!1), Be = j(
494
497
  (e, t) => {
495
- if (!W || !b) return;
498
+ if (!Z || !b) return;
496
499
  const n = Math.max(
497
500
  b.first,
498
501
  Math.min(b.last, t)
499
502
  );
500
503
  if (n === e) return;
501
- W(e, n);
504
+ Z(e, n);
502
505
  const s = a[e];
503
506
  if (s) {
504
- const r = ne ? ne({ tool: s, from: e, to: n }) : S("toolRail.reorderAnnounce", {
507
+ const r = se ? se({ tool: s, from: e, to: n }) : R("toolRail.reorderAnnounce", {
505
508
  tool: s.label,
506
509
  to: n - b.first + 1,
507
510
  total: b.last - b.first + 1,
508
511
  defaultValue: "{{tool}} moved to position {{to}} of {{total}}"
509
512
  });
510
- r && (ue.current = !ue.current, xt(ue.current ? r : `${r}​`));
513
+ r && (pe.current = !pe.current, Rt(pe.current ? r : `${r}​`));
511
514
  }
512
515
  },
513
- [W, b, a, S, ne]
514
- ), _e = a[ye], O = L >= 0 ? L : _e && !_e.disabled ? ye : it, wt = B(
516
+ [Z, b, a, R, se]
517
+ ), je = a[Ie], q = L >= 0 ? L : je && !$(je) ? Ie : ut, St = j(
515
518
  (e, t) => {
516
519
  const n = a.find((s) => s.id === e);
517
- !n || n.disabled || (_.current = t, g(h === e ? null : e));
520
+ !n || n.disabled || (P.current = t, g(h === e ? null : e));
518
521
  },
519
522
  [a, h, g]
520
- ), It = B(
523
+ ), Et = j(
521
524
  (e) => {
522
- var V, i, x;
525
+ var B;
523
526
  const t = a.length;
524
527
  if (t === 0 || e.altKey) return;
525
528
  let n = null;
526
- if (e.key === "ArrowDown" ? n = (O + 1) % t : e.key === "ArrowUp" ? n = (O - 1 + t) % t : e.key === "Home" ? n = 0 : e.key === "End" && (n = t - 1), n === null) return;
529
+ if (e.key === "ArrowDown" ? n = (q + 1) % t : e.key === "ArrowUp" ? n = (q - 1 + t) % t : e.key === "Home" ? n = 0 : e.key === "End" && (n = t - 1), n === null) return;
527
530
  const s = e.key === "ArrowUp" || e.key === "End";
528
531
  let r = n, d = 0;
529
- for (; d < t && ((V = a[r]) != null && V.disabled); )
532
+ for (; d < t && $(a[r]); )
530
533
  r = s ? (r - 1 + t) % t : (r + 1) % t, d += 1;
531
- (i = a[r]) != null && i.disabled || (e.preventDefault(), re(r), (x = se.current[r]) == null || x.focus());
534
+ $(a[r]) || (e.preventDefault(), ie(r), (B = oe.current[r]) == null || B.focus());
532
535
  },
533
- [a, O]
534
- ), p = Dt(), E = (p == null ? void 0 : p.phone) ?? !1, fe = (p == null ? void 0 : p.sharedWidth) ?? null, X = p == null ? void 0 : p.minMainWidth, [A, Pe] = R(!1), J = m(!1);
535
- J.current = A;
536
- const [Q, Ve] = R(null), Be = m(void 0), je = m(null);
536
+ [a, q]
537
+ ), p = Vt(), E = (p == null ? void 0 : p.phone) ?? !1, ve = (p == null ? void 0 : p.sharedWidth) ?? null, Q = p == null ? void 0 : p.minMainWidth, [A, Fe] = I(!1), ee = m(!1);
538
+ ee.current = A;
539
+ const [te, Me] = I(null), Oe = m(void 0), qe = m(null);
537
540
  k(() => {
538
541
  var n;
539
- const e = Be.current;
540
- if (Be.current = h, !E || h === null) {
541
- Q !== null && Ve(null);
542
+ const e = Oe.current;
543
+ if (Oe.current = h, !E || h === null) {
544
+ te !== null && Me(null);
542
545
  return;
543
546
  }
544
- if (Q === h) return;
547
+ if (te === h) return;
545
548
  if (e !== void 0 && h !== e) {
546
- je.current = document.activeElement instanceof HTMLElement ? document.activeElement : null, Ve(h);
549
+ qe.current = document.activeElement instanceof HTMLElement ? document.activeElement : null, Me(h);
547
550
  return;
548
551
  }
549
552
  const t = (n = T.current) == null ? void 0 : n.contains(document.activeElement);
550
553
  g(null), t && (p == null || p.focusMain());
551
- }, [E, h, Q, g, p]);
552
- const pe = E && o !== null && Q === o.id;
553
- te(() => {
554
+ }, [E, h, te, g, p]);
555
+ const me = E && o !== null && te === o.id;
556
+ ae(() => {
554
557
  const e = T.current;
555
558
  if (!e) return;
556
559
  const t = (n) => {
557
- if (n.key !== "Escape" || L < 0 || n.target instanceof Element && n.target.closest(`[${Pt}]`))
560
+ if (n.key !== "Escape" || L < 0 || n.target instanceof Element && n.target.closest(`[${jt}]`))
558
561
  return;
559
562
  n.preventDefault();
560
563
  const s = L;
561
- g(null), re(s), requestAnimationFrame(() => {
564
+ g(null), ie(s), requestAnimationFrame(() => {
562
565
  var r;
563
- (r = se.current[s]) == null || r.focus();
566
+ (r = oe.current[s]) == null || r.focus();
564
567
  });
565
568
  };
566
569
  return e.addEventListener("keydown", t), () => e.removeEventListener("keydown", t);
567
- }, [L, g]), te(() => {
570
+ }, [L, g]), ae(() => {
568
571
  if (!A || !o || E) return;
569
572
  const e = (t) => {
570
573
  t.key !== "Escape" || t.defaultPrevented || (t.preventDefault(), g(null));
@@ -572,80 +575,81 @@ const gn = kt(
572
575
  return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
573
576
  }, [A, o, E, g]), k(() => {
574
577
  var e;
575
- o && _.current && ((e = z.current) == null || e.focus()), _.current = !1;
578
+ o && P.current && ((e = z.current) == null || e.focus()), P.current = !1;
576
579
  }, [o]);
577
- const Me = u === "end" || A ? "inline-start" : "inline-end", { separatorProps: Fe, isResizing: ee, isResized: Oe } = Mt({
578
- edge: Me,
580
+ const Ke = u === "end" || A ? "inline-start" : "inline-end", { separatorProps: He, isResizing: ne, isResized: $e } = qt({
581
+ edge: Ke,
579
582
  targetRef: z,
580
- cssProperty: Xe,
581
- minSize: Gt,
582
- maxSize: Xt,
583
- defaultSize: Jt,
583
+ cssProperty: tt,
584
+ minSize: Qt,
585
+ maxSize: en,
586
+ defaultSize: tn,
584
587
  disabled: !v,
585
588
  // A width the user cannot change or reset is a trap: the controlled
586
589
  // value applies only while the handle is on.
587
- size: v ? U : void 0,
588
- onResize: tt
589
- }), ve = Fe["aria-valuenow"];
590
+ size: v ? Y : void 0,
591
+ onResize: rt
592
+ }), ge = He["aria-valuenow"];
590
593
  k(() => {
591
594
  var e;
592
- !v || !Oe || !o || (e = z.current) == null || e.style.setProperty(
593
- Xe,
594
- `${ve}px`
595
+ !v || !$e || !o || (e = z.current) == null || e.style.setProperty(
596
+ tt,
597
+ `${ge}px`
595
598
  );
596
- }, [o, v, Oe, ve]);
597
- const [Rt, St] = R(null), qe = !!p && !E && X !== void 0;
599
+ }, [o, v, $e, ge]);
600
+ const [Tt, At] = I(null), Ue = !!p && !E && Q !== void 0;
598
601
  k(() => {
599
602
  const e = z.current;
600
- if (!e || !o || !qe || typeof ResizeObserver > "u") return;
603
+ if (!e || !o || !Ue || typeof ResizeObserver > "u") return;
601
604
  const t = new ResizeObserver(() => {
602
605
  const n = e.offsetWidth;
603
- St((s) => s === n ? s : n);
606
+ At((s) => s === n ? s : n);
604
607
  });
605
608
  return t.observe(e), () => t.disconnect();
606
- }, [o, qe]), k(() => {
609
+ }, [o, Ue]), k(() => {
607
610
  var r;
608
- if (!p || E || X === void 0) {
609
- J.current && Pe(!1);
611
+ if (!p || E || Q === void 0) {
612
+ ee.current && Fe(!1);
610
613
  return;
611
614
  }
612
- if (ee) return;
615
+ if (ne) return;
613
616
  const e = z.current;
614
617
  if (!o || !e) return;
615
- const t = ((r = Re.current) == null ? void 0 : r.getBoundingClientRect().width) ?? 0, n = fe === null ? null : fe - t - e.offsetWidth, s = en(
618
+ const t = ((r = Ae.current) == null ? void 0 : r.getBoundingClientRect().width) ?? 0, n = ve === null ? null : ve - t - e.offsetWidth, s = an(
616
619
  n,
617
- X,
618
- J.current
620
+ Q,
621
+ ee.current
619
622
  );
620
- s !== J.current && Pe(s);
623
+ s !== ee.current && Fe(s);
621
624
  }, [
622
625
  p,
623
626
  E,
624
- fe,
625
- X,
626
- o,
627
627
  ve,
628
- ee,
629
- Rt
628
+ Q,
629
+ o,
630
+ ge,
631
+ ne,
632
+ Tt
630
633
  ]);
631
- const me = m(h);
632
- me.current = h;
633
- const Ke = m("docked");
634
- Ke.current = pe ? "full-screen" : A ? "overlay" : "docked";
635
- const ge = q(
634
+ const he = m(h);
635
+ he.current = h;
636
+ const We = m("docked");
637
+ We.current = me ? "full-screen" : A ? "overlay" : "docked";
638
+ const be = K(
636
639
  () => ({
637
- getActiveToolId: () => me.current,
638
- getPanelMode: () => Ke.current,
640
+ getActiveToolId: () => he.current,
641
+ getPanelMode: () => We.current,
639
642
  setActiveTool: (e) => {
640
- _.current = !1, g(e);
643
+ var t;
644
+ e !== null && ((t = a.find((n) => n.id === e)) != null && t.disabled) || (P.current = !1, g(e));
641
645
  },
642
646
  open: (e) => {
643
647
  const t = a.find((n) => n.id === e);
644
- !t || t.disabled || (_.current = !1, g(e));
648
+ !t || t.disabled || (P.current = !1, g(e));
645
649
  },
646
650
  close: () => {
647
- const e = me.current;
648
- _.current = !1, g(null), e != null && requestAnimationFrame(() => {
651
+ const e = he.current;
652
+ P.current = !1, g(null), e != null && requestAnimationFrame(() => {
649
653
  var t, n;
650
654
  (n = (t = T.current) == null ? void 0 : t.querySelector(
651
655
  `[data-tool-id="${CSS.escape(e)}"]`
@@ -655,145 +659,145 @@ const gn = kt(
655
659
  }),
656
660
  [a, g]
657
661
  );
658
- zt(rt, () => ge, [ge]), $t(at, ge, l);
659
- const Et = S("toolRail.badgeCountOverflow", {
662
+ Dt(dt, () => be, [be]), Yt(it, be, i);
663
+ const kt = R("toolRail.badgeCountOverflow", {
660
664
  defaultValue: "99+"
661
- }), He = j ?? S("toolRail.railLabel", { defaultValue: "Tools" });
662
- return /* @__PURE__ */ I(
665
+ }), Ye = F ?? R("toolRail.railLabel", { defaultValue: "Tools" });
666
+ return /* @__PURE__ */ w(
663
667
  "aside",
664
668
  {
665
669
  ref: T,
666
- "aria-label": He,
667
- "data-component": nt,
668
- "data-component-id": l,
670
+ "aria-label": Ye,
671
+ "data-component": ot,
672
+ "data-component-id": i,
669
673
  "data-side": u,
670
- "data-panel-mode": pe ? "full-screen" : A ? "overlay" : "docked",
671
- className: [tn({ side: u }), st].filter(Boolean).join(" "),
674
+ "data-panel-mode": me ? "full-screen" : A ? "overlay" : "docked",
675
+ className: [sn({ side: u }), lt].filter(Boolean).join(" "),
672
676
  children: [
673
- we ? /* @__PURE__ */ c("span", { role: "status", "aria-live": "polite", className: "ds:sr-only", children: yt }) : null,
674
- w && !E ? /* @__PURE__ */ I(
677
+ Se ? /* @__PURE__ */ c("span", { role: "status", "aria-live": "polite", className: "ds:sr-only", children: It }) : null,
678
+ x && !E ? /* @__PURE__ */ w(
675
679
  "section",
676
680
  {
677
- ref: pt,
681
+ ref: gt,
678
682
  tabIndex: -1,
679
- "aria-label": S("toolRail.panelLabel", {
680
- tool: w.label,
683
+ "aria-label": R("toolRail.panelLabel", {
684
+ tool: x.label,
681
685
  defaultValue: "{{tool}} panel"
682
686
  }),
683
687
  "aria-hidden": C || void 0,
684
688
  "data-tool-rail-state": C ? "collapsing" : "expanded",
685
- "data-presence": ce.phase,
686
- "data-active-tool": w.id,
687
- "data-resizing": ee ? "" : void 0,
689
+ "data-presence": fe.phase,
690
+ "data-active-tool": x.id,
691
+ "data-resizing": ne ? "" : void 0,
688
692
  className: [
689
693
  // Overlaid, it slides in from the strip on its inline end.
690
- an({ side: A ? "end" : u }),
691
- sn({
694
+ on({ side: A ? "end" : u }),
695
+ ln({
692
696
  mode: A ? "overlay" : "docked",
693
697
  side: u
694
698
  }),
695
699
  "ds:focus-visible:outline-none"
696
700
  ].filter(Boolean).join(" "),
697
701
  children: [
698
- /* @__PURE__ */ I(_t, { container: ut, children: [
699
- be ? be(w, { isActive: !C }) : null,
700
- /* @__PURE__ */ I("div", { ref: Ae, className: on, children: [
701
- mt.map((e) => /* @__PURE__ */ c(
702
+ /* @__PURE__ */ w(Bt, { container: vt, children: [
703
+ we ? we(x, { isActive: !C }) : null,
704
+ /* @__PURE__ */ w("div", { ref: Le, className: cn, children: [
705
+ bt.map((e) => /* @__PURE__ */ c(
702
706
  "div",
703
707
  {
704
- ref: ht,
708
+ ref: xt,
705
709
  "aria-hidden": "true",
706
710
  "data-exit-id": e.exitId,
707
711
  "data-tool-rail-body": e.toolId,
708
712
  "data-tool-rail-layer": "leaving",
709
- "data-presence": G && e.exitId === gt ? "present" : "leaving",
710
- className: Je({ layer: "leaving" }),
713
+ "data-presence": J && e.exitId === yt ? "present" : "leaving",
714
+ className: nt({ layer: "leaving" }),
711
715
  onTransitionEnd: (t) => {
712
- t.target === t.currentTarget && F(e.exitId);
716
+ t.target === t.currentTarget && O(e.exitId);
713
717
  }
714
718
  },
715
719
  e.exitId
716
720
  )),
717
- /* @__PURE__ */ I(
721
+ /* @__PURE__ */ w(
718
722
  "div",
719
723
  {
720
- "data-tool-rail-body": w.id,
724
+ "data-tool-rail-body": x.id,
721
725
  "data-tool-rail-layer": "live",
722
- "data-presence": G ? "entering" : "present",
723
- className: Je({ layer: "live" }),
726
+ "data-presence": J ? "entering" : "present",
727
+ className: nt({ layer: "live" }),
724
728
  children: [
725
- w.header ? /* @__PURE__ */ c("div", { className: "ds:shrink-0", children: w.header }) : null,
726
- w.fill ? (
729
+ x.header ? /* @__PURE__ */ c("div", { className: "ds:shrink-0", children: x.header }) : null,
730
+ x.fill ? (
727
731
  // data-tool-fill: a self-scrolling panel owns its own native
728
732
  // scroll, so a token rule paints its scrollbar to match the
729
733
  // 8px overlay. See tokens/index.css.
730
- /* @__PURE__ */ c("div", { "data-tool-fill": "", className: "ds:flex-1 ds:min-h-0", children: w.panel })
734
+ /* @__PURE__ */ c("div", { "data-tool-fill": "", className: "ds:flex-1 ds:min-h-0", children: x.panel })
731
735
  ) : /* @__PURE__ */ c(
732
- Ze,
736
+ Qe,
733
737
  {
734
738
  orientation: "vertical",
735
739
  className: "ds:flex-1 ds:min-h-0",
736
- children: w.panel
740
+ children: x.panel
737
741
  }
738
742
  )
739
743
  ]
740
744
  },
741
- w.id
745
+ x.id
742
746
  )
743
747
  ] })
744
748
  ] }),
745
749
  v ? /* @__PURE__ */ c(
746
750
  "div",
747
751
  {
748
- ...Fe,
749
- "aria-label": S("toolRail.resizePanel", {
752
+ ...He,
753
+ "aria-label": R("toolRail.resizePanel", {
750
754
  defaultValue: "Resize tool panel"
751
755
  }),
752
- "data-resizing": ee ? "" : void 0,
753
- className: fn({ edge: Me })
756
+ "data-resizing": ne ? "" : void 0,
757
+ className: mn({ edge: Ke })
754
758
  }
755
759
  ) : null
756
760
  ]
757
761
  }
758
762
  ) : null,
759
- pe && o ? /* @__PURE__ */ c(
760
- K.Root,
763
+ me && o ? /* @__PURE__ */ c(
764
+ H.Root,
761
765
  {
762
766
  open: !0,
763
767
  onOpenChange: (e) => {
764
768
  e || g(null);
765
769
  },
766
- children: /* @__PURE__ */ c(K.Portal, { children: /* @__PURE__ */ I(
767
- K.Content,
770
+ children: /* @__PURE__ */ c(H.Portal, { children: /* @__PURE__ */ w(
771
+ H.Content,
768
772
  {
769
773
  "aria-describedby": void 0,
770
774
  "data-component": "tool-rail-panel",
771
775
  "data-active-tool": o.id,
772
- className: rn,
776
+ className: dn,
773
777
  onCloseAutoFocus: (e) => {
774
- const t = je.current;
778
+ const t = qe.current;
775
779
  t != null && t.isConnected && (e.preventDefault(), t.focus());
776
780
  },
777
781
  children: [
778
- /* @__PURE__ */ I("div", { className: "ds:flex ds:shrink-0 ds:justify-end ds:p-[var(--spacing-xs)]", children: [
779
- /* @__PURE__ */ c(K.Title, { className: "ds:sr-only", children: S("toolRail.panelLabel", {
782
+ /* @__PURE__ */ w("div", { className: "ds:flex ds:shrink-0 ds:justify-end ds:p-[var(--spacing-xs)]", children: [
783
+ /* @__PURE__ */ c(H.Title, { className: "ds:sr-only", children: R("toolRail.panelLabel", {
780
784
  tool: o.label,
781
785
  defaultValue: "{{tool}} panel"
782
786
  }) }),
783
- /* @__PURE__ */ c(K.Close, { asChild: !0, children: /* @__PURE__ */ c(
784
- he,
787
+ /* @__PURE__ */ c(H.Close, { asChild: !0, children: /* @__PURE__ */ c(
788
+ xe,
785
789
  {
786
- icon: /* @__PURE__ */ c(Ut, { "aria-hidden": "true" }),
790
+ icon: /* @__PURE__ */ c(Zt, { "aria-hidden": "true" }),
787
791
  intent: "ghost",
788
792
  size: "lg",
789
- "aria-label": S("common.close", { defaultValue: "Close" })
793
+ "aria-label": R("common.close", { defaultValue: "Close" })
790
794
  }
791
795
  ) })
792
796
  ] }),
793
- /* @__PURE__ */ I(Vt, { actions: null, children: [
797
+ /* @__PURE__ */ w(Ft, { actions: null, children: [
794
798
  o.header ? /* @__PURE__ */ c("div", { className: "ds:shrink-0", children: o.header }) : null,
795
799
  o.fill ? /* @__PURE__ */ c("div", { "data-tool-fill": "", className: "ds:flex-1 ds:min-h-0", children: o.panel }) : /* @__PURE__ */ c(
796
- Ze,
800
+ Qe,
797
801
  {
798
802
  orientation: "vertical",
799
803
  className: "ds:flex-1 ds:min-h-0",
@@ -806,24 +810,24 @@ const gn = kt(
806
810
  ) })
807
811
  }
808
812
  ) : null,
809
- /* @__PURE__ */ c(Bt, { children: /* @__PURE__ */ I(
813
+ /* @__PURE__ */ c(Mt, { children: /* @__PURE__ */ w(
810
814
  "div",
811
815
  {
812
- ref: Re,
816
+ ref: Ae,
813
817
  role: "toolbar",
814
818
  "aria-orientation": "vertical",
815
- "aria-label": He,
816
- className: nn(),
817
- onKeyDown: It,
819
+ "aria-label": Ye,
820
+ className: rn(),
821
+ onKeyDown: Et,
818
822
  children: [
819
823
  a.map((e, t) => {
820
- const n = e.id === h, s = typeof e.badgeCount == "number" && e.badgeCount > 0, r = s ? S("toolRail.toolWithCount", {
824
+ const n = e.id === h, s = typeof e.badgeCount == "number" && e.badgeCount > 0, r = s ? R("toolRail.toolWithCount", {
821
825
  tool: e.label,
822
826
  count: e.badgeCount,
823
827
  defaultValue: "{{tool}}, {{count}} updates"
824
- }) : e.label, d = we && !!e.reorderable && !e.disabled, V = d ? `${dt}-${e.id}` : void 0;
825
- return /* @__PURE__ */ I(Lt, { children: [
826
- lt && t === xe ? /* @__PURE__ */ c(
828
+ }) : e.label, d = Se && !!e.reorderable && !e.disabled, B = d ? `${Ee}-${e.id}` : void 0, D = e.disabled ? e.disabledReason : void 0, ye = D ? `${Ee}-${e.id}-reason` : void 0;
829
+ return /* @__PURE__ */ w(_t, { children: [
830
+ ft && t === Re ? /* @__PURE__ */ c(
827
831
  "div",
828
832
  {
829
833
  role: "separator",
@@ -831,100 +835,113 @@ const gn = kt(
831
835
  className: "ds:my-[var(--spacing-2xs)] ds:h-px ds:w-[var(--spacing-lg)] ds:shrink-0 ds:bg-[var(--border)] ds:forced-colors:bg-[CanvasText]"
832
836
  }
833
837
  ) : null,
834
- /* @__PURE__ */ I(
838
+ /* @__PURE__ */ w(
835
839
  "div",
836
840
  {
837
841
  className: [
838
- Qe({
842
+ at({
839
843
  dragging: M === t,
840
- dropTarget: Ie === t && M !== t,
844
+ dropTarget: Te === t && M !== t,
841
845
  reorderable: d
842
846
  }),
843
- et,
844
- Ot
847
+ st,
848
+ Ht
845
849
  ].filter(Boolean).join(" "),
846
850
  "data-reflow-id": e.id,
847
851
  "data-dragging": M === t ? "" : void 0,
848
852
  draggable: d || void 0,
849
- onDragStart: d ? (i) => {
850
- le(t), i.dataTransfer.effectAllowed = "move", i.dataTransfer.setData(
853
+ onDragStart: d ? (l) => {
854
+ ce(t), l.dataTransfer.effectAllowed = "move", l.dataTransfer.setData(
851
855
  "text/plain",
852
856
  String(t)
853
857
  );
854
858
  } : void 0,
855
- onDragOver: d ? (i) => {
856
- M !== null && (i.preventDefault(), i.dataTransfer.dropEffect = "move", Ie !== t && Y(t));
859
+ onDragOver: d ? (l) => {
860
+ M !== null && (l.preventDefault(), l.dataTransfer.dropEffect = "move", Te !== t && G(t));
857
861
  } : void 0,
858
- onDragLeave: d ? () => Y((i) => i === t ? null : i) : void 0,
859
- onDrop: d ? (i) => {
860
- i.preventDefault();
861
- const x = M;
862
- Y(null), le(null), !(x === null || x === t) && De(x, t);
862
+ onDragLeave: d ? () => G((l) => l === t ? null : l) : void 0,
863
+ onDrop: d ? (l) => {
864
+ l.preventDefault();
865
+ const S = M;
866
+ G(null), ce(null), !(S === null || S === t) && Be(S, t);
863
867
  } : void 0,
864
868
  onDragEnd: d ? () => {
865
- le(null), Y(null);
869
+ ce(null), G(null);
866
870
  } : void 0,
867
871
  children: [
868
872
  /* @__PURE__ */ c(
869
- he,
873
+ xe,
870
874
  {
871
- ref: (i) => {
872
- se.current[t] = i;
875
+ ref: (l) => {
876
+ oe.current[t] = l;
873
877
  },
874
878
  icon: e.icon,
875
- tooltip: e.label,
879
+ tooltip: D ?? e.label,
876
880
  "aria-label": r,
877
881
  intent: "ghost",
878
882
  size: "sm",
879
- disabled: e.disabled,
883
+ disabled: e.disabled && !D,
884
+ "aria-disabled": D ? !0 : void 0,
885
+ className: D ? "ds:aria-disabled:focus-visible:opacity-100 ds:aria-disabled:focus-visible:*:opacity-50" : void 0,
880
886
  "aria-pressed": n,
881
887
  "aria-expanded": n,
882
888
  "data-active": n ? e.id : void 0,
883
889
  "data-tool-id": e.id,
884
- "aria-describedby": V,
890
+ "aria-describedby": ye ?? B,
885
891
  "aria-keyshortcuts": d ? "Alt+ArrowUp Alt+ArrowDown" : void 0,
886
- tabIndex: t === O ? 0 : -1,
892
+ tabIndex: t === q ? 0 : -1,
887
893
  onFocus: () => {
888
- e.disabled || re(t);
894
+ $(e) || ie(t);
895
+ },
896
+ onClick: (l) => {
897
+ if (D) {
898
+ l.preventDefault();
899
+ return;
900
+ }
901
+ St(e.id, le.current);
889
902
  },
890
- onClick: () => wt(e.id, oe.current),
891
- onKeyDown: (i) => {
892
- if (i.key === "Enter" || i.key === " ") {
893
- oe.current = !0;
903
+ onKeyDown: (l) => {
904
+ if (l.key === "Enter" || l.key === " ") {
905
+ le.current = !0;
894
906
  return;
895
907
  }
896
- if (d && i.altKey && b) {
897
- let x = null;
898
- if (i.key === "ArrowUp" ? x = t - 1 : i.key === "ArrowDown" ? x = t + 1 : i.key === "Home" ? x = b.first : i.key === "End" && (x = b.last), x !== null) {
899
- i.preventDefault();
900
- const Tt = Math.max(
908
+ if (d && l.altKey && b) {
909
+ let S = null;
910
+ if (l.key === "ArrowUp" ? S = t - 1 : l.key === "ArrowDown" ? S = t + 1 : l.key === "Home" ? S = b.first : l.key === "End" && (S = b.last), S !== null) {
911
+ l.preventDefault();
912
+ const Nt = Math.max(
901
913
  b.first,
902
- Math.min(b.last, x)
903
- ), At = e.id;
904
- De(t, Tt), requestAnimationFrame(() => {
905
- var We, Ye;
906
- (Ye = (We = T.current) == null ? void 0 : We.querySelector(
907
- `[data-tool-id="${CSS.escape(At)}"]`
908
- )) == null || Ye.focus();
914
+ Math.min(b.last, S)
915
+ ), zt = e.id;
916
+ Be(t, Nt), requestAnimationFrame(() => {
917
+ var Xe, Je;
918
+ (Je = (Xe = T.current) == null ? void 0 : Xe.querySelector(
919
+ `[data-tool-id="${CSS.escape(zt)}"]`
920
+ )) == null || Je.focus();
909
921
  });
910
922
  }
911
923
  }
912
924
  },
913
- onKeyUp: (i) => {
914
- (i.key === "Enter" || i.key === " ") && (oe.current = !1);
925
+ onKeyUp: (l) => {
926
+ (l.key === "Enter" || l.key === " ") && (le.current = !1);
915
927
  }
916
928
  }
917
929
  ),
918
- s ? /* @__PURE__ */ c("span", { "aria-hidden": "true", className: pn(), children: mn(
930
+ s ? /* @__PURE__ */ c("span", { "aria-hidden": "true", className: gn(), children: bn(
919
931
  e.badgeCount,
920
- Et
932
+ kt
921
933
  ) }) : null,
922
- ae == null ? void 0 : ae(e, {
934
+ re == null ? void 0 : re(e, {
923
935
  index: t,
924
936
  isActive: n,
925
- isRovingTarget: t === O
937
+ isRovingTarget: t === q
926
938
  }),
927
- V ? /* @__PURE__ */ c("span", { id: V, className: "ds:sr-only", children: S("toolRail.reorderInstructions", {
939
+ ye ? (
940
+ /* Hidden: it is the icon's description, not a second
941
+ copy of the reason to read in the toolbar. */
942
+ /* @__PURE__ */ c("span", { id: ye, hidden: !0, children: D })
943
+ ) : null,
944
+ B ? /* @__PURE__ */ c("span", { id: B, className: "ds:sr-only", children: R("toolRail.reorderInstructions", {
928
945
  tool: e.label,
929
946
  defaultValue: "Reorder {{tool}}. Press Alt + Up or Alt + Down to move."
930
947
  }) }) : null
@@ -933,22 +950,22 @@ const gn = kt(
933
950
  )
934
951
  ] }, e.id);
935
952
  }),
936
- bt.map(
937
- (e) => de.isLeaving(e.id) ? /* @__PURE__ */ c(
953
+ wt.map(
954
+ (e) => ue.isLeaving(e.id) ? /* @__PURE__ */ c(
938
955
  "div",
939
956
  {
940
957
  className: [
941
- Qe({
958
+ at({
942
959
  dragging: !1,
943
960
  dropTarget: !1,
944
961
  reorderable: !1
945
962
  }),
946
- et,
947
- vn
963
+ st,
964
+ hn
948
965
  ].filter(Boolean).join(" "),
949
966
  "aria-hidden": "true",
950
967
  children: /* @__PURE__ */ c(
951
- he,
968
+ xe,
952
969
  {
953
970
  icon: e.icon,
954
971
  intent: "ghost",
@@ -969,9 +986,9 @@ const gn = kt(
969
986
  );
970
987
  }
971
988
  );
972
- gn.displayName = "ToolRail";
989
+ yn.displayName = "ToolRail";
973
990
  export {
974
- gn as T,
975
- Wt as t
991
+ yn as T,
992
+ Gt as t
976
993
  };
977
- //# sourceMappingURL=tool-rail-DjPEiBa2.js.map
994
+ //# sourceMappingURL=tool-rail-CJBtqzMs.js.map