1import{j as e}from"./ui-vendor-7ksmbWQe.js";import{r as l}from"./react-vendor-LSUMIZ7H.js";import{a4 as g,t as y,j,a7 as w,a8 as N,D as v,B as f,aa as k,P as E}from"./index-DWFe9eMF.js";import{u as L}from"./i18n-vendor-Cq4PMOpV.js";import{M as F}from"./minimize-2-CW2jvng7.js";import{M as P}from"./maximize-2-DMDUomt6.js";function I(){const{t:a}=L(),n=g(),{user:u}=y(),[i,m]=l.useState(null),[x,p]=l.useState(!0),[o,h]=l.useState(null),[c,t]=l.useState(!1),d=l.useRef(null);l.useEffect(()=>{let s=!1;return(async()=>{try{const{url:r}=await j.getPixyLabsIframeUrl();s||m(r)}catch(r){s||h(r?.message||"Failed to load offerwall")}})(),()=>{s=!0}},[]);const b=async()=>{const s=d.current;if(s)try{document.fullscreenElement?(await document.exitFullscreen(),t(!1)):(await s.requestFullscreen(),t(!0))}catch{t(r=>!r)}};return l.useEffect(()=>{const s=()=>t(!!document.fullscreenElement);return document.addEventListener("fullscreenchange",s),()=>document.removeEventListener("fullscreenchange",s)},[]),e.jsxs("div",{className:"min-h-screen bg-background flex flex-col",children:[e.jsx(w,{provider:"pixylabs",userId:u?.id}),n.blocked&&e.jsx(N,{onRetry:n.retry,loading:n.loading}),e.jsx(v,{}),e.jsxs("div",{className:"container mx-auto px-3 max-w-3xl flex items-center justify-between h-12 border-b border-border/40",children:[e.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[e.jsx("span",{"aria-hidden":!0,className:"block h-5 w-1 rounded-full bg-primary shrink-0"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h1",{className:"text-base leading-none truncate font-serif font-bold",children:a("pixylabs.title","PixyLabs Offers")}),e.jsx("p",{className:"text-[10px] text-muted-foreground mt-0.5 truncate",children:a("pixylabs.partnerNetwork","Partner offer network")})]})]}),e.jsx(f,{variant:"ghost",size:"icon",className:"h-9 w-9 rounded-full",onClick:b,"aria-label":c?a("pixylabs.exitFullscreen","Exit fullscreen"):a("pixylabs.fullscreen","Open fullscreen"),children:c?e.jsx(F,{className:"h-4 w-4"}):e.jsx(P,{className:"h-4 w-4"})})]}),e.jsx("main",{className:"flex-1 flex flex-col",children:e.jsx("div",{ref:d,className:"relative w-full bg-background",style:{height:"calc(100vh - 56px)"},children:o?e.jsx("div",{className:"h-full flex items-center justify-center p-6",children:e.jsxs("div",{className:"text-center space-y-4 max-w-sm",children:[e.jsx("p",{className:"text-lg",style:{fontFamily:"'Playfair Display', serif",fontWeight:700},children:a("pixylabs.loadError","Failed to load the offerwall")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:o}),e.jsxs(f,{variant:"outline",size:"sm",onClick:()=>window.location.reload(),className:"rounded-full",children:[e.jsx(k,{className:"h-4 w-4 mr-1.5"}),a("common.tryAgain","Try again")]})]})}):e.jsxs(e.Fragment,{children:[x&&e.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background",children:e.jsxs("div",{className:"text-center space-y-3",children:[e.jsx(E,{size:32,speed:1.6,className:"mx-auto"}),e.jsx("p",{className:"text-xs text-muted-foreground font-medium",children:a("pixylabs.loading","Loading offersâ¦")})]})}),i&&e.jsx("iframe",{src:i,title:"PixyLabs Offerwall",className:"w-full h-full border-0 block bg-background",onLoad:()=>p(!1),sandbox:"allow-same-origin allow-scripts allow-popups allow-forms allow-popups-to-escape-sandbox allow-top-navigation-by-user-activation",allow:"clipboard-write; fullscreen",referrerPolicy:"no-referrer-when-downgrade"})]})})})]})}export{I 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.