@alfadocs/ui-kit 1.45.0 → 1.46.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 (157) hide show
  1. package/dist/_chunks/{actions-cell-renderer-BXBy9c0f.js → actions-cell-renderer-B5m9lwgC.js} +2 -2
  2. package/dist/_chunks/ai-credits-notice-xszqOZTC.js +90 -0
  3. package/dist/_chunks/ai-credits-notice.agent-C9L7orrP.js +17 -0
  4. package/dist/_chunks/{ai-consent-banner-D7I2U-cz.js → ai-permission-notice-D7I2U-cz.js} +1 -1
  5. package/dist/_chunks/ai-sparkle-D23NT8Z_.js +45 -0
  6. package/dist/_chunks/{anamnesis-summary-rows-DQUqwWc1.js → anamnesis-summary-rows-DI-UX5r6.js} +2 -2
  7. package/dist/_chunks/{appointment-card-TgR_2GKS.js → appointment-card-DluZy8Iv.js} +2 -2
  8. package/dist/_chunks/{appointment-peek-abiR0T9e.js → appointment-peek-BsfCpiJs.js} +3 -3
  9. package/dist/_chunks/{appointment-timeline-CCnyUYKz.js → appointment-timeline-Cs5f9viN.js} +3 -3
  10. package/dist/_chunks/{appointment-tray-N0yEI8UF.js → appointment-tray-CLrGGnKR.js} +2 -2
  11. package/dist/_chunks/baby-Dku-Xvg9.js +23 -0
  12. package/dist/_chunks/{balance-badge-cell-o6LldMUA.js → balance-badge-cell-YGrYdrvR.js} +3 -3
  13. package/dist/_chunks/{booking-D43ASl8y.js → booking-B7gA9gFB.js} +279 -296
  14. package/dist/_chunks/button-group-CA1tmu39.js +325 -0
  15. package/dist/_chunks/{calendar-U6N0F99w.js → calendar-OzSeTb4V.js} +2 -2
  16. package/dist/_chunks/{calendar-event-card-DKUnT9Be.js → calendar-event-card-B6N5h1dO.js} +57 -48
  17. package/dist/_chunks/{calendar-workspace-B7KvZ1_D.js → calendar-workspace-BB-BZT7W.js} +3002 -2912
  18. package/dist/_chunks/{chart-PF2krCZC.js → chart-D8ucl8hH.js} +2 -2
  19. package/dist/_chunks/{data-table-CcAx_I1w.js → data-table-DnKOmEVw.js} +2 -2
  20. package/dist/_chunks/{editable-currency-cell-renderer-Psb6XKHR.js → editable-currency-cell-renderer-OUkUv7U4.js} +2 -2
  21. package/dist/_chunks/{face-scheme-Bm6pe7R8.js → face-scheme-mIhwrQXt.js} +3 -3
  22. package/dist/_chunks/{file-manager-BfLQxF5t.js → file-manager-DOcJGIx2.js} +4 -4
  23. package/dist/_chunks/{header-settings-CTe45iDy.js → header-settings-BEfx_-TF.js} +2 -2
  24. package/dist/_chunks/{help-me-write-templates-GUeEn3Ff.js → help-me-write-templates-DHIwa4xR.js} +205 -199
  25. package/dist/_chunks/{hover-card-BMJBVqIf.js → hover-card-nUae8NPJ.js} +67 -62
  26. package/dist/_chunks/{icon-button-group-DkkdIygu.js → icon-button-group-DZKC6KGf.js} +181 -168
  27. package/dist/_chunks/kit-extensions-DuoFF1R3.js +94 -0
  28. package/dist/_chunks/{marketplace-app-shell-DdwPj03y.js → marketplace-app-shell-PB89Dkk_.js} +2 -2
  29. package/dist/_chunks/{notes-panel-Dkk9QPPX.js → notes-panel-CHbDDMx8.js} +83 -73
  30. package/dist/_chunks/{patient-details-C8ImUrVg.js → patient-details-DUj1htsH.js} +2 -2
  31. package/dist/_chunks/{patient-field-row-BRSOKvme.js → patient-field-row-CO0WR7yA.js} +2 -2
  32. package/dist/_chunks/{patient-summary-card-BhmKB2KR.js → patient-summary-card-DNzdYjxE.js} +59 -45
  33. package/dist/_chunks/rich-text-editor-BwDV2XkZ.js +4153 -0
  34. package/dist/_chunks/{tasks-panel-CpcikOeY.js → tasks-panel-DncuBPIZ.js} +2 -2
  35. package/dist/_chunks/{theme-toggle-bI0pgDDv.js → theme-toggle-BP0XRGMM.js} +2 -2
  36. package/dist/_chunks/use-ai-sparkle-Cf4yVTLB.js +76 -0
  37. package/dist/_chunks/{workflow-status-xeaJTzD3.js → workflow-status-CuJAOuKL.js} +43 -42
  38. package/dist/agent-catalog.json +32 -4
  39. package/dist/agent-i18n/en.json +1 -1
  40. package/dist/components/ai-credits-notice/ai-credits-notice.agent.d.ts +3 -0
  41. package/dist/components/ai-credits-notice/ai-credits-notice.d.ts +48 -0
  42. package/dist/components/ai-credits-notice/index.d.ts +4 -0
  43. package/dist/components/ai-credits-notice/index.js +7 -0
  44. package/dist/components/{ai-consent-banner/ai-consent-banner.agent.d.ts → ai-permission-notice/ai-permission-notice.agent.d.ts} +2 -2
  45. package/dist/components/{ai-consent-banner/ai-consent-banner.d.ts → ai-permission-notice/ai-permission-notice.d.ts} +1 -1
  46. package/dist/components/ai-permission-notice/index.d.ts +4 -0
  47. package/dist/components/{ai-consent-banner → ai-permission-notice}/index.js +1 -1
  48. package/dist/components/ai-sparkle/ai-sparkle.d.ts +3 -3
  49. package/dist/components/ai-sparkle/index.js +1 -1
  50. package/dist/components/appointment-card/index.js +2 -2
  51. package/dist/components/appointment-peek/index.js +1 -1
  52. package/dist/components/appointment-timeline/index.js +1 -1
  53. package/dist/components/booking/index.js +1 -1
  54. package/dist/components/button-group/index.js +1 -1
  55. package/dist/components/calendar/index.js +1 -1
  56. package/dist/components/calendar-event-card/index.js +1 -1
  57. package/dist/components/chart/index.js +1 -1
  58. package/dist/components/data-table/index.js +3 -3
  59. package/dist/components/face-scheme/index.js +1 -1
  60. package/dist/components/file-manager/index.js +1 -1
  61. package/dist/components/header-settings/index.js +1 -1
  62. package/dist/components/hover-card/hover-card.d.ts +4 -0
  63. package/dist/components/hover-card/index.d.ts +1 -1
  64. package/dist/components/hover-card/index.js +3 -2
  65. package/dist/components/icon-button-group/index.js +1 -1
  66. package/dist/components/index.d.ts +2 -1
  67. package/dist/components/notes-panel/index.js +1 -1
  68. package/dist/components/notes-panel/notes-panel.d.ts +10 -0
  69. package/dist/components/patient-details/index.js +1 -1
  70. package/dist/components/patient-summary-card/index.js +1 -1
  71. package/dist/components/patient-table/index.js +1 -1
  72. package/dist/components/rich-text-editor/editor-extensions.d.ts +54 -0
  73. package/dist/components/rich-text-editor/editor-toolbar.d.ts +2 -1
  74. package/dist/components/rich-text-editor/help-me-write-overlay.d.ts +4 -0
  75. package/dist/components/rich-text-editor/index.d.ts +2 -0
  76. package/dist/components/rich-text-editor/index.js +6 -4
  77. package/dist/components/rich-text-editor/kit-extensions.d.ts +4 -0
  78. package/dist/components/rich-text-editor/rich-text-editor.d.ts +18 -2
  79. package/dist/components/tasks-panel/index.js +1 -1
  80. package/dist/components/theme-toggle/index.js +1 -1
  81. package/dist/components/workflow-status/index.js +1 -1
  82. package/dist/hooks/index.d.ts +1 -1
  83. package/dist/hooks/index.js +51 -53
  84. package/dist/hooks/use-ai-sparkle.d.ts +7 -25
  85. package/dist/host-compat.css +2 -2
  86. package/dist/i18n/locales/ar.d.ts +31 -0
  87. package/dist/i18n/locales/ar.js +33 -2
  88. package/dist/i18n/locales/de.d.ts +31 -0
  89. package/dist/i18n/locales/de.js +33 -2
  90. package/dist/i18n/locales/el.d.ts +31 -0
  91. package/dist/i18n/locales/el.js +33 -2
  92. package/dist/i18n/locales/en.d.ts +31 -0
  93. package/dist/i18n/locales/en.js +33 -2
  94. package/dist/i18n/locales/es.d.ts +31 -0
  95. package/dist/i18n/locales/es.js +33 -2
  96. package/dist/i18n/locales/fr.d.ts +31 -0
  97. package/dist/i18n/locales/fr.js +33 -2
  98. package/dist/i18n/locales/hi.d.ts +31 -0
  99. package/dist/i18n/locales/hi.js +33 -2
  100. package/dist/i18n/locales/it.d.ts +31 -0
  101. package/dist/i18n/locales/it.js +33 -2
  102. package/dist/i18n/locales/ja.d.ts +31 -0
  103. package/dist/i18n/locales/ja.js +33 -2
  104. package/dist/i18n/locales/nl.d.ts +31 -0
  105. package/dist/i18n/locales/nl.js +33 -2
  106. package/dist/i18n/locales/pl.d.ts +31 -0
  107. package/dist/i18n/locales/pl.js +33 -2
  108. package/dist/i18n/locales/pt.d.ts +31 -0
  109. package/dist/i18n/locales/pt.js +33 -2
  110. package/dist/i18n/locales/ro.d.ts +31 -0
  111. package/dist/i18n/locales/ro.js +33 -2
  112. package/dist/i18n/locales/ru.d.ts +31 -0
  113. package/dist/i18n/locales/ru.js +33 -2
  114. package/dist/i18n/locales/sq.d.ts +31 -0
  115. package/dist/i18n/locales/sq.js +33 -2
  116. package/dist/i18n/locales/sv.d.ts +31 -0
  117. package/dist/i18n/locales/sv.js +33 -2
  118. package/dist/i18n/locales/tr.d.ts +31 -0
  119. package/dist/i18n/locales/tr.js +33 -2
  120. package/dist/i18n/locales/zh.d.ts +31 -0
  121. package/dist/i18n/locales/zh.js +33 -2
  122. package/dist/index.js +646 -639
  123. package/dist/locales/ar.json +33 -2
  124. package/dist/locales/de.json +33 -2
  125. package/dist/locales/el.json +33 -2
  126. package/dist/locales/en.json +33 -2
  127. package/dist/locales/es.json +33 -2
  128. package/dist/locales/fr.json +33 -2
  129. package/dist/locales/hi.json +33 -2
  130. package/dist/locales/it.json +33 -2
  131. package/dist/locales/ja.json +33 -2
  132. package/dist/locales/nl.json +33 -2
  133. package/dist/locales/pl.json +33 -2
  134. package/dist/locales/pt.json +33 -2
  135. package/dist/locales/ro.json +33 -2
  136. package/dist/locales/ru.json +33 -2
  137. package/dist/locales/sq.json +33 -2
  138. package/dist/locales/sv.json +33 -2
  139. package/dist/locales/tr.json +33 -2
  140. package/dist/locales/zh.json +33 -2
  141. package/dist/patterns/anamnesis/index.js +1 -1
  142. package/dist/patterns/calendar/calendar-workspace.d.ts +6 -4
  143. package/dist/patterns/calendar/calendar.data.d.ts +9 -0
  144. package/dist/patterns/calendar/calendar.journey.d.ts +1 -1
  145. package/dist/patterns/calendar/calendar.sheets.d.ts +16 -5
  146. package/dist/patterns/calendar/calendar.types.d.ts +3 -1
  147. package/dist/patterns/calendar/index.js +1 -1
  148. package/dist/patterns/help-me-write-templates/help-me-write-templates.d.ts +11 -2
  149. package/dist/patterns/help-me-write-templates/index.js +1 -1
  150. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  151. package/dist/tokens.css +1 -1
  152. package/package.json +14 -4
  153. package/dist/_chunks/ai-sparkle-DXeP_6a0.js +0 -52
  154. package/dist/_chunks/button-group-R32U7SyV.js +0 -307
  155. package/dist/_chunks/rich-text-editor-BrAvNajV.js +0 -3779
  156. package/dist/_chunks/use-ai-sparkle-CyQSRTCe.js +0 -103
  157. package/dist/components/ai-consent-banner/index.d.ts +0 -4
@@ -1,11 +1,11 @@
1
1
  import { jsxs as m, jsx as r, Fragment as _ } from "react/jsx-runtime";
2
- import { useState as b, useEffect as U, useId as ee, useRef as V, useCallback as S, useMemo as Y } from "react";
2
+ import { useState as b, useEffect as U, useId as ee, useRef as V, useCallback as L, useMemo as Y } from "react";
3
3
  import { useTranslation as $ } from "react-i18next";
4
4
  import { c as ce } from "./index-D2ZczOXr.js";
5
- import { A as P } from "./alert-CiQ5Pa3Q.js";
6
- import { B as D } from "./button-CaUe1uyd.js";
7
- import { I as F } from "./icon-button-CehAeZoP.js";
8
- import { D as y } from "./dialog-BJiLqhx6.js";
5
+ import { A as O } from "./alert-CiQ5Pa3Q.js";
6
+ import { B as N } from "./button-CaUe1uyd.js";
7
+ import { I as B } from "./icon-button-CehAeZoP.js";
8
+ import { D as x } from "./dialog-BJiLqhx6.js";
9
9
  import { E as de } from "./editor-overlay-DwNKaI22.js";
10
10
  import { E as me } from "./empty-state-BUN_UAWf.js";
11
11
  import { F as Z } from "./form-field-CahJzTxp.js";
@@ -51,7 +51,7 @@ function Ie({
51
51
  credits: e,
52
52
  onBack: o
53
53
  }) {
54
- const { t: l, i18n: u } = $(), f = e == null ? void 0 : e.limit, T = (e == null ? void 0 : e.remaining) ?? 0, a = f !== void 0 ? l("helpMeWriteTemplates.credits.remaining", { remaining: T, limit: f }) : void 0, t = e != null && e.resetsOn ? new Intl.DateTimeFormat(u.language, {
54
+ const { t: l, i18n: h } = $(), f = e == null ? void 0 : e.limit, T = (e == null ? void 0 : e.remaining) ?? 0, a = f !== void 0 ? l("helpMeWriteTemplates.credits.remaining", { remaining: T, limit: f }) : void 0, t = e != null && e.resetsOn ? new Intl.DateTimeFormat(h.language, {
55
55
  day: "numeric",
56
56
  month: "long"
57
57
  }).format(e.resetsOn) : void 0;
@@ -61,9 +61,9 @@ function Ie({
61
61
  className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
62
62
  "data-component": "ai-credits-exhausted-notice",
63
63
  children: [
64
- /* @__PURE__ */ m(P, { variant: "promo", icon: /* @__PURE__ */ r(fe, { "aria-hidden": "true" }), children: [
65
- /* @__PURE__ */ r(P.Title, { as: "h2", children: l("helpMeWriteTemplates.credits.title") }),
66
- /* @__PURE__ */ r(P.Description, { children: e != null && e.onBuyCredits ? t ? l("helpMeWriteTemplates.credits.bodyResets", { date: t }) : l("helpMeWriteTemplates.credits.body") : t ? l("helpMeWriteTemplates.credits.bodyWaitResets", {
64
+ /* @__PURE__ */ m(O, { variant: "promo", icon: /* @__PURE__ */ r(fe, { "aria-hidden": "true" }), children: [
65
+ /* @__PURE__ */ r(O.Title, { as: "h2", children: l("helpMeWriteTemplates.credits.title") }),
66
+ /* @__PURE__ */ r(O.Description, { children: e != null && e.onBuyCredits ? t ? l("helpMeWriteTemplates.credits.bodyResets", { date: t }) : l("helpMeWriteTemplates.credits.body") : t ? l("helpMeWriteTemplates.credits.bodyWaitResets", {
67
67
  date: t
68
68
  }) : l("helpMeWriteTemplates.credits.bodyWait") }),
69
69
  f !== void 0 && a ? /* @__PURE__ */ m("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)] ds:[margin-block-start:var(--spacing-sm)]", children: [
@@ -82,9 +82,9 @@ function Ie({
82
82
  }
83
83
  )
84
84
  ] }) : null,
85
- e != null && e.onBuyCredits || e != null && e.onSeeCosts ? /* @__PURE__ */ m(P.Action, { children: [
85
+ e != null && e.onBuyCredits || e != null && e.onSeeCosts ? /* @__PURE__ */ m(O.Action, { children: [
86
86
  e.onBuyCredits ? /* @__PURE__ */ r(
87
- D,
87
+ N,
88
88
  {
89
89
  intent: "tonal",
90
90
  size: "sm",
@@ -93,11 +93,11 @@ function Ie({
93
93
  children: l("helpMeWriteTemplates.credits.cta")
94
94
  }
95
95
  ) : null,
96
- e.onSeeCosts ? /* @__PURE__ */ r(D, { intent: "link", size: "sm", onClick: e.onSeeCosts, children: l("helpMeWriteTemplates.credits.secondary") }) : null
96
+ e.onSeeCosts ? /* @__PURE__ */ r(N, { intent: "link", size: "sm", onClick: e.onSeeCosts, children: l("helpMeWriteTemplates.credits.secondary") }) : null
97
97
  ] }) : null
98
98
  ] }),
99
99
  /* @__PURE__ */ m("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]", children: [
100
- o ? /* @__PURE__ */ r(D, { intent: "ghost", startIcon: /* @__PURE__ */ r(ve, {}), onClick: o, children: l("helpMeWriteTemplates.credits.back") }) : null,
100
+ o ? /* @__PURE__ */ r(N, { intent: "ghost", startIcon: /* @__PURE__ */ r(ve, {}), onClick: o, children: l("helpMeWriteTemplates.credits.back") }) : null,
101
101
  /* @__PURE__ */ r("p", { className: K, children: l("helpMeWriteTemplates.credits.kept") })
102
102
  ] })
103
103
  ]
@@ -108,65 +108,65 @@ function Re({
108
108
  context: e,
109
109
  onGenerate: o,
110
110
  onApplied: l,
111
- credits: u,
111
+ credits: h,
112
112
  enableDictation: f = !0,
113
113
  suspendClose: T = !1
114
114
  }) {
115
- const { t: a } = $(), { open: t } = e, x = ee(), s = ee(), [c, E] = b(""), [w, I] = b(!1), [z, i] = b(!1), [v, d] = b(!1), [C, h] = b(null), g = V(null), k = f ? e.onDictate : void 0, [N, A] = b(!1), [L, B] = b(""), [X, n] = b(""), W = V(null), R = S(() => {
115
+ const { t: a } = $(), { open: t } = e, k = ee(), s = ee(), [u, D] = b(""), [w, E] = b(!1), [z, i] = b(!1), [g, c] = b(!1), [C, I] = b(null), d = V(null), v = f ? e.onDictate : void 0, [W, A] = b(!1), [S, P] = b(""), [X, n] = b(""), y = V(null), R = L(() => {
116
116
  var p;
117
- return (p = W.current) == null ? void 0 : p.abort();
118
- }, []), ie = S(() => {
119
- if (N) {
117
+ return (p = y.current) == null ? void 0 : p.abort();
118
+ }, []), ie = L(() => {
119
+ if (W) {
120
120
  R();
121
121
  return;
122
122
  }
123
- if (!k) return;
123
+ if (!v) return;
124
124
  const p = new AbortController();
125
- W.current = p, A(!0), n(a("helpMeWriteTemplates.bar.listening")), k({
125
+ y.current = p, A(!0), n(a("helpMeWriteTemplates.bar.listening")), v({
126
126
  signal: p.signal,
127
127
  onPartialTranscript: (M) => {
128
- p.signal.aborted || B(M);
128
+ p.signal.aborted || P(M);
129
129
  },
130
130
  onFinalTranscript: (M) => {
131
131
  if (p.signal.aborted) return;
132
- B("");
133
- const O = M.trim();
134
- O && (E((H) => ne(H, O)), n(O));
132
+ P("");
133
+ const H = M.trim();
134
+ H && (D((F) => ne(F, H)), n(H));
135
135
  }
136
136
  }).catch((M) => {
137
- M instanceof ae && d(!0);
137
+ M instanceof ae && c(!0);
138
138
  }).finally(() => {
139
- B(""), W.current === p && (W.current = null, A(!1), n(""));
139
+ P(""), y.current === p && (y.current = null, A(!1), n(""));
140
140
  });
141
- }, [N, k, R, a]);
141
+ }, [W, v, R, a]);
142
142
  U(() => {
143
143
  var p, M;
144
- t ? (E(""), I(!1), i(!1), d(e.creditsExhausted), h(null)) : ((p = g.current) == null || p.abort(), (M = W.current) == null || M.abort());
144
+ t ? (D(""), E(!1), i(!1), c(e.creditsExhausted), I(null)) : ((p = d.current) == null || p.abort(), (M = y.current) == null || M.abort());
145
145
  }, [t]), U(
146
146
  () => () => {
147
147
  var p, M;
148
- (p = g.current) == null || p.abort(), (M = W.current) == null || M.abort();
148
+ (p = d.current) == null || p.abort(), (M = y.current) == null || M.abort();
149
149
  },
150
150
  []
151
151
  );
152
- const Q = S(() => {
153
- var O;
154
- if (w || !c.trim()) return;
155
- R(), (O = g.current) == null || O.abort();
152
+ const Q = L(() => {
153
+ var H;
154
+ if (w || !u.trim()) return;
155
+ R(), (H = d.current) == null || H.abort();
156
156
  const p = new AbortController();
157
- g.current = p, i(!1), I(!0);
157
+ d.current = p, i(!1), E(!0);
158
158
  const M = e.scope === "selection";
159
159
  o({
160
- prompt: c.trim(),
160
+ prompt: u.trim(),
161
161
  sourceText: M ? e.selectionText : e.getText(),
162
162
  scope: M ? "selection" : "document",
163
163
  signal: p.signal
164
- }).then((H) => {
165
- p.signal.aborted || (h(H), I(!1));
166
- }).catch((H) => {
167
- p.signal.aborted || ze(H) || (H instanceof ae ? d(!0) : i(!0), I(!1));
164
+ }).then((F) => {
165
+ p.signal.aborted || (I(F), E(!1));
166
+ }).catch((F) => {
167
+ p.signal.aborted || ze(F) || (F instanceof ae ? c(!0) : i(!0), E(!1));
168
168
  });
169
- }, [w, c, o, R]), { onClose: G } = e, le = S(() => {
169
+ }, [w, u, o, R]), { onClose: G } = e, le = L(() => {
170
170
  T || G();
171
171
  }, [T, G]), oe = () => {
172
172
  if (C === null) return;
@@ -180,12 +180,12 @@ function Re({
180
180
  });
181
181
  };
182
182
  let j;
183
- if (v)
183
+ if (g)
184
184
  j = /* @__PURE__ */ r(
185
185
  Ie,
186
186
  {
187
- credits: u,
188
- onBack: () => d(!1)
187
+ credits: h,
188
+ onBack: () => c(!1)
189
189
  }
190
190
  );
191
191
  else if (C !== null)
@@ -193,10 +193,10 @@ function Re({
193
193
  /* @__PURE__ */ m(
194
194
  "section",
195
195
  {
196
- "aria-labelledby": x,
196
+ "aria-labelledby": k,
197
197
  className: "ds:flex ds:min-w-0 ds:flex-col ds:gap-[var(--spacing-2xs)]",
198
198
  children: [
199
- /* @__PURE__ */ r("h2", { id: x, className: De, children: a("helpMeWriteTemplates.bar.after") }),
199
+ /* @__PURE__ */ r("h2", { id: k, className: De, children: a("helpMeWriteTemplates.bar.after") }),
200
200
  /* @__PURE__ */ r(
201
201
  he,
202
202
  {
@@ -210,28 +210,28 @@ function Re({
210
210
  }
211
211
  ),
212
212
  /* @__PURE__ */ m("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]", children: [
213
- /* @__PURE__ */ r(D, { intent: "ghost", startIcon: /* @__PURE__ */ r(te, {}), onClick: e.onClose, children: a("helpMeWriteTemplates.bar.discard") }),
213
+ /* @__PURE__ */ r(N, { intent: "ghost", startIcon: /* @__PURE__ */ r(te, {}), onClick: e.onClose, children: a("helpMeWriteTemplates.bar.discard") }),
214
214
  /* @__PURE__ */ r(
215
- D,
215
+ N,
216
216
  {
217
217
  intent: "ghost",
218
218
  startIcon: /* @__PURE__ */ r(Ce, {}),
219
219
  onClick: () => {
220
- h(null), Q();
220
+ I(null), Q();
221
221
  },
222
222
  children: a("helpMeWriteTemplates.bar.retry")
223
223
  }
224
224
  ),
225
225
  /* @__PURE__ */ r("span", { className: "ds:flex-1", "aria-hidden": "true" }),
226
- /* @__PURE__ */ r(D, { intent: "primary", onClick: oe, children: e.scope === "selection" ? a("helpMeWriteTemplates.bar.replace") : a("helpMeWriteTemplates.bar.insert") })
226
+ /* @__PURE__ */ r(N, { intent: "primary", onClick: oe, children: e.scope === "selection" ? a("helpMeWriteTemplates.bar.replace") : a("helpMeWriteTemplates.bar.insert") })
227
227
  ] })
228
228
  ] });
229
229
  else {
230
- const p = N ? ne(c, L) : c;
230
+ const p = W ? ne(u, S) : u;
231
231
  j = /* @__PURE__ */ m(_, { children: [
232
232
  /* @__PURE__ */ m("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
233
233
  /* @__PURE__ */ r(
234
- F,
234
+ B,
235
235
  {
236
236
  size: "md",
237
237
  intent: "outline",
@@ -246,45 +246,45 @@ function Re({
246
246
  {
247
247
  size: "md",
248
248
  value: p,
249
- onChange: (M) => E(M.target.value),
249
+ onChange: (M) => D(M.target.value),
250
250
  placeholder: a("editor.ai.promptPlaceholder"),
251
251
  "aria-label": a("editor.ai.promptLabel"),
252
252
  autoResize: !0,
253
253
  minRows: 1,
254
254
  maxRows: 3,
255
- readOnly: w || N,
255
+ readOnly: w || W,
256
256
  tone: z ? "error" : "default",
257
257
  "aria-describedby": z ? s : void 0
258
258
  }
259
259
  ) }),
260
- k ? /* @__PURE__ */ r(
261
- F,
260
+ v ? /* @__PURE__ */ r(
261
+ B,
262
262
  {
263
263
  size: "md",
264
264
  intent: "outline",
265
- className: N ? `${q} ${ke}` : q,
266
- icon: N ? /* @__PURE__ */ r(We, { className: "ds:fill-current" }) : /* @__PURE__ */ r(ye, {}),
267
- "aria-pressed": N,
268
- "aria-label": a(N ? "helpMeWriteTemplates.bar.dictateStop" : "helpMeWriteTemplates.bar.dictateStart"),
265
+ className: W ? `${q} ${ke}` : q,
266
+ icon: W ? /* @__PURE__ */ r(We, { className: "ds:fill-current" }) : /* @__PURE__ */ r(ye, {}),
267
+ "aria-pressed": W,
268
+ "aria-label": a(W ? "helpMeWriteTemplates.bar.dictateStop" : "helpMeWriteTemplates.bar.dictateStart"),
269
269
  disabled: w,
270
270
  onClick: ie
271
271
  }
272
272
  ) : null,
273
273
  /* @__PURE__ */ r(
274
- F,
274
+ B,
275
275
  {
276
276
  size: "md",
277
277
  intent: "primary",
278
278
  className: Ne,
279
279
  icon: w ? /* @__PURE__ */ r(ue, { size: "sm", variant: "pulse" }) : /* @__PURE__ */ r(xe, {}),
280
- disabled: w || !c.trim(),
280
+ disabled: w || !u.trim(),
281
281
  "aria-busy": w || void 0,
282
282
  "aria-label": a("helpMeWriteTemplates.bar.write"),
283
283
  onClick: Q
284
284
  }
285
285
  )
286
286
  ] }),
287
- k ? /* @__PURE__ */ r("p", { className: "ds:sr-only", role: "status", "aria-live": "polite", children: X }) : null,
287
+ v ? /* @__PURE__ */ r("p", { className: "ds:sr-only", role: "status", "aria-live": "polite", children: X }) : null,
288
288
  z ? /* @__PURE__ */ r("p", { id: s, role: "alert", className: K, children: a("helpMeWriteTemplates.bar.error") }) : null,
289
289
  /* @__PURE__ */ m("p", { className: K, children: [
290
290
  e.scope === "selection" ? a("helpMeWriteTemplates.bar.contextSelection") : a("helpMeWriteTemplates.bar.contextDocument"),
@@ -314,52 +314,52 @@ const Ae = ce("", {
314
314
  defaultVariants: { dragging: !1, dropTarget: !1 }
315
315
  });
316
316
  function Se(e, o) {
317
- const { t: l } = $(), [u, f] = b(null), [T, a] = b(null), [t, x] = b(""), s = V(!1), c = (i, v) => {
318
- const d = Math.max(0, Math.min(e.length - 1, v));
319
- if (!o || d === i) return;
320
- const C = e.map((k) => k.id), [h] = C.splice(i, 1);
321
- C.splice(d, 0, h), o(C), s.current = !s.current;
322
- const g = l("helpMeWriteTemplates.manager.reorderAnnounce", {
317
+ const { t: l } = $(), [h, f] = b(null), [T, a] = b(null), [t, k] = b(""), s = V(!1), u = (i, g) => {
318
+ const c = Math.max(0, Math.min(e.length - 1, g));
319
+ if (!o || c === i) return;
320
+ const C = e.map((v) => v.id), [I] = C.splice(i, 1);
321
+ C.splice(c, 0, I), o(C), s.current = !s.current;
322
+ const d = l("helpMeWriteTemplates.manager.reorderAnnounce", {
323
323
  label: e[i].name,
324
- to: d + 1,
324
+ to: c + 1,
325
325
  total: e.length
326
326
  });
327
- x(s.current ? g : `${g}​`);
327
+ k(s.current ? d : `${d}​`);
328
328
  };
329
329
  return { rowProps: (i) => o ? {
330
330
  draggable: !0,
331
- onDragStart: (v) => {
332
- f(i), v.dataTransfer.effectAllowed = "move", v.dataTransfer.setData("text/plain", String(i));
331
+ onDragStart: (g) => {
332
+ f(i), g.dataTransfer.effectAllowed = "move", g.dataTransfer.setData("text/plain", String(i));
333
333
  },
334
334
  onDragEnd: () => {
335
335
  f(null), a(null);
336
336
  },
337
- onDragOver: (v) => {
338
- u !== null && (v.preventDefault(), v.dataTransfer.dropEffect = "move", a(i));
337
+ onDragOver: (g) => {
338
+ h !== null && (g.preventDefault(), g.dataTransfer.dropEffect = "move", a(i));
339
339
  },
340
340
  onDragLeave: () => a(null),
341
- onDrop: (v) => {
342
- v.preventDefault();
343
- const d = u;
344
- f(null), a(null), d !== null && c(d, i);
341
+ onDrop: (g) => {
342
+ g.preventDefault();
343
+ const c = h;
344
+ f(null), a(null), c !== null && u(c, i);
345
345
  }
346
346
  } : {}, rowClass: (i) => Ae({
347
- dragging: u === i,
348
- dropTarget: T === i && u !== i
349
- }), handle: (i, v) => /* @__PURE__ */ r(
350
- F,
347
+ dragging: h === i,
348
+ dropTarget: T === i && h !== i
349
+ }), handle: (i, g) => /* @__PURE__ */ r(
350
+ B,
351
351
  {
352
352
  size: "sm",
353
353
  intent: "ghost",
354
354
  icon: /* @__PURE__ */ r(we, { "aria-hidden": "true" }),
355
355
  "aria-label": l("helpMeWriteTemplates.manager.reorderHandle", {
356
- label: v
356
+ label: g
357
357
  }),
358
358
  className: "ds:cursor-grab ds:active:cursor-grabbing",
359
- onKeyDown: (d) => {
360
- if (!d.altKey) return;
361
- const C = d.key === "ArrowUp" ? i - 1 : d.key === "ArrowDown" ? i + 1 : d.key === "Home" ? 0 : d.key === "End" ? e.length - 1 : null;
362
- C !== null && (d.preventDefault(), c(i, C));
359
+ onKeyDown: (c) => {
360
+ if (!c.altKey) return;
361
+ const C = c.key === "ArrowUp" ? i - 1 : c.key === "ArrowDown" ? i + 1 : c.key === "Home" ? 0 : c.key === "End" ? e.length - 1 : null;
362
+ C !== null && (c.preventDefault(), u(i, C));
363
363
  }
364
364
  }
365
365
  ), liveRegion: /* @__PURE__ */ r("span", { role: "status", "aria-live": "polite", className: "ds:sr-only", children: t }) };
@@ -374,46 +374,46 @@ function Pe({
374
374
  open: e,
375
375
  onOpenChange: o,
376
376
  initialMode: l = "list",
377
- templates: u,
377
+ templates: h,
378
378
  onSaveTemplate: f,
379
379
  onDeleteTemplate: T,
380
380
  onReorderTemplates: a
381
381
  }) {
382
- const { t } = $(), x = Se(u, a), [s, c] = b(null), [E, w] = b(!1), [I, z] = b(!1), [i, v] = b(null), [d, C] = b(!1), [h, g] = b(!1), k = async () => {
383
- if (!(!i || d)) {
384
- C(!0), g(!1);
382
+ const { t } = $(), k = Se(h, a), [s, u] = b(null), [D, w] = b(!1), [E, z] = b(!1), [i, g] = b(null), [c, C] = b(!1), [I, d] = b(!1), v = async () => {
383
+ if (!(!i || c)) {
384
+ C(!0), d(!1);
385
385
  try {
386
- await (T == null ? void 0 : T(i.id)), v(null);
386
+ await (T == null ? void 0 : T(i.id)), g(null);
387
387
  } catch {
388
- g(!0);
388
+ d(!0);
389
389
  } finally {
390
390
  C(!1);
391
391
  }
392
392
  }
393
393
  };
394
394
  U(() => {
395
- e && (z(!1), c(l === "create" ? { ...J } : null));
395
+ e && (z(!1), u(l === "create" ? { ...J } : null));
396
396
  }, [e]);
397
- const N = (n, W) => u.some(
398
- (R) => R.id !== W && R.name.toLowerCase() === n.toLowerCase()
397
+ const W = (n, y) => h.some(
398
+ (R) => R.id !== y && R.name.toLowerCase() === n.toLowerCase()
399
399
  ), A = (() => {
400
400
  if (!(s != null && s.submitted)) return;
401
401
  const n = s.name.trim();
402
- return n ? N(n, s.id) ? t("helpMeWriteTemplates.manager.nameTaken") : void 0 : t("helpMeWriteTemplates.manager.nameRequired");
403
- })(), L = s != null && s.submitted && !s.prompt.trim() ? t("helpMeWriteTemplates.manager.promptRequired") : void 0, B = async () => {
404
- if (!s || E) return;
402
+ return n ? W(n, s.id) ? t("helpMeWriteTemplates.manager.nameTaken") : void 0 : t("helpMeWriteTemplates.manager.nameRequired");
403
+ })(), S = s != null && s.submitted && !s.prompt.trim() ? t("helpMeWriteTemplates.manager.promptRequired") : void 0, P = async () => {
404
+ if (!s || D) return;
405
405
  const n = { ...s, submitted: !0 };
406
- c(n);
407
- const W = n.name.trim(), R = n.prompt.trim();
408
- if (!(!W || !R || N(W, n.id))) {
406
+ u(n);
407
+ const y = n.name.trim(), R = n.prompt.trim();
408
+ if (!(!y || !R || W(y, n.id))) {
409
409
  w(!0), z(!1);
410
410
  try {
411
411
  await f({
412
412
  id: n.id,
413
- name: W,
413
+ name: y,
414
414
  description: n.description.trim() || void 0,
415
415
  prompt: R
416
- }), c(null);
416
+ }), u(null);
417
417
  } catch {
418
418
  z(!0);
419
419
  } finally {
@@ -422,14 +422,14 @@ function Pe({
422
422
  }
423
423
  }, X = s ? s.id ? t("helpMeWriteTemplates.manager.formEdit") : t("helpMeWriteTemplates.manager.formNew") : t("helpMeWriteTemplates.manager.title");
424
424
  return /* @__PURE__ */ m(_, { children: [
425
- /* @__PURE__ */ r(y, { open: e, onOpenChange: o, children: /* @__PURE__ */ r(y.Content, { size: "lg", children: /* @__PURE__ */ m("div", { className: "ds:contents", "data-component": "ai-template-manager", children: [
426
- /* @__PURE__ */ m(y.Header, { children: [
427
- /* @__PURE__ */ r(y.Title, { children: X }),
428
- /* @__PURE__ */ r(y.Description, { children: t("helpMeWriteTemplates.manager.description") })
425
+ /* @__PURE__ */ r(x, { open: e, onOpenChange: o, children: /* @__PURE__ */ r(x.Content, { size: "lg", children: /* @__PURE__ */ m("div", { className: "ds:contents", "data-component": "ai-template-manager", children: [
426
+ /* @__PURE__ */ m(x.Header, { children: [
427
+ /* @__PURE__ */ r(x.Title, { children: X }),
428
+ /* @__PURE__ */ r(x.Description, { children: t("helpMeWriteTemplates.manager.description") })
429
429
  ] }),
430
- /* @__PURE__ */ m(y.Body, { children: [
430
+ /* @__PURE__ */ m(x.Body, { children: [
431
431
  s ? /* @__PURE__ */ m("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
432
- I ? /* @__PURE__ */ r(P, { variant: "error", children: t("helpMeWriteTemplates.manager.saveError") }) : null,
432
+ E ? /* @__PURE__ */ r(O, { variant: "error", children: t("helpMeWriteTemplates.manager.saveError") }) : null,
433
433
  /* @__PURE__ */ r(
434
434
  Z,
435
435
  {
@@ -444,7 +444,7 @@ function Pe({
444
444
  placeholder: t(
445
445
  "helpMeWriteTemplates.manager.namePlaceholder"
446
446
  ),
447
- onChange: (n) => c({ ...s, name: n.target.value })
447
+ onChange: (n) => u({ ...s, name: n.target.value })
448
448
  }
449
449
  )
450
450
  }
@@ -460,7 +460,7 @@ function Pe({
460
460
  {
461
461
  value: s.description,
462
462
  maxLength: 120,
463
- onChange: (n) => c({ ...s, description: n.target.value })
463
+ onChange: (n) => u({ ...s, description: n.target.value })
464
464
  }
465
465
  )
466
466
  }
@@ -472,7 +472,7 @@ function Pe({
472
472
  description: t(
473
473
  "helpMeWriteTemplates.manager.promptDescription"
474
474
  ),
475
- error: L,
475
+ error: S,
476
476
  required: !0,
477
477
  children: /* @__PURE__ */ r(
478
478
  se,
@@ -482,12 +482,12 @@ function Pe({
482
482
  autoResize: !0,
483
483
  minRows: 4,
484
484
  maxRows: 10,
485
- onChange: (n) => c({ ...s, prompt: n.target.value })
485
+ onChange: (n) => u({ ...s, prompt: n.target.value })
486
486
  }
487
487
  )
488
488
  }
489
489
  )
490
- ] }) : u.length === 0 ? /* @__PURE__ */ r(
490
+ ] }) : h.length === 0 ? /* @__PURE__ */ r(
491
491
  me,
492
492
  {
493
493
  variant: "first-use",
@@ -498,7 +498,7 @@ function Pe({
498
498
  ),
499
499
  primaryAction: {
500
500
  label: t("helpMeWriteTemplates.manager.new"),
501
- onClick: () => c({ ...J })
501
+ onClick: () => u({ ...J })
502
502
  }
503
503
  }
504
504
  ) : /* @__PURE__ */ r(
@@ -506,19 +506,19 @@ function Pe({
506
506
  {
507
507
  "aria-label": t("helpMeWriteTemplates.manager.listLabel"),
508
508
  className: "ds:m-0 ds:flex ds:list-none ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-0",
509
- children: u.map((n, W) => /* @__PURE__ */ m(
509
+ children: h.map((n, y) => /* @__PURE__ */ m(
510
510
  "li",
511
511
  {
512
- ...x.rowProps(W),
513
- className: `ds:flex ds:items-start ds:gap-[var(--spacing-sm)] ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)] ds:p-[var(--spacing-sm)] ${x.rowClass(W)}`,
512
+ ...k.rowProps(y),
513
+ className: `ds:flex ds:items-start ds:gap-[var(--spacing-sm)] ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)] ds:p-[var(--spacing-sm)] ${k.rowClass(y)}`,
514
514
  children: [
515
- a ? x.handle(W, n.name) : null,
515
+ a ? k.handle(y, n.name) : null,
516
516
  /* @__PURE__ */ m("div", { className: "ds:flex ds:min-w-0 ds:flex-1 ds:flex-col ds:gap-[var(--spacing-2xs)]", children: [
517
517
  /* @__PURE__ */ r("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]", children: /* @__PURE__ */ r("span", { className: "type-title-item ds:text-[color:var(--foreground)]", children: n.name }) }),
518
518
  /* @__PURE__ */ r("p", { className: `${K} ds:line-clamp-2`, children: n.description || n.prompt })
519
519
  ] }),
520
520
  /* @__PURE__ */ r(
521
- F,
521
+ B,
522
522
  {
523
523
  size: "sm",
524
524
  intent: "ghost",
@@ -526,7 +526,7 @@ function Pe({
526
526
  "aria-label": t("helpMeWriteTemplates.manager.edit", {
527
527
  name: n.name
528
528
  }),
529
- onClick: () => c({
529
+ onClick: () => u({
530
530
  id: n.id,
531
531
  name: n.name,
532
532
  description: n.description ?? "",
@@ -536,7 +536,7 @@ function Pe({
536
536
  }
537
537
  ),
538
538
  T ? /* @__PURE__ */ r(
539
- F,
539
+ B,
540
540
  {
541
541
  size: "sm",
542
542
  intent: "ghost",
@@ -544,7 +544,7 @@ function Pe({
544
544
  "aria-label": t("helpMeWriteTemplates.manager.delete", {
545
545
  name: n.name
546
546
  }),
547
- onClick: () => v(n)
547
+ onClick: () => g(n)
548
548
  }
549
549
  ) : null
550
550
  ]
@@ -553,55 +553,55 @@ function Pe({
553
553
  ))
554
554
  }
555
555
  ),
556
- x.liveRegion
556
+ k.liveRegion
557
557
  ] }),
558
- /* @__PURE__ */ r(y.Footer, { children: s ? /* @__PURE__ */ m(_, { children: [
559
- /* @__PURE__ */ r(D, { intent: "secondary", onClick: () => c(null), children: t("helpMeWriteTemplates.manager.cancel") }),
558
+ /* @__PURE__ */ r(x.Footer, { children: s ? /* @__PURE__ */ m(_, { children: [
559
+ /* @__PURE__ */ r(N, { intent: "secondary", onClick: () => u(null), children: t("helpMeWriteTemplates.manager.cancel") }),
560
560
  /* @__PURE__ */ r(
561
- D,
561
+ N,
562
562
  {
563
563
  intent: "primary",
564
- loading: E,
565
- onClick: () => void B(),
564
+ loading: D,
565
+ onClick: () => void P(),
566
566
  children: t("helpMeWriteTemplates.manager.save")
567
567
  }
568
568
  )
569
569
  ] }) : /* @__PURE__ */ m(_, { children: [
570
- u.length > 0 ? /* @__PURE__ */ r(
571
- D,
570
+ h.length > 0 ? /* @__PURE__ */ r(
571
+ N,
572
572
  {
573
573
  intent: "outline",
574
574
  startIcon: /* @__PURE__ */ r(Me, {}),
575
- onClick: () => c({ ...J }),
575
+ onClick: () => u({ ...J }),
576
576
  children: t("helpMeWriteTemplates.manager.new")
577
577
  }
578
578
  ) : null,
579
- /* @__PURE__ */ r(y.Close, { asChild: !0, children: /* @__PURE__ */ r(D, { intent: "primary", children: t("helpMeWriteTemplates.manager.done") }) })
579
+ /* @__PURE__ */ r(x.Close, { asChild: !0, children: /* @__PURE__ */ r(N, { intent: "primary", children: t("helpMeWriteTemplates.manager.done") }) })
580
580
  ] }) })
581
581
  ] }) }) }),
582
582
  /* @__PURE__ */ r(
583
- y,
583
+ x,
584
584
  {
585
585
  open: i != null,
586
586
  onOpenChange: (n) => {
587
- !n && !d && (v(null), g(!1));
587
+ !n && !c && (g(null), d(!1));
588
588
  },
589
- children: /* @__PURE__ */ m(y.Content, { size: "sm", variant: "alert", children: [
590
- /* @__PURE__ */ m(y.Header, { children: [
591
- /* @__PURE__ */ r(y.Title, { children: t("helpMeWriteTemplates.manager.deleteTitle", {
589
+ children: /* @__PURE__ */ m(x.Content, { size: "sm", variant: "alert", children: [
590
+ /* @__PURE__ */ m(x.Header, { children: [
591
+ /* @__PURE__ */ r(x.Title, { children: t("helpMeWriteTemplates.manager.deleteTitle", {
592
592
  name: (i == null ? void 0 : i.name) ?? ""
593
593
  }) }),
594
- /* @__PURE__ */ r(y.Description, { children: t("helpMeWriteTemplates.manager.deleteDescription") })
594
+ /* @__PURE__ */ r(x.Description, { children: t("helpMeWriteTemplates.manager.deleteDescription") })
595
595
  ] }),
596
- h ? /* @__PURE__ */ r(y.Body, { children: /* @__PURE__ */ r(P, { variant: "error", children: t("helpMeWriteTemplates.manager.deleteError") }) }) : null,
597
- /* @__PURE__ */ m(y.Footer, { children: [
598
- /* @__PURE__ */ r(y.Close, { asChild: !0, children: /* @__PURE__ */ r(D, { intent: "secondary", disabled: d, children: t("helpMeWriteTemplates.manager.cancel") }) }),
596
+ I ? /* @__PURE__ */ r(x.Body, { children: /* @__PURE__ */ r(O, { variant: "error", children: t("helpMeWriteTemplates.manager.deleteError") }) }) : null,
597
+ /* @__PURE__ */ m(x.Footer, { children: [
598
+ /* @__PURE__ */ r(x.Close, { asChild: !0, children: /* @__PURE__ */ r(N, { intent: "secondary", disabled: c, children: t("helpMeWriteTemplates.manager.cancel") }) }),
599
599
  /* @__PURE__ */ r(
600
- D,
600
+ N,
601
601
  {
602
602
  intent: "destructive",
603
- loading: d,
604
- onClick: () => void k(),
603
+ loading: c,
604
+ onClick: () => void v(),
605
605
  children: t("helpMeWriteTemplates.manager.deleteConfirm")
606
606
  }
607
607
  )
@@ -616,14 +616,14 @@ function Le({
616
616
  onUndo: o,
617
617
  onDismiss: l
618
618
  }) {
619
- const { t: u } = $(), f = V(null);
619
+ const { t: h } = $(), f = V(null);
620
620
  if (U(() => {
621
621
  var a;
622
622
  e && ((a = f.current) == null || a.focus());
623
623
  }, [e]), !(e != null && e.template)) return null;
624
624
  const T = e.template.name;
625
625
  return /* @__PURE__ */ r(
626
- P,
626
+ O,
627
627
  {
628
628
  variant: "success",
629
629
  dismissible: !0,
@@ -632,8 +632,8 @@ function Le({
632
632
  },
633
633
  "data-component": "help-me-write-undo-notice",
634
634
  children: /* @__PURE__ */ m("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]", children: [
635
- /* @__PURE__ */ r("span", { children: e.mode === "below" ? u("helpMeWriteTemplates.undo.addedBelow", { name: T }) : u("helpMeWriteTemplates.undo.replaced", { name: T }) }),
636
- /* @__PURE__ */ r(D, { ref: f, intent: "outline", size: "sm", onClick: o, children: u("helpMeWriteTemplates.undo.undo") })
635
+ /* @__PURE__ */ r("span", { children: e.mode === "below" ? h("helpMeWriteTemplates.undo.addedBelow", { name: T }) : h("helpMeWriteTemplates.undo.replaced", { name: T }) }),
636
+ /* @__PURE__ */ r(N, { ref: f, intent: "outline", size: "sm", onClick: o, children: h("helpMeWriteTemplates.undo.undo") })
637
637
  ] })
638
638
  }
639
639
  );
@@ -642,92 +642,98 @@ function mr({
642
642
  templates: e,
643
643
  onGenerate: o,
644
644
  onSaveTemplate: l,
645
- onDeleteTemplate: u,
645
+ onDeleteTemplate: h,
646
646
  onReorderTemplates: f,
647
647
  credits: T,
648
648
  enableDictation: a,
649
- onApplied: t
649
+ onApplied: t,
650
+ creditsNotice: k
650
651
  }) {
651
- const [x, s] = b({ open: !1, mode: "list" }), [c, E] = b(null), w = S(
652
- (h = "list") => s({ open: !0, mode: h }),
652
+ const [s, u] = b({ open: !1, mode: "list" }), [D, w] = b(null), E = L(
653
+ (d = "list") => u({ open: !0, mode: d }),
653
654
  []
654
- ), I = S(
655
- (h) => /* @__PURE__ */ r(
655
+ ), z = L(
656
+ (d) => /* @__PURE__ */ r(
656
657
  Re,
657
658
  {
658
- context: h,
659
+ context: d,
659
660
  onGenerate: o,
660
661
  credits: T,
661
662
  enableDictation: a,
662
- suspendClose: x.open,
663
+ suspendClose: s.open,
663
664
  onApplied: t
664
665
  }
665
666
  ),
666
- [o, T, a, x.open, t]
667
- ), z = Y(() => {
668
- const h = new Map(e.map((g) => [g.id, g]));
667
+ [o, T, a, s.open, t]
668
+ ), i = Y(() => {
669
+ const d = new Map(e.map((v) => [v.id, v]));
669
670
  return {
670
671
  templates: e,
671
- onRun: ({ template: g, text: k, scope: N, signal: A }) => {
672
- const L = h.get(g.id);
673
- return L ? o({
674
- template: L,
672
+ onRun: ({ template: v, text: W, scope: A, signal: S }) => {
673
+ const P = d.get(v.id);
674
+ return P ? o({
675
+ template: P,
675
676
  prompt: "",
676
- sourceText: k,
677
- scope: N,
678
- signal: A
677
+ sourceText: W,
678
+ scope: A,
679
+ signal: S
679
680
  }) : Promise.reject(new Error("Unknown template"));
680
681
  },
681
- onManage: l ? w : void 0
682
+ onManage: l ? E : void 0
682
683
  };
683
- }, [e, o, l, w]), i = S(
684
- (h) => {
685
- if (h.action !== "template" || !h.template) return;
686
- const g = e.find((N) => {
687
- var A;
688
- return N.id === ((A = h.template) == null ? void 0 : A.id);
689
- }), k = {
684
+ }, [e, o, l, E]), g = L(
685
+ (d) => {
686
+ if (d.action !== "template" || !d.template) return;
687
+ const v = e.find((A) => {
688
+ var S;
689
+ return A.id === ((S = d.template) == null ? void 0 : S.id);
690
+ }), W = {
690
691
  mode: "replace",
691
- template: g,
692
- previousHtml: h.previousHtml,
693
- undo: h.undo
692
+ template: v,
693
+ previousHtml: d.previousHtml,
694
+ undo: d.undo
694
695
  };
695
- E(g ? k : null), t == null || t(k);
696
+ w(v ? W : null), t == null || t(W);
696
697
  },
697
698
  [e, t]
698
- ), v = Y(
699
+ ), c = Y(
699
700
  () => l ? /* @__PURE__ */ r(
700
701
  Pe,
701
702
  {
702
- open: x.open,
703
- initialMode: x.mode,
704
- onOpenChange: (h) => s((g) => ({ ...g, open: h })),
703
+ open: s.open,
704
+ initialMode: s.mode,
705
+ onOpenChange: (d) => u((v) => ({ ...v, open: d })),
705
706
  templates: e,
706
707
  onSaveTemplate: l,
707
- onDeleteTemplate: u,
708
+ onDeleteTemplate: h,
708
709
  onReorderTemplates: f
709
710
  }
710
711
  ) : null,
711
- [x, e, l, u, f]
712
- ), d = /* @__PURE__ */ r(
712
+ [s, e, l, h, f]
713
+ ), C = /* @__PURE__ */ r(
713
714
  Le,
714
715
  {
715
- applied: c,
716
+ applied: D,
716
717
  onUndo: () => {
717
- c == null || c.undo(), E(null);
718
+ D == null || D.undo(), w(null);
718
719
  },
719
- onDismiss: () => E(null)
720
+ onDismiss: () => w(null)
720
721
  }
721
- ), C = Y(
722
- () => ({ renderHelpMeWrite: I, aiTemplates: z, onAiApplied: i }),
723
- [I, z, i]
722
+ ), I = Y(
723
+ () => ({
724
+ renderHelpMeWrite: z,
725
+ aiTemplates: i,
726
+ onAiApplied: g,
727
+ aiCreditsNotice: k
728
+ }),
729
+ [z, i, g, k]
724
730
  );
725
731
  return {
726
- ...C,
727
- editorProps: C,
728
- manager: v,
729
- undoNotice: d,
730
- openManager: w
732
+ ...I,
733
+ editorProps: I,
734
+ manager: c,
735
+ undoNotice: C,
736
+ openManager: E
731
737
  };
732
738
  }
733
739
  export {
@@ -738,4 +744,4 @@ export {
738
744
  Le as c,
739
745
  mr as u
740
746
  };
741
- //# sourceMappingURL=help-me-write-templates-GUeEn3Ff.js.map
747
+ //# sourceMappingURL=help-me-write-templates-DHIwa4xR.js.map