@botfabrik/engine-webclient 4.76.3 → 4.76.5
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.
package/dist/client/index.html
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<meta name="theme-color" content="#000000" />
|
|
8
8
|
<meta name="google" content="notranslate" />
|
|
9
9
|
<title>Bubble Chat Client</title>
|
|
10
|
-
<script type="module" crossorigin src="./assets/index-
|
|
10
|
+
<script type="module" crossorigin src="./assets/index-xFWBBdin.js"></script>
|
|
11
11
|
<link rel="stylesheet" crossorigin href="./assets/index-BuUa4rAN.css">
|
|
12
12
|
</head>
|
|
13
13
|
|
package/dist/embed/bundle.js
CHANGED
|
@@ -54,5 +54,5 @@ var pt=Object.defineProperty;var wt=(w,C,O)=>C in w?pt(w,C,{enumerable:!0,config
|
|
|
54
54
|
<br class="svelte-1705l81"/>
|
|
55
55
|
src="https://server.com/webclient/embed/bundle.js"> </script>
|
|
56
56
|
</code>
|
|
57
|
-
`,s(t,"class","svelte-1705l81"),s(o,"class","svelte-1705l81")},m(r,i){x(r,t,i),x(r,n,i),x(r,o,i)},p:w,d(r){r&&(y(t),y(n),y(o))}}}function Fe(e){let t,n,o,r,i,l,d,c,a,u,v,b,h,g,f,k,A,I,m=e[4]&&me(e);return{c(){t=_("div"),n=_("div"),o=_("img"),i=L(),l=_("div"),m&&m.c(),d=L(),c=_("div"),a=q("svg"),u=q("path"),h=L(),g=_("iframe"),T(o.src,r=`${e[3]}/logo.svg`)||s(o,"src",r),s(o,"alt","Logo"),s(o,"class","logo svelte-1705l81"),s(u,"d","M0,0L20,20M20,0L0,20"),s(u,"class","svelte-1705l81"),s(a,"viewBox","-2 -2 24 24"),s(a,"aria-label","Close window icon"),s(a,"class","svelte-1705l81"),s(c,"aria-label",v=e[5].header.closeChat),s(c,"data-title",b=e[5].header.closeChat),s(c,"role","button"),s(c,"class","bot-border-close-icon svelte-1705l81"),s(c,"tabindex",0),s(l,"class","header-icon-container svelte-1705l81"),s(n,"class","header svelte-1705l81"),s(g,"id","chat-frame"),s(g,"title","Chat"),s(g,"class","bot svelte-1705l81"),T(g.src,f=`${e[0]}${e[0].indexOf("?")===-1?"?":"&"}referrer=${encodeURIComponent(e[1]??"")}&windowHeight=${we()}&windowWidth=${pe()}`)||s(g,"src",f),s(g,"frameborder","0"),s(g,"allow","microphone"),g.allowFullscreen=!0,s(t,"class","bot-border svelte-1705l81"),s(t,"aria-hidden",k=e[2]?"false":"true"),fe(t,"closed",!e[2])},m(M,S){x(M,t,S),p(t,n),p(n,o),p(n,i),p(n,l),m&&m.m(l,null),p(l,d),p(l,c),p(c,a),p(a,u),p(t,h),p(t,g),A||(I=[U(c,"click",function(){z(e[6])&&e[6].apply(this,arguments)}),U(c,"keydown",e[9])],A=!0)},p(M,S){e=M,S&8&&!T(o.src,r=`${e[3]}/logo.svg`)&&s(o,"src",r),e[4]?m?m.p(e,S):(m=me(e),m.c(),m.m(l,d)):m&&(m.d(1),m=null),S&32&&v!==(v=e[5].header.closeChat)&&s(c,"aria-label",v),S&32&&b!==(b=e[5].header.closeChat)&&s(c,"data-title",b),S&3&&!T(g.src,f=`${e[0]}${e[0].indexOf("?")===-1?"?":"&"}referrer=${encodeURIComponent(e[1]??"")}&windowHeight=${we()}&windowWidth=${pe()}`)&&s(g,"src",f),S&4&&k!==(k=e[2]?"false":"true")&&s(t,"aria-hidden",k),S&4&&fe(t,"closed",!e[2])},d(M){M&&y(t),m&&m.d(),A=!1,E(I)}}}function me(e){let t,n,o,r,i,l,d;return{c(){t=_("div"),n=q("svg"),o=q("path"),s(o,"d","M230.64,25.36a32,32,0,0,0-45.26,0q-.21.21-.42.45L131.55,88.22,121,77.64a24,24,0,0,0-33.95,0l-76.69,76.7a8,8,0,0,0,0,11.31l80,80a8,8,0,0,0,11.31,0L178.36,169a24,24,0,0,0,0-33.95l-10.58-10.57L230.19,71c.15-.14.31-.28.45-.43A32,32,0,0,0,230.64,25.36ZM96,228.69,79.32,212l22.34-22.35a8,8,0,0,0-11.31-11.31L68,200.68,55.32,188l22.34-22.35a8,8,0,0,0-11.31-11.31L44,176.68,27.31,160,72,115.31,140.69,184ZM219.52,59.1l-68.71,58.81a8,8,0,0,0-.46,11.74L167,146.34a8,8,0,0,1,0,11.31l-15,15L83.32,104l15-15a8,8,0,0,1,11.31,0l16.69,16.69a8,8,0,0,0,11.74-.46L196.9,36.48A16,16,0,0,1,219.52,59.1Z"),s(o,"class","svelte-1705l81"),s(n,"viewBox","0 0 256 256"),s(n,"aria-label","Restart chat icon"),s(n,"class","svelte-1705l81"),s(t,"aria-label",r=e[5].header.restartChat),s(t,"data-title",i=e[5].header.restartChat),s(t,"role","button"),s(t,"class","bot-border-restart-icon svelte-1705l81"),s(t,"tabindex",0)},m(c,a){x(c,t,a),p(t,n),p(n,o),l||(d=[U(t,"click",function(){z(e[7])&&e[7].apply(this,arguments)}),U(t,"keydown",e[8])],l=!0)},p(c,a){e=c,a&32&&r!==(r=e[5].header.restartChat)&&s(t,"aria-label",r),a&32&&i!==(i=e[5].header.restartChat)&&s(t,"data-title",i)},d(c){c&&y(t),l=!1,E(d)}}}function Ke(e){let t;function n(i,l){return i[0]?Fe:Ge}let o=n(e),r=o(e);return{c(){r.c(),t=We()},m(i,l){r.m(i,l),x(i,t,l)},p(i,[l]){o===(o=n(i))&&r?r.p(i,l):(r.d(1),r=o(i),r&&(r.c(),r.m(t.parentNode,t)))},i:w,o:w,d(i){i&&y(t),r.d(i)}}}function pe(){try{return window.innerWidth}catch{return-1}}function we(){try{return window.innerHeight}catch{return-1}}function Ye(e,t,n){let{server:o}=t,{referrer:r}=t,{open:i}=t,{assetsUrl:l}=t,{chatStarted:d}=t,{translations:c}=t,{onToggle:a}=t,{onRestartChat:u}=t;function v(h){const g=h.key;(g==="ArrowDown"||g==="ArrowRight"||g==="Enter"||g===" "||g==="Space")&&(h.stopPropagation(),u())}function b(h){const g=h.key;(g==="ArrowDown"||g==="ArrowRight"||g==="Enter"||g===" "||g==="Space")&&(h.stopPropagation(),a())}return e.$$set=h=>{"server"in h&&n(0,o=h.server),"referrer"in h&&n(1,r=h.referrer),"open"in h&&n(2,i=h.open),"assetsUrl"in h&&n(3,l=h.assetsUrl),"chatStarted"in h&&n(4,d=h.chatStarted),"translations"in h&&n(5,c=h.translations),"onToggle"in h&&n(6,a=h.onToggle),"onRestartChat"in h&&n(7,u=h.onRestartChat)},[o,r,i,l,d,c,a,u,v,b]}class Ze extends ne{constructor(t){super(),te(this,t,Ye,Ke,K,{server:0,referrer:1,open:2,assetsUrl:3,chatStarted:4,translations:5,onToggle:6,onRestartChat:7},Be)}}function Ve(e){Y(e,"svelte-2hl2mw",`.svelte-2hl2mw,.svelte-2hl2mw:before,.svelte-2hl2mw:after{box-sizing:border-box}.chat-button-wrapper.svelte-2hl2mw{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}@media screen and (min-width: 768px){.chat-button-wrapper.svelte-2hl2mw{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)}}.chat-button.svelte-2hl2mw{display:block;height:100%;cursor:pointer;border-radius:50%;box-shadow:9px 9px 16px rgba(0, 0, 0, 0.25);transition:transform 100ms,
|
|
57
|
+
`,s(t,"class","svelte-1705l81"),s(o,"class","svelte-1705l81")},m(r,i){x(r,t,i),x(r,n,i),x(r,o,i)},p:w,d(r){r&&(y(t),y(n),y(o))}}}function Fe(e){let t,n,o,r,i,l,d,c,a,u,v,b,h,g,f,k,A,I,m=e[4]&&me(e);return{c(){t=_("div"),n=_("div"),o=_("img"),i=L(),l=_("div"),m&&m.c(),d=L(),c=_("div"),a=q("svg"),u=q("path"),h=L(),g=_("iframe"),T(o.src,r=`${e[3]}/logo.svg`)||s(o,"src",r),s(o,"alt","Logo"),s(o,"class","logo svelte-1705l81"),s(u,"d","M0,0L20,20M20,0L0,20"),s(u,"class","svelte-1705l81"),s(a,"viewBox","-2 -2 24 24"),s(a,"aria-label","Close window icon"),s(a,"class","svelte-1705l81"),s(c,"aria-label",v=e[5].header.closeChat),s(c,"data-title",b=e[5].header.closeChat),s(c,"role","button"),s(c,"class","bot-border-close-icon svelte-1705l81"),s(c,"tabindex",0),s(l,"class","header-icon-container svelte-1705l81"),s(n,"class","header svelte-1705l81"),s(g,"id","chat-frame"),s(g,"title","Chat"),s(g,"class","bot svelte-1705l81"),T(g.src,f=`${e[0]}${e[0].indexOf("?")===-1?"?":"&"}referrer=${encodeURIComponent(e[1]??"")}&windowHeight=${we()}&windowWidth=${pe()}`)||s(g,"src",f),s(g,"frameborder","0"),s(g,"allow","microphone; clipboard-write"),g.allowFullscreen=!0,s(t,"class","bot-border svelte-1705l81"),s(t,"aria-hidden",k=e[2]?"false":"true"),fe(t,"closed",!e[2])},m(M,S){x(M,t,S),p(t,n),p(n,o),p(n,i),p(n,l),m&&m.m(l,null),p(l,d),p(l,c),p(c,a),p(a,u),p(t,h),p(t,g),A||(I=[U(c,"click",function(){z(e[6])&&e[6].apply(this,arguments)}),U(c,"keydown",e[9])],A=!0)},p(M,S){e=M,S&8&&!T(o.src,r=`${e[3]}/logo.svg`)&&s(o,"src",r),e[4]?m?m.p(e,S):(m=me(e),m.c(),m.m(l,d)):m&&(m.d(1),m=null),S&32&&v!==(v=e[5].header.closeChat)&&s(c,"aria-label",v),S&32&&b!==(b=e[5].header.closeChat)&&s(c,"data-title",b),S&3&&!T(g.src,f=`${e[0]}${e[0].indexOf("?")===-1?"?":"&"}referrer=${encodeURIComponent(e[1]??"")}&windowHeight=${we()}&windowWidth=${pe()}`)&&s(g,"src",f),S&4&&k!==(k=e[2]?"false":"true")&&s(t,"aria-hidden",k),S&4&&fe(t,"closed",!e[2])},d(M){M&&y(t),m&&m.d(),A=!1,E(I)}}}function me(e){let t,n,o,r,i,l,d;return{c(){t=_("div"),n=q("svg"),o=q("path"),s(o,"d","M230.64,25.36a32,32,0,0,0-45.26,0q-.21.21-.42.45L131.55,88.22,121,77.64a24,24,0,0,0-33.95,0l-76.69,76.7a8,8,0,0,0,0,11.31l80,80a8,8,0,0,0,11.31,0L178.36,169a24,24,0,0,0,0-33.95l-10.58-10.57L230.19,71c.15-.14.31-.28.45-.43A32,32,0,0,0,230.64,25.36ZM96,228.69,79.32,212l22.34-22.35a8,8,0,0,0-11.31-11.31L68,200.68,55.32,188l22.34-22.35a8,8,0,0,0-11.31-11.31L44,176.68,27.31,160,72,115.31,140.69,184ZM219.52,59.1l-68.71,58.81a8,8,0,0,0-.46,11.74L167,146.34a8,8,0,0,1,0,11.31l-15,15L83.32,104l15-15a8,8,0,0,1,11.31,0l16.69,16.69a8,8,0,0,0,11.74-.46L196.9,36.48A16,16,0,0,1,219.52,59.1Z"),s(o,"class","svelte-1705l81"),s(n,"viewBox","0 0 256 256"),s(n,"aria-label","Restart chat icon"),s(n,"class","svelte-1705l81"),s(t,"aria-label",r=e[5].header.restartChat),s(t,"data-title",i=e[5].header.restartChat),s(t,"role","button"),s(t,"class","bot-border-restart-icon svelte-1705l81"),s(t,"tabindex",0)},m(c,a){x(c,t,a),p(t,n),p(n,o),l||(d=[U(t,"click",function(){z(e[7])&&e[7].apply(this,arguments)}),U(t,"keydown",e[8])],l=!0)},p(c,a){e=c,a&32&&r!==(r=e[5].header.restartChat)&&s(t,"aria-label",r),a&32&&i!==(i=e[5].header.restartChat)&&s(t,"data-title",i)},d(c){c&&y(t),l=!1,E(d)}}}function Ke(e){let t;function n(i,l){return i[0]?Fe:Ge}let o=n(e),r=o(e);return{c(){r.c(),t=We()},m(i,l){r.m(i,l),x(i,t,l)},p(i,[l]){o===(o=n(i))&&r?r.p(i,l):(r.d(1),r=o(i),r&&(r.c(),r.m(t.parentNode,t)))},i:w,o:w,d(i){i&&y(t),r.d(i)}}}function pe(){try{return window.innerWidth}catch{return-1}}function we(){try{return window.innerHeight}catch{return-1}}function Ye(e,t,n){let{server:o}=t,{referrer:r}=t,{open:i}=t,{assetsUrl:l}=t,{chatStarted:d}=t,{translations:c}=t,{onToggle:a}=t,{onRestartChat:u}=t;function v(h){const g=h.key;(g==="ArrowDown"||g==="ArrowRight"||g==="Enter"||g===" "||g==="Space")&&(h.stopPropagation(),u())}function b(h){const g=h.key;(g==="ArrowDown"||g==="ArrowRight"||g==="Enter"||g===" "||g==="Space")&&(h.stopPropagation(),a())}return e.$$set=h=>{"server"in h&&n(0,o=h.server),"referrer"in h&&n(1,r=h.referrer),"open"in h&&n(2,i=h.open),"assetsUrl"in h&&n(3,l=h.assetsUrl),"chatStarted"in h&&n(4,d=h.chatStarted),"translations"in h&&n(5,c=h.translations),"onToggle"in h&&n(6,a=h.onToggle),"onRestartChat"in h&&n(7,u=h.onRestartChat)},[o,r,i,l,d,c,a,u,v,b]}class Ze extends ne{constructor(t){super(),te(this,t,Ye,Ke,K,{server:0,referrer:1,open:2,assetsUrl:3,chatStarted:4,translations:5,onToggle:6,onRestartChat:7},Be)}}function Ve(e){Y(e,"svelte-2hl2mw",`.svelte-2hl2mw,.svelte-2hl2mw:before,.svelte-2hl2mw:after{box-sizing:border-box}.chat-button-wrapper.svelte-2hl2mw{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}@media screen and (min-width: 768px){.chat-button-wrapper.svelte-2hl2mw{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)}}.chat-button.svelte-2hl2mw{display:block;height:100%;cursor:pointer;border-radius:50%;box-shadow:9px 9px 16px rgba(0, 0, 0, 0.25);transition:transform 100ms,
|
|
58
58
|
box-shadow 100ms}.chat-button.svelte-2hl2mw:hover{box-shadow:16px 16px 16px rgba(0, 0, 0, 0.2);transform:translateY(-2px)}`)}function Je(e){let t,n,o,r,i,l;return{c(){t=_("div"),n=_("img"),s(n,"class","chat-button svelte-2hl2mw"),s(n,"alt","Open chat window"),T(n.src,o=`${e[0]}/fab.svg`)||s(n,"src",o),s(t,"class","chat-button-wrapper svelte-2hl2mw"),s(t,"tabindex","0"),s(t,"role","button"),s(t,"aria-label","Open chat window"),s(t,"aria-expanded",r=e[2]?"true":"false")},m(d,c){x(d,t,c),p(t,n),i||(l=[U(t,"click",function(){z(e[1])&&e[1].apply(this,arguments)}),U(t,"keydown",e[3])],i=!0)},p(d,[c]){e=d,c&1&&!T(n.src,o=`${e[0]}/fab.svg`)&&s(n,"src",o),c&4&&r!==(r=e[2]?"true":"false")&&s(t,"aria-expanded",r)},i:w,o:w,d(d){d&&y(t),i=!1,E(l)}}}function Qe(e,t,n){let{assetsUrl:o}=t,{onToggle:r}=t,{open:i}=t;function l(d){const c=d.key;(c==="ArrowDown"||c==="ArrowRight"||c==="Enter"||c===" "||c==="Space")&&(d.stopPropagation(),r())}return e.$$set=d=>{"assetsUrl"in d&&n(0,o=d.assetsUrl),"onToggle"in d&&n(1,r=d.onToggle),"open"in d&&n(2,i=d.open)},[o,r,i,l]}class Xe extends ne{constructor(t){super(),te(this,t,Qe,Je,K,{assetsUrl:0,onToggle:1,open:2},Ve)}}/*! js-cookie v3.0.5 | MIT */function G(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)e[o]=n[o]}return e}var $e={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 re(e,t){function n(r,i,l){if(!(typeof document>"u")){l=G({},t,l),typeof l.expires=="number"&&(l.expires=new Date(Date.now()+l.expires*864e5)),l.expires&&(l.expires=l.expires.toUTCString()),r=encodeURIComponent(r).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var d="";for(var c in l)l[c]&&(d+="; "+c,l[c]!==!0&&(d+="="+l[c].split(";")[0]));return document.cookie=r+"="+e.write(i,r)+d}}function o(r){if(!(typeof document>"u"||arguments.length&&!r)){for(var i=document.cookie?document.cookie.split("; "):[],l={},d=0;d<i.length;d++){var c=i[d].split("="),a=c.slice(1).join("=");try{var u=decodeURIComponent(c[0]);if(l[u]=e.read(a,u),r===u)break}catch{}}return r?l[r]:l}}return Object.create({set:n,get:o,remove:function(r,i){n(r,"",G({},i,{expires:-1}))},withAttributes:function(r){return re(this.converter,G({},this.attributes,r))},withConverter:function(r){return re(G({},this.converter,r),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var _e=re($e,{path:"/"});const ye="bot-window",ke=()=>{switch(_e.get(ye)){case"open":return!0;case"closed":return!1;default:return!1}},Ce=e=>{_e.set(ye,e)};let xe=!1;function et(e){xe=e}function tt(){return xe}const oe=[];let P=ke();function ie(){P=!0,Ce("open"),oe.forEach(function(e){e.call(window,P)})}function le(){P=!1,Ce("closed"),oe.forEach(function(e){e.call(window,P)})}function ae(){P?le():ie()}function Se(){se({type:"RESTART_CHAT"})}function nt(e){se({type:"CHAT_MESSAGE_FROM_GUEST",text:e})}function rt(e){se({type:"TRIGGER_STORY",story:e})}function se(e){var n;const t=document.getElementById("chat-frame");(n=t==null?void 0:t.contentWindow)==null||n.postMessage(e,"*")}function Oe(e,t){switch(e){case"ON_CHAT_WINDOW_STATE_CHANGE":oe.push(t);break;default:throw new Error("Unsupported event "+e)}}const ot=Object.freeze(Object.defineProperty({__proto__:null,closeChatWindow:le,enterGuestMessage:nt,isChatbotLoaded:tt,openChatWindow:ie,restartChat:Se,subscribe:Oe,toggleChatWindow:ae,triggerStory:rt},Symbol.toStringTag,{value:"Module"}));function it(){return navigator.userAgent.match(/(iPad|iPhone|iPod)/g)}const lt=()=>{it()&&document.querySelectorAll("html, body").forEach(e=>{e.classList.add("iOS-device")})},at=e=>{"gtag"in window&&typeof window.gtag=="function"?window.gtag("event","",e):"dataLayer"in window&&Array.isArray(window.dataLayer)&&window.dataLayer.push(e)},st=(e,t,n,o,r)=>{window.addEventListener("message",i=>{const l=i.data;switch(l.type){case"webclient.chat.started":e();break;case"webclient.chat.ended":t();break;case"webclient.expand.window":n(l.devices);break;case"webclient.change.url":o(l.url);break;case"webclient.change.translations":r(l.payload.translations);break;case"google.tag.event":at(l.payload);break}},!1)},{document:ct}=Ue;function dt(e){Y(e,"svelte-1vmieip",".bubble-chat.svelte-1vmieip{font-size:16px}")}function ft(e){let t,n,o,r,i,l,d,c;return i=new Xe({props:{assetsUrl:e[4],open:e[5],onToggle:ae}}),d=new Ze({props:{server:e[2],referrer:e[3],assetsUrl:e[4],open:e[5],chatStarted:e[0],translations:e[1],onToggle:ae,onRestartChat:Se}}),{c(){t=_("link"),o=L(),r=_("div"),be(i.$$.fragment),l=L(),be(d.$$.fragment),s(t,"rel","stylesheet"),s(t,"href",n=`${e[4]}/custom.css`),s(r,"class","bubble-chat svelte-1vmieip")},m(a,u){p(ct.head,t),x(a,o,u),x(a,r,u),$(i,r,null),p(r,l),$(d,r,null),c=!0},p(a,[u]){(!c||u&16&&n!==(n=`${a[4]}/custom.css`))&&s(t,"href",n);const v={};u&16&&(v.assetsUrl=a[4]),u&32&&(v.open=a[5]),i.$set(v);const b={};u&4&&(b.server=a[2]),u&8&&(b.referrer=a[3]),u&16&&(b.assetsUrl=a[4]),u&32&&(b.open=a[5]),u&1&&(b.chatStarted=a[0]),u&2&&(b.translations=a[1]),d.$set(b)},i(a){c||(X(i.$$.fragment,a),X(d.$$.fragment,a),c=!0)},o(a){ve(i.$$.fragment,a),ve(d.$$.fragment,a),c=!1},d(a){a&&(y(o),y(r)),y(t),ee(i),ee(d)}}}function ut(e,t,n){let{server:o}=t,{referrer:r}=t,{assetsUrl:i=o?o.split("?")[0]:void 0}=t,{linkHandling:l="default"}=t,{chatStarted:d=!1}=t,{translations:c={header:{restartChat:"Restart chat",closeChat:"Minimize chat"}}}=t;lt();let a=ke();Oe("ON_CHAT_WINDOW_STATE_CHANGE",function(k){n(5,a=k)});function u(){n(0,d=!0)}function v(){n(0,d=!1)}function b(f){const k=window.innerWidth,A=f==null||f==="all",I=f==="desktop"&&k>=768,m=f==="mobile"&&k<768;(A||I||m)&&ie()}function h(f){const k=window.innerWidth,A=window.location.hostname,I=new URL(f).hostname,m=A===I;k<768&&le(),l==="new-tab"?window.open(f,"_blank"):l==="existing-tab"||m?document.location.href=f:window.open(f,"_blank")}function g(f){n(1,c=f)}return st(u,v,b,h,g),e.$$set=f=>{"server"in f&&n(2,o=f.server),"referrer"in f&&n(3,r=f.referrer),"assetsUrl"in f&&n(4,i=f.assetsUrl),"linkHandling"in f&&n(6,l=f.linkHandling),"chatStarted"in f&&n(0,d=f.chatStarted),"translations"in f&&n(1,c=f.translations)},[d,c,o,r,i,a,l]}class ht extends ne{constructor(t){super(),te(this,t,ut,ft,K,{server:2,referrer:3,assetsUrl:4,linkHandling:6,chatStarted:0,translations:1},dt)}}const gt=e=>e.replace(/\/embed\/bundle\.js/,""),vt=e=>{var t;return(t=e.dataset)==null?void 0:t.server},bt=e=>{if(e&&"src"in e&&typeof e.src=="string")return vt(e)||gt(e.src)},j=document.querySelector("script#chatbot"),Ee=bt(j),mt=j!=null&&j.getAttribute("link-handling")?j.getAttribute("link-handling"):"default";window.chatbot=ot;const Ae=()=>{console.log("Chatbot is loading from",Ee),new ht({target:document.body,props:{server:Ee,referrer:window.location.href,linkHandling:mt}}),et(!0)},Te=(e=0)=>{e>=3||document.readyState==="complete"?setTimeout(Ae,1e3):setTimeout(()=>{Te(e+1)},1e3)};Te();var F=document.getElementById("chatbot");F&&"src"in F&&typeof F.src=="string"&&F.src.indexOf("caller=bookmarklet")>0&&setTimeout(Ae,500)})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@botfabrik/engine-webclient",
|
|
3
|
-
"version": "4.76.
|
|
3
|
+
"version": "4.76.5",
|
|
4
4
|
"description": "Webclient for Botfabriks Bot Engine",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"tsx": "^4.19.2",
|
|
41
41
|
"typescript": "5.1.6"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "60a4f0c2967cbb1962d74bc9a36aa92e6c703d43"
|
|
44
44
|
}
|