!function(){"use strict";customElements.get("share-button")||customElements.define("share-button",class extends HTMLElement{constructor(){super(),this.container=this.closest("data-section-id"),this.shareButton=this.querySelector("[data-share-button]"),this.shareMessage=this.querySelector("[data-share-message]"),this.urlToShare=this.shareButton.dataset.shareUrl?this.shareButton.dataset.shareUrl:document.location.href}connectedCallback(){navigator.share?this.shareButton.addEventListener("click",(()=>{navigator.share({url:this.urlToShare,title:document.title})})):this.shareButton.addEventListener("click",this.copyToClipboard.bind(this))}copyToClipboard(){navigator.clipboard.writeText(this.urlToShare).then((()=>{this.shareMessage.classList.add("is-visible");const t=()=>{this.shareMessage.classList.remove("is-visible"),this.shareMessage.removeEventListener("animationend",t)};this.shareMessage.addEventListener("animationend",t)}))}updateUrl(t){this.urlToShare=t,this.shareButton.dataset.shareUrl=t}})}();
