PageSourceSearch

https://www.avontic.com/cdn/shop/t/164/assets/avontic-team-orders.js?v=168754146853267016811791557317

js avontic.com collected 2026-10-09 22:43:05 UTC 7,814 bytes, 2 lines download raw bytes

1(()=>{"use strict";if(window.avonticTeamOrders)return;window.avonticTeamOrders=!0;const TEAM_AT=5,QUOTE_AT=10,ROLLOUT_AT=100,unitCache=new WeakMap,defaults=new WeakMap,announced=new Set,emit=(name,detail={})=>{window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:name,...detail}),document.dispatchEvent(new CustomEvent(`avontic:${name}`,{detail}))},esc=value=>window.CSS&&CSS.escape?CSS.escape(value):String(value).replace(/"/g,'\\"'),number=value=>new Intl.NumberFormat(document.documentElement.lang||"en-US").format(value),formIdOf=node=>node.closest("form")?.getAttribute("id")||"",quantityInput=formId=>formId&&(document.querySelector(`input[name="quantity"][form="${esc(formId)}"]`)||document.getElementById(formId)?.querySelector('input[name="quantity"]'))||null,variantId=formId=>{if(!formId)return"";const form=document.getElementById(formId),live=[...document.querySelectorAll(`[name="id"][form="${esc(formId)}"]`),...form?form.querySelectorAll('[name="id"]'):[]].find(input=>!input.disabled&&input.value);return live?String(live.value):""},unitsPerItem=(strip,id)=>{if(!unitCache.has(strip)){let map2=null;try{map2=JSON.parse(strip.querySelector("[data-avt-units]")?.textContent||"null")}catch{map2=null}unitCache.set(strip,map2)}const map=unitCache.get(strip);return map&&id&&map[id]?Number(map[id])||1:map?0:1},quoteHref=(strip,units,id)=>{const url=new URL(strip.dataset.quoteBase||"/pages/business-solutions",window.location.origin);units>0&&url.searchParams.set("quantity",String(units));const formId=strip.dataset.formId||formIdOf(strip);id&&url.searchParams.set("pack_count",String(Math.max(1,parseInt(quantityInput(formId)?.value,10)||1)));const params=new URLSearchParams(location.search);return["preview_theme_id","_fd","pb","currency","country","locale","model","smartfit_model"].forEach(key=>{params.has(key)&&url.searchParams.set(key,params.get(key))}),id&&url.searchParams.set("variant",id),url.hash="avb-quote",`${url.pathname}${url.search}${url.hash}`},syncCard=(productId,units)=>{const tier=units>=ROLLOUT_AT?"100":units>=QUOTE_AT?"10":"1";document.querySelectorAll(`[data-avt-card="${esc(productId)}"]`).forEach(card=>{card.querySelectorAll("[data-avt-tier]").forEach(item=>{const active=item.dataset.avtTier===tier;item.classList.toggle("is-active",active),active?item.setAttribute("aria-current","step"):item.removeAttribute("aria-current")});const cta=card.querySelector("[data-avt-card-cta]"),strip=document.querySelector(`[data-avt-strip][data-product-id="${esc(productId)}"]`);cta&&strip&&(cta.href=quoteHref(strip,units,variantId(strip.dataset.formId||formIdOf(strip))))})},update=strip=>{if(!strip.isConnected)return;const title=strip.querySelector("[data-avt-title]"),sub=strip.querySelector("[data-avt-sub]"),status=strip.querySelector("[data-avt-status]"),cta=strip.querySelector("[data-avt-cta]"),ctaLabel=strip.querySelector("[data-avt-cta-label]");if(!title||!sub||!cta||!ctaLabel)return;defaults.has(strip)||defaults.set(strip,{title:title.textContent.trim(),sub:sub.textContent.trim(),cta:ctaLabel.textContent.trim()});const base=defaults.get(strip);strip.dataset.formId||(strip.dataset.formId=formIdOf(strip));const formId=strip.dataset.formId,quantity=Math.max(1,parseInt(quantityInput(formId)?.value,10)||1),id=variantId(formId),units=id?quantity*unitsPerItem(strip,id):0,noun=units===1?strip.dataset.nounOne||"case":strip.dataset.noun||"cases",hasPacks=strip.dataset.hasPacks==="true",isTeamProduct=strip.dataset.kind==="team",state=units>=QUOTE_AT?"quote":units>=TEAM_AT?"team":"default";state==="quote"?(title.textContent=`Ordering ${number(units)} ${noun}? Get a formal quote.`,sub.textContent=units>=ROLLOUT_AT?"Volume pricing may be available. We confirm fit for every model and a bulk shipping timeline with your quote.":"Volume pricing may be available at this quantity. PO, W-9 and tax-exempt support available.",ctaLabel.textContent=`Quote for ${number(units)}`,status.textContent=isTeamProduct?`${number(quantity)} ${quantity===1?"pack":"packs"} \xD7 ${number(units/quantity)} cases`:""):state==="team"?(title.textContent=`Buying ${number(units)} ${noun}?`,sub.textContent=isTeamProduct?"Mixing models or colors? One formal quote can cover every pack.":hasPacks?"Ready-made team packs are below \u2014 or get one quote for mixed models and colors.":"We can confirm every model and color and prepare one quote for your team.",ctaLabel.textContent=base.cta,status.textContent=isTeamProduct?`${number(quantity)} ${quantity===1?"pack":"packs"} \xD7 ${number(units/quantity)} cases`:""):(title.textContent=base.title,sub.textContent=base.sub,ctaLabel.textContent=base.cta,status.textContent=isTeamProduct&&units?`${number(quantity)} ${quantity===1?"pack":"packs"} \xD7 ${number(units/quantity)} cases = ${number(units)} devices`:""),id||(status.textContent=JSON.parse(document.querySelector("[data-avt-messages]")?.textContent||"{}").invalid_selection||""),cta.href=quoteHref(strip,units,id),cta.dataset.avtUnits=String(units);const more=strip.querySelector("[data-avt-more]");if(more){const anchor=more.getAttribute("href")||"",present=anchor.startsWith("#")&&anchor.length>1&&document.getElementById(anchor.slice(1));more.style.display=present?"":"none"}if(strip.dataset.state!==state){const previous=strip.dataset.state;if(strip.dataset.state=state,previous&&state!=="default"){strip.classList.remove("is-pulse"),strip.offsetWidth,strip.classList.add("is-pulse");const key=`${strip.dataset.productHandle}:${state}`;announced.has(key)||(announced.add(key),emit("av_team_nudge_shown",{state,units,product_handle:strip.dataset.productHandle}))}}syncCard(strip.dataset.productId,units)};let frame=0;const refresh=()=>{frame||(frame=window.requestAnimationFrame(()=>{frame=0,document.querySelectorAll("[data-avt-strip]").forEach(update)}))},settle=()=>{refresh(),window.setTimeout(refresh,90),window.setTimeout(refresh,320)};document.addEventListener("input",event=>{event.target instanceof HTMLInputElement&&event.target.name==="quantity"&&refresh()},!0),document.addEventListener("change",event=>{const target=event.target;target instanceof Element&&(target.matches('input[name="quantity"], [name="id"]')||target.closest('variant-picker, product-variants, form[action*="/cart/add"]'))&&settle()},!0),document.addEventListener("click",event=>{const target=event.target instanceof Element?event.target:null;if(!target)return;target.closest(".quantity-selector__button, quantity-selector button")&&settle();const tracked=target.closest("[data-avt-track]");if(tracked){const strip=document.querySelector("[data-avt-strip]");emit("av_team_order_click",{placement:tracked.dataset.avtTrack,units:Number(strip?.querySelector("[data-avt-cta]")?.dataset.avtUnits||1),product_handle:strip?.dataset.productHandle||""})}const more=target.closest("[data-avt-more]");if(more){const card=document.querySelector(more.getAttribute("href"));if(card){event.preventDefault();const reduce=window.matchMedia("(prefers-reduced-motion: reduce)").matches;card.scrollIntoView({behavior:reduce?"auto":"smooth",block:"start"}),card.setAttribute("tabindex","-1"),card.focus({preventScroll:!0})}}}),["variant:change","product:variant-change","variant:changed","shopify:section:load"].forEach(name=>
1document.addEventListener(name,settle)),new MutationObserver(records=>{records.some(record=>[...record.addedNodes].some(node=>node.nodeType===1&&(node.matches("[data-avt-strip], [data-avt-card], quantity-selector")||node.querySelector("[data-avt-strip], [data-avt-card], quantity-selector"))))&&settle()}).observe(document.documentElement,{childList:!0,subtree:!0}),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",settle,{once:!0}):settle()})();
2//# sourceMappingURL=/cdn/shop/t/164/assets/avontic-team-orders.js.map?v=168754146853267016811791557317

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.