PageSourceSearch

https://www.placemania.sk/wp-content/cache/min/1/wp-content/plugin…emania-map-runtime-loader.js?ver=1790340982

js placemania.sk collected 2026-10-02 23:20:36 UTC 3,051 bytes, 12 lines download raw bytes

1(function(){'use strict';const RUNTIME_SCRIPT_IDS=['placemania-map-core-js','placemania-map-preferences-js','placemania-map-app-js'];const DEFAULT_ROOT_MARGIN='900px 0px';const observers=new Set();let runtimePromise=null;function parseLazyConfig(component){const template=component.querySelector('.placemania-map-config');if(!template)return{};const raw=(template.content?template.content.textContent:template.textContent||'').trim();if(!raw)return{};try{const config=JSON.parse(raw);return config&&typeof config.lazyLoad==='object'&&config.lazyLoad?config.lazyLoad:{}}catch(error){return{}}}
2function disconnectObservers(){observers.forEach((observer)=>observer.disconnect());observers.clear()}
3function copyExecutionAttributes(placeholder,script){if(placeholder.nonce)script.nonce=placeholder.nonce;['crossorigin','referrerpolicy','integrity'].forEach((name)=>{const value=placeholder.getAttribute(name);if(value!==null&&value!=='')script.setAttribute(name,value)})}
4function activateRuntimeScript(id){const placeholder=document.getElementById(id);if(!placeholder){return Promise.reject(new Error(`Missing deferred runtime placeholder: ${id}`))}
5const src=String(placeholder.dataset.placemaniaMapRuntimeSrc||'').trim();if(!src){return Promise.reject(new Error(`Missing deferred runtime URL: ${id}`))}
6return new Promise((resolve,reject)=>{const script=document.createElement('script');script.id=id;script.src=src;script.async=!1;script.setAttribute('nowprocket','');copyExecutionAttributes(placeholder,script);script.addEventListener('load',resolve,{once:!0});script.addEventListener('error',()=>reject(new Error(`Failed to load map runtime: ${src}`)),{once:!0});placeholder.replaceWith(script)})}
7async function loadRuntime(){if(runtimePromise)return runtimePromise;runtimePromise=(async()=>{for(const id of RUNTIME_SCRIPT_IDS){await activateRuntimeScript(id)}})();await runtimePromise;disconnectObservers()}
8function requestRuntime(){loadRuntime().catch((error)=>{document.querySelectorAll('.placemania-map-shell').forEach((container)=>{if(container.dataset.mapLazyState==='ready')return;container.dataset.mapLazyState='runtime-failed'});console.error('[Placemania Map runtime]',error)})}
9function observeComponent(component){const container=component.querySelector('.placemania-map-shell');if(!container)return;const lazy=parseLazyConfig(component);const rootMargin=typeof lazy.rootMargin==='string'&&lazy.rootMargin.trim()?lazy.rootMargin.trim():DEFAULT_ROOT_MARGIN;const observer=new IntersectionObserver((entries)=>{if(!entries.some((entry)=>entry.isIntersecting||entry.intersectionRatio>0))return;requestRuntime()},{rootMargin,threshold:0});observers.add(observer);observer.observe(container)}
10function start(){const components=Array.from(document.querySelectorAll('.placemania-map-component'));if(!components.length)return;if(!('IntersectionObserver' in window)){requestRuntime();return}
11components.forEach(observeComponent)}
12if(document.readyState==='loading'){document.addEventListener('DOMContentLoaded',start,{once:!0})}else{start()}})()

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.