1import{debounce,requestIdleCallback,viewTransition}from"@theme/utilities";import{Component}from"@theme/component";const OFFSET=40;export class FloatingPanelComponent extends Component{#updatePosition=async()=>{viewTransition.current&&await viewTransition.current;const rect=this.getBoundingClientRect(),viewportWidth=window.innerWidth;if(this.style.top=OFFSET+"px",rect.right>viewportWidth){const overflowAmount=rect.right-viewportWidth+OFFSET;this.style.left=`-${overflowAmount}px`}if(rect.left<0){const overflowAmount=Math.abs(rect.left)+OFFSET;this.style.left=`${overflowAmount}px`}this.#mutationObserver.takeRecords()};#mutationObserver=new MutationObserver(this.#updatePosition);#resizeListener=debounce(()=>{const parent=this.closest("details"),closeOnResize=this.dataset.closeOnResize==="true";parent instanceof HTMLDetailsElement&&closeOnResize&&(parent.open=!1,parent.removeAttribute("open"),this.#updatePosition())},100);connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.#resizeListener),requestIdleCallback(()=>{this.#updatePosition(),this.#mutationObserver.observe(this,{attributes:!0})})}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("resize",this.#resizeListener),this.#mutationObserver.disconnect()}}customElements.get("floating-panel-component")||customElements.define("floating-panel-component",FloatingPanelComponent); 2//# sourceMappingURL=/cdn/shop/t/3/assets/floating-panel.js.map?v=151277338116891310371782122108
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.