PageSourceSearch

https://www.allbirds.com/cdn/shop/t/4159/assets/use-post-atc-modal.js

js allbirds.com collected 2026-10-02 02:17:12 UTC 3,763 bytes, 1 lines download raw bytes

1import{i as y,w as L,g as c}from"./ScrollTrigger.js";import{N as _}from"./navigation.js";import{P as U}from"./pagination.js";import{r as o,w as W}from"./vue.esm-bundler.js";import{a as Y,b as x}from"./use-focus-management.js";import{u as K}from"./use-scroll-lock.js";import{b as q}from"./animations.js";import{i as j}from"./swiper.js";const i=o(!1),h=o(null),R=o([]),M=o({continueShoppingLabel:"Continue shopping",freeShippingMessageAchieved:"You've earned free shipping!",freeShippingMessageNotAchieved:"Spend {amount} more to earn free shipping!",freeShippingThreshold:7500,recommendationsTitle:"You may also like",viewCartLabel:"View cart & check out"});function oe(l){l.recommendations&&(R.value=l.recommendations),l.settings&&(M.value={...M.value,...l.settings})}function ae(l){const F=x(),{lockScroll:N,unlockScroll:E}=K(),T=o(window?.ALLBIRDS?.settings?.features?.postAtcModal||!1);let t=null,u=null,p=null,m=!1,f=!1,s=null,r=null,n=null,d=null,A=null,w=null;const g=o(null),S=o(null);let v=null;const k=e=>{const a=e?.value||e||document;return s=a.querySelector("[data-post-atc-modal]"),r=a.querySelector("[data-post-atc-overlay]"),n=a.querySelector("[data-post-atc-panel]"),d=a.querySelector("[data-post-atc-recommendations]"),A=a.querySelector("[data-post-atc-pagination]"),w=a.querySelector("[data-post-atc-close]"),!s||!r||!n?(L("[Allbirds composable] - usePostAtcModal - setupAnimation - Required DOM elements not found",{foundElements:{modal:!!s,overlay:!!r,panel:!!n}}),null):(g.value=n,S.value=w,t||(t=c.timeline({onReverseComplete:()=>{c.set(s,{pointerEvents:"none"}),P()},onStart:()=>{c.set(s,{pointerEvents:"auto"})},paused:!0}),t.fromTo(r,{opacity:0},{duration:.3,ease:q.SINE_OUT,opacity:1},0),t.fromTo(n,{opacity:0,scale:.95},{duration:.4,ease:q.POWER3_OUT,onComplete:I,opacity:1,scale:1},.1),c.set(s,{pointerEvents:"none"}),c.set(r,{opacity:0}),c.set(n,{opacity:0,scale:.95}),t))},I=()=>{if(!d||u)return;u=j(d,{breakpoints:{768:{slidesOffsetAfter:24,slidesOffsetBefore:24,slidesPerView:4}},modules:[_,U],pagination:{clickable:!0,el:A},slidesOffsetAfter:20,slidesOffsetBefore:20,slidesPerView:2.4,spaceBetween:10});const e=d.querySelector(".swiper");e&&requestAnimationFrame(()=>{e.classList.add("opacity-100")})},P=()=>{u&&(u.destroy(!0,!0),u=null)},C=e=>{e.key==="Escape"&&i.value&&b()},B=()=>{f||(document.addEventListener("keydown",C),f=!0)},O=()=>{f&&(document.removeEventListener("keydown",C),f=!1)},V=e=>{m||(k(e),v=Y({containerRef:g,focusFirstOnActivate:o(!0),focusTriggerElementRef:S,initialFocusSelector:"[data-post-atc-modal-view-cart-button]",isActive:o(null),trapFocus:!0}),p=W(i,a=>{t||(t=k(e)),t&&(a?(v?.activateFocusManagement(),N(),t.timeScale(1).play(),requestAnimationFrame(B)):(v?.deactivateFocusManagement(),O(),t.progress()>0&&t.timeScale(1.5).reverse()))}),m=!0)},z=()=>{m&&(p&&(p(),p=null),t&&(t.kill(),t=null),P(),O(),i.value&&E(),s=r=n=d=A=w=null,g.value=null,S.value=null,v=null,m=!1)},G=e=>{if(!e){L("[Allbirds composable] - usePostAtcModal - openModal called without product data");return}h.value={colorway:e.colorway||"",image:e.image||"",price:e.price||"",size:e.size||"",title:e.title||""},i.value=!0,y("[Allbirds composable] - usePostAtcModal - Modal opened",{product:h.value.title,section:l})},b=()=>{i.value&&(E(),i.value=!1,y("[Allbirds composable] - usePostAtcModal - Modal closed",{section:l}))};return{addedProduct:h,cleanup:z,closeModal:b,handleRecommendationClick:e=>{y("[Allbirds composable] - usePostAtcModal - Recommendation clicked",{handle:e?.handle,productName:e?.productName,section:l})},init:V,isEnabled:T,isOpen:i,openModal:G,recommendations:R,settings:M,viewCart:()=>{b(),F.openDrawer(),y("[Allbirds composable] - usePostAtcModal - View cart clicked",{section:l})}}}export{oe as i,ae as u};

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.