!function(e){const t={assets:[],functions:[],loaded:new Set,isLibraryAvailable:t=>"undefined"!=typeof e[t]},o=["keydown","mousemove","wheel","touchmove","touchstart","touchend"],r=3;let n,a=!1;const s=e=>new Promise((t=>setTimeout(t,e))),i=/^(https?:)?\/\/[^\s]+$/;async function c({type:e,src:o,location:n="body",callback:a}){if(!t.loaded.has(o)){for(let i=1;i<=r;i++)try{return await new Promise(((t,r)=>{let a;switch(e){case"script":a=document.createElement("script"),a.src=o,a.async=!1,a.onload=t,a.onerror=r,("head"===n?document.head:document.body).appendChild(a);break;case"style":a=document.createElement("link"),a.rel="stylesheet",a.href=o,a.onload=t,a.onerror=r,document.head.appendChild(a)}})),t.loaded.add(o),void a?.()}catch{const e=Math.min(2**i*200,4e3);console.warn(`[SmartLoad] Retry ${i}/${r} for ${o} in ${e}ms`),await s(e)}console.error(`[SmartLoad] Failed to load after ${r} attempts: ${o}`)}}async function l(e,t){for(const o of e)await c(o);t?.()}function d(){const e=document.querySelectorAll("[smartload]"),t=[];e.forEach((e=>{const o=e.getAttribute("smartload");if(!i.test(o))return console.error(`[SmartLoad] Invalid URL: ${o}`);const r=e.tagName;"SCRIPT"===r?t.push({type:"script",src:o}):"LINK"===r?t.push({type:"style",src:o}):"IFRAME"===r&&function(e,t){const o=new IntersectionObserver((e=>{e.forEach((e=>{e.isIntersecting&&(e.target.src=t,o.unobserve(e.target))}))}));o.observe(e)}(e,o),e.removeAttribute("smartload")})),t.length&&l(t)}function u(){const e=document.querySelectorAll("[smartload-video]"),t=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);e.forEach((e=>{const o=e.getAttribute("smartload-video");if(!o)return;const r=()=>{let n;n=t?`${o}${o.includes("?")?"&":"?"}autoplay=0&rel=0&modestbranding=1&showinfo=0`:`${o}${o.includes("?")?"&":"?"}autoplay=1&rel=0&modestbranding=1&showinfo=0`;const a=document.createElement("iframe");a.src=n,a.allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture",a.allowFullscreen=!0,a.frameBorder="0",a.width="100%",a.height="100%",a.className="iframe-youtube",a.style.display="block",e.innerHTML="",e.appendChild(a),a.offsetHeight,requestAnimationFrame((()=>{a.style.transform="translateZ(0)",a.style.willChange="transform"})),e.removeAttribute("smartload-video"),e.style.cursor="default",t||(e.removeEventListener("click",r),e.removeAttribute("role"),e.removeAttribute("tabindex"),e.removeAttribute("aria-label"))};if(t){const t=new IntersectionObserver((e=>{e.forEach((e=>{e.isIntersecting&&(r(),t.unobserve(e.target))}))}),{rootMargin:"200px 0px",threshold:.01});t.observe(e)}else e.setAttribute("role","button"),e.setAttribute("tabindex","0"),e.setAttribute("aria-label","Play video"),e.style.cursor="pointer",e.addEventListener("click",r,{once:!0})}))}function m(){a||(a=!0,clearTimeout(n),l(t.assets,(()=>{t.functions.forEach((e=>e instanceof Function&&e())),d(),u()})))}document.addEventListener("DOMContentLoaded",(()=>{d(),u(),o.forEach((e=>document.addEventListener(e,m,{once:!0}))),n=setTimeout(m,1e4)})),e.smartload=t}(this);