1import{d as e,i as a,ao as i,J as n,a as l,c as t,e as s,t as o,z as r,p as d,f as c,k as u,l as v,b as m,ap as k,B as p,g as f,T as g,r as b,h,S as y,R as N}from"./vue-Cbujuoqu.js";import{c as S,N as A}from"./apollo.client-CTIoy0fp.js";import"./preload-helper-D9jEkzRM.js";import"./exports-DzJyI3gR.js";const C={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ArticleSave"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"article"},arguments:[{kind:"Argument",name:{kind:"Name",value:"pk"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"saved"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"hideInMainFeed"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:147,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:"query ArticleSave($id: ID!) {\n article(pk: $id) {\n id\n saved\n hideInMainFeed\n }\n}\n"}}},w={class:"label"},F=e({__name:"SaveArticle",props:{id:{}},setup(e){const F=e,I="preview"===window.location.pathname.split("/").pop(),D=b(!1),T=h(()=>y&&(N.isActive||N.isOverduePhase)&&!I&&!D.value),j=b(!1),M=b(!1);a(async function(){if(!T)return;const e=await S();e.watchQuery({query:C,variables:{id:F.id}}).subscribe({next:e=>{j.value=e.data.article.saved,D.value=e.data.article.hideInMainFeed,e.networkStatus===A.ready&&(M.value=!0)}})});const{$collectionToggle:q,showArticleCollections:$,toggleArticleCollections:_,closeArticleCollections:x,closeThisArticleCollection:z}=i();return(e,a)=>{const i=n("ArticleCollection");return T.value?(l(),t("span",{key:0,ref_key:"$collectionToggle",ref:q,class:"collections-toggle saving"},[s("a",{href:"javascript:void(0)",class:c(["nofb",[j.value?"bookmarked":"bookmark"]]),"aria-label":"Artikel zu einer Liste hinzufügen",onClick:a[0]||(a[0]=r(e=>d(_)(),["stop","prevent"]))},[s("span",w,o(j.value?"Gespeichert":"Speichern"),1)],2),u(g,{name:"fade"},{default:v(()=>[d($)?m((l(),p(i,{key:0,articleId:F.id,onClick:a[1]||(a[1]=r(()=>{},["stop","prevent"])),onCloseMenu:d(z)},null,8,["articleId","onCloseMenu"])),[[d(k),d(x)]]):f("",!0)]),_:1})],512)):f("",!0)}}});export{F as default};
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.