PageSourceSearch

https://us.tonies.com/cdn/shop/t/2834/assets/product.D-8GmEpH.bundle.min.js

js tonies.com collected 2026-09-24 18:02:30 UTC 20,185 bytes, 69 lines download raw bytes

1var K=Object.defineProperty;var _=i=>{throw TypeError(i)};var j=(i,t,e)=>t in i?K(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var A=(i,t,e)=>j(i,typeof t!="symbol"?t+"":t,e),V=(i,t,e)=>t.has(i)||_("Cannot "+e);var T=(i,t,e)=>t.has(i)?_("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,e);var f=(i,t,e)=>(V(i,t,"access private method"),e);import"./VideoPlaceholder.BG-lHELp.chunk.min.js";import{c as F}from"./focus-trap.esm.DB7ZyUfP.chunk.min.js";import{d as r,B as l}from"./customElements.CVxHRH-p.chunk.min.js";import{h as G,g as z}from"./utmTracking.H8iyGy-b.chunk.min.js";import{l as Y}from"./loadScript.JDgUFPIx.chunk.min.js";import{w as X}from"./vue.esm.CU4NPk8R.chunk.min.js";import{u as Z}from"./useToniesBreakpoints.DNFh2WfK.chunk.min.js";import{l as u}from"./locales.Bc-_KeTj.chunk.min.js";import{p as W,b as J}from"./analytics.BRpKoWry.chunk.min.js";import{G as k}from"./giftreggie.s6E0j6pt.chunk.min.js";import{u as Q}from"./useHeaderHeight.B6k40c0p.chunk.min.js";import{S as tt}from"./gsap.BDY7-3A4.chunk.min.js";import{W as h}from"./Repository.C9Ww5KhN.chunk.min.js";import{r as et,s as O}from"./handleFocus.DpBiQh6s.chunk.min.js";import"./faq-accordions.CsWDO6KY.chunk.min.js";import"./animationObserver.BmJzsoRD.chunk.min.js";import"./cartStore.UjSR_pbU.chunk.min.js";import"./ShopifyApi.CAemAGdE.chunk.min.js";import"./preload-helper.C1FmrZbK.chunk.min.js";import"./index.Cs9MTHPS.chunk.min.js";import"./index.BH8shDJx.chunk.min.js";import"./breakpoints.B4Zc9sYF.chunk.min.js";const v={INLINE:"inline",POPUP:"popup"},P="https://cdn.channelsight.com/widget/scripts/cswidget.loader.js",b="#csModalButtonClose",B=".csWidgetModal";class p extends l{setup(){this.focusTrap=null,this.modalObserver=null,this.appearanceObserver=null,this.handleEscapeKey=null,this.isWaitingForModal=!1,this.onMounted(async()=>{this.assetId=this.dataset.assetId,this.skus=this.dataset.skus,this.type=this.dataset.type??v.INLINE,this.source=this.dataset.source??"",await this.render();const t=document.querySelectorAll(`script[src="${P}"]`),e=document.getElementById("cswidgetjs"),s=document.querySelector(B);t.forEach(a=>{a.remove()}),e&&e.remove(),s&&s.remove(),await p.loadWidgetScript()&&this.type===v.POPUP&&this.setupModalFocusHandling()}),this.onUnmounted(()=>{this.deactivateFocusTrap(),this.appearanceObserver&&(this.appearanceObserver.disconnect(),this.appearanceObserver=null)})}get elementType(){return this.type===v.INLINE?"div":"button"}static async loadWidgetScript(){try{return await Y(P),!0}catch(t){return console.warn("ChannelSight widget failed to load",t),!1}}async render(){const t=this.innerHTML,e=await G(),s=z(),o=e?Object.entries(s).map(([a,n])=>`data-${a.replace("_","-")}=${n}`).join(" "):"";this.innerHTML=`
2      <${this.elementType}
3        class="channel-sight-widget cswidget"
4        data-wtbsource="${this.source}"
5        data-asset-id="${this.assetId}"
6        data-product-sku="${this.skus}"
7        data-cookie-consent="${e}"
8        ${o}
9      >
10        ${t}
11      </${this.elementType}>
12    `}setupModalFocusHandling(){this.listen("click",this.handleWidgetClick.bind(this),this.firstElementChild)}handleWidgetClick(t){if(this.isWaitingForModal){t.stopImmediatePropagation();return}this.isWaitingForModal=!0,this.observeModalAppearance()}observeModalAppearance(){this.appearanceObserver&&this.appearanceObserver.disconnect();const t=s=>{this.handleModalOpen(s),this.appearanceObserver&&(this.appearanceObserver.disconnect(),this.appearanceObserver=null)},e=new MutationObserver(()=>{const s=document.querySelector(B);s&&p.isModalVisible(s)&&t(s)});this.appearanceObserver=e,e.observe(document.body,p.getObserverConfig())}static isModalVisible(t){return getComputedStyle(t).display!=="none"}static getObserverConfig(){return{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","class"]}}handleModalOpen(t){this.isWaitingForModal=!1,this.setupFocusTrap(t),this.setupEscapeKeyHandler(t),this.setupCloseButtonHandler(t),this.setupModalRemovalObserver(t)}setupFocusTrap(t){this.focusTrap=F(t,{initialFocus:b,escapeDeactivates:!0,clickOutsideDeactivates:!0,onDeactivate:()=>{this.focusTrap=null}}),this.focusTrap.activate()}setupEscapeKeyHandler(t){this.handleEscapeKey=e=>{e.key==="Escape"&&this.closeModal(t)},document.addEventListener("keydown",this.handleEscapeKey)}setupCloseButtonHandler(t){const e=t.querySelector(b);e&&e.addEventListener("click",()=>{this.closeModal(t)})}setupModalRemovalObserver(t){this.modalObserver=new MutationObserver(e=>{e.forEach(s=>
12{s.removedNodes.forEach(o=>{p.isModalRemoved(o,t)&&this.deactivateFocusTrap()})})}),this.modalObserver.observe(document.body,{childList:!0,subtree:!0})}deactivateFocusTrap(){this.isWaitingForModal=!1,this.focusTrap&&(this.focusTrap.deactivate(),this.focusTrap=null),this.cleanupEventListeners(),this.cleanupObservers()}cleanupEventListeners(){this.handleEscapeKey&&(document.removeEventListener("keydown",this.handleEscapeKey),this.handleEscapeKey=null)}cleanupObservers(){this.modalObserver&&(this.modalObserver.disconnect(),this.modalObserver=null)}closeModal(t){const e=t.querySelector(b);e&&e.click(),this.deactivateFocusTrap()}static isModalRemoved(t,e){return t===e||t.nodeType===Node.ELEMENT_NODE&&(t==null?void 0:t.contains(e))}}r("channel-sight-widget-component",p);const R="is-open",st=Z(),D=st.smaller("laptopS");class it extends l{setup(){this.image=null,this.onMounted(()=>{this.image=this.querySelector("img"),this.modal=this.querySelector("[data-modal]"),this.openModalButton=this.querySelector("[data-open-modal]"),this.closeModalButton=this.querySelector("[data-close-modal]"),this.bindEventListeners();const t=X(D,()=>{this.openModalButton.setAttribute("tabindex",D.value?"0":"-1")},{immediate:!0});this.onUnmounted(()=>{t()})})}bindEventListeners(){this.listen("mousemove",t=>this.handleMouseMove(t),this.image),this.listen("mouseleave",()=>this.handleMouseLeave(),this.image),this.listen("keydown",t=>this.handleKeyDown(t),document),this.listen("click",()=>this.openModal(),this.openModalButton),this.listen("click",()=>this.closeModal(),this.closeModalButton)}handleMouseMove(t){const e=t.currentTarget.getBoundingClientRect(),s=(t.clientX-e.left)/e.width*100,o=(t.clientY-e.top)/e.height*100;this.image.style.transformOrigin=`${s}% ${o}%`}handleMouseLeave(){this.image.style.transformOrigin="center center"}handleKeyDown(t){t.key==="Escape"&&this.closeModal()}openModal(){this.modal.classList.add(R)}closeModal(){this.modal.classList.remove(R)}}r("image-zoom-component",it);const{video_player_element:y}=u;class ot extends l{setup(){this.onMounted(()=>{this.playButton=this.querySelector("[data-play-button]"),this.playIcon=this.querySelector("[data-play-icon]"),this.pauseIcon=this.querySelector("[data-pause-icon]"),this.videoStatus=this.querySelector("[data-video-status]"),this.video=this.querySelector("video"),this.videoTitle=this.video.getAttribute("aria-label")??"video",this.bindEventListeners()})}bindEventListeners(){this.listen("click",()=>this.handlePlayButtonClick(),this.playButton)}showPlayIcon(){this.playIcon.style.display="inline-block",this.pauseIcon.style.display="none"}showPauseIcon(){this.pauseIcon.style.display="inline-block",this.playIcon.style.display="none"}pause(){this.video.pause(),this.showPlayIcon(),this.playButton.setAttribute("aria-label",y.aria.play_label),this.playButton.setAttribute("aria-pressed","false"),this.setAttribute("data-paused",""),this.announceStatus(y.aria.paused_label.replace("{videoTitle}",this.videoTitle))}play(){this.video.play(),this.showPauseIcon(),this.playButton.setAttribute("aria-label",y.aria.pause_label),this.playButton.setAttribute("aria-pressed","true"),this.removeAttribute("data-paused"),this.announceStatus(y.aria.playing_label.replace("{videoTitle}",this.videoTitle))}announceStatus(t){this.videoStatus.textContent=t}handlePlayButtonClick(){this.video.paused?this.play():this.pause()}}r("video-player-component",ot);var m,$,H;class at extends l{constructor(){super(...arguments);T(this,m)}setup(){this.media=[],this.thumbnails=[],this.onMounted(()=>{this.media=this.querySelectorAll("[data-media]"),this.thumbnails=this.querySelectorAll("[data-thumbnail]"),f(this,m,$).call(this)})}}m=new WeakSet,$=function(){this.thumbnails.forEach((e,s)=>{this.listen("click",()=>f(this,m,H).call(this,e,s),e)})},H=function(e,s){this.thumbnails.forEach((o,a)=>{o.toggleAttribute("data-selected",a===s)}),this.media.forEach((o,a)=>{o.toggleAttribute("data-selected",a===s)})};r("media-gallery-component",at);class E extends l{setup(){this.registries=[],this.onMounted(()=>{this.render(),this.bindEventListeners(),this.refs.initialFocus&&
12(this.focusTrap=F(this,{initialFocus:this.refs.initialFocus,onDeactivate:()=>{this.close()}}),this.focusTrap.activate())}),this.onUnmounted(()=>{this.focusTrap&&this.focusTrap.deactivate()})}bindEventListeners(){this.querySelectorAll("[data-registry]").forEach(t=>{this.listen("click",e=>this.handleRegistrySelect(e),t)}),this.listen("click",()=>this.handleAddProductClick(),this.refs.addProductButton)}handleRegistrySelect(t){const e=this.registries.find(s=>String(s.id)===t.target.value);this.dispatchEvent(new CustomEvent("registrySelect",{detail:e,bubbles:!0}))}handleAddProductClick(){const t=this.refs.addProductButton;t&&(t.disabled=!0),this.dispatchEvent(new CustomEvent("addProductClick",{bubbles:!0}))}static formatDate(t){const e=new Date(t).toDateString().split(" ");return`${e[1]} ${e[2]}, ${e[3]}`}renderRegistries(){return this.registries.map((t,e)=>`
13      <label class="registry-select-modal__registry-option">
14        <input
15          type="radio"
16          name="registry"
17          value="${t.id}"
18          data-registry
19          ${e===0?"checked":""}
20        />
21        <span>
22          <span class="registry-select-modal__registry-name">${t.name}</span>
23          <span class="registry-select-modal__registry-info">
24            <span>Name:</span> ${t.registrant_first} ${t.registrant_last}
25          </span>
26          ${t.description?`
27            <span class="registry-select-modal__registry-info">
28              <span>Type:</span> ${t.description}
29            </span>
30            `:""}
31          <span class="registry-select-modal__registry-info">
32            <span>Date:</span> ${E.formatDate(t.event_date)}
33          </span>
34        </span>
35      </label>
36    `).join("")}close(){this.remove()}render(){this.innerHTML=`
37      <div class="registry-select-modal">
38        <button
39          type="button"
40          class="registry-select-modal__overlay"
41          title="${u.accessibility.modal.close}"
42          on:click="/close"
43        ></button>
44        <div class="registry-select-modal__modal">
45          <button
46            type="button"
47            class="registry-select-modal__close"
48            title="${u.accessibility.modal.close}"
49            ref="initialFocus"
50            on:click="/close"
51          >
52            <svg width="20" height="19" viewBox="0 0 20 19" fill="none" xmlns="http://www.w3.org/2000/svg"><line x1="1.1318" y1="18.1025" x2="18.1024" y2="1.13194" stroke="#333333"/><line x1="1.8389" y1="1.1318" x2="18.8095" y2="18.1024" stroke="#333333"/></svg>
53          </button>
54          <div class="registry-select-modal__scroll-container">
55            <h2>${u.gift_registry.select_a_registry}</h2>
56            <div class="registry-select-modal__registries">
57              ${this.renderRegistries()}
58            </div>
59            <button
60              type="button"
61              class="registry-select-modal__add-product button button--flat"
62              ref="addProductButton"
63            >
64              ${u.gift_registry.add_product}
65            </button>
66          </div>
67        </div>
68      </div>
69    `,this.updatedCallback()}}r("registry-select-modal-component",E);const{customer:d,routes:{accountLoginUrl:nt}}=window.theme,rt={PRODUCT_HANDLE:"data-product-handle"},lt="/pages/create-a-registry",ct=2e3;class dt extends l{setup(){this.giftReggieSession=null,this.product=null,this.registries=[],this.selectedRegistry=null,this.onMounted(async()=>{if(d)if(await this.loadProduct(),d.gift_reggie.shared_secret)await this.initializeSession();else{const t=await k.registerUser(d.id),s=new DOMParser().parseFromString(t,"text/html").getElementById("customer-shared-secret").innerHTML;await this.initializeSession(s)}this.listen("click",()=>this.handleAddToRegistryClick(),this)})}async initializeSession(t){this.giftReggieSession=await k.initSession(d.email,d.gift_reggie.shared_secret?d.gift_reggie.shared_secret:t),await this.loadRegistries()}async loadProduct(){const t=this.getAttribute(rt.PRODUCT_HANDLE);t&&(this.product=await W.load({},{handle:t}))}async loadRegistries(){this.registries=[];const t=await this.giftReggieSession.getRegistries();this.loading=!1,this.registries=t.registries,[this.selectedRegistry]=this.registries}handleAddToRegistryClick(){if(!d){window.location.href=nt;return}if(!this.registries.length){window.location.href=lt;return}this.showModal()}showModal(){const t=document.createElement("registry-select-modal-component");t.registries=this.registries,[this.selectedRegistry]=this.registries,this.listen("addProductClick",async()=>{await this.addProduct(),t.close()}
69,t),this.listen("registrySelect",({detail:e})=>{this.selectedRegistry=e},t),document.body.appendChild(t)}async addProduct(){const t=this.refs.buttonText,e=t.textContent;await this.giftReggieSession.setRegistryProducts(this.selectedRegistry.id,this.product.id,this.product.selected_or_first_available_variant.id,1),t.textContent=u.gift_registry.product_added,setTimeout(()=>{t.textContent=e},ct)}}r("registry-button-component",dt);class ht extends l{setup(){this.scrollTrigger=null,this.onMounted(()=>{this.initScrollTrigger()}),this.onUnmounted(()=>{this.cleanup()})}initScrollTrigger(){const t=this.getAttribute("target-selector"),e=this.getAttribute("sticky-class")||"is-sticky",s=document.querySelector(t);if(!s)return;const o=this.firstElementChild;if(!o)return;const{height:a}=Q();this.scrollTrigger=tt.create({trigger:s,start:()=>`bottom bottom+=${a.value}`,end:()=>`bottom top+=${a.value}`,onToggle:n=>{o.classList.toggle(e,!n.isActive)}})}cleanup(){this.scrollTrigger&&(this.scrollTrigger.kill(),this.scrollTrigger=null)}}r("sticky-observer-component",ht);class ut extends l{setup(){const t=e=>{const s=e.target.closest("[href]");if(s){e.preventDefault();const o=new URL(s.href);window.history.pushState({},"",o.toString())}};this.onMounted(()=>{this.listen("click",t,this)})}}r("variant-selector-component",ut);const pt={PRODUCT_HANDLE:"data-product-handle"},c={SHOW:"",HIDE:"none"},I={ADD_FAILED:"Failed to add to wishlist:",REMOVE_FAILED:"Failed to remove from wishlist:"},{customer:C}=window.theme;class M extends l{setup(){this.isLoading=!1,this.product=null,this.wishlist=h.getWishlist(),this.onMounted(async()=>{C&&(this.setLoading(!0),await Promise.all([this.loadProduct(),h.fetchItems()]),this.setLoading(!1)),this.render(),this.bindEventListeners()})}get addButton(){return this.refs.addButton}get removeButton(){return this.refs.removeButton}get loader(){return this.refs.loader}async loadProduct(){const t=this.getAttribute(pt.PRODUCT_HANDLE);t&&(this.product=await W.load({},{handle:t}))}get isProductInWishlist(){return this.product?h.findItem(this.product,this.wishlist)!==void 0:!1}bindEventListeners(){this.listen("click",()=>this.addToWishlist(),this.addButton),this.listen("click",()=>this.removeFromWishlist(),this.removeButton)}async addToWishlist(){if(!C){M.openWishlistModal();return}this.canPerformWishlistAction()&&await this.performWishlistAction(()=>h.addItem(this.product),I.ADD_FAILED)}async removeFromWishlist(){this.canPerformWishlistAction()&&await this.performWishlistAction(()=>h.removeItem(this.product),I.REMOVE_FAILED)}canPerformWishlistAction(){return this.product&&!this.isLoading}async performWishlistAction(t,e){this.setLoading(!0);try{await t(),await h.fetchItems()}catch(s){console.warn(e,s)}finally{this.setLoading(!1),this.render()}}static openWishlistModal(){const t=new CustomEvent("openWishlistModal");document.dispatchEvent(t)}setLoading(t){this.isLoading=t,this.updateLoadingDisplay(t)}updateLoadingDisplay(t){const e=t?c.HIDE:c.SHOW,s=t?c.SHOW:c.HIDE;this.addButton&&(this.addButton.style.display=e),this.removeButton&&(this.removeButton.style.display=e),this.loader&&(this.loader.style.display=s)}render(){this.isLoading||(this.updateButtonDisplay(),this.hideLoader())}updateButtonDisplay(){this.isProductInWishlist?(this.showRemoveButton(),this.hideAddButton()):(this.showAddButton(),this.hideRemoveButton())}showAddButton(){this.addButton&&(this.addButton.style.display=c.SHOW)}hideAddButton(){this.addButton&&(this.addButton.style.display=c.HIDE)}showRemoveButton(){this.removeButton&&(this.removeButton.style.display=c.SHOW)}hideRemoveButton(){this.removeButton&&(this.removeButton.style.display=c.HIDE)}hideLoader(){this.loader&&(this.loader.style.display=c.HIDE)}}r("wishlist-button-component",M);const w={},mt=(i={})=>new Proxy(i,{get(t,e){return t[e]},set(t,e,s){return t[e]===s||(t[e]=s),!0},deleteProperty(t,e){return delete t[e],!0}}),gt=(i,t={})=>(w[i]||(w[i]=mt(t)),w[i]),yt=new DOMParser,S={},U=async i=>{const t=String(i);return S[t]||(S[t]=fetch(i).then(e=>e.text())),S[t]},q=i=>yt.parseFromString(i,"text/html"),ft=i=>{const t=new URL(i);return U(t).then(q)},vt=async(i,t="#MainContent")=>{const e=document.querySelector(t);if(e){const o=(await ft(i)).querySelector(t);o&&e.replaceWith(o)}},x=async(i,t)=>{const e=new URL(i);return e.searchParams.set("section_id",t),(await U(e).then(q)).querySelector(`#shopify-section-${t}`)},bt=async(i,t,e)=>{const s=`#shopify-section-${t}`,o=document.querySelector(e||s);if(o){const a=await x(i,t),n=e?a==null?void 0:a.querySelector(e):a;n&&o.replaceWith(n)}},wt=i=>{const t=()=>{const{baseUrl:n=window.location.origin,route:g=window.location.pathname}=i.dataset;return new URL(g,n)},e=()=>i.dataset.sectionId;return{reloadPage:n=>
69vt(t(),n),reloadSection:n=>bt(t(),e(),n),reloadSelf:async(n=`#${i.id}`)=>{const g=await x(t(),e()),L=g==null?void 0:g.querySelector(n);L&&i.replaceWith(L)}}};class N extends l{setup(){this.store=gt(this.dataset.sectionId),this.updateUrl(),this.lastUrl=new URL(window.location.href),this.bindHistoryEvents(),this.injectFormState(),this.handleHasStickyAtc(),this.updateInjectedAppElements(),et(),this.watch("data-reloading",t=>{t&&this.querySelectorAll("button").forEach(e=>{e.disabled=!0})})}updateUrl(){const t={variant:this.dataset.variantId,selling_plan:this.dataset.sellingPlan},e=new URL(window.location.href);Object.keys(t).forEach(s=>{t[s]?e.searchParams.set(s,t[s]):e.searchParams.delete(s)}),window.history.replaceState({},"",e.toString())}bindHistoryEvents(){const{reloadPage:t,reloadSection:e}=wt(this),s=["variant","selling_plan","option_values"],o=()=>{const a=new URL(window.location.href);this.dataset.route=a.toString(),a.pathname!==this.lastUrl.pathname?(this.dataset.reloading=!0,O(),t()):s.some(n=>a.searchParams.get(n)!==this.lastUrl.searchParams.get(n))&&(this.dataset.reloading=!0,O(),e())};this.onMounted(()=>{window.addEventListener("locationchange",o)}),this.onUnmounted(()=>{window.removeEventListener("locationchange",o)})}injectFormState(){const t=["quantity","selling_plan"];this.onMounted(()=>{const e=this.querySelector("form[data-product-id]");e&&(t.forEach(s=>{this.store[s]&&e.elements.namedItem(s)&&(e.elements.namedItem(s).value=this.store[s])}),this.onUnmounted(()=>{const s=new FormData(e);t.forEach(o=>{this.store[o]=s.get(o)})}))})}updateInjectedAppElements(){this.onMounted(()=>{const t=()=>{const s=this.querySelector("img.pdq-pdp__widget-icon");s&&!s.hasAttribute("aria-hidden")&&s.setAttribute("aria-hidden","true")};t();const e=new MutationObserver(t);e.observe(this,{childList:!0,subtree:!0}),this.onUnmounted(()=>{e.disconnect()})})}handleHasStickyAtc(){const t=this.dataset.stickyAtcEnabled==="true",e="footer--sticky-atc-enabled";if(t){const s=document.querySelector("[data-footer]");s&&!s.classList.contains(e)&&s.classList.add(e)}}}A(N,"observedAttributes",["data-reloading"]);r("main-product-component",N);J.trackEvent("pdp_view",window.theme.product);

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.