@inkeep/agents-ui-cloud 0.0.0-rc-20260310051343

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 (85) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1 -0
  3. package/dist/components/api/analytics/events.cjs +1 -0
  4. package/dist/components/api/analytics/events.js +34 -0
  5. package/dist/components/chat-button-modal.cjs +1 -0
  6. package/dist/components/chat-button-modal.js +20 -0
  7. package/dist/components/chat-button.cjs +1 -0
  8. package/dist/components/chat-button.js +15 -0
  9. package/dist/components/default-settings.cjs +1 -0
  10. package/dist/components/default-settings.js +24 -0
  11. package/dist/components/embedded-chat.cjs +1 -0
  12. package/dist/components/embedded-chat.js +15 -0
  13. package/dist/components/embedded-search-and-chat.cjs +1 -0
  14. package/dist/components/embedded-search-and-chat.js +20 -0
  15. package/dist/components/embedded-search.cjs +1 -0
  16. package/dist/components/embedded-search.js +18 -0
  17. package/dist/components/hooks/use-base-settings.cjs +1 -0
  18. package/dist/components/hooks/use-base-settings.js +42 -0
  19. package/dist/components/hooks/use-browser-storage.cjs +1 -0
  20. package/dist/components/hooks/use-browser-storage.js +91 -0
  21. package/dist/components/hooks/use-search-settings.cjs +1 -0
  22. package/dist/components/hooks/use-search-settings.js +23 -0
  23. package/dist/components/hooks/use-user-properties.cjs +1 -0
  24. package/dist/components/hooks/use-user-properties.js +27 -0
  25. package/dist/components/index.cjs +1 -0
  26. package/dist/components/index.js +28 -0
  27. package/dist/components/modal.chat.cjs +1 -0
  28. package/dist/components/modal.chat.js +20 -0
  29. package/dist/components/modal.cjs +1 -0
  30. package/dist/components/modal.js +23 -0
  31. package/dist/components/modal.search-and-chat.cjs +1 -0
  32. package/dist/components/modal.search-and-chat.js +20 -0
  33. package/dist/components/modal.search.cjs +1 -0
  34. package/dist/components/modal.search.js +20 -0
  35. package/dist/components/searchbar.cjs +1 -0
  36. package/dist/components/searchbar.js +20 -0
  37. package/dist/components/sidebar-chat.cjs +1 -0
  38. package/dist/components/sidebar-chat.js +15 -0
  39. package/dist/components/utils/generate-uid.cjs +1 -0
  40. package/dist/components/utils/generate-uid.js +8 -0
  41. package/dist/components/utils/index.cjs +1 -0
  42. package/dist/components/utils/index.js +6 -0
  43. package/dist/components/utils/search-implementation.cjs +89 -0
  44. package/dist/components/utils/search-implementation.js +143 -0
  45. package/dist/components/utils/search.cjs +1 -0
  46. package/dist/components/utils/search.js +50 -0
  47. package/dist/components/utils/transform-source/breadcrumbs.cjs +1 -0
  48. package/dist/components/utils/transform-source/breadcrumbs.js +31 -0
  49. package/dist/components/utils/transform-source/common-words/long.cjs +1 -0
  50. package/dist/components/utils/transform-source/common-words/long.js +69 -0
  51. package/dist/components/utils/transform-source/common-words/lowercase.cjs +1 -0
  52. package/dist/components/utils/transform-source/common-words/lowercase.js +48 -0
  53. package/dist/components/utils/transform-source/common-words/short.cjs +1 -0
  54. package/dist/components/utils/transform-source/common-words/short.js +141 -0
  55. package/dist/components/utils/transform-source/description.cjs +1 -0
  56. package/dist/components/utils/transform-source/description.js +10 -0
  57. package/dist/components/utils/transform-source/icon.cjs +1 -0
  58. package/dist/components/utils/transform-source/icon.js +9 -0
  59. package/dist/components/utils/transform-source/index.cjs +1 -0
  60. package/dist/components/utils/transform-source/index.js +20 -0
  61. package/dist/components/utils/transform-source/tabs.cjs +1 -0
  62. package/dist/components/utils/transform-source/tabs.js +36 -0
  63. package/dist/components/utils/transform-source/title.cjs +1 -0
  64. package/dist/components/utils/transform-source/title.js +12 -0
  65. package/dist/components/utils/transform-source/utils/description-without-title.cjs +1 -0
  66. package/dist/components/utils/transform-source/utils/description-without-title.js +12 -0
  67. package/dist/components/utils/transform-source/utils/index.cjs +1 -0
  68. package/dist/components/utils/transform-source/utils/index.js +16 -0
  69. package/dist/components/utils/transform-source/utils/misc.cjs +1 -0
  70. package/dist/components/utils/transform-source/utils/misc.js +15 -0
  71. package/dist/components/utils/transform-source/utils/standardize-common-words.cjs +1 -0
  72. package/dist/components/utils/transform-source/utils/standardize-common-words.js +26 -0
  73. package/dist/components/utils/transform-source/utils/standardize-organization-display-name.cjs +1 -0
  74. package/dist/components/utils/transform-source/utils/standardize-organization-display-name.js +10 -0
  75. package/dist/components/utils/transform-source/utils/standardize-suffixes.cjs +1 -0
  76. package/dist/components/utils/transform-source/utils/standardize-suffixes.js +16 -0
  77. package/dist/components/utils/transform-source/utils/strip-branding-keywords.cjs +1 -0
  78. package/dist/components/utils/transform-source/utils/strip-branding-keywords.js +14 -0
  79. package/dist/components/utils.cjs +1 -0
  80. package/dist/components/utils.js +20 -0
  81. package/dist/index.cjs +1 -0
  82. package/dist/index.d.cts +235 -0
  83. package/dist/index.d.ts +235 -0
  84. package/dist/index.js +28 -0
  85. package/package.json +74 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Chakra UI
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1 @@
1
+ # @inkeep
@@ -0,0 +1 @@
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});async function a(e,s,i){try{const t=`${i}/events`,r={...e,type:e.eventName};if("searchQuery"in e.properties)r.entityType="search",r.searchQuery=e.properties.searchQuery;else if("messageId"in e.properties)r.entityType="message",r.messageId=e.properties.messageId;else{if(r.entityType="conversation",!e.properties.conversationId)return;r.conversationId=e.properties.conversationId}const o=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${s}`},body:JSON.stringify(r)});if(!o.ok){const n=await o.text();throw new Error(`Failed to log event: ${n}`)}}catch(t){console.warn("Error in logEvent:",t)}}exports.logEvent=a;
@@ -0,0 +1,34 @@
1
+ "use client";
2
+ async function a(e, s, i) {
3
+ try {
4
+ const o = `${i}/events`, r = {
5
+ ...e,
6
+ type: e.eventName
7
+ };
8
+ if ("searchQuery" in e.properties)
9
+ r.entityType = "search", r.searchQuery = e.properties.searchQuery;
10
+ else if ("messageId" in e.properties)
11
+ r.entityType = "message", r.messageId = e.properties.messageId;
12
+ else {
13
+ if (r.entityType = "conversation", !e.properties.conversationId) return;
14
+ r.conversationId = e.properties.conversationId;
15
+ }
16
+ const t = await fetch(o, {
17
+ method: "POST",
18
+ headers: {
19
+ "Content-Type": "application/json",
20
+ Authorization: `Bearer ${s}`
21
+ },
22
+ body: JSON.stringify(r)
23
+ });
24
+ if (!t.ok) {
25
+ const n = await t.text();
26
+ throw new Error(`Failed to log event: ${n}`);
27
+ }
28
+ } catch (o) {
29
+ console.warn("Error in logEvent:", o);
30
+ }
31
+ }
32
+ export {
33
+ a as logEvent
34
+ };
@@ -0,0 +1 @@
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),t=require("@inkeep/agents-ui"),u=require("./hooks/use-base-settings.cjs"),o=require("./hooks/use-search-settings.cjs"),c=require("./default-settings.cjs");function g(e){const s=u.useBaseSettings(e.baseSettings),n=o.useSearchSettings({baseSettings:s,searchSettings:e.searchSettings}),i=t.mergeProps(c.defaultInkeepAIChatSettings,e.aiChatSettings??{}),a=t.mergeProps(e,{baseSettings:s,aiChatSettings:i,searchSettings:n});return r.jsx(t.InkeepChatButtonModal,{...a})}exports.InkeepChatButtonModal=g;
@@ -0,0 +1,20 @@
1
+ "use client";
2
+ import { jsx as i } from "react/jsx-runtime";
3
+ import { mergeProps as n, InkeepChatButtonModal as r } from "@inkeep/agents-ui";
4
+ import { useBaseSettings as g } from "./hooks/use-base-settings.js";
5
+ import { useSearchSettings as m } from "./hooks/use-search-settings.js";
6
+ import { defaultInkeepAIChatSettings as S } from "./default-settings.js";
7
+ function C(t) {
8
+ const e = g(t.baseSettings), s = m({
9
+ baseSettings: e,
10
+ searchSettings: t.searchSettings
11
+ }), a = n(S, t.aiChatSettings ?? {}), o = n(t, {
12
+ baseSettings: e,
13
+ aiChatSettings: a,
14
+ searchSettings: s
15
+ });
16
+ return /* @__PURE__ */ i(r, { ...o });
17
+ }
18
+ export {
19
+ C as InkeepChatButtonModal
20
+ };
@@ -0,0 +1 @@
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),t=require("@inkeep/agents-ui"),a=require("./hooks/use-base-settings.cjs"),r=require("./default-settings.cjs");function o(e){const n=a.useBaseSettings(e.baseSettings),s=t.mergeProps(r.defaultInkeepAIChatSettings,e.aiChatSettings??{}),i=t.mergeProps(e,{baseSettings:n,aiChatSettings:s});return u.jsx(t.InkeepChatButton,{...i})}exports.InkeepChatButton=o;
@@ -0,0 +1,15 @@
1
+ "use client";
2
+ import { jsx as a } from "react/jsx-runtime";
3
+ import { mergeProps as e, InkeepChatButton as i } from "@inkeep/agents-ui";
4
+ import { useBaseSettings as r } from "./hooks/use-base-settings.js";
5
+ import { defaultInkeepAIChatSettings as m } from "./default-settings.js";
6
+ function p(t) {
7
+ const n = r(t.baseSettings), o = e(m, t.aiChatSettings ?? {}), s = e(t, {
8
+ baseSettings: n,
9
+ aiChatSettings: o
10
+ });
11
+ return /* @__PURE__ */ a(i, { ...s });
12
+ }
13
+ export {
14
+ p as InkeepChatButton
15
+ };
@@ -0,0 +1 @@
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={headers:{}},t={env:"production",primaryBrandColor:"#0000",analyticsApiBaseUrl:"https://api.io.inkeep.com",privacyPreferences:{optOutAnalyticalCookies:!1,optOutAllAnalytics:!1,optOutFunctionalCookies:!1}},a={apiKey:"",url:"https://api.inkeep.com"};exports.defaultInkeepAIChatSettings=e;exports.defaultInkeepBaseSettings=t;exports.defaultInkeepSearchSettings=a;
@@ -0,0 +1,24 @@
1
+ "use client";
2
+ const e = {
3
+ headers: {}
4
+ }, t = {
5
+ env: "production",
6
+ primaryBrandColor: "#0000",
7
+ analyticsApiBaseUrl: "https://api.io.inkeep.com",
8
+ privacyPreferences: {
9
+ optOutAnalyticalCookies: !1,
10
+ // disable use of cookies for analytics. Default is false.
11
+ optOutAllAnalytics: !1,
12
+ // disable all event logging, even analytics that don't use cookies (e.g. anonymous events)
13
+ optOutFunctionalCookies: !1
14
+ // disable all cookies that are used for functionality, like caching chat sessions cross-tabs. Default is false.
15
+ }
16
+ }, a = {
17
+ apiKey: "",
18
+ url: "https://api.inkeep.com"
19
+ };
20
+ export {
21
+ e as defaultInkeepAIChatSettings,
22
+ t as defaultInkeepBaseSettings,
23
+ a as defaultInkeepSearchSettings
24
+ };
@@ -0,0 +1 @@
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),t=require("@inkeep/agents-ui"),r=require("./default-settings.cjs"),u=require("./hooks/use-base-settings.cjs");function g(e){const n=u.useBaseSettings(e.baseSettings),s=t.mergeProps(r.defaultInkeepAIChatSettings,e.aiChatSettings??{}),i=t.mergeProps(e,{baseSettings:n,aiChatSettings:s});return a.jsx(t.InkeepEmbeddedChat,{...i})}exports.InkeepEmbeddedChat=g;
@@ -0,0 +1,15 @@
1
+ "use client";
2
+ import { jsx as i } from "react/jsx-runtime";
3
+ import { mergeProps as t, InkeepEmbeddedChat as m } from "@inkeep/agents-ui";
4
+ import { defaultInkeepAIChatSettings as o } from "./default-settings.js";
5
+ import { useBaseSettings as r } from "./hooks/use-base-settings.js";
6
+ function S(e) {
7
+ const n = r(e.baseSettings), s = t(o, e.aiChatSettings ?? {}), a = t(e, {
8
+ baseSettings: n,
9
+ aiChatSettings: s
10
+ });
11
+ return /* @__PURE__ */ i(m, { ...a });
12
+ }
13
+ export {
14
+ S as InkeepEmbeddedChat
15
+ };
@@ -0,0 +1 @@
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),t=require("@inkeep/agents-ui"),c=require("./hooks/use-base-settings.cjs"),S=require("./hooks/use-search-settings.cjs"),u=require("./default-settings.cjs");function g(e){const s=c.useBaseSettings(e.baseSettings),n=S.useSearchSettings({baseSettings:s,searchSettings:e.searchSettings}),i=t.mergeProps(u.defaultInkeepAIChatSettings,e.aiChatSettings??{}),a=t.mergeProps(e,{baseSettings:s,aiChatSettings:i,searchSettings:n});return r.jsx(t.InkeepEmbeddedSearchAndChat,{...a})}exports.InkeepEmbeddedSearchAndChat=g;
@@ -0,0 +1,20 @@
1
+ "use client";
2
+ import { jsx as r } from "react/jsx-runtime";
3
+ import { mergeProps as n, InkeepEmbeddedSearchAndChat as m } from "@inkeep/agents-ui";
4
+ import { useBaseSettings as o } from "./hooks/use-base-settings.js";
5
+ import { useSearchSettings as S } from "./hooks/use-search-settings.js";
6
+ import { defaultInkeepAIChatSettings as c } from "./default-settings.js";
7
+ function C(e) {
8
+ const t = o(e.baseSettings), s = S({
9
+ baseSettings: t,
10
+ searchSettings: e.searchSettings
11
+ }), a = n(c, e.aiChatSettings ?? {}), i = n(e, {
12
+ baseSettings: t,
13
+ aiChatSettings: a,
14
+ searchSettings: s
15
+ });
16
+ return /* @__PURE__ */ r(m, { ...i });
17
+ }
18
+ export {
19
+ C as InkeepEmbeddedSearchAndChat
20
+ };
@@ -0,0 +1 @@
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),s=require("@inkeep/agents-ui"),i=require("./hooks/use-base-settings.cjs"),S=require("./hooks/use-search-settings.cjs");function a(e){const t=i.useBaseSettings(e.baseSettings),n=S.useSearchSettings({baseSettings:t,searchSettings:e.searchSettings}),r=s.mergeProps(e,{baseSettings:t,searchSettings:n});return c.jsx(s.InkeepEmbeddedSearch,{...r})}exports.InkeepEmbeddedSearch=a;
@@ -0,0 +1,18 @@
1
+ "use client";
2
+ import { jsx as n } from "react/jsx-runtime";
3
+ import { mergeProps as c, InkeepEmbeddedSearch as i } from "@inkeep/agents-ui";
4
+ import { useBaseSettings as a } from "./hooks/use-base-settings.js";
5
+ import { useSearchSettings as o } from "./hooks/use-search-settings.js";
6
+ function h(e) {
7
+ const t = a(e.baseSettings), s = o({
8
+ baseSettings: t,
9
+ searchSettings: e.searchSettings
10
+ }), r = c(e, {
11
+ baseSettings: t,
12
+ searchSettings: s
13
+ });
14
+ return /* @__PURE__ */ n(i, { ...r });
15
+ }
16
+ export {
17
+ h as InkeepEmbeddedSearch
18
+ };
@@ -0,0 +1 @@
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("@inkeep/agents-ui"),p=require("../default-settings.cjs"),S=require("./use-user-properties.cjs"),m=require("../api/analytics/events.cjs"),v=require("../utils/transform-source/index.cjs"),f=c=>{const n=i.mergeProps(p.defaultInkeepBaseSettings,c??{}),r=S.useUserProperties(n),{analyticsApiBaseUrl:a,privacyPreferences:u,env:l,transformSource:g}=n,d={userProperties:r,async onEvent(e){const t=u?.optOutAllAnalytics&&l!=="development",s=["modal_opened","modal_closed"].includes(e.eventName);t&&!s&&m.logEvent({...e,userProperties:r},"",a??"")},transformSource(e,t,s){const o=g?.(e,t,s);return v.transformInkeepSource?.(o??e,t,s)??o}};return i.mergeProps(n,d)};exports.useBaseSettings=f;
@@ -0,0 +1,42 @@
1
+ "use client";
2
+ import { mergeProps as i } from "@inkeep/agents-ui";
3
+ import { defaultInkeepBaseSettings as f } from "../default-settings.js";
4
+ import { useUserProperties as u } from "./use-user-properties.js";
5
+ import { logEvent as g } from "../api/analytics/events.js";
6
+ import { transformInkeepSource as d } from "../utils/transform-source/index.js";
7
+ const y = (a) => {
8
+ const n = i(
9
+ f,
10
+ a ?? {}
11
+ ), o = u(n), { analyticsApiBaseUrl: c, privacyPreferences: m, env: p, transformSource: l } = n;
12
+ return i(
13
+ n,
14
+ {
15
+ userProperties: o,
16
+ async onEvent(e) {
17
+ const t = m?.optOutAllAnalytics && p !== "development", s = ["modal_opened", "modal_closed"].includes(e.eventName);
18
+ t && !s && g({ ...e, userProperties: o }, "", c ?? "");
19
+ },
20
+ // we don't have this endpoint in the new api yet so we shouldn't show the feedback buttons
21
+ // async onFeedback(feedback) {
22
+ // return submitFeedback({
23
+ // type: feedback.type,
24
+ // messageId: feedback.messageId,
25
+ // reasons: feedback.reasons,
26
+ // // TODO
27
+ // apiKey: '',
28
+ // apiUrl: analyticsApiBaseUrl ?? '',
29
+ // userProperties,
30
+ // properties: feedback.properties,
31
+ // })
32
+ // },
33
+ transformSource(e, t, s) {
34
+ const r = l?.(e, t, s);
35
+ return d?.(r ?? e, t, s) ?? r;
36
+ }
37
+ }
38
+ );
39
+ };
40
+ export {
41
+ y as useBaseSettings
42
+ };
@@ -0,0 +1 @@
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react"),i="inkeepUsagePreferences",y={hasSwitchModeButtonJiggled:!1,userId:null},S={defaultView:null,inkeepChatSessionId:null},g={...y,...S},d={set(o,s,e,c=365){try{if(o==="cookie"){const t=new Date;e===void 0?(t.setTime(t.getTime()-1),document.cookie=`${i}_${s}=; expires=${t.toUTCString()}; path=/`):(t.setTime(t.getTime()+c*24*60*60*1e3),document.cookie=`${i}_${s}=${e}; expires=${t.toUTCString()}; path=/`)}else typeof sessionStorage<"u"&&sessionStorage.setItem(`${i}_${s}`,e?JSON.stringify(e):"")}catch{return null}},get(o,s){if(o==="cookie"){const e=`${i}_${s}=`,c=document.cookie.split(";");for(const t of c){const a=t.trim();if(a.startsWith(e))return a.substring(e.length)}return null}try{if(typeof sessionStorage<"u"){const e=sessionStorage.getItem(`${i}_${s}`);return e?JSON.parse(e):null}}catch{return null}return null}},$=({perInstanceModifier:o,canUseCookies:s,optOutFunctionalCookies:e})=>{const c=s?"cookie":"sessionStorage",t=r=>r in S?`${r}-${o}`:r,a=Object.keys(g).reduce((r,n)=>{const u=t(n),l=d.get(c,u);return{...r,[n]:l}},{...g}),[k,m]=f.useState(a),p=(r,n,u=365)=>{const l=t(r);d.set(c,l,n,u),m(h=>({...h,[r]:n}))};return f.useEffect(()=>{if(e)for(const r of Object.keys(g)){const n=t(r);d.set("cookie",n,null,-1)}},[e]),{browserStorage:k,setBrowserStorage:p}},b=()=>{try{if(typeof localStorage>"u")return!1;const o="__df709c5b-6651-43dc-94e7-d8dc899bf4e8__";return localStorage.setItem(o,"test_value"),localStorage.removeItem(o),!0}catch{return!1}},w=()=>{if(typeof document>"u")return!1;document.cookie="testcookie=true; Path=/; Max-Age=1000";const o=document.cookie.includes("testcookie=true");return document.cookie="testcookie=; Path=/; Max-Age=-1000",o},C=()=>{const o=b(),s=w();return o&&s};exports.passesBrowserStorageChecks=C;exports.useBrowserStorage=$;
@@ -0,0 +1,91 @@
1
+ "use client";
2
+ import { useState as h, useEffect as $ } from "react";
3
+ const i = "inkeepUsagePreferences", y = {
4
+ hasSwitchModeButtonJiggled: !1,
5
+ userId: null
6
+ }, f = {
7
+ defaultView: null,
8
+ inkeepChatSessionId: null
9
+ }, g = {
10
+ ...y,
11
+ ...f
12
+ }, d = {
13
+ set(o, s, e, c = 365) {
14
+ try {
15
+ if (o === "cookie") {
16
+ const t = /* @__PURE__ */ new Date();
17
+ e === void 0 ? (t.setTime(t.getTime() - 1), document.cookie = `${i}_${s}=; expires=${t.toUTCString()}; path=/`) : (t.setTime(t.getTime() + c * 24 * 60 * 60 * 1e3), document.cookie = `${i}_${s}=${e}; expires=${t.toUTCString()}; path=/`);
18
+ } else typeof sessionStorage < "u" && sessionStorage.setItem(`${i}_${s}`, e ? JSON.stringify(e) : "");
19
+ } catch {
20
+ return null;
21
+ }
22
+ },
23
+ get(o, s) {
24
+ if (o === "cookie") {
25
+ const e = `${i}_${s}=`, c = document.cookie.split(";");
26
+ for (const t of c) {
27
+ const a = t.trim();
28
+ if (a.startsWith(e))
29
+ return a.substring(e.length);
30
+ }
31
+ return null;
32
+ }
33
+ try {
34
+ if (typeof sessionStorage < "u") {
35
+ const e = sessionStorage.getItem(`${i}_${s}`);
36
+ return e ? JSON.parse(e) : null;
37
+ }
38
+ } catch {
39
+ return null;
40
+ }
41
+ return null;
42
+ }
43
+ }, C = ({
44
+ perInstanceModifier: o,
45
+ canUseCookies: s,
46
+ optOutFunctionalCookies: e
47
+ }) => {
48
+ const c = s ? "cookie" : "sessionStorage", t = (r) => r in f ? `${r}-${o}` : r, a = Object.keys(g).reduce(
49
+ (r, n) => {
50
+ const l = t(n), u = d.get(c, l);
51
+ return { ...r, [n]: u };
52
+ },
53
+ { ...g }
54
+ ), [S, k] = h(a), m = (r, n, l = 365) => {
55
+ const u = t(r);
56
+ d.set(c, u, n, l), k((p) => ({
57
+ ...p,
58
+ [r]: n
59
+ }));
60
+ };
61
+ return $(() => {
62
+ if (e)
63
+ for (const r of Object.keys(g)) {
64
+ const n = t(r);
65
+ d.set("cookie", n, null, -1);
66
+ }
67
+ }, [e]), {
68
+ browserStorage: S,
69
+ setBrowserStorage: m
70
+ };
71
+ }, _ = () => {
72
+ try {
73
+ if (typeof localStorage > "u") return !1;
74
+ const o = "__df709c5b-6651-43dc-94e7-d8dc899bf4e8__";
75
+ return localStorage.setItem(o, "test_value"), localStorage.removeItem(o), !0;
76
+ } catch {
77
+ return !1;
78
+ }
79
+ }, b = () => {
80
+ if (typeof document > "u") return !1;
81
+ document.cookie = "testcookie=true; Path=/; Max-Age=1000";
82
+ const o = document.cookie.includes("testcookie=true");
83
+ return document.cookie = "testcookie=; Path=/; Max-Age=-1000", o;
84
+ }, I = () => {
85
+ const o = _(), s = b();
86
+ return o && s;
87
+ };
88
+ export {
89
+ I as passesBrowserStorageChecks,
90
+ C as useBrowserStorage
91
+ };
@@ -0,0 +1 @@
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react"),n=require("@inkeep/agents-ui"),a=require("../default-settings.cjs"),s=require("../utils/search-implementation.cjs"),u=({baseSettings:r,searchSettings:e})=>o.useMemo(()=>{const t=n.mergeProps(a.defaultInkeepSearchSettings,e??{}),c=e?.onSearch?e.onSearch:s.createInkeepSearchImplementation({baseSettings:r,searchSettings:t});return n.mergeProps(t,{onSearch:c})},[r,e]);exports.useSearchSettings=u;
@@ -0,0 +1,23 @@
1
+ "use client";
2
+ import { useMemo as n } from "react";
3
+ import { mergeProps as t } from "@inkeep/agents-ui";
4
+ import { defaultInkeepSearchSettings as c } from "../default-settings.js";
5
+ import { createInkeepSearchImplementation as p } from "../utils/search-implementation.js";
6
+ const u = ({
7
+ baseSettings: r,
8
+ searchSettings: e
9
+ }) => n(() => {
10
+ const o = t(
11
+ c,
12
+ e ?? {}
13
+ ), m = e?.onSearch ? e.onSearch : p({
14
+ baseSettings: r,
15
+ searchSettings: o
16
+ });
17
+ return t(o, {
18
+ onSearch: m
19
+ });
20
+ }, [r, e]);
21
+ export {
22
+ u as useSearchSettings
23
+ };
@@ -0,0 +1 @@
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),a=require("./use-browser-storage.cjs"),I=require("../utils/generate-uid.cjs"),U=d=>{const{userProperties:r,privacyPreferences:p}=d,{optOutAllAnalytics:e,optOutAnalyticalCookies:i,optOutFunctionalCookies:g}=p??{},l="widget-embedded-chat",c=t.useMemo(()=>a.passesBrowserStorageChecks(),[]),s=t.useMemo(()=>!e&&!i&&c,[e,i,c]),{browserStorage:n,setBrowserStorage:u}=a.useBrowserStorage({perInstanceModifier:l,canUseCookies:s,optOutFunctionalCookies:g}),o=t.useMemo(()=>{const O=e?"ANONYMOUS":r?.id?"ID_PROVIDED":s?"COOKIED":"ANONYMOUS",S=e?void 0:r?.id||s&&n.userId||I.generateUid();return{identificationType:O,...e?{}:r,id:S}},[r,e,s,n.userId]);return t.useEffect(()=>{s?u("userId",o.id):u("userId",void 0)},[s,o.id]),o};exports.useUserProperties=U;
@@ -0,0 +1,27 @@
1
+ "use client";
2
+ import { useMemo as t, useEffect as l } from "react";
3
+ import { passesBrowserStorageChecks as I, useBrowserStorage as g } from "./use-browser-storage.js";
4
+ import { generateUid as S } from "../utils/generate-uid.js";
5
+ const k = (u) => {
6
+ const { userProperties: r, privacyPreferences: a } = u, { optOutAllAnalytics: e, optOutAnalyticalCookies: i, optOutFunctionalCookies: p } = a ?? {}, O = "widget-embedded-chat", c = t(() => I(), []), o = t(
7
+ () => !e && !i && c,
8
+ [e, i, c]
9
+ ), { browserStorage: n, setBrowserStorage: d } = g({
10
+ perInstanceModifier: O,
11
+ canUseCookies: o,
12
+ optOutFunctionalCookies: p
13
+ }), s = t(() => {
14
+ const f = e ? "ANONYMOUS" : r?.id ? "ID_PROVIDED" : o ? "COOKIED" : "ANONYMOUS", m = e ? void 0 : r?.id || o && n.userId || S();
15
+ return {
16
+ identificationType: f,
17
+ ...e ? {} : r,
18
+ id: m
19
+ };
20
+ }, [r, e, o, n.userId]);
21
+ return l(() => {
22
+ o ? d("userId", s.id) : d("userId", void 0);
23
+ }, [o, s.id]), s;
24
+ };
25
+ export {
26
+ k as useUserProperties
27
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./embedded-chat.cjs"),d=require("./sidebar-chat.cjs"),n=require("./embedded-search-and-chat.cjs"),r=require("./embedded-search.cjs"),o=require("./modal.chat.cjs"),c=require("./modal.search-and-chat.cjs"),h=require("./modal.search.cjs"),e=require("./modal.cjs"),p=require("./chat-button.cjs"),s=require("./chat-button-modal.cjs"),l=require("./searchbar.cjs"),a=require("./utils.cjs");exports.InkeepEmbeddedChat=t.InkeepEmbeddedChat;exports.InkeepSidebarChat=d.InkeepSidebarChat;exports.InkeepEmbeddedSearchAndChat=n.InkeepEmbeddedSearchAndChat;exports.InkeepEmbeddedSearch=r.InkeepEmbeddedSearch;exports.InkeepModalChat=o.InkeepModalChat;exports.InkeepModalSearchAndChat=c.InkeepModalSearchAndChat;exports.InkeepModalSearch=h.InkeepModalSearch;exports.InkeepModal=e.InkeepModal;exports.ModalContent=e.ModalContent;exports.InkeepChatButton=p.InkeepChatButton;exports.InkeepChatButtonModal=s.InkeepChatButtonModal;exports.InkeepSearchBar=l.InkeepSearchBar;exports.composeEventHandlers=a.composeEventHandlers;exports.composeRefs=a.composeRefs;
@@ -0,0 +1,28 @@
1
+ import { InkeepEmbeddedChat as r } from "./embedded-chat.js";
2
+ import { InkeepSidebarChat as p } from "./sidebar-chat.js";
3
+ import { InkeepEmbeddedSearchAndChat as d } from "./embedded-search-and-chat.js";
4
+ import { InkeepEmbeddedSearch as m } from "./embedded-search.js";
5
+ import { InkeepModalChat as h } from "./modal.chat.js";
6
+ import { InkeepModalSearchAndChat as k } from "./modal.search-and-chat.js";
7
+ import { InkeepModalSearch as C } from "./modal.search.js";
8
+ import { InkeepModal as l, ModalContent as M } from "./modal.js";
9
+ import { InkeepChatButton as b } from "./chat-button.js";
10
+ import { InkeepChatButtonModal as E } from "./chat-button-modal.js";
11
+ import { InkeepSearchBar as u } from "./searchbar.js";
12
+ import { composeEventHandlers as i, composeRefs as v } from "./utils.js";
13
+ export {
14
+ b as InkeepChatButton,
15
+ E as InkeepChatButtonModal,
16
+ r as InkeepEmbeddedChat,
17
+ m as InkeepEmbeddedSearch,
18
+ d as InkeepEmbeddedSearchAndChat,
19
+ l as InkeepModal,
20
+ h as InkeepModalChat,
21
+ C as InkeepModalSearch,
22
+ k as InkeepModalSearchAndChat,
23
+ u as InkeepSearchBar,
24
+ p as InkeepSidebarChat,
25
+ M as ModalContent,
26
+ i as composeEventHandlers,
27
+ v as composeRefs
28
+ };
@@ -0,0 +1 @@
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("@inkeep/agents-ui"),a=require("./modal.cjs");function c(n){const{openSettings:i,baseSettings:o,aiChatSettings:r,...s}=n;return e.jsx(a.InkeepModal,{componentType:t.WebWidgetInteractionType.CustomTrigger,openSettings:i,baseSettings:o,aiChatSettings:r,children:e.jsx(t.InkeepEmbeddedChatImpl,{...s})})}exports.InkeepModalChat=c;
@@ -0,0 +1,20 @@
1
+ "use client";
2
+ import { jsx as e } from "react/jsx-runtime";
3
+ import { WebWidgetInteractionType as p, InkeepEmbeddedChatImpl as m } from "@inkeep/agents-ui";
4
+ import { InkeepModal as s } from "./modal.js";
5
+ function g(t) {
6
+ const { openSettings: n, baseSettings: o, aiChatSettings: r, ...i } = t;
7
+ return /* @__PURE__ */ e(
8
+ s,
9
+ {
10
+ componentType: p.CustomTrigger,
11
+ openSettings: n,
12
+ baseSettings: o,
13
+ aiChatSettings: r,
14
+ children: /* @__PURE__ */ e(m, { ...i })
15
+ }
16
+ );
17
+ }
18
+ export {
19
+ g as InkeepModalChat
20
+ };
@@ -0,0 +1 @@
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("@inkeep/agents-ui");function d(o){const{componentType:r,children:t,openSettings:i,...l}=o;return e.jsx(n.ErrorBoundary,{children:e.jsx(n.Portal,{children:e.jsx(n.Shadow,{children:e.jsx(n.RootProvider,{config:{...l},componentType:r,children:e.jsx(n.Modal.Root,{config:i,children:t})})})})})}function c(o){return e.jsx(n.Modal.Overlay,{children:e.jsx(n.Modal.Content,{children:o.children})})}exports.InkeepModal=d;exports.ModalContent=c;
@@ -0,0 +1,23 @@
1
+ "use client";
2
+ import { jsx as n } from "react/jsx-runtime";
3
+ import { ErrorBoundary as d, Portal as l, Shadow as h, RootProvider as a, Modal as r } from "@inkeep/agents-ui";
4
+ function u(o) {
5
+ const { componentType: e, children: t, openSettings: i, ...c } = o;
6
+ return /* @__PURE__ */ n(d, { children: /* @__PURE__ */ n(l, { children: /* @__PURE__ */ n(h, { children: /* @__PURE__ */ n(
7
+ a,
8
+ {
9
+ config: {
10
+ ...c
11
+ },
12
+ componentType: e,
13
+ children: /* @__PURE__ */ n(r.Root, { config: i, children: t })
14
+ }
15
+ ) }) }) });
16
+ }
17
+ function m(o) {
18
+ return /* @__PURE__ */ n(r.Overlay, { children: /* @__PURE__ */ n(r.Content, { children: o.children }) });
19
+ }
20
+ export {
21
+ u as InkeepModal,
22
+ m as ModalContent
23
+ };
@@ -0,0 +1 @@
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),t=require("@inkeep/agents-ui"),c=require("./hooks/use-base-settings.cjs"),S=require("./hooks/use-search-settings.cjs"),u=require("./default-settings.cjs");function g(e){const s=c.useBaseSettings(e.baseSettings),n=S.useSearchSettings({baseSettings:s,searchSettings:e.searchSettings}),a=t.mergeProps(u.defaultInkeepAIChatSettings,e.aiChatSettings??{}),i=t.mergeProps(e,{baseSettings:s,aiChatSettings:a,searchSettings:n});return r.jsx(t.InkeepModalSearchAndChat,{...i})}exports.InkeepModalSearchAndChat=g;
@@ -0,0 +1,20 @@
1
+ "use client";
2
+ import { jsx as r } from "react/jsx-runtime";
3
+ import { mergeProps as n, InkeepModalSearchAndChat as o } from "@inkeep/agents-ui";
4
+ import { useBaseSettings as S } from "./hooks/use-base-settings.js";
5
+ import { useSearchSettings as c } from "./hooks/use-search-settings.js";
6
+ import { defaultInkeepAIChatSettings as h } from "./default-settings.js";
7
+ function l(t) {
8
+ const e = S(t.baseSettings), a = c({
9
+ baseSettings: e,
10
+ searchSettings: t.searchSettings
11
+ }), s = n(h, t.aiChatSettings ?? {}), i = n(t, {
12
+ baseSettings: e,
13
+ aiChatSettings: s,
14
+ searchSettings: a
15
+ });
16
+ return /* @__PURE__ */ r(o, { ...i });
17
+ }
18
+ export {
19
+ l as InkeepModalSearchAndChat
20
+ };
@@ -0,0 +1 @@
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("@inkeep/agents-ui"),c=require("./modal.cjs");function u(n){const{openSettings:r,baseSettings:o,searchSettings:s,...i}=n;return e.jsx(c.InkeepModal,{componentType:t.WebWidgetInteractionType.CustomTrigger,openSettings:r,baseSettings:o,searchSettings:s,children:e.jsx(t.InkeepEmbeddedSearchImpl,{shouldAutoFocusInput:!0,...i})})}exports.InkeepModalSearch=u;
@@ -0,0 +1,20 @@
1
+ "use client";
2
+ import { jsx as e } from "react/jsx-runtime";
3
+ import { WebWidgetInteractionType as i, InkeepEmbeddedSearchImpl as s } from "@inkeep/agents-ui";
4
+ import { InkeepModal as c } from "./modal.js";
5
+ function a(t) {
6
+ const { openSettings: o, baseSettings: n, searchSettings: r, ...p } = t;
7
+ return /* @__PURE__ */ e(
8
+ c,
9
+ {
10
+ componentType: i.CustomTrigger,
11
+ openSettings: o,
12
+ baseSettings: n,
13
+ searchSettings: r,
14
+ children: /* @__PURE__ */ e(s, { shouldAutoFocusInput: !0, ...p })
15
+ }
16
+ );
17
+ }
18
+ export {
19
+ a as InkeepModalSearch
20
+ };
@@ -0,0 +1 @@
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),t=require("@inkeep/agents-ui"),c=require("./hooks/use-base-settings.cjs"),S=require("./hooks/use-search-settings.cjs"),u=require("./default-settings.cjs");function g(e){const s=c.useBaseSettings(e.baseSettings),n=S.useSearchSettings({baseSettings:s,searchSettings:e.searchSettings}),r=t.mergeProps(u.defaultInkeepAIChatSettings,e.aiChatSettings??{}),i=t.mergeProps(e,{baseSettings:s,aiChatSettings:r,searchSettings:n});return a.jsx(t.InkeepSearchBar,{...i})}exports.InkeepSearchBar=g;
@@ -0,0 +1,20 @@
1
+ "use client";
2
+ import { jsx as i } from "react/jsx-runtime";
3
+ import { mergeProps as s, InkeepSearchBar as o } from "@inkeep/agents-ui";
4
+ import { useBaseSettings as S } from "./hooks/use-base-settings.js";
5
+ import { useSearchSettings as c } from "./hooks/use-search-settings.js";
6
+ import { defaultInkeepAIChatSettings as g } from "./default-settings.js";
7
+ function I(e) {
8
+ const t = S(e.baseSettings), n = c({
9
+ baseSettings: t,
10
+ searchSettings: e.searchSettings
11
+ }), r = s(g, e.aiChatSettings ?? {}), a = s(e, {
12
+ baseSettings: t,
13
+ aiChatSettings: r,
14
+ searchSettings: n
15
+ });
16
+ return /* @__PURE__ */ i(o, { ...a });
17
+ }
18
+ export {
19
+ I as InkeepSearchBar
20
+ };
@@ -0,0 +1 @@
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),t=require("@inkeep/agents-ui"),r=require("./default-settings.cjs"),u=require("./hooks/use-base-settings.cjs");function g(e){const n=u.useBaseSettings(e.baseSettings),s=t.mergeProps(r.defaultInkeepAIChatSettings,e.aiChatSettings??{}),i=t.mergeProps(e,{baseSettings:n,aiChatSettings:s});return a.jsx(t.InkeepSidebarChat,{...i})}exports.InkeepSidebarChat=g;
@@ -0,0 +1,15 @@
1
+ "use client";
2
+ import { jsx as s } from "react/jsx-runtime";
3
+ import { mergeProps as e, InkeepSidebarChat as r } from "@inkeep/agents-ui";
4
+ import { defaultInkeepAIChatSettings as o } from "./default-settings.js";
5
+ import { useBaseSettings as m } from "./hooks/use-base-settings.js";
6
+ function f(t) {
7
+ const a = m(t.baseSettings), i = e(o, t.aiChatSettings ?? {}), n = e(t, {
8
+ baseSettings: a,
9
+ aiChatSettings: i
10
+ });
11
+ return /* @__PURE__ */ s(r, { ...n });
12
+ }
13
+ export {
14
+ f as InkeepSidebarChat
15
+ };
@@ -0,0 +1 @@
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function n(e=21){const r=new Uint8Array(e);return crypto.getRandomValues(r),Array.from(r,t=>t.toString(36)).join("").slice(0,e)}exports.generateUid=n;
@@ -0,0 +1,8 @@
1
+ "use client";
2
+ function t(r = 21) {
3
+ const e = new Uint8Array(r);
4
+ return crypto.getRandomValues(e), Array.from(e, (n) => n.toString(36)).join("").slice(0, r);
5
+ }
6
+ export {
7
+ t as generateUid
8
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./search-implementation.cjs"),t=require("../hooks/use-search-settings.cjs");exports.createInkeepSearchImplementation=e.createInkeepSearchImplementation;exports.useSearchSettings=t.useSearchSettings;
@@ -0,0 +1,6 @@
1
+ import { createInkeepSearchImplementation as t } from "./search-implementation.js";
2
+ import { useSearchSettings as a } from "../hooks/use-search-settings.js";
3
+ export {
4
+ t as createInkeepSearchImplementation,
5
+ a as useSearchSettings
6
+ };