@letscooee/web-sdk 13.1.10 → 13.1.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.
- package/dist/chunk-7XDM4HDH.js +1 -0
- package/dist/{chunk-VOVXCOBB.js → chunk-BJ5UBWZZ.js} +1 -1
- package/dist/{chunk-2AHALCF3.js → chunk-CFZOV3EF.js} +1 -1
- package/dist/chunk-GIEYLCFF.js +4 -0
- package/dist/chunk-JAIJ74CO.js +39 -0
- package/dist/chunk-MHKDPBHM.js +8 -0
- package/dist/{chunk-LW7ZESZN.js → chunk-Z7UUW7XD.js} +2 -2
- package/dist/{chunk-Y3BMMUFH.js → chunk-ZFMH37WK.js} +1 -1
- package/dist/{debugger.component-G4NYQU2M.js → debugger.component-UQRQT3KM.js} +1 -1
- package/dist/main.min.js +4 -4
- package/dist/renderer-7THALERZ.js +1 -0
- package/dist/sdk-debug-logs-PG5BE6E3.js +1 -0
- package/dist/{share-dialog.component-HDMDNACD.js → share-dialog.component-OXWTLKYG.js} +1 -1
- package/dist/video-detail-dialog.component-E4FB7GMC.js +2 -0
- package/dist/widget.min.js +5 -5
- package/package.json +1 -1
- package/dist/chunk-ALW6N5YB.js +0 -1
- package/dist/chunk-DTWV2VE6.js +0 -4
- package/dist/chunk-K3NDUCRB.js +0 -39
- package/dist/chunk-PC4YRNPG.js +0 -8
- package/dist/renderer-X5CF2PGG.js +0 -1
- package/dist/sdk-debug-logs-OECRZKTM.js +0 -1
- package/dist/video-detail-dialog.component-YQZ6AMST.js +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{b as ue,l as be,o as _e,p as Ce,q as ye,r as xe,s as De,t as Ve,u as Ie}from"./chunk-Z7UUW7XD.js";import{a as Ee,b as Te}from"./chunk-BJ5UBWZZ.js";import{a as ge,b as P,c as U,d as he,e as ve,f as fe,g as M}from"./chunk-CFZOV3EF.js";import{b as k,c as we}from"./chunk-7XDM4HDH.js";import{Ba as h,Cb as j,Da as s,E as _,Ga as F,Ha as B,I as K,Ia as H,Ib as me,L as G,La as V,M as Q,Ma as S,O as d,Ta as ie,Ua as oe,V as q,Va as ne,X as y,Za as re,ba as E,fb as se,ha as T,ia as x,ib as ae,ja as D,jb as de,kb as le,la as Y,ma as $,na as L,oa as u,pa as l,qa as a,ra as w,sa as J,sb as ce,ta as X,ua as Z,ub as pe,v,va as ee,wa as te,x as p,xa as A,y as m,za as C}from"./chunk-GIEYLCFF.js";import"./chunk-U4XWPFUW.js";var I="a-f\\d",Me=`#?[${I}]{3}[${I}]?`,Oe=`#?[${I}]{6}([${I}]{2})?`,Ne=new RegExp(`[^#${I}]`,"gi"),Re=new RegExp(`^${Me}$|^${Oe}$`,"i");function W(i,e={}){if(typeof i!="string"||Ne.test(i)||!Re.test(i))throw new TypeError("Expected a valid hex string");i=i.replace(/^#/,"");let t=1;i.length===8&&(t=Number.parseInt(i.slice(6,8),16)/255,i=i.slice(0,6)),i.length===4&&(t=Number.parseInt(i.slice(3,4).repeat(2),16)/255,i=i.slice(0,3)),i.length===3&&(i=i[0]+i[0]+i[1]+i[1]+i[2]+i[2]);let o=Number.parseInt(i,16),n=o>>16,r=o>>8&255,f=o&255,b=typeof e.alpha=="number"?e.alpha:t;if(e.format==="array")return[n,r,f,b];if(e.format==="css"){let g=b===1?"":` / ${Number((b*100).toFixed(2))}%`;return`rgb(${n} ${r} ${f}${g})`}return{red:n,green:r,blue:f,alpha:b}}var c=class{h;a=100;g;constructor(e){e??={},this.h=e.h,this.a=e.a,this.g=e.g}get hex(){return this.h}get grad(){return this.g}get rgba(){if(!this.hex)return"";try{return W(this.hex,{format:"css",alpha:this.getAlpha()})}catch(e){return console.error("Invalid hex",e),"#000000"}}getAlpha(){return(this.a??100)/100}};var O=class i{static DEFAULT_FALLBACK=new c({h:"#000000",a:50});r;c;fb;constructor(e){this.r=e.r,e.c&&(this.c=new c(e.c)),e.fb&&(this.fb=new c(e.fb))}get radius(){return this.r}get color(){return this.c}get fallback(){return this.fb??i.DEFAULT_FALLBACK}};var N=class{size;enabled;color;constructor(e){e??={},this.enabled=e.enabled,this.size=e.size,this.color=new c(e.color)}};var R=class i{video=le.required();progress=_(0);constructor(){ae(e=>{let t=this.video(),o=()=>{this.progress.set(t.currentTime/t.duration*100)};t.addEventListener("timeupdate",o),e(()=>{t.removeEventListener("timeupdate",o)})})}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=y({type:i,selectors:[["cooee-video-progress-bar"]],inputs:{video:[1,"video"]},decls:3,vars:3,consts:[[1,"video-untracked-path"],["role","progressbar",1,"video-tracked-path"]],template:function(t,o){t&1&&(J(0,"div",0)(1,"div",1),Z(2,"div"),X()()),t&2&&(d(),S("width",o.progress(),"%"),T("aria-valuenow",o.progress()))},styles:["[_nghost-%COMP%]{display:block;width:100%;position:absolute;z-index:10;top:4px;padding-inline:8px;box-sizing:border-box}.video-untracked-path[_ngcontent-%COMP%], .video-tracked-path[_ngcontent-%COMP%]{height:4px;border-radius:var(--lc-video-progress-bar-radius)}.video-untracked-path[_ngcontent-%COMP%]{background-color:rgba(var(--lc-video-progress-bar-bg-color));width:100%;margin-bottom:2px}.video-tracked-path[_ngcontent-%COMP%]{background-color:rgba(var(--lc-video-progress-bar-color));transition:width .5s ease-in-out}@media (prefers-reduced-motion: reduce){.video-tracked-path[_ngcontent-%COMP%]{transition:none}}"]})};var z=class i{dialogState=de();dialog=v(fe);triggerData=v(ge)().triggerData;eventData=v(P);containerRef=v(q);async share(e){e.stopPropagation(),e.preventDefault(),k()&&we()?await this.shareNative():await this.shareWithDialog()}async shareNative(){let e=Te(this.triggerData,this.eventData.video,!1);await navigator.share(e),Ee(this.triggerData,this.eventData.video,this.eventData.index,"Native")}async shareWithDialog(){let e=await import("./share-dialog.component-OXWTLKYG.js");this.dialogState.emit(!0),this.dialog.open(e.ShareDialogComponent,{viewContainerRef:this.containerRef}).closed.subscribe(()=>this.dialogState.emit(!1))}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=y({type:i,selectors:[["cooee-share-button"]],outputs:{dialogState:"dialogState"},decls:2,vars:0,consts:[["type","button","aria-label","Share video",3,"click"],["name","share"]],template:function(t,o){t&1&&(l(0,"button",0),h("click",function(r){return o.share(r)}),w(1,"cooee-icon",1),a())},dependencies:[M],styles:["button[_ngcontent-%COMP%]{width:var(--lc-icon-button-size, 44px);height:var(--lc-icon-button-size, 44px);display:flex;justify-content:center;align-items:center;border:none;border-radius:100%;background:#00000080;background:color-mix(in oklab,#000 50%,transparent)}button[_ngcontent-%COMP%] cooee-icon[name=share][_ngcontent-%COMP%]{color:#fff}"]})};var ze=["swiperComp"],$e=["videoEl"],Le=(i,e)=>e.url;function Ae(i,e){i&1&&(l(0,"div",11),w(1,"div",15),a())}function Fe(i,e){if(i&1&&w(0,"source",13),i&2){let t=e.$implicit;u("type",re(t.mimeType))("src",t.url,G)}}function Be(i,e){i&1&&A(0)}function He(i,e){if(i&1){let t=C();l(0,"cooee-video-promoted-items",24),h("cardClick",function(n){p(t);let r=s(2).$implicit,f=s();return m(f.productCardClicked(n,r))}),a()}if(i&2){let t=s(2).$implicit;u("items",t.items)}}function je(i,e){if(i&1&&w(0,"cooee-video-card",23),i&2){let t=s(2).$implicit;u("card",t.card)}}function Ue(i,e){if(i&1){let t=C();w(0,"cooee-video-progress-bar",16),l(1,"div",17)(2,"cooee-mute-toggle",18),ne("mutedChange",function(n){p(t);let r=s(2);return oe(r.muted,n)||(r.muted=n),m(n)}),h("toggled",function(){p(t);let n=s(2);return m(n.muteToggled())}),a(),E(3,Be,1,0,"ng-container",8),a(),l(4,"div",19)(5,"cooee-share-button",20),h("dialogState",function(n){p(t);let r=s(2);return m(r.shareDialogOpen.set(n))}),a()(),l(6,"div",21),x(7,He,1,1,"cooee-video-promoted-items",22)(8,je,1,1,"cooee-video-card",23),a()}if(i&2){let t=s().$implicit,o=V(5),n=s(),r=V(9);u("video",o),d(2),ie("muted",n.muted),u("videoEl",o),d(),u("ngTemplateOutlet",r),d(4),D(t.items.length&&n.videoConfig.showItems()?7:t.card&&n.videoConfig.footerContent===n.VideoConfigFooterContent.CARD?8:-1)}}function We(i,e){if(i&1){let t=C();l(0,"cooee-item-detail",25),h("closeClick",function(){p(t);let n=s(2);return m(n.productModalClosed())}),a()}if(i&2){let t=s(2);u("item",t.selectedItem)("similarItems",t.selectedVideo.items)("template",t.videoConfig.itemDetailConfig.template)}}function Ke(i,e){if(i&1){let t=C();l(0,"div",6)(1,"div",9)(2,"div",10),x(3,Ae,2,0,"div",11),l(4,"video",12,2),h("click",function(){let n=p(t).$index,r=s();return m(r.currentIndex===n&&r.toggleMute())})("ended",function(){p(t);let n=V(5),r=s();return m(r.onVideoEnded(n))})("loadstart",function(){let n=p(t).$index,r=s();return m(r.onVideoLoadStart(n))})("canplay",function(){let n=p(t).$index,r=s();return m(r.onVideoCanPlay(n))}),$(6,Fe,1,3,"source",13,Le),a(),x(8,Ue,9,5),a(),x(9,We,1,3,"cooee-item-detail",14),a()()}if(i&2){let t=e.$implicit,o=e.$index,n=s();d(2),S("background-image",t.thumbnail?"url("+t.thumbnail+")":null),d(),D(n.shouldShowVideoSpinner(o)?3:-1),d(),u("ngClass",n.viewTemplateClassName)("muted",!0),T("preload",n.isVideoVisible(o)?"metadata":"none")("data-video-id",t.id)("autoplay",null),d(2),L(t.sources),d(2),D(n.currentIndex===o?8:-1),d(),D(n.selectedItem&&n.currentIndex===o?9:-1)}}function Ge(i,e){i&1&&A(0)}function Qe(i,e){if(i&1){let t=C();l(0,"button",26),h("click",function(){p(t);let n=s();return m(n.close())}),w(1,"cooee-icon",27),a()}}var ke=class i{swiperComponent;videoElements;VideoConfigFooterContent=_e;currentIndex=0;muted=_(!1);selectedItem=null;selectedVideo;detailPopupTemplate;viewTemplateClassName="lc-video-only-view";shareDialogOpen=_(!1);data=v(ve);elementRef=v(K);eventData=v(P);dialogRef=v(he);swiperInitialized=_(!1);swiperOptions=_(null);videos=[];videoConfig;triggerContext;engagementTrigger;isMobile=k();navigationConfig;cssLoadedPromise;resizeDebouncer=new be(this.onResize.bind(this));videoLoadingStates=new Map;constructor(){this.videos=this.data.videos,this.currentIndex=this.data.currentIndex,this.selectedItem=this.data.selectedItem??null,this.selectedVideo=this.videos[this.currentIndex],this.triggerContext=this.data.triggerContext,this.engagementTrigger=this.triggerContext.triggerData,this.videoConfig=this.engagementTrigger?.content?.videoConfig??new Ce,this.navigationConfig=new N({enabled:!0,size:50,color:new c({h:"#000000"})}),this.cssLoadedPromise=ue(this.elementRef.nativeElement.shadowRoot)}onKeyDown(e){e.preventDefault(),e.stopPropagation(),this.close()}async ngOnInit(){switch(this.muted.set(await j.get("muted",!1)),this.videoConfig.detailPopup.template){case"PRODUCT_DETAIL_VIEW":this.selectItemForDetailView(),this.viewTemplateClassName="lc-product-detail-view";break;case"VIDEO_ONLY_VIEW":this.viewTemplateClassName="lc-video-only-view";break}}ngAfterViewInit(){this.initializeSwiperWithVideoDimensions()}ngOnDestroy(){this.resizeDebouncer?.destroy()}initializeSwiperWithVideoDimensions(){this.applyOptimalVideoDimensions(),this.initSwiperOptions(),this.playActiveVideo(!1)}close(){let e=this.getCurrentVideoElement();this.dialogRef.close({lastVideo:this.videos[this.currentIndex],lastVideoIndex:this.currentIndex,lastVideoDuration:e?.currentTime})}getCurrentVideoElement(){return this.videoElements.get(this.currentIndex)?.nativeElement}moveToNextVideo(){this.swiperComponent.swiper.slideTo(this.currentIndex+1)}productModalClosed(){this.selectedItem=null}pauseAll(){this.videoElements.forEach(e=>e.nativeElement.pause())}toggleMute(){this.muted.update(e=>!e)}async muteToggled(){await j.set("muted",this.muted());let t=[this.muted()?"CE Video Muted":"CE Video Unmuted",{current:this.currentVideoProps()},{triggerData:this.engagementTrigger}];window.CooeeSDK.events.push(t)}playActiveVideo(e=!0){e&&this.pauseAll();let t=this.getCurrentVideoElement();t&&this.playVideo(t)}playVideo(e){e.currentTime=0,e.play().catch(t=>me.error(t))}onVideoEnded(e){if(this.currentIndex<this.videos.length-1)this.selectedItem||this.shareDialogOpen()?this.playVideo(e):this.moveToNextVideo();else{let t=this.getPreviousVideoDataForEvent(),o=["CE Last Video Ended",{previous:t},{triggerData:this.engagementTrigger}];window.CooeeSDK.events.push(o),this.playVideo(e)}}onSlideChange(e){let t=this.getPreviousVideoDataForEvent();this.currentIndex=e.realIndex,this.selectedVideo=this.videos[this.currentIndex],this.eventData.video=this.selectedVideo,this.eventData.index=this.currentIndex,this.playActiveVideo(),this.isProductDetailView()?this.selectItemForDetailView():this.selectedItem=null;let o=this.currentVideoProps(),n={previous:t,current:o},r=new U("CE Video Changed",n,this.engagementTrigger);r.setVideos(this.videos[this.currentIndex]),window.CooeeSDK.sendEvent(r)}productCardClicked(e,t){let o={videoID:t.id,videoIndex:this.currentIndex},n=new U("CE More Item Info Clicked",{current:o},this.engagementTrigger);n.setVideos(t),window.CooeeSDK.sendEvent(n),this.selectedItem=e}onVideoLoadStart(e){this.videoLoadingStates.set(e,!0)}onVideoCanPlay(e){this.videoLoadingStates.set(e,!1)}shouldShowVideoSpinner(e){return this.swiperInitialized()?this.videoLoadingStates.get(e)===!0&&this.isVideoVisible(e):this.isVideoVisible(e)}isVideoVisible(e){let t=this.currentIndex-1,o=this.currentIndex+1;return e===this.currentIndex||e===t||e===o}async initSwiperOptions(){await this.cssLoadedPromise;let e=this.isMobile?1:"auto",t=0;this.isProductDetailView()&&(e="auto",t=10),this.swiperOptions.set({direction:this.isMobile?"vertical":"horizontal",effect:this.isMobile?"slide":"coverflow",slidesPerView:e,initialSlide:this.currentIndex,centeredSlides:!0,spaceBetween:t,coverflowEffect:{rotate:0,stretch:0,depth:400,modifier:1,slideShadows:!1},on:{init:o=>{this.swiperInitialized.set(!0),setTimeout(()=>{o.update()},100)}},mousewheel:{enabled:!this.isMobile,invert:!1,thresholdDelta:20}})}isProductDetailView(){return this.videoConfig.detailPopup.template==="PRODUCT_DETAIL_VIEW"}currentVideoProps(){return{videoID:this.videos[this.currentIndex].id,videoIndex:this.currentIndex}}getPreviousVideoDataForEvent(){let e=this.currentVideoProps(),t=this.videoElements.find(n=>n.nativeElement.dataset.videoId===this.videos[this.currentIndex].id)?.nativeElement;e.playedTillMS=Math.ceil(t?.currentTime*1e3);let o=t?.duration*1e3;return e.playedTillPercent=+(e.playedTillMS/o).toFixed(4),e}selectItemForDetailView(){this.selectedItem=this.isMobile?null:this.selectedVideo?.items?.[0]??null}applyOptimalVideoDimensions(){if(this.isMobile||this.isProductDetailView())return;let e=this.calculateOptimalVideoDimensions();e&&this.setVideoContainerDimensions(e.width,e.height)}calculateOptimalVideoDimensions(){let e=this.videos.map(g=>g.sources?.[0]).filter(g=>g?.width&&g?.height).map(g=>({width:g.width,height:g.height,aspectRatio:g.width/g.height}));if(e.length===0)return null;let t=e[0],o=window.innerWidth*.9,n=window.innerHeight*.9,r=o/t.width,f=n/t.height,b=Math.min(r,f);return{width:Math.floor(t.width*b),height:Math.floor(t.height*b)}}setVideoContainerDimensions(e,t){let o=this.elementRef.nativeElement;o.style.setProperty("--video-container-width",`${e}px`),o.style.setProperty("--video-container-height",`${t}px`)}onResize(){this.applyOptimalVideoDimensions()}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=y({type:i,selectors:[["cooee-video-detail-dialog"]],viewQuery:function(t,o){if(t&1&&(F(ze,7),F($e,5)),t&2){let n;B(n=H())&&(o.swiperComponent=n.first),B(n=H())&&(o.videoElements=n)}},hostAttrs:[1,"letscooee-widget"],hostBindings:function(t,o){t&1&&h("keydown.escape",function(r){return o.onKeyDown(r)},Q)},decls:10,vars:4,consts:[["swiperComp",""],["closeButtonTemplate",""],["videoEl",""],[1,"lc-shadow-inner",3,"ngClass"],[1,"video-swiper",3,"slideChange","options","navigationConfig"],["ngProjectAs","swiper-slides",5,["swiper-slides"]],[1,"swiper-slide","video-slide"],[1,"lc-desktop-controls"],[4,"ngTemplateOutlet"],[1,"lc-video-modal-row"],[1,"lc-video-container"],[1,"video-loading-overlay"],["playsinline","",1,"lc-video-el",3,"click","ended","loadstart","canplay","ngClass","muted"],[3,"src","type"],[1,"swiper-no-swiping","swiper-no-mousewheel",3,"item","similarItems","template"],[1,"loading-spinner"],[3,"video"],[1,"lc-video-controls"],[3,"mutedChange","toggled","muted","videoEl"],[1,"share-controls"],[3,"dialogState"],[1,"lc-card-container"],[3,"items"],[3,"card"],[3,"cardClick","items"],[1,"swiper-no-swiping","swiper-no-mousewheel",3,"closeClick","item","similarItems","template"],["type","button","aria-label","Close",1,"lc-close-button",3,"click"],["name","close","aria-hidden","true"]],template:function(t,o){if(t&1){let n=C();l(0,"div",3)(1,"cooee-swiper",4,0),h("slideChange",function(f){return p(n),m(o.onSlideChange(f))}),ee(3,5),$(4,Ke,10,10,"div",6,Y),te(),a(),l(6,"div",7),E(7,Ge,1,0,"ng-container",8),a()(),E(8,Qe,2,0,"ng-template",null,1,se)}if(t&2){let n=V(9);u("ngClass",o.viewTemplateClassName),d(),u("options",o.swiperOptions())("navigationConfig",o.navigationConfig),d(3),L(o.videos),d(3),u("ngTemplateOutlet",n)}},dependencies:[Ie,ye,Ve,z,R,pe,ce,De,xe,M],styles:[`:host{display:flex}.lc-shadow-inner{position:relative;width:100vw;height:100vh;display:flex}@media (min-width: 768px){.lc-shadow-inner{background-color:color-mix(in oklab,#000 70%,transparent);justify-content:center;align-items:center}}.video-swiper{--swiper-navigation-size: 50px;--swiper-navigation-color: white;width:100dvw;height:100dvh}.lc-product-detail-view .video-swiper{align-items:center}@media (min-width: 768px){.video-swiper{width:100%;height:100%;max-width:90vw;max-height:90vh}}.video-swiper>.swiper-wrapper{max-height:100%;pointer-events:none}.lc-product-detail-view .video-swiper>.swiper-wrapper{align-items:center}@media (max-width: 768px){.video-swiper>.swiper-button-prev{display:none!important}}@media (max-width: 768px){.video-swiper>.swiper-button-next{display:var(--lc-next-video-button-display)!important;width:var(--lc-icon-button-size, 44px);height:var(--lc-icon-button-size, 44px);display:flex;justify-content:center;align-items:center;border:none;border-radius:100%;background:#00000080;background:color-mix(in oklab,#000 50%,transparent);color:#fff;inset:auto auto 12px 50%;transform:translate(-50%) rotate(90deg)}.video-swiper>.swiper-button-next:after{color:#fff;font-weight:900}}.video-swiper:has(cooee-item-detail)>.swiper-button-next{display:none!important}.video-slide{position:relative;display:flex;align-items:center;visibility:hidden;pointer-events:auto}.lc-product-detail-view .video-slide{width:40vw!important;height:70vh!important}@media (min-width: 768px){.lc-product-detail-view .video-slide{min-width:650px!important}}@media (max-width: 768px){.lc-product-detail-view .video-slide{width:100%!important;height:100%!important}}@media (min-width: 768px){.lc-video-only-view .video-slide{width:fit-content!important}}@media (min-width: 768px){.video-slide{border-radius:var(--lc-media-radius);overflow:hidden}}.video-slide.swiper-slide-active,.video-slide.swiper-slide-prev,.video-slide.swiper-slide-next{visibility:visible}video{width:100%;height:100%;object-fit:cover;position:relative;z-index:3}.lc-desktop-controls{position:absolute;top:2rem;right:4rem;z-index:10;display:flex;gap:.5rem}@media (max-width: 768px){.lc-desktop-controls{display:none}}.lc-video-controls{position:absolute;top:1rem;z-index:10;right:.5rem;display:flex;gap:.25rem}@media (min-width: 768px){.lc-video-controls .lc-close-button{display:none}}.share-controls{position:absolute;bottom:30%;right:.5rem;z-index:10;display:flex;gap:.25rem;flex-direction:column;justify-content:center;align-items:center}.lc-close-button{width:var(--lc-icon-button-size, 44px);height:var(--lc-icon-button-size, 44px);display:flex;justify-content:center;align-items:center;border:none;border-radius:100%;background:#00000080;background:color-mix(in oklab,#000 50%,transparent)}.lc-video-container{position:relative;height:100%;width:100%;background:#000000b3 no-repeat center;background-size:cover}@media (min-width: 768px){.lc-product-detail-view .lc-video-container{width:50%}}@media (min-width: 768px){.lc-video-only-view .lc-video-container{width:var(--video-container-width, 100%);height:var(--video-container-height, 100%)}}.lc-card-container{position:absolute;bottom:12px;z-index:10;width:100%;padding-inline:12px;box-sizing:border-box}.lc-product-detail-view .lc-card-container{display:none}@media (max-width: 768px){.lc-product-detail-view .lc-card-container{display:block}}.lc-product-detail-view .lc-video-modal-row{display:flex;justify-content:center;height:100%;width:100%}.lc-video-only-view .lc-video-modal-row{display:block;height:100%}.lc-product-detail-view cooee-item-detail{--header-display: none;width:50%;flex:1}@media (max-width: 768px){.lc-product-detail-view cooee-item-detail{--header-display: flex;width:100%;height:70dvh;position:absolute;bottom:0;z-index:2147483646}}.lc-video-only-view cooee-item-detail{width:100%;height:70dvh;z-index:2147483646;bottom:0;position:absolute;border-radius:var(--lc-card-radius) var(--lc-card-radius) 0 0}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.video-loading-overlay{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;background-color:#0000004d;z-index:2}.video-loading-overlay .loading-spinner{width:30px;height:30px;border:3px solid rgba(255,255,255,.3);border-top:3px solid #fff;border-radius:50%;animation:spin 1s linear infinite}
|
|
2
|
+
`],encapsulation:3})};export{ke as VideoDetailDialogComponent};
|
package/dist/widget.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as _i,c as rt,d as ut,e as ie,f as bi,g as se,h as wi,i as Vi,j as Si,k as Ii,m as ki,n as Fi,o as At,q as Di,r as Li,s as Ni,t as Bi,u as Hi}from"./chunk-Z7UUW7XD.js";import{c as ft,d as Ti,e as Ei,f as gt,g as Pi,h as Ai,i as Ri,l as Oi}from"./chunk-CFZOV3EF.js";import{a as ht}from"./chunk-ZFMH37WK.js";import{a as Ge,b as Mi}from"./chunk-7XDM4HDH.js";import{$ as z,$a as te,A as Kt,Aa as ve,B as Jt,Ba as j,Bb as hi,Cb as vi,Da as y,E as fe,Eb as yi,F as Yt,Fb as Ci,Ga as Ue,Gb as Qe,Ha as ze,I as Xt,Ia as qe,Ib as W,Jb as xi,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-GIEYLCFF.js";import{a as be,b as Ut,e as Gi,g as Ki}from"./chunk-U4XWPFUW.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,`
|
|
@@ -7,14 +7,14 @@ import{a as yi,c as rt,d as ut,e as ie,f as Ci,g as se,h as xi,i as Vi,j as Si,k
|
|
|
7
7
|
|
|
8
8
|
`+i.message+`
|
|
9
9
|
`+Array(i.message.length+1).join("=")+`
|
|
10
|
-
`+Je(s,m)):i}}function ke(s,l){var d;return l.cache&&l.name&&l.storage.templates.get(l.name)?l.storage.templates.get(l.name):(d=typeof s=="function"?s:tt(s,l),l.cache&&l.name&&l.storage.templates.define(l.name,d),d)}Le.l.bind(Le),n.compile=tt,n.compileScope=oe,n.compileScopeIntoFunction=Xe,n.compileToString=Je,n.defaultConfig=Le,n.filters=dt,n.getConfig=et,n.helpers=lt,n.nativeHelpers=ct,n.parse=at,n.render=function(s,l,d,m){var r=et(d||{});if(!r.async)return ke(s,r)(l,r);if(!m){if(typeof o=="function")return new o(function(i,p){try{i(ke(s,r)(l,r))}catch(g){p(g)}});throw e("Please provide a callback function, this env doesn't support Promises")}try{ke(s,r)(l,r,m)}catch(i){return m(i)}},n.templates=st,Object.defineProperty(n,"__esModule",{value:!0})})});var Ji={schedule(n,e){let t=setTimeout(n,e);return()=>clearTimeout(t)}};function Yi(n){return n.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function Xi(n){return!!n&&n.nodeType===Node.ELEMENT_NODE}var Rt;function en(n,e){if(!Rt){let t=Element.prototype;Rt=t.matches||t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector}return n.nodeType===Node.ELEMENT_NODE?Rt.call(n,e):!1}function tn(n){let e={};return n.forEach(({propName:t,templateName:o,transform:a})=>{e[Yi(o)]=[t,a]}),e}function nn(n,e){return e.get(Ft).resolveComponentFactory(n).inputs}function on(n,e){let t=n.childNodes,o=e.map(()=>[]),a=-1;e.some((c,u)=>c==="*"?(a=u,!0):!1);for(let c=0,u=t.length;c<u;++c){let f=t[c],b=rn(f,e,a);b!==-1&&o[b].push(f)}return o}function rn(n,e,t){let o=t;return Xi(n)&&e.some((a,c)=>a!=="*"&&en(n,a)?(o=c,!0):!1),o}var an=10,Ot=class{componentFactory;inputMap=new Map;constructor(e,t){this.componentFactory=t.get(Ft).resolveComponentFactory(e);for(let o of this.componentFactory.inputs)this.inputMap.set(o.propName,o.templateName)}create(e){return new Lt(this.componentFactory,e,this.inputMap)}},Lt=class{componentFactory;injector;inputMap;eventEmitters=new qt(1);events=this.eventEmitters.pipe(Zt(e=>Wt(...e)));componentRef=null;scheduledDestroyFn=null;initialInputValues=new Map;ngZone;elementZone;appRef;cdScheduler;constructor(e,t,o){this.componentFactory=e,this.injector=t,this.inputMap=o,this.ngZone=this.injector.get(ai),this.appRef=this.injector.get(si),this.cdScheduler=t.get(Yt),this.elementZone=typeof Zone>"u"?null:this.ngZone.run(()=>Zone.current)}connect(e){this.runInZone(()=>{if(this.scheduledDestroyFn!==null){this.scheduledDestroyFn(),this.scheduledDestroyFn=null;return}this.componentRef===null&&this.initializeComponent(e)})}disconnect(){this.runInZone(()=>{this.componentRef===null||this.scheduledDestroyFn!==null||(this.scheduledDestroyFn=Ji.schedule(()=>{this.componentRef!==null&&(this.componentRef.destroy(),this.componentRef=null)},an))})}getInputValue(e){return this.runInZone(()=>this.componentRef===null?this.initialInputValues.get(e):this.componentRef.instance[e])}setInputValue(e,t){if(this.componentRef===null){this.initialInputValues.set(e,t);return}this.runInZone(()=>{this.componentRef.setInput(this.inputMap.get(e)??e,t),ti(this.componentRef.hostView)&&(ii(this.componentRef.changeDetectorRef),this.cdScheduler.notify(6))})}initializeComponent(e){let t=Jt.create({providers:[],parent:this.injector}),o=on(e,this.componentFactory.ngContentSelectors);this.componentRef=this.componentFactory.create(t,o,e),this.initializeInputs(),this.initializeOutputs(this.componentRef),this.appRef.attachView(this.componentRef.hostView),this.componentRef.hostView.detectChanges()}initializeInputs(){for(let[e,t]of this.initialInputValues)this.setInputValue(e,t);this.initialInputValues.clear()}initializeOutputs(e){let t=this.componentFactory.outputs.map(({propName:o,templateName:a})=>{let c=e.instance[o];return new zt(u=>{let f=c.subscribe(b=>u.next({name:a,value:b}));return()=>f.unsubscribe()})});this.eventEmitters.next(t)}runInZone(e){return this.elementZone&&Zone.current!==this.elementZone?this.ngZone.run(e):e()}},Nt=class extends HTMLElement{ngElementEventsSubscription=null};function ji(n,e){let t=nn(n,e.injector),o=e.strategyFactory||new Ot(n,e.injector),a=tn(t);class c extends Nt{injector;static observedAttributes=Object.keys(a);get ngElementStrategy(){if(!this._ngElementStrategy){let f=this._ngElementStrategy=o.create(this.injector||e.injector);t.forEach(({propName:b,transform:D})=>{if(!this.hasOwnProperty(b))return;let Y=this[b];delete this[b],f.setInputValue(b,Y,D)})}return this._ngElementStrategy}_ngElementStrategy;constructor(f){super(),this.injector=f}attributeChangedCallback(f,b,D,Y){let[Te,Ee]=a[f];this.ngElementStrategy.setInputValue(Te,D,Ee)}connectedCallback(){let f=!1;this.ngElementStrategy.events&&(this.subscribeToEvents(),f=!0),this.ngElementStrategy.connect(this),f||this.subscribeToEvents()}disconnectedCallback(){this._ngElementStrategy&&this._ngElementStrategy.disconnect(),this.ngElementEventsSubscription&&(this.ngElementEventsSubscription.unsubscribe(),this.ngElementEventsSubscription=null)}subscribeToEvents(){this.ngElementEventsSubscription=this.ngElementStrategy.events.subscribe(f=>{let b=new CustomEvent(f.name,{detail:f.value});this.dispatchEvent(b)})}}return t.forEach(({propName:u,transform:f})=>{Object.defineProperty(c.prototype,u,{get(){return this.ngElementStrategy.getInputValue(u)},set(b){this.ngElementStrategy.setInputValue(u,b,f)},configurable:!0,enumerable:!0})}),c}var $i={providers:[ui()]};var Bt=(t=>(t.CART_AMOUNT="CART_AMOUNT",t.ITEM_COUNT="ITEM_COUNT",t))(Bt||{});var Q=Ki(zi());Q.filters.define("default",function(n){return typeof n>"u"||n==null?"":ln(n)});+Q.filters.define("max",(n,e)=>{let t=Number(n),o=Number(e);return isNaN(t)||isNaN(o)?n:t>o?e:n});Q.filters.define("min",(n,e)=>{let t=Number(n),o=Number(e);return isNaN(t)||isNaN(o)?n:t<o?e:n});Q.filters.define("fallback",(n,e)=>n==null||n===""?e:n);Q.filters.define("manipulate_quantity",(n,e,t)=>{if(e??=1,t??=100,e>t)return W.error("Invalid range: min should be less than or equal to max."),n;if(n>=e&&n<=t)return n;let o=n%t;return o<e?e:o});Q.filters.define("apply_discount_perc",(n,e,t=1/0)=>{if(n=+n,isNaN(n))return W.error("Need value as a number for `apply_discount_perc` filter"),NaN;if(e<0||e>100)return W.error("Invalid percent value for `apply_discount_perc` filter. Must be between 0 and 100."),NaN;let o=n*e/100;return n-Math.min(t,o)});Q.filters.define("apply_discount_fixed",(n,e)=>(n=+n,isNaN(n)?(W.error("Need value as a number for `apply_discount_fixed` filter"),NaN):Math.max(0,n-e)));Q.filters.define("currency",n=>(n=+n,isNaN(n)?(W.error("Need value as a number for `currency` filter"),NaN):Qe(n)));Q.filters.define("split",(n,e,t)=>{if(typeof n!="string")return W.error("Need value as a string for `split` filter"),"";if(e==null)return W.error("Need delimiter for `split` filter"),"";if(t==null||isNaN(Number(t)))return W.error("Need a valid index for `split` filter"),"";let o=n.split(String(e)),a=Number(t),c=a<0?o.length+a:a;return o[c].trim()??""});Q.defaultConfig.defaultFilter="default";Q.defaultConfig.useWith=!0;Q.defaultConfig.autoEscape=!1;var sn={'"':""","\\":"\","\n":"\\n"," ":"\\t"};function ln(n){return String(n).replace(/["\\\n\t]/g,e=>sn[e])}function cn(n){if(!n)return"";let e=/({{{\s*([^}]+?)\s*}}}|{{\s*&\s*([^}]+?)\s*}})/g;return n.replace(e,(t,o,a,c)=>`{{ ${(a||c||"").trim()} }}`)}var Ke=(n,e,t)=>{e=be({discount:{},cart:{},product:{},bundle:{},variant:{},customer:{},svg:{},form:{},amount_left:null},e);try{return Q.render(cn(n),e)}catch(o){throw bi(o,"squirrelly-render",{extra:{template:n,values:e},triggerContext:t}),o}};var yt=class n{transform(e,t){return e?Ke(e,be({},t)):null}static \u0275fac=function(t){return new(t||n)};static \u0275pipe=oi({name:"cooeeDynamicVariables",type:n,pure:!0})};var Ht={};(function n(e,t,o,a){var c=!!(e.Worker&&e.Blob&&e.Promise&&e.OffscreenCanvas&&e.OffscreenCanvasRenderingContext2D&&e.HTMLCanvasElement&&e.HTMLCanvasElement.prototype.transferControlToOffscreen&&e.URL&&e.URL.createObjectURL),u=typeof Path2D=="function"&&typeof DOMMatrix=="function",f=(function(){if(!e.OffscreenCanvas)return!1;var r=new OffscreenCanvas(1,1),i=r.getContext("2d");i.fillRect(0,0,1,1);var p=r.transferToImageBitmap();try{i.createPattern(p,"no-repeat")}catch{return!1}return!0})();function b(){}function D(r){var i=t.exports.Promise,p=i!==void 0?i:e.Promise;return typeof p=="function"?new p(r):(r(b,b),null)}var Y=(function(r,i){return{transform:function(p){if(r)return p;if(i.has(p))return i.get(p);var g=new OffscreenCanvas(p.width,p.height),C=g.getContext("2d");return C.drawImage(p,0,0),i.set(p,g),g},clear:function(){i.clear()}}})(f,new Map),Te=(function(){var r=Math.floor(16.666666666666668),i,p,g={},C=0;return typeof requestAnimationFrame=="function"&&typeof cancelAnimationFrame=="function"?(i=function(x){var w=Math.random();return g[w]=requestAnimationFrame(function h(_){C===_||C+r-1<_?(C=_,delete g[w],x()):g[w]=requestAnimationFrame(h)}),w},p=function(x){g[x]&&cancelAnimationFrame(g[x])}):(i=function(x){return setTimeout(x,r)},p=function(x){return clearTimeout(x)}),{frame:i,cancel:p}})(),Ee=(function(){var r,i,p={};function g(C){function x(w,h){C.postMessage({options:w||{},callback:h})}C.init=function(h){var _=h.transferControlToOffscreen();C.postMessage({canvas:_},[_])},C.fire=function(h,_,v){if(i)return x(h,null),i;var E=Math.random().toString(36).slice(2);return i=D(function(T){function F(I){I.data.callback===E&&(delete p[E],C.removeEventListener("message",F),i=null,Y.clear(),v(),T())}C.addEventListener("message",F),x(h,E),p[E]=F.bind(null,{data:{callback:E}})}),i},C.reset=function(){C.postMessage({reset:!0});for(var h in p)p[h](),delete p[h]}}return function(){if(r)return r;if(!o&&c){var C=["var CONFETTI, SIZE = {}, module = {};","("+n.toString()+")(this, module, true, SIZE);","onmessage = function(msg) {"," if (msg.data.options) {"," CONFETTI(msg.data.options).then(function () {"," if (msg.data.callback) {"," postMessage({ callback: msg.data.callback });"," }"," });"," } else if (msg.data.reset) {"," CONFETTI && CONFETTI.reset();"," } else if (msg.data.resize) {"," SIZE.width = msg.data.resize.width;"," SIZE.height = msg.data.resize.height;"," } else if (msg.data.canvas) {"," SIZE.width = msg.data.canvas.width;"," SIZE.height = msg.data.canvas.height;"," CONFETTI = module.exports.create(msg.data.canvas);"," }","}"].join(`
|
|
10
|
+
`+Je(s,m)):i}}function ke(s,l){var d;return l.cache&&l.name&&l.storage.templates.get(l.name)?l.storage.templates.get(l.name):(d=typeof s=="function"?s:tt(s,l),l.cache&&l.name&&l.storage.templates.define(l.name,d),d)}Le.l.bind(Le),n.compile=tt,n.compileScope=oe,n.compileScopeIntoFunction=Xe,n.compileToString=Je,n.defaultConfig=Le,n.filters=dt,n.getConfig=et,n.helpers=lt,n.nativeHelpers=ct,n.parse=at,n.render=function(s,l,d,m){var r=et(d||{});if(!r.async)return ke(s,r)(l,r);if(!m){if(typeof o=="function")return new o(function(i,p){try{i(ke(s,r)(l,r))}catch(g){p(g)}});throw e("Please provide a callback function, this env doesn't support Promises")}try{ke(s,r)(l,r,m)}catch(i){return m(i)}},n.templates=st,Object.defineProperty(n,"__esModule",{value:!0})})});var Ji={schedule(n,e){let t=setTimeout(n,e);return()=>clearTimeout(t)}};function Yi(n){return n.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function Xi(n){return!!n&&n.nodeType===Node.ELEMENT_NODE}var Rt;function en(n,e){if(!Rt){let t=Element.prototype;Rt=t.matches||t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector}return n.nodeType===Node.ELEMENT_NODE?Rt.call(n,e):!1}function tn(n){let e={};return n.forEach(({propName:t,templateName:o,transform:a})=>{e[Yi(o)]=[t,a]}),e}function nn(n,e){return e.get(Ft).resolveComponentFactory(n).inputs}function on(n,e){let t=n.childNodes,o=e.map(()=>[]),a=-1;e.some((c,u)=>c==="*"?(a=u,!0):!1);for(let c=0,u=t.length;c<u;++c){let f=t[c],b=rn(f,e,a);b!==-1&&o[b].push(f)}return o}function rn(n,e,t){let o=t;return Xi(n)&&e.some((a,c)=>a!=="*"&&en(n,a)?(o=c,!0):!1),o}var an=10,Ot=class{componentFactory;inputMap=new Map;constructor(e,t){this.componentFactory=t.get(Ft).resolveComponentFactory(e);for(let o of this.componentFactory.inputs)this.inputMap.set(o.propName,o.templateName)}create(e){return new Lt(this.componentFactory,e,this.inputMap)}},Lt=class{componentFactory;injector;inputMap;eventEmitters=new qt(1);events=this.eventEmitters.pipe(Zt(e=>Wt(...e)));componentRef=null;scheduledDestroyFn=null;initialInputValues=new Map;ngZone;elementZone;appRef;cdScheduler;constructor(e,t,o){this.componentFactory=e,this.injector=t,this.inputMap=o,this.ngZone=this.injector.get(ai),this.appRef=this.injector.get(si),this.cdScheduler=t.get(Yt),this.elementZone=typeof Zone>"u"?null:this.ngZone.run(()=>Zone.current)}connect(e){this.runInZone(()=>{if(this.scheduledDestroyFn!==null){this.scheduledDestroyFn(),this.scheduledDestroyFn=null;return}this.componentRef===null&&this.initializeComponent(e)})}disconnect(){this.runInZone(()=>{this.componentRef===null||this.scheduledDestroyFn!==null||(this.scheduledDestroyFn=Ji.schedule(()=>{this.componentRef!==null&&(this.componentRef.destroy(),this.componentRef=null)},an))})}getInputValue(e){return this.runInZone(()=>this.componentRef===null?this.initialInputValues.get(e):this.componentRef.instance[e])}setInputValue(e,t){if(this.componentRef===null){this.initialInputValues.set(e,t);return}this.runInZone(()=>{this.componentRef.setInput(this.inputMap.get(e)??e,t),ti(this.componentRef.hostView)&&(ii(this.componentRef.changeDetectorRef),this.cdScheduler.notify(6))})}initializeComponent(e){let t=Jt.create({providers:[],parent:this.injector}),o=on(e,this.componentFactory.ngContentSelectors);this.componentRef=this.componentFactory.create(t,o,e),this.initializeInputs(),this.initializeOutputs(this.componentRef),this.appRef.attachView(this.componentRef.hostView),this.componentRef.hostView.detectChanges()}initializeInputs(){for(let[e,t]of this.initialInputValues)this.setInputValue(e,t);this.initialInputValues.clear()}initializeOutputs(e){let t=this.componentFactory.outputs.map(({propName:o,templateName:a})=>{let c=e.instance[o];return new zt(u=>{let f=c.subscribe(b=>u.next({name:a,value:b}));return()=>f.unsubscribe()})});this.eventEmitters.next(t)}runInZone(e){return this.elementZone&&Zone.current!==this.elementZone?this.ngZone.run(e):e()}},Nt=class extends HTMLElement{ngElementEventsSubscription=null};function ji(n,e){let t=nn(n,e.injector),o=e.strategyFactory||new Ot(n,e.injector),a=tn(t);class c extends Nt{injector;static observedAttributes=Object.keys(a);get ngElementStrategy(){if(!this._ngElementStrategy){let f=this._ngElementStrategy=o.create(this.injector||e.injector);t.forEach(({propName:b,transform:D})=>{if(!this.hasOwnProperty(b))return;let Y=this[b];delete this[b],f.setInputValue(b,Y,D)})}return this._ngElementStrategy}_ngElementStrategy;constructor(f){super(),this.injector=f}attributeChangedCallback(f,b,D,Y){let[Te,Ee]=a[f];this.ngElementStrategy.setInputValue(Te,D,Ee)}connectedCallback(){let f=!1;this.ngElementStrategy.events&&(this.subscribeToEvents(),f=!0),this.ngElementStrategy.connect(this),f||this.subscribeToEvents()}disconnectedCallback(){this._ngElementStrategy&&this._ngElementStrategy.disconnect(),this.ngElementEventsSubscription&&(this.ngElementEventsSubscription.unsubscribe(),this.ngElementEventsSubscription=null)}subscribeToEvents(){this.ngElementEventsSubscription=this.ngElementStrategy.events.subscribe(f=>{let b=new CustomEvent(f.name,{detail:f.value});this.dispatchEvent(b)})}}return t.forEach(({propName:u,transform:f})=>{Object.defineProperty(c.prototype,u,{get(){return this.ngElementStrategy.getInputValue(u)},set(b){this.ngElementStrategy.setInputValue(u,b,f)},configurable:!0,enumerable:!0})}),c}var $i={providers:[ui()]};var Bt=(t=>(t.CART_AMOUNT="CART_AMOUNT",t.ITEM_COUNT="ITEM_COUNT",t))(Bt||{});var Q=Ki(zi());Q.filters.define("default",function(n){return typeof n>"u"||n==null?"":ln(n)});+Q.filters.define("max",(n,e)=>{let t=Number(n),o=Number(e);return isNaN(t)||isNaN(o)?n:t>o?e:n});Q.filters.define("min",(n,e)=>{let t=Number(n),o=Number(e);return isNaN(t)||isNaN(o)?n:t<o?e:n});Q.filters.define("fallback",(n,e)=>n==null||n===""?e:n);Q.filters.define("manipulate_quantity",(n,e,t)=>{if(e??=1,t??=100,e>t)return W.error("Invalid range: min should be less than or equal to max."),n;if(n>=e&&n<=t)return n;let o=n%t;return o<e?e:o});Q.filters.define("apply_discount_perc",(n,e,t=1/0)=>{if(n=+n,isNaN(n))return W.error("Need value as a number for `apply_discount_perc` filter"),NaN;if(e<0||e>100)return W.error("Invalid percent value for `apply_discount_perc` filter. Must be between 0 and 100."),NaN;let o=n*e/100;return n-Math.min(t,o)});Q.filters.define("apply_discount_fixed",(n,e)=>(n=+n,isNaN(n)?(W.error("Need value as a number for `apply_discount_fixed` filter"),NaN):Math.max(0,n-e)));Q.filters.define("currency",n=>(n=+n,isNaN(n)?(W.error("Need value as a number for `currency` filter"),NaN):Qe(n)));Q.filters.define("split",(n,e,t)=>{if(typeof n!="string")return W.error("Need value as a string for `split` filter"),"";if(e==null)return W.error("Need delimiter for `split` filter"),"";if(t==null||isNaN(Number(t)))return W.error("Need a valid index for `split` filter"),"";let o=n.split(String(e)),a=Number(t),c=a<0?o.length+a:a;return o[c].trim()??""});Q.defaultConfig.defaultFilter="default";Q.defaultConfig.useWith=!0;Q.defaultConfig.autoEscape=!1;var sn={'"':""","\\":"\","\n":"\\n"," ":"\\t"};function ln(n){return String(n).replace(/["\\\n\t]/g,e=>sn[e])}function cn(n){if(!n)return"";let e=/({{{\s*([^}]+?)\s*}}}|{{\s*&\s*([^}]+?)\s*}})/g;return n.replace(e,(t,o,a,c)=>`{{ ${(a||c||"").trim()} }}`)}var Ke=(n,e,t)=>{e=be({discount:{},cart:{},product:{},bundle:{},variant:{},customer:{},svg:{},form:{},amount_left:null},e);try{return Q.render(cn(n),e)}catch(o){throw yi(o,"squirrelly-render",{extra:{template:n,values:e},triggerContext:t}),o}};var yt=class n{transform(e,t){return e?Ke(e,be({},t)):null}static \u0275fac=function(t){return new(t||n)};static \u0275pipe=oi({name:"cooeeDynamicVariables",type:n,pure:!0})};var Ht={};(function n(e,t,o,a){var c=!!(e.Worker&&e.Blob&&e.Promise&&e.OffscreenCanvas&&e.OffscreenCanvasRenderingContext2D&&e.HTMLCanvasElement&&e.HTMLCanvasElement.prototype.transferControlToOffscreen&&e.URL&&e.URL.createObjectURL),u=typeof Path2D=="function"&&typeof DOMMatrix=="function",f=(function(){if(!e.OffscreenCanvas)return!1;var r=new OffscreenCanvas(1,1),i=r.getContext("2d");i.fillRect(0,0,1,1);var p=r.transferToImageBitmap();try{i.createPattern(p,"no-repeat")}catch{return!1}return!0})();function b(){}function D(r){var i=t.exports.Promise,p=i!==void 0?i:e.Promise;return typeof p=="function"?new p(r):(r(b,b),null)}var Y=(function(r,i){return{transform:function(p){if(r)return p;if(i.has(p))return i.get(p);var g=new OffscreenCanvas(p.width,p.height),C=g.getContext("2d");return C.drawImage(p,0,0),i.set(p,g),g},clear:function(){i.clear()}}})(f,new Map),Te=(function(){var r=Math.floor(16.666666666666668),i,p,g={},C=0;return typeof requestAnimationFrame=="function"&&typeof cancelAnimationFrame=="function"?(i=function(x){var w=Math.random();return g[w]=requestAnimationFrame(function h(_){C===_||C+r-1<_?(C=_,delete g[w],x()):g[w]=requestAnimationFrame(h)}),w},p=function(x){g[x]&&cancelAnimationFrame(g[x])}):(i=function(x){return setTimeout(x,r)},p=function(x){return clearTimeout(x)}),{frame:i,cancel:p}})(),Ee=(function(){var r,i,p={};function g(C){function x(w,h){C.postMessage({options:w||{},callback:h})}C.init=function(h){var _=h.transferControlToOffscreen();C.postMessage({canvas:_},[_])},C.fire=function(h,_,v){if(i)return x(h,null),i;var E=Math.random().toString(36).slice(2);return i=D(function(T){function F(I){I.data.callback===E&&(delete p[E],C.removeEventListener("message",F),i=null,Y.clear(),v(),T())}C.addEventListener("message",F),x(h,E),p[E]=F.bind(null,{data:{callback:E}})}),i},C.reset=function(){C.postMessage({reset:!0});for(var h in p)p[h](),delete p[h]}}return function(){if(r)return r;if(!o&&c){var C=["var CONFETTI, SIZE = {}, module = {};","("+n.toString()+")(this, module, true, SIZE);","onmessage = function(msg) {"," if (msg.data.options) {"," CONFETTI(msg.data.options).then(function () {"," if (msg.data.callback) {"," postMessage({ callback: msg.data.callback });"," }"," });"," } else if (msg.data.reset) {"," CONFETTI && CONFETTI.reset();"," } else if (msg.data.resize) {"," SIZE.width = msg.data.resize.width;"," SIZE.height = msg.data.resize.height;"," } else if (msg.data.canvas) {"," SIZE.width = msg.data.canvas.width;"," SIZE.height = msg.data.canvas.height;"," CONFETTI = module.exports.create(msg.data.canvas);"," }","}"].join(`
|
|
11
11
|
`);try{r=new Worker(URL.createObjectURL(new Blob([C])))}catch(x){return typeof console!==void 0&&typeof console.warn=="function"&&console.warn("\u{1F38A} Could not load worker",x),null}g(r)}return r}})(),at={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,x:.5,y:.5,shapes:["square","circle"],zIndex:100,colors:["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff"],disableForReducedMotion:!1,scalar:1};function Je(r,i){return i?i(r):r}function Ye(r){return r!=null}function L(r,i,p){return Je(r&&Ye(r[i])?r[i]:at[i],p)}function Mt(r){return r<0?0:Math.floor(r)}function Xe(r,i){return Math.floor(Math.random()*(i-r))+r}function oe(r){return parseInt(r,16)}function Oe(r){return r.map(xe)}function xe(r){var i=String(r).replace(/[^0-9a-f]/gi,"");return i.length<6&&(i=i[0]+i[0]+i[1]+i[1]+i[2]+i[2]),{r:oe(i.substring(0,2)),g:oe(i.substring(2,4)),b:oe(i.substring(4,6))}}function Pt(r){var i=L(r,"origin",Object);return i.x=L(i,"x",Number),i.y=L(i,"y",Number),i}function kt(r){r.width=document.documentElement.clientWidth,r.height=document.documentElement.clientHeight}function st(r){var i=r.getBoundingClientRect();r.width=i.width,r.height=i.height}function lt(r){var i=document.createElement("canvas");return i.style.position="fixed",i.style.top="0px",i.style.left="0px",i.style.pointerEvents="none",i.style.zIndex=r,i}function ct(r,i,p,g,C,x,w,h,_){r.save(),r.translate(i,p),r.rotate(x),r.scale(g,C),r.arc(0,0,1,w,h,_),r.restore()}function dt(r){var i=r.angle*(Math.PI/180),p=r.spread*(Math.PI/180);return{x:r.x,y:r.y,wobble:Math.random()*10,wobbleSpeed:Math.min(.11,Math.random()*.1+.05),velocity:r.startVelocity*.5+Math.random()*r.startVelocity,angle2D:-i+(.5*p-Math.random()*p),tiltAngle:(Math.random()*(.75-.25)+.25)*Math.PI,color:r.color,shape:r.shape,tick:0,totalTicks:r.ticks,decay:r.decay,drift:r.drift,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:r.gravity*3,ovalScalar:.6,scalar:r.scalar,flat:r.flat}}function Le(r,i){i.x+=Math.cos(i.angle2D)*i.velocity+i.drift,i.y+=Math.sin(i.angle2D)*i.velocity+i.gravity,i.velocity*=i.decay,i.flat?(i.wobble=0,i.wobbleX=i.x+10*i.scalar,i.wobbleY=i.y+10*i.scalar,i.tiltSin=0,i.tiltCos=0,i.random=1):(i.wobble+=i.wobbleSpeed,i.wobbleX=i.x+10*i.scalar*Math.cos(i.wobble),i.wobbleY=i.y+10*i.scalar*Math.sin(i.wobble),i.tiltAngle+=.1,i.tiltSin=Math.sin(i.tiltAngle),i.tiltCos=Math.cos(i.tiltAngle),i.random=Math.random()+2);var p=i.tick++/i.totalTicks,g=i.x+i.random*i.tiltCos,C=i.y+i.random*i.tiltSin,x=i.wobbleX+i.random*i.tiltCos,w=i.wobbleY+i.random*i.tiltSin;if(r.fillStyle="rgba("+i.color.r+", "+i.color.g+", "+i.color.b+", "+(1-p)+")",r.beginPath(),u&&i.shape.type==="path"&&typeof i.shape.path=="string"&&Array.isArray(i.shape.matrix))r.fill(l(i.shape.path,i.shape.matrix,i.x,i.y,Math.abs(x-g)*.1,Math.abs(w-C)*.1,Math.PI/10*i.wobble));else if(i.shape.type==="bitmap"){var h=Math.PI/10*i.wobble,_=Math.abs(x-g)*.1,v=Math.abs(w-C)*.1,E=i.shape.bitmap.width*i.scalar,T=i.shape.bitmap.height*i.scalar,F=new DOMMatrix([Math.cos(h)*_,Math.sin(h)*_,-Math.sin(h)*v,Math.cos(h)*v,i.x,i.y]);F.multiplySelf(new DOMMatrix(i.shape.matrix));var I=r.createPattern(Y.transform(i.shape.bitmap),"no-repeat");I.setTransform(F),r.globalAlpha=1-p,r.fillStyle=I,r.fillRect(i.x-E/2,i.y-T/2,E,T),r.globalAlpha=1}else if(i.shape==="circle")r.ellipse?r.ellipse(i.x,i.y,Math.abs(x-g)*i.ovalScalar,Math.abs(w-C)*i.ovalScalar,Math.PI/10*i.wobble,0,2*Math.PI):ct(r,i.x,i.y,Math.abs(x-g)*i.ovalScalar,Math.abs(w-C)*i.ovalScalar,Math.PI/10*i.wobble,0,2*Math.PI);else if(i.shape==="star")for(var S=Math.PI/2*3,O=4*i.scalar,$=8*i.scalar,G=i.x,X=i.y,re=5,k=Math.PI/re;re--;)G=i.x+Math.cos(S)*$,X=i.y+Math.sin(S)*$,r.lineTo(G,X),S+=k,G=i.x+Math.cos(S)*O,X=i.y+Math.sin(S)*O,r.lineTo(G,X),S+=k;else r.moveTo(Math.floor(i.x),Math.floor(i.y)),r.lineTo(Math.floor(i.wobbleX),Math.floor(C)),r.lineTo(Math.floor(x),Math.floor(w)),r.lineTo(Math.floor(g),Math.floor(i.wobbleY));return r.closePath(),r.fill(),i.tick<i.totalTicks}function et(r,i,p,g,C){var x=i.slice(),w=r.getContext("2d"),h,_,v=D(function(E){function T(){h=_=null,w.clearRect(0,0,g.width,g.height),Y.clear(),C(),E()}function F(){o&&!(g.width===a.width&&g.height===a.height)&&(g.width=r.width=a.width,g.height=r.height=a.height),!g.width&&!g.height&&(p(r),g.width=r.width,g.height=r.height),w.clearRect(0,0,g.width,g.height),x=x.filter(function(I){return Le(w,I)}),x.length?h=Te.frame(F):T()}h=Te.frame(F),_=T});return{addFettis:function(E){return x=x.concat(E),v},canvas:r,promise:v,reset:function(){h&&Te.cancel(h),_&&_()}}}function tt(r,i){var p=!r,g=!!L(i||{},"resize"),C=!1,x=L(i,"disableForReducedMotion",Boolean),w=c&&!!L(i||{},"useWorker"),h=w?Ee():null,_=p?kt:st,v=r&&h?!!r.__confetti_initialized:!1,E=typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion)").matches,T;function F(S,O,$){for(var G=L(S,"particleCount",Mt),X=L(S,"angle",Number),re=L(S,"spread",Number),k=L(S,"startVelocity",Number),_e=L(S,"decay",Number),Fe=L(S,"gravity",Number),De=L(S,"drift",Number),K=L(S,"colors",Oe),me=L(S,"ticks",Number),pt=L(S,"shapes"),ee=L(S,"scalar"),Ae=!!L(S,"flat"),Ne=Pt(S),Be=G,ae=[],ue=r.width*Ne.x,Qi=r.height*Ne.y;Be--;)ae.push(dt({x:ue,y:Qi,angle:X,spread:re,startVelocity:k,color:K[Be%K.length],shape:pt[Xe(0,pt.length)],ticks:me,decay:_e,gravity:Fe,drift:De,scalar:ee,flat:Ae}));return T?T.addFettis(ae):(T=et(r,ae,_,O,$),T.promise)}function I(S){var O=x||L(S,"disableForReducedMotion",Boolean),$=L(S,"zIndex",Number);if(O&&E)return D(function(k){k()});p&&T?r=T.canvas:p&&!r&&(r=lt($),document.body.appendChild(r)),g&&!v&&_(r);var G={width:r.width,height:r.height};h&&!v&&h.init(r),v=!0,h&&(r.__confetti_initialized=!0);function X(){if(h){var k={getBoundingClientRect:function(){if(!p)return r.getBoundingClientRect()}};_(k),h.postMessage({resize:{width:k.width,height:k.height}});return}G.width=G.height=null}function re(){T=null,g&&(C=!1,e.removeEventListener("resize",X)),p&&r&&(document.body.contains(r)&&document.body.removeChild(r),r=null,v=!1)}return g&&!C&&(C=!0,e.addEventListener("resize",X,!1)),h?h.fire(S,G,re):F(S,G,re)}return I.reset=function(){h&&h.reset(),T&&T.reset()},I}var ke;function s(){return ke||(ke=tt(null,{useWorker:!0,resize:!0})),ke}function l(r,i,p,g,C,x,w){var h=new Path2D(r),_=new Path2D;_.addPath(h,new DOMMatrix(i));var v=new Path2D;return v.addPath(_,new DOMMatrix([Math.cos(w)*C,Math.sin(w)*C,-Math.sin(w)*x,Math.cos(w)*x,p,g])),v}function d(r){if(!u)throw new Error("path confetti are not supported in this browser");var i,p;typeof r=="string"?i=r:(i=r.path,p=r.matrix);var g=new Path2D(i),C=document.createElement("canvas"),x=C.getContext("2d");if(!p){for(var w=1e3,h=w,_=w,v=0,E=0,T,F,I=0;I<w;I+=2)for(var S=0;S<w;S+=2)x.isPointInPath(g,I,S,"nonzero")&&(h=Math.min(h,I),_=Math.min(_,S),v=Math.max(v,I),E=Math.max(E,S));T=v-h,F=E-_;var O=10,$=Math.min(O/T,O/F);p=[$,0,0,$,-Math.round(T/2+h)*$,-Math.round(F/2+_)*$]}return{type:"path",path:i,matrix:p}}function m(r){var i,p=1,g="#000000",C='"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif';typeof r=="string"?i=r:(i=r.text,p="scalar"in r?r.scalar:p,C="fontFamily"in r?r.fontFamily:C,g="color"in r?r.color:g);var x=10*p,w=""+x+"px "+C,h=new OffscreenCanvas(x,x),_=h.getContext("2d");_.font=w;var v=_.measureText(i),E=Math.ceil(v.actualBoundingBoxRight+v.actualBoundingBoxLeft),T=Math.ceil(v.actualBoundingBoxAscent+v.actualBoundingBoxDescent),F=2,I=v.actualBoundingBoxLeft+F,S=v.actualBoundingBoxAscent+F;E+=F+F,T+=F+F,h=new OffscreenCanvas(E,T),_=h.getContext("2d"),_.font=w,_.fillStyle=g,_.fillText(i,I,S);var O=1/p;return{type:"bitmap",bitmap:h.transferToImageBitmap(),matrix:[O,0,0,O,-E*O/2,-T*O/2]}}t.exports=function(){return s().apply(this,arguments)},t.exports.reset=function(){s().reset()},t.exports.create=tt,t.exports.shapeFromPath=d,t.exports.shapeFromText=m})((function(){return typeof window<"u"?window:typeof self<"u"?self:this||{}})(),Ht,!1);var qi=Ht.exports,po=Ht.exports.create;var Ct=class{static DEFAULTS={scalar:1.4,zIndex:1e4,shapes:["circle","circle","square"],colors:["#f51c8f","#2179e2","#d52dc8","#01a9d9","#78ff44","#fdff6a"]};static async basic(){await this.fire({particleCount:100,spread:70,origin:{y:.6}})}static async leftRight(e=100){let t=[],o=Date.now()+2e3,a=()=>{t.push(this.fire({angle:60,spread:55,origin:{x:0}}),this.fire({angle:120,spread:55,origin:{x:1}})),Date.now()<o&&e>0&&(requestAnimationFrame(a),e--)};a(),await Promise.all(t)}static async realistic(){await Promise.all([this.realisticFire(.25,{spread:26,startVelocity:55}),this.realisticFire(.2,{spread:60}),this.realisticFire(.35,{spread:100,decay:.91,scalar:.8}),this.realisticFire(.1,{spread:120,startVelocity:25,decay:.92,scalar:1.2}),this.realisticFire(.1,{spread:120,startVelocity:45})])}static async fire(e){Object.assign(e,this.DEFAULTS,e),e.particleCount=e.particleCount??this.DEFAULTS.colors.length,await qi(e)}static async realisticFire(e,t){let a={origin:{y:.7}};await this.fire(Object.assign({},a,t,{particleCount:Math.floor(200*e)}))}};var dn=(n,e)=>e.minValue;function pn(n,e){if(n&1&&(Se(0,"div",7),Ce(1,"safeHtml")),n&2){let t=y().$implicit;ve("innerHTML",Ve(1,1,t.minValue+" Products"),ce)}}function mn(n,e){if(n&1&&(Se(0,"div",7),Ce(1,"cooeeCurrency"),Ce(2,"safeHtml")),n&2){let t=y().$implicit;ve("innerHTML",Ve(2,3,Ve(1,1,t.minValue)),ce)}}function un(n,e){if(n&1&&(je(0,"li",6)(1,"div"),N(2,pn,2,3,"div",7)(3,mn,3,5,"div",7),Se(4,"img",8),je(5,"div",9),Z(6),$e()()()),n&2){let t=e.$implicit,o=y(2);nt("left",t.calculatedAlignment+"%"),V(2),B((o.progressBarConfig==null?null:o.progressBarConfig.rewardBasis)===o.RewardBasis.ITEM_COUNT?2:3),V(2),ve("src",o.getIconURL(t),He),V(2),ot(t.label)}}function fn(n,e){if(n&1&&(Se(0,"div",0),Ce(1,"cooeeDynamicVariables"),Ce(2,"safeHtml"),je(3,"div",1)(4,"ul",2)(5,"div",3),Se(6,"div",4),$e(),ge(7,un,7,5,"li",5,dn),$e()()),n&2){let t=y(),o=t.calculatedState(),a=o.nextMilestone?o.nextMilestone.reachingText:o.lastMilestone.reachedText;ve("innerHTML",Ve(2,6,mi(1,3,a,t.localDynamicVariables())),ce),V(6),nt("width",o.cartValuePercentage+"%"),V(),he(o.milestones)}}var xt=class n extends se{cart;localDynamicVariables=fe({});calculatedState=fe({});progressBarConfig;RewardBasis=Bt;constructor(){super()}engagementTriggerReceived(e){this.progressBarConfig=e.progressBarConfig}ngOnInit(){super.ngOnInit(),this.calculateMilestonesSilently()}update(){this.calculateMilestonesSilently()}getIconURL(e){return e.rewardType===ut.FREE_SHIPPING?"https://img.icons8.com/ios-filled/50/FFFFFF/free-shipping.png":e.rewardType===ut.DISCOUNT?"https://img.icons8.com/ios-glyphs/30/FFFFFF/sale-price-tag.png":e.rewardType===ut.FREE_AUTO_GIFT?"https://img.icons8.com/ios-filled/50/FFFFFF/gift--v1.png":""}calculateMilestonesSilently(){this.calculateMilestones().catch(e=>W.error(e))}async calculateMilestones(){let e=this.engagementTrigger,t=this.progressBarConfig;if(!t?.milestones?.length){W.warn("Milestones not available in progress bar config",e);return}let o=await this.cart.getNormalisedCart(),a=t.milestones.at(-1),c=t?.reachedAmountOrCount??o.originalAmount,u=t.totalProgress??0;W.verbose("Cart value:",c,`, percentage: ${u}%`),this.celebrate(e,c);let f={milestonesReady:!0,cartValuePercentage:u,milestones:t.milestones},b=t.milestones.find(D=>!D.reached);if(b){let D=Qe(b.minValue-c);if(t.rewardBasis==="ITEM_COUNT"){let Y=b.minValue-c;D=`${Y} ${Y===1?"product":"products"}`}this.localDynamicVariables.set({amount_left:D}),f.nextMilestone=b,this.calculatedState.set(f);return}f.lastMilestone=a,this.calculatedState.set(f)}celebrate(e,t){let c=[...e.progressBarConfig.milestones].reverse().find(b=>b.minValue<t);if(!c)return;let u=`lc/en/${e.shortID}/${c.minValue}`;sessionStorage.getItem(u)||(sessionStorage.setItem(u,"1"),this.progressBarConfig?.noConfetti||Ct.realistic())}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["cooee-progressbar"]],inputs:{cart:"cart"},features:[te(ie()),z],decls:1,vars:1,consts:[[1,"heading",3,"innerHTML"],[1,"milestone-container"],[1,"milestone-list"],[1,"untracked-path"],[1,"tracked-path"],[1,"milestone-list-item",3,"left"],[1,"milestone-list-item"],[1,"milestone-value",3,"innerHTML"],["width","20","height","20","alt","milestone icon",1,"milestone-icon",3,"src"],[1,"milestone-label"]],template:function(t,o){t&1&&N(0,fn,9,8),t&2&&B(o.calculatedState().milestonesReady?0:-1)},dependencies:[yt,Ge,Vi],styles:[`:host{display:block;padding:10px;background:linear-gradient(0deg,rgba(var(--lc-primary-color),.1) 0%,transparent 100%)}.milestone-container{width:95%;margin:8px 0}.heading{font-weight:500;text-align:center;font-size:12px}.milestone-list{display:flex;align-items:center;position:relative;font-size:10px;font-weight:500}.untracked-path{width:100%;background-color:#e5e7eb;height:4px;position:absolute}.tracked-path{background-color:rgba(var(--lc-primary-color));height:100%;display:block;transition:width .5s ease-in-out}.milestone-list{padding:0;margin:0}.milestone-list-item{position:relative;display:flex;flex-direction:column;align-items:center;height:75px}.milestone-list-item>div{display:flex;flex-direction:column;align-items:center;justify-content:space-between;position:absolute;height:100%;width:100px}.milestone-icon{padding:5px;border-radius:1000px;background-color:rgba(var(--lc-primary-color))}
|
|
12
|
-
`],encapsulation:3})};var gn=["numberVariable"],_t=class n extends se{numberSlot;savingsBarConfig;textParts=fe({start:"",end:""});globalIntervals=[];constructor(){super()}ngAfterViewInit(){this.updateUIVars()}engagementTriggerReceived(e){this.savingsBarConfig=e.content.savingsBarConfig,this.elementRef.nativeElement.classList.add("lc_"+e.entryAnimation?.toLowerCase()),this.savingsBarConfig.iconURL&&this.elementRef.nativeElement.style.setProperty("--lc-discount-icon",this.savingsBarConfig.iconURL)}update(){this.updateUIVars()}updateUIVars(){let e=be(be({},this.engagementTrigger.getCartMagicVariables()),
|
|
12
|
+
`],encapsulation:3})};var gn=["numberVariable"],_t=class n extends se{numberSlot;savingsBarConfig;textParts=fe({start:"",end:""});globalIntervals=[];constructor(){super()}ngAfterViewInit(){this.updateUIVars()}engagementTriggerReceived(e){this.savingsBarConfig=e.content.savingsBarConfig,this.elementRef.nativeElement.classList.add("lc_"+e.entryAnimation?.toLowerCase()),this.savingsBarConfig.iconURL&&this.elementRef.nativeElement.style.setProperty("--lc-discount-icon",this.savingsBarConfig.iconURL)}update(){this.updateUIVars()}updateUIVars(){let e=be(be({},this.engagementTrigger.getCartMagicVariables()),Ci("total_savings",this.savingsBarConfig.totalSavings)),t=Ke(this.savingsBarConfig.text,{cart:e},this.triggerContext),o=t.match(/[\d.,]+/)?.[0];if(!o){W.error("No amount found in text",t);return}let[a,c]=t.split(o);this.textParts.set({start:a,end:c}),this.savingsBarConfig.animateNumber?this.runAnimation(o):this.numberSlot.nativeElement.innerHTML=o}runSlotMachineAnimation(e="0"){let t=this.numberSlot.nativeElement;t.innerHTML="";let o=this.savingsBarConfig.animationDuration/e.length;this.clearPreviousIntervals();for(let a=0;a<e.length;a++){let c=document.createElement("div");c.className="digit",c.style.display="inline-block",t.appendChild(c);let u=setInterval(()=>{let f=Math.floor(Math.random()*10);c.innerHTML=`<div>${f}</div>`},50);this.globalIntervals.push(u),setTimeout(()=>{clearInterval(u);let f=e?.[a]??Math.floor(Math.random()*10);c.innerHTML=`${f}`},(a+1)*o)}}clearPreviousIntervals(){this.globalIntervals.forEach(clearInterval),this.globalIntervals=[]}runIncrementalAnimation(e){let t=performance.now(),o=a=>{let c=Math.min((a-t)/this.savingsBarConfig.animationDuration,1);this.numberSlot.nativeElement.innerHTML=Math.floor(e*c).toString(),c<1&&requestAnimationFrame(o)};requestAnimationFrame(o)}runAnimation(e){this.savingsBarConfig.animation==="SLOT_MACHINE"?this.runSlotMachineAnimation(e):this.savingsBarConfig.animation==="INCREMENTAL"&&this.runIncrementalAnimation(Number(e))}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["cooee-savings-bar"]],viewQuery:function(t,o){if(t&1&&Ue(gn,5),t&2){let a;ze(a=qe())&&(o.numberSlot=a.first)}},features:[z],decls:6,vars:2,consts:[["numberVariable",""],[1,"container"],[1,"icon"],[1,"primary-text",3,"innerHTML"],[1,"counter-text"],[1,"final-text",3,"innerHTML"]],template:function(t,o){t&1&&(je(0,"div",1),Se(1,"div",2)(2,"div",3)(3,"div",4,0)(5,"div",5),$e()),t&2&&(V(2),ve("innerHTML",o.textParts().start,ce),V(3),ve("innerHTML",o.textParts().end,ce))},styles:[`:host{display:block}.container{white-space:pre;display:flex;justify-content:center;align-items:center;background-color:rgba(var(--lc-primary-button-bg-color, 0 162 81));color:rgba(var(--lc-primary-button-color, 255 255 255));padding:8px;border-radius:4px 4px 0 0;overflow:hidden}.container .icon{background-image:var(--lc-discount-icon, url(https://img.icons8.com/ios-glyphs/30/FFFFFF/discount--v1.png));background-position:center;background-size:cover;height:20px;width:20px;margin-right:2px}
|
|
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-YQZ6AMST.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-E4FB7GMC.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 vi.set("muted",!0),await this.openDialog(a,o)}}async openDialog(e,t,o){await _i();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:bi(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=hi.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)}
|
|
20
|
-
`],encapsulation:3})};
|
|
20
|
+
`],encapsulation:3})};xi("CooeeWidgetSDK");(async()=>{let n=await gi($i),e=(t,o)=>{let a=ji(t,{injector:n.injector});customElements.define(o,a)};e(Vt,"cooee-sticky-atc"),e(_t,"cooee-savings-bar"),e(xt,"cooee-progressbar"),e(Tt,"cooee-video-playlist"),e(Et,"cooee-video-popup"),e(St,"cooee-video-stories"),e(wi,"cooee-product-options-picker"),e(It,"cooee-collection-filter"),sessionStorage.cooeeDebug&&import("./debugger.component-UQRQT3KM.js").then(t=>{e(t.DebuggerComponent,"cooee-debugger")}),window.cooeeShowQuickItem=(t,o)=>{n.injector.get(wt).showItemQuickView(t,o)}})();
|
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.
|
|
4
|
+
"version": "13.1.11",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"lint": "ng lint",
|
|
7
7
|
"integrity": "./scripts/validate-integrity.sh",
|
package/dist/chunk-ALW6N5YB.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Bb as De,Cb as ce,Eb as nt,_ as et,v as Ze,yb as tt,zb as rt}from"./chunk-DTWV2VE6.js";import{c as ne,e as mr,g as hr,h as fe}from"./chunk-U4XWPFUW.js";var it=mr((ot,Ce)=>{"use strict";(function(m){if(typeof ot=="object"&&typeof Ce<"u")Ce.exports=m();else if(typeof define=="function"&&define.amd)define([],m);else{var l;typeof window<"u"?l=window:typeof global<"u"?l=global:typeof self<"u"?l=self:l=this,l.localforage=m()}})(function(){var m,l,w;return(function g(y,R,S){function C(F,V){if(!R[F]){if(!y[F]){var h=typeof ne=="function"&≠if(!V&&h)return h(F,!0);if(E)return E(F,!0);var p=new Error("Cannot find module '"+F+"'");throw p.code="MODULE_NOT_FOUND",p}var N=R[F]={exports:{}};y[F][0].call(N.exports,function(P){var Y=y[F][1][P];return C(Y||P)},N,N.exports,g,y,R,S)}return R[F].exports}for(var E=typeof ne=="function"&&ne,O=0;O<S.length;O++)C(S[O]);return C})({1:[function(g,y,R){(function(S){"use strict";var C=S.MutationObserver||S.WebKitMutationObserver,E;if(C){var O=0,F=new C(P),V=S.document.createTextNode("");F.observe(V,{characterData:!0}),E=function(){V.data=O=++O%2}}else if(!S.setImmediate&&typeof S.MessageChannel<"u"){var h=new S.MessageChannel;h.port1.onmessage=P,E=function(){h.port2.postMessage(0)}}else"document"in S&&"onreadystatechange"in S.document.createElement("script")?E=function(){var B=S.document.createElement("script");B.onreadystatechange=function(){P(),B.onreadystatechange=null,B.parentNode.removeChild(B),B=null},S.document.documentElement.appendChild(B)}:E=function(){setTimeout(P,0)};var p,N=[];function P(){p=!0;for(var B,k,M=N.length;M;){for(k=N,N=[],B=-1;++B<M;)k[B]();M=N.length}p=!1}y.exports=Y;function Y(B){N.push(B)===1&&!p&&E()}}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(g,y,R){"use strict";var S=g(1);function C(){}var E={},O=["REJECTED"],F=["FULFILLED"],V=["PENDING"];y.exports=h;function h(d){if(typeof d!="function")throw new TypeError("resolver must be a function");this.state=V,this.queue=[],this.outcome=void 0,d!==C&&Y(this,d)}h.prototype.catch=function(d){return this.then(null,d)},h.prototype.then=function(d,T){if(typeof d!="function"&&this.state===F||typeof T!="function"&&this.state===O)return this;var _=new this.constructor(C);if(this.state!==V){var D=this.state===F?d:T;N(_,D,this.outcome)}else this.queue.push(new p(_,d,T));return _};function p(d,T,_){this.promise=d,typeof T=="function"&&(this.onFulfilled=T,this.callFulfilled=this.otherCallFulfilled),typeof _=="function"&&(this.onRejected=_,this.callRejected=this.otherCallRejected)}p.prototype.callFulfilled=function(d){E.resolve(this.promise,d)},p.prototype.otherCallFulfilled=function(d){N(this.promise,this.onFulfilled,d)},p.prototype.callRejected=function(d){E.reject(this.promise,d)},p.prototype.otherCallRejected=function(d){N(this.promise,this.onRejected,d)};function N(d,T,_){S(function(){var D;try{D=T(_)}catch(U){return E.reject(d,U)}D===d?E.reject(d,new TypeError("Cannot resolve promise with itself")):E.resolve(d,D)})}E.resolve=function(d,T){var _=B(P,T);if(_.status==="error")return E.reject(d,_.value);var D=_.value;if(D)Y(d,D);else{d.state=F,d.outcome=T;for(var U=-1,W=d.queue.length;++U<W;)d.queue[U].callFulfilled(T)}return d},E.reject=function(d,T){d.state=O,d.outcome=T;for(var _=-1,D=d.queue.length;++_<D;)d.queue[_].callRejected(T);return d};function P(d){var T=d&&d.then;if(d&&(typeof d=="object"||typeof d=="function")&&typeof T=="function")return function(){T.apply(d,arguments)}}function Y(d,T){var _=!1;function D(H){_||(_=!0,E.reject(d,H))}function U(H){_||(_=!0,E.resolve(d,H))}function W(){T(U,D)}var $=B(W);$.status==="error"&&D($.value)}function B(d,T){var _={};try{_.value=d(T),_.status="success"}catch(D){_.status="error",_.value=D}return _}h.resolve=k;function k(d){return d instanceof this?d:E.resolve(new this(C),d)}h.reject=M;function M(d){var T=new this(C);return E.reject(T,d)}h.all=ge;function ge(d){var T=this;if(Object.prototype.toString.call(d)!=="[object Array]")return this.reject(new TypeError("must be an array"));var _=d.length,D=!1;if(!_)return this.resolve([]);for(var U=new Array(_),W=0,$=-1,H=new this(C);++$<_;)G(d[$],$);return H;function G(ee,ae){T.resolve(ee).then(pe,function(J){D||(D=!0,E.reject(H,J))});function pe(J){U[ae]=J,++W===_&&!D&&(D=!0,E.resolve(H,U))}}}h.race=q;function q(d){var T=this;if(Object.prototype.toString.call(d)!=="[object Array]")return this.reject(new TypeError("must be an array"));var _=d.length,D=!1;if(!_)return this.resolve([]);for(var U=-1,W=new this(C);++U<_;)$(d[U]);return W;function $(H){T.resolve(H).then(function(G){D||(D=!0,E.resolve(W,G))},function(G){D||(D=!0,E.reject(W,G))})}}},{1:1}],3:[function(g,y,R){(function(S){"use strict";typeof S.Promise!="function"&&(S.Promise=g(2))}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(g,y,R){"use strict";var S=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function C(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function E(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var O=E();function F(){try{if(!O||!O.open)return!1;var e=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),r=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!e||r)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function V(e,r){e=e||[],r=r||{};try{return new Blob(e,r)}catch(n){if(n.name!=="TypeError")throw n;for(var t=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,o=new t,i=0;i<e.length;i+=1)o.append(e[i]);return o.getBlob(r.type)}}typeof Promise>"u"&&g(3);var h=Promise;function p(e,r){r&&e.then(function(t){r(null,t)},function(t){r(t)})}function N(e,r,t){typeof r=="function"&&e.then(r),typeof t=="function"&&e.catch(t)}function P(e){return typeof e!="string"&&(console.warn(e+" used as a key, but it is not a string."),e=String(e)),e}function Y(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var B="local-forage-detect-blob-support",k=void 0,M={},ge=Object.prototype.toString,q="readonly",d="readwrite";function T(e){for(var r=e.length,t=new ArrayBuffer(r),o=new Uint8Array(t),i=0;i<r;i++)o[i]=e.charCodeAt(i);return t}function _(e){return new h(function(r){var t=e.transaction(B,d),o=V([""]);t.objectStore(B).put(o,"key"),t.onabort=function(i){i.preventDefault(),i.stopPropagation(),r(!1)},t.oncomplete=function(){var i=navigator.userAgent.match(/Chrome\/(\d+)/),n=navigator.userAgent.match(/Edge\//);r(n||!i||parseInt(i[1],10)>=43)}}).catch(function(){return!1})}function D(e){return typeof k=="boolean"?h.resolve(k):_(e).then(function(r){return k=r,k})}function U(e){var r=M[e.name],t={};t.promise=new h(function(o,i){t.resolve=o,t.reject=i}),r.deferredOperations.push(t),r.dbReady?r.dbReady=r.dbReady.then(function(){return t.promise}):r.dbReady=t.promise}function W(e){var r=M[e.name],t=r.deferredOperations.pop();if(t)return t.resolve(),t.promise}function $(e,r){var t=M[e.name],o=t.deferredOperations.pop();if(o)return o.reject(r),o.promise}function H(e,r){return new h(function(t,o){if(M[e.name]=M[e.name]||Pe(),e.db)if(r)U(e),e.db.close();else return t(e.db);var i=[e.name];r&&i.push(e.version);var n=O.open.apply(O,i);r&&(n.onupgradeneeded=function(a){var s=n.result;try{s.createObjectStore(e.storeName),a.oldVersion<=1&&s.createObjectStore(B)}catch(u){if(u.name==="ConstraintError")console.warn('The database "'+e.name+'" has been upgraded from version '+a.oldVersion+" to version "+a.newVersion+', but the storage "'+e.storeName+'" already exists.');else throw u}}),n.onerror=function(a){a.preventDefault(),o(n.error)},n.onsuccess=function(){var a=n.result;a.onversionchange=function(s){s.target.close()},t(a),W(e)}})}function G(e){return H(e,!1)}function ee(e){return H(e,!0)}function ae(e,r){if(!e.db)return!0;var t=!e.db.objectStoreNames.contains(e.storeName),o=e.version<e.db.version,i=e.version>e.db.version;if(o&&(e.version!==r&&console.warn('The database "'+e.name+`" can't be downgraded from version `+e.db.version+" to version "+e.version+"."),e.version=e.db.version),i||t){if(t){var n=e.db.version+1;n>e.version&&(e.version=n)}return!0}return!1}function pe(e){return new h(function(r,t){var o=new FileReader;o.onerror=t,o.onloadend=function(i){var n=btoa(i.target.result||"");r({__local_forage_encoded_blob:!0,data:n,type:e.type})},o.readAsBinaryString(e)})}function J(e){var r=T(atob(e.data));return V([r],{type:e.type})}function Le(e){return e&&e.__local_forage_encoded_blob}function ht(e){var r=this,t=r._initReady().then(function(){var o=M[r._dbInfo.name];if(o&&o.dbReady)return o.dbReady});return N(t,e,e),t}function vt(e){U(e);for(var r=M[e.name],t=r.forages,o=0;o<t.length;o++){var i=t[o];i._dbInfo.db&&(i._dbInfo.db.close(),i._dbInfo.db=null)}return e.db=null,G(e).then(function(n){return e.db=n,ae(e)?ee(e):n}).then(function(n){e.db=r.db=n;for(var a=0;a<t.length;a++)t[a]._dbInfo.db=n}).catch(function(n){throw $(e,n),n})}function j(e,r,t,o){o===void 0&&(o=1);try{var i=e.db.transaction(e.storeName,r);t(null,i)}catch(n){if(o>0&&(!e.db||n.name==="InvalidStateError"||n.name==="NotFoundError"))return h.resolve().then(function(){if(!e.db||n.name==="NotFoundError"&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),ee(e)}).then(function(){return vt(e).then(function(){j(e,r,t,o-1)})}).catch(t);t(n)}}function Pe(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function gt(e){var r=this,t={db:null};if(e)for(var o in e)t[o]=e[o];var i=M[t.name];i||(i=Pe(),M[t.name]=i),i.forages.push(r),r._initReady||(r._initReady=r.ready,r.ready=ht);var n=[];function a(){return h.resolve()}for(var s=0;s<i.forages.length;s++){var u=i.forages[s];u!==r&&n.push(u._initReady().catch(a))}var f=i.forages.slice(0);return h.all(n).then(function(){return t.db=i.db,G(t)}).then(function(c){return t.db=c,ae(t,r._defaultConfig.version)?ee(t):c}).then(function(c){t.db=i.db=c,r._dbInfo=t;for(var v=0;v<f.length;v++){var b=f[v];b!==r&&(b._dbInfo.db=t.db,b._dbInfo.version=t.version)}})}function pt(e,r){var t=this;e=P(e);var o=new h(function(i,n){t.ready().then(function(){j(t._dbInfo,q,function(a,s){if(a)return n(a);try{var u=s.objectStore(t._dbInfo.storeName),f=u.get(e);f.onsuccess=function(){var c=f.result;c===void 0&&(c=null),Le(c)&&(c=J(c)),i(c)},f.onerror=function(){n(f.error)}}catch(c){n(c)}})}).catch(n)});return p(o,r),o}function yt(e,r){var t=this,o=new h(function(i,n){t.ready().then(function(){j(t._dbInfo,q,function(a,s){if(a)return n(a);try{var u=s.objectStore(t._dbInfo.storeName),f=u.openCursor(),c=1;f.onsuccess=function(){var v=f.result;if(v){var b=v.value;Le(b)&&(b=J(b));var I=e(b,v.key,c++);I!==void 0?i(I):v.continue()}else i()},f.onerror=function(){n(f.error)}}catch(v){n(v)}})}).catch(n)});return p(o,r),o}function bt(e,r,t){var o=this;e=P(e);var i=new h(function(n,a){var s;o.ready().then(function(){return s=o._dbInfo,ge.call(r)==="[object Blob]"?D(s.db).then(function(u){return u?r:pe(r)}):r}).then(function(u){j(o._dbInfo,d,function(f,c){if(f)return a(f);try{var v=c.objectStore(o._dbInfo.storeName);u===null&&(u=void 0);var b=v.put(u,e);c.oncomplete=function(){u===void 0&&(u=null),n(u)},c.onabort=c.onerror=function(){var I=b.error?b.error:b.transaction.error;a(I)}}catch(I){a(I)}})}).catch(a)});return p(i,t),i}function _t(e,r){var t=this;e=P(e);var o=new h(function(i,n){t.ready().then(function(){j(t._dbInfo,d,function(a,s){if(a)return n(a);try{var u=s.objectStore(t._dbInfo.storeName),f=u.delete(e);s.oncomplete=function(){i()},s.onerror=function(){n(f.error)},s.onabort=function(){var c=f.error?f.error:f.transaction.error;n(c)}}catch(c){n(c)}})}).catch(n)});return p(o,r),o}function wt(e){var r=this,t=new h(function(o,i){r.ready().then(function(){j(r._dbInfo,d,function(n,a){if(n)return i(n);try{var s=a.objectStore(r._dbInfo.storeName),u=s.clear();a.oncomplete=function(){o()},a.onabort=a.onerror=function(){var f=u.error?u.error:u.transaction.error;i(f)}}catch(f){i(f)}})}).catch(i)});return p(t,e),t}function Et(e){var r=this,t=new h(function(o,i){r.ready().then(function(){j(r._dbInfo,q,function(n,a){if(n)return i(n);try{var s=a.objectStore(r._dbInfo.storeName),u=s.count();u.onsuccess=function(){o(u.result)},u.onerror=function(){i(u.error)}}catch(f){i(f)}})}).catch(i)});return p(t,e),t}function St(e,r){var t=this,o=new h(function(i,n){if(e<0){i(null);return}t.ready().then(function(){j(t._dbInfo,q,function(a,s){if(a)return n(a);try{var u=s.objectStore(t._dbInfo.storeName),f=!1,c=u.openKeyCursor();c.onsuccess=function(){var v=c.result;if(!v){i(null);return}e===0||f?i(v.key):(f=!0,v.advance(e))},c.onerror=function(){n(c.error)}}catch(v){n(v)}})}).catch(n)});return p(o,r),o}function Tt(e){var r=this,t=new h(function(o,i){r.ready().then(function(){j(r._dbInfo,q,function(n,a){if(n)return i(n);try{var s=a.objectStore(r._dbInfo.storeName),u=s.openKeyCursor(),f=[];u.onsuccess=function(){var c=u.result;if(!c){o(f);return}f.push(c.key),c.continue()},u.onerror=function(){i(u.error)}}catch(c){i(c)}})}).catch(i)});return p(t,e),t}function It(e,r){r=Y.apply(this,arguments);var t=this.config();e=typeof e!="function"&&e||{},e.name||(e.name=e.name||t.name,e.storeName=e.storeName||t.storeName);var o=this,i;if(!e.name)i=h.reject("Invalid arguments");else{var n=e.name===t.name&&o._dbInfo.db,a=n?h.resolve(o._dbInfo.db):G(e).then(function(s){var u=M[e.name],f=u.forages;u.db=s;for(var c=0;c<f.length;c++)f[c]._dbInfo.db=s;return s});e.storeName?i=a.then(function(s){if(s.objectStoreNames.contains(e.storeName)){var u=s.version+1;U(e);var f=M[e.name],c=f.forages;s.close();for(var v=0;v<c.length;v++){var b=c[v];b._dbInfo.db=null,b._dbInfo.version=u}var I=new h(function(x,L){var A=O.open(e.name,u);A.onerror=function(z){var re=A.result;re.close(),L(z)},A.onupgradeneeded=function(){var z=A.result;z.deleteObjectStore(e.storeName)},A.onsuccess=function(){var z=A.result;z.close(),x(z)}});return I.then(function(x){f.db=x;for(var L=0;L<c.length;L++){var A=c[L];A._dbInfo.db=x,W(A._dbInfo)}}).catch(function(x){throw($(e,x)||h.resolve()).catch(function(){}),x})}}):i=a.then(function(s){U(e);var u=M[e.name],f=u.forages;s.close();for(var c=0;c<f.length;c++){var v=f[c];v._dbInfo.db=null}var b=new h(function(I,x){var L=O.deleteDatabase(e.name);L.onerror=function(){var A=L.result;A&&A.close(),x(L.error)},L.onblocked=function(){console.warn('dropInstance blocked for database "'+e.name+'" until all open connections are closed')},L.onsuccess=function(){var A=L.result;A&&A.close(),I(A)}});return b.then(function(I){u.db=I;for(var x=0;x<f.length;x++){var L=f[x];W(L._dbInfo)}}).catch(function(I){throw($(e,I)||h.resolve()).catch(function(){}),I})})}return p(i,r),i}var xt={_driver:"asyncStorage",_initStorage:gt,_support:F(),iterate:yt,getItem:pt,setItem:bt,removeItem:_t,clear:wt,length:Et,key:St,keys:Tt,dropInstance:It};function Dt(){return typeof openDatabase=="function"}var Q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ct="~~local_forage_type~",Be=/^~~local_forage_type~([^~]+)~/,se="__lfsc__:",ye=se.length,be="arbf",_e="blob",Oe="si08",Me="ui08",Fe="uic8",Ue="si16",We="si32",$e="ur16",He="ui32",ze="fl32",Ve="fl64",Ye=ye+be.length,ke=Object.prototype.toString;function Ge(e){var r=e.length*.75,t=e.length,o,i=0,n,a,s,u;e[e.length-1]==="="&&(r--,e[e.length-2]==="="&&r--);var f=new ArrayBuffer(r),c=new Uint8Array(f);for(o=0;o<t;o+=4)n=Q.indexOf(e[o]),a=Q.indexOf(e[o+1]),s=Q.indexOf(e[o+2]),u=Q.indexOf(e[o+3]),c[i++]=n<<2|a>>4,c[i++]=(a&15)<<4|s>>2,c[i++]=(s&3)<<6|u&63;return f}function we(e){var r=new Uint8Array(e),t="",o;for(o=0;o<r.length;o+=3)t+=Q[r[o]>>2],t+=Q[(r[o]&3)<<4|r[o+1]>>4],t+=Q[(r[o+1]&15)<<2|r[o+2]>>6],t+=Q[r[o+2]&63];return r.length%3===2?t=t.substring(0,t.length-1)+"=":r.length%3===1&&(t=t.substring(0,t.length-2)+"=="),t}function At(e,r){var t="";if(e&&(t=ke.call(e)),e&&(t==="[object ArrayBuffer]"||e.buffer&&ke.call(e.buffer)==="[object ArrayBuffer]")){var o,i=se;e instanceof ArrayBuffer?(o=e,i+=be):(o=e.buffer,t==="[object Int8Array]"?i+=Oe:t==="[object Uint8Array]"?i+=Me:t==="[object Uint8ClampedArray]"?i+=Fe:t==="[object Int16Array]"?i+=Ue:t==="[object Uint16Array]"?i+=$e:t==="[object Int32Array]"?i+=We:t==="[object Uint32Array]"?i+=He:t==="[object Float32Array]"?i+=ze:t==="[object Float64Array]"?i+=Ve:r(new Error("Failed to get type for BinaryArray"))),r(i+we(o))}else if(t==="[object Blob]"){var n=new FileReader;n.onload=function(){var a=Ct+e.type+"~"+we(this.result);r(se+_e+a)},n.readAsArrayBuffer(e)}else try{r(JSON.stringify(e))}catch(a){console.error("Couldn't convert value into a JSON string: ",e),r(null,a)}}function Rt(e){if(e.substring(0,ye)!==se)return JSON.parse(e);var r=e.substring(Ye),t=e.substring(ye,Ye),o;if(t===_e&&Be.test(r)){var i=r.match(Be);o=i[1],r=r.substring(i[0].length)}var n=Ge(r);switch(t){case be:return n;case _e:return V([n],{type:o});case Oe:return new Int8Array(n);case Me:return new Uint8Array(n);case Fe:return new Uint8ClampedArray(n);case Ue:return new Int16Array(n);case $e:return new Uint16Array(n);case We:return new Int32Array(n);case He:return new Uint32Array(n);case ze:return new Float32Array(n);case Ve:return new Float64Array(n);default:throw new Error("Unkown type: "+t)}}var Ee={serialize:At,deserialize:Rt,stringToBuffer:Ge,bufferToString:we};function je(e,r,t,o){e.executeSql("CREATE TABLE IF NOT EXISTS "+r.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],t,o)}function Nt(e){var r=this,t={db:null};if(e)for(var o in e)t[o]=typeof e[o]!="string"?e[o].toString():e[o];var i=new h(function(n,a){try{t.db=openDatabase(t.name,String(t.version),t.description,t.size)}catch(s){return a(s)}t.db.transaction(function(s){je(s,t,function(){r._dbInfo=t,n()},function(u,f){a(f)})},a)});return t.serializer=Ee,i}function X(e,r,t,o,i,n){e.executeSql(t,o,i,function(a,s){s.code===s.SYNTAX_ERR?a.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[r.storeName],function(u,f){f.rows.length?n(u,s):je(u,r,function(){u.executeSql(t,o,i,n)},n)},n):n(a,s)},n)}function Lt(e,r){var t=this;e=P(e);var o=new h(function(i,n){t.ready().then(function(){var a=t._dbInfo;a.db.transaction(function(s){X(s,a,"SELECT * FROM "+a.storeName+" WHERE key = ? LIMIT 1",[e],function(u,f){var c=f.rows.length?f.rows.item(0).value:null;c&&(c=a.serializer.deserialize(c)),i(c)},function(u,f){n(f)})})}).catch(n)});return p(o,r),o}function Pt(e,r){var t=this,o=new h(function(i,n){t.ready().then(function(){var a=t._dbInfo;a.db.transaction(function(s){X(s,a,"SELECT * FROM "+a.storeName,[],function(u,f){for(var c=f.rows,v=c.length,b=0;b<v;b++){var I=c.item(b),x=I.value;if(x&&(x=a.serializer.deserialize(x)),x=e(x,I.key,b+1),x!==void 0){i(x);return}}i()},function(u,f){n(f)})})}).catch(n)});return p(o,r),o}function Qe(e,r,t,o){var i=this;e=P(e);var n=new h(function(a,s){i.ready().then(function(){r===void 0&&(r=null);var u=r,f=i._dbInfo;f.serializer.serialize(r,function(c,v){v?s(v):f.db.transaction(function(b){X(b,f,"INSERT OR REPLACE INTO "+f.storeName+" (key, value) VALUES (?, ?)",[e,c],function(){a(u)},function(I,x){s(x)})},function(b){if(b.code===b.QUOTA_ERR){if(o>0){a(Qe.apply(i,[e,u,t,o-1]));return}s(b)}})})}).catch(s)});return p(n,t),n}function Bt(e,r,t){return Qe.apply(this,[e,r,t,1])}function Ot(e,r){var t=this;e=P(e);var o=new h(function(i,n){t.ready().then(function(){var a=t._dbInfo;a.db.transaction(function(s){X(s,a,"DELETE FROM "+a.storeName+" WHERE key = ?",[e],function(){i()},function(u,f){n(f)})})}).catch(n)});return p(o,r),o}function Mt(e){var r=this,t=new h(function(o,i){r.ready().then(function(){var n=r._dbInfo;n.db.transaction(function(a){X(a,n,"DELETE FROM "+n.storeName,[],function(){o()},function(s,u){i(u)})})}).catch(i)});return p(t,e),t}function Ft(e){var r=this,t=new h(function(o,i){r.ready().then(function(){var n=r._dbInfo;n.db.transaction(function(a){X(a,n,"SELECT COUNT(key) as c FROM "+n.storeName,[],function(s,u){var f=u.rows.item(0).c;o(f)},function(s,u){i(u)})})}).catch(i)});return p(t,e),t}function Ut(e,r){var t=this,o=new h(function(i,n){t.ready().then(function(){var a=t._dbInfo;a.db.transaction(function(s){X(s,a,"SELECT key FROM "+a.storeName+" WHERE id = ? LIMIT 1",[e+1],function(u,f){var c=f.rows.length?f.rows.item(0).key:null;i(c)},function(u,f){n(f)})})}).catch(n)});return p(o,r),o}function Wt(e){var r=this,t=new h(function(o,i){r.ready().then(function(){var n=r._dbInfo;n.db.transaction(function(a){X(a,n,"SELECT key FROM "+n.storeName,[],function(s,u){for(var f=[],c=0;c<u.rows.length;c++)f.push(u.rows.item(c).key);o(f)},function(s,u){i(u)})})}).catch(i)});return p(t,e),t}function $t(e){return new h(function(r,t){e.transaction(function(o){o.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(i,n){for(var a=[],s=0;s<n.rows.length;s++)a.push(n.rows.item(s).name);r({db:e,storeNames:a})},function(i,n){t(n)})},function(o){t(o)})})}function Ht(e,r){r=Y.apply(this,arguments);var t=this.config();e=typeof e!="function"&&e||{},e.name||(e.name=e.name||t.name,e.storeName=e.storeName||t.storeName);var o=this,i;return e.name?i=new h(function(n){var a;e.name===t.name?a=o._dbInfo.db:a=openDatabase(e.name,"","",0),e.storeName?n({db:a,storeNames:[e.storeName]}):n($t(a))}).then(function(n){return new h(function(a,s){n.db.transaction(function(u){function f(I){return new h(function(x,L){u.executeSql("DROP TABLE IF EXISTS "+I,[],function(){x()},function(A,z){L(z)})})}for(var c=[],v=0,b=n.storeNames.length;v<b;v++)c.push(f(n.storeNames[v]));h.all(c).then(function(){a()}).catch(function(I){s(I)})},function(u){s(u)})})}):i=h.reject("Invalid arguments"),p(i,r),i}var zt={_driver:"webSQLStorage",_initStorage:Nt,_support:Dt(),iterate:Pt,getItem:Lt,setItem:Bt,removeItem:Ot,clear:Mt,length:Ft,key:Ut,keys:Wt,dropInstance:Ht};function Vt(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function Xe(e,r){var t=e.name+"/";return e.storeName!==r.storeName&&(t+=e.storeName+"/"),t}function Yt(){var e="_localforage_support_test";try{return localStorage.setItem(e,!0),localStorage.removeItem(e),!1}catch{return!0}}function kt(){return!Yt()||localStorage.length>0}function Gt(e){var r=this,t={};if(e)for(var o in e)t[o]=e[o];return t.keyPrefix=Xe(e,r._defaultConfig),kt()?(r._dbInfo=t,t.serializer=Ee,h.resolve()):h.reject()}function jt(e){var r=this,t=r.ready().then(function(){for(var o=r._dbInfo.keyPrefix,i=localStorage.length-1;i>=0;i--){var n=localStorage.key(i);n.indexOf(o)===0&&localStorage.removeItem(n)}});return p(t,e),t}function Qt(e,r){var t=this;e=P(e);var o=t.ready().then(function(){var i=t._dbInfo,n=localStorage.getItem(i.keyPrefix+e);return n&&(n=i.serializer.deserialize(n)),n});return p(o,r),o}function Xt(e,r){var t=this,o=t.ready().then(function(){for(var i=t._dbInfo,n=i.keyPrefix,a=n.length,s=localStorage.length,u=1,f=0;f<s;f++){var c=localStorage.key(f);if(c.indexOf(n)===0){var v=localStorage.getItem(c);if(v&&(v=i.serializer.deserialize(v)),v=e(v,c.substring(a),u++),v!==void 0)return v}}});return p(o,r),o}function qt(e,r){var t=this,o=t.ready().then(function(){var i=t._dbInfo,n;try{n=localStorage.key(e)}catch{n=null}return n&&(n=n.substring(i.keyPrefix.length)),n});return p(o,r),o}function Jt(e){var r=this,t=r.ready().then(function(){for(var o=r._dbInfo,i=localStorage.length,n=[],a=0;a<i;a++){var s=localStorage.key(a);s.indexOf(o.keyPrefix)===0&&n.push(s.substring(o.keyPrefix.length))}return n});return p(t,e),t}function Kt(e){var r=this,t=r.keys().then(function(o){return o.length});return p(t,e),t}function Zt(e,r){var t=this;e=P(e);var o=t.ready().then(function(){var i=t._dbInfo;localStorage.removeItem(i.keyPrefix+e)});return p(o,r),o}function er(e,r,t){var o=this;e=P(e);var i=o.ready().then(function(){r===void 0&&(r=null);var n=r;return new h(function(a,s){var u=o._dbInfo;u.serializer.serialize(r,function(f,c){if(c)s(c);else try{localStorage.setItem(u.keyPrefix+e,f),a(n)}catch(v){(v.name==="QuotaExceededError"||v.name==="NS_ERROR_DOM_QUOTA_REACHED")&&s(v),s(v)}})})});return p(i,t),i}function tr(e,r){if(r=Y.apply(this,arguments),e=typeof e!="function"&&e||{},!e.name){var t=this.config();e.name=e.name||t.name,e.storeName=e.storeName||t.storeName}var o=this,i;return e.name?i=new h(function(n){e.storeName?n(Xe(e,o._defaultConfig)):n(e.name+"/")}).then(function(n){for(var a=localStorage.length-1;a>=0;a--){var s=localStorage.key(a);s.indexOf(n)===0&&localStorage.removeItem(s)}}):i=h.reject("Invalid arguments"),p(i,r),i}var rr={_driver:"localStorageWrapper",_initStorage:Gt,_support:Vt(),iterate:Xt,getItem:Qt,setItem:er,removeItem:Zt,clear:jt,length:Kt,key:qt,keys:Jt,dropInstance:tr},nr=function(r,t){return r===t||typeof r=="number"&&typeof t=="number"&&isNaN(r)&&isNaN(t)},or=function(r,t){for(var o=r.length,i=0;i<o;){if(nr(r[i],t))return!0;i++}return!1},qe=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"},te={},Je={},K={INDEXEDDB:xt,WEBSQL:zt,LOCALSTORAGE:rr},ir=[K.INDEXEDDB._driver,K.WEBSQL._driver,K.LOCALSTORAGE._driver],ue=["dropInstance"],Se=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(ue),ar={description:"",driver:ir.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function sr(e,r){e[r]=function(){var t=arguments;return e.ready().then(function(){return e[r].apply(e,t)})}}function Te(){for(var e=1;e<arguments.length;e++){var r=arguments[e];if(r)for(var t in r)r.hasOwnProperty(t)&&(qe(r[t])?arguments[0][t]=r[t].slice():arguments[0][t]=r[t])}return arguments[0]}var ur=(function(){function e(r){C(this,e);for(var t in K)if(K.hasOwnProperty(t)){var o=K[t],i=o._driver;this[t]=i,te[i]||this.defineDriver(o)}this._defaultConfig=Te({},ar),this._config=Te({},this._defaultConfig,r),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return e.prototype.config=function(t){if((typeof t>"u"?"undefined":S(t))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var o in t){if(o==="storeName"&&(t[o]=t[o].replace(/\W/g,"_")),o==="version"&&typeof t[o]!="number")return new Error("Database version must be a number.");this._config[o]=t[o]}return"driver"in t&&t.driver?this.setDriver(this._config.driver):!0}else return typeof t=="string"?this._config[t]:this._config},e.prototype.defineDriver=function(t,o,i){var n=new h(function(a,s){try{var u=t._driver,f=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!t._driver){s(f);return}for(var c=Se.concat("_initStorage"),v=0,b=c.length;v<b;v++){var I=c[v],x=!or(ue,I);if((x||t[I])&&typeof t[I]!="function"){s(f);return}}var L=function(){for(var re=function(lr){return function(){var dr=new Error("Method "+lr+" is not implemented by the current driver"),Ke=h.reject(dr);return p(Ke,arguments[arguments.length-1]),Ke}},Ie=0,cr=ue.length;Ie<cr;Ie++){var xe=ue[Ie];t[xe]||(t[xe]=re(xe))}};L();var A=function(re){te[u]&&console.info("Redefining LocalForage driver: "+u),te[u]=t,Je[u]=re,a()};"_support"in t?t._support&&typeof t._support=="function"?t._support().then(A,s):A(!!t._support):A(!0)}catch(z){s(z)}});return N(n,o,i),n},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(t,o,i){var n=te[t]?h.resolve(te[t]):h.reject(new Error("Driver not found."));return N(n,o,i),n},e.prototype.getSerializer=function(t){var o=h.resolve(Ee);return N(o,t),o},e.prototype.ready=function(t){var o=this,i=o._driverSet.then(function(){return o._ready===null&&(o._ready=o._initDriver()),o._ready});return N(i,t,t),i},e.prototype.setDriver=function(t,o,i){var n=this;qe(t)||(t=[t]);var a=this._getSupportedDrivers(t);function s(){n._config.driver=n.driver()}function u(v){return n._extend(v),s(),n._ready=n._initStorage(n._config),n._ready}function f(v){return function(){var b=0;function I(){for(;b<v.length;){var x=v[b];return b++,n._dbInfo=null,n._ready=null,n.getDriver(x).then(u).catch(I)}s();var L=new Error("No available storage method found.");return n._driverSet=h.reject(L),n._driverSet}return I()}}var c=this._driverSet!==null?this._driverSet.catch(function(){return h.resolve()}):h.resolve();return this._driverSet=c.then(function(){var v=a[0];return n._dbInfo=null,n._ready=null,n.getDriver(v).then(function(b){n._driver=b._driver,s(),n._wrapLibraryMethodsWithReady(),n._initDriver=f(a)})}).catch(function(){s();var v=new Error("No available storage method found.");return n._driverSet=h.reject(v),n._driverSet}),N(this._driverSet,o,i),this._driverSet},e.prototype.supports=function(t){return!!Je[t]},e.prototype._extend=function(t){Te(this,t)},e.prototype._getSupportedDrivers=function(t){for(var o=[],i=0,n=t.length;i<n;i++){var a=t[i];this.supports(a)&&o.push(a)}return o},e.prototype._wrapLibraryMethodsWithReady=function(){for(var t=0,o=Se.length;t<o;t++)sr(this,Se[t])},e.prototype.createInstance=function(t){return new e(t)},e})(),fr=new ur;y.exports=fr},{3:3}]},{},[4])(4)})});var Ae=hr(it());function le(m){return Ae.default.createInstance({name:"lc",storeName:m,driver:Ae.default.LOCALSTORAGE})}var Z=class{static storage;static async get(l,w){return await this.storage?.getItem(l)??w}static set(l,w){return this.storage?.setItem(l,w)}static remove(l){return this.storage?.removeItem(l)}static clear(){return this.storage?.clear()}static getForage(){return this.storage}};var oe=class oe extends Z{};fe(oe,"storeName","usr"),oe.storage=le(oe.storeName);var Re=oe;var de=class{gaEnabled;gaMeasurementID;pixelPush;website;currencyCount;money;storefrontToken;skipItemAttribute;widgetCustomisation;currency;static get(){return window.CooeeSDK.config}update(l){return l??={},this.gaEnabled=l.gaEnabled,this.gaMeasurementID=l.gaMeasurementID,this.pixelPush=l.pixelPush,this.website=l.website??{},this.currencyCount=l.currencyCount??0,this.money=l.money,this.currency=l.currency,this.storefrontToken=l.storefrontToken,this.skipItemAttribute=l.skipItemAttribute,this.widgetCustomisation=l.widgetCustomisation,this}};var ie=class ie extends Z{};fe(ie,"storeName","ses"),ie.storage=le(ie.storeName);var Ne=ie;var at={},st,me,vr,ft,ut;async function gr(){if(!me)return ut??=pr(),ut}async function pr(){let{BrowserClient:m,Scope:l,defaultStackParser:w,getDefaultIntegrations:g,makeFetchTransport:y}=await import("./esm-EYV26LOR.js");ft=l;let R=g({}).filter(S=>!["BrowserApiErrors","Breadcrumbs","GlobalHandlers"].includes(S.name));me=new m({dsn:"https://1bc3dda4c861f60cd6be1b67584f4bc6@o559187.ingest.us.sentry.io/4507626484203520",transport:y,stackParser:w,integrations:R,environment:De.mode,release:`web-sdk@${rt}`,debug:De.debug,sampleRate:.5}),me.init()}function ct(m,l,w){ce.error(`${l}:`,m),gr().then(()=>{let g=_r(w);if(g.setTag("operation",l),m instanceof nt){yr(g,m,l);return}g.captureException(m)})}function yr(m,l,w){if(br(m,l),l.response){let g=l.response,y=l.responseText;m.setTag("error.message",l.message),g.status!=null&&m.setTag("http.status_code",g.status),g.statusText&&m.setTag("http.status_text",g.statusText),y&&typeof y=="object"&&"error"in y&&(m.setTag("http.error_code",y.error.code),m.setTag("http.error_message",y.error.message)),m.setExtras({responseText:l.responseText,statusText:g.statusText,responseType:g.type,redirected:g.redirected,responseUrl:g.url,originalError:l.message}),m.captureMessage(`${w} failed with ${g.status}`,"error");return}if(l.request){m.captureMessage(`No response was received for ${w}`,"error");return}}function br(m,l){let w=l.request;if(!w)return;m.setExtras({body:l.requestBody,headers:w.headers,method:w.method,url:w.url});let g=w.headers?.get("Cooee-Retry-Attempt");g!==null&&m.setTag("retry.attempt",g)}function _r(m){m??={};let{extra:l,tags:w}=m,g=new ft;if(g.setClient(me),g.setUser(vr),m.triggerContext&&!m.engagementTrigger&&(m.engagementTrigger=m.triggerContext.triggerData),m.engagementTrigger){let y=m.engagementTrigger;g.setTags({"engagement.id":y.engagementID,"engagement.short_id":y.shortID,"engagement.objective":y.objective,"engagement.delivery_type":y.onsiteDeliveryType,"engagement.content_id":y.contentID,"engagement.variation":y.variation,"engagement.currency":y.currency})}return l&&g.setExtras(l),w&&g.setTags(w),st&&g.setTags(st),Object.keys(at).forEach(y=>{g.setContext(y,at[y])}),g.setTag("language",navigator.language),g.setTag("timezone",lt()),wr(g),g}function wr(m){window.Shopify&&(m.setTag("shopify.shop",window.Shopify.shop),m.setTag("shopify.currency",window.Shopify.currency?.active),m.setTag("shopify.locale",window.Shopify.locale),m.setTag("theme.schema_name",window.Shopify.theme?.schema_name),m.setTag("theme.schema_version",window.Shopify.theme?.schema_version))}var he=class{static format(l,w){let g=/{{\s*(\w+)\s*}}/;return w.replace(g,(y,R)=>{switch(R){case"amount":return this.formatWithDelimiters(l,2);case"amount_no_decimals":return this.formatWithDelimiters(l,0);case"amount_with_comma_separator":return this.formatWithDelimiters(l,2,".",",");case"amount_no_decimals_with_comma_separator":return this.formatWithDelimiters(l,0,".",",");case"amount_with_apostrophe_separator":return this.formatWithDelimiters(l,2,"'",".");case"amount_no_decimals_with_space_separator":return this.formatWithDelimiters(l,0," ");case"amount_with_space_separator":return this.formatWithDelimiters(l,2," ",",");case"amount_with_period_and_space_separator":return this.formatWithDelimiters(l,2," ",".");default:return y}})}static formatWithDelimiters(l,w=2,g=",",y="."){if(isNaN(l)||l==null)return"0";let S=(l/100).toFixed(w).split("."),C=S[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1"+g),E=S[1]?y+S[1]:"";return C+E}};function dt(){return window.CooeeSDK.runtimeData}function nn(m,l,w){return{[m]:Er(l,w),[m+"_wo_currency"]:l}}function Er(m,l){if(m==0&&l)return"Free";let w=dt(),g=de.get(),y=w.shopCurrencyCode||g.currency,R=w.currencyCode;R||ce.warn("Currency code is not set in RuntimeData");let S=g.money?.format??w.moneyFormat,C;if(S&&y===R)C=he.format(m*100,S);else{let E;try{E=new Intl.NumberFormat(Sr(),{style:"currency",currency:R||y,minimumFractionDigits:0,maximumFractionDigits:2})}catch(O){return ct(O,"format-currency",{extra:{currentCurrency:R,shopCurrency:y}}),""}C=E.format(m),C=C.replace("\u20B9","Rs. "),g.money?.showCurrency&&R!=="INR"&&(C=C.concat(` ${R}`))}return C}function Sr(){let m="en";return typeof navigator<"u"&&(navigator.languages!==void 0&&navigator.languages.length>0?m=navigator.languages[0]:navigator.language&&(m=navigator.language)),m=m.split(";")[0],m=m.split("-")[0],m||"en"}var ve;function lt(){if(ve)return ve;try{return ve=Intl.DateTimeFormat().resolvedOptions().timeZone,ve}catch{return""}}function on(m){let l=document.createElement("span");l.id="snackbar",l.innerText=m,document.body.appendChild(l),l.className="show",setTimeout(()=>{l.classList.remove("show"),document.body.removeChild(l)},5e3)}var mt=class m{sanitizer=Ze(tt);transform(l){return l?this.sanitizer.bypassSecurityTrustHtml(l):""}static \u0275fac=function(w){return new(w||m)};static \u0275pipe=et({name:"safeHtml",type:m,pure:!0})};function hn(){return window.CooeeSDK?.uaParser.getDevice().type==="mobile"}var vn=()=>typeof navigator<"u"&&"share"in navigator;export{de as a,Re as b,ct as c,nn as d,Er as e,on as f,mt as g,hn as h,vn as i};
|