@letscooee/web-sdk 13.1.2 → 13.1.3

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.
@@ -1,4 +1,4 @@
1
- import{A as Bi,B as Hi,a as vi,b as yi,d as rt,e as ut,f as ie,g as Ci,h as se,i as xi,j as _i,k as bi,l as wi,m as Qe,n as Vi,o as Si,p as Ii,q as Mi,t as ki,u as Fi,v as At,x as Di,y as Li,z as Ni}from"./chunk-TER5PVFC.js";import{c as W,d as hi,g as ft,i as Ti,j as Ei,k as gt,l as Pi,m as Ai,n as Ri,q as Oi}from"./chunk-4P2RSDKV.js";import{a as ht}from"./chunk-HJ2OFJSU.js";import{a as Ge}from"./chunk-T6RU7RSX.js";import{$ as z,$a as te,A as Kt,Aa as ve,B as Jt,Ba as j,Da as y,E as fe,F as Yt,Ga as Ue,Ha as ze,I as Xt,Ia as qe,K as ce,L as He,La as de,Ma as nt,N as ei,O as V,P as ti,Pa as di,Q as ii,Qa as Z,Ra as ot,S as Ft,Sa as we,Wa as Re,X as U,Xa as ye,Ya as q,Z as ni,_ as oi,aa as ri,ab as We,b as zt,bb as pi,cb as Ce,da as ai,db as Ve,e as qt,eb as mi,fa as si,gb as ui,ha as it,ia as N,ib as fi,ja as B,k as Wt,kb as Dt,la as mt,ma as ge,na as he,oa as H,p as Zt,pa as M,qa as P,ra as ne,s as Qt,sa as je,sb as Ze,ta as $e,ua as Se,v as le,va as li,wa as ci,x as A,xb as gi,y as R,z as Gt,za as J}from"./chunk-K77Q3IPF.js";import{a as be,b as Ut,e as Gi,f as Ki}from"./chunk-V7UGKYBN.js";var zi=Gi((vt,Ui)=>{"use strict";(function(n,e){typeof vt=="object"&&typeof Ui<"u"?e(vt):typeof define=="function"&&define.amd?define(["exports"],e):e((n=typeof globalThis<"u"?globalThis:n||self).Sqrl={})})(vt,function(n){"use strict";function e(s){var l,d,m=new Error(s);return l=m,d=e.prototype,Object.setPrototypeOf?Object.setPrototypeOf(l,d):l.__proto__=d,m}function t(s,l,d){var m=l.slice(0,d).split(/\n/),r=m.length,i=m[r-1].length+1;throw e(s+=" at line "+r+" col "+i+`:
1
+ import{A as Bi,B as Hi,a as vi,b as yi,d as rt,e as ut,f as ie,g as Ci,h as se,i as xi,j as _i,k as bi,l as wi,m as Qe,n as Vi,o as Si,p as Ii,q as Mi,t as ki,u as Fi,v as At,x as Di,y as Li,z as Ni}from"./chunk-OAZIKL6G.js";import{c as W,d as hi,g as ft,i as Ti,j as Ei,k as gt,l as Pi,m as Ai,n as Ri,q as Oi}from"./chunk-UGPL2NMF.js";import{a as ht}from"./chunk-HJ2OFJSU.js";import{a as Ge}from"./chunk-T6RU7RSX.js";import{$ as z,$a as te,A as Kt,Aa as ve,B as Jt,Ba as j,Da as y,E as fe,F as Yt,Ga as Ue,Ha as ze,I as Xt,Ia as qe,K as ce,L as He,La as de,Ma as nt,N as ei,O as V,P as ti,Pa as di,Q as ii,Qa as Z,Ra as ot,S as Ft,Sa as we,Wa as Re,X as U,Xa as ye,Ya as q,Z as ni,_ as oi,aa as ri,ab as We,b as zt,bb as pi,cb as Ce,da as ai,db as Ve,e as qt,eb as mi,fa as si,gb as ui,ha as it,ia as N,ib as fi,ja as B,k as Wt,kb as Dt,la as mt,ma as ge,na as he,oa as H,p as Zt,pa as M,qa as P,ra as ne,s as Qt,sa as je,sb as Ze,ta as $e,ua as Se,v as le,va as li,wa as ci,x as A,xb as gi,y as R,z as Gt,za as J}from"./chunk-K77Q3IPF.js";import{a as be,b as Ut,e as Gi,f as Ki}from"./chunk-V7UGKYBN.js";var zi=Gi((vt,Ui)=>{"use strict";(function(n,e){typeof vt=="object"&&typeof Ui<"u"?e(vt):typeof define=="function"&&define.amd?define(["exports"],e):e((n=typeof globalThis<"u"?globalThis:n||self).Sqrl={})})(vt,function(n){"use strict";function e(s){var l,d,m=new Error(s);return l=m,d=e.prototype,Object.setPrototypeOf?Object.setPrototypeOf(l,d):l.__proto__=d,m}function t(s,l,d){var m=l.slice(0,d).split(/\n/),r=m.length,i=m[r-1].length+1;throw e(s+=" at line "+r+" col "+i+`:
2
2
 
3
3
  `+l.split(/\n/)[r-1]+`
4
4
  `+Array(i).join(" ")+"^")}e.prototype=Object.create(Error.prototype,{name:{value:"Squirrelly Error",enumerable:!1}});var o=new Function("return this")().Promise,a=!1;try{a=new Function("return (async function(){}).constructor")()}catch(s){if(!(s instanceof SyntaxError))throw s}function c(s,l){return Object.prototype.hasOwnProperty.call(s,l)}function u(s,l,d){for(var m in l)c(l,m)&&(l[m]==null||typeof l[m]!="object"||m!=="storage"&&m!=="prefixes"||d?s[m]=l[m]:s[m]=u({},l[m]));return s}var f=/^async +/,b=/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})*}|(?!\${)[^\\`])*`/g,D=/'(?:\\[\s\w"'\\`]|[^\n\r'\\])*?'/g,Y=/"(?:\\[\s\w"'\\`]|[^\n\r"\\])*?"/g,Te=/[.*+\-?^${}()|[\]\\]/g;function Ee(s){return Te.test(s)?s.replace(Te,"\\$&"):s}function at(s,l){l.rmWhitespace&&(s=s.replace(/[\r\n]+/g,`
@@ -13,7 +13,7 @@ import{A as Bi,B as Hi,a as vi,b as yi,d as rt,e as ut,f as ie,g as Ci,h as se,i
13
13
  `],encapsulation:3})};var bt=class n extends se{item;data=le(Ei);dialogRef=le(Ti);ItemDetailLayout=Si;constructor(){super(),this.triggerContext=this.data.triggerContext,this.item=this.data.item}close(){this.dialogRef.close()}engagementTriggerReceived(e){}update(){}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["cooee-item-quick-view"]],features:[te(ie()),z],decls:1,vars:2,consts:[[3,"closeClick","item","layout"]],template:function(t,o){t&1&&(M(0,"cooee-item-detail",0),j("closeClick",function(){return o.close()}),P()),t&2&&H("item",o.item)("layout",o.ItemDetailLayout.TWO_PANE)},dependencies:[Di],styles:[`:host{display:flex;align-items:center;justify-content:center;height:100%}@media (min-width: 768px){cooee-item-detail{max-width:900px;max-height:80vh;border-radius:var(--lc-card-radius)}}
14
14
  `],encapsulation:3})};var wt=class n{dialog=le(gt);dialogRef;constructor(){}showItemQuickView(e,t){this.dialogRef=this.dialog.open(bt,{width:"100vw",height:"100dvh",backdropClass:["letscooee-backdrop"],data:{item:t,triggerContext:e}})}static \u0275fac=function(t){return new(t||n)};static \u0275prov=Qt({token:n,factory:n.\u0275fac,providedIn:"root"})};var hn=(n,e)=>({enter:n,exit:e});function vn(n,e){if(n&1&&(M(0,"div",7),Z(1),P(),M(2,"div",8),Z(3),P()),n&2){let t=y(2);V(),we(" ",t.getCurrency(t.selectedVariant().price.cmp)," "),V(2),we(" ",t.getDiscountPercentage(t.selectedVariant().price),"% off ")}}function yn(n,e){if(n&1&&(M(0,"div",6),Z(1),P()),n&2){let t=y(2);V(),we(" ",t.stickyATCConfig.leftText," ")}}function Cn(n,e){if(n&1&&(M(0,"div",1)(1,"div",5),Z(2),P(),N(3,vn,4,2),N(4,yn,2,1,"div",6),P()),n&2){let t=y();V(2),we(" ",t.getCurrency(t.selectedVariant().price.d)," "),V(),B(t.selectedVariant().price.cmp?3:-1),V(),B(t.stickyATCConfig.leftText?4:-1)}}function xn(n,e){if(n&1&&(M(0,"div",9),Z(1),P()),n&2){let t=e.$implicit,o=e.$index;y(2);let a=q(5);H("ngClass",pi(2,hn,o===a.currentIndex,o===a.previousIndex)),V(),we(" ",t," ")}}function _n(n,e){if(n&1&&(M(0,"div",4),ge(1,xn,2,5,"div",9,mt),P()),n&2){y();let t=q(5);V(),he(t.features)}}var Vt=class n extends se{currentItem;stickyATCConfig;selectedVariant=fe(void 0);featureSlider=fe({features:[],currentIndex:0});constructor(){super()}onVariantChange(e){this.currentItem&&(this.currentItem.setSelectedVariantByID(e.detail.variantID),this.selectedVariant.set(this.currentItem.selectedOrFirstVariant.value))}engagementTriggerReceived(e){this.stickyATCConfig=e.stickyATCConfig??{},this.currentItem=e.items[0],this.selectedVariant.set(this.currentItem.vars[0]),this.stickyATCConfig.leftText=this.replaceVariables(this.stickyATCConfig.leftText),this.stickyATCConfig.rightText=this.replaceVariables(this.stickyATCConfig.rightText),this.startFeatureRotation()}update(){}getCurrency(e){return Qe(e)}getDiscountPercentage(e){return((e.cmp-e.d)/e.cmp*100).toFixed(0)}addToCart(){this.engagementService.executeCTA(rt.ADD_TO_CART,{item:this.currentItem})}startFeatureRotation(){if(!this.stickyATCConfig.rightText)return;let e=this.stickyATCConfig.rightText.split(`
15
15
  `),t=e.length===1?null:setInterval(()=>{this.featureSlider.update(o=>Ut(be({},o),{previousIndex:o.currentIndex,currentIndex:(o.currentIndex+1)%o.features.length}))},3e3);this.featureSlider.set({intervalRef:t,currentIndex:0,features:e})}replaceVariables(e){return e?Ke(e,this.currentItem.getTemplateVariables(),this.triggerContext):""}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["cooee-sticky-atc"]],hostBindings:function(t,o){t&1&&j("letscooee:variant-change",function(c){return o.onVariantChange(c)},ei)},features:[te(ie()),z],decls:7,vars:3,consts:[[1,"lc-wrapper"],[1,"lc-prices"],[1,"lc-button-wrapper"],["type","button",1,"lc-button","lc-button-atc",3,"click"],[1,"lc-features"],[1,"lc-sale-price"],[1,"lc-additional-text"],[1,"lc-compare-price"],[1,"lc-discount-label"],[1,"lc-feature",3,"ngClass"]],template:function(t,o){if(t&1){let a=J();M(0,"div",0),N(1,Cn,5,3,"div",1),M(2,"div",2)(3,"button",3),j("click",function(){return A(a),R(o.addToCart())}),Z(4,"Add To Cart"),P(),Re(5),N(6,_n,3,0,"div",4),P()()}if(t&2){V(),B(o.selectedVariant()&&o.stickyATCConfig.showProductInfo?1:-1),V(4);let a=ye(o.featureSlider());V(),B(a.features.length?6:-1)}},dependencies:[Ze],styles:[`:host{display:flex;justify-content:center;padding:10px;background-color:#fff;width:100%;box-shadow:4px 0 10px #0006;line-height:normal}.lc-wrapper{display:flex;justify-content:space-between;align-items:center;gap:8px;max-width:1100px;width:100%}.lc-prices{flex:1 1 100%;display:flex;flex-wrap:wrap;align-items:center;gap:6px}@media (min-width: 768px){.lc-prices{gap:8px}}.lc-sale-price{font-size:24px;font-weight:600}.lc-compare-price{font-size:18px;font-weight:600;color:red;text-decoration:line-through}.lc-discount-label{font-size:12px;font-weight:500;color:green}.lc-button-wrapper{flex:1 1 100%;display:flex;flex-direction:column;gap:4px;align-items:center}.lc-button{background-color:#000;color:#fff;opacity:1;pointer-events:auto;border-radius:4px;min-width:150px;width:100%;padding:8px}.lc-additional-text,.lc-feature{font-size:12px;color:#666}.lc-features{position:relative;overflow:hidden;height:16px;text-align:center;width:100%}.lc-features .lc-feature{position:absolute;width:100%;opacity:0;transform:translateY(100%);transition:transform .5s ease,opacity .5s ease}.lc-features .lc-feature.enter{opacity:1;transform:translateY(0);z-index:2}.lc-features .lc-feature.exit{opacity:0;transform:translateY(-100%);z-index:1}
16
- `],encapsulation:3})};var bn=["videoEl"];async function Wi(){return(await import("./video-detail-dialog.component-JLMGGNLE.js")).VideoDetailDialogComponent}var Me=class n extends se{videoElements;videos;videoConfig;dialogRef=null;dialog=le(gt);isMobile=Mi();pausedVideos=[];videoLoadingStates=new Map;intersectionObserver;visibleVideos=new Set;constructor(){super(),Wi()}ngAfterViewInit(){this.checkAndOpenVideoFromUrl()}ngOnDestroy(){super.ngOnDestroy(),this.intersectionObserver?.disconnect()}engagementTriggerReceived(e){this.videoConfig=e.content?.videoConfig,this.videos=this.videoConfig.videos}onMuteToggled(e,t){e||this.videoElements.forEach(o=>{o.nativeElement!==t&&(o.nativeElement.muted=!0,o.nativeElement.pause())})}sendTriggerClicked(e,t){this.sendEvent("CE Trigger Clicked",{},e,t)}async onVideoTap(e,t,o,a,c){e?.stopPropagation(),e?.preventDefault();let u=t.items?.[0];if(this.sendTriggerClicked(t,u),this.videoConfig.footerContent==="NONE"){a&&(a.muted=!1,a.play(),this.onMuteToggled(!1,a));return}await this.openDialog(t,o,c)}sendEvent(e,t,o,a){let c=new ft(e,t,this.engagementTrigger);c.setVideos(o),a&&(c.items=[a.toEmbed()]),window.CooeeSDK.sendEvent(c)}onDialogClosed(){this.resumePlaylistVideos()}isVideoLoading(e){return this.videoLoadingStates.get(e)??!0}onVideoLoadStart(e){this.videoLoadingStates.set(e,!0)}onVideoCanPlay(e){this.videoLoadingStates.set(e,!1)}playVideo(e){e.play().catch(t=>{W.error("Failed to play video:",t)})}setupIntersectionObserver(e=.5,t="50px"){this.intersectionObserver=new IntersectionObserver(o=>{o.forEach(a=>{let c=a.target,u=c.dataset.videoId;u&&(a.isIntersecting?(this.visibleVideos.add(u),this.handleVideoVisibilityChange(c,!0)):(this.visibleVideos.delete(u),this.handleVideoVisibilityChange(c,!1)))})},{threshold:e,rootMargin:t}),setTimeout(()=>{this.videoElements.forEach(o=>{this.intersectionObserver?.observe(o.nativeElement)})},100)}handleVideoVisibilityChange(e,t){t?this.onVideoBecameVisible(e):e.pause()}onVideoBecameVisible(e){this.playVideo(e)}pauseAllPlaylistVideos(){this.pausedVideos=[],this.videoElements.forEach(e=>{let t=e.nativeElement;t.paused||(this.pausedVideos.push(t),t.pause())})}resumePlaylistVideos(){this.pausedVideos.forEach(e=>{e.play().catch(()=>{})}),this.pausedVideos=[]}async checkAndOpenVideoFromUrl(){let e=Oi();if(!e||!this.videos)return;let t=Ri();if(t.utm_campaign?.toLowerCase()!=="shoppable_video"||t.utm_source?.toLowerCase()!==Ai)return;let o=this.videos.findIndex(a=>a.shortID===+e);if(o!==-1){let a=this.videos[o];await _i.set("muted",!0),await this.openDialog(a,o)}}async openDialog(e,t,o){await yi();let a={videos:this.videos,currentIndex:t,triggerContext:this.triggerContext,selectedItem:o};this.dialogRef&&this.dialogRef.close(),this.pauseAllPlaylistVideos();let c=await Wi();this.dialogRef=this.dialog.open(c,{width:"100vw",height:"100vh",data:a,providers:Ci(this.triggerContext,{video:e,index:t}),disableClose:!0});let u={videoID:e.id,videoIndex:t};this.sendEvent("CE Video Dialog Opened",{current:u},e),this.dialogRef.closed.subscribe(f=>{if(this.dialogRef=null,!f)return;let b=f.lastVideoDuration*1e3,D={videoID:f.lastVideo.id,videoIndex:f.lastVideoIndex,playedTillMS:b,playedTillPercent:b/f.lastVideo.durationMS};this.sendEvent("CE Video Dialog Closed",{current:D},f.lastVideo),this.onDialogClosed()})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["cooee-abstract-video"]],viewQuery:function(t,o){if(t&1&&Ue(bn,5),t&2){let a;ze(a=qe())&&(o.videoElements=a)}},features:[z],decls:0,vars:0,template:function(t,o){},encapsulation:2})};var Pe=class n{video=Dt.required({alias:"cooeeVideoSources"});prioritySource=Dt("high");elementRef=le(Xt);constructor(){fi(()=>{this.updateSources()})}updateSources(){let e=this.elementRef.nativeElement,t=this.video(),o=this.prioritySource();e.querySelectorAll("source").forEach(c=>c.remove()),o==="best"?(this.addSource(t.bestSource),this.addSource(t.highSource),this.addSource(t.lowSource)):o==="low"?(this.addSource(t.lowSource),this.addSource(t.highSource),this.addSource(t.bestSource)):(this.addSource(t.highSource),this.addSource(t.bestSource),this.addSource(t.lowSource)),this.addSource(t.m3u8Source),e.load()}addSource(e){if(!e)return;let t=document.createElement("source");t.src=e.url,t.type=e.mimeType,this.elementRef.nativeElement.appendChild(t)}static \u0275fac=function(t){return new(t||n)};static \u0275dir=ni({type:n,selectors:[["video","cooeeVideoSources",""]],inputs:{video:[1,"cooeeVideoSources","video"],prioritySource:[1,"prioritySource"]}})};var wn=(n,e)=>e.id;function Vn(n,e){if(n&1&&(ne(0,"div",1),Ce(1,"safeHtml")),n&2){let t=y();H("innerHTML",Ve(1,1,t.videoConfig.heading),ce)}}function Tn(n,e){n&1&&(M(0,"div",6),ne(1,"div",12),P())}function En(n,e){if(n&1){let t=J();M(0,"cooee-mute-toggle",13),j("toggled",function(a){A(t),y();let c=de(6),u=y();return R(u.onMuteToggled(a,c))}),P()}if(n&2){y();let t=de(6);H("muted",t.muted)("videoEl",t)}}function Sn(n,e){if(n&1){let t=J();M(0,"cooee-video-promoted-items",16),j("cardClick",function(a){A(t);let c=y(2),u=c.$implicit,f=c.$index,b=de(6),D=y();return R(D.onItemCardClick(a,u,f,b))}),P()}if(n&2){let t=y(2).$implicit;H("items",t.items)("centeredSlides",!1)}}function In(n,e){if(n&1){let t=J();M(0,"cooee-item-card",17),j("buttonClick",function(){A(t);let a=y(2),c=a.$implicit,u=a.$index,f=de(6),b=y();return R(b.addToCartClicked(null,c,u,f))})("click",function(){A(t);let a=y(2),c=a.$implicit,u=a.$index,f=de(6),b=q(0),D=y();return R(D.onItemCardClick(b,c,u,f))}),P()}if(n&2){y(2);let t=q(0);H("item",t)}}function Mn(n,e){if(n&1&&N(0,Sn,1,2,"cooee-video-promoted-items",14)(1,In,1,1,"cooee-item-card",15),n&2){let t=y().$implicit,o=y(),c=q(2)===o.VideoConfigFooterContent.ITEM_SWIPER;B(c&&t.items.length>1?0:t.items.length?1:-1)}}function Pn(n,e){if(n&1){let t=J();M(0,"cooee-video-card",18),j("linkClicked",function(){A(t);let a=y().$implicit,c=y();return R(c.sendTriggerClicked(a))}),P()}if(n&2){y();let t=q(1);H("card",t)}}function kn(n,e){if(n&1){let t=J();Re(0)(1),M(2,"div",4)(3,"div",5),j("click",function(a){let c=A(t),u=c.$implicit,f=c.$index,b=de(6),D=y();return R(D.onVideoTap(a,u,f,b))})("keydown.enter",function(a){let c=A(t),u=c.$implicit,f=c.$index,b=de(6),D=y();return R(D.onVideoTap(a,u,f,b))})("keydown.space",function(a){let c=A(t),u=c.$implicit,f=c.$index,b=de(6),D=y();return R(D.onVideoTap(a,u,f,b))}),N(4,Tn,2,0,"div",6),M(5,"video",7,0),j("mouseenter",function(){A(t);let a=de(6);y();let c=q(1);return R(c&&a.play())})("mouseleave",function(){A(t);let a=de(6);y();let c=q(1);return R(c&&a.pause())})("loadstart",function(){let a=A(t).$implicit,c=y();return R(c.onVideoLoadStart(a.id))})("canplay",function(){let a=A(t).$implicit,c=y();return R(c.onVideoCanPlay(a.id))}),P(),M(7,"div",8),N(8,En,1,2,"cooee-mute-toggle",9),P()(),M(9,"div",10),N(10,Mn,2,1)(11,Pn,1,1,"cooee-video-card",11),P()()}if(n&2){let t=e.$implicit,o=y(),a=q(0),c=q(2);ye(t.items[0]),V();let f=ye(t.card)&&c===o.VideoConfigFooterContent.CARD;V(2),nt("background-image",t.thumbnail?"url("+t.thumbnail+")":null),V(),B(o.isVideoLoading(t.id)?4:-1),V(),H("cooeeVideoSources",t)("muted",!0),it("preload",a?"metadata":"none")("autoplay",null)("data-video-id",t.id),V(3),B(o.videoConfig.showMuteButton?8:-1),V(2),B(o.videoConfig.showItems()?10:f?11:-1)}}var Tt=class n extends Me{VideoConfigFooterContent=At;VideoConfigAutoPlay=Fi;swiperOptions=null;constructor(){super(),this.hasSwiper=!0}ngAfterViewInit(){super.ngAfterViewInit();let e=this.videoConfig.playlistConfig.videoSwiper,t=e?(this.isMobile?e.gapSm:e.gap)+"px":window.cooeePlaylistGap??24,o=e?this.isMobile?e.maxInRowSm:e.maxInRow:"auto";this.swiperOptions={direction:"horizontal",effect:"slide",loop:e?.loop,freeMode:!0,spaceBetween:t,slidesPerView:o,mousewheel:{enabled:!0,forceToAxis:!0},autoplay:e?.autoplay?.enabled?{delay:e?.autoplay?.delay,disableOnInteraction:!1}:!1},this.setupIntersectionObserver(),this.playFirstVideo()}ngOnDestroy(){super.ngOnDestroy()}addToCartClicked(e,t,o,a){let c=t.items?.[0],u=vi.get().website?.canChangeVariantInCart;if(t.items?.length>1||c?.hasVariants()&&!u){this.onItemCardClick(c,t,o,a);return}this.engagementService.executeCTA(rt.ADD_TO_CART,{item:c,video:t})}goToPDP(e,t){e?.stopPropagation(),e?.preventDefault();let o=t.items?.[0];this.engagementService.executeCTA(rt.GO_TO_PRODUCT,{item:o,video:t})}onItemCardClick(e,t,o,a){this.videoConfig.playlistConfig.itemCardClickBehavior==="OPEN_ITEM_DETAIL"?this.onVideoTap(null,t,o,a,e):this.onVideoTap(null,t,o,a)}update(){}onVideoBecameVisible(e){this.shouldAutoPlay()&&(this.dialogRef?this.pausedVideos.push(e):this.playVideo(e))}shouldAutoPlay(){return this.videoConfig.autoPlay==="ON"||this.videoConfig.autoPlay==="ON_HOVER"&&this.isMobile}playFirstVideo(){}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["cooee-video-playlist"]],features:[te(ie()),z],decls:8,vars:7,consts:[["videoEl",""],[1,"heading-text",3,"innerHTML"],[3,"options","navigationConfig","paginationConfig"],["ngProjectAs","swiper-slides",5,["swiper-slides"]],[1,"swiper-slide","video-card"],["role","button","tabindex","0","aria-label","Play video","aria-haspopup","dialog",1,"video-wrapper",3,"click","keydown.enter","keydown.space"],[1,"video-loading-overlay"],["width","100%","playsinline","","loop","",3,"mouseenter","mouseleave","loadstart","canplay","cooeeVideoSources","muted"],[1,"video-controls"],[3,"muted","videoEl"],["role","region","aria-label","Video details",1,"video-footer"],[3,"card"],[1,"loading-spinner"],[3,"toggled","muted","videoEl"],[3,"items","centeredSlides"],["role","button","tabindex","0","aria-label","Product detail",3,"item"],[3,"cardClick","items","centeredSlides"],["role","button","tabindex","0","aria-label","Product detail",3,"buttonClick","click","item"],[3,"linkClicked","card"]],template:function(t,o){if(t&1&&(Re(0)(1)(2),N(3,Vn,2,3,"div",1),M(4,"cooee-swiper",2),li(5,3),ge(6,kn,12,12,"div",4,wn),ci(),P()),t&2){ye(!o.videoConfig.autoPlay||o.videoConfig.autoPlay===o.VideoConfigAutoPlay.ON),V(),ye(o.videoConfig.autoPlay===o.VideoConfigAutoPlay.ON_HOVER),V(),ye(o.videoConfig.footerContent),V(),B(o.videoConfig.heading?3:-1);let a=o.videoConfig.playlistConfig.videoSwiper;V(),H("options",o.swiperOptions)("navigationConfig",a==null?null:a.navigation)("paginationConfig",a==null?null:a.pagination),V(2),he(o.videos)}},dependencies:[Bi,Ni,Li,ki,Pe,Hi,Ge],styles:[`:host{display:block}cooee-swiper.swiper{margin:8px;padding-top:25px;padding-bottom:25px}.video-wrapper{position:relative;cursor:pointer;outline:none;border-radius:var(--lc-media-radius, 8px);background-size:cover;background-position:center;background-repeat:no-repeat}.video-wrapper video{width:100%;height:var(--lc-video-card-height);object-fit:cover;border-radius:var(--lc-media-radius, 8px);position:relative}.video-card.swiper-slide{width:var(--lc-video-card-width);transition:transform .3s ease}.video-card.swiper-slide:hover{transform:scale(1.05)}@media (max-width: 768px),(prefers-reduced-motion: reduce){.video-card.swiper-slide{transition:none}.video-card.swiper-slide:hover{transform:none}}.video-controls{position:absolute;bottom:8px;z-index:10;right:8px;display:flex;gap:8px}.video-footer{overflow-x:hidden}cooee-item-card{cursor:pointer;padding-left:0!important;padding-right:0!important}cooee-item-card .item-image{width:50px;height:50px;display:none}cooee-item-card .item-detail-button{display:none!important}cooee-item-card .item-info{font-size:14px;line-height:normal;margin-right:unset!important}cooee-item-card .item-info .item-name{-webkit-line-clamp:1;overflow:hidden}.video-loading-overlay{border-radius:var(--lc-media-radius, 8px)}
16
+ `],encapsulation:3})};var bn=["videoEl"];async function Wi(){return(await import("./video-detail-dialog.component-2HBYKRGD.js")).VideoDetailDialogComponent}var Me=class n extends se{videoElements;videos;videoConfig;dialogRef=null;dialog=le(gt);isMobile=Mi();pausedVideos=[];videoLoadingStates=new Map;intersectionObserver;visibleVideos=new Set;constructor(){super(),Wi()}ngAfterViewInit(){this.checkAndOpenVideoFromUrl()}ngOnDestroy(){super.ngOnDestroy(),this.intersectionObserver?.disconnect()}engagementTriggerReceived(e){this.videoConfig=e.content?.videoConfig,this.videos=this.videoConfig.videos}onMuteToggled(e,t){e||this.videoElements.forEach(o=>{o.nativeElement!==t&&(o.nativeElement.muted=!0,o.nativeElement.pause())})}sendTriggerClicked(e,t){this.sendEvent("CE Trigger Clicked",{},e,t)}async onVideoTap(e,t,o,a,c){e?.stopPropagation(),e?.preventDefault();let u=t.items?.[0];if(this.sendTriggerClicked(t,u),this.videoConfig.footerContent==="NONE"){a&&(a.muted=!1,a.play(),this.onMuteToggled(!1,a));return}await this.openDialog(t,o,c)}sendEvent(e,t,o,a){let c=new ft(e,t,this.engagementTrigger);c.setVideos(o),a&&(c.items=[a.toEmbed()]),window.CooeeSDK.sendEvent(c)}onDialogClosed(){this.resumePlaylistVideos()}isVideoLoading(e){return this.videoLoadingStates.get(e)??!0}onVideoLoadStart(e){this.videoLoadingStates.set(e,!0)}onVideoCanPlay(e){this.videoLoadingStates.set(e,!1)}playVideo(e){e.play().catch(t=>{W.error("Failed to play video:",t)})}setupIntersectionObserver(e=.5,t="50px"){this.intersectionObserver=new IntersectionObserver(o=>{o.forEach(a=>{let c=a.target,u=c.dataset.videoId;u&&(a.isIntersecting?(this.visibleVideos.add(u),this.handleVideoVisibilityChange(c,!0)):(this.visibleVideos.delete(u),this.handleVideoVisibilityChange(c,!1)))})},{threshold:e,rootMargin:t}),setTimeout(()=>{this.videoElements.forEach(o=>{this.intersectionObserver?.observe(o.nativeElement)})},100)}handleVideoVisibilityChange(e,t){t?this.onVideoBecameVisible(e):e.pause()}onVideoBecameVisible(e){this.playVideo(e)}pauseAllPlaylistVideos(){this.pausedVideos=[],this.videoElements.forEach(e=>{let t=e.nativeElement;t.paused||(this.pausedVideos.push(t),t.pause())})}resumePlaylistVideos(){this.pausedVideos.forEach(e=>{e.play().catch(()=>{})}),this.pausedVideos=[]}async checkAndOpenVideoFromUrl(){let e=Oi();if(!e||!this.videos)return;let t=Ri();if(t.utm_campaign?.toLowerCase()!=="shoppable_video"||t.utm_source?.toLowerCase()!==Ai)return;let o=this.videos.findIndex(a=>a.shortID===+e);if(o!==-1){let a=this.videos[o];await _i.set("muted",!0),await this.openDialog(a,o)}}async openDialog(e,t,o){await yi();let a={videos:this.videos,currentIndex:t,triggerContext:this.triggerContext,selectedItem:o};this.dialogRef&&this.dialogRef.close(),this.pauseAllPlaylistVideos();let c=await Wi();this.dialogRef=this.dialog.open(c,{width:"100vw",height:"100vh",data:a,providers:Ci(this.triggerContext,{video:e,index:t}),disableClose:!0});let u={videoID:e.id,videoIndex:t};this.sendEvent("CE Video Dialog Opened",{current:u},e),this.dialogRef.closed.subscribe(f=>{if(this.dialogRef=null,!f)return;let b=f.lastVideoDuration*1e3,D={videoID:f.lastVideo.id,videoIndex:f.lastVideoIndex,playedTillMS:b,playedTillPercent:b/f.lastVideo.durationMS};this.sendEvent("CE Video Dialog Closed",{current:D},f.lastVideo),this.onDialogClosed()})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["cooee-abstract-video"]],viewQuery:function(t,o){if(t&1&&Ue(bn,5),t&2){let a;ze(a=qe())&&(o.videoElements=a)}},features:[z],decls:0,vars:0,template:function(t,o){},encapsulation:2})};var Pe=class n{video=Dt.required({alias:"cooeeVideoSources"});prioritySource=Dt("high");elementRef=le(Xt);constructor(){fi(()=>{this.updateSources()})}updateSources(){let e=this.elementRef.nativeElement,t=this.video(),o=this.prioritySource();e.querySelectorAll("source").forEach(c=>c.remove()),o==="best"?(this.addSource(t.bestSource),this.addSource(t.highSource),this.addSource(t.lowSource)):o==="low"?(this.addSource(t.lowSource),this.addSource(t.highSource),this.addSource(t.bestSource)):(this.addSource(t.highSource),this.addSource(t.bestSource),this.addSource(t.lowSource)),this.addSource(t.m3u8Source),e.load()}addSource(e){if(!e)return;let t=document.createElement("source");t.src=e.url,t.type=e.mimeType,this.elementRef.nativeElement.appendChild(t)}static \u0275fac=function(t){return new(t||n)};static \u0275dir=ni({type:n,selectors:[["video","cooeeVideoSources",""]],inputs:{video:[1,"cooeeVideoSources","video"],prioritySource:[1,"prioritySource"]}})};var wn=(n,e)=>e.id;function Vn(n,e){if(n&1&&(ne(0,"div",1),Ce(1,"safeHtml")),n&2){let t=y();H("innerHTML",Ve(1,1,t.videoConfig.heading),ce)}}function Tn(n,e){n&1&&(M(0,"div",6),ne(1,"div",12),P())}function En(n,e){if(n&1){let t=J();M(0,"cooee-mute-toggle",13),j("toggled",function(a){A(t),y();let c=de(6),u=y();return R(u.onMuteToggled(a,c))}),P()}if(n&2){y();let t=de(6);H("muted",t.muted)("videoEl",t)}}function Sn(n,e){if(n&1){let t=J();M(0,"cooee-video-promoted-items",16),j("cardClick",function(a){A(t);let c=y(2),u=c.$implicit,f=c.$index,b=de(6),D=y();return R(D.onItemCardClick(a,u,f,b))}),P()}if(n&2){let t=y(2).$implicit;H("items",t.items)("centeredSlides",!1)}}function In(n,e){if(n&1){let t=J();M(0,"cooee-item-card",17),j("buttonClick",function(){A(t);let a=y(2),c=a.$implicit,u=a.$index,f=de(6),b=y();return R(b.addToCartClicked(null,c,u,f))})("click",function(){A(t);let a=y(2),c=a.$implicit,u=a.$index,f=de(6),b=q(0),D=y();return R(D.onItemCardClick(b,c,u,f))}),P()}if(n&2){y(2);let t=q(0);H("item",t)}}function Mn(n,e){if(n&1&&N(0,Sn,1,2,"cooee-video-promoted-items",14)(1,In,1,1,"cooee-item-card",15),n&2){let t=y().$implicit,o=y(),c=q(2)===o.VideoConfigFooterContent.ITEM_SWIPER;B(c&&t.items.length>1?0:t.items.length?1:-1)}}function Pn(n,e){if(n&1){let t=J();M(0,"cooee-video-card",18),j("linkClicked",function(){A(t);let a=y().$implicit,c=y();return R(c.sendTriggerClicked(a))}),P()}if(n&2){y();let t=q(1);H("card",t)}}function kn(n,e){if(n&1){let t=J();Re(0)(1),M(2,"div",4)(3,"div",5),j("click",function(a){let c=A(t),u=c.$implicit,f=c.$index,b=de(6),D=y();return R(D.onVideoTap(a,u,f,b))})("keydown.enter",function(a){let c=A(t),u=c.$implicit,f=c.$index,b=de(6),D=y();return R(D.onVideoTap(a,u,f,b))})("keydown.space",function(a){let c=A(t),u=c.$implicit,f=c.$index,b=de(6),D=y();return R(D.onVideoTap(a,u,f,b))}),N(4,Tn,2,0,"div",6),M(5,"video",7,0),j("mouseenter",function(){A(t);let a=de(6);y();let c=q(1);return R(c&&a.play())})("mouseleave",function(){A(t);let a=de(6);y();let c=q(1);return R(c&&a.pause())})("loadstart",function(){let a=A(t).$implicit,c=y();return R(c.onVideoLoadStart(a.id))})("canplay",function(){let a=A(t).$implicit,c=y();return R(c.onVideoCanPlay(a.id))}),P(),M(7,"div",8),N(8,En,1,2,"cooee-mute-toggle",9),P()(),M(9,"div",10),N(10,Mn,2,1)(11,Pn,1,1,"cooee-video-card",11),P()()}if(n&2){let t=e.$implicit,o=y(),a=q(0),c=q(2);ye(t.items[0]),V();let f=ye(t.card)&&c===o.VideoConfigFooterContent.CARD;V(2),nt("background-image",t.thumbnail?"url("+t.thumbnail+")":null),V(),B(o.isVideoLoading(t.id)?4:-1),V(),H("cooeeVideoSources",t)("muted",!0),it("preload",a?"metadata":"none")("autoplay",null)("data-video-id",t.id),V(3),B(o.videoConfig.showMuteButton?8:-1),V(2),B(o.videoConfig.showItems()?10:f?11:-1)}}var Tt=class n extends Me{VideoConfigFooterContent=At;VideoConfigAutoPlay=Fi;swiperOptions=null;constructor(){super(),this.hasSwiper=!0}ngAfterViewInit(){super.ngAfterViewInit();let e=this.videoConfig.playlistConfig.videoSwiper,t=e?(this.isMobile?e.gapSm:e.gap)+"px":window.cooeePlaylistGap??24,o=e?this.isMobile?e.maxInRowSm:e.maxInRow:"auto";this.swiperOptions={direction:"horizontal",effect:"slide",loop:e?.loop,freeMode:!0,spaceBetween:t,slidesPerView:o,mousewheel:{enabled:!0,forceToAxis:!0},autoplay:e?.autoplay?.enabled?{delay:e?.autoplay?.delay,disableOnInteraction:!1}:!1},this.setupIntersectionObserver(),this.playFirstVideo()}ngOnDestroy(){super.ngOnDestroy()}addToCartClicked(e,t,o,a){let c=t.items?.[0],u=vi.get().website?.canChangeVariantInCart;if(t.items?.length>1||c?.hasVariants()&&!u){this.onItemCardClick(c,t,o,a);return}this.engagementService.executeCTA(rt.ADD_TO_CART,{item:c,video:t})}goToPDP(e,t){e?.stopPropagation(),e?.preventDefault();let o=t.items?.[0];this.engagementService.executeCTA(rt.GO_TO_PRODUCT,{item:o,video:t})}onItemCardClick(e,t,o,a){this.videoConfig.playlistConfig.itemCardClickBehavior==="OPEN_ITEM_DETAIL"?this.onVideoTap(null,t,o,a,e):this.onVideoTap(null,t,o,a)}update(){}onVideoBecameVisible(e){this.shouldAutoPlay()&&(this.dialogRef?this.pausedVideos.push(e):this.playVideo(e))}shouldAutoPlay(){return this.videoConfig.autoPlay==="ON"||this.videoConfig.autoPlay==="ON_HOVER"&&this.isMobile}playFirstVideo(){}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["cooee-video-playlist"]],features:[te(ie()),z],decls:8,vars:7,consts:[["videoEl",""],[1,"heading-text",3,"innerHTML"],[3,"options","navigationConfig","paginationConfig"],["ngProjectAs","swiper-slides",5,["swiper-slides"]],[1,"swiper-slide","video-card"],["role","button","tabindex","0","aria-label","Play video","aria-haspopup","dialog",1,"video-wrapper",3,"click","keydown.enter","keydown.space"],[1,"video-loading-overlay"],["width","100%","playsinline","","loop","",3,"mouseenter","mouseleave","loadstart","canplay","cooeeVideoSources","muted"],[1,"video-controls"],[3,"muted","videoEl"],["role","region","aria-label","Video details",1,"video-footer"],[3,"card"],[1,"loading-spinner"],[3,"toggled","muted","videoEl"],[3,"items","centeredSlides"],["role","button","tabindex","0","aria-label","Product detail",3,"item"],[3,"cardClick","items","centeredSlides"],["role","button","tabindex","0","aria-label","Product detail",3,"buttonClick","click","item"],[3,"linkClicked","card"]],template:function(t,o){if(t&1&&(Re(0)(1)(2),N(3,Vn,2,3,"div",1),M(4,"cooee-swiper",2),li(5,3),ge(6,kn,12,12,"div",4,wn),ci(),P()),t&2){ye(!o.videoConfig.autoPlay||o.videoConfig.autoPlay===o.VideoConfigAutoPlay.ON),V(),ye(o.videoConfig.autoPlay===o.VideoConfigAutoPlay.ON_HOVER),V(),ye(o.videoConfig.footerContent),V(),B(o.videoConfig.heading?3:-1);let a=o.videoConfig.playlistConfig.videoSwiper;V(),H("options",o.swiperOptions)("navigationConfig",a==null?null:a.navigation)("paginationConfig",a==null?null:a.pagination),V(2),he(o.videos)}},dependencies:[Bi,Ni,Li,ki,Pe,Hi,Ge],styles:[`:host{display:block}cooee-swiper.swiper{margin:8px;padding-top:25px;padding-bottom:25px}.video-wrapper{position:relative;cursor:pointer;outline:none;border-radius:var(--lc-media-radius, 8px);background-size:cover;background-position:center;background-repeat:no-repeat}.video-wrapper video{width:100%;height:var(--lc-video-card-height);object-fit:cover;border-radius:var(--lc-media-radius, 8px);position:relative}.video-card.swiper-slide{width:var(--lc-video-card-width);transition:transform .3s ease}.video-card.swiper-slide:hover{transform:scale(1.05)}@media (max-width: 768px),(prefers-reduced-motion: reduce){.video-card.swiper-slide{transition:none}.video-card.swiper-slide:hover{transform:none}}.video-controls{position:absolute;bottom:8px;z-index:10;right:8px;display:flex;gap:8px}.video-footer{overflow-x:hidden}cooee-item-card{cursor:pointer;padding-left:0!important;padding-right:0!important}cooee-item-card .item-image{width:50px;height:50px;display:none}cooee-item-card .item-detail-button{display:none!important}cooee-item-card .item-info{font-size:14px;line-height:normal;margin-right:unset!important}cooee-item-card .item-info .item-name{-webkit-line-clamp:1;overflow:hidden}.video-loading-overlay{border-radius:var(--lc-media-radius, 8px)}
17
17
  `],encapsulation:3})};var Fn=["videoElement"],Dn=n=>({"cursor-grab":n}),Et=class n extends Me{videoElement;video;isDragging=!1;hidden=!1;cdkDrag=le(ht,{self:!0});untilDestroyed=Ii();constructor(){super()}get popupClasses(){return this.hidden?["hidden"]:["visible"]}onClick(e){e.stopPropagation(),e.preventDefault(),this.onVideoClick()}ngOnInit(){super.ngOnInit();let e=this.elementRef.nativeElement.closest(".letscooee-engagement");e&&(e.style.zIndex="10000"),this.cdkDrag.moved.pipe(this.untilDestroyed).subscribe(()=>this.isDragging=!0)}ngAfterViewInit(){super.ngAfterViewInit(),setTimeout(()=>{this.autoPlay()},100)}onVideoClick(){if(this.isDragging){this.isDragging=!1;return}this.hidden=!0,this.onVideoTap(null,this.video,0)}close(){this.hidden=!0;let e=(new Date().getTime()-this.triggerContext.startTime.getTime())/1e3;this.sendEvent("CE Trigger Closed",{duration:e})}engagementTriggerReceived(e){super.engagementTriggerReceived(e),this.video=this.videos[0]}update(){}onDialogClosed(){this.hidden=!1}autoPlay(){let e=this.videoElement.nativeElement;this.hidden||this.playVideo(e)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["cooee-video-popup"]],viewQuery:function(t,o){if(t&1&&Ue(Fn,5),t&2){let a;ze(a=qe())&&(o.videoElement=a.first)}},hostAttrs:["role","button","tabindex","0","aria-label","Open video popup "],hostVars:3,hostBindings:function(t,o){t&1&&j("keydown.enter",function(c){return o.onClick(c)})("keydown.space",function(c){return o.onClick(c)})("click",function(c){return o.onClick(c)}),t&2&&(ve("cdkDragBoundary","body"),di(o.popupClasses))},features:[te(ie()),ri([{directive:ht,inputs:["cdkDragBoundary","cdkDragBoundary"]}]),z],decls:9,vars:5,consts:[["videoElement",""],[1,"popup-inner",3,"ngClass"],["type","button","aria-label","Close video popup",1,"close-button",3,"click"],["name","close","aria-hidden","true"],[1,"play-button"],["name","unmute","aria-hidden","true"],[1,"text"],["loop","","preload","metadata","playsinline","",3,"muted","cooeeVideoSources"]],template:function(t,o){if(t&1){let a=J();M(0,"div",1)(1,"button",2),j("click",function(u){return A(a),u.stopPropagation(),R(o.close())}),ne(2,"cooee-icon",3),P(),M(3,"div",4),ne(4,"cooee-icon",5),M(5,"div",6),Z(6,"Tap to unmute"),P()(),ne(7,"video",7,0),P()}t&2&&(H("ngClass",We(3,Dn,o.isDragging)),V(7),H("muted",!0)("cooeeVideoSources",o.video))},dependencies:[Ze,Pi,Pe],styles:[`:host{position:fixed;display:block;right:24px;bottom:24px;min-height:150px;max-width:150px;box-shadow:0 25px 50px -12px #00000040}:host(.hidden){display:none}.popup-inner{display:flex;justify-content:center;align-items:center;position:relative}video{width:100%;border-radius:8px;background-color:#fff}.close-button{position:absolute;top:-14px;right:-14px;background-color:#00000080;border-radius:9999px;width:32px;height:32px;border:none;z-index:10;display:flex;justify-content:center;align-items:center}.play-button{display:flex;justify-content:center;align-items:center;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%) scale(1);transition:all .1s ease-in-out;z-index:999;flex-wrap:wrap;width:100%;max-width:130px;border-radius:5px;padding:5px 10px;background-color:#97979761;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.play-button cooee-icon{width:14px;height:14px}.play-button .text{font-size:11px;line-height:1;color:#fff;font-weight:400;margin-left:5px;text-align:center}
18
18
  `],encapsulation:3})};var An=(n,e)=>e.id;function Rn(n,e){if(n&1&&(ne(0,"div",1),Ce(1,"safeHtml")),n&2){let t=y();H("innerHTML",Ve(1,1,t.videoConfig.heading),ce)}}function On(n,e){n&1&&(M(0,"div",9),ne(1,"div",11),P())}function Ln(n,e){if(n&1){let t=J();M(0,"div",4),j("click",function(a){let c=A(t),u=c.$implicit,f=c.$index,b=y();return R(b.onVideoTap(a,u,f))})("keydown.enter",function(a){let c=A(t),u=c.$implicit,f=c.$index,b=y();return R(b.onVideoTap(a,u,f))})("keydown.space",function(a){let c=A(t),u=c.$implicit,f=c.$index,b=y();return R(b.onVideoTap(a,u,f))}),Gt(),M(1,"svg",5),ne(2,"circle",6)(3,"circle",7),P(),Kt(),M(4,"div",8),N(5,On,2,0,"div",9),M(6,"video",10,0),j("loadstart",function(){let a=A(t).$implicit,c=y();return R(c.onVideoLoadStart(a.id))})("canplay",function(){let a=A(t).$implicit,c=y();return R(c.onVideoCanPlay(a.id))}),P()()()}if(n&2){let t=e.$implicit,o=e.$index,a=y();it("aria-label","Open video story "+(o+1)),V(5),B(a.isVideoLoading(t.id)?5:-1),V(),H("poster",t.thumbnail,He)("cooeeVideoSources",t)("prioritySource","low")("muted",!0),it("data-video-id",t.id)}}var St=class n extends Me{constructor(){super()}ngAfterViewInit(){super.ngAfterViewInit(),this.setupIntersectionObserver()}ngOnDestroy(){super.ngOnDestroy()}update(){}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["cooee-video-stories"]],features:[te(ie()),z],decls:4,vars:1,consts:[["videoEl",""],[1,"heading-text",3,"innerHTML"],[1,"video-stories"],["role","button","tabindex","0",1,"video-story"],["role","button","tabindex","0",1,"video-story",3,"click","keydown.enter","keydown.space"],["viewBox","0 0 100 100"],["cx","50","cy","50","r","48","fill","none","stroke-width","4"],["cx","50","cy","50","r","48","fill","none","stroke-width","4","stroke-linecap","round","stroke-dasharray","301.6","stroke-dashoffset","301.6",1,"video-story-circle"],[1,"video-wrapper"],[1,"video-loading-overlay"],["loop","","playsinline","","preload","metadata",3,"loadstart","canplay","poster","cooeeVideoSources","prioritySource","muted"],[1,"loading-spinner"]],template:function(t,o){t&1&&(N(0,Rn,2,3,"div",1),M(1,"div",2),ge(2,Ln,8,7,"div",3,An),P()),t&2&&(B(o.videoConfig.heading?0:-1),V(2),he(o.videos))},dependencies:[Pe,Ge],styles:[`:host{display:block}.video-stories{display:flex;overflow:auto;margin:.75rem;gap:.75rem;justify-content:center;align-items:center;scrollbar-width:none}.video-stories::-webkit-scrollbar{display:none}@media (max-width: 768px){.video-stories{justify-content:start!important}}.video-story{position:relative;width:5rem;height:5rem;cursor:pointer;flex-shrink:0}.video-story svg{position:absolute;top:0;left:0;width:100%;height:100%}.video-story svg circle:first-child{stroke:#d1d5db}.video-story svg circle:last-child{stroke:#3b82f6}.video-story .video-wrapper{position:relative;width:100%;height:100%;border-radius:9999px;overflow:hidden}.video-story .video-wrapper video{width:100%;height:100%;object-fit:cover;border-radius:9999px;position:relative;z-index:1}.video-story .video-wrapper .video-loading-overlay{border-radius:9999px}
19
19
  `],encapsulation:3})};var jt=(t=>(t.IMAGE="IMAGE",t.BUTTON="BUTTON",t))(jt||{});var $t=n=>({active:n});function Nn(n,e){if(n&1&&(M(0,"span",4),Z(1),P()),n&2){let t=y(2);V(),ot(t.collectionFilterConfig.subtitle)}}function Bn(n,e){if(n&1&&(M(0,"div",1)(1,"span",3),Z(2),P(),N(3,Nn,2,1,"span",4),P()),n&2){let t=y();V(2),ot(t.collectionFilterConfig.title),V(),B(t.collectionFilterConfig.subtitle?3:-1)}}function Hn(n,e){if(n&1&&(M(0,"span",9),Z(1),P()),n&2){let t=y(2).$implicit,o=q(0);H("ngClass",We(2,$t,o)),V(),we("",t.label," ")}}function jn(n,e){if(n&1){let t=J();M(0,"div",7),j("mousedown",function(){A(t);let a=y().$implicit,c=q(0),u=y(2);return R(u.filterClick(a,c))}),ne(1,"img",8),N(2,Hn,2,4,"span",9),P()}if(n&2){let t=y().$implicit,o=q(0);V(),H("src",t.imageSrc,He)("ngClass",We(3,$t,o)),V(),B(t.label?2:-1)}}function $n(n,e){if(n&1){let t=J();M(0,"button",10),j("click",function(){A(t);let a=y().$implicit,c=q(0),u=y(2);return R(u.filterClick(a,c))}),Z(1),P()}if(n&2){let t=y().$implicit,o=q(0);H("ngClass",We(2,$t,o)),V(),we("",t.label," ")}}function Un(n,e){if(n&1&&(Re(0),N(1,jn,3,5,"div",5)(2,$n,2,4,"button",6)),n&2){let t=e.$implicit,o=y(2);ye(t.value===o.currentActiveParams()[t.key]),V(),B(o.collectionFilterConfig.template===o.CollectionFilterTemplate.IMAGE?1:o.collectionFilterConfig.template===o.CollectionFilterTemplate.BUTTON?2:-1)}}function zn(n,e){if(n&1&&ge(0,Un,3,2,null,null,mt),n&2){let t=y();he(t.collectionFilterConfig.options)}}var It=class n extends se{currentActiveParams=fe({});collectionFilterConfig;CollectionFilterTemplate=jt;originalPushState;constructor(){super(),this.attachedURLStateChecker()}engagementTriggerReceived(e){this.collectionFilterConfig=e.content.collectionFilterConfig}update(){}ngOnDestroy(){this.originalPushState&&(window.history.pushState=this.originalPushState)}filterClick(e,t=!1){let o=new URL(window.location.href),a=t?"removed":"applied";if(t?o.searchParams.delete(e.key):o.searchParams.set(e.key,e.value),this.collectionFilterConfig.refreshPage){this.sendEvent(e,a),window.location.href=o.href;return}window.history.replaceState({path:o.href},"",o),this.sendEvent(e,a),this.checkAndUpdateParams()}sendEvent(e,t){let o=new ft("CE Trigger Clicked",{filterApplication:t,filter:{key:e.key,value:e.value}},this.engagementTrigger);window.CooeeSDK.sendEvent(o)}attachedURLStateChecker(){this.checkAndUpdateParams(),this.originalPushState=window.history.pushState,window.history.pushState=new Proxy(window.history.pushState,{apply:(e,t,o)=>{e.apply(t,o),this.checkAndUpdateParams()}})}checkAndUpdateParams(){let e=new URL(window.location.href),t={};e.searchParams.forEach((o,a)=>{t[a]=o}),this.currentActiveParams.set(t)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["cooee-collection-filter"]],features:[te(ie()),z],decls:4,vars:2,consts:[[1,"wrapper"],[1,"filter-title-container"],[1,"options-container"],[1,"filter-title"],[1,"filter-subtitle"],[1,"image-filter-wrapper"],["type","button",1,"filter-button",3,"ngClass"],[1,"image-filter-wrapper",3,"mousedown"],["alt","collection filter image",1,"filter-image",3,"src","ngClass"],[1,"filter-label",3,"ngClass"],["type","button",1,"filter-button",3,"click","ngClass"]],template:function(t,o){t&1&&(M(0,"div",0),N(1,Bn,4,2,"div",1),M(2,"div",2),N(3,zn,2,0),P()()),t&2&&(V(),B(o.collectionFilterConfig.title?1:-1),V(2),B(o.collectionFilterConfig.options.length?3:-1))},dependencies:[Ze],styles:[`.wrapper{display:flex;flex-direction:column;gap:10px;padding:10px;justify-content:center;align-items:center}.filter-title-container{display:flex;flex-direction:column;gap:5px;align-items:center}.filter-title-container .filter-title{color:rgba(var(--lc-heading-color));font-family:var(--lc-heading-family),serif;font-weight:var(--lc-heading-weight);font-size:var(--lc-heading-size);transform:var(--lc-heading-transform);letter-spacing:var(--lc-heading-letter-spacing);text-align:var(--lc-heading-align)}.filter-title-container .filter-subtitle{color:rgba(var(--lc-subheading-color));font-weight:var(--lc-subheading-weight);font-size:var(--lc-subheading-size)}.options-container{display:flex;gap:35px;align-items:center;flex-wrap:wrap;justify-content:center}.options-container .image-filter-wrapper{display:flex;gap:10px;flex-direction:column;align-items:center;cursor:pointer}.options-container .image-filter-wrapper .filter-image{width:var(--lc-image-width, 80px);height:var(--lc-image-height, 80px);border-radius:40px}.options-container .image-filter-wrapper .filter-image.active{border:2px solid rgba(var(--lc-primary-color));padding:2px}.options-container .image-filter-wrapper .filter-label{font-size:var(--lc-text-size, 14px);color:rgba(var(--lc-text-color));font-weight:var(--lc-text-weight)}.options-container .image-filter-wrapper .filter-label.active{color:rgba(var(--lc-primary-color))}.options-container .filter-button{background-color:rgba(var(--lc-secondary-button-bg-color));font-size:var(--lc-button-size, 14px);color:rgba(var(--lc-secondary-button-color));border-color:rgba(var(--lc-secondary-button-border-color));font-weight:var(--lc-secondary-button-weight);border-radius:var(--lc-button-radius);font-family:var(--lc-button-family),serif;height:var(--lc-button-height, 36px);padding:0 16px}.options-container .filter-button:hover,.options-container .filter-button.active{background-color:rgba(var(--lc-primary-button-bg-color));color:rgba(var(--lc-primary-button-color));border-color:rgba(var(--lc-primary-button-border-color));font-weight:var(--lc-primary-button-weight)}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@letscooee/web-sdk",
3
3
  "description": "Engage uniquely and boost conversions with AI-powered customer journeys driven by real-time intent",
4
- "version": "13.1.2",
4
+ "version": "13.1.3",
5
5
  "scripts": {
6
6
  "lint": "ng lint",
7
7
  "integrity": "./scripts/validate-integrity.sh",