PageSourceSearch

https://adnews.com.br/assets/index-Bo9D7uQU.js

js adnews.com.br collected 2026-10-02 03:22:05 UTC 11,708 bytes, 9 lines download raw bytes

vendor: 2,398 bytes, lines 1-9
1import{r as a,j as e,I as A,J as D,a as ee,L as q}from"./components-CmTwZ3Mu.js";import{M as ce,b as te,P as le,d as de,e as ue,f as fe,m as ne}from"./index-DNha2c8B.js";class he extends a.Component{getSnapshotBeforeUpdate(i){const r=this.props.childRef.current;if(r&&i.isPresent&&!this.props.isPresent){const o=r.offsetParent,c=o instanceof HTMLElement&&o.offsetWidth||0,s=this.props.sizeRef.current;s.height=r.offsetHeight||0,s.width=r.offsetWidth||0,s.top=r.offsetTop,s.left=r.offsetLeft,s.right=c-s.width-s.left}return null}componentDidUpdate(){}render(){return this.props.children}}function xe({children:n,isPresent:i,anchorX:r}){const o=a.useId(),c=a.useRef(null),s=a.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:u}=a.useContext(ce);return a.useInsertionEffect(()=>{const{width:f,height:h,top:d,left:x,right:b}=s.current;if(i||!c.current||!f||!h)return;const j=r==="left"?`left: ${x}`:`right: ${b}`;c.current.dataset.motionPopId=o;const g=document.createElement("style");return u&&(g.nonce=u),document.head.appendChild(g),g.sheet&&g.sheet.insertRule(`
2          [data-motion-pop-id="${o}"] {
3            position: absolute !important;
4            width: ${f}px !important;
5            height: ${h}px !important;
6            ${j}px !important;
7            top: ${d}px !important;
8          }
9        `),()=>{document.head.removeChild(g)}},[i]),e.jsx(he,{isPresent:i,childRef:c,sizeRef:s,children:a.cloneElement(n,{ref:c})})}const me=({children:n,initial:i,isPresent:r,onExitComplete:o,custom:c,presenceAffectsLayout:s,mode:u,anchorX:f})=>{const h=te(pe),d=a.useId(),x=a.useCallback(j=>{h.set(j,!0);for(const g of h.values())if(!g)return;o&&o()},[h,o]),b=a.useMemo(()=>({id:d,initial:i,isPresent:r,custom:c,onExitComplete:x,register:j=>(h.set(j,!1),()=>h.delete(j))}),s?[Math.random(),x]:[r,x]);return a.useMemo(()=>{h.forEach((j,g)=>h.set(g,!1))},[r]),a.useEffect(()=>{!r&&!h.size&&o&&o()},[r]),u==="popLayout"&&(n=e.jsx(xe,{isPresent:r,anchorX:f,children:n})),e.jsx(le.Provider,{value:b,children:n})};function pe(){return new Map}const _=n=>n.key||"";function J(n){const i=[];return a.Children.forEach(n,r=>{a.isValidElement(r)&&i.push(r)}),i}const se=({children:n,custom:i,initial:r=!0,onExitComplete:o,presenceAffectsLayout:c=!0,mode:s="sync",propagate:u=!1,anchorX:f="left"})=>{const[h,d]=de(u),x=a.useMemo(()=>J(n),[n]),b=u&&!h?[]:x.map(_),j=a.useRef(!0),g=a.useRef(x),N=te(()=>
9new Map),[L,F]=a.useState(x),[v,P]=a.useState(x);ue(()=>{j.current=!1,g.current=x;for(let t=0;t<v.length;t++){const l=_(v[t]);b.includes(l)?N.delete(l):N.get(l)!==!0&&N.set(l,!1)}},[v,b.length,b.join("-")]);const $=[];if(x!==L){let t=[...x];for(let l=0;l<v.length;l++){const p=v[l],y=_(p);b.includes(y)||(t.splice(l,0,p),$.push(p))}return s==="wait"&&$.length&&(t=$),P(J(t)),F(x),null}const{forceRender:R}=a.useContext(fe);return e.jsx(e.Fragment,{children:v.map(t=>{const l=_(t),p=u&&!h?!1:x===v||b.includes(l),y=()=>{if(N.has(l))N.set(l,!0);else return;let C=!0;N.forEach(I=>{I||(C=!1)}),C&&(R==null||R(),P(g.current),u&&(d==null||d()),o&&o())};return e.jsx(me,{isPresent:p,initial:!j.current||r?void 0:!1,custom:i,presenceAffectsLayout:c,mode:s,onExitComplete:p?void 0:y,anchorX:f,children:t},l)})})},Y=({children:n,...i})=>e.jsx("button",{className:"bg-gray2 px-3 py-2 rounded-md cursor-pointer",...i,children:e.jsx("span",{className:"font-integral text-sm text-black",children:n})}),Q=a.forwardRef(({label:n="Buscar",id:i,...r},o)=>{const c=i||"textfield-search";return e.jsxs("div",{className:"w-full h-[36px] bg-gray2 rounded-md border border-black flex items-center",children:[e.jsx("label",{htmlFor:c,className:"sr-only",children:n}),e.jsx("button",{type:"submit",children:e.jsx("img",{src:"/icons/search.svg",alt:"search",className:"w-6 h-6 mx-3"})}),e.jsx("input",{...r,id:c,ref:o,type:"text",className:"w-full h-full bg-transparent text-black outline-none"})]})});Q.displayName="TextFieldSearch";var H,Z;function ge(){if(Z)return H;Z=1;var n="Expected a function",i=NaN,r="[object Symbol]",o=/^\s+|\s+$/g,c=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,u=/^0o[0-7]+$/i,f=parseInt,h=typeof A=="object"&&A&&A.Object===Object&&A,d=typeof self=="object"&&self&&self.Object===Object&&self,x=h||d||Function("return this")(),b=Object.prototype,j=b.toString,g=Math.max,N=Math.min,L=function(){return x.Date.now()};function F(t,l,p){var y,C,I,S,w,E,M=0,V=!1,O=!1,W=!0;if(typeof t!="function")throw new TypeError(n);l=R(l)||0,v(p)&&(V=!!p.leading,O="maxWait"in p,I=O?g(R(p.maxWait)||0,l):I,W="trailing"in p?!!p.trailing:W);function B(m){var k=y,T=C;return y=C=void 0,M=m,S=t.apply(T,k),S}function re(m){return M=m,w=setTimeout(z,l),V?B(m):S}function ie(m){var k=m-E,T=m-M,X=l-k;return O?N(X,I-T):X}function G(m){var k=m-E,T=m-M;return E===void 0||k>=l||k<0||O&&T>=I}function z(){var m=L();if(G(m))return K(m);w=setTimeout(z,ie(m))}function K(m){return w=void 0,W&&y?B(m):(y=C=void 0,S)}function oe(){w!==void 0&&clearTimeout(w),M=0,y=E=C=w=void 0}function ae(){return w===void 0?S:K(L())}function U(){var m=L(),k=G(m);if(y=arguments,C=this,E=m,k){if(w===void 0)return re(E);if(O)return w=setTimeout(z,l),B(E)}return w===void 0&&(w=setTimeout(z,l)),S}return U.cancel=oe,U.flush=ae,U}function v(t){var l=typeof t;return!!t&&(l=="object"||l=="function")}function P(t){return!!t&&typeof t=="object"}function $(t){return typeof t=="symbol"||P(t)&&j.call(t)==r}function R(t){if(typeof t=="number")return t;if($(t))return i;if(v(t)){var l=typeof t.valueOf=="function"?t.valueOf():t;t=v(l)?l+"":l}if(typeof t!="string")return t===0?t:+t;t=t.replace(o,"");var p=s.test(t);return p||u.test(t)?f(t.slice(2),p?2:8):c.test(t)?i:+t}return H=F,H}ge();var je=typeof window<"u"?a.useLayoutEffect:a.useEffect;function be(n,i,r,o){const c=a.useRef(i);je(()=>{c.current=i},[i]),a.useEffect(()=>{const s=window;if(!(s&&s.addEventListener))return;const u=f=>{c.current(f)};return s.addEventListener(n,u,o),()=>{s.removeEventListener(n,u,o)}},[n,r,o])}function ve(n,i,r="mousedown",o={}){be(r,c=>{const s=c.target;if(!s||!s.isConnected)return;(Array.isArray(n)?n.filter(f=>!!f.current).every(f=>f.current&&!f.current.contains(s)):n.current&&!n.current.contains(s))&&i(c)},void 0,o)}const we={open:{opacity:1,y:0},closed:{opacity:0,y:-50}},ye=({isOpen:n,onClose:i})=>{const r=a.useRef(null),o=D("root"),c=a.useRef(!1);return a.useEffect(()=>{if(typeof window<"u"){c.current=window.innerWidth>=1024;const s=()=>{c.current=window.innerWidth>=1024},u=f=>{f.key==="Escape"&&n&&i()};return window.addEventListener("resize",s),window.addEventListener("keydown",u),()=>{window.removeEventListener("resize",s),window.removeEventListener("keydown",u)}}},[n,i]),ve(r,()=>{c.current&&i()}),e.jsx(se,{children:n&&e.jsx(ne.div,{className:"hidden lg:block fixed top-[30px] left-0 w-full h-full bg-black2 z-50 overflow-y-auto",animate:"open",initial:"closed",exit:"closed",variants:we,transition:{duration:.3},children:e.jsx("div",{className:"container mx-auto",children:e.jsxs("div",{className:"w-full grid grid-cols-3",children:[e.jsx("div",{children:e.jsxs("h1",{className:"text-white font-integral text-4xl mt-2",children:["explore",e.jsx("br",{})," a adnews"]})}),e.jsxs("div",{className:"col-span-2 grid grid-flow-col grid-rows-12",ref:r,children:[o==null?void 0:o.categories.data.map(s=>{var u;return e.jsx("a",{href:`/categories/${encodeURI(s.slug)}`,children:e.jsxs("div",{className:"w-full h-[48px] bg-black px-[22px] flex items-center gap-[10px]",children:[e.jsx("img",{src:`${(u=s.icon)==null?void 0:u.url}`,className:"w-[24px] h-[24px]",alt:"category"}),e.jsx("p",{className:"text-white font-integral text-sm",children:s.name})]})},s.slug)}),e.jsx("a",{href:"/direto-e-reto",children:e.jsxs("div",{className:"w-full h-[48px] bg-black px-[22px] flex items-center gap-[10px]",children:[e.jsx("img",{src:"/icons/direto-e-reto-icon.svg",className:"w-[24px] h-[24px]",alt:"category"}),e.jsx("p",{className:"text-white font-integral text-sm",children:"Direto e reto"})]})},"direto-e-reto")]})]})})})})},Ne={open:{opacity:1,y:0},closed:{opacity:0,y:-50}},Ce=({isOpen:n,onClose:i,onOpen:r})=>{const o=a.useRef(null),c=D("root"),s=ee(),[u,f]=a.useState(""),h=d=>{d.preventDefault(),u.trim()&&(s(`/busca?query=${encodeURIComponent(u)}`),i())};return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"lg:hidden",children:e.jsx("div",{className:"w-full h-[50px] flex items-center bg-black2 fixed top-0 left-0 z-40",children:e.jsx("div",{className:"container mx-auto",children:e.jsxs("div",{className:"w-full flex flex-row justify-between items-center",children:[e.jsx("a",{href:"/","aria-label":"AdNews Home",children:e.jsx("img",{src:"/icons/mb-logo.svg",alt:""})}),e.jsxs("div",{className:"flex flex-row justify-center items-center gap-2",children:[e.jsx("button",{"aria-label":"pesquisar botão",onClick:()=>{r(),setTimeout(()=>{var d;(d=o.current)==null||d.focus()},300)},children:e.jsx("img",{src:"/icons/search-mb.svg",alt:""})}),e.jsx("button",{onClick:r,"aria-label":"menu botão",children:e.jsx("img",{src:"/icons/hamb.svg",alt:""})})]})]})})})}),e.jsx(se,{children:n&&e.jsx(ne.div,{className:"fixed lg:hidden top-0 left-0 w-full h-[100dvh] bg-black z-50",animate:"open",initial:"closed",exit:"closed",variants:Ne,transition:{duration:.3},children:e.jsxs("div",{className:"container mt-4 pb-20 overflow-y-auto h-full",children:[e.jsxs("div",{className:"w-full flex flex-row justify-between items-start mb-[35px]",children:[e.jsx("img",{src:"/imgs/logo.svg",alt:"AdNews",className:"w-[195px]"}),e.jsx("button",{onClick:i,children:e.jsx("img",{src:"/icons/close.svg",alt:""})})]}),e.jsx("div",{className:"w-full mb-[14px]",children:e.jsx("form",{onSubmit:h,children:e.jsx(Q,{ref:o,value:u,onChange:d=>f(d.target.value),className:"w-full"})})}),e.jsxs("div",{className:"w-full flex flex-col",children:[e.jsx(q,{to:"/25anos",children:e.jsxs("div",{className:"w-full h-[49px] bg-black flex items-center gap-[10px] mb-[10px]",children:[e.jsx("img",{src:"/icons/mb-logo.svg",className:"w-[24px] h-[24px]",alt:"25 anos"}),e.jsx("p",{className:"text-white font-integral text-sm",children:"Adnews 25 anos"})]})}),c==null?void 0:c.categories.data.map(d=>{var x;return e.jsx(q,{to:`/categories/${encodeURI(d.slug)}`,children:e.jsxs("div",{className:"w-full h-[49px] bg-black flex items-center gap-[10px]",children:[e.jsx("img",{src:`${(x=d.icon)==null?void 0:x.url}`,className:"w-[24px] h-[24px]",alt:"category"}),e.jsx("p",{className:"text-white font-integral text-sm",children:d.name})]})},d.slug)}),e.jsx(q,{to:"/direto-e-reto",children:e.jsxs("div",{className:"w-full h-[49px] bg-black flex items-center gap-[10px]",children:[e.jsx("img",{src:"/icons/direto-e-reto-icon.svg",className:"w-[24px] h-[24px]",alt:"category"}),e.jsx("p",{className:"text-white font-integral text-sm",children:"Direto e reto"})]})},"/direto-e-reto")]})]})})})]})},Re=()=>
9{const n=D("root"),i=ee(),[r,o]=a.useState(!1),[c,s]=a.useState(""),u=a.useCallback(()=>{o(!0)},[]),f=a.useCallback(()=>{o(!1)},[]),h=d=>{d.preventDefault(),c.trim()&&i(`/busca?query=${encodeURIComponent(c)}`)};return n!=null&&n.header_main_categories?e.jsxs(e.Fragment,{children:[e.jsx(ye,{isOpen:r,onClose:f}),e.jsx(Ce,{isOpen:r,onClose:f,onOpen:u}),e.jsx("div",{className:"container mx-auto lg:block hidden",children:e.jsxs("ul",{className:"flex flex-row justify-between items-center gap-2",children:[n==null?void 0:n.header_main_categories.map(d=>e.jsx("li",{children:e.jsx("a",{href:`/categories/${encodeURI(d.slug)}`,children:e.jsx(Y,{children:d.name})})},d.slug)),e.jsx("li",{children:e.jsx(Y,{onClick:u,children:"Ver todos"})}),e.jsx("li",{className:"w-[188px]",children:e.jsx("form",{onSubmit:h,children:e.jsx(Q,{value:c,onChange:d=>s(d.target.value)})})})]})})]}):null};export{Y as B,Re as C};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.