UNPKG

@letscooee/web-sdk

Version:

Engage uniquely and boost conversions with AI-powered customer journeys driven by real-time intent

2 lines (1 loc) 4 kB
import{a as C,b}from"./chunk-QNDF6L35.js";import{e as g,f as h,i as u,l as f}from"./chunk-4NGRJOC7.js";import{Ba as l,Qa as c,X as m,pa as n,qa as i,ra as r,v as s}from"./chunk-K77Q3IPF.js";import"./chunk-V7UGKYBN.js";var _=class d{dialogRef=s(u);eventData=s(h);triggerData=s(g)().triggerData;onShareAndClose(p,o){p.stopPropagation();let{url:t,text:a}=b(this.triggerData,this.eventData.video,o!=="Clipboard");switch(o){case"Whatsapp":window.open(`https://wa.me/?text=${a}%20${t}`,"_blank","noopener,noreferrer");break;case"X(Twitter)":window.open(`https://x.com/intent/post?text=${a}&url=${t}`,"_blank","noopener,noreferrer");break;case"Clipboard":navigator.clipboard.writeText(t).catch(()=>{let e=document.createElement("textarea");e.value=t,document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e)});break;default:}o&&C(this.triggerData,this.eventData.video,this.eventData.index,o),this.dialogRef.close()}static \u0275fac=function(o){return new(o||d)};static \u0275cmp=m({type:d,selectors:[["cooee-share-dialog"]],decls:19,vars:0,consts:[[1,"share-dialog"],[1,"share-dialog-header"],["type","button","aria-label","Close",1,"close-button",3,"click"],["name","close","aria-hidden","true"],[1,"share-options"],["type","button","aria-label","Share on WhatsApp",1,"share-option",3,"click"],["name","whatsapp","aria-hidden","true"],["type","button","aria-label","Share on X",1,"share-option",3,"click"],["name","x-twitter","aria-hidden","true"],["type","button","aria-label","Copy link",1,"share-option",3,"click"],["name","copy","aria-hidden","true"]],template:function(o,t){o&1&&(n(0,"div",0)(1,"div",1)(2,"h3"),c(3,"Share"),i(),n(4,"button",2),l("click",function(e){return t.onShareAndClose(e)}),r(5,"cooee-icon",3),i()(),n(6,"div",4)(7,"button",5),l("click",function(e){return t.onShareAndClose(e,"Whatsapp")}),r(8,"cooee-icon",6),n(9,"span"),c(10,"Whatsapp"),i()(),n(11,"button",7),l("click",function(e){return t.onShareAndClose(e,"X(Twitter)")}),r(12,"cooee-icon",8),n(13,"span"),c(14,"X"),i()(),n(15,"button",9),l("click",function(e){return t.onShareAndClose(e,"Clipboard")}),r(16,"cooee-icon",10),n(17,"span"),c(18,"Copy link"),i()()()())},dependencies:[f],styles:["@keyframes _ngcontent-%COMP%_slideInScale{0%{opacity:0;transform:scale(.9) translateY(8px)}to{opacity:1;transform:scale(1) translateY(0)}}.share-dialog[_ngcontent-%COMP%]{background:#fff;border-radius:12px;padding:20px;min-width:280px;box-shadow:0 8px 32px #00000026;color:#333;animation:_ngcontent-%COMP%_slideInScale .25s ease-out}.share-dialog-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px}.share-dialog-header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font-family:var(--lc-heading-family),serif;margin:0;font-size:18px;font-weight:600}.share-options[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px;font-family:var(--lc-text-family),serif}.share-option[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px;padding:12px 16px;background:#0002;border:1px solid #e9ecef;border-radius:8px;color:#333;font-size:16px;font-weight:500;cursor:pointer;transition:all .2s ease}.share-option[_ngcontent-%COMP%]:hover{background:#0004;border-color:#dee2e6;transform:translateY(-1px)}.share-option[_ngcontent-%COMP%]:active{transform:translateY(0)}.share-option[_ngcontent-%COMP%] cooee-icon[_ngcontent-%COMP%]{width:24px;height:24px}.share-option[_ngcontent-%COMP%] cooee-icon[name=whatsapp][_ngcontent-%COMP%]{color:#25d366}.share-option[_ngcontent-%COMP%] cooee-icon[name=x-twitter][_ngcontent-%COMP%], .share-option[_ngcontent-%COMP%] cooee-icon[name=copy][_ngcontent-%COMP%]{color:#000}.share-option[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{flex:1;text-align:left}button.close-button[_ngcontent-%COMP%]{background-color:transparent;border:none}button.close-button[_ngcontent-%COMP%] cooee-icon[name=close][_ngcontent-%COMP%]{border-radius:100%;color:#000}"]})};export{_ as ShareDialogComponent};