import{b as s}from"./p-da187899.js";import{L as t,a as i}from"./p-ab217a42.js";import{k as e}from"./p-28b0e0a8.js";class a extends t{async connect(s){super.connect(s),await this.loadLib(),this.PointerListenerLib&&(this.pointerListener=new this.PointerListenerLib(s,{DEBUG:!0}),this.pointerListener.on("swipeleft",(()=>this.notify({left:!0,right:!1}))),this.pointerListener.on("swiperight",(()=>this.notify({left:!1,right:!0}))))}disconnect(){var s;super.disconnect(),null===(s=this.pointerListener)||void 0===s||s.destroy()}async loadLib(){return new Promise(((s,t)=>{e((async()=>{import("./p-11f970ba.js").then((t=>{this.PointerListenerLib=t.PointerListener,s()})).catch(t)}))}))}}class r extends i{constructor(s={mobileOnly:!1}){super(((s,t)=>{t&&s.swipeListener(t)})),this.options=s,this.listener=new a}attach(t){(!0===this.options.mobileOnly&&s.isMobile||!0!==this.options.mobileOnly)&&(super.attach(t),this.listener.connect(t.el),this.listener.add((s=>super.notify(s))))}detach(){super.detach(),this.listener.disconnect()}}export{r as B}