@inkeep/agents-ui 0.0.0-dev-20260508233535 → 0.0.0-dev-20260508234956

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.
@@ -12,84 +12,82 @@ import { widgetToggle as g } from "./components/ui/recipes/widget-toggle.js";
12
12
  import { DefaultToolComponent as M, EmbeddedChatMessagePart as y } from "./components/message.js";
13
13
  import { DataSummaryGroup as F } from "./components/data-summary-group.js";
14
14
  import { BaseEventsProvider as w, useBaseEvents as E } from "../primitives/providers/base-events-provider.js";
15
- import { ChatAuthProvider as R, useChatAuth as $ } from "../primitives/providers/chat-auth-provider.js";
16
- import { ChatFormProvider as T, useChatForm as O, useChatFormState as W } from "../primitives/providers/chat-form-provider.js";
17
- import { ChatHistoryProvider as L, useChatHistory as j } from "../primitives/providers/chat-history-provider.js";
18
- import { InkeepConfigProvider as K, WebWidgetInteractionType as N, useInkeepConfig as Q } from "../primitives/providers/config-provider.js";
19
- import { FeedbackProvider as q, useMessageFeedback as J } from "../primitives/providers/feedback-provider.js";
20
- import { FormFieldProvider as X, useFormField as Y } from "../primitives/providers/form-field-provider.js";
21
- import { HelpMenuProvider as _, useHelpMenu as ee, useHelpMenuState as oe } from "../primitives/providers/help-menu-provider.js";
22
- import { ChatMarkdownProvider as te, useChatMarkdown as ae } from "../primitives/providers/markdown-provider.js";
23
- import { MessageProvider as se, useMessage as ie, useOptionalMessage as pe } from "../primitives/providers/message-provider.js";
24
- import { RootProvider as ne } from "../primitives/providers/root-provider.js";
25
- import { SourceItemProvider as Ce, useSourceItem as fe } from "../primitives/providers/source-item-provider.js";
26
- import { ThemeProvider as he } from "../primitives/providers/theme-provider.js";
27
- import { WidgetProvider as be, useWidget as Se } from "../primitives/providers/widget-provider.js";
28
- import { SidebarChatProvider as Pe, useInkeepSidebarChat as ve, useOptionalSidebarChat as Ie, useSidebarChat as ge } from "../primitives/providers/sidebar-chat-provider.js";
29
- import { ChatBubbleProvider as Me, useChatBubble as ye, useInkeepChatBubble as ke, useOptionalChatBubble as Fe } from "../primitives/providers/chat-bubble-provider.js";
30
- import { ikp as we, jsxFactory as Ee } from "../primitives/components/factory.js";
15
+ import { ChatFormProvider as R, useChatForm as $, useChatFormState as T } from "../primitives/providers/chat-form-provider.js";
16
+ import { ChatHistoryProvider as W, useChatHistory as A } from "../primitives/providers/chat-history-provider.js";
17
+ import { InkeepConfigProvider as L, WebWidgetInteractionType as j, useInkeepConfig as G } from "../primitives/providers/config-provider.js";
18
+ import { FeedbackProvider as N, useMessageFeedback as Q } from "../primitives/providers/feedback-provider.js";
19
+ import { FormFieldProvider as q, useFormField as J } from "../primitives/providers/form-field-provider.js";
20
+ import { HelpMenuProvider as X, useHelpMenu as Y, useHelpMenuState as Z } from "../primitives/providers/help-menu-provider.js";
21
+ import { ChatMarkdownProvider as ee, useChatMarkdown as oe } from "../primitives/providers/markdown-provider.js";
22
+ import { MessageProvider as te, useMessage as ae, useOptionalMessage as me } from "../primitives/providers/message-provider.js";
23
+ import { RootProvider as ie } from "../primitives/providers/root-provider.js";
24
+ import { SourceItemProvider as de, useSourceItem as ne } from "../primitives/providers/source-item-provider.js";
25
+ import { ThemeProvider as fe } from "../primitives/providers/theme-provider.js";
26
+ import { WidgetProvider as xe, useWidget as he } from "../primitives/providers/widget-provider.js";
27
+ import { SidebarChatProvider as be, useInkeepSidebarChat as Se, useOptionalSidebarChat as ce, useSidebarChat as Pe } from "../primitives/providers/sidebar-chat-provider.js";
28
+ import { ChatBubbleProvider as Ie, useChatBubble as ge, useInkeepChatBubble as Be, useOptionalChatBubble as Me } from "../primitives/providers/chat-bubble-provider.js";
29
+ import { ikp as ke, jsxFactory as Fe } from "../primitives/components/factory.js";
31
30
  import * as p from "../primitives/components/embedded-chat.js";
32
31
  import * as d from "../primitives/components/sidebar-chat/index.js";
33
- import { ChatProvider as Re, useChat as $e } from "../primitives/components/embedded-chat/chat-provider.js";
32
+ import { ChatProvider as we, useChat as Ee } from "../primitives/components/embedded-chat/chat-provider.js";
34
33
  import * as n from "../primitives/components/embedded-search.js";
35
- import { SearchProvider as Te, SearchProviderImpl as Oe, useSearch as We } from "../primitives/components/embedded-search/search-provider.js";
34
+ import { SearchProvider as Re, SearchProviderImpl as $e, useSearch as Te } from "../primitives/components/embedded-search/search-provider.js";
36
35
  import * as u from "../primitives/components/modal.js";
37
- import { ModalProvider as Le, useModal as je } from "../primitives/components/modal/modal-provider.js";
38
- import * as C from "../primitives/components/chat-button.js";
39
- import * as f from "../primitives/components/searchbar.js";
36
+ import { ModalProvider as We, useModal as Ae } from "../primitives/components/modal/modal-provider.js";
37
+ import * as f from "../primitives/components/chat-button.js";
38
+ import * as C from "../primitives/components/searchbar.js";
40
39
  import * as x from "../primitives/components/chat-bubble/index.js";
41
40
  import * as h from "../primitives/components/data-summaries.js";
42
41
  import * as l from "../primitives/components/chat-history/index.js";
43
- import { useBoolean as Ke } from "../primitives/hooks/use-boolean.js";
44
- import { useComponentClassNames as Qe } from "../primitives/hooks/use-component-classnames.js";
45
- import { useContainerSize as qe } from "../primitives/hooks/use-container-size.js";
46
- import { useInkeepOpenState as Ve } from "../primitives/hooks/use-inkeep-open-state.js";
47
- import { useCopyToClipboard as Ye } from "../primitives/hooks/use-copy-to-clipboard.js";
48
- import { useInstantUpdate as _e } from "../primitives/hooks/use-instant-update.js";
49
- import { useIsMounted as oo } from "../primitives/hooks/use-is-mounted.js";
50
- import { useMediaQuery as to } from "../primitives/hooks/use-media-query.js";
51
- import { useResizeObserver as mo } from "../primitives/hooks/use-resize-observer.js";
52
- import { useScrollingFades as io, useScrollingFadesHorizontal as po } from "../primitives/hooks/use-scrolling-fades.js";
53
- import { useSettleAction as uo } from "../primitives/hooks/use-settle-action.js";
54
- import { useSimpleScroll as fo } from "../primitives/hooks/use-simple-scroll.js";
55
- import { callAll as ho, dataAttr as lo, getInitials as bo, getMessageContent as So, isCitationArtifact as co, isString as Po, maybeRender as vo, toKebabCase as Io } from "../primitives/utils/misc.js";
56
- import { ChatBubbleComponentIds as Bo, DataSummaryComponentIds as Mo, SearchBarComponentIds as yo, SidebarChatComponentIds as ko, aiChatComponentIds as Fo, aiChatHistoryComponentIds as Ho, aiSearchComponentIds as wo, chatButtonComponentIds as Eo, componentIDs as Do, markDownComponentIds as Ro, miscellanousComponentIds as $o, modalComponentIds as Ao } from "../primitives/utils/component-ids.js";
57
- import { composeRefs as Oo, useComposedRefs as Wo } from "../primitives/utils/compose-refs.js";
58
- import { mergeProps as Lo } from "../primitives/utils/merge-props.js";
59
- import { Portal as Go } from "../primitives/atoms/portal.js";
60
- import { CustomIcon as No } from "../primitives/atoms/icons/custom-icon.js";
61
- import { BuiltInIconRenderer as Uo } from "../primitives/atoms/icons/built-in-icon-renderer.js";
62
- import { PortalWithTheme as Jo } from "../primitives/atoms/portal-with-theme.js";
63
- import { Command as Xo, CommandDialog as Yo, CommandEmpty as Zo, CommandInput as _o, CommandItem as er, CommandList as or, CommandLoading as rr, CommandRoot as tr, CommandSeparator as ar, defaultFilter as mr, useCommandState as sr, useCommandStore as ir } from "../primitives/atoms/cmdk/index.js";
64
- import { ErrorBoundary as dr } from "../primitives/atoms/error-boundary.js";
65
- import { InkeepShadow as ur, InkeepShadowProvider as Cr, ShadowContext as fr, useShadow as xr } from "../primitives/atoms/shadow/context.js";
42
+ import { useBoolean as Le } from "../primitives/hooks/use-boolean.js";
43
+ import { useComponentClassNames as Ge } from "../primitives/hooks/use-component-classnames.js";
44
+ import { useContainerSize as Ne } from "../primitives/hooks/use-container-size.js";
45
+ import { useInkeepOpenState as Ue } from "../primitives/hooks/use-inkeep-open-state.js";
46
+ import { useCopyToClipboard as Je } from "../primitives/hooks/use-copy-to-clipboard.js";
47
+ import { useInstantUpdate as Xe } from "../primitives/hooks/use-instant-update.js";
48
+ import { useIsMounted as Ze } from "../primitives/hooks/use-is-mounted.js";
49
+ import { useMediaQuery as eo } from "../primitives/hooks/use-media-query.js";
50
+ import { useResizeObserver as ro } from "../primitives/hooks/use-resize-observer.js";
51
+ import { useScrollingFades as ao, useScrollingFadesHorizontal as mo } from "../primitives/hooks/use-scrolling-fades.js";
52
+ import { useSettleAction as io } from "../primitives/hooks/use-settle-action.js";
53
+ import { useSimpleScroll as no } from "../primitives/hooks/use-simple-scroll.js";
54
+ import { callAll as fo, dataAttr as Co, getInitials as xo, getMessageContent as ho, isCitationArtifact as lo, isString as bo, maybeRender as So, toKebabCase as co } from "../primitives/utils/misc.js";
55
+ import { ChatBubbleComponentIds as vo, DataSummaryComponentIds as Io, SearchBarComponentIds as go, SidebarChatComponentIds as Bo, aiChatComponentIds as Mo, aiChatHistoryComponentIds as yo, aiSearchComponentIds as ko, chatButtonComponentIds as Fo, componentIDs as Ho, markDownComponentIds as wo, miscellanousComponentIds as Eo, modalComponentIds as Do } from "../primitives/utils/component-ids.js";
56
+ import { composeRefs as $o, useComposedRefs as To } from "../primitives/utils/compose-refs.js";
57
+ import { mergeProps as Wo } from "../primitives/utils/merge-props.js";
58
+ import { Portal as zo } from "../primitives/atoms/portal.js";
59
+ import { CustomIcon as jo } from "../primitives/atoms/icons/custom-icon.js";
60
+ import { BuiltInIconRenderer as Ko } from "../primitives/atoms/icons/built-in-icon-renderer.js";
61
+ import { PortalWithTheme as Qo } from "../primitives/atoms/portal-with-theme.js";
62
+ import { Command as qo, CommandDialog as Jo, CommandEmpty as Vo, CommandInput as Xo, CommandItem as Yo, CommandList as Zo, CommandLoading as _o, CommandRoot as er, CommandSeparator as or, defaultFilter as rr, useCommandState as tr, useCommandStore as ar } from "../primitives/atoms/cmdk/index.js";
63
+ import { ErrorBoundary as sr } from "../primitives/atoms/error-boundary.js";
64
+ import { InkeepShadow as pr, InkeepShadowProvider as dr, ShadowContext as nr, useShadow as ur } from "../primitives/atoms/shadow/context.js";
66
65
  export {
67
66
  w as BaseEventsProvider,
68
- Uo as BuiltInIconRenderer,
69
- R as ChatAuthProvider,
67
+ Ko as BuiltInIconRenderer,
70
68
  t as ChatBubble,
71
- Bo as ChatBubbleComponentIds,
69
+ vo as ChatBubbleComponentIds,
72
70
  x as ChatBubblePrimitive,
73
- Me as ChatBubbleProvider,
71
+ Ie as ChatBubbleProvider,
74
72
  s as ChatButton,
75
- C as ChatButtonPrimitive,
76
- T as ChatFormProvider,
73
+ f as ChatButtonPrimitive,
74
+ R as ChatFormProvider,
77
75
  o as ChatHistory,
78
76
  l as ChatHistoryPrimitive,
79
- L as ChatHistoryProvider,
80
- te as ChatMarkdownProvider,
81
- Re as ChatProvider,
82
- Xo as Command,
83
- Yo as CommandDialog,
84
- Zo as CommandEmpty,
85
- _o as CommandInput,
86
- er as CommandItem,
87
- or as CommandList,
88
- rr as CommandLoading,
89
- tr as CommandRoot,
90
- ar as CommandSeparator,
91
- No as CustomIcon,
92
- Mo as DataSummaryComponentIds,
77
+ W as ChatHistoryProvider,
78
+ ee as ChatMarkdownProvider,
79
+ we as ChatProvider,
80
+ qo as Command,
81
+ Jo as CommandDialog,
82
+ Vo as CommandEmpty,
83
+ Xo as CommandInput,
84
+ Yo as CommandItem,
85
+ Zo as CommandList,
86
+ _o as CommandLoading,
87
+ er as CommandRoot,
88
+ or as CommandSeparator,
89
+ jo as CustomIcon,
90
+ Io as DataSummaryComponentIds,
93
91
  F as DataSummaryGroup,
94
92
  h as DataSummaryPrimitive,
95
93
  M as DefaultToolComponent,
@@ -98,97 +96,96 @@ export {
98
96
  p as EmbeddedChatPrimitive,
99
97
  a as EmbeddedSearch,
100
98
  n as EmbeddedSearchPrimitive,
101
- dr as ErrorBoundary,
102
- q as FeedbackProvider,
103
- X as FormFieldProvider,
104
- _ as HelpMenuProvider,
105
- K as InkeepConfigProvider,
106
- ur as InkeepShadow,
107
- Cr as InkeepShadowProvider,
99
+ sr as ErrorBoundary,
100
+ N as FeedbackProvider,
101
+ q as FormFieldProvider,
102
+ X as HelpMenuProvider,
103
+ L as InkeepConfigProvider,
104
+ pr as InkeepShadow,
105
+ dr as InkeepShadowProvider,
108
106
  v as LoadingIndicator,
109
- se as MessageProvider,
107
+ te as MessageProvider,
110
108
  m as Modal,
111
109
  u as ModalPrimitive,
112
- Le as ModalProvider,
113
- Go as Portal,
114
- Jo as PortalWithTheme,
115
- ne as RootProvider,
110
+ We as ModalProvider,
111
+ zo as Portal,
112
+ Qo as PortalWithTheme,
113
+ ie as RootProvider,
116
114
  i as SearchBar,
117
- yo as SearchBarComponentIds,
118
- f as SearchBarPrimitive,
119
- Te as SearchProvider,
120
- Oe as SearchProviderImpl,
115
+ go as SearchBarComponentIds,
116
+ C as SearchBarPrimitive,
117
+ Re as SearchProvider,
118
+ $e as SearchProviderImpl,
121
119
  c as Shadow,
122
- fr as ShadowContext,
120
+ nr as ShadowContext,
123
121
  r as SidebarChat,
124
- ko as SidebarChatComponentIds,
122
+ Bo as SidebarChatComponentIds,
125
123
  d as SidebarChatPrimitive,
126
- Pe as SidebarChatProvider,
127
- Ce as SourceItemProvider,
128
- he as ThemeProvider,
129
- N as WebWidgetInteractionType,
130
- be as WidgetProvider,
131
- Fo as aiChatComponentIds,
132
- Ho as aiChatHistoryComponentIds,
133
- wo as aiSearchComponentIds,
134
- ho as callAll,
135
- Eo as chatButtonComponentIds,
136
- Do as componentIDs,
137
- Oo as composeRefs,
138
- lo as dataAttr,
139
- mr as defaultFilter,
140
- bo as getInitials,
141
- So as getMessageContent,
142
- we as ikp,
143
- co as isCitationArtifact,
144
- Po as isString,
145
- Ee as jsxFactory,
146
- Ro as markDownComponentIds,
147
- vo as maybeRender,
148
- Lo as mergeProps,
149
- $o as miscellanousComponentIds,
150
- Ao as modalComponentIds,
151
- Io as toKebabCase,
124
+ be as SidebarChatProvider,
125
+ de as SourceItemProvider,
126
+ fe as ThemeProvider,
127
+ j as WebWidgetInteractionType,
128
+ xe as WidgetProvider,
129
+ Mo as aiChatComponentIds,
130
+ yo as aiChatHistoryComponentIds,
131
+ ko as aiSearchComponentIds,
132
+ fo as callAll,
133
+ Fo as chatButtonComponentIds,
134
+ Ho as componentIDs,
135
+ $o as composeRefs,
136
+ Co as dataAttr,
137
+ rr as defaultFilter,
138
+ xo as getInitials,
139
+ ho as getMessageContent,
140
+ ke as ikp,
141
+ lo as isCitationArtifact,
142
+ bo as isString,
143
+ Fe as jsxFactory,
144
+ wo as markDownComponentIds,
145
+ So as maybeRender,
146
+ Wo as mergeProps,
147
+ Eo as miscellanousComponentIds,
148
+ Do as modalComponentIds,
149
+ co as toKebabCase,
152
150
  E as useBaseEvents,
153
- Ke as useBoolean,
154
- $e as useChat,
155
- $ as useChatAuth,
156
- ye as useChatBubble,
157
- O as useChatForm,
158
- W as useChatFormState,
159
- j as useChatHistory,
160
- ae as useChatMarkdown,
161
- sr as useCommandState,
162
- ir as useCommandStore,
163
- Qe as useComponentClassNames,
164
- Wo as useComposedRefs,
165
- qe as useContainerSize,
166
- Ye as useCopyToClipboard,
167
- Y as useFormField,
168
- ee as useHelpMenu,
169
- oe as useHelpMenuState,
170
- ke as useInkeepChatBubble,
171
- Q as useInkeepConfig,
172
- Ve as useInkeepOpenState,
173
- ve as useInkeepSidebarChat,
174
- _e as useInstantUpdate,
175
- oo as useIsMounted,
176
- to as useMediaQuery,
177
- ie as useMessage,
178
- J as useMessageFeedback,
179
- je as useModal,
180
- Fe as useOptionalChatBubble,
181
- pe as useOptionalMessage,
182
- Ie as useOptionalSidebarChat,
183
- mo as useResizeObserver,
184
- io as useScrollingFades,
185
- po as useScrollingFadesHorizontal,
186
- We as useSearch,
187
- uo as useSettleAction,
188
- xr as useShadow,
189
- ge as useSidebarChat,
190
- fo as useSimpleScroll,
191
- fe as useSourceItem,
192
- Se as useWidget,
151
+ Le as useBoolean,
152
+ Ee as useChat,
153
+ ge as useChatBubble,
154
+ $ as useChatForm,
155
+ T as useChatFormState,
156
+ A as useChatHistory,
157
+ oe as useChatMarkdown,
158
+ tr as useCommandState,
159
+ ar as useCommandStore,
160
+ Ge as useComponentClassNames,
161
+ To as useComposedRefs,
162
+ Ne as useContainerSize,
163
+ Je as useCopyToClipboard,
164
+ J as useFormField,
165
+ Y as useHelpMenu,
166
+ Z as useHelpMenuState,
167
+ Be as useInkeepChatBubble,
168
+ G as useInkeepConfig,
169
+ Ue as useInkeepOpenState,
170
+ Se as useInkeepSidebarChat,
171
+ Xe as useInstantUpdate,
172
+ Ze as useIsMounted,
173
+ eo as useMediaQuery,
174
+ ae as useMessage,
175
+ Q as useMessageFeedback,
176
+ Ae as useModal,
177
+ Me as useOptionalChatBubble,
178
+ me as useOptionalMessage,
179
+ ce as useOptionalSidebarChat,
180
+ ro as useResizeObserver,
181
+ ao as useScrollingFades,
182
+ mo as useScrollingFadesHorizontal,
183
+ Te as useSearch,
184
+ io as useSettleAction,
185
+ ur as useShadow,
186
+ Pe as useSidebarChat,
187
+ no as useSimpleScroll,
188
+ ne as useSourceItem,
189
+ he as useWidget,
193
190
  g as widgetToggle
194
191
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkeep/agents-ui",
3
- "version": "0.0.0-dev-20260508233535",
3
+ "version": "0.0.0-dev-20260508234956",
4
4
  "description": "",
5
5
  "homepage": "",
6
6
  "repository": {
@@ -1 +0,0 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("react/jsx-runtime"),u=require("react"),S=require("./config-provider.cjs"),T=require("../components/modal/modal-provider.cjs"),m=require("./chat-bubble-provider.cjs"),x=require("./sidebar-chat-provider.cjs"),B=require("../hooks/use-auth-token.cjs"),w=require("../components/embedded-chat/use-captcha.cjs"),I=require("../hooks/use-anonymous-session.cjs"),c=u.createContext(void 0),j=({children:e})=>{const{baseSettings:t,aiChatSettings:h}=S.useInkeepConfig(),{shouldBypassCaptcha:d,privacyPreferences:l}=t,{baseUrl:s,appId:C,apiKey:p}=h,A=T.useModal(),b=m.useOptionalChatBubble(),v=x.useOptionalSidebarChat(),g=A?.isOpen??b?.isOpen??v?.isOpen??!0,{authToken:n,isLoading:o,refreshToken:q}=B.useAuthToken(),y=!!t.getAuthToken,r=!!n,{getCaptchaHeader:a,invalidate:i}=w.useCaptcha({baseUrl:s,shouldBypassCaptcha:d||!!p,shouldMakeInitialRequest:g}),{sessionToken:P,refreshSession:f}=I.useAnonymousSession({baseUrl:s,appId:C,getCaptchaHeader:a,invalidateCaptcha:i,optOutAllAnalytics:l?.optOutAllAnalytics,enabled:!r&&!o}),k={authToken:n,isAuthenticated:r,isAuthLoading:o,isAuthConfigured:y,refreshAuthToken:q,sessionToken:P,refreshSession:f,getCaptchaHeader:a,invalidateCaptcha:i};return O.jsx(c.Provider,{value:k,children:e})},M=()=>{const e=u.useContext(c);if(!e)throw new Error("useChatAuth must be used within a ChatAuthProvider");return e};exports.ChatAuthProvider=j;exports.useChatAuth=M;
@@ -1,15 +0,0 @@
1
- export interface ChatAuthContextValue {
2
- authToken: string | null;
3
- isAuthenticated: boolean;
4
- isAuthLoading: boolean;
5
- isAuthConfigured: boolean;
6
- refreshAuthToken: () => Promise<string | null>;
7
- sessionToken: string | null;
8
- refreshSession: () => Promise<string | null>;
9
- getCaptchaHeader: () => Promise<Record<string, string>>;
10
- invalidateCaptcha: () => void;
11
- }
12
- export declare const ChatAuthProvider: React.FC<{
13
- children: React.ReactNode;
14
- }>;
15
- export declare const useChatAuth: () => ChatAuthContextValue;
@@ -1,44 +0,0 @@
1
- "use client";
2
- import { jsx as y } from "react/jsx-runtime";
3
- import { useContext as x, createContext as T } from "react";
4
- import { useInkeepConfig as S } from "./config-provider.js";
5
- import { useModal as w } from "../components/modal/modal-provider.js";
6
- import { useOptionalChatBubble as B } from "./chat-bubble-provider.js";
7
- import { useOptionalSidebarChat as I } from "./sidebar-chat-provider.js";
8
- import { useAuthToken as P } from "../hooks/use-auth-token.js";
9
- import { useCaptcha as L } from "../components/embedded-chat/use-captcha.js";
10
- import { useAnonymousSession as M } from "../hooks/use-anonymous-session.js";
11
- const u = T(void 0), F = ({ children: t }) => {
12
- const { baseSettings: e, aiChatSettings: h } = S(), { shouldBypassCaptcha: c, privacyPreferences: p } = e, { baseUrl: o, appId: d, apiKey: l } = h, m = w(), C = B(), f = I(), A = m?.isOpen ?? C?.isOpen ?? f?.isOpen ?? !0, { authToken: s, isLoading: n, refreshToken: b } = P(), g = !!e.getAuthToken, a = !!s, { getCaptchaHeader: i, invalidate: r } = L({
13
- baseUrl: o,
14
- shouldBypassCaptcha: c || !!l,
15
- shouldMakeInitialRequest: A
16
- }), { sessionToken: k, refreshSession: v } = M({
17
- baseUrl: o,
18
- appId: d,
19
- getCaptchaHeader: i,
20
- invalidateCaptcha: r,
21
- optOutAllAnalytics: p?.optOutAllAnalytics,
22
- enabled: !a && !n
23
- }), O = {
24
- authToken: s,
25
- isAuthenticated: a,
26
- isAuthLoading: n,
27
- isAuthConfigured: g,
28
- refreshAuthToken: b,
29
- sessionToken: k,
30
- refreshSession: v,
31
- getCaptchaHeader: i,
32
- invalidateCaptcha: r
33
- };
34
- return /* @__PURE__ */ y(u.Provider, { value: O, children: t });
35
- }, G = () => {
36
- const t = x(u);
37
- if (!t)
38
- throw new Error("useChatAuth must be used within a ChatAuthProvider");
39
- return t;
40
- };
41
- export {
42
- F as ChatAuthProvider,
43
- G as useChatAuth
44
- };