Warning: fopen(/www/sites/update.greasyfork.icu/index/store/forever/173a167eab31334800ce051a132192b6.js): failed to open stream: No space left on device in /www/sites/update.greasyfork.icu/index/scriptControl.php on line 65
// ==UserScript== // @name bilibili-app-recommend // @namespace https://magicdawn.fun // @version 0.6.0 // @author magicdawn // @description 为B站首页添加像App一样的推荐 // @license MIT // @homepageURL https://github.com/magicdawn/bilibili-app-recommend // @supportURL https://github.com/magicdawn/bilibili-app-recommend/issues // @match *://www.bilibili.com/ // @match *://www.bilibili.com/?* // @match https://www.mcbbs.net/template/mcbbs/image/special_photo_bg.png // @match https://www.mcbbs.net/template/mcbbs/image/special_photo_bg.png?* // @require https://unpkg.com/axios@0.27.2/dist/axios.min.js // @require https://unpkg.com/axios-userscript-adapter@0.2.0/dist/axiosGmxhrAdapter.min.js // @require https://unpkg.com/react@18.2.0/umd/react.production.min.js // @require https://unpkg.com/react-dom@18.2.0/umd/react-dom.production.min.js // @connect app.bilibili.com // @connect passport.bilibili.com // @connect link.acg.tv // @connect www.mcbbs.net // @grant GM.xmlHttpRequest // @grant GM_deleteValue // @grant GM_getValue // @grant GM_setValue // @grant GM_xmlhttpRequest // @grant unsafeWindow // @downloadURL none // ==/UserScript== (i=>{const e=document.createElement("style");e.dataset.source="vite-plugin-monkey",e.innerText=i,document.head.appendChild(e)})(`.primary-btn[disabled]:active,.primary-btn[disabled]:hover{cursor:wait;background-color:inherit}._toast-container_9119l_1{position:fixed;top:50%;left:50%;z-index:999999;padding:12px 24px;font-size:14px;width:240px;margin-left:-120px;background:#ffb243;color:#fff;border-radius:6px}._modal-mask_vh629_1{position:fixed;left:0;top:0;right:0;bottom:0;background-color:#00000080;z-index:11003;display:flex;align-items:center;justify-content:center}._modal_vh629_1{width:500px;max-height:calc(80vh - 50px);border-radius:10px;overflow:hidden;background-color:#fff;padding:0 15px 15px;display:flex;flex-direction:column}._modal_vh629_1 ._modal-header_vh629_23{padding-top:10px;padding-bottom:10px;border-bottom:none;display:flex;align-items:center}._modal_vh629_1 ._modal-header_vh629_23 ._modal-title_vh629_30{font-size:1.5rem;margin-bottom:0;line-height:1.5}._modal_vh629_1 ._modal-header_vh629_23 ._title-desc_vh629_35{margin-left:5px;font-size:40%}._modal_vh629_1 ._modal-header_vh629_23 ._btn-close_vh629_39{margin-left:10px}._modal_vh629_1 ._modal-header_vh629_23 ._btn-close_vh629_39 svg{width:10px;height:10px;margin-right:3px;margin-top:-1px}body.dark ._modal_vh629_1 ._modal-header_vh629_23 ._btn-close_vh629_39{color:#eee!important;background-color:#333!important;border-color:transparent!important;height:auto;padding:8px 12px;line-height:16px;font-size:13px}._modal_vh629_1 ._modal-body_vh629_57{padding-top:0;flex-grow:1;overflow-y:scroll}._reason-list_vh629_62{display:flex;align-items:center;flex-wrap:wrap;justify-content:space-between}._reason_vh629_62{color:inherit;width:45%;text-align:center;line-height:20px;border:1px solid #eee;margin-top:8px;margin-bottom:8px;padding-top:5px;padding-bottom:5px}body.dark ._reason_vh629_62{border:1px solid #333}._bili-video-card_1a93a_1{position:relative}._image-wrapper_1a93a_4{border-radius:6px;overflow:hidden}._preview-card-wrapper_1a93a_8{position:absolute;top:0;left:0;right:0;bottom:0;z-index:2;overflow:hidden;border-top-left-radius:inherit;border-top-right-radius:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0}._preview-card-wrapper_1a93a_8 ._preview-card-inner_1a93a_21{width:100%;height:100%}._watch-later_1a93a_25{z-index:3}._badge_1a93a_28{color:#fa6a9d;border-radius:2px;border:1px #fa6a9d solid;line-height:20px;padding:0 10px;transform:scale(.8)}._recommend-reason_1a93a_36{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;display:inline-block;color:var(--Or5);background-color:var(--Or1);border-radius:4px;margin-right:4px;font-size:var(--follow-icon-font-size);line-height:var(--follow-icon-line-height);height:var(--follow-icon-line-height);padding:0 4px;cursor:default}._bangumi-desc_1a93a_51{color:default}._btn-dislike_1a93a_54{display:flex;align-items:center;justify-content:center;position:absolute;top:8px;left:8px;width:28px;height:28px;border-radius:6px;cursor:pointer;background-color:#212121cc;z-index:9;transform:translateZ(0)}._btn-dislike_1a93a_54 ._btn-dislike-icon_1a93a_69{pointer-events:none;user-select:none;width:12px;height:12px;color:#fff}._btn-dislike_1a93a_54 ._btn-dislike-tip_1a93a_76{pointer-events:none;user-select:none;position:absolute;bottom:-6px;left:-5px;transform:translateY(100%);font-size:12px;color:#fff;border-radius:4px;line-height:18px;padding:4px 8px;background-color:#000c;white-space:nowrap}._disliked-wrapper_1a93a_91{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;flex-direction:column;border-radius:6px;border:1px solid #eee}body.dark ._disliked-wrapper_1a93a_91{border:1px solid #333}._disliked-wrapper_1a93a_91 ._dislike-content-cover_1a93a_105{border-top-left-radius:6px;border-top-right-radius:6px;padding-top:56.25%;position:relative}._disliked-wrapper_1a93a_91 ._dislike-content-cover_1a93a_105 ._dislike-content-cover-inner_1a93a_111{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center}._disliked-wrapper_1a93a_91 ._dislike-content-cover_1a93a_105 ._dislike-content-cover-inner_1a93a_111 ._dislike-icon_1a93a_122{margin-bottom:5px}._disliked-wrapper_1a93a_91 ._dislike-content-cover_1a93a_105 ._dislike-content-cover-inner_1a93a_111 ._dislike-reason_1a93a_125{font-size:20px;text-align:center}._disliked-wrapper_1a93a_91 ._dislike-content-cover_1a93a_105 ._dislike-content-cover-inner_1a93a_111 ._dislike-desc_1a93a_129{font-size:16px;text-align:center}._disliked-wrapper_1a93a_91 ._dislike-content-action_1a93a_133{flex:1;width:100%;border-top:1px solid #eee;display:flex;align-items:center;justify-content:center}body.dark ._disliked-wrapper_1a93a_91 ._dislike-content-action_1a93a_133{border-top:1px solid #333}._disliked-wrapper_1a93a_91 ._dislike-content-action_1a93a_133 button{font-size:16px;color:inherit;display:flex;align-items:center}._video-grid_14t5i_9{display:grid;position:relative;width:100%;grid-gap:20px 12px}@media (max-width: 1099.9px){._video-grid_14t5i_9{grid-template-columns:repeat(4,1fr)}._video-grid_14t5i_9._limit-two-lines_14t5i_19>*:nth-of-type(1n + 9){display:none!important}}@media (min-width: 1100px) and (max-width: 1700.9px){._video-grid_14t5i_9{grid-template-columns:repeat(5,1fr)}._video-grid_14t5i_9._limit-two-lines_14t5i_19>*:nth-of-type(1n + 11){display:none!important}}@media (min-width: 1701px){._video-grid_14t5i_9{grid-template-columns:repeat(6,1fr)}._video-grid_14t5i_9._limit-two-lines_14t5i_19>*:nth-of-type(1n + 13){display:none!important}}._video-grid_14t5i_9._internal-testing_14t5i_43{grid-gap:20px 20px}@media (max-width: 1399.9px){._video-grid_14t5i_9._internal-testing_14t5i_43{grid-template-columns:repeat(4,1fr)}._video-grid_14t5i_9._internal-testing_14t5i_43._limit-one-line_14t5i_50>*:nth-of-type(1n + 5){display:none!important}._video-grid_14t5i_9._internal-testing_14t5i_43._limit-two-lines_14t5i_19>*:nth-of-type(1n + 9){display:none!important}}@media (min-width: 1400px){._video-grid_14t5i_9._internal-testing_14t5i_43{grid-template-columns:repeat(5,1fr)}._video-grid_14t5i_9._internal-testing_14t5i_43._limit-one-line_14t5i_50>*:nth-of-type(1n + 6){display:none!important}._video-grid_14t5i_9._internal-testing_14t5i_43._limit-two-lines_14t5i_19>*:nth-of-type(1n + 11){display:none!important}}._narrow-mode_14t5i_71{grid-template-columns:repeat(2,1fr)!important}._checkbox_5cp8u_1{margin-top:1px;cursor:pointer;outline:none}._checkbox_5cp8u_1+label{margin-left:2px;user-select:none;cursor:pointer}._modal-mask_3m0r6_1{position:fixed;left:0;top:0;right:0;bottom:0;background-color:#00000080;z-index:11003;display:flex;align-items:center;justify-content:center}._modal_3m0r6_1{width:500px;max-height:calc(80vh - 50px);border-radius:10px;overflow:hidden;background-color:#fff;padding:0 15px 15px;display:flex;flex-direction:column}._modal_3m0r6_1 ._modal-header_3m0r6_23{padding-top:10px;padding-bottom:10px;border-bottom:none;display:flex;align-items:center}._modal_3m0r6_1 ._modal-header_3m0r6_23 ._modal-title_3m0r6_30{font-size:1.5rem;margin-bottom:0;line-height:1.5;display:flex;align-items:center}._modal_3m0r6_1 ._modal-header_3m0r6_23 ._modal-title_3m0r6_30 ._config-icon_3m0r6_37{line-height:1;margin-right:5px;font-size:0}._modal_3m0r6_1 ._modal-header_3m0r6_23 ._btn-close_3m0r6_42{margin-left:10px}._modal_3m0r6_1 ._modal-header_3m0r6_23 ._btn-close_3m0r6_42 svg{width:10px;height:10px;margin-right:3px;margin-top:-1px}body.dark ._modal_3m0r6_1 ._modal-header_3m0r6_23 ._btn-close_3m0r6_42{color:#eee!important;background-color:#333!important;border-color:transparent!important;height:auto;padding:8px 12px;line-height:16px;font-size:13px}._modal_3m0r6_1 ._modal-body_3m0r6_60{padding-top:0;flex-grow:1;overflow-y:scroll}._settings-group_3m0r6_65{margin-bottom:10px}._settings-group_3m0r6_65 ._settings-group-title_3m0r6_68{font-size:2em}._settings-group_3m0r6_65 ._settings-group-content_3m0r6_71{color:default}._settings-group_3m0r6_65 ._settings-group-content_3m0r6_71 button:first-child{margin-left:0}._row_3m0r6_77{display:flex;align-items:center}._check_3m0r6_81{margin-left:20px}._check_3m0r6_81:first-child{margin-left:0}._expand-btn_wdzp9_1{padding:0;width:31px;height:31px;border-radius:50%}._expand-btn_wdzp9_1 svg{width:13px;height:13px;transform:rotate(180deg)}._expand-btn_wdzp9_1 svg._expanded_wdzp9_12{transform:rotate(0)}body.dark ._expand-btn_wdzp9_1{color:#eee!important;border-color:transparent!important;background-color:#333!important}body.dark ._expand-btn_wdzp9_1:hover{background-color:#555!important}._modal-mask_1f28q_1{position:fixed;left:0;top:0;right:0;bottom:0;z-index:11000;background-color:#00000080;display:flex;align-items:center;justify-content:center}._modal-mask_1f28q_1._narrow-mode_1f28q_13{background-color:#000000e6}._modal_1f28q_1{width:calc(100vw - 30px);height:calc(100vh - 30px);border-radius:10px;overflow:hidden;background-color:#fff;padding:0 0 15px 15px;display:flex;flex-direction:column}body.dark ._modal_1f28q_1{border:1px solid #fb7299}._modal_1f28q_1._narrow-mode_1f28q_13{width:606px;height:calc(100vh - 10px);border:none}body.dark ._modal_1f28q_1._narrow-mode_1f28q_13{border:none}._modal_1f28q_1 ._modal-header_1f28q_38{padding-top:10px;padding-bottom:10px;border-bottom:none;padding-right:15px;display:flex;align-items:center}._modal_1f28q_1 ._modal-header_1f28q_38 ._modal-title_1f28q_46{font-size:1.5rem;margin-bottom:0;line-height:1.5}body.dark ._modal_1f28q_1 ._modal-header_1f28q_38 ._btn-refresh_1f28q_51,body.dark ._modal_1f28q_1 ._modal-header_1f28q_38 ._btn-close_1f28q_52{color:#eee!important;background-color:#333!important;border-color:transparent!important;height:auto;padding:8px 12px;line-height:16px;font-size:13px}._modal_1f28q_1 ._modal-header_1f28q_38 ._btn-close_1f28q_52{margin-left:10px}._modal_1f28q_1 ._modal-header_1f28q_38 ._btn-close_1f28q_52 svg{width:10px;height:10px}._modal_1f28q_1 ._modal-body_1f28q_68{padding-top:0;flex-grow:1;overflow-y:scroll;padding-right:15px} `); var Eg=Object.defineProperty;var xg=(y,me,De)=>me in y?Eg(y,me,{enumerable:!0,configurable:!0,writable:!0,value:De}):y[me]=De;var gr=(y,me,De)=>(xg(y,typeof me!="symbol"?me+"":me,De),De);(function(y,me,De,Jo){"use strict";const St=e=>e&&typeof e=="object"&&"default"in e?e:{default:e};function Zo(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const Ce=St(y),Vn=Zo(y),Qo=St(me),yr=St(De),qo=St(Jo);var ea=typeof global=="object"&&global&&global.Object===Object&&global;const Xn=ea;var ta=typeof self=="object"&&self&&self.Object===Object&&self,ra=Xn||ta||Function("return this")();const ge=ra;var na=ge.Symbol;const ye=na;var Jn=Object.prototype,ia=Jn.hasOwnProperty,sa=Jn.toString,et=ye?ye.toStringTag:void 0;function oa(e){var t=ia.call(e,et),r=e[et];try{e[et]=void 0;var n=!0}catch{}var i=sa.call(e);return n&&(t?e[et]=r:delete e[et]),i}var aa=Object.prototype,ca=aa.toString;function la(e){return ca.call(e)}var ua="[object Null]",fa="[object Undefined]",Zn=ye?ye.toStringTag:void 0;function He(e){return e==null?e===void 0?fa:ua:Zn&&Zn in Object(e)?oa(e):la(e)}function Ue(e){return e!=null&&typeof e=="object"}var da="[object Symbol]";function Ct(e){return typeof e=="symbol"||Ue(e)&&He(e)==da}function ha(e,t){for(var r=-1,n=e==null?0:e.length,i=Array(n);++r0){if(++t>=Ya)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Ja(e){return function(){return e}}var Za=function(){try{var e=$e(Object,"defineProperty");return e({},"",{}),e}catch{}}();const Tt=Za;var Qa=Tt?function(e,t){return Tt(e,"toString",{configurable:!0,enumerable:!1,value:Ja(t),writable:!0})}:xa,qa=Xa(Qa);const ec=qa;var tc=9007199254740991,rc=/^(?:0|[1-9]\d*)$/;function Sr(e,t){var r=typeof e;return t=t==null?tc:t,!!t&&(r=="number"||r!="symbol"&&rc.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=cc}function lc(e){return e!=null&&Tr(e.length)&&!ni(e)}var uc=Object.prototype;function fc(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||uc;return e===r}function dc(e,t){for(var r=-1,n=Array(e);++r-1}function Al(e,t){var r=this.__data__,n=Et(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function Ee(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t0&&r(c)?t>1?vi(c,t-1,r,n,i):gi(i,c):n||(i[i.length]=c)}return i}function Gl(e){var t=e==null?0:e.length;return t?vi(e,1):[]}function Yl(e){return ec(ac(e,void 0,Gl),e+"")}var Kl="Expected a function";function Vl(e,t){var r;if(typeof t!="function")throw new TypeError(Kl);return e=ri(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=void 0),r}}function Xl(e,t,r){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),r=r>i?i:r,r<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var s=Array(i);++n=n?e:Xl(e,t,r)}var Zl="\\ud800-\\udfff",Ql="\\u0300-\\u036f",ql="\\ufe20-\\ufe2f",eu="\\u20d0-\\u20ff",tu=Ql+ql+eu,ru="\\ufe0e\\ufe0f",nu="\\u200d",iu=RegExp("["+nu+Zl+tu+ru+"]");function Mr(e){return iu.test(e)}function su(e){return e.split("")}var bi="\\ud800-\\udfff",ou="\\u0300-\\u036f",au="\\ufe20-\\ufe2f",cu="\\u20d0-\\u20ff",lu=ou+au+cu,uu="\\ufe0e\\ufe0f",fu="["+bi+"]",Pr="["+lu+"]",Rr="\\ud83c[\\udffb-\\udfff]",du="(?:"+Pr+"|"+Rr+")",_i="[^"+bi+"]",wi="(?:\\ud83c[\\udde6-\\uddff]){2}",Si="[\\ud800-\\udbff][\\udc00-\\udfff]",hu="\\u200d",Ci=du+"?",Ti="["+uu+"]?",pu="(?:"+hu+"(?:"+[_i,wi,Si].join("|")+")"+Ti+Ci+")*",mu=Ti+Ci+pu,gu="(?:"+[_i+Pr+"?",Pr,wi,Si,fu].join("|")+")",yu=RegExp(Rr+"(?="+Rr+")|"+gu+mu,"g");function vu(e){return e.match(yu)||[]}function bu(e){return Mr(e)?vu(e):su(e)}function _u(){this.__data__=new Ee,this.size=0}function wu(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function Su(e){return this.__data__.get(e)}function Cu(e){return this.__data__.has(e)}var Tu=200;function Eu(e,t){var r=this.__data__;if(r instanceof Ee){var n=r.__data__;if(!nt||n.lengthc))return!1;var a=s.get(e),u=s.get(t);if(a&&u)return a==t&&u==e;var d=-1,h=!0,v=r&Xu?new Ot:void 0;for(s.set(e,t),s.set(t,e);++d=t||A<0||d&&E>=s}function T(){var S=$r();if(b(S))return D(S);c=setTimeout(T,_(S))}function D(S){return c=void 0,h&&n?v(S):(n=i=void 0,o)}function L(){c!==void 0&&clearTimeout(c),a=0,n=l=i=c=void 0}function k(){return c===void 0?o:D($r())}function C(){var S=$r(),A=b(S);if(n=arguments,i=this,l=S,A){if(c===void 0)return g(l);if(d)return clearTimeout(c),c=setTimeout(T,t),v(l)}return c===void 0&&(c=setTimeout(T,t)),o}return C.cancel=L,C.flush=k,C}function Of(e,t){return ji(e,t)}function kf(e,t,r,n){if(!Oe(e))return e;t=At(t,e);for(var i=-1,s=t.length,o=s-1,c=e;c!=null&&++iRf)return r;do t%2&&(r+=e),t=Lf(t/2),t&&(e+=e);while(t);return r}var Nf=Cf("length");const Df=Nf;var Bi="\\ud800-\\udfff",Ff="\\u0300-\\u036f",$f="\\ufe20-\\ufe2f",If="\\u20d0-\\u20ff",jf=Ff+$f+If,zf="\\ufe0e\\ufe0f",Wf="["+Bi+"]",Ir="["+jf+"]",jr="\\ud83c[\\udffb-\\udfff]",Bf="(?:"+Ir+"|"+jr+")",Hi="[^"+Bi+"]",Ui="(?:\\ud83c[\\udde6-\\uddff]){2}",Gi="[\\ud800-\\udbff][\\udc00-\\udfff]",Hf="\\u200d",Yi=Bf+"?",Ki="["+zf+"]?",Uf="(?:"+Hf+"(?:"+[Hi,Ui,Gi].join("|")+")"+Ki+Yi+")*",Gf=Ki+Yi+Uf,Yf="(?:"+[Hi+Ir+"?",Ir,Ui,Gi,Wf].join("|")+")",Vi=RegExp(jr+"(?="+jr+")|"+Yf+Gf,"g");function Kf(e){for(var t=Vi.lastIndex=0;Vi.test(e);)++t;return t}function Xi(e){return Mr(e)?Kf(e):Df(e)}var Vf=Math.ceil;function Xf(e,t){t=t===void 0?" ":vr(t);var r=t.length;if(r<2)return r?Wi(t,e):t;var n=Wi(t,Vf(e/Xi(t)));return Mr(t)?Jl(bu(n),0,e).join(""):n.slice(0,e)}function Jf(e,t,r){e=mi(e),t=ri(t);var n=t?Xi(e):0;return t&&nnew Proxy(e,t);const Br=Object.getPrototypeOf,Hr=new WeakMap,Zi=e=>e&&(Hr.has(e)?Hr.get(e):Br(e)===Object.prototype||Br(e)===Array.prototype),Qi=e=>typeof e=="object"&&e!==null,qi=new WeakMap,es=e=>e[Wr]||e,ts=(e,t,r)=>{if(!Zi(e))return e;const n=es(e),i=(o=>Object.isFrozen(o)||Object.values(Object.getOwnPropertyDescriptors(o)).some(c=>!c.writable))(n);let s=r&&r.get(n);return s&&s[1].f===i||(s=((o,c)=>{const l={f:c};let a=!1;const u=(h,v)=>{if(!a){let g=l.a.get(o);g||(g=new Set,l.a.set(o,g)),v&&g.has(zr)||g.add(h)}},d={get:(h,v)=>v===Wr?o:(u(v),ts(h[v],l.a,l.c)),has:(h,v)=>v===td?(a=!0,l.a.delete(o),!0):(u(v),v in h),getOwnPropertyDescriptor:(h,v)=>(u(v,!0),Object.getOwnPropertyDescriptor(h,v)),ownKeys:h=>(u(zr),Reflect.ownKeys(h))};return c&&(d.set=d.deleteProperty=()=>!1),[d,l]})(n,i),s[1].p=rd(i?(o=>{let c=qi.get(o);if(!c){if(Array.isArray(o))c=Array.from(o);else{const l=Object.getOwnPropertyDescriptors(o);Object.values(l).forEach(a=>{a.configurable=!0}),c=Object.create(Br(o),l)}qi.set(o,c)}return c})(n):n,s[0]),r&&r.set(n,s)),s[1].a=t,s[1].c=r,s[1].p},nd=(e,t)=>{const r=Reflect.ownKeys(e),n=Reflect.ownKeys(t);return r.length!==n.length||r.some((i,s)=>i!==n[s])},rs=(e,t,r,n)=>{if(Object.is(e,t))return!1;if(!Qi(e)||!Qi(t))return!0;const i=r.get(es(e));if(!i)return!0;if(n){const o=n.get(e);if(o&&o.n===t)return o.g;n.set(e,{n:t,g:!1})}let s=null;for(const o of i){const c=o===zr?nd(e,t):rs(e[o],t[o],r,n);if(c!==!0&&c!==!1||(s=c),s)break}return s===null&&(s=!0),n&&n.set(e,{n:t,g:s}),s},ns=e=>Zi(e)&&e[Wr]||null,is=(e,t=!0)=>{Hr.set(e,t)};var ss=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function id(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var os={exports:{}},as={};/** * @license React * use-sync-external-store-shim.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Ge=Ce.default;function sd(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var od=typeof Object.is=="function"?Object.is:sd,ad=Ge.useState,cd=Ge.useEffect,ld=Ge.useLayoutEffect,ud=Ge.useDebugValue;function fd(e,t){var r=t(),n=ad({inst:{value:r,getSnapshot:t}}),i=n[0].inst,s=n[1];return ld(function(){i.value=r,i.getSnapshot=t,Ur(i)&&s({inst:i})},[e,r,t]),cd(function(){return Ur(i)&&s({inst:i}),e(function(){Ur(i)&&s({inst:i})})},[e]),ud(r),r}function Ur(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!od(e,r)}catch{return!0}}function dd(e,t){return t()}var hd=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?dd:fd;as.useSyncExternalStore=Ge.useSyncExternalStore!==void 0?Ge.useSyncExternalStore:hd,function(e){e.exports=as}(os);const pd=id(os.exports),Gr=e=>typeof e=="object"&&e!==null,de=Symbol(),Yr=new WeakSet,md=(e=Object.is,t=(a,u)=>new Proxy(a,u),r=a=>Gr(a)&&!Yr.has(a)&&(Array.isArray(a)||!(Symbol.iterator in a))&&!(a instanceof WeakMap)&&!(a instanceof WeakSet)&&!(a instanceof Error)&&!(a instanceof Number)&&!(a instanceof Date)&&!(a instanceof String)&&!(a instanceof RegExp)&&!(a instanceof ArrayBuffer),n=a=>{switch(a.status){case"fulfilled":return a.value;case"rejected":throw a.reason;default:throw a}},i=new WeakMap,s=(a,u,d,h=n)=>{const v=i.get(u);if((v==null?void 0:v[0])===d)return v[1];const g=Array.isArray(a)?[]:Object.create(Object.getPrototypeOf(a));return is(g,!0),i.set(u,[d,g]),Reflect.ownKeys(a).forEach(_=>{const b=Reflect.get(a,_,u);Yr.has(b)?(is(b,!1),g[_]=b):b instanceof Promise?Object.defineProperty(g,_,{get(){return h(b)}}):b!=null&&b[de]?g[_]=Kr(b,h):g[_]=b}),Object.freeze(g)},o=new WeakMap,c=[1],l=a=>{if(!Gr(a))throw new Error("object required");const u=o.get(a);if(u)return u;let d=c[0];const h=new Set,v=(k,C=++c[0])=>{d!==C&&(d=C,h.forEach(S=>S(k,C)))},g=new Map,_=k=>{let C=g.get(k);return C||(C=(S,A)=>{const E=[...S];E[1]=[k,...E[1]],v(E,A)},g.set(k,C)),C},b=k=>{const C=g.get(k);return g.delete(k),C},T=Array.isArray(a)?[]:Object.create(Object.getPrototypeOf(a)),L=t(T,{get(k,C,S){return C===de?[k,S,d,s,h]:Reflect.get(k,C,S)},deleteProperty(k,C){var S;const A=Reflect.get(k,C),E=(S=A==null?void 0:A[de])==null?void 0:S[4];E&&E.delete(b(C));const M=Reflect.deleteProperty(k,C);return M&&v(["delete",[C],A]),M},set(k,C,S,A){var E,M;const P=Reflect.has(k,C),oe=Reflect.get(k,C,A);if(P&&e(oe,S))return!0;const ne=(E=oe==null?void 0:oe[de])==null?void 0:E[4];ne&&ne.delete(b(C)),Gr(S)&&(S=ns(S)||S);let N=S;return(M=Object.getOwnPropertyDescriptor(k,C))!=null&&M.set||(S instanceof Promise?S.then(O=>{S.status="fulfilled",S.value=O,v(["resolve",[C],O])}).catch(O=>{S.status="rejected",S.reason=O,v(["reject",[C],O])}):(!(S!=null&&S[de])&&r(S)&&(N=it(S)),N!=null&&N[de]&&N[de][4].add(_(C)))),Reflect.set(k,C,N,A),v(["set",[C],S,oe]),!0}});return o.set(a,L),Reflect.ownKeys(a).forEach(k=>{const C=Object.getOwnPropertyDescriptor(a,k);C.get||C.set?Object.defineProperty(T,k,C):L[k]=a[k]}),L})=>[l,de,Yr,e,t,r,n,i,s,o,c],[gd]=md();function it(e={}){return gd(e)}function cs(e,t,r){({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0}&&"production")!=="production"&&!(e!=null&&e[de])&&console.warn("Please use proxy object");let n;const i=[],s=e[de][4],o=c=>{if(i.push(c),r){t(i.splice(0));return}n||(n=Promise.resolve().then(()=>{n=void 0,s.has(o)&&t(i.splice(0))}))};return s.add(o),()=>s.delete(o)}function Kr(e,t){({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0}&&"production")!=="production"&&!(e!=null&&e[de])&&console.warn("Please use proxy object");const[r,n,i,s]=e[de];return s(r,n,i,t)}const{use:ls}=Ce.default,{useSyncExternalStore:yd}=pd,vd=(e,t)=>{const r=[],n=new WeakSet,i=(s,o)=>{if(n.has(s))return;let c;typeof s=="object"&&s!==null&&(n.add(s),c=t.get(ns(s)||s)),c?c.forEach(l=>{"value"in(Object.getOwnPropertyDescriptor(s,l)||{})&&i(s[l],o?[...o,l]:[l])}):o&&r.push(o)};return i(e),r},bd=(e,t)=>{const r=y.useRef();y.useEffect(()=>{r.current=vd(e,t)}),y.useDebugValue(r.current)};function st(e,t){const r=t==null?void 0:t.sync,n=y.useRef(),i=y.useRef();let s=!0;const o=yd(y.useCallback(a=>{const u=cs(e,a,r);return a(),u},[e,r]),()=>{const a=Kr(e,ls);try{if(!s&&n.current&&i.current&&!rs(n.current,a,i.current,new WeakMap))return n.current}catch{}return a},()=>Kr(e,ls));s=!1;const c=new WeakMap;y.useEffect(()=>{n.current=o,i.current=c}),({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0}&&"production")!=="production"&&bd(o,c);const l=y.useMemo(()=>new WeakMap,[]);return ts(o,c,l)}const us={accessKey:"",useNarrowMode:!1,initialShowMore:!1,pureRecommend:!1},he=it(us),fs=Object.keys(us),Me=function(){return st(he)},ds="bilibili-app-recommend.config";function _d(){const e=GM_getValue(ds);e&&typeof e=="object"&&Object.assign(he,Ji(e,fs)),cs(he,()=>{wd()})}function wd(){const e=Ji(he,fs);GM_setValue(ds,e)}function Sd(e){Object.assign(he,e)}_d();var ot={exports:{}};const Cd=(e,t)=>Math.floor(Math.random()*(t-e+1)+e),hs=()=>{const e=new Error("Delay aborted");return e.name="AbortError",e},ps=({clearTimeout:e,setTimeout:t,willResolve:r})=>(n,{value:i,signal:s}={})=>{if(s&&s.aborted)return Promise.reject(hs());let o,c,l;const a=e||clearTimeout,u=()=>{a(o),l(hs())},d=()=>{s&&s.removeEventListener("abort",u)},h=new Promise((v,g)=>{c=()=>{d(),r?v(i):g(i)},l=g,o=(t||setTimeout)(c,n)});return s&&s.addEventListener("abort",u,{once:!0}),h.clear=()=>{a(o),o=null,c()},h},ms=e=>{const t=ps({...e,willResolve:!0});return t.reject=ps({...e,willResolve:!1}),t.range=(r,n,i)=>t(Cd(r,n),i),t},Vr=ms();Vr.createWithTimers=ms,ot.exports=Vr,ot.exports.default=Vr;var Mt,gs=Qo.default;Mt=gs.createRoot,gs.hydrateRoot;const kg="";var ys={exports:{}};/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */(function(e){(function(){var t={}.hasOwnProperty;function r(){for(var n=[],i=0;i0?q(Ke,--ie):0,Ye--,V===10&&(Ye=1,Nt--),V}function ce(){return V=ie2||ut(V)>3?"":" "}function Fd(e,t){for(;--t&&ce()&&!(V<48||V>102||V>57&&V<65||V>70&&V<97););return lt(e,Ft()+(t<6&&be()==32&&ce()==32))}function qr(e){for(;ce();)switch(V){case e:return ie;case 34:case 39:e!==34&&e!==39&&qr(V);break;case 40:e===41&&qr(e);break;case 92:ce();break}return ie}function $d(e,t){for(;ce()&&e+V!==47+10;)if(e+V===42+42&&be()===47)break;return"/*"+lt(t,ie-1)+"*"+Rt(e===47?e:ce())}function Id(e){for(;!ut(be());)ce();return lt(e,ie)}function jd(e){return Cs(It("",null,null,null,[""],e=Ss(e),0,[0],e))}function It(e,t,r,n,i,s,o,c,l){for(var a=0,u=0,d=o,h=0,v=0,g=0,_=1,b=1,T=1,D=0,L="",k=i,C=s,S=n,A=L;b;)switch(g=D,D=ce()){case 40:if(g!=108&&q(A,d-1)==58){Zr(A+=H($t(D),"&","&\f"),"&\f")!=-1&&(T=-1);break}case 34:case 39:case 91:A+=$t(D);break;case 9:case 10:case 13:case 32:A+=Dd(g);break;case 92:A+=Fd(Ft()-1,7);continue;case 47:switch(be()){case 42:case 47:Lt(zd($d(ce(),Ft()),t,r),l);break;default:A+="/"}break;case 123*_:c[a++]=ve(A)*T;case 125*_:case 59:case 0:switch(D){case 0:case 125:b=0;case 59+u:v>0&&ve(A)-d&&Lt(v>32?Es(A+";",n,r,d-1):Es(H(A," ","")+";",n,r,d-2),l);break;case 59:A+=";";default:if(Lt(S=Ts(A,t,r,a,u,i,c,L,k=[],C=[],d),s),D===123)if(u===0)It(A,t,S,S,k,s,d,c,C);else switch(h===99&&q(A,3)===110?100:h){case 100:case 109:case 115:It(e,S,S,n&&Lt(Ts(e,S,S,0,0,i,c,L,i,k=[],d),C),i,C,d,c,n?k:C);break;default:It(A,S,S,S,[""],C,0,c,C)}}a=u=v=0,_=T=1,L=A="",d=o;break;case 58:d=1+ve(A),v=g;default:if(_<1){if(D==123)--_;else if(D==125&&_++==0&&Nd()==125)continue}switch(A+=Rt(D),D*_){case 38:T=u>0?1:(A+="\f",-1);break;case 44:c[a++]=(ve(A)-1)*T,T=1;break;case 64:be()===45&&(A+=$t(ce())),h=be(),u=d=ve(L=A+=Id(Ft())),D++;break;case 45:g===45&&ve(A)==2&&(_=0)}}return s}function Ts(e,t,r,n,i,s,o,c,l,a,u){for(var d=i-1,h=i===0?s:[""],v=Qr(h),g=0,_=0,b=0;g0?h[T]+" "+D:H(D,/&\f/g,h[T])))&&(l[b++]=L);return Dt(e,t,r,i===0?Xr:c,l,a,u)}function zd(e,t,r){return Dt(e,t,r,vs,Rt(Ld()),at(e,2,-2),0)}function Es(e,t,r,n){return Dt(e,t,r,Jr,at(e,0,n),at(e,n+1,-1),n)}function Ve(e,t){for(var r="",n=Qr(e),i=0;i6)switch(q(e,t+1)){case 109:if(q(e,t+4)!==45)break;case 102:return H(e,/(.+:)(.+)-([^]+)/,"$1"+B+"$2-$3$1"+Pt+(q(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Zr(e,"stretch")?As(H(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(q(e,t+1)!==115)break;case 6444:switch(q(e,ve(e)-3-(~Zr(e,"!important")&&10))){case 107:return H(e,":",":"+B)+e;case 101:return H(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+B+(q(e,14)===45?"inline-":"")+"box$3$1"+B+"$2$3$1"+re+"$2box$3")+e}break;case 5936:switch(q(e,t+11)){case 114:return B+e+re+H(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return B+e+re+H(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return B+e+re+H(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return B+e+re+e+e}return e}var Jd=function(t,r,n,i){if(t.length>-1&&!t.return)switch(t.type){case Jr:t.return=As(t.value,t.length);break;case bs:return Ve([ct(t,{value:H(t.value,"@","@"+B)})],i);case Xr:if(t.length)return Rd(t.props,function(s){switch(Pd(s,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Ve([ct(t,{props:[H(s,/:(read-\w+)/,":"+Pt+"$1")]})],i);case"::placeholder":return Ve([ct(t,{props:[H(s,/:(plac\w+)/,":"+B+"input-$1")]}),ct(t,{props:[H(s,/:(plac\w+)/,":"+Pt+"$1")]}),ct(t,{props:[H(s,/:(plac\w+)/,re+"input-$1")]})],i)}return""})}},Zd=[Jd],Os=function(t){var r=t.key;if(r==="css"){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(_){var b=_.getAttribute("data-emotion");b.indexOf(" ")!==-1&&(document.head.appendChild(_),_.setAttribute("data-s",""))})}var i=t.stylisPlugins||Zd,s={},o,c=[];o=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+r+' "]'),function(_){for(var b=_.getAttribute("data-emotion").split(" "),T=1;T=4;++n,i-=4)r=e.charCodeAt(n)&255|(e.charCodeAt(++n)&255)<<8|(e.charCodeAt(++n)&255)<<16|(e.charCodeAt(++n)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,t=(r&65535)*1540483477+((r>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(n+2)&255)<<16;case 2:t^=(e.charCodeAt(n+1)&255)<<8;case 1:t^=e.charCodeAt(n)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var ah={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},ch=/[A-Z]|^ms/g,lh=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Ds=function(t){return t.charCodeAt(1)===45},Fs=function(t){return t!=null&&typeof t!="boolean"},sn=Ud(function(e){return Ds(e)?e:e.replace(ch,"-$&").toLowerCase()}),$s=function(t,r){switch(t){case"animation":case"animationName":if(typeof r=="string")return r.replace(lh,function(n,i,s){return _e={name:i,styles:s,next:_e},i})}return ah[t]!==1&&!Ds(t)&&typeof r=="number"&&r!==0?r+"px":r},Mg="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function ft(e,t,r){if(r==null)return"";if(r.__emotion_styles!==void 0)return r;switch(typeof r){case"boolean":return"";case"object":{if(r.anim===1)return _e={name:r.name,styles:r.styles,next:_e},r.name;if(r.styles!==void 0){var n=r.next;if(n!==void 0)for(;n!==void 0;)_e={name:n.name,styles:n.styles,next:_e},n=n.next;var i=r.styles+";";return i}return uh(e,t,r)}case"function":{if(e!==void 0){var s=_e,o=r(e);return _e=s,ft(e,t,o)}break}}if(t==null)return r;var c=t[r];return c!==void 0?c:r}function uh(e,t,r){var n="";if(Array.isArray(r))for(var i=0;i!!document.querySelectorAll(".bili-feed4").length),Us=function(){return y.useMemo(()=>Jt(),[])},Gs=document.querySelector(".bili-header__bar"),Ys=Boolean(Gs&&window.getComputedStyle(Gs).display==="none")?50:64,Ks=()=>document.body.classList.contains("dark"),Vs=it({value:Ks()});function cn(){return st(Vs).value}const Zt=new MutationObserver(function(){Vs.value=Ks()});Zt.observe(document.body,{attributes:!0,attributeFilter:["class"]}),window.addEventListener("unload",()=>{Zt==null||Zt.disconnect()});var _h=function(t){return function(r,n){var i=y.useRef(!1);t(function(){return function(){i.current=!1}},[]),t(function(){if(!i.current)i.current=!0;else return r()},n)}},Je=function(t){return typeof t=="function"},wh=function(t){return typeof t=="string"},Xs=function(t){return typeof t=="number"},Sh=!1;const ln=Sh;function Y(e){ln&&(Je(e)||console.error("useMemoizedFn expected parameter is a function, got ".concat(typeof e)));var t=y.useRef(e);t.current=y.useMemo(function(){return e},[e]);var r=y.useRef();return r.current||(r.current=function(){for(var n=[],i=0;i0)&&!(i=n.next()).done;)s.push(i.value)}catch(c){o={error:c}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s},Zs=globalThis&&globalThis.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,s;n-1&&(s=setTimeout(function(){qt.delete(t)},r)),qt.set(t,Qt(Qt({},n),{timer:s}))},xh=function(t){return qt.get(t)},er=new Map,Ah=function(t){return er.get(t)},Oh=function(t,r){er.set(t,r),r.then(function(n){return er.delete(t),n}).catch(function(){er.delete(t)})},ze={},kh=function(t,r){ze[t]&&ze[t].forEach(function(n){return n(r)})},dn=function(t,r){return ze[t]||(ze[t]=[]),ze[t].push(r),function(){var i=ze[t].indexOf(r);ze[t].splice(i,1)}},Mh=globalThis&&globalThis.__read||function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(c){o={error:c}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s},Ph=globalThis&&globalThis.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,s;n0)&&!(i=n.next()).done;)s.push(i.value)}catch(c){o={error:c}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s},Dh=globalThis&&globalThis.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,s;n0)&&!(i=n.next()).done;)s.push(i.value)}catch(c){o={error:c}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s},Yh=globalThis&&globalThis.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,s;n-1&&yt.splice(r,1)}}if(mt){var eo=function(){if(!(!hn()||!Vh()))for(var t=0;t0)&&!(i=n.next()).done;)s.push(i.value)}catch(c){o={error:c}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s},tp=globalThis&&globalThis.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,s;n0)&&!(i=n.next()).done;)s.push(i.value)}catch(c){o={error:c}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s},ap=function(){var t=op(y.useState({}),2),r=t[1];return y.useCallback(function(){return r({})},[])};const cp=ap;var Pe=globalThis&&globalThis.__assign||function(){return Pe=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0&&s[s.length-1])&&(a[0]===6||a[0]===2)){r=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]0)&&!(i=n.next()).done;)s.push(i.value)}catch(c){o={error:c}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s},Qe=globalThis&&globalThis.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,s;n0)&&!(i=n.next()).done;)s.push(i.value)}catch(c){o={error:c}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s},ro=globalThis&&globalThis.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,s;n0)&&!(i=n.next()).done;)s.push(i.value)}catch(c){o={error:c}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s},no=globalThis&&globalThis.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,s;n0)&&!(i=n.next()).done;)s.push(i.value)}catch(c){o={error:c}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s};function so(e,t){e===void 0&&(e=!1);var r=yp(y.useState(e),2),n=r[0],i=r[1],s=y.useMemo(function(){var o=t===void 0?!e:t,c=function(){return i(function(h){return h===e?o:e})},l=function(h){return i(h)},a=function(){return i(e)},u=function(){return i(o)};return{toggle:c,set:l,setLeft:a,setRight:u}},[]);return[n,s]}var vp=globalThis&&globalThis.__read||function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(c){o={error:c}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s};function bp(e){e===void 0&&(e=!1);var t=vp(so(e),2),r=t[0],n=t[1],i=n.toggle,s=n.set,o=y.useMemo(function(){var c=function(){return s(!0)},l=function(){return s(!1)};return{toggle:i,set:function(u){return s(!!u)},setTrue:c,setFalse:l}},[]);return[r,o]}function tr(e,t){if(!!mt){if(!e)return t;var r;return Je(e)?r=e():"current"in e?r=e.current:r=e,r}}var _p=function(t){var r=function(i,s,o){var c=y.useRef(!1),l=y.useRef([]),a=y.useRef([]),u=y.useRef();t(function(){var d,h=Array.isArray(o)?o:[o],v=h.map(function(g){return tr(g)});if(!c.current){c.current=!0,l.current=v,a.current=s,u.current=i();return}(v.length!==l.current.length||!fn(v,l.current)||!fn(s,a.current))&&((d=u.current)===null||d===void 0||d.call(u),l.current=v,a.current=s,u.current=i())}),pt(function(){var d;(d=u.current)===null||d===void 0||d.call(u),c.current=!1})};return r},wp=_p(y.useEffect);const oo=wp;var ao={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(ss,function(){var r=1e3,n=6e4,i=36e5,s="millisecond",o="second",c="minute",l="hour",a="day",u="week",d="month",h="quarter",v="year",g="date",_="Invalid Date",b=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,T=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,D={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(N){var O=["th","st","nd","rd"],x=N%100;return"["+N+(O[(x-20)%10]||O[x]||O[0])+"]"}},L=function(N,O,x){var I=String(N);return!I||I.length>=O?N:""+Array(O+1-I.length).join(x)+N},k={s:L,z:function(N){var O=-N.utcOffset(),x=Math.abs(O),I=Math.floor(x/60),f=x%60;return(O<=0?"+":"-")+L(I,2,"0")+":"+L(f,2,"0")},m:function N(O,x){if(O.date()1)return N(w[0])}else{var R=O.name;S[R]=O,f=R}return!I&&f&&(C=f),f||!I&&C},M=function(N,O){if(A(N))return N.clone();var x=typeof O=="object"?O:{};return x.date=N,x.args=arguments,new oe(x)},P=k;P.l=E,P.i=A,P.w=function(N,O){return M(N,{locale:O.$L,utc:O.$u,x:O.$x,$offset:O.$offset})};var oe=function(){function N(x){this.$L=E(x.locale,null,!0),this.parse(x)}var O=N.prototype;return O.parse=function(x){this.$d=function(I){var f=I.date,m=I.utc;if(f===null)return new Date(NaN);if(P.u(f))return new Date;if(f instanceof Date)return new Date(f);if(typeof f=="string"&&!/Z$/i.test(f)){var w=f.match(b);if(w){var R=w[2]-1||0,z=(w[7]||"0").substring(0,3);return m?new Date(Date.UTC(w[1],R,w[3]||1,w[4]||0,w[5]||0,w[6]||0,z)):new Date(w[1],R,w[3]||1,w[4]||0,w[5]||0,w[6]||0,z)}}return new Date(f)}(x),this.$x=x.x||{},this.init()},O.init=function(){var x=this.$d;this.$y=x.getFullYear(),this.$M=x.getMonth(),this.$D=x.getDate(),this.$W=x.getDay(),this.$H=x.getHours(),this.$m=x.getMinutes(),this.$s=x.getSeconds(),this.$ms=x.getMilliseconds()},O.$utils=function(){return P},O.isValid=function(){return this.$d.toString()!==_},O.isSame=function(x,I){var f=M(x);return this.startOf(I)<=f&&f<=this.endOf(I)},O.isAfter=function(x,I){return M(x)0)&&!(i=n.next()).done;)s.push(i.value)}catch(c){o={error:c}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s};const mn=function(e,t){var r=t||{},n=r.onEnter,i=r.onLeave,s=r.onChange,o=Sp(bp(!1),2),c=o[0],l=o[1],a=l.setTrue,u=l.setFalse;return rr("mouseenter",function(){n==null||n(),a(),s==null||s(!0)},{target:e}),rr("mouseleave",function(){i==null||i(),u(),s==null||s(!1)},{target:e}),c};var Cp=function(t,r){return r===void 0&&(r=[]),Of(t,r)},Tp=function(t,r,n){var i=y.useRef(),s=y.useRef(0);Cp(r,i.current)||(i.current=r,s.current+=1),oo(t,[s.current],n)};const Ep=Tp;var gn=globalThis&&globalThis.__values||function(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},xp={0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,pausebreak:19,capslock:20,esc:27,space:32,pageup:33,pagedown:34,end:35,home:36,leftarrow:37,uparrow:38,rightarrow:39,downarrow:40,insert:45,delete:46,a:65,b:66,c:67,d:68,e:69,f:70,g:71,h:72,i:73,j:74,k:75,l:76,m:77,n:78,o:79,p:80,q:81,r:82,s:83,t:84,u:85,v:86,w:87,x:88,y:89,z:90,leftwindowkey:91,rightwindowkey:92,selectkey:93,numpad0:96,numpad1:97,numpad2:98,numpad3:99,numpad4:100,numpad5:101,numpad6:102,numpad7:103,numpad8:104,numpad9:105,multiply:106,add:107,subtract:109,decimalpoint:110,divide:111,f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123,numlock:144,scrolllock:145,semicolon:186,equalsign:187,comma:188,dash:189,period:190,forwardslash:191,graveaccent:192,openbracket:219,backslash:220,closebracket:221,singlequote:222},yn={ctrl:function(t){return t.ctrlKey},shift:function(t){return t.shiftKey},alt:function(t){return t.altKey},meta:function(t){return t.metaKey}};function Ap(e){var t=Object.keys(yn).reduce(function(r,n){return yn[n](e)?r+1:r},0);return[16,17,18,91,92].includes(e.keyCode)?t:t+1}function lo(e,t,r){var n,i;if(!e.key)return!1;if(Xs(t))return e.keyCode===t;var s=t.split("."),o=0;try{for(var c=gn(s),l=c.next();!l.done;l=c.next()){var a=l.value,u=yn[a],d=xp[a.toLowerCase()];(u&&u(e)||d&&d===e.keyCode)&&o++}}catch(h){n={error:h}}finally{try{l&&!l.done&&(i=c.return)&&i.call(c)}finally{if(n)throw n.error}}return r?o===s.length&&Ap(e)===s.length:o===s.length}function Op(e,t){return Je(e)?e:wh(e)||Xs(e)?function(r){return lo(r,e,t)}:Array.isArray(e)?function(r){return e.some(function(n){return lo(r,n,t)})}:e?function(){return!0}:function(){return!1}}var kp=["keydown"];function We(e,t,r){var n=r||{},i=n.events,s=i===void 0?kp:i,o=n.target,c=n.exactMatch,l=c===void 0?!1:c,a=ht(t),u=ht(e);Ep(function(){var d,h,v,g=tr(o,window);if(!!g){var _=function(k){var C,S=Op(u.current,l);if(S(k))return(C=a.current)===null||C===void 0?void 0:C.call(a,k)};try{for(var b=gn(s),T=b.next();!T.done;T=b.next()){var D=T.value;(v=g==null?void 0:g.addEventListener)===null||v===void 0||v.call(g,D,_)}}catch(L){d={error:L}}finally{try{T&&!T.done&&(h=b.return)&&h.call(b)}finally{if(d)throw d.error}}return function(){var L,k,C;try{for(var S=gn(s),A=S.next();!A.done;A=S.next()){var E=A.value;(C=g==null?void 0:g.removeEventListener)===null||C===void 0||C.call(g,E,_)}}catch(M){L={error:M}}finally{try{A&&!A.done&&(k=S.return)&&k.call(S)}finally{if(L)throw L.error}}}}},[s],o)}var Mp=globalThis&&globalThis.__read||function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(c){o={error:c}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s};function Pp(e){var t=y.useRef(0),r=Mp(y.useState(e),2),n=r[0],i=r[1],s=y.useCallback(function(o){cancelAnimationFrame(t.current),t.current=requestAnimationFrame(function(){i(o)})},[]);return pt(function(){cancelAnimationFrame(t.current)}),[n,s]}var Rp=globalThis&&globalThis.__read||function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(c){o={error:c}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s},Lp={screenX:NaN,screenY:NaN,clientX:NaN,clientY:NaN,pageX:NaN,pageY:NaN,elementX:NaN,elementY:NaN,elementH:NaN,elementW:NaN,elementPosX:NaN,elementPosY:NaN};const Np=function(e){var t=Rp(Pp(Lp),2),r=t[0],n=t[1];return rr("mousemove",function(i){var s=i.screenX,o=i.screenY,c=i.clientX,l=i.clientY,a=i.pageX,u=i.pageY,d={screenX:s,screenY:o,clientX:c,clientY:l,pageX:a,pageY:u,elementX:NaN,elementY:NaN,elementH:NaN,elementW:NaN,elementPosX:NaN,elementPosY:NaN},h=tr(e);if(h){var v=h.getBoundingClientRect(),g=v.left,_=v.top,b=v.width,T=v.height;d.elementPosX=g+window.pageXOffset,d.elementPosY=_+window.pageYOffset,d.elementX=a-d.elementPosX,d.elementY=u-d.elementPosY,d.elementW=b,d.elementH=T}n(d)},{target:function(){return document}}),r};var nr={exports:{}},ir={};/** * @license React * react-jsx-runtime.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Dp=Ce.default,Fp=Symbol.for("react.element"),$p=Symbol.for("react.fragment"),Ip=Object.prototype.hasOwnProperty,jp=Dp.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,zp={key:!0,ref:!0,__self:!0,__source:!0};function uo(e,t,r){var n,i={},s=null,o=null;r!==void 0&&(s=""+r),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(o=t.ref);for(n in t)Ip.call(t,n)&&!zp.hasOwnProperty(n)&&(i[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)i[n]===void 0&&(i[n]=t[n]);return{$$typeof:Fp,type:e,key:s,ref:o,props:i,_owner:jp.current}}ir.Fragment=$p,ir.jsx=uo,ir.jsxs=uo,function(e){e.exports=ir}(nr);const Wp=nr.exports.Fragment,fo=nr.exports.jsx,ho=nr.exports.jsxs;var Re=Wp;function p(e,t,r){return Xt.call(t,"css")?fo(Ws,zs(e,t),r):fo(e,t,r)}function F(e,t,r){return Xt.call(t,"css")?ho(Ws,zs(e,t),r):ho(e,t,r)}let vt=0;const Bp=()=>{vt++,document.body.style.overflow="hidden"},Hp=()=>{vt--,vt<0&&(vt=0),vt===0&&(document.body.style.overflow="overlay")};function vn({show:e,onHide:t,children:r,clsModalMask:n,clsModal:i,hideWhenMaskOnClick:s=!1}){y.useLayoutEffect(()=>{e?Bp():Hp()},[e]);const o=y.useRef(null),c=cn(),{bg:l,c:a}=y.useMemo(()=>{const g=window.getComputedStyle(document.body)["background-color"],_=window.getComputedStyle(document.body).color;return{bg:g,c:_}},[c]),u=y.useMemo(()=>c?{"--bg":l,"--c":a,backgroundColor:l,color:a}:{},[l,a,c]),d=y.useId(),h=y.useMemo(()=>{const g=document.createElement("div");return g.setAttribute("data-id","base-modal-"+d),document.body.appendChild(g),g},[]),v=Y(g=>{var _;(_=o.current)!=null&&_.contains(g.target)||s&&t()});return e?me.createPortal(p("div",{className:te(n),onClick:v,children:p("div",{className:te(i),style:u,ref:o,children:r})}),h):null}const po="_toast-container_9119l_1",Lg={toastContainer:po};function ue(e,t=2e3){const r=document.createElement("div");r.className=po,r.innerText=e,document.body.appendChild(r),setTimeout(()=>r.remove(),t)}const Up="\u8BF7\u6C42\u5931\u8D25, \u8BF7\u91CD\u8BD5 !!!",Gp="\u64CD\u4F5C\u5931\u8D25, \u8BF7\u91CD\u8BD5 !!!";function mo(){return ue(Up)}function go(){return ue(Gp)}function Yp(e){const t=it({data:Array.from(e||[]),has(r){return this.data.some(n=>n[0]===r)},set(r,n){const i=this.data.find(s=>s[0]===r);return i?i[1]=n:this.data.push([r,n]),this},get(r){var n;return(n=this.data.find(i=>i[0]===r))==null?void 0:n[1]},delete(r){const n=this.data.findIndex(i=>i[0]===r);return n===-1?!1:(this.data.splice(n,1),!0)},clear(){this.data.splice(0)},get size(){return this.data.length},toJSON(){return new Map(this.data)},forEach(r){this.data.forEach(n=>{r(n[1],n[0],this)})},keys(){return this.data.map(r=>r[0]).values()},values(){return this.data.map(r=>r[1]).values()},entries(){return new Map(this.data).entries()},get[Symbol.toStringTag](){return"Map"},[Symbol.iterator](){return this.entries()}});return Object.defineProperties(t,{data:{enumerable:!1},size:{enumerable:!1},toJSON:{enumerable:!1}}),Object.seal(t),t}const Kp="https://api.bilibili.com",yo="https://app.bilibili.com",bn=yr.default.create({baseURL:Kp});bn.interceptors.request.use(function(e){var t;return(t=e.params)!=null&&t._||(e.params={...e.params,_:Date.now()}),e},function(e){return Promise.reject(e)});const sr=yr.default.create({adapter:qo.default});sr.interceptors.request.use(function(e){return e.params={access_key:he.accessKey||"",...e.params},e},function(e){return Promise.reject(e)}),sr.interceptors.response.use(e=>{if(e.config.responseType==="json"&&e.data&&e.data instanceof ArrayBuffer){const t=new TextDecoder,r=new Uint8Array(e.data),n=t.decode(r);e.data=n;try{e.data=JSON.parse(n)}catch{}}return e});function Vp(){var t;const e=(t=document.cookie.match(/bili_jct=([0-9a-fA-F]{32})/))==null?void 0:t[1];if(!e)throw ue("\u627E\u4E0D\u5230 csrf token, \u8BF7\u68C0\u67E5\u662F\u5426\u767B\u5F55"),new Error("\u627E\u4E0D\u5230 csrf token, \u8BF7\u68C0\u67E5\u662F\u5426\u767B\u5F55");return e}const bt=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,or=typeof AbortController=="function"?AbortController:class{constructor(){this.signal=new vo}abort(){this.signal.dispatchEvent("abort")}},Xp=typeof AbortSignal=="function",Jp=typeof or.AbortSignal=="function",vo=Xp?AbortSignal:Jp?or.AbortController:class{constructor(){this.aborted=!1,this._listeners=[]}dispatchEvent(t){if(t==="abort"){this.aborted=!0;const r={type:t,target:this};this.onabort(r),this._listeners.forEach(n=>n(r),this)}}onabort(){}addEventListener(t,r){t==="abort"&&this._listeners.push(r)}removeEventListener(t,r){t==="abort"&&(this._listeners=this._listeners.filter(n=>n!==r))}},_n=new Set,wn=(e,t)=>{const r=`LRU_CACHE_OPTION_${e}`;ar(r)&&Cn(r,`${e} option`,`options.${t}`,Be)},Sn=(e,t)=>{const r=`LRU_CACHE_METHOD_${e}`;if(ar(r)){const{prototype:n}=Be,{get:i}=Object.getOwnPropertyDescriptor(n,e);Cn(r,`${e} method`,`cache.${t}()`,i)}},Zp=(e,t)=>{const r=`LRU_CACHE_PROPERTY_${e}`;if(ar(r)){const{prototype:n}=Be,{get:i}=Object.getOwnPropertyDescriptor(n,e);Cn(r,`${e} property`,`cache.${t}`,i)}},bo=(...e)=>{typeof process=="object"&&process&&typeof process.emitWarning=="function"?process.emitWarning(...e):console.error(...e)},ar=e=>!_n.has(e),Cn=(e,t,r,n)=>{_n.add(e);const i=`The ${t} is deprecated. Please use ${r} instead.`;bo(i,"DeprecationWarning",e,n)},Le=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),_o=e=>Le(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?cr:null:null;class cr extends Array{constructor(t){super(t),this.fill(0)}}class Qp{constructor(t){if(t===0)return[];const r=_o(t);this.heap=new r(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}}class Be{constructor(t={}){const{max:r=0,ttl:n,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:c,allowStale:l,dispose:a,disposeAfter:u,noDisposeOnSet:d,noUpdateTTL:h,maxSize:v=0,maxEntrySize:g=0,sizeCalculation:_,fetchMethod:b,fetchContext:T,noDeleteOnFetchRejection:D,noDeleteOnStaleGet:L}=t,{length:k,maxAge:C,stale:S}=t instanceof Be?{}:t;if(r!==0&&!Le(r))throw new TypeError("max option must be a nonnegative integer");const A=r?_o(r):Array;if(!A)throw new Error("invalid max value: "+r);if(this.max=r,this.maxSize=v,this.maxEntrySize=g||this.maxSize,this.sizeCalculation=_||k,this.sizeCalculation){if(!this.maxSize&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(this.fetchMethod=b||null,this.fetchMethod&&typeof this.fetchMethod!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.fetchContext=T,!this.fetchMethod&&T!==void 0)throw new TypeError("cannot set fetchContext without fetchMethod");if(this.keyMap=new Map,this.keyList=new Array(r).fill(null),this.valList=new Array(r).fill(null),this.next=new A(r),this.prev=new A(r),this.head=0,this.tail=0,this.free=new Qp(r),this.initialFill=1,this.size=0,typeof a=="function"&&(this.dispose=a),typeof u=="function"?(this.disposeAfter=u,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!d,this.noUpdateTTL=!!h,this.noDeleteOnFetchRejection=!!D,this.maxEntrySize!==0){if(this.maxSize!==0&&!Le(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");if(!Le(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!l||!!S,this.noDeleteOnStaleGet=!!L,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!c,this.ttlResolution=Le(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=n||C||0,this.ttl){if(!Le(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.initializeTTLTracking()}if(this.max===0&&this.ttl===0&&this.maxSize===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.max&&!this.maxSize){const E="LRU_CACHE_UNBOUNDED";ar(E)&&(_n.add(E),bo("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",E,Be))}S&&wn("stale","allowStale"),C&&wn("maxAge","ttl"),k&&wn("length","sizeCalculation")}getRemainingTTL(t){return this.has(t,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new cr(this.max),this.starts=new cr(this.max),this.setItemTTL=(n,i,s=bt.now())=>{if(this.starts[n]=i!==0?s:0,this.ttls[n]=i,i!==0&&this.ttlAutopurge){const o=setTimeout(()=>{this.isStale(n)&&this.delete(this.keyList[n])},i+1);o.unref&&o.unref()}},this.updateItemAge=n=>{this.starts[n]=this.ttls[n]!==0?bt.now():0};let t=0;const r=()=>{const n=bt.now();if(this.ttlResolution>0){t=n;const i=setTimeout(()=>t=0,this.ttlResolution);i.unref&&i.unref()}return n};this.getRemainingTTL=n=>{const i=this.keyMap.get(n);return i===void 0?0:this.ttls[i]===0||this.starts[i]===0?1/0:this.starts[i]+this.ttls[i]-(t||r())},this.isStale=n=>this.ttls[n]!==0&&this.starts[n]!==0&&(t||r())-this.starts[n]>this.ttls[n]}updateItemAge(t){}setItemTTL(t,r,n){}isStale(t){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new cr(this.max),this.removeItemSize=t=>{this.calculatedSize-=this.sizes[t],this.sizes[t]=0},this.requireSize=(t,r,n,i)=>{if(this.isBackgroundFetch(r))return 0;if(!Le(n))if(i){if(typeof i!="function")throw new TypeError("sizeCalculation must be a function");if(n=i(r,t),!Le(n))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer)");return n},this.addItemSize=(t,r)=>{if(this.sizes[t]=r,this.maxSize){const n=this.maxSize-this.sizes[t];for(;this.calculatedSize>n;)this.evict(!0)}this.calculatedSize+=this.sizes[t]}}removeItemSize(t){}addItemSize(t,r){}requireSize(t,r,n,i){if(n||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache")}*indexes({allowStale:t=this.allowStale}={}){if(this.size)for(let r=this.tail;!(!this.isValidIndex(r)||((t||!this.isStale(r))&&(yield r),r===this.head));)r=this.prev[r]}*rindexes({allowStale:t=this.allowStale}={}){if(this.size)for(let r=this.head;!(!this.isValidIndex(r)||((t||!this.isStale(r))&&(yield r),r===this.tail));)r=this.next[r]}isValidIndex(t){return this.keyMap.get(this.keyList[t])===t}*entries(){for(const t of this.indexes())yield[this.keyList[t],this.valList[t]]}*rentries(){for(const t of this.rindexes())yield[this.keyList[t],this.valList[t]]}*keys(){for(const t of this.indexes())yield this.keyList[t]}*rkeys(){for(const t of this.rindexes())yield this.keyList[t]}*values(){for(const t of this.indexes())yield this.valList[t]}*rvalues(){for(const t of this.rindexes())yield this.valList[t]}[Symbol.iterator](){return this.entries()}find(t,r={}){for(const n of this.indexes())if(t(this.valList[n],this.keyList[n],this))return this.get(this.keyList[n],r)}forEach(t,r=this){for(const n of this.indexes())t.call(r,this.valList[n],this.keyList[n],this)}rforEach(t,r=this){for(const n of this.rindexes())t.call(r,this.valList[n],this.keyList[n],this)}get prune(){return Sn("prune","purgeStale"),this.purgeStale}purgeStale(){let t=!1;for(const r of this.rindexes({allowStale:!0}))this.isStale(r)&&(this.delete(this.keyList[r]),t=!0);return t}dump(){const t=[];for(const r of this.indexes({allowStale:!0})){const n=this.keyList[r],i=this.valList[r],o={value:this.isBackgroundFetch(i)?i.__staleWhileFetching:i};if(this.ttls){o.ttl=this.ttls[r];const c=bt.now()-this.starts[r];o.start=Math.floor(Date.now()-c)}this.sizes&&(o.size=this.sizes[r]),t.unshift([n,o])}return t}load(t){this.clear();for(const[r,n]of t){if(n.start){const i=Date.now()-n.start;n.start=bt.now()-i}this.set(r,n.value,n)}}dispose(t,r,n){}set(t,r,{ttl:n=this.ttl,start:i,noDisposeOnSet:s=this.noDisposeOnSet,size:o=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL}={}){if(o=this.requireSize(t,r,o,c),this.maxEntrySize&&o>this.maxEntrySize)return this.delete(t),this;let a=this.size===0?void 0:this.keyMap.get(t);if(a===void 0)a=this.newIndex(),this.keyList[a]=t,this.valList[a]=r,this.keyMap.set(t,a),this.next[this.tail]=a,this.prev[a]=this.tail,this.tail=a,this.size++,this.addItemSize(a,o),l=!1;else{const u=this.valList[a];r!==u&&(this.isBackgroundFetch(u)?u.__abortController.abort():s||(this.dispose(u,t,"set"),this.disposeAfter&&this.disposed.push([u,t,"set"])),this.removeItemSize(a),this.valList[a]=r,this.addItemSize(a,o)),this.moveToTail(a)}if(n!==0&&this.ttl===0&&!this.ttls&&this.initializeTTLTracking(),l||this.setItemTTL(a,n,i),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return this.size===0?this.tail:this.size===this.max&&this.max!==0?this.evict(!1):this.free.length!==0?this.free.pop():this.initialFill++}pop(){if(this.size){const t=this.valList[this.head];return this.evict(!0),t}}evict(t){const r=this.head,n=this.keyList[r],i=this.valList[r];return this.isBackgroundFetch(i)?i.__abortController.abort():(this.dispose(i,n,"evict"),this.disposeAfter&&this.disposed.push([i,n,"evict"])),this.removeItemSize(r),t&&(this.keyList[r]=null,this.valList[r]=null,this.free.push(r)),this.head=this.next[r],this.keyMap.delete(n),this.size--,r}has(t,{updateAgeOnHas:r=this.updateAgeOnHas}={}){const n=this.keyMap.get(t);return n!==void 0&&!this.isStale(n)?(r&&this.updateItemAge(n),!0):!1}peek(t,{allowStale:r=this.allowStale}={}){const n=this.keyMap.get(t);if(n!==void 0&&(r||!this.isStale(n))){const i=this.valList[n];return this.isBackgroundFetch(i)?i.__staleWhileFetching:i}}backgroundFetch(t,r,n,i){const s=r===void 0?void 0:this.valList[r];if(this.isBackgroundFetch(s))return s;const o=new or,c={signal:o.signal,options:n,context:i},l=h=>(o.signal.aborted||this.set(t,h,c.options),h),a=h=>{if(this.valList[r]===d&&(!n.noDeleteOnFetchRejection||d.__staleWhileFetching===void 0?this.delete(t):this.valList[r]=d.__staleWhileFetching),d.__returned===d)throw h},u=h=>h(this.fetchMethod(t,s,c)),d=new Promise(u).then(l,a);return d.__abortController=o,d.__staleWhileFetching=s,d.__returned=null,r===void 0?(this.set(t,d,c.options),r=this.keyMap.get(t)):this.valList[r]=d,d}isBackgroundFetch(t){return t&&typeof t=="object"&&typeof t.then=="function"&&Object.prototype.hasOwnProperty.call(t,"__staleWhileFetching")&&Object.prototype.hasOwnProperty.call(t,"__returned")&&(t.__returned===t||t.__returned===null)}async fetch(t,{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:s=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:c=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:a=this.noUpdateTTL,noDeleteOnFetchRejection:u=this.noDeleteOnFetchRejection,fetchContext:d=this.fetchContext,forceRefresh:h=!1}={}){if(!this.fetchMethod)return this.get(t,{allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:i});const v={allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:i,ttl:s,noDisposeOnSet:o,size:c,sizeCalculation:l,noUpdateTTL:a,noDeleteOnFetchRejection:u};let g=this.keyMap.get(t);if(g===void 0){const _=this.backgroundFetch(t,g,v,d);return _.__returned=_}else{const _=this.valList[g];if(this.isBackgroundFetch(_))return r&&_.__staleWhileFetching!==void 0?_.__staleWhileFetching:_.__returned=_;if(!h&&!this.isStale(g))return this.moveToTail(g),n&&this.updateItemAge(g),_;const b=this.backgroundFetch(t,g,v,d);return r&&b.__staleWhileFetching!==void 0?b.__staleWhileFetching:b.__returned=b}}get(t,{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet}={}){const s=this.keyMap.get(t);if(s!==void 0){const o=this.valList[s],c=this.isBackgroundFetch(o);return this.isStale(s)?c?r?o.__staleWhileFetching:void 0:(i||this.delete(t),r?o:void 0):c?void 0:(this.moveToTail(s),n&&this.updateItemAge(s),o)}}connect(t,r){this.prev[r]=t,this.next[t]=r}moveToTail(t){t!==this.tail&&(t===this.head?this.head=this.next[t]:this.connect(this.prev[t],this.next[t]),this.connect(this.tail,t),this.tail=t)}get del(){return Sn("del","delete"),this.delete}delete(t){let r=!1;if(this.size!==0){const n=this.keyMap.get(t);if(n!==void 0)if(r=!0,this.size===1)this.clear();else{this.removeItemSize(n);const i=this.valList[n];this.isBackgroundFetch(i)?i.__abortController.abort():(this.dispose(i,t,"delete"),this.disposeAfter&&this.disposed.push([i,t,"delete"])),this.keyMap.delete(t),this.keyList[n]=null,this.valList[n]=null,n===this.tail?this.tail=this.prev[n]:n===this.head?this.head=this.next[n]:(this.next[this.prev[n]]=this.next[n],this.prev[this.next[n]]=this.prev[n]),this.size--,this.free.push(n)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return r}clear(){for(const t of this.rindexes({allowStale:!0})){const r=this.valList[t];if(this.isBackgroundFetch(r))r.__abortController.abort();else{const n=this.keyList[t];this.dispose(r,n,"delete"),this.disposeAfter&&this.disposed.push([r,n,"delete"])}}if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),this.sizes&&this.sizes.fill(0),this.head=0,this.tail=0,this.initialFill=1,this.free.length=0,this.calculatedSize=0,this.size=0,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return Sn("reset","clear"),this.clear}get length(){return Zp("length","size"),this.size}static get AbortController(){return or}static get AbortSignal(){return vo}}var qp=Be;const em=qp;async function tm(e){return(await bn.get("/pvideo",{params:{aid:e}})).data.data}async function rm(e){return[]}const Tn=new em({max:200});async function nm(e){if(Tn.has(e))return Tn.get(e);const[t,r]=await Promise.all([tm(e),rm()]);return Tn.set(e,{pvideoData:t,dmData:r}),{pvideoData:t,dmData:r}}function wo(e){return async function(r){const n=new FormData;n.append("aid",r),n.append("csrf",Vp());const s=(await bn.post("/x/v2/history/toview/"+e,n,{withCredentials:!0})).data,o=(s==null?void 0:s.code)===0&&(s==null?void 0:s.message)==="0";return o||ue((s==null?void 0:s.message)||"\u51FA\u9519\u4E86"),o}}const im=wo("add"),sm=wo("del"),So=e=>{const t={dislike:"/x/feed/dislike",cancel:"/x/feed/dislike/cancel"}[e];return async function(r,n){var c;const s=(await sr.get(yo+t,{params:{goto:r.goto,id:r.param,mid:r.mid,rid:r.tid,tag_id:(c=r.tag)==null?void 0:c.tag_id,reason_id:n,build:"1",mobi_app:"android",idx:(Date.now()/1e3).toFixed(0)}})).data;return(s==null?void 0:s.code)===0&&(s==null?void 0:s.message)==="0"}},om=So("dislike"),am=So("cancel"),Ae={modalMask:"_modal-mask_vh629_1",modal:"_modal_vh629_1",modalHeader:"_modal-header_vh629_23",modalTitle:"_modal-title_vh629_30",titleDesc:"_title-desc_vh629_35",btnClose:"_btn-close_vh629_39",modalBody:"_modal-body_vh629_57",reasonList:"_reason-list_vh629_62",reason:"_reason_vh629_62"},En=Yp();function cm(){return st(En)}function lm(e){const t=cm();if(!!e)return t.get(e)}function um({show:e,onHide:t,item:r}){const[n,i]=y.useState(!1),s=Y(async(c,l)=>{if(!r)return;let a=!1,u=null;try{i(!0),a=await om(r,c)}catch(d){u=d}finally{i(!1)}if(u)return console.error(u.stack||u),mo();a?ue("\u5DF2\u6807\u8BB0\u4E0D\u60F3\u770B"):go(),a&&(En.set(r.param,{id:c,name:l}),t())}),o=y.useMemo(()=>{var c;return[...(c=r==null?void 0:r.dislike_reasons)!=null?c:[],{reason_id:12,reason_name:"\u6B64\u7C7B\u5185\u5BB9\u8FC7\u591A"},{reason_id:13,reason_name:"\u63A8\u8350\u8FC7"}]},[r]);return F(vn,{show:e,onHide:t,clsModalMask:Ae.modalMask,clsModal:Ae.modal,hideWhenMaskOnClick:!0,children:[F("div",{className:Ae.modalHeader,children:[F("div",{className:Ae.modalTitle,children:["\u6211\u4E0D\u60F3\u770B",p("span",{className:Ae.titleDesc,children:"(\u9009\u62E9\u540E\u5C06\u51CF\u5C11\u76F8\u4F3C\u5185\u5BB9\u63A8\u8350)"})]}),p("div",{className:"space",style:{flex:1}}),F("button",{className:`primary-btn roll-btn ${Ae.btnClose}`,onClick:t,children:[p("svg",{style:{transform:"rotate(0deg)"},children:p("use",{xlinkHref:"#widget-close"})}),p("span",{children:"\u5173\u95ED"})]})]}),p("div",{className:Ae.modalBody,children:p("div",{className:Ae.reasonList,children:o.map(c=>p("button",{className:Ae.reason,"data-id":c.reason_id,onClick:()=>s(c.reason_id,c.reason_name),disabled:n,children:c.reason_name},c.reason_id))})})]})}const Co={show:!1,onHide:To,item:null};function To(){Eo({show:!1,item:null})}function Eo(e){Object.assign(Co,e),fm().render(p(um,{...Co,onHide:To}))}let xn;function fm(){if(!xn){const e=document.createElement("div");e.classList.add("show-dislike-container"),document.body.appendChild(e),xn=Mt(e)}return xn}function dm(e){Eo({show:!0,item:e})}function hm(e){if(!e)return"00:00";const t=Math.trunc(e/3600);e-=t*3600;const r=Math.trunc(e/60);e-=r*60;const i=[t,r,e];return i[0]===0&&i.shift(),i.map(o=>Jf(o.toString(),2,"0")).join(":")}function An(e){if(!e)return"";if(e<=9999)return e.toString();let t=(e/1e4).toFixed(1);return t=t.replace(/\.0$/,""),`${t}\u4E07`}var On={},we={};Object.defineProperty(we,"__esModule",{value:!0}),we.DEFAULT_ICON_CONFIGS=void 0,we.IconConverter=Mo,we.IconProvider=void 0,we.IconWrapper=wm;var lr=pm(Ce.default);function xo(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,r=new WeakMap;return(xo=function(n){return n?r:t})(e)}function pm(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var r=xo(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if(s!=="default"&&Object.prototype.hasOwnProperty.call(e,s)){var o=i?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(n,s,o):n[s]=e[s]}return n.default=e,r&&r.set(e,n),n}var mm=["size","strokeWidth","strokeLinecap","strokeLinejoin","theme","fill","className","spin"];function Ao(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Oo(e){for(var t=1;t=0)&&(!Object.prototype.propertyIsEnumerable.call(e,n)||(r[n]=e[n]))}return r}function vm(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,s;for(s=0;s=0)&&(r[i]=e[i]);return r}var ko={size:"1em",strokeWidth:4,strokeLinecap:"round",strokeLinejoin:"round",rtl:!1,theme:"outline",colors:{outline:{fill:"#333",background:"transparent"},filled:{fill:"#333",background:"#FFF"},twoTone:{fill:"#333",twoTone:"#2F88FF"},multiColor:{outStrokeColor:"#333",outFillColor:"#2F88FF",innerStrokeColor:"#FFF",innerFillColor:"#43CCF8"}},prefix:"i"};we.DEFAULT_ICON_CONFIGS=ko;function bm(){return"icon-"+((1+Math.random())*4294967296|0).toString(16).substring(1)}function Mo(e,t,r){var n=typeof t.fill=="string"?[t.fill]:t.fill||[],i=[],s=t.theme||r.theme;switch(s){case"outline":i.push(typeof n[0]=="string"?n[0]:"currentColor"),i.push("none"),i.push(typeof n[0]=="string"?n[0]:"currentColor"),i.push("none");break;case"filled":i.push(typeof n[0]=="string"?n[0]:"currentColor"),i.push(typeof n[0]=="string"?n[0]:"currentColor"),i.push("#FFF"),i.push("#FFF");break;case"two-tone":i.push(typeof n[0]=="string"?n[0]:"currentColor"),i.push(typeof n[1]=="string"?n[1]:r.colors.twoTone.twoTone),i.push(typeof n[0]=="string"?n[0]:"currentColor"),i.push(typeof n[1]=="string"?n[1]:r.colors.twoTone.twoTone);break;case"multi-color":i.push(typeof n[0]=="string"?n[0]:"currentColor"),i.push(typeof n[1]=="string"?n[1]:r.colors.multiColor.outFillColor),i.push(typeof n[2]=="string"?n[2]:r.colors.multiColor.innerStrokeColor),i.push(typeof n[3]=="string"?n[3]:r.colors.multiColor.innerFillColor);break}return{size:t.size||r.size,strokeWidth:t.strokeWidth||r.strokeWidth,strokeLinecap:t.strokeLinecap||r.strokeLinecap,strokeLinejoin:t.strokeLinejoin||r.strokeLinejoin,colors:i,id:e}}var Po=(0,lr.createContext)(ko),_m=Po.Provider;we.IconProvider=_m;function wm(e,t,r){return function(n){var i=n.size,s=n.strokeWidth,o=n.strokeLinecap,c=n.strokeLinejoin,l=n.theme,a=n.fill,u=n.className,d=n.spin,h=ym(n,mm),v=(0,lr.useContext)(Po),g=(0,lr.useMemo)(bm,[]),_=Mo(g,{size:i,strokeWidth:s,strokeLinecap:o,strokeLinejoin:c,theme:l,fill:a},v),b=[v.prefix+"-icon"];return b.push(v.prefix+"-icon-"+e),t&&v.rtl&&b.push(v.prefix+"-icon-rtl"),d&&b.push(v.prefix+"-icon-spin"),u&&b.push(u),lr.default.createElement("span",Oo(Oo({},h),{},{className:b.join(" ")}),r(_))}}Object.defineProperty(On,"__esModule",{value:!0});var Ro=On.default=void 0,_t=Cm(Ce.default),Sm=we;function Cm(e){return e&&e.__esModule?e:{default:e}}var Tm=(0,Sm.IconWrapper)("distraught-face",!1,function(e){return _t.default.createElement("svg",{width:e.size,height:e.size,viewBox:"0 0 48 48",fill:"none"},_t.default.createElement("path",{d:"M24 44C35.0457 44 44 35.0457 44 24C44 12.9543 35.0457 4 24 4C12.9543 4 4 12.9543 4 24C4 35.0457 12.9543 44 24 44Z",fill:e.colors[1],stroke:e.colors[0],strokeWidth:e.strokeWidth,strokeLinejoin:e.strokeLinejoin}),_t.default.createElement("path",{d:"M24 29C29 29 31 33 31 33H17C17 33 19 29 24 29Z",stroke:e.colors[2],strokeWidth:e.strokeWidth,strokeLinecap:e.strokeLinecap,strokeLinejoin:e.strokeLinejoin}),_t.default.createElement("path",{d:"M32 17L29 20L32 23",stroke:e.colors[2],strokeWidth:e.strokeWidth,strokeLinecap:e.strokeLinecap,strokeLinejoin:e.strokeLinejoin}),_t.default.createElement("path",{d:"M16 17L19 20L16 23",stroke:e.colors[2],strokeWidth:e.strokeWidth,strokeLinecap:e.strokeLinecap,strokeLinejoin:e.strokeLinejoin}))});Ro=On.default=Tm;var kn={};Object.defineProperty(kn,"__esModule",{value:!0});var Lo=kn.default=void 0,Mn=xm(Ce.default),Em=we;function xm(e){return e&&e.__esModule?e:{default:e}}var Am=(0,Em.IconWrapper)("return",!0,function(e){return Mn.default.createElement("svg",{width:e.size,height:e.size,viewBox:"0 0 48 48",fill:"none"},Mn.default.createElement("path",{d:"M12.9998 8L6 14L12.9998 21",stroke:e.colors[0],strokeWidth:e.strokeWidth,strokeLinecap:e.strokeLinecap,strokeLinejoin:e.strokeLinejoin}),Mn.default.createElement("path",{d:"M6 14H28.9938C35.8768 14 41.7221 19.6204 41.9904 26.5C42.2739 33.7696 36.2671 40 28.9938 40H11.9984",stroke:e.colors[0],strokeWidth:e.strokeWidth,strokeLinecap:e.strokeLinecap,strokeLinejoin:e.strokeLinejoin}))});Lo=kn.default=Am;const Z={biliVideoCard:"_bili-video-card_1a93a_1",imageWrapper:"_image-wrapper_1a93a_4",previewCardWrapper:"_preview-card-wrapper_1a93a_8",previewCardInner:"_preview-card-inner_1a93a_21",watchLater:"_watch-later_1a93a_25",badge:"_badge_1a93a_28",recommendReason:"_recommend-reason_1a93a_36",bangumiDesc:"_bangumi-desc_1a93a_51",btnDislike:"_btn-dislike_1a93a_54",btnDislikeIcon:"_btn-dislike-icon_1a93a_69",btnDislikeTip:"_btn-dislike-tip_1a93a_76",dislikedWrapper:"_disliked-wrapper_1a93a_91",dislikeContentCover:"_dislike-content-cover_1a93a_105",dislikeContentCoverInner:"_dislike-content-cover-inner_1a93a_111",dislikeIcon:"_dislike-icon_1a93a_122",dislikeReason:"_dislike-reason_1a93a_125",dislikeDesc:"_dislike-desc_1a93a_129",dislikeContentAction:"_dislike-content-action_1a93a_133"};function Pn(e,t){return isNaN(e)?t:e}function Om({className:e,item:t,pvideo:r,enterCursorState:n}){const i=y.useRef(null),s=Np(i),o={item:t,pvideo:r,cursorState:s,elWidth:Pn(s.elementW,n.width),elHeight:Pn(s.elementH,n.height),relativeX:Pn(s.elementX,n.relativeX)};return p("div",{ref:i,className:te(Z.previewCardWrapper,e),children:r?p(km,{...o}):!1})}function km({item:e,pvideo:t,elWidth:r,elHeight:n,relativeX:i}){var S;let s=0,o=0;r&&i&&!isNaN(i)&&!isNaN(r)&&(s=i/r,s<0&&(s=0),s>1&&(s=1),o=Math.floor((e.duration||0)*s));let c=y.useMemo(()=>{const A=(t==null?void 0:t.index)||[];let E=Pm(A,o);return E!==-1?E:o>A[A.length-1]?(E=Math.floor(A.length*s)-1,E<0&&(E=0),E):0},[t,o]);const{img_x_len:l,img_y_len:a,img_x_size:u,img_y_size:d}=t,h=a*l;c=c+1;const v=Math.floor(c/h),g=c-v*h,_=((S=t.image)==null?void 0:S[v])||"",b=Math.floor(g/l)+1,T=g-(b-1)*l,D=r*l,L=n*a,k=(b-1)*n,C=(T-1)*r;return p("div",{className:Z.previewCardInner,style:{backgroundColor:"black",backgroundImage:`url(${_})`,backgroundPosition:`-${C}px -${k}px`,backgroundSize:`${D}px ${L}px`},children:p(Mm,{progress:s})})}function Mm({progress:e}){return p("div",{className:"track",style:{position:"absolute",bottom:0,left:0,backgroundColor:"#eee",width:"100%",height:2},children:p("div",{className:"bar",style:{backgroundColor:"#fa6a9d",height:"100%",width:`${e*100}%`}})})}function Pm(e,t){var c;let r=0,n=e.length-1,i=-1;for(;r<=n;){const l=Math.floor((r+n)/2),a=e[l];if(t===a)return l;a{if(!e)return"";const t=co.unix(e);return t.format("YYYY")===Rm?t.format("M-D"):t.format("YY-M-D")},Nm=e=>e.replace(/^http:\/\//,"https://"),Rn=y.memo(function({style:t,className:r,item:n,loading:i}){i=i!=null?i:!n;const s=F("div",{className:te("bili-video-card__skeleton",{hide:!i}),children:[p("div",{className:"bili-video-card__skeleton--cover"}),p("div",{className:"bili-video-card__skeleton--info",children:F("div",{className:"bili-video-card__skeleton--right",children:[p("p",{className:"bili-video-card__skeleton--text"}),p("p",{className:"bili-video-card__skeleton--text short"}),p("p",{className:"bili-video-card__skeleton--light"})]})})]}),o=lm(n==null?void 0:n.param);return F("div",{style:t,className:te("bili-video-card",Z.biliVideoCard,r),"data-report":"partition_recommend.content",children:[s,!i&&n&&(o?p(Dm,{item:n,dislikedReason:o}):p(Fm,{item:n}))]})}),Dm=y.memo(function({dislikedReason:t,item:r}){const n=Y(async()=>{if(!(t!=null&&t.id))return;let i=!1,s=null;try{i=await am(r,t.id)}catch(o){s=o}if(s)return console.error(s.stack||s),mo();i?ue("\u5DF2\u64A4\u9500"):go(),i&&En.delete(r.param)});return F("div",{className:te(Z.dislikedWrapper),children:[p("div",{className:Z.dislikeContentCover,children:F("div",{className:Z.dislikeContentCoverInner,children:[p(Ro,{theme:"outline",size:"32",fill:"#333",className:Z.dislikeIcon}),p("div",{className:Z.dislikeReason,children:t==null?void 0:t.name}),p("div",{className:Z.dislikeDesc,children:"\u5C06\u51CF\u5C11\u6B64\u7C7B\u5185\u5BB9\u63A8\u8350"})]})}),p("div",{className:Z.dislikeContentAction,children:F("button",{onClick:n,children:[p(Lo,{theme:"outline",size:"16",fill:"#333",style:{marginRight:4,fontSize:0,marginTop:-2}}),"\u64A4\u9500"]})})]})}),Fm=y.memo(function({item:t}){const r=y.useRef(null),[n,i]=y.useState(()=>({width:0,height:0,relativeX:0}));rr("mouseenter",fe=>{var Xo;const pr=(Xo=r.current)==null?void 0:Xo.getBoundingClientRect();if(!pr)return;const{width:mr,height:Kn,x:Tg}=pr;i({width:mr,height:Kn,relativeX:fe.pageX-window.pageXOffset-Tg})},{target:r});const s=mn(r),o=y.useRef(null),c=mn(o),[l,a]=y.useState(!1),{accessKey:u}=Me(),d=Boolean(u),{param:h,title:v,cover:g,goto:_,play:b,like:T,coin:D,desc:L,danmaku:k,ctime:C,duration:S,name:A,face:E,mid:M,favorite:P,badge:oe,rcmd_reason:ne}=t,N=y.useMemo(()=>Lm(C),[C]),O=y.useMemo(()=>Nm(g),[g]),[x,I]=y.useState(null),[f,m]=y.useState(!1),w=Y(async()=>{if(!x&&!f)try{m(!0);const fe=await nm(h);I(fe)}finally{m(!1)}});y.useEffect(()=>{s&&w()},[s]);let R=!1;const z=Y(async fe=>{if(fe.preventDefault(),R)return;R=!0;const pr=l?sm:im;let mr=!1;try{mr=await pr(h)}finally{R=!1}mr&&a(Kn=>!Kn)}),$=y.useRef(null),j=mn($),W=Y(fe=>{fe.stopPropagation(),fe.preventDefault(),dm(t)}),U=t.goto==="bangumi",Q=t.goto==="av",ae=Q?`/video/av${h}`:t.uri,Se=y.useMemo(()=>hm(S),[S]),X=y.useMemo(()=>An(b),[b]),pe=y.useMemo(()=>An(T),[T]),wt=y.useMemo(()=>An(P),[P]);return F("div",{className:"bili-video-card__wrap __scale-wrap",children:[p("a",{href:ae,target:"_blank","data-mod":"partition_recommend","data-idx":"content","data-ext":"click",children:F("div",{className:"bili-video-card__image __scale-player-wrap",ref:r,children:[F("div",{className:te("bili-video-card__image--wrap",Z.imageWrapper),children:[F("picture",{className:"v-img bili-video-card__cover",children:[p("source",{srcSet:`${O}@672w_378h_1c.webp`,type:"image/webp"}),p("img",{src:`${O}@672w_378h_1c.webp`,alt:v,loading:"lazy"})]}),s&&p(Om,{item:t,pvideo:x==null?void 0:x.pvideoData,enterCursorState:n}),F("div",{className:`bili-watch-later ${Z.watchLater}`,style:{display:s?"flex":"none"},ref:o,onClick:z,children:[p("svg",{className:"bili-watch-later__icon",children:p("use",{xlinkHref:l?"#widget-watch-save":"#widget-watch-later"})}),p("span",{className:"bili-watch-later__tip",style:{display:c?"block":"none"},children:l?"\u79FB\u9664":"\u7A0D\u540E\u518D\u770B"})]}),d&&F("div",{ref:$,className:Z.btnDislike,onClick:W,style:{display:s?"flex":"none"},children:[p("svg",{className:Z.btnDislikeIcon,children:p("use",{xlinkHref:"#widget-close"})}),p("span",{className:Z.btnDislikeTip,style:{display:j?"block":"none"},children:"\u6211\u4E0D\u60F3\u770B"})]})]}),p("div",{className:"bili-video-card__mask",children:F("div",{className:"bili-video-card__stats",children:[F("div",{className:"bili-video-card__stats--left",children:[F("span",{className:"bili-video-card__stats--item",children:[p("svg",{className:"bili-video-card__stats--icon",children:p("use",{xlinkHref:"#widget-play-count"})}),p("span",{className:"bili-video-card__stats--text",children:X})]}),p("span",{className:"bili-video-card__stats--item",children:_==="av"?F(Re,{children:[p("svg",{className:"bili-video-card__stats--icon",children:p("use",{xlinkHref:"#widget-agree"})}),p("span",{className:"bili-video-card__stats--text",children:pe})]}):F(Re,{children:[p("svg",{className:"bili-video-card__stats--icon",children:p("use",{xlinkHref:"#widget-agree"})}),p("span",{className:"bili-video-card__stats--text",children:wt})]})})]}),p("span",{className:"bili-video-card__stats__duration",children:Q&&Se})]})})]})}),p("div",{className:"bili-video-card__info __scale-disable",children:F("div",{className:"bili-video-card__info--right",children:[p("a",{href:ae,target:"_blank","data-mod":"partition_recommend","data-idx":"content","data-ext":"click",children:p("h3",{className:"bili-video-card__info--tit",title:v,children:v})}),F("p",{className:"bili-video-card__info--bottom",children:[Q&&F("a",{className:"bili-video-card__info--owner",href:`//space.bilibili.com/${M}`,target:"_blank","data-mod":"partition_recommend","data-idx":"content","data-ext":"click",children:[ne!=null&&ne.content?p("span",{className:Z.recommendReason,children:ne.content}):p("svg",{className:"bili-video-card__info--owner__up",children:p("use",{xlinkHref:"#widget-up"})}),p("span",{className:"bili-video-card__info--author",children:A}),N&&F("span",{className:"bili-video-card__info--date",children:["\xB7 ",N]})]}),U&&F("a",{className:"bili-video-card__info--owner",href:ae,target:"_blank",children:[p("span",{className:Z.badge,children:oe}),p("span",{className:Z.bangumiDesc,children:L})]})]})]})})]})});var ur={exports:{}},Ln={exports:{}},No={},$m=function(t){return t&&typeof t=="object"&&typeof t.copy=="function"&&typeof t.fill=="function"&&typeof t.readUInt8=="function"},Nn={exports:{}};typeof Object.create=="function"?Nn.exports=function(t,r){t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:Nn.exports=function(t,r){t.super_=r;var n=function(){};n.prototype=r.prototype,t.prototype=new n,t.prototype.constructor=t},function(e){var t=/%[sdj%]/g;e.format=function(f){if(!L(f)){for(var m=[],w=0;w=z)return W;switch(W){case"%s":return String(R[w++]);case"%d":return Number(R[w++]);case"%j":try{return JSON.stringify(R[w++])}catch{return"[Circular]"}default:return W}}),j=R[w];w=3&&(w.depth=arguments[2]),arguments.length>=4&&(w.colors=arguments[3]),_(m)?w.showHidden=m:m&&e._extend(w,m),C(w.showHidden)&&(w.showHidden=!1),C(w.depth)&&(w.depth=2),C(w.colors)&&(w.colors=!1),C(w.customInspect)&&(w.customInspect=!0),w.colors&&(w.stylize=s),l(w,f,w.depth)}e.inspect=i,i.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},i.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function s(f,m){var w=i.styles[m];return w?"\x1B["+i.colors[w][0]+"m"+f+"\x1B["+i.colors[w][1]+"m":f}function o(f,m){return f}function c(f){var m={};return f.forEach(function(w,R){m[w]=!0}),m}function l(f,m,w){if(f.customInspect&&m&&P(m.inspect)&&m.inspect!==e.inspect&&!(m.constructor&&m.constructor.prototype===m)){var R=m.inspect(w,f);return L(R)||(R=l(f,R,w)),R}var z=a(f,m);if(z)return z;var $=Object.keys(m),j=c($);if(f.showHidden&&($=Object.getOwnPropertyNames(m)),M(m)&&($.indexOf("message")>=0||$.indexOf("description")>=0))return u(m);if($.length===0){if(P(m)){var W=m.name?": "+m.name:"";return f.stylize("[Function"+W+"]","special")}if(S(m))return f.stylize(RegExp.prototype.toString.call(m),"regexp");if(E(m))return f.stylize(Date.prototype.toString.call(m),"date");if(M(m))return u(m)}var U="",Q=!1,ae=["{","}"];if(g(m)&&(Q=!0,ae=["[","]"]),P(m)){var Se=m.name?": "+m.name:"";U=" [Function"+Se+"]"}if(S(m)&&(U=" "+RegExp.prototype.toString.call(m)),E(m)&&(U=" "+Date.prototype.toUTCString.call(m)),M(m)&&(U=" "+u(m)),$.length===0&&(!Q||m.length==0))return ae[0]+U+ae[1];if(w<0)return S(m)?f.stylize(RegExp.prototype.toString.call(m),"regexp"):f.stylize("[Object]","special");f.seen.push(m);var X;return Q?X=d(f,m,w,j,$):X=$.map(function(pe){return h(f,m,w,j,pe,Q)}),f.seen.pop(),v(X,U,ae)}function a(f,m){if(C(m))return f.stylize("undefined","undefined");if(L(m)){var w="'"+JSON.stringify(m).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return f.stylize(w,"string")}if(D(m))return f.stylize(""+m,"number");if(_(m))return f.stylize(""+m,"boolean");if(b(m))return f.stylize("null","null")}function u(f){return"["+Error.prototype.toString.call(f)+"]"}function d(f,m,w,R,z){for(var $=[],j=0,W=m.length;j-1&&($?W=W.split(` `).map(function(Q){return" "+Q}).join(` `).substr(2):W=` `+W.split(` `).map(function(Q){return" "+Q}).join(` `))):W=f.stylize("[Circular]","special")),C(j)){if($&&z.match(/^\d+$/))return W;j=JSON.stringify(""+z),j.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(j=j.substr(1,j.length-2),j=f.stylize(j,"name")):(j=j.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),j=f.stylize(j,"string"))}return j+": "+W}function v(f,m,w){var R=f.reduce(function(z,$){return $.indexOf(` `)>=0,z+$.replace(/\u001b\[\d\d?m/g,"").length+1},0);return R>60?w[0]+(m===""?"":m+` `)+" "+f.join(`, `)+" "+w[1]:w[0]+m+" "+f.join(", ")+" "+w[1]}function g(f){return Array.isArray(f)}e.isArray=g;function _(f){return typeof f=="boolean"}e.isBoolean=_;function b(f){return f===null}e.isNull=b;function T(f){return f==null}e.isNullOrUndefined=T;function D(f){return typeof f=="number"}e.isNumber=D;function L(f){return typeof f=="string"}e.isString=L;function k(f){return typeof f=="symbol"}e.isSymbol=k;function C(f){return f===void 0}e.isUndefined=C;function S(f){return A(f)&&ne(f)==="[object RegExp]"}e.isRegExp=S;function A(f){return typeof f=="object"&&f!==null}e.isObject=A;function E(f){return A(f)&&ne(f)==="[object Date]"}e.isDate=E;function M(f){return A(f)&&(ne(f)==="[object Error]"||f instanceof Error)}e.isError=M;function P(f){return typeof f=="function"}e.isFunction=P;function oe(f){return f===null||typeof f=="boolean"||typeof f=="number"||typeof f=="string"||typeof f=="symbol"||typeof f>"u"}e.isPrimitive=oe,e.isBuffer=$m;function ne(f){return Object.prototype.toString.call(f)}function N(f){return f<10?"0"+f.toString(10):f.toString(10)}var O=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function x(){var f=new Date,m=[N(f.getHours()),N(f.getMinutes()),N(f.getSeconds())].join(":");return[f.getDate(),O[f.getMonth()],m].join(" ")}e.log=function(){console.log("%s - %s",x(),e.format.apply(e,arguments))},e.inherits=Nn.exports,e._extend=function(f,m){if(!m||!A(m))return f;for(var w=Object.keys(m),R=w.length;R--;)f[w[R]]=m[w[R]];return f};function I(f,m){return Object.prototype.hasOwnProperty.call(f,m)}}(No);var Im=No.format;function jm(){(typeof AbortController>"u"||typeof AbortSignal>"u")&&console.error("[promise.timeout] need global AbortController & AbortSingal")}function zm(e,t){return function(){var r=this,n=[].slice.call(arguments);jm();var i=new AbortController;return n.push(i.signal),new Promise(function(s,o){var c=setTimeout(function(){var l=new fr(t);o(l),i.abort()},t);Promise.resolve(e.apply(r,n)).then(function(l){clearTimeout(c),s(l)},function(l){clearTimeout(c),o(l)})})}}class fr extends Error{constructor(t){super(),this.timeout=t,this.message=Im("timeout of %sms exceed",t),Error.captureStackTrace(this,fr)}}Ln.exports=zm,Ln.exports.TimeoutError=fr;const Do=Ln.exports,Wm=Do.TimeoutError;ur.exports=function(t,r){const n=t;r=r||{};const i=r.times||5,s=r.timeout;s&&(t=Do(t,s));const o=r.onerror;return async function(){const c=this,l=[].slice.call(arguments),a=new Array(i);for(let u=0;u"} ${this.times} times`,this.timeout&&(this.message+=` with timeout = ${this.timeout}ms`),Error.captureStackTrace(this,this.constructor)}}class Bm extends Error{constructor(t){super(),t instanceof Error?(this.originalError=t,{message:t}=t):(this.originalError=new Error(t),this.originalError.stack=this.stack),this.name="AbortError",this.message=t}}var Hm=ur.exports.RetryError=Fo;ur.exports.TimeoutError=Wm;const Um="bilibili-app-recommend".toUpperCase();class Dn extends Error{constructor(r){super();gr(this,"json");Error.captureStackTrace(this,Dn),this.json=r}}async function Gm(){const t=(await sr.get(yo+"/x/feed/index",{responseType:"json",params:{build:"1",mobi_app:"android",idx:(Date.now()/1e3).toFixed(0)+"0"+(Math.random()*10).toFixed(0)}})).data;if(!t.data){if(t.code===-663)throw new Dn(t);return ue(`${Um}: \u672A\u77E5\u9519\u8BEF, \u8BF7\u8054\u7CFB\u5F00\u53D1\u8005 code=${t.code} message=${t.message||""}`,1e4),[]}return t.data}const Ym=ur.exports(Gm,{times:5,timeout:2e3});async function Km(){try{return await Ym()}catch(e){throw e instanceof Hm&&(console.error(e.errors),ue("\u8BF7\u6C42\u51FA\u9519, \u8BF7\u91CD\u8BD5 !!!")),e}}async function Vm(){return Fn(2)}async function Fn(e){const t=new Array(e).fill(0).map(i=>Km());let n=(await Promise.all(t)).reduce((i,s)=>i.concat(s||[]),[]);return n=Xm(n),n.map(i=>({...i,uniqId:i.param+"-"+crypto.randomUUID()}))}function Xm(e){const t=new Set;return e=e.filter(r=>{const{param:n}=r;return t.has(n)?(console.log("[bilibili-app-recommend]: [uniqRecList]: duplicate",r),!1):(t.add(n),!0)}),e}var se={exports:{}},Jm="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Zm=Jm,Qm=Zm;function $o(){}function Io(){}Io.resetWarningCache=$o;var qm=function(){function e(n,i,s,o,c,l){if(l!==Qm){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}e.isRequired=e;function t(){return e}var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Io,resetWarningCache:$o};return r.PropTypes=r,r};se.exports=qm();class $n extends y.Component{constructor(t){super(t),this.scrollListener=this.scrollListener.bind(this),this.eventListenerOptions=this.eventListenerOptions.bind(this),this.mousewheelListener=this.mousewheelListener.bind(this)}componentDidMount(){this.pageLoaded=this.props.pageStart,this.options=this.eventListenerOptions(),this.attachScrollListener()}componentDidUpdate(){if(this.props.isReverse&&this.loadMore){const t=this.getParentElement(this.scrollComponent);t.scrollTop=t.scrollHeight-this.beforeScrollHeight+this.beforeScrollTop,this.loadMore=!1}this.attachScrollListener()}componentWillUnmount(){this.detachScrollListener(),this.detachMousewheelListener()}isPassiveSupported(){let t=!1;const r={get passive(){t=!0}};try{document.addEventListener("test",null,r),document.removeEventListener("test",null,r)}catch{}return t}eventListenerOptions(){let t=this.props.useCapture;return this.isPassiveSupported()?t={useCapture:this.props.useCapture,passive:!0}:t={passive:!1},t}setDefaultLoader(t){this.defaultLoader=t}detachMousewheelListener(){let t=window;this.props.useWindow===!1&&(t=this.scrollComponent.parentNode),t.removeEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture)}detachScrollListener(){let t=window;this.props.useWindow===!1&&(t=this.getParentElement(this.scrollComponent)),t.removeEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),t.removeEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture)}getParentElement(t){const r=this.props.getScrollParent&&this.props.getScrollParent();return r!=null?r:t&&t.parentNode}filterProps(t){return t}attachScrollListener(){const t=this.getParentElement(this.scrollComponent);if(!this.props.hasMore||!t)return;let r=window;this.props.useWindow===!1&&(r=t),r.addEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture),r.addEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),r.addEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture),this.props.initialLoad&&this.scrollListener()}mousewheelListener(t){t.deltaY===1&&!this.isPassiveSupported()&&t.preventDefault()}scrollListener(){const t=this.scrollComponent,r=window,n=this.getParentElement(t);let i;if(this.props.useWindow){const s=document.documentElement||document.body.parentNode||document.body,o=r.pageYOffset!==void 0?r.pageYOffset:s.scrollTop;this.props.isReverse?i=o:i=this.calculateOffset(t,o)}else this.props.isReverse?i=n.scrollTop:i=t.scrollHeight-n.scrollTop-n.clientHeight;i{this.scrollComponent=T,u&&u(T)};const b=[r];return i&&(c?o?b.unshift(c):b.push(c):this.defaultLoader&&(o?b.unshift(this.defaultLoader):b.push(this.defaultLoader))),Ce.default.createElement(n,_,b)}}gr($n,"propTypes",{children:se.exports.node.isRequired,element:se.exports.node,hasMore:se.exports.bool,initialLoad:se.exports.bool,isReverse:se.exports.bool,loader:se.exports.node,loadMore:se.exports.func.isRequired,pageStart:se.exports.number,ref:se.exports.func,getScrollParent:se.exports.func,threshold:se.exports.number,useCapture:se.exports.bool,useWindow:se.exports.bool}),gr($n,"defaultProps",{element:"div",hasMore:!1,initialLoad:!0,pageStart:0,ref:null,threshold:250,useWindow:!0,isReverse:!1,useCapture:!1,loader:null,getScrollParent:null});const In="_video-grid_14t5i_9",jo="_limit-two-lines_14t5i_19",jn="_internal-testing_14t5i_43",eg="_limit-one-line_14t5i_50",zo="_narrow-mode_14t5i_71",cy={videoGrid:In,limitTwoLines:jo,internalTesting:jn,limitOneLine:eg,narrowMode:zo};function tg({enabled:e,refresh:t,minIndex:r=0,maxIndex:n,containerRef:i,getScrollerRect:s}){const[o,c]=y.useState(null),l=Y(()=>{var P;if(o===null||!i.current)return!1;const E=s(),M=(P=i.current.querySelector(`.${qe.card}.${qe.cardActive}`))==null?void 0:P.getBoundingClientRect();return!(!E||!M||M.top-E.top<-(E.height+M.height)||M.top-E.top>E.height*2+M.height)}),a=Y((E,M)=>{if(!e)return;M==null||M.preventDefault();const P=l()?o+E:T();if(!(Pn){C(n);return}c(P),C(P)}}),u=y.useCallback(E=>{a(-1,E)},[]),d=y.useCallback(E=>{a(1,E)},[]);We("leftarrow",u),We("rightarrow",d);const h=y.useCallback(E=>{a(-A(),E)},[]),v=y.useCallback(E=>{a(A(),E)},[]);We("uparrow",h),We("downarrow",v);const g=Y(()=>{!o||!e||S(o)}),_=Y(()=>{!e||c(null)});We("enter",g),We("esc",_);const b=Y(()=>{!e||t()});We("r",b,{exactMatch:!0});function T(){const E=s();if(!E)return 0;const M=L();for(let P=0;P=E.top)return P;return 0}const D=`.${qe.card}`;function L(){var E;return[...((E=i.current)==null?void 0:E.querySelectorAll(D))||[]]}function k(E){return L()[E]}function C(E){var P;const M=k(E);(P=M==null?void 0:M.scrollIntoViewIfNeeded)==null||P.call(M,!1)}function S(E){const M=k(E);if(!M)return;const P=M.querySelector(".bili-video-card__wrap > a");P==null||P.click()}function A(){if(he.useNarrowMode)return 2;let E=Wo.get(window.innerWidth);if(E)return E;const M=i.current;if(!M)return 0;const P=window.getComputedStyle(M);return P.display!=="grid"?0:(E=P.gridTemplateColumns.split(" ").length,Wo.set(window.innerWidth,E),E)}return{activeIndex:o,clearActiveIndex:_}}const Wo=new Map,qe={loader:an` text-align: center; line-height: 60px; font-size: 120%; `,card:an` border: 2px solid transparent; /* global class under .card */ .bili-video-card__info { padding-left: 2px; padding-bottom: 1px; margin-top: calc(var(--info-margin-top) - 1px); } `,cardActive:an` border-color: #fb7299; border-radius: 6px; overflow: hidden; `},Bo=y.forwardRef(({infiteScrollUseWindow:e,shortcutEnabled:t,onScrollToTop:r,className:n,scrollerRef:i},s)=>{const[o,c]=y.useState([]),[l,a]=y.useState(!1);y.useImperativeHandle(s,()=>({refresh:u}));const u=Y(async()=>{await(r==null?void 0:r());try{b(),a(!0),c(await Fn(2)),b()}finally{a(!1)}}),d=Y(async D=>{const L=await Fn(2);c(k=>[...k,...L])}),{useNarrowMode:h}=Me(),v=y.useRef(null),g=Y(()=>{var D;if(e){const L=Ys+50;return new DOMRect(0,L,window.innerWidth,window.innerHeight-L)}else return(D=i==null?void 0:i.current)==null?void 0:D.getBoundingClientRect()}),{activeIndex:_,clearActiveIndex:b}=tg({enabled:t,refresh:u,maxIndex:o.length-1,containerRef:v,getScrollerRect:g}),T=Us();return p($n,{pageStart:0,loadMore:d,hasMore:!0,useWindow:e,threshold:360,style:{minHeight:"100%"},loader:p("div",{className:qe.loader,children:"\u52A0\u8F7D\u4E2D..."},0),children:p("div",{ref:v,className:te(In,{[jn]:T},{[zo]:h},n),children:o.map((D,L)=>p(Rn,{loading:l,item:D,className:te(qe.card,{[qe.cardActive]:L===_})},D.uniqId))})})}),rg={checkbox:"_checkbox_5cp8u_1"};async function ng(){var l,a;const t=(await yr.default.get("https://passport.bilibili.com/login/app/third",{params:{appkey:"27eb53fc9058f8c3",api:"https://www.mcbbs.net/template/mcbbs/image/special_photo_bg.png",sign:"04224646d1fea004e79606d3b038c84a"},withCredentials:!0})).data;if(!((l=t==null?void 0:t.data)!=null&&l.has_login))return{errmsg:"\u4F60\u5FC5\u987B\u767B\u5F55B\u7AD9\u4E4B\u540E\u624D\u80FD\u4F7F\u7528\u6388\u6743",json:t};if(!((a=t==null?void 0:t.data)!=null&&a.confirm_uri))return{errmsg:"\u65E0\u6CD5\u83B7\u5F97\u6388\u6743\u7F51\u5740",json:t};const r=t.data.confirm_uri;let n;const i=new Promise(u=>{window.addEventListener("message",d=>{if(d.origin!="https://www.mcbbs.net"||!d.data)return;const h=d.data.match(/access_key=([0-9a-z]{32})/);if(!h||!h[1])return u({errmsg:"\u6CA1\u6709\u83B7\u5F97\u5339\u914D\u7684\u5BC6\u94A5"});u(h[1])}),n=setTimeout(()=>{u({errmsg:"\u83B7\u53D6\u6388\u6743\u8D85\u65F6"})},10*1e3)}),s=document.createElement("iframe");s.src=r,s.style.display="none",document.body.appendChild(s);function o(){s.remove(),n&&(clearTimeout(n),n=null)}const c=await i;return o(),c}async function ig(){const e=await ng();if(typeof e=="object"&&"errmsg"in e){ue(e.errmsg);return}const t=e;return he.accessKey=t,ue("\u83B7\u53D6\u6210\u529F"),t}function sg(){he.accessKey="",ue("\u5DF2\u5220\u9664 access_key")}function zn(){const e=y.useRef(null),{accessKey:t}=Me(),r=io(ig,{manual:!0}),n=Y(async()=>{var c;await r.runAsync()&&((c=e.current)==null||c.set(!1))}),i=sg,s=Y(()=>{const o="https://github.com/indefined/UserScripts/tree/master/bilibiliHome#%E6%8E%88%E6%9D%83%E8%AF%B4%E6%98%8E";window.open(o,"_blank")});return p(Re,{children:t?F(Re,{children:[p("button",{className:"primary-btn roll-btn",onClick:s,children:p("span",{children:"access_key \u8BF4\u660E"})}),p("button",{className:"primary-btn roll-btn",onClick:()=>n(),disabled:r.loading,children:p("span",{children:"\u91CD\u65B0\u83B7\u53D6 access_key"})}),p("button",{className:"primary-btn roll-btn",onClick:i,children:p("span",{children:"\u5220\u9664 access_key"})})]}):F(Re,{children:[p("button",{className:"primary-btn roll-btn",onClick:s,children:p("span",{children:"access_key \u8BF4\u660E"})}),p("button",{className:"primary-btn roll-btn",onClick:n,disabled:r.loading,children:p("span",{children:"\u83B7\u53D6 access_key"})})]})})}var Wn={};Object.defineProperty(Wn,"__esModule",{value:!0});var Bn=Wn.default=void 0,Hn=ag(Ce.default),og=we;function ag(e){return e&&e.__esModule?e:{default:e}}var cg=(0,og.IconWrapper)("config",!1,function(e){return Hn.default.createElement("svg",{width:e.size,height:e.size,viewBox:"0 0 48 48",fill:"none"},Hn.default.createElement("path",{d:"M24 4L18 10H10V18L4 24L10 30V38H18L24 44L30 38H38V30L44 24L38 18V10H30L24 4Z",fill:e.colors[1],stroke:e.colors[0],strokeWidth:e.strokeWidth,strokeLinejoin:e.strokeLinejoin}),Hn.default.createElement("path",{d:"M24 30C27.3137 30 30 27.3137 30 24C30 20.6863 27.3137 18 24 18C20.6863 18 18 20.6863 18 24C18 27.3137 20.6863 30 24 30Z",fill:e.colors[3],stroke:e.colors[2],strokeWidth:e.strokeWidth,strokeLinejoin:e.strokeLinejoin}))});Bn=Wn.default=cg;const ee={modalMask:"_modal-mask_3m0r6_1",modal:"_modal_3m0r6_1",modalHeader:"_modal-header_3m0r6_23",modalTitle:"_modal-title_3m0r6_30",configIcon:"_config-icon_3m0r6_37",btnClose:"_btn-close_3m0r6_42",modalBody:"_modal-body_3m0r6_60",settingsGroup:"_settings-group_3m0r6_65",settingsGroupTitle:"_settings-group-title_3m0r6_68",settingsGroupContent:"_settings-group-content_3m0r6_71",row:"_row_3m0r6_77",check:"_check_3m0r6_81"},Un={container:{name:"8irbms",styles:"display:inline-flex;align-items:center"},checkbox:{name:"4l4ubo",styles:"cursor:pointer;outline:none"},label:{name:"side0b",styles:"margin-left:2px;user-select:none;cursor:pointer"}};function dr({configKey:e,label:t,className:r}){const i=!!Me()[e],s=y.useCallback(c=>{const l=c.target.checked;Sd({[e]:l}),l&&e==="initialShowMore"&&ue("\u5DF2\u5F00\u542F\u81EA\u52A8\u67E5\u770B\u66F4\u591A: \u4E0B\u6B21\u6253\u5F00\u9996\u9875\u65F6\u5C06\u76F4\u63A5\u5C55\u793A\u63A8\u8350\u5F39\u6846")},[]),o=y.useId();return F("span",{css:Un.container,className:r,children:[p("input",{type:"checkbox",id:o,checked:i,onChange:s,css:Un.checkbox}),p("label",{htmlFor:o,css:Un.label,children:t||e})]})}var lg={name:"1qkltea",styles:"margin-left:5px"};const ug=function(){const e=lg;return F(Re,{children:[p(dr,{configKey:"initialShowMore",label:"\u81EA\u52A8\u67E5\u770B\u66F4\u591A",css:e}),p(dr,{configKey:"useNarrowMode",label:"\u542F\u7528\u7A84\u5C4F\u6A21\u5F0F",css:e})]})};function fg({show:e,onHide:t}){const r=y.useId(),{pureRecommend:n}=Me(),i=cn();return F(vn,{show:e,onHide:t,clsModalMask:ee.modalMask,clsModal:ee.modal,hideWhenMaskOnClick:!0,children:[F("div",{className:ee.modalHeader,children:[F("div",{className:ee.modalTitle,children:[p(Bn,{theme:"outline",size:"24",fill:i?"#fff":"#333",className:ee.configIcon}),"\u8BBE\u7F6E\u9879"]}),p("div",{className:"space",style:{flex:1}}),F("button",{className:`primary-btn roll-btn ${ee.btnClose}`,onClick:t,children:[p("svg",{style:{transform:"rotate(0deg)"},children:p("use",{xlinkHref:"#widget-close"})}),p("span",{children:"\u5173\u95ED"})]})]}),F("main",{className:ee.modalBody,children:[F("div",{className:ee.settingsGroup,children:[p("div",{className:ee.settingsGroupTitle,children:"Auth"}),p("div",{className:te(ee.settingsGroupContent,ee.row),children:p(zn,{})})]}),F("div",{className:ee.settingsGroup,children:[p("div",{className:ee.settingsGroupTitle,children:"\u5F00\u5173"}),F("div",{className:te(ee.settingsGroupContent,ee.row),children:[p("input",{type:"checkbox",className:rg.checkbox,id:r,checked:n,onChange:async s=>{he.pureRecommend=s.target.checked,ue("\u5373\u5C06\u5237\u65B0\u7F51\u9875"),await ot.exports(500),location.reload()}}),p("label",{htmlFor:r,children:"\u5F00\u542F\u7EAF\u5206\u4EAB\u6A21\u5F0F"}),p(dr,{configKey:"initialShowMore",label:"\u81EA\u52A8\u67E5\u770B\u66F4\u591A",className:ee.check}),p(dr,{configKey:"useNarrowMode",label:"\u542F\u7528\u7A84\u5C4F\u6A21\u5F0F",className:ee.check})]})]})]})]})}const Ho={expandBtn:"_expand-btn_wdzp9_1",expanded:"_expanded_wdzp9_12"},Uo=y.forwardRef(function({children:t},r){const[n,i]=so(!1);y.useImperativeHandle(r,()=>i,[i]);const s=p("button",{className:te("primary-btn",Ho.expandBtn),onClick:i.toggle,children:p("svg",{className:te({[Ho.expanded]:n}),children:p("use",{xlinkHref:"#widget-arrow"})})});return F(Re,{children:[s,n&&t]})}),Ne={modalMask:"_modal-mask_1f28q_1",narrowMode:"_narrow-mode_1f28q_13",modal:"_modal_1f28q_1",modalHeader:"_modal-header_1f28q_38",modalTitle:"_modal-title_1f28q_46",btnRefresh:"_btn-refresh_1f28q_51",btnClose:"_btn-close_1f28q_52",modalBody:"_modal-body_1f28q_68"},dg=y.memo(function({show:t,onHide:r}){const n=y.useRef(null),i=y.useRef(null),{useNarrowMode:s}=Me(),o=y.useMemo(()=>({[Ne.narrowMode]:s}),[s]),c=Y(()=>{var a;return(a=i.current)==null?void 0:a.refresh()}),l=Y(()=>{n.current&&(n.current.scrollTop=0)});return F(vn,{show:t,onHide:r,clsModalMask:te(Ne.modalMask,o),clsModal:te(Ne.modal,o),children:[F("div",{className:Ne.modalHeader,children:[p("div",{className:Ne.modalTitle,children:"\u63A8\u8350"}),p("div",{className:"space",style:{flex:1}}),p(Uo,{children:p(ug,{})}),F("button",{className:`primary-btn roll-btn ${Ne.btnRefresh}`,onClick:c,children:[p("svg",{children:p("use",{xlinkHref:"#widget-roll"})}),p("span",{children:"\u6362\u4E00\u6362"})]}),F("button",{className:`primary-btn roll-btn ${Ne.btnClose}`,onClick:r,children:[p("svg",{children:p("use",{xlinkHref:"#widget-close"})}),p("span",{children:"\u5173\u95ED"})]})]}),p("div",{className:Ne.modalBody,ref:n,children:p(Bo,{ref:i,shortcutEnabled:t,onScrollToTop:l,infiteScrollUseWindow:!1,scrollerRef:n})})]})});var Gn={};Object.defineProperty(Gn,"__esModule",{value:!0});var Go=Gn.useSticky=void 0;const Yn=Ce.default;function hg(){const e=(0,Yn.useRef)(null),[t,r]=(0,Yn.useState)(!1);return(0,Yn.useEffect)(()=>{function n(){if(!e.current)return;const i=e.current.getBoundingClientRect().top,s=parseInt(getComputedStyle(e.current).top),o=i<=s;o&&!t?r(!0):!o&&t&&r(!1)}return n(),document.addEventListener("scroll",n),window.addEventListener("resize",n),window.addEventListener("orientationchange",n),()=>{document.removeEventListener("scroll",n),window.removeEventListener("resize",n),window.removeEventListener("orientationchange",n)}},[t]),[e,t]}Go=Gn.useSticky=hg;const Yo={btn:Xe` padding: 0; width: 31px; height: 31px; border-radius: 50%; `,icon:Xe` svg { width: 14px; height: 14px; } `},hr=it({showMore:he.initialShowMore}),pg=function(){return st(hr)},mg=()=>{hr.showMore=!0},gg=()=>{hr.showMore=!1};function Ko({onRefresh:e}){const{accessKey:t,pureRecommend:r}=Me(),n=y.useRef(null),{showMore:i}=st(hr),[s,o]=y.useState(!1),c=y.useCallback(()=>{o(!0)},[]),l=y.useCallback(()=>{o(!1)},[]),[a,u]=Go(),d=cn();return F(Re,{children:[F("div",{ref:a,className:"area-header",css:[Xe` margin-bottom: 0; height: 50px; `,r&&Xe` position: sticky; top: ${Ys}px; z-index: 1000; `,r&&u&&Xe` background-color: var(--bg1_float); box-shadow: 0 2px 4px rgb(0 0 0 / 8%); `,"",""],children:[F("div",{className:"left",children:[p("a",{id:"\u5F71\u89C6",className:"the-world area-anchor","data-id":"25"}),p("svg",{className:"icon",children:p("use",{xlinkHref:"#channel-cinephile"})}),p("a",{className:"title",href:"#",children:p("span",{children:"\u63A8\u8350"})})]}),F("div",{className:"right",children:[p("button",{className:"primary-btn",css:Yo.btn,onClick:c,children:p(Bn,{theme:"outline",size:"24",fill:d?"#fff":"#333",css:Yo.icon})}),t?p(Uo,{ref:n,children:p(zn,{})}):p(zn,{}),F("button",{className:"primary-btn roll-btn",onClick:e,children:[p("svg",{style:{transform:"rotate(0deg)"},children:p("use",{xlinkHref:"#widget-roll"})}),p("span",{children:"\u6362\u4E00\u6362"})]}),F("button",{className:"primary-btn see-more",onClick:mg,children:[p("span",{children:"\u67E5\u770B\u66F4\u591A"}),p("svg",{children:p("use",{xlinkHref:"#widget-arrow"})})]})]})]}),p(dg,{show:i,onHide:gg}),p(fg,{show:s,onHide:l})]})}const yg={grid:Xe` /* card=299 col-gap=20 */ width: ${299*2+20}px; margin: 0 auto; `};function vg(){const{useNarrowMode:e}=Me(),{showMore:t}=pg(),r=y.useRef(null),n=Y(()=>{var s;return(s=r.current)==null?void 0:s.refresh()}),i=Y(()=>{document.documentElement.scrollTop=0});return F("section",{"data-area":"\u63A8\u8350",children:[p(Ko,{onRefresh:n}),p(Bo,{ref:r,css:[e&&yg.grid,"",""],shortcutEnabled:!t,infiteScrollUseWindow:!0,onScrollToTop:i})]})}function bg(){const e=y.useMemo(()=>new Array(20).fill(0).map(()=>crypto.randomUUID()),[]),{data:t,loading:r,error:n,refresh:i}=io(Vm);n&&console.error(n.stack||n);const s=Us();return F("section",{"data-area":"\u63A8\u8350",children:[p(Ko,{onRefresh:i}),p("div",{className:te(In,jo,{[jn]:s}),style:{marginBottom:s?30:0},children:r||n?e.map(o=>p(Rn,{},o)):t.map(o=>p(Rn,{item:o},o.uniqId))})]})}const _g=10*1e3;async function Vo(e){let t=[];const r=()=>{t=Array.from(document.querySelectorAll(e))},n=performance.now();for(;!t.length&&performance.now()-n<_g;)await ot.exports(100),r();t.forEach(i=>{i.remove()})}(function(){var t;if(location.href.startsWith("https://www.mcbbs.net/template/mcbbs/image/special_photo_bg.png?"))return window.stop(),(t=window.top)==null?void 0:t.postMessage(location.href,"https://www.bilibili.com");if(location.pathname==="/")return wg()})();async function wg(){return he.pureRecommend?Cg():Sg()}async function Sg(){const t=Date.now()+1e4;let r=null;for(;;){if(document.querySelector(".bili-layout > section.bili-grid")){r=document.querySelector(".bili-layout > section.bili-grid");break}if(Jt()&&document.querySelector(".recommended-container")){r=document.querySelector(".recommended-container");break}if(Date.now()>t)break;await ot.exports(100)}if(!r){console.error("[bilibili-app-recommend]: init fail");return}const n=document.createElement("section");r.insertAdjacentElement("afterend",n),Mt(n).render(p(bg,{}))}async function Cg(){var i,s;Jt()?((i=document.querySelector(".bili-feed4 .bili-feed4-layout"))==null||i.remove(),Vo(".bili-feed4 .header-channel")):((s=document.querySelector(".bili-layout"))==null||s.remove(),Vo(".bili-footer"));const e=document.createElement("div");e.classList.add(Jt()?"bili-feed4-layout":"bili-layout","pure-recommend");const t=document.querySelector(".bili-header");t==null||t.insertAdjacentElement("afterend",e);const r=document.createElement("section");e==null||e.appendChild(r),Mt(r).render(p(vg,{}))}})(React,ReactDOM,axios,axiosGmxhrAdapter);