PageSourceSearch

https://arkitekten.se/app/themes/hopp/assets/javascript/chunks/smartocto-adapter.8afbaa90.js

js arkitekten.se collected 2026-09-24 20:37:30 UTC 3,460 bytes, 1 lines download raw bytes

1var g=Object.defineProperty;var f=(c,e,t)=>e in c?g(c,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):c[e]=t;var r=(c,e,t)=>f(c,typeof e!="symbol"?e+"":e,t);import{S as T}from"./consent.cea05f21.js";import{b as I,e as y}from"../application.3a13dd1a.js";const A=20;class E{constructor(){r(this,"scriptAdded",!1);r(this,"enabled",!1);r(this,"tentaclesEnabled",!1);var n,o,s,a;this.consentUpdatedHandler=this.consentUpdatedHandler.bind(this),window._ain||(window._ain={}),window.tentacles||(window.tentacles={});let e=null,t=null;if((o=(n=window.hopp)==null?void 0:n.tracking)!=null&&o.smartoctoDomainId&&(e=window.hopp.tracking.smartoctoDomainId),(a=(s=window.hopp)==null?void 0:s.tracking)!=null&&a.smartoctoTentaclesKey&&(t=window.hopp.tracking.smartoctoTentaclesKey),this.smartoctoDomainId=e,this.smartoctoTentaclesKey=t,e){this.enabled=!0;const i=window._ain;i.id=e,i.title=null,i.page_type=null,i.postid=null,i.url=null,i.maincontent=null,i.pubdate=null,i.authors=null,i.sections=null,i.tags=null,i.access_level="free",i.article_type=null,i.reader_type="anonymous",i.trackauto=!1}if(t){this.tentaclesEnabled=!0;const i=window.tentacles;i.apiToken=t,i.pageType=""}}initialize(){this.addScriptTag(),window.addEventListener(I,this.consentUpdatedHandler)}consentUpdatedHandler(){this.addScriptTag()}addScriptTag(){if(this.scriptAdded||!y(T))return;const e=document.createElement("script");if(e.async=!0,e.src="https://d7d3cf2e81d293050033-3dfc0615b0fd7b49143049256703bfce.ssl.cf1.rackcdn.com/stf.js",document.body.appendChild(e),this.tentaclesEnabled){const t=document.createElement("script");t.async=!0,t.src="https://tentacles.smartocto.com/ten/tentacle.js",document.body.appendChild(t)}this.scriptAdded=!0}trackPageView(e){const t=window._ain,n=this.isArticle(e),o=this.getSections(e),s=this.getTags(e),{pageId:a,pageType:i,pageUrl:l,contentItemId:d,contentItemAuthor:u,contentItemVariant:p,pagePublicationDate:h}=e,m=window.document.title;t.title=m,t.page_type=n?"article":"landing",t.postid=a??i,t.url=this.deleteQueryParams(l),t.maincontent=d?`.ContentItem[data-content-item-id="${d}"]`:"body",t.authors=n?u:"Landing",t.sections=n?o:"Landing",n?(t.article_type=p,t.pubdate=h,t.tags=s):(t.article_type=null,t.pubdate=null,t.tags=null),this.waitForAin().then(({track:w})=>w()).catch(()=>{}),this.tentaclesEnabled&&(window.tentacles.pageType=n?"article":"landing",window.postMessage("activateTentacles"))}trackEvent({name:e,params:t={},pageDetails:n={}}){const o={...t,postid:n.pageId||n.pageType,url:n.pageUrl};this.waitForAin().then(({pushConversion:s})=>s(e,o)).catch(()=>{})}isArticle(e){return!!e.contentItemId}getSections(e){const t=[e.contentItemCategory];return e.contentItemSection&&t.push(e.contentItemSection),e.contentItemMission&&t.push(e.contentItemMission),e.contentItemContext&&t.push(e.contentItemContext),t.join()}getTags(e){const t=[];return e.contentItemTags&&t.push(e.contentItemTags),e.contentItemUserneeds&&t.push(e.contentItemUserneeds),t.join()}deleteQueryParams(e){const t=new URL(e),n=new URLSearchParams(t.search);return n.forEach((o,s)=>{s!=="s"&&n.delete(s)}),t.search=n.toString(),t.toString()}pushToAin(e,t){}waitForAin(){return this.waitForAinPromise||(this.waitForAinPromise=new Promise((e,t)=>{let n=0;const o=()=>{if(!this.scriptAdded||n>A)return t();if(typeof window._ain.track=="function")return e(window._ain);n+=1;const s=10*Math.max(1,n/2);setTimeout(o,s)};o()})),this.waitForAinPromise}}export{E 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.