brave-search-mcp
Version:
MCP Server that uses Brave Search API to search for images, general web search, video, news and points of interest.
9 lines • 104 kB
HTML
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="color-scheme" content="light dark" />
<title>Brave News Search</title>
<script type="module" crossorigin>!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))n(e);new MutationObserver(e=>{for(const t of e)if("childList"===t.type)for(const e of t.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&n(e)}).observe(document,{childList:!0,subtree:!0})}function n(e){if(e.ep)return;e.ep=!0;const n=function(e){const n={};return e.integrity&&(n.integrity=e.integrity),e.referrerPolicy&&(n.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?n.credentials="include":"anonymous"===e.crossOrigin?n.credentials="omit":n.credentials="same-origin",n}(e);fetch(e.href,n)}}();var e,n,t,o,r,l,i,_,a,u,s,c={},d=[],f=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,p=Array.isArray;function h(e,n){for(var t in n)e[t]=n[t];return e}function v(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function m(n,t,o){var r,l,i,_={};for(i in t)"key"==i?r=t[i]:"ref"==i?l=t[i]:_[i]=t[i];if(arguments.length>2&&(_.children=arguments.length>3?e.call(arguments,2):o),"function"==typeof n&&null!=n.defaultProps)for(i in n.defaultProps)void 0===_[i]&&(_[i]=n.defaultProps[i]);return g(n,_,r,l,null)}function g(e,o,r,l,i){var _={type:e,props:o,key:r,ref:l,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==i?++t:i,__i:-1,__u:0};return null==i&&null!=n.vnode&&n.vnode(_),_}function y(e){return e.children}function b(e,n){this.props=e,this.context=n}function C(e,n){if(null==n)return e.__?C(e.__,e.__i+1):null;for(var t;n<e.__k.length;n++)if(null!=(t=e.__k[n])&&null!=t.__e)return t.__e;return"function"==typeof e.type?C(e):null}function w(e){if(e.__P&&e.__d){var t=e.__v,o=t.__e,r=[],l=[],i=h({},t);i.__v=t.__v+1,n.vnode&&n.vnode(i),D(e.__P,i,t,e.__n,e.__P.namespaceURI,32&t.__u?[o]:null,r,null==o?C(t):o,!!(32&t.__u),l),i.__v=t.__v,i.__.__k[i.__i]=i,R(r,i,l),t.__e=t.__=null,i.__e!=o&&k(i)}}function k(e){if(null!=(e=e.__)&&null!=e.__c)return e.__e=e.__c.base=null,e.__k.some(function(n){if(null!=n&&null!=n.__e)return e.__e=e.__c.base=n.__e}),k(e)}function x(e){(!e.__d&&(e.__d=!0)&&o.push(e)&&!N.__r++||r!=n.debounceRendering)&&((r=n.debounceRendering)||l)(N)}function N(){for(var e,n=1;o.length;)o.length>n&&o.sort(i),e=o.shift(),n=o.length,w(e);N.__r=0}function L(e,n,t,o,r,l,i,_,a,u,s){var f,h,v,m,b,w,k,x=o&&o.__k||d,N=n.length;for(a=function(e,n,t,o,r){var l,i,_,a,u,s=t.length,c=s,d=0;for(e.__k=new Array(r),l=0;l<r;l++)null!=(i=n[l])&&"boolean"!=typeof i&&"function"!=typeof i?("string"==typeof i||"number"==typeof i||"bigint"==typeof i||i.constructor==String?i=e.__k[l]=g(null,i,null,null,null):p(i)?i=e.__k[l]=g(y,{children:i},null,null,null):void 0===i.constructor&&i.__b>0?i=e.__k[l]=g(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):e.__k[l]=i,a=l+d,i.__=e,i.__b=e.__b+1,_=null,-1!=(u=i.__i=M(i,t,a,c))&&(c--,(_=t[u])&&(_.__u|=2)),null==_||null==_.__v?(-1==u&&(r>s?d--:r<s&&d++),"function"!=typeof i.type&&(i.__u|=4)):u!=a&&(u==a-1?d--:u==a+1?d++:(u>a?d--:d++,i.__u|=4))):e.__k[l]=null;if(c)for(l=0;l<s;l++)null!=(_=t[l])&&!(2&_.__u)&&(_.__e==o&&(o=C(_)),I(_,_));return o}(t,n,x,a,N),f=0;f<N;f++)null!=(v=t.__k[f])&&(h=-1!=v.__i&&x[v.__i]||c,v.__i=f,w=D(e,v,h,r,l,i,_,a,u,s),m=v.__e,v.ref&&h.ref!=v.ref&&(h.ref&&B(h.ref,null,v),s.push(v.ref,v.__c||m,v)),null==b&&null!=m&&(b=m),(k=!!(4&v.__u))||h.__k===v.__k?a=P(v,a,e,k):"function"==typeof v.type&&void 0!==w?a=w:m&&(a=m.nextSibling),v.__u&=-7);return t.__e=b,a}function P(e,n,t,o){var r,l;if("function"==typeof e.type){for(r=e.__k,l=0;r&&l<r.length;l++)r[l]&&(r[l].__=e,n=P(r[l],n,t,o));return n}e.__e!=n&&(o&&(n&&e.type&&!n.parentNode&&(n=C(e)),t.insertBefore(e.__e,n||null)),n=e.__e);do{n=n&&n.nextSibling}while(null!=n&&8==n.nodeType);return n}function H(e,n){return n=n||[],null==e||"boolean"==typeof e||(p(e)?e.some(function(e){H(e,n)}):n.push(e)),n}function M(e,n,t,o){var r,l,i,_=e.key,a=e.type,u=n[t],s=null!=u&&!(2&u.__u);if(null===u&&null==_||s&&_==u.key&&a==u.type)return t;if(o>(s?1:0))for(r=t-1,l=t+1;r>=0||l<n.length;)if(null!=(u=n[i=r>=0?r--:l++])&&!(2&u.__u)&&_==u.key&&a==u.type)return i;return-1}function S(e,n,t){"-"==n[0]?e.setProperty(n,null==t?"":t):e[n]=null==t?"":"number"!=typeof t||f.test(n)?t:t+"px"}function A(e,n,t,o,r){var l,i;e:if("style"==n)if("string"==typeof t)e.style.cssText=t;else{if("string"==typeof o&&(e.style.cssText=o=""),o)for(n in o)t&&n in t||S(e.style,n,"");if(t)for(n in t)o&&t[n]==o[n]||S(e.style,n,t[n])}else if("o"==n[0]&&"n"==n[1])l=n!=(n=n.replace(_,"$1")),i=n.toLowerCase(),n=i in e||"onFocusOut"==n||"onFocusIn"==n?i.slice(2):n.slice(2),e.l||(e.l={}),e.l[n+l]=t,t?o?t.u=o.u:(t.u=a,e.addEventListener(n,l?s:u,l)):e.removeEventListener(n,l?s:u,l);else{if("http://www.w3.org/2000/svg"==r)n=n.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=n&&"height"!=n&&"href"!=n&&"list"!=n&&"form"!=n&&"tabIndex"!=n&&"download"!=n&&"rowSpan"!=n&&"colSpan"!=n&&"role"!=n&&"popover"!=n&&n in e)try{e[n]=null==t?"":t;break e}catch(c){}"function"==typeof t||(null==t||!1===t&&"-"!=n[4]?e.removeAttribute(n):e.setAttribute(n,"popover"==n&&1==t?"":t))}}function E(e){return function(t){if(this.l){var o=this.l[t.type+e];if(null==t.t)t.t=a++;else if(t.t<o.u)return;return o(n.event?n.event(t):t)}}}function D(t,o,r,l,i,_,a,u,s,f){var m,g,w,k,x,N,P,H,M,S,E,D,R,B,I,U=o.type;if(void 0!==o.constructor)return null;128&r.__u&&(s=!!(32&r.__u),_=[u=o.__e=r.__e]),(m=n.__b)&&m(o);e:if("function"==typeof U)try{if(H=o.props,M="prototype"in U&&U.prototype.render,S=(m=U.contextType)&&l[m.__c],E=m?S?S.props.value:m.__:l,r.__c?P=(g=o.__c=r.__c).__=g.__E:(M?o.__c=g=new U(H,E):(o.__c=g=new b(H,E),g.constructor=U,g.render=O),S&&S.sub(g),g.state||(g.state={}),g.__n=l,w=g.__d=!0,g.__h=[],g._sb=[]),M&&null==g.__s&&(g.__s=g.state),M&&null!=U.getDerivedStateFromProps&&(g.__s==g.state&&(g.__s=h({},g.__s)),h(g.__s,U.getDerivedStateFromProps(H,g.__s))),k=g.props,x=g.state,g.__v=o,w)M&&null==U.getDerivedStateFromProps&&null!=g.componentWillMount&&g.componentWillMount(),M&&null!=g.componentDidMount&&g.__h.push(g.componentDidMount);else{if(M&&null==U.getDerivedStateFromProps&&H!==k&&null!=g.componentWillReceiveProps&&g.componentWillReceiveProps(H,E),o.__v==r.__v||!g.__e&&null!=g.shouldComponentUpdate&&!1===g.shouldComponentUpdate(H,g.__s,E)){o.__v!=r.__v&&(g.props=H,g.state=g.__s,g.__d=!1),o.__e=r.__e,o.__k=r.__k,o.__k.some(function(e){e&&(e.__=o)}),d.push.apply(g.__h,g._sb),g._sb=[],g.__h.length&&a.push(g);break e}null!=g.componentWillUpdate&&g.componentWillUpdate(H,g.__s,E),M&&null!=g.componentDidUpdate&&g.__h.push(function(){g.componentDidUpdate(k,x,N)})}if(g.context=E,g.props=H,g.__P=t,g.__e=!1,D=n.__r,R=0,M)g.state=g.__s,g.__d=!1,D&&D(o),m=g.render(g.props,g.state,g.context),d.push.apply(g.__h,g._sb),g._sb=[];else do{g.__d=!1,D&&D(o),m=g.render(g.props,g.state,g.context),g.state=g.__s}while(g.__d&&++R<25);g.state=g.__s,null!=g.getChildContext&&(l=h(h({},l),g.getChildContext())),M&&!w&&null!=g.getSnapshotBeforeUpdate&&(N=g.getSnapshotBeforeUpdate(k,x)),B=null!=m&&m.type===y&&null==m.key?q(m.props.children):m,u=L(t,p(B)?B:[B],o,r,l,i,_,a,u,s,f),g.base=o.__e,o.__u&=-161,g.__h.length&&a.push(g),P&&(g.__E=g.__=null)}catch(W){if(o.__v=null,s||null!=_)if(W.then){for(o.__u|=s?160:128;u&&8==u.nodeType&&u.nextSibling;)u=u.nextSibling;_[_.indexOf(u)]=null,o.__e=u}else{for(I=_.length;I--;)v(_[I]);T(o)}else o.__e=r.__e,o.__k=r.__k,W.then||T(o);n.__e(W,o,r)}else null==_&&o.__v==r.__v?(o.__k=r.__k,o.__e=r.__e):u=o.__e=function(t,o,r,l,i,_,a,u,s){var d,f,h,m,g,y,b,w=r.props||c,k=o.props,x=o.type;if("svg"==x?i="http://www.w3.org/2000/svg":"math"==x?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),null!=_)for(d=0;d<_.length;d++)if((g=_[d])&&"setAttribute"in g==!!x&&(x?g.localName==x:3==g.nodeType)){t=g,_[d]=null;break}if(null==t){if(null==x)return document.createTextNode(k);t=document.createElementNS(i,x,k.is&&k),u&&(n.__m&&n.__m(o,_),u=!1),_=null}if(null==x)w===k||u&&t.data==k||(t.data=k);else{if(_=_&&e.call(t.childNodes),!u&&null!=_)for(w={},d=0;d<t.attributes.length;d++)w[(g=t.attributes[d]).name]=g.value;for(d in w)g=w[d],"dangerouslySetInnerHTML"==d?h=g:"children"==d||d in k||"value"==d&&"defaultValue"in k||"checked"==d&&"defaultChecked"in k||A(t,d,null,g,i);for(d in k)g=k[d],"children"==d?m=g:"dangerouslySetInnerHTML"==d?f=g:"value"==d?y=g:"checked"==d?b=g:u&&"function"!=typeof g||w[d]===g||A(t,d,g,w[d],i);if(f)u||h&&(f.__html==h.__html||f.__html==t.innerHTML)||(t.innerHTML=f.__html),o.__k=[];else if(h&&(t.innerHTML=""),L("template"==o.type?t.content:t,p(m)?m:[m],o,r,l,"foreignObject"==x?"http://www.w3.org/1999/xhtml":i,_,a,_?_[0]:r.__k&&C(r,0),u,s),null!=_)for(d=_.length;d--;)v(_[d]);u||(d="value","progress"==x&&null==y?t.removeAttribute("value"):null!=y&&(y!==t[d]||"progress"==x&&!y||"option"==x&&y!=w[d])&&A(t,d,y,w[d],i),d="checked",null!=b&&b!=t[d]&&A(t,d,b,w[d],i))}return t}(r.__e,o,r,l,i,_,a,s,f);return(m=n.diffed)&&m(o),128&o.__u?void 0:u}function T(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(T))}function R(e,t,o){for(var r=0;r<o.length;r++)B(o[r],o[++r],o[++r]);n.__c&&n.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(o){n.__e(o,t.__v)}})}function q(e){return"object"!=typeof e||null==e||e.__b>0?e:p(e)?e.map(q):h({},e)}function B(e,t,o){try{if("function"==typeof e){var r="function"==typeof e.__u;r&&e.__u(),r&&null==t||(e.__u=e(t))}else e.current=t}catch(l){n.__e(l,o)}}function I(e,t,o){var r,l;if(n.unmount&&n.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||B(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(i){n.__e(i,t)}r.base=r.__P=null}if(r=e.__k)for(l=0;l<r.length;l++)r[l]&&I(r[l],t,o||"function"!=typeof e.type);o||v(e.__e),e.__c=e.__=e.__e=void 0}function O(e,n,t){return this.constructor(e,t)}function U(t,o,r){var l,i,_;o==document&&(o=document.documentElement),n.__&&n.__(t,o),l=o.__k,i=[],_=[],D(o,t=o.__k=m(y,null,[t]),l||c,c,o.namespaceURI,l?null:o.firstChild?e.call(o.childNodes):null,i,l?l.__e:o.firstChild,!1,_),R(i,t,_)}e=d.slice,n={__e:function(e,n,t,o){for(var r,l,i;n=n.__;)if((r=n.__c)&&!r.__)try{if((l=r.constructor)&&null!=l.getDerivedStateFromError&&(r.setState(l.getDerivedStateFromError(e)),i=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(e,o||{}),i=r.__d),i)return r.__E=r}catch(_){e=_}throw e}},t=0,b.prototype.setState=function(e,n){var t;t=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=h({},this.state),"function"==typeof e&&(e=e(h({},t),this.props)),e&&h(t,e),null!=e&&this.__v&&(n&&this._sb.push(n),x(this))},b.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),x(this))},b.prototype.render=y,o=[],l="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,i=function(e,n){return e.__v.__b-n.__v.__b},N.__r=0,_=/(PointerCapture)$|Capture$/i,a=0,u=E(!1),s=E(!0);var W=0;function $(e,t,o,r,l,i){t||(t={});var _,a,u=t;if("ref"in u)for(a in u={},t)"ref"==a?_=t[a]:u[a]=t[a];var s={type:e,props:u,key:o,ref:_,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--W,__i:-1,__u:0,__source:l,__self:i};if("function"==typeof e&&(_=e.defaultProps))for(a in _)void 0===u[a]&&(u[a]=_[a]);return n.vnode&&n.vnode(s),s}var F,V,Z,z,j=0,Q=[],K=n,G=K.__b,J=K.__r,X=K.diffed,Y=K.__c,ee=K.unmount,ne=K.__;function te(e,n){K.__h&&K.__h(V,e,j||n),j=0;var t=V.__H||(V.__H={__:[],__h:[]});return e>=t.__.length&&t.__.push({}),t.__[e]}function oe(e){return j=1,function(e,n){var t=te(F++,2);if(t.t=e,!t.__c&&(t.__=[fe(void 0,n),function(e){var n=t.__N?t.__N[0]:t.__[0],o=t.t(n,e);n!==o&&(t.__N=[o,t.__[1]],t.__c.setState({}))}],t.__c=V,!V.__f)){var o=function(e,n,o){if(!t.__c.__H)return!0;var l=t.__c.__H.__.filter(function(e){return e.__c});if(l.every(function(e){return!e.__N}))return!r||r.call(this,e,n,o);var i=t.__c.props!==e;return l.some(function(e){if(e.__N){var n=e.__[0];e.__=e.__N,e.__N=void 0,n!==e.__[0]&&(i=!0)}}),r&&r.call(this,e,n,o)||i};V.__f=!0;var r=V.shouldComponentUpdate,l=V.componentWillUpdate;V.componentWillUpdate=function(e,n,t){if(this.__e){var i=r;r=void 0,o(e,n,t),r=i}l&&l.call(this,e,n,t)},V.shouldComponentUpdate=o}return t.__N||t.__}(fe,e)}function re(e,n){var t=te(F++,3);!K.__s&&de(t.__H,n)&&(t.__=e,t.u=n,V.__H.__h.push(t))}function le(e,n){var t=te(F++,7);return de(t.__H,n)&&(t.__=e(),t.__H=n,t.__h=e),t.__}function ie(e,n){return j=8,le(function(){return e},n)}function _e(){for(var e;e=Q.shift();){var n=e.__H;if(e.__P&&n)try{n.__h.some(se),n.__h.some(ce),n.__h=[]}catch(t){n.__h=[],K.__e(t,e.__v)}}}K.__b=function(e){V=null,G&&G(e)},K.__=function(e,n){e&&n.__k&&n.__k.__m&&(e.__m=n.__k.__m),ne&&ne(e,n)},K.__r=function(e){J&&J(e),F=0;var n=(V=e.__c).__H;n&&(Z===V?(n.__h=[],V.__h=[],n.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(n.__h.some(se),n.__h.some(ce),n.__h=[],F=0)),Z=V},K.diffed=function(e){X&&X(e);var n=e.__c;n&&n.__H&&(n.__H.__h.length&&(1!==Q.push(n)&&z===K.requestAnimationFrame||((z=K.requestAnimationFrame)||ue)(_e)),n.__H.__.some(function(e){e.u&&(e.__H=e.u),e.u=void 0})),Z=V=null},K.__c=function(e,n){n.some(function(e){try{e.__h.some(se),e.__h=e.__h.filter(function(e){return!e.__||ce(e)})}catch(t){n.some(function(e){e.__h&&(e.__h=[])}),n=[],K.__e(t,e.__v)}}),Y&&Y(e,n)},K.unmount=function(e){ee&&ee(e);var n,t=e.__c;t&&t.__H&&(t.__H.__.some(function(e){try{se(e)}catch(t){n=t}}),t.__H=void 0,n&&K.__e(n,t.__v))};var ae="function"==typeof requestAnimationFrame;function ue(e){var n,t=function(){clearTimeout(o),ae&&cancelAnimationFrame(n),setTimeout(e)},o=setTimeout(t,35);ae&&(n=requestAnimationFrame(t))}function se(e){var n=V,t=e.__c;"function"==typeof t&&(e.__c=void 0,t()),V=n}function ce(e){var n=V;e.__c=e.__(),V=n}function de(e,n){return!e||e.length!==n.length||n.some(function(n,t){return n!==e[t]})}function fe(e,n){return"function"==typeof n?n(e):n}function pe(e,n){for(var t in e)if("__source"!==t&&!(t in n))return!0;for(var o in n)if("__source"!==o&&e[o]!==n[o])return!0;return!1}function he(e){try{return!((n=e.__)===(t=e.u())&&(0!==n||1/n==1/t)||n!=n&&t!=t)}catch(o){return!0}var n,t}function ve(e,n){this.props=e,this.context=n}(ve.prototype=new b).isPureReactComponent=!0,ve.prototype.shouldComponentUpdate=function(e,n){return pe(this.props,e)||pe(this.state,n)};var me=n.__b;n.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),me&&me(e)};var ge=n.__e;n.__e=function(e,n,t,o){if(e.then)for(var r,l=n;l=l.__;)if((r=l.__c)&&r.__c)return null==n.__e&&(n.__e=t.__e,n.__k=t.__k),r.__c(e,n);ge(e,n,t,o)};var ye=n.unmount;function be(e,n,t){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(e){"function"==typeof e.__c&&e.__c()}),e.__c.__H=null),null!=(e=function(e,n){for(var t in n)e[t]=n[t];return e}({},e)).__c&&(e.__c.__P===t&&(e.__c.__P=n),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(e){return be(e,n,t)})),e}function Ce(e,n,t){return e&&t&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(e){return Ce(e,n,t)}),e.__c&&e.__c.__P===n&&(e.__e&&t.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=t)),e}function we(){this.__u=0,this.o=null,this.__b=null}function ke(e){if(!e.__)return null;var n=e.__.__c;return n&&n.__a&&n.__a(e)}function xe(){this.i=null,this.l=null}n.unmount=function(e){var n=e.__c;n&&(n.__z=!0),n&&n.__R&&n.__R(),n&&32&e.__u&&(e.type=null),ye&&ye(e)},(we.prototype=new b).__c=function(e,n){var t=n.__c,o=this;null==o.o&&(o.o=[]),o.o.push(t);var r=ke(o.__v),l=!1,i=function(){l||o.__z||(l=!0,t.__R=null,r?r(a):a())};t.__R=i;var _=t.__P;t.__P=null;var a=function(){if(! --o.__u){if(o.state.__a){var e=o.state.__a;o.__v.__k[0]=Ce(e,e.__c.__P,e.__c.__O)}var n;for(o.setState({__a:o.__b=null});n=o.o.pop();)n.__P=_,n.forceUpdate()}};o.__u++||32&n.__u||o.setState({__a:o.__b=o.__v.__k[0]}),e.then(i,i)},we.prototype.componentWillUnmount=function(){this.o=[]},we.prototype.render=function(e,n){if(this.__b){if(this.__v.__k){var t=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=be(this.__b,t,o.__O=o.__P)}this.__b=null}var r=n.__a&&m(y,null,e.fallback);return r&&(r.__u&=-33),[m(y,null,n.__a?null:e.children),r]};var Ne=function(e,n,t){if(++t[1]===t[0]&&e.l.delete(n),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.l.size))for(t=e.i;t;){for(;t.length>3;)t.pop()();if(t[1]<t[0])break;e.i=t=t[2]}};(xe.prototype=new b).__a=function(e){var n=this,t=ke(n.__v),o=n.l.get(e);return o[0]++,function(r){var l=function(){n.props.revealOrder?(o.push(r),Ne(n,e,o)):r()};t?t(l):l()}},xe.prototype.render=function(e){this.i=null,this.l=new Map;var n=H(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&n.reverse();for(var t=n.length;t--;)this.l.set(n[t],this.i=[1,0,this.i]);return e.children},xe.prototype.componentDidUpdate=xe.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(n,t){Ne(e,t,n)})};var Le="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Pe=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,He=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Me=/[A-Z0-9]/g,Se="undefined"!=typeof document,Ae=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};b.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(b.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(n){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:n})}})});var Ee=n.event;function De(){}function Te(){return this.cancelBubble}function Re(){return this.defaultPrevented}n.event=function(e){return Ee&&(e=Ee(e)),e.persist=De,e.isPropagationStopped=Te,e.isDefaultPrevented=Re,e.nativeEvent=e};var qe={enumerable:!1,configurable:!0,get:function(){return this.class}},Be=n.vnode;n.vnode=function(e){"string"==typeof e.type&&function(e){var n=e.props,t=e.type,o={},r=-1===t.indexOf("-");for(var l in n){var i=n[l];if(!("value"===l&&"defaultValue"in n&&null==i||Se&&"children"===l&&"noscript"===t||"class"===l||"className"===l)){var _=l.toLowerCase();"defaultValue"===l&&"value"in n&&null==n.value?l="value":"download"===l&&!0===i?i="":"translate"===_&&"no"===i?i=!1:"o"===_[0]&&"n"===_[1]?"ondoubleclick"===_?l="ondblclick":"onchange"!==_||"input"!==t&&"textarea"!==t||Ae(n.type)?"onfocus"===_?l="onfocusin":"onblur"===_?l="onfocusout":He.test(l)&&(l=_):_=l="oninput":r&&Pe.test(l)?l=l.replace(Me,"-$&").toLowerCase():null===i&&(i=void 0),"oninput"===_&&o[l=_]&&(l="oninputCapture"),o[l]=i}}"select"==t&&o.multiple&&Array.isArray(o.value)&&(o.value=H(n.children).forEach(function(e){e.props.selected=-1!=o.value.indexOf(e.props.value)})),"select"==t&&null!=o.defaultValue&&(o.value=H(n.children).forEach(function(e){e.props.selected=o.multiple?-1!=o.defaultValue.indexOf(e.props.value):o.defaultValue==e.props.value})),n.class&&!n.className?(o.class=n.class,Object.defineProperty(o,"className",qe)):n.className&&(o.class=o.className=n.className),e.props=o}(e),e.$$typeof=Le,Be&&Be(e)};var Ie=n.__r;n.__r=function(e){Ie&&Ie(e),e.__c};var Oe=n.diffed;n.diffed=function(e){Oe&&Oe(e);var n=e.props,t=e.__e;null!=t&&"textarea"===e.type&&"value"in n&&n.value!==t.value&&(t.value=null==n.value?"":n.value)};var Ue=y;function We(e){const n=document.documentElement;n.setAttribute("data-theme",e),n.style.colorScheme=e}const $e="openai:set_globals";function Fe(e){const n=ie(n=>{if("undefined"==typeof window)return()=>{};const t=t=>{const o=t;o.detail?.globals&&e in o.detail.globals&&n()};return window.addEventListener($e,t,{passive:!0}),()=>{window.removeEventListener($e,t)}},[e]),t=ie(()=>{if("undefined"!=typeof window)return window.openai?.[e]},[e]);return ie(()=>{},[]),o=n,l=(r=t)(),i=oe({t:{__:l,u:r}}),_=i[0].t,a=i[1],function(e,n){var t=te(F++,4);!K.__s&&de(t.__H,n)&&(t.__=e,t.u=n,V.__h.push(t))}(function(){_.__=l,_.u=r,he(_)&&a({t:_})},[o,l,r]),re(function(){return he(_)&&a({t:_}),o(function(){he(_)&&a({t:_})})},[o]),l;var o,r,l,i,_,a}const Ve="(prefers-color-scheme: dark)";function Ze(){const e=Fe("theme");var n;re(()=>{if(n)return void We(n);const e=()=>{We(window.matchMedia?.(Ve).matches?"dark":"light")};e();const t=window.matchMedia?.(Ve);if(!t)return;const o=()=>e();return t.addEventListener?(t.addEventListener("change",o),()=>{t.removeEventListener("change",o)}):(t.addListener?.(o),()=>{t.removeListener?.(o)})},[n="light"===e||"dark"===e?e:void 0])}const ze=e=>$("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:$("path",{d:"M5.29289 12.7071C4.90237 12.3166 4.90237 11.6834 5.29289 11.2929L10.2929 6.29289C10.6834 5.90237 11.3166 5.90237 11.7071 6.29289C12.0976 6.68342 12.0976 7.31658 11.7071 7.70711L8.41421 11H18C18.5523 11 19 11.4477 19 12C19 12.5523 18.5523 13 18 13H8.41421L11.7071 16.2929C12.0976 16.6834 12.0976 17.3166 11.7071 17.7071C11.3166 18.0976 10.6834 18.0976 10.2929 17.7071L5.29289 12.7071Z",fill:"currentColor"})}),je=e=>$("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:$("path",{d:"M18.7071 12.7071C19.0976 12.3166 19.0976 11.6834 18.7071 11.2929L13.7071 6.29289C13.3166 5.90237 12.6834 5.90237 12.2929 6.29289C11.9024 6.68342 11.9024 7.31658 12.2929 7.70711L15.5858 11H6C5.44771 11 5 11.4477 5 12C5 12.5523 5.44771 13 6 13H15.5858L12.2929 16.2929C11.9024 16.6834 11.9024 17.3166 12.2929 17.7071C12.6834 18.0976 13.3166 18.0976 13.7071 17.7071L18.7071 12.7071Z",fill:"currentColor"})}),Qe=e=>$("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:$("path",{fillRule:"evenodd",d:"M18.063 5.674a1 1 0 0 1 .263 1.39l-7.5 11a1 1 0 0 1-1.533.143l-4.5-4.5a1 1 0 1 1 1.414-1.414l3.647 3.647 6.82-10.003a1 1 0 0 1 1.39-.263Z",clipRule:"evenodd"})}),Ke=e=>$("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:$("path",{d:"M13 4a1 1 0 1 1 2 0v3.586l4.293-4.293a1 1 0 1 1 1.414 1.414L16.414 9H20a1 1 0 1 1 0 2h-6a1 1 0 0 1-1-1V4ZM3 14a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v6a1 1 0 1 1-2 0v-3.586l-4.293 4.293a1 1 0 0 1-1.414-1.414L7.586 15H4a1 1 0 0 1-1-1Z"})}),Ge=e=>$("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:$("path",{d:"M13 4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v6a1 1 0 1 1-2 0V6.414l-3.793 3.793a1 1 0 0 1-1.414-1.414L17.586 5H14a1 1 0 0 1-1-1Zm-9 9a1 1 0 0 1 1 1v3.586l3.793-3.793a1 1 0 0 1 1.414 1.414L6.414 19H10a1 1 0 1 1 0 2H4a1 1 0 0 1-1-1v-6a1 1 0 0 1 1-1Z"})}),Je=e=>$("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:$("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.7587 3H16.2413C17.0463 2.99999 17.7106 2.99998 18.2518 3.04419C18.8139 3.09012 19.3306 3.18868 19.816 3.43598C20.5686 3.81947 21.1805 4.43139 21.564 5.18404C21.8113 5.66937 21.9099 6.18608 21.9558 6.74817C22 7.28936 22 7.95372 22 8.75868V15.2413C22 16.0463 22 16.7106 21.9558 17.2518C21.9099 17.8139 21.8113 18.3306 21.564 18.816C21.1805 19.5686 20.5686 20.1805 19.816 20.564C19.3306 20.8113 18.8139 20.9099 18.2518 20.9558C17.7106 21 17.0463 21 16.2413 21H7.75868C6.95372 21 6.28936 21 5.74817 20.9558C5.18608 20.9099 4.66937 20.8113 4.18404 20.564C3.43139 20.1805 2.81947 19.5686 2.43597 18.816C2.18868 18.3306 2.09012 17.8139 2.04419 17.2518C1.99998 16.7106 1.99999 16.0463 2 15.2413V8.7587C1.99999 7.95373 1.99998 7.28937 2.04419 6.74817C2.09012 6.18608 2.18868 5.66937 2.43597 5.18404C2.81947 4.43139 3.43139 3.81947 4.18404 3.43597C4.66937 3.18868 5.18608 3.09012 5.74817 3.04419C6.28937 2.99998 6.95373 2.99999 7.7587 3ZM5.91104 5.03755C5.47262 5.07337 5.24842 5.1383 5.09202 5.21799C4.7157 5.40973 4.40973 5.7157 4.21799 6.09202C4.1383 6.24842 4.07337 6.47262 4.03755 6.91104C4.00078 7.36113 4 7.94342 4 8.8V15.2C4 16.0566 4.00078 16.6389 4.03755 17.089C4.07337 17.5274 4.1383 17.7516 4.21799 17.908C4.40973 18.2843 4.7157 18.5903 5.09202 18.782C5.24842 18.8617 5.47262 18.9266 5.91104 18.9624C6.36113 18.9992 6.94342 19 7.8 19H16.2C17.0566 19 17.6389 18.9992 18.089 18.9624C18.5274 18.9266 18.7516 18.8617 18.908 18.782C19.2843 18.5903 19.5903 18.2843 19.782 17.908C19.8617 17.7516 19.9266 17.5274 19.9624 17.089C19.9992 16.6389 20 16.0566 20 15.2V8.8C20 7.94342 19.9992 7.36113 19.9624 6.91104C19.9266 6.47262 19.8617 6.24842 19.782 6.09202C19.5903 5.7157 19.2843 5.40973 18.908 5.21799C18.7516 5.1383 18.5274 5.07337 18.089 5.03755C17.6389 5.00078 17.0566 5 16.2 5H7.8C6.94342 5 6.36113 5.00078 5.91104 5.03755ZM6 8C6 7.44772 6.44772 7 7 7H10.5C11.0523 7 11.5 7.44772 11.5 8V12C11.5 12.5523 11.0523 13 10.5 13H7C6.44772 13 6 12.5523 6 12V8ZM8 9V11H9.5V9H8ZM13.5 8C13.5 7.44772 13.9477 7 14.5 7H17C17.5523 7 18 7.44772 18 8C18 8.55229 17.5523 9 17 9H14.5C13.9477 9 13.5 8.55229 13.5 8ZM13.5 12C13.5 11.4477 13.9477 11 14.5 11H17C17.5523 11 18 11.4477 18 12C18 12.5523 17.5523 13 17 13H14.5C13.9477 13 13.5 12.5523 13.5 12ZM5.99783 16C5.99783 15.4477 6.44555 15 6.99783 15H16.9978C17.5501 15 17.9978 15.4477 17.9978 16C17.9978 16.5523 17.5501 17 16.9978 17H6.99783C6.44555 17 5.99783 16.5523 5.99783 16Z",fill:"currentColor"})}),Xe=e=>$("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:$("path",{fillRule:"evenodd",d:"M12 5a1 1 0 0 1 1 1v5h5a1 1 0 1 1 0 2h-5v5a1 1 0 1 1-2 0v-5H6a1 1 0 1 1 0-2h5V6a1 1 0 0 1 1-1Z",clipRule:"evenodd"})});function Ye({onRequestFullscreen:e,displayMode:n}){const t="fullscreen"===n;return $("button",{className:"fullscreen-btn",onClick:e,title:t?"Exit fullscreen":"Enter fullscreen","aria-label":t?"Exit fullscreen":"Enter fullscreen",children:$(t?Ke:Ge,{width:16,height:16})})}function en({direction:e,className:n,disabled:t,...o}){const r="previous"===e,l=r?"Previous":"Next";return $("button",{type:"button",className:`inline-flex h-8 min-w-[88px] items-center justify-center gap-1.5 rounded-full border border-[var(--color-border-secondary-outline)] bg-transparent px-3 text-[13px] font-medium text-[var(--color-text-secondary-outline)] transition-colors duration-150 ease-out ${t?"cursor-not-allowed border-[var(--color-border-disabled)] text-[var(--color-text-disabled)]":"hover:bg-[var(--color-background-secondary-outline-hover)] hover:text-[var(--color-text-secondary-outline-hover)] active:bg-[var(--color-background-secondary-outline-active)]"}${n?` ${n}`:""}`,disabled:t,...o,children:[r&&$(ze,{width:14,height:14}),l,!r&&$(je,{width:14,height:14})]})}function nn({size:e,strokeWidth:n}){return $("span",{className:"inline-block animate-spin rounded-full border-solid border-[var(--grid-line-strong)] border-t-[var(--accent)]",style:{width:e,height:e,borderWidth:n},"aria-hidden":"true"})}function tn({variant:e,brandSub:n,query:t,countLabel:o,isInitialLoading:r,loadingQuery:l,error:i,infoBanner:_,hasData:a,isEmpty:u,emptyTitle:s,emptyDescription:c,noResultsTitle:d="No results",noResultsDescription:f="Try a different query.",children:p,pagination:h,context:v,hostContext:m,displayMode:g,requestDisplayMode:y}){const b=m?.safeAreaInsets,C={paddingTop:b?.top,paddingRight:b?.right,paddingBottom:b?.bottom,paddingLeft:b?.left,marginBottom:b?.bottom},w=h?` · Page ${h.pageNumber}`:"",k=v&&v.count>0?` · ${v.count} in context`:"",x=Boolean(h?.isLoading&&a&&!u),N=Boolean(v?.addAllDisabled||x),L=N?"cursor-not-allowed border-[var(--color-border-disabled)] bg-[var(--color-background-disabled)] text-[var(--color-text-disabled)]":"hover:bg-[var(--color-background-secondary-soft-alpha-hover)] active:bg-[var(--color-background-secondary-soft-alpha-active)]";return $("main",{className:`app ${e}-app`,style:C,"data-display-mode":g,children:[$("header",{className:"header",children:[$("div",{className:"brand",children:[$("span",{className:"brand-mark",children:"Brave"}),$("span",{className:"brand-sub",children:n})]}),$("div",{className:"header-right",children:[$("div",{className:"meta",children:[$("div",{className:"term",children:a?t:r&&l?l:`Run brave_${e}_search to see results`}),$("div",{className:"count",children:[a?o:r?"Searching...":"Awaiting tool output",a&&h&&w,k]})]}),$("div",{className:"header-actions",children:[v&&$("button",{type:"button",className:`inline-flex h-8 items-center justify-center rounded-full border border-transparent bg-[var(--color-background-secondary-soft-alpha)] px-3 text-[13px] font-medium text-[var(--color-text-secondary-soft)] transition-colors duration-150 ease-out ${L}`,onClick:v.onAddAll,disabled:N,children:"Add All"}),y&&$(Ye,{onRequestFullscreen:()=>{y&&y("fullscreen"===g?"inline":"fullscreen")},displayMode:g})]})]})]}),i&&$("div",{className:"error-banner",children:[$("strong",{children:"Error:"})," ",i]}),_&&$("div",{className:"info-banner",children:_}),r&&!a&&$("section",{className:"loading-state",children:[$(nn,{size:32,strokeWidth:3}),$("p",{children:["Searching for"," ",$("strong",{children:l||"..."})]})]}),!a&&!r&&$("section",{className:"empty-state",children:[$("h2",{children:s}),$("p",{children:c})]}),a&&u&&!i&&$("section",{className:"empty-state",children:[$("h2",{children:d}),$("p",{children:f})]}),a&&!u&&$("section",{className:"results-region"+(x?" results-region--loading":""),"aria-busy":x,children:[$("div",{className:"results-content"+(x?" results-content--locked":""),inert:x,children:p}),x?$("div",{className:"results-loading-overlay",role:"status","aria-label":"Loading page results",children:$("div",{className:"results-loading-content",children:[$(nn,{size:28,strokeWidth:3}),$("span",{children:"Loading results..."})]})}):null]}),h&&a&&!u&&$("footer",{className:"app-footer",style:void 0,children:$("nav",{className:"pagination","aria-label":"Pagination",children:[$(en,{direction:"previous",onClick:h.onPrevious,disabled:!h.hasPrevious||h.isLoading,"aria-label":"Previous page"}),$("span",{className:"pagination-info",children:h.isLoading?"Loading...":`Page ${h.pageNumber}`}),$(en,{direction:"next",onClick:h.onNext,disabled:!h.hasNext||h.isLoading,"aria-label":"Next page"})]})})]})}function on({item:e,index:n,onOpenLink:t,isInContext:o,onToggleContext:r}){return $("article",{className:"news-card-shell",children:[$("button",{type:"button",className:`news-card ${e.breaking?"news-card--breaking":""} ${o?"news-card--in-context":""}`,onClick:()=>{t(e.url)},style:{animationDelay:60*n+"ms"},children:[$("div",{className:"news-thumbnail",children:e.thumbnail?.src?$("img",{src:e.thumbnail.src,alt:"",className:"news-thumbnail-img",loading:"lazy"}):$("div",{className:"news-placeholder",children:$(Je,{width:24,height:24})})}),$("div",{className:"news-content",children:[$("div",{className:"news-header",children:[$("span",{className:"news-source",children:[e.favicon&&$("img",{src:e.favicon,alt:"",className:"news-favicon"}),e.source]}),$("span",{className:"news-age",children:e.age}),e.breaking&&$("span",{className:"news-breaking-badge",children:"BREAKING"})]}),$("h3",{className:"news-title",children:e.title}),$("p",{className:"news-description",children:e.description})]})]}),r&&$("button",{type:"button",className:"context-btn "+(o?"context-btn--active":""),onClick:n=>{n.stopPropagation(),r&&r(e)},"aria-label":o?"Remove from context":"Add to context",title:o?"In context":"Add to context",children:$(o?Qe:Xe,{width:16,height:16})})]})}const rn=[];function ln({toolResult:e,hostContext:n,openLink:t,sendLog:o,displayMode:r,requestDisplayMode:l,onLoadPage:i,isLoading:_,isInitialLoading:a,loadingQuery:u,contextArticles:s=rn,onContextChange:c}){const[d,f]=oe(!1),p=_??d,h=e?._meta?.structuredContent??e?.structuredContent,v=h?.items??[],m=h?.error,g=Boolean(h),y=h?.offset??0,b=h?.returnedCount??v.length,C=h?.pageSize??h?.count??v.length,w=y>0,k=y<9&&v.length>0,x=Boolean(i)&&g&&!m,N=le(()=>new Set(s.map(e=>e.url)),[s]),L=e=>N.has(e),P=Boolean(c),H=async e=>{try{const{isError:n}=await t({url:e});n&&await o({level:"warning",data:`Open link rejected: ${e}`})}catch(n){await o({level:"error",data:`Open link failed: ${n instanceof Error?n.message:String(n)}`})}},M=e=>{if(!c)return;const n={title:e.title,source:e.source,age:e.age,url:e.url};L(e.url)?c(s.filter(n=>n.url!==e.url)):c([...s,n])},S=y+1;return $(tn,{variant:"news",brandSub:"News Search",query:h?.query,countLabel:`${b}/${C} articles`,error:m,isInitialLoading:a,loadingQuery:u,hasData:g,isEmpty:0===v.length,emptyTitle:"News Search",emptyDescription:"Ask to search for news on any topic.",noResultsTitle:"No results",noResultsDescription:"Try a different query or adjust the freshness filter.",hostContext:n,displayMode:r,requestDisplayMode:l,pagination:x?{pageNumber:S,hasPrevious:w,hasNext:k,isLoading:p,onPrevious:async()=>{if(i&&!p&&w){f(!0);try{await i(y-1)}finally{f(!1)}}},onNext:async()=>{if(i&&!p&&k){f(!0);try{await i(y+1)}finally{f(!1)}}}}:void 0,context:P&&v.length>0?{count:s.length,onAddAll:()=>{if(!c)return;const e=v.filter(e=>!L(e.url)).map(e=>({title:e.title,source:e.source,age:e.age,url:e.url}));c([...s,...e])},addAllDisabled:v.every(e=>L(e.url))}:void 0,children:$("section",{className:"news-list",children:v.map((e,n)=>$(on,{item:e,index:n,onOpenLink:H,isInContext:L(e.url),onToggleContext:P?M:void 0},e.url))})})}function _n(){Ze();const e=Fe("toolInput"),n=Fe("toolOutput"),t=Fe("toolResponseMetadata"),o=t?.structuredContent??n?.structuredContent,[r,l]=oe([]),{displayMode:i,hostContext:_,openLink:a,requestDisplayMode:u,noopLog:s,canCallTool:c,canSetWidgetState:d,callTool:f,setWidgetState:p,currentData:h,isLoading:v,setIsLoading:m,setPagedOutput:g}=function({toolInputQuery:e=null,initialData:n=null}={}){const t=Fe("displayMode"),o=Fe("safeArea"),[r,l]=oe(null),[i,_]=oe(!1),a=le(()=>{const e=o?.insets;return e?{safeAreaInsets:{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}:null},[o]),u=e??n?.query??null,s=r&&u&&r.query===u?r:n;re(()=>{if(r&&u&&r.query!==u){const e=setTimeout(()=>{l(null),_(!1)},0);return()=>clearTimeout(e)}},[u,r]);const c=ie(async({url:e})=>{try{return window.openai?.openExternal&&await window.openai.openExternal({href:e}),{isError:!1}}catch{return{isError:!0}}},[]),d=ie(async e=>{if(window.openai?.requestDisplayMode)return await window.openai.requestDisplayMode({mode:e}),e},[]),f=ie(async()=>{},[]),p=ie(async(e,n)=>window.openai?.callTool?window.openai.callTool(e,n):null,[]),h=ie(e=>{window.openai?.setWidgetState?.(e)},[]);return{displayMode:t,hostContext:a,openLink:c,requestDisplayMode:d,noopLog:f,canCallTool:Boolean(window.openai?.callTool),canSetWidgetState:Boolean(window.openai?.setWidgetState),canRequestDisplayMode:Boolean(window.openai?.requestDisplayMode),callTool:p,setWidgetState:h,currentData:s,hostQuery:u,isLoading:i,setIsLoading:_,setPagedOutput:l}}({toolInputQuery:e?.query??null,initialData:o}),y=ie(async e=>{if(h){m(!0);try{const n=function(e){if(!e||"object"!=typeof e)return null;const n=e;return n.meta?.structuredContent??n._meta?.structuredContent??n.structuredContent??null}(await f("brave_news_search",{query:h.query,count:h.pageSize??h.count??10,offset:e}));n&&g(n)}catch(n){console.error("Failed to load page:",n)}finally{m(!1)}}},[f,h,m,g]),b=ie(e=>{l(e),p({modelContent:{selectedArticles:e.map((e,n)=>({index:n+1,title:e.title,source:e.source,age:e.age,url:e.url})),count:e.length}})},[p]),C=Boolean(h),w=null!==e&&!C,k=e?.query;return $(ln,{toolInputs:null,toolInputsPartial:null,toolResult:h?{structuredContent:h}:null,hostContext:_,openLink:a,sendLog:s,displayMode:i??"inline",requestDisplayMode:u,onLoadPage:c?y:void 0,isLoading:v,isInitialLoading:w,loadingQuery:k,contextArticles:r,onContextChange:d?b:void 0})}var an;(an=document.getElementById("root"),{render:function(e){var n,t;n=e,null==(t=an).__k&&(t.textContent=""),U(n,t),n&&n.__c},unmount:function(){var e;(e=an).__k&&U(null,e)}}).render($(Ue,{children:$(_n,{})}));</script>
<style rel="stylesheet" crossorigin>@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style:solid;--tw-font-weight:initial;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-ease:initial}}}@layer theme{:root,:host{--font-sans:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;--font-mono:ui-monospace,"SFMono-Regular","SF Mono","Menlo","Monaco","Consolas","Liberation Mono","DejaVu Sans Mono","Courier New",monospace;--spacing:.25rem;--breakpoint-sm:576px;--breakpoint-md:768px;--breakpoint-lg:1024px;--breakpoint-xl:1280px;--breakpoint-2xl:1536px;--tracking-tight:-.025em;--tracking-normal:0em;--tracking-wide:.025em;--ease-out:cubic-bezier(0,0,.2,1);--animate-spin:spin 1s linear infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--breakpoint-xs:380px;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--radius-2xs:.125rem;--radius-xs:.25rem;--radius-sm: calc(.5rem - 4px) ;--radius-md: calc(.5rem - 2px) ;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--radius-3xl:1.25rem;--radius-4xl:1.5rem;--radius-full:9999px}:root,:where([data-theme]){--gray-500:#5d5d5d;--alpha-0:var(--alpha-base)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--alpha-0:color-mix(in oklab,var(--alpha-base)0%,transparent)}}:root,:where([data-theme]){--alpha-02:var(--alpha-base)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--alpha-02:color-mix(in oklab,var(--alpha-base)2%,transparent)}}:root,:where([data-theme]){--alpha-04:var(--alpha-base)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--alpha-04:color-mix(in oklab,var(--alpha-base)4%,transparent)}}:root,:where([data-theme]){--alpha-05:var(--alpha-base)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--alpha-05:color-mix(in oklab,var(--alpha-base)5%,transparent)}}:root,:where([data-theme]){--alpha-06:var(--alpha-base)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--alpha-06:color-mix(in oklab,var(--alpha-base)6%,transparent)}}:root,:where([data-theme]){--alpha-08:var(--alpha-base)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--alpha-08:color-mix(in oklab,var(--alpha-base)8%,transparent)}}:root,:where([data-theme]){--alpha-10:var(--alpha-base)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--alpha-10:color-mix(in oklab,var(--alpha-base)10%,transparent)}}:root,:where([data-theme]){--alpha-12:var(--alpha-base)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--alpha-12:color-mix(in oklab,var(--alpha-base)12%,transparent)}}:root,:where([data-theme]){--alpha-15:var(--alpha-base)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--alpha-15:color-mix(in oklab,var(--alpha-base)15%,transparent)}}:root,:where([data-theme]){--alpha-16:var(--alpha-base)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--alpha-16:color-mix(in oklab,var(--alpha-base)16%,transparent)}}:root,:where([data-theme]){--alpha-20:var(--alpha-base)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--alpha-20:color-mix(in oklab,var(--alpha-base)20%,transparent)}}:root,:where([data-theme]){--alpha-25:var(--alpha-base)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--alpha-25:color-mix(in oklab,var(--alpha-base)25%,transparent)}}:root,:where([data-theme]){--alpha-30:var(--alpha-base)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--alpha-30:color-mix(in oklab,var(--alpha-base)30%,transparent)}}:root,:where([data-theme]){--alpha-35:var(--alpha-base)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--alpha-35:color-mix(in oklab,var(--alpha-base)35%,transparent)}}:root,:where([data-theme]){--alpha-40:var(--alpha-base)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--alpha-40:color-mix(in oklab,var(--alpha-base)40%,transparent)}}:root,:where([data-theme]){--alpha-50:var(--alpha-base)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--alpha-50:color-mix(in oklab,var(--alpha-base)50%,transparent)}}:root,:where([data-theme]){--alpha-60:var(--alpha-base)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--alpha-60:color-mix(in oklab,var(--alpha-base)60%,transparent)}}:root,:where([data-theme]){--alpha-70:var(--alpha-base)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--alpha-70:color-mix(in oklab,var(--alpha-base)70%,transparent)}}:root,:where([data-theme]){--white:#fff;--black:#000;--green-25:#edfaf2;--green-50:#d9f4e4;--green-75:#b8ebcc;--green-100:#8cdfad;--green-200:#66d492;--green-300:#40c977;--green-400:#04b84c;--green-500:#00a240;--green-600:#008635;--green-700:#00692a;--green-800:#004f1f;--green-900:#003716;--green-950:#011c0b;--green-1000:#001207;--green-a25:var(--green-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--green-a25:color-mix(in oklab,var(--green-400)8%,transparent)}}:root,:where([data-theme]){--green-a50:var(--green-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--green-a50:color-mix(in oklab,var(--green-400)15%,transparent)}}:root,:where([data-theme]){--green-a75:var(--green-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--green-a75:color-mix(in oklab,var(--green-400)29%,transparent)}}:root,:where([data-theme]){--green-a100:var(--green-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--green-a100:color-mix(in oklab,var(--green-400)45%,transparent)}}:root,:where([data-theme]){--green-a200:var(--green-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--green-a200:color-mix(in oklab,var(--green-400)60%,transparent)}}:root,:where([data-theme]){--green-a300:var(--green-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--green-a300:color-mix(in oklab,var(--green-400)75%,transparent)}}:root,:where([data-theme]){--red-25:#fff0f0;--red-50:#ffd9d9;--red-75:#ffc6c5;--red-100:#ffa4a2;--red-200:#ff8583;--red-300:#ff6764;--red-400:#fa423e;--red-500:#e02e2a;--red-600:#ba2623;--red-700:#911e1b;--red-800:#6e1615;--red-900:#4d100e;--red-950:#280b0a;--red-1000:#1f0909;--red-a25:var(--red-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--red-a25:color-mix(in oklab,var(--red-400)8%,transparent)}}:root,:where([data-theme]){--red-a50:var(--red-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--red-a50:color-mix(in oklab,var(--red-400)16%,transparent)}}:root,:where([data-theme]){--red-a75:var(--red-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--red-a75:color-mix(in oklab,var(--red-400)30%,transparent)}}:root,:where([data-theme]){--red-a100:var(--red-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--red-a100:color-mix(in oklab,var(--red-400)48%,transparent)}}:root,:where([data-theme]){--red-a200:var(--red-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--red-a200:color-mix(in oklab,var(--red-400)64%,transparent)}}:root,:where([data-theme]){--red-a300:var(--red-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--red-a300:color-mix(in oklab,var(--red-400)79%,transparent)}}:root,:where([data-theme]){--pink-25:#fff4f9;--pink-50:#ffe8f3;--pink-75:#ffd4e8;--pink-100:#ffbada;--pink-200:#ffa3ce;--pink-300:#ff8cc1;--pink-400:#ff66ad;--pink-500:#e04c91;--pink-600:#ba437a;--pink-700:#963c67;--pink-800:#6e2c4a;--pink-900:#4d1f34;--pink-950:#29101c;--pink-1000:#1a0a11;--pink-a25:var(--pink-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--pink-a25:color-mix(in oklab,var(--pink-400)8%,transparent)}}:root,:where([data-theme]){--pink-a50:var(--pink-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--pink-a50:color-mix(in oklab,var(--pink-400)16%,transparent)}}:root,:where([data-theme]){--pink-a75:var(--pink-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--pink-a75:color-mix(in oklab,var(--pink-400)28%,transparent)}}:root,:where([data-theme]){--pink-a100:var(--pink-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--pink-a100:color-mix(in oklab,var(--pink-400)45%,transparent)}}:root,:where([data-theme]){--pink-a200:var(--pink-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--pink-a200:color-mix(in oklab,var(--pink-400)60%,transparent)}}:root,:where([data-theme]){--pink-a300:var(--pink-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--pink-a300:color-mix(in oklab,var(--pink-400)76%,transparent)}}:root,:where([data-theme]){--orange-25:#fff5f0;--orange-50:#ffe7d9;--orange-75:#ffcfb4;--orange-100:#ffb790;--orange-200:#ff9e6c;--orange-300:#ff8549;--orange-400:#fb6a22;--orange-500:#e25507;--orange-600:#b9480d;--orange-700:#923b0f;--orange-800:#6d2e0f;--orange-900:#4a2206;--orange-950:#281105;--orange-1000:#211107;--orange-a25:var(--orange-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--orange-a25:color-mix(in oklab,var(--orange-400)7%,transparent)}}:root,:where([data-theme]){--orange-a50:var(--orange-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--orange-a50:color-mix(in oklab,var(--orange-400)16%,transparent)}}:root,:where([data-theme]){--orange-a75:var(--orange-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--orange-a75:color-mix(in oklab,var(--orange-400)33%,transparent)}}:root,:where([data-theme]){--orange-a100:var(--orange-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--orange-a100:color-mix(in oklab,var(--orange-400)48%,transparent)}}:root,:where([data-theme]){--orange-a200:var(--orange-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--orange-a200:color-mix(in oklab,var(--orange-400)65%,transparent)}}:root,:where([data-theme]){--orange-a300:var(--orange-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--orange-a300:color-mix(in oklab,var(--orange-400)81%,transparent)}}:root,:where([data-theme]){--yellow-25:#fffbed;--yellow-50:#fff6d9;--yellow-75:#ffeeb8;--yellow-100:#ffe48c;--yellow-200:#ffdb66;--yellow-300:#ffd240;--yellow-400:#ffc300;--yellow-500:#e0ac00;--yellow-600:#ba8e00;--yellow-700:#916f00;--yellow-800:#6e5400;--yellow-900:#4d3b00;--yellow-950:#261d00;--yellow-1000:#1a1400;--yellow-a25:var(--yellow-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--yellow-a25:color-mix(in oklab,var(--yellow-400)8%,transparent)}}:root,:where([data-theme]){--yellow-a50:var(--yellow-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--yellow-a50:color-mix(in oklab,var(--yellow-400)15%,transparent)}}:root,:where([data-theme]){--yellow-a75:var(--yellow-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--yellow-a75:color-mix(in oklab,var(--yellow-400)27%,transparent)}}:root,:where([data-theme]){--yellow-a100:var(--yellow-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--yellow-a100:color-mix(in oklab,var(--yellow-400)45%,transparent)}}:root,:where([data-theme]){--yellow-a200:var(--yellow-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--yellow-a200:color-mix(in oklab,var(--yellow-400)59%,transparent)}}:root,:where([data-theme]){--yellow-a300:var(--yellow-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--yellow-a300:color-mix(in oklab,var(--yellow-400)74%,transparent)}}:root,:where([data-theme]){--purple-25:#f9f5fe;--purple-50:#efe5fe;--purple-75:#e0cefd;--purple-100:#ceb0fb;--purple-200:#be95fa;--purple-300:#ad7bf9;--purple-400:#924ff7;--purple-500:#8046d9;--purple-600:#6b3ab4;--purple-700:#532d8d;--purple-800:#3f226a;--purple-900:#2c184a;--purple-950:#160c25;--purple-1000:#100a19;--purple-a25:var(--purple-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--purple-a25:color-mix(in oklab,var(--purple-400)6%,transparent)}}:root,:where([data-theme]){--purple-a50:var(--purple-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--purple-a50:color-mix(in oklab,var(--purple-400)15%,transparent)}}:root,:where([data-theme]){--purple-a75:var(--purple-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--purple-a75:color-mix(in oklab,var(--purple-400)28%,transparent)}}:root,:where([data-theme]){--purple-a100:var(--purple-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--purple-a100:color-mix(in oklab,var(--purple-400)45%,transparent)}}:root,:where([data-theme]){--purple-a200:var(--purple-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--purple-a200:color-mix(in oklab,var(--purple-400)60%,transparent)}}:root,:where([data-theme]){--purple-a300:var(--purple-400)}@supports (color:color-mix(in lab,red,red)){:root,:where([data-theme]){--purple-a300:color-mix(in oklab,var(--purple-400)75%,transparent)}}:root,:where([data-theme]){--blue-25:#f5faff;--blue-50:#e5f3ff;--blue-75:#cce6ff;--blue-100:#99ceff;--blue-200:#66b5ff;--blue-300:#339cff;--blue-400:#0285ff;--blue-500:#0169cc;--blue-600:#004f99;--blue-700:#003f7a;--blue-800