1function _typeof(obj){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_typeof(obj)}function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}function _iterableToArray(iter){if(typeof Symbol!=="undefined"&&iter[Symbol.iterator]!=null||iter["@@iterator"]!=null)return Array.from(iter)}function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr)}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,_toPropertyKey(descriptor.key),descriptor)}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return _typeof(key)==="symbol"?key:String(key)}function _toPrimitive(input,hint){if(_typeof(input)!=="object"||input===null)return input;var prim=input[Symbol.toPrimitive];if(prim!==undefined){var res=prim.call(input,hint||"default");if(_typeof(res)!=="object")return res;throw new TypeError("@@toPrimitive must return a primitive value.");}return(hint==="string"?String:Number)(input)}var WP_DOUBAN=function(){function WP_DOUBAN(){_classCallCheck(this,WP_DOUBAN);this.ver="1.0.5";this.type="movie";this.status="done";this.finished=false;this.paged=1;this.genre_list=[];this.genre=[];this.subjects=[];this._create()}_createClass(WP_DOUBAN,[{key:"on",value:function on(t,e,n){var a=document.querySelectorAll(e);a.forEach(function(item){item.addEventListener(t,n)})}},{key:"_addSearchParams",value:function _addSearchParams(url){var params=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};url=new URL(url);var new_url=new URL("".concat(url.origin).concat(url.pathname,"?").concat(new URLSearchParams([].concat(_toConsumableArray(Array.from(url.searchParams.entries())),_toConsumableArray(Object.entries(params))))));return new_url.href}},{key:"_fetchGenres",value:function _fetchGenres(){var _this=this;document.querySelector(".db--genres").innerHTML="";var url=wpd_base.token?"https://node.wpista.com/v1/outer/genres?token="+wpd_base.token:wpd_base.api+"v1/movie/genres";
1fetch(this._addSearchParams(url,{type:this.type})).then(function(response){return response.json()}).then(function(data){var t=wpd_base.token?data.data:data;if(t.length){_this.genre_list=t;_this._renderGenre()}});return true}},{key:"_statusChange",value:function _statusChange(){var _this2=this;this.on("click",".db--typeItem",function(t){var self=t.currentTarget;if(self.classList.contains("is-active")){return}document.querySelector(".db--list").innerHTML="";document.querySelector(".lds-ripple").classList.remove("u-hide");document.querySelector(".db--typeItem.is-active").classList.remove("is-active");self.classList.add("is-active");_this2.status=self.dataset.status;_this2.paged=1;_this2.finished=false;_this2.subjects=[];_this2._fetchData();return})}},{key:"_handleGenreClick",value:function _handleGenreClick(){var _this3=this;this.on("click",".db--genreItem",function(t){var self=t.currentTarget;if(self.classList.contains("is-active")){var index=_this3.genre.indexOf(self.innerText);self.classList.remove("is-active");_this3.genre.splice(index,1);_this3.paged=1;_this3.finished=false;_this3.subjects=[];_this3._fetchData();return}document.querySelector(".db--list").innerHTML="";document.querySelector(".lds-ripple").classList.remove("u-hide");self.classList.add("is-active");_this3.genre.push(self.innerText);_this3.paged=1;_this3.finished=false;_this3.subjects=[];_this3._fetchData();return})}},{key:"_renderGenre",value:function _renderGenre(){var _this4=this;document.querySelector(".db--genres").innerHTML=this.genre_list.map(function(item){return"<span class=\"db--genreItem".concat(_this4.genre_list.includes(item.name)?" is-active":"","\">").concat(item.name,"</span>")}).join("");this._handleGenreClick()}},{key:"_fetchData",value:function _fetchData(){var _this5=this;var url=wpd_base.token?"https://node.wpista.com/v1/outer/faves":wpd_base.api+"v1/movies";fetch(this._addSearchParams(url,{token:wpd_base.token,type:this.t
1ype,paged:this.paged,genre:JSON.stringify(this.genre),status:this.status})).then(function(response){return response.json()}).then(function(data){var t=wpd_base.token?data.data:data;if(t.length){if(document.querySelector(".db--list").classList.contains("db--list__card")){_this5.subjects=[].concat(_toConsumableArray(_this5.subjects),_toConsumableArray(t));_this5._randerDateTemplate()}else{_this5.subjects=[].concat(_toConsumableArray(_this5.subjects),_toConsumableArray(t));_this5._randerListTemplate()}document.querySelector(".lds-ripple").classList.add("u-hide")}else{document.querySelector(".db--list").classList.contains("db--list__card")?_this5._randerDateTemplate():_this5._randerListTemplate();_this5.finished=true;document.querySelector(".lds-ripple").classList.add("u-hide")}})}},{key:"_randerDateTemplate",value:function _randerDateTemplate(){if(!this.subjects.length)return document.querySelector(".db--list").innerHTML="<div class=\"db--empty\"></div>";var result=this.subjects.reduce(function(result,item){var date=new Date(item.create_time);var year=date.getFullYear();var month=date.getMonth()+1;var key="".concat(year,"-").concat(month.toString().padStart(2,"0"));if(Object.prototype.hasOwnProperty.call(result,key)){result[key].push(item)}else{result[key]=[item]}return result},{});var html="";for(var key in result){var date=key.split("-");html+="<div class=\"db--listBydate\"><div class=\"db--titleDate JiEun\"><div class=\"db--titleDate__day\">".concat(date[1],"</div><div class=\"db--titleDate__month\">").concat(date[0],"</div></div><div class=\"db--dateList__card\">");html+=result[key].map(function(movie){return"<div class=\"db--item\">".concat(movie.is_top250?'<span class="top250">Top 250</span>':"","<img src=\"").concat(movie.poster,"\" referrerpolicy=\"unsafe-url\" class=\"db--image\"><div class=\"db--score JiEun\">").concat(movie.douban_score>0?'<svg width="12" height="12" viewBox="0 0 24 24" fill="currentColor" ><path d="M12 20.1l5.82 3.682c1.066.675 2.37-.322 2.09-1.584l-1.543-6.926 5.146-4.667c.94-.85.435-2.465-.799-2.567l-6.773-.602L13.29.89a1.38 1.38 0 0 0-2.581 0l-2.65 6.53-6.774.602C.052 8.126-.453 9.74.486 10.59l5.147 4.666-1.542 6.926c-.28 1.262 1.023 2.26 2.09 1.585L12 20.099z"></path></svg>'+movie.douban_score:"").concat(movie.year>0?" · "+movie.year:"","</div><div class=\"db--title\"><a href=\"").concat(movie.link,"\" target=\"_blank\">").concat(movie.name,"</a></div>\n \n </div>")}).join("");html+="</div></div>"}document.querySelector(".db--list").innerHTML=html}},{key:"_randerListTemplate",value:function _randerListTemplate(){if(!this.subjects.length)return document.querySelector(".db--list").innerHTML="<div class=\"db--empty\"></div>";document.querySelector(".db--list").innerHTML=this.subjects.map(function(item){return"<div class=\"db--item\">".concat(item.is_top250?'<span class="top250">Top 250</span>':"","<img src=\"").concat(item.poster,"\" referrerpolicy=\"unsafe-url\" class=\"db--image\"><div class=\"ipc-signpost JiEun\">").concat(item.create_time,"</div><div class=\"db--score JiEun\">").concat(item.douban_score>0?'<svg width="12" height="12" viewBox="0 0 24 24" fill="currentColor" ><path d="M12 20.1l5.82 3.682c1.066.675 2.37-.322 2.09-1.584l-1.543-6.926 5.146-4.667c.94-.85.435-2.465-.799-2.567l-6.773-.602L13.29.89a1.38 1.38 0 0 0-2.581 0l-2.65 6.53-6.774.602C.052 8.126-.453 9.74.486 10.59l5.147 4.666-1.542 6.926c-.28 1.262 1.023 2.26 2.09 1.585L12 20.099z"></path></svg>'+item.douban_score:"").concat(item.year>0?" · "+item.year:"","</div><div class=\"db--title\"><a href=\"").concat(item.link,"\" target=\"_blank\">").concat(item.name,"</a></div>\n </div>\n </div>")}).join("")}},{key:"_handleScroll",value:function _handleScroll(){var _this6=this;window.addEventListener("scroll",function(){var t=window.scrollY||window.pageYOffset;if(document.querySelector(".block-more").offsetTop+ -window.innerHeight<t&&document.querySelector(".lds-ripple").classList.contains("u-hide")&&!_this6.finished){document.querySelector(".lds-ripple").classList.remove("u-hide");_this6.paged++;_this6._fetchData()}})}},{key:"_handleNavClick",value:function _handleNavClick(){var _this7=this;this.on("click",".db--navItem",function(t){if(t.target.classList.contains("current"))return;_this7.genre=[];_this7.type=t.target.dataset.type;if(_this7.type!="book"){_this7._fetchGenres();document.querySelector(".db--genres").classList.remove("u-hide")}else{document.querySelector(".db--genres").classList.add("u-hide")}document.querySelector(".db--list").innerHTML="";document.querySelector(".lds-ripple").classList.remove("u-hide");document.querySelector(".db--navItem.current").classList.remove("current");var self=t.target;self.classList.add("current");_this7.paged=1;_this7.finished=false;_this7.subjects=[];_this7._fetchData()})}},{key:"_create",value:function _create(){var _this8=this;
1if(document.querySelector(".db--container")){if(document.querySelector(".db--navItem.current")){this.type=document.querySelector(".db--navItem.current").dataset.type}if(document.querySelector(".db--list").dataset.type)this.type=document.querySelector(".db--list").dataset.type;if(this.type=="movie"){document.querySelector(".db--genres").classList.remove("u-hide")}this._fetchGenres();this._fetchData();this._handleScroll();this._handleNavClick();this._statusChange()}if(document.querySelector(".db--collection")){document.querySelectorAll(".db--collection").forEach(function(item){_this8._fetchCollection(item)})}}},{key:"_fetchCollection",value:function _fetchCollection(item){var type=item.dataset.style?item.dataset.style:"card";var url=wpd_base.token?"https://node.wpista.com/v1/outer/faves?token="+wpd_base.token:wpd_base.api+"v1/movies";fetch(this._addSearchParams(url,{type:this.type,paged:1,start_time:item.dataset.start,end_time:item.dataset.end,status:item.dataset.status})).then(function(response){return response.json()}).then(function(data){var t=wpd_base.token?data.data:data;if(t.length){if(type=="card"){item.innerHTML+=t.map(function(movie){return"<div class=\"doulist-item\">\n <div class=\"doulist-subject\">\n <div class=\"db--viewTime JiEun\">Marked ".concat(movie.create_time,"</div>\n <div class=\"doulist-post\"><img referrerpolicy=\"unsafe-url\" src=\"").concat(movie.poster,"\"></div><div class=\"doulist-content\"><div class=\"doulist-title\"><a href=\"").concat(movie.link,"\" class=\"cute\" target=\"_blank\" rel=\"external nofollow\">").concat(movie.name,"</a></div><div class=\"rating\"><span class=\"allstardark\"><span class=\"allstarlight\" style=\"width:75%\"></span></span><span class=\"rating_nums\">").concat(movie.douban_score,"</span></div><div class=\"abstract\">").concat(movie.remark||movie.card_subtitle,"</div></div></div></div>")}).join("")}else{var result=t.reduce(function(result,item){if(Object.prototype.hasOwnProperty.call(result,item.create_time)){result[item.create_time].push(item)}else{result[item.create_time]=[item]}return result},{});var html="";for(var key in result){html+="<div class=\"db--date\">".concat(key,"</div><div class=\"db--dateList\">");html+=result[key].map(function(movie){return"<div class=\"db--card__list\"\">\n <img referrerpolicy=\"unsafe-url\" src=\"".concat(movie.poster,"\">\n <div>\n <div class=\"title\"><a href=\"").concat(movie.link,"\" class=\"cute\" target=\"_blank\" rel=\"external nofollow\">").concat(movie.name,"</a></div>\n <div class=\"rating\"><span class=\"allstardark\"><span class=\"allstarlight\" style=\"width:75%\"></span></span><span class=\"rating_nums\">").concat(movie.douban_score,"</span></div>\n ").concat(movie.remark||movie.card_subtitle,"\n </div>\n </div>")}).join("");html+="</div>"}item.innerHTML=html}}})}}]);return WP_DOUBAN}();new WP_DOUBAN();
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.