@inkeep/cxkit-primitives 0.5.33 → 0.5.35

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.
@@ -1,37 +1,37 @@
1
1
  "use client";
2
2
  import { jsx as a } from "react/jsx-runtime";
3
- import { Command as R } from "../atoms/cmdk/index.js";
3
+ import { Command as p } from "../atoms/cmdk/index.js";
4
4
  import { ikp as r } from "./factory.js";
5
5
  import { dataAttr as m, maybeRender as g } from "../utils/misc.js";
6
- import { forwardRef as w, useEffect as E, useState as V, useRef as y, useMemo as F } from "react";
6
+ import { forwardRef as w, useEffect as L, useState as G, useRef as C, useCallback as M, useMemo as E } from "react";
7
7
  import { useSearch as l } from "./embedded-search/search-provider.js";
8
- import { SearchProvider as Yt } from "./embedded-search/search-provider.js";
9
- import K from "./tagline-logo-icon.js";
10
- import { CustomIcon as b } from "../atoms/icons/custom-icon.js";
8
+ import { SearchProvider as ti } from "./embedded-search/search-provider.js";
9
+ import W from "./tagline-logo-icon.js";
10
+ import { CustomIcon as S } from "../atoms/icons/custom-icon.js";
11
11
  import * as T from "@radix-ui/react-scroll-area";
12
- import * as L from "@radix-ui/react-tabs";
13
- import { useInkeepConfig as S } from "../providers/config-provider.js";
14
- import { useSearchEvents as $ } from "../providers/search-events-provider.js";
15
- import { LinkWithQueryParams as O } from "../atoms/link.js";
16
- import { SourceItemProvider as M, useSourceItem as h } from "../providers/source-item-provider.js";
17
- import { BuiltInIconRenderer as C } from "../atoms/icons/built-in-icon-renderer.js";
18
- import { highlightEmphasis as G } from "../utils/highlight-emphasis.js";
19
- import { useScrollingFades as W } from "../hooks/use-scrolling-fades.js";
20
- import { useColorModeValue as q } from "@inkeep/cxkit-color-mode";
21
- import j from "../atoms/avatars/ai.js";
22
- import { useModal as U } from "./modal/modal-provider.js";
23
- import { useComposedRefs as A } from "../utils/compose-refs.js";
24
- import { composeEventHandlers as p } from "../utils/compose-event-handlers.js";
25
- import { useShadow as Q } from "../atoms/shadow/context.js";
26
- import { Markdown as z } from "../atoms/markdown/index.js";
27
- const P = "__ask_ai__", J = r("div", {
12
+ import * as A from "@radix-ui/react-tabs";
13
+ import { useInkeepConfig as b } from "../providers/config-provider.js";
14
+ import { useSearchEvents as q } from "../providers/search-events-provider.js";
15
+ import { LinkWithQueryParams as x } from "../atoms/link.js";
16
+ import { SourceItemProvider as U, useSourceItem as h } from "../providers/source-item-provider.js";
17
+ import { BuiltInIconRenderer as B } from "../atoms/icons/built-in-icon-renderer.js";
18
+ import { highlightEmphasis as j } from "../utils/highlight-emphasis.js";
19
+ import { useScrollingFades as Q } from "../hooks/use-scrolling-fades.js";
20
+ import { useColorModeValue as z } from "@inkeep/cxkit-color-mode";
21
+ import J from "../atoms/avatars/ai.js";
22
+ import { useModal as D } from "./modal/modal-provider.js";
23
+ import { useComposedRefs as k } from "../utils/compose-refs.js";
24
+ import { composeEventHandlers as R } from "../utils/compose-event-handlers.js";
25
+ import { useShadow as X } from "../atoms/shadow/context.js";
26
+ import { Markdown as Y } from "../atoms/markdown/index.js";
27
+ const P = "__ask_ai__", Z = r("div", {
28
28
  _id: "aiSearchWrapper"
29
- }), et = (e) => {
29
+ }), rt = (e) => {
30
30
  const {
31
31
  searchSettings: { view: t }
32
- } = S(), { isHidden: i, hasContent: s, isMobile: n } = l(), o = U();
32
+ } = b(), { isHidden: i, hasContent: s, isMobile: n } = l(), o = D();
33
33
  return /* @__PURE__ */ a(
34
- J,
34
+ Z,
35
35
  {
36
36
  "data-hidden": m(i),
37
37
  "data-has-content": m(s),
@@ -42,14 +42,15 @@ const P = "__ask_ai__", J = r("div", {
42
42
  ...e
43
43
  }
44
44
  );
45
- }, X = r(R, {
45
+ }, ee = r(p, {
46
46
  _id: "aiSearchRoot"
47
- }), tt = (e) => {
48
- const { isHidden: t, selectedItem: i, onSelectedItemChange: s } = l();
47
+ }), st = (e) => {
48
+ const { isHidden: t, selectedItem: i, onSelectedItemChange: s, isMobile: n } = l();
49
49
  return /* @__PURE__ */ a(
50
- X,
50
+ ee,
51
51
  {
52
52
  "data-hidden": m(t),
53
+ "data-mobile": m(n),
53
54
  shouldFilter: !1,
54
55
  loop: !1,
55
56
  value: i,
@@ -57,57 +58,57 @@ const P = "__ask_ai__", J = r("div", {
57
58
  ...e
58
59
  }
59
60
  );
60
- }, Y = r(R.List, {
61
+ }, te = r(p.List, {
61
62
  _id: "aiSearchContent"
62
- }), it = w((e, t) => {
63
+ }), nt = w((e, t) => {
63
64
  const { selectedItem: i } = l();
64
65
  return /* @__PURE__ */ a(
65
- Y,
66
+ te,
66
67
  {
67
68
  "aria-activedescendant": `aiSearchResults__Item-${i}`,
68
69
  ...e,
69
70
  ref: t
70
71
  }
71
72
  );
72
- }), rt = r("div", {
73
+ }), at = r("div", {
73
74
  _id: "aiSearchInputGroup"
74
- }), st = r(b, {
75
+ }), ot = r(S, {
75
76
  _id: "aiSearchInputIcon",
76
77
  iconKey: "search"
77
- }), Z = r(R.Input, {
78
+ }), ie = r(p.Input, {
78
79
  _id: "aiSearchInput"
79
- }), nt = w(({ onInput: e, ...t }, i) => {
80
- const { query: s, onInput: n, placeholder: o, inputRef: c, shouldAutoFocusInput: d, selectedItem: u } = l(), _ = A(i, c), I = U();
81
- return E(() => {
80
+ }), ct = w(({ onInput: e, ...t }, i) => {
81
+ const { query: s, onInput: n, placeholder: o, inputRef: c, shouldAutoFocusInput: d, selectedItem: u } = l(), I = k(i, c), _ = D();
82
+ return L(() => {
82
83
  requestAnimationFrame(() => {
83
84
  d && c?.current && (c.current.focus(), c.current.selectionStart = c.current.value.length);
84
85
  });
85
- }, [d, c, I?.isOpen]), /* @__PURE__ */ a(
86
- Z,
86
+ }, [d, c, _?.isOpen]), /* @__PURE__ */ a(
87
+ ie,
87
88
  {
88
- ref: _,
89
+ ref: I,
89
90
  placeholder: o,
90
91
  value: s,
91
- onInput: p(e, n),
92
+ onInput: R(e, n),
92
93
  "aria-activedescendant": `aiSearchResults__Item-${u}`,
93
94
  ...t
94
95
  }
95
96
  );
96
- }), ee = r(C, {
97
+ }), re = r(B, {
97
98
  _id: "aiSearchLoading",
98
99
  iconSettings: {
99
100
  builtIn: "LuLoaderCircle"
100
101
  }
101
- }), at = (e) => {
102
+ }), lt = (e) => {
102
103
  const { loading: t, resultsList: i } = l();
103
- return !t || i.length === 0 ? null : /* @__PURE__ */ a(ee, { ...e });
104
- }, te = r(R.Item, {
104
+ return !t || i.length === 0 ? null : /* @__PURE__ */ a(re, { ...e });
105
+ }, se = r(p.Item, {
105
106
  _id: "aiAskAITrigger",
106
107
  value: P
107
- }), ot = (e) => {
108
+ }), dt = (e) => {
108
109
  const { setSelectedItem: t, results: i, tab: s } = l(), n = i[s]?.[0]?.id ?? "NONE";
109
110
  return /* @__PURE__ */ a(
110
- te,
111
+ se,
111
112
  {
112
113
  ...e,
113
114
  id: `aiSearchResults__Item-${P}`,
@@ -115,13 +116,13 @@ const P = "__ask_ai__", J = r("div", {
115
116
  onPointerLeave: () => t(n)
116
117
  }
117
118
  );
118
- }, ie = r("img", {
119
+ }, ne = r("img", {
119
120
  _id: "aiAskAITrigger__Icon"
120
- }), ct = (e) => {
121
- const { aiChatSettings: t } = S(), { aiAssistantAvatar: i } = t ?? {}, s = typeof i == "string" ? i : i?.light, n = (typeof i == "string" ? i : i?.dark) ?? s, o = q(s, n), [c, d] = V(o);
122
- return E(() => {
121
+ }), ut = (e) => {
122
+ const { aiChatSettings: t } = b(), { aiAssistantAvatar: i } = t ?? {}, s = typeof i == "string" ? i : i?.light, n = (typeof i == "string" ? i : i?.dark) ?? s, o = z(s, n), [c, d] = G(o);
123
+ return L(() => {
123
124
  d(o);
124
- }, [o]), /* @__PURE__ */ a(ie, { asChild: !0, ...e, children: c ? (
125
+ }, [o]), /* @__PURE__ */ a(ne, { asChild: !0, ...e, children: c ? (
125
126
  // biome-ignore lint/a11y/useAltText: <explanation>
126
127
  /* @__PURE__ */ a(
127
128
  "img",
@@ -129,26 +130,26 @@ const P = "__ask_ai__", J = r("div", {
129
130
  src: c,
130
131
  alt: "AI Avatar",
131
132
  "data-type": "image",
132
- onError: p(() => {
133
+ onError: R(() => {
133
134
  d(null);
134
135
  }),
135
136
  ...e
136
137
  }
137
138
  )
138
- ) : /* @__PURE__ */ a(j, { "data-type": "icon", ...e }) });
139
- }, lt = r("span", {
139
+ ) : /* @__PURE__ */ a(J, { "data-type": "icon", ...e }) });
140
+ }, mt = r("span", {
140
141
  _id: "aiAskAITrigger__Label"
141
- }), dt = r(b, {
142
+ }), ht = r(S, {
142
143
  _id: "aiAskAITrigger__Indicator",
143
144
  iconKey: "openLinkInSameTab"
144
- }), re = r(L.Root, {
145
+ }), ae = r(A.Root, {
145
146
  _id: "aiSearchResults"
146
- }), ut = (e) => {
147
+ }), It = (e) => {
147
148
  const {
148
149
  searchSettings: { view: t }
149
- } = S(), { tab: i, onTabChange: s, hasContent: n, isHidden: o } = l();
150
+ } = b(), { tab: i, onTabChange: s, hasContent: n, isHidden: o } = l();
150
151
  return /* @__PURE__ */ a(
151
- re,
152
+ ae,
152
153
  {
153
154
  value: i,
154
155
  onValueChange: s,
@@ -157,60 +158,60 @@ const P = "__ask_ai__", J = r("div", {
157
158
  ...e
158
159
  }
159
160
  );
160
- }, se = r("div", {
161
+ }, oe = r("div", {
161
162
  _id: "aiSearchResults__Loading"
162
- }), mt = (e) => {
163
+ }), _t = (e) => {
163
164
  const { loading: t, resultsList: i } = l();
164
- return !t || i.length > 0 ? null : /* @__PURE__ */ a(se, { ...e });
165
- }, ne = r(R.Empty, {
165
+ return !t || i.length > 0 ? null : /* @__PURE__ */ a(oe, { ...e });
166
+ }, ce = r(p.Empty, {
166
167
  _id: "aiSearchResults__Empty"
167
- }), ht = (e) => {
168
+ }), vt = (e) => {
168
169
  const { query: t, loading: i, results: s, tab: n } = l(), o = s[n]?.length;
169
- return i || !t || o ? null : /* @__PURE__ */ a(ne, { children: "No results found.", ...e });
170
- }, ae = r(L.List, {
170
+ return i || !t || o ? null : /* @__PURE__ */ a(ce, { children: "No results found.", ...e });
171
+ }, le = r(A.List, {
171
172
  _id: "aiSearchResults__TabList"
172
- }), It = (e) => {
173
+ }), bt = (e) => {
173
174
  const { children: t, ...i } = e, {
174
175
  searchSettings: { tabs: s }
175
- } = S(), { results: n, loading: o, resultsList: c } = l();
176
+ } = b(), { results: n, loading: o, resultsList: c } = l();
176
177
  if (o && c.length === 0) return null;
177
178
  const d = Object.keys(n);
178
- return !s.length || !d.length ? null : /* @__PURE__ */ a(ae, { tabIndex: -1, children: g(t, d), ...i });
179
- }, oe = r(L.Trigger, {
179
+ return !s.length || !d.length ? null : /* @__PURE__ */ a(le, { tabIndex: -1, children: g(t, d), ...i });
180
+ }, de = r(A.Trigger, {
180
181
  _id: "aiSearchResults__Tab"
181
- }), _t = w((e, t) => {
182
- const i = y(null), s = A(t, i), { tab: n, onClick: o, ...c } = e, { results: d, tab: u, inputRef: _ } = l(), I = d[n].length, v = n === u, f = () => {
183
- _.current?.focus();
184
- }, k = Q();
185
- return E(() => {
186
- v && k?.shadowHost?.shadowRoot?.activeElement?.hasAttribute("ikp-tab") && i.current?.focus();
182
+ }), pt = w((e, t) => {
183
+ const i = C(null), s = k(t, i), { tab: n, onClick: o, ...c } = e, { results: d, tab: u, inputRef: I } = l(), _ = d[n].length, v = n === u, f = () => {
184
+ I.current?.focus();
185
+ }, y = X();
186
+ return L(() => {
187
+ v && y?.shadowHost?.shadowRoot?.activeElement?.hasAttribute("ikp-tab") && i.current?.focus();
187
188
  }, [v]), /* @__PURE__ */ a(
188
- oe,
189
+ de,
189
190
  {
190
191
  ref: s,
191
192
  "ikp-tab": "",
192
193
  tabIndex: v ? 0 : -1,
193
194
  value: n,
194
- children: `${n} (${I})`,
195
- onClick: p(o, f),
195
+ children: `${n} (${_})`,
196
+ onClick: R(o, f),
196
197
  ...c
197
198
  }
198
199
  );
199
- }), vt = r("div", {
200
+ }), St = r("div", {
200
201
  _id: "aiSearchResults__Content"
201
- }), ce = r(T.Root, {
202
+ }), ue = r(T.Root, {
202
203
  _id: "aiSearchResults__ScrollArea"
203
- }), St = (e) => {
204
+ }), Rt = (e) => {
204
205
  const { loading: t, resultsList: i } = l();
205
- return t && i.length === 0 ? null : /* @__PURE__ */ a(ce, { tabIndex: -1, ...e });
206
- }, le = r(T.Viewport, {
206
+ return t && i.length === 0 ? null : /* @__PURE__ */ a(ue, { tabIndex: -1, ...e });
207
+ }, me = r(T.Viewport, {
207
208
  _id: "aiSearchResults__ScrollAreaViewport"
208
- }), Rt = w(({ children: e, ...t }, i) => {
209
- const s = W(), n = A(i, s), { tab: o } = l();
210
- return E(() => {
209
+ }), Pt = w(({ children: e, ...t }, i) => {
210
+ const s = Q(), n = k(i, s), { tab: o } = l();
211
+ return L(() => {
211
212
  o && s.current?.scrollTo({ top: 0, behavior: "auto" });
212
213
  }, [o]), /* @__PURE__ */ a(
213
- le,
214
+ me,
214
215
  {
215
216
  ref: n,
216
217
  tabIndex: -1,
@@ -221,21 +222,21 @@ const P = "__ask_ai__", J = r("div", {
221
222
  ...t
222
223
  }
223
224
  );
224
- }), bt = r(
225
+ }), gt = r(
225
226
  T.ScrollAreaScrollbar,
226
227
  {
227
228
  _id: "aiSearchResults__ScrollAreaScrollbar"
228
229
  }
229
- ), pt = r(T.ScrollAreaThumb, {
230
+ ), wt = r(T.ScrollAreaThumb, {
230
231
  _id: "aiSearchResults__ScrollAreaThumb"
231
- }), Pt = r(T.Corner, {
232
+ }), Tt = r(T.Corner, {
232
233
  _id: "aiSearchResults__ScrollAreaCorner"
233
- }), de = r(L.Content, {
234
+ }), he = r(A.Content, {
234
235
  _id: "aiSearchResults__List"
235
- }), gt = (e) => {
236
+ }), ft = (e) => {
236
237
  const { children: t, ...i } = e, { results: s, tab: n } = l(), o = s[n] ?? [];
237
238
  return /* @__PURE__ */ a(
238
- de,
239
+ he,
239
240
  {
240
241
  value: n,
241
242
  "data-has-results": m(o.length > 0),
@@ -245,88 +246,91 @@ const P = "__ask_ai__", J = r("div", {
245
246
  ...i
246
247
  }
247
248
  );
248
- }, ue = r(R.Item, {
249
+ }, Ie = r(p.Item, {
249
250
  _id: "aiSearchResults__Item",
250
251
  asChild: !0
251
- }), wt = w(({ item: e, onClick: t, onSelect: i, children: s, ...n }, o) => {
252
+ }), Et = w(({ item: e, onClick: t, onSelect: i, children: s, ...n }, o) => {
252
253
  const {
253
254
  searchSettings: { shouldOpenLinksInNewTab: c, view: d }
254
- } = S(), { logEvent: u } = $(), { query: _, transitionsDisabled: I, selectedItem: v } = l(), f = y(null), k = A(o, f), x = () => {
255
- f.current?.click();
256
- }, B = () => {
255
+ } = b(), { logEvent: u } = q(), { query: I, transitionsDisabled: _, selectedItem: v } = l(), f = C(null), y = k(o, f), N = M(($) => {
256
+ $.trigger === "keyboard" && f.current?.click();
257
+ }, []), H = M(() => {
257
258
  u({
258
259
  eventName: "search_result_clicked",
259
260
  properties: {
260
- searchQuery: _,
261
+ searchQuery: I,
261
262
  title: e.title,
262
263
  url: e.url
263
264
  }
264
265
  });
265
- }, N = e.shouldOpenInNewTab !== void 0 ? e.shouldOpenInNewTab : c, H = v === e.id, D = H || (v === "NONE" || v === P);
266
- return /* @__PURE__ */ a(M, { source: { ...e, isExternal: N }, children: /* @__PURE__ */ a(
267
- ue,
266
+ }, [u, I, e.title, e.url]), O = E(
267
+ () => e.shouldOpenInNewTab !== void 0 ? e.shouldOpenInNewTab : c,
268
+ [e.shouldOpenInNewTab, c]
269
+ ), F = v === e.id, V = F || (v === "NONE" || v === P), K = E(
270
+ () => ({
271
+ href: e.url,
272
+ isExternal: O,
273
+ appendToUrl: e.appendToUrl,
274
+ children: s,
275
+ id: `aiSearchResults__Item-${e.id}`
276
+ }),
277
+ [e.url, O, e.appendToUrl, s, e.id]
278
+ );
279
+ return /* @__PURE__ */ a(U, { source: { ...e, isExternal: O }, children: /* @__PURE__ */ a(
280
+ Ie,
268
281
  {
269
- ref: k,
282
+ ref: y,
270
283
  value: e.id,
271
284
  "data-type": e.type,
272
285
  "data-breadcrumbs": !!e.breadcrumbs?.length,
273
- "data-disable-transitions": m(I),
286
+ "data-disable-transitions": m(_),
274
287
  "data-view": d,
275
- onSelect: p(i, x),
276
- onClick: p(t, B),
277
- "data-selected": m(H),
278
- tabIndex: D ? 0 : -1,
288
+ onSelect: R(i, N),
289
+ onClick: R(t, H),
290
+ "data-selected": m(F),
291
+ tabIndex: V ? 0 : -1,
279
292
  ...n,
280
- children: /* @__PURE__ */ a(
281
- O,
282
- {
283
- href: e.url,
284
- isExternal: N,
285
- appendToUrl: e.appendToUrl,
286
- children: s,
287
- id: `aiSearchResults__Item-${e.id}`
288
- }
289
- )
293
+ children: /* @__PURE__ */ a(x, { ...K })
290
294
  }
291
295
  ) });
292
- }), me = r("div", {
296
+ }), _e = r("div", {
293
297
  _id: "aiSearchResults__ItemBreadcrumbs"
294
- }), he = (e) => {
298
+ }), ve = (e) => {
295
299
  const { source: t } = h(), { tab: i } = l();
296
300
  if (!t.breadcrumbs?.length) return null;
297
301
  const { children: s, ...n } = e, c = t.tabs?.find((d) => typeof d != "string" && d[0] === i)?.[1]?.breadcrumbs ?? t.breadcrumbs ?? [];
298
302
  return /* @__PURE__ */ a(
299
- me,
303
+ _e,
300
304
  {
301
305
  "aria-hidden": "true",
302
306
  children: g(s, c),
303
307
  ...n
304
308
  }
305
309
  );
306
- }, Ie = r(b, {
310
+ }, be = r(S, {
307
311
  _id: "aiSearchResults__ItemBreadcrumbIcon",
308
312
  iconKey: "breadcrumbSeparator"
309
- }), _e = r(C, {
313
+ }), pe = r(B, {
310
314
  _id: "aiSearchResults__ItemIcon"
311
- }), Tt = (e) => {
315
+ }), Lt = (e) => {
312
316
  const { source: t } = h();
313
- return /* @__PURE__ */ a(_e, { iconSettings: t.icon, "data-type": t.type, ...e });
314
- }, ve = r("span", {
317
+ return /* @__PURE__ */ a(pe, { iconSettings: t.icon, "data-type": t.type, ...e });
318
+ }, Se = r("span", {
315
319
  _id: "aiSearchResults__ItemTitle"
316
- }), ft = (e) => {
320
+ }), At = (e) => {
317
321
  const { source: t } = h();
318
- return /* @__PURE__ */ a(ve, { "data-type": t.type, children: t.title, ...e });
319
- }, Se = r("span", {
322
+ return /* @__PURE__ */ a(Se, { "data-type": t.type, children: t.title, ...e });
323
+ }, Re = r("span", {
320
324
  _id: "aiSearchResults__ItemTag"
321
- }), Et = (e) => {
325
+ }), kt = (e) => {
322
326
  const { source: t } = h();
323
- return /* @__PURE__ */ a(Se, { "data-type": t.type, children: t.tag, ...e });
324
- }, Re = r("span", {
327
+ return /* @__PURE__ */ a(Re, { "data-type": t.type, children: t.tag, ...e });
328
+ }, Pe = r("span", {
325
329
  _id: "aiSearchResults__ItemDescription"
326
- }), Lt = (e) => {
327
- const { source: t } = h(), { children: i, ...s } = e, n = F(() => t.description ? G(t.description) : [], [t.description]);
330
+ }), yt = (e) => {
331
+ const { source: t } = h(), { children: i, ...s } = e, n = E(() => t.description ? j(t.description) : [], [t.description]);
328
332
  return n.length ? /* @__PURE__ */ a(
329
- Re,
333
+ Pe,
330
334
  {
331
335
  "data-type": t.type,
332
336
  "aria-hidden": "true",
@@ -334,12 +338,12 @@ const P = "__ask_ai__", J = r("div", {
334
338
  ...s
335
339
  }
336
340
  ) : null;
337
- }, be = r("span", {
341
+ }, ge = r("span", {
338
342
  _id: "aiSearchResults__ItemDescriptionPart"
339
- }), At = (e) => {
343
+ }), Ot = (e) => {
340
344
  const { part: t, ...i } = e, { source: s } = h();
341
345
  return typeof t == "string" ? t : /* @__PURE__ */ a(
342
- be,
346
+ ge,
343
347
  {
344
348
  "data-type": s.type,
345
349
  children: t.content,
@@ -347,42 +351,42 @@ const P = "__ask_ai__", J = r("div", {
347
351
  ...i
348
352
  }
349
353
  );
350
- }, pe = r(b, {
354
+ }, we = r(S, {
351
355
  _id: "aiSearchResults__ItemIndicator"
352
- }), kt = (e) => {
356
+ }), Ct = (e) => {
353
357
  const { source: t } = h(), {
354
358
  searchSettings: { view: i }
355
- } = S();
359
+ } = b();
356
360
  return /* @__PURE__ */ a(
357
- pe,
361
+ we,
358
362
  {
359
363
  iconKey: t.isExternal ? "openLinkInNewTab" : "openLinkInSameTab",
360
364
  "data-view": i,
361
365
  ...e
362
366
  }
363
367
  );
364
- }, Pe = r("div", {
368
+ }, Te = r("div", {
365
369
  _id: "aiSearchResults__ItemPreview",
366
370
  "aria-hidden": !0
367
- }), yt = (e) => {
371
+ }), xt = (e) => {
368
372
  const {
369
373
  searchSettings: { view: t, shouldOpenLinksInNewTab: i }
370
- } = S(), { results: s, tab: n, selectedItem: o } = l(), c = s[n] ?? [], d = y(null), u = F(() => {
374
+ } = b(), { results: s, tab: n, selectedItem: o } = l(), c = s[n] ?? [], d = C(null), u = E(() => {
371
375
  if (o === P) return d.current;
372
- const I = c.find((v) => v.id === o);
373
- return d.current = I ?? null, I;
376
+ const _ = c.find((v) => v.id === o);
377
+ return d.current = _ ?? null, _;
374
378
  }, [o]);
375
379
  if (t !== "dual-pane" || o === P || !u) return null;
376
- const _ = u.shouldOpenInNewTab !== void 0 ? u.shouldOpenInNewTab : i;
377
- return /* @__PURE__ */ a(M, { source: { ...u, isExternal: _ }, children: /* @__PURE__ */ a(Pe, { ...e }) });
378
- }, Ot = r("div", {
380
+ const I = u.shouldOpenInNewTab !== void 0 ? u.shouldOpenInNewTab : i;
381
+ return /* @__PURE__ */ a(U, { source: { ...u, isExternal: I }, children: /* @__PURE__ */ a(Te, { ...e }) });
382
+ }, Bt = r("div", {
379
383
  _id: "aiSearchResults__ItemPreview__Header"
380
- }), ge = r(O, {
384
+ }), fe = r(x, {
381
385
  _id: "aiSearchResults__ItemPreview__Heading"
382
- }), Ct = (e) => {
386
+ }), Nt = (e) => {
383
387
  const { source: t } = h();
384
388
  return /* @__PURE__ */ a(
385
- ge,
389
+ fe,
386
390
  {
387
391
  href: t.url,
388
392
  isExternal: t.isExternal,
@@ -391,101 +395,101 @@ const P = "__ask_ai__", J = r("div", {
391
395
  ...e
392
396
  }
393
397
  );
394
- }, we = r("span", {
398
+ }, Ee = r("span", {
395
399
  _id: "aiSearchResults__ItemPreview__Title"
396
- }), xt = (e) => {
400
+ }), Ht = (e) => {
397
401
  const { source: t } = h();
398
- return /* @__PURE__ */ a(we, { children: t.title, ...e });
399
- }, Te = r(b, {
402
+ return /* @__PURE__ */ a(Ee, { children: t.title, ...e });
403
+ }, Le = r(S, {
400
404
  _id: "aiSearchResults__ItemPreview__Title__LinkIcon",
401
405
  iconKey: "openLinkInNewTab"
402
- }), Bt = (e) => {
406
+ }), Ft = (e) => {
403
407
  const { source: t } = h();
404
408
  return /* @__PURE__ */ a(
405
- Te,
409
+ Le,
406
410
  {
407
411
  iconKey: t.isExternal ? "openLinkInNewTab" : "openLinkInSameTab",
408
412
  ...e
409
413
  }
410
414
  );
411
- }, Nt = r(
412
- he,
415
+ }, Mt = r(
416
+ ve,
413
417
  {
414
418
  _id: "aiSearchResults__ItemPreview__Breadcrumbs"
415
419
  }
416
- ), Ht = r(
417
- Ie,
420
+ ), Ut = r(
421
+ be,
418
422
  {
419
423
  _id: "aiSearchResults__ItemPreview__BreadcrumbIcon"
420
424
  }
421
- ), fe = r(z, {
425
+ ), Ae = r(Y, {
422
426
  _id: "aiSearchResults__ItemPreview__Body"
423
- }), Ft = (e) => {
427
+ }), Dt = (e) => {
424
428
  const { source: t } = h(), { resultsList: i } = l(), s = i.find((o) => o.id === t.id), {
425
429
  searchSettings: { shouldOpenLinksInNewTab: n }
426
- } = S();
430
+ } = b();
427
431
  return s ? /* @__PURE__ */ a(
428
- fe,
432
+ Ae,
429
433
  {
430
434
  shouldOpenLinksInNewTab: n,
431
435
  children: s.preview,
432
436
  ...e
433
437
  }
434
438
  ) : null;
435
- }, Ee = r("div", {
439
+ }, ke = r("div", {
436
440
  _id: "aiSearchResults__ItemPreview__Outline"
437
- }), Mt = (e) => {
441
+ }), Vt = (e) => {
438
442
  const { source: t } = h(), { resultsList: i } = l();
439
- return i.find((o) => o.id === t.id)?.rootRecord.topLevelHeadings?.length ? /* @__PURE__ */ a(Ee, { ...e }) : null;
440
- }, Ut = r("span", {
443
+ return i.find((o) => o.id === t.id)?.rootRecord.topLevelHeadings?.length ? /* @__PURE__ */ a(ke, { ...e }) : null;
444
+ }, Kt = r("span", {
441
445
  _id: "aiSearchResults__ItemPreview__Outline__Title",
442
446
  children: "On this page"
443
- }), Le = r("ul", {
447
+ }), ye = r("ul", {
444
448
  _id: "aiSearchResults__ItemPreview__Outline__List"
445
- }), Dt = (e) => {
449
+ }), $t = (e) => {
446
450
  const { source: t } = h(), { resultsList: i } = l(), s = i.find((u) => u.id === t.id), n = s?.rootRecord.topLevelHeadings;
447
451
  if (!n?.length) return null;
448
452
  const o = n.map((u) => {
449
- const _ = u?.anchor && u?.anchor === s?.content?.anchor, I = u?.anchor === s?.pathHeadings?.[0]?.anchor;
453
+ const I = u?.anchor && u?.anchor === s?.content?.anchor, _ = u?.anchor === s?.pathHeadings?.[0]?.anchor;
450
454
  return {
451
455
  ...u,
452
- isMatch: _ || I
456
+ isMatch: I || _
453
457
  };
454
458
  }), { children: c, ...d } = e;
455
- return /* @__PURE__ */ a(Le, { children: g(c, o), ...d });
456
- }, Ae = r(O, {
459
+ return /* @__PURE__ */ a(ye, { children: g(c, o), ...d });
460
+ }, Oe = r(x, {
457
461
  _id: "aiSearchResults__ItemPreview__Outline__Item"
458
- }), Vt = (e) => {
462
+ }), Gt = (e) => {
459
463
  const {
460
464
  searchSettings: { shouldOpenLinksInNewTab: t }
461
- } = S();
462
- return /* @__PURE__ */ a(Ae, { isExternal: t, ...e });
463
- }, Kt = r(b, {
465
+ } = b();
466
+ return /* @__PURE__ */ a(Oe, { isExternal: t, ...e });
467
+ }, Wt = r(S, {
464
468
  _id: "aiSearchResults__ItemPreview__Outline__ItemIcon",
465
469
  iconKey: "newLine"
466
- }), ke = r("span", {
470
+ }), Ce = r("span", {
467
471
  _id: "aiSearchResults__ItemPreview__Outline__ItemText"
468
- }), $t = (e) => /* @__PURE__ */ a(ke, { ...e }), Gt = r(
469
- C,
472
+ }), qt = (e) => /* @__PURE__ */ a(Ce, { ...e }), jt = r(
473
+ B,
470
474
  {
471
475
  _id: "aiSearchResults__ItemPreview__Outline__ItemLinkIcon",
472
476
  iconSettings: {
473
477
  builtIn: "LuLink"
474
478
  }
475
479
  }
476
- ), ye = r("div", {
480
+ ), xe = r("div", {
477
481
  _id: "aiSearchFooter"
478
- }), Wt = (e) => {
482
+ }), Qt = (e) => {
479
483
  const { hasContent: t } = l();
480
- return /* @__PURE__ */ a(ye, { "data-has-results": m(t), ...e });
481
- }, qt = r("div", {
484
+ return /* @__PURE__ */ a(xe, { "data-has-results": m(t), ...e });
485
+ }, zt = r("div", {
482
486
  _id: "aiSearchTagline__Container"
483
- }), jt = r("span", {
487
+ }), Jt = r("span", {
484
488
  _id: "aiSearchTagline__Text",
485
489
  children: "Powered by"
486
- }), Qt = r(K, {
490
+ }), Xt = r(W, {
487
491
  _id: "aiSearchTagline__Logo"
488
- }), zt = r("a", {
492
+ }), Yt = r("a", {
489
493
  _id: "aiSearchTagline__BrandName",
490
494
  children: "inkeep",
491
495
  href: "https://www.inkeep.com/",
@@ -494,100 +498,100 @@ const P = "__ask_ai__", J = r("div", {
494
498
  });
495
499
  export {
496
500
  P as ASK_AI_TRIGGER_VALUE,
497
- ot as AskAITrigger,
498
- ct as AskAITriggerIcon,
499
- dt as AskAITriggerIndicator,
500
- lt as AskAITriggerLabel,
501
- it as Content,
502
- st as EmbeddedSearchInputIcon,
503
- ot as EmbeddedSearchPrimitiveAskAITrigger,
504
- ct as EmbeddedSearchPrimitiveAskAITriggerIcon,
505
- dt as EmbeddedSearchPrimitiveAskAITriggerIndicator,
506
- lt as EmbeddedSearchPrimitiveAskAITriggerLabel,
507
- it as EmbeddedSearchPrimitiveContent,
508
- Wt as EmbeddedSearchPrimitiveFooter,
509
- nt as EmbeddedSearchPrimitiveInput,
510
- rt as EmbeddedSearchPrimitiveInputGroup,
511
- at as EmbeddedSearchPrimitiveLoading,
512
- ut as EmbeddedSearchPrimitiveResults,
513
- vt as EmbeddedSearchPrimitiveResultsContent,
514
- ht as EmbeddedSearchPrimitiveResultsEmpty,
515
- wt as EmbeddedSearchPrimitiveResultsItem,
516
- he as EmbeddedSearchPrimitiveResultsItemBreadcrumbs,
517
- Lt as EmbeddedSearchPrimitiveResultsItemDescription,
518
- At as EmbeddedSearchPrimitiveResultsItemDescriptionPart,
519
- Tt as EmbeddedSearchPrimitiveResultsItemIcon,
520
- kt as EmbeddedSearchPrimitiveResultsItemIndicator,
521
- yt as EmbeddedSearchPrimitiveResultsItemPreview,
522
- Ft as EmbeddedSearchPrimitiveResultsItemPreviewBody,
523
- Ht as EmbeddedSearchPrimitiveResultsItemPreviewBreadcrumbIcon,
524
- Ct as EmbeddedSearchPrimitiveResultsItemPreviewHeading,
525
- Mt as EmbeddedSearchPrimitiveResultsItemPreviewOutline,
526
- Vt as EmbeddedSearchPrimitiveResultsItemPreviewOutlineItem,
527
- Kt as EmbeddedSearchPrimitiveResultsItemPreviewOutlineItemIcon,
528
- Gt as EmbeddedSearchPrimitiveResultsItemPreviewOutlineItemLinkIcon,
529
- $t as EmbeddedSearchPrimitiveResultsItemPreviewOutlineItemText,
530
- Dt as EmbeddedSearchPrimitiveResultsItemPreviewOutlineList,
531
- Ut as EmbeddedSearchPrimitiveResultsItemPreviewOutlineTitle,
532
- xt as EmbeddedSearchPrimitiveResultsItemPreviewTitle,
533
- Bt as EmbeddedSearchPrimitiveResultsItemPreviewTitleLinkIcon,
534
- Et as EmbeddedSearchPrimitiveResultsItemTag,
535
- ft as EmbeddedSearchPrimitiveResultsItemTitle,
536
- gt as EmbeddedSearchPrimitiveResultsList,
537
- mt as EmbeddedSearchPrimitiveResultsLoading,
538
- St as EmbeddedSearchPrimitiveResultsScrollArea,
539
- Rt as EmbeddedSearchPrimitiveResultsScrollAreaViewport,
540
- _t as EmbeddedSearchPrimitiveResultsTab,
541
- It as EmbeddedSearchPrimitiveResultsTabList,
542
- tt as EmbeddedSearchPrimitiveRoot,
543
- et as EmbeddedSearchPrimitiveWrapper,
544
- Wt as Footer,
545
- nt as Input,
546
- rt as InputGroup,
547
- st as InputIcon,
548
- at as Loading,
549
- Y as PrimitiveContent,
550
- Yt as Provider,
551
- ut as Results,
552
- vt as ResultsContent,
553
- ht as ResultsEmpty,
554
- wt as ResultsItem,
555
- Ie as ResultsItemBreadcrumbIcon,
556
- he as ResultsItemBreadcrumbs,
557
- Lt as ResultsItemDescription,
558
- At as ResultsItemDescriptionPart,
559
- Tt as ResultsItemIcon,
560
- kt as ResultsItemIndicator,
561
- yt as ResultsItemPreview,
562
- Ft as ResultsItemPreviewBody,
563
- Ht as ResultsItemPreviewBreadcrumbIcon,
564
- Nt as ResultsItemPreviewBreadcrumbs,
565
- Ot as ResultsItemPreviewHeader,
566
- Ct as ResultsItemPreviewHeading,
567
- Mt as ResultsItemPreviewOutline,
568
- Vt as ResultsItemPreviewOutlineItem,
569
- Kt as ResultsItemPreviewOutlineItemIcon,
570
- Gt as ResultsItemPreviewOutlineItemLinkIcon,
571
- $t as ResultsItemPreviewOutlineItemText,
572
- Dt as ResultsItemPreviewOutlineList,
573
- Ut as ResultsItemPreviewOutlineTitle,
574
- xt as ResultsItemPreviewTitle,
575
- Bt as ResultsItemPreviewTitleLinkIcon,
576
- Et as ResultsItemTag,
577
- ft as ResultsItemTitle,
578
- gt as ResultsList,
579
- mt as ResultsLoading,
580
- St as ResultsScrollArea,
581
- Pt as ResultsScrollAreaCorner,
582
- bt as ResultsScrollAreaScrollbar,
583
- pt as ResultsScrollAreaThumb,
584
- Rt as ResultsScrollAreaViewport,
585
- _t as ResultsTab,
586
- It as ResultsTabList,
587
- tt as Root,
588
- zt as TaglineBrandName,
589
- qt as TaglineContainer,
590
- Qt as TaglineLogo,
591
- jt as TaglineText,
592
- et as Wrapper
501
+ dt as AskAITrigger,
502
+ ut as AskAITriggerIcon,
503
+ ht as AskAITriggerIndicator,
504
+ mt as AskAITriggerLabel,
505
+ nt as Content,
506
+ ot as EmbeddedSearchInputIcon,
507
+ dt as EmbeddedSearchPrimitiveAskAITrigger,
508
+ ut as EmbeddedSearchPrimitiveAskAITriggerIcon,
509
+ ht as EmbeddedSearchPrimitiveAskAITriggerIndicator,
510
+ mt as EmbeddedSearchPrimitiveAskAITriggerLabel,
511
+ nt as EmbeddedSearchPrimitiveContent,
512
+ Qt as EmbeddedSearchPrimitiveFooter,
513
+ ct as EmbeddedSearchPrimitiveInput,
514
+ at as EmbeddedSearchPrimitiveInputGroup,
515
+ lt as EmbeddedSearchPrimitiveLoading,
516
+ It as EmbeddedSearchPrimitiveResults,
517
+ St as EmbeddedSearchPrimitiveResultsContent,
518
+ vt as EmbeddedSearchPrimitiveResultsEmpty,
519
+ Et as EmbeddedSearchPrimitiveResultsItem,
520
+ ve as EmbeddedSearchPrimitiveResultsItemBreadcrumbs,
521
+ yt as EmbeddedSearchPrimitiveResultsItemDescription,
522
+ Ot as EmbeddedSearchPrimitiveResultsItemDescriptionPart,
523
+ Lt as EmbeddedSearchPrimitiveResultsItemIcon,
524
+ Ct as EmbeddedSearchPrimitiveResultsItemIndicator,
525
+ xt as EmbeddedSearchPrimitiveResultsItemPreview,
526
+ Dt as EmbeddedSearchPrimitiveResultsItemPreviewBody,
527
+ Ut as EmbeddedSearchPrimitiveResultsItemPreviewBreadcrumbIcon,
528
+ Nt as EmbeddedSearchPrimitiveResultsItemPreviewHeading,
529
+ Vt as EmbeddedSearchPrimitiveResultsItemPreviewOutline,
530
+ Gt as EmbeddedSearchPrimitiveResultsItemPreviewOutlineItem,
531
+ Wt as EmbeddedSearchPrimitiveResultsItemPreviewOutlineItemIcon,
532
+ jt as EmbeddedSearchPrimitiveResultsItemPreviewOutlineItemLinkIcon,
533
+ qt as EmbeddedSearchPrimitiveResultsItemPreviewOutlineItemText,
534
+ $t as EmbeddedSearchPrimitiveResultsItemPreviewOutlineList,
535
+ Kt as EmbeddedSearchPrimitiveResultsItemPreviewOutlineTitle,
536
+ Ht as EmbeddedSearchPrimitiveResultsItemPreviewTitle,
537
+ Ft as EmbeddedSearchPrimitiveResultsItemPreviewTitleLinkIcon,
538
+ kt as EmbeddedSearchPrimitiveResultsItemTag,
539
+ At as EmbeddedSearchPrimitiveResultsItemTitle,
540
+ ft as EmbeddedSearchPrimitiveResultsList,
541
+ _t as EmbeddedSearchPrimitiveResultsLoading,
542
+ Rt as EmbeddedSearchPrimitiveResultsScrollArea,
543
+ Pt as EmbeddedSearchPrimitiveResultsScrollAreaViewport,
544
+ pt as EmbeddedSearchPrimitiveResultsTab,
545
+ bt as EmbeddedSearchPrimitiveResultsTabList,
546
+ st as EmbeddedSearchPrimitiveRoot,
547
+ rt as EmbeddedSearchPrimitiveWrapper,
548
+ Qt as Footer,
549
+ ct as Input,
550
+ at as InputGroup,
551
+ ot as InputIcon,
552
+ lt as Loading,
553
+ te as PrimitiveContent,
554
+ ti as Provider,
555
+ It as Results,
556
+ St as ResultsContent,
557
+ vt as ResultsEmpty,
558
+ Et as ResultsItem,
559
+ be as ResultsItemBreadcrumbIcon,
560
+ ve as ResultsItemBreadcrumbs,
561
+ yt as ResultsItemDescription,
562
+ Ot as ResultsItemDescriptionPart,
563
+ Lt as ResultsItemIcon,
564
+ Ct as ResultsItemIndicator,
565
+ xt as ResultsItemPreview,
566
+ Dt as ResultsItemPreviewBody,
567
+ Ut as ResultsItemPreviewBreadcrumbIcon,
568
+ Mt as ResultsItemPreviewBreadcrumbs,
569
+ Bt as ResultsItemPreviewHeader,
570
+ Nt as ResultsItemPreviewHeading,
571
+ Vt as ResultsItemPreviewOutline,
572
+ Gt as ResultsItemPreviewOutlineItem,
573
+ Wt as ResultsItemPreviewOutlineItemIcon,
574
+ jt as ResultsItemPreviewOutlineItemLinkIcon,
575
+ qt as ResultsItemPreviewOutlineItemText,
576
+ $t as ResultsItemPreviewOutlineList,
577
+ Kt as ResultsItemPreviewOutlineTitle,
578
+ Ht as ResultsItemPreviewTitle,
579
+ Ft as ResultsItemPreviewTitleLinkIcon,
580
+ kt as ResultsItemTag,
581
+ At as ResultsItemTitle,
582
+ ft as ResultsList,
583
+ _t as ResultsLoading,
584
+ Rt as ResultsScrollArea,
585
+ Tt as ResultsScrollAreaCorner,
586
+ gt as ResultsScrollAreaScrollbar,
587
+ wt as ResultsScrollAreaThumb,
588
+ Pt as ResultsScrollAreaViewport,
589
+ pt as ResultsTab,
590
+ bt as ResultsTabList,
591
+ st as Root,
592
+ Yt as TaglineBrandName,
593
+ zt as TaglineContainer,
594
+ Xt as TaglineLogo,
595
+ Jt as TaglineText,
596
+ rt as Wrapper
593
597
  };