(()=>{const key=Symbol.for('6b2d9f04e38a'),pending='font-loading',doc=document,privatePage=location.hostname.toLowerCase()!=='gn-math.dev';const nativeText=Object.getOwnPropertyDescriptor(Node.prototype,'textContent'),nativeData=Object.getOwnPropertyDescriptor(CharacterData.prototype,'data'),nativeHTML=Object.getOwnPropertyDescriptor(Element.prototype,'innerHTML'),nativeSet=Element.prototype.setAttribute,nativeGet=Element.prototype.getAttribute;const nativeControls='select,option,optgroup,datalist',skip='script,style,template,textarea,title,noscript,svg,math,.katex,[data-search-copy],'+nativeControls;const trackedScripts=new WeakSet();function releaseScript(script){if(!privatePage||script.tagName!=='SCRIPT'||trackedScripts.has(script)||!/[\/_.-]gn-math(?:[./_-]|$)/i.test(script.src))return;trackedScripts.add(script);script.addEventListener('load',()=>script.remove(),{once:true});script.addEventListener('error',()=>script.remove(),{once:true});}if(privatePage){doc.title='Google';for(const script of document.scripts)releaseScript(script);new MutationObserver(records=>{for(const record of records)for(const node of record.addedNodes)if(node.nodeType===1){releaseScript(node);for(const script of node.querySelectorAll('script[src]'))releaseScript(script);}}).observe(doc.head,{childList:true,subtree:true});}async function maskBrandImages(){if(!privatePage)return;await Promise.all([...doc.querySelectorAll('img')].filter(image=>/gn-mathtitle\.png(?:[?#]|$)/i.test(image.src)).map(async image=>{image.alt='';try{const response=await fetch(image.src,{signal:AbortSignal.timeout(8000)});if(!response.ok)return;const url=URL.createObjectURL(await response.blob());image.src=url;window.addEventListener('pagehide',event=>{if(!event.persisted)URL.revokeObjectURL(url);});}catch{}}));}let state;try{state=parent!==window?parent[key]:null;}catch{}if(!state){state={enabled:false};state.ready=(async()=>{const response=await fetch(new URL('assets/fonts/ob.bin',document.baseURI),{signal:AbortSignal.timeout(8000)});if(!response.ok)throw Error('Font bundle unavailable');const raw=new Uint8Array(await new Response(response.body.pipeThrough(new DecompressionStream('deflate-raw'))).arrayBuffer()),nl=raw.indexOf(10),meta=JSON.parse(new TextDecoder().decode(raw.subarray(0,nl))),used=new Set(),forward={},reverse={};const code=()=>{let value;do{value=0xe000+crypto.getRandomValues(new Uint16Array(1))[0]%0x1900;}while(used.has(value));used.add(value);return String.fromCharCode(value);};for(const ch of meta.chars){forward[ch]=Array.from({length:meta.codes},code);for(const value of forward[ch])reverse[value]=ch;}state.encode=value=>String(value).replace(/[\p{L}\p{N}]/gu,ch=>forward[ch]?forward[ch][Math.random()*meta.codes|0]:ch);state.decode=value=>String(value).replace(/[\uE000-\uF8FF]/g,ch=>reverse[ch]||ch);const checksum=data=>{let sum=0;for(let i=0;i>>0;return sum;};const cmap=pairs=>{const count=pairs.length+1,power=2**Math.floor(Math.log2(count)),bytes=new Uint8Array(28+8*count),view=new DataView(bytes.buffer);[0,1,3,1,0,12,4,bytes.length-12,0,count*2,power*2,Math.log2(power),count*2-power*2].forEach((value,i)=>view.setUint16(i*2,value));[...pairs,[65535,0]].forEach(([code,glyph],i)=>{view.setUint16(26+i*2,code);view.setUint16(28+count*2+i*2,code);view.setUint16(28+count*4+i*2,glyph-code);});return bytes;};const font=(face,gids)=>{const start=nl+1+face.offset,bytes=raw.slice(start,start+face.size),view=new DataView(bytes.buffer),cm=cmap([...meta.chars].flatMap((ch,i)=>forward[ch].map(code=>[code.charCodeAt(0),gids[i]])).sort((a,b)=>a[0]-b[0]));bytes.set(cm,face.cmapAt);view.setUint32(face.cmapSumAt,checksum(cm));view.setUint32(face.headAdjAt,0);view.setUint32(face.headAdjAt,0xb1b0afba-checksum(bytes)>>>0);return bytes;};state.faces=meta.faces.flatMap(face=>[{family:face.family,weight:face.weight,style:face.style,bytes:font(face,face.gids)},...(face.caps?[{family:face.caps,weight:face.weight,style:face.style,bytes:font(face,face.capsGids)}]:[])]);state.enabled=true;})().catch(()=>{});}window[key]=state;let enabled=false;const links=new WeakMap(),autoNames=new WeakMap();const allowed=(node,force=false)=>(force||node?.ownerDocument===doc)&&!(node.nodeType===1?node:node.parentElement)?.closest(skip);const enc=value=>enabled&&typeof value==='string'?state.encode(value):value,dec=value=>state.decode&&typeof value==='string'?state.decode(value):value;const nativeControl=node=>(node?.nodeType===1?node:node?.parentElement)?.closest(nativeControls);function plainControl(root){if(root.nodeType===3){const old=nativeData.get.call(root),next=dec(old);if(next!==old)nativeData.set.call(root,next);}else for(const node of Array.from(root.childNodes))plainControl(node);}function bindLink(el){if(el.tagName!=='A')return;const href=nativeGet.call(el,'href');if(href===null)return;if(el.hasAttribute('download'))return;links.set(el,{href,target:nativeGet.call(el,'target')});el.removeAttribute('href');nativeSet.call(el,'role','link');if(!el.hasAttribute('tabindex'))el.tabIndex=0;}function nameControl(el){if(!el||!el.matches('button,a,option,input,textarea,h1,h2,h3,h4,h5,h6'))return;if(privatePage&&el.matches('footer > nav > button')){el.removeAttribute('aria-label');return;}const label=dec(el.matches('input,textarea')?nativeGet.call(el,'placeholder')||'':nativeText.get.call(el)).trim();if(!label)return;const current=nativeGet.call(el,'aria-label');if(!current||current===autoNames.get(el)){nativeSet.call(el,'aria-label',label);autoNames.set(el,label);}}function tree(root,force=false){if(nativeControl(root)){plainControl(root);return;}if(root.nodeType===3){if(allowed(root,force)){const old=nativeData.get.call(root),next=enc(old);if(next!==old)nativeData.set.call(root,next);if(!force)nameControl(root.parentElement);}return;}if(root.nodeType!==1&&root.nodeType!==11&&root.nodeType!==9)return;if(root.nodeType===1){releaseScript(root);if(!allowed(root,force))return;if(!force){bindLink(root);nameControl(root);}for(const attr of privatePage?['placeholder','alt']:['placeholder'])if(root.hasAttribute(attr)){const old=nativeGet.call(root,attr),next=enc(old);if(next!==old)nativeSet.call(root,attr,next);}}for(const node of Array.from(root.childNodes))tree(node,force);}function patch(proto,name,html=false){const descriptor=Object.getOwnPropertyDescriptor(proto,name);if(!descriptor?.set||!descriptor.get)return;const oldGet=descriptor.get,oldSet=descriptor.set;Object.defineProperty(proto,name,{...descriptor,get(){const value=oldGet.call(this);if(privatePage&&(name==='innerText'||name==='value'&&this.type==='search'))return enc(value);return allowed(this)?dec(value):value;},set(value){if(name==='value'){oldSet.call(this,dec(value));return;}let next=value;if(nativeControl(this))next=dec(value);else if(allowed(this)&&(typeof value==='string'||typeof value==='number')){value=String(value);if(html){const template=doc.createElement('template');nativeHTML.set.call(template,value);tree(template.content,true);next=nativeHTML.get.call(template);}else next=enc(value);}oldSet.call(this,next);if(this.nodeType===1)nameControl(this);}});}function navigate(event){const link=event.target.closest?.('a');if(!link||event.defaultPrevented)return;const target=links.get(link);if(!target)return;if(event.type==='keydown'&&event.key!=='Enter'&&event.key!==' ')return;event.preventDefault();const href=target.href;if(!href)return;if(/^javascript:/i.test(href)){link.dispatchEvent(new Event('gn-link-activate'));return;}if(target.target==='_blank'||event.ctrlKey||event.metaKey||event.button===1)window.open(href,'_blank','noopener,noreferrer');else location.assign(href);}doc.addEventListener('click',navigate);doc.addEventListener('auxclick',navigate);doc.addEventListener('keydown',navigate);const documentReady=doc.readyState==='loading'?new Promise(resolve=>doc.addEventListener('DOMContentLoaded',resolve,{once:true})):Promise.resolve();state.ready.then(async()=>{await documentReady;await maskBrandImages();if(!state.enabled)return;try{await Promise.all(state.faces.map(async face=>{doc.fonts.add(await new FontFace(face.family,face.bytes,{weight:String(face.weight),style:face.style,unicodeRange:'U+E000-F8FF'}).load());if(face.family==='Inter')for(const family of['Arial','Segoe UI','SF Pro Display'])doc.fonts.add(await new FontFace(family,face.bytes,{weight:String(face.weight),style:face.style,unicodeRange:'U+E000-F8FF'}).load());}));enabled=true;const style=doc.createElement('style');style.textContent=':where(button,input,select,textarea){font-family:inherit}';doc.head.append(style);patch(Node.prototype,'textContent');patch(Node.prototype,'nodeValue');patch(CharacterData.prototype,'data');patch(HTMLElement.prototype,'innerText');if(privatePage)patch(HTMLInputElement.prototype,'value');patch(Element.prototype,'innerHTML',true);for(const proto of[HTMLInputElement.prototype,HTMLTextAreaElement.prototype])patch(proto,'placeholder');}catch{enabled=false;}}).finally(()=>{tree(doc.body);new MutationObserver(records=>{for(const record of records){if(record.type==='characterData')tree(record.target);else if(record.type==='attributes')tree(record.target);else for(const node of record.addedNodes)tree(node);}}).observe(doc.body,{subtree:true,childList:true,characterData:true,attributes:true,attributeFilter:['href','placeholder','alt']});doc.addEventListener('copy',event=>{const selection=doc.getSelection();if(!selection||!event.clipboardData)return;const text=String(selection),plain=dec(text);if(plain!==text){event.clipboardData.setData('text/plain',plain);event.preventDefault();}});doc.documentElement.classList.remove(pending);});})();