!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["feeds/group-filter"]=t():e["feeds/group-filter"]=t()}(globalThis,(()=>(()=>{var e,t,n={813:(e,t,n)=>{var o=n(955)((function(e){return e[1]}));o.push([e.id,".group-filter-hide-feed {\n  display: none !important;\n}\n.group-filter-panel {\n  background-color: white;\n  font-size: 12px;\n  width: 100%;\n  border-radius: 4px;\n  box-sizing: border-box;\n  flex-direction: column;\n  padding: 12px 16px;\n}\n.group-filter-panel .group-filter-header {\n  cursor: pointer;\n  padding-bottom: 14px;\n  position: sticky;\n  top: 0;\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n}\n.group-filter-panel .group-filter-header h1 {\n  font-weight: normal;\n  font-size: 16px;\n  margin: 0;\n}\n.group-filter-panel .group-item {\n  display: flex;\n  flex-direction: row;\n  font-size: 14px;\n}\nbody.dark .group-filter-panel {\n  color: #eee;\n  background-color: #444;\n}",""]),e.exports=o},955:e=>{"use strict";
// eslint-disable-next-line func-names
e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},
// eslint-disable-next-line func-names
t.i=function(e,n,o){"string"==typeof e&&(
// eslint-disable-next-line no-param-reassign
e=[[null,e,""]]);var r={};if(o)for(var i=0;i<this.length;i++){
// eslint-disable-next-line prefer-destructuring
var a=this[i][0];null!=a&&(r[a]=!0)}for(var s=0;s<e.length;s++){var c=[].concat(e[s]);o&&r[c[0]]||(n&&(c[2]?c[2]="".concat(n," and ").concat(c[2]):c[2]=n),t.push(c))}},t}},991:(e,t,n)=>{"use strict";var o,r=function(){return void 0===o&&(
// @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805
// @see https://github.com/webpack-contrib/style-loader/issues/177
o=Boolean(window&&document&&document.all&&!window.atob)),o},i=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),a=[];function s(e){for(var t=-1,n=0;n<a.length;n++)if(a[n].identifier===e){t=n;break}return t}function c(e,t){for(var n={},o=[],r=0;r<e.length;r++){var i=e[r],c=t.base?i[0]+t.base:i[0],l=n[c]||0,d="".concat(c," ").concat(l);n[c]=l+1;var u=s(d),p={css:i[1],media:i[2],sourceMap:i[3]};-1!==u?(a[u].references++,a[u].updater(p)):a.push({identifier:d,updater:v(p,t),references:1}),o.push(d)}return o}function l(e){var t=document.createElement("style"),o=e.attributes||{};if(void 0===o.nonce){var r=n.nc;r&&(o.nonce=r)}if(Object.keys(o).forEach((function(e){t.setAttribute(e,o[e])})),"function"==typeof e.insert)e.insert(t);else{var a=i(e.insert||"head");if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(t)}return t}var d,u=(d=[],function(e,t){return d[e]=t,d.filter(Boolean).join("\n")});function p(e,t,n,o){var r=n?"":o.media?"@media ".concat(o.media," {").concat(o.css,"}"):o.css;if(e.styleSheet)e.styleSheet.cssText=u(t,r);else{var i=document.createTextNode(r),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(i,a[t]):e.appendChild(i)}}function f(e,t,n){var o=n.css,r=n.media,i=n.sourceMap;if(r?e.setAttribute("media",r):e.removeAttribute("media"),i&&"undefined"!=typeof btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),e.styleSheet)e.styleSheet.cssText=o;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(o))}}var h=null,m=0;function v(e,t){var n,o,r;if(t.singleton){var i=m++;n=h||(h=l(t)),o=p.bind(null,n,i,!1),r=p.bind(null,n,i,!0)}else n=l(t),o=f.bind(null,n,t),r=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(n)};return o(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;o(e=t)}else r()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=r());var n=c(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var o=0;o<n.length;o++){var r=s(n[o]);a[r].references--}for(var i=c(e,t),l=0;l<n.length;l++){var d=s(n[l]);0===a[d].references&&(a[d].updater(),a.splice(d,1))}n=i}}}},951:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>v});var o=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"group-filter-panel"},[t("div",{staticClass:"group-filter-header"},[t("h1",[e._v("分组")]),e._v(" "),t("switch-box",{model:{value:e.allChecked,callback:function(t){e.allChecked=t},expression:"allChecked"}})],1),e._v(" "),e._l(e.groups,(function(n,o){return t("div",{key:o,staticClass:"group-item"},[t("CheckBox",{model:{value:n.checked,callback:function(t){e.$set(n,"checked",t)},expression:"group.checked"}},[e._v("\n      "+e._s(n.name)+"\n    ")])],1)}))],2)};o._withStripped=!0;const r=coreApis.ui,i=coreApis.ajax;var a=n(649),s=n(847);let c;const l=Vue.extend({components:{SwitchBox:r.SwitchBox,CheckBox:r.CheckBox},data:()=>({groups:[],followingMap:new Map,selectedGroupIds:[],allChecked:!0}),watch:{groups:{handler(e){this.selectedGroupIds=e.filter((e=>e.checked)).map((e=>e.id)),c.cards.forEach((e=>{this.updateCard(lodash.clone(e))}))},deep:!0,immediate:!0},allChecked:{handler(e){for(const t of this.groups)t.checked=e}}},async mounted(){c=await(0,a.forEachFeedsCard)({added:e=>{this.updateCard(lodash.clone(e))}}),this.groups=await(0,i.bilibiliApi)((0,i.getJsonWithCredentials)("https://api.bilibili.com/x/relation/tags"),"分组信息获取失败").then((e=>e.map((e=>({name:e.name,checked:!0,id:e.tagid})))));const e=(0,s.getUID)();(await(0,i.getPages)({api:t=>(0,i.getJsonWithCredentials)(`https://api.bilibili.com/x/relation/followings?vmid=${e}&pn=${t}&ps=50`),getList:e=>e.data.list,getTotal:e=>e.data.total})).forEach((e=>{this.followingMap.set(e.uname,e.tag)}))},methods:{updateCard(e){const t=this.followingMap.get(e.username);t&&this.selectedGroupIds&&(t.some((e=>this.selectedGroupIds.includes(e)))?e.element.classList.remove("group-filter-hide-feed"):e.element.classList.add("group-filter-hide-feed"))}}});var d=n(991),u=n.n(d),p=n(813),f=n.n(p),h={insert:"head",singleton:!1};u()(f(),h);f().locals;var m=function(e,t,n,o,r,i,a,s){var c,l="function"==typeof e?e.options:e;if(t&&(l.render=t,l.staticRenderFns=n,l._compiled=!0),o&&(l.functional=!0),i&&(l._scopeId="data-v-"+i),a?(c=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),r&&r.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},l._ssrRegister=c):r&&(c=s?function(){r.call(this,(l.functional?this.parent:this).$root.$options.shadowRoot)}:r),c)if(l.functional){l._injectStyles=c;var d=l.render;l.render=function(e,t){return c.call(t),d(e,t)}}else{var u=l.beforeCreate;l.beforeCreate=u?[].concat(u,c):[c]}return{exports:e,options:l}}(l,o,[],!1,null,null,null);const v=m.exports},366:e=>{function t(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}t.keys=()=>[],t.resolve=t,t.id=366,e.exports=t},177:e=>{"use strict";e.exports="按照关注分组筛选动态\n"},649:e=>{"use strict";e.exports=coreApis.componentApis.feeds.api},728:e=>{"use strict";e.exports=coreApis.spinQuery},847:e=>{"use strict";e.exports=coreApis.utils}},o={};function r(e){var t=o[e];if(void 0!==t)return t.exports;var i=o[e]={id:e,exports:{}};return n[e](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,r.t=function(n,o){if(1&o&&(n=this(n)),8&o)return n;if("object"==typeof n&&n){if(4&o&&n.__esModule)return n;if(16&o&&"function"==typeof n.then)return n}var i=Object.create(null);r.r(i);var a={};e=e||[null,t({}),t([]),t(t)];for(var s=2&o&&n;"object"==typeof s&&!~e.indexOf(s);s=t(s))Object.getOwnPropertyNames(s).forEach((e=>a[e]=()=>n[e]));return a.default=()=>n,r.d(i,a),i},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nc=void 0;var i={};return(()=>{"use strict";r.d(i,{component:()=>n});const e=coreApis.componentApis.define;var t=r(649);const n=(0,e.defineComponentMetadata)({name:"feedsGroupFilter",entry:async()=>{const{select:e}=await Promise.resolve().then(r.t.bind(r,728,23));let n;if("v2"===t.feedsCardsManager.managerType){const t=await e(".bili-dyn-home--member aside.left"),o=document.createElement("section");o.classList.add("group-filter-section"),t.insertAdjacentElement("afterbegin",o),n=o}else n=await e(".home-container .left-panel");if(null===n)return;const o=await Promise.resolve().then(r.bind(r,951)),{mountVueComponent:i}=await Promise.resolve().then(r.t.bind(r,847,23));n.insertAdjacentElement("afterbegin",i(o).$el)},displayName:"动态分组过滤",author:{name:"Rinne",link:"https://github.com/OharaRinneY"},urlInclude:[/^https:\/\/t\.bilibili\.com\/$/],tags:[componentsTags.feeds],commitHash:"f8d9b5665fc198fe5b2eb39c57dab6d686e5ed74",coreVersion:"2.10.4",description:(()=>{const e=r(366);return{...Object.fromEntries(e.keys().map((t=>[t.match(/index\.(.+)\.md$/)[1],e(t)]))),"zh-CN":()=>Promise.resolve().then(r.t.bind(r,177,17)).then((e=>e.default))}})()})})(),i=i.component})()));