(async()=>{ const assert=(ok,msg)=>{if(!ok)throw Error(msg)},delay=ms=>new Promise(r=>setTimeout(r,ms)); const wait=async fn=>{for(let n=0;n<300;n++){if(fn())return;await delay(25)}throw Error('Timeout '+fn)}; const ready=()=>document.querySelector('.slides-frame[data-ready=true]'); await wait(()=>window.PagesSlides); const e=window.PagesEditor; if(e){await wait(()=>document.querySelector('[data-editor-action=slides]')&&e.preview);e.paused=true;document.querySelector('[data-editor-action=slides]').click();} await wait(ready); const frame=ready(),source=e?.text(),historyLength=history.length; assert(frame.dataset.count==='2','Wrong slide count'); assert(frame.sandbox.contains('allow-scripts')&&!frame.sandbox.contains('allow-same-origin'),'Isolation missing'); let isolated=false;try{isolated=!frame.contentDocument}catch{isolated=true}assert(isolated,'Frame can access parent origin'); assert(frame.getBoundingClientRect().height>=240,'Slide frame collapsed'); assert(frame.getBoundingClientRect().width<=innerWidth,'Mobile slide overflow'); if(e&&innerWidth<=700){assert(getComputedStyle(document.querySelector('.editor-pane')).display==='none','Mobile preview not full width');setEditorPreviewVisible(false);assert(getComputedStyle(document.querySelector('.editor-pane')).display!=='none','Mobile source inaccessible');setEditorPreviewVisible(true);} const host=frame.parentElement; // Verify the defensive DOM boundary independently of server sanitization. PagesSlides.render(host,'