1import{g as ue,a as Fe,w as Se,e as U,i as ot}from"./ScrollTrigger.js";import{N as Wn}from"./navigation.js";import{P as jn}from"./pagination.js";import{a as Za,m as Re,r as _,n as Pe,c as Jn,w as De,o as Kn}from"./vue.esm-bundler.js";import{u as Qn,v as Wt,g as Ia,c as _a,f as eo}from"./analytics-data.js";import{u as Ya,F as Te,i as to,P as nt,c as Lt}from"./use-amplitude-experiment.js";import{u as ao,b as no}from"./use-focus-management.js";import{g as Ae,_ as oo,M as Ua,a as qa,b as Xa,c as ro}from"./matrix.js";import{b as Dt,A as Xe,a as io}from"./animations.js";import{u as ta}from"./use-modal.js";import{u as so}from"./use-post-atc-modal.js";import{P as lo}from"./use-product-section-visibility.js";import{u as co}from"./use-size-chart.js";import{u as Ma}from"./use-viewport-size.js";import{u as uo}from"./use-yotpo-composable.js";import{M as kt,G as po,H as fo,a as mo,A as ho,C as go,D as Ta,L as Nt,n as Pa}from"./wunderkind-api.js";import{b as vo,a as yo,A as bo,p as wo}from"./iterable.js";import{f as Ca}from"./currency.js";import{c as Eo,f as So,b as xa,d as Ao,n as Io,m as _o}from"./validator.js";import{g as Mo}from"./item-cart-properties.js";import{B as To,r as Po}from"./base-section.js";import{i as Co}from"./swiper.js";import"./create-element-if-not-defined.js";import"./swiper-core.js";import"./classes-to-selector.js";import"./use-scroll-lock.js";import"./cookies.js";import"./_commonjsHelpers.js";var xo=1,Je,le,W,rt,Ne,Ce,jt,Oa=function(e,t){return e.actions.forEach(function(a){return a.vars[t]&&a.vars[t](a)})},Jt={},La=180/Math.PI,Oo=Math.PI/180,bt={},Da={},St={},aa=function(e){return typeof e=="string"?e.split(" ").join("").split(","):e},Lo=aa("onStart,onUpdate,onComplete,onReverseComplete,onInterrupt"),At=aa("transform,transformOrigin,width,height,position,top,left,opacity,zIndex,maxWidth,maxHeight,minWidth,minHeight"),it=function(e){return Je(e)[0]||console.warn("Element not found:",e)},$e=function(e){return Math.round(e*1e4)/1e4||0},Rt=function(e,t,a){return e.forEach(function(o){return o.classList[a](t)})},ka={zIndex:1,kill:1,simple:1,spin:1,clearProps:1,targets:1,toggleClass:1,onComplete:1,onUpdate:1,onInterrupt:1,onStart:1,delay:1,repeat:1,repeatDelay:1,yoyo:1,scale:1,fade:1,absolute:1,props:1,onEnter:1,onLeave:1,custom:1,paused:1,nested:1,prune:1,absoluteOnLeave:1},$a={zIndex:1,simple:1,clearProps:1,scale:1,absolute:1,fitChild:1,getVars:1,props:1},Ha=function(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()},He=function(e,t){var a={},o;for(o in e)t[o]||(a[o]=e[o]);return a},na={},Wa=function(e){var t=na[e]=aa(e);return St[e]=t.concat(At),t},Do=function(e){var t=e._gsap||le.core.getCache(e);return t.gmCache===le.ticker.frame?t.gMatrix:(t.gmCache=le.ticker.frame,t.gMatrix=Ae(e,!0,!1,!0))},ko=function r(e,t,a){a===void 0&&(a=0);for(var o=e.parentNode,n=1e3*Math.pow(10,a)*(t?-1:1),i=t?-n*900:0;e;)i+=n,e=e.previousSibling;return o?i+r(o,t,a+1):i},wt=function(e,t,a){return e.forEach(function(o){return o.d=ko(a?o.element:o.t,t)}),e.sort(function(o,n){return o.d-n.d}),e},st=function(e,t){for(var a=e.element.style,o=e.css=e.css||[],n=t.length,i,l;n--;)i=t[n],l=a[i]||a.getPropertyValue(i),o.push(l?i:Da[i]||(Da[i]=Ha(i)),l);return a},Et=function(e){var t=e.css,a=e.element.style,o=0;for(e.cache.uncache=1;o<t.length;o+=2)t[o+1]?a[t[o]]=t[o+1]:a.removeProperty(t[o]);!t[t.indexOf("transform")+1]&&a.translate&&(a.removeProperty("translate"),a.removeProperty("scale"),a.removeProperty("rotate"))},Na=function(e,t){e.forEach(function(a){return a.a.cache.uncache=1}),t||e.finalStates.forEach(Et)},Vt="paddingTop,paddingRight,paddingBottom,paddingLeft,gridArea,transition".split(","),oa=function(e,t,a){var o=e.element,n=e.width,i=e.height,l=e.uncache,u=e.getProp,c=o.style,v=4,b,Y,G;if(typeof t!="object"&&(t=e),W&&a!==1)return W._abs.push({t:o,b:e,a:e,sd:0}),W._final.push(function(){return(e.cache.uncache=1)&&Et(e)}),o;for(Y=u("display")==="none",(!e.isVisible||Y)&&(Y&&(st(e,["display"]).display=t.display),e.matrix=t.matrix,e.width=n=e.width||t.width,e.height=i=e.height||t.height),st(e,Vt),G=window.getComputedStyle(o);v--;)c[Vt[v]]=G[Vt[v]];if(c.gridArea="1 / 1 / 1 / 1",c.transition="none",c.position="absolute",c.width=n+"px",c.height=i+"px",c.top||(c.top="0px"),c.left||(c.left="0px"),l)b=new Ge(o);else if(b=He(e,bt),b.position="absolute",e.simple){var R=o.getBoundingClientRect();b.matrix=new Ua(1,0,0,1,R.left+qa(),R.top+Xa())}
1else b.matrix=Ae(o,!1,!1,!0);return b=je(b,e,!0),e.x=Ce(b.x,.01),e.y=Ce(b.y,.01),o},Ra=function(e,t){return t!==!0&&(t=Je(t),e=e.filter(function(a){if(t.indexOf((a.sd<0?a.b:a.a).element)!==-1)return!0;a.t._gsap.renderTransform(1),a.b.isVisible&&(a.t.style.width=a.b.width+"px",a.t.style.height=a.b.height+"px")})),e},ja=function(e){return wt(e,!0).forEach(function(t){return(t.a.isVisible||t.b.isVisible)&&oa(t.sd<0?t.b:t.a,t.b,1)})},No=function(e,t){return t&&e.idLookup[Kt(t).id]||e.elementStates[0]},Kt=function(e,t,a,o){return e instanceof Ge?e:e instanceof be?No(e,o):new Ge(typeof e=="string"?it(e)||console.warn(e+" not found"):e,t,a)},Ro=function(e,t){for(var a=le.getProperty(e.element,null,"native"),o=e.props={},n=t.length;n--;)o[t[n]]=(a(t[n])+"").trim();return o.zIndex&&(o.zIndex=parseFloat(o.zIndex)||0),e},Ja=function(e,t){var a=e.style||e,o;for(o in t)a[o]=t[o]},Vo=function(e){var t=e.getAttribute("data-flip-id");return t||e.setAttribute("data-flip-id",t="auto-"+xo++),t},Ka=function(e){return e.map(function(t){return t.element})},Va=function(e,t,a){return e&&t.length&&a.add(e(Ka(t),a,new be(t,0,!0)),0)},je=function(e,t,a,o,n,i){var l=e.element,u=e.cache,c=e.parent,v=e.x,b=e.y,Y=t.width,G=t.height,R=t.scaleX,V=t.scaleY,z=t.rotation,Z=t.bounds,X=i&&jt&&jt(l,"transform,width,height"),T=e,$=t.matrix,w=$.e,C=$.f,O=e.bounds.width!==Z.width||e.bounds.height!==Z.height||e.scaleX!==R||e.scaleY!==V||e.rotation!==z,q=!O&&e.simple&&t.simple&&!n,L,P,D,p,d,F,A;return q||!c?(R=V=1,z=L=0):(d=Do(c),F=d.clone().multiply(t.ctm?t.matrix.clone().multiply(t.ctm):t.matrix),z=$e(Math.atan2(F.b,F.a)*La),L=$e(Math.atan2(F.c,F.d)*La+z)%360,R=Math.sqrt(Math.pow(F.a,2)+Math.pow(F.b,2)),V=Math.sqrt(Math.pow(F.c,2)+Math.pow(F.d,2))*Math.cos(L*Oo),n&&(n=Je(n)[0],p=le.getProperty(n),A=n.getBBox&&typeof n.getBBox=="function"&&n.getBBox(),T={scaleX:p("scaleX"),scaleY:p("scaleY"),width:A?A.width:Math.ceil(parseFloat(p("width","px"))),height:A?A.height:parseFloat(p("height","px"))}),u.rotation=z+"deg",u.skewX=L+"deg"),a?(R*=Y===T.width||!T.width?1:Y/T.width,V*=G===T.height||!T.height?1:G/T.height,u.scaleX=R,u.scaleY=V):(Y=Ce(Y*R/T.scaleX,0),G=Ce(G*V/T.scaleY,0),l.style.width=Y+"px",l.
1style.height=G+"px"),o&&Ja(l,t.props),q||!c?(v+=w-e.matrix.e,b+=C-e.matrix.f):O||c!==t.parent?(u.x=v+"px",u.y=b+"px",u.renderTransform(1,u),F=Ae(n||l,!1,!1,!0),P=d.apply({x:F.e,y:F.f}),D=d.apply({x:w,y:C}),v+=D.x-P.x,b+=D.y-P.y):(d.e=d.f=0,D=d.apply({x:w-e.matrix.e,y:C-e.matrix.f}),v+=D.x,b+=D.y),v=Ce(v,.02),b=Ce(b,.02),i&&!(i instanceof Ge)?X&&X.revert():(u.x=v+"px",u.y=b+"px",u.renderTransform(1,u)),i&&(i.x=v,i.y=b,i.rotation=z,i.skewX=L,a?(i.scaleX=R,i.scaleY=V):(i.width=Y,i.height=G)),i||u},zt=function(e,t){return e instanceof be?e:new be(e,t)},Qa=function(e,t,a){var o=e.idLookup[a],n=e.alt[a];return n.isVisible&&(!(t.getElementState(n.element)||n).isVisible||!o.isVisible)?n:o},Ft=[],Bt="width,height,overflowX,overflowY".split(","),pt,za=function(e){if(e!==pt){var t=Ne.style,a=Ne.clientWidth===window.outerWidth,o=Ne.clientHeight===window.outerHeight,n=4;if(e&&(a||o)){for(;n--;)Ft[n]=t[Bt[n]];a&&(t.width=Ne.clientWidth+"px",t.overflowY="hidden"),o&&(t.height=Ne.clientHeight+"px",t.overflowX="hidden"),pt=e}else if(pt){for(;n--;)Ft[n]?t[Bt[n]]=Ft[n]:t.removeProperty(Ha(Bt[n]));pt=e}}},Fa=function(e,t){for(var a=0;a<e.length;a+=3)le.set(e[a],{clearProps:!0}),e[a].setAttribute("style",e[a+t]),e[a]._gsap.gmCache=-1},Gt=function(e,t,a,o){e instanceof be&&t instanceof be||console.warn("Not a valid state object."),a=a||{};var n=a,i=n.clearProps,l=n.onEnter,u=n.onLeave,c=n.absolute,v=n.absoluteOnLeave,b=n.custom,Y=n.delay,G=n.paused,R=n.repeat,V=n.repeatDelay,z=n.yoyo,Z=n.toggleClass,X=n.nested,T=n.zIndex,$=n.scale,w=n.fade,C=n.stagger,O=n.spin,q=n.prune,L=("props"in a?a:e).props,P=He(a,ka),D=le.timeline({delay:Y,paused:G,repeat:R,repeatDelay:V,yoyo:z,data:"isFlip"}),p=P,d=[],F=[],A=[],j=[],de=O===!0?1:O||0,he=typeof O=="function"?O:function(){return de},f=e.interrupted||t.interrupted,g=D[o!==1?"to":"from"],M,I,E,k,h,x,te,ae,ve,ne,re,we,H,K;for(I in t.idLookup)re=t.alt[I]?Qa(t,e,I):t.idLookup[I],h=re.element,ne=e.idLookup[I],e.alt[I]&&h===ne.element&&(e.alt[I].isVisible||!re.isVisible)&&(ne=e.alt[I]),ne?(x={t:h,b:ne,a:re,sd:ne.element===h?0:re.isVisible?1:-1},A.push(x),x.sd&&(x.sd<0&&(x.b=re,x.a=ne),f&&st(x.b,L?St[L]:At),w&&A.push(x.swap={t:ne.element,b:x.b,a:x.a,sd:-x.sd,swap:x})),h._flip=ne.element._flip=W?W.timeline:D):re.isVisible&&(A.push({t:h,b:He(re,{isVisible:1}),a:re,sd:0,entering:1}),h._flip=W?W.timeline:D);if(L&&(na[L]||Wa(L)).forEach(function(fe){return P[fe]=function(_e){return A[_e].a.props[fe]}}),A.finalStates=ve=[],we=function(){wt(A),za(!0);var _e=[];for(k=0;k<A.length;k++)x=A[k],H=x.a,K=x.b,q&&!H.isDifferent(K)&&!x.entering?A.splice(k--,1):(h=x.t,X&&!(x.sd<0)&&k&&(H=x.a=H.clone({matrix:Ae(h,!1,!1,!0)})),K.isVisible&&H.isVisible?(x.sd<0?(X&&Fa(_e,1),te=new Ge(h,L,e.simple),je(te,H,$,0,0,te),te.matrix=Ae(h,!1,!1,!0),te.bounds=h.getBoundingClientRect(),te.css=x.b.css,x.a=H=te,w&&(h.style.opacity=f?K.opacity:H.opacity),C&&j.push(h),X&&(Fa(_e,2),_e.push(h,h.getAttribute("style")))):x.sd>0&&w&&(h.style.opacity=f?H.opacity-K.opacity:"0"),je(H,K,$,L),X&&x.sd<0&&_e.push(h.getAttribute("style"))):K.isVisible!==H.isVisible&&(K.isVisible?H.isVisible||(K.css=H.css,F.push(K),A.splice(k--,1),c&&X&&je(H,K,$,L)):(H.isVisible&&d.push(H),A.splice(k--,1))),$||(h.style.maxWidth=Math.max(H.width,K.width)+"px",h.style.maxHeight=Math.max(H.height,K.height)+"px",h.style.minWidth=Math.min(H.width,K.width)+"px",h.style.minHeight=Math.min(H.height,K.height)+"px"),X&&Z&&h.classList.add(Z)),ve.push(H);var xe;if(Z&&(xe=ve.map(function(N){return N.element}),X&&xe.forEach(function(N){return N.classList.remove(Z)})),za(!1),$?(P.scaleX=function(N){return A[N].a.scaleX},P.scaleY=function(N){return A[N].a.scaleY}):(P.width=function(N){return A[N].a.width+"px"},P.height=function(N){return A[N].a.height+"px"},P.autoRound=a.autoRound||!1),P.x=function(N){return A[N].a.x+"px"},P.y=function(N){return A[N].a.y+"px"},P.rotation=function(N){return A[N].a.rotation+(O?he(N,ae[N],ae)*360:0)},P.skewX=function(N){return A[N].a.skewX},ae=A.map(function(N){return N.t}),(T||T===0)&&(P.modifiers={zIndex:function(){return T}},P.zIndex=T,P.immediateRender=a.immediateRender!==!1),w&&(P.opacity=function(N){return A[N].sd<0?0:A[N].sd>0?A[N].a.opacity:"+=0"}),j.length){C=le.utils.distribute(C);var Qe=ae.slice(j.length);P.stagger=function(N,et){return C(~j.indexOf(et)?ae.indexOf(A[N].swap.t):N,et,Qe)}}
1if(Lo.forEach(function(N){return a[N]&&D.eventCallback(N,a[N],a[N+"Params"])}),b&&ae.length){p=He(P,ka),"scale"in b&&(b.scaleX=b.scaleY=b.scale,delete b.scale);for(I in b)M=He(b[I],$a),M[I]=P[I],!("duration"in M)&&"duration"in P&&(M.duration=P.duration),M.stagger=P.stagger,g.call(D,ae,M,0),delete p[I]}(ae.length||F.length||d.length)&&(Z&&D.add(function(){return Rt(xe,Z,D._zTime<0?"remove":"add")},0)&&!G&&Rt(xe,Z,"add"),ae.length&&g.call(D,ae,p,0)),Va(l,d,D),Va(u,F,D);var Ze=W&&W.timeline;Ze&&(Ze.add(D,0),W._final.push(function(){return Na(A,!i)})),E=D.duration(),D.call(function(){var N=D.time()>=E;N&&!Ze&&Na(A,!i),Z&&Rt(xe,Z,N?"remove":"add")})},v&&(c=A.filter(function(fe){return!fe.sd&&!fe.a.isVisible&&fe.b.isVisible}).map(function(fe){return fe.a.element})),W){var Ie;c&&(Ie=W._abs).push.apply(Ie,Ra(A,c)),W._run.push(we)}else c&&ja(Ra(A,c)),we();var Ke=W?W.timeline:D;return Ke.revert=function(){return ra(Ke,1,1)},Ke},zo=function r(e){e.vars.onInterrupt&&e.vars.onInterrupt.apply(e,e.vars.onInterruptParams||[]),e.getChildren(!0,!1,!0).forEach(r)},ra=function(e,t,a){if(e&&e.progress()<1&&(!e.paused()||a))return t&&(zo(e),t<2&&e.progress(1),e.kill()),!0},ft=function(e){for(var t=e.idLookup={},a=e.alt={},o=e.elementStates,n=o.length,i;n--;)i=o[n],t[i.id]?a[i.id]=i:t[i.id]=i},be=(function(){function r(t,a,o){if(this.props=a&&a.props,this.simple=!!(a&&a.simple),o)this.targets=Ka(t),this.elementStates=t,ft(this);else{this.targets=Je(t);
1var n=a&&(a.kill===!1||a.batch&&!a.kill);W&&!n&&W._kill.push(this),this.update(n||!!W)}}var e=r.prototype;return e.update=function(a){var o=this;return this.elementStates=this.targets.map(function(n){return new Ge(n,o.props,o.simple)}),ft(this),this.interrupt(a),this.recordInlineStyles(),this},e.clear=function(){return this.targets.length=this.elementStates.length=0,ft(this),this},e.fit=function(a,o,n){for(var i=wt(this.elementStates.slice(0),!1,!0),l=(a||this).idLookup,u=0,c,v;u<i.length;u++)c=i[u],n&&(c.matrix=Ae(c.element,!1,!1,!0)),v=l[c.id],v&&je(c,v,o,!0,0,c),c.matrix=Ae(c.element,!1,!1,!0);return this},e.getProperty=function(a,o){var n=this.getElementState(a)||bt;return(o in n?n:n.props||bt)[o]},e.add=function(a){for(var o=a.targets.length,n=this.idLookup,i=this.alt,l,u,c;o--;)u=a.elementStates[o],c=n[u.id],c&&(u.element===c.element||i[u.id]&&i[u.id].element===u.element)?(l=this.elementStates.indexOf(u.element===c.element?c:i[u.id]),this.targets.splice(l,1,a.targets[o]),this.elementStates.splice(l,1,u)):(this.targets.push(a.targets[o]),this.elementStates.push(u));return a.interrupted&&(this.interrupted=!0),a.simple||(this.simple=!1),ft(this),this},e.compare=function(a){var o=a.idLookup,n=this.idLookup,i=[],l=[],u=[],c=[],v=[],b=a.alt,Y=this.alt,G=function(q,L,P){return(q.isVisible!==L.isVisible?q.isVisible?u:c:q.isVisible?l:i).push(P)&&v.push(P)},R=function(q,L,P){return v.indexOf(P)<0&&G(q,L,P)},V,z,Z,X,T,$,w,C;for(Z in o)T=b[Z],$=Y[Z],V=T?Qa(a,this,Z):o[Z],X=V.element,z=n[Z],$?(C=z.isVisible||!$.isVisible&&X===z.element?z:$,w=T&&!V.isVisible&&!T.isVisible&&C.element===T.element?T:V,w.isVisible&&C.isVisible&&w.element!==C.element?((w.isDifferent(C)?l:i).push(w.element,C.element),v.push(w.element,C.element)):G(w,C,w.element),T&&w.element===T.element&&(T=o[Z]),R(w.element!==z.element&&T?T:w,z,z.element),R(T&&T.element===$.element?T:w,$,$.element),T&&R(T,$.element===T.element?$:z,T.element)):(z?z.isDifferent(V)?G(V,z,X):i.push(X):u.push(X),T&&R(T,z,T.element));for(Z in n)o[Z]||(c.push(n[Z].element),Y[Z]&&c.push(Y[Z].element));return{changed:l,unchanged:i,enter:u,leave:c}},e.recordInlineStyles=function(){for(var a=St[this.props]||At,o=this.elementStates.length;o--;)st(this.elementStates[o],a)},e.interrupt=function(a){var o=this,n=[];this.targets.forEach(function(i){var l=i._flip,u=ra(l,a?0:1);a&&u&&n.indexOf(l)<0&&l.add(function(){return o.updateVisibility()}),u&&n.push(l)}),!a&&n.length&&this.updateVisibility(),this.interrupted||(this.interrupted=!!n.length)},e.updateVisibility=function(){this.elementStates.forEach(function(a){var o=a.element.getBoundingClientRect();a.isVisible=!!(o.width||o.height||o.top||o.left),a.uncache=1})},e.getElementState=function(a){return this.elementStates[this.targets.indexOf(it(a))]},e.makeAbsolute=function(){return wt(this.elementStates.slice(0),!0,!0).map(oa)},r})(),Ge=(function(){function r(t,a,o){t instanceof r?Object.assign(this,t,a||{}):(this.element=t,this.update(a,o))}var e=r.prototype;return e.isDifferent=function(a){var o=this.bounds,n=a.bounds;return o.top!==n.top||o.left!==n.left||o.width!==n.width||o.height!==n.height||!this.matrix.equals(a.matrix)||this.opacity!==a.opacity||this.props&&a.props&&JSON.stringify(this.props)!==JSON.stringify(a.props)},e.clone=function(a){return new r(this,a)},e.update=function(a,o){var n=this,i=n.element,l=le.getProperty(i),u=le.core.getCache(i),c=i.getBoundingClientRect(),v=i.getBBox&&typeof i.getBBox=="function"&&i.nodeName.toLowerCase()!=="svg"&&i.getBBox(),b=o?new Ua(1,0,0,1,c.left+qa(),c.top+Xa()):Ae(i,!1,!1,!0);u.uncache=1,n.getProp=l,n.element=i,n.id=Vo(i),n.matrix=b,n.cache=u,n.bounds=c,n.isVisible=!!(c.width||c.height||c.left||c.top),n.display=l("display"),n.position=l("position"),n.parent=i.parentNode,n.x=l("x","px"),n.y=l("y","px"),n.scaleX=u.scaleX,n.scaleY=u.scaleY,n.rotation=l("rotation"),n.skewX=l("skewX"),n.opacity=l("opacity"),n.width=v?v.width:Ce(l("width","px"),.04),n.height=v?v.height:Ce(l("height","px"),.04),a&&Ro(n,na[a]||Wa(a)),n.ctm=i.getCTM&&i.nodeName.toLowerCase()==="svg"&&ro(i).inverse(),n.simple=o||$e(b.a)===1&&!$e(b.b)&&!$e(b.c)&&$e(b.d)===1,n.uncache=0},r})(),Fo=(function(){function r(t,a){this.vars=t,this.batch=a,this.states=[],this.timeline=a.timeline}var e=r.prototype;return e.getStateById=function(a){for(var o=this.states.length;o--;)if(this.states[o].idLookup[a])return this.states[o]},e.kill=function(){this.batch.remove(this)},r})(),Bo=(function(){function r(t){this.id=t,this.actions=[],this._kill=[],this._final=[],this._abs=[],this._run=[],this.data={},this.state=new be,this.timeline=le.timeline()}var e=r.prototype;return e.add=function(a){var o=this.actions.filter(function(n){return n.vars===a});return o.length?o[0]:(o=new Fo(typeof a=="function"?{animate:a}:a,this),this.actions.push(o),o)},e.remove=function(a){var o=this.actions.indexOf(a);return o>=0&&this.actions.splice(o,1),this},e.getState=function(a){var o=this,n=W,i=rt;return W=this,this.state.clear(),this._kill.length=0,this.actions.forEach(function(l){l.vars.getState&&(l.states.length=0,rt=l,l.state=l.vars.getState(l)),a&&l.states.forEac
1h(function(u){return o.state.add(u)})}),rt=i,W=n,this.killConflicts(),this},e.animate=function(){var a=this,o=W,n=this.timeline,i=this.actions.length,l,u;for(W=this,n.clear(),this._abs.length=this._final.length=this._run.length=0,this.actions.forEach(function(c){c.vars.animate&&c.vars.animate(c);var v=c.vars.onEnter,b=c.vars.onLeave,Y=c.targets,G,R;Y&&Y.length&&(v||b)&&(G=new be,c.states.forEach(function(V){return G.add(V)}),R=G.compare(Be.getState(Y)),R.enter.length&&v&&v(R.enter),R.leave.length&&b&&b(R.leave))}),ja(this._abs),this._run.forEach(function(c){return c()}),u=n.duration(),l=this._final.slice(0),n.add(function(){u<=n.time()&&(l.forEach(function(c){return c()}),Oa(a,"onComplete"))}),W=o;i--;)this.actions[i].vars.once&&this.actions[i].kill();return Oa(this,"onStart"),n.restart(),this},e.loadState=function(a){a||(a=function(){return 0});var o=[];return this.actions.forEach(function(n){if(n.vars.loadState){var i,l=function u(c){c&&(n.targets=c),i=o.indexOf(u),~i&&(o.splice(i,1),o.length||a())};o.push(l),n.vars.loadState(l)}}),o.length||a(),this},e.setState=function(){return this.actions.forEach(function(a){return a.targets=a.vars.setState&&a.vars.setState(a)}),this},e.killConflicts=function(a){return this.state.interrupt(a),this._kill.forEach(function(o){return o.interrupt(a)}),this},e.run=function(a,o){var n=this;return this!==W&&(a||this.getState(o),this.loadState(function(){n._killed||(n.setState(),n.animate())})),this},e.clear=function(a){this.state.clear(),a||(this.actions.length=0)},e.getStateById=function(a){for(var o=this.actions.length,n;o--;)if(n=this.actions[o].getStateById(a),n)return n;return this.state.idLookup[a]&&this.state},e.kill=function(){this._killed=1,this.clear(),delete Jt[this.id]},r})(),Be=(function(){function r(){}return r.getState=function(t,a){var o=zt(t,a);return rt&&rt.states.push(o),a&&a.batch&&r.batch(a.batch).state.add(o),o},r.from=function(t,a){return a=a||{},"clearProps"in a||(a.clearProps=!0),Gt(t,zt(a.targets||t.targets,{props:a.props||t.props,simple:a.simple,kill:!!a.kill}),a,-1)},r.to=function(t,a){return Gt(t,zt(a.targets||t.targets,{props:a.props||t.props,simple:a.simple,kill:!!a.kill}),a,1)},r.fromTo=function(t,a,o){return Gt(t,a,o)},r.fit=function(t,a,o){var n=o?He(o,$a):{},i=o||n,l=i.absolute,u=i.scale,c=i.getVars,v=i.props,b=i.runBackwards,Y=i.onComplete,G=i.simple,R=o&&o.fitChild&&it(o.fitChild),V=Kt(a,v,G,t),z=Kt(t,0,G,V),Z=v?St[v]:At,X=le.context();return v&&Ja(n,V.props),st(z,Z),b&&("immediateRender"in n||(n.immediateRender=!0),n.onComplete=function(){Et(z),Y&&Y.apply(this,arguments)}),l&&oa(z,V),n=je(z,V,u||R,!n.duration&&v,R,n.duration||c?n:0),typeof o=="object"&&"zIndex"in o&&(n.zIndex=o.zIndex),X&&!c&&X.add(function(){return function(){return Et(z)}}),c?n:n.duration?le.to(z.element,n):null},r.makeAbsolute=function(t,a){return(t instanceof be?t:new be(t,a)).makeAbsolute()},r.batch=function(t){return t||(t="default"),Jt[t]||(Jt[t]=new Bo(t))},r.killFlipsOf=function(t,a){(t instanceof be?t.targets:Je(t)).forEach(function(o){return o&&ra(o._flip,a!==!1?1:2)})},r.isFlipping=function(t){var a=r.getByTarget(t);return!!a&&a.isActive()},r.getByTarget=function(t){return(it(t)||bt)._flip},r.getElementState=function(t,a){return new Ge(it(t),a)},r.convertCoordinates=function(t,a,o){var n=Ae(a,!0,!0).multiply(Ae(t));return o?n.apply(o):n},r.register=function(t){if(Ne=typeof document<"u"&&document.body,Ne){le=t,oo(Ne),Je=le.utils.toArray,jt=le.core.getStyleSaver;var a=le.utils.snap(.1);Ce=function(n,i){return a(parseFloat(n)+i)}}},r})();Be.version="3.14.2";typeof window<"u"&&window.gsap&&window.gsap.registerPlugin(Be);ue.registerPlugin(Be,Fe);const ke="desktop-image-zoom-modal",Zt=.4,Go=50,Zo=600,me={CLOSE_BUTTON:"[data-desktop-zoom-close]",FLIP_ID:"[data-flip-id]",IMAGE:"[data-desktop-zoom-image]",MODAL:`#${ke}`,OVERLAY:"[data-desktop-zoom-overlay]",SCROLL_CONTAINER:"[data-desktop-zoom-scroll-container]",THUMBNAILS:"[data-desktop-zoom-thumbnails]"};function Yo(){const{closeModal:r,isModalOpen:e,openModal:t,upscaleModalImages:a}=ta(),o=Re(()=>e(ke)),n=_(0),i=_([]);let l=[],u=!1,c=null,v=null,b=null;const Y=async(w,C,O=null)=>{try{if(!C||C.length===0){Se("[Allbirds composable] - useDesktopImageZoomModal - openDesktopZoomModal - No images provided",{imageListLength:C?.length,initialIndex:w});return}i.value=C,n.value=w,O?await R(w,O):await G(w)}catch(q){U("[Allbirds composable] - useDesktopImageZoomModal - openDesktopZoomModal - Error opening modal",{imageListLength:C?.length,initialIndex:w},q)}},G=async w=>{t(ke),await Pe(),X(w,!1),T(),Z(),a(me.MODAL)},R=async(w,C)=>{const O=C.dataset.flipId;if(!O){await G(w);return}b=C.closest("button"),b&&(b.style.overflow="visible");const q=Be.getState(C);v=C,C.style.visibility="hidden",t(ke),await Pe(),X(w,!1),await Pe();const L=document.querySelector(me.MODAL),P=L?.querySelector(`[data-flip-id="${O}"]`);if(!P){C.style.visibility="",b&&(b.style.overflow=""),v=null,b=null,T(),Z(),a(me.MODAL);return}const D=L.querySelectorAll(me.IMAGE),p=P.closest(me.IMAGE);D.forEach(d=>{d!==p&&(d.style.visibility="hidden")}),ue.fromTo(L,{opacity:0}
1,{duration:Zt,ease:Dt.POWER3_OUT,opacity:1}),Be.from(q,{absolute:!0,duration:Zt,ease:Dt.POWER3_OUT,onComplete:()=>{D.forEach(d=>{d.style.visibility=""}),T(),Z(),a(me.MODAL)},scale:!0,targets:P,zIndex:1e3})},V=()=>{v&&(ue.set(v,{clearProps:"all"}),v.style.visibility="",v=null),b&&(b.style.overflow="",b=null)},z=()=>{try{$();const w=document.querySelector(me.MODAL);w?(w.querySelectorAll(me.FLIP_ID).forEach(O=>{Be.killFlipsOf(O),ue.killTweensOf(O)}),V(),ue.to(w,{duration:Zt,ease:Dt.SINE_OUT,onComplete:()=>{r(ke),ue.set(w,{opacity:1})},opacity:0})):(V(),r(ke))}catch(w){U("[Allbirds composable] - useDesktopImageZoomModal - closeDesktopZoomModal - Error closing modal",{},w),V(),r(ke)}},Z=()=>{const w=document.querySelector(me.MODAL);w&&w.focus()},X=(w,C=!0)=>{try{const O=document.querySelector(me.MODAL),q=O?.querySelector(me.SCROLL_CONTAINER),L=O?.querySelector(`[data-image-index="${w}"]`);if(!q||!L){Se("[Allbirds composable] - useDesktopImageZoomModal - scrollToDesktopZoomImage - Elements not found",{index:w});return}u=!0,c&&clearTimeout(c),n.value=w,L.scrollIntoView({behavior:C?"smooth":"instant",block:"start"}),c=setTimeout(()=>{u=!1},C?Zo:Go)}catch(O){U("[Allbirds composable] - useDesktopImageZoomModal - scrollToDesktopZoomImage - Error scrolling to image",{index:w},O)}},T=()=>{try{$();const w=document.querySelector(me.MODAL),C=w?.querySelector(me.SCROLL_CONTAINER),O=w?.querySelectorAll(me.IMAGE);if(!C||!O?.length){Se("[Allbirds composable] - useDesktopImageZoomModal - setupScrollObserver - Elements not found");return}const q=L=>{u||(n.value=L)};O.forEach(L=>{const P=parseInt(L.dataset.imageIndex,10);if(isNaN(P))return;const D=Fe.create({end:"bottom 30%",onEnter:()=>q(P),onEnterBack:()=>q(P),scroller:C,start:"top 70%",trigger:L});l.push(D)})}catch(w){U("[Allbirds composable] - useDesktopImageZoomModal - setupScrollObserver - Error setting up observer",{},w)}},$=()=>{c&&(clearTimeout(c),c=null),u=!1,l.forEach(w=>{w.kill()}),l=[]};return Za(()=>{$(),V(),o.value&&r(ke)}),{closeDesktopZoomModal:z,desktopZoomActiveIndex:n,images:i,isDesktopZoomModalOpen:o,openDesktopZoomModal:Y,scrollToDesktopZoomImage:X}}var se=function(){return se=Object.assign||function(e){for(var t,a=1,o=arguments.length;a<o;a++){t=arguments[a];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},se.apply(this,arguments)};typeof window<"u"&&(window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),typeof window.CustomEvent!="function"&&(window.CustomEvent=function(e,t){t=t||{bubbles:!1,cancelable:!1,detail:null};var a=document.createEvent("CustomEvent");return a.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),a}));var Uo=typeof document<"u"&&!!document.documentMode,Yt;function qo(){return Yt||(Yt=document.createElement("div").style)}var Ba=["webkit","moz","ms"],mt={};function ia(r){if(mt[r])return mt[r];var e=qo();if(r in e)return mt[r]=r;for(var t=r[0].toUpperCase()+r.slice(1),a=Ba.length;a--;){var o="".concat(Ba[a]).concat(t);if(o in e)return mt[r]=o}}function ht(r,e){return parseFloat(e[ia(r)])||0}function gt(r,e,t){t===void 0&&(t=window.getComputedStyle(r));var a=e==="border"?"Width":"";return{left:ht("".concat(e,"Left").concat(a),t),right:ht("".concat(e,"Right").concat(a),t),top:ht("".concat(e,"Top").concat(a),t),bottom:ht("".concat(e,"Bottom").concat(a),t)}}function We(r,e,t){r.style[ia(e)]=t}function Xo(r,e){var t=ia("transform");We(r,"transition","".concat(t," ").concat(e.duration,"ms ").concat(e.easing))}function $o(r,e,t){var a=e.x,o=e.y,n=e.scale,i=e.isSVG;if(We(r,"transform","scale(".concat(n,") translate(").concat(a,"px, ").concat(o,"px)")),i&&Uo){var l=window.getComputedStyle(r).getPropertyValue("transform");r.setAttribute("transform",l)}}function Ut(r){var e=r.parentNode,t=window.getComputedStyle(r),a=window.getComputedStyle(e),o=r.getBoundingClientRect(),n=e.getBoundingClientRect();return{elem:{style:t,width:o.width,height:o.height,top:o.top,bottom:o.bottom,left:o.left,right:o.right,margin:gt(r,"margin",t),border:gt(r,"border",t)},parent:{style:a,width:n.width,height:n.height,top:n.top,bottom:n.bottom,left:n.left,right:n.right,padding:gt(e,"padding",a),border:gt(e,"border",a)}}}
1var lt={down:"mousedown",move:"mousemove",up:"mouseup mouseleave"};typeof window<"u"&&(typeof window.PointerEvent=="function"?lt={down:"pointerdown",move:"pointermove",up:"pointerup pointerleave pointercancel"}:typeof window.TouchEvent=="function"&&(lt={down:"touchstart",move:"touchmove",up:"touchend touchcancel"}));function qt(r,e,t,a){lt[r].split(" ").forEach(function(o){e.addEventListener(o,t,a)})}function Xt(r,e,t){lt[r].split(" ").forEach(function(a){e.removeEventListener(a,t)})}function en(r,e){for(var t=r.length;t--;)if(r[t].pointerId===e.pointerId)return t;return-1}function Qt(r,e){var t;if(e.touches){t=0;for(var a=0,o=e.touches;a<o.length;a++){var n=o[a];n.pointerId=t++,Qt(r,n)}return}t=en(r,e),t>-1&&r.splice(t,1),r.push(e)}function Ho(r,e){if(e.touches){for(;r.length;)r.pop();return}var t=en(r,e);t>-1&&r.splice(t,1)}function Ga(r){r=r.slice(0);for(var e=r.pop(),t;t=r.pop();)e={clientX:(t.clientX-e.clientX)/2+e.clientX,clientY:(t.clientY-e.clientY)/2+e.clientY};return e}function $t(r){if(r.length<2)return 0;var e=r[0],t=r[1];return Math.sqrt(Math.pow(Math.abs(t.clientX-e.clientX),2)+Math.pow(Math.abs(t.clientY-e.clientY),2))}function Wo(r){for(var e=r;e&&e.parentNode;){if(e.parentNode===document)return!0;e=e.parentNode instanceof ShadowRoot?e.parentNode.host:e.parentNode}return!1}function jo(r){return(r.getAttribute("class")||"").trim()}function Jo(r,e){return r.nodeType===1&&" ".concat(jo(r)," ").indexOf(" ".concat(e," "))>-1}function Ko(r,e){for(var t=r;t!=null;t=t.parentNode)if(Jo(t,e.excludeClass)||e.exclude.indexOf(t)>-1)return!0;return!1}var Qo=/^http:[\w\.\/]+svg$/;function er(r){return Qo.test(r.namespaceURI)&&r.nodeName.toLowerCase()!=="svg"}function tr(r){var e={};for(var t in r)r.hasOwnProperty(t)&&(e[t]=r[t]);return e}var tn={animate:!1,canvas:!1,cursor:"move",disablePan:!1,disableZoom:!1,disableXAxis:!1,disableYAxis:!1,duration:200,easing:"ease-in-out",exclude:[],excludeClass:"panzoom-exclude",handleStartEvent:function(r){r.preventDefault(),r.stopPropagation()},maxScale:4,minScale:.125,overflow:"hidden",panOnlyWhenZoomed:!1,pinchAndPan:!1,relative:!1,setTransform:$o,startX:0,startY:0,startScale:1,step:.3,touchAction:"none"};function an(r,e){if(!r)throw new Error("Panzoom requires an element as an argument");if(r.nodeType!==1)throw new Error("Panzoom requires an element with a nodeType of 1");if(!Wo(r))throw new Error("Panzoom should be called on elements that have been attached to the DOM");e=se(se({},tn),e);var t=er(r),a=r.parentNode;a.style.overflow=e.overflow,a.style.userSelect="none",a.style.touchAction=e.touchAction,(e.canvas?a:r).style.cursor=e.cursor,r.style.userSelect="none",r.style.touchAction=e.touchAction,We(r,"transformOrigin",typeof e.origin=="string"?e.origin:t?"0 0":"50% 50%");function o(){a.style.overflow="",a.style.userSelect="",a.style.touchAction="",a.style.cursor="",r.style.cursor="",r.style.userSelect="",r.style.touchAction="",We(r,"transformOrigin","")}function n(f){f===void 0&&(f={});for(var g in f)f.hasOwnProperty(g)&&(e[g]=f[g]);(f.hasOwnProperty("cursor")||f.hasOwnProperty("canvas"))&&(a.style.cursor=r.style.cursor="",(e.canvas?a:r).style.cursor=e.cursor),f.hasOwnProperty("overflow")&&(a.style.overflow=f.overflow),f.hasOwnProperty("touchAction")&&(a.style.touchAction=f.touchAction,r.style.touchAction=f.touchAction)}var i=0,l=0,u=1,c=!1;V(e.startScale,{animate:!1,force:!0}),setTimeout(function(){R(e.startX,e.startY,{animate:!1,force:!0})});function v(f,g,M){if(!M.silent){var I=new CustomEvent(f,{detail:g});r.dispatchEvent(I)}}function b(f,g,M){var I={x:i,y:l,scale:u,isSVG:t,originalEvent:M};return requestAnimationFrame(function(){typeof g.animate=="boolean"&&(g.animate?Xo(r,g):We(r,"transition","none")),g.setTransform(r,I,g),v(f,I,g),v("panzoomchange",I,g)}),I}function Y(f,g,M,I){var E=se(se({},e),I),k={x:i,y:l,opts:E};if(!I?.force&&(E.disablePan||E.panOnlyWhenZoomed&&u===E.startScale))return k;if(f=parseFloat(f),g=parseFloat(g),E.disableXAxis||(k.x=(E.relative?i:0)+f),E.disableYAxis||(k.y=(E.relative?l:0)+g),E.contain){var h=Ut(r),x=h.elem.width/u,te=h.elem.height/u,ae=x*M,ve=te*M,ne=(ae-x)/2,re=(ve-te)/2;if(E.contain==="inside"){var we=(-h.elem.margin.left-h.parent.padding.left+ne)/M,H=(h.parent.width-ae-h.parent.padding.left-h.elem.margin.left-h.parent.border.left-h.parent.border.right+ne)/M;k.x=Math.max(Math.min(k.x,H),we);var K=(-h.elem.margin.top-h.parent.padding.top+re)/M,Ie=(h.parent.height-ve-h.parent.padding.top-h.elem.margin.top-h.parent.border.top-h.parent.border.bottom+re)/M;k.y=Math.max(Math.min(k.y,Ie),K)}else if(E.contain==="outside"){var we=(-(ae-h.parent.width)-h.parent.padding.left-h.parent.border.left-h.parent.border.right+ne)/M,H=(ne-h.parent.padding.left)/M;k.x=Math.max(Math.min(k.x,H),we);var K=(-(ve-h.parent.height)-h.parent.padding.top-h.parent.border.top-h.parent.border.bottom+re)/M,Ie=(re-h.parent.padding.top)/M;k.y=Math.max(Math.min(k.y,Ie),K)}}return E.roundPixels&&(k.x=Math.round(k.x),k.y=Math.round(k.y)),k}function G(f,g){var M=se(se({},e),g),I={scale:u,opts:M};if(!g?.force&&M.disableZoom)return I;var E=e.minScale,k=e.maxScale;if(M.contain){var h=Ut(r),x=h.elem.width/u,te=h.elem.height/u;if(x>1&&te>1){var ae=h.parent.width-h.parent.border.left-h.parent.border.right,ve=h.parent.height-h.parent.border.top-h.parent.border.bottom,ne=ae/x,re=ve/te;e.contain==="inside"?k=Math.min(k,ne,re):e.contain==="outside"&&(E=Math.max(E,ne,re))}}return I.scale=Math.min(Math.max(f,E),k),I}function R(f,g,M,I){var E=Y(f,g,u,M);return i!==E.x||l!==E.y?(i=E.x,l=E.y,b("panzoompan",E.opts,I)):{x:i,y:l,scale:u,isSVG:t,originalEvent:I}}function V(f,g,M){var I=G(f,g),E=I.opts;if(!(!g?.force&&E.disableZoom)){f=I.scale;var k=i,h=l;if(E.focal){var x=E.focal;k=(x.x/f-x.x/u+i*f)/f,h=(x.y/f-x.y/u+l*f)/f}var te=Y(k,h,f,{relative:!1,force:!0});return i=te.x,l=te.y,u=f,b("panzoomzoom",E,M)}}function z(f,g){var M=se(se(se({},e),{animate:!0}),g);return V(u*Math.exp((f?1:-1)*M.step),M)}function Z(f){return z(!0,f)}function X(f){return z(!1,f)}function T(f,g,M,I){var E=Ut(r),k={width:E.parent.width-E.parent.padding.left-E.parent.padding.right-E.parent.border.left-E.parent.border.right,height:E.parent.height-E.parent.padding.top-E.parent.padding.bottom-E.parent.border.top-E.parent.border.bottom},h=g.clientX-E.parent.left-E.parent.padding.left-E.parent.border.left-E.elem.margin.left,x=g.clientY-E.parent.top-E.parent.padding.top-E.parent.border.top-E.elem.margin.top;t||(h-=E.elem.width/u/2,x-=E.elem.height/u/2);var te={x:h/k.width*(k.width*f),y:x/k.height*(k.height*f)};return V(f,se(se({},M),{animate:!1,focal:te}),I)}function $(f,g){f.preventDefault();var M=se(se(se({},e),g),{animate:!1}),I=f.deltaY===0&&f.deltaX?f.deltaX:f.deltaY,E=I<0?1:-1,k=G(u*Math.exp(E*M.step/3),M).scale;return T(k,f,M,f)}function w(f){var g=se(se(se({},e),{animate:!0,force:!0}),f);u=G(g.startScale,g).scale;var M=Y(g.startX,g.startY,u,g);return i=M.x,l=M.y,b("panzoomreset",g)}var C,O,q,L,P,D,p=[];function d(f){if(!Ko(f.target,e)){Qt(p,f),c=!0,e.handleStartEvent(f),C=i,O=l,v("panzoomstart",{x:i,y:l,scale:u,isSVG:t,originalEvent:f},e);var g=Ga(p);q=g.clientX,L=g.clientY,P=u,D=$t(p)}}function F(f){if(!(!c||C===void 0||O===void 0||q===void 0||L===void 0)){Qt(p,f);var g=Ga(p),M=p.length>1,I=u;if(M){D===0&&(D=$t(p));var E=$t(p)-D;I=G(E*e.step/80+P).scale,T(I,g,{animate:!1},f)}(!M||e.pinchAndPan)&&R(C+(g.clientX-q)/I,O+(g.clientY-L)/I,{animate:!1},f)}}function A(f){p.length===1&&v("panzoomend",{x:i,y:l,scale:u,isSVG:t,originalEvent:f}
1,e),Ho(p,f),c&&(c=!1,C=O=q=L=void 0)}var j=!1;function de(){j||(j=!0,qt("down",e.canvas?a:r,d),qt("move",document,F,{passive:!0}),qt("up",document,A,{passive:!0}))}function he(){j=!1,Xt("down",e.canvas?a:r,d),Xt("move",document,F),Xt("up",document,A)}return e.noBind||de(),{bind:de,destroy:he,eventNames:lt,getPan:function(){return{x:i,y:l}},getScale:function(){return u},getOptions:function(){return tr(e)},handleDown:d,handleMove:F,handleUp:A,pan:R,reset:w,resetStyle:o,setOptions:n,setStyle:function(f,g){return We(r,f,g)},zoom:V,zoomIn:Z,zoomOut:X,zoomToPoint:T,zoomWithWheel:$}}an.defaultOptions=tn;const ar=.5,ea="image-zoom-modal",vt=.02,ge={IMAGE_CONTAINER:"[data-image-container]",IMAGE_INDEX:"[data-image-index]",MODAL:`[data-modal-id="${ea}"]`};let pe=null;const nr=()=>{const r=document.querySelector(ge.MODAL);return{maxScale:parseFloat(r.dataset.zoomMaxScale),minScale:parseFloat(r.dataset.zoomMinScale),startScale:parseFloat(r.dataset.zoomStartScale)}};function or(){const{closeModal:r,openModal:e,upscaleModalImages:t}=ta(),a=_(0),o=_([]),n=_(null),i=_(null),l=_(!1),u=_(0),c=_(0),v=_(0),b=_(0),Y=_(0),G=_(0),R=async(p,d,F=null)=>{try{if(!d||d.length===0){Se("[Allbirds composable] - useImageZoomModal - openImageZoomModal - No images provided",{imageListLength:d?.length,initialIndex:p});return}if(p<0||p>=d.length){Se("[Allbirds composable] - useImageZoomModal - openImageZoomModal - Invalid initial index",{imageListLength:d.length,initialIndex:p});return}o.value=d,a.value=p,e(ea),F&&window.ALLBIRDS.page.isProductTemplate&&Qn({pdpImagePosition:p,shopifyProduct:F}),await Pe(),z(),Z(),t(ge.MODAL)}catch(A){U("[Allbirds composable] - useImageZoomModal - openImageZoomModal - Error opening modal",{imageListLength:d?.length,initialIndex:p},A)}},V=()=>{try{T(),r(ea),l.value=!1}catch(p){U("[Allbirds composable] - useImageZoomModal - closeImageZoomModal - Error closing modal",{},p)}},z=()=>{try{const d=document.querySelector(ge.MODAL)?.querySelector(ge.IMAGE_CONTAINER);if(!d)return;d.querySelectorAll(ge.IMAGE_INDEX).forEach(A=>{ue.set(A,{opacity:1})})}catch(p){U("[Allbirds composable] - useImageZoomModal - resetImageOpacities - Error resetting opacities",{},p)}},Z=()=>{try{const d=document.querySelector(ge.MODAL)?.querySelector(ge.IMAGE_CONTAINER);if(!d){Se("[Allbirds composable] - useImageZoomModal - initPanzoom - Image container not found");return}n.value&&T(),pe=nr(),n.value=an(d,{contain:"outside",maxScale:pe.maxScale,minScale:pe.minScale,startScale:pe.startScale,step:ar,transformOrigin:"center"}),d.addEventListener("wheel",n.value.zoomWithWheel),d.addEventListener("dblclick",X)}catch(p){U("[Allbirds composable] - useImageZoomModal - initPanzoom - Error initializing panzoom",{},p)}},X=p=>{try{if(!n.value)return;const d=p.target;if(!(d.tagName==="IMG"||d.closest("img")))return;if(n.value.getScale()>pe.minScale+vt)n.value.zoom(pe.minScale,{animate:!0});else{const j=p.currentTarget.getBoundingClientRect(),de=p.clientX-j.left,he=p.clientY-j.top;n.value.zoomToPoint(pe.maxScale,{clientX:de,clientY:he},{animate:!0})}}catch(d){U("[Allbirds composable] - useImageZoomModal - handleDoubleClickZoom - Error handling double-click zoom",{},d)}},T=()=>{try{if(n.value){const d=document.querySelector(ge.MODAL)?.querySelector(ge.IMAGE_CONTAINER);d&&(d.removeEventListener("wheel",n.value.zoomWithWheel),d.removeEventListener("dblclick",X)),n.value.destroy(),n.value=null}pe=null}catch(p){U("[Allbirds composable] - useImageZoomModal - destroyPanzoom - Error destroying panzoom",{},p)}},$=()=>{try{n.value&&n.value.reset({animate:!1})}catch(p){U("[Allbirds composable] - useImageZoomModal - resetZoom - Error resetting zoom",{},p)}},w=()=>{if(!(l.value||o.value.length<=1)&&!(a.value>=o.value.length-1))try{l.value=!0;const p=a.value+1;O(p)}catch(p){U("[Allbirds composable] - useImageZoomModal - goToNext - Error navigating to next image",{currentIndex:a.value},p),l.value=!1}},C=()=>{if(!(l.value||o.value.length<=1)&&!(a.value<=0))try{l.value=!0;const p=a.value-1;O(p)}catch(p){U("[Allbirds composable] - useImageZoomModal - goToPrev - Error navigating to previous image",{currentIndex:a.value},p),l.value=!1}},O=p=>
1{if(p===a.value){l.value=!1;return}try{const F=document.querySelector(ge.MODAL)?.querySelector(ge.IMAGE_CONTAINER);if(!F){Se("[Allbirds composable] - useImageZoomModal - navigateToImage - Container not found"),l.value=!1;return}const A=F.querySelector(`[data-image-index="${a.value}"]`),j=F.querySelector(`[data-image-index="${p}"]`);if(!A||!j){a.value=p,$(),l.value=!1;return}ue.to(A,{...Xe.CAROUSEL_FADE_OUT,onComplete:()=>{a.value=p,$(),ue.to(j,{...Xe.CAROUSEL_FADE_IN,onComplete:()=>{l.value=!1}})}}),window.ALLBIRDS.page.isProductTemplate&&Wt({pdpImagePosition:p+1,shopifyProduct:window.ALLBIRDS.page.productDetailsPage.product})}catch(d){U("[Allbirds composable] - useImageZoomModal - navigateToImage - Error navigating to image",{newIndex:p},d),l.value=!1}},q=p=>{try{const d=n.value?.getScale?.()??null;if(n.value&&pe&&typeof d=="number"&&d>pe.minScale+vt)return;u.value=p.touches[0].clientX,c.value=p.touches[0].clientY,v.value=Date.now()}catch(d){U("[Allbirds composable] - useImageZoomModal - handleTouchStart - Error handling touch start",{},d)}},L=p=>{try{const d=n.value?.getScale?.()??null,F=p.changedTouches[0],A=F.clientX,j=F.clientY,de=Date.now(),he=de-b.value,f=Math.sqrt(Math.pow(A-Y.value,2)+Math.pow(j-G.value,2));if(he<300&&f<20){P(p),b.value=0;return}if(b.value=de,Y.value=A,G.value=j,n.value&&pe&&typeof d=="number"&&d>pe.minScale+vt)return;const g=A-u.value,M=j-c.value,I=de-v.value;Math.abs(g)>50&&I<300&&Math.abs(g)>Math.abs(M)&&(g>0?C():w())}catch(d){U("[Allbirds composable] - useImageZoomModal - handleTouchEnd - Error handling touch end",{},d)}},P=p=>{try{if(!n.value)return;const d=p.changedTouches[0],F=document.elementFromPoint(d.clientX,d.clientY);if(!(F?.tagName==="IMG"||F?.closest("img")))return;if(n.value.getScale()>pe.minScale+vt)n.value.zoom(pe.minScale,{animate:!0});else{const he=document.querySelector(ge.MODAL)?.querySelector(ge.IMAGE_CONTAINER);if(he){const f=he.getBoundingClientRect(),g=d.clientX-f.left,M=d.clientY-f.top;n.value.zoomToPoint(pe.maxScale,{clientX:g,clientY:M},{animate:!0})}}}catch(d){U("[Allbirds composable] - useImageZoomModal - handleDoubleTapZoom - Error handling double-tap zoom",{},d)}};return{closeImageZoomModal:V,currentImageIndex:a,goToImageIndex:p=>{if(!(l.value||o.value.length<=1)&&!(p<0||p>=o.value.length)&&p!==a.value)try{l.value=!0,O(p)}catch(d){U("[Allbirds composable] - useImageZoomModal - goToImageIndex - Error navigating to image",{index:p},d),l.value=!1}},goToNext:w,goToPrev:C,handleTouchEnd:L,handleTouchStart:q,imageContainer:i,images:o,isNavigating:l,openImageZoomModal:R,resetZoom:$}}const ze="mobile-sticky-atc",Ht={CONTROL:"control",TREATMENT:"treatment"};function rr(r="main-product"){const{getFlag:e,getFlagValue:t,reportExposure:a}=Ya(),o=_(!1),n=Re(()=>{const c=e(ze);return c?.status===Te.SUCCESS||c?.status===Te.ERROR}),i=Re(()=>t(ze)===Ht.TREATMENT),l=Re(()=>{const c=t(ze);return!c||c===Ht.CONTROL});return{FLAG_KEY:ze,isControlVariant:l,isExperimentLoaded:n,isStickyAtcVariant:i,trackExposure:()=>{o.value||e(ze)?.status!==Te.SUCCESS||(o.value=!0,a(ze),ot("[Allbirds composable] - useMobileStickyAtcExperiment - Exposure reported",{section:r,variant:t(ze)}))},VARIANTS:Ht}}const ir="__shopify_send_gift_card_to_recipient",sr="Recipient email",lr="Recipient name",cr="Message",ur="Send on",dr="__shopify_offset",pr="on",fr="180",mr=({emailRecipient:r,messageRecipient:e,nameRecipient:t,sendOn:a})=>({[cr]:e,[sr]:r,[ir]:pr,[lr]:t,...Eo(a)&&{[ur]:So(a)},[dr]:fr});ue.registerPlugin(Fe);const Ee={DOWN:"down",UP:"up"},qe={ALL:"all",SALE:"sale"},yt="edition",hr={loop:!0,modules:[Wn,jn],pagination:{clickable:!0,el:".swiper-pagination",renderBullet:function(r,e){return`<span class="${e}" data-pagination-index="${r}"></span>`}}};class gr extends To{constructor(){super('[data-section-type="main-product"]')}init(e){const t=e.container;if(!t){U("[Allbirds section] - Main Product - init - Container not found",{},new Error("Container not found"));return}const a=!e.hasLoaded;Jn({name:"MainProductSection",setup(){const o=new URLSearchParams(window.location.search),n=o.get(qe.SALE),i=o.get(yt),l=n==="true",u=_(l),c=l?qe.SALE:i||qe.ALL;let v=null;const b=_(1),Y=_(!0),G=_(!1),R=_(c),V=_(""),z=_(""),Z=Re(()=>la.value),X=_(!1),T=_(l),$=Re(()=>d.value?.price?Ca(d.value.price):null),w=_(t.getAttribute("data-product-price")||""),{addSingleVariant:C}=ao(),O=_(null),q=_(null),L=_(null),P=_(!1),D=_(!1),p=_([]),d=_(null),F=_(!1),A=_(!1),j=_(!1),de=_(!1),he=_(!1),f=_(!1),g=_(null),M=_(null),I=_(null),E=_(null),k=_(!1),h=_(""),{isMobile:x,onResize:te}=Ma();let ae=null;const ve=no(),ne=so("main-product"),re=_(null),we=_(!1),{openSizeChart:H}=co(),{isExperimentLoaded:K,isStickyAtcVariant:Ie,trackExposure:Ke}=rr(),{getFlag:fe,getFlagValue:_e,reportExposure:xe}=Ya(),Qe=_(!1);let Ze=!1;De(()=>fe(Lt),s=>{s?.status===Te.SUCCESS&&(Ze||(Ze=!0,xe(Lt)),Qe.value=_e(Lt)==="hide",Qe.value&&document.querySelector('[data-section-type="product-reviews"]')?.classList.add("hidden"))},{immediate:!0});const N=_(!1);let et=!1;De(()=>fe(nt),s=>{s?.status===Te.SUCCESS&&(et||(et=!0,xe(nt)),N.value=_e(nt)==="treatment")},{immediate:!0});const sa=_(null),It=_([]),_t=_([]),Ve=_(null),la=_(!0);let ca={};try{const s=t.dataset.colorwayVariants;if(s){const m=JSON.parse(s);ca=Object.fromEntries(Object.entries(m).map(([y,B])=>[y,B.map(S=>({...S,available:S.available===!0||S.available==="true"||S.available===1||S.available==="1",isOnSale:!!S.isOnSale}))]))}}catch(s){U("[Allbirds section] - Main Product - Error parsing colorway variants data during setup",{colorwayVariantsAttr:t.dataset.colorwayVariants},s)}const Oe=_(ca),Ye=_(null),ua=Re(()=>{if(!Ye.value||Object.keys(Oe.value).length===0)return null;const s=new Set;return Object.entries(Oe.value).forEach(([m,y])=>{y.find(S=>S.title===Ye.value)?.available&&s.add(m)}),s}),nn=Re(()=>Object.entries(Oe.value).map(([s,m])=>({handle:s,isOnSale:m.some(y=>y.isOnSale===!0)})).filter(({isOnSale:s})=>s)),tt=s=>ua.value===null?!0:ua.value.has(s),on=s=>{const m=t.querySelector("[data-product-color-selector]");return m?m.getAttribute("data-current-product-handle")===s:!1},Mt=()=>{const s=t.querySelector("[data-product-color-selector]");if(!s)return;const m=s.querySelector(".swatch-group");if(!m)return;const y=_t.value.length>0?_t.value:Array.from(m.querySelectorAll("[data-color-swatch]"));if(y.length===0)return;if(R.value==="all"){const Q=[],ce=[];
1y.forEach(oe=>{const ee=oe.getAttribute("data-handle");tt(ee)?Q.push(oe):ce.push(oe)}),Q.forEach(oe=>{m.appendChild(oe)}),ce.forEach(oe=>{m.appendChild(oe)});return}const S=new Map,J=[];y.forEach(Q=>{const ce=Q.getAttribute("data-edition")||"",oe=Q.getAttribute("data-sale")==="true";let ee=ce;oe?ee="sale":(!ce||ce==="")&&(ee="all"),S.has(ee)||(S.set(ee,[]),J.push(ee)),S.get(ee).push(Q)});const ie=[],ye=new Set;if(S.has("all")){const Q=S.get("all"),ce=[],oe=[];Q.forEach(ee=>{const Me=ee.getAttribute("data-handle");tt(Me)?ce.push(ee):oe.push(ee)}),ie.push(...ce,...oe),ye.add("all")}if(J.forEach(Q=>{if(ye.has(Q)||Q==="all"||Q==="sale")return;const ce=S.get(Q),oe=[],ee=[];ce.forEach(Me=>{const Hn=Me.getAttribute("data-handle");tt(Hn)?oe.push(Me):ee.push(Me)}),ie.push(...oe,...ee),ye.add(Q)}),S.has("sale")){const Q=S.get("sale"),ce=[],oe=[];Q.forEach(ee=>{const Me=ee.getAttribute("data-handle");tt(Me)?ce.push(ee):oe.push(ee)}),ie.push(...ce,...oe),ye.add("sale")}ie.forEach(Q=>{m.appendChild(Q)})},{isModalOpen:rn}=ta(),{closeImageZoomModal:sn,currentImageIndex:ln,goToNext:cn,goToPrev:un,handleTouchEnd:dn,handleTouchStart:pn,imageContainer:fn,images:mn,isNavigating:hn,openImageZoomModal:da}=or(),{closeDesktopZoomModal:gn,desktopZoomActiveIndex:vn,isDesktopZoomModalOpen:yn,openDesktopZoomModal:pa,scrollToDesktopZoomImage:bn}=Yo(),{initYotpoWidgets:fa,shouldInitYotpo:ma}=uo({componentName:"Main Product"}),wn=()=>{sa.value=t.querySelector("[data-floating-container-mobile]"),Ve.value=t.querySelector("[data-pdp-info]")},Le=(s,m=!1)=>{if(!x.value)return;const y=sa.value;if(!y){U("[Allbirds section] - Main Product - handleDocking - No floating container!",{},new Error("No floating container!"));return}const B=y.style.position==="absolute";let S={duration:io.ELEMENT.HOVER.DEFAULT*.25};s===Ee.UP&&!m?S={...Xe.FADE_OUT_CTA,...S,pointerEvents:"none"}:(S={...Xe.FADE_IN_CTA,...S,pointerEvents:"auto"},B&&ue.set(y,{position:"fixed"})),ue.to(y,S),m&&ue.set(y,{position:"absolute"})},En=()=>{x.value?t.querySelector("[data-pdp-info]")?.scrollIntoView({behavior:"smooth",block:"center"}):window.scrollTo({behavior:"smooth",top:0})},Tt=()=>{if(!x.value){Pt();return}K.value?(Ke(),Ie.value?Sn():Pt()):Pt()},Pt=()=>{const s=t.querySelector("[data-pdp-atf-container]"),m=document.querySelector("main");if(!s){U("[Allbirds section] - Main Product - setupControlBehavior - Trigger element not found",{triggerElement:s},new Error("Trigger element not found"));return}O.value=Fe.create({end:"bottom bottom",endTrigger:m,onLeave:()=>{Le(Ee.UP,!0)},onLeaveBack:()=>{Le(Ee.UP)},onToggle:y=>{y.isActive&&Le(Ee.DOWN)},start:"bottom top",trigger:s})},Ue=()=>{const s=!P.value&&!D.value;Le(s?Ee.DOWN:Ee.UP)},Sn=()=>{const s=t.querySelector("[data-pdp-atc]"),m=document.querySelector("main.template-product");if(!s){Le(Ee.DOWN),Se("[Allbirds section] - Main Product - setupStickyATCBehavior - ATC container not found, showing sticky bar");return}if(O.value=Fe.create({end:"bottom top+=10%",onToggle:y=>{P.value=y.isActive,Ue()},start:"top bottom-=10%",trigger:s}),m&&(q.value=Fe.create({end:"bottom top",onEnter:()=>{D.value=!0,Ue()},onEnterBack:()=>{D.value=!0,Ue()},onLeave:()=>{D.value=!0,Ue()},onLeaveBack:()=>{D.value=!1,Ue()},start:"bottom bottom",trigger:m}),D.value=q.value.isActive),P.value=O.value.isActive,Ue(),m){let y=m.offsetHeight;L.value=new ResizeObserver(()=>{const B=m.offsetHeight;Math.abs(B-y)>10&&(y=B,Fe.refresh())}),L.value.observe(m)}ot("[Allbirds section] - Main Product - setupStickyATCBehavior - ScrollTrigger initialized",{isAtcVisible:P.value,isPastProductEnd:D.value})},Ct=()=>{O.value&&(O.value.kill(),O.value=null),q.value&&(q.value.kill(),q.value=null),L.value&&(L.value.disconnect(),L.value=null),P.value=!1,D.value=!1},An=()=>{const s=Object.keys(Oe.value).length;s>0?ot("[Allbirds section] - Main Product - Colorway variants data initialized",{colorwayCount:s,sampleData:Object.keys(Oe.value).slice(0,2)}):Se("[Allbirds section] - Main Product - No colorway variants data found")},In=()=>{k.value=t.dataset.productOneSize==="true",t.querySelectorAll("[data-variant-id]").forEach(m=>{p.value.push({available:m.dataset.variantAvailable==="true",colorName:t.dataset.productC
1olor,compareAtPrice:Number(m.dataset.variantCompareAtPrice||0),id:Number(m.dataset.variantId),price:Number(m.dataset.variantPrice||0),productTitle:t.dataset.productName,sku:m.dataset.variantSku,title:m.dataset.variantTitle,titleHandleized:m.dataset.variantTitleHandleized})}),k.value&&p.value.length>0&&ba(p.value[0].id)},_n=()=>{j.value=!0},ha=()=>{j.value=!1,de.value=!1},Mn=()=>{if(!h.value||!d.value||!xa(h.value))return;const s=kt.PLACEMENT.PRODUCT_UPDATES_FORM,m=h.value;try{const y=vo({email:m,isMobile:x.value,pdpSignupFlow:bo.PDP_SIGNUP_FLOW_SOLD_OUT,placementSource:s,productData:yo({productColor:t.dataset.productColor,productEdition:t.dataset.productEdition,productGender:t.dataset.productGender,productMaster:t.dataset.productMaster,productMaterial:t.dataset.productMaterial,productName:t.dataset.productName,productSilhouette:t.dataset.productSilhouette,sku:d.value?.sku})});po(m,fo()),mo({additionalTraits:ho({subscriptionSource:s,subscriptionStatus:!0}),email:m}),go({cmsProductId:t.dataset.productId||null,messageMedium:kt.MEDIUM.EMAIL,messageType:kt.TYPE.ALL,optInStatus:!0,placement:s,sku:d.value?.sku||null}),wo(y),de.value=!0,h.value=""}catch(y){U("[Allbirds section] - Main Product - handleNotifySubmit - Error submitting notify form",{origination:s},y),he.value=!0,h.value=""}},Tn=s=>{s&&Nt({searchParams:{size:s.titleHandleized,variant:String(s.id)}})},Pn=()=>{f.value=!0},Cn=()=>{f.value=!1},xn=async()=>{if(!xt(I.value)){U("[Allbirds section] - Main Product - handleSendAsGiftModalConfirm - Invalid date",{sendAsGiftModalSendOn:I.value},new Error("Invalid date"));return}const s=mr({emailRecipient:g.value,messageRecipient:E.value,nameRecipient:M.value,sendOn:I.value});try{const m=await C(d.value.id,1,s);ve.openDrawer(),Ia(m,window?.ALLBIRDS?.page?.productDetailsPage?.product,Ta.PDP,d?.value?.title)}catch(m){U("[Allbirds section] - Main Product - handleSendAsGiftModalConfirm - Error adding gift card to cart",{giftCardLineItemProperties:s},m)}On(),f.value=!1},On=()=>{g.value=null,M.value=null,E.value=null,I.value=null},ga=()=>xa(g.value),xt=()=>Ao(I.value),va=()=>Io(M.value),ya=()=>_o(E.value),Ln=()=>ga()&&va()&&ya()&&(I.value===null||xt()),ba=s=>{if(!t.querySelector(`[data-variant-id="${s}"]`))return;const y=p.value.find(B=>B.id===s);y&&(d.value=y,F.value=!0,A.value=!y.available,Ye.value=y.title,_a({variantSize:y.title}))},Dn=s=>{we.value=!0,ba(s)},wa=s=>{s.key==="Escape"&&j.value&&ha()},kn=async()=>{if(!d.value)return;const s=It.value.includes("FINAL SALE"),m=d.value.compareAtPrice,y=d.value.price;if(ne.isEnabled.value){const S=t.getAttribute("data-product-object"),ie=(S?JSON.parse(S):{}).images?.[0],ye=ie?.preview_image?.src||ie?.src||"";ne.openModal({colorway:d.value.colorName||"",image:ye,price:Ca(y),size:d.value.title||"",title:d.value.productTitle||""})}else ve.openDrawer();const B=Mo({colorName:d.value.colorName,compareAtPrice:m>y?m:null,isFinalSale:s,masterName:d.value.productTitle});try{const S=await C(d.value.id,1,B);Ia(S,window?.ALLBIRDS?.page?.productDetailsPage?.product,Ta.PDP,d?.value?.title)}catch(S){U("[Allbirds section] - Main Product - handleAddToCartClick - Error adding item to cart",{itemCartProperties:B},S)}},Nn=()=>{ot("[Allbirds section] - Main Product - initProductSwiper");const s={...hr,breakpoints:{0:{slidesPerView:1,spaceBetween:10,speed:400}},on:{slideChange:y=>{const B=y.realIndex+1;b.value=B,Wt({pdpImagePosition:B,shopifyProduct:window.ALLBIRDS.page.productDetailsPage.product})}}};if(v=Co(t,s),!v){U("[Allbirds section] - Main Product - Swiper initialization failed");return}v.params.loop&&(Y.value=!1,G.value=!1);const m=t.querySelector(".swiper-pagination");m&&m.addEventListener("click",y=>{const B=y.target.closest(".swiper-pagination-bullet");if(B&&B.dataset.paginationIndex){const S=parseInt(B.dataset.paginationIndex,10);if(S!==v.realIndex)try{Wt({pdpImagePosition:S+1,shopifyProduct:window.ALLBIRDS.page.productDetailsPage.product})}catch(J){U("[Allbirds section] - Product Hero - Error tracking pagination click",{clickedIndex:S},J)}}})},Rn=()=>{v&&!v.destroyed&&(v.destroy(!0,!0),v=null)},ct=()=>{const s=t.querySelector("[data-pdp-gallery-swiper]");if(!s){U("[Allbirds section] - Main Product - Carousel element not found",{isFirstLoad:a});return}ue.fromTo(s,{opacity:0}
1,{...Xe.FADE_IN})};let ut=null,dt=null;const Ot=()=>{ut&&(clearTimeout(ut),ut=null),dt&&(dt(),dt=null)},Vn=()=>{if(!to()){ct();return}const s=fe(nt);if(s?.status===Te.SUCCESS||s?.status===Te.ERROR){ct();return}ut=setTimeout(()=>{Ot(),ct()},2e3),dt=De(()=>fe(nt),m=>{m?.status!==Te.SUCCESS&&m?.status!==Te.ERROR||(Ot(),ct())},{immediate:!0})},zn=()=>{const s=t.querySelector("[data-pdp-info]");s&&(a?ue.fromTo(s,{opacity:0},{...Xe.FADE_IN}):ue.set(s,{opacity:1}))},Fn=(s,m)=>{if(!s)return;let y=null;const B=Ye.value;if(B&&Oe.value&&Oe.value[s]){const ie=Oe.value[s].find(ye=>ye.title===B);ie&&(y=ie.id)}const S=`${window.location.origin}/products/${s}`,J={};m!==qe.ALL?J[yt]=m:J[yt]=null,y&&(J.variant=y),Nt({pathname:S,searchParams:J}),Po(["main-product","product-comparison","product-reviews"],{},()=>{Gn(),ma.value=!0,Pe(()=>{fa()}),window.dispatchEvent(new CustomEvent(lo))},ie=>{U("[Allbirds section] - Main Product - Failed to rerender section",{},ie)})},Ea=()=>{const s=t.querySelector("[data-product-color-selector]")?.getAttribute("data-default-colorway-name"),m=t.querySelector("[data-product-color-selector]")?.getAttribute("data-current-edition");s&&(V.value=s,z.value=m)},Bn=(s,m)=>{const{isDesktop:y}=Ma();y.value&&(V.value=s,z.value=m)},Gn=()=>{try{const s=t.getAttribute("data-product-object"),m=s?JSON.parse(s):{},y=window?.ALLBIRDS?.page?.productDetailsPage?.product;window.ALLBIRDS.page.productDetailsPage.product={...y,...m};const S=new URLSearchParams(window.location.search).get("size");_a({...S?{variantSize:S}:{}})}catch(s){U("[Allbirds section] - Main Product - Failed to send product viewed event",{},s)}},Zn=()=>{try{const s=t.getAttribute("data-product-object"),m=s?JSON.parse(s):{},B=(m.images||[]).map((J,ie)=>({alt:J.alt||`Product image ${ie+1}`,image:J.preview_image||J,media_type:J.media_type||"image"})),S=t.getAttribute("data-gallery-lifestyle-images");if(S)try{const J=JSON.parse(S);Array.isArray(J)&&J.forEach(ie=>{B.push({alt:`Lifestyle image for ${m.title||"product"}`,image:{src:ie},media_type:"image"})})}catch{Se("[Allbirds section] - Main Product - Failed to parse gallery lifestyle images attribute",{lifestyleImagesAttr:S})}return B}catch(s){return U("[Allbirds section] - Main Product - Failed to prepare image data",{},s),[]}},Yn=s=>{if(!v)return;const y=v.slides?.[v.activeIndex]?.getAttribute("data-image-index");y!=null&&(eo({location:Pa.LOCATIONS.PDP,name:"pdp-zoom-cta",type:Pa.TYPES.BUTTON}),Sa(Number(y),s))},Sa=(s,m=null)=>{try{const y=Zn();if(y.length===0)return;if(x.value){const B=t.getAttribute("data-product-object"),S=B?JSON.parse(B):null;da(s,y,S)}else{const S=m?.target?.closest("button")?.querySelector("img[data-flip-id]");pa(s,y,S)}}catch(y){U("[Allbirds section] - Product Hero - Failed to handle image click",{imageIndex:s},y)}};De(d,s=>{s&&Tn(s)}),De(Ye,()=>{Pe(()=>{Mt()})}),De(R,()=>{Pe(()=>{Mt()})}),De(()=>K.value,()=>{x.value&&(Ct(),Le(Ee.UP),Tt())}),De(()=>x.value,(s,m)=>{s!==m&&(Ct(),Le(Ee.UP),Tt())});const at=()=>{if(!Ve.value)return;const s=document.querySelector("[data-header-bar]"),B=(s?Math.max(0,s.getBoundingClientRect().bottom):0)+20,S=window.innerHeight,J=Ve.value.offsetHeight;if(S<J){const ie=window.pageYOffset||document.documentElement.scrollTop,ye=Ve.value.closest("[data-pdp-atf-container]")||Ve.value.parentElement,Q=ye?ye.offsetTop:0,ce=J-S+20;if(ie>=Q){const oe=ie-Q,ee=B-ce,Me=Math.max(B-oe,ee);Ve.value.style.top=`${Me}px`;return}}Ve.value.style.top=`${B}px`},Aa=()=>{const s=t.querySelector("[data-pdp-info]");if(!s)return;const m=window.innerHeight,y=s.offsetHeight;la.value=m>y},Un=()=>{at(),window.addEventListener("scroll",at,{passive:!0}),window.addEventListener("resize",at,{passive:!0})},qn=()=>{window.removeEventListener("scroll",at),window.removeEventListener("resize",at)},Xn=()=>{u.value&&nn.value.length===0&&(u.value=!1,T.value=!1,R.value=qe.ALL,Nt({searchParams:{[yt]:void 0,[qe.SALE]:void 0}}))},$n=s=>u.value?s:!0;return Kn(()=>{ot("[Allbirds section] - Main Product - onMounted");const s=t.querySelector("[data-product-color-selector]");if(s){const S=s.querySelector(".swatch-group");S&&(_t.value=Array.from(S.querySelectorAll("[data-color-swatch]")))}Nn(),Vn(),Ea(),wn(),An(),In();try{It.value=JSON.parse(t.dataset.productTags||"[]")}catch(S){U("[Allbirds section] - Main Product - onMounted - Error parsing product tags",{},S),It.value=[]}const m=new URL(window.location.href),y=m.searchParams.get("size"),B=m.searchParams.get("variant");if(y||B){const S=p.value.find(J=>J.titleHandleized.toLowerCase()===y?.toLowerCase()||J.id===Number(B));S&&(d.value=S,F.value=!0,A.value=!S.available,Ye.value=S.title)}Pe(()=>{Mt()}),zn(),Le(Ee.UP),Tt(),ma.value=!0,fa(),Pe(()=>{Un(),Aa()}),ae=te(Aa),Xn(),window.addEventListener("keydown",wa)}),Za(()=>{Rn(),Ot(),Ct(),qn(),ae&&ae(),window.removeEventListener("keydown",wa)}),{activeVariant:d,closeDesktopZoomModal:gn,closeImageZoomModal:sn,closeNotifyModal:ha,closeSendAsGiftModal:Cn,colorwayEdition:z,colorwayName:V,currentImageIndex:ln,currentSlideIndex:b,desktopZoomActiveIndex:vn,formattedVariantPrice:$,genderTab:re,goToNext:cn,goToPrev:un,handleAddToCartClick:kn,handleFloatingSelectSizeClick:En,handleImageClick:Sa,handleNotifySubmit:Mn,handleOpenGiftModalClick:Pn,handleSendAsGiftModalConfirm:xn,handleSetCurrentColorway:Fn,handleTouchEnd:dn,handleTouchStart:pn,handleVariantClick:Dn,handleZoomCtaClick:Yn,hasUserInteracted:we,hideYotpoReviews:Qe,imageContainer:fn,images:mn,isColorwaySelected:on,isColorwaySizeAvailable:tt,isDesktopZoomModalOpen:yn,isFinalSaleTooltipOpen:X,isMobile:x,isModalOpen:rn,isNavigating:hn,isNotifyMo
1dalError:he,isNotifyModalOpen:j,isNotifyModalSuccess:de,isOnSalePdp:u,isSaleProduct:T,isSendAsGiftModalOpen:f,isSendAsGiftModalValid:Ln,isSizeSelected:F,isStickyAtcVariant:Ie,isUnavailableSelected:A,isValidDate:xt,isValidEmail:ga,isValidMessage:ya,isValidName:va,notifyEmail:h,openDesktopZoomModal:pa,openImageZoomModal:da,openNotifyModal:_n,openSizeChart:H,productPrice:w,scrollToDesktopZoomImage:bn,selectedEdition:R,sendAsGiftModalGreeting:E,sendAsGiftModalSendOn:I,sendAsGiftModalToEmail:g,sendAsGiftModalToName:M,setColorwayName:Bn,setDefaultColorwayName:Ea,shouldShowColorwayGroup:$n,shouldShowStickyLayout:Z,showZoomCta:N,swiperIsBeginning:Y,swiperIsEnd:G}}}).mount(t)}}new gr;
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.