1"use strict";(self.rspackChunk=self.rspackChunk||[]).push([[3491],{9374(t,e,o){let i,l;var s=o(619),a=o(1925);let n=a.A.user&&a.A.user.ssoid,r=!1;function c(t,e){e.dataset.ctLabel=t}let u=(i="true"===document.body.dataset.appFollowing,l="followings"===new URLSearchParams(location.search).get("app-content"),window.zappi&&i||l)?new class{isApp=!0;constructor(){window.addEventListener("followings",this,!1)}click(t){var e;let o,i=t.value,{followingType:l,ctLocation:n}=t.dataset,r=t.querySelector(".follow-button__data"),c=r?JSON.parse(r.text):{};c.uuid=i,c.followingType=l,c.buttonLocation=n,e=t,o={page:[a.A.tracking.page]},"teaser"===e.dataset.ctLocation&&(o.teaser=[(0,s.Yl)(e)]),c.entities=o,this.dispatch("open",c),d(i,{open:!0})}async get(){this.dispatch("list")}handleEvent(t){switch(t.detail.type){case"list":w({followings:t.detail.followings.map(t=>t.uuid),notifications:t.detail.followings.filter(t=>t.notification).map(t=>t.uuid)});break;case"update":d(t.detail.uuid,{following:t.detail.following,notification:t.detail.notification});break;case"close":d(t.detail.uuid,{open:!1})}}dispatch(t,e){a.A.log("Followings: dispatch %c%s","color: #007fff;",t,e);let o={type:"followings",action:t,...e};window.zappi.postMessage(o)}}:new class{isApp=!1;constructor(){this.url=`${a.A.settings.get("bookmark_fetch_api_url","/-/merkl")}/bookmarks`}async click(t){let e=t.value,o=t.dataset.followingType;try{t.classList.contains("followed")?(c("remove",t),await this.remove(e,o),a.A.log(`Unfollowed ${o}: ${e}`),d(e,{following:!1})):(c("add",t),await this.add(e,o),a.A.log(`Followed ${o}: ${e}`),d(e,{following:!0}))}catch(t){a.A.log("followings.mjs: caught error",t)}}async get(){let t=`${this.url}?following_type=in.(podcast,series,author)`;try{let e=await fetch(t,this.requestOptions("GET"));if(!(e.status>=400))return(await e.json()).map(t=>t.uuid);a.A.log(`followings.mjs: status ${e.status} error while GET.`)}catch(t){a.A.log("followings.mjs: caught error while GET.",t)}}async add(t,e){let o=JSON.stringify({uuid:t,following_type:e}),i={...this.requestOptions("POST"),body:o},l=await fetch(this.url,i);if(l.status>204)throw Error(`followings.mjs: status ${l.status} error while POST.`)}async remove(t,e){let o=`${this.url}?uuid=eq.${t}&following_type=eq.${e}`,i=this.requestOptions("DELETE"),l=await fetch(o,i);if(l.status>204)throw Error(`followings.mjs: status ${l.status} error while DELETE.`)}requestOptions(t){let e=a.A.settings.get("sso_cookie","zeit_sso_201501"),o=a.A.cookieRead(e);return{method:t,mode:"cors",cache:"no-cache",credentials:"include",headers:{"Content-Type":"application/json",Authorization:`Bearer ${o}`}}}};function f(t){let e=t.target.closest("button.follow-button");if(e){if(!n){var o;let t;c("attempt",e),o=e.dataset.followingType,t=a.A.settings.get(`wally_layout_for_followings_gate_${o}`)||a.A.settings.get("wally_layout_for_followings_gate","sys_gate_follow_web"),window.Zeit.renderWally(t);return}e.blur(),u.isApp&&(t._clicktrack=!1),u.click(e)}}function d(t,e={}){document.querySelectorAll(`button.follow-button[value="${t}"]`).forEach(t=>{"open"in e&&t.classList.toggle("menu-open",e.open),"following"in e&&(t.classList.toggle("followed",e.following),t.setAttribute("aria-pressed",e.following),t.firstChild.textContent=e.following?"Gefolgt":t.getAttribute("aria-label"),"notification"in e&&t.classList.toggle("notified",e.following&&e.notification))})}async function g(t){n&&w({followings:await u.get(),container:t})}function w({followings:t,notifications:e=[],container:o=document}){Array.isArray(t)&&t.length&&o.querySelectorAll("button.follow-button").forEach(o=>{t.includes(o.value)&&(o.classList.add("followed"),o.setAttribute("aria-pressed",!0),o.firstChild.textContent="Gefolgt",e.includes(o.value)&&o.classList.add("notified"))})}o.d(e,{},{default:function(t=document){r||(document.body.addEventListener("click",f),r=!0),a.A.tracking.registerEventEnricher("follow",t=>({eventProperties:{uuid:t.value,starting_position:t.dataset.ctLocation,following_type:t.dataset.followingType}})),g(t)}})}}]);
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.