1import{G as S,j as U,N as j,q as _,co as O,ab as D,cp as P,cq as A,cr as B,cs as $,ct as M,p as m,C as f,ao as b,ax as k,Y as N,P as d,O as R,av as x,_ as G,r as K,o as h,c as v,l as V,h as C,ae as F}from"./index-D-iuxWOd.js";const y={Contentflow:"contentFlow",X:"twitter",Facebook:"facebook",Instagram:"instagram","dpa-webgrafik":"dpaWebgrafik","dpa-electionslive":"dpaElection",Datawrapper:"dpaDataWrapper",Glomex:"videoGlomex",glomex:"videoGlomex",Opinary:"opinary",SoundCloud:"soundCloud",TikTok:"tiktok",Vimeo:"vimeo",YouTube:"youtube","app.23degrees.io":"twentyThreeDegrees","23degrees":"twentyThreeDegrees","embed.nexx.cloud":"nexx","x.com":"twitter","embed.contentflow.net":"contentFlow","www.thinglink.com":"thinglink","pressekompass.net":"opinary"};var W=Object.defineProperty,q=Object.getOwnPropertyDescriptor,c=(s,e,t,o)=>{for(var n=o>1?void 0:o?q(e,t):e,a=s.length-1,r;a>=0;a--)(r=s[a])&&(n=(o?r(e,t,n):r(n))||n);return o&&n&&W(e,t,n),n};const E=S("tickarooPrerenderedBlock"),H=S("edition"),w="https://cdn.tickaroo.com/api/embed/v4/prefetch/liveblog.json",J="https://cdn.tickaroo.com/api/embed/v4/prefetch/liveblog-teaser.json";let i=class extends U(j){constructor(){super(...arguments),this.clientId="6440f2d90b23adb7acaa26ae",this.loading=!0,this.consentManagerVendorId=_.consentManager.vendorIds.tickaroo,this.loadingBannerHeight="500px",this.currentConsents=""}get content(){var e;return((e=this.getContent)==null?void 0:e[this.liveblogId])||null}get browser(){return this.isBrowser()}get showTickaroo(){return!this.edition.disableTickaroo}get useManualLinking(){return this.isSlider&&!!this.storyUrl}get liveblogArticleUrl(){return O(this.storyUrl,this.origin)||this.origin}get injectedLiveblogUrl(){const e=this.liveblogArticleUrl;return this.outputMedium!==D.NewsApp||P(e)?e:A(`${this.origin}${B}${$(e)}`)}injectLiveblogUrlAttribute(e){return e.replace(/<tickaroo-liveblog-teaser(?=[\s>])/,`<tickaroo-liveblog-teaser liveblogUrl="${M(this.injectedLiveblogUrl)}"`)}updateJsonLdScript(e){if(this.browser){let t=document.getElementById("tickaroo-jsonld");t||(t=document.createElement("script"),t.id="tickaroo-jsonld",t.type="application/ld+json",document.head.appendChild(t)),t.textContent=e}}async created(){await this.$store.dispatch("addHeaders",{"X-Custom-TTL":"15m"},{root:!0})}async fetchTickarooData(){var g,u;this.loading=!0,this.updateConsents();let e=w;this.isSlider&&(e=J);const t={client_id:this.clientId,liveblogId:this.liveblogId,themeId:this.themeId,webEmbedConstraints:this.currentConsents,includeLiveblogUrl:this.liveblogArticleUrl},o=new URLSearchParams(t);this.useManualLinking&&o.delete("includeLiveblogUrl");const n=`${e}?${o.toString()}`,a=await fetch(n),{html:r,schema:l}=await a.json();let p=l;if(this.isSlider){const T=`${w}?${new URLSearchParams(t).toString()}`;p=(await(await fetch(T)).json()).schema}const I={html:this.useManualLinking?this.injectLiveblogUrlAttribute(r):r,json:JSON.stringify(p)};await this.setContent({...this.getContent||{},[this.liveblogId]:I}),(g=this.getContent)!=null&&g[this.liveblogId]&&this.updateJsonLdScript((u=this.getContent)==null?void 0:u[this.liveblogId].json),this.loading=!1}async serverPrefetch(){try{await this.fetchTickarooData()}catch(e){m.error("error fetching tickaroo data",e)}}updateConsents(){const e={};Object.keys(y).forEach(t=>{const o=y[t],n=o?f.getVendorId(o):void 0,r=(n?f.hasVendorConsent(n):!1)?"full":"consent";e[t]=r}),this.currentConsents=JSON.stringify(e)}async initialiseSDK(){return new Promise(e=>{this.EventBus.subscribe(b.getSDKLoadedEventName(),()=>{e()}),this.EventBus.publish(b.getLoadSDKEventName())})}async mounted(){await this.initialiseSDK();const e=async o=>{const n=document.querySelector(`tickaroo-liveblog[liveblogid="${this.liveblogId}"]`);if(typeof n=="object"&&n&&"liveblogComponent"in n&&"setConsent"in n&&typeof n.setConsent=="function")return n;if(o>0)return await new Promise(a=>{setTimeout(()=>{a(!0)},200)}),e(o-1)},t=await e(10);if(t&&this.currentConsents){const o=JSON.parse(this.currentConsents);Object.keys(o).forEach(n=>{o[n]==="full"&&"setConsent"in t&&typeof t.setConsent=="function"&&t.setConsent(n,!0)})}}async beforeMount(){var e,t;if(this.loading=!this.content,await this.EventBus.publish("consentManager.checkBlocking"),this.updateConsents(),this.EventBus.subscribe("consentManager.sdk.vendorconsent",()=>{this.updateConsents()}),await k(),!this.content)try{await this.fetchTickarooData()}catch(o){m.error("error fetching tickaroo data",o),this.loading=!1}(e=this.getContent)!=null&&e[this.liveblogId]&&this.updateJsonLdScript((t=this.getContent)==null?void 0:t[this.liveblogId].json),await k(),await this.$nextTick(()=>{const o=this.$refs.tickaroo;o&&o.addEventListener("click",this.handleLinkClick)})}handleLinkClick(e){var a,r;if(!(e.target instanceof Element)||(a=e.target.getAttribute("type"))!=null&&a.includes("checkbox")||(r=e.target.getAttribute("for"))!=null&&r.includes("toggle"))return;e.preventDefault();const t=e.target.closest("a");if(!t)return;const o=t.getAttribute("href");if(!o||o==="#")return;const n=o.startsWith("#")&&this.isSlider?this.liveblogArticleUrl+o:o;this.navigate(n,this.isWebApp&&!this.isSlider)}beforeUnmount(){var e;(e=this.$refs.tickaroo)==null||e.removeEventListener("click",this.handleLinkClick)}};c([d({required:!0})],i.prototype,"liveblogId",2);c([d({required:!0})],i.prototype,"themeId",2);c([d({default:!1})],i.prototype,"isSlider",2);c([d({default:""})],i.prototype,"storyUrl",2);c([E.Getter("getContent")],i.prototype,"getContent",2);c([E.Action("setContent")],i.prototype,"setContent",2);c([H.Getter("getEdition")],i.prototype,"edition",2);c([N("getOrigin")],i.prototype,"origin",2);i=c([R({name:"Tickaroo",components:{DnmLoadingBanner:x}})],i);const X=["innerHTML"];function Y(s,e,t,o,n,a){var l;const r=K("DnmLoadingBanner");return s.showTickaroo?(h(),v("section",{key:0,class:F([{"--isSlider":s.isSlider},"tickaroo"]),"data-testid":"tickaroo-content"},[s.loading?(h(),V(r,{key:0,"data-cmp-vendor":s.consentManagerVendorId,height:s.loadingBannerHeight,class:"cmplazyload","data-cmp-preview":"","data-testid":"tickaroo-content-loading-banner",width:"100%"},null,8,["data-cmp-vendor","height"])):(l=s.content)!=null&&l.html?(h(),v("div",{key:1,innerHTML:s.content.html,"data-testid":"tickaroo-embed-content",ref:"tickaroo"},null,8,X)):C("",!0)],2)):C("",!0)}const te=G(i,[["render",Y]]);var L;try{"__c"in i&&((L=i.__c).componentFileName??(L.componentFileName=Object.create(null)),Object.defineProperty(i.__c,"componentFileName",{value:"app/components/storyline/tickaroo/Tickaroo.vue"}))}catch(s){console.error("injectFileNamePlugin",s)}export{te 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.