UNPKG

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 106 kB
<!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 Video 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"]'))t(e);new MutationObserver(e=>{for(const n of e)if("childList"===n.type)for(const e of n.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&t(e)}).observe(document,{childList:!0,subtree:!0})}function t(e){if(e.ep)return;e.ep=!0;const t=function(e){const t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?t.credentials="include":"anonymous"===e.crossOrigin?t.credentials="omit":t.credentials="same-origin",t}(e);fetch(e.href,t)}}();var e,t,n,o,r,i,l,a,_,u,c,s={},d=[],p=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,f=Array.isArray;function h(e,t){for(var n in t)e[n]=t[n];return e}function v(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function m(t,n,o){var r,i,l,a={};for(l in n)"key"==l?r=n[l]:"ref"==l?i=n[l]:a[l]=n[l];if(arguments.length>2&&(a.children=arguments.length>3?e.call(arguments,2):o),"function"==typeof t&&null!=t.defaultProps)for(l in t.defaultProps)void 0===a[l]&&(a[l]=t.defaultProps[l]);return y(t,a,r,i,null)}function y(e,o,r,i,l){var a={type:e,props:o,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==l?++n:l,__i:-1,__u:0};return null==l&&null!=t.vnode&&t.vnode(a),a}function g(e){return e.children}function b(e,t){this.props=e,this.context=t}function w(e,t){if(null==t)return e.__?w(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?w(e):null}function k(e){if(e.__P&&e.__d){var n=e.__v,o=n.__e,r=[],i=[],l=h({},n);l.__v=n.__v+1,t.vnode&&t.vnode(l),H(e.__P,l,n,e.__n,e.__P.namespaceURI,32&n.__u?[o]:null,r,null==o?w(n):o,!!(32&n.__u),i),l.__v=n.__v,l.__.__k[l.__i]=l,A(r,l,i),n.__e=n.__=null,l.__e!=o&&C(l)}}function C(e){if(null!=(e=e.__)&&null!=e.__c)return e.__e=e.__c.base=null,e.__k.some(function(t){if(null!=t&&null!=t.__e)return e.__e=e.__c.base=t.__e}),C(e)}function x(e){(!e.__d&&(e.__d=!0)&&o.push(e)&&!N.__r++||r!=t.debounceRendering)&&((r=t.debounceRendering)||i)(N)}function N(){for(var e,t=1;o.length;)o.length>t&&o.sort(l),e=o.shift(),t=o.length,k(e);N.__r=0}function L(e,t,n,o,r,i,l,a,_,u,c){var p,h,v,m,b,k,C,x=o&&o.__k||d,N=t.length;for(_=function(e,t,n,o,r){var i,l,a,_,u,c=n.length,s=c,d=0;for(e.__k=new Array(r),i=0;i<r;i++)null!=(l=t[i])&&"boolean"!=typeof l&&"function"!=typeof l?("string"==typeof l||"number"==typeof l||"bigint"==typeof l||l.constructor==String?l=e.__k[i]=y(null,l,null,null,null):f(l)?l=e.__k[i]=y(g,{children:l},null,null,null):void 0===l.constructor&&l.__b>0?l=e.__k[i]=y(l.type,l.props,l.key,l.ref?l.ref:null,l.__v):e.__k[i]=l,_=i+d,l.__=e,l.__b=e.__b+1,a=null,-1!=(u=l.__i=M(l,n,_,s))&&(s--,(a=n[u])&&(a.__u|=2)),null==a||null==a.__v?(-1==u&&(r>c?d--:r<c&&d++),"function"!=typeof l.type&&(l.__u|=4)):u!=_&&(u==_-1?d--:u==_+1?d++:(u>_?d--:d++,l.__u|=4))):e.__k[i]=null;if(s)for(i=0;i<c;i++)null!=(a=n[i])&&!(2&a.__u)&&(a.__e==o&&(o=w(a)),B(a,a));return o}(n,t,x,_,N),p=0;p<N;p++)null!=(v=n.__k[p])&&(h=-1!=v.__i&&x[v.__i]||s,v.__i=p,k=H(e,v,h,r,i,l,a,_,u,c),m=v.__e,v.ref&&h.ref!=v.ref&&(h.ref&&q(h.ref,null,v),c.push(v.ref,v.__c||m,v)),null==b&&null!=m&&(b=m),(C=!!(4&v.__u))||h.__k===v.__k?_=P(v,_,e,C):"function"==typeof v.type&&void 0!==k?_=k:m&&(_=m.nextSibling),v.__u&=-7);return n.__e=b,_}function P(e,t,n,o){var r,i;if("function"==typeof e.type){for(r=e.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=e,t=P(r[i],t,n,o));return t}e.__e!=t&&(o&&(t&&e.type&&!t.parentNode&&(t=w(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function S(e,t){return t=t||[],null==e||"boolean"==typeof e||(f(e)?e.some(function(e){S(e,t)}):t.push(e)),t}function M(e,t,n,o){var r,i,l,a=e.key,_=e.type,u=t[n],c=null!=u&&!(2&u.__u);if(null===u&&null==a||c&&a==u.key&&_==u.type)return n;if(o>(c?1:0))for(r=n-1,i=n+1;r>=0||i<t.length;)if(null!=(u=t[l=r>=0?r--:i++])&&!(2&u.__u)&&a==u.key&&_==u.type)return l;return-1}function T(e,t,n){"-"==t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||p.test(t)?n:n+"px"}function D(e,t,n,o,r){var i,l;e:if("style"==t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof o&&(e.style.cssText=o=""),o)for(t in o)n&&t in n||T(e.style,t,"");if(n)for(t in n)o&&n[t]==o[t]||T(e.style,t,n[t])}else if("o"==t[0]&&"n"==t[1])i=t!=(t=t.replace(a,"$1")),l=t.toLowerCase(),t=l in e||"onFocusOut"==t||"onFocusIn"==t?l.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?o?n.u=o.u:(n.u=_,e.addEventListener(t,i?c:u,i)):e.removeEventListener(t,i?c:u,i);else{if("http://www.w3.org/2000/svg"==r)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==n?"":n;break e}catch(s){}"function"==typeof n||(null==n||!1===n&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==n?"":n))}}function E(e){return function(n){if(this.l){var o=this.l[n.type+e];if(null==n.t)n.t=_++;else if(n.t<o.u)return;return o(t.event?t.event(n):n)}}}function H(n,o,r,i,l,a,_,u,c,p){var m,y,k,C,x,N,P,S,M,T,E,H,A,q,B,O=o.type;if(void 0!==o.constructor)return null;128&r.__u&&(c=!!(32&r.__u),a=[u=o.__e=r.__e]),(m=t.__b)&&m(o);e:if("function"==typeof O)try{if(S=o.props,M="prototype"in O&&O.prototype.render,T=(m=O.contextType)&&i[m.__c],E=m?T?T.props.value:m.__:i,r.__c?P=(y=o.__c=r.__c).__=y.__E:(M?o.__c=y=new O(S,E):(o.__c=y=new b(S,E),y.constructor=O,y.render=$),T&&T.sub(y),y.state||(y.state={}),y.__n=i,k=y.__d=!0,y.__h=[],y._sb=[]),M&&null==y.__s&&(y.__s=y.state),M&&null!=O.getDerivedStateFromProps&&(y.__s==y.state&&(y.__s=h({},y.__s)),h(y.__s,O.getDerivedStateFromProps(S,y.__s))),C=y.props,x=y.state,y.__v=o,k)M&&null==O.getDerivedStateFromProps&&null!=y.componentWillMount&&y.componentWillMount(),M&&null!=y.componentDidMount&&y.__h.push(y.componentDidMount);else{if(M&&null==O.getDerivedStateFromProps&&S!==C&&null!=y.componentWillReceiveProps&&y.componentWillReceiveProps(S,E),o.__v==r.__v||!y.__e&&null!=y.shouldComponentUpdate&&!1===y.shouldComponentUpdate(S,y.__s,E)){o.__v!=r.__v&&(y.props=S,y.state=y.__s,y.__d=!1),o.__e=r.__e,o.__k=r.__k,o.__k.some(function(e){e&&(e.__=o)}),d.push.apply(y.__h,y._sb),y._sb=[],y.__h.length&&_.push(y);break e}null!=y.componentWillUpdate&&y.componentWillUpdate(S,y.__s,E),M&&null!=y.componentDidUpdate&&y.__h.push(function(){y.componentDidUpdate(C,x,N)})}if(y.context=E,y.props=S,y.__P=n,y.__e=!1,H=t.__r,A=0,M)y.state=y.__s,y.__d=!1,H&&H(o),m=y.render(y.props,y.state,y.context),d.push.apply(y.__h,y._sb),y._sb=[];else do{y.__d=!1,H&&H(o),m=y.render(y.props,y.state,y.context),y.state=y.__s}while(y.__d&&++A<25);y.state=y.__s,null!=y.getChildContext&&(i=h(h({},i),y.getChildContext())),M&&!k&&null!=y.getSnapshotBeforeUpdate&&(N=y.getSnapshotBeforeUpdate(C,x)),q=null!=m&&m.type===g&&null==m.key?I(m.props.children):m,u=L(n,f(q)?q:[q],o,r,i,l,a,_,u,c,p),y.base=o.__e,o.__u&=-161,y.__h.length&&_.push(y),P&&(y.__E=y.__=null)}catch(U){if(o.__v=null,c||null!=a)if(U.then){for(o.__u|=c?160:128;u&&8==u.nodeType&&u.nextSibling;)u=u.nextSibling;a[a.indexOf(u)]=null,o.__e=u}else{for(B=a.length;B--;)v(a[B]);R(o)}else o.__e=r.__e,o.__k=r.__k,U.then||R(o);t.__e(U,o,r)}else null==a&&o.__v==r.__v?(o.__k=r.__k,o.__e=r.__e):u=o.__e=function(n,o,r,i,l,a,_,u,c){var d,p,h,m,y,g,b,k=r.props||s,C=o.props,x=o.type;if("svg"==x?l="http://www.w3.org/2000/svg":"math"==x?l="http://www.w3.org/1998/Math/MathML":l||(l="http://www.w3.org/1999/xhtml"),null!=a)for(d=0;d<a.length;d++)if((y=a[d])&&"setAttribute"in y==!!x&&(x?y.localName==x:3==y.nodeType)){n=y,a[d]=null;break}if(null==n){if(null==x)return document.createTextNode(C);n=document.createElementNS(l,x,C.is&&C),u&&(t.__m&&t.__m(o,a),u=!1),a=null}if(null==x)k===C||u&&n.data==C||(n.data=C);else{if(a=a&&e.call(n.childNodes),!u&&null!=a)for(k={},d=0;d<n.attributes.length;d++)k[(y=n.attributes[d]).name]=y.value;for(d in k)y=k[d],"dangerouslySetInnerHTML"==d?h=y:"children"==d||d in C||"value"==d&&"defaultValue"in C||"checked"==d&&"defaultChecked"in C||D(n,d,null,y,l);for(d in C)y=C[d],"children"==d?m=y:"dangerouslySetInnerHTML"==d?p=y:"value"==d?g=y:"checked"==d?b=y:u&&"function"!=typeof y||k[d]===y||D(n,d,y,k[d],l);if(p)u||h&&(p.__html==h.__html||p.__html==n.innerHTML)||(n.innerHTML=p.__html),o.__k=[];else if(h&&(n.innerHTML=""),L("template"==o.type?n.content:n,f(m)?m:[m],o,r,i,"foreignObject"==x?"http://www.w3.org/1999/xhtml":l,a,_,a?a[0]:r.__k&&w(r,0),u,c),null!=a)for(d=a.length;d--;)v(a[d]);u||(d="value","progress"==x&&null==g?n.removeAttribute("value"):null!=g&&(g!==n[d]||"progress"==x&&!g||"option"==x&&g!=k[d])&&D(n,d,g,k[d],l),d="checked",null!=b&&b!=n[d]&&D(n,d,b,k[d],l))}return n}(r.__e,o,r,i,l,a,_,c,p);return(m=t.diffed)&&m(o),128&o.__u?void 0:u}function R(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(R))}function A(e,n,o){for(var r=0;r<o.length;r++)q(o[r],o[++r],o[++r]);t.__c&&t.__c(n,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(e){e.call(n)})}catch(o){t.__e(o,n.__v)}})}function I(e){return"object"!=typeof e||null==e||e.__b>0?e:f(e)?e.map(I):h({},e)}function q(e,n,o){try{if("function"==typeof e){var r="function"==typeof e.__u;r&&e.__u(),r&&null==n||(e.__u=e(n))}else e.current=n}catch(i){t.__e(i,o)}}function B(e,n,o){var r,i;if(t.unmount&&t.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||q(r,null,n)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(l){t.__e(l,n)}r.base=r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&B(r[i],n,o||"function"!=typeof e.type);o||v(e.__e),e.__c=e.__=e.__e=void 0}function $(e,t,n){return this.constructor(e,n)}function O(n,o,r){var i,l,a;o==document&&(o=document.documentElement),t.__&&t.__(n,o),i=o.__k,l=[],a=[],H(o,n=o.__k=m(g,null,[n]),i||s,s,o.namespaceURI,i?null:o.firstChild?e.call(o.childNodes):null,l,i?i.__e:o.firstChild,!1,a),A(l,n,a)}e=d.slice,t={__e:function(e,t,n,o){for(var r,i,l;t=t.__;)if((r=t.__c)&&!r.__)try{if((i=r.constructor)&&null!=i.getDerivedStateFromError&&(r.setState(i.getDerivedStateFromError(e)),l=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(e,o||{}),l=r.__d),l)return r.__E=r}catch(a){e=a}throw e}},n=0,b.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=h({},this.state),"function"==typeof e&&(e=e(h({},n),this.props)),e&&h(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),x(this))},b.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),x(this))},b.prototype.render=g,o=[],i="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,l=function(e,t){return e.__v.__b-t.__v.__b},N.__r=0,a=/(PointerCapture)$|Capture$/i,_=0,u=E(!1),c=E(!0);var U=0;function W(e,n,o,r,i,l){n||(n={});var a,_,u=n;if("ref"in u)for(_ in u={},n)"ref"==_?a=n[_]:u[_]=n[_];var c={type:e,props:u,key:o,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--U,__i:-1,__u:0,__source:i,__self:l};if("function"==typeof e&&(a=e.defaultProps))for(_ in a)void 0===u[_]&&(u[_]=a[_]);return t.vnode&&t.vnode(c),c}var F,V,Z,z,j=0,Q=[],K=t,Y=K.__b,G=K.__r,J=K.diffed,X=K.__c,ee=K.unmount,te=K.__;function ne(e,t){K.__h&&K.__h(V,e,j||t),j=0;var n=V.__H||(V.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function oe(e){return j=1,function(e,t){var n=ne(F++,2);if(n.t=e,!n.__c&&(n.__=[pe(void 0,t),function(e){var t=n.__N?n.__N[0]:n.__[0],o=n.t(t,e);t!==o&&(n.__N=[o,n.__[1]],n.__c.setState({}))}],n.__c=V,!V.__f)){var o=function(e,t,o){if(!n.__c.__H)return!0;var i=n.__c.__H.__.filter(function(e){return e.__c});if(i.every(function(e){return!e.__N}))return!r||r.call(this,e,t,o);var l=n.__c.props!==e;return i.some(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(l=!0)}}),r&&r.call(this,e,t,o)||l};V.__f=!0;var r=V.shouldComponentUpdate,i=V.componentWillUpdate;V.componentWillUpdate=function(e,t,n){if(this.__e){var l=r;r=void 0,o(e,t,n),r=l}i&&i.call(this,e,t,n)},V.shouldComponentUpdate=o}return n.__N||n.__}(pe,e)}function re(e,t){var n=ne(F++,3);!K.__s&&de(n.__H,t)&&(n.__=e,n.u=t,V.__H.__h.push(n))}function ie(e,t){var n=ne(F++,7);return de(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function le(e,t){return j=8,ie(function(){return e},t)}function ae(){for(var e;e=Q.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(ce),t.__h.some(se),t.__h=[]}catch(n){t.__h=[],K.__e(n,e.__v)}}}K.__b=function(e){V=null,Y&&Y(e)},K.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),te&&te(e,t)},K.__r=function(e){G&&G(e),F=0;var t=(V=e.__c).__H;t&&(Z===V?(t.__h=[],V.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.some(ce),t.__h.some(se),t.__h=[],F=0)),Z=V},K.diffed=function(e){J&&J(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==Q.push(t)&&z===K.requestAnimationFrame||((z=K.requestAnimationFrame)||ue)(ae)),t.__H.__.some(function(e){e.u&&(e.__H=e.u),e.u=void 0})),Z=V=null},K.__c=function(e,t){t.some(function(e){try{e.__h.some(ce),e.__h=e.__h.filter(function(e){return!e.__||se(e)})}catch(n){t.some(function(e){e.__h&&(e.__h=[])}),t=[],K.__e(n,e.__v)}}),X&&X(e,t)},K.unmount=function(e){ee&&ee(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(e){try{ce(e)}catch(n){t=n}}),n.__H=void 0,t&&K.__e(t,n.__v))};var _e="function"==typeof requestAnimationFrame;function ue(e){var t,n=function(){clearTimeout(o),_e&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(n,35);_e&&(t=requestAnimationFrame(n))}function ce(e){var t=V,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),V=t}function se(e){var t=V;e.__c=e.__(),V=t}function de(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function pe(e,t){return"function"==typeof t?t(e):t}function fe(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var o in t)if("__source"!==o&&e[o]!==t[o])return!0;return!1}function he(e){try{return!((t=e.__)===(n=e.u())&&(0!==t||1/t==1/n)||t!=t&&n!=n)}catch(o){return!0}var t,n}function ve(e,t){this.props=e,this.context=t}(ve.prototype=new b).isPureReactComponent=!0,ve.prototype.shouldComponentUpdate=function(e,t){return fe(this.props,e)||fe(this.state,t)};var me=t.__b;t.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),me&&me(e)};var ye=t.__e;t.__e=function(e,t,n,o){if(e.then)for(var r,i=t;i=i.__;)if((r=i.__c)&&r.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),r.__c(e,t);ye(e,t,n,o)};var ge=t.unmount;function be(e,t,n){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,t){for(var n in t)e[n]=t[n];return e}({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(e){return be(e,t,n)})),e}function we(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(e){return we(e,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function ke(){this.__u=0,this.o=null,this.__b=null}function Ce(e){if(!e.__)return null;var t=e.__.__c;return t&&t.__a&&t.__a(e)}function xe(){this.i=null,this.l=null}t.unmount=function(e){var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),ge&&ge(e)},(ke.prototype=new b).__c=function(e,t){var n=t.__c,o=this;null==o.o&&(o.o=[]),o.o.push(n);var r=Ce(o.__v),i=!1,l=function(){i||o.__z||(i=!0,n.__R=null,r?r(_):_())};n.__R=l;var a=n.__P;n.__P=null;var _=function(){if(! --o.__u){if(o.state.__a){var e=o.state.__a;o.__v.__k[0]=we(e,e.__c.__P,e.__c.__O)}var t;for(o.setState({__a:o.__b=null});t=o.o.pop();)t.__P=a,t.forceUpdate()}};o.__u++||32&t.__u||o.setState({__a:o.__b=o.__v.__k[0]}),e.then(l,l)},ke.prototype.componentWillUnmount=function(){this.o=[]},ke.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=be(this.__b,n,o.__O=o.__P)}this.__b=null}var r=t.__a&&m(g,null,e.fallback);return r&&(r.__u&=-33),[m(g,null,t.__a?null:e.children),r]};var Ne=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};(xe.prototype=new b).__a=function(e){var t=this,n=Ce(t.__v),o=t.l.get(e);return o[0]++,function(r){var i=function(){t.props.revealOrder?(o.push(r),Ne(t,e,o)):r()};n?n(i):i()}},xe.prototype.render=function(e){this.i=null,this.l=new Map;var t=S(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},xe.prototype.componentDidUpdate=xe.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){Ne(e,n,t)})};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]/,Se=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Me=/[A-Z0-9]/g,Te="undefined"!=typeof document,De=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(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Ee=t.event;function He(){}function Re(){return this.cancelBubble}function Ae(){return this.defaultPrevented}t.event=function(e){return Ee&&(e=Ee(e)),e.persist=He,e.isPropagationStopped=Re,e.isDefaultPrevented=Ae,e.nativeEvent=e};var Ie={enumerable:!1,configurable:!0,get:function(){return this.class}},qe=t.vnode;t.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,o={},r=-1===n.indexOf("-");for(var i in t){var l=t[i];if(!("value"===i&&"defaultValue"in t&&null==l||Te&&"children"===i&&"noscript"===n||"class"===i||"className"===i)){var a=i.toLowerCase();"defaultValue"===i&&"value"in t&&null==t.value?i="value":"download"===i&&!0===l?l="":"translate"===a&&"no"===l?l=!1:"o"===a[0]&&"n"===a[1]?"ondoubleclick"===a?i="ondblclick":"onchange"!==a||"input"!==n&&"textarea"!==n||De(t.type)?"onfocus"===a?i="onfocusin":"onblur"===a?i="onfocusout":Se.test(i)&&(i=a):a=i="oninput":r&&Pe.test(i)?i=i.replace(Me,"-$&").toLowerCase():null===l&&(l=void 0),"oninput"===a&&o[i=a]&&(i="oninputCapture"),o[i]=l}}"select"==n&&o.multiple&&Array.isArray(o.value)&&(o.value=S(t.children).forEach(function(e){e.props.selected=-1!=o.value.indexOf(e.props.value)})),"select"==n&&null!=o.defaultValue&&(o.value=S(t.children).forEach(function(e){e.props.selected=o.multiple?-1!=o.defaultValue.indexOf(e.props.value):o.defaultValue==e.props.value})),t.class&&!t.className?(o.class=t.class,Object.defineProperty(o,"className",Ie)):t.className&&(o.class=o.className=t.className),e.props=o}(e),e.$$typeof=Le,qe&&qe(e)};var Be=t.__r;t.__r=function(e){Be&&Be(e),e.__c};var $e=t.diffed;t.diffed=function(e){$e&&$e(e);var t=e.props,n=e.__e;null!=n&&"textarea"===e.type&&"value"in t&&t.value!==n.value&&(n.value=null==t.value?"":t.value)};var Oe=g;function Ue(e){const t=document.documentElement;t.setAttribute("data-theme",e),t.style.colorScheme=e}const We="openai:set_globals";function Fe(e){const t=le(t=>{if("undefined"==typeof window)return()=>{};const n=n=>{const o=n;o.detail?.globals&&e in o.detail.globals&&t()};return window.addEventListener(We,n,{passive:!0}),()=>{window.removeEventListener(We,n)}},[e]),n=le(()=>{if("undefined"!=typeof window)return window.openai?.[e]},[e]);return le(()=>{},[]),o=t,i=(r=n)(),l=oe({t:{__:i,u:r}}),a=l[0].t,_=l[1],function(e,t){var n=ne(F++,4);!K.__s&&de(n.__H,t)&&(n.__=e,n.u=t,V.__h.push(n))}(function(){a.__=i,a.u=r,he(a)&&_({t:a})},[o,i,r]),re(function(){return he(a)&&_({t:a}),o(function(){he(a)&&_({t:a})})},[o]),i;var o,r,i,l,a,_}const Ve="(prefers-color-scheme: dark)";function Ze(){const e=Fe("theme");var t;re(()=>{if(t)return void Ue(t);const e=()=>{Ue(window.matchMedia?.(Ve).matches?"dark":"light")};e();const n=window.matchMedia?.(Ve);if(!n)return;const o=()=>e();return n.addEventListener?(n.addEventListener("change",o),()=>{n.removeEventListener("change",o)}):(n.addListener?.(o),()=>{n.removeListener?.(o)})},[t="light"===e||"dark"===e?e:void 0])}const ze=e=>W("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:W("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=>W("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:W("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=>W("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:W("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=>W("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:W("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"})}),Ye=e=>W("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:W("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"})}),Ge=e=>W("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:[W("path",{d:"M9.5 9.33165V14.6683C9.5 15.4595 10.3752 15.9373 11.0408 15.5095L15.1915 12.8412C15.8038 12.4475 15.8038 11.5524 15.1915 11.1588L11.0408 8.49047C10.3752 8.06265 9.5 8.54049 9.5 9.33165Z",fill:"currentColor"}),W("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2ZM4 12C4 7.58172 7.58172 4 12 4C16.4183 4 20 7.58172 20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12Z",fill:"currentColor"})]}),Je=e=>W("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:W("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"})}),Xe=e=>W("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:W("path",{fillRule:"evenodd",d:"M5.636 5.636a1 1 0 0 1 1.414 0l4.95 4.95 4.95-4.95a1 1 0 0 1 1.414 1.414L13.414 12l4.95 4.95a1 1 0 0 1-1.414 1.414L12 13.414l-4.95 4.95a1 1 0 0 1-1.414-1.414l4.95-4.95-4.95-4.95a1 1 0 0 1 0-1.414Z",clipRule:"evenodd"})});function et({onRequestFullscreen:e,displayMode:t}){const n="fullscreen"===t;return W("button",{className:"fullscreen-btn",onClick:e,title:n?"Exit fullscreen":"Enter fullscreen","aria-label":n?"Exit fullscreen":"Enter fullscreen",children:W(n?Ke:Ye,{width:16,height:16})})}function tt({direction:e,className:t,disabled:n,...o}){const r="previous"===e,i=r?"Previous":"Next";return W("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 ${n?"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)]"}${t?` ${t}`:""}`,disabled:n,...o,children:[r&&W(ze,{width:14,height:14}),i,!r&&W(je,{width:14,height:14})]})}function nt({size:e,strokeWidth:t}){return W("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:t},"aria-hidden":"true"})}function ot({variant:e,brandSub:t,query:n,countLabel:o,isInitialLoading:r,loadingQuery:i,error:l,infoBanner:a,hasData:_,isEmpty:u,emptyTitle:c,emptyDescription:s,noResultsTitle:d="No results",noResultsDescription:p="Try a different query.",children:f,pagination:h,context:v,hostContext:m,displayMode:y,requestDisplayMode:g}){const b=m?.safeAreaInsets,w={paddingTop:b?.top,paddingRight:b?.right,paddingBottom:b?.bottom,paddingLeft:b?.left,marginBottom:b?.bottom},k=h?` · Page ${h.pageNumber}`:"",C=v&&v.count>0?` · ${v.count} in context`:"",x=Boolean(h?.isLoading&&_&&!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 W("main",{className:`app ${e}-app`,style:w,"data-display-mode":y,children:[W("header",{className:"header",children:[W("div",{className:"brand",children:[W("span",{className:"brand-mark",children:"Brave"}),W("span",{className:"brand-sub",children:t})]}),W("div",{className:"header-right",children:[W("div",{className:"meta",children:[W("div",{className:"term",children:_?n:r&&i?i:`Run brave_${e}_search to see results`}),W("div",{className:"count",children:[_?o:r?"Searching...":"Awaiting tool output",_&&h&&k,C]})]}),W("div",{className:"header-actions",children:[v&&W("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"}),g&&W(et,{onRequestFullscreen:()=>{g&&g("fullscreen"===y?"inline":"fullscreen")},displayMode:y})]})]})]}),l&&W("div",{className:"error-banner",children:[W("strong",{children:"Error:"})," ",l]}),a&&W("div",{className:"info-banner",children:a}),r&&!_&&W("section",{className:"loading-state",children:[W(nt,{size:32,strokeWidth:3}),W("p",{children:["Searching for"," ",W("strong",{children:i||"..."})]})]}),!_&&!r&&W("section",{className:"empty-state",children:[W("h2",{children:c}),W("p",{children:s})]}),_&&u&&!l&&W("section",{className:"empty-state",children:[W("h2",{children:d}),W("p",{children:p})]}),_&&!u&&W("section",{className:"results-region"+(x?" results-region--loading":""),"aria-busy":x,children:[W("div",{className:"results-content"+(x?" results-content--locked":""),inert:x,children:f}),x?W("div",{className:"results-loading-overlay",role:"status","aria-label":"Loading page results",children:W("div",{className:"results-loading-content",children:[W(nt,{size:28,strokeWidth:3}),W("span",{children:"Loading results..."})]})}):null]}),h&&_&&!u&&W("footer",{className:"app-footer",style:void 0,children:W("nav",{className:"pagination","aria-label":"Pagination",children:[W(tt,{direction:"previous",onClick:h.onPrevious,disabled:!h.hasPrevious||h.isLoading,"aria-label":"Previous page"}),W("span",{className:"pagination-info",children:h.isLoading?"Loading...":`Page ${h.pageNumber}`}),W(tt,{direction:"next",onClick:h.onNext,disabled:!h.hasNext||h.isLoading,"aria-label":"Next page"})]})})]})}function rt({item:e,index:t,onPlay:n,onOpenLink:o,isInContext:r,onToggleContext:i}){const l=Boolean(e.embedId);return W("article",{className:"video-card-shell",children:[W("button",{type:"button",className:`video-card ${l?"video-card--embeddable":""} ${r?"video-card--in-context":""}`,onClick:()=>{l?n(e):o(e.url)},style:{animationDelay:60*t+"ms"},children:[W("div",{className:"video-thumbnail",children:[e.thumbnail?.src?W("img",{src:e.thumbnail.src,alt:e.title,className:"video-thumbnail-image",loading:"lazy"}):W("div",{className:"video-placeholder",children:W(Ge,{width:32,height:32})}),e.duration&&W("span",{className:"video-duration",children:e.duration}),W("div",{className:"video-play-overlay",children:W("div",{className:"video-play-button "+(l?"video-play-button--youtube":""),children:W(Ge,{width:24,height:24})})}),l&&W("span",{className:"video-embed-badge",children:"youtube"===e.embedType?"YouTube":"Vimeo"})]}),W("div",{className:"video-content",children:[W("h3",{className:"video-title",children:e.title}),W("div",{className:"video-meta",children:[e.favicon&&W("img",{src:e.favicon,alt:"",className:"video-favicon",width:16,height:16}),W("span",{className:"video-creator",children:e.creator})]}),W("div",{className:"video-stats",children:[e.views&&W("span",{children:e.views}),e.views&&e.age&&W("span",{className:"video-stats-dot",children:"•"}),e.age&&W("span",{children:e.age})]})]})]}),i&&W("button",{type:"button",className:"context-btn "+(r?"context-btn--active":""),onClick:t=>{t.stopPropagation(),i&&i(e)},"aria-label":r?"Remove from context":"Add to context",title:r?"In context":"Add to context",children:W(r?Qe:Je,{width:14,height:14})})]})}function it({video:e,onClose:t}){if(!e.embedId||!e.embedType)return null;const n="youtube"===e.embedType?`https://www.youtube.com/embed/${e.embedId}?autoplay=1`:`https://player.vimeo.com/video/${e.embedId}?autoplay=1`;return W("div",{className:"video-modal-backdrop",onClick:t,children:W("div",{className:"video-modal",onClick:e=>e.stopPropagation(),children:[W("button",{className:"video-modal-close",onClick:t,children:W(Xe,{width:24,height:24})}),W("div",{className:"video-modal-content",children:W("iframe",{src:n,title:e.title,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,className:"video-modal-iframe"})}),W("div",{className:"video-modal-title",children:e.title})]})})}function lt({video:e}){return e.embedId&&e.embedType?W("div",{className:"video-pip-container",children:W("iframe",{src:"youtube"===e.embedType?`https://www.youtube.com/embed/${e.embedId}?autoplay=1`:`https://player.vimeo.com/video/${e.embedId}?autoplay=1`,title:e.title,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,className:"video-pip-iframe"})}):null}const at=[];function _t({toolResult:e,hostContext:t,openLink:n,sendLog:o,displayMode:r,requestDisplayMode:i,onLoadPage:l,isLoading:a,isInitialLoading:_,loadingQuery:u,contextVideos:c=at,onContextChange:s,availableDisplayModes:d}){const[p,f]=oe(null),[h,v]=oe(!1),[m,y]=oe(!1),b=a??h,w=(k=r,j=5,ie(function(){return{current:k}},[]));var k;const C=d?.includes("pip")??!1,x=e?._meta?.structuredContent??e?.structuredContent,N=x?.items??[],L=x?.error,P=Boolean(x),S=x?.offset??0,M=x?.returnedCount??N.length,T=x?.pageSize??x?.count??N.length,D=S>0,E=S<9&&N.length>0,H=Boolean(l)&&P&&!L,R=ie(()=>new Set(c.map(e=>e.url)),[c]),A=e=>R.has(e),I=Boolean(s),q=async e=>{try{const{isError:t}=await n({url:e});t&&await o({level:"warning",data:`Open link rejected: ${e}`})}catch(t){await o({level:"error",data:`Open link failed: ${t instanceof Error?t.message:String(t)}`})}};re(()=>{const e="pip"===w.current&&"pip"!==r;if(w.current=r,e&&p){const e=setTimeout(()=>f(null),0);return()=>clearTimeout(e)}},[r,p]);const B=async e=>{f(e),y(!1),C&&i&&"pip"!==await i("pip")&&y(!0)},$=e=>{if(!s)return;const t={title:e.title,creator:e.creator,duration:e.duration,url:e.url};A(e.url)?s(c.filter(t=>t.url!==e.url)):s([...c,t])},O=S+1;return"pip"===r&&p?W(lt,{video:p}):W(g,{children:[W(ot,{variant:"video",brandSub:"Video Search",query:x?.query,countLabel:`${M}/${T} videos`,error:L,isInitialLoading:_,loadingQuery:u,hasData:P,isEmpty:0===N.length,emptyTitle:"Video Search",emptyDescription:"Ask to search for videos on any topic.",noResultsTitle:"No results",noResultsDescription:"Try a broader query or adjust the count.",hostContext:t,displayMode:r,requestDisplayMode:i,pagination:H?{pageNumber:O,hasPrevious:D,hasNext:E,isLoading:b,onPrevious:async()=>{if(l&&!b&&D){v(!0);try{await l(S-1)}finally{v(!1)}}},onNext:async()=>{if(l&&!b&&E){v(!0);try{await l(S+1)}finally{v(!1)}}}}:void 0,context:I&&N.length>0?{count:c.length,onAddAll:()=>{if(!s)return;const e=N.filter(e=>!A(e.url)).map(e=>({title:e.title,creator:e.creator,duration:e.duration,url:e.url}));s([...c,...e])},addAllDisabled:N.every(e=>A(e.url))}:void 0,children:W("section",{className:"video-grid",children:N.map((e,t)=>W(rt,{item:e,index:t,onPlay:B,onOpenLink:q,isInContext:A(e.url),onToggleContext:I?$:void 0},e.url))})}),p&&(!C||m)&&W(it,{video:p,onClose:async()=>{f(null),y(!1),"pip"===r&&i&&await i("inline")}})]})}function ut(){Ze();const e=Fe("toolInput"),t=Fe("toolOutput"),n=Fe("toolResponseMetadata"),o=n?.structuredContent??t?.structuredContent,[r,i]=oe([]),{displayMode:l,hostContext:a,openLink:_,requestDisplayMode:u,noopLog:c,canCallTool:s,canSetWidgetState:d,canRequestDisplayMode:p,callTool:f,setWidgetState:h,currentData:v,isLoading:m,setIsLoading:y,setPagedOutput:g}=function({toolInputQuery:e=null,initialData:t=null}={}){const n=Fe("displayMode"),o=Fe("safeArea"),[r,i]=oe(null),[l,a]=oe(!1),_=ie(()=>{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??t?.query??null,c=r&&u&&r.query===u?r:t;re(()=>{if(r&&u&&r.query!==u){const e=setTimeout(()=>{i(null),a(!1)},0);return()=>clearTimeout(e)}},[u,r]);const s=le(async({url:e})=>{try{return window.openai?.openExternal&&await window.openai.openExternal({href:e}),{isError:!1}}catch{return{isError:!0}}},[]),d=le(async e=>{if(window.openai?.requestDisplayMode)return await window.openai.requestDisplayMode({mode:e}),e},[]),p=le(async()=>{},[]),f=le(async(e,t)=>window.openai?.callTool?window.openai.callTool(e,t):null,[]),h=le(e=>{window.openai?.setWidgetState?.(e)},[]);return{displayMode:n,hostContext:_,openLink:s,requestDisplayMode:d,noopLog:p,canCallTool:Boolean(window.openai?.callTool),canSetWidgetState:Boolean(window.openai?.setWidgetState),canRequestDisplayMode:Boolean(window.openai?.requestDisplayMode),callTool:f,setWidgetState:h,currentData:c,hostQuery:u,isLoading:l,setIsLoading:a,setPagedOutput:i}}({toolInputQuery:e?.query??null,initialData:o}),b=le(async e=>{if(v){y(!0);try{const t=function(e){if(!e||"object"!=typeof e)return null;const t=e;return t.meta?.structuredContent??t._meta?.structuredContent??t.structuredContent??null}(await f("brave_video_search",{query:v.query,count:v.pageSize??v.count??10,offset:e}));t&&g(t)}catch(t){console.error("Failed to load page:",t)}finally{y(!1)}}},[f,v,y,g]),w=le(e=>{i(e),h({modelContent:{selectedVideos:e.map((e,t)=>({index:t+1,title:e.title,creator:e.creator,duration:e.duration,url:e.url})),count:e.length}})},[h]),k=Boolean(v),C=null!==e&&!k,x=e?.query;return W(_t,{toolInputs:null,toolInputsPartial:null,toolResult:v?{structuredContent:v}:null,hostContext:a,openLink:_,sendLog:c,displayMode:l??"inline",requestDisplayMode:u,availableDisplayModes:p?["inline","fullscreen","pip"]:void 0,onLoadPage:s?b:void 0,isLoading:m,isInitialLoading:C,loadingQuery:x,contextVideos:r,onContextChange:d?w:void 0})}var ct;(ct=document.getElementById("root"),{render:function(e){var t,n;t=e,null==(n=ct).__k&&(n.textContent=""),O(t,n),t&&t.__c},unmount:function(){var e;(e=ct).__k&&O(null,e)}}).render(W(Oe,{children:W(ut,{})}));</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)}@support