PageSourceSearch

https://www.bonescoffee.com/cdn/shop/t/332/assets/section-toggletip.min.js?v=171959813546867975751787600693

js bonescoffee.com collected 2026-09-25 19:36:37 UTC 2,959 bytes, 1 lines download raw bytes

1!function(t){"function"==typeof define&&define.amd?define(t):t()}((function(){"use strict";const t="is-active",i="is-visible",e=(t,i,e,s)=>{e&&0!=s?t.setAttribute(i,e):t.removeAttribute(i)};function s(t){return t=t||2e3,new Promise((i=>{setTimeout((()=>{i()}),t)}))}class n extends HTMLElement{constructor(){super(),this.classes={active:"is-active",visible:"is-visible"},this.content={trigger:this.querySelector(".js-toggletip-button"),content:this.querySelector(".js-toggletip-content"),close:this.querySelector(".js-toggletip-close")},this.state={marginInlineVar:"--margin-inline",originalPosition:this.getAttribute("tip-position")},this.handlers={triggerClick:this.t.bind(this),externalInteraction:this.i.bind(this),externalKeydown:this.o.bind(this),preventOverflow:this.h.bind(this)}}async l(){await s(210),this.setAttribute("tip-position",this.state.originalPosition)}h(){const{trigger:t,content:i}=this.content,e=this.getAttribute("tip-position"),s=t.getBoundingClientRect(),n=i.getBoundingClientRect(),o=window.innerWidth,c=16,r=s.left+s.width/2,a=n.width/2,h="right"==e&&o-s.right-c<n.width,l="left"==e&&s.left-c<n.width;(h||l)&&this.setAttribute("tip-position","top");let d=0;r-a<c?d=c-(r-a)+"px":r-a+n.width>o-c&&(d=o-24-(r-a+n.width)+"px"),i.style.setProperty(this.state.marginInlineVar,d)}p(n=!0){const{trigger:o,content:c}=this.content;let r=n?c:o;o.setAttribute("aria-expanded",n),async function(n,o=!0,c=300,r=!1){o&&(r&&e(n,"aria-hidden",void 0,!1),n.classList.add(t),await s(1),n.classList.add(i)),o||(n.classList.remove(i),await s(c),n.classList.remove(t),r&&e(n,"aria-hidden","true"))}(c,n),n?(this.u(),window.requestAnimationFrame(this.handlers.preventOverflow)):(this.m(),this.l()),r.focus()}i(t){const{target:i,type:e}=t;(!this.contains(i)||"click"===e&&i==this.content.close)&&this.p(!1)}t(){const t="true"===this.content.trigger.getAttribute("aria-expanded");this.p(!t)}o(t){"Escape"===t.key&&this.p(!1)}u(){document.addEventListener("click",this.handlers.externalInteraction),document.addEventListener("keydown",this.handlers.externalKeydown),document.addEventListener("focusin",this.handlers.externalInteraction)}m(){document.removeEventListener("click",this.handlers.externalInteraction),document.removeEventListener("keydown",this.handlers.externalKeydown),document.removeEventListener("focusin",this.handlers.externalInteraction)}v(){new ResizeObserver(this.handlers.preventOverflow).observe(document.body)}k(){const{trigger:t,content:i}=this.content;e(t,"aria-expanded",!1),e(t,"aria-haspopup","dialog"),e(i,"tabindex","0"),e(i,"role","dialog"),e(i,"aria-label",t.textContent.trim())}disconnectedCallback(){const{trigger:t}=this.content;t&&t.removeEventListener("click",this.handlers.triggerClick)}connectedCallback(){const{trigger:t,content:i}=this.content;t&&i&&(this.k(),this.v(),t.addEventListener("click",this.handlers.triggerClick))}}var o,c;o="toggle-tip",c=n,void 0===customElements.get(o)&&customElements.define(o,c)}));

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.