PageSourceSearch

https://axon.es/_next/static/chunks/2577-61e2853463fd1baf.js

js axon.es collected 2026-09-24 22:37:48 UTC 23,153 bytes, 1 lines download raw bytes

1try{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9bb34d9b-3b74-48dc-a2af-a789caf627fb",e._sentryDebugIdIdentifier="sentry-dbid-9bb34d9b-3b74-48dc-a2af-a789caf627fb")}catch(e){}"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2577],{3013:function(e,t,r){r.d(t,{Z:function(){return o}});var l=r(85893),s=r(67294),a=r(66175),n=function e(t,r,l){let s=!1;if(l?-1!==t.innerText.indexOf(r.innerText)&&(s=!0):t.contains(r)&&(s=!0),!s){let{children:l}=t;if(l.length>0)for(let t=0;t<l.length;t+=1)e(l[t],r,!0)&&(s=!0)}return s},i=r(86735),o=e=>{let t,{shown:r,className:o,bulletIcon:c,peek:d,onActiveFn:u,onClick:f,heading:h,children:p,noAutoHide:v,filterProp:g,attached:y,tags:m,context:b}=e,[x,j]=(0,s.useState)(!1),[N,k]=(0,s.useState)(r||!1),[_,T]=(0,s.useState)([]);(0,s.useEffect)(()=>{k(r)},[r]);let C=e=>{let r=t;r&&e.target&&!n(r,e.target,null)&&k(!1)};(0,s.useEffect)(()=>(v||window.addEventListener("click",C),g&&T((null==b?void 0:b.filters[h])||[]),()=>{v||window.removeEventListener("click",C),("Tabla de contenidos"===h||"Descripci\xf3n"===h)&&k(!0)}),[]);let S=()=>{u&&u()};return(0,s.useEffect)(()=>{x&&S()},[x]),(0,l.jsxs)("div",{ref:e=>{t=e},className:"collapsibleBlock".concat(N?" collapsed":""," ").concat(o||"").concat(x||_.length>0?"":" inactive").concat(c?" bulletTitle":""),children:[(0,l.jsxs)(a.default,{type:"button",onClick:()=>{k(e=>!e),j(e=>!e),f&&f()},className:"collapsibleHeading",children:[c?(0,l.jsx)(i.Z,{className:N?"bullet-minus":"bullet-plus"}):null,h]}),(0,l.jsx)("div",{className:"collapsibleContent ".concat(N?"":"hidden"," ").concat(m?"tags":""," ").concat(d?"peek":""," ").concat(y?"attached":""),children:p})]})}},80170:function(e,t,r){var l=r(85893),s=r(67294);t.Z=e=>{let{children:t,initialIndex:r,block:a,className:n}=e,[i,o]=(0,s.useState)({active:r});return(0,s.useEffect)(()=>{o(e=>({...e,active:r}))},[r]),(0,l.jsx)("div",{className:"buttonGroup ".concat(n||""," ").concat(a?"disabled":""),children:s.Children.map(t,(e,t)=>e?s.cloneElement(e,{className:(e.props.className||"")+(t===i.active?" active":"")}):null)})}},38906:function(e,t,r){var l=r(85893),s=r(5152),a=r.n(s);r(67294);let n=a()(()=>Promise.resolve().then(r.bind(r,72272)),{loadableGenerated:{webpack:()=>[72272]},ssr:!1});t.Z=e=>{let{className:t,isSpinner:r}=e;return(0,l.jsx)("div",{className:"loader ".concat(t||""),children:r?(0,l.jsx)("div",{style:{width:"100px",background:"none",opacity:1},children:(0,l.jsx)(n,{ariaLabel:"loading",height:100,width:100,strokeWidth:2.2,color:"red",secondaryColor:"white"})}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"one"}),(0,l.jsx)("div",{className:"two"}),(0,l.jsx)("div",{className:"three"})]})})}},59007:function(e,t,r){r.r(t),r.d(t,{default:function(){return ef}});var l=r(85893),s=r(67294),a=r(11163),n=r(989),i=r.n(n),o=r(45937),c=r(26410),d=e=>{let{asPath:t}=(0,a.useRouter)(),r=t.includes("resultados"),l=!!(0,c.vX)(c._3.areaOfInterest),[n,i]=(0,s.useState)(null),{doTheSearch:d,order:u,filter:f}=(0,o.Z)();return(0,s.useEffect)(()=>{if((u||Object.keys(f).length)&&d){i("filters");return}if(!e&&r){i("results");return}if(r){i("".concat(e,"Result"));return}if(["book","ebook"].includes(e)&&l){i("".concat(e,"WithArea"));return}i(e)},[e,f,u,d]),n},u=r(72076),f=r(49544),h=r(6848),p=r(48268),v=r(15503),g=(e,t)=>"set_state"===t.type?{...e,...t.listing}:e,y=r(532),m=r(77606),b=r(67312),x=r(5152),j=r.n(x),N=r(86063),k=r(76249),_=r(1747);let T=async()=>{try{let{query:e}=(0,_.in)(),{data:{getTags:t}}=await e({query:k.zm,fetchPolicy:"cache-first"});return{ok:!!t,data:t}}catch(e){return{ok:!1,messageError:null==e?void 0:e.message}}},C=async e=>{try{let{query:t}=(0,_.in)(),{data:{aggregate:r}}=await t({query:k.zK,variables:e,fetchPolicy:"cache-first"});return{ok:!!r,data:r}}catch(e){return{ok:!1,messageError:null==e?void 0:e.message}}};var S=r(3013),P=r(86735),w=r(80170),I=r(38906),E=r(71191),O=(e,t)=>"set_state"===t.type?{...e,...t.filter}:e,R=r(72272);let Z=j()(()=>r.e(608).then(r.bind(r,50608)),{loadableGenerated:{webpack:()=>[50608]}}),F=j()(()=>r.e(2799).then(r.bind(r,82799)),{loadableGenerated:{webpack:()=>[82799]}}),A=j()(()=>Promise.all([r.e(3662),r.e(9734),r.e(3543)]).then(r.bind(r,73543)),{loadableGenerated:{webpack:()=>[73543]}});var L=e=>{let{productTypeOpen:t,changeOrderFn:r,otherOpen:s,tagCategoryActive:a,tagCategoryActiveResult:n,changeFiltersTags:i,loadingFilter:c,categoryProps:d,others:u,productType:f,tags:h,nResults:p}=e,{changeFilters:v,filter:g}=(0,o.Z)();return f?(0,l.jsx)(F,{multi:!0,heading:"Categor\xedas",className:"productType",changeFilters:v,clickClose:t,children:(0,l.jsx)(Z,{categoryProps:d,changeOrderFn:r})},"f_p_t"):u?(0,l.jsx)(F,{clickClose:()=>{var e;g.Tags&&(null===(e=g.Tags)||void 0===e?void 0:e.length)||s()},otherOpen:s,className:"other",children:c||!h?(0,l.jsx)(R.default,{ariaLabel:"loading-indicator-register",height:50,width:45,strokeWidth:3.5,color:"red",secondaryColor:"white"}):(0,l.jsx)(A,{otherOpen:s,tagCategoryActive:a,tagCategoryActiveResult:n,changeFiltersTags:i,categoryCurrent:d,nResults:p,tags:h})}):null};let B=j()(()=>Promise.all([r.e(6658),r.e(8585)]).then(r.bind(r,8585)),{loadableGenerated:{webpack:()=>[8585]}}),G=j()(()=>Promise.all([r.e(3662),r.e(9734),r.e(3543)]).then(r.bind(r,73543)),{loadableGenerated:{webpack:()=>[73543]}}),W=j()(()=>r.e(608).then(r.bind(r,50608)),{loadableGenerated:{webpack:()=>[50608]}}),X=j()(()=>Promise.resolve().then(r.bind(r,66175)),{loadableGenerated:{webpack:()=>[66175]}}
1),H={calendar:m.s5.filterSortNewest,visited:m.s5.filterSortMostViewed,alfabeta:m.s5.filterSortAlphabeticalOrder,alfabetaBack:m.s5.filterSortAlphabeticalOrder,euro:m.s5.filterSortPrice,euroHigh:m.s5.filterSortPrice,bestSellers:m.s5.filterSortBestSellers},{sectionWithAreasOfInterest:q}=v.default;var D=e=>{let{type:t,search:r,hidden:n,category:i}=e,{asPath:d}=(0,a.useRouter)(),{t:f}=(0,y.$G)(m.ZP.Section),[h,p]=(0,s.useReducer)(O,{orderOptions:!1,productType:!1,areasOfInterest:!1,price:!1,others:!1,openFilters:!1,fixed:!1,expandedAreas:!1,nResults:{},type:t,search:r,loadingFilter:!1,category:i}),{getOrder:g,changeOrder:b,resetFilter:x,getFilters:j,changeFilters:k,filter:_,setOpenFilter:R}=(0,o.Z)(),{isTheActualPageSave:Z,pageScrollPosition:F}=(0,u.Z)(),{documentWidth:A}=(0,E.Z)(),[D,M]=(0,s.useState)(0),Y=(0,s.useRef)(""),z=(0,s.useRef)(null),U=e=>{var t;return(null===(t=_["Categor\xedas"])||void 0===t?void 0:t.length)?[..._["Categor\xedas"]]:i?[i]:v.default.allProductTypes},V=e=>{let t=(0,c.vX)(c._3.areaOfInterest);return q.includes(U(e)[0])&&t?[t]:null},$=async()=>{let{ok:e,data:t}=await T();e&&p({type:"set_state",filter:{tags:t}})};(0,s.useEffect)(()=>{$().catch(console.error)},[d]);let Q=e=>{p({type:"set_state",filter:{orderOptions:!h.orderOptions}}),b(e,!1,!0)},K=async e=>{var t,r,l,s;let a={limit:1,skip:0,sort:"prices.sale",order:-1,product_type:U(),lang:(null===(r=j())||void 0===r?void 0:null===(t=r.Idioma)||void 0===t?void 0:t.length)&&j().Idioma,areas_of_interest:V(),tags:(null===(s=j())||void 0===s?void 0:null===(l=s.Tags)||void 0===l?void 0:l.length)&&j().Tags,type:h.type,searchGeneral:h.search,prox:!1,area_prox:void 0},{ok:n,data:i}=await (0,N.Xp)(a);if(!n)return;let[o]=i||[],c=null==o?void 0:o.priceWithDiscount,d={};d.nResults={...e,price:{min:0,max:c}},p({type:"set_state",filter:{...d}})},J=async(e,t)=>{var r,l,s,a;M(D+1);let{category:n}=h;if("magazines"===n||"others"!==e)return;let i=U(t),o=V(),c=t?{...t}:{..._},d={collectionName:"Books",group:"tags",product_type:i,lang:(null==c?void 0:null===(r=c.Idioma)||void 0===r?void 0:r.length)&&c.Idioma,rangePrice:(null==c?void 0:null===(l=c.Precio)||void 0===l?void 0:l.length)&&c.Precio[0],areas_of_interest:o,tags:(null==c?void 0:null===(s=c.Tags)||void 0===s?void 0:s.length)&&c.Tags,type:h.type,searchGeneral:h.search,prox:c&&(null===(a=c.Tags)||void 0===a?void 0:a.some(e=>{var t;return null===(t=e.items)||void 0===t?void 0:t.includes("SIN PUBLICAR")})),area_prox:void 0};p({type:"set_state",filter:{loadingFilter:!0}});let{ok:u,data:f}=await C(d);if(!u)return;let{nResults:v}=h,g=null==f?void 0:f.results,y={};y.nResults={...v,others:g},y.loadingFilter=!1,p({type:"set_state",filter:{...y}}),K(y.nResults).catch(console.error)};(0,s.useEffect)(()=>{if(!Z()&&void 0!==F){x(),b(q.includes(i)?"calendar":"visited",!1,!0),J("others",{}).catch(console.error);return}J("others").catch(console.error)},[null==F?void 0:F.pageName]),(0,s.useEffect)(()=>{p({type:"set_state",filter:{category:i}})},[i]),(0,s.useEffect)(()=>{p({type:"set_state",filter:{type:t,search:r,orderOptions:!1,productType:!1,areasOfInterest:!1,price:!1,others:!1}})},[t,r]);let ee=(e,t)=>"Categor\xedas"===e&&(null==h?void 0:h[t])?"focused active":_[e]||"Categor\xedas"===e?"active":h[t]?"focused":"",et=()=>{p({type:"set_state",filter:{productType:!1,areasOfInterest:!1,price:!1,others:!1,openFilters:!1}}),x()},er=()=>{let e=A>v.NW.MAX_TABLET?!h.openFilters:!h.productType;A<=v.NW.MAX_TABLET&&R(e),p({type:"set_state",filter:{productType:!h.productType,areasOfInterest:!1,price:!1,others:!1,openFilters:e}}),e&&J("productType").catch(console.error)};(0,s.useEffect)(()=>{J("others").catch(console.error)},[_]);let el=()=>{let e=!h.others;p({type:"set_state",filter:{productType:!1,areasOfInterest:!1,price:!1,others:!h.others,openFilters:e}}),R(e),Y.current="",z.current=null},es=()=>{p({type:"set_state",filter:{openFilters:!1}}),R(!1)},ea=()=>{es(),et()},en=(e,t)=>{let r=_.Tags?_.Tags:[],l=r.findIndex(t=>t.prop===e.prop);if(-1!==l){let t=r[l].items.indexOf(e.value);-1!==t&&r[l].items.length>1?r[l].items.splice(t,1):-1!==t&&1===r[l].items.length?r.splice(l,1):r[l].items.push(e.value)}else{let t={prop:e.prop,items:[e.value]};r.push(t)}Y.current=e.prop,z.current=t,k({prop:"Tags",value:r},void 0,!0)};if(A>v.NW.MAX_TABLET){var ei;return(0,l.jsx)("div",{className:"filtersWrapper ".concat(h.fixed?"fixed":""),children:(0,l.jsxs)("div",{className:"filters",children:[(0,l.jsxs)(w.Z,{className:"filtersHeader horizontal",children:[(0,l.jsx)(X,{className:ee("Categor\xedas","productType"),onClick:er,children:(0,l.jsxs)("div",{className:"orderForStyle",children:[(0,l.jsx)("p",{children:f(m.s5.filterS
1ortBy)}),(0,l.jsxs)("div",{className:"filterOptionSelected",children:[(0,l.jsx)(P.Z,{className:H[g()]?g():["book"].includes(i)?"calendar":"visited",nameAriaLabel:"category"}),(0,l.jsx)("p",{children:f("".concat(H[g()]?H[g()]:["book"].includes(i)?m.s5.filterSortNewest:m.s5.filterSortMostViewed))})]})]})}),(0,l.jsx)(X,{className:ee("Tags","others"),onClick:el,children:(0,l.jsx)("p",{children:f(m.s5.filterBy)})})]}),(null===(ei=_.Tags)||void 0===ei?void 0:ei.length)||_.Precio?(0,l.jsx)(X,{noStyle:!0,onClick:et,className:"filtersReset ".concat(Object.keys(j()).length?"":"inactive"," activeFilters"),children:(0,l.jsx)("span",{children:f(m.s5.removeFilter)})}):null,h.openFilters?(0,l.jsx)(L,{changeOrderFn:Q,otherOpen:el,productTypeOpen:er,changeFiltersTags:en,tagCategoryActive:Y.current,tagCategoryActiveResult:z.current,categoryProps:h.category,loadingFilter:h.loadingFilter,nResults:h.nResults,others:h.others,productType:h.productType,tags:h.tags}):null]})})}return(0,l.jsx)("div",{className:"filters".concat(h.openFilters?" active":" inactive"," ").concat(h.fixed?"fixed":""," ").concat(!h.openFilters&&n?"hidden":""),children:h.openFilters?(0,l.jsxs)("div",{className:"filterWrapper",children:[(0,l.jsxs)("div",{className:"filterHeader",children:[(0,l.jsx)(X,{noStyle:!0,iconLeft:!0,iconClass:"filtro",children:f(m.s5.filters)}),(0,l.jsx)(X,{noStyle:!0,children:(0,l.jsx)(P.Z,{onClick:ea,className:"close",nameAriaLabel:"closed"})})]}),(0,l.jsx)("div",{className:"filterContent",children:(0,l.jsxs)(B,{children:[(0,l.jsx)(S.Z,{multi:!0,onClick:er,heading:f(m.s5.filterSortBy),className:"filter",children:(0,l.jsx)(W,{categoryProps:h.category,changeOrderFn:Q})}),(0,l.jsx)(S.Z,{filter:!0,multi:!0,onClick:el,heading:f(m.s5.filterBy),className:"filter",children:h.loadingFilter?(0,l.jsx)(I.Z,{}):(0,l.jsx)(G,{otherOpen:el,changeFiltersTags:en,tagCategoryActive:Y.current,tagCategoryActiveResult:z.current,categoryCurrent:h.category,nResults:h.nResults,tags:h.tags})})]})}),(0,l.jsx)("div",{className:"filterFooter actionsHolder",children:(0,l.jsx)(X,{onClick:es,className:"rounded bordered cta",iconClass:"check",iconRight:!0,children:f(m.s5.filterApplyFilter)})})]}):(0,l.jsxs)("div",{className:"filterHeader",children:[(0,l.jsx)(X,{noStyle:!0,iconLeft:!0,iconClass:"filtro",onClick:()=>{p({type:"set_state",filter:{openFilters:!0}}),R(!0)},children:f(m.s5.filters)}),(0,l.jsx)(X,{noStyle:!0,children:(0,l.jsx)(P.Z,{onClick:ea,className:"refresh",nameAriaLabel:"refresh"})})]})})},M=r(18446),Y=r.n(M),z=r(60374),U=r(29156);let{allProductTypes:V,sectionWithAreasOfInterest:$,pixelToLoad:Q}=v.default,K=e=>e?"filters":null,J=(e,t,r,l,s,a)=>{let n=t?[]:[...r],i=t?[]:[...l],o=(0,c.vX)(c._3.areaOfInterest);return(s||a)&&t&&o?i=[]:r.length&&!l.length&&(i=r.map(e=>e.id)),e.forEach(e=>{i.some(t=>t===e.id)||(i.push(e.id),n.push(e))}),{listProductsId:i,products:n}},ee=(e,t,r,l,s,a,n,i,o,d)=>{var u,f,h,p,v;let g=t||null;""===t&&(g=r?"calendar":"visited");let{sortType:y,orderType:m}=(0,U.pg)(g,l),b={limit:s,skip:a,sort:y,order:m,product_type:(null==e?void 0:null===(u=e["Categor\xedas"])||void 0===u?void 0:u.length)?e["Categor\xedas"]:n?[n]:V,lang:(null==e?void 0:null===(f=e.Idioma)||void 0===f?void 0:f.length)?e.Idioma:null,rangePrice:(null==e?void 0:null===(h=e.Precio)||void 0===h?void 0:h.length)?e.Precio[0]:null,areas_of_interest:(null==e?void 0:null===(p=e.Áreas)||void 0===p?void 0:p.length)&&e.Áreas,tags:(null==e?void 0:null===(v=e.Tags)||void 0===v?void 0:v.length)?e.Tags:null,type:i,searchGeneral:o,prox:d,area_prox:l};if(!$.includes(b.product_type[0]))return b.areas_of_interest=null,b;let x=(0,c.vX)(c._3.areaOfInterest);return b.areas_of_interest=x&&[x],!b.areas_of_interest&&x&&(b.areas_of_interest=[x]),b},et=e=>{if(!e)return!1;let{scrollHeight:t,clientHeight:r,scrollTop:l}=e,s=t-r;return s&&s-l<=Q};var er=r(33216),el=e=>{let{goToPositionInScroll:t,scrollBar:r}=(0,er.A)(),{isTheActualPageSave:l,pageScrollPosition:a,setScrollPosition:n}=(0,u.Z)(),i=(0,s.useRef)(!0),o=(0,s.useRef)(null),c=(0,s.useRef)(null);(0,s.useEffect)(()=>{if(o.current=null==r?void 0:r.scrollTop,c.current=null==r?void 0:r.getScrollHeight,!e)return;if(!l()||!a){if(!i.current){i.current=!0;return}t();return}o.current(null==a?void 0:a.Y);let s=setInterval(()=>{o.current(null==a?void 0:a.Y),(null==a?void 0:a.Y)<=c.current()&&(clearInterval(s),i.current=!1,n(void 0))},100);return()=>{clearInterval(s)}},[e,r,a])},es=r(66175),ea=r(56280);let en=e=>Number.isNaN(Number(e)),{sectionWithAreasOfInterest:ei,initialPagination:eo,noInitialPagination:ec,sectionSpanishWithAreasOfInterest:ed}=v.default;var eu=s.memo(e=>{let{area:t,type:r,search:n,category:i,title:f,isAreaPage:p,setListingLoading:v,setTotalCurrentProducts:g}=e,{changeFilters:y,doTheSearch:m,existFilter:b,order:x,filter:j,changeDoTheSearch:k}=(0,o.Z)(),{pathname:_,asPath:T}
1=(0,a.useRouter)(),[C,S]=(0,s.useState)({listProductsId:[],loading:!1,noPublish:!1,initialLoad:!1,areaBeautify:t||""}),[P,w]=(0,s.useState)(!1),[E,O]=(0,s.useState)(!1),R=(0,s.useRef)(!0),Z=(0,s.useRef)(!1),[F,A]=(0,s.useState)(null),{pageScrollPosition:L,scrollbarValues:B,isTheActualPageSave:G}=(0,u.Z)(),W=(0,s.useRef)(null),X=d(i),[H,q]=(0,h.Z)(e=>[e.dataProduct,e.setStateBySection],z.Z),{books:D=[],limit:M=eo.limit,skip:U=eo.skip}=(null==H?void 0:H[X])||{};el(!!(null==D?void 0:D.length));let V=(0,s.useRef)(M),$=(0,s.useRef)(U);(0,s.useEffect)(()=>{B&&(W.current=B)},[B]),(0,s.useEffect)(()=>{D.length<=10&&(R.current=!0,Z.current=!1)},[D.length]);let Q=(e,t)=>{let{listProductsId:r,products:l}=J(e,t,D,C.listProductsId,T.includes("resultados"),null==X?void 0:X.includes("filters"));(null==e?void 0:e.length)||(R.current=!1),S(e=>({...e,listProductsId:r,loading:!1})),q(t&&K((!!x||!!Object.keys(j).length)&&m)||X,{books:l,limit:V.current,skip:$.current}),O(!1),v(!1),w(!1),Z.current=!1},er=(e,t)=>{var r;if(i&&(null===(r=e[0])||void 0===r?void 0:r.product_type)!==i){S(e=>({...e,loading:!1})),O(!1),v(!1);return}Q(e,t)},eu=e=>{if(e){$.current=eo.skip,V.current=eo.limit;return}if(V.current===eo.limit&&eo.limit!==ec.limit){V.current=ec.limit;return}$.current+=V.current},ef=async function(){var e;let l=!(arguments.length>0)||void 0===arguments[0]||arguments[0];eu(l);let s=t;en(t)&&(s=null);let a=ee(j,x,ed.includes(T),s,V.current,$.current,i,T.includes("saldos-y-ofertas")?"all":r,T.includes("saldos-y-ofertas")?"":n,t?!p:C.noPublish||j&&(null===(e=j.Tags)||void 0===e?void 0:e.some(e=>{var t;return null===(t=e.items)||void 0===t?void 0:t.includes("SIN PUBLICAR")})));T.includes("saldos-y-ofertas")&&delete a.searchGeneral,Z.current=!0;let{data:o,ok:c}=await (0,N.Xp)(a);
1if(c&&(er(o,l),1===a.product_type.length&&T.includes("resultados")&&l)){let{data:e,ok:t}=await (0,N.Y2)(a);if(!t)return;g(c?e:null==D?void 0:D.length)}};(0,s.useEffect)(()=>{!m||!X||m&&"filters"!==X||G()&&"filters"===X||(eu(!0),R.current=!0,S(e=>({...e,initialLoad:!0,listProductsId:[]})),w(!0),ef().catch(console.error))},[x,j,m,X]),(0,s.useEffect)(()=>{eu(!0),R.current=!0,(0,c.vX)(c._3.areaOfInterest)&&ei.includes(i)&&T.includes("resultados")&&w(!0)},[i]),(0,s.useEffect)(()=>{E&&!P&&ef(!1).catch(console.error)},[E]);let eh=()=>{!E&&R.current&&(null==C||!C.loading)&&!Z.current&&et(W.current)&&(S(e=>({...e,loading:!0,initialLoad:!1})),O(!0))},ep=()=>{document.addEventListener("bp.scroll",eh,!0)};(0,s.useEffect)(()=>{var e;return ep(),b()&&(null==L?void 0:null===(e=L.pageName)||void 0===e?void 0:e.includes(T))||S(e=>({...e,listProductsId:[]})),()=>{S(e=>({...e,listProductsId:[]})),document.removeEventListener("bp.scroll",eh)}},[T]),(0,s.useEffect)(()=>{var e;let{noPublish:t}=C;(null==j?void 0:null===(e=j.Tags)||void 0===e?void 0:e.length)?t=j.Tags.some(e=>{var t;return null===(t=e.items)||void 0===t?void 0:t.includes("SIN PUBLICAR")}):C.noPublish&&(t=!1),S(e=>({...e,noPublish:t}))},[j]);let ev=()=>{var e;let t=null==j?void 0:null===(e=j.Tags)||void 0===e?void 0:e.filter(e=>{var t;return!(null==e?void 0:null===(t=e.items)||void 0===t?void 0:t.includes("SIN PUBLICAR"))});S(e=>({...e,listProductsId:[]})),y({prop:"Tags",value:t},null,!0),k(!1)},eg=e=>{A(e)};if(P&&(null==D?void 0:D.length)===0)return(0,l.jsx)("div",{className:"row productList fixed paddingList",children:(0,l.jsx)(I.Z,{isSpinner:!0})});if(null==D?void 0:D.length){var ey;let e=T.split("/").includes("resultados")?T.split("/")[2]:T.split("/")[1].split("-")[0];return(0,l.jsxs)("div",{id:"serverProducts",children:[(0,l.jsxs)("div",{className:"proxiHeader",children:[(0,l.jsx)("h2",{className:"pageTitleArea",children:f.replace("?expanded=true","")}),C.noPublish?(0,l.jsx)(es.default,{onClick:ev,className:"rounded bordered",iconClass:"arrow-left",iconLeft:!0,children:"Volver a ".concat("material"===e?"materiales":e," ya publicados")}):null]}),(0,l.jsxs)("div",{className:"row productList paddingList ".concat((()=>{let[,e]=_.split("/");return"resultados"===e?"results":""})()),children:[null==D?void 0:D.map(e=>(0,l.jsx)(ea.Z,{results:!0,id:"l_p_".concat(e.id),element:e,withBorder:!0,category:i,onClick:eg,isLoading:Y()(e,F)},"".concat(null==e?void 0:e.id," - ").concat(null==e?void 0:e.ean))),C.loadingBack?(0,l.jsx)(I.Z,{isSpinner:!0,className:"cart superBig"}):null,(null==D?void 0:D.length)&&(null===(ey=D[0])||void 0===ey?void 0:ey.not_released)?(0,l.jsx)("div",{className:"actionsHolder backFromCart",children:(0,l.jsx)(es.default,{onClick:ev,className:"rounded bordered",iconClass:"arrow-left",iconLeft:!0,children:"Volver"})}):null,C.loadingBack?(0,l.jsx)(I.Z,{isSpinner:!0,className:"cart superBig"}):null,C.loading?(0,l.jsx)(I.Z,{isSpinner:!0}):null]})]},"serverProducts")}return(0,l.jsx)("div",{className:"row productList",children:C.loading||P?(0,l.jsx)(I.Z,{isSpinner:!0}):(0,l.jsx)("p",{className:"counter",children:" No hay resultados con esta b\xfasqueda en ".concat(n||C.areaBeautify)})})}),ef=s.memo(e=>{let t,{type:r,category:n,title:x,listCurrentProducts:j,area:N,isAreaPage:k,totalCurrentProducts:_,search:T}=e,{t:C}=(0,y.$G)(m.ZP.Section),{filter:S}=(0,o.Z)(),{push:P}=(0,a.useRouter)(),[w,I]=(0,s.useState)(_||0),[E,O]=(0,s.useReducer)(g,{type:r,searching:!1,firstSearchResults:!1,prevSearch:null,category:n}),{setSearch:R}=(0,f.Z)(),{isTheActualPageSave:Z}=(0,u.Z)(),F=d(n),A=(0,h.Z)(e=>e.setInitialStateBySection),L=(0,s.useCallback)(e=>{O({type:"set_state",listing:{loading:e}})},[]);(0,s.useEffect)(()=>{A(F,{books:j},Z())},[F]),(0,s.useEffect)(()=>{let e={};e.category=n,e.type=r,O({type:"set_state",listing:{...e}})},[n,r]);let B=C(m.s5.searchFound,{total:w,search:T});return(0,l.jsxs)("div",{className:"row listing",children:[T?(0,l.jsxs)("p",{className:"counter toolsBlock",children:[B,(0,l.jsx)(b.Z,{onClick:()=>{let e=(0,c.vX)(c._3.areaOfInterestName);if(!e||!v.default.sectionWithAreasOfInterest.includes(E.category)){P(E.category?"/".concat(p.e5[E.category]):"/").cat
1ch(console.error);return}let t=i()(e.replace(/, /g,"."),{custom:["."]});R(null),P(E.category?"/".concat(p.e5[E.category],"/").concat(t):"/").catch(console.error)},children:C(m.s5.cancelSearch)}),(!!E.alternativeSearchText&&0!==E.alternativeSearchType||0===E.alternativeSearchType)&&((t=(null==S?void 0:S["\xc1reas"])&&[...null==S?void 0:S["\xc1reas"]])&&(t=t.filter(e=>e)),(null==t?void 0:t.length)>0)&&(0,l.jsx)(b.Z,{onClick:()=>{0===E.alternativeSearchType&&((0,c.fQ)(c._3.areaOfInterest),(0,c.fQ)(c._3.areaOfInterestName))},children:"Buscar en ".concat(E.alternativeSearchText)})]}):null,(0,l.jsx)(D,{category:E.category,type:E.type,search:T}),(0,l.jsx)(eu,{title:x,type:E.type,search:T,listProducts:j,category:n,setListingLoading:L,area:null==N?void 0:N.nameEsFriendly,isAreaPage:k,setTotalCurrentProducts:I})]})})},86063:function(e,t,r){r.d(t,{Xp:function(){return n},Y2:function(){return i},cF:function(){return c},d6:function(){return o}});var l=r(76249),s=r(1747),a=r(53174);let n=async e=>{try{let{query:t}=(0,s.in)(),{data:{books:r}}=await t({query:l.mA,variables:e,fetchPolicy:"cache-first"});return{ok:!!r,data:r}}catch(e){return{ok:!1,messageError:null==e?void 0:e.message}}},i=async e=>{try{let{query:t}=(0,s.in)(),{data:{totalProducts:r}}=await t({query:a.nN,variables:e,fetchPolicy:"cache-first"});return{ok:r>=0,data:r}}catch(e){return{ok:!1,messageError:null==e?void 0:e.message}}},o=async(e,t)=>{let{query:r}=(0,s.in)();try{return(await r({query:a.a8,variables:{product_type:e,area:t},fetchPolicy:"cache-first"})).data.getImportantProduct||[]}catch(e){return console.error(e),[]}},c=async(e,t)=>{let{query:r}=(0,s.in)();try{return(await r({query:a.fh,variables:{product_type:e,area:t},fetchPolicy:"cache-first"})).data.getPrePublication||[]}catch(e){return console.error(e),[]}}},13433:function(e,t,r){r.d(t,{l:function(){return a}});var l=r(73914),s=r(99564);function a(e){return(0,s.$)(l.useCallback(function(t){return e.onNextChange(function r(){t(),e.onNextChange(r)})},[e]),e,e)}}}]);

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.