1import{j as g}from"./kinematics-Di5PXsRQ.js";import{a as n}from"./glyphs-myXpDwvS.js";import{A as P,a7 as $}from"./algebra-CcXhFBFE.js";import{a as N,R as W,d as H,o as J,r as Q,e as X}from"./geometry-5DFQyt7V.js";import{runExtensionsOnFrame as Y}from"./modules-mXbkNbYZ.js";import{s as G,i as V}from"./index-C4rntNU6.js";import"./meteorology-7juZoOw8.js";import"./earth-science-52cTImor.js";import"./periodic-table-QDa7g7Xi.js";import"./lab-safety-9lbEFqdD.js";import"./chemistry-lab-TYyt26Gh.js";import"./reading-list-CzfxqSP8.js";import"./acoustics-DPHqfUB8.js";import"./student-portal-DSGij66U.js";function b(r,o){if(r)try{const a=r.contentDocument;a&&a.querySelectorAll("audio, video").forEach(v=>{const m=v;m.muted=o,o&&(m.volume=0)})}catch{}}function ee(r){var a;const o=(a=r.title)==null?void 0:a.trim();if(o&&o!=="rosin"&&o!=="New Tab")return o;try{return new URL(r.url).hostname.replace(/^www\./,"")}catch{return r.url||"Page"}}function we({tab:r,isVisible:o,onNavigate:a,onGoBack:v,onGoForward:m}){var k;const y=n.useRef(null),S=n.useRef(null),d=n.useRef(1),[j,p]=n.useState(!0),[x,A]=n.useState(1),[z,C]=n.useState(!1),[O,I]=n.useState(!1),[U,_]=n.useState(!0),[q,T]=n.useState(r.url);n.useEffect(()=>{T(r.url)},[r.url]);const E=n.useCallback(()=>{var e;return((e=r.frame)==null?void 0:e.frame)??null},[r.frame]),c=n.useCallback(e=>{const t=S.current,s=y.current;if(!t||!s)return;const u=N(s,t,e);d.current=u,A(u)},[]);n.useEffect(()=>{p(!0)},[r.url,r.frame]),n.useEffect(()=>{var h,i;if(!((h=r.frame)!=null&&h.frame))return;const e=S.current;if(!e)return;const t=r.frame.frame;t.parentElement!==e&&e.appendChild(t),t.style.cssText="position:absolute;inset:0;width:100%;height:100%;border:none;background:#fff;";const s=t.getAttribute("src")||t.src||"";!!r.url&&/^https?:\/\//i.test(r.url)&&(!s||s==="about:blank"||s.indexOf("study-path")===-1)&&P(t,r.url);const w=()=>p(!1);if(t.addEventListener("load",w),t.getAttribute("src")&&t.contentDocument)try{((i=t.contentDocument)==null?void 0:i.readyState)==="complete"&&p(!1)}catch{p(!1)}const R=window.setTimeout(()=>p(!1),2500);return()=>{t.removeEventListener("load",w),window.clearTimeout(R)}},[r.frame,r.url]),n.useEffect(()=>{var e;(e=r.frame)!=null&&e.frame&&(r.frame.frame.style.display=o?"block":"none")},[o,r.frame]),n.useEffect(()=>{var h;if(!o||!((h=r.frame)!=null&&h.frame))return;const e=r.frame.frame;let t="",s=null;const u=(i,l=!1)=>{const f=i||r.url,F=`${r.id}|${f}|${e.src||""}`;if(F===t&&e.__pzRivetKey===F)return;t=F;try{e.__pzRivetKey=F}catch{}Y(e,f),G({id:r.id,url:!f||f.startsWith("rosin://")?"about:blank":f,title:r.title,favicon:r.favicon,iframe:e,active:o});const L=()=>{V(e,r.id,f),X(e)};if(l){L();return}s&&window.clearTimeout(s),s=window.setTimeout(L,400)};u(void 0,!1);const w=()=>{try{e.__pzRivetKey="",e.__pzExtRan=new Set,e.__pzShieldRan=new Set}catch{}u(void 0,!1)};e.addEventListener("load",w);const R=i=>{const l=i.detail;if((l==null?void 0:l.tabId)===r.id&&(l!=null&&l.url)){try{e.__pzExtRan=new Set,e.__pzShieldRan=new Set,e.__pzRivetKey=""}catch{}setTimeout(()=>u(l.url,!1),250)}};return window.addEventListener("rosin-url-change",R),()=>{s&&window.clearTimeout(s),e.removeEventListener("load",w),window.removeEventListener("rosin-url-change",R)}},[o,r.frame,r.id,r.url]),n.useEffect(()=>{const e=()=>{const t=!!document.fullscreenElement;I(t),t||_(!0),requestAnimationFrame(()=>c(d.current))};return document.addEventListener("fullscreenchange",e),()=>document.removeEventListener("fullscreenchange",e)},[c]),n.useEffect(()=>{if(!o)return;const e=()=>{document.hidden||b(E(),z)};e();const t=window.setInterval(e,2e3);return()=>window.clearInterval(t)},[z,E,o]),n.useEffect(()=>{o&&requestAnimationFrame(()=>c(d.current))},[o,c,r.url]),n.useEffect(()=>{const e=y.current;if(!e||typeof ResizeObserver>"u")return;const t=new ResizeObserver(()=>{requestAnimationFrame(()=>c(d.current))});t.observe(e);const s=()=>requestAnimationFrame(()=>c(d.current));return window.addEventListener("pz-shell-resize",s),()=>{t.disconnect(),window.removeEventListener("pz-shell-resize",s)}},[c,o]);const Z=()=>{if(v){v();return}H(r,E,a)},D=()=>{var e,t;try{(t=(e=r.frame)==null?void 0:e.reload)==null||t.call(e)}catch{}},K=()=>{J(r.url)},B=()=>{const e=y.current;e&&(document.fullscreenElement?document.exitFullscreen():e.requestFullscreen().catch(()=>{}))},M=()=>
1{if(m){m();return}Q(r,null,E)};return g.jsxs("div",{ref:y,className:"absolute inset-0 w-full h-full overflow-hidden",style:{display:o?"block":"none",background:"#fff"},"data-pz-content-frame":"1",children:[g.jsx("div",{ref:S,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",transformOrigin:"0 0",background:"#fff"}}),j&&g.jsx($,{lite:!0,subtitle:"Connectingâ¦"}),g.jsx(W,{title:ee(r),url:q,onUrlChange:T,onUrlSubmit:a,onUrlBlur:()=>T(r.url),zoom:x,muted:z,isFullscreen:O,controlsVisible:U,bottomOffset:16,onBack:Z,onForward:M,onZoomIn:()=>c(x+.25),onZoomOut:()=>c(x-.25),onToggleMute:()=>C(e=>!e),onReload:(k=r.frame)!=null&&k.reload?D:void 0,onExternal:K,onFullscreen:B,onToggleControls:()=>_(e=>!e)})]})}export{we 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.