PageSourceSearch

https://www.jansport.com/cdn/shop/t/80/assets/colors-modal.BQzM-uQV.min.js

js jansport.com collected 2026-09-24 18:17:43 UTC 3,923 bytes, 1 lines download raw bytes

1var p=Object.defineProperty;var m=(c,a,e)=>a in c?p(c,a,{enumerable:!0,configurable:!0,writable:!0,value:e}):c[a]=e;var h=(c,a,e)=>m(c,typeof a!="symbol"?a+"":a,e);import{E as g}from"./events.CylfRtLc.min.js";import{p as y}from"./parse-html.C-hh7jJd.min.js";import{S as f}from"./sections-api-service.CIHHOVpP.min.js";import{e as v}from"./body-scroll.B--ZoFRz.min.js";class T extends HTMLElement{constructor(){super();h(this,"handleProductCardClick",e=>{const r=e.currentTarget,t=JSON.parse(r.getAttribute("data-product")),o=r.getAttribute("data-variant-id"),i=t.variants.find(s=>s.id==o),n=new CustomEvent(g.PRODUCT_VARIANT_UPDATE,{detail:{product:t,variant:i},bubbles:!0});this.dispatchEvent(n),this.closeModal()});h(this,"handleFilterClick",async e=>{var i,n;e.currentTarget.classList.toggle("active");let r=this.querySelectorAll(".color-filter-tab-js.active");const t=this.querySelector(".color-filter-tab-js");if(t&&t.dataset.colorGroup!==void 0){let s=Array.from(r).map(l=>l.dataset.colorGroup);this.querySelectorAll(".colors-modal-product-card-js").forEach(l=>{if(s.length===0)l.style.display="";else{let u=l.dataset.colorGroup;s.includes(u)?l.style.display="":l.style.display="none"}})}else{let s=(n=(i=document.querySelector("main-product-standard-option-color"))==null?void 0:i.dataset)==null?void 0:n.partNumber;if(!s)return;const d=new URL(`${window.Shopify.routes.root}collections/all`,window.location.origin);d.searchParams.set("section_id","colors-modal"),d.searchParams.set("filter.p.m.oms.part_number",s),r.length>0&&r.forEach(l=>{d.searchParams.append(l.dataset.name,l.dataset.value)}),await this.render(d),this.init()}});this.startY=0,this.endY=0,this.swipeThreshold=100,this.init()}init(){this.setProductModalHeight(),this.setEventListeners(),window.addEventListener("resize",()=>{setTimeout(()=>this.setProductModalHeight(),50)})}setEventListeners(){window.innerWidth<=768?(this.addEventListener("touchstart",t=>{this.startY=t.touches[0].clientY}),this.addEventListener("touchmove",t=>{this.endY=t.changedTouches[0].clientY;const o=t.target.closest(".colors-modal-close");this.endY-this.startY>this.swipeThreshold&&o&&window.innerWidth<=768&&(this.closeModal(),this.startY=0,this.endY=0)})):(this.querySelector(".colors-modal-close").addEventListener("click",()=>{this.closeModal()}),document.querySelector(".color-overlay-modal-overlay").addEventListener("click",()=>{this.closeModal()})),this.querySelectorAll(".color-filter-tab-js").forEach(t=>{t.addEventListener("click",o=>{this.handleFilterClick(o)})}),this.querySelectorAll(".colors-modal-product-card-js").forEach(t=>{t.addEventListener("click",o=>{this.handleProductCardClick(o)})})}async render(e){const r=await f.fetch(e,"colors-modal");if(!r)return;const t=y(r,"#shopify-section-colors-modal");let o=document.querySelector(".color-overlay-modal-data");o.innerHTML="",o.innerHTML=t.innerHTML}closeModal(){document.querySelector(".color-overlay-modal").classList.remove("active"),v()}setProductModalHeight(){const e=this.getTotalHeightWithMargins(this.querySelector(".colors-modal-header")),r=this.getTotalHeightWithMargins(this.querySelector(".colors-modal-filter-wrapper"));let t=this.querySelector(".colors-modal-product-wrapper");if(window.innerWidth<=768){const o=this.getTotalHeightWithMargins(this.querySelector(".colors-modal-close")),i=parseInt(document.documentElement.style.getPropertyValue("--promo-bar-height")||"0",10)||0,n=parseInt(document.documentElement.style.getPropertyValue("--mobile-header-height")||"0",10)||0;let s=e+r+o+i+n+16;t.style.setProperty("--product-wrapper-height",`${s}px`)}else{let o=e+r+64;t.style.setProperty("--product-wrapper-height",`${o}px`)}}getTotalHeightWithMargins(e){const r=window.getComputedStyle(e),t=parseFloat(r.marginTop),o=parseFloat(r.marginBottom);return e.offsetHeight+t+o}}const b=()=>{customElements.get("colors-modal")||customElements.define("colors-modal",T)};export{b as default};

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.