@syntrologie/adapt-chatbot 2.8.0-canary.312 → 2.8.0-canary.314

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 +1 @@
1
- {"version":3,"file":"AdaptiveChatBarMountable.d.ts","sourceRoot":"","sources":["../src/AdaptiveChatBarMountable.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,mBAAmB,CAAC;AA+Y3B,eAAO,MAAM,wBAAwB;qBAClB,WAAW,gBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,IAAI;sBAyC9D,WAAW,gBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;CAQ5E,CAAC"}
1
+ {"version":3,"file":"AdaptiveChatBarMountable.d.ts","sourceRoot":"","sources":["../src/AdaptiveChatBarMountable.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,mBAAmB,CAAC;AAqZ3B,eAAO,MAAM,wBAAwB;qBAClB,WAAW,gBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,IAAI;sBAyC9D,WAAW,gBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;CAQ5E,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ChatAssistantLit.d.ts","sourceRoot":"","sources":["../src/ChatAssistantLit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAGH,OAAO,mBAAmB,CAAC;AAa3B,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEvF,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,aAAa,CAAC;IACtB,OAAO,EAAE,oBAAoB,CAAC;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AA8CD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,eAAe,GAAG,SAAS,GAAG,MAAM,CAiEhF;AAED,eAAO,MAAM,yBAAyB;qBACnB,WAAW,gBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAgbpE,CAAC"}
1
+ {"version":3,"file":"ChatAssistantLit.d.ts","sourceRoot":"","sources":["../src/ChatAssistantLit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAGH,OAAO,mBAAmB,CAAC;AAa3B,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEvF,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,aAAa,CAAC;IACtB,OAAO,EAAE,oBAAoB,CAAC;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AA8CD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,eAAe,GAAG,SAAS,GAAG,MAAM,CAiEhF;AAED,eAAO,MAAM,yBAAyB;qBACnB,WAAW,gBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAsbpE,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  ChatAssistantLitMountable,
3
3
  renderFallbackHtml
4
- } from "./chunk-2ZUJ7DZI.js";
4
+ } from "./chunk-DG63RLZZ.js";
5
5
  import "./chunk-ONGGPQER.js";
6
6
  import "./chunk-VLJ3WOEX.js";
7
7
  import "./chunk-UVKRO5ER.js";
@@ -8487,13 +8487,14 @@ var ChatAssistantLitMountable = {
8487
8487
  const flatLooksLikeChatbotConfig = typeof flat.backendUrl === "string";
8488
8488
  const chatbotConfig = nestedConfig ?? (flatLooksLikeChatbotConfig ? flat : void 0);
8489
8489
  const resolvedTileId = tileId ?? instanceId ?? "chatbot-widget";
8490
- if (!chatbotConfig?.backendUrl || !runtime) {
8491
- container.innerHTML = '<div style="padding:16px;color:var(--sc-content-text-secondary-color,#87919f)">Chat widget requires config and runtime.</div>';
8490
+ const backendUrl = runtime?.backendUrl;
8491
+ if (!backendUrl || !runtime) {
8492
+ container.innerHTML = '<div style="padding:16px;color:var(--sc-content-text-secondary-color,#87919f)">Chat widget requires runtime + backendUrl.</div>';
8492
8493
  return () => {
8493
8494
  container.innerHTML = "";
8494
8495
  };
8495
8496
  }
8496
- const baseUrl = chatbotConfig.backendUrl.replace(/\/$/, "");
8497
+ const baseUrl = backendUrl.replace(/\/$/, "");
8497
8498
  const token = readSyntroToken();
8498
8499
  const streamUrl = `${baseUrl}/api/adaptive/stream`;
8499
8500
  const buildHeaders = (cft) => {
@@ -8532,8 +8533,8 @@ var ChatAssistantLitMountable = {
8532
8533
  elementStore.scheduleClientTtl(response.session_expires_at);
8533
8534
  });
8534
8535
  const el = document.createElement("syntro-chat");
8535
- el.greeting = chatbotConfig.greeting;
8536
- if (chatbotConfig.suggestions) {
8536
+ el.greeting = chatbotConfig?.greeting;
8537
+ if (chatbotConfig?.suggestions) {
8537
8538
  el.suggestions = chatbotConfig.suggestions;
8538
8539
  }
8539
8540
  el.style.cssText = "display:flex;flex-direction:column;height:100%;width:100%;";
@@ -8592,7 +8593,7 @@ var ChatAssistantLitMountable = {
8592
8593
  );
8593
8594
  transport?.disconnect();
8594
8595
  el.remove();
8595
- container.innerHTML = renderFallbackHtml(chatbotConfig.fallback);
8596
+ container.innerHTML = renderFallbackHtml(chatbotConfig?.fallback);
8596
8597
  };
8597
8598
  const setupTransport = (cftToken) => {
8598
8599
  if (isUnmounted) return;
@@ -8767,4 +8768,4 @@ fast-json-patch/module/duplex.mjs:
8767
8768
  * MIT license
8768
8769
  *)
8769
8770
  */
8770
- //# sourceMappingURL=chunk-2ZUJ7DZI.js.map
8771
+ //# sourceMappingURL=chunk-DG63RLZZ.js.map