@letscooee/web-sdk 11.0.0 → 11.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +0,0 @@
1
- import{A as Fe,B as Ne,a as be,c as ye,e as H,g as Ve,i as E,k as Z,o as De,p as Ie,q as Ee,s as ke,t as Pe,u as Me,w as Oe,x as $,y as Se,z as Ae}from"./chunk-F2TELYIQ.js";import{$a as Ce,Aa as g,Ca as d,D as oe,E as D,Fa as K,Ga as G,Ha as Y,I as M,Ia as se,Ja as ce,K as O,Ka as P,L as k,La as N,N as a,Pa as w,Qa as pe,Sa as me,Ta as ue,Ua as ge,Va as ve,W as x,Wa as he,Xa as z,Ya as _e,aa as S,ba as Q,bb as T,cb as I,eb as fe,fa as A,ga as v,ha as h,hb as L,ia as F,ib as J,ja as b,jb as R,ka as y,kb as we,la as c,lb as X,ma as s,na as l,oa as u,pa as ne,qa as re,ra as ae,rb as B,sa as de,ta as le,tb as xe,ua as q,v as V,x as p,y as m,ya as _,yb as Te}from"./chunk-WCCK4F5X.js";import"./chunk-V7UGKYBN.js";var Le=o=>({active:o}),Re=(o,t)=>t.mID;function Be(o,t){if(o&1&&u(0,"img",7),o&2){let e=t.$implicit,i=d();c("src",e.url,k)("alt",i.item().name)}}function He(o,t){if(o&1&&(u(0,"span",16),T(1,"cooeeCurrency"),T(2,"safeHtml")),o&2){d(2);let e=z(13);c("innerHTML",I(2,3,I(1,1,e.d)),O)}}function $e(o,t){if(o&1&&(u(0,"span",17),T(1,"cooeeCurrency"),T(2,"safeHtml")),o&2){d(2);let e=z(13);c("innerHTML",I(2,3,I(1,1,e.cmp)),O)}}function je(o,t){if(o&1&&(s(0,"div",10),v(1,He,3,5,"span",16),v(2,$e,3,5,"span",17),l()),o&2){d();let e=z(13);a(),h(e.d?1:-1),a(),h(e.cmp?2:-1)}}function Ue(o,t){if(o&1){let e=_();s(0,"a",20),g("click",function(n){let r=p(e).$implicit,C=d(2);return m(C.changeItem(n,r))}),u(1,"img",21),l()}if(o&2){let e=t.$implicit,i=d(2);c("ngClass",Ce(3,Le,e.mID===i.item().mID+"")),a(),c("src",e.firstImageURL,k)("alt",i.item().name)}}function We(o,t){if(o&1&&(s(0,"span",18),w(1,"Select product"),l(),s(2,"div",6),b(3,Ue,2,5,"a",19,Re),l()),o&2){let e=d();a(3),y(e.similarItems())}}function Qe(o,t){if(o&1&&(s(0,"span",22),w(1,"Select variant"),l(),u(2,"cooee-item-options-picker",23)),o&2){let e=d();a(2),c("item",e.item())}}function qe(o,t){if(o&1&&(s(0,"div",24),w(1,"Description"),l(),u(2,"div",25),T(3,"safeHtml")),o&2){let e=d();a(2),c("innerHTML",I(3,1,e.item().desc),O)}}function Ke(o,t){o&1&&w(0," Add To Cart ")}function Ge(o,t){o&1&&w(0," Out of stock ")}var j=class o{closeModel=new Q;performCTA=new Q;item=X.required();similarItems=X.required();closeDialog(){this.closeModel.emit()}clickAddToCart(){this.performCTA.emit({item:this.item(),cta:E.ADD_TO_CART})}openCart(){this.performCTA.emit({item:this.item(),cta:E.OPEN_CART})}changeItem(t,e){t.stopPropagation(),t.preventDefault(),this.item.set(e)}goToPDP(){this.performCTA.emit({item:this.item(),cta:E.GO_TO_PRODUCT})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=x({type:o,selectors:[["cooee-item-detail"]],hostAttrs:[1,"letscooee-widget"],inputs:{item:[1,"item"],similarItems:[1,"similarItems"]},outputs:{closeModel:"closeModel",performCTA:"performCTA",item:"itemChange",similarItems:"similarItemsChange"},decls:26,vars:8,consts:[[1,"lc-card-wrapper","card-wrapper"],[1,"lc-card-header","card-header"],[1,"lc-header","header"],["type","button","aria-label","Close product details",1,"lc-close-button","close-button",3,"click"],["name","close","aria-hidden","true"],[1,"card-content"],[1,"lc-image-strip","image-strip"],[1,"w-28","h-28","object-contain",3,"src","alt"],[1,"lc-inner-body","inner-body"],[1,"lc-item-name","item-name"],[1,"lc-prices","prices"],[1,"lc-card-footer","card-footer"],["type","button",1,"lc-cta-button","cta-button",3,"click","disabled"],["type","button",1,"lc-more-info-button","more-info-button",3,"click"],["type","button","title","View Cart",1,"view-cart-button",3,"click"],["width","32","height","32","src","https://img.icons8.com/material-sharp/48/shopping-cart.png","alt","shopping-cart"],[1,"lc-item-price","item-price",3,"innerHTML"],[1,"lc-item-cmp-price","item-cmp-price",3,"innerHTML"],[1,"lc-selected-product-title","selected-product-title"],["href","#",1,"product-selector",3,"ngClass"],["href","#",1,"product-selector",3,"click","ngClass"],[3,"src","alt"],[1,"selected-variant-title"],[3,"item"],[1,"lc-description-title","description-title"],[1,"lc-description","description",3,"innerHTML"]],template:function(e,i){if(e&1){let n=_();s(0,"div",0)(1,"div",1)(2,"div",2),w(3,"Shop Now"),l(),s(4,"button",3),g("click",function(){return p(n),m(i.closeDialog())}),u(5,"cooee-icon",4),l()(),s(6,"div",5)(7,"div",6),b(8,Be,1,2,"img",7,F),l(),s(10,"div",8)(11,"div",9),w(12),l(),ve(13),v(14,je,3,2,"div",10),v(15,We,5,0),v(16,Qe,3,1),v(17,qe,4,3),l()(),s(18,"div",11)(19,"button",12),g("click",function(){return p(n),m(i.clickAddToCart())}),v(20,Ke,1,0)(21,Ge,1,0),l(),s(22,"button",13),g("click",function(){return p(n),m(i.goToPDP())}),w(23," More Info "),l(),s(24,"button",14),g("click",function(){return p(n),m(i.openCart())}),u(25,"img",15),l()()()}if(e&2){let n=i.item().selectedOrFirstVariant.value;a(8),y(i.item().imgs),a(4),pe(i.item().name),a();let r=he(n.price);a(),h(r?14:-1),a(),h(i.similarItems().length>1?15:-1),a(),h(i.item().hasVariants()?16:-1),a(),h(i.item().desc?17:-1),a(2),c("disabled",!n.isAvailable),a(),h(n.isAvailable?20:21)}},dependencies:[B,Ve,$,Te,De],styles:["[_nghost-%COMP%]{display:block;background:#fff}.card-wrapper[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column;height:100%;overflow:auto}.card-header[_ngcontent-%COMP%]{display:var(--header-display, flex);flex-direction:row;justify-content:space-between;align-items:center;padding:8px 16px;border-bottom:1px solid var(--lc-color-gray-300)}.header[_ngcontent-%COMP%]{font-size:24px;font-weight:var(--lc-subheading-weight);color:rgba(var(--lc-subheading-color))}.close-button[_ngcontent-%COMP%]{background:transparent;border:none;width:36px;height:36px}.close-button[_ngcontent-%COMP%] cooee-icon[_ngcontent-%COMP%]{color:#000000b3}.card-content[_ngcontent-%COMP%]{flex:1;overflow-y:auto;overscroll-behavior:contain}.inner-body[_ngcontent-%COMP%]{padding:16px;display:flex;flex-direction:column;gap:8px}.image-strip[_ngcontent-%COMP%]{width:100%;display:flex;overflow-x:auto;gap:8px;flex-wrap:nowrap}.image-strip[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:auto;height:200px}.product-selector[_ngcontent-%COMP%]{height:100px;flex-shrink:0;border-radius:var(--lc-media-radius);padding:2px}.product-selector.active[_ngcontent-%COMP%]{border:1px solid rgba(var(--lc-primary-color))}.product-selector[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{max-height:100%;border-radius:var(--lc-media-radius)}.description-title[_ngcontent-%COMP%], .selected-product-title[_ngcontent-%COMP%], .selected-variant-title[_ngcontent-%COMP%]{font-size:var(--lc-subheading-size);font-weight:var(--lc-subheading-weight);color:rgba(var(--lc-subheading-color));margin-top:8px;line-height:normal}.description[_ngcontent-%COMP%]{line-height:normal;color:#000;font-size:var(--lc-description-size);font-weight:var(--lc-description-weight)}.card-footer[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;padding:var(--lc-item-detail-footer-padding);background-color:rgba(var(--lc-item-detail-footer-bg-color));box-shadow:var(--lc-item-detail-footer-box-shadow);gap:12px}.cta-button[_ngcontent-%COMP%], .more-info-button[_ngcontent-%COMP%]{width:50%;padding:12px;display:flex;justify-content:center;align-items:center}.more-info-button[_ngcontent-%COMP%]{background-color:rgba(var(--lc-secondary-button-bg-color));color:rgba(var(--lc-secondary-button-color));font-weight:var(--lc-secondary-button-weight);text-transform:var(--lc-secondary-button-transform);border-radius:var(--lc-button-radius);font-size:var(--lc-button-size);font-family:var(--lc-button-family),serif;height:var(--lc-button-height);letter-spacing:var(--lc-button-letter-spacing);transition:filter .12s ease,background-color .2s ease,color .2s ease;border-width:1px;border-style:solid;border-color:rgba(var(--lc-secondary-button-border-color))}.more-info-button[_ngcontent-%COMP%]:hover{filter:brightness(.95)}.more-info-button[_ngcontent-%COMP%]:active{filter:brightness(.9)}.more-info-button[_ngcontent-%COMP%]:focus-visible{outline:2px solid rgba(var(--lc-primary-color, 0, 0, 0));outline-offset:2px}"]})};var U=class o{video=R.required();progress=D(0);constructor(){L(t=>{let e=this.video(),i=()=>{this.progress.set(e.currentTime/e.duration*100)};e.addEventListener("timeupdate",i),t(()=>{e.removeEventListener("timeupdate",i)})})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=x({type:o,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(e,i){e&1&&(ne(0,"div",0)(1,"div",1),ae(2,"div"),re()()),e&2&&(a(),N("width",i.progress(),"%"),A("aria-valuenow",i.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 Ye=["swiperContainer"],Je=(o,t)=>t.id;function Xe(o,t){if(o&1){let e=_();s(0,"div",3)(1,"cooee-item-card",4),g("buttonClick",function(n){p(e);let r=d();return m(r.onButtonClick(n))})("click",function(){let n=p(e).$implicit,r=d();return m(r.cardClick.emit(n))}),l()()}if(o&2){let e=t.$implicit;a(),c("item",e)}}var W=class o{items=R.required();cardClick=J();buttonClick=J();destroyRef=V(oe);elementRef=V(M);swiperContainerRef=we.required("swiperContainer");swiperInstance;constructor(){L(()=>{this.initSwiper()}),this.destroyRef.onDestroy(()=>{this.swiperInstance?.destroy()})}ngOnInit(){H(this.elementRef.nativeElement.shadowRoot)}onButtonClick(t){let e=ye.get().website?.canChangeVariantInCart;if(this.items()?.length>1||t.hasVariants()&&!e){this.cardClick.emit(t);return}this.buttonClick.emit(t)}initSwiper(){this.swiperInstance=new window.CooeeSDK.Swiper(this.swiperContainerRef().nativeElement,{direction:"horizontal",effect:"slide",slidesPerView:1.2,nested:!0,centeredSlides:!0,spaceBetween:12,mousewheel:{enabled:!0,thresholdDelta:10,thresholdTime:200}})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=x({type:o,selectors:[["cooee-video-promoted-items"]],viewQuery:function(e,i){e&1&&se(i.swiperContainerRef,Ye,5),e&2&&ce()},hostAttrs:[1,"letscooee-widget"],inputs:{items:[1,"items"]},outputs:{cardClick:"cardClick",buttonClick:"buttonClick"},decls:5,vars:0,consts:[["swiperContainer",""],[1,"swiper-container"],[1,"swiper-wrapper"],[1,"swiper-slide"],["tabindex","0",3,"buttonClick","click","item"]],template:function(e,i){e&1&&(s(0,"div",1,0)(2,"div",2),b(3,Xe,2,1,"div",3,Je),l()()),e&2&&(a(3),y(i.items()))},dependencies:[Ne],styles:[`:host{display:block;width:100%}cooee-item-card{-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);background-color:rgba(var(--lc-card-bg-color));cursor:pointer;border-radius:var(--lc-card-radius)}
2
- `],encapsulation:3})};var Ze=["swiperComp"],et=["videoEl"],tt=(o,t)=>t.url;function it(o,t){o&1&&(s(0,"div",11),u(1,"div",15),l())}function ot(o,t){if(o&1&&u(0,"source",13),o&2){let e=t.$implicit;c("type",_e(e.mimeType))("src",e.url,k)}}function nt(o,t){o&1&&q(0)}function rt(o,t){if(o&1){let e=_();s(0,"cooee-video-promoted-items",22),g("buttonClick",function(n){p(e);let r=d(2).$implicit,C=d();return m(C.itemButtonClicked(n,r))})("cardClick",function(n){p(e);let r=d(2).$implicit,C=d();return m(C.productCardClicked(n,r))}),l()}if(o&2){let e=d(2).$implicit;c("items",e.items)}}function at(o,t){if(o&1&&u(0,"cooee-video-card",21),o&2){let e=d(2).$implicit;c("card",e.card)}}function dt(o,t){if(o&1){let e=_();u(0,"cooee-video-progress-bar",16),s(1,"div",17)(2,"cooee-mute-toggle",18),ge("mutedChange",function(n){p(e);let r=d(2);return ue(r.muted,n)||(r.muted=n),m(n)}),g("toggled",function(){p(e);let n=d(2);return m(n.muteToggled())}),l(),S(3,nt,1,0,"ng-container",8),l(),s(4,"div",19),v(5,rt,1,1,"cooee-video-promoted-items",20)(6,at,1,1,"cooee-video-card",21),l()}if(o&2){let e=d().$implicit,i=P(5),n=d(),r=P(9);c("video",i),a(2),me("muted",n.muted),c("videoEl",i),a(),c("ngTemplateOutlet",r),a(2),h(e.items.length&&n.footerContent===n.VideoConfigFooterContent.FIRST_ITEM?5:e.card&&n.footerContent===n.VideoConfigFooterContent.CARD?6:-1)}}function lt(o,t){if(o&1){let e=_();s(0,"cooee-item-detail",23),g("performCTA",function(n){p(e);let r=d(2);return m(r.performClickToAction(n,r.selectedVideo))})("closeModel",function(){p(e);let n=d(2);return m(n.productModalClosed())}),l()}if(o&2){let e=d(2);c("item",e.selectedItem)("similarItems",e.selectedVideo.items)}}function st(o,t){if(o&1){let e=_();s(0,"div",6)(1,"div",9)(2,"div",10),v(3,it,2,0,"div",11),s(4,"video",12,2),g("click",function(){let n=p(e).$index,r=d();return m(r.currentIndex===n&&r.toggleMute())})("ended",function(){p(e);let n=P(5),r=d();return m(r.onVideoEnded(n))})("loadstart",function(){let n=p(e).$index,r=d();return m(r.onVideoLoadStart(n))})("canplay",function(){let n=p(e).$index,r=d();return m(r.onVideoCanPlay(n))}),b(6,ot,1,3,"source",13,tt),l(),v(8,dt,7,5),l(),v(9,lt,1,2,"cooee-item-detail",14),l()()}if(o&2){let e=t.$implicit,i=t.$index,n=d();a(2),N("background-image",e.thumbnail?"url("+e.thumbnail+")":null),a(),h(n.shouldShowVideoSpinner(i)?3:-1),a(),c("ngClass",n.viewTemplateClassName),A("preload",n.isVideoVisible(i)?"metadata":"none")("data-video-id",e.id)("autoplay",n.currentIndex===i||null)("muted",n.muted||null),a(2),y(e.sources),a(2),h(n.currentIndex===i?8:-1),a(),h(n.selectedItem&&n.currentIndex===i?9:-1)}}function ct(o,t){o&1&&q(0)}function pt(o,t){if(o&1){let e=_();s(0,"button",24),g("click",function(){p(e);let n=d();return m(n.close())}),u(1,"cooee-icon",25),l()}}var ze=class o{swiperComponent;videoElements;VideoConfigFooterContent=ke;currentIndex=0;muted=D(!1);selectedItem=null;selectedVideo;detailPopupTemplate;footerContent;viewTemplateClassName="lc-video-only-view";data=V(Me);elementRef=V(M);dialogRef=V(Pe);swiperInitialized=D(!1);swiperOptions=D(null);videos=[];triggerContext;engagementTrigger;isMobile=window.CooeeSDK.uaParser.getDevice().type==="mobile";navigationConfig;cssLoadedPromise;resizeDebouncer=new Oe(this.onResize.bind(this));videoLoadingStates=new Map;constructor(){this.videos=this.data.videos,this.currentIndex=this.data.currentIndex,this.triggerContext=this.data.triggerContext,this.engagementTrigger=this.triggerContext.triggerData,this.navigationConfig=new Ee({enabled:!0,size:50,color:new Ie({h:"#000000"})}),this.cssLoadedPromise=H(this.elementRef.nativeElement.shadowRoot)}async ngOnInit(){this.muted.set(await Z.get("muted",!1));let t=this.engagementTrigger?.content?.videoConfig;switch(this.detailPopupTemplate=t?.detailPopup.template??"VIDEO_ONLY_VIEW",this.footerContent=t?.footerContent??"FIRST_ITEM",this.detailPopupTemplate){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()}close(t=this.videos[this.currentIndex],e=this.currentIndex){let i=this.getCurrentVideoElement();this.dialogRef.close({lastVideo:t,lastVideoIndex:e,lastVideoDuration:i?.currentTime})}itemButtonClicked(t,e){this.performClickToAction({cta:E.ADD_TO_CART,item:t},e)}performClickToAction(t,e){this.data.onCTAPerformed({cta:t.cta,item:t.item,video:e})}getCurrentVideoElement(){return this.videoElements.get(this.currentIndex)?.nativeElement}moveToNextVideo(){this.swiperComponent.swiper.slideTo(this.currentIndex+1)}productModalClosed(){this.selectedItem=null,this.selectedVideo=void 0}pauseAll(){this.videoElements.forEach(t=>t.nativeElement.pause())}toggleMute(){this.muted.update(t=>!t)}async muteToggled(){await Z.set("muted",this.muted());let e=[this.muted()?"CE Video Muted":"CE Video Unmuted",{current:this.currentVideoProps()},{triggerData:this.engagementTrigger}];window.CooeeSDK.events.push(e)}playActiveVideo(){this.pauseAll();let t=this.getCurrentVideoElement();t&&this.playVideo(t)}playVideo(t){t.currentTime=0,t.play().catch(e=>be.error(e))}onVideoEnded(t){if(this.currentIndex<this.videos.length-1)this.selectedItem?this.playVideo(t):this.moveToNextVideo();else{let e=this.getPreviousVideoDataForEvent(),i=["CE Last Video Ended",{previous:e},{triggerData:this.engagementTrigger}];window.CooeeSDK.events.push(i),this.playVideo(t)}}onSlideChange(t){let e=this.getPreviousVideoDataForEvent();this.currentIndex=t.realIndex,this.playActiveVideo(),this.detailPopupTemplate==="PRODUCT_DETAIL_VIEW"?this.selectItemForDetailView():(this.selectedItem=null,delete this.selectedVideo);let i=this.currentVideoProps(),n={previous:e,current:i},r=["CE Video Changed",n,{triggerData:this.engagementTrigger}];window.CooeeSDK.events.push(r)}productCardClicked(t,e){let i={videoID:e.id,videoIndex:this.currentIndex},n=["CE More Item Info Clicked",{current:i},{triggerData:this.engagementTrigger}];window.CooeeSDK.events.push(n),this.selectedItem=t,this.selectedVideo=e}onVideoLoadStart(t){this.videoLoadingStates.set(t,!0)}onVideoCanPlay(t){this.videoLoadingStates.set(t,!1)}shouldShowVideoSpinner(t){return this.swiperInitialized()?this.videoLoadingStates.get(t)===!0&&this.isVideoVisible(t):this.isVideoVisible(t)}isVideoVisible(t){let e=this.currentIndex-1,i=this.currentIndex+1;return t===this.currentIndex||t===e||t===i}async initSwiperOptions(){await this.cssLoadedPromise;let t=this.isMobile?1:"auto",e=0;this.isProductDetailView()&&(t="auto",e=10),this.swiperOptions.set({direction:this.isMobile?"vertical":"horizontal",effect:this.isMobile?"slide":"coverflow",slidesPerView:t,initialSlide:this.currentIndex,centeredSlides:!0,spaceBetween:e,coverflowEffect:{rotate:0,stretch:0,depth:400,modifier:1,slideShadows:!1},on:{init:i=>{this.swiperInitialized.set(!0),setTimeout(()=>{i.update()},100)}},mousewheel:{enabled:!this.isMobile,invert:!1,thresholdDelta:20}})}isProductDetailView(){return this.detailPopupTemplate==="PRODUCT_DETAIL_VIEW"}currentVideoProps(){return{videoID:this.videos[this.currentIndex].id,videoIndex:this.currentIndex}}getPreviousVideoDataForEvent(){let t=this.currentVideoProps(),e=this.videoElements.find(n=>n.nativeElement.dataset.videoId===this.videos[this.currentIndex].id)?.nativeElement;t.playedTillMS=Math.ceil(e?.currentTime*1e3);let i=e?.duration*1e3;return t.playedTillPercent=+(t.playedTillMS/i).toFixed(4),t}selectItemForDetailView(){this.selectedVideo=this.videos[this.currentIndex],this.selectedItem=this.isMobile?null:this.selectedVideo?.items?.[0]??null}applyOptimalVideoDimensions(){if(this.isMobile||this.isProductDetailView())return;let t=this.calculateOptimalVideoDimensions();t&&this.setVideoContainerDimensions(t.width,t.height)}calculateOptimalVideoDimensions(){let t=this.videos.map(f=>f.sources?.[0]).filter(f=>f?.width&&f?.height).map(f=>({width:f.width,height:f.height,aspectRatio:f.width/f.height}));if(t.length===0)return null;let e=t[0],i=window.innerWidth*.9,n=window.innerHeight*.9,r=i/e.width,C=n/e.height,ie=Math.min(r,C);return{width:Math.floor(e.width*ie),height:Math.floor(e.height*ie)}}setVideoContainerDimensions(t,e){let i=this.elementRef.nativeElement;i.style.setProperty("--video-container-width",`${t}px`),i.style.setProperty("--video-container-height",`${e}px`)}onResize(){this.applyOptimalVideoDimensions()}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=x({type:o,selectors:[["cooee-video-detail-dialog"]],viewQuery:function(e,i){if(e&1&&(K(Ze,7),K(et,5)),e&2){let n;G(n=Y())&&(i.swiperComponent=n.first),G(n=Y())&&(i.videoElements=n)}},hostAttrs:[1,"letscooee-widget"],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"],[3,"src","type"],[1,"swiper-no-swiping","swiper-no-mousewheel",3,"item","similarItems"],[1,"loading-spinner"],[3,"video"],[1,"lc-video-controls"],[3,"mutedChange","toggled","muted","videoEl"],[1,"lc-card-container"],[3,"items"],[3,"card"],[3,"buttonClick","cardClick","items"],[1,"swiper-no-swiping","swiper-no-mousewheel",3,"performCTA","closeModel","item","similarItems"],["type","button","aria-label","Close",1,"lc-close-button",3,"click"],["name","close","aria-hidden","true"]],template:function(e,i){if(e&1){let n=_();s(0,"div",3)(1,"cooee-swiper",4,0),g("slideChange",function(C){return p(n),m(i.onSlideChange(C))}),de(3,5),b(4,st,10,10,"div",6,F),le(),l(),s(6,"div",7),S(7,ct,1,0,"ng-container",8),l()(),S(8,pt,2,0,"ng-template",null,1,fe)}if(e&2){let n=P(9);c("ngClass",i.viewTemplateClassName),a(),c("options",i.swiperOptions())("navigationConfig",i.navigationConfig),a(3),y(i.videos),a(3),c("ngTemplateOutlet",n)}},dependencies:[W,j,Fe,U,xe,B,Ae,Se,$],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%}.lc-product-detail-view .video-swiper>.swiper-wrapper{align-items:center}@media (max-width: 768px){.video-swiper>.swiper-button-prev,.video-swiper>.swiper-button-next{display:none!important}}.video-slide{position:relative;display:flex;align-items:center;visibility:hidden}.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}}.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}
3
- `],encapsulation:3})};export{ze as VideoDetailDialogComponent};