PageSourceSearch

https://levoit.com/cdn/shop/t/191/assets/custom.js?v=104913095308801165571790094444

js levoit.com collected 2026-09-24 23:46:27 UTC 16,323 bytes, 2 lines download raw bytes

1(()=>{setContainerHeight(),window.addEventListener("resize",setContainerHeight),carouselElement(),updateStoreStatus({open:9,close:17,textContainer:document.getElementById("store-status")});function setContainerHeight(){document.querySelectorAll(".autoheight").forEach(container=>{const image=container.querySelector("img");if(image){const width=container.offsetWidth,ratio=image.naturalHeight/image.naturalWidth,height=width*ratio;container.style.height=`${height}px`}})}window.addEventListener("resize",setContainerHeight);function updateStoreStatus({open,close,textContainer}){if(!textContainer)return;function toPST(date){const utc=date.getTime()+date.getTimezoneOffset()*6e4;return new Date(utc-36e5*8)}const now=toPST(new Date),day=now.getDay(),hours=now.getHours();day>=1&&day<=5?hours<open?textContainer.innerHTML="Customer service is currently closed. Opens at 9:00 AM.":hours>=close?textContainer.innerHTML="Customer service is currently closed. Opens tomorrow at 9:00 AM.":textContainer.innerHTML="Customer service is currently open.":textContainer.innerHTML="Customer service is closed today."}function carouselElement(){const slider=document.querySelector(".tws__slider");if(!slider)return;const slide=slider.querySelector(".tws__slide-list"),next=slider.querySelector(".pro-next"),prev=slider.querySelector(".pro-prev"),need_loop=document.querySelector(".tws__ctrl").hasAttribute("data-loop"),itemsWidth=690,itemsPerStep=1;let currentSlide=0,totalSlides=slide.children.length,totalItems=slide.children.length;function updateSlider(){slide.style.transform=`translateX(-${currentSlide*itemsWidth}px)`,need_loop||(currentSlide===totalSlides-itemsPerStep?next.style.display="none":next.style.display="block",currentSlide===0?prev.style.display="none":prev.style.display="block")}function nextSlide(){currentSlide+=itemsPerStep,currentSlide>totalSlides-itemsPerStep&&(need_loop?currentSlide=0:currentSlide=totalSlides-itemsPerStep),updateSlider()}function prevSlide(){currentSlide-=itemsPerStep,currentSlide<0&&(need_loop?currentSlide=totalSlides-itemsPerStep:currentSlide=0),updateSlider()}next.addEventListener("click",nextSlide),prev.addEventListener("click",prevSlide),window.addEventListener("resize",()=>{totalSlides=Math.ceil(totalItems/itemsPerStep),updateSlider()}),updateSlider()}const imageOvrelayBtn=document.querySelectorAll(".img-wrp .svg-wrp .imageOvrelaybtn");imageOvrelayBtn?.forEach(button=>{button.addEventListener("click",event=>{event.preventDefault();const imageOvrelayText=button.closest(".img-wrp");button.classList.contains("is--active")?(button.classList.remove("is--active"),imageOvrelayText.querySelector(".image-ovrelayContent").classList.remove("is--active")):(button.classList.add("is--active"),imageOvrelayText.querySelector(".image-ovrelayContent").classList.add("is--active"))})})})(),document.addEventListener("DOMContentLoaded",function(){function initFilterChecklist(){document.querySelectorAll(".v-filter-checklist").forEach(function(el){const initKey="filter_checklist_init_"+el.getAttribute("data-section-id");if(window[initKey])return;window[initKey]=!0;const items=el.querySelectorAll(".v-filter-checklist__item"),images=el.querySelectorAll(".v-filter-checklist__image:not(.v-filter-checklist__image--default)"),defaultImage=el.querySelector(".v-filter-checklist__image--default"),listWrapper=el.querySelector(".v-filter-checklist__list-wrapper");function switchItem(index){items.forEach(function(item){item.classList.remove("active")}),images.forEach(function(img){img.classList.remove("active")}),index>=0&&index<items.length?(items[index].classList.add("active"),images[index].classList.add("active"),defaultImage&&defaultImage.classList.add("hidden")):defaultImage&&defaultImage.classList.remove("hidden")}function resetToDefault(){switchItem(-1)}function isMobile(){return window.innerWidth<700}items.forEach(function(item){const index=parseInt(item.getAttribute("data-index"));item.addEventListener("click",function(e){e.preventDefault(),switchItem(index)}),item.addEventListener("mouseenter",function(){isMobile()||switchItem(index)})}),listWrapper&&listWrapper.addEventListener("mouseleave",function(){isMobile()||resetToDefault()}),isMobile()?switchItem(0):resetToDefault()})}initFilterChecklist(),typeof Shopify<"u"&&Shopify.designMode&&document.addEventListener("shopify:section:load",function(e){document.querySelector("#shopify-section-"+e.detail.sectionId+" .v-filter-checklist")&&(window["filter_checklist_init_"+e.detail.sectionId]=!1,setTimeout(initFilterChecklist,100))})}),(function(){"use strict";function clampToZero(n){return n<0?0:n}function pad2(n){var v=Math.floor(clampToZero(n));return v<10?"0"+v:String(v)}function normalizeOffsetColon(tz){return tz.replace(/([+-]\d{2})(\d{2})$/,"$1:$2")}function ensureIsoWithTz(input){if(!input)return null;var s=String(input).trim();return s?(s=s.replace(/\//g,"-"),s=s.replace(" ","T"),/^\d{4}-\d{2}-\d{2}$/.test(s)&&(s+="T00:00:00"),/[zZ]|[+-]\d{2}:?\d{2}$/.test(s)?s=s.replace(/([+-]\d{2})(\d{2})$/,normalizeOffsetColon("$1$2")):s+="-04:00",s):null}function TimeCalculator(){}TimeCalculator.prototype.parse=function(input){var iso=ensureIsoWithTz(input);if(!iso)return null;var d=new Date(iso);return isNaN(d.getTime())?null:d}
1,TimeCalculator.prototype.diff=function(target,now){var ms=target.getTime()-now.getTime();ms=Math.max(0,ms);var totalSeconds=Math.floor(ms/1e3),days=Math.floor(totalSeconds/86400),hours=Math.floor(totalSeconds%86400/3600),minutes=Math.floor(totalSeconds%3600/60),seconds=totalSeconds%60;return{days,hours,minutes,seconds,ms}};function DOMUpdater(root){this.root=root}DOMUpdater.prototype.setValues=function(values,leading){var dd=this.root.querySelector("[data-dd]"),hh=this.root.querySelector("[data-hh]"),mm=this.root.querySelector("[data-mm]"),ss=this.root.querySelector("[data-ss]");function setIfChanged(el,nextText){if(el){var text=String(nextText);el.textContent!==text&&(el.textContent=text)}}setIfChanged(dd,leading?pad2(values.days):String(values.days)),setIfChanged(hh,leading?pad2(values.hours):String(values.hours)),setIfChanged(mm,leading?pad2(values.minutes):String(values.minutes)),setIfChanged(ss,leading?pad2(values.seconds):String(values.seconds))},DOMUpdater.prototype.showCompleteText=function(text){this.root.innerHTML='<span class="v-countdown__complete-text">'+(text||"")+"</span>"},DOMUpdater.prototype.hide=function(){this.root.style.display="none"},DOMUpdater.prototype.zero=function(leading){this.setValues({days:0,hours:0,minutes:0,seconds:0},leading)};function CountdownComponent(el,options){this.el=el,this.options=options||{},this.tc=new TimeCalculator,this.updater=new DOMUpdater(el),this._interval=null,this._target=null}CountdownComponent.prototype.init=function(){var targetStr=this.options.target||this.el.getAttribute("data-target")||"",tzTarget=this.tc.parse(targetStr);if(!tzTarget){var invalidText=this.options.invalidText||this.el.getAttribute("data-invalid-text")||"Invalid date";return this.el.innerHTML=invalidText,!1}this._target=tzTarget,this.render();var self=this;return this._interval=setInterval(function(){self.render()},1e3),!0},CountdownComponent.prototype.pause=function(){this._interval&&(clearInterval(this._interval),this._interval=null)},CountdownComponent.prototype.resume=function(){var self=this;this._target&&(this._interval||(this.render(),this._interval=setInterval(function(){self.render()},1e3)))},CountdownComponent.prototype.render=function(){var leading=this.options.leadingZero!=null?this.options.leadingZero:this.el.getAttribute("data-leading-zero")==="true",behavior=this.options.completeBehavior||this.el.getAttribute("data-complete-behavior")||"hide",completeText=this.options.completeText||this.el.getAttribute("data-complete-text")||"",diff=this.tc.diff(this._target,new Date);if(diff.ms<=0){this.destroy(),behavior==="text"&&completeText?this.updater.showCompleteText(completeText):behavior==="hide"?this.updater.hide():this.updater.zero(leading);return}this.updater.setValues(diff,leading)},CountdownComponent.prototype.destroy=function(){this._interval&&(clearInterval(this._interval),this._interval=null)};var Registry=(function(){var instances=new Set;function isManaged(el){return!!(el.__vCc||el.__vCountdownInterval)}function attach(el){if(!el||isManaged(el))return null;var comp=new CountdownComponent(el,{});return comp.init()?(el.__vCc=comp,instances.add(comp),comp):null}function initAllIn(root){var scope=root||document,els=scope.querySelectorAll("[data-countdown]");els.forEach(function(el){attach(el)})}function destroyAllIn(root){var scope=root||document,els=scope.querySelectorAll("[data-countdown]");els.forEach(function(el){el.__vCc&&(el.__vCc.destroy(),instances.delete(el.__vCc),el.__vCc=null)})}function pauseAll(){instances.forEach(function(c){c.pause()})}function resumeAll(){instances.forEach(function(c){c.resume()})}return{attach,initAllIn,destroyAllIn,pauseAll,resumeAll}})();function onDomReady(fn){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",fn):fn()}onDomReady(function(){if(!(window.VCountdownModule&&window.VCountdownModule.autoInit===!1))try{Registry.initAllIn(document)}catch{}}),document.addEventListener("visibilitychange",function(){try{document.hidden?Registry.pauseAll():Registry.resumeAll()}catch{}}),window.addEventListener("beforeunload",function(){try{Registry.destroyAllIn(document)}catch{}}),window.Shopify&&Shopify.designMode&&(document.addEventListener("shopify:section:load",function(e){try{if(!e||!e.detail||!e.detail.sectionId)return;var root=document.getElementById("shopify-section-"+e.detail.sectionId);root&&Registry.initAllIn(root)}catch{}}),document.addEventListener("shopify:section:unload",function(e){try{if(!e||!e.detail||!e.detail.sectionId)return;var root=document.getElementById("shopify-section-"+e.detail.sectionId);root&&Registry.destroyAllIn(root)}catch{}})),window.VCountdownModule={TimeCalculator,DOMUpdater,CountdownComponent,Registry,autoInit:!0}})(),(function(){"use strict";function qsa(scope,sel){return Array.prototype.slice.call((scope||document).querySelectorAll(sel))}function on(el,type,handler){el&&el.addEventListener(type,handler,{passive:!0})}function getStickyOffset(nav){try{if(nav.getAttribute("data-sticky")!=="true")return 0;var top=getComputedStyle(nav).top,n=parseInt(top,10);return isNaN(n)?0:n}catch{return 0}}function smoothScrollTo(y){try{window.scrollTo({top:y,behavior:"smooth"})}catch{window.scrollTo(0,y)}}function scrollToId(id,offset){var el=document.getElementById(id);if(!el)return!1;var rect=el.getBoundingClientRect(),extraOffset=0;try{var computed=getComputedStyle(el),scrollMarginTop=computed.scrollMarginTop;if(scrollMarginTop&&scrollMarginTop!=="auto"){var headerHeight=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--header-height"),10)||0,totalMargin=parseFloat(scrollMarginTop);extraOffset=totalMargin-headerHeight}}catch{}var top=rect.top+window.pageYOffset-(offset||0)-extraOffset;return smoothScrollTo(top),!0}function initAnchorNav(root){var container=root||document,navs=qsa(container,".v-anchor-navigation");
1navs.length&&navs.forEach(function(nav){if(nav.__vAnchorInit)return;nav.__vAnchorInit=!0;var smooth=String(nav.getAttribute("data-smooth"))==="true",links=qsa(nav,".v-anchor-navigation__link");if(!links.length)return;var stickyTop=getStickyOffset(nav),lockTargetId=null;function unlockWhenArrived(targetEl){if(!targetEl){lockTargetId=null;return}var tries=0;(function tick(){var expected=getDocTop(targetEl)-stickyTop,at=Math.abs(window.pageYOffset-expected)<=2;if(at||tries>300){lockTargetId=null,recomputeActiveByScroll();return}tries++,requestAnimationFrame(tick)})()}links.forEach(function(a){a.addEventListener("click",function(e){var id=a.getAttribute("data-anchor")||"";if(id){smooth&&e.preventDefault();var ok=scrollToId(id,stickyTop);smooth&&ok&&(lockTargetId=id,setActive(id),unlockWhenArrived(document.getElementById(id)))}},{passive:!1})});var activeClass="is-active";function setActive(id){var activeLink=null;links.forEach(function(a){var isActive=id&&a.getAttribute("data-anchor")===id;a.classList.toggle(activeClass,isActive),isActive?(a.setAttribute("aria-current","location"),activeLink=a):a.removeAttribute("aria-current")}),activeLink&&list&&list.scrollWidth>list.clientWidth&&scrollActiveToCenter(activeLink)}function scrollActiveToCenter(activeLink){if(!(!activeLink||!list)){var linkRect=activeLink.getBoundingClientRect(),listRect=list.getBoundingClientRect(),linkCenterX=linkRect.left+linkRect.width/2-listRect.left+list.scrollLeft,listCenterX=list.clientWidth/2,targetScrollLeft=linkCenterX-listCenterX;targetScrollLeft=Math.max(0,Math.min(targetScrollLeft,list.scrollWidth-list.clientWidth)),list.scrollTo({left:targetScrollLeft,behavior:"smooth"})}}var targets=links.map(function(a){var id=a.getAttribute("data-anchor");return id?document.getElementById(id):null}).filter(Boolean);function getDocTop(el){try{var r=el.getBoundingClientRect();return r.top+window.pageYOffset}catch{return 0}}function recomputeActiveByScroll(){if(lockTargetId){setActive(lockTargetId);return}if(!targets.length){setActive(null);return}for(var viewport=window.innerHeight||document.documentElement.clientHeight||0,lineY=window.scrollY+stickyTop+Math.min(viewport*.25,200),ordered=targets.slice().sort(function(a,b){return getDocTop(a)-getDocTop(b)}),current=null,i=0;i<ordered.length&&getDocTop(ordered[i])<=lineY;i++)current=ordered[i];var scrollBottom=window.scrollY+viewport,docHeight=Math.max(document.body.scrollHeight,document.documentElement.scrollHeight);!current&&docHeight-scrollBottom<=2&&(current=ordered[ordered.length-1]),setActive(current?current.id:null)}if("IntersectionObserver"in window){var io=new IntersectionObserver(function(entries){entries.forEach(function(entry){!lockTargetId&&entry.isIntersecting&&setActive(entry.target.id)})},{root:null,rootMargin:"0px 0px -60% 0px",threshold:.1});targets.forEach(function(t){io.observe(t)}),on(window,"scroll",recomputeActiveByScroll),on(window,"resize",recomputeActiveByScroll),recomputeActiveByScroll()}else{let onScroll=function(){ticking||(ticking=!0,requestAnimationFrame(function(){recomputeActiveByScroll(),ticking=!1}))};var ticking=!1;on(window,"scroll",onScroll),on(window,"resize",onScroll),onScroll()}var list=nav.querySelector(".v-anchor-navigation__list"),prevBtn=nav.querySelector('[data-arrow="prev"]'),nextBtn=nav.querySelector('[data-arrow="next"]');if(list&&prevBtn&&nextBtn){let updateArrows=function(){try{var canScrollLeft=list.scrollLeft>0,canScrollRight=Math.ceil(list.scrollLeft+list.clientWidth)<list.scrollWidth,hasOverflow=list.scrollWidth>list.clientWidth;prevBtn.hidden=!canScrollLeft,nextBtn.hidden=!canScrollRight,nav.classList.toggle("has-scroll-arrows",canScrollLeft||canScrollRight),list.classList.toggle("has-overflow",hasOverflow),hasOverflow&&list.scrollLeft===0&&getComputedStyle(list).justifyContent==="center"&&setTimeout(function(){list.scrollLeft=0},0)}catch{}},scrollByAmount=function(dir){var amount=Math.max(120,Math.floor(list.clientWidth*.6)),to=dir==="next"?list.scrollLeft+amount:list.scrollLeft-amount;list.scrollTo({left:to,behavior:"smooth"})};prevBtn.addEventListener("click",function(){scrollByAmount("prev")}),nextBtn.addEventListener("click",function(){scrollByAmount("next")}),list.addEventListener("scroll",updateArrows,{passive:!0}),window.addEventListener("resize",updateArrows),setTimeout(function(){updateArrows(),list.scrollWidth>list.clientWidth&&(list.scrollLeft=0)},0)}if(location.hash&&location.hash.length>1){var initialId=location.hash.slice(1);setTimeout(function(){scrollToId(initialId,stickyTop),setActive(initialId)},0)}window.addEventListener("popstate",function(){var id=(location.hash||"").replace(/^#/,"");id&&(scrollToId(id,stickyTop),setActive(id))})})}function onReady(fn){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",fn):fn()}onReady(function(){try{initAnchorNav(document)}catch{}}),window.Shopify&&Shopify.designMode&&document.addEventListener("shopify:section:load",function(e){try{if(!e||!e.detail||!e.detail.sectionId)return;var root=document.getElementById("shopify-section-"+e.detail.sectionId);root&&initAnchorNav(root)}catch{}})})();
2//# sourceMappingURL=/cdn/shop/t/191/assets/custom.js.map?v=104913095308801165571790094444

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.