@molin.ai/shop-ai 0.5.8 → 0.5.11

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.
@@ -1042,7 +1042,7 @@ CHAT`}</span>
1042
1042
  </div>
1043
1043
 
1044
1044
  <!-- desktop -->
1045
- <div class="max-sm:hidden ${i} ${this.positionClasses} fixed transition-[opacity,translate,visibility]">
1045
+ <div class="max-sm:hidden ${i} ${this.positionClasses} z-[2147483647] fixed transition-[opacity,translate,visibility]">
1046
1046
  <mw-popup-desktop text="${r.desktop.text}" @mw:click="${we(this,Pl,vd)}" @mw:close="${we(this,Sl,yd)}"></mw-popup-desktop>
1047
1047
  </div>
1048
1048
  `}hide(){Xt(this,ln).hide()}};ln=new WeakMap,bd=new WeakMap,Sl=new WeakSet,yd=function(){Xt(this,ln).onCloseClick()},Pl=new WeakSet,vd=function(){this.dispatchEvent(new Fc.ClickEvent),Xt(this,ln).onContentClick()},Jt(Fc,"properties",{positionClasses:{type:String,attribute:"position"},delayMs:{type:Number,attribute:"delay"},soundUrl:{type:String,attribute:"sound"},content:{type:Object}});var Yo=Fc,gd;Yo.ClickEvent=(gd=class extends CustomEvent{constructor(e={}){super(Yo.ClickEvent.type,{...e})}},Jt(gd,"type","mw:click"),gd);var YS="https://molin.ai/?utm_source=molin-shop-ai&utm_medium=widget&utm_campaign=poweredby",wl=class extends hi(Xe){constructor(){super(...arguments);Jt(this,"render",()=>Te`
@@ -1099,7 +1099,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1099
1099
  <mw-bubble state="${this.state}" src="${dv(this.config?.bubble?.imageUrl)}"></mw-bubble>
1100
1100
  `:Ue}};ff=new WeakMap,Jt(cf,"properties",{cdn:{type:String},widgetId:{type:String,attribute:"widget"},state:{type:String}});customElements.define("molin-shop-ai-launcher",cf);var df,sh,ah,so,Wl,Ul,uf=class{constructor(e,i,r,s=window.history){Qt(this,df,void 0);Qt(this,sh,void 0);Qt(this,ah,void 0);Qt(this,so,void 0);Qt(this,Wl,!1);Qt(this,Ul,()=>{Xt(this,sh).test(window.location.pathname)&&Xt(this,ah).navigated()});Ie(this,df,e),Ie(this,sh,i),Ie(this,ah,r),Ie(this,so,s),e.addController(this)}hostConnected(){window.addEventListener("pageshow",Xt(this,Ul));let e=Xt(this,so).pushState;Xt(this,so).pushState=(...i)=>{if(e.call(Xt(this,so),...i),!Xt(this,Wl))try{let r=new URL(i[2],window.location.origin);Xt(this,sh).test(r.pathname)&&Xt(this,ah).navigated()}catch{}}}hostDisconnected(){window.removeEventListener("pageshow",Xt(this,Ul)),Ie(this,Wl,!0)}};df=new WeakMap,sh=new WeakMap,ah=new WeakMap,so=new WeakMap,Wl=new WeakMap,Ul=new WeakMap;function mf(t,e=""){return Object.entries(t).filter(([i,r])=>r).map(([i,r])=>`${e}${i}-[${r}]`).join(" ")}var yf,om,gr,vf,bf,mv,_f,gv,xf,yv,Sf,vv,Pf,bv,gf=class extends hi(Xe){constructor(){super();Qt(this,bf);Qt(this,_f);Qt(this,xf);Qt(this,Sf);Qt(this,Pf);Qt(this,yf,new cn(this,{onError:console.error}));Qt(this,om,new uf(this,/checkout|order|thank-you|thank_you/i,{navigated:()=>{let i=Xt(this,_f,gv);i&&hr("ShopAssistant: user visited checkout page",{widgetId:this.widgetId,conversationId:i.conversationId,hasSentMessage:i.messages.length>0})}}));Qt(this,gr,!1);Qt(this,vf,{onError:i=>{alert(i.error),console.error(i.widgetId,i.error),hr("ShopAssistant: error",i)},onNewMessageStartedStreaming:i=>hr("ShopAssistant: user received bot message (streaming started)",i),onMessageEndedStreaming:i=>hr("ShopAssistant: user received bot message (streaming ended)",i),onUserCanceledStreaming:i=>hr("ShopAssistant: user canceled streaming",i),onUserClickedLink:i=>hr("ShopAssistant: user clicked link",i),onUserSentInput:i=>hr("ShopAssistant: user sent input",i)});this.cdn="https://widget.molin.ai",this.widgetId=""}get config(){return Xt(this,yf).data}render(){if(!this.config)return Ue;let i=[mf(this.config.bubble.position),mf(this.config.bubble.mobilePosition||{},"max-sm:")].join(" "),r=mf(this.config.bubble.position),s={bottom:"72px"},a=Object.entries(this.config.bubble.position).filter(([l,o])=>o).map(([l,o])=>`sm:${l}-[calc(${[s[l],o].filter(u=>!!u).join("+")})]`).join(" "),n=a;return this.config.hidden&&!this.config.kioskMode?Ue:Te`
1101
1101
  ${this.config.kioskMode?Ue:Te`
1102
- <mw-bubble class="${i} fixed z-[2147483647]" @click=${we(this,Sf,vv)} state="${Xt(this,gr)?"close":"open"}" src="https://widget.molin.ai/bubble/?w=${this.widgetId}"></mw-bubble>
1102
+ <mw-bubble class="${i} fixed z-[2147483647]" @click=${we(this,Sf,vv)} state="${Xt(this,gr)?"close":"open"}" src="${this.config.bubble?.imageUrl||""}"></mw-bubble>
1103
1103
 
1104
1104
  <!-- only load the component if enabled on any platform-->
1105
1105
  ${this.config?.popup?.mobileEnabled||this.config?.popup?.desktopEnabled?Te`<mw-popup
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@molin.ai/shop-ai",
3
- "version": "0.5.8",
3
+ "version": "0.5.11",
4
4
  "description": "Molin Shop AI",
5
5
  "keywords": [
6
6
  "molin",
@@ -28,9 +28,6 @@
28
28
  "publish:latest": "npm publish --access public --tag latest",
29
29
  "publish:beta": "npm publish --access public --tag beta"
30
30
  },
31
- "dependencies": {
32
- "posthog-js": "^1.114.2"
33
- },
34
31
  "files": [
35
32
  "/dist/molin-shop-ai.min.js"
36
33
  ]