1import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{i as t,r as n}from"./framework-BOexRV2D.js";import{t as r}from"./utils-CFJipakz.js";var i=e(t(),1),a=n();function o({publisher:e}){return(0,i.useEffect)(()=>{if(document.getElementById(`solvekit-adsense-loader`))return;let t=document.createElement(`script`);t.id=`solvekit-adsense-loader`,t.async=!0,t.crossOrigin=`anonymous`,t.src=`https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=${encodeURIComponent(e)}`,document.head.appendChild(t)},[e]),null}function s(e){if(navigator.doNotTrack===`1`)return;let t=JSON.stringify({path:window.location.pathname,event:`ad-impression`,placement:e});navigator.sendBeacon?navigator.sendBeacon(`/api/analytics`,new Blob([t],{type:`application/json`})):fetch(`/api/analytics`,{method:`POST`,headers:{"content-type":`application/json`},body:t,keepalive:!0})}function c({publisher:e,slot:t,placement:n,className:o}){let c=(0,i.useRef)(null),l=(0,i.useRef)(null),u=(0,i.useRef)(!1),[d,f]=(0,i.useState)(!1),[p,m]=(0,i.useState)(`pending`);return(0,i.useEffect)(()=>{if(!e||!t||!c.current)return;let n=new IntersectionObserver(([e])=>{e?.isIntersecting&&(f(!0),n.disconnect())},{rootMargin:`400px 0px`});return n.observe(c.current),()=>n.disconnect()},[e,t]),(0,i.useEffect)(()=>{if(!(!d||u.current)){u.current=!0,s(n);try{(window.adsbygoogle=window.adsbygoogle||[]).push({})}catch{u.current=!1}}},[d,n]),(0,i.useEffect)(()=>{if(!d||!l.current)return;let e=l.current,t=()=>{let t=e.getAttribute(`data-ad-status`);t===`filled`?m(`filled`):t===`unfilled`&&m(`unfilled`)};t();let n=new MutationObserver(t);n.observe(e,{attributes:!0,attributeFilter:[`data-ad-status`]});let r=window.setTimeout(()=>{m(e=>e===`pending`?`unfilled`:e)},8e3);return()=>{n.disconnect(),window.clearTimeout(r)}},[d]),!e||!t?null:(0,a.jsxs)(`div`,{ref:c,"data-placement":n,hidden:p===`unfilled`,"aria-label":p===`filled`?`Advertisement`:void 0,className:r(`mx-auto min-h-px max-w-3xl`,p===`filled`&&`my-8 overflow-hidden rounded-xl border border-slate-200 bg-white p-3 dark:border-slate-800 dark:bg-slate-900`,o),children:[p===`filled`&&(0,a.jsx)(`p`,{className:`mb-2 text-center text-[10px] font-semibold uppercase tracking-[0.16em] text-slate-500 dark:text-slate-400`,children:`Advertisement`}),d&&(0,a.jsx)(`ins`,{ref:l,className:`adsbygoogle block`,"data-ad-client":e,"data-ad-slot":t,"data-ad-format":`auto`,"data-full-width-responsive":`true`})]})}export{c as AdSlot,o as AdsenseScript};
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.