PageSourceSearch

https://www.withinpets.com/cdn/shop/t/3/assets/product-card.js?v=109162507960970066601781781537

js withinpets.com collected 2026-10-05 09:33:54 UTC 30,591 bytes, 2 lines download raw bytes

1var ce=Object.defineProperty,ue=Object.defineProperties,le=Object.getOwnPropertyDescriptors,Ft=Object.getOwnPropertySymbols,de=Object.prototype.hasOwnProperty,fe=Object.prototype.propertyIsEnumerable,Bt=n=>{throw TypeError(n)},Et=(n,r,t)=>r in n?ce(n,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[r]=t,O=(n,r)=>{for(var t in r||(r={}))de.call(r,t)&&Et(n,t,r[t]);if(Ft)for(var t of Ft(r))fe.call(r,t)&&Et(n,t,r[t]);return n},nt=(n,r)=>ue(n,le(r)),g=(n,r,t)=>Et(n,typeof r!="symbol"?r+"":r,t),wt=(n,r,t)=>r.has(n)||Bt("Cannot "+t),c=(n,r,t)=>(wt(n,r,"read from private field"),t?t.call(n):r.get(n)),f=(n,r,t)=>r.has(n)?Bt("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(n):r.set(n,t),v=(n,r,t,e)=>(wt(n,r,"write to private field"),e?e.call(n,t):r.set(n,t),t),p=(n,r,t)=>(wt(n,r,"access private method"),t),Xt=typeof window.requestIdleCallback=="function"?window.requestIdleCallback:setTimeout,it=()=>"yield"in At?At.yield():new Promise(n=>{requestAnimationFrame(()=>{setTimeout(n,0)})}),$t={current:void 0};function Wt(n,r){let t;function e(...i){clearTimeout(t),t=setTimeout(()=>n.apply(this,i),r)}return e.cancel=()=>{clearTimeout(t)},e}var Ee=matchMedia("(prefers-reduced-motion: reduce)"),Tt=matchMedia("(min-width: 750px)");function zt(){return Tt.matches}var St=class extends HTMLElement{shimmer(){this.setAttribute("shimmer","")}};customElements.get("text-component")||customElements.define("text-component",St);function Kt(){return new URLSearchParams(window.location.search).get("view")}var q,H,xt=class{constructor(){f(this,q,new Set),f(this,H,!1),g(this,"schedule",async r=>{c(this,q).add(r),c(this,H)||(v(this,H,!0),$t.current&&await $t.current,requestAnimationFrame(this.flush))}),g(this,"flush",()=>{for(let r of c(this,q))setTimeout(r,0);c(this,q).clear(),v(this,H,!1)})}};q=new WeakMap,H=new WeakMap;var At=new xt,U,V=class extends ResizeObserver{constructor(t){super(e=>{if(c(this,U))return t(e,this);v(this,U,!0)}),f(this,U,!1)}disconnect(){v(this,U,!1),super.disconnect()}};U=new WeakMap,typeof Theme<"u"&&(Theme.utilities=nt(O({},Theme.utilities),{scheduler:At}));var J=class extends HTMLElement{connectedCallback(){if(!this.shadowRoot){let r=this.querySelector(':scope > template[shadowrootmode="open"]');if(!(r instanceof HTMLTemplateElement))return;this.attachShadow({mode:"open"}).append(r.content.cloneNode(!0))}}},R,st,_,D,A=class extends J{constructor(){super(...arguments),f(this,R),g(this,"refs",{}),g(this,"requiredRefs"),f(this,_,new MutationObserver(t=>{t.some(e=>e.type==="attributes"&&c(this,D).call(this,e.target)||e.type==="childList"&&[...e.addedNodes,...e.removedNodes].some(c(this,D)))&&p(this,R,st).call(this)})),f(this,D,t=>Pt(Gt(t))===this)}get roots(){return this.shadowRoot?[this,this.shadowRoot]:[this]}connectedCallback(){super.connectedCallback(),he(),p(this,R,st).call(this),Xt(()=>{for(let t of this.roots)c(this,_).observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["ref"],attributeOldValue:!0})})}updatedCallback(){c(this,_).takeRecords(),p(this,R,st).call(this)}disconnectedCallback(){c(this,_).disconnect()}};R=new WeakSet,st=function(){var i,s;let t={},e=this.roots.reduce((o,a)=>{for(let u of a.querySelectorAll("[ref]"))c(this,D).call(this,u)&&o.add(u);return o},new Set);for(let o of e){let a=(i=o.getAttribute("ref"))!=null?i:"",u=a.endsWith("[]"),l=u?a.slice(0,-2):a;if(u){let d=Array.isArray(t[l])?t[l]:[];d.push(o),t[l]=d}else t[l]=o}if((s=this.requiredRefs)!=null&&s.length){for(let o of this.requiredRefs)if(!(o in t))throw new Ct(o,this)}this.refs=t},_=new WeakMap,D=new WeakMap;function Gt(n){if(n.parentNode)return n.parentNode;let r=n.getRootNode();return r instanceof ShadowRoot?r.host:null}function Pt(n){if(!n)return null;if(n instanceof A||n instanceof HTMLElement&&n.tagName.toLowerCase().endsWith("-component"))return n;let r=Gt(n);return r?Pt(r):null}var jt=!1;function he(){if(jt)return;jt=!0;let n=["click","change","select","focus","blur","submit","input","keydown","keyup","toggle"],r=["focus","blur"],t=["pointerenter","pointerleave"];for(let i of[...n,...t]){let s=`on:${i}`;document.addEventListener(i,o=>{var x;let a=e(o);if(!a)return;let u=o.target!==a?new Proxy(o,{get(w,Dt){if(Dt==="target")return a;let vt=Reflect.get(w,Dt);return typeof vt=="function"?vt.bind(w):vt}}):o,l=(x=a.getAttribute(s))!=null?x:"",[d,h]=l.split("/"),m=l.match(/([\/\?][^\/\?]+)([\/\?][^\/\?]+)$/),S=m?m[2]:null,C=d?d.startsWith("#")?document.querySelector(d):a.closest(d):Pt(a);if(!(C instanceof A)||!h)return;h=h.replace(/\?.*/,"");let rt=C[h];if(typeof rt=="function")try{let w=[u];S&&w.unshift(pe(S)),rt.call(C,...w)}catch(w){console.error(w)}},{capture:!0})}function e(i){var o,a;let s=(a=(o=i.composedPath)==null?void 0:o.call(i)[0])!=null?a:i.target;if(s instanceof Element)return s.hasAttribute(`on:${i.type}`)?s:t.includes(i.type)?null:i.bubbles||r.includes(i.type)?s.closest(`[on\\:${i.type}]`):null}}function pe(n){let r=n[0],t=n.slice(1);return r==="?"?Object.fromEntries(Array.from(new URLSearchParams(t).entries()).map(([e,i])=>[e,Yt(i)])):Yt(t)}function Yt(n){if(n==="true")return!0;
1if(n==="false")return!1;let r=Number(n);return!isNaN(r)&&n.trim()!==""?r:n}var Ct=class extends Error{constructor(r,t){super(`Required ref "${r}" not found in component ${t.tagName.toLowerCase()}`)}},kt=class extends Event{constructor(r){super("overflowMinimum",{bubbles:!0}),this.detail={minimumReached:r}}},b,Jt,Qt,F,ot,Z,It,Zt,Nt,P,Mt,Lt,T,B,$,M,Q=class extends J{constructor(){super(...arguments),f(this,b),f(this,F,!1),f(this,ot,t=>{let e=t[0];e!=null&&e.isIntersecting&&(c(this,M).disconnect(),setTimeout(()=>{var i;(i=this.querySelector(':scope > template[shadowrootmode="open"]'))==null||i.remove(),c(this,P).call(this,e.boundingClientRect.height)},0))}),f(this,Z,()=>{c(this,F)||(v(this,F,!0),requestAnimationFrame(()=>setTimeout(()=>{c(this,P).call(this),v(this,F,!1)},0)))}),f(this,P,(t=0,e=null)=>{let{defaultSlot:i,overflowSlot:s,moreSlot:o,list:a,placeholder:u}=c(this,T);p(this,b,Lt).call(this),p(this,b,It).call(this);let l=i.assignedElements();if(!l[l.length-1]){p(this,b,Mt).call(this);return}let h=[],m=[],S=0,C=!1;t>0&&a.style.setProperty("height",`${t}px`),a.style.setProperty("flex-wrap","wrap"),u.hidden=!0,o.style.setProperty("order","-1"),o.hidden=!1,e?.style.setProperty("order","-1");let rt=o.getBoundingClientRect();l.forEach(x=>{let w=x.getBoundingClientRect();w.top>rt.top?(m.length||(S=w.width),C=!0,m.push(x)):h.push(x)}),C&&o.style.removeProperty("order"),e?.style.removeProperty("order");for(let x of l){let w=m.includes(x)?s.name:i.name;x.slot!==w&&(x.slot=w)}a.style.setProperty("counter-reset",`overflow-count ${m.length}`),this.style.setProperty("--overflow-count",`${m.length}`),o.hidden=!C,C&&(u.style.width=`${S}px`,u.hidden=!1),a.style.setProperty("overflow","unset"),C&&p(this,b,Nt).call(this,h),p(this,b,Mt).call(this)}),f(this,T),f(this,B,new V(c(this,Z))),f(this,$,new MutationObserver(c(this,Z))),f(this,M,new IntersectionObserver(c(this,ot),{rootMargin:"640px 360px 640px 360px"}))}static get observedAttributes(){return["disabled","minimum-items"]}attributeChangedCallback(t,e,i){t==="disabled"&&(i==="true"?p(this,b,Zt).call(this):c(this,P).call(this))}async connectedCallback(){super.connectedCallback(),await p(this,b,Jt).call(this),p(this,b,Qt).call(this),c(this,P).call(this)}disconnectedCallback(){c(this,B).disconnect(),c(this,$).disconnect(),c(this,M).disconnect()}get schedule(){var t,e;return typeof((e=(t=Theme==null?void 0:Theme.utilities)==null?void 0:t.scheduler)==null?void 0:e.schedule)=="function"?Theme.utilities.scheduler.schedule:i=>requestAnimationFrame(()=>setTimeout(i,0))}get minimumItems(){let t=this.getAttribute("minimum-items");return t?parseInt(t,10):null}get overflowSlot(){let{overflowSlot:t}=c(this,T);return t}get defaultSlot(){let{defaultSlot:t}=c(this,T);return t}showAll(){let{placeholder:t}=c(this,T);t.style.setProperty("width","0"),t.style.setProperty("display","none"),this.setAttribute("disabled","true")}};b=new WeakSet,Jt=function(){var e;let t=(e=this.shadowRoot)==null?void 0:e.querySelector('link[rel="stylesheet"]');return!t||t.sheet?Promise.resolve():new Promise(i=>{t.addEventListener("load",i)})},Qt=function(){let{shadowRoot:t}=this;if(!t)throw new Error("Missing shadow root");let e=t.querySelector("slot:not([name])"),i=t.querySelector('slot[name="overflow"]'),s=t.querySelector('slot[name="more"]'),o=t.querySelector('[part="overflow"]'),a=t.querySelector('[part="list"]'),u=t.querySelector('[part="placeholder"]');if(!(e instanceof HTMLSlotElement)||!(i instanceof HTMLSlotElement)||!(s instanceof HTMLSlotElement)||!(o instanceof HTMLElement)||!(a instanceof HTMLUListElement)||!(u instanceof HTMLLIElement))throw new Error("Invalid element types in <OverflowList />");v(this,T,{defaultSlot:e,overflowSlot:i,moreSlot:s,overflow:o,list:a,placeholder:u}),this.addEventListener("reflow",m=>{c(this,P).call(this,0,m.detail.lastVisibleElement)});let l=e.assignedElements().filter(m=>!(m instanceof HTMLTemplateElement)),d=l[0],h=l[l.length-1];d&&c(this,M).observe(d),h&&h!==d&&c(this,M).observe(h)},F=new WeakMap,ot=new WeakMap,Z=new WeakMap,It=function(){let{defaultSlot:t,overflowSlot:e}=c(this,T);for(let i of e.assignedElements())i.slot!==t.name&&(i.slot=t.name)},Zt=function(){let{list:t}=c(this,T);p(this,b,Lt).call(this),p(this,b,It).call(this),t.style.removeProperty("height"),this.style.setProperty("--overflow-count","0")},Nt=function(t){if(this.minimumItems!==null){let e=t.length<this.minimumItems;e?this.setAttribute("minimum-reached",""):this.removeAttribute("minimum-reached"),this.dispatchEvent(new kt(e))}},P=new WeakMap,Mt=function(){c(this,B).observe(this),c(this,$).observe(this,{childList:!0})},Lt=function(){c(this,B).disconnect(),c(this,$).disconnect()},T=new WeakMap,B=new WeakMap,$=new WeakMap,M=new WeakMap,customElements.get("overflow-list")||customElements.define("overflow-list",Q);var y=class{};g(y,"variantSelected","variant:selected"),g(y,"variantUpdate","variant:update"),g(y,"cartUpdate","cart:update"),g(y,"cartError","cart:error"),g(y,"mediaStartedPlaying","media:started-playing"),g(y,"quantitySelectorUpdate","quantity-selector:update"),g(y,"productTierUpdate","product-tier:update"),g(y,"purchaseTypeUpd
1ate","purchase-type:update"),g(y,"megaMenuHover","megaMenu:hover"),g(y,"zoomMediaSelected","zoom-media:selected"),g(y,"discountUpdate","discount:update"),g(y,"FilterUpdate","filter:update");var at=class extends Event{constructor(r){super(y.variantSelected,{bubbles:!0}),this.detail={resource:r}}},ct=class extends Event{constructor(r,t,e){super(y.variantUpdate,{bubbles:!0}),this.detail={resource:r||null,sourceId:t,data:{html:e.html,productId:e.productId,newProduct:e.newProduct}}}},lt=class lt2 extends Event{constructor(r,t,e){super(lt2.eventName,{bubbles:!0}),this.detail={resource:r,sourceId:t,data:O({},e)}}};g(lt,"eventName",y.cartUpdate);var te=lt,dt=class dt2 extends Event{constructor(t){super(dt2.eventName,{bubbles:!0}),g(this,"detail"),this.detail=t}};g(dt,"eventName","slideshow:select");var ut=dt,Ht={childrenOnly:!0,reject(n,r){var t,e;return!!(r.nodeType===Node.TEXT_NODE&&((t=r.nodeValue)==null?void 0:t.trim())===""||r instanceof HTMLTemplateElement&&r.shadowRootMode==="open"&&n.parentElement&&r.parentElement&&n.parentElement.tagName===r.parentElement.tagName&&((e=n.parentElement)==null?void 0:e.shadowRoot)!=null||r.nodeType===Node.COMMENT_NODE&&r.nodeValue==="shopify:rendered_by_section_api")},onBeforeUpdate(n,r){if(n instanceof Element&&r instanceof Element){let t=["product-grid-view","data-current-checked","data-previous-checked","cart-summary-sticky"];for(let s of t){let o=n.getAttribute(s),a=r.getAttribute(s);o&&o!==a&&r.setAttribute(s,o)}let e=["floating-panel-component","fieldset.variant-option"],i=["account-popover"];for(let s of e)if(n.matches(s)&&r.matches(s)){let o=n.getAttribute("style");o&&r.setAttribute("style",o)}for(let s of i)if(n.id===s&&r.id===s){let o=n.getAttribute("style");o&&r.setAttribute("style",o)}n instanceof HTMLElement&&r instanceof HTMLElement&&n.style.viewTransitionName&&(r.style.viewTransitionName=n.style.viewTransitionName)}},onAfterUpdate(n){n instanceof A&&queueMicrotask(()=>n.updatedCallback())}};function W(n,r,t=Ht){if(!n||!r)throw new Error("Both oldTree and newTree must be provided");if(typeof r=="string"){let e=new DOMParser().parseFromString(r,"text/html").body.firstChild;if(!e)throw new Error("newTree string is not valid HTML");r=e}if(t.childrenOnly)return qt(r,n,t),n;if(r.nodeType===11)throw new Error("newTree should have one root node (not a DocumentFragment)");return ft(r,n,t)}function ft(n,r,t){var e,i;if(!r)return n;if(!n||(e=n.isSameNode)!=null&&e.call(n,r))return r;if(n.nodeType!==r.nodeType)return n;if(n instanceof Element&&r instanceof Element){if(r.tagName==="SHOPIFY-ACCELERATED-CHECKOUT-CART")return r;if(n.tagName!==r.tagName)return n;let s=X(n,t),o=X(r,t);if(s&&o&&s!==o)return n}return r instanceof Element&&r.hasAttribute("data-skip-node-update")&&n instanceof Element&&n.hasAttribute("data-skip-node-update")||me(n,r,t),qt(n,r,t),(i=t.onAfterUpdate)==null||i.call(t,n),r}function me(n,r,t){var e;if((e=t.onBeforeUpdate)==null||e.call(t,r,n),(n instanceof HTMLDetailsElement&&r instanceof HTMLDetailsElement||n instanceof HTMLDialogElement&&r instanceof HTMLDialogElement)&&(n.hasAttribute("declarative-open")||(n.open=r.open)),r instanceof HTMLElement&&n instanceof HTMLElement)for(let i of["slot","sizes"]){let s=r.getAttribute(i),o=n.getAttribute(i);s!==o&&(s==null?n.removeAttribute(i):n.setAttribute(i,s))}n instanceof Element&&r instanceof Element?r.isEqualNode(n)||ge(n,r):(n instanceof Text||n instanceof Comment)&&r.nodeValue!==n.nodeValue&&(r.nodeValue=n.nodeValue),n instanceof HTMLInputElement&&r instanceof HTMLInputElement?ye(n,r):n instanceof HTMLOptionElement&&r instanceof HTMLOptionElement?Ot(n,r,"selected"):n instanceof HTMLTextAreaElement&&r instanceof HTMLTextAreaElement&&be(n,r)}function X(n,r){var t,e;return(e=(t=r?.getNodeKey)==null?void 0:t.call(r,n))!=null?e:n instanceof Element?n.id:void 0}function Ot(n,r,t){n[t]!==r[t]&&(r[t]=n[t],n[t]!=null?r.setAttribute(t,""):r.removeAttribute(t))}function ge(n,r){let t=r.attributes,e=n.attributes;for(let i of Array.from(e)){let{name:s,namespaceURI:o,value:a}=i,u=i.localName||s;(s==="src"||s==="href"||s==="srcset"||s==="poster")&&r.getAttribute(s)===a||(o?r.getAttributeNS(o,u)!==a&&r.setAttributeNS(o,u,a):r.hasAttribute(s)?r.getAttribute(s)!==a&&(a==="null"||a==="undefined"?r.removeAttribute(s):r.setAttribute(s,a)):r.setAttribute(s,a))}for(let i of Array.from(t)){if(i.specified===!1)continue;let{name:s,namespaceURI:o}=i,a=i.localName||s;o?n.hasAttributeNS(o,a)||r.removeAttributeNS(o,a):n.hasAttribute(s)||r.removeAttribute(s)}}function ye(n,r){let t=n.value;Ot(n,r,"checked"),Ot(n,r,"disabled"),n.indeterminate!==r.indeterminate&&(r.indeterminate=n.indeterminate),r.type!=="file"&&(t!==r.value&&(r.setAttribute("value",t),r.value=t),t==="null"&&(r.value="",r.removeAttribute("value")),n.hasAttributeNS(null,"value")?r.type==="range"&&(r.value=t):r.removeAttribute("value"))}function be(n,r){let t=n.value;t!==r.value&&(r.value=t);let e=r.firstChild;
1if(e?.nodeType===Node.TEXT_NODE){if(t===""&&e.nodeValue===r.placeholder)return;e.nodeValue=t}}function qt(n,r,t){var u;if(r instanceof Element&&r.hasAttribute("data-skip-subtree-update")&&n instanceof Element&&n.hasAttribute("data-skip-subtree-update"))return;let e,i,s,o,a=0;for(let l=0;e=r.childNodes[l],i=n.childNodes[l-a],!(!e&&!i);l++){if(!i){e&&r.removeChild(e),l--;continue}if(!e){r.appendChild(i),a++;continue}if(ee(i,e,t)){s=ft(i,e,t),s!==e&&(r.replaceChild(s,e),a++);continue}if((u=t.reject)!=null&&u.call(t,e,i)){n.removeChild(i),l--;continue}o=null;for(let d=l;d<r.childNodes.length;d++){let h=r.childNodes[d];if(h&&ee(h,i,t)){o=h;break}}o?(s=ft(i,o,t),s!==o&&a++,r.insertBefore(s,e)):!X(i,t)&&!X(e,t)?(s=ft(i,e,t),s!==e&&(r.replaceChild(s,e),a++)):(r.insertBefore(i,e),a++)}}function ee(n,r,t){var e,i;if(n.nodeType!==r.nodeType)return!1;if(n.nodeType===Node.ELEMENT_NODE){if(n instanceof Element&&r instanceof Element&&n.tagName!==r.tagName)return!1;let s=X(n,t),o=X(r,t);if(s&&o&&s!==o)return!1}return n.nodeType===Node.TEXT_NODE&&r.nodeType===Node.TEXT_NODE?((e=n.nodeValue)==null?void 0:e.trim())===((i=r.nodeValue)==null?void 0:i.trim()):n.nodeType===Node.COMMENT_NODE&&r.nodeType===Node.COMMENT_NODE?n.nodeValue===r.nodeValue:!0}var z,K,j,Y,N,k,Ut,Vt,G=class extends A{constructor(){super(...arguments),f(this,k),f(this,z),f(this,K),f(this,j,[]),f(this,Y,[]),f(this,N,new V(()=>this.updateVariantPickerCss()))}connectedCallback(){super.connectedCallback(),(this.refs.fieldsets||[]).forEach(e=>{var o;let i=Array.from((o=e?.querySelectorAll("input"))!=null?o:[]);c(this,Y).push(i);let s=i.findIndex(a=>a.dataset.currentChecked==="true");s!==-1&&c(this,j).push([s])}),this.addEventListener("change",this.variantChanged.bind(this)),c(this,N).observe(this)}disconnectedCallback(){super.disconnectedCallback(),c(this,N).disconnect()}variantChanged(t){var m,S;if(!(t.target instanceof HTMLElement))return;let e=t.target instanceof HTMLSelectElement?t.target.options[t.target.selectedIndex]:t.target;if(!e)return;this.updateSelectedOption(t.target),this.dispatchEvent(new at({id:(m=e.dataset.optionValueId)!=null?m:""}));let i=this.dataset.templateProductMatch==="true"&&!t.target.closest("product-card")&&!t.target.closest("quick-add-dialog"),s=(S=this.dataset.productUrl)==null?void 0:S.split("?")[0],o=e.dataset.connectedProductUrl,a=i&&!!o&&o!==s,u=!!this.closest("featured-product-information"),l=a?"main":u?"featured-product-information":void 0;this.fetchUpdatedSection(this.buildRequestUrl(e),l);let d=new URL(window.location.href),h=e.dataset.variantId||null;i&&(h?d.searchParams.set("variant",h):d.searchParams.delete("variant")),a&&(d.pathname=o),d.href!==window.location.href&&it().then(()=>{history.replaceState({},"",d.toString())})}updateFieldsetCss(t){if(Number.isNaN(t))return;let e=p(this,k,Ut).call(this,t);e&&p(this,k,Vt).call(this,e)}updateSelectedOption(t){if(typeof t=="string"){let e=this.querySelector(`[data-option-value-id="${t}"]`);if(!e)throw new Error("Target element not found");t=e}if(t instanceof HTMLInputElement){let e=Number.parseInt(t.dataset.fieldsetIndex||""),i=Number.parseInt(t.dataset.inputIndex||"");if(!Number.isNaN(e)&&!Number.isNaN(i)){let o=(this.refs.fieldsets||[])[e],a=c(this,j)[e],u=c(this,Y)[e];if(u&&a&&o){let[l,d]=a;l!==void 0&&u[l]&&(u[l].dataset.previousChecked="false"),d!==void 0&&u[d]&&(u[d].dataset.previousChecked="false"),a.unshift(i),a.length=Math.min(a.length,2);let h=a[0],m=a[1];h!==void 0&&u[h]&&(u[h].dataset.currentChecked="true"),m!==void 0&&u[m]&&(u[m].dataset.previousChecked="true",u[m].dataset.currentChecked="false"),this.updateFieldsetCss(e)}}t.checked=!0}if(t instanceof HTMLSelectElement){let e=t.value,i=Array.from(t.options).find(s=>s.value===e);if(!i)throw new Error("Option not found");for(let s of t.options)s.removeAttribute("selected");i.setAttribute("selected","selected")}}buildRequestUrl(t,e=null,i=[]){var d;let s=t.dataset.connectedProductUrl||c(this,z)||this.dataset.productUrl;v(this,z,s);let o=[],a=Kt();a&&o.push(`view=${a}`),this.selectedOptionsValues.length&&!e?o.push(`option_values=${this.selectedOptionsValues.join(",")}`):e==="product-card"&&(this.selectedOptionsValues.length?o.push(`option_values=${i.join(",")}`):o.push(`option_values=${t.dataset.optionValueId}`));let u={"quick-add-component":"section-rendering-product-card","swatches-variant-picker-component":"section-rendering-product-card","featured-product-information":(d=this.closest("featured-product-information"))==null?void 0:d.id},l=Object.keys(u).find(h=>this.closest(h));return l?(s!=null&&s.includes("?")&&(s=s.split("?")[0]),`${s}?section_id=${u[l]}&${o.join("&")}`):`${s}?${o.join("&")}`}fetchUpdatedSection(t,e){var i;(i=c(this,K))==null||i.abort(),v(this,K,new AbortController),fetch(t,{signal:c(this,K).signal}).then(s=>s.text()).then(s=>{var u,l,d;v(this,z,void 0);let o=new DOMParser().parseFromString(s,"text/html");(u=o.querySelector("overflow-list[defer]"))==null||u.removeAttribute("defer");let a=(l=o.querySelector('variant-picker script[type="application/json"]'))==null?void 0:l.textContent;if(a)if(e==="main")this.updateMain(o);else if(e)this.updateElement(o,e);
1else{let h=this.updateVariantPicker(o);this.selectedOptionId&&this.dispatchEvent(new ct(JSON.parse(a),this.selectedOptionId,{html:o,productId:(d=this.dataset.productId)!=null?d:"",newProduct:h}))}}).catch(s=>{s.name==="AbortError"?console.warn("Fetch aborted by user"):console.error(s)})}updateVariantPicker(t){let e,i=t.querySelector(this.tagName.toLowerCase());if(!i)throw new Error("No new variant picker source found");if(i instanceof HTMLElement){let s=i.dataset.productId,o=i.dataset.productUrl;s&&o&&this.dataset.productId!==s&&(e={id:s,url:o}),this.dataset.productId=s,this.dataset.productUrl=o}return W(this,i,nt(O({},Ht),{getNodeKey:s=>s instanceof HTMLElement?s.dataset.key:void 0})),this.updateVariantPickerCss(),e}updateVariantPickerCss(){let e=(this.refs.fieldsets||[]).map((i,s)=>p(this,k,Ut).call(this,s)).filter(i=>i!==null);for(let i of e)p(this,k,Vt).call(this,i)}updateElement(t,e){let i=this.closest(e),s=t.querySelector(e);if(!i||!s)throw new Error(`No new element source found for ${e}`);W(i,s)}updateMain(t){let e=document.querySelector("main"),i=t.querySelector("main");if(!e||!i)throw new Error("No new main source found");W(e,i)}get selectedOption(){let t=this.querySelector("select option[selected], fieldset input:checked");if(t instanceof HTMLInputElement||t instanceof HTMLOptionElement)return t}get selectedOptionId(){let{selectedOption:t}=this;if(!t)return;let{optionValueId:e}=t.dataset;if(!e)throw new Error("No option value ID found");return e}get selectedOptionsValues(){return Array.from(this.querySelectorAll("select option[selected], fieldset input:checked")).map(e=>{let{optionValueId:i}=e.dataset;if(!i)throw new Error("No option value ID found");return i})}};z=new WeakMap,K=new WeakMap,j=new WeakMap,Y=new WeakMap,N=new WeakMap,k=new WeakSet,Ut=function(t){var l,d,h,m;let i=(this.refs.fieldsets||[])[t],s=c(this,j)[t],o=c(this,Y)[t];if(!o||!s||!i)return null;let[a,u]=s;return{fieldset:i,currentIndex:a,previousIndex:u,currentWidth:a!==void 0?(d=(l=o[a])==null?void 0:l.parentElement)==null?void 0:d.offsetWidth:void 0,previousWidth:u!==void 0?(m=(h=o[u])==null?void 0:h.parentElement)==null?void 0:m.offsetWidth:void 0}},Vt=function({fieldset:t,currentWidth:e,previousWidth:i,currentIndex:s,previousIndex:o}){e?t.style.setProperty("--pill-width-current",`${e}px`):s!==void 0&&t.style.removeProperty("--pill-width-current"),i?t.style.setProperty("--pill-width-previous",`${i}px`):o!==void 0&&t.style.removeProperty("--pill-width-previous")},customElements.get("variant-picker")||customElements.define("variant-picker",G);var L,pt,E,Rt,tt,mt,gt,re,ne,ie,se,oe,I,yt,et,ht=class extends A{constructor(){super(...arguments),f(this,E),g(this,"requiredRefs",["productCardLink"]),f(this,L,()=>{var t;(t=this.refs.quickAdd)==null||t.fetchProductPage(this.productPageUrl)}),f(this,pt,(t,e)=>{if(t instanceof MouseEvent&&(t.metaKey||t.ctrlKey||t.shiftKey||t.button===1)){t.preventDefault(),window.open(e.href,"_blank");return}else window.location.href=e.href}),f(this,tt,()=>{this.removeEventListener("pointerenter",c(this,L)),this.removeEventListener("focusin",c(this,L)),zt()&&(this.addEventListener("pointerenter",c(this,L)),this.addEventListener("focusin",c(this,L)))}),f(this,mt,t=>{var e;t.target!==this.variantPicker&&((e=this.variantPicker)==null||e.updateSelectedOption(t.detail.resource.id))}),f(this,gt,t=>{var e,i;t.stopPropagation(),this.updatePrice(t),p(this,E,ie).call(this,t),p(this,E,ne).call(this,t),(e=this.refs.quickAdd)==null||e.fetchProductPage(this.productPageUrl),t.target!==this.variantPicker&&((i=this.variantPicker)==null||i.updateVariantPicker(t.detail.data.html)),p(this,E,oe).call(this),v(this,I,null),this.removeAttribute("data-no-swatch-selected"),p(this,E,re).call(this)}),f(this,I,null),f(this,yt,t=>{t.detail.userInitiated&&v(this,I,t.detail.index)}),f(this,et,()=>{var s,o;let{slideshow:t}=this.refs;if(!t)return;if((s=this.variantPicker)!=null&&s.selectedOption){let a=this.variantPicker.selectedOption.dataset.optionMediaId;if(a){t.select({id:a},void 0,{animate:!1});return}}let e=t.initialSlide,i=e?.getAttribute("slide-id");if(e&&(o=t.slides)!=null&&o.includes(e)&&i){t.select({id:i},void 0,{animate:!1});return}t.previous(void 0,{animate:!1})}),g(this,"navigateToProduct",t=>{if(!(t.target instanceof Element)||this.hasAttribute("data-no-navigation")||t.target.closest("dialog")||t.target.closest('button, input, label, select, [tabindex="1"]'))return;let i=this.refs.productCardLink;if(!i.href)return;let s=new URL(i.href),o=i.getAttribute("id");if(!o)return;let a=this.closest('results-list[infinite-scroll="true"]');if(!window.Shopify.designMode&&a){let l=new URL(window.location.href),d=this.closest("li");l.hash=o,d&&d.dataset.page&&l.searchParams.set("page",d.dataset.page),it().then(()=>{history.replaceState({},"",l.toString())})}t.target.closest("a")||c(this,pt).call(this,t,s)}),g(this,"resetVariant",Wt(c(this,et),100))}get productPageUrl(){return this.refs.productCardLink.href}getSelectedVariantId(){let t=this.querySelector('input[type="radio"]:checked[data-variant-id]');return t?.dataset.variantId||null}getProductCardLink(){return this.refs.productCardLink||null}connectedCallback(){if(super.connectedCallback(),!(this.refs.productCardLink instanceof HTMLAnchorElement))throw new Error("Product card link not found");c(this,tt).call(this),this.addEventListener(y.variantUpdate,c(this,gt)),this.addEventListener(y.variantSelected,c(this,mt)),this.addEventListener(ut.eventName,c(this,yt)),Tt.addEventListener("change",c(this,tt)),this.dataset.navigateToMainProduct==="true"&&this.addEventListener("click",this.navigateToProduct),setTimeout(()=>{var e;(e=this.refs.slideshow)!=null&&e.isNested&&p(this,E,Rt).call(this)})}disconnectedCallback(){super.disconnectedCallback(),this.dataset.navigateToMainProduct==="true"&&this.removeEventListener("click",this.navigateToProduct)}updatePrice(t){let e=this.querySelectorAll("product-price [ref='priceContainer']")[1],i=t.detail.data.html.querySelector("product-price [ref='priceContainer']");i&&e&&W(e,i)}get allVariants(){return this.querySelectorAll("input[data-variant-id]")}get variantPicker(){return this.querySelector("swatches-variant-picker-component")}previewVariant(t){let{slideshow:e}=this.refs;e&&(this.resetVariant.cancel(),e.select({id:t},void 0,{animate:!1}))}previewImage(t){if(t.pointerType!=="mouse")return;let{slideshow:e}=this.refs;e&&(this.resetVariant.cancel(),c(this,I)!=null&&c(this,I)>0?e.select(c(this,I),void 0,{animate:!1}):(e.next(void 0,{animate:!1}),setTimeout(()=>p(this,E,Rt).call(this))))}resetImage(t){if(t.pointerType!=="mouse")return;let{slideshow:e}=this.refs;if(this.variantPicker)c(this,et).call(this);else{if(!e)return;e.previous(void 0,{animate:!1})}}};L=new WeakMap,pt=new WeakMap,E=new WeakSet,Rt=function(){var e,i,s,o,a;let t=(s=(e=this.refs.slideshow)==null?void 0:e.slides)==null?void 0:s[(i=this.refs.slideshow)==null?void 0:i.current];(a=(o=t?.nextElementSibling)==null?void 0:o.querySelector('img[loading="lazy"]'))==null||a.removeAttribute("loading")},tt=new WeakMap,mt=new WeakMap,gt=new WeakMap,re=function(){let t=this.querySelector("swatches-variant-picker-component overflow-list"),e=!!(t!=null&&t.querySelector('[slot="overflow"]'));!t||!e||requestAnimationFrame(()=>{t.dispatchEvent(new CustomEvent("reflow",{bubbles:!0,detail:{}}))})},ne=function(t){var s,o,a,u,l;let e=(s=t.detail.data.html)==null?void 0:s.querySelector("product-card a"),i=(a=(o=t.detail.data.html)==null?void 0:o.querySelector("product-card-link"))==null?void 0:a.getAttribute("data-featured-media-url");if(i&&this.closest("product-card-link")&&((u=this.closest("product-card-link"))==null||u.setAttribute("data-featured-media-url",i)),e instanceof HTMLAnchorElement){if(((l=e.getAttribute("href"))==null?void 0:l.trim())==="")return;let d=e.href,{productCardLink:h,productTitleLink:m,cardGalleryLink:S}=this.refs;h.href=d,S instanceof HTMLAnchorElement&&(S.href=d),m instanceof HTMLAnchorElement&&(m.href=d)}},ie=function(t){let e=t.detail.data.html.querySelectorAll("input:checked");for(let i of e)p(this,E,se).call(this,i.dataset.optionAvailable==="true")},se=function(t){let e=this.querySelector(".add-to-cart__button button");e instanceof HTMLButtonElement&&(e.disabled=!t)},oe=function(){var i,s;let{slideshow:t}=this.refs;if(!((i=this.variantPicker)!=null&&i.selectedOption))return;let e=(s=this.variantPicker)==null?void 0:s.selectedOption.dataset.optionMediaId;if(t&&e){let{slides:o=[]}=t.refs;for(let a of o)a.getAttribute("variant-image")!=null&&(a.hidden=a.getAttribute("slide-id")!==e);t.select({id:e},void 0,{animate:!1})}},I=new WeakMap,yt=new WeakMap,et=new WeakMap,customElements.get("product-card")||customElements.define("product-card",ht);var bt,ae,_t=class extends G{constructor(){super(...arguments),f(this,bt)}connectedCallback(){super.connectedCallback(),this.parentProductCard=this.closest("product-card"),this.addEventListener(y.variantUpdate,p(this,bt,ae).bind(this))}variantChanged(t){var a,u;if(!(t.target instanceof HTMLElement))return;let e=t.target instanceof HTMLInputElement&&((a=t.target.name)==null?void 0:a.includes("-swatch")),i=t.target,s=parseInt(i.dataset.availableCount||"0"),o=i.dataset.f
1irstAvailableOrFirstVariantId;if(e&&s>0&&o){t.stopPropagation(),this.updateSelectedOption(i);let l=(u=this.dataset.productUrl)==null?void 0:u.split("?")[0];if(!l)return;let d=new URL(l,window.location.origin);d.searchParams.set("variant",o),d.searchParams.set("section_id","section-rendering-product-card");let h=d.href;this.pendingVariantId=o,this.fetchUpdatedSection(h);return}super.variantChanged(t)}showAllSwatches(t){t?.preventDefault();let{overflowList:e}=this.refs;e instanceof Q&&e.showAll()}};bt=new WeakSet,ae=function(){if(this.pendingVariantId&&this.parentProductCard instanceof ht){let t=new URL(this.parentProductCard.refs.productCardLink.href);t.searchParams.set("variant",this.pendingVariantId),this.parentProductCard.refs.productCardLink.href=t.toString(),this.pendingVariantId=null}},customElements.get("swatches-variant-picker-component")||customElements.define("swatches-variant-picker-component",_t);export{ht as ProductCard};
2//# sourceMappingURL=/cdn/shop/t/3/assets/product-card.js.map?v=109162507960970066601781781537

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.