(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9603],{8266:function(e,a,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/search",function(){return t(73445)}])},54111:function(e,a,t){"use strict";var n=t(85893);t(67294);var r=t(67274),l=t.n(r);a.Z=()=>(0,n.jsxs)("div",{className:"".concat(l().spinner),children:[(0,n.jsx)("div",{className:l().spinner_blade}),(0,n.jsx)("div",{className:l().spinner_blade}),(0,n.jsx)("div",{className:l().spinner_blade}),(0,n.jsx)("div",{className:l().spinner_blade}),(0,n.jsx)("div",{className:l().spinner_blade}),(0,n.jsx)("div",{className:l().spinner_blade}),(0,n.jsx)("div",{className:l().spinner_blade}),(0,n.jsx)("div",{className:l().spinner_blade}),(0,n.jsx)("div",{className:l().spinner_blade}),(0,n.jsx)("div",{className:l().spinner_blade}),(0,n.jsx)("div",{className:l().spinner_blade}),(0,n.jsx)("div",{className:l().spinner_blade})]})},20754:function(e,a,t){"use strict";var n=t(85893),r=t(67294),l=t(46791),i=t.n(l),o=t(41664),s=t.n(o),c=t(13114),d=t(34221),u=t(50549),p=t(72679);t(88922),a.Z=e=>{var a,t,l,o,v,g;let{data:h,media_type:m,genresMovie:f,genresTv:_,cardType:b}=e,[y,x]=(0,r.useState)(!0),[C,N]=(0,r.useState)(f),[P,k]=(0,r.useState)(_),[j,L]=(0,r.useState)(!0),[S,w]=(0,r.useState)(!1),E=new Date((null==h?void 0:h.release_date)||(null==h?void 0:h.first_air_date)).getFullYear()||(null==h?void 0:null===(a=h.release_date)||void 0===a?void 0:a.split("-")[2]),O=null==h?void 0:h.original_language,R=[];return null==h||null===(t=h.genre_ids)||void 0===t||t.map(e=>{(null==h?void 0:h.media_type)==="movie"||"movie"===m?null==C||C.map(a=>{(null==a?void 0:a.id)===e&&R.push(null==a?void 0:a.name)}):((null==h?void 0:h.media_type)==="tv"||"tv"===m)&&(null==P||P.map(a=>{(null==a?void 0:a.id)===e&&R.push(null==a?void 0:a.name)}))}),console.log({Genres:R}),(0,n.jsxs)(s(),{href:"".concat((null==h?void 0:h.media_type)==="person"?"/person?id="+(null==h?void 0:h.id):"/detail?type="+((null==h?void 0:h.media_type)||m)+"&id="+(null==h?void 0:h.id)),className:i().MovieCardSmall,"aria-label":(null==h?void 0:h.name)||"poster","data-tooltip-id":"tooltip","data-tooltip-html":"".concat((null==h?void 0:null===(l=h.title)||void 0===l?void 0:l.length)>30||(null==h?void 0:null===(o=h.name)||void 0===o?void 0:o.length)>30?(null==h?void 0:h.title)||(null==h?void 0:h.name):""),children:[(0,n.jsx)(c.M,{mode:"sync",children:(0,n.jsx)(d.E.div,{whileHover:{y:"-0.5rem"},whileTap:{y:"0.2rem"},transition:{type:"spring",stiffness:400,damping:10},children:(0,n.jsx)("div",{className:"".concat(i().img," ").concat((null==h?void 0:h.poster_path)!==null&&(null==h?void 0:h.poster_path)!==void 0?"skeleton":null),children:(0,n.jsx)("div",{children:(0,n.jsx)(p.LazyLoadImage,{src:"".concat(S?"/images/fallback_person.jpg":(null==h?void 0:h.poster_path)!==null&&(null==h?void 0:h.poster_path)!==void 0||(null==h?void 0:h.profile_path)!==null&&(null==h?void 0:h.profile_path)!==void 0||(null==h?void 0:h.still_path)!==null&&(null==h?void 0:h.still_path)!==void 0?"https://image.tmdb.org/t/p/original".replace("/original","/w185")+((null==h?void 0:h.poster_path)||(null==h?void 0:h.profile_path)||(null==h?void 0:h.still_path))||null:y?"/images/logo.svg":"/images/fallback_person.jpg"),height:"100%",width:"100%",useIntersectionObserver:!0,effect:"opacity",className:"".concat(i().img," ").concat(y?"skeleton":null),onLoad:()=>{setTimeout(()=>{x(!1),L(!1)},700)},loading:"lazy",onError:e=>{w(!0),x(!1)},alt:(null==h?void 0:h.id)||"sm"},null==h?void 0:h.id)})})})}),(0,n.jsxs)("div",{className:"".concat(i().metaData),children:[(0,n.jsx)("h1",{children:(null==h?void 0:h.title)||(null==h?void 0:h.name)||(0,n.jsx)(u.Z,{count:2})}),(0,n.jsxs)("p",{children:[(null==(g=(null==h?void 0:h.media_type)||m)?void 0:g.charAt(0).toUpperCase())+(null==g?void 0:g.slice(1)),(null==h?void 0:h.vote_average)?" • ".concat(null===(v=parseInt(null==h?void 0:h.vote_average))||void 0===v?void 0:v.toFixed(1)):null,(null==h?void 0:h.media_type)==="person"||Number.isNaN(E)?null:" • ".concat(E)," ",(null==h?void 0:h.media_type)==="person"&&(null==h?void 0:h.known_for_department)?" • ".concat(null==h?void 0:h.known_for_department):null," ",void 0!==O?" • ".concat(O.toUpperCase()):null]}),(null==h?void 0:h.genre_ids)?(null==R?void 0:R.length)>0&&(null==R?void 0:R.join(", ")):null==h?void 0:h.genres]})]},null==h?void 0:h.id)}},73445:function(e,a,t){"use strict";t.r(a),t.d(a,{default:function(){return R}});var n=t(85893),r=t(67294),l=t(2873),i=t(37481),o=t.n(i),s=t(11358),c=t.n(s),d=t(15581),u=t(20754),p=t(50549),v=t(74865),g=t.n(v),h=t(85437),m=t(54111),f=t(18357),_=t(9008),b=t.n(_),y=t(91487),x=t(53870),C=t(82237),N=t(59972),P=t.n(N),k=t(41664),j=t.n(k),L=t(13114),S=t(34221);t(88922);var w=e=>{var a,t,r;let{data:l}=e;if((null==l?void 0:l.Category)!=="XXX")return(0,n.jsx)(L.M,{mode:"sync",children:(0,n.jsx)(S.E.div,{whileHover:{y:"-0.5rem"},whileTap:{y:"0.2rem"},transition:{type:"spring",stiffness:400,damping:10},children:(0,n.jsx)("div",{className:P().MovieCardSmall,"aria-label":(null==l?void 0:l.Name)||"poster","data-tooltip-id":"tooltip","data-tooltip-html":"".concat((null==l?void 0:null===(a=l.Name)||void 0===a?void 0:a.length)>30||(null==l?void 0:null===(t=l.name)||void 0===t?void 0:t.length)>30?(null==l?void 0:l.Name)||(null==l?void 0:l.name):""),children:(0,n.jsxs)("div",{className:"".concat(P().metaData),children:[(0,n.jsx)("h1",{children:(null==l?void 0:l.Name)||(null==l?void 0:l.Name)||(0,n.jsx)(p.Z,{count:2})}),(0,n.jsxs)("p",{children:[(null==l?void 0:l.UploadedBy)?" ".concat(null==l?void 0:l.UploadedBy):null," "]}),(0,n.jsxs)("p",{children:[(null==l?void 0:l.Category)?" ".concat((null==(r=null==l?void 0:l.Category)?void 0:r.charAt(0).toUpperCase())+(null==r?void 0:r.slice(1))):null," ",(null==l?void 0:l.Type)&&(null==l?void 0:l.Type)!==(null==l?void 0:l.Category)?" • ".concat(null==l?void 0:l.Type):null," ",(null==l?void 0:l.Size)?" • ".concat(null==l?void 0:l.Size):null," "]}),(0,n.jsxs)("p",{children:[(null==l?void 0:l.DateUploaded)?" ".concat(null==l?void 0:l.DateUploaded):null," ",(null==l?void 0:l.Language)?" • ".concat(null==l?void 0:l.Language):null]}),(0,n.jsxs)("p",{children:[(null==l?void 0:l.Downloads)?(0,n.jsxs)("span",{className:P().singleRow,children:[(0,n.jsx)(x.e1i,{})," ",null==l?void 0:l.Downloads]}):null," ",(null==l?void 0:l.Seeders)?(0,n.jsxs)("span",{className:P().singleRow,children:[(0,n.jsx)(x.Jtq,{})," ",null==l?void 0:l.Seeders]}):null," "]}),(null==l?void 0:l.Magnet)&&(0,n.jsxs)("div",{className:P().cardbtns,children:[(0,n.jsx)(j(),{href:"https://webtor.io/".concat(function(e){var a,t,n;let r=new URLSearchParams(null==e?void 0:null===(a=e.split("?"))||void 0===a?void 0:a[1]),l=null==r?void 0:null===(n=r.get("xt"))||void 0===n?void 0:null===(t=n.split(":"))||void 0===t?void 0:t.pop();return l?null==l?void 0:l.toLowerCase():null}(null==l?void 0:l.Magnet)),target:"_blank",className:P().btns,"aria-label":"webtor",children:"Webtor"}),(0,n.jsx)(j(),{href:"".concat(null==l?void 0:l.Magnet),className:P().btns,"aria-label":"magnet",children:"Magnet"})]})]})},null==l?void 0:l.Magnet)})})},E=t(64712);let O=[1,2,3,4,5,6,7,8,9,10];var R=e=>{let{categoryType:a}=e,[t,i]=(0,r.useState)(""),[s,v]=(0,r.useState)([]),[_,N]=(0,r.useState)(1),[P,k]=(0,r.useState)(1),[j,L]=(0,r.useState)(!0),[S,R]=(0,r.useState)([]),[T,A]=(0,r.useState)([]),[D,I]=(0,r.useState)(!1),[M,B]=(0,r.useState)("false"),[q,Z]=(0,r.useState)("general"),[H,W]=(0,f.YD)({triggerOnce:!1}),[U,F]=(0,r.useState)({currentPage:_,query:t,categoryType:a}),J=(0,r.useRef)(null);return(0,r.useEffect)(()=>{(async()=>{try{let e=await (0,l.Z)({requestID:"genresMovie"}),a=await (0,l.Z)({requestID:"genresTv"});R(e.genres),A(a.genres)}catch(e){console.error("Error fetching genres:",e)}})(),null==J||J.current.focus();let e=e=>{"/"===e.key?(e.preventDefault(),null==J||J.current.focus()):"Escape"===e.key&&(e.preventDefault(),null==J||J.current.blur())};window.addEventListener("keydown",e);let a=(0,h.G)();return B(null==a?void 0:a.infiniteScroll),()=>{window.removeEventListener("keydown",e)}},[]),(0,r.useEffect)(()=>{let e;let n=async e=>{try{let n;if("general"===q||(null==t?void 0:t.length)===0){var a;if(e){if((n=await (0,l.Z)({requestID:"searchMulti",page:_,query:t})).page>n.total_pages&&N(n.total_pages),_>n.total_pages){N(1);return}k(n.total_pages>500?500:n.total_pages)}else n=await (0,l.Z)({requestID:"trending"}),N(1),k(1);"true"===M&&U.currentPage!==_?v(e=>{var a;return[...e||[],...(null==n?void 0:null===(a=n.results)||void 0===a?void 0:a.filter(e=>(null==e?void 0:e.media_type)!=="person"||(null==e?void 0:e.profile_path)!==null))||[]]}):v(null==n?void 0:null===(a=n.results)||void 0===a?void 0:a.filter(e=>(null==e?void 0:e.media_type)!=="person"||(null==e?void 0:e.profile_path)!==null))}else"ai"===q&&(null==t?void 0:t.length)>1?(n=await (0,l.Z)({requestID:"aiRecommendation",page:_,query:t}),v(n),N(1),k(1)):"torrent"===q&&(null==t?void 0:t.length)>1&&((null==(n=await (0,l.Z)({requestID:"TorrentSearch",page:_,query:t}))?void 0:n.error)?(v([]),E.Am.error(null==n?void 0:n.error)):v(n),k(_))}catch(e){console.error("Error fetching data:",e)}finally{L(!1)}};return(null==t?void 0:t.length)>1&&""!=_&&"0"!=_&&(L(!0),clearTimeout(e),e=setTimeout(()=>{t.length>=2&&n(!0)},600),F({currentPage:_,query:t,categoryType:a})),(null==t?void 0:t.length)===0&&(L(!0),n(!1),F({currentPage:_,query:t,categoryType:a})),()=>clearTimeout(e)},[t,_,q]),(0,r.useEffect)(()=>{j?g().start():g().done(!1)},[j]),(0,r.useEffect)(()=>{N(1)},[t,q]),(0,r.useEffect)(()=>{W&&_+1<=P&&N(_+1)},[W]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(b(),{children:(0,n.jsx)("title",{children:"Rive | Search "})}),(0,n.jsxs)("div",{className:o().MoviePage,children:[(0,n.jsxs)("div",{className:o().InputWrapper,children:[(0,n.jsx)("input",{ref:J,type:"text",className:o().searchInput,value:t,onChange:e=>i(e.target.value),placeholder:"Please enter at least 2 characters to search...",onFocus:()=>I(!0),onBlur:()=>I(!1)}),(0,n.jsx)("div",{className:o().inputShortcut,children:D?(0,n.jsx)("span",{className:"tooltip-btn",children:"Esc"}):(0,n.jsx)("span",{className:"tooltip-btn",children:"/"})}),"torrent"===q&&(null==t?void 0:t.length)>1&&(0,n.jsx)("input",{type:"text",className:"".concat(o().searchInput," ").concat(o().pageInput),value:_,onChange:e=>N(e.target.value),placeholder:"Page (Optional)"})]}),(0,n.jsxs)("div",{className:o().searchModeWrapper,children:[(0,n.jsxs)("div",{className:"".concat(o().searchOption," ").concat("general"===q?o().btnActive:o().btnInactive),"data-tooltip-id":"tooltip","data-tooltip-html":"
r-1&&console.warn("(react-paginate): The initialPage prop provided is greater than the maximum page index from pageCount prop (".concat(a," > ").concat(r-1,").")),void 0!==l&&l>r-1&&console.warn("(react-paginate): The forcePage prop provided is greater than the maximum page index from pageCount prop (".concat(l," > ").concat(r-1,")."))}},{key:"componentDidUpdate",value:function(e){void 0!==this.props.forcePage&&this.props.forcePage!==e.forcePage&&(this.props.forcePage>this.props.pageCount-1&&console.warn("(react-paginate): The forcePage prop provided is greater than the maximum page index from pageCount prop (".concat(this.props.forcePage," > ").concat(this.props.pageCount-1,").")),this.setState({selected:this.props.forcePage})),Number.isInteger(e.pageCount)&&!Number.isInteger(this.props.pageCount)&&console.warn("(react-paginate): The pageCount prop value provided is not an integer (".concat(this.props.pageCount,"). Did you forget a Math.ceil()?"))}},{key:"getForwardJump",value:function(){var e=this.state.selected,a=this.props,t=a.pageCount,n=e+a.pageRangeDisplayed;return n>=t?t-1:n}},{key:"getBackwardJump",value:function(){var e=this.state.selected-this.props.pageRangeDisplayed;return e<0?0:e}},{key:"getElementHref",value:function(e){var a=this.props,t=a.hrefBuilder,n=a.pageCount,r=a.hrefAllControls;if(t)return r||e>=0&&e