1import{t as e}from"./dist.Cnxa_LV8.js";import{t}from"./store.yYORyfU0.js";import{n}from"./ejs.BEyL0p9I.js";import{t as r}from"./readCookie.PuejXQGi.js";import{r as i}from"./experiments.hwfu1Jt-.js";import{n as a,r as o,t as s}from"./trackArticleView.DE3h8h54.js";import{t as c}from"./trackUIElementEvent.DbBXIxjl.js";import{t as l}from"./resolveSubscriberState.Da7uxYh_.js";import{r as u}from"./setupTouchpoint.CRww8tlm.js";var d={autoCreateConsents:!0,requireAdvertisingOptIn:!0};function f(e,t=`localhost`){window.location.host.startsWith(t)&&(e.deployStage=`dev`,e.deployStageTpaas=`pre`,e.logLevel=`debug`,document.cookie=`_pulse2debug=true`)}function p(){let e=r(`whitelist`);return e?{"spt:whitelist":e}:{}}function m(e){let t=p();return{"spt:site":e.publicationName,"spt:sitegroup":e.group,...t}}function h(e){let t={id:e.providerId,product:e.deviceInfo?.isApp?`PolarisApp`:e.product,productName:e.productName||e.product,productType:e.deviceInfo?.productType||`Web`};return e.publicationInfo?.group&&(t.group=e.publicationInfo.group),t}function g(){if(window.polarx?.pulseClient)return;window.polarx||(window.polarx={});let e={trackPageView:v,trackArticleView:a,trackUIElementEvent:c,trackUIElementClick:(e,t)=>{c(e,{...t,type:`Engagement`,action:`Click`})},trackUIElementView:(e,t)=>{c(e,{...t,type:`View`})}};window.polarx.pulseClient=Object.freeze({v1:Object.freeze(e)})}function _(e,t){let{$providerId:r,$site:a,$siteGroup:o}=i();r.set(e),a.set(t.publicationInfo?.publicationName||``),o.set(t.publicationInfo?.group||``);let s={...d},c=h({...t,providerId:e}),l={actor:t.actor,provider:c};f(s,t.subdomain);let u=new n(e,s,l),p=m(t.publicationInfo??{publicationName:``,group:``});u.update({object:{"spt:custom":p}}),window.pulse||=u,window.__pulseTracker=Promise.resolve(u),u.exposeToProxyClients(),g()}function v(e,t=[]){window.pulse&&o(e,{track:!1,remove:!1},{experiments:t})}var y=_,b=class extends HTMLElement{async resolveActor(){let n=l()===`subscription`,r=await t().getUser();if(!r)return;let i={id:r.userId,subscriptionName:n?`Abo`:`False`,realm:`spid.no`};if(!n)return i;try{let e=(await u())?.profile?.plan_name;e&&(i.productFeatures=[e])}catch(t){e.error(t,`[pulse loader]: failed to get touchpoint user`)}return i}connectedCallback(){let e=this.dataset.pulseProvider,t=this.dataset.publication,n=this.dataset.product,r=this.dataset.productName,i=this.dataset.group,o=JSON.parse(this.dataset.deviceInfo||`{}`);y(e,{product:n,productName:r,actor:this.resolveActor(),deviceInfo:o,publicationInfo:{publicationName:t,group:i}});let c=JSON.parse(this.dataset.viewMeta||`null`);if(!c)return;let l=JSON.parse(this.dataset.experiments||`[]`);if(c.type===`Article`||c.type===`SalesPoster`){let e=document.getElementById(s);a(c,{experiments:l,articleElement:e})}else v(c,l)}};customElements.get(`pulse-loader`)||customElements.define(`pulse-loader`,b);
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.