@botfabrik/engine-webclient 4.117.2 → 4.118.1

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.
@@ -13,7 +13,7 @@
13
13
  <meta name="theme-color" content="#000000" />
14
14
  <meta name="google" content="notranslate" />
15
15
  <title>Bubble Chat Client</title>
16
- <script type="module" crossorigin src="./assets/index-kLumE_Is.js"></script>
16
+ <script type="module" crossorigin src="./assets/index-C4GnHw7l.js"></script>
17
17
  <link rel="stylesheet" crossorigin href="./assets/index-Q0uFG8V2.css">
18
18
  </head>
19
19
 
@@ -25,8 +25,8 @@
25
25
  }p.svelte-yhk8rr,
26
26
  pre.svelte-yhk8rr {max-width:300px;}pre.svelte-yhk8rr {font-size:0.6em;line-height:0.5;}`};function Er(e,t){Ue(t,!0),lr(e,Tr),xr(()=>{document.getElementById(`chat-frame`)?.addEventListener(`load`,t.onLoad)});var n=er(),r=Jt(n),i=e=>{var n=Cr();let r;var i=qt(n);Pe(n),dn(e=>{r=fr(n,1,`bot-border svelte-yhk8rr`,null,r,{closed:!t.open}),gr(n,`aria-hidden`,t.open?`false`:`true`),gr(i,`src`,e)},[()=>`${t.server}${t.server.indexOf(`?`)===-1?`?`:`&`}referrer=${encodeURIComponent(t.referrer??``)}`]),tr(e,n)},a=e=>{var t=wr();Fe(4),tr(e,t)};sr(r,e=>{t.server?e(i):e(a,-1)}),tr(e,n),We()}var Dr=$n(`<div class="chat-button-wrapper svelte-1xi58vz" tabindex="0" role="button" aria-label="Open chat window"><img class="chat-button svelte-1xi58vz" alt="Open chat window"/></div>`),Or={hash:`svelte-1xi58vz`,code:`.svelte-1xi58vz,
27
27
  .svelte-1xi58vz:before,
28
- .svelte-1xi58vz:after {box-sizing:border-box;}.chat-button-wrapper.svelte-1xi58vz {position:fixed;top:var(--fab-top-mobile, var(--fab-top, auto));right:var(--fab-right-mobile, var(--fab-right, 1.5em));bottom:var(--fab-bottom-mobile, var(--fab-bottom, 1.5em));left:var(--fab-left-mobile, var(--fab-left, auto));width:var(--fab-size-mobile, var(--fab-size, 5em));height:var(--fab-size-mobile, var(--fab-size, 5em));z-index:999;}
28
+ .svelte-1xi58vz:after {box-sizing:border-box;}.chat-button-wrapper.svelte-1xi58vz {position:fixed;top:var(--fab-top-mobile, var(--fab-top, auto));right:var(--fab-right-mobile, var(--fab-right, 1.5em));bottom:var(--fab-bottom-mobile, var(--fab-bottom, 1.5em));left:var(--fab-left-mobile, var(--fab-left, auto));width:var(--fab-width-mobile, var(--fab-width, var(--fab-size-mobile, var(--fab-size, 5em))));height:var(--fab-height-mobile, var(--fab-height, var(--fab-size-mobile, var(--fab-size, 5em))));z-index:999;}
29
29
 
30
- @media screen and (min-width: 768px) {.chat-button-wrapper.svelte-1xi58vz {top:var(--fab-top, auto);right:var(--fab-right, 1.5em);bottom:var(--fab-bottom, 1.5em);left:var(--fab-left, auto);width:var(--fab-size, 6em);height:var(--fab-size, 6em);}
30
+ @media screen and (min-width: 768px) {.chat-button-wrapper.svelte-1xi58vz {top:var(--fab-top, auto);right:var(--fab-right, 1.5em);bottom:var(--fab-bottom, 1.5em);left:var(--fab-left, auto);width:var(--fab-width, var(--fab-size, 6em));height:var(--fab-height, var(--fab-size, 6em));}
31
31
  }.chat-button.svelte-1xi58vz {display:block;height:100%;cursor:pointer;border-radius:50%;box-shadow:9px 9px 16px rgba(0, 0, 0, 0.25);transition:transform 100ms,
32
32
  box-shadow 100ms;}.chat-button.svelte-1xi58vz:hover {box-shadow:16px 16px 16px rgba(0, 0, 0, 0.2);transform:translateY(-2px);}`};function kr(e,t){Ue(t,!0),lr(e,Or);function n(e){let n=e.key;(n===`ArrowDown`||n===`ArrowRight`||n===`Enter`||n===` `||n===`Space`)&&(e.stopPropagation(),t.onToggle())}var r=Dr(),i=qt(r);Pe(r),dn(()=>{gr(r,`aria-expanded`,t.open?`true`:`false`),gr(i,`src`,`${t.assetsUrl}/fab.svg`)}),Gn(`click`,r,function(...e){t.onToggle?.apply(this,e)}),Gn(`keydown`,r,n),tr(e,r),We()}Kn([`click`,`keydown`]);var Ar=!1;function jr(e){Ar=e}function Mr(){return Ar}function Nr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var Pr={read:function(e){return e[0]===`"`&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function Fr(e,t){function n(n,r,i){if(!(typeof document>`u`)){i=Nr({},t,i),typeof i.expires==`number`&&(i.expires=new Date(Date.now()+i.expires*864e5)),i.expires&&=i.expires.toUTCString(),n=encodeURIComponent(n).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a=``;for(var o in i)i[o]&&(a+=`; `+o,i[o]!==!0&&(a+=`=`+i[o].split(`;`)[0]));return document.cookie=n+`=`+e.write(r,n)+a}}function r(t){if(!(typeof document>`u`||arguments.length&&!t)){for(var n=document.cookie?document.cookie.split(`; `):[],r={},i=0;i<n.length;i++){var a=n[i].split(`=`),o=a.slice(1).join(`=`);try{var s=decodeURIComponent(a[0]);if(r[s]=e.read(o,s),t===s)break}catch{}}return t?r[t]:r}}return Object.create({set:n,get:r,remove:function(e,t){n(e,``,Nr({},t,{expires:-1}))},withAttributes:function(e){return Fr(this.converter,Nr({},this.attributes,e))},withConverter:function(e){return Fr(Nr({},this.converter,e),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var Ir=Fr(Pr,{path:`/`}),Lr=`bubble-chat-window-state`,Rr=()=>{switch(Ir.get(Lr)){case`open`:return!0;case`closed`:return!1;default:return}},zr=e=>{let t=new Date(new Date().getTime()+480*60*1e3);Ir.set(Lr,e,{expires:t})},Br=t({closeChatWindow:()=>Wr,enterGuestMessage:()=>qr,isChatbotLoaded:()=>Mr,openChatWindow:()=>Ur,restartChat:()=>Kr,subscribe:()=>Qr,toggleChatWindow:()=>Gr,triggerStory:()=>Jr}),Vr=[],Hr=Rr();function Ur(){Hr=!0,zr(`open`),Vr.forEach(function(e){e.call(window,!0)})}function Wr(){Hr=!1,zr(`closed`),Vr.forEach(function(e){e.call(window,!1)})}function Gr(){Hr?Wr():Ur()}function Kr(){Zr({type:`RESTART_CHAT`})}function qr(e){Zr({type:`CHAT_MESSAGE_FROM_GUEST`,text:e})}function Jr(e){Zr({type:`TRIGGER_STORY`,story:e})}function Yr(){return document.getElementById(`chat-frame`)}function Xr(){let e=Yr();if(e?.src)try{return new URL(e.src).origin}catch{return null}return null}function Zr(e){let t=Yr(),n=Xr();if(!n){console.warn(`Cannot send message: chat iframe origin could not be determined`);return}t?.contentWindow?.postMessage(e,n)}function Qr(e,t){switch(e){case`ON_CHAT_WINDOW_STATE_CHANGE`:Vr.push(t);break;default:throw Error(`Unsupported event `+e)}}var $r=e=>{if(!e||typeof e!=`object`||Array.isArray(e)){console.warn(`Invalid tracking payload received:`,e);return}`gtag`in window&&typeof window.gtag==`function`?window.gtag(`event`,``,e):`dataLayer`in window&&Array.isArray(window.dataLayer)&&window.dataLayer.push(e)},ei=(e,t,n,r,i)=>{let a=()=>{let e=document.getElementById(`chat-frame`);if(e?.src)try{return new URL(e.src).origin}catch{return null}return null},o={CHAT_STARTED:`webclient.chat.started`,CHAT_ENDED:`webclient.chat.ended`,WINDOW_EXPAND:`webclient.window.expand`,WINDOW_CLOSE:`webclient.window.close`,CHANGE_URL:`webclient.change.url`,GOOGLE_TAG_EVENT:`google.tag.event`},s=Object.values(o);window.addEventListener(`message`,c=>{if(!c.data?.type||!s.includes(c.data.type))return;let l=a();if(l&&c.origin!==l){console.warn(`Rejected postMessage from untrusted origin:`,c.origin);return}let u=c.data;switch(u.type){case o.CHAT_STARTED:e();break;case o.CHAT_ENDED:t();break;case o.WINDOW_EXPAND:n(u.devices,u.initial);break;case o.WINDOW_CLOSE:r();break;case o.CHANGE_URL:i(u.url);break;case o.GOOGLE_TAG_EVENT:$r(u.payload);break;default:break}},!1)},ti=e=>new Promise(t=>{let n=document.getElementById(e);n?(n.onload=()=>{t(!0)},n.onerror=()=>{console.error(`Failed to load CSS file: custom.css`),t(!1)}):(console.error(`No custom.css file found`),t(!1))}),ni=$n(`<link rel="stylesheet"/>`),ri=$n(`<div><!> <!></div>`),ii={hash:`svelte-1n46o8q`,code:`.bubble-chat.svelte-1n46o8q {font-size:16px;visibility:hidden;opacity:0;}.bubble-chat.chatbot-ready.svelte-1n46o8q {visibility:visible;opacity:1;}`};function ai(e,t){Ue(t,!0),lr(e,ii);let n=`chatbot-style`,r=br(t,`assetsUrl`,19,()=>t.server?t.server.split(`?`)[0]:void 0),i=br(t,`linkHandling`,3,`default`),a=br(t,`chatStarted`,7,!1),o=br(t,`expandChatWindowAtStart`,3,null),s=N(!1),c=N(!1),l=N(F(Rr()));Qr(`ON_CHAT_WINDOW_STATE_CHANGE`,function(e){P(l,e,!0)});function u(){a(!0)}function d(){a(!1)}function f(e,t){let n=window.innerWidth,r=e==null||e===`all`||e===`desktop`&&n>=768||e===`mobile`&&n<768;(!t||$(l)!==!1)&&r&&Ur()}function p(){Wr()}function m(e){let t=window.innerWidth,n=window.location.hostname===new URL(e).hostname;t<768&&Wr(),i()===`new-tab`?window.open(e,`_blank`):i()===`existing-tab`||n?document.location.href=e:window.open(e,`_blank`)}function h(){P(c,!0)}ei(u,d,f,p,m),an(()=>{let e=window.innerWidth<768;if($(l)&&e){let e=window.scrollY,t=document.body.style.position,n=document.body.style.width,r=document.body.style.overflow,i=document.body.style.top;return document.body.style.position=`fixed`,document.body.style.width=`100%`,document.body.style.overflow=`hidden`,document.body.style.top=`-${e}px`,()=>{document.body.style.position=t,document.body.style.width=n,document.body.style.overflow=r,document.body.style.top=i,window.scrollTo(0,e)}}}),xr(async()=>{if(P(s,await ti(n),!0),o()&&$(l)!==!1){let e=window.innerWidth,t=o()===`all`,n=o()===`desktop`&&e>=768,r=o()===`mobile`&&e<768;(t||n||r)&&Ur()}});var g=ri();cr(`1n46o8q`,e=>{var t=ni();gr(t,`id`,n),dn(()=>gr(t,`href`,`${r()}/custom.css`)),tr(e,t)});var _=qt(g);kr(_,{get assetsUrl(){return r()},get open(){return $(l)},get onToggle(){return Gr}}),Er(Yt(_,2),{get server(){return t.server},get referrer(){return t.referrer},get open(){return $(l)},onLoad:h}),Pe(g),dn(()=>fr(g,1,`bubble-chat ${$(s)&&$(c)?`chatbot-ready`:``}`,`svelte-1n46o8q`)),tr(e,g),We()}var oi=e=>e.replace(/\/embed\/bundle\.js/,``),si=e=>e.dataset?.server,ci=e=>{if(e&&`src`in e&&typeof e.src==`string`)return si(e)||oi(e.src)},li=document.querySelector(`script#chatbot`),ui=ci(li),di=li?.getAttribute(`data-link-handling`)?li.getAttribute(`data-link-handling`):`default`,fi=li?.getAttribute(`data-expand-at-start`)?li.getAttribute(`data-expand-at-start`):null;window.chatbot=Br;var pi=()=>{console.log(`Chatbot is loading from`,ui),nr(ai,{target:document.body,props:{server:ui,referrer:window.location.href,linkHandling:di,expandChatWindowAtStart:fi}}),jr(!0)},mi=(e=0)=>{e>=3||document.readyState===`complete`?setTimeout(pi,500):setTimeout(()=>{mi(e+1)},500)};mi();var hi=document.getElementById(`chatbot`);hi&&`src`in hi&&typeof hi.src==`string`&&hi.src.indexOf(`caller=bookmarklet`)>0&&setTimeout(pi,500)})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botfabrik/engine-webclient",
3
- "version": "4.117.2",
3
+ "version": "4.118.1",
4
4
  "description": "Webclient for Botfabriks Bot Engine",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -31,9 +31,9 @@
31
31
  "dev:embed": "tsx --watch ./run-embed-local.ts"
32
32
  },
33
33
  "dependencies": {
34
- "@botfabrik/engine-domain": "^4.116.7",
35
- "@botfabrik/engine-transcript-export": "^4.117.2",
36
- "@botfabrik/engine-utils": "^4.116.7",
34
+ "@botfabrik/engine-domain": "^4.118.1",
35
+ "@botfabrik/engine-transcript-export": "^4.118.1",
36
+ "@botfabrik/engine-utils": "^4.118.1",
37
37
  "@google-cloud/speech": "^7.3.1",
38
38
  "@node-saml/passport-saml": "^5.1.0",
39
39
  "@types/cors": "^2.8.19",
@@ -53,7 +53,7 @@
53
53
  "@types/ua-parser-js": "^0.7.39",
54
54
  "supertest": "^7.2.2",
55
55
  "tsx": "^4.21.0",
56
- "typescript": "5.9.3"
56
+ "typescript": "6.0.3"
57
57
  },
58
- "gitHead": "3fbda9ea47316ae0462d0184e36f3a62565225bd"
58
+ "gitHead": "ce44ece243ae3f88f5a5b2a7d13f0badbea50d47"
59
59
  }