https://store.guitargate.com/cdn/shop/t/4/assets/anchored-popover.js?v=95953304814728754461767395514
1import{Component}from"@theme/component";import{debounce,requestIdleCallback}from"@theme/utilities";export class AnchoredPopoverComponent extends Component{requiredRefs=["popover","trigger"];interaction_delay=200;#popoverTrigger=null;#onTriggerEnter=()=>{const{trigger,popover}=this.refs;trigger.dataset.hoverActive="true",popover.matches(":popover-open")||(this.#popoverTrigger=setTimeout(()=>{trigger.matches("[data-hover-active]")&&popover.showPopover()},this.interaction_delay))};#onTriggerLeave=()=>{const{trigger,popover}=this.refs;delete trigger.dataset.hoverActive,this.#popoverTrigger&&clearTimeout(this.#popoverTrigger),popover.matches(":popover-open")&&(this.#popoverTrigger=setTimeout(()=>{popover.hidePopover()},this.interaction_delay))};#onPopoverEnter=()=>{this.#popoverTrigger&&clearTimeout(this.#popoverTrigger)};#onPopoverLeave=()=>{const{popover}=this.refs;this.#popoverTrigger=setTimeout(()=>{popover.hidePopover()},this.interaction_delay)};#updatePosition=async()=>{const{popover,trigger}=this.refs;if(!popover||!trigger)return;const positions=trigger.getBoundingClientRect();popover.style.setProperty("--anchor-top",`${positions.top}`),popover.style.setProperty("--anchor-right",`${window.innerWidth-positions.right}`),popover.style.setProperty("--anchor-bottom",`${window.innerHeight-positions.bottom}`),popover.style.setProperty("--anchor-left",`${positions.left}`),popover.style.setProperty("--anchor-height",`${positions.height}`),popover.style.setProperty("--anchor-width",`${positions.width}`)};#resizeListener=debounce(()=>{const popover=this.refs.popover;popover&&popover.matches(":popover-open")&&popover.hidePopover()},100);connectedCallback(){super.connectedCallback();const{popover,trigger}=this.refs;this.dataset.closeOnResize&&popover.addEventListener("beforetoggle",event=>{window[event.newState==="open"?"addEventListener":"removeEventListener"]("resize",this.#resizeListener)}),this.dataset.hoverTriggered&&(trigger.addEventListener("pointerenter",this.#onTriggerEnter),trigger.addEventListener("pointerleave",this.#onTriggerLeave),popover.addEventListener("pointerenter",this.#onPopoverEnter),popover.addEventListener("pointerleave",this.#onPopoverLeave)),CSS.supports("position-anchor: --trigger")||(popover.addEventListener("beforetoggle",()=>{this.#updatePosition()}),requestIdleCallback(()=>{this.#updatePosition()}))}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("resize",this.#resizeListener)}}customElements.get("anchored-popover-component")||customElements.define("anchored-popover-component",AnchoredPopoverComponent); 2//# sourceMappingURL=/cdn/shop/t/4/assets/anchored-popover.js.map?v=95953304814728754461767395514
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.