(()=>{function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}!function(){"use strict";var e=highlight_and_share,i=e.prefix,n=e.suffix,l=e.content_legacy_mode,o=null,a=document.querySelector("#has-highlight-and-share");if(null!==a){var r=a.querySelector(".highlight-and-share-wrapper").getBoundingClientRect(),s=r.width,h=(r.height,function(t){var e=window.getComputedStyle(t);return"none"!==e.display&&"hidden"!==e.visibility&&"0"!==e.opacity}),c=function(){var t=document.querySelectorAll(".highlight-and-share-wrapper");null!==t&&t.forEach((function(t){null===t.closest("#has-highlight-and-share")&&t.remove()}))},d=function(l,o,r,s,d){var f=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null;if(!1!==highlight_and_share.show_twitter||!1!==highlight_and_share.show_facebook||!1!==highlight_and_share.show_linkedin||!1!==highlight_and_share.show_ok||!1!==highlight_and_share.show_vk||!1!==highlight_and_share.show_pinterest||!1!==highlight_and_share.show_email||!1!==highlight_and_share.show_webshare||!1!==highlight_and_share.show_mastodon){c();var w=a.querySelector(".highlight-and-share-wrapper").cloneNode(!0);if(w.style.display="block",w.style.position="absolute",w.style.width="auto",w.style.height="auto",w.style["z-index"]=1e4,w.classList.contains("orientation-vertical")&&(w.style.display="inline-flex"),function(t,l,o,a,r,s){var h=t.querySelectorAll(".has_whatsapp, .has_facebook, .has_twitter, .has_copy, .has_reddit, .has_telegram, .has_linkedin, .has_xing, .has_signal, .has_vk, .has_tumblr, .has_mastodon, .has_email_mailto, .has_email_form");if(null===h)return t;var c="";"inline"===s?c="highlight":"selection"===s?c="selection":"cta"===s&&(c="quote"),h.forEach((function(t){var s=t.querySelector("a"),h=s.getAttribute("href");h=(h=(h=(h=(h=(h=(h=(h=h.replace("%url%",encodeURIComponent(l))).replace("%username%",encodeURIComponent(e.twitter_username))).replace("%title%",encodeURIComponent(o))).replace("%text%",encodeURIComponent(a))).replace("%hashtags%",encodeURIComponent(r))).replace("%type%",encodeURIComponent(c))).replace("%prefix%",encodeURIComponent(i))).replace("%suffix%",encodeURIComponent(n)),s.setAttribute("href",h);var d=t.getAttribute("data-title");null!==d&&(d=d.replace("%title%",encodeURIComponent(o)),t.setAttribute("data-title",d));var u=t.getAttribute("data-url");null!==u&&(u=u.replace("%url%",encodeURIComponent(l)),t.setAttribute("data-url",u))}))}(w,r,o,l,s,d),void 0!==navigator.share){var y=w.querySelector(".has_webshare");null!==y&&(y.style.display="inline-block")}switch(document.body.appendChild(w),d){case"selection":u(w);break;case"inline":g(w,f);break;case"cta":p(w,f)}var m=document.querySelector("body").querySelectorAll(".has_whatsapp, .has_facebook, .has_twitter, .has_telegram, .has_linkedin, .has_xing, .has_reddit, .has_tumblr");null!==m&&m.forEach((function(t){h(t)&&t.querySelector("a").addEventListener("click",(function(e){e.preventDefault();var i=t.querySelector("a").getAttribute("href");"undefined"!=typeof dataLayer&&dataLayer.push({event:"highlight-and-share",hasShareText:l,hasSharePostUrl:r,hasSharePostTitle:o,hasShareType:d,hasSocialNetwork:t.getAttribute("data-type")}),window.open(i,"Highlight and Share","width=575,height=430,toolbar=false,menubar=false,location=false,status=false")}))}));var v=document.querySelectorAll(".has_copy");null!==v&&v.forEach((function(e){h(e)&&("undefined"==typeof ClipboardItem?e.remove():e.addEventListener("click",(function(i){i.preventDefault();try{var n=new Blob([l],{type:"text/plain"}),a=[new ClipboardItem((s={},h=n.type,c=n,(h=function(e){var i=function(e,i){if("object"!==t(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var l=n.call(e,"string");if("object"!==t(l))return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===t(i)?i:String(i)}(h))in s?Object.defineProperty(s,h,{value:c,enumerable:!0,configurable:!0,writable:!0}):s[h]=c,s))];navigator.clipboard.write(a)}catch(t){}var s,h,c;e.setAttribute("data-tooltip","Copied!"),"undefined"!=typeof dataLayer&&dataLayer.push({event:"highlight-and-share",hasShareText:l,hasSharePostUrl:r,hasSharePostTitle:o,hasShareType:d,hasSocialNetwork:"copy"})})))}));var b=document.querySelectorAll(".has_email_form");null!==b&&b.forEach((function(t){h(t)&&t.addEventListener("click",(function(t){t.preventDefault();var e=t.target.closest("a").getAttribute("href");"undefined"!=typeof Fancybox&&(c(),window.highlightShareFancy=new Fancybox([{src:e,type:"iframe",preload:!0,compact:!0,autoFocus:!0}],{Toolbar:{autoEnable:!1}}))}))}));var _=document.querySelectorAll(".has_mastodon");null!==_&&_.forEach((function(t){h(t)&&t.addEventListener("click",(function(t){t.preventDefault();var e=t.target.closest("a").getAttribute("href");"undefined"!=typeof Fancybox&&(c(),window.highlightShareFancy=new Fancybox([{type:"inline",compact:!0,src:"#has-mastodon-prompt"}],{Toolbar:{autoEnable:!1},on:{done:function(){var t=document.querySelector(".has-mastodon-form"),i=t.querySelector("input");null!==i&&i.focus(),t.addEventListener("submit",(function(t){t.preventDefault();var n=i.value;localStorage.setItem("highlight-and-share-mastodon",n);var l=e;""!==n&&(l=l.replace(/mastodon\.social/i,n)),console.log(l),window.open(l,"Highlight and Share","width=575,height=430,toolbar=false,menubar=false,location=false,status=false")}));var n=localStorage.getItem("highlight-and-share-mastodon");null!==n&&(i.value=n)}}}))}))}));var x=document.querySelectorAll(".has_webshare");null!==x&&x.forEach((function(t){h(t)&&t.addEventListener("click",(function(t){t.preventDefault();var e=t.target.closest("a").getAttribute("href");navigator.share({title:o,text:l,url:e})}))}))}},u=function(t){var e=window.innerWidth,i=window.innerHeight,n=window.getSelection().getRangeAt(0).getBoundingClientRect(),l=n.top,o=n.left,a=n.width,r=n.height;t.offsetWidth>e&&(t.style.maxWidth=e-20+"px",t.classList.add("has-no-margin-bottom"));var h=t.getBoundingClientRect(),c=h.width,d=h.height;if(t.classList.contains("orientation-vertical")){var u=o+window.scrollX-(c+15),g=l+window.scrollY-d/2+r/2;if(t.classList.add("has-no-margin-bottom"),l+window.scrollY-d/2<0){t.style.display="grid",t.style.gridTemplateColumns="1fr 1fr";var p=t.getBoundingClientRect();t.style.top=l+window.scrollY-p.height/2+r/2+"px",t.style.left=o+window.scrollX-p.width-15+"px"}else if(l+d>i){t.style.display="grid",t.style.gridTemplateColumns="1fr 1fr";var f=t.getBoundingClientRect();t.style.top=l+window.scrollY-f.height/2+r/2+"px",t.style.left=o+window.scrollX-f.width-15+"px"}else t.style.left=u+"px",t.style.top=g+"px",t.classList.remove("has-no-margin-bottom")}else{var w=o+window.scrollX+a/2-c/2,y=l+window.scrollY-d-15;t.classList.add("has-no-margin-bottom"),w<0?t.style.left="15px":w+s>e?t.style.right="15px":(t.style.left=w+"px",t.classList.remove("has-no-margin-bottom")),t.style.top=y+"px"}},g=function(t,e){var i=window.innerWidth,n=window.innerHeight,l=e.getBoundingClientRect(),o=l.top,a=l.left,r=l.width,h=l.height,c=t.getBoundingClientRect(),d=c.width,u=c.height;if(t.classList.contains("orientation-vertical")){var g=a+window.scrollX-(d+15),p=o+window.scrollY-u/2+h/2;if(t.classList.add("has-no-margin-bottom"),o+window.scrollY-u/2<0){t.style.display="grid",t.style.gridTemplateColumns="1fr 1fr";var f=t.getBoundingClientRect();t.style.top=o+window.scrollY-f.height/2+h/2+"px";var w=a+window.scrollX-f.width-15;t.style.left=w<0?"15px":w+"px"}else if(o+u>n){t.style.display="grid",t.style.gridTemplateColumns="1fr 1fr";var y=t.getBoundingClientRect();t.style.top=o+window.scrollY-y.height/2+h/2+"px";var m=a+window.scrollX-y.width-15;t.style.left=m<0?"15px":m+"px"}else t.style.left=g+"px",t.style.top=p+"px",t.classList.remove("has-no-margin-bottom")}else{var v=a+window.scrollX+r/2-d/2,b=o+window.scrollY-u-15;t.classList.add("has-no-margin-bottom"),v<0?t.style.left="15px":v+s>i?t.style.right="15px":(t.style.left=v+"px",t.classList.remove("has-no-margin-bottom")),t.style.top=b+"px"}},p=function(t,e){var i=window.innerWidth,n=window.innerHeight,l=e.getBoundingClientRect(),o=l.top,a=l.left,r=l.width,h=l.height;t.getBoundingClientRect().width>i&&(t.style.maxWidth=i-20+"px",t.classList.add("has-no-margin-bottom"));var c=t.getBoundingClientRect(),d=c.width,u=c.height;if(t.classList.contains("orientation-vertical")){window.scrollX;var g=o+window.scrollY-u/2+h/2;if(t.classList.add("has-no-margin-bottom"),o+window.scrollY-u/2<0){t.style.display="grid",t.style.gridTemplateColumns="1fr 1fr";var p=t.getBoundingClientRect();t.style.top=o+window.scrollY-p.height/2+h/2+"px";var f=a+window.scrollX-p.width-15;t.style.left=f<0?"15px":f+"px"}else if(o+u>n){t.style.display="grid",t.style.gridTemplateColumns="1fr 1fr";var w=t.getBoundingClientRect();t.style.top=o+window.scrollY-w.height/2+h/2+"px";var y=a+window.scrollX-w.width-15;t.style.left=y<0?"15px":y+"px"}else{var m=t.getBoundingClientRect();t.style.left=a+window.scrollX-m.width-15+"px",t.style.top=g+"px",t.classList.remove("has-no-margin-bottom")}}else{var v=a+window.scrollX+r/2-d/2,b=o+window.scrollY-u-15;t.classList.add("has-no-margin-bottom"),v<0?t.style.left="15px":v+s>i?t.style.right="15px":(t.style.left=v+"px",t.classList.remove("has-no-margin-bottom")),t.style.top=b+"px"}},f=function(t){var e=null!==t?t.dataset.url:window.location.href,i=null!==t?t.dataset.title:document.title,n=null!==t?t.dataset.hashtags:"",l={};return l.href=e,l.title=i,l.hashtags=n,l},w=e.content;if(""!==w){var y=document.querySelectorAll(w);if(null!==y){var m=function(t,e){c();var i=document.defaultView.getSelection().toString().trim();if(""!==i){var n=e.querySelector(".has-social-placeholder"),l=f(n),o=l.href,a=l.title,r=l.hashtags;d(i,a,o,r,"selection")}};y.forEach((function(t){!t.classList.contains("has-content-area")||l?t.addEventListener("mouseup",(function(e){m(0,t)})):t.parentElement.addEventListener("mouseup",(function(e){m(0,t.parentElement)}))}))}var v=document.querySelectorAll(".has-inline-text");null!==v&&v.forEach((function(t){highlight_and_share.inline_highlight_tooltips_enabled&&""!==highlight_and_share.inline_highlight_tooltips_text&&t.setAttribute("data-tooltip",highlight_and_share.inline_highlight_tooltips_text),t.addEventListener("click",(function(i){!function(t,i){if(c(),i!==o){o=i;var n=i.innerText.trim();if(""!==n){var l=t.target.closest(".has-social-placeholder"),a=f(l),r=a.href,s=a.title,h=a.hashtags;e.enable_webshare_inline_highlight&&"function"==typeof navigator.share?navigator.share({title:s,url:r,text:n}):d(n,s,r,h,"inline",i)}}else o=null}(i,t);var n=document.querySelectorAll(".has-inline-text-tooltip");null!==n&&n.forEach((function(t){t.remove()}))})),t.addEventListener("mouseover",(function(e){if(t.hasAttribute("data-tooltip")){var i=e.target.getBoundingClientRect().top,n=window.scrollX,l=window.scrollY,o=e.clientX-60+n,a=i-30+l-10,r=document.createElement("div");r.classList.add("has-inline-text-tooltip"),r.style.position="absolute",r.style.left=o+"px",r.style.top=a+"px",r.innerText=t.getAttribute("data-tooltip"),document.body.appendChild(r);var s=r.getBoundingClientRect();s.right>window.innerWidth?r.style.left=o-(s.right-window.innerWidth)+"px":s.left<0&&(r.style.left=o-s.left+"px"),s.bottom>window.innerHeight?r.style.top=a-(s.bottom-window.innerHeight)+"px":s.top<0&&(r.style.top=a-s.top+"px")}})),t.addEventListener("mouseout",(function(){var t=document.querySelectorAll(".has-inline-text-tooltip");null!==t&&t.forEach((function(t){t.classList.add("has-fade-out"),setTimeout((function(){t.remove()}),900)}))}))}));var b=document.querySelectorAll(".has-click-prompt");null!==b&&b.forEach((function(t){t.addEventListener("click",(function(i){if(i.preventDefault(),c(),t!==o){o=t;var n=t.parentNode.querySelector(".has-click-to-share-text").getAttribute("data-text-full"),l=t.closest(".has-social-placeholder"),a=f(l),r=a.href,s=a.title,h=a.hashtags;e.enable_webshare_click_to_share&&"function"==typeof navigator.share?navigator.share({title:s,url:r,text:n}):d(n,s,r,h,"cta",t.closest(".has-click-to-share"))}else o=null}))}))}}}()})();