PageSourceSearch

https://www.ltz.se/assets/rev/js/share-module-B3DFLLC7.js

js ltz.se collected 2026-10-02 07:18:23 UTC 2,094 bytes, 2 lines download raw bytes

1import{b as o,c as n,d as r}from"./chunk-KLSLXA54.js";import{u as a}from"./chunk-VJGBCIFP.js";import"./chunk-XCPXRTXT.js";import"./chunk-XJLSI5BW.js";import"./chunk-ZOYOJ6FT.js";import"./chunk-6KHOHYTW.js";var s=class{constructor(t){this._element=t,this._init();let e=(window.lclClientConfig||{}).language;this._copiedLabel=e&&e.share_article_copied}get shareData(){let t=this._element.getAttribute("title")||document.title,e=new URL(window.location.href);try{this._element.hasAttribute("url")&&(e=new URL(this._element.getAttribute("url"),window.location.href))}catch(i){a(new Error("failed when constructing share URL"),{extra:i})}return e.searchParams.set("shareSource","sharebutton"),{title:t,url:e.toString()}}_init(){this._element.classList.add("share--active"),this._element.addEventListener("click",this._handleClick.bind(this)),n?this._element.setAttribute("type","android"):o?this._element.setAttribute("type","ios"):r&&this._element.setAttribute("type","desktop")}_handleClick(t){if(!(t&&t.target instanceof HTMLElement&&t.target.closest("[data-share-button]")))return;this._button=t.target.closest("[data-share-button]"),this._textNode=Array.from(this._button.childNodes).find(i=>i.nodeType===Node.TEXT_NODE);let e=this._textNode.nodeValue;"share"in navigator&&!r?navigator.share(this.shareData).catch(i=>{i.toString().includes("AbortError")||a(new Error("failed to share natively"),{extra:i})}):"clipboard"in navigator&&navigator.clipboard.writeText(this.shareData.url).then(()=>{this.updateButton({text:this._copiedLabel,className:"share--copied",toggle:!0}),setTimeout(()=>{this.updateButton({text:e,className:"share--copied",toggle:!1})},3e3)}).catch(i=>{a(new Error("failed to copy link to clipboard"),{extra:i})})}updateButton({text:t,className:e,toggle:i}){let l=Array.from(this._button.childNodes).find(h=>h.nodeType===Node.TEXT_NODE);this._button.addEventListener("transitionend",()=>{l.nodeValue=t,this._element.classList.toggle(e,i),this._button.style.opacity="1"}),this._button.style.opacity="0"}};export{s as default};
2//# sourceMappingURL=share-module-B3DFLLC7.js.map

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.