1class t{constructor(){this.items=[],this.itemsMarkup="",this.cartItemsMarkup="",this.cartSummaryMarkup="",this.cartContainerElement=document.querySelector("cart-component"),this.cartSummaryElement=this.cartContainerElement?.querySelector(".cart-summary"),this.sideCartToggle=document.querySelector('[data-ref="cartToggle"]'),this.grapheneRecommendationsId=this.cartContainerElement?.getAttribute("data-graphene-recommendations")}connectedCallback(){}dispatchCartUpdated(){const t=this.items.reduce((t,e)=>t+e.quantity,0),e=new CustomEvent("cart:updated",{detail:{totalCount:t,items:this.items}});document.dispatchEvent(e)}async fetchCart(){try{const t=await fetch("/cart.js").then(t=>t.json());this.items=t.items||[];const e=await fetch("/?sections=cart"),n=await e.json();this.itemsMarkup=n.cart?n.cart:"";const s=document.createElement("div");s.innerHTML=this.itemsMarkup;const i=s.querySelector(".cart"),r=s.querySelector(".cart-summary");return this.cartItemsMarkup=i?i.innerHTML:"",this.cartSummaryMarkup=r?r.innerHTML:"",this.renderCartItems(),this.renderCartSummary(),this.renderCartRecommendations(),this.dispatchCartUpdated(),this.items}catch(t){throw console.error("Error fetching cart:",t),t}}normalizeCartResponse(t){const e=t._parsedJson||null,n=e?.description||e?.error||e?.message||t.statusText||`HTTP ${t.status}`,s=Number(e?.status),i=Number.isFinite(s)?s:t.ok?t.status:422;return!t.ok||e&&("error"===e.status||e.error||e.description)?{ok:!1,status:i,message:n,data:e}:{ok:!0,status:t.status,message:"OK",data:e}}renderCartItems(){this.cartContainerElement=document.querySelector(".cart"),this.cartContainerElement&&(this.cartContainerElement.innerHTML=this.cartItemsMarkup,this.sideCartToggle=document.querySelector('[data-ref="cartToggle"]'),"cart"!=document.body.getAttribute("data-template")?this.sideCartToggle.checked=!0:this.sideCartToggle.checked=!1)}renderCartSummary(){this.cartSummaryElement&&(this.cartSummaryElement.innerHTML=this.cartSummaryMarkup)}renderCartRecommendations(){const t=this.cartContainerElement?.querySelector("[data-graphene-recommendations-id]"),e=t?.getAttribute("data-graphene-recommendations-id"),n=t?.getAttribute("data-target");e&&window.$g.load({elements:[{id:e,target:n}]})}parsePreorderDate(t){if(!t||"string"!=typeof t)return null;const e=t.trim().replace(/(\d)(st|nd|rd|th)/gi,"$1").replace(/\s+/g," "),n=new Date(e);return Number.isNaN(n.getTime())?null:n}getPreorderAttributeValue(t=[]){const e=[...this.items,...t].filter(Boolean).map(t=>t?.properties?.Preorder||t?.properties?.Preorder).filter(t=>"string"==typeof t&&t.trim()).map(t=>({value:t,date:this.parsePreorderDate(t)})).filter(({date:t})=>null!==t);if(!e.length)return"false";const n=e.reduce((t,e)=>t?e.date>t.date?e:t:e,null);return n?n.value:"false"}getMultiplePreordersAttributeValue(t=[]){return[...this.items,...t].filter(Boolean).filter(t=>{const e=t?.properties?.Preorder||t?.properties?.Preorder;return"string"==typeof e&&e.trim().length>0}).length>1?"true":"false"}async setPreorderCartAttribute(){const t=this.getPreorderAttributeValue(),e=this.getMultiplePreordersAttributeValue();try{const n=await fetch("/cart/update.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({attributes:{Preorder:t,"Multiple preorders":e}})});return n._parsedJson=await n.json().catch(()=>null),this.normalizeCartResponse(n)}catch(t){return{ok:!1,status:0,message:t.message||"Network error",data:null}}}async addItems(t){const e=this.getPreorderAttributeValue(t),n=this.getMultiplePreordersAttributeValue(t);console.log("Adding items to cart:",t,"Preorder date:",e,"Multiple preorders:",n);try{const s=await fetch("/cart/add.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({items:t.map(t=>({id:t.id,quantity:t.quantity,selling_plan_id:null,properties:t.properties})),attributes:{Preorder:e,"Multiple preorders":n}})});s._parsedJson=await s.json().catch(()=>null);const i=this.normalizeCartResponse(s);return i.ok?(await this.fetchCart(),await this.setPreorderCartAttribute(),i):i}catch(t){return{ok:!1,status:0,message:t.message||"Network error",data:null}}}async updateItems(t){const e=this.getPreorderAttributeValue(t),n=this.getMultiplePreordersAttributeValue(t);try{const s=t.reduce((t,e)=>(t[e.id]=e.quantity,t),{}),i=await fetch("/cart/update.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({updates:s,attributes:{Preorder:e,"Multiple preorders":n}})});i._parsedJson=await i.json().catch(()=>null);const r=this.normalizeCartResponse(i);return r.ok?(await this.fetchCart(),await this.renderCartItems(),await this.setPreorderCartAttribute(),r):r}catch(t){return{ok:!1,status:0,message:t.message||"Network error",data:null}}}async removeItem(t){return this.updateItems([{id:t,quantity:0}])}async clearCart(){try{const t=await fetch("/cart/clear.js",{method:"POST",headers:{"Content-Type":"application/json"}});t._parsedJson=await t.json().catch(()=>null);const e=this.normalizeCartResponse(t);return e.ok?(await this.fetchCart(),e):e}catch(t){return{ok:!1,status:0,message:t.message||"Network error",data:null}}}async getItems(){return await this.fetchCart()}}function e(t,e){const n=document.body.getAttribute("data-currency-format")||"£{{amount}}";"string"==typeof t&&(t=t.replace(".",""));var s="",i=/\{\{\s*(\w+)\s*\}\}/,r=e||n;function o(t,e){return void 0===t?e:t}function a(t,e,n,s){if(e=o(e,2),n=o(n,","),s=o(s,"."),isNaN(t)||null==t)return 0;var i=(t=(t/100).toFixed(e)).split(".");return i[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1"+n)+(i[1]?s+i[1]:"")}switch(r.match(i)[1]){case"amount":s=a(t,2);break;case"amount_no_decimals":s=a(t,0);break;case"amount_with_comma_separator":s=a(t,2,".",",");break;case"amount_no_decimals_with_comma_separator":s=a(t,0,".",",")}return r.replace(i,s)}class n extends HTMLElement{constructor(){super(),this.cart=new t,this.handleSubmitEvent=this.handleSubmit.bind(this),this.errors=this.querySelector('[data-ref="errors"]'),this.quantitySelector=this.querySelector("quantity-selector"),this.productPrice
1=this.querySelector("product-price"),this.products=JSON.parse(this.getAttribute("products")),this.totalSetPriceElement=this.querySelector('[data-ref="totalSetPrice"]')}connectedCallback(){const t=this.querySelector("form");t?t.addEventListener("submit",this.handleSubmitEvent):console.warn("No <form> found inside <product-form>"),this.querySelector("product-set-item")&&this.addEventListener("product-set-item-changed",t=>{console.log(t.detail);const n=this.products.find(e=>e.id==t.detail.id);n&&(this.products=this.products.map(e=>e==n?t.detail:e)),this.setAttribute("products",JSON.stringify(this.products));const s=this.products.reduce((t,e)=>+t+ +e.price*e.quantity,0);console.log(s),console.log(this.products),this.totalSetPriceElement&&(this.totalSetPriceElement.innerText=`${e(s)}`)})}disconnectedCallback(){const t=this.querySelector("form");t&&t.removeEventListener("submit",this.handleSubmitEvent)}async handleSubmit(t){t.preventDefault();let e=[];if(this.querySelector('[data-ref="productSetItem"]')){if(e=[...this.querySelectorAll('[data-ref="productSetItem"]')].map(t=>({id:Number.parseInt(t.querySelector('[name$="[id]"]').value,10),quantity:Number.parseInt(t.querySelector('[name$="[quantity]"]').value,10)||0})).filter(t=>Number.isInteger(t.id)&&t.id>0&&t.quantity>0),!e.length)return void console.error("No valid product items found")}else{const n=new FormData(t.target),s=Number.parseInt(n.get("id"),10),i=Number.parseInt(n.get("quantity"),10)||1,r=[...n.entries()].filter(([t])=>/^properties\[[^\]]+\]$/.test(t)).reduce((t,[e,n])=>(t[e.match(/^properties\[([^\]]+)\]$/)[1]]=n,t),{});if(!Number.isInteger(s)||s<=0)return void console.error("Product ID is required");e=[{id:s,quantity:i,properties:r}]}const n=await this.cart.addItems(e);if(n&&"object"==typeof n&&!1===n.ok)return console.error("Error adding to cart:",n.message),this.displayError(n),n}displayError(t){if(!this.errors)return void console.error("Failed to show fallback alert for error:",t.message||t);const e=t&&"string"==typeof t.message?t.message:"string"==typeof t?t:String(t);this.errors.innerText=e,this.errors.classList.remove("hidden"),setTimeout(()=>{this.errors.classList.add("hidden"),this.errors.innerText=""},2e3)}}class s extends HTMLElement{constructor(){super(),this.quantitySelector=this.querySelector('[data-ref="quantitySelector"]'),this.cartRemoveButton=this.querySelector('[data-ref="cartRemoveButton"]'),this.cart=new t,this._updateHandler=t=>{const e=this.dataset.variantId,n=this.quantitySelector.quantity||1;this.cart.updateItems([{id:e,quantity:n}])},this._removeHandler=t=>{const e=this.dataset.variantId;this.cart.removeItem(e)}}connectedCallback(){this.quantitySelector&&this.quantitySelector.addEventListener("quantity-changed",this._updateHandler),this.cartRemoveButton&&this.cartRemoveButton.addEventListener("click",this._removeHandler)}disconnectedCallback(){this.quantitySelector&&this.quantitySelector.removeEventListener("quantity-changed",this._updateHandler),this.cartRemoveButton&&this.cartRemoveButton.removeEventListener("click",this._removeHandler)}}class i extends HTMLElement{constructor(){super(),this.count=this.querySelector('[data-ref="count"]'),this.updateEventHandler=this.updateCount.bind(this)}connectedCallback(){document.addEventListener("cart:updated",this.updateEventHandler)}disconnectedCallback(){document.removeEventListener("cart:updated",this.updateEventHandler)}updateCount(t){const e=t.detail.totalCount;this.count&&(this.count.textContent=String(e)),e>0?this.count.classList.remove("hidden"):this.count.classList.add("hidden")}}class r extends HTMLElement{constructor(){super(),this.days=0,this.hours=0,this.minutes=0,this.seconds=0,this.endTime=this.getAttribute("end-time")}connectedCallback(){this.daysElement=this.querySelector('[data-ref="days"]'),this.hoursElement=this.querySelector('[data-ref="hours"]'),this.minutesElement=this.querySelector('[data-ref="minutes"]'),this.secondsElement=this.querySelector('[data-ref="seconds"]'),this.update(),this._intervalId=window.setInterval(()=>this.update(),1e3)}disconnectedCallback(){this._intervalId&&(clearInterval(this._intervalId),this._intervalId=null)}calculateTime(){let t=new Date,e=new Date(`${this.endTime}`)-t,n=Math.floor(e/1e3);this.days=Math.floor(n/86400),this.hours=Math.floor(n%86400/3600),this.minutes=Math.floor(n%3600/60),this.seconds=n%60}update(){this.calculateTime(),this.daysElement&&(this.daysElement.textContent=String(this.days),this.daysElement.setAttribute("style",`--value:${this.days}`)),this.hoursElement&&(this.hoursElement.textContent=String(this.hours),this.hoursElement.setAttribute("style",`--value:${this.hours}`)),this.minutesElement&&(this.minutesElement.textContent=String(this.minutes),this.minutesElement.setAttribute("style",`--value:${this.minutes}`)),this.secondsElement&&(this.secondsElement.textContent=String(this.seconds),this.secondsElement.setAttribute("style",`--value:${this.seconds}`))}}function o(t){return"number"==typeof t}function a(t){return"string"==typeof t}function l(t){return"boolean"==typeof t}function c(t){return"[object Object]"===Object.prototype.toString.call(t)}function u(t){return Math.abs(t)}function d(t){return Math.sign(t)}function h(t,e){return u(t-e)}function p(t){return y(t).map(Number)}function m(t){return t[f(t)]}function f(t){return Math.max(0,t.length-1)}function g(t,e){return e===f(t)}
vendor: 20,410 bytes, line 1
1function v(t,e=0){return Array.from(Array(t),(t,n)=>e+n)}function y(t){return Object.keys(t)}function b(t,e){return[t,e].reduce((t,e)=>(y(e).forEach(n=>{const s=t[n],i=e[n],r=c(s)&&c(i);t[n]=r?b(s,i):i}),t),{})}function E(t,e){return void 0!==e.MouseEvent&&t instanceof e.MouseEvent}function S(){let t=[];const e={add:function(n,s,i,r={passive:!0}){let o;if("addEventListener"in n)n.addEventListener(s,i,r),o=()=>n.removeEventListener(s,i,r);else{const t=n;t.addListener(i),o=()=>t.removeListener(i)}return t.push(o),e},clear:function(){t=t.filter(t=>t())}};return e}function w(t,e,n,s){const i=S(),r=1e3/60;let o=null,a=0,l=0;function c(t){if(!l)return;o||(o=t,n(),n());const i=t-o;for(o=t,a+=i;a>=r;)n(),a-=r;s(a/r),l&&(l=e.requestAnimationFrame(c))}function u(){e.cancelAnimationFrame(l),o=null,a=0,l=0}return{init:function(){i.add(t,"visibilitychange",()=>{t.hidden&&(o=null,a=0)})},destroy:function(){u(),i.clear()},start:function(){l||(l=e.requestAnimationFrame(c))},stop:u,update:n,render:s}}function x(t=0,e=0){const n=u(t-e);function s(e){return e<t}function i(t){return t>e}function r(t){return s(t)||i(t)}const o={length:n,max:e,min:t,constrain:function(n){return r(n)?s(n)?t:e:n},reachedAny:r,reachedMax:i,reachedMin:s,removeOffset:function(t){return n?t-n*Math.ceil((t-e)/n):t}};return o}function L(t,e,n){const{constrain:s}=x(0,t),i=t+1;let r=o(e);function o(t){return n?u((i+t)%i):s(t)}function a(){return r}function l(){return L(t,a(),n)}const c={get:a,set:function(t){return r=o(t),c},add:function(t){return l().set(a()+t)},clone:l};return c}function k(t,e,n,s,i,r,o,a,c,p,m,f,g,v,y,b,w,L,k){const{cross:C,direction:P}=t,B=["INPUT","SELECT","TEXTAREA"],$={passive:!1},M=S(),T=S(),A=x(50,225).constrain(v.measure(20)),H={mouse:300,touch:400},I={mouse:500,touch:600},q=y?43:25;let _=!1,N=0,D=0,F=!1,R=!1,O=!1,V=!1;function j(t){if(!E(t,s)&&t.touches.length>=2)return z(t);const e=r.readPoint(t),n=r.readPoint(t,C),o=h(e,N),l=h(n,D);if(!R&&!V){if(!t.cancelable)return z(t);if(R=o>l,!R)return z(t)}const c=r.pointerMove(t);o>b&&(O=!0),p.useFriction(.3).useDuration(.75),a.start(),i.add(P(c)),t.preventDefault()}function z(t){const e=m.byDistance(0,!1).index!==f.get(),n=r.pointerUp(t)*(y?I:H)[V?"mouse":"touch"],s=function(t,e){const n=f.add(-1*d(t)),s=m.byDistance(t,!y).distance;return y||u(t)<A?s:w&&e?.5*s:m.byIndex(n.get(),0).distance}(P(n),e),i=function(t,e){if(0===t||0===e)return 0;if(u(t)<=u(e))return 0;const n=h(u(t),u(e));return u(n/t)}(n,s),o=q-10*i,a=L+i/50;R=!1,F=!1,T.clear(),p.useDuration(o).useFriction(a),c.distance(s,!y),V=!1,g.emit("pointerUp")}function U(t){O&&(t.stopPropagation(),t.preventDefault(),O=!1)}return{init:function(t){if(!k)return;function a(a){(l(k)||k(t,a))&&function(t){const a=E(t,s);if(V=a,O=y&&a&&!t.buttons&&_,_=h(i.get(),o.get())>=2,a&&0!==t.button)return;if(function(t){const e=t.nodeName||"";return B.includes(e)}(t.target))return;F=!0,r.pointerDown(t),p.useFriction(0).useDuration(0),i.set(o),function(){const t=V?n:e;T.add(t,"touchmove",j,$).add(t,"touchend",z).add(t,"mousemove",j,$).add(t,"mouseup",z)}(),N=r.readPoint(t),D=r.readPoint(t,C),g.emit("pointerDown")}(a)}const c=e;M.add(c,"dragstart",t=>t.preventDefault(),$).add(c,"touchmove",()=>{},$).add(c,"touchend",()=>{}).add(c,"touchstart",a).add(c,"mousedown",a).add(c,"touchcancel",z).add(c,"contextmenu",z).add(c,"click",U,!0)},destroy:function(){M.clear(),T.clear()},pointerDown:function(){return F}}}function C(t,e){let n,s;function i(t){return t.timeStamp}function r(n,s){const i="client"+("x"===(s||t.scroll)?"X":"Y");return(E(n,e)?n:n.touches[0])[i]}return{pointerDown:function(t){return n=t,s=t,r(t)},pointerMove:function(t){const e=r(t)-r(s),o=i(t)-i(n)>170;return s=t,o&&(n=t),e},pointerUp:function(t){if(!n||!s)return 0;const e=r(s)-r(n),o=i(t)-i(n),a=i(t)-i(s)>170,l=e/o;return o&&!a&&u(l)>.1?l:0},readPoint:r}}function P(t,e,n,s,i,r,o){const a=[t].concat(s);let c,d,h=[],p=!1;function m(t){return i.measureSize(o.measure(t))}return{init:function(i){r&&(d=m(t),h=s.map(m),c=new ResizeObserver(n=>{(l(r)||r(i,n))&&function(n){for(const r of n){if(p)return;const n=r.target===t,o=s.indexOf(r.target),a=n?d:h[o];if(u(m(n?t:s[o])-a)>=.5){i.reInit(),e.emit("resize");break}}}(n)}),n.requestAnimationFrame(()=>{a.forEach(t=>c.observe(t))}))},destroy:function(){p=!0,c&&c.disconnect()}}}function B(t,e,n,s,i){const r=i.measure(10),o=i.measure(50),a=x(.1,.99);let l=!1;function c(){return!l&&(!!t.reachedAny(n.get())&&!!t.reachedAny(e.get()))}const d={shouldConstrain:c,constrain:function(i){if(!c())return;const l=t.reachedMin(e.get())?"min":"max",d=u(t[l]-e.get()),h=n.get()-e.get(),p=a.constrain(d/o);n.subtract(h*p),!i&&u(h)<r&&(n.set(t.constrain(n.get())),s.useDuration(25).useBaseFriction())},toggleActive:function(t){l=!t}};return d}function $(t,e,n,s){const i=e.min+.1,r=e.max+.1,{reachedMin:o,reachedMax:a}=x(i,r);const l={loop:function(e){if(!function(t){return 1===t?a(n.get()):-1===t&&o(n.get())}(e))return;const i=t*(-1*e);s.forEach(t=>t.add(i))}};return l}function M(t,e,n,s,i){const{reachedAny:r,removeOffset:o,constrain:a}=s;function l(t){return t.concat().sort((t,e)=>u(t)-u(e))[0]}function c(e,s){const i=[e,e+n,e-n];if(!t)return e;if(!s)return l(i);const r=i.filter(t=>d(t)===s);return r.length?l(r):m(i)-n}return{byDistance:function(n,s){const l=i.get()+n,{index:d,distance:h}=function(n){const s=t?o(n):a(n),i=e.map((t,e)=>({diff:c(t-s,0),index:e})).sort((t,e)=>u(t.diff)-u(e.diff)),{index:r}=i[0];return{index:r,distance:s}}(l),p=!t&&r(l);return!s||p?{index:d,distance:n}:{index:d,distance:n+c(e[d]-h,0)}},byIndex:function(t,n){return{index:t,distance:c(e[t]-i.get(),n)}},shortcut:c}}function T(t,e,n,s,i,r,a,c){const u={passive:!0,capture:!0};let d=0;function h(t){"Tab"===t.code&&(d=(new Date).getTime())}return{init:function(p){c&&(r.add(document,"keydown",h,!1),e.forEach((e,h)=>{r.add(e,"focus",e=>{(l(c)||c(p,e))&&function(e){if((new Date).getTime()-d>10)return;a.emit("slideFocusStart"),t.scrollLeft=0;const r=n.findIndex(t=>t.includes(e));o(r)&&(i.useDuration(0),s.index(r,0),a.emit("slideFocus"))}(h)},u)}))}}}function A(t){let e=t;function n(t){return o(t)?t:t.get()}const s={get:function(){return e},set:function(t){e=n(t)},add:function(t){e+=n(t)},subtract:function(t){e-=n(t)}};return s}function H(t,e){const n="x"===t.scroll?function(t){return`translate3d(${t}px,0px,0px)`}:function(t){return`translate3d(0px,${t}px,0px)`},s=e.style;let i=null,r=!1;const o={clear:function(){r||(s.transform="",e.getAttribute("style")||e.removeAttribute("style"))},to:function(e){if(r)return;const o=(a=t.direction(e),Math.round(100*a)/100);var a;o!==i&&(s.transform=n(o),i=o)},toggleActive:function(t){r=!t}};return o}function I(t,e,n,s,i,r,o,a,l){const c=p(i),u=p(i).reverse(),d=function(){const t=o[0];return f(m(u,t),n,!1)}().concat(function(){const t=e-o[0]-1;return f(m(c,t),-n,!0)}());function h(t,e){return t.reduce((t,e)=>t-i[e],e)}function m(t,e){return t.reduce((t,n)=>h(t,e)>0?t.concat([n]):t,[])}function f(i,o,c){const u=function(t){return r.map((n,i)=>({start:n-s[i]+.5+t,end:n+e-.5+t}))}(o);return i.map(e=>{const s=c?0:-n,i=c?n:0,r=c?"end":"start",o=u[e][r];return{index:e,loopPoint:o,slideLocation:A(-1),translate:H(t,l[e]),target:()=>a.get()>o?s:i}})}const g={canLoop:function(){return d.every(({index:t})=>{const n=c.filter(e=>e!==t);return h(n,e)<=.1})},clear:function(){d.forEach(t=>t.translate.clear())},loop:function(){d.forEach(t=>{const{target:e,translate:n,slideLocation:s}=t,i=e();i!==s.get()&&(n.to(i),s.set(i))})},loopPoints:d};return g}function q(t,e,n){let s,i=!1;return{init:function(r){n&&(s=new MutationObserver(t=>{i||(l(n)||n(r,t))&&function(t){for(const n of t)if("childList"===n.type){r.reInit(),e.emit("slidesChanged");break}}(t)}),s.observe(t,{childList:!0}))},destroy:function(){s&&s.disconnect(),i=!0}}}function _(t,e,n,s){const i={};let r,o=null,a=null,l=!1;return{init:function(){r=new IntersectionObserver(t=>{l||(t.forEach(t=>{const n=e.indexOf(t.target);i[n]=t}),o=null,a=null,n.emit("slidesInView"))},{root:t.parentElement,threshold:s}),e.forEach(t=>r.observe(t))},destroy:function(){r&&r.disconnect(),l=!0},get:function(t=!0){if(t&&o)return o;if(!t&&a)return a;const e=function(t){return y(i).reduce((e,n)=>{const s=parseInt(n),{isIntersecting:r}=i[s];return(t&&r||!t&&!r)&&e.push(s),e},[])}(t);return t&&(o=e),t||(a=e),e}}}function N(t,e,n,s,i,r,a,l,c){const{startEdge:d,endEdge:h,direction:g}=t,v=o(n);const y={groupSlides:function(t){return v?function(t,e){return p(t).filter(t=>t%e===0).map(n=>t.slice(n,n+e))}(t,n):function(t){return t.length?p(t).reduce((n,o,p)=>{const v=m(n)||0,y=0===v,b=o===f(t),E=i[d]-r[v][d],S=i[d]-r[o][h],w=!s&&y?g(a):0,x=u(S-(!s&&b?g(l):0)-(E+w));return p&&x>e+c&&n.push(o),b&&n.push(t.length),n},[]).map((e,n,s)=>{const i=Math.max(s[n-1]||0);return t.slice(i,e)}):[]}(t)}};return y}function D(t,e,n,s,i,r,o){const{align:l,axis:c,direction:y,startIndex:b,loop:E,duration:D,dragFree:F,dragThreshold:R,inViewThreshold:O,slidesToScroll:V,skipSnaps:j,containScroll:z,watchResize:U,watchSlides:Z,watchDrag:G,watchFocus:W}=r,J={measure:function(t){const{offsetTop:e,offsetLeft:n,offsetWidth:s,offsetHeight:i}=t;return{top:e,right:n+s,bottom:e+i,left:n,width:s,height:i}}},X=J.measure(e),Y=n.map(J.measure),Q=function(t,e){const n="rtl"===e,s="y"===t,i=!s&&n?-1:1,r={scroll:s?"y":"x",cross:s?"x":"y",startEdge:s?"top":n?"right":"left",endEdge:s?"bottom":n?"left":"right",measureSize:function(t){const{height:e,width:n}=t;return s?e:n},direction:function(t){return t*i}};return r}(c,y),K=Q.measureSize(X),tt=function(t){const e={measure:function(e){return t*(e/100)}};return e}(K),et=function(t,e){const n={start:function(){return 0},center:function(t){return s(t)/2},end:s};function s(t){return e-t}const i={measure:function(s,i){return a(t)?n[t](s):t(e,s,i)}};return i}(l,K),nt=!E&&!!z,st=E||!!z,{slideSizes:it,slideSizesWithGaps:rt,startGap:ot,endGap:at}=function(t,e,n,s,i,r){const{measureSize:o,startEdge:a,endEdge:l}=t,c=n[0]&&i,d=function(){if(!c)return 0;const t=n[0];return u(e[a]-t[a])}(),h=function(){if(!c)return 0;const t=r.getComputedStyle(m(s));return parseFloat(t.getPropertyValue(`margin-${l}`))}(),p=n.map(o),f=n.map((t,e,n)=>{const s=!e,i=g(n,e);return s?p[e]+d:i?p[e]+h:n[e+1][a]-t[a]}).map(u);return{slideSizes:p,slideSizesWithGaps:f,startGap:d,endGap:h}}(Q,X,Y,n,st,i),lt=N(Q,K,V,E,X,Y,ot,at,2),{snaps:ct,snapsAligned:ut}=function(t,e,n,s,i){const{startEdge:r,endEdge:o}=t,{groupSlides:a}=i,l=a(s).map(t=>m(t)[o]-t[0][r]).map(u).map(e.measure),c=s.map(t=>n[r]-t[r]).map(t=>-u(t)),d=a(c).map(t=>t[0]).map((t,e)=>t+l[e]);return{snaps:c,snapsAligned:d}}(Q,et,X,Y,lt),dt=-m(ct)+m(rt),{snapsContained:ht,scrollContainLimit:pt}=function(t,e,n,s,i){const r=x(-e+t,0),o=n.map((t,e)=>{const{min:s,max:i}=r,o=r.constrain(t),a=!e,c=g(n,e);return a?i:c||l(s,o)?s:l(i,o)?i:o}).map(t=>parseFloat(t.toFixed(3))),a=function(){const t=o[0],e=m(o);return x(o.lastIndexOf(t),o.indexOf(e)+1)}();function l(t,e){return h(t,e)<=1}return{snapsContained:function(){if(e<=t+i)return[r.max];if("keepSnaps"===s)return o;const{min:n,max:l}=a;return o.slice(n,l)}(),scrollContainLimit:a}}(K,dt,ut,z,2),mt=nt?ht:ut,{limit:ft}=function(t,e,n){const s=e[0];return{limit:x(n?s-t:m(e),s)}}(dt,mt,E),gt=L(f(mt),b,E),vt=gt.clone(),yt=p(n),bt=w(s,i,()=>(({dragHandler:t,scrollBody:e,scrollBounds:n,options:{loop:s}})=>{s||n.constrain(t.pointerDown()),e.seek()})(Ht),t=>(({scrollBody:t,translate:e,location:n,offsetLocation:s,previousLocation:i,scrollLooper:r,slideLooper:o,dragHandler:a,animation:l,eventHandler:c,scrollBounds:u,options:{loop:d}},h)=>{const p=t.settled(),m=!u.shouldConstrain(),f=d?p:p&&m,g=f&&!a.pointerDown();g&&l.stop();const v=n.get()*h+i.get()*(1-h);s.set(v),d&&(r.loop(t.direction()),o.loop()),e.to(s.get()),g&&c.emit("settle"),f||c.emit("scroll")})(Ht,t)),Et=mt[gt.get()],St=A(Et),wt=A(Et),xt=A(Et),Lt=A(Et),kt=function(t,e,n,s,i,r){let o=0,a=0,l=i,c=r,h=t.get(),p=0;function m(t){return l=t,g}function f(t){return c=t,g}const g={direction:function(){return a},duration:function(){return l},velocity:function(){return o},seek:function(){const e=s.get()-t.get();let i=0;return l?(n.set(t),o+=e/l,o*=c,h+=o,t.add(o),i=h-p):(o=0,n.set(s),t.set(s),i=e),a=d(i),p=h,g},settled:function(){return u(s.get()-e.get())<.001},useBaseFriction:function(){return f(r)},useBaseDuration:function(){return m(i)},useFriction:f,useDuration:m};return g}(St,xt,wt,Lt,D,.68),Ct=M(E,mt,dt,ft,Lt),Pt=function(t,e,n,s,i,r,o){function a(i){const a=i.distance,l=i.index!==e.get();r.add(a),a&&(s.duration()?t.start():(t.update(),t.render(1),t.update())),l&&(n.set(e.get()),e.set(i.index),o.emit("select"))}const l={distance:function(t,e){a(i.byDistance(t,e))},index:function(t,n){const s=e.clone().set(t);a(i.byIndex(s.get(),n))}};return l}(bt,gt,vt,kt,Ct,Lt,o),Bt=function(t){const{max:e,length:n}=t,s={get:function(t){return n?(t-e)/-n:0}};return s}(ft),$t=S(),Mt=_(e,n,o,O),{slideRegistry:Tt}=function(t,e,n,s,i,r){const{groupSlides:o}=i,{min:a,max:l}=s;return{slideRegistry:function(){const s=o(r),i=!t||"keepSnaps"===e;return 1===n.length?[r]:i?s:s.slice(a,l).map((t,e,n)=>{const s=!e,i=g(n,e);return s?v(m(n[0])+1):i?v(f(r)-m(n)[0]+1,m(n)[0]):t})}()}}(nt,z,mt,pt,lt,yt),At=T(t,n,Tt,Pt,kt,$t,o,W),Ht={ownerDocument:s,ownerWindow:i,eventHandler:o,containerRect:X,slideRects:Y,animation:bt,axis:Q,dragHandler:k(Q,t,s,i,Lt,C(Q,i),St,bt,Pt,kt,Ct,gt,o,tt,F,R,j,.68,G),eventStore:$t,percentOfView:tt,index:gt,indexPrevious:vt,limit:ft,location:St,offsetLocation:xt,previousLocation:wt,options:r,resizeHandler:P(e,o,i,n,Q,U,J),scrollBody:kt,scrollBounds:B(ft,xt,Lt,kt,tt),scrollLooper:$(dt,ft,xt,[St,xt,wt,Lt]),scrollProgress:Bt,scrollSnapList:mt.map(Bt.get),scrollSnaps:mt,scrollTarget:Ct,scrollTo:Pt,slideLooper:I(Q,K,dt,it,rt,ct,mt,xt,n),slideFocus:At,slidesHandler:q(e,o,Z),slidesInView:Mt,slideIndexes:yt,slideRegistry:Tt,slidesToScroll:lt,target:Lt,translate:H(Q,e)};return Ht}const F={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function R(t){function e(t,e){return b(t,e||{})}const n={mergeOptions:e,optionsAtMedia:function(n){const s=n.breakpoints||{},i=y(s).filter(e=>t.matchMedia(e).matches).map(t=>s[t]).reduce((t,n)=>e(t,n),{});return e(n,i)},optionsMediaQueries:function(e){return e.map(t=>y(t.breakpoints||{})).reduce((t,e)=>t.concat(e),[]).map(t.matchMedia)}};return n}function O(t,e,n){const s=t.ownerDocument,i=s.defaultView,r=R(i),o=function(t){let e=[];return{init:function(n,s){return e=s.filter(({options:e})=>!1!==t.optionsAtMedia(e).active),e.forEach(e=>e.init(n,t)),s.reduce((t,e)=>Object.assign(t,{[e.name]:e}),{})},destroy:function(){e=e.filter(t=>t.destroy())}}}(r),l=S(),c=function(){let t,e={};function n(t){return e[t]||[]}const s={init:function(e){t=e},emit:function(e){return n(e).forEach(n=>n(t,e)),s},off:function(t,i){return e[t]=n(t).filter(t=>t!==i),s},on:function(t,i){return e[t]=n(t).concat([i]),s},clear:function(){e={}}};return s}(),{mergeOptions:u,optionsAtMedia:d,optionsMediaQueries:h}=r,{on:p,off:m,emit:f}=c,g=B;let v,y,b,E,w=!1,x=u(F,O.globalOptions),L=u(x),k=[];function C(e){const n=D(t,b,E,s,i,e,c);if(e.loop&&!n.slideLooper.canLoop()){return C(Object.assign({},e,{loop:!1}))}return n}function P(e,n){w||(x=u(x,e),L=d(x),k=n||k,function(){const{container:e,slides:n}=L,s=a(e)?t.querySelector(e):e;b=s||t.children[0];const i=a(n)?b.querySelectorAll(n):n;E=[].slice.call(i||b.children)}(),v=C(L),h([x,...k.map(({options:t})=>t)]).forEach(t=>l.add(t,"change",B)),L.active&&(v.translate.to(v.location.get()),v.animation.init(),v.slidesInView.init(),v.slideFocus.init(A),v.eventHandler.init(A),v.resizeHandler.init(A),v.slidesHandler.init(A),v.options.loop&&v.slideLooper.loop(),b.offsetParent&&E.length&&v.dragHandler.init(A),y=o.init(A,k)))}function B(t,e){const n=T();$(),P(u({startIndex:n},t),e),c.emit("reInit")}function $(){v.dragHandler.destroy(),v.eventStore.clear(),v.translate.clear(),v.slideLooper.clear(),v.resizeHandler.destroy(),v.slidesHandler.destroy(),v.slidesInView.destroy(),v.animation.destroy(),o.destroy(),l.clear()}function M(t,e,n){L.active&&!w&&(v.scrollBody.useBaseFriction().useDuration(!0===e?0:L.duration),v.scrollTo.index(t,n||0))}function T(){return v.index.get()}const A={canScrollNext:function(){return v.index.add(1).get()!==T()},canScrollPrev:function(){return v.index.add(-1).get()!==T()},containerNode:function(){return b},internalEngine:function(){return v},destroy:function(){w||(w=!0,l.clear(),$(),c.emit("destroy"),c.clear())},off:m,on:p,emit:f,plugins:function(){return y},previousScrollSnap:function(){return v.indexPrevious.get()},reInit:g,rootNode:function(){return t},scrollNext:function(t){M(v.index.add(1).get(),t,-1)},scrollPrev:function(t){M(v.index.add(-1).get(),t,1)},scrollProgress:function(){return v.scrollProgress.get(v.offsetLocation.get())},scrollSnapList:function(){return v.scrollSnapList},scrollTo:M,selectedScrollSnap:T,slideNodes:function(){return E},slidesInView:function(){return v.slidesInView.get()},slidesNotInView:function(){return v.slidesInView.get(!1)}};return P(e,n),setTimeout(()=>c.emit("init"),0),A}O.globalOptions=void 0;const V={active:!0,breakpoints:{},delay:4e3,jump:!1,playOnInit:!0,stopOnFocusIn:!0,stopOnInteraction:!0,stopOnMouseEnter:!1,stopOnLastSnap:!1,rootNode:null};function j(t={}){let e,n,s,i,r=null,o=0,a=!1,l=!1,c=!1,u=!1;function d(){s||(m()?c=!0:(a||n.emit("autoplay:play"),function(){const{ownerWindow:t}=n.internalEngine();t.clearTimeout(o),o=t.setTimeout(b,i[n.selectedScrollSnap()]),r=(new Date).getTime(),n.emit("autoplay:timerset")}(),a=!0))}function h(){s||(a&&n.emit("autoplay:stop"),function(){const{ownerWindow:t}=n.internalEngine();t.clearTimeout(o),o=0,r=null,n.emit("autoplay:timerstopped")}(),a=!1)}function p(){if(m())return c=a,h();c&&d()}function m(){const{ownerDocument:t}=n.internalEngine();return"hidden"===t.visibilityState}function f(){l||h()}function g(){l||d()}function v(){l=!0,h()}function y(){l=!1,d()}function b(){const{index:t}=n.internalEngine(),s=t.clone().add(1).get(),i=n.scrollSnapList().length-1,r=e.stopOnLastSnap&&s===i;if(n.canScrollNext()?n.scrollNext(u):n.scrollTo(0,u),n.emit("autoplay:select"),r)return h();d()}return{name:"autoplay",options:t,init:function(r,o){n=r;const{mergeOptions:a,optionsAtMedia:l}=o,c=a(V,j.globalOptions),m=a(c,t);if(e=l(m),n.scrollSnapList().length<=1)return;u=e.jump,s=!1,i=function(t,e){const n=t.scrollSnapList();return"number"==typeof e?n.map(()=>e):e(n,t)}(n,e.delay);const{eventStore:b,ownerDocument:E}=n.internalEngine(),S=!!n.internalEngine().options.watchDrag,w=function(t,e){const n=t.rootNode();return e&&e(n)||n}(n,e.rootNode);b.add(E,"visibilitychange",p),S&&n.on("pointerDown",f),S&&!e.stopOnInteraction&&n.on("pointerUp",g),e.stopOnMouseEnter&&b.add(w,"mouseenter",v),e.stopOnMouseEnter&&!e.stopOnInteraction&&b.add(w,"mouseleave",y),e.stopOnFocusIn&&n.on("slideFocusStart",h),e.stopOnFocusIn&&!e.stopOnInteraction&&b.add(n.containerNode(),"focusout",d),e.playOnInit&&d()},destroy:function(){n.off("pointerDown",f).off("pointerUp",g).off("slideFocusStart",h),h(),s=!0,a=!1},play:function(t){void 0!==t&&(u=t),d()},stop:function(){a&&h()},reset:function(){a&&d()},isPlaying:function(){return a},timeUntilNext:function(){return r?i[n.selectedScrollSnap()]-((new Date).getTime()-r):null}}}j.globalOptions=void 0;class z extends HTMLElement{constructor(){super(),this.axis=this.getAttribute("axis")||"x",this.progress="true"==this.getAttribute("progress"),this.isThumbnailCarousel="true"==this.getAttribute("data-thumb-carousel"),this.isMainCarousel="true"==this.getAttribute("data-main-carousel"),this.mainCarousel=document.querySelector('[data-main-carousel="true"]'),this.isVideoCarousel="true"==this.getAttribute("data-video-carousel"),this.wrapperNode=this.querySelector(".embla"),this.viewportNode=this.querySelector(".embla__viewport"),this.prevButtonNode=this.querySelector(".embla__prev"),this.nextButtonNode=this.querySelector(".embla__next"),this.progressNode=this.querySelector(".embla__progress__bar"),this.startIndex=Number(this.getAttribute("start-index"))||0,this.align=this.getAttribute("align")||"start",this.autoPlay="true"==this.getAttribute("autoplay"),this.thumbnailButtons=this.querySelectorAll(".embla__slide__number"),this.dotsWra
1pper=this.querySelector(".embla__dots"),this.dotNodes=[],this.mobileOnly="true"==this.getAttribute("mobile-only"),this.mobileMedia=window.matchMedia("(max-width: 767px)"),this._onMobileChange=()=>this.handleMobileInit(),this.emblaApi=null,this._emblaListenersBound=!1,this.thumbnailHandlers=null,this.videoHandlers=null,this.dotHandlers=null,this.prevClickHandler=()=>this.emblaApi?.scrollPrev?.(),this.nextClickHandler=()=>this.emblaApi?.scrollNext?.(),this.toggleButtonsDisabledHandler=()=>this.toggleButtonsDisabled(),this.updateProgressHandler=()=>this.updateProgress(),this.toggleDotButtonsActiveHandler=()=>this.toggleDotButtonsActive()}connectedCallback(){if(this.prevButtonNode&&this.prevButtonNode.addEventListener("click",this.prevClickHandler,!1),this.nextButtonNode&&this.nextButtonNode.addEventListener("click",this.nextClickHandler,!1),this.mobileOnly?(this.mobileMedia.addEventListener("change",this._onMobileChange),this.handleMobileInit()):this.initEmbla(),this.isThumbnailCarousel&&this.mainCarousel){this.thumbnailHandlers=new Map;for(const t of this.thumbnailButtons){const e=()=>{const e=this.mainCarousel.getEmblaApi?.();e?.scrollTo?.(Number(t.getAttribute("data-index")),!1,"forward")};this.thumbnailHandlers.set(t,e),t.addEventListener("click",e)}}this.isVideoCarousel&&this.setupVideo()}disconnectedCallback(){if(this.prevButtonNode&&this.prevButtonNode.removeEventListener("click",this.prevClickHandler),this.nextButtonNode&&this.nextButtonNode.removeEventListener("click",this.nextClickHandler),this.mobileMedia.removeEventListener("change",this._onMobileChange),this.thumbnailHandlers)for(const[t,e]of this.thumbnailHandlers)t.removeEventListener("click",e);if(this.videoHandlers)for(const[t,e]of this.videoHandlers)t.removeEventListener("click",e.click),t.removeEventListener("play",e.play);if(this.dotNodes&&this.dotHandlers)for(const[t,e]of this.dotHandlers)t.removeEventListener("click",e);this.destroyEmbla()}handleMobileInit(){const t=this.mobileMedia.matches;t&&!this.emblaApi?this.initEmbla():!t&&this.emblaApi&&this.destroyEmbla()}initEmbla(){if(!this.viewportNode)return;const t=[];this.autoPlay&&t.push(j({delay:5e3,playOnInit:!0,stopOnInteraction:!0})),this.emblaApi=O(this.viewportNode,{loop:!1,axis:this.axis,align:this.align,startIndex:this.startIndex,duration:50,slidesToScroll:1},t),this.emblaApi.on("select",this.toggleButtonsDisabledHandler),this.emblaApi.on("reInit",this.toggleButtonsDisabledHandler),Boolean(this.progress)&&this.progressNode&&(this.emblaApi.on("reInit",this.updateProgressHandler),this.emblaApi.on("scroll",this.updateProgressHandler),this.emblaApi.on("slidefocus",this.updateProgressHandler)),this.dotsWrapper&&(this.createAndSetupDotButtons(),this.emblaApi.on("reInit",()=>this.createAndSetupDotButtons()),this.emblaApi.on("select",this.toggleDotButtonsActiveHandler)),requestAnimationFrame(()=>this.emblaApi?.reInit?.()),window.addEventListener("load",()=>this.emblaApi?.reInit?.(),{once:!0}),this.toggleButtonsDisabled(),this.updateProgress(),this.toggleDotButtonsActive()}destroyEmbla(){if(this.emblaApi){try{this.emblaApi.destroy()}catch(t){}this.emblaApi=null}}getEmblaApi(){return this.emblaApi}updateProgress(){if(!this.emblaApi||!this.progressNode)return;const t=Math.max(0,Math.min(1,this.emblaApi.scrollProgress()));this.progressNode.style.transform=`translate3d(${100*t}%,0px,0px)`}toggleButtonsDisabled(){if(!this.emblaApi)return;const t=(t,e)=>{t&&t.toggleAttribute("disabled",!e)};t(this.prevButtonNode,this.emblaApi.canScrollPrev()),t(this.nextButtonNode,this.emblaApi.canScrollNext())}setupVideo(){const t=this.querySelectorAll("video");this.videoHandlers=new Map;for(const e of t){const n=()=>{this.showControls({video:e,videos:t})},s=()=>{this.handleVideo({video:e,videos:t})};this.videoHandlers.set(e,{click:n,play:s}),e.addEventListener("click",n),e.addEventListener("play",s)}}showControls(t){const{video:e,videos:n}=t;e.controls||(e.controls=!0,this.handleVideo({video:e,videos:n}))}handleVideo(t){const{video:e,videos:n}=t;for(const t of n)e!==t&&t.pause();e.muted=!1,e.play()}createDotButtonHtml(){const t=this.querySelector("#embla-dot-template");if(!t)return[];const e=this.emblaApi.scrollSnapList();
1return this.dotsWrapper&&(this.dotsWrapper.innerHTML=e.reduce((e,n)=>e+t.innerHTML,"")),Array.from(this.dotsWrapper?.querySelectorAll(".embla__dot")??[])}addDotButtonClickHandlers(){this.dotHandlers=new Map,this.dotNodes.forEach((t,e)=>{const n=()=>{this.emblaApi?.scrollTo?.(e),this.emblaApi?.plugins?.().autoplay?.reset?.()};this.dotHandlers.set(t,n),t.addEventListener("click",n,!1)})}createAndSetupDotButtons(){this.dotsWrapper&&this.emblaApi&&(this.dotNodes&&this.dotNodes.length&&this.dotNodes.forEach(t=>t.remove()),this.dotNodes=this.createDotButtonHtml(),this.addDotButtonClickHandlers(),this.toggleDotButtonsActive())}toggleDotButtonsActive(){if(!this.emblaApi||!this.dotNodes||!this.dotNodes.length)return;const t=this.emblaApi.previousScrollSnap(),e=this.emblaApi.selectedScrollSnap();t>=0&&this.dotNodes[t]&&this.dotNodes[t].classList.remove("embla__dot--selected"),this.dotNodes[e]&&this.dotNodes[e].classList.add("embla__dot--selected")}}class U extends HTMLElement{constructor(){super(),this.carousel=this.querySelector('[data-ref="carousel"]'),this.carouselSlider=this.carousel?.querySelector("carousel-slider"),this.tabButtons=this.querySelectorAll('[data-ref="tabButtons"]'),this.tabClickHandler=this.handleTabClick.bind(this)}connectedCallback(){for(const t of this.tabButtons)t.addEventListener("click",this.tabClickHandler)}disconnectedCallback(){for(const t of this.tabButtons)t.removeEventListener("click",this.tabClickHandler)}async handleTabClick(t){const e=t.target.closest('[data-ref="tabButtons"]');if(!e)return;const n=e.getAttribute("data-collection-handle");try{const t=await fetch(`/collections/${n}/?sections=featured-products`),s=await t.json(),i=new DOMParser,r=i.parseFromString(s["featured-products"],"text/html").querySelector('[data-ref="carousel"]');if(r){let t=this.carouselSlider.getEmblaApi();t&&t.destroy(),this.carousel.innerHTML=r.innerHTML,await customElements.whenDefined("carousel-slider"),this.tabButtons.forEach(t=>{t.classList.toggle("btn-primary",t===e),t.classList.toggle("btn-secondary",t!==e)}),t=this.carouselSlider.getEmblaApi(),t&&t.reInit()}}catch(t){console.error("Error loading section:",t)}}}class Z extends HTMLElement{constructor(){super(),this.searchButton=this.querySelectorAll('[data-ref="searchButton"]'),this.predictiveSearch=document.querySelector('[data-ref="headerPredictiveSearch"]'),this.searchCloseButton=this.predictiveSearch.querySelector('[data-ref="searchCloseButton"]'),this.searchInput=document.querySelector('predictive-search [data-ref="searchInput"]'),this._onSearchClick=t=>{t.preventDefault(),this.openSearch()},this._onCloseClick=t=>{t.preventDefault(),this.closeSearch()},this._onDocClick=t=>{t.target.closest('[data-ref="headerPredictiveSearch"]')||t.target.closest('[data-ref="searchButton"]')||!document.body.classList.contains("search-is-active")||this.closeSearch()}}connectedCallback(){if(this.searchButton)for(let t of this.searchButton)t.addEventListener("click",this._onSearchClick);this.searchCloseButton&&this.searchCloseButton.addEventListener("click",this._onCloseClick),document.addEventListener("click",this._onDocClick)}disconnectedCallback(){if(this.searchButton)for(let t of this.searchButton)t.removeEventListener("click",this._onSearchClick);this.searchCloseButton&&this.searchCloseButton.removeEventListener("click",this._onCloseClick),document.removeEventListener("click",this._onDocClick)}openSearch(){this.predictiveSearch.classList.remove("hidden"),document.body.classList.add("search-is-active"),this.searchInput?.focus()}closeSearch(){this.predictiveSearch.classList.add("hidden"),document.body.classList.remove("search-is-active"),this.searchInput?.blur()}}class G extends HTMLElement{constructor(){super(),this.categoryButtons=this.querySelectorAll('[data-ref="categoryButtons"]'),this.carouselWrapper=this.querySelector('[data-ref="carouselWrapper"]'),this.buttonClickHandler=this.handleButtonclickEvent.bind(this)}connectedCallback(){for(const t of this.categoryButtons)t.addEventListener("click",this.buttonClickHandler)}disconnectedCallback(){for(const t of this.categoryButtons)t.removeEventListener("click",this.buttonClickHandler)}handleButtonclickEvent(t){const e=t.target.closest('[data-ref="categoryButtons"]');if(!e)return;const n=e.getAttribute("data-block-id"),s=this.querySelector(`#template-${n}`);this.carouselWrapper.innerHTML=s.innerHTML;for(const t of this.categoryButtons)t.classList.remove("btn-primary"),t.classList.add("btn-secondary");e.classList.add("btn-primary"),e.classList.remove("btn-secondary")}}class W extends HTMLElement{constructor(){super(),this.addButton=this.querySelector('[data-ref="addButton"]'),this.subtractButton=this.querySelector('[data-ref="subtractButton"]'),this.input=this.querySelector('[data-ref="quantityInput"]'),this.message=this.querySelector('[data-ref="message"]'),this.addButtonClickHandler=this.addQuantity.bind(this),this.subtractButtonClickHandler=this.subtractQuantity.bind(this)}connectedCallback(){this.addButton&&this.addButton.addEventListener("click",this.addButtonClickHandler),this.subtractButton&&this.subtractButton.addEventListener("click",this.subtractButtonClickHandler)}disconnectedCallback(){this.addButton&&this.addButton.removeEventListener("click",this.addButtonClickHandler),this.subtractButton&&this.subtractButton.removeEventListener("click",this.subtractButtonClickHandler)}get quantity(){return this.input&&this.input.value?parseInt(this.input.value,10):1}addQuantity(t){const e=parseInt(this.input.value)+1;this.input&&(e>parseInt(this.input.max)?1==parseInt(this.input.max)?this.renderError(`There is only ${this.input.max} available`):this.renderError(`There are only ${this.input.max} available`):(this.input.value=e,this.dispatchEvent(new CustomEvent("quantity-changed",{detail:{quantity:this.input.value}}))))}subtractQuantity(t){const e=parseInt(this.input.value)-1;!this.input||e<parseInt(this.input.min)||(this.input.value=e,this.dispatchEvent(new CustomEvent("quantity-changed",{detail:{quantity:this.input.value}})))}renderError(t){this.message.innerText=t,this.message.classList.remove("hidden"),setTimeout(()=>{this.message.classList.add("hidden"),this.message.innerText=""},2e3)}} 2/*! 3 * @license MIT 4 * @name vlitejs 5 * @version 8.1.1 6 * @copyright 2026 Yoriiis 7 */const J={},X={};function Y({plugins:t,provider:e,type:n,player:s}){(function(t){const e=[],n=Object.keys(J);return t.forEach(t=>{if(!n.includes(t))throw new Error(`vlitejs :: Unknown plugin "${t}".`);e.push({id:t,Plugin:J[t],options:X[t]})}),e})(t).forEach(({id:t,Plugin:i,options:r})=>{const o=new i({player:s,options:r});if(s.plugins[t]=o,!o.providers.includes(e)||!o.types.includes(n))throw new Error(`vlitejs :: The "${t}" plugin is only compatible with providers:"${o.providers}" and types:"${o.types}"`);o.init()})}const Q={html5:function(t){return class extends t{constructor(t){super(t),this.events=[{type:"timeupdate",listener:super.onTimeUpdate.bind(this)}
7,{type:"ended",listener:super.onMediaEnded.bind(this)},{type:"playing",listener:this.onPlaying.bind(this)},{type:"waiting",listener:this.onWaiting.bind(this)},{type:"seeking",listener:this.onSeeking.bind(this)},{type:"seeked",listener:this.onSeeked.bind(this)}]}init(){this.waitUntilVideoIsReady().then(()=>{this.addSpecificEvents(),super.onReady()})}waitUntilVideoIsReady(){return new window.Promise(t=>{this.media.readyState>=2&&this.media.duration||0===this.media.readyState&&"none"===this.media.preload?t():(this.media.addEventListener("loadedmetadata",t,{once:!0}),this.media.addEventListener("canplay",t,{once:!0}))})}addSpecificEvents(){this.events.forEach(t=>{this.media.addEventListener(t.type,t.listener.bind(this))})}getInstance(){return this.media}getCurrentTime(){return new window.Promise(t=>t(this.media.currentTime))}getDuration(){return new window.Promise(t=>t(this.media.duration))}methodPlay(){this.media.play()}methodPause(){this.media.pause()}methodSetVolume(t){this.media.volume=t}methodGetVolume(){return new window.Promise(t=>t(this.media.volume))}methodMute(){this.media.muted=!0,this.media.setAttribute("muted","")}methodUnMute(){this.media.muted=!1,this.media.removeAttribute("muted")}methodSetSource(t){this.media.src=t,this.media.load(),this.removeSpecificEvents(),this.init()}methodSeekTo(t){this.media.currentTime=t}onWaiting(){this.loading(!0)}onPlaying(){this.loading(!1)}onSeeking(){this.loading(!0)}onSeeked(){this.loading(!1)}removeSpecificEvents(){this.events.forEach(t=>{this.media.removeEventListener(t.type,t.listener)})}destroy(){this.removeSpecificEvents(),super.destroy()}}}},K={};function tt(t){const e=1e3*t,n=e/1e3/60|0,s=e/1e3%60|0;let i="";return i+=n<10?"0":"",i+=`${n}:`,i+=s<10?"0":"",i+=s,i}function et(){return"ontouchstart"in window||navigator.maxTouchPoints>0}function nt({target:t,selectorString:e,nodeName:n}){return(n=[].concat(n)).some(n=>t.nodeName.toLowerCase()===n&&t.matches(e))}function st({isMuted:t}){return`<button class="v-volumeButton v-controlButton${t?" v-controlPressed":""}"><svg class="v-iconUnpressed" viewBox="0 0 18 17" xmlns="http://www.w3.org/2000/svg"><path d="M0 6.461v4c0 .55.45 1 1 1h3l3.29 3.29c.63.63 1.71.18 1.71-.71V2.871c0-.89-1.08-1.34-1.71-.71L4 5.461H1c-.55 0-1 .45-1 1Zm13.5 2a4.5 4.5 0 0 0-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02ZM11 .911v.2c0 .38.25.71.6.85a7.004 7.004 0 0 1 4.4 6.5c0 2.94-1.82 5.47-4.4 6.5-.36.14-.6.47-.6.85v.2c0 .63.63 1.07 1.21.85a8.98 8.98 0 0 0 5.79-8.4c0-3.84-2.4-7.11-5.79-8.4-.58-.23-1.21.22-1.21.85Z"/></svg><svg class="v-iconPressed" viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg"><path d="M.63.292a.996.996 0 0 0 0 1.41l3.66 3.66-.29.3H1c-.55 0-1 .45-1 1v4c0 .55.45 1 1 1h3l3.29 3.29c.63.63 1.71.18 1.71-.71v-4.17l4.18 4.18c-.49.37-1.02.68-1.6.91-.36.15-.58.53-.58.92 0 .72.73 1.18 1.39.91.8-.33 1.55-.77 2.22-1.31l1.34 1.34a.997.997 0 1 0 1.41-1.41L2.05.293c-.39-.39-1.02-.39-1.42 0ZM16 8.662c0 .82-.15 1.61-.41 2.34l1.53 1.53c.56-1.17.88-2.48.88-3.87 0-3.83-2.4-7.11-5.78-8.4
7-.59-.23-1.22.23-1.22.86v.19c0 .38.25.71.61.85 2.57 1.04 4.39 3.56 4.39 6.5Zm-8.71-6.29-.17.17L9 4.422v-1.35c0-.89-1.08-1.33-1.71-.7Zm6.21 6.29a4.5 4.5 0 0 0-2.5-4.03v1.79l2.48 2.48c.01-.08.02-.16.02-.24Z"/></svg></button>`}class it{constructor({player:t,type:e}){this.player=t,this.type=e,this.touchEvents=["touchstart","touchmove","touchend"],this.onInputProgressBar=this.onInputProgressBar.bind(this),this.onTouchEventProgressBar=this.onTouchEventProgressBar.bind(this),this.onClickOnControlBar=this.onClickOnControlBar.bind(this),this.togglePlayPause=this.togglePlayPause.bind(this),this.toggleVolume=this.toggleVolume.bind(this),this.toggleFullscreen=this.toggleFullscreen.bind(this)}init(){this.render(),this.cacheElements(),this.addEvents()}cacheElements(){const t=this.player.elements.container.querySelector(".v-controlBar");t&&(this.player.elements.controlBar=t,this.player.elements.playPause=t.querySelector(".v-playPauseButton"),this.player.elements.progressBar=t.querySelector(".v-progressBar"),this.player.elements.currentTime=t.querySelector(".v-currentTime"),this.player.elements.duration=t.querySelector(".v-duration"),this.player.elements.volume=t.querySelector(".v-volumeButton"),this.player.elements.fullscreen=t.querySelector(".v-fullscreenButton"),this.player.elements.volume&&this.player.elements.volume.setAttribute("aria-label",this.player.isMuted?"Unmute":"Mute"))}render(){this.player.elements.container.insertAdjacentHTML("beforeend",this.getTemplate())}onReady(){this.player.getDuration().then(t=>{this.player.elements.progressBar&&this.player.elements.progressBar.setAttribute("aria-valuemax",`${Math.round(t)}`),this.player.elements.duration&&(this.player.elements.duration.innerHTML=tt(t))})}addEvents(){var t;this.player.elements.progressBar&&(this.player.elements.progressBar.addEventListener("input",this.onInputProgressBar),this.player.isTouch&&this.touchEvents.forEach(t=>{this.player.elements.progressBar.addEventListener(t,this.onTouchEventProgressBar)})),null===(t=this.player.elements.controlBar)||void 0===t||t.addEventListener("click",this.onClickOnControlBar)}onTouchEventProgressBar(t){t.preventDefault();const e=t.target,n=Number.parseFloat(e.getAttribute("max")||"100"),s=e.getBoundingClientRect(),i=(t.changedTouches[0].clientX-s.left)/s.width*100;e.value=""+100*i/n,e.dispatchEvent(new Event("input"))}onInputProgressBar(t){const e=t.target;e.style.setProperty("--vlite-progressValue",`${e.value}%`),this.player.elements.outerContainer.classList.contains("v-firstStart")&&this.player.play(),this.player.getDuration().then(t=>{this.player.seekTo(Number.parseFloat(e.value)*t/100)})}onClickOnControlBar(t){const e=t.target,n=nt({target:e,selectorString:".v-playPauseButton",nodeName:["button"]}),s=nt({target:e,selectorString:".v-volumeButton",nodeName:["button"]}),i=nt({target:e,selectorString:".v-fullscreenButton",nodeName:["button"]});n?this.togglePlayPause(t):s?this.toggleVolume(t):i&&this.toggleFullscreen(t),(n||s||i)&&this.player.elements.container.focus(),this.player.Vlitejs.startAutoHideTimer()}togglePlayPause(t){t.preventDefault(),this.player.elements.outerContainer.classList.contains("v-paused")?this.player.play():this.player.pause()}toggleVolume(t){t.preventDefault(),this.player.elements.volume.classList.contains("v-controlPressed")?this.player.unMute():this.player.mute()}toggleFullscreen(t){if(t.preventDefault(),this.player.isFullScreen)this.isOrientationApiAvailable()&&window.screen.orientation.unlock(),this.player.exitFullscreen();else{this.player.requestFullscreen();try{window.matchMedia("(orientation:portrait)").matches&&this.isOrientationApiAvailable()&&window.screen.orientation.lock("landscape").catch(()=>{})}catch(t){}}}isOrientationApiAvailable(){return void 0!==window.screen.orientation&&"function"==typeof window.screen.orientation.lock&&"function"==typeof window.screen.orientation.unlock}getTemplate(){return`${function({options:t,isMuted:e,isVideo:n}){return n?`<div class="v-controlBar">${t.playPause?'<button class="v-playPauseButton v-controlButton" aria-label="Play">
7<svg class="v-iconUnpressed" viewBox="0 0 11 13" xmlns="http://www.w3.org/2000/svg"><path d="M0 1v10.36c0 .79.87 1.27 1.54.84l8.14-5.18a1 1 0 0 0 0-1.69L1.54.16A.998.998 0 0 0 0 1Z"/></svg><svg class="v-iconPressed" viewBox="0 0 12 14" xmlns="http://www.w3.org/2000/svg"><path d="M2 14c1.1 0 2-.9 2-2V2c0-1.1-.9-2-2-2S0 .9 0 2v10c0 1.1.9 2 2 2ZM8 2v10c0 1.1.9 2 2 2s2-.9 2-2V2c0-1.1-.9-2-2-2S8 .9 8 2Z"/></svg></button>':""}${t.time?'<div class="v-time"><span class="v-currentTime">00:00</span> / <span class="v-duration"></span></div>':""}${t.progressBar?'<input type="range" class="v-progressBar v-progressBarStyle" min="0" max="100" step="0.01" value="0" aria-label="Seek" aria-valuemin="0" />':""}${t.volume?st({isMuted:e}):""}${t.fullscreen?'<button class="v-fullscreenButton v-controlButton" aria-label="Enter fullscreen"><svg class="v-iconUnpressed" viewBox="0 0 14 14" xmlns="http://www.w3.org/2000/svg"><path d="M1 9c-.55 0-1 .45-1 1v3c0 .55.45 1 1 1h3c.55 0 1-.45 1-1s-.45-1-1-1H2v-2c0-.55-.45-1-1-1Zm0-4c.55 0 1-.45 1-1V2h2c.55 0 1-.45 1-1s-.45-1-1-1H1C.45 0 0 .45 0 1v3c0 .55.45 1 1 1Zm11 7h-2c-.55 0-1 .45-1 1s.45 1 1 1h3c.55 0 1-.45 1-1v-3c0-.55-.45-1-1-1s-1 .45-1 1v2ZM9 1c0 .55.45 1 1 1h2v2c0 .55.45 1 1 1s1-.45 1-1V1c0-.55-.45-1-1-1h-3c-.55 0-1 .45-1 1Z"/></svg><svg class="v-iconPressed" viewBox="0 0 14 14" xmlns="http://www.w3.org/2000/svg"><path d="M1 11h2v2c0 .55.45 1 1 1s1-.45 1-1v-3c0-.55-.45-1-1-1H1c-.55 0-1 .45-1 1s.45 1 1 1Zm2-8H1c-.55 0-1 .45-1 1s.45 1 1 1h3c.55 0 1-.45 1-1V1c0-.55-.45-1-1-1S3 .45 3 1v2Zm7 11c.55 0 1-.45 1-1v-2h2c.55 0 1-.45 1-1s-.45-1-1-1h-3c-.55 0-1 .45-1 1v3c0 .55.45 1 1 1Zm1-11V1c0-.55-.45-1-1-1S9 .45 9 1v3c0 .55.45 1 1 1h3c.55 0 1-.45 1-1s-.45-1-1-1h-2Z"/></svg></span></button>':""}</div>`:`<div class="v-controlBar">${t.playPause?'<button class="v-playPauseButton v-controlButton" aria-label="Play"><svg class="v-iconUnpressed" viewBox="0 0 11 13" xmlns="http://www.w3.org/2000/svg"><path d="M0 1v10.36c0 .79.87 1.27 1.54.84l8.14-5.18a1 1 0 0 0 0-1.69L1.54.16A.998.998 0 0 0 0 1Z"/></svg><svg class="v-iconPressed" viewBox="0 0 12 14" xmlns="http://www.w3.org/2000/svg"><path d="M2 14c1.1 0 2-.9 2-2V2c0-1.1-.9-2-2-2S0 .9 0 2v10c0 1.1.9 2 2 2ZM8 2v10c0 1.1.9 2 2 2s2-.9 2-2V2c0-1.1-.9-2-2-2S8 .9 8 2Z"/></svg></button>':""}${t.time?'<div class="v-time"><span class="v-currentTime">00:00</span> / <span class="v-duration"></span></div>':""}${t.progressBar?'<input type="range" class="v-progressBar v-progressBarStyle" min="0" max="100" step="0.01" value="0" aria-label="Seek" aria-valuemin="0" />':""}${t.volume?st({isMuted:e}):""}</div>`}({options:this.player.options,isMuted:this.player.isMuted,isVideo:"video"===this.type})}`}removeEvents(){var t;this.player.elements.progressBar&&(this.player.elements.progressBar.removeEventListener("input",this.onInputProgressBar),this.player.isTouch&&this.touchEvents.forEach(t=>{this.player.elements.progressBar.removeEventListener(t,this.onTouchEventProgressBar)})),null===(t=this.player.elements.controlBar)||void 0===t||t.removeEventListener("click",this.onClickOnControlBar)}destroy(){var t;this.removeEvents(),null===(t=this.player.elements.controlBar)||void 0===t||t.remove()}}class rt{constructor({Vlitejs:t,type:e}){this.Vlitejs=t,this.type=e,this.plugins={},this.media=t.media,this.options=t.options,this.isCast=!1,this.isLinearAd=!1,this.elements={container:t.container,outerContainer:t.outerContainer,bigPlay:t.container.querySelector(".v-bigPlay"),poster:t.container.querySelector(".v-poster"),controlBar:null,playPause:null,progressBar:null,currentTime:null,duration:null,volume:null,fullscreen:null},this.isFullScreen=!1,this.isMuted=this.options.muted,this.isPaused=null,this.playerEvents=[],this.isTouch=et(),this.controlBar=new it({player:this,type:e})}build(){this.options.controls&&this.controlBar.init(),this.init()}onReady(){this.options.muted&&this.mute(),this.media.classList.add("v-media"),this.media.setAttribute("tabindex","-1"),this.options.autoplay&&(!this.media.muted&&this.mute(),this.play()),this.Vlitejs.onReady instanceof Function&&this.Vlitejs.onReady.call(this,this),"none"===this.media.preload&&"html5"===this.Vlitejs.provider?this.media.addEventListener("loadedmetadata",()=>this.triggerOnReady()):this.triggerOnReady(),this.loading(!1)}triggerOnReady(){this.options.controls&&this.controlBar.onReady(),Object.keys(this.plugins).forEac
7h(t=>{this.plugins[t].onReady instanceof Function&&this.plugins[t].onReady()})}on(t,e){e instanceof Function&&(this.playerEvents.push({type:t,listener:e}),this.elements.container.addEventListener(t,e))}off(t,e){e instanceof Function&&this.elements.container.removeEventListener(t,e)}dispatchEvent(t,e){this.elements.container.dispatchEvent(new window.CustomEvent(t,{detail:e}))}loading(t){this.elements.outerContainer.classList[t?"add":"remove"]("v-loading"),this.dispatchEvent("progress")}onTimeUpdate(){this.options.time&&Promise.all([this.getCurrentTime(),this.getDuration()]).then(([t,e])=>this.updateProgressBar({seconds:t,duration:e}))}updateProgressBar({seconds:t,duration:e,isRemote:n=!1}){const s=Math.round(t);if(this.elements.progressBar){const n=100*s/e;this.elements.progressBar.value=`${n}`,this.elements.progressBar.style.setProperty("--vlite-progressValue",`${n}%`),this.elements.progressBar.setAttribute("aria-valuenow",`${Math.round(t)}`)}this.elements.currentTime&&(this.elements.currentTime.innerHTML=tt(s)),!n&&this.dispatchEvent("timeupdate")}onMediaEnded(){this.options.loop?this.play():(this.elements.outerContainer.classList.replace("v-playing","v-paused"),this.elements.outerContainer.classList.add("v-firstStart"),this.isPaused=null),this.elements.poster&&this.elements.poster.classList.add("v-active"),"video"===this.type&&this.elements.bigPlay&&this.elements.bigPlay.setAttribute("aria-label","Play"),this.elements.playPause&&(this.elements.playPause.setAttribute("aria-label","Play"),this.elements.playPause.classList.remove("v-controlPressed")),this.elements.progressBar&&(this.elements.progressBar.value="0",this.elements.progressBar.style.setProperty("--vlite-progressValue","0%"),this.elements.progressBar.removeAttribute("aria-valuenow")),this.elements.currentTime&&(this.elements.currentTime.innerHTML="00:00"),this.dispatchEvent("ended")}play(){this.isLinearAd||(null===this.isPaused&&(this.elements.outerContainer.classList.remove("v-firstStart"),"video"===this.type&&this.elements.poster&&this.elements.poster.classList.remove("v-active")),!this.isCast&&this.methodPlay(),this.isPaused=!1,this.elements.outerContainer.classList.replace("v-paused","v-playing"),this.elements.playPause&&(this.elements.playPause.setAttribute("aria-label","Pause"),this.elements.playPause.classList.add("v-controlPressed")),"video"===this.type&&this.elements.bigPlay&&this.elements.bigPlay.setAttribute("aria-label","Pause"),this.afterPlayPause(),this.dispatchEvent("play"))}pause(){!this.isCast&&this.methodPause(),this.isPaused=!0,this.elements.outerContainer.classList.replace("v-playing","v-paused"),this.elements.playPause&&(this.elements.playPause.setAttribute("aria-label","Play"),this.elements.playPause.classList.remove("v-controlPressed")),"video"===this.type&&this.elements.bigPlay&&this.elements.bigPlay.setAttribute("aria-label","Play"),this.afterPlayPause(),this.dispatchEvent("pause")}afterPlayPause(){this.Vlitejs.autoHideGranted&&(this.Vlitejs.stopAutoHideTimer(),!this.isPaused&&this.Vlitejs.startAutoHideTimer())}setVolume(t){let e=t;e>1?e=1:e<=0?(e=0,this.isMuted=!0,this.elements.volume&&this.elements.volume.classList.add("v-controlPressed")):(this.isMuted=!1,this.elements.volume&&this.elements.volume.classList.remove("v-controlPressed")),this.methodSetVolume(e),this.dispatchEvent("volumechange",{volume:e})}getVolume(){return new window.Promise(t=>{this.methodGetVolume().then(e=>{t(e)})})}mute(){this.methodMute(),this.isMuted=!0,this.elements.volume&&(this.elements.volume.classList.add("v-controlPressed"),this.elements.volume.setAttribute("aria-label","Unmute")),this.dispatchEvent("volumechange")}unMute(){this.methodUnMute(),this.isMuted=!1,this.elements.volume&&(this.elements.volume.classList.remove("v-controlPressed"),this.elements.volume.setAttribute("aria-label","Mute")),this.dispatchEvent("volumechange")}setSource(t){this.options.loop=!1,this.pause(),this.onMediaEnded(),this.methodSetSource(t),this.controlBar.onReady(),this.play(),this.dispatchEvent("sourcechange")}seekTo(t){this.methodSeekTo(t)}requestFullscreen(){const{requestFn:t}=this.Vlitejs.supportFullScreen;this.media[t]&&(this.elements.container[t](),this.isFullScreen=!0,this.elements.outerContainer.classList.add("v-fullscreen"),this.elements.fullscreen&&(this.elements.fullscreen.classList.add("v-controlPressed"),this.elements.fullscreen.setAttribute("aria-label","Exit fullscreen")),this.dispatchEvent("enterfullscreen"))}exitFullscreen({escKey:t=!1}={}){const{cancelFn:e}=this.Vlitejs.supportFullScreen;document[e]&&(!t&&document[e](),this.isFullScreen=!1,this.elements.outerContainer.classList.remove("v-fullscreen"),this.elements.fullscreen&&(this.elements.fullscreen.classList.remove("v-controlPressed"),this.elements.fullscreen.setAttribute("aria-label","Enter fullscreen")),this.dispatchEvent("exitfullscreen"))}destroy(){var t;
7Object.keys(this.plugins).forEach(t=>{this.plugins[t].destroy instanceof Function&&this.plugins[t].destroy()}),null===(t=this.controlBar)||void 0===t||t.destroy(),this.playerEvents.forEach(t=>{this.elements.container.removeEventListener(t.type,t.listener)}),this.elements.container.remove()}}const ot={audio:{controls:!0,autoplay:!1,playPause:!0,progressBar:!0,time:!0,volume:!0,loop:!1},video:{controls:!0,autoplay:!1,playPause:!0,progressBar:!0,time:!0,volume:!0,fullscreen:!0,poster:null,bigPlay:!0,playsinline:!0,loop:!1,muted:!1,autoHide:!1,autoHideDelay:3e3,providerParams:{}}};class at{constructor(t,{options:e={},provider:n="html5",plugins:s=[],onReady:i=()=>{}}={}){if("string"==typeof t)this.media=document.querySelector(t);else{if(!(t instanceof HTMLVideoElement||t instanceof HTMLAudioElement||t instanceof HTMLDivElement))throw new TypeError("vlitejs :: The element or selector supplied is not valid.");this.media=t}this.provider=n,this.onReady=i,this.type=this.media instanceof HTMLAudioElement?"audio":"video",this.supportFullScreen=function(){const t=document.exitFullscreen instanceof Function?"":["webkit","moz","ms"].find(t=>document[`${t}ExitFullscreen`]instanceof Function||document[`${t}CancelFullScreen`]instanceof Function)||"";return{requestFn:t?`${t}RequestFullScreen`:"requestFullscreen",cancelFn:t?`${t}ExitFullscreen`:"exitFullscreen",changeEvent:t?`${t}fullscreenchange`:"fullscreenchange",isFullScreen:t?`${t}FullscreenElement`:"fullscreenElement"}}(),["autoplay","playsinline","muted","loop"].forEach(t=>{this.media.hasAttribute(t)?e[t]=!0:e[t]&&this.media.setAttribute(t,"")}),this.options=Object.assign(Object.assign({},ot[this.type]),e),this.autoHideGranted="video"===this.type&&!!this.options.autoHide&&!!this.options.controls,/(iPhone)/gi.test(window.navigator.userAgent)&&(this.options.fullscreen=!1),this.onClickOnPlayer=this.onClickOnPlayer.bind(this),this.onDoubleClickOnPlayer=this.onDoubleClickOnPlayer.bind(this),this.onMousemove=this.onMousemove.bind(this),this.onChangeFullScreen=this.onChangeFullScreen.bind(this);const r=function(t,e){const n=Q[t];if(n)return n(e,K[t]);throw new Error(`vlitejs :: Unknown provider "${t}"`)}(n,rt);this.wrapElement(),this.container=this.media.closest(".v-container"),this.outerContainer=this.container.closest(".v-vlite"),"video"===this.type&&this.renderLayout(),this.player=new r({type:this.type,Vlitejs:this}),this.player.build(),this.addEvents(),Y({plugins:s,provider:n,type:this.t
7ype,player:this.player})}wrapElement(){const t=document.createElement("div");t.classList.add("v-vlite","v-firstStart","v-paused","v-loading",`v-${this.type}`);const e=document.createElement("div");e.setAttribute("tabindex","0"),e.classList.add("v-container"),t.appendChild(e),this.media.parentNode.insertBefore(t,this.media),e.appendChild(this.media)}renderLayout(){const t=`\n\t\t\t<div class="v-overlay"></div>\n\t\t\t\n\t\t<div class="v-loader">\n\t\t\t<div class="v-loaderContent">\n\t\t\t\t<div class="v-loaderBounce1"></div>\n\t\t\t\t<div class="v-loaderBounce2"></div>\n\t\t\t\t<div class="v-loaderBounce3"></div>\n\t\t\t</div>\n\t\t</div>\n\t\n\t\t\t${this.options.poster?function({posterUrl:t=""}){return`<div class="v-poster v-active"${t&&` style="background-image: url(${t})"`}></div>`}({posterUrl:this.options.poster}):""}\n\t\t\t${this.options.bigPlay?'<button class="v-bigPlay" aria-label="Play"><svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M10 0C4.48 0 0 4.48 0 10s4.48 10 10 10 10-4.48 10-10S15.52 0 10 0ZM7.5 12.67V7.33c0-.79.88-1.27 1.54-.84l4.15 2.67a1 1 0 0 1 0 1.68l-4.15 2.67c-.66.43-1.54-.05-1.54-.84Z"/></svg></button>':""}\n\t\t`;this.container.insertAdjacentHTML("beforeend",t)}addEvents(){"video"===this.type&&(this.container.addEventListener("click",this.onClickOnPlayer),this.container.addEventListener("dblclick",this.onDoubleClickOnPlayer),this.autoHideGranted&&!this.player.isTouch&&this.container.addEventListener("mousemove",this.onMousemove),document.addEventListener(this.supportFullScreen.changeEvent,this.onChangeFullScreen))}onClickOnPlayer(t){var e;const n=t.target,s=nt({target:n,selectorString:".v-poster, .v-bigPlay",nodeName:["div","button"]}),i=nt({target:n,selectorString:".v-overlay",nodeName:["div"]});if(i&&et()&&this.autoHideGranted&&(null===(e=this.player.elements.controlBar)||void 0===e?void 0:e.classList.contains("v-hidden")))return this.stopAutoHideTimer(),void this.startAutoHideTimer();(s||i&&!et())&&(this.player.controlBar.togglePlayPause(t),n.matches(".v-bigPlay")&&this.container.focus())}onDoubleClickOnPlayer(t){nt({target:t.target,selectorString:".v-overlay",nodeName:["div"]})&&this.player.controlBar.toggleFullscreen(t)}onMousemove(){!this.player.isPaused&&this.autoHideGranted&&(this.stopAutoHideTimer(),this.startAutoHideTimer())}onChangeFullScreen(){!document[this.supportFullScreen.isFullScreen]&&this.player.isFullScreen&&this.player.exitFullscreen({escKey:!0})}stopAutoHideTimer(){var t;"video"===this.type&&this.player.elements.controlBar&&(null===(t=this.player.elements.controlBar)||void 0===t||t.classList.remove("v-hidden"),clearTimeout(this.timerAutoHide))}startAutoHideTimer(){"video"===this.type&&!this.player.isPaused&&this.player.elements.controlBar&&(this.timerAutoHide=window.setTimeout(()=>{var t;null===(t=this.player.elements.controlBar)||void 0===t||t.classList.add("v-hidden")},this.options.autoHideDelay))}removeEvents(){"video"===this.type&&(this.container.removeEventListener("click",this.onClickOnPlayer),this.container.removeEventListener("dblclick",this.onDoubleClickOnPlayer),this.autoHideGranted&&!this.player.isTouch&&this.container.removeEventListener("mousemove",this.onMousemove),window.removeEventListener(this.supportFullScreen.changeEvent,this.onChangeFullScreen))}destroy(){this.removeEvents(),this.player.destroy(),this.player.controlBar.destroy()}}at.registerProvider=function(t,e,n){if(void 0!==e){if(!Object.keys(Q).includes(t))return Q[t]=e,void(n&&(K[t]=n));throw new Error(`vlitejs :: The provider id "${t}" is already registered.`)}throw new Error(`vlitejs :: The provider id "${t}" is undefined.`)},at.registerPlugin=function(t,e,n){if(void 0!==e){if(!Object.keys(J).includes(t))return J[t]=e,void(n&&(X[t]=n));throw new Error(`vlitejs :: The plugin id "${t}" is already registered.`)}throw new Error(`vlitejs :: The plugin id "${t}" is undefined.`)};class lt extends HTMLElement{constructor(){super(),this.vliteInstance=null}connectedCallback(){const t=this.querySelector("video");t&&(this.vliteInstance=new at(t))}disconnectedCallback(){this.vliteInstance&&this.vliteInstance.destroy&&this.vliteInstance.destroy(),this.vliteInstance=null}}function ct(){}const ut=t=>t;function dt(t,e){for(const n in e)t[n]=e[n];return t}function ht(t){return t()}function pt(t){t.forEach(ht)}function mt(t){return"function"==typeof t}function ft(t,e){return t!=t?e==e:t!==e}function gt(t,e,n){t.$$.on_destroy.push(function(t,...e){if(null==t)return ct;const n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}(e,n))}function vt(t){return t&&mt(t.destroy)?t.destroy:ct}let yt=()=>globalThis.performance.now(),bt=t=>requestAnimationFrame(t);const Et=new Set;
7function St(t){Et.forEach(e=>{e.c(t)||(Et.delete(e),e.f())}),0!==Et.size&&bt(St)}function wt(t){let e;return 0===Et.size&&bt(St),{promise:new Promise(n=>{Et.add(e={c:t,f:n})}),abort(){Et.delete(e)}}}function xt(t,e){t.appendChild(e)}function Lt(t,e,n){t.insertBefore(e,n||null)}function kt(t){t.parentNode.removeChild(t)}function Ct(t){return document.createElement(t)}function Pt(){return t="",document.createTextNode(t);var t}function Bt(t,e,n,s){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n,s)}function $t(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function Mt(t,e,n,s){null===n?t.style.removeProperty(e):t.style.setProperty(e,n)}function Tt(t,e,n){t.classList[n?"add":"remove"](e)}let At,Ht,It=0,qt={};function _t(t,e,n,s,i,r,o,a=0){const l=16.666/s;let c="{\n";for(let t=0;t<=1;t+=l){const s=e+(n-e)*r(t);c+=100*t+`%{${o(s,1-s)}}\n`}const u=c+`100% {${o(n,1-n)}}\n}`,d=`_bp_${Math.round(1e9*Math.random())}_${a}`;if(!qt[d]){if(!At){const t=Ct("style");document.head.appendChild(t),At=t.sheet}qt[d]=!0,At.insertRule(`@keyframes ${d} ${u}`,At.cssRules.length)}const h=t.style.animation||"";return t.style.animation=`${h?`${h}, `:""}${d} ${s}ms linear ${i}ms 1 both`,It+=1,d}function Nt(t,e){t.style.animation=(t.style.animation||"").split(", ").filter(e?t=>t.indexOf(e)<0:t=>-1===t.indexOf("_bp")).join(", "),e&&! --It&&bt(()=>{if(It)return;let t=At.cssRules.length;for(;t--;)At.deleteRule(t);qt={}})}function Dt(t){Ht=t}const Ft=[],Rt=[],Ot=[],Vt=[],jt=Promise.resolve();let zt=!1;function Ut(t){Ot.push(t)}const Zt=new Set;let Gt,Wt=0;function Jt(){const t=Ht;do{for(;Wt<Ft.length;){const t=Ft[Wt];Wt++,Dt(t),Xt(t.$$)}for(Dt(null),Ft.length=0,Wt=0;Rt.length;)Rt.pop()();for(let t=0;t<Ot.length;t+=1){const e=Ot[t];Zt.has(e)||(Zt.add(e),e())}Ot.length=0}while(Ft.length);for(;Vt.length;)Vt.pop()();zt=!1,Zt.clear(),Dt(t)}function Xt(t){if(null!==t.fragment){t.update(),pt(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(Ut)}}function Yt(){return Gt||(Gt=Promise.resolve(),Gt.then(()=>{Gt=null})),Gt}function Qt(t,e,n){t.dispatchEvent(function(t,e,n=!1){const s=document.createEvent("CustomEvent");return s.initCustomEvent(t,n,!1,e),s}(`${e?"intro":"outro"}${n}`))}
7const Kt=new Set;let te;function ee(){te={r:0,c:[],p:te}}function ne(){te.r||pt(te.c),te=te.p}function se(t,e){t&&t.i&&(Kt.delete(t),t.i(e))}function ie(t,e,n,s){if(t&&t.o){if(Kt.has(t))return;Kt.add(t),te.c.push(()=>{Kt.delete(t),s&&(n&&t.d(1),s())}),t.o(e)}}const re={duration:0};function oe(t,e,n){let s,i,r=e(t,n),o=!1,a=0;function l(){s&&Nt(t,s)}function c(){const{delay:e=0,duration:n=300,easing:c=ut,tick:u=ct,css:d}=r||re;d&&(s=_t(t,0,1,n,e,c,d,a++)),u(0,1);const h=yt()+e,p=h+n;i&&i.abort(),o=!0,Ut(()=>Qt(t,!0,"start")),i=wt(e=>{if(o){if(e>=p)return u(1,0),Qt(t,!0,"end"),l(),o=!1;if(e>=h){const t=c((e-h)/n);u(t,1-t)}}return o})}let u=!1;return{start(){u||(u=!0,Nt(t),mt(r)?(r=r(),Yt().then(c)):c())},invalidate(){u=!1},end(){o&&(l(),o=!1)}}}function ae(t,e,n){let s,i=e(t,n),r=!0;const o=te;function a(){const{delay:e=0,duration:n=300,easing:a=ut,tick:l=ct,css:c}=i||re;c&&(s=_t(t,1,0,n,e,a,c));const u=yt()+e,d=u+n;Ut(()=>Qt(t,!1,"start")),wt(e=>{if(r){if(e>=d)return l(0,1),Qt(t,!1,"end"),--o.r||pt(o.c),!1;if(e>=u){const t=a((e-u)/n);l(1-t,t)}}return r})}return o.r+=1,mt(i)?Yt().then(()=>{i=i(),a()}):a(),{end(e){e&&i.tick&&i.tick(1,0),r&&(s&&Nt(t,s),r=!1)}}}function le(t){t&&t.c()}function ce(t,e,n,s){const{fragment:i,on_mount:r,on_destroy:o,after_update:a}=t.$$;i&&i.m(e,n),s||Ut(()=>{const e=r.map(ht).filter(mt);o?o.push(...e):pt(e),t.$$.on_mount=[]}),a.forEach(Ut)}function ue(t,e){const n=t.$$;null!==n.fragment&&(pt(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function de(t,e){-1===t.$$.dirty[0]&&(Ft.push(t),zt||(zt=!0,jt.then(Jt)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function he(t,e,n,s,i,r,o,a=[-1]){const l=Ht;Dt(t);const c=t.$$={fragment:null,ctx:null,props:r,update:ct,not_equal:i,bound:{},on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(l?l.$$.context:[])),callbacks:{},dirty:a,skip_bound:!1,root:e.target||l.$$.root};o&&o(c.root);let u=!1;c.ctx=n?n(t,e.props||{},(e,n,...s)=>{const r=s.length?s[0]:n;return c.ctx&&i(c.ctx[e],c.ctx[e]=r)&&(!c.skip_bound&&c.bound[e]&&c.bound[e](r),u&&de(t,e)),n}):[],c.update(),u=!0,pt(c.before_update),c.fragment=!!s&&s(c.ctx),e.target&&(c.fragment&&c.fragment.c(),ce(t,e.target,e.anchor,e.customElement),Jt()),Dt(l)}class pe{$destroy(){ue(this,1),this.$destroy=ct}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}function me(t){const e=t-1;return e*e*e+1}function fe(t,{delay:e=0,duration:n=400,easing:s=me,x:i=0,y:r=0,opacity:o=0}={}){const a=getComputedStyle(t),l=+a.opacity,c="none"===a.transform?"":a.transform,u=l*(1-o);return{delay:e,duration:n,easing:s,css:(t,e)=>`\n\t\t\ttransform: ${c} translate(${(1-t)*i}px, ${(1-t)*r}px);\n\t\t\topacity: ${l-u*e}`}}const ge=[];function ve(t,e=ct){let n;const s=new Set;function i(e){if(ft(t,e)&&(t=e,n)){const e=!ge.length;for(const e of s)e[1](),ge.push(e,t);if(e){for(let t=0;t<ge.length;t+=2)ge[t][0](ge[t+1]);ge.length=0}}}return{set:i,update:function(e){i(e(t))},subscribe:function(r,o=ct){const a=[r,o];return s.add(a),1===s.size&&(n=e(i)||ct),r(t),()=>{s.delete(a),0===s.size&&(n(),n=null)}}}}function ye(t,e){if(t===e||t!=t)return()=>t;const n=typeof t;if(Array.isArray(t)){const n=e.map((e,n)=>ye(t[n],e));return t=>n.map(e=>e(t))}if("number"===n){const n=e-t;return e=>t+e*n}}function be(t,e={}){const n=ve(t);let s,i=t;function r(r,o){if(null==t)return n.set(t=r),Promise.resolve();i=r;let a=s,l=!1,{delay:c=0,duration:u=400,easing:d=ut,interpolate:h=ye}=dt(dt({},e),o);if(0===u)return a&&(a.abort(),a=null),n.set(t=i),Promise.resolve();const p=yt()+c;let m;return s=wt(e=>{if(e<p)return!0;l||(m=h(t,r),"function"==typeof u&&(u=u(t,r)),l=!0),a&&(a.abort(),a=null);const s=e-p;return s>u?(n.set(t=r),!1):(n.set(t=m(d(s/u))),!0)}),s.promise}return{set:r,update:(e,n)=>r(e(i,t),n),subscribe:n.subscribe}}const Ee=ve(0),Se=globalThis.matchMedia?.("(prefers-reduced-motion: reduce)").matches,we=t=>({easing:me,duration:Se?0:t}),xe=t=>!t.thumb||`url(${t.thumb})`,Le=(t,e)=>{if(e){"string"==typeof e&&(e=JSON.parse(e));for(const n in e)t.setAttribute(n,e[n])}};function ke(t){let e,n,s;return{c(){e=Ct("div"),e.innerHTML='<span class="bp-bar"></span><span class="bp-o"></span>',$t(e,"class","bp-load"),Mt(e,"background-image",xe(t[0]))},m(t,n){Lt(t,e,n),s=!0},p(t,n){1&n&&Mt(e,"background-image",xe(t[0]))},i(t){s||(n&&n.end(1),s=!0)},o(t){t&&(n=ae(e,fe,{duration:480})),s=!1},d(t){t&&kt(e),t&&n&&n.end()}}}function Ce(t){let e,n;return{c(){e=Ct("div"),$t(e,"class","bp-load"),Mt(e,"background-image",xe(t[0]))},m(t,n){Lt(t,e,n)},p(t,n){1&n&&Mt(e,"background-image",xe(t[0]))},i(t){n||Ut(()=>{n=oe(e,fe,{duration:480}),n.start()})},o:ct,d(t){t&&kt(e)}}}function Pe(t){let e,n,s=!t[1]&&ke(t),i=t[2]&&Ce(t);return{c(){s&&s.c(),e=Pt(),i&&i.c(),n=Pt()},m(t,r){s&&s.m(t,r),Lt(t,e,r),i&&i.m(t,r),Lt(t,n,r)},p(t,[r]){t[1]?s&&(ee(),ie(s,1,1,()=>{s=null}),ne()):s?(s.p(t,r),2&r&&se(s,1)):(s=ke(t),s.c(),se(s,1),s.m(e.parentNode,e)),t[2]?i?(i.p(t,r),4&r&&se(i,1)):(i=Ce(t),i.c(),se(i,1),i.m(n.parentNode,n)):i&&(i.d(1),i=null)},i(t){se(s),se(i)},o(t){ie(s)},d(t){s&&s.d(t),t&&kt(e),i&&i.d(t),t&&kt(n)}}}function Be(t,e,n){let s;gt(t,Ee,t=>n(2,s=t));let{activeItem:i}=e,{loaded:r}=e;return t.$$set=t=>{"activeItem"in t&&n(0,i=t.activeItem),"loaded"in t&&n(1,r=t.loaded)},[i,r,s]}class $e extends pe{constructor(t){super(),he(this,t,Be,Pe,ft,{activeItem:0,loaded:1})}}function Me(t){let e,n,s,i,r,o;return{c(){e=Ct("img"),$t(e,"sizes",n=t[8].sizes||`${t[1]}px`),$t(e,"alt",t[7].alt)},m(n,s){Lt(n,e,s),i=!0,r||(o=[vt(t[21].call(null,e)),Bt(e,"error",t[27])],r=!0)},p(t,s){(!i||2&s[0]&&n!==(n=t[8].sizes||`${t[1]}px`))&&$t(e,"sizes",n)},i(t){i||(s&&s.end(1),i=!0)},o(t){s=ae(e,fe,{}),i=!1},d(t){t&&kt(e),t&&s&&s.end(),r=!1,pt(o)}}}function Te(t){let e,n;return e=new $e({props:{activeItem:t[7],loaded:t[2]}}),{c(){le(e.$$.fragment)},m(t,s){ce(e,t,s),n=!0},p(t,n){const s={};4&n[0]&&(s.loaded=t[2]),e.$set(s)},i(t){n||(se(e.$$.fragment,t),n=!0)},o(t){ie(e.$$.fragment,t),n=!1},d(t){ue(e,t)}}}function Ae(t){let e,n,s,i,r,o,a=`translate3d(${t[0][0]/-2+t[6][0]}px, ${t[0][1]/-2+t[6][1]}px, 0)`,l=t[2]&&Me(t),c=t[3]&&Te(t);return{c(){e=Ct("div"),n=Ct("div"),l&&l.c(),s=Pt(),c&&c.c(),$t(n,"class","bp-img"),Mt(n,"width",t[0][0]+"px"),Mt(n,"height",t[0][1]+"px"),Tt(n,"bp-drag",t[4]),Tt(n,"bp-canzoom",t[11]>1&&t[0][0]<t[12]),Mt(n,"background-image",xe(t[7])),Mt(n,"transform",a),$t(e,"class","bp-img-wrap"),Tt(e,"bp-close",t[5])},m(a,u){Lt(a,e,u),xt(e,n),l&&l.m(n,null),xt(n,s),c&&c.m(n,null),i=!0,r||(o=[vt(t[20].call(null,n)),Bt(e,"wheel",t[15]),Bt(e,"pointerdown",t[16]),Bt(e,"pointermove",t[17]),Bt(e,"pointerup",t[19]),Bt(e,"pointercancel",t[18])],r=!0)},p(t,r){t[2]?l?(l.p(t,r),4&r[0]&&se(l,1)):(l=Me(t),l.c(),se(l,1),l.m(n,s)):l&&(ee(),ie(l,1,1,()=>{l=null}),ne()),t[3]?c?(c.p(t,r),8&r[0]&&se(c,1)):(c=Te(t),c.c(),se(c,1),c.m(n,null)):c&&(ee(),ie(c,1,1,()=>{c=null}),ne()),(!i||1&r[0])&&Mt(n,"width",t[0][0]+"px"),(!i||1&r[0])&&Mt(n,"height",t[0][1]+"px"),(!i||16&r[0])&&Tt(n,"bp-drag",t[4]),(!i||6145&r[0])&&Tt(n,"bp-canzoom",t[11]>1&&t[0][0]<t[12]),65&r[0]&&a!==(a=`translate3d(${t[0][0]/-2+t[6][0]}px, ${t[0][1]/-2+t[6][1]}px, 0)`)&&Mt(n,"transform",a),(!i||32&r[0])&&Tt(e,"bp-close",t[5])},i(t){i||(se(l),se(c),i=!0)},o(t){ie(l),ie(c),i=!1},d(t){t&&kt(e),l&&l.d(),c&&c.d(),r=!1,pt(o)}}}function He(t,e,n){let s,i,r,o;gt(t,Ee,t=>
7n(26,r=t));let{props:a}=e,{smallScreen:l}=e,{activeItem:c,opts:u,prev:d,next:h,zoomed:p,container:m}=a;gt(t,p,t=>n(25,s=t));let f,g,v,y,b,E,S,w,x,L,k,C=c.maxZoom||u.maxZoom||10,P=a.calculateDimensions(c),B=P[0],$=0;const M=+c.width,T=[],A=new Map,H=be(P,we(400));gt(t,H,t=>n(0,o=t));const I=be([0,0],we(400));gt(t,I,t=>n(6,i=t));const q=([t,e],s=o)=>{const i=(s[0]-m.w)/2,r=(s[1]-m.h)/2;return i<0?t=0:t>i?l?(t=b?i+(t-i)/10:i)>i+20&&n(4,b=d()):t=i:t<-i&&(l?(t=b?-i-(-i-t)/10:-i)<-i-20&&n(4,b=h()):t=-i),r<0?e=0:e>r?e=r:e<-r&&(e=-r),[t,e]};function _(t=C,e){if(r)return;const s=P[0]*C;let a=o[0]+o[0]*t,l=o[1]+o[1]*t;if(t>0)a>s&&(a=s,l=P[1]*C),a>M&&(a=M,l=+c.height);else if(a<P[0])return H.set(P),I.set([0,0]);let{x:u,y:d,width:h,height:p}=y.getBoundingClientRect();const m=e?e.clientX-u-h/2:0,f=e?e.clientY-d-p/2:0;u=a/h*-m+m,d=l/p*-f+f;const g=[a,l];H.set(g).then(()=>{n(1,B=Math.round(Math.max(B,a)))}),I.set(q([i[0]+u,i[1]+d],g))}Object.defineProperty(c,"zoom",{configurable:!0,get:()=>s,set:t=>_(t?C:-C)});const N=t=>{const[e,n]=A.set(t.pointerId,t).values(),s=e.clientX-n.clientX,i=e.clientY-n.clientY,r=Math.hypot(s,i);v=v||{clientX:(e.clientX+n.clientX)/2,clientY:(e.clientY+n.clientY)/2},_((($||r)-r)/-35,v),$=r},D=t=>A.delete(t.pointerId);return t.$$set=t=>{"smallScreen"in t&&n(23,l=t.smallScreen)},t.$$.update=()=>{if(16777217&t.$$.dirty[0]&&p.set(o[0]-10>P[0]),117440512&t.$$.dirty[0]&&r&&s&&!u.intro){const t=we(480);I.set([0,0],t),H.set(P,t),n(5,k=!0)}},[o,B,f,g,b,k,i,c,u,p,m,C,M,H,I,t=>{u.inline&&!s||(t.preventDefault(),_(t.deltaY/-300,t))},t=>{2!==t.button&&(t.preventDefault(),n(4,b=!0),A.set(t.pointerId,t),S=t.clientX,w=t.clientY,x=i[0],L=i[1])},t=>{if(A.size>1)return n(4,b=!1),u.noPinch?.(m.el)||N(t);if(!b)return;let e=t.clientX,i=t.clientY;T.push({x:e,y:i}),E||=Math.hypot(e-S,i-w)>5,e-=S,i-=w,s||(i<-90&&n(4,b=!u.noClose&&a.close()),Math.abs(i)<30&&(e>40&&n(4,b=d()),e<-40&&n(4,b=h()))),s&&E&&!r&&I.set(q([x+e,L+i]),{duration:0})},D,function(t){if(D(t),v&&(n(4,b=$=0),v=A.size?v:null),b){if(n(4,b=!1),t.target===this&&!u.noClose)return a.close();if(E){const[t,e,n]=T.slice(-3),s=e.x-n.x,r=e.y-n.y;Math.hypot(s,r)>5&&I.set(q([i[0]-5*(t.x-n.x),i[1]-5*(t.y-n.y)]))}else u.onImageClick?.(m.el,c)||_(s?-C:C,t);E=!1,T.length=0}},t=>{y=t,a.setResizeFunc(()=>{n(24,P=a.calculateDimensions(c)),!u.inline&&l||(H.set(P),I.set([0,0]))}),a.loadImage(c).then(()=>{n(2,f=!0),a.preloadNext()}),setTimeout(()=>{n(3,g=!f)},250)},t=>{Le(t,c.attr),t.srcset=c.img},a,l,P,s,r,t=>u.onError?.(m,c,t)]}class Ie extends pe{constructor(t){super(),he(this,t,He,Ae,ft,{props:22,smallScreen:23},null,[-1,-1])}}function qe(t){let e,n,s,i,r,o;return s=new $e({props:{activeItem:t[2],loaded:t[0]}}),{c(){e=Ct("div"),n=Ct("iframe"),le(s.$$.fragment),$t(n,"allow","autoplay; fullscreen"),$t(n,"title",t[2].title),$t(e,"class","bp-if"),Mt(e,"width",t[1][0]+"px"),Mt(e,"height",t[1][1]+"px")},m(a,l){Lt(a,e,l),xt(e,n),ce(s,e,null),i=!0,r||(o=[vt(t[3].call(null,n)),Bt(n,"load",t[5])],r=!0)},p(t,[n]){const r={};1&n&&(r.loaded=t[0]),s.$set(r),(!i||2&n)&&Mt(e,"width",t[1][0]+"px"),(!i||2&n)&&Mt(e,"height",t[1][1]+"px")},i(t){i||(se(s.$$.fragment,t),i=!0)},o(t){ie(s.$$.fragment,t),i=!1},d(t){t&&kt(e),ue(s),r=!1,pt(o)}}}function _e(t,e,n){let s,i,{props:r}=e;const{activeItem:o}=r,a=()=>n(1,i=r.calculateDimensions(o));a(),r.setResizeFunc(a);return[s,i,o,t=>{Le(t,o.attr),t.src=o.iframe},r,()=>n(0,s=!0)]}class Ne extends pe{constructor(t){super(),he(this,t,_e,qe,ft,{props:4})}}function De(t){let e,n,s,i,r;return n=new $e({props:{activeItem:t[2],loaded:t[0]}}),{c(){e=Ct("div"),le(n.$$.fragment),$t(e,"class","bp-vid"),Mt(e,"width",t[1][0]+"px"),Mt(e,"height",t[1][1]+"px"),Mt(e,"background-image",xe(t[2]))},m(o,a){Lt(o,e,a),ce(n,e,null),s=!0,i||(r=vt(t[3].call(null,e)),i=!0)},p(t,[i]){const r={};1&i&&(r.loaded=t[0]),n.$set(r),(!s||2&i)&&Mt(e,"width",t[1][0]+"px"),(!s||2&i)&&Mt(e,"height",t[1][1]+"px")},i(t){s||(se(n.$$.fragment,t),s=!0)},o(t){ie(n.$$.fragment,t),s=!1},d(t){t&&kt(e),ue(n),i=!1,r()}}}function Fe(t,e,n){let s,i,{props:r}=e;const{activeItem:o,opts:a,container:l}=r,c=()=>n(1,i=r.calculateDimensions(o));c(),r.setResizeFunc(c);return[s,i,o,t=>{let e;const i=(t,n)=>{Array.isArray(n)||(n=JSON.parse(n));for(const s of n){e||(e=document.createElement(s.type?.includes("audio")?"audio":"video"),Le(e,{controls:!0,autoplay:!0,playsinline:!0,tabindex:"0"}),Le(e,o.attr));const n=document.createElement(t);Le(n,s),"source"==t&&(n.onError=t=>a.onError?.(l,o,t)),e.append(n)}};i("source",o.sources),i("track",o.tracks||[]),e.oncanplay=()=>n(0,s=!0),t.append(e)},r]}class Re extends pe{constructor(t){super(),he(this,t,Fe,De,ft,{props:4})}}function Oe(t){let e,n,s,i,r,o,a,l,c,u=t[6].i,d=Ge(t),h=t[0].length>1&&We(t);return{c(){e=Ct("div"),n=Ct("div"),d.c(),i=Ct("div"),r=Ct("button"),h&&h.c(),$t(r,"class","bp-x"),$t(r,"title","Close"),$t(r,"aria-label","Close"),$t(i,"class","bp-controls"),$t(e,"class","bp-wrap"),Tt(e,"bp-zoomed",t[10]),Tt(e,"bp-inline",t[8]),Tt(e,"bp-small",t[7]),Tt(e,"bp-noclose",t[5].noClose)},m(s,o){Lt(s,e,o),xt(e,n),d.m(e,null),xt(e,i),xt(i,r),h&&h.m(i,null),a=!0,l||(c=[Bt(r,"click",t[1]),vt(t[14].call(null,e))],l=!0)},p(t,n){64&n[0]&&ft(u,u=t[6].i)?(ee(),ie(d,1,1,ct),ne(),d=Ge(t),d.c(),se(d,1),d.m(e,i)):d.p(t,n),t[0].length>1?h?h.p(t,n):(h=We(t),h.c(),h.m(i,null)):h&&(h.d(1),h=null),(!a||1024&n[0])&&Tt(e,"bp-zoomed",t[10]),(!a||256&n[0])&&Tt(e,"bp-inline",t[8]),(!a||128&n[0])&&Tt(e,"bp-small",t[7]),(!a||32&n[0])&&Tt(e,"bp-noclose",t[5].noClose)},i(t){a||(s&&s.end(1),se(d),o&&o.end(1),a=!0)},o(t){t&&(s=ae(n,fe,{duration:480})),ie(d),t&&(o=ae(i,fe,{})),a=!1},d(t){t&&kt(e),t&&s&&s.end(),d.d(t),h&&h.d(),t&&o&&o.end(),l=!1,pt(c)}}}function Ve(t){let e,n=(t[6].html??t[6].element.outerHTML)+"";return{c(){e=Ct("div"),$t(e,"class","bp-html")},m(t,s){Lt(t,e,s),e.innerHTML=n},p(t,s){64&s[0]&&n!==(n=(t[6].html??t[6].element.outerHTML)+"")&&(e.innerHTML=n)},i:ct,o:ct,d(t){t&&kt(e)}}}function je(t){let e,n;return e=new Ne({props:{props:t[13]()}}),{c(){le(e.$$.fragment)},m(t,s){ce(e,t,s),n=!0},p:ct,i(t){n||(se(e.$$.fragment,t),n=!0)},o(t){ie(e.$$.fragment,t),n=!1},d(t){ue(e,t)}}}function ze(t){let e,n;return e=new Re({props:{props:t[13]()}}),{c(){le(e.$$.fragment)},m(t,s){ce(e,t,s),n=!0},p:ct,i(t){n||(se(e.$$.fragment,t),n=!0)},o(t){ie(e.$$.fragment,t),n=!1},d(t){ue(e,t)}}}function Ue(t){let e,n;return e=new Ie({props:{props:t[13](),smallScreen:t[7]}}),{c(){le(e.$$.fragment)},m(t,s){ce(e,t,s),n=!0},p(t,n){const s={};128&n[0]&&(s.smallScreen=t[7]),e.$set(s)},i(t){n||(se(e.$$.fragment,t),n=!0)},o(t){ie(e.$$.fragment,t),n=!1},d(t){ue(e,t)}}}function Ze(t){let e,n,s,i=t[6].caption+"";return{c(){e=Ct("div"),$t(e,"class","bp-cap")},m(t,n){Lt(t,e,n),e.innerHTML=i,s=!0},p(t,n){(!s||64&n[0])&&i!==(i=t[6].caption+"")&&(e.innerHTML=i)},i(t){s||(n&&n.end(1),s=!0)},o(t){n=ae(e,fe,{duration:200}),s=!1},d(t){t&&kt(e),t&&n&&n.end()}}}function Ge(t){let e,n,s,i,r,o,a,l,c;const u=[Ue,ze,je,Ve],d=[];function h(t,e){return t[6].img?0:t[6].sources?1:t[6].iframe?2:3}n=h(t),s=d[n]=u[n](t);let p=t[6].caption&&Ze(t);return{c(){e=Ct("div"),s.c(),p&&p.c(),o=Pt(),$t(e,"class","bp-inner")},m(s,i){Lt(s,e,i),d[n].m(e,null),p&&p.m(s,i),Lt(s,o,i),a=!0,l||(c=[Bt(e,"pointerdown",t[20]),Bt(e,"pointerup",t[21])],l=!0)},p(t,i){let r=n;n=h(t),n===r?d[n].p(t,i):(ee(),ie(d[r],1,1,()=>{d[r]=null}),ne(),s=d[n],s?s.p(t,i):(s=d[n]=u[n](t),s.c()),se(s,1),s.m(e,null)),t[6].caption?p?(p.p(t,i),64&i[0]&&se(p,1)):(p=Ze(t),p.c(),se(p,1),p.m(o.parentNode,o)):p&&(ee(),ie(p,1,1,()=>{p=null}),ne())},i(n){a||(se(s),Ut(()=>{r&&r.end(1),i=oe(e,t[12],!0),i.start()}),se(p),a=!0)},o(n){ie(s),i&&i.invalidate(),r=ae(e,t[12],!1),ie(p),a=!1},d(t){t&&kt(e),d[n].d(),t&&r&&r.end(),p&&p.d(t),t&&kt(o),l=!1,pt(c)}}}function We(t){let e,n,s,i,r,o=`${t[4]+1} / ${t[0].length}`;return{c(){e=Ct("div"),n=Ct("button"),s=Ct("button"),$t(e,"class","bp-count"),$t(n,"class","bp-prev"),$t(n,"title","Previous"),$t(n,"aria-label","Previous"),$t(s,"class","bp-next"),$t(s,"title","Next"),$t(s,"aria-label","Next")},m(a,l){Lt(a,e,l),e.innerHTML=o,Lt(a,n,l),Lt(a,s,l),i||(r=[Bt(n,"click",t[2]),Bt(s,"click",t[3])],i=!0)},p(t,n){17&n[0]&&o!==(o=`${t[4]+1} / ${t[0].length}`)&&(e.innerHTML=o)},d(t){t&&kt(e),t&&kt(n),t&&kt(s),i=!1,pt(r)}}}function Je(t){let e,n,s=t[0]&&Oe(t);return{c(){s&&s.c(),e=Pt()},m(t,i){s&&s.m(t,i),Lt(t,e,i),n=!0},p(t,n){t[0]?s?(s.p(t,n),1&n[0]&&se(s,1)):(s=Oe(t),s.c(),se(s,1),s.m(e.parentNode,e)):s&&(ee(),ie(s,1,1,()=>{s=null}),ne())},i(t){n||(se(s),n=!0)},o(t){ie(s),n=!1},d(t){s&&s.d(t),t&&kt(e)}}}function Xe(t,e,n){let s,{items:i}=e,{target:r}=e;const o=document.documentElement;let a,l,c,u,d,h,p,m,f;const g=()=>!f.img&&!f.sources&&!f.iframe;let v;const y=t=>v=t,b={},E=ve(0);gt(t,E,t=>n(10,s=t));const S=()=>{l.onClose?.(b.el,f),Ee.set(!0),n(0,i=null),u?.focus({preventScroll:!0})},w=()=>L(a-1),x=()=>L(a+1),L=t=>{p=t-a,n(4,a=k(t))},k=t=>(t+i.length)%i.length,C=t=>{const{key:e,shiftKey:n}=t;if("Escape"===e)!l.noClose&&S();else if("ArrowRight"===e)x();else if("ArrowLeft"===e)w();else if("Tab"===e){const{activeElement:e}=document;if(n||!e.controls){t.preventDefault();const{focusWrap:s=b.el}=l,i=[...s.querySelectorAll("*")].filter(t=>t.tabIndex>=0);let r=i.indexOf(e);r+=i.length+(n?-1:1),i[r%i.length].focus()}}},P=({width:t=1920,height:e=1080})=>{const{scale:n=.99}=l,s=Math.min(1,b.w/t*n,b.h/e*n);return[Math.round(t*s),Math.round(e*s)]},B=()=>
7{if(i){const t=i[k(a+1)],e=i[k(a-1)];!t.preload&&$(t),!e.preload&&$(e)}},$=t=>{if(t.img){const e=document.createElement("img");return e.sizes=l.sizes||`${P(t)[0]}px`,e.srcset=t.img,t.preload=!0,e.decode().catch(t=>{})}},M=t=>{let e;if(g()){const n=t.firstChild.firstChild;e=[n.clientWidth,n.clientHeight]}else e=P(f);const n=(f.element||u).getBoundingClientRect(),s=n.left-(b.w-n.width)/2,i=n.top-(b.h-n.height)/2,r=n.width/e[0],o=n.height/e[1];return{duration:480,easing:me,css:(t,e)=>`transform:translate3d(${s*e}px, ${i*e}px, 0) scale3d(${r+t*(1-r)}, ${o+t*(1-o)}, 1)`}};return t.$$set=t=>{"items"in t&&n(0,i=t.items),"target"in t&&n(15,r=t.target)},t.$$.update=()=>{786545&t.$$.dirty[0]&&i&&(n(6,f=i[a]),c&&l.onUpdate?.(b.el,f))},[i,S,w,x,a,l,f,d,h,m,s,E,(t,e)=>c&&i?fe(t,{x:(p>0?20:-20)*(e?1:-1),duration:250}):(n(18,c=e),l.intro?fe(t,{y:e?10:-10}):M(t)),()=>({activeItem:f,calculateDimensions:P,loadImage:$,preloadNext:B,opts:l,prev:w,next:x,close:S,setResizeFunc:y,zoomed:E,container:b}),t=>{let e;n(19,b.el=t,b),l.onOpen?.(b.el,f),h||globalThis.addEventListener("keydown",C);const s=new ResizeObserver(t=>{e&&(n(19,b.w=t[0].contentRect.width,b),n(19,b.h=t[0].contentRect.height,b),n(7,d=b.w<769),g()||v?.(),l.onResize?.(b.el,f)),e=!0});return s.observe(t),{destroy(){s.disconnect(),globalThis.removeEventListener("keydown",C),Ee.set(!1),o.classList.remove("bp-lock"),l.onClosed?.()}}},r,t=>{n(5,l=t),n(8,h=l.inline),!h&&o.scrollHeight>o.clientHeight&&o.classList.add("bp-lock"),u=document.activeElement,n(19,b.w=r.offsetWidth,b),n(19,b.h=r===document.body?globalThis.innerHeight:r.clientHeight,b),n(7,d=b.w<769),n(4,a=l.position||0),n(0,i=[]);for(let t=0;t<(l.items.length||1);t++){let e=l.items[t]||l.items;"dataset"in e?i.push({element:e,i:t,...e.dataset}):(e.i=t,i.push(e),e=e.element),l.el&&l.el===e&&n(4,a=t)}},L,c,b,t=>n(9,m=t.target),function(t){2!==t.button&&t.target===this&&m===this&&!l.noClose&&S()}]}class Ye extends pe{constructor(t){super(),he(this,t,Xe,Je,ft,{items:0,target:15,open:16,close:1,prev:2,next:3,setPosition:17},null,[-1,-1])}get items(){return this.$$.ctx[0]}get target(){return this.$$.ctx[15]}get open(){return this.$$.ctx[16]}get close(){return this.$$.ctx[1]}get prev(){return this.$$.ctx[2]}get next(){return this.$$.ctx[3]}get setPosition(){return this.$$.ctx[17]}}class Qe extends HTMLElement{constructor(){var t;super(),this.imageLinks=[...this.querySelectorAll('[data-ref="galleryImageLink"]')],this.bp=(t={target:document.body},new Ye({...t,props:t})),this.imageClickHandler=this.openGallery.bind(this)}connectedCallback(){this.initGallery()}disconnectedCallback(){for(let t of this.imageLinks)t.removeEventListener("click",this.imageClickHandler);this.bp.$destroy?.(),this.bp=null}initGallery(){for(let t of this.imageLinks)t.addEventListener("click",this.imageClickHandler)}openGallery(t){t.preventDefault(),this.bp.open({items:this.imageLinks,el:t.currentTarget,intro:"fadeUp"})}}class Ke extends HTMLElement{constructor(){super(),this.checkbox=this.querySelector('[data-ref="filterDrawerCheckbox"]'),this.filterCheckbox=[...this.querySelectorAll('[data-ref="filter-value-checkbox"]')],this.handleState=this.toggleQueryParam.bind(this),this.handleFilterCheckboxes=this.reloadGraphene.bind(this)}connectedCallback(){this.checkbox&&this.checkbox.addEventListener("change",this.handleState),this.addGrapheneListeners()}disconnectedCallback(){this.checkbox&&this.handleState&&this.checkbox.removeEventListener("change",this.handleState),this.handleState=null}toggleQueryParam(t){const e=new URLSearchParams(location.search);this.checkbox.checked||(e.delete("drawer"),window.location.search=e)}addGrapheneListeners(){for(let t of this.filterCheckbox)t.addEventListener("change",this.handleFilterCheckboxes)}reloadGraphene(t){const e=new URLSearchParams(location.search).get("drawer");this.checkbox.checked?e?window.graphenehc.reload({url:`${t.target.value}`}):window.graphenehc.reload({url:`${t.target.value}&drawer=open`}):window.graphenehc.reload({url:`${t.target.value}`})}}class tn extends HTMLElement{constructor(){super(),this.minRange=this.querySelector('[data-ref="minRange"]'),this.maxRange=this.querySelector('[data-ref="maxRange"]'),this.minValue=this.querySelector('[data-ref="minValue"]'),this.maxValue=this.querySelector('[data-ref="maxValue"]'),this.rangeTrack=this.querySelector('[data-ref="rangeTrack"]'),this.minGap=10,this.updateHandler=this.updateRange.bind(this),this.initialLoad=!0}connectedCallback(){this.minRange.addEventListener("change",this.updateHandler),this.maxRange.addEventListener("change",this.updateHandler),this.updateRange()}disconnectedCallback(){this.minRange.removeEventListener("change",this.updateHandler),this.maxRange.removeEventListener("change",this.updateHandler)}updateRange(){let t=parseInt(this.minRange.value),e=parseInt(this.maxRange.value);e-t<this.minGap&&(event.target===this.minRange?this.minRange.value=e-this.minGap:this.maxRange.value=t+this.minGap),this.minValue.innerText=this.minRange.value,this.maxValue.innerText=this.maxRange.value;const n=this.minRange.value-parseInt(this.maxRange.getAttribute("min")),s=parseInt(this.maxRange.getAttribute("max"))-parseInt(this.maxRange.getAttribute("min"));let i=n/s*100,r=(this.maxRange.value-parseInt(this.maxRange.getAttribute("min")))/s*100;this.rangeTrack.style.left=i+"%",this.rangeTrack.style.right=100-r+"%";let o=new URLSearchParams(window.location.search);o.set("price",`${t}~${e}`),o.set("drawer","open"),this.initialLoad||graphenehc.reload({url:`${window.location.pathname}?${o.toString()}`}),this.initialLoad=!1}}class en extends HTMLElement{constructor(){super(),this.loadMoreButton=this.querySelector('[data-ref="loadMoreButton"]'),this.loadingSpinner=this.querySelector('[data-ref="loadingSpinner"]'),this.handleLoadMoreClick=this.handleLoadMore.bind(this)}connectedCallback(){this.loadMoreButton.addEventListener("click",this.handleLoadMoreClick),graphenehc.load({template:{id:"category",target:"#graphene-collection-
7products"},page_context:{category_id:"{{ collection.id }}"},success:t=>{t.templates.category.current_page>=t.templates.category.page_count?this.loadMoreButton?.classList.add("hidden"):this.loadMoreButton?.classList.remove("hidden")}})}disconnectedCallback(){this.loadMoreButton.removeEventListener("click",this.handleLoadMoreClick)}handleLoadMore(){this.loadingSpinner?.classList.remove("hidden"),graphenehc.load_page({target:{selector:"[data-ref='collectionProducts']",position:"beforeend"},track_page:!0,set_page_url:!0,init:t=>{console.log(t)},success:t=>{console.log(t),this.loadingSpinner?.classList.add("hidden")},last_page:t=>{this.loadMoreButton?.classList.add("hidden")}})}}class nn extends HTMLElement{constructor(){super(),this.product=JSON.parse(this.getAttribute("product")),this.quantitySelector=this.querySelector("quantity-selector"),this.productPrice=this.querySelector("product-price"),this.updateTotalPriceHandler=t=>{this.updateTotalPrice(t.detail.quantity)}}connectedCallback(){this.quantitySelector&&this.quantitySelector.addEventListener("quantity-changed",this.updateTotalPriceHandler)}updateTotalPrice(t){this.productPrice&&(this.productPrice.updatePrice(t),this.setAttribute("data-total-price",`${this.productPrice.price}`)),this.dispatchEvent(new CustomEvent("product-set-item-changed",{detail:{id:this.product.id,title:this.product.title,price:this.product.price,quantity:Number(t),available:this.product.available},bubbles:!0,composed:!0}))}}class sn extends HTMLElement{constructor(){super(),this.totalPriceElement=this.querySelector('[data-ref="totalPrice"]'),this.updateHandler=this.updatePrice.bind(this),this.singlePrice=this.getAttribute("single-price"),this.totalPrice=this.singlePrice,this.displayZero=this.getAttribute("display-zero")}connectedCallback(){}get price(){return this.totalPrice}updatePrice(t){this.totalPrice=this.singlePrice*t,this.totalPriceElement&&this.singlePrice&&(this.totalPriceElement.innerText=`${e(this.singlePrice*t,"£{{amount_no_decimals}}")}`,this.displayZero||0!=t?this.classList.remove("hidden"):this.classList.add("hidden"))}}class rn extends HTMLElement{constructor(){super(),this.searchInput=this.querySelector('[data-ref="searchInput"]'),this.searchResultsElement=this.querySelector('[data-ref="resultsElement"]'),this.searchCloseButton=this.querySelector('[data-ref="searchCloseButton"]'),this.menuCloseInput=document.querySelector('[data-ref="menuToggle"]'),this.handleSearchFocus=this.openResults.bind(this),this.handleSearchClose=this.closeResults.bind(this),this.handleMenuClose=this.closeResults.bind(this)}connectedCallback(){this.searchInput&&this.searchInput.addEventListener("focus",this.handleSearchFocus),this.searchCloseButton&&this.searchCloseButton.addEventListener("click",this.handleSearchClose),this.menuCloseInput&&this.menuCloseInput.addEventListener("change",this.handleMenuClose)}disconnectedCallback(){this.searchInput&&this.searchInput.removeEventListener("focus",this.handleSearchFocus),this.searchCloseButton&&this.searchCloseButton.removeEventListener("click",this.handleSearchClose),this.menuCloseInput&&this.menuCloseInput.removeEventListener("change",this.handleMenuClose)}openResults(){this.searchResultsElement.classList.remove("hidden")}closeResults(){this.searchResultsElement.classList.add("hidden")}}class on extends HTMLElement{constructor(){super(),this.loadMoreButton=this.querySelector('[data-ref="loadMoreButton"]'),this.loadingSpinner=this.querySelector('[data-ref="loadingSpinner"]'),this.handleLoadMoreClick=this.handleLoadMore.bind(this),this.searchText=this.getAttribute("search-text")}connectedCallback(){this.loadMoreButton.addEventListener("click",this.handleLoadMoreClick),graphenehc.load({template:{id:"search",target:"#Results"},page_context:{search_text:`${this.searchText}`},success:t=>{t.templates.search.current_page>=t.templates.search.page_count?this.loadMoreButton?.classList.add("hidden"):this.loadMoreButton?.classList.remove("hidden")}})}disconnectedCallback(){this.loadMoreButton.removeEventListener("click",this.handleLoadMoreClick)}handleLoadMore(){this.loadingSpinner?.classList.remove("hidden"),graphenehc.load_page({target:{selector:"[data-ref='collectionProducts']",position:"beforeend"},track_page:!0,set_page_url:!0,init:t=>{console.log(t)},success:t=>{console.log(t),this.loadingSpinner?.classList.add("hidden")},last_page:t=>{this.loadMoreButton?.classList.add("hidden")}})}}customElements.define("product-form",n),customElements.define("cart-item",s),customElements.define("cart-count",i),customElements.define("countdown-timer",r),customElements.define("carousel-slider",z),customElements.define("featured-products",U),customElements.define("collection-categories",G),customElements.define("quantity-selector",W),customElements.define("video-player",lt),customElements.define("product-gallery",Qe),customElements.define("site-header",Z),customElements.define("filter-checkbox",Ke),customElements.define("price-slider",tn),customElements.define("collection-listing",en),customElements.define("product-set-item",nn),customElements.define("product-price",sn),customElements.define("predictive-search",rn),customElements.define("search-listing",on);
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.