帕秋莉

pixiv 搜寻/浏览 工具

安装此脚本
作者推荐脚本

您可能也喜欢Pixiv 简单存图

安装此脚本
  1. // ==UserScript==
  2. // @name Patchouli
  3. // @name:en Patchouli
  4. // @name:ja パチュリー
  5. // @name:zh-TW 帕秋莉
  6. // @name:zh-CN 帕秋莉
  7. // @description An image searching/browsing tool on pixiv
  8. // @description:en An image searching/browsing tool on pixiv
  9. // @description:ja pixiv 検索機能強化
  10. // @description:zh-TW pixiv 搜尋/瀏覽 工具
  11. // @description:zh-CN pixiv 搜寻/浏览 工具
  12. // @namespace https://github.com/FlandreDaisuki
  13. // @include *://www.pixiv.net/*
  14. // @require https://unpkg.com/vue@2.6.10/dist/vue.min.js
  15. // @require https://unpkg.com/vuex@3.1.1/dist/vuex.min.js
  16. // @require https://unpkg.com/vue-i18n@8.14.1/dist/vue-i18n.min.js
  17. // @require https://unpkg.com/file-saver@2.0.2/dist/FileSaver.min.js
  18. // @require https://www.gitcdn.xyz/repo/FlandreDaisuki/zip_player/ecf3751317079fcabef70af4bd0e92411288303d/dist/zip_player.iife.min.js
  19. // @icon http://i.imgur.com/VwoYc5w.png
  20. // @connect i.pximg.net
  21. // @noframes
  22. // @author FlandreDaisuki
  23. // @license The MIT License (MIT) Copyright (c) 2016-2019 FlandreDaisuki
  24. // @compatible firefox>=52
  25. // @compatible chrome>=55
  26. // @version 4.2.4
  27. // @grant unsafeWindow
  28. // @grant GM_getValue
  29. // @grant GM.getValue
  30. // @grant GM_setValue
  31. // @grant GM.setValue
  32. // @grant GM_xmlhttpRequest
  33. // @grant GM.xmlHttpRequest
  34. // ==/UserScript==
  35.  
  36. (function (Vue, VueI18n, Vuex) {
  37. 'use strict';
  38.  
  39.  
  40. function __$styleInject ( css ) {
  41. if(!css) return ;
  42.  
  43. if(typeof(window) == 'undefined') return ;
  44. let style = document.createElement('style');
  45.  
  46. style.innerHTML = css;
  47. document.head.appendChild(style);
  48. return css;
  49. }
  50.  
  51. Vue = Vue && Vue.hasOwnProperty('default') ? Vue['default'] : Vue;
  52. VueI18n = VueI18n && VueI18n.hasOwnProperty('default') ? VueI18n['default'] : VueI18n;
  53. Vuex = Vuex && Vuex.hasOwnProperty('default') ? Vuex['default'] : Vuex;
  54.  
  55. __$styleInject("._global-header {\n z-index: 4;\n position: relative;\n}\n._global-header .ui-search {\n z-index: auto;\n}\n._global-header.koakuma-placeholder {\n /* I don't know why #koakuma just 32px\n but it should preserve 42px to keep all spacing correct */\n margin-bottom: 42px;\n}\nul.menu-items > li.current > a {\n color: black;\n font-weight: bold;\n text-decoration: none;\n}\n#toolbar-items {\n z-index: 5;\n}\n.ω {\n display: flex;\n flex-flow: row wrap;\n justify-content: center;\n position: relative;\n}\n.ω,\n.ω .layout-a,\n.ω .layout-body {\n transition: width 0.2s;\n}\n.ω.↔,\n.ω.↔ .layout-a,\n.ω.↔ .layout-body {\n width: 100% !important;\n}\n.ω.↔ .layout-a {\n display: flex;\n flex-direction: row-reverse;\n}\n.ω.↔ .layout-column-2 {\n flex: 1;\n margin-left: 20px;\n}\n.ω.↔ .layout-body,\n.ω.↔ .layout-a {\n margin: 10px 20px;\n}\n\n._28nOzbY {\n /* Fix Koakuma will cover pixiv recommended popup\n when follow user in NewProfilePage */\n z-index: 4;\n}\n\n/* annoyings, ref: lib/pixiv.js */\n\n/* Ad */\n.ad,\n.ads_area,\n.ad-footer,\n.ads_anchor,\n.ads-top-info,\n.comic-hot-works,\n.user-ad-container,\n.ads_area_no_margin,\n/* Premium */\n.hover-item,\n.ad-printservice,\n.bookmark-ranges,\n.require-premium,\n.showcase-reminder,\n.sample-user-search,\n.popular-introduction,\n._premium-lead-tag-search-bar,\n._premium-lead-popular-d-body,\n._premium-lead-promotion-banner {\n display: none !important;\n}\n\n:root {\n --new-default-image-item-square-size: 184px;\n --default-image-item-image-square-size: 200px;\n --loading-icon-size: 72px;\n --loading-icon-color: #0096fa;\n}\n\n/* dotted focus */\na::-moz-focus-inner,\nbutton::-moz-focus-inner {\n border: 0 !important;\n outline: 0 !important;\n}\na:focus,\nbutton:focus {\n outline: 0 !important;\n}\n");
  56.  
  57. const MAIN_PAGE_TYPE = {
  58. ANCIENT_FOLLOWED_NEWS: Symbol('ANCIENT_FOLLOWED_NEWS'),
  59. FOLLOWED_NEWS: Symbol('FOLLOWED_NEWS'),
  60. NEW_PROFILE: Symbol('NEW_PROFILE'),
  61. NEW_PROFILE_BOOKMARK: Symbol('NEW_PROFILE_BOOKMARK'),
  62. NEW_PROFILE_ILLUST: Symbol('NEW_PROFILE_ILLUST'),
  63. NEW_PROFILE_MANGA: Symbol('NEW_PROFILE_MANGA'),
  64. NO_SUPPORT: Symbol('NO_SUPPORT'),
  65. SEARCH: Symbol('SEARCH'),
  66. SELF_BOOKMARK: Symbol('SELF_BOOKMARK'),
  67. };
  68. const SORT_TYPE = {
  69. BOOKMARK_COUNT: 2,
  70. BOOKMARK_ID: 1,
  71. ILLUST_ID: 0,
  72. };
  73. const NPP_TYPE_COUNT = 5;
  74. const $ = (selector) => {
  75. return document.querySelector(selector);
  76. };
  77. const $$ = (selector) => {
  78. return [...document.querySelectorAll(selector)];
  79. };
  80. const $$find = (doc, selector) => {
  81. return [...doc.querySelectorAll(selector)];
  82. };
  83. const $el = (tag, attr = {}, cb = () => {}) => {
  84. const el = document.createElement(tag);
  85. Object.assign(el, attr);
  86. cb(el);
  87. return el;
  88. };
  89. const $print = {
  90. debug(...args) {
  91. console.debug.apply(console, [...args]);
  92. },
  93. error(...args) {
  94. console.error.apply(console, [...args]);
  95. },
  96. log(...args) {
  97. console.log.apply(console, [...args]);
  98. },
  99. };
  100. const toInt = (x) => {
  101. const t = Number(x);
  102. return isNaN(t) ? 0 : Math.floor(t);
  103. };
  104. const toFormUrlencoded = (o) => {
  105. return new URLSearchParams(o).toString();
  106. };
  107. async function waitUntil(func, { ms = 100, maxCount = 20 } = {}) {
  108. return new Promise((resolve, reject) => {
  109. let c = maxCount;
  110. const i = setInterval(() => {
  111. const r = func();
  112. if (r) {
  113. clearInterval(i);
  114. resolve(r);
  115. } else if (c <= 0) {
  116. clearInterval(i);
  117. reject();
  118. } else {
  119. c -= 1;
  120. }
  121. }, ms);
  122. });
  123. }
  124. async function $ready(func) {
  125. return waitUntil(func, { maxCount: Infinity })
  126. .catch($print.error);
  127. }
  128. Vue.use(VueI18n);
  129. const en = {
  130. config: {
  131. blacklist: 'Blacklist',
  132. contextMenuExtension: 'Right click extension',
  133. hoverPlay: 'Mouse hover play ugoira',
  134. userTooltip: 'Illustrator tooltip',
  135. },
  136. contextMenu: {
  137. addToBlacklist: 'Add to Blacklist',
  138. download: 'Download',
  139. followUser: 'Follow',
  140. openBookmarkPage: 'Add Bookmark Page',
  141. preview: 'Preview',
  142. thumbUp: 'Like',
  143. },
  144. ctrlPanel: {
  145. buttonEnd: 'End',
  146. buttonGo: 'Go',
  147. buttonPause: 'Pause',
  148. fitWidth: 'fit browser width',
  149. sortByBookmarkId: 'sort by bookmark id',
  150. sortByDate: 'sort by date',
  151. sortByPopularity: 'sort by popularity',
  152. tagFilterQueryPlaceholder: 'tags filter example: flandre || sister',
  153. },
  154. mainView: {
  155. bookmarkTooltip: '{count} bookmarks',
  156. newProfilePage: {
  157. bookmarks: 'Bookmarks',
  158. contents: 'Contents',
  159. illustrations: 'Illustrations',
  160. manga: 'Manga',
  161. noResult: 'Not found',
  162. privateBookmark: 'Private',
  163. publicBookmark: 'Public',
  164. },
  165. },
  166. };
  167. const ja = {
  168. config: {
  169. blacklist: 'ブラックリスト',
  170. contextMenuExtension: '右クリックの拡張機能',
  171. hoverPlay: 'マウスオーバーでうごイラ再生',
  172. userTooltip: 'イラストレーターツールチップ',
  173. },
  174. contextMenu: {
  175. addToBlacklist: 'ブラックリストへ',
  176. download: 'ダウンロード',
  177. followUser: 'フォローする',
  178. openBookmarkPage: 'ブックマーク追加ページ',
  179. preview: 'プレビュー',
  180. thumbUp: 'いいね',
  181. },
  182. ctrlPanel: {
  183. buttonEnd: '終了',
  184. buttonGo: '捜す',
  185. buttonPause: '中断',
  186. fitWidth: '全幅',
  187. sortByBookmarkId: 'ブックマーク順',
  188. sortByDate: '投稿順',
  189. sortByPopularity: '人気順',
  190. tagFilterQueryPlaceholder: 'タグフィルター 例: フランドール || 妹様',
  191. },
  192. mainView: {
  193. bookmarkTooltip: '{count} 件のブックマーク',
  194. newProfilePage: {
  195. bookmarks: 'ブックマーク',
  196. contents: '作品',
  197. illustrations: 'イラスト',
  198. manga: 'マンガ',
  199. noResult: '作品がありません',
  200. privateBookmark: '非公開',
  201. publicBookmark: '公開',
  202. },
  203. },
  204. };
  205. const zhCN = {
  206. config: {
  207. blacklist: '黑名單',
  208. contextMenuExtension: '右键扩展',
  209. hoverPlay: '鼠标播放动图',
  210. userTooltip: '绘师提示框',
  211. },
  212. contextMenu: {
  213. addToBlacklist: '拉黑',
  214. download: '下载',
  215. followUser: '加关注',
  216. openBookmarkPage: '开启添加收藏页',
  217. preview: '原图预览',
  218. thumbUp: '赞',
  219. },
  220. ctrlPanel: {
  221. buttonEnd: '完',
  222. buttonGo: '找',
  223. buttonPause: '停',
  224. fitWidth: '自适应浏览器宽度',
  225. sortByBookmarkId: '以加入顺序排序',
  226. sortByDate: '以日期排序',
  227. sortByPopularity: '以人气排序',
  228. tagFilterQueryPlaceholder: '标签过滤 例: 芙兰朵露 || 二小姐',
  229. },
  230. mainView: {
  231. bookmarkTooltip: '{count} 个收藏',
  232. newProfilePage: {
  233. bookmarks: '收藏',
  234. contents: '作品',
  235. illustrations: '插画',
  236. manga: '漫画',
  237. noResult: '找不到作品',
  238. privateBookmark: '非公开',
  239. publicBookmark: '公开',
  240. },
  241. },
  242. };
  243. const zhTW = {
  244. config: {
  245. blacklist: '黑名單',
  246. contextMenuExtension: '擴充右鍵',
  247. hoverPlay: '滑鼠播放動圖',
  248. userTooltip: '繪師提示框',
  249. },
  250. contextMenu: {
  251. addToBlacklist: '加入黑名單',
  252. download: '下載',
  253. followUser: '加關注',
  254. openBookmarkPage: '開啟添加收藏頁',
  255. preview: '原圖預覽',
  256. thumbUp: '讚',
  257. },
  258. ctrlPanel: {
  259. buttonEnd: '完',
  260. buttonGo: '找',
  261. buttonPause: '停',
  262. fitWidth: '自適應瀏覽器寬度',
  263. sortByBookmarkId: '以加入順序排序',
  264. sortByDate: '以日期排序',
  265. sortByPopularity: '以人氣排序',
  266. tagFilterQueryPlaceholder: '標籤過濾 例: 芙蘭朵露 || 二小姐',
  267. },
  268. mainView: {
  269. bookmarkTooltip: '{count} 個收藏',
  270. newProfilePage: {
  271. bookmarks: '收藏',
  272. contents: '作品',
  273. illustrations: '插畫',
  274. manga: '漫畫',
  275. noResult: '找不到作品',
  276. privateBookmark: '非公開',
  277. publicBookmark: '公開',
  278. },
  279. },
  280. };
  281. var i18n = new VueI18n({
  282. fallbackLocale: 'ja',
  283. locale: document.documentElement.lang.toLowerCase(),
  284. messages: {
  285. en,
  286. ja,
  287. 'zh': zhCN,
  288. 'zh-cn': zhCN,
  289. 'zh-tw': zhTW,
  290. },
  291. });
  292. class ExtendableError extends Error {
  293. constructor(message) {
  294. super(message);
  295. this.name = this.constructor.name;
  296. if (typeof Error.captureStackTrace === 'function') {
  297. Error.captureStackTrace(this, this.constructor);
  298. } else {
  299. this.stack = (new Error(message)).stack;
  300. }
  301. }
  302. }
  303. class InitError extends ExtendableError {}
  304. class ConnectionError extends ExtendableError {}
  305. class Pixiv {
  306. constructor() {
  307. this._tt = null;
  308. }
  309. get tt() {
  310. if (this._tt) {
  311. return this._tt;
  312. }
  313. const inputTT = $('input[name="tt"]');
  314. if (inputTT) {
  315. this._tt = inputTT.value;
  316. } else if (window.pixiv) {
  317. this._tt = window.pixiv.context.token;
  318. } else if (window.globalInitData) {
  319. this._tt = window.globalInitData.token;
  320. } else {
  321. $print.error('Pixiv#tt getter');
  322. }
  323. return this._tt;
  324. }
  325. async fetch(url, options = {}) {
  326. const opt = Object.assign({ credentials: 'same-origin' }, options);
  327. try {
  328. if (url) {
  329. const a = $el('a', { href: url });
  330. const resp = await fetch(a.href, opt);
  331. if (!resp.ok) {
  332. throw new ConnectionError(`${resp.status} ${resp.statusText}`);
  333. }
  334. return resp;
  335. } else {
  336. $print.error('Pixiv#fetch without url');
  337. }
  338. } catch (error) {
  339. $print.error('Pixiv#fetch: error:', error);
  340. }
  341. }
  342. async fetchJSON(url, options = {}) {
  343. try {
  344. const resp = await this.fetch(url, options);
  345. const data = await resp.json();
  346. const properties = Object.keys(data);
  347. if (properties.includes('error') && properties.includes('body')) {
  348. if (data.error) {
  349. $print.error('Pixiv#fetchJSON: JSON has error:', data.message);
  350. return null;
  351. } else {
  352. return data.body;
  353. }
  354. } else {
  355. return data;
  356. }
  357. } catch (error) {
  358. $print.error('Pixiv#fetchJSON: error:', error);
  359. }
  360. }
  361. async fetchHTML(url, options = {}) {
  362. try {
  363. const resp = await this.fetch(url, options);
  364. const data = await resp.text();
  365. return data;
  366. } catch (error) {
  367. $print.error('Pixiv#fetchHTML: error:', error);
  368. }
  369. }
  370. async rpcCall(mode, params = {}) {
  371. return this.fetchJSON('/rpc/index.php', {
  372. method: 'POST',
  373. headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
  374. body: toFormUrlencoded({ ...params, mode, tt: this.tt }),
  375. });
  376. }
  377. async getIllustData(illustId) {
  378. const url = `/ajax/illust/${illustId}`;
  379. const data = await this.fetchJSON(url);
  380. return data;
  381. }
  382. async getIllustBookmarkData(illustId) {
  383. const url = `/ajax/illust/${illustId}/bookmarkData`;
  384. const data = await this.fetchJSON(url);
  385. return data;
  386. }
  387. async getIllustDataGroup(illustIds) {
  388. const uniqIllustIds = [...new Set(illustIds)];
  389. const illustDataGroup = await Promise.all(uniqIllustIds.map(id => this.getIllustData(id)));
  390. return illustDataGroup
  391. .filter(Boolean)
  392. .reduce((collect, d) => {
  393. collect[d.illustId] = d;
  394. return collect;
  395. }, {});
  396. }
  397. async getUserData(userId) {
  398. const url = `/ajax/user/${userId}`;
  399. const data = await this.fetchJSON(url);
  400. return data;
  401. }
  402. async getUserProfileData(userId) {
  403. const url = `/ajax/user/${userId}/profile/all`;
  404. const data = await this.fetchJSON(url);
  405. return data;
  406. }
  407. async getUserBookmarkData(userId, optSearchParams = {}) {
  408. const searchParams = Object.assign({
  409. limit: 24,
  410. offset: 0,
  411. rest: 'show',
  412. tag: '',
  413. }, optSearchParams);
  414. const url = `/ajax/user/${userId}/illusts/bookmarks?${toFormUrlencoded(searchParams)}`;
  415. const data = await this.fetchJSON(url);
  416. return data;
  417. }
  418. async getUserDataGroup(userIds) {
  419. const uniqUserIds = [...new Set(userIds)];
  420. const userDataGroup = await Promise.all(uniqUserIds.map(id => this.getUserData(id)));
  421. return userDataGroup
  422. .filter(Boolean)
  423. .reduce((collect, d) => {
  424. collect[d.userId] = d;
  425. return collect;
  426. }, {});
  427. }
  428. async getIllustUgoiraMetaData(illustId) {
  429. const url = `/ajax/illust/${illustId}/ugoira_meta`;
  430. const data = await this.fetchJSON(url);
  431. return data;
  432. }
  433. async getIllustIdsInLegacyPageHTML(url) {
  434. try {
  435. const html = await this.fetchHTML(url);
  436. const nextTag = html.match(/class="next"[^/]*/);
  437. let nextUrl = '';
  438. if (nextTag) {
  439. const nextHref = nextTag[0].match(/href="([^"]+)"/);
  440. if (nextHref) {
  441. const query = nextHref[1].replace(/&amp;/g, '&');
  442. if (query) {
  443. nextUrl = `${location.pathname}${query}`;
  444. }
  445. }
  446. }
  447. const iidHTMLs = html.match(/;illust_id=\d+"\s*class="work/g) || [];
  448. const illustIds = [];
  449. for (const dataid of iidHTMLs) {
  450. const iid = dataid.replace(/\D+(\d+).*/, '$1');
  451. if (!illustIds.includes(iid) && iid !== '0') {
  452. illustIds.push(iid);
  453. }
  454. }
  455. const ret = {
  456. illustIds,
  457. nextUrl,
  458. };
  459. return ret;
  460. } catch (error) {
  461. $print.error('Pixiv#getIllustIdsInLegacyPageHTML: error:', error);
  462. }
  463. }
  464. async getIllustIdsInPageHTML(url) {
  465. try {
  466. const html = await this.fetchHTML(url);
  467. const nextTag = html.match(/class="next"[^/]*/);
  468. let nextUrl = '';
  469. if (nextTag) {
  470. const nextHref = nextTag[0].match(/href="([^"]+)"/);
  471. if (nextHref) {
  472. const query = nextHref[1].replace(/&amp;/g, '&');
  473. if (query) {
  474. nextUrl = `${location.pathname}${query}`;
  475. }
  476. }
  477. }
  478. const iidHTMLs = html.match(/illustId&quot;:&quot;(\d+)&quot;/g) || [];
  479. const illustIds = [];
  480. for (const dataid of iidHTMLs) {
  481. const iid = dataid.replace(/\D+(\d+).*/, '$1');
  482. if (!illustIds.includes(iid) && iid !== '0') {
  483. illustIds.push(iid);
  484. }
  485. }
  486. const ret = {
  487. illustIds,
  488. nextUrl,
  489. };
  490. return ret;
  491. } catch (error) {
  492. $print.error('Pixiv#getIllustIdsInPageHTML: error:', error);
  493. }
  494. }
  495. async postIllustLike(illustId) {
  496. const url = '/ajax/illusts/like';
  497. const data = await this.fetchJSON(url, {
  498. method: 'POST',
  499. headers: {
  500. 'Content-Type': 'application/json',
  501. 'x-csrf-token': this.tt,
  502. },
  503. body: JSON.stringify({
  504. illust_id: illustId,
  505. }),
  506. });
  507. return Boolean(data);
  508. }
  509. async postFollowUser(userId) {
  510. const url = '/bookmark_add.php';
  511. const searchParams = {
  512. format: 'json',
  513. mode: 'add',
  514. restrict: 0,
  515. tt: this.tt,
  516. type: 'user',
  517. user_id: userId,
  518. };
  519. const data = await this.fetchJSON(url, {
  520. method: 'POST',
  521. headers: {
  522. 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
  523. },
  524. body: toFormUrlencoded(searchParams),
  525. });
  526. return Boolean(data);
  527. }
  528. async postRPCAddBookmark(illustId) {
  529. const searchParams = {
  530. comment: '',
  531. illust_id: illustId,
  532. restrict: 0,
  533. tags: '',
  534. };
  535. await this.rpcCall('save_illust_bookmark', searchParams);
  536. return true;
  537. }
  538. async postRPCDeleteBookmark(bookmarkId) {
  539. const searchParams = { bookmark_id: bookmarkId };
  540. await this.rpcCall('delete_illust_bookmark', searchParams);
  541. return true;
  542. }
  543. }
  544. const PixivAPI = new Pixiv();
  545. function removeAnnoyings(doc = document) {
  546. const annoyings = [
  547. '.ad',
  548. '.ads_area',
  549. '.ad-footer',
  550. '.ads_anchor',
  551. '.ads-top-info',
  552. '.comic-hot-works',
  553. '.user-ad-container',
  554. '.ads_area_no_margin',
  555. '.hover-item',
  556. '.ad-printservice',
  557. '.bookmark-ranges',
  558. '.require-premium',
  559. '.showcase-reminder',
  560. '.sample-user-search',
  561. '.popular-introduction',
  562. '._premium-lead-tag-search-bar',
  563. '._premium-lead-popular-d-body',
  564. '._premium-lead-promotion-banner',
  565. ];
  566. for (const selector of annoyings) {
  567. for (const el of $$find(doc, selector)) {
  568. el.remove();
  569. }
  570. }
  571. }
  572. const DEFAULT_MATCH = true;
  573. const isString = (s) => typeof(s) === 'string';
  574. const isFunction = (s) => typeof(s) === 'function';
  575. const isOrOp = (s) => s === ' || ';
  576. const isAndOp = (s) => s === ' && ';
  577. const isCondOp = (s) => isOrOp(s) || isAndOp(s);
  578. const isGroupExpr = (s) => isString(s) && (/^{.*}$/).test(s);
  579. const isPartialExclusionExpr = (s) => isString(s) && (/^-[^-].*$/).test(s);
  580. const isPartialInclusionExpr = (s) => isString(s) && (/^[+]?.*$/).test(s);
  581. const defaultFunc = () => DEFAULT_MATCH;
  582. const isMatched = (ruleStr, targetStr) => {
  583. const rule = ruleStr.toLowerCase();
  584. const target = targetStr.toLowerCase();
  585. return makeRuleFunc(rule, target)();
  586. };
  587. const makeRuleFunc = (rule, target) => {
  588. if (isString(rule)) {
  589. const rtoks = rule.trim().match(/(\{.*?\}| ([|]{2}|[&]{2}) |\S+)/g);
  590. if (!rtoks) {
  591. return defaultFunc;
  592. }
  593. const tokList = rtoks.map((rtok) => {
  594. if (isCondOp(rtok)) {
  595. return rtok;
  596. } else if (isGroupExpr(rtok)) {
  597. return makeRuleFunc(rtok.slice(1, -1), target);
  598. } else if (isPartialExclusionExpr(rtok)) {
  599. return () => !target.includes(rtok.slice(1));
  600. } else if (isPartialInclusionExpr(rtok)) {
  601. return () => target.includes(rtok.replace(/^[+]?(.*)$/, '$1'));
  602. } else {
  603. $print.log('tagMatcher#makeRuleFunc: Unknown rtok', rtok);
  604. return defaultFunc;
  605. }
  606. });
  607. return makeRuleFunc(tokList, target);
  608. } else {
  609. const ruleList = rule.map(r => (isString(r) && !isCondOp(r)) ? makeRuleFunc(r, target) : r);
  610. const funcList = ruleList.filter(isFunction);
  611. const opList = ruleList.filter(isCondOp);
  612. if (funcList.length + opList.length !== ruleList.length) {
  613. $print.log('tagMatcher#makeRuleFunc: Unknown ruleList', ruleList);
  614. return defaultFunc;
  615. }
  616. if (opList.every(isAndOp)) {
  617. return () => funcList.every(fn => fn());
  618. } else if (opList.every(isOrOp)) {
  619. return () => funcList.some(fn => fn());
  620. } else {
  621. $print.log('tagMatcher#makeRuleFunc: Mixed condition operators without grouping', ruleList);
  622. return defaultFunc;
  623. }
  624. }
  625. };
  626. var tagFilterQuerier = {
  627. isMatched,
  628. makeRuleFunc,
  629. };
  630. const makeNewTag = (tag) => {
  631. if (tag.translation) {
  632. const trs = Object.values(tag.translation);
  633. return [tag.tag, ...trs].filter(Boolean).join('\x00');
  634. }
  635. return [tag.tag, tag.romaji].filter(Boolean).join('\x00');
  636. };
  637. const makeLibraryData = ({ illustDataGroup, userDataGroup }) => {
  638. if (!illustDataGroup || !Object.keys(illustDataGroup).length) {
  639. return [];
  640. }
  641. const library = [];
  642. for (const [illustId, illustData] of Object.entries(illustDataGroup)) {
  643. const allTags = illustData.tags.tags.map(makeNewTag).join('\x00');
  644. const d = {
  645. bookmarkCount: illustData.bookmarkCount,
  646. bookmarkId: '',
  647. illustId,
  648. illustPageCount: toInt(illustData.pageCount),
  649. illustTitle: illustData.illustTitle,
  650. isBookmarked: Boolean(illustData.bookmarkData),
  651. isFollowed: userDataGroup[illustData.userId].isFollowed,
  652. isManga: illustData.illustType === 1,
  653. isPrivateBookmark: false,
  654. isUgoira: illustData.illustType === 2,
  655. profileImg: userDataGroup[illustData.userId].image,
  656. tags: allTags,
  657. urls: {
  658. original: illustData.urls.original,
  659. regular: illustData.urls.regular,
  660. thumb: illustData.urls.thumb,
  661. },
  662. userId: illustData.userId,
  663. userName: illustData.userName,
  664. };
  665. if (illustData.bookmarkData) {
  666. d.bookmarkId = illustData.bookmarkData.id;
  667. d.isPrivateBookmark = illustData.bookmarkData.private;
  668. }
  669. library.push(d);
  670. }
  671. return library;
  672. };
  673. const state = {
  674. batchSize: 40,
  675. defaultStatus: {
  676. isEnded: false,
  677. isPaused: true,
  678. },
  679. imageItemLibrary: [],
  680. moveWindowIndex: 0,
  681. moveWindowPrivateBookmarkIndex: 0,
  682. nextUrl: location.href,
  683. nppStatus: {
  684. isEnded: Array(NPP_TYPE_COUNT).fill(false),
  685. isPaused: true,
  686. },
  687. prefetchPool: {
  688. illusts: [],
  689. manga: [],
  690. },
  691. };
  692. const getters = {
  693. batchSize: (state) => state.batchSize,
  694. defaultDisplayIndices: (state, getters, rootState, rootGetters) => {
  695. const clonedLib = state.imageItemLibrary.slice();
  696. const { sp, filters, config, orderBy } = rootGetters;
  697. const dateOldFirst = sp.order === 'date';
  698. const bookmarkEarlyFirst = sp.order === 'asc';
  699. const isToShow = (d) => {
  700. return d.bookmarkCount >= filters.limit &&
  701. tagFilterQuerier.isMatched(filters.query, d.tags) &&
  702. !config.blacklist.includes(d.userId) &&
  703. !(rootGetters.unbookmarkedOnly && d.isBookmarked);
  704. };
  705. const shows = [], hides = [];
  706. for (const [i, d] of clonedLib.entries()) {
  707. const s = isToShow(d);
  708. const o = {
  709. index: i,
  710. [orderBy]: d[orderBy],
  711. };
  712. if (s) {
  713. shows.push(o);
  714. } else {
  715. hides.push(o);
  716. }
  717. }
  718. shows.sort((a, b) => {
  719. const av = toInt(a[orderBy]);
  720. const bv = toInt(b[orderBy]);
  721. const c = bv - av;
  722. switch (orderBy) {
  723. case 'illustId':
  724. return dateOldFirst ? -c : c;
  725. case 'bookmarkCount':
  726. return c;
  727. case 'bookmarkId':
  728. return bookmarkEarlyFirst ? -c : c;
  729. default:
  730. return 0;
  731. }
  732. });
  733. return {
  734. hides: hides.map(item => item.index),
  735. shows: shows.map(item => item.index),
  736. };
  737. },
  738. imageItemLibrary: (state) => state.imageItemLibrary,
  739. nppDisplayIndices: (state, getters, rootState, rootGetters) => {
  740. const clonedLib = state.imageItemLibrary.slice();
  741. const { filters, config, orderBy, sp } = rootGetters;
  742. const { nppType } = getters;
  743. const isToShow = (d) => {
  744. const conds = [
  745. d.bookmarkCount >= filters.limit,
  746. tagFilterQuerier.isMatched(filters.query, d.tags),
  747. !config.blacklist.includes(d.userId),
  748. !(rootGetters.unbookmarkedOnly && d.isBookmarked),
  749. ];
  750. switch (nppType) {
  751. case 0:
  752. conds.push(d.userId === sp.id);
  753. break;
  754. case 1:
  755. conds.push(d.userId === sp.id && !d.isManga);
  756. break;
  757. case 2:
  758. conds.push(d.userId === sp.id && d.isManga);
  759. break;
  760. case 3:
  761. conds.push(d.userId !== sp.id && !d.isPrivateBookmark);
  762. break;
  763. case 4:
  764. conds.push(d.userId !== sp.id && d.isPrivateBookmark);
  765. break;
  766. default:
  767. break;
  768. }
  769. return conds.every(Boolean);
  770. };
  771. const shows = [], hides = [];
  772. for (const [i, d] of clonedLib.entries()) {
  773. const s = isToShow(d);
  774. const o = {
  775. index: i,
  776. [orderBy]: d[orderBy],
  777. };
  778. if (s) {
  779. shows.push(o);
  780. } else {
  781. hides.push(o);
  782. }
  783. }
  784. shows.sort((a, b) => {
  785. const av = toInt(a[orderBy]);
  786. const bv = toInt(b[orderBy]);
  787. return bv - av;
  788. });
  789. return {
  790. hides: hides.map(item => item.index),
  791. shows: shows.map(item => item.index),
  792. };
  793. },
  794. nppType: (state, getters, rootState, rootGetters) => {
  795. const types = [
  796. MAIN_PAGE_TYPE.NEW_PROFILE,
  797. MAIN_PAGE_TYPE.NEW_PROFILE_ILLUST,
  798. MAIN_PAGE_TYPE.NEW_PROFILE_MANGA,
  799. MAIN_PAGE_TYPE.NEW_PROFILE_BOOKMARK,
  800. ];
  801. const loginId = rootGetters.loginData.id;
  802. const uid = rootGetters.sp.id;
  803. const rest = rootGetters.sp.rest;
  804. const mpt = rootGetters.MPT;
  805. const isSelfPrivateBookmarkPage = mpt === MAIN_PAGE_TYPE.NEW_PROFILE_BOOKMARK && loginId === uid && rest === 'hide';
  806. if (isSelfPrivateBookmarkPage) {
  807. return types.length;
  808. }
  809. return types.indexOf(mpt);
  810. },
  811. status: (state, getters) => {
  812. if (getters.nppType >= 0) {
  813. return {
  814. isEnded: state.nppStatus.isEnded[getters.nppType],
  815. isPaused: state.nppStatus.isPaused,
  816. };
  817. } else {
  818. return state.defaultStatus;
  819. }
  820. },
  821. };
  822. const mutations = {
  823. editImgItem: (state, payload = {}) => {
  824. const DEFAULT_OPT = {
  825. illustId: '',
  826. type: null,
  827. userId: '',
  828. };
  829. const opt = Object.assign({}, DEFAULT_OPT, payload);
  830. if (opt.type === 'follow-user' && opt.userId) {
  831. state.imageItemLibrary
  832. .filter(i => i.userId === opt.userId)
  833. .forEach(i => {
  834. i.isFollowed = true;
  835. });
  836. } else if (opt.type === 'edit-bookmarked' && opt.illustId) {
  837. state.imageItemLibrary
  838. .filter(i => i.illustId === opt.illustId)
  839. .forEach(i => {
  840. if (typeof opt.isBookmarked === 'boolean' ) {
  841. i.isBookmarked = opt.isBookmarked;
  842. if (!opt.isBookmarked) {
  843. i.isPrivateBookmark = false;
  844. }
  845. }
  846. });
  847. }
  848. },
  849. setStatus: (state, { nppType = -1, isPaused, isEnded }) => {
  850. if (nppType >= 0) {
  851. if (isPaused !== undefined) {
  852. state.nppStatus.isPaused = isPaused;
  853. }
  854. if (isEnded !== undefined) {
  855. state.nppStatus.isEnded[nppType] = isEnded;
  856. }
  857. } else {
  858. if (isPaused !== undefined) {
  859. state.defaultStatus.isPaused = isPaused;
  860. }
  861. if (isEnded !== undefined) {
  862. state.defaultStatus.isEnded = isEnded;
  863. }
  864. }
  865. },
  866. };
  867. const actions = {
  868. pause: ({ commit, getters }) => {
  869. commit('setStatus', { isPaused: true, nppType: getters.nppType });
  870. },
  871. relive: ({ commit, getters }) => {
  872. commit('setStatus', { isEnded: false, nppType: getters.nppType });
  873. },
  874. resume: ({ commit, getters }) => {
  875. commit('setStatus', { isPaused: false, nppType: getters.nppType });
  876. },
  877. start: async({ state, dispatch, getters, rootGetters }, { times = Infinity, force = false, isFirst = false } = {}) => {
  878. await dispatch('resume');
  879. if (force) {
  880. await dispatch('relive');
  881. }
  882. if (getters.status.isEnded || times <= 0) {
  883. return;
  884. }
  885. if (getters.nppType >= 0 && isFirst) {
  886. const profile = await PixivAPI.getUserProfileData(rootGetters.sp.id);
  887. state.prefetchPool.illusts.push(...Object.keys(profile.illusts));
  888. state.prefetchPool.manga.push(...Object.keys(profile.manga));
  889. state.prefetchPool.illusts.sort((i, j) => j - i);
  890. state.prefetchPool.manga.sort((i, j) => j - i);
  891. }
  892. switch (rootGetters.MPT) {
  893. case MAIN_PAGE_TYPE.SEARCH:
  894. case MAIN_PAGE_TYPE.FOLLOWED_NEWS:
  895. case MAIN_PAGE_TYPE.ANCIENT_FOLLOWED_NEWS:
  896. case MAIN_PAGE_TYPE.SELF_BOOKMARK:
  897. await dispatch('startNextUrlBased', { times });
  898. break;
  899. case MAIN_PAGE_TYPE.NEW_PROFILE:
  900. await dispatch('startPrefetchBased', { pool: 'all', times });
  901. break;
  902. case MAIN_PAGE_TYPE.NEW_PROFILE_ILLUST:
  903. await dispatch('startPrefetchBased', { pool: 'illusts', times });
  904. break;
  905. case MAIN_PAGE_TYPE.NEW_PROFILE_MANGA:
  906. await dispatch('startPrefetchBased', { pool: 'manga', times });
  907. break;
  908. case MAIN_PAGE_TYPE.NEW_PROFILE_BOOKMARK:
  909. await dispatch('startMovingWindowBased', { times });
  910. break;
  911. default:
  912. $print.error('Unknown main page type', rootGetters.MPT);
  913. break;
  914. }
  915. },
  916. startMovingWindowBased: async({ state, dispatch, getters, rootGetters }, { times = Infinity, rest = null } = {}) => {
  917. while (!getters.status.isPaused && !getters.status.isEnded && times) {
  918. let illustIds = [], maxTotal = Infinity;
  919. const _rest = rest || rootGetters.sp.rest || 'show';
  920. const _uid = rootGetters.sp.id;
  921. let cIndex = (_rest === 'show') ? state.moveWindowIndex : state.moveWindowPrivateBookmarkIndex;
  922. if (getters.nppType >= 0) {
  923. const opt = { limit: getters.batchSize, offset: cIndex, rest: _rest };
  924. const { works, total } = await PixivAPI.getUserBookmarkData(_uid, opt);
  925. if (!works) {
  926. await dispatch('stop');
  927. break;
  928. }
  929. maxTotal = total;
  930. illustIds.push(...works.map((d) => d.id));
  931. }
  932. cIndex += getters.batchSize;
  933. if (getters.nppType >= 0 && _rest === 'hide') {
  934. state.moveWindowPrivateBookmarkIndex = cIndex;
  935. } else {
  936. state.moveWindowIndex = cIndex;
  937. }
  938. const illustDataGroup = await PixivAPI.getIllustDataGroup(illustIds);
  939. const userIds = Object.values(illustDataGroup).map(d => d.userId);
  940. const userDataGroup = await PixivAPI.getUserDataGroup(userIds);
  941. const libraryData = makeLibraryData({
  942. illustDataGroup,
  943. userDataGroup,
  944. });
  945. for (const d of libraryData) {
  946. if (!state.imageItemLibrary.find(x => x.illustId === d.illustId)) {
  947. state.imageItemLibrary.push(d);
  948. }
  949. }
  950. times -= 1;
  951. if (!times) {
  952. await dispatch('pause');
  953. }
  954. if (cIndex > maxTotal) {
  955. await dispatch('stop');
  956. }
  957. }
  958. },
  959. startNextUrlBased: async({ state, dispatch, getters, rootGetters }, { times = Infinity } = {}) => {
  960. while (!getters.status.isPaused && !getters.status.isEnded && times) {
  961. let page = null;
  962. if ([MAIN_PAGE_TYPE.SEARCH, MAIN_PAGE_TYPE.FOLLOWED_NEWS].includes(rootGetters.MPT)) {
  963. page = await PixivAPI.getIllustIdsInPageHTML(state.nextUrl);
  964. } else {
  965. page = await PixivAPI.getIllustIdsInLegacyPageHTML(state.nextUrl);
  966. }
  967. state.nextUrl = page.nextUrl;
  968. const illustDataGroup = await PixivAPI.getIllustDataGroup(page.illustIds);
  969. const userIds = Object.values(illustDataGroup).map(d => d.userId);
  970. const userDataGroup = await PixivAPI.getUserDataGroup(userIds);
  971. const libraryData = makeLibraryData({
  972. illustDataGroup,
  973. userDataGroup,
  974. });
  975. for (const d of libraryData) {
  976. if (!state.imageItemLibrary.find(x => x.illustId === d.illustId)) {
  977. state.imageItemLibrary.push(d);
  978. }
  979. }
  980. times -= 1;
  981. if (!times) {
  982. await dispatch('pause');
  983. }
  984. if (!state.nextUrl) {
  985. await dispatch('stop');
  986. }
  987. }
  988. },
  989. startPrefetchBased: async({ state, dispatch, getters }, { times = Infinity, pool = 'all' } = {}) => {
  990. const pPool = state.prefetchPool;
  991. let todoPool = [];
  992. if (pool === 'all') {
  993. todoPool.push(...pPool.illusts);
  994. todoPool.push(...pPool.manga);
  995. } else {
  996. todoPool.push(...pPool[pool]);
  997. }
  998. while (!getters.status.isPaused && !getters.status.isEnded && times) {
  999. if (!todoPool.length) {
  1000. await dispatch('stop');
  1001. }
  1002. const illustIds = todoPool.splice(0, getters.batchSize);
  1003. if (pool === 'all') {
  1004. illustIds.forEach((id) => {
  1005. const ii = pPool.illusts.indexOf(id);
  1006. if (ii >= 0) {
  1007. pPool.illusts.splice(ii, 1);
  1008. }
  1009. const mi = pPool.manga.indexOf(id);
  1010. if (mi >= 0) {
  1011. pPool.manga.splice(mi, 1);
  1012. }
  1013. });
  1014. }
  1015. const illustDataGroup = await PixivAPI.getIllustDataGroup(illustIds);
  1016. const userIds = Object.values(illustDataGroup).map(d => d.userId);
  1017. const userDataGroup = await PixivAPI.getUserDataGroup(userIds);
  1018. const libraryData = makeLibraryData({
  1019. illustDataGroup,
  1020. userDataGroup,
  1021. });
  1022. for (const d of libraryData) {
  1023. if (!state.imageItemLibrary.find(x => x.illustId === d.illustId)) {
  1024. state.imageItemLibrary.push(d);
  1025. }
  1026. }
  1027. times -= 1;
  1028. if (!times) {
  1029. await dispatch('pause');
  1030. }
  1031. if (!todoPool.length) {
  1032. await dispatch('stop');
  1033. }
  1034. }
  1035. },
  1036. stop: ({ commit, getters }) => {
  1037. commit('setStatus', { isEnded: true, isPaused: true, nppType: getters.nppType });
  1038. },
  1039. };
  1040. var pixiv = {
  1041. actions,
  1042. getters,
  1043. mutations,
  1044. namespaced: true,
  1045. state,
  1046. };
  1047. const state$1 = {
  1048. active: false,
  1049. data: null,
  1050. position: { x: -1e7, y: -1e7 },
  1051. };
  1052. const getters$1 = {
  1053. active: (state) => state.active,
  1054. data: (state) => state.data,
  1055. pos: (state) => state.position,
  1056. };
  1057. const mutations$1 = {
  1058. activate: (state, payload) => {
  1059. state.active = true;
  1060. state.position = payload.position;
  1061. state.data = payload.data;
  1062. },
  1063. deactivate: (state) => {
  1064. state.active = false;
  1065. state.position = { x: -1e7, y: -1e7 };
  1066. },
  1067. };
  1068. var contextMenu = {
  1069. getters: getters$1,
  1070. mutations: mutations$1,
  1071. namespaced: true,
  1072. state: state$1,
  1073. };
  1074. const state$2 = {
  1075. data: null,
  1076. mode: null,
  1077. };
  1078. const mutations$2 = {
  1079. close: (state) => {
  1080. state.mode = null;
  1081. },
  1082. open: (state, payload) => {
  1083. Object.assign(state, payload);
  1084. },
  1085. };
  1086. const getters$2 = {
  1087. data: (state) => state.data,
  1088. mode: (state) => state.mode,
  1089. };
  1090. var coverLayer = {
  1091. getters: getters$2,
  1092. mutations: mutations$2,
  1093. namespaced: true,
  1094. state: state$2,
  1095. };
  1096. Vue.use(Vuex);
  1097. const _isSelfBookmarkPage = (mpt, loginId, uid) => {
  1098. return (
  1099. mpt === MAIN_PAGE_TYPE.SELF_BOOKMARK ||
  1100. (mpt === MAIN_PAGE_TYPE.NEW_PROFILE_BOOKMARK &&
  1101. loginId === uid)
  1102. );
  1103. };
  1104. const _getSearchParam = () => {
  1105. const s = new URLSearchParams(location.search);
  1106. const ret = {};
  1107. [...s.entries()].reduce((collect, [k, v]) => {
  1108. collect[k] = v;
  1109. return collect;
  1110. }, ret);
  1111. return ret;
  1112. };
  1113. const modules = { contextMenu, coverLayer, pixiv };
  1114. const state$3 = {
  1115. NAME: GM_info.script.name,
  1116. VERSION: GM_info.script.version,
  1117. config: {
  1118. blacklist: [],
  1119. contextMenu: 1,
  1120. croppedThumb: 1,
  1121. fitwidth: 1,
  1122. hoverPlay: 1,
  1123. sort: SORT_TYPE.ILLUST_ID,
  1124. userTooltip: 1,
  1125. },
  1126. filters: {
  1127. limit: 0,
  1128. query: '',
  1129. },
  1130. locale: document.documentElement.lang.toLowerCase(),
  1131. loginData: null,
  1132. mainPageType: MAIN_PAGE_TYPE.NO_SUPPORT,
  1133. mountPointCoverLayer: null,
  1134. mountPointCtrlPanel: null,
  1135. mountPointMainView: null,
  1136. searchParam: {},
  1137. unbookmarkedOnly: false,
  1138. };
  1139. const getters$3 = {
  1140. MPT: (state) => state.mainPageType,
  1141. config: (state) => state.config,
  1142. filters: (state) => state.filters,
  1143. isSelfBookmarkPage: (state) => _isSelfBookmarkPage(state.mainPageType, state.loginData.id, state.searchParam.id),
  1144. locale: (state) => state.locale,
  1145. loginData: (state) => state.loginData,
  1146. mountPointCoverLayer: (state) => state.mountPointCoverLayer,
  1147. mountPointCtrlPanel: (state) => state.mountPointCtrlPanel,
  1148. mountPointMainView: (state) => state.mountPointMainView,
  1149. orderBy: (state) => {
  1150. switch (state.config.sort) {
  1151. case SORT_TYPE.ILLUST_ID:
  1152. return 'illustId';
  1153. case SORT_TYPE.BOOKMARK_ID:
  1154. return 'bookmarkId';
  1155. case SORT_TYPE.BOOKMARK_COUNT:
  1156. return 'bookmarkCount';
  1157. default:
  1158. $print.error('VuexStore#getters.orderBy:', state.config.sort);
  1159. return 'illustId';
  1160. }
  1161. },
  1162. sp: (state) => state.searchParam,
  1163. unbookmarkedOnly: (state) => state.unbookmarkedOnly,
  1164. };
  1165. const mutations$3 = {
  1166. afterInit: (state) => {
  1167. const _sbp = _isSelfBookmarkPage(state.mainPageType, state.loginData.id, state.searchParam.id);
  1168. if (_sbp) {
  1169. state.config.sort = SORT_TYPE.BOOKMARK_ID;
  1170. } else if (state.config.sort === SORT_TYPE.BOOKMARK_ID) {
  1171. state.config.sort = SORT_TYPE.ILLUST_ID;
  1172. }
  1173. if (state.mainPageType === MAIN_PAGE_TYPE.SELF_BOOKMARK) {
  1174. for (const marker of $$('.js-legacy-mark-all, .js-legacy-unmark-all')) {
  1175. marker.addEventListener('click', () => {
  1176. $$('input[name="book_id[]"]').forEach(el => {
  1177. el.checked = marker.classList.contains('js-legacy-mark-all');
  1178. });
  1179. });
  1180. }
  1181. const sp = state.searchParam;
  1182. if (sp.order && sp.order.includes('date')) {
  1183. state.config.sort = SORT_TYPE.ILLUST_ID;
  1184. } else {
  1185. state.config.sort = SORT_TYPE.BOOKMARK_ID;
  1186. }
  1187. }
  1188. removeAnnoyings();
  1189. },
  1190. applyConfig: (state) => {
  1191. if (state.mainPageType !== MAIN_PAGE_TYPE.NO_SUPPORT) {
  1192. if (state.config.fitwidth) {
  1193. $$('.ω').forEach(el => el.classList.add('↔'));
  1194. } else {
  1195. $$('.ω').forEach(el => el.classList.remove('↔'));
  1196. }
  1197. }
  1198. },
  1199. loadConfig: (state) => {
  1200. const config = JSON.parse(localStorage.getItem(state.NAME) || '{}');
  1201. Object.assign(state.config, config);
  1202. },
  1203. saveConfig: (state) => {
  1204. const storable = JSON.stringify(state.config);
  1205. localStorage.setItem(state.NAME, storable);
  1206. },
  1207. setConfig: (state, payload) => {
  1208. Object.assign(state.config, payload);
  1209. },
  1210. setFilters: (state, payload) => {
  1211. Object.assign(state.filters, payload);
  1212. },
  1213. setMainPageType: (state, payload = {}) => {
  1214. if (payload.forceSet) {
  1215. state.mainPageType = payload.forceSet;
  1216. } else {
  1217. const path = location.pathname;
  1218. const sp = state.searchParam;
  1219. switch (path) {
  1220. case '/search.php':
  1221. state.mainPageType = MAIN_PAGE_TYPE.SEARCH;
  1222. break;
  1223. case '/bookmark_new_illust_r18.php':
  1224. case '/bookmark_new_illust.php':
  1225. state.mainPageType = MAIN_PAGE_TYPE.FOLLOWED_NEWS;
  1226. break;
  1227. case '/new_illust.php':
  1228. case '/mypixiv_new_illust.php':
  1229. case '/new_illust_r18.php':
  1230. state.mainPageType = MAIN_PAGE_TYPE.ANCIENT_FOLLOWED_NEWS;
  1231. break;
  1232. case '/member.php':
  1233. state.mainPageType = MAIN_PAGE_TYPE.NEW_PROFILE;
  1234. break;
  1235. case '/member_illust.php':
  1236. if (sp.mode) {
  1237. state.mainPageType = MAIN_PAGE_TYPE.NO_SUPPORT;
  1238. break;
  1239. }
  1240. if (sp.type === 'manga') {
  1241. state.mainPageType = MAIN_PAGE_TYPE.NEW_PROFILE_MANGA;
  1242. } else if (sp.type === 'illust') {
  1243. state.mainPageType = MAIN_PAGE_TYPE.NEW_PROFILE_ILLUST;
  1244. } else {
  1245. state.mainPageType = MAIN_PAGE_TYPE.NEW_PROFILE;
  1246. }
  1247. break;
  1248. case '/bookmark.php': {
  1249. if (sp.type === 'user' || sp.type === 'reg_user') {
  1250. state.mainPageType = MAIN_PAGE_TYPE.NO_SUPPORT;
  1251. }
  1252. else if (sp.id) {
  1253. state.mainPageType = MAIN_PAGE_TYPE.NEW_PROFILE_BOOKMARK;
  1254. } else {
  1255. state.mainPageType = MAIN_PAGE_TYPE.SELF_BOOKMARK;
  1256. }
  1257. break;
  1258. }
  1259. default:
  1260. state.mainPageType = MAIN_PAGE_TYPE.NO_SUPPORT;
  1261. break;
  1262. }
  1263. }
  1264. const _sbp = _isSelfBookmarkPage(state.mainPageType, state.loginData.id, state.searchParam.id);
  1265. if (!_sbp && state.config.sort === SORT_TYPE.BOOKMARK_ID) {
  1266. state.config.sort = SORT_TYPE.ILLUST_ID;
  1267. }
  1268. },
  1269. toggleUnbookmarkedOnly: (state) => {
  1270. state.unbookmarkedOnly = !state.unbookmarkedOnly;
  1271. },
  1272. updateSearchParam: (state) => {
  1273. state.searchParam = _getSearchParam();
  1274. },
  1275. };
  1276. const actions$1 = {
  1277. init: async({ state, commit, dispatch }) => {
  1278. if (window.globalInitData && window.globalInitData.userData) {
  1279. const u = window.globalInitData.userData;
  1280. state.loginData = { id: u.id };
  1281. } else if (window.pixiv && window.pixiv.user) {
  1282. const u = window.pixiv.user;
  1283. state.loginData = { id: u.id };
  1284. } else {
  1285. throw new InitError('The page has no any login user data.');
  1286. }
  1287. commit('updateSearchParam');
  1288. commit('setMainPageType');
  1289. if (state.mainPageType !== MAIN_PAGE_TYPE.NO_SUPPORT) {
  1290. commit('loadConfig');
  1291. await dispatch('setMountPoints');
  1292. commit('afterInit');
  1293. commit('applyConfig');
  1294. commit('saveConfig');
  1295. }
  1296. },
  1297. setMountPoints: async({ state, getters }) => {
  1298. $$('#wrapper').forEach(el => el.classList.add('ω'));
  1299. state.mountPointCoverLayer = $el('div', null, (el) => {
  1300. document.body.appendChild(el);
  1301. });
  1302. state.mountPointCtrlPanel = $el('div', null, async(el) => {
  1303. if (getters['pixiv/nppType'] >= 0) {
  1304. await $ready(() => $('.sLHPYEz, ._3CsQgM9'));
  1305. $('.sLHPYEz, ._3CsQgM9').parentNode.insertAdjacentElement('afterend', el);
  1306. } else {
  1307. $('header._global-header').insertAdjacentElement('afterend', el);
  1308. }
  1309. });
  1310. switch (state.mainPageType) {
  1311. case MAIN_PAGE_TYPE.SEARCH:
  1312. state.mountPointMainView = $('#js-react-search-mid');
  1313. break;
  1314. case MAIN_PAGE_TYPE.FOLLOWED_NEWS:
  1315. state.mountPointMainView = $('#js-mount-point-latest-following');
  1316. break;
  1317. case MAIN_PAGE_TYPE.ANCIENT_FOLLOWED_NEWS:
  1318. state.mountPointMainView = $('ul._image-items');
  1319. break;
  1320. case MAIN_PAGE_TYPE.NEW_PROFILE:
  1321. case MAIN_PAGE_TYPE.NEW_PROFILE_BOOKMARK:
  1322. case MAIN_PAGE_TYPE.NEW_PROFILE_ILLUST:
  1323. case MAIN_PAGE_TYPE.NEW_PROFILE_MANGA:
  1324. await $ready(() => $('.g4R-bsH, ._9GTeZI7'));
  1325. state.mountPointMainView = $('.g4R-bsH, ._9GTeZI7');
  1326. break;
  1327. case MAIN_PAGE_TYPE.SELF_BOOKMARK:
  1328. state.mountPointMainView = $('.display_editable_works');
  1329. break;
  1330. default:
  1331. break;
  1332. }
  1333. },
  1334. };
  1335. var vuexStore = new Vuex.Store({
  1336. actions: actions$1,
  1337. getters: getters$3,
  1338. modules,
  1339. mutations: mutations$3,
  1340. state: state$3,
  1341. });
  1342. var script = {
  1343. props: {
  1344. icon: {
  1345. default: '',
  1346. type: String,
  1347. },
  1348. },
  1349. };
  1350. function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier
  1351. , shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {
  1352. if (typeof shadowMode !== 'boolean') {
  1353. createInjectorSSR = createInjector;
  1354. createInjector = shadowMode;
  1355. shadowMode = false;
  1356. }
  1357. var options = typeof script === 'function' ? script.options : script;
  1358. if (template && template.render) {
  1359. options.render = template.render;
  1360. options.staticRenderFns = template.staticRenderFns;
  1361. options._compiled = true;
  1362. if (isFunctionalTemplate) {
  1363. options.functional = true;
  1364. }
  1365. }
  1366. if (scopeId) {
  1367. options._scopeId = scopeId;
  1368. }
  1369. var hook;
  1370. if (moduleIdentifier) {
  1371. hook = function hook(context) {
  1372. context = context ||
  1373. this.$vnode && this.$vnode.ssrContext ||
  1374. this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext;
  1375. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  1376. context = __VUE_SSR_CONTEXT__;
  1377. }
  1378. if (style) {
  1379. style.call(this, createInjectorSSR(context));
  1380. }
  1381. if (context && context._registeredComponents) {
  1382. context._registeredComponents.add(moduleIdentifier);
  1383. }
  1384. };
  1385. options._ssrRegister = hook;
  1386. } else if (style) {
  1387. hook = shadowMode ? function () {
  1388. style.call(this, createInjectorShadow(this.$root.$options.shadowRoot));
  1389. } : function (context) {
  1390. style.call(this, createInjector(context));
  1391. };
  1392. }
  1393. if (hook) {
  1394. if (options.functional) {
  1395. var originalRender = options.render;
  1396. options.render = function renderWithStyleInjection(h, context) {
  1397. hook.call(context);
  1398. return originalRender(h, context);
  1399. };
  1400. } else {
  1401. var existing = options.beforeCreate;
  1402. options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
  1403. }
  1404. }
  1405. return script;
  1406. }
  1407. var normalizeComponent_1 = normalizeComponent;
  1408. const __vue_script__ = script;
  1409. var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.icon === 'angle-down')?_c('svg',{staticClass:"fa-angle-down",attrs:{"aria-hidden":"true","data-prefix":"fas","data-icon":"angle-down","role":"img","xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 320 512"}},[_c('path',{attrs:{"fill":"currentColor","d":"M143 352.3L7 216.3c-9.4-9.4-9.4-24.6 0-33.9l22.6-22.6c9.4-9.4 24.6-9.4 33.9 0l96.4 96.4 96.4-96.4c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9l-136 136c-9.2 9.4-24.4 9.4-33.8 0z"}})]):(_vm.icon === 'bookmark')?_c('svg',{staticClass:"fa-bookmark",attrs:{"aria-hidden":"true","data-prefix":"far","data-icon":"bookmark","role":"img","xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 384 512"}},[_c('path',{attrs:{"fill":"currentColor","d":"M336 0H48C21.49 0 0 21.49 0 48v464l192-112 192 112V48c0-26.51-21.49-48-48-48zm0 428.43l-144-84-144 84V54a6 6 0 0 1 6-6h276c3.314 0 6 2.683 6 5.996V428.43z"}})]):(_vm.icon === 'cog')?_c('svg',{staticClass:"fa-cog",attrs:{"aria-hidden":"true","data-prefix":"fas","data-icon":"cog","role":"img","xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 512 512"}},[_c('path',{attrs:{"fill":"currentColor","d":"M444.788 291.1l42.616 24.599c4.867 2.809 7.126 8.618 5.459 13.985-11.07 35.642-29.97 67.842-54.689 94.586a12.016 12.016 0 0 1-14.832 2.254l-42.584-24.595a191.577 191.577 0 0 1-60.759 35.13v49.182a12.01 12.01 0 0 1-9.377 11.718c-34.956 7.85-72.499 8.256-109.219.007-5.49-1.233-9.403-6.096-9.403-11.723v-49.184a191.555 191.555 0 0 1-60.759-35.13l-42.584 24.595a12.016 12.016 0 0 1-14.832-2.254c-24.718-26.744-43.619-58.944-54.689-94.586-1.667-5.366.592-11.175 5.459-13.985L67.212 291.1a193.48 193.48 0 0 1 0-70.199l-42.616-24.599c-4.867-2.809-7.126-8.618-5.459-13.985 11.07-35.642 29.97-67.842 54.689-94.586a12.016 12.016 0 0 1 14.832-2.254l42.584 24.595a191.577 191.577 0 0 1 60.759-35.13V25.759a12.01 12.01 0 0 1 9.377-11.718c34.956-7.85 72.499-8.256 109.219-.007 5.49 1.233 9.403 6.096 9.403 11.723v49.184a191.555 191.555 0 0 1 60.759 35.13l42.584-24.595a12.016 12.016 0 0 1 14.832 2.254c24.718 26.744 43.619 58.944 54.689 94.586 1.667 5.366-.592 11.175-5.459 13.985L444.788 220.9a193.485 193.485 0 0 1 0 70.2zM336 256c0-44.112-35.888-80-80-80s-80 35.888-80 80 35.888 80 80 80 80-35.888 80-80z"}})]):(_vm.icon === 'compress')?_c('svg',{staticClass:"fa-compress",attrs:{"aria-hidden":"true","data-prefix":"fas","data-icon":"compress","role":"img","xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 448 512"}},[_c('path',{attrs:{"fill":"currentColor","d":"M436 192H312c-13.3 0-24-10.7-24-24V44c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v84h84c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12zm-276-24V44c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v84H12c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h124c13.3 0 24-10.7 24-24zm0 300V344c0-13.3-10.7-24-24-24H12c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h84v84c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm192 0v-84h84c6.6 0 12-5.4 12-12v-40c0-6.6-5.4-12-12-12H312c-13.3 0-24 10.7-24 24v124c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12z"}})]):(_vm.icon === 'download')?_c('svg',{staticClass:"fa-download",attrs:{"aria-hidden":"true","data-prefix":"fas","data-icon":"download","role":"img","xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 512 512"}},[_c('path',{attrs:{"fill":"currentColor","d":"M216 0h80c13.3 0 24 10.7 24 24v168h87.7c17.8 0 26.7 21.5 14.1 34.1L269.7 378.3c-7.5 7.5-19.8 7.5-27.3 0L90.1 226.1c-12.6-12.6-3.7-34.1 14.1-34.1H192V24c0-13.3 10.7-24 24-24zm296 376v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h146.7l49 49c20.1 20.1 52.5 20.1 72.6 0l49-49H488c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"}})]):(_vm.icon === 'expand')?_c('svg',{staticClass:"fa-expand",attrs:{"aria-hidden":"true","data-prefix":"fas","data-icon":"expand","role":"img","xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 448 512"}},[_c('path',{attrs:{"fill":"currentColor","d":"M0 180V56c0-13.3 10.7-24 24-24h124c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12H64v84c0 6.6-5.4 12-12 12H12c-6.6 0-12-5.4-12-12zM288 44v40c0 6.6 5.4 12 12 12h84v84c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12V56c0-13.3-10.7-24-24-24H300c-6.6 0-12 5.4-12 12zm148 276h-40c-6.6 0-12 5.4-12 12v84h-84c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h124c13.3 0 24-10.7 24-24V332c0-6.6-5.4-12-12-12zM160 468v-40c0-6.6-5.4-12-12-12H64v-84c0-6.6-5.4-12-12-12H12c-6.6 0-12 5.4-12 12v124c0 13.3 10.7 24 24 24h124c6.6 0 12-5.4 12-12z"}})]):(_vm.icon === 'eye-slash')?_c('svg',{staticClass:"fa-eye-slash",attrs:{"aria-hidden":"true","data-prefix":"far","data-icon":"eye-slash","role":"img","xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 576 512"}},[_c('path',{attrs:{"fill":"currentColor","d":"M272.702 359.139c-80.483-9.011-136.212-86.886-116.93-167.042l116.93 167.042zM288 392c-102.556 0-192.092-54.701-240-136 21.755-36.917 52.1-68.342 88.344-91.658l-27.541-39.343C67.001 152.234 31.921 188.741 6.646 231.631a47.999 47.999 0 0 0 0 48.739C63.004 376.006 168.14 440 288 440a332.89 332.89 0 0 0 39.648-2.367l-32.021-45.744A284.16 284.16 0 0 1 288 392zm281.354-111.631c-33.232 56.394-83.421 101.742-143.554 129.492l48.116 68.74c3.801 5.429 2.48 12.912-2.949 16.712L450.23 509.83c-5.429 3.801-12.912 2.48-16.712-2.949L102.084 33.399c-3.801-5.429-2.48-12.912 2.949-16.712L125.77 2.17c5.429-3.801 12.912-2.48 16.712 2.949l55.526 79.325C226.612 76.343 256.808 72 288 72c119.86 0 224.996 63.994 281.354 159.631a48.002 48.002 0 0 1 0 48.738zM528 256c-44.157-74.933-123.677-127.27-216.162-135.007C302.042 131.078 296 144.83 296 160c0 30.928 25.072 56 56 56s56-25.072 56-56l-.001-.042c30.632 57.277 16.739 130.26-36.928 171.719l26.695 38.135C452.626 346.551 498.308 306.386 528 256z"}})]):(_vm.icon === 'rss')?_c('svg',{staticClass:"fa-rss",attrs:{"aria-hidden":"true","data-prefix":"fas","data-icon":"rss","role":"img","xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 448 512"}},[_c('path',{attrs:{"fill":"currentColor","d":"M128.081 415.959c0 35.369-28.672 64.041-64.041 64.041S0 451.328 0 415.959s28.672-64.041 64.041-64.041 64.04 28.673 64.04 64.041zm175.66 47.25c-8.354-154.6-132.185-278.587-286.95-286.95C7.656 175.765 0 183.105 0 192.253v48.069c0 8.415 6.49 15.472 14.887 16.018 111.832 7.284 201.473 96.702 208.772 208.772.547 8.397 7.604 14.887 16.018 14.887h48.069c9.149.001 16.489-7.655 15.995-16.79zm144.249.288C439.596 229.677 251.465 40.445 16.503 32.01 7.473 31.686 0 38.981 0 48.016v48.068c0 8.625 6.835 15.645 15.453 15.999 191.179 7.839 344.627 161.316 352.465 352.465.353 8.618 7.373 15.453 15.999 15.453h48.068c9.034-.001 16.329-7.474 16.005-16.504z"}})]):(_vm.icon === 'search-plus')?_c('svg',{staticClass:"fa-search-plus",attrs:{"aria-hidden":"true","data-prefix":"fas","data-icon":"search-plus","role":"img","xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 512 512"}},[_c('path',{attrs:{"fill":"currentColor","d":"M304 192v32c0 6.6-5.4 12-12 12h-56v56c0 6.6-5.4 12-12 12h-32c-6.6 0-12-5.4-12-12v-56h-56c-6.6 0-12-5.4-12-12v-32c0-6.6 5.4-12 12-12h56v-56c0-6.6 5.4-12 12-12h32c6.6 0 12 5.4 12 12v56h56c6.6 0 12 5.4 12 12zm201 284.7L476.7 505c-9.4 9.4-24.6 9.4-33.9 0L343 405.3c-4.5-4.5-7-10.6-7-17V372c-35.3 27.6-79.7 44-128 44C93.1 416 0 322.9 0 208S93.1 0 208 0s208 93.1 208 208c0 48.3-16.4 92.7-44 128h16.3c6.4 0 12.5 2.5 17 7l99.7 99.7c9.3 9.4 9.3 24.6 0 34zM344 208c0-75.2-60.8-136-136-136S72 132.8 72 208s60.8 136 136 136 136-60.8 136-136z"}})]):(_vm.icon === 'thumbs-up')?_c('svg',{staticClass:"fa-thumbs-up",attrs:{"aria-hidden":"true","data-prefix":"far","data-icon":"thumbs-up","role":"img","xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 512 512"}},[_c('path',{attrs:{"fill":"currentColor","d":"M466.27 286.69C475.04 271.84 480 256 480 236.85c0-44.015-37.218-85.58-85.82-85.58H357.7c4.92-12.81 8.85-28.13 8.85-46.54C366.55 31.936 328.86 0 271.28 0c-61.607 0-58.093 94.933-71.76 108.6-22.747 22.747-49.615 66.447-68.76 83.4H32c-17.673 0-32 14.327-32 32v240c0 17.673 14.327 32 32 32h64c14.893 0 27.408-10.174 30.978-23.95 44.509 1.001 75.06 39.94 177.802 39.94 7.22 0 15.22.01 22.22.01 77.117 0 111.986-39.423 112.94-95.33 13.319-18.425 20.299-43.122 17.34-66.99 9.854-18.452 13.664-40.343 8.99-62.99zm-61.75 53.83c12.56 21.13 1.26 49.41-13.94 57.57 7.7 48.78-17.608 65.9-53.12 65.9h-37.82c-71.639 0-118.029-37.82-171.64-37.82V240h10.92c28.36 0 67.98-70.89 94.54-97.46 28.36-28.36 18.91-75.63 37.82-94.54 47.27 0 47.27 32.98 47.27 56.73 0 39.17-28.36 56.72-28.36 94.54h103.99c21.11 0 37.73 18.91 37.82 37.82.09 18.9-12.82 37.81-22.27 37.81 13.489 14.555 16.371 45.236-5.21 65.62zM88 432c0 13.255-10.745 24-24 24s-24-10.745-24-24 10.745-24 24-24 24 10.745 24 24z"}})]):(_vm.icon === 'toggle-off')?_c('svg',{staticClass:"fa-toggle-off",attrs:{"aria-hidden":"true","data-prefix":"fas","data-icon":"toggle-off","role":"img","xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 576 512"}},[_c('path',{attrs:{"fill":"currentColor","d":"M384 64H192C85.961 64 0 149.961 0 256s85.961 192 192 192h192c106.039 0 192-85.961 192-192S490.039 64 384 64zM64 256c0-70.741 57.249-128 128-128 70.741 0 128 57.249 128 128 0 70.741-57.249 128-128 128-70.741 0-128-57.249-128-128zm320 128h-48.905c65.217-72.858 65.236-183.12 0-256H384c70.741 0 128 57.249 128 128 0 70.74-57.249 128-128 128z"}})]):(_vm.icon === 'toggle-on')?_c('svg',{staticClass:"fa-toggle-on",attrs:{"aria-hidden":"true","data-prefix":"fas","data-icon":"toggle-on","role":"img","xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 576 512"}},[_c('path',{attrs:{"fill":"currentColor","d":"M576 256c0 106.039-85.961 192-192 192H192C85.961 448 0 362.039 0 256S85.961 64 192 64h192c106.039 0 192 85.961 192 192zM384 128c-70.741 0-128 57.249-128 128 0 70.741 57.249 128 128 128 70.741 0 128-57.249 128-128 0-70.741-57.249-128-128-128"}})]):_c('span',[_vm._v(_vm._s(_vm.icon))])};
  1410. var __vue_staticRenderFns__ = [];
  1411. const __vue_inject_styles__ = undefined;
  1412. const __vue_scope_id__ = undefined;
  1413. const __vue_module_identifier__ = undefined;
  1414. const __vue_is_functional_template__ = false;
  1415. var FontAwesomeIcon = normalizeComponent_1(
  1416. { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
  1417. __vue_inject_styles__,
  1418. __vue_script__,
  1419. __vue_scope_id__,
  1420. __vue_is_functional_template__,
  1421. __vue_module_identifier__,
  1422. undefined,
  1423. undefined
  1424. );
  1425. var script$1 = {
  1426. props: {
  1427. cropped: {
  1428. default: true,
  1429. type: Boolean,
  1430. },
  1431. },
  1432. };
  1433. const __vue_script__$1 = script$1;
  1434. var __vue_render__$1 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('svg',{attrs:{"aria-hidden":"true","focusable":"false","role":"img","xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 512 512"}},[_c('path',{directives:[{name:"show",rawName:"v-show",value:(!_vm.cropped),expression:"!cropped"}],staticClass:"fa-image",attrs:{"fill":"currentColor","d":"M464 64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V112c0-26.51-21.49-48-48-48zm-6 336H54a6 6 0 0 1-6-6V118a6 6 0 0 1 6-6h404a6 6 0 0 1 6 6v276a6 6 0 0 1-6 6zM128 152c-22.091 0-40 17.909-40 40s17.909 40 40 40 40-17.909 40-40-17.909-40-40-40zM96 352h320v-80l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L192 304l-39.515-39.515c-4.686-4.686-12.284-4.686-16.971 0L96 304v48z"}}),_vm._v(" "),_c('path',{directives:[{name:"show",rawName:"v-show",value:(_vm.cropped),expression:"cropped"}],staticClass:"fa-image-cropped",attrs:{"fill":"currentColor","d":"M 80.42266,58.577333 C 70.20134,63.692 62.84266,73.058667 58.406664,86.6 L 56,93.948 56,256 l 0,162.052 2.406664,7.348 c 4.435996,13.54133 11.794676,22.908 22.015996,28.02267 L 85.576,456 256,456 l 170.424,0 5.15334,-2.57733 c 10.22133,-5.11467 17.58,-14.48134 22.016,-28.02267 L 456,418.052 456,256 456,93.948 453.59334,86.6 C 449.136,72.993333 441.88,63.701333 431.77867,58.668 L 426.424,56 256,56 85.576,56 80.42266,58.577333 m 335.52001,49.979997 2.55733,2.556 0,144.88667 0,144.88667 -2.55733,2.556 L 413.38667,406 256,406 98.61333,406 96.05733,403.44267 93.5,400.88667 93.5,256 l 0,-144.88667 2.55733,-2.556 L 98.61333,106 256,106 l 157.38667,0 2.556,2.55733 m -272.44267,80.776 0,36.576 3.24,-1.88133 c 1.78267,-1.036 5.05867,-3.93467 7.28133,-6.444 16.28534,-18.38534 12.456,-51.484 -7.28133,-62.94534 l -3.24,-1.88133 0,36.576 m 109.66534,52.32133 -63.81201,63.78134 -22.2,-22.11467 C 154.94267,271.16 144.62533,261.208 144.22533,261.208 c -0.39866,0 -0.72533,21.328 -0.72533,47.396 l 0,47.396 112.5,0 112.5,0 0,-69.04534 0,-69.04533 -20.11333,-20.01733 -20.112,-20.01734 -5.64933,0 -5.648,0 -63.812,63.78"}})])};
  1435. var __vue_staticRenderFns__$1 = [];
  1436. const __vue_inject_styles__$1 = undefined;
  1437. const __vue_scope_id__$1 = undefined;
  1438. const __vue_module_identifier__$1 = undefined;
  1439. const __vue_is_functional_template__$1 = false;
  1440. var IconCropThumb = normalizeComponent_1(
  1441. { render: __vue_render__$1, staticRenderFns: __vue_staticRenderFns__$1 },
  1442. __vue_inject_styles__$1,
  1443. __vue_script__$1,
  1444. __vue_scope_id__$1,
  1445. __vue_is_functional_template__$1,
  1446. __vue_module_identifier__$1,
  1447. undefined,
  1448. undefined
  1449. );
  1450. var script$2 = {
  1451. props: {
  1452. double: {
  1453. default: false,
  1454. type: Boolean,
  1455. },
  1456. },
  1457. };
  1458. const __vue_script__$2 = script$2;
  1459. var __vue_render__$2 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('svg',{staticClass:"fa-layered-hearts",attrs:{"aria-hidden":"true","role":"img","xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 512 512"}},[_c('g',{directives:[{name:"show",rawName:"v-show",value:(_vm.double),expression:"double"}],attrs:{"transform":"translate(256 256)"}},[_c('g',{attrs:{"transform":"translate(-80, 0) scale(0.6, 0.6) rotate(0 0 0)"}},[_c('path',{attrs:{"fill":"currentColor","d":"M462.3 62.6C407.5 15.9 326 24.3 275.7 76.2L256 96.5l-19.7-20.3C186.1 24.3 104.5 15.9 49.7 62.6c-62.8 53.6-66.1 149.8-9.9 207.9l193.5 199.8c12.5 12.9 32.8 12.9 45.3 0l193.5-199.8c56.3-58.1 53-154.3-9.8-207.9z","transform":"translate(-256 -256)"}})])]),_vm._v(" "),_c('g',{directives:[{name:"show",rawName:"v-show",value:(_vm.double),expression:"double"}],attrs:{"transform":"translate(256 256)"}},[_c('g',{attrs:{"transform":"translate(80, 0) scale(0.6, 0.6) rotate(0 0 0)"}},[_c('path',{attrs:{"fill":"currentColor","d":"M458.4 64.3C400.6 15.7 311.3 23 256 79.3 200.7 23 111.4 15.6 53.6 64.3-21.6 127.6-10.6 230.8 43 285.5l175.4 178.7c10 10.2 23.4 15.9 37.6 15.9 14.3 0 27.6-5.6 37.6-15.8L469 285.6c53.5-54.7 64.7-157.9-10.6-221.3zm-23.6 187.5L259.4 430.5c-2.4 2.4-4.4 2.4-6.8 0L77.2 251.8c-36.5-37.2-43.9-107.6 7.3-150.7 38.9-32.7 98.9-27.8 136.5 10.5l35 35.7 35-35.7c37.8-38.5 97.8-43.2 136.5-10.6 51.1 43.1 43.5 113.9 7.3 150.8z","transform":"translate(-256 -256)"}})])]),_vm._v(" "),_c('g',{directives:[{name:"show",rawName:"v-show",value:(!_vm.double),expression:"!double"}],attrs:{"transform":"translate(256 256)"}},[_c('g',{attrs:{"transform":"translate(0, 0) scale(0.9, 0.9) rotate(0 0 0)"}},[_c('path',{attrs:{"fill":"currentColor","d":"M458.4 64.3C400.6 15.7 311.3 23 256 79.3 200.7 23 111.4 15.6 53.6 64.3-21.6 127.6-10.6 230.8 43 285.5l175.4 178.7c10 10.2 23.4 15.9 37.6 15.9 14.3 0 27.6-5.6 37.6-15.8L469 285.6c53.5-54.7 64.7-157.9-10.6-221.3zm-23.6 187.5L259.4 430.5c-2.4 2.4-4.4 2.4-6.8 0L77.2 251.8c-36.5-37.2-43.9-107.6 7.3-150.7 38.9-32.7 98.9-27.8 136.5 10.5l35 35.7 35-35.7c37.8-38.5 97.8-43.2 136.5-10.6 51.1 43.1 43.5 113.9 7.3 150.8z","transform":"translate(-256 -256)"}})])])])};
  1460. var __vue_staticRenderFns__$2 = [];
  1461. const __vue_inject_styles__$2 = undefined;
  1462. const __vue_scope_id__$2 = undefined;
  1463. const __vue_module_identifier__$2 = undefined;
  1464. const __vue_is_functional_template__$2 = false;
  1465. var IconLayeredHearts = normalizeComponent_1(
  1466. { render: __vue_render__$2, staticRenderFns: __vue_staticRenderFns__$2 },
  1467. __vue_inject_styles__$2,
  1468. __vue_script__$2,
  1469. __vue_scope_id__$2,
  1470. __vue_is_functional_template__$2,
  1471. __vue_module_identifier__$2,
  1472. undefined,
  1473. undefined
  1474. );
  1475. var script$3 = {
  1476. components: {
  1477. FontAwesomeIcon,
  1478. IconCropThumb,
  1479. IconLayeredHearts,
  1480. },
  1481. props: {
  1482. id: {
  1483. default: '',
  1484. type: String,
  1485. },
  1486. },
  1487. data() {
  1488. return {
  1489. debounceId4sortInput: null,
  1490. debounceId4tagsFilter: null,
  1491. sortingOrderSwitchOn: false,
  1492. unbookmarkedOnly: this.$store.getters.unbookmarkedOnly,
  1493. usualList: [100, 500, 1000, 3000, 5000, 10000],
  1494. usualSwitchOn: false,
  1495. };
  1496. },
  1497. computed: {
  1498. buttonMsg() {
  1499. if (this.status.isEnded) {
  1500. return this.$t('ctrlPanel.buttonEnd');
  1501. } else if (this.status.isPaused) {
  1502. return this.$t('ctrlPanel.buttonGo');
  1503. } else {
  1504. return this.$t('ctrlPanel.buttonPause');
  1505. }
  1506. },
  1507. filters() {
  1508. return this.$store.getters.filters;
  1509. },
  1510. isSelfBookmarkPage() {
  1511. return this.$store.getters.isSelfBookmarkPage;
  1512. },
  1513. processedCountMsg() {
  1514. const rootGetters = this.$store.getters;
  1515. const isNewProfilePage = rootGetters['pixiv/nppType'] >= 0;
  1516. let indices = null;
  1517. if (isNewProfilePage) {
  1518. indices = rootGetters['pixiv/nppDisplayIndices'];
  1519. } else {
  1520. indices = rootGetters['pixiv/defaultDisplayIndices'];
  1521. }
  1522. const { shows, hides } = indices;
  1523. return `${shows.length} / ${shows.length + hides.length}`;
  1524. },
  1525. sortingOrderMsg() {
  1526. switch (this.xc.sort) {
  1527. case SORT_TYPE.BOOKMARK_COUNT:
  1528. return this.$t('ctrlPanel.sortByPopularity');
  1529. case SORT_TYPE.ILLUST_ID:
  1530. return this.$t('ctrlPanel.sortByDate');
  1531. default:
  1532. return this.$t('ctrlPanel.sortByBookmarkId');
  1533. }
  1534. },
  1535. status() {
  1536. return this.$store.getters['pixiv/status'];
  1537. },
  1538. statusClass() {
  1539. const _s = this.status;
  1540. return {
  1541. end: _s.isEnded,
  1542. go: _s.isPaused && !_s.isEnded,
  1543. paused: !_s.isPaused && !_s.isEnded,
  1544. };
  1545. },
  1546. xc() {
  1547. return this.$store.getters.config;
  1548. },
  1549. },
  1550. methods: {
  1551. clickMainButton() {
  1552. if (this.status.isPaused) {
  1553. this.$store.dispatch('pixiv/start');
  1554. } else {
  1555. this.$store.dispatch('pixiv/pause');
  1556. }
  1557. },
  1558. clickSortingOrder(event) {
  1559. const ct = event.currentTarget;
  1560. switch (ct.id) {
  1561. case 'koakuma-sorting-order-by-popularity':
  1562. this.$store.commit('setConfig', { sort: SORT_TYPE.BOOKMARK_COUNT });
  1563. break;
  1564. case 'koakuma-sorting-order-by-bookmark-id':
  1565. this.$store.commit('setConfig', { sort: SORT_TYPE.BOOKMARK_ID });
  1566. break;
  1567. default:
  1568. this.$store.commit('setConfig', { sort: SORT_TYPE.ILLUST_ID });
  1569. break;
  1570. }
  1571. this.$store.commit('saveConfig');
  1572. this.$store.commit('applyConfig');
  1573. this.sortingOrderSwitchOn = false;
  1574. },
  1575. clickUsual(event) {
  1576. this.$store.commit('setFilters', {
  1577. limit: toInt(event.currentTarget.textContent),
  1578. });
  1579. this.usualSwitchOn = false;
  1580. },
  1581. openCoverLayerInConfigMode() {
  1582. this.$store.commit('coverLayer/open', { data: null, mode: 'config' });
  1583. },
  1584. optionsChange(event) {
  1585. if (event.target.closest('#koakuma-options-width-compress')) {
  1586. this.$store.commit('setConfig', { fitwidth: false });
  1587. } else if (event.target.closest('#koakuma-options-width-expand')) {
  1588. this.$store.commit('setConfig', { fitwidth: true });
  1589. }
  1590. this.$store.commit('saveConfig');
  1591. this.$store.commit('applyConfig');
  1592. },
  1593. sortInputInput(event) {
  1594. if (this.debounceId4sortInput) {
  1595. clearTimeout(this.debounceId4sortInput);
  1596. }
  1597. this.debounceId4sortInput = setTimeout(() => {
  1598. this.debounceId4sortInput = null;
  1599. this.$store.commit('setFilters', {
  1600. limit: Math.max(0, toInt(event.target.value)),
  1601. });
  1602. }, 500);
  1603. },
  1604. sortInputWheel(event) {
  1605. if (event.deltaY < 0) {
  1606. this.$store.commit('setFilters', {
  1607. limit: toInt(event.target.value) + 20,
  1608. });
  1609. } else {
  1610. this.$store.commit('setFilters', {
  1611. limit: Math.max(0, toInt(event.target.value) - 20),
  1612. });
  1613. }
  1614. },
  1615. tagsFilterInput(event) {
  1616. if (this.debounceId4tagsFilter) {
  1617. clearTimeout(this.debounceId4tagsFilter);
  1618. }
  1619. this.debounceId4tagsFilter = setTimeout(() => {
  1620. this.debounceId4tagsFilter = null;
  1621. this.$store.commit('setFilters', {
  1622. query: event.target.value,
  1623. });
  1624. }, 1500);
  1625. },
  1626. toggleCroppedThumb() {
  1627. this.$store.commit('setConfig', {
  1628. croppedThumb: !this.xc.croppedThumb,
  1629. });
  1630. this.$store.commit('saveConfig');
  1631. },
  1632. toggleUnbookmarkedOnly() {
  1633. this.$store.commit('toggleUnbookmarkedOnly');
  1634. this.unbookmarkedOnly = this.$store.getters.unbookmarkedOnly;
  1635. },
  1636. },
  1637. };
  1638. var isOldIE = typeof navigator !== 'undefined' && /msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());
  1639. function createInjector(context) {
  1640. return function (id, style) {
  1641. return addStyle(id, style);
  1642. };
  1643. }
  1644. var HEAD;
  1645. var styles = {};
  1646. function addStyle(id, css) {
  1647. var group = isOldIE ? css.media || 'default' : id;
  1648. var style = styles[group] || (styles[group] = {
  1649. ids: new Set(),
  1650. styles: []
  1651. });
  1652. if (!style.ids.has(id)) {
  1653. style.ids.add(id);
  1654. var code = css.source;
  1655. if (css.map) {
  1656. code += '\n/*# sourceURL=' + css.map.sources[0] + ' */';
  1657. code += '\n/*# sourceMappingURL=data:application/json;base64,' + btoa(unescape(encodeURIComponent(JSON.stringify(css.map)))) + ' */';
  1658. }
  1659. if (!style.element) {
  1660. style.element = document.createElement('style');
  1661. style.element.type = 'text/css';
  1662. if (css.media) style.element.setAttribute('media', css.media);
  1663. if (HEAD === undefined) {
  1664. HEAD = document.head || document.getElementsByTagName('head')[0];
  1665. }
  1666. HEAD.appendChild(style.element);
  1667. }
  1668. if ('styleSheet' in style.element) {
  1669. style.styles.push(code);
  1670. style.element.styleSheet.cssText = style.styles.filter(Boolean).join('\n');
  1671. } else {
  1672. var index = style.ids.size - 1;
  1673. var textNode = document.createTextNode(code);
  1674. var nodes = style.element.childNodes;
  1675. if (nodes[index]) style.element.removeChild(nodes[index]);
  1676. if (nodes.length) style.element.insertBefore(textNode, nodes[index]);else style.element.appendChild(textNode);
  1677. }
  1678. }
  1679. }
  1680. var browser = createInjector;
  1681. const __vue_script__$3 = script$3;
  1682. var __vue_render__$3 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{ref:_vm.id,attrs:{"id":_vm.id}},[_c('div',{staticClass:"koakuma-block",attrs:{"id":"koakuma-processed-block"}},[_vm._v(_vm._s(_vm.processedCountMsg))]),_vm._v(" "),_c('div',{staticClass:"koakuma-block",attrs:{"id":"koakuma-bookmark-sort-block"}},[_c('label',{attrs:{"id":"koakuma-bookmark-sort-label","for":"koakuma-bookmark-sort-input"}},[_c('span',[_vm._v("❤️")]),_vm._v(" "),_c('input',{attrs:{"id":"koakuma-bookmark-sort-input","type":"number","min":"0","step":"1"},domProps:{"value":_vm.filters.limit},on:{"wheel":function($event){$event.stopPropagation();$event.preventDefault();return _vm.sortInputWheel($event)},"input":_vm.sortInputInput}})]),_vm._v(" "),_c('a',{attrs:{"id":"koakuma-bookmark-input-usual-switch","role":"button"},on:{"click":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"left",37,$event.key,["Left","ArrowLeft"])){ return null; }if('button' in $event && $event.button !== 0){ return null; }_vm.usualSwitchOn = !_vm.usualSwitchOn;}}},[_c('FontAwesomeIcon',{attrs:{"icon":'angle-down'}})],1),_vm._v(" "),_c('ul',{directives:[{name:"show",rawName:"v-show",value:(_vm.usualSwitchOn),expression:"usualSwitchOn"}],attrs:{"id":"koakuma-bookmark-input-usual-list"}},_vm._l((_vm.usualList),function(usual){return _c('li',{key:usual},[_c('span',{staticClass:"sort-order-apply-indicator"},[_vm._v("⮬")]),_vm._v(" "),_c('a',{staticClass:"usual-list-link",attrs:{"role":"button"},on:{"click":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"left",37,$event.key,["Left","ArrowLeft"])){ return null; }if('button' in $event && $event.button !== 0){ return null; }return _vm.clickUsual($event)}}},[_vm._v(_vm._s(usual))])])}),0)]),_vm._v(" "),_c('div',{staticClass:"koakuma-block"},[_c('input',{attrs:{"id":"koakuma-bookmark-tags-filter-input","placeholder":_vm.$t('ctrlPanel.tagFilterQueryPlaceholder'),"type":"text"},on:{"input":_vm.tagsFilterInput}})]),_vm._v(" "),_c('div',{staticClass:"koakuma-block"},[_c('button',{class:_vm.statusClass,attrs:{"id":"koakuma-main-button","disabled":_vm.status.isEnded},on:{"mouseup":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"left",37,$event.key,["Left","ArrowLeft"])){ return null; }if('button' in $event && $event.button !== 0){ return null; }return _vm.clickMainButton($event)}}},[_vm._v(_vm._s(_vm.buttonMsg))])]),_vm._v(" "),_c('div',{staticClass:"koakuma-block",attrs:{"id":"koakuma-sorting-order-block"}},[_c('a',{attrs:{"id":"koakuma-sorting-order-select-switch","role":"button"},on:{"click":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"left",37,$event.key,["Left","ArrowLeft"])){ return null; }if('button' in $event && $event.button !== 0){ return null; }_vm.sortingOrderSwitchOn = !_vm.sortingOrderSwitchOn;}}},[_c('output',{attrs:{"id":"koakuma-sorting-order-select-output"}},[_vm._v(_vm._s(_vm.sortingOrderMsg))]),_vm._v(" "),_c('FontAwesomeIcon',{attrs:{"icon":'angle-down'}})],1),_vm._v(" "),_c('ul',{directives:[{name:"show",rawName:"v-show",value:(_vm.sortingOrderSwitchOn),expression:"sortingOrderSwitchOn"}],attrs:{"id":"koakuma-sorting-order-select-list"}},[_c('li',[_c('span',{staticClass:"sort-order-apply-indicator"},[_vm._v("⮬")]),_vm._v(" "),_c('a',{staticClass:"sorting-order-link",attrs:{"id":"koakuma-sorting-order-by-popularity","role":"button"},on:{"click":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"left",37,$event.key,["Left","ArrowLeft"])){ return null; }if('button' in $event && $event.button !== 0){ return null; }return _vm.clickSortingOrder($event)}}},[_vm._v(_vm._s(_vm.$t('ctrlPanel.sortByPopularity')))])]),_vm._v(" "),_c('li',[_c('span',{staticClass:"sort-order-apply-indicator"},[_vm._v("⮬")]),_vm._v(" "),_c('a',{staticClass:"sorting-order-link",attrs:{"id":"koakuma-sorting-order-by-date","role":"button"},on:{"click":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"left",37,$event.key,["Left","ArrowLeft"])){ return null; }if('button' in $event && $event.button !== 0){ return null; }return _vm.clickSortingOrder($event)}}},[_vm._v(_vm._s(_vm.$t('ctrlPanel.sortByDate')))])]),_vm._v(" "),_c('li',{directives:[{name:"show",rawName:"v-show",value:(_vm.isSelfBookmarkPage),expression:"isSelfBookmarkPage"}]},[_c('span',{staticClass:"sort-order-apply-indicator"},[_vm._v("⮬")]),_vm._v(" "),_c('a',{staticClass:"sorting-order-link",attrs:{"id":"koakuma-sorting-order-by-bookmark-id","role":"button"},on:{"click":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"left",37,$event.key,["Left","ArrowLeft"])){ return null; }if('button' in $event && $event.button !== 0){ return null; }return _vm.clickSortingOrder($event)}}},[_vm._v(_vm._s(_vm.$t('ctrlPanel.sortByBookmarkId')))])])])]),_vm._v(" "),_c('div',{staticClass:"koakuma-block",attrs:{"id":"koakuma-display-options-block"}},[_c('div',{directives:[{name:"show",rawName:"v-show",value:(!_vm.isSelfBookmarkPage),expression:"!isSelfBookmarkPage"}],on:{"click":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"left",37,$event.key,["Left","ArrowLeft"])){ return null; }if('button' in $event && $event.button !== 0){ return null; }return _vm.toggleUnbookmarkedOnly($event)}}},[_c('IconLayeredHearts',{attrs:{"id":"koakuma-display-options-unbookmarked-only","double":_vm.unbookmarkedOnly}})],1)]),_vm._v(" "),_c('div',{staticClass:"koakuma-block",attrs:{"id":"koakuma-crop-thumb-options-block"}},[_c('div',{on:{"click":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"left",37,$event.key,["Left","ArrowLeft"])){ return null; }if('button' in $event && $event.button !== 0){ return null; }return _vm.toggleCroppedThumb($event)}}},[_c('IconCropThumb',{attrs:{"id":"koakuma-crop-thumb-options-icon","cropped":!!_vm.xc.croppedThumb}})],1)]),_vm._v(" "),_c('div',{staticClass:"koakuma-block",attrs:{"id":"koakuma-options-block"}},[_c('div',{on:{"click":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"left",37,$event.key,["Left","ArrowLeft"])){ return null; }if('button' in $event && $event.button !== 0){ return null; }return _vm.optionsChange($event)}}},[_c('FontAwesomeIcon',{directives:[{name:"show",rawName:"v-show",value:(_vm.xc.fitwidth),expression:"xc.fitwidth"}],attrs:{"id":"koakuma-options-width-compress","icon":'compress'}}),_vm._v(" "),_c('FontAwesomeIcon',{directives:[{name:"show",rawName:"v-show",value:(!_vm.xc.fitwidth),expression:"!xc.fitwidth"}],attrs:{"id":"koakuma-options-width-expand","icon":'expand'}})],1),_vm._v(" "),_c('div',{on:{"click":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"left",37,$event.key,["Left","ArrowLeft"])){ return null; }if('button' in $event && $event.button !== 0){ return null; }return _vm.openCoverLayerInConfigMode($event)}}},[_c('FontAwesomeIcon',{attrs:{"id":"koakuma-options-config","icon":'cog'}})],1)])])};
  1683. var __vue_staticRenderFns__$3 = [];
  1684. const __vue_inject_styles__$3 = function (inject) {
  1685. if (!inject) return
  1686. inject("data-v-039298e9_0", { source: "a[data-v-039298e9]{color:#258fb8;text-decoration:none}a[role=button]>.fa-angle-down[data-v-039298e9]{padding:2px;height:16px}#Koakuma[data-v-039298e9]{display:flex;justify-content:center;align-items:center;position:sticky;top:0;z-index:3;background-color:#eef;box-shadow:0 1px 1px #777;padding:4px;color:#00186c;font-size:16px}.koakuma-block[data-v-039298e9]{margin:0 10px;display:inline-flex}#koakuma-processed-block[data-v-039298e9]{font-size:18px}#koakuma-bookmark-sort-label[data-v-039298e9]{display:inline-flex!important;align-items:center;margin-right:0;border-radius:3px 0 0 3px;background-color:#cef;color:#0069b1;margin:0 1px;padding:0 6px}#koakuma-bookmark-sort-block[data-v-039298e9],#koakuma-sorting-order-block[data-v-039298e9]{position:relative;box-shadow:0 0 1px #069;border-radius:4px}#koakuma-sorting-order-block[data-v-039298e9]{background-color:#cef}#koakuma-bookmark-sort-input[data-v-039298e9]{-moz-appearance:textfield;border:none;background-color:transparent;padding:0;color:inherit;font-size:16px;display:inline-block;cursor:ns-resize;text-align:center;max-width:50px}#koakuma-bookmark-sort-input[data-v-039298e9]::-webkit-inner-spin-button,#koakuma-bookmark-sort-input[data-v-039298e9]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}#koakuma-bookmark-tags-filter-input[data-v-039298e9]{margin:0;padding:0 4px;color:#333;font-size:12px;border:1px solid #becad7;height:20px;min-width:300px}#koakuma-bookmark-tags-filter-input[data-v-039298e9]:focus{background:#ffc;outline:0}#koakuma-bookmark-input-usual-switch[data-v-039298e9],#koakuma-sorting-order-select-switch[data-v-039298e9]{background-color:#cef;padding:1px;border-left:1px solid #888;border-radius:0 3px 3px 0;cursor:pointer;display:inline-flex;align-items:center}#koakuma-sorting-order-select-switch[data-v-039298e9]{border:none;border-radius:3px}#koakuma-bookmark-input-usual-list[data-v-039298e9],#koakuma-sorting-order-select-list[data-v-039298e9]{border-radius:3px;background-color:#cef;box-shadow:0 0 2px #069;position:absolute;top:100%;width:100%;margin-top:1px;list-style:none;padding:0}#koakuma-sorting-order-select-list[data-v-039298e9]{display:grid;grid-auto-columns:max-content;width:initial}#koakuma-bookmark-input-usual-list>li[data-v-039298e9],#koakuma-sorting-order-select-list>li[data-v-039298e9]{display:flex;position:relative;line-height:24px}#koakuma-bookmark-input-usual-list>li[data-v-039298e9]::after,#koakuma-sorting-order-select-list>li[data-v-039298e9]::after{content:\"\";box-shadow:0 0 0 1px #89d8ff;display:inline-block;margin:0;height:0;line-height:0;font-size:0;position:absolute;left:0;right:0;width:100%;transform:scaleX(.8)}#koakuma-bookmark-input-usual-list>li[data-v-039298e9]:first-child::after,#koakuma-sorting-order-select-list>li[data-v-039298e9]:first-child::after{box-shadow:none}#koakuma-bookmark-input-usual-list .sort-order-apply-indicator[data-v-039298e9],#koakuma-sorting-order-select-list .sort-order-apply-indicator[data-v-039298e9]{visibility:hidden}#koakuma-bookmark-input-usual-list .sort-order-apply-indicator[data-v-039298e9]{position:absolute}#koakuma-bookmark-input-usual-list>li:hover .sort-order-apply-indicator[data-v-039298e9],#koakuma-sorting-order-select-list>li:hover .sort-order-apply-indicator[data-v-039298e9]{visibility:visible}.sort-order-apply-indicator[data-v-039298e9]{display:block;justify-content:center;align-items:center;font-weight:bolder;padding:0 4px}.sorting-order-link[data-v-039298e9],.usual-list-link[data-v-039298e9]{display:block;cursor:pointer;text-align:center;flex:1}.sorting-order-link[data-v-039298e9]{padding-right:18px}#koakuma-sorting-order-select-output[data-v-039298e9]{padding:0 16px;display:flex;align-items:center}#koakuma-sorting-order-select[data-v-039298e9]{font-size:14px}#koakuma-crop-thumb-options-block>*[data-v-039298e9],#koakuma-display-options-block>*[data-v-039298e9],#koakuma-options-block>*[data-v-039298e9]{margin:0 5px;display:inline-flex;align-items:center}#koakuma-main-button[data-v-039298e9]{border:none;padding:2px 14px;border-radius:3px;font-size:16px}#koakuma-main-button[data-v-039298e9]:enabled{transform:translate(-1px,-1px);box-shadow:1px 1px 1px #4c4c4c;cursor:pointer}#koakuma-main-button[data-v-039298e9]:enabled:hover{transform:translate(0);box-shadow:none}#koakuma-main-button[data-v-039298e9]:enabled:active{transform:translate(1px,1px);box-shadow:-1px -1px 1px #4c4c4c}#koakuma-main-button.go[data-v-039298e9]{background-color:#00ff59}#koakuma-main-button.paused[data-v-039298e9]{background-color:#feff00}#koakuma-main-button.end[data-v-039298e9]{background-color:#878787;color:#fff;opacity:.87}#koakuma-crop-thumb-options-icon[data-v-039298e9],#koakuma-display-options-unbookmarked-only[data-v-039298e9],#koakuma-options-config[data-v-039298e9],#koakuma-options-width-compress[data-v-039298e9],#koakuma-options-width-expand[data-v-039298e9]{height:20px;cursor:pointer}", map: undefined, media: undefined });
  1687. };
  1688. const __vue_scope_id__$3 = "data-v-039298e9";
  1689. const __vue_module_identifier__$3 = undefined;
  1690. const __vue_is_functional_template__$3 = false;
  1691. var ctrlPanel = normalizeComponent_1(
  1692. { render: __vue_render__$3, staticRenderFns: __vue_staticRenderFns__$3 },
  1693. __vue_inject_styles__$3,
  1694. __vue_script__$3,
  1695. __vue_scope_id__$3,
  1696. __vue_is_functional_template__$3,
  1697. __vue_module_identifier__$3,
  1698. browser,
  1699. undefined
  1700. );
  1701. const GMC = {
  1702. async XHR(details) {
  1703. const xhr = window.GM_xmlhttpRequest || (GM ? GM.xmlHttpRequest : null);
  1704. if (!xhr) {
  1705. return Promise.reject();
  1706. }
  1707. return new Promise((resolve, reject) => {
  1708. Object.assign(details, {
  1709. onabort: reject,
  1710. onerror: reject,
  1711. onload: resolve,
  1712. ontimeout: reject,
  1713. });
  1714. xhr(details);
  1715. });
  1716. },
  1717. async getValue(name, failv = null) {
  1718. if (window.GM_getValue) {
  1719. return Promise.resolve(GM_getValue(name) || failv);
  1720. } else {
  1721. return (await GM.getValue(name)) || failv;
  1722. }
  1723. },
  1724. async setValue(name, value) {
  1725. if (window.GM_setValue) {
  1726. GM_setValue(name, value);
  1727. } else {
  1728. GM.setValue(name, value);
  1729. }
  1730. },
  1731. };
  1732. var script$4 = {
  1733. components: { FontAwesomeIcon },
  1734. computed: {
  1735. bookmarkPageLink() {
  1736. if (!this.xdata) {
  1737. return '#';
  1738. }
  1739. return `bookmark_add.php?type=illust&illust_id=${this.xdata.illustId}`;
  1740. },
  1741. currentImageItem() {
  1742. if (!this.xdata) {
  1743. return null;
  1744. }
  1745. const lib = this.$store.getters['pixiv/imageItemLibrary'];
  1746. const found = lib.find(i => i.illustId === this.xdata.illustId);
  1747. return found ? found : null;
  1748. },
  1749. currentType() {
  1750. if (!this.xdata) {
  1751. return '';
  1752. }
  1753. return this.xdata.type;
  1754. },
  1755. inlineStyle() {
  1756. const RIGHT_BOUND = 200;
  1757. const position = this.xpos;
  1758. const ow = document.body.offsetWidth;
  1759. let style = `top: ${position.y}px;`;
  1760. if (ow - position.x < RIGHT_BOUND) {
  1761. style += `right: ${ow - position.x}px;`;
  1762. } else {
  1763. style += `left: ${position.x}px;`;
  1764. }
  1765. return style;
  1766. },
  1767. isDownloadable() {
  1768. return (
  1769. this.currentImageItem &&
  1770. this.currentImageItem.illustPageCount === 1 &&
  1771. !this.currentImageItem.isUgoira
  1772. );
  1773. },
  1774. isUgoira() {
  1775. return this.currentImageItem && this.currentImageItem.isUgoira;
  1776. },
  1777. xdata() {
  1778. return this.$store.getters['contextMenu/data'];
  1779. },
  1780. xpos() {
  1781. return this.$store.getters['contextMenu/pos'];
  1782. },
  1783. },
  1784. methods: {
  1785. addToBlacklist() {
  1786. if (this.currentImageItem) {
  1787. const userId = this.currentImageItem.userId;
  1788. const blacklist = this.$store.getters.config.blacklist;
  1789. blacklist.push(userId);
  1790. blacklist.sort((a, b) => a - b);
  1791. this.$store.commit('setConfig', { blacklist });
  1792. this.$store.commit('saveConfig');
  1793. }
  1794. },
  1795. async downloadOne() {
  1796. const imgUrl = this.currentImageItem.urls.original;
  1797. const illustId = this.currentImageItem.illustId;
  1798. const a = $el('a', { href: imgUrl });
  1799. const filename = a.pathname.split('/').pop();
  1800. const ext = filename
  1801. .split('.')
  1802. .pop()
  1803. .toLowerCase();
  1804. const response = await GMC.XHR({
  1805. method: 'GET',
  1806. url: imgUrl,
  1807. responseType: 'arraybuffer',
  1808. binary: true,
  1809. headers: {
  1810. Referer: `https://www.pixiv.net/member_illust.php?mode=medium&illust_id=${illustId}`,
  1811. },
  1812. });
  1813. if (ext === 'jpg' || ext === 'jpeg') {
  1814. saveAs(new File([response.response], filename, { type: 'image/jpeg' }));
  1815. } else if (ext === 'png') {
  1816. saveAs(new File([response.response], filename, { type: 'image/png' }));
  1817. }
  1818. },
  1819. async followUser() {
  1820. if (this.currentImageItem) {
  1821. const userId = this.currentImageItem.userId;
  1822. if (await PixivAPI.postFollowUser(userId)) {
  1823. this.$store.commit('pixiv/editImgItem', {
  1824. type: 'follow-user',
  1825. userId: this.currentImageItem.userId,
  1826. });
  1827. }
  1828. }
  1829. },
  1830. openPreview() {
  1831. this.$store.commit('coverLayer/open', {
  1832. data: this.currentImageItem,
  1833. mode: 'preview',
  1834. });
  1835. },
  1836. thumbUp() {
  1837. if (this.currentImageItem) {
  1838. PixivAPI.postIllustLike(this.currentImageItem.illustId);
  1839. }
  1840. },
  1841. },
  1842. };
  1843. const __vue_script__$4 = script$4;
  1844. var __vue_render__$4 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{style:(_vm.inlineStyle),attrs:{"id":"patchouli-context-menu"}},[_c('ul',{directives:[{name:"show",rawName:"v-show",value:(_vm.currentType === 'image-item-image'),expression:"currentType === 'image-item-image'"}]},[_c('li',[_c('a',{attrs:{"role":"button"},on:{"click":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"left",37,$event.key,["Left","ArrowLeft"])){ return null; }if('button' in $event && $event.button !== 0){ return null; }return _vm.thumbUp($event)}}},[_c('FontAwesomeIcon',{attrs:{"icon":'thumbs-up'}}),_vm._v("\n "+_vm._s(_vm.$t('contextMenu.thumbUp'))+"\n ")],1)]),_vm._v(" "),_c('li',{directives:[{name:"show",rawName:"v-show",value:(_vm.isDownloadable),expression:"isDownloadable"}]},[_c('a',{attrs:{"role":"button"},on:{"click":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"left",37,$event.key,["Left","ArrowLeft"])){ return null; }if('button' in $event && $event.button !== 0){ return null; }return _vm.downloadOne($event)}}},[_c('FontAwesomeIcon',{attrs:{"icon":'download'}}),_vm._v("\n "+_vm._s(_vm.$t('contextMenu.download'))+"\n ")],1)]),_vm._v(" "),_c('li',[_c('a',{attrs:{"role":"button"},on:{"click":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"left",37,$event.key,["Left","ArrowLeft"])){ return null; }if('button' in $event && $event.button !== 0){ return null; }return _vm.openPreview($event)}}},[_c('FontAwesomeIcon',{attrs:{"icon":'search-plus'}}),_vm._v("\n "+_vm._s(_vm.$t('contextMenu.preview'))+"\n ")],1)]),_vm._v(" "),_c('li',[_c('a',{attrs:{"href":_vm.bookmarkPageLink,"role":"button","target":"_blank"}},[_c('FontAwesomeIcon',{attrs:{"icon":'bookmark'}}),_vm._v("\n "+_vm._s(_vm.$t('contextMenu.openBookmarkPage'))+"\n ")],1)])]),_vm._v(" "),_c('ul',{directives:[{name:"show",rawName:"v-show",value:(_vm.currentType === 'image-item-title-user'),expression:"currentType === 'image-item-title-user'"}]},[_c('li',[_c('a',{attrs:{"role":"button"},on:{"click":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"left",37,$event.key,["Left","ArrowLeft"])){ return null; }if('button' in $event && $event.button !== 0){ return null; }return _vm.addToBlacklist($event)}}},[_c('FontAwesomeIcon',{attrs:{"icon":'eye-slash'}}),_vm._v("\n "+_vm._s(_vm.$t('contextMenu.addToBlacklist'))+"\n ")],1)]),_vm._v(" "),_c('li',{directives:[{name:"show",rawName:"v-show",value:(_vm.currentImageItem && !_vm.currentImageItem.isFollowed),expression:"currentImageItem && !currentImageItem.isFollowed"}]},[_c('a',{attrs:{"role":"button"},on:{"click":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"left",37,$event.key,["Left","ArrowLeft"])){ return null; }if('button' in $event && $event.button !== 0){ return null; }return _vm.followUser($event)}}},[_c('FontAwesomeIcon',{attrs:{"icon":'rss'}}),_vm._v("\n "+_vm._s(_vm.$t('contextMenu.followUser'))+"\n ")],1)])])])};
  1845. var __vue_staticRenderFns__$4 = [];
  1846. const __vue_inject_styles__$4 = function (inject) {
  1847. if (!inject) return
  1848. inject("data-v-9e5a37f4_0", { source: "#patchouli-context-menu[data-v-9e5a37f4]{box-sizing:border-box;border:1px solid #b28fce;position:fixed;z-index:10;background-color:#fff;font-size:16px;overflow:hidden;border-radius:5px}#patchouli-context-menu>ul[data-v-9e5a37f4]{margin:0;padding:0;line-height:20px}#patchouli-context-menu>ul>li[data-v-9e5a37f4]{display:flex;align-items:center}#patchouli-context-menu>ul a[data-v-9e5a37f4]{color:#85a;padding:3px;flex:1;text-decoration:none;white-space:nowrap;display:inline-flex;align-items:center;text-align:center}#patchouli-context-menu>ul a[data-v-9e5a37f4]:hover{background-color:#b28fce;color:#fff;cursor:pointer}#patchouli-context-menu>ul svg[role=img][data-v-9e5a37f4]{height:18px;width:18px;margin:0 4px}", map: undefined, media: undefined });
  1849. };
  1850. const __vue_scope_id__$4 = "data-v-9e5a37f4";
  1851. const __vue_module_identifier__$4 = undefined;
  1852. const __vue_is_functional_template__$4 = false;
  1853. var ContextMenu = normalizeComponent_1(
  1854. { render: __vue_render__$4, staticRenderFns: __vue_staticRenderFns__$4 },
  1855. __vue_inject_styles__$4,
  1856. __vue_script__$4,
  1857. __vue_scope_id__$4,
  1858. __vue_is_functional_template__$4,
  1859. __vue_module_identifier__$4,
  1860. browser,
  1861. undefined
  1862. );
  1863. var script$5 = {
  1864. props: {
  1865. size: {
  1866. default: 48,
  1867. type: Number,
  1868. },
  1869. },
  1870. computed: {
  1871. inlineStyle() {
  1872. return `height: ${this.size}px; width: ${this.size}px;`;
  1873. },
  1874. },
  1875. };
  1876. const __vue_script__$5 = script$5;
  1877. var __vue_render__$5 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('svg',{staticClass:"iup",style:(_vm.inlineStyle),attrs:{"viewBox":"0 0 24 24"}},[_c('circle',{staticClass:"iup-circle",attrs:{"cx":"12","cy":"12","r":"10"}}),_vm._v(" "),_c('path',{attrs:{"d":"M9,8.74841664 L9,15.2515834 C9,15.8038681 9.44771525,16.2515834 10,16.2515834 C10.1782928,16.2515834 10.3533435,16.2039156 10.5070201,16.1135176 L16.0347118,12.8619342 C16.510745,12.5819147 16.6696454,11.969013 16.3896259,11.4929799 C16.3034179,11.3464262 16.1812655,11.2242738 16.0347118,11.1380658 L10.5070201,7.88648243 C10.030987,7.60646294 9.41808527,7.76536339 9.13806578,8.24139652 C9.04766776,8.39507316 9,8.57012386 9,8.74841664 Z"}})])};
  1878. var __vue_staticRenderFns__$5 = [];
  1879. const __vue_inject_styles__$5 = function (inject) {
  1880. if (!inject) return
  1881. inject("data-v-0b17ca5d_0", { source: ".iup-circle[data-v-0b17ca5d]{fill:#000;fill-opacity:.4}.iup[data-v-0b17ca5d]{fill:#fff;font-size:0;line-height:0;stroke:none;vertical-align:middle}", map: undefined, media: undefined });
  1882. };
  1883. const __vue_scope_id__$5 = "data-v-0b17ca5d";
  1884. const __vue_module_identifier__$5 = undefined;
  1885. const __vue_is_functional_template__$5 = false;
  1886. var IconUgoiraPlay = normalizeComponent_1(
  1887. { render: __vue_render__$5, staticRenderFns: __vue_staticRenderFns__$5 },
  1888. __vue_inject_styles__$5,
  1889. __vue_script__$5,
  1890. __vue_scope_id__$5,
  1891. __vue_is_functional_template__$5,
  1892. __vue_module_identifier__$5,
  1893. browser,
  1894. undefined
  1895. );
  1896. var script$6 = {
  1897. props: {
  1898. actived: {
  1899. default: false,
  1900. type: Boolean,
  1901. },
  1902. isPrivate: {
  1903. default: false,
  1904. type: Boolean,
  1905. },
  1906. },
  1907. computed: {
  1908. classes() {
  1909. return {
  1910. ['ibh-active']: this.actived,
  1911. ['ibh-inactive']: !this.actived,
  1912. ['ibh-private']: this.isPrivate,
  1913. };
  1914. },
  1915. },
  1916. };
  1917. const __vue_script__$6 = script$6;
  1918. var __vue_render__$6 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('svg',{staticClass:"ibh-effect",class:_vm.classes,attrs:{"viewBox":"0 0 32 32","width":"32","height":"32"}},[_c('path',{staticClass:"ibh-filled-heart",attrs:{"fill-rule":"evenodd","clip-rule":"evenodd","d":"M21,5.5 C24.8659932,5.5 28,8.63400675 28,12.5 C28,18.2694439 24.2975093,23.1517313 17.2206059,27.1100183 C16.4622493,27.5342993 15.5379984,27.5343235 14.779626,27.110148 C7.70250208,23.1517462 4,18.2694529 4,12.5 C4,8.63400691 7.13400681,5.5 11,5.5 C12.829814,5.5 14.6210123,6.4144028 16,7.8282366 C17.3789877,6.4144028 19.170186,5.5 21,5.5 Z"}}),_vm._v(" "),_c('path',{staticClass:"ibh-hollow-heart",attrs:{"d":"M16,11.3317089 C15.0857201,9.28334665 13.0491506,7.5 11,7.5 C8.23857625,7.5 6,9.73857647 6,12.5 C6,17.4386065 9.2519779,21.7268174 15.7559337,25.3646328 C15.9076021,25.4494645 16.092439,25.4494644 16.2441073,25.3646326 C22.7480325,21.7268037 26,17.4385986 26,12.5 C26,9.73857625 23.7614237,7.5 21,7.5 C18.9508494,7.5 16.9142799,9.28334665 16,11.3317089 Z"}}),_vm._v(" "),_c('path',{staticClass:"ibh-heart-lock-bg",attrs:{"fill-rule":"evenodd","clip-rule":"evenodd","d":"M29.98 20.523A3.998 3.998 0 0 1 32 24v4a4 4 0 0 1-4 4h-7a4 4 0 0 1-4-4v-4c0-1.489.814-2.788 2.02-3.477a5.5 5.5 0 0 1 10.96 0z","fill":"#fff"}}),_vm._v(" "),_c('path',{staticClass:"ibh-heart-lock-fg",attrs:{"fill-rule":"evenodd","clip-rule":"evenodd","d":"M28 22a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-7a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2v-1a3.5 3.5 0 1 1 7 0v1zm-5-1a1.5 1.5 0 0 1 3 0v1h-3v-1z","fill":"#1F1F1F"}})])};
  1919. var __vue_staticRenderFns__$6 = [];
  1920. const __vue_inject_styles__$6 = function (inject) {
  1921. if (!inject) return
  1922. inject("data-v-688ed66c_0", { source: ".ibh-active[data-v-688ed66c]{fill:#ff4060}.ibh-heart-lock-bg[data-v-688ed66c],.ibh-heart-lock-fg[data-v-688ed66c]{display:none}.ibh-active.ibh-private>.ibh-heart-lock-bg[data-v-688ed66c],.ibh-active.ibh-private>.ibh-heart-lock-fg[data-v-688ed66c]{display:inline}.ibh-inactive[data-v-688ed66c]{fill:#fff}.ibh-inactive>.ibh-filled-heart[data-v-688ed66c]{fill:#333}.ibh-effect[data-v-688ed66c]{box-sizing:border-box;font-size:0;line-height:0;-webkit-transition:fill .2s,stroke .2s;transition:fill .2s,stroke .2s;vertical-align:top;opacity:.85}.ibh-effect[data-v-688ed66c]:hover{opacity:1}", map: undefined, media: undefined });
  1923. };
  1924. const __vue_scope_id__$6 = "data-v-688ed66c";
  1925. const __vue_module_identifier__$6 = undefined;
  1926. const __vue_is_functional_template__$6 = false;
  1927. var IconBookmarkHeart = normalizeComponent_1(
  1928. { render: __vue_render__$6, staticRenderFns: __vue_staticRenderFns__$6 },
  1929. __vue_inject_styles__$6,
  1930. __vue_script__$6,
  1931. __vue_scope_id__$6,
  1932. __vue_is_functional_template__$6,
  1933. __vue_module_identifier__$6,
  1934. browser,
  1935. undefined
  1936. );
  1937. var script$7 = {
  1938. props: {
  1939. illustPageCount: {
  1940. default: 1,
  1941. type: Number,
  1942. },
  1943. },
  1944. };
  1945. const __vue_script__$7 = script$7;
  1946. var __vue_render__$7 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"icon-multiple-indicator"},[_c('svg',{staticClass:"icon-multiple-svg",attrs:{"viewBox":"0 0 9 10"}},[_c('path',{attrs:{"d":"M8,3 C8.55228475,3 9,3.44771525 9,4 L9,9 C9,9.55228475 8.55228475,10 8,10 L3,10 C2.44771525,10 2,9.55228475 2,9 L6,9 C7.1045695,9 8,8.1045695 8,7 L8,3 Z M1,1 L6,1 C6.55228475,1 7,1.44771525 7,2 L7,7 C7,7.55228475 6.55228475,8 6,8 L1,8 C0.44771525,8 0,7.55228475 0,7 L0,2 C0,1.44771525 0.44771525,1 1,1 Z"}})]),_vm._v(" "),_c('span',{staticClass:"illust-page-count"},[_vm._v(_vm._s(_vm.illustPageCount))])])};
  1947. var __vue_staticRenderFns__$7 = [];
  1948. const __vue_inject_styles__$7 = function (inject) {
  1949. if (!inject) return
  1950. inject("data-v-24bf7204_0", { source: ".icon-multiple-indicator[data-v-24bf7204]{align-items:center;background:rgba(0,0,0,.4);border-radius:10px;box-sizing:border-box;display:flex;flex:none;height:20px;margin:2px 2px -20px auto;padding:5px 6px;z-index:1;color:#fff;font-size:10px;font-weight:700;line-height:1}.icon-multiple-svg[data-v-24bf7204]{fill:#fff;font-size:0;height:10px;line-height:0;stroke:none;width:9px}.illust-page-count[data-v-24bf7204]{margin-left:2px}", map: undefined, media: undefined });
  1951. };
  1952. const __vue_scope_id__$7 = "data-v-24bf7204";
  1953. const __vue_module_identifier__$7 = undefined;
  1954. const __vue_is_functional_template__$7 = false;
  1955. var IndicatorMultiple = normalizeComponent_1(
  1956. { render: __vue_render__$7, staticRenderFns: __vue_staticRenderFns__$7 },
  1957. __vue_inject_styles__$7,
  1958. __vue_script__$7,
  1959. __vue_scope_id__$7,
  1960. __vue_is_functional_template__$7,
  1961. __vue_module_identifier__$7,
  1962. browser,
  1963. undefined
  1964. );
  1965. var script$8 = {
  1966. components: { IconBookmarkHeart, IconUgoiraPlay, IndicatorMultiple },
  1967. props: {
  1968. bookmarkId: {
  1969. default: '',
  1970. type: String,
  1971. },
  1972. illustId: {
  1973. default: '',
  1974. type: String,
  1975. },
  1976. illustPageCount: {
  1977. default: 1,
  1978. type: Number,
  1979. },
  1980. imgUrl: {
  1981. default: '',
  1982. type: String,
  1983. },
  1984. isBookmarked: {
  1985. default: false,
  1986. type: Boolean,
  1987. },
  1988. isPrivateBookmark: {
  1989. default: false,
  1990. type: Boolean,
  1991. },
  1992. isUgoira: {
  1993. default: false,
  1994. type: Boolean,
  1995. },
  1996. },
  1997. data() {
  1998. return {
  1999. selfIsBookmarked: this.isBookmarked,
  2000. selfIsPrivateBookmark: this.isPrivateBookmark,
  2001. ugoiraMeta: null,
  2002. ugoiraPlayed: false,
  2003. ugoiraPlayer: null,
  2004. };
  2005. },
  2006. computed: {
  2007. canHoverPlay() {
  2008. return this.$store.getters.config.hoverPlay;
  2009. },
  2010. illustPageUrl() {
  2011. return `/member_illust.php?mode=medium&illust_id=${this.illustId}`;
  2012. },
  2013. isSelfBookmarkPage() {
  2014. return this.$store.getters.isSelfBookmarkPage;
  2015. },
  2016. },
  2017. mounted() {
  2018. this.$nextTick(async() => {
  2019. if (this.isUgoira && this.canHoverPlay) {
  2020. this.ugoiraMeta = await PixivAPI.getIllustUgoiraMetaData(this.illustId);
  2021. }
  2022. });
  2023. },
  2024. methods: {
  2025. activateContextMenu(event) {
  2026. if (this.$store.state.config.contextMenu) {
  2027. event.preventDefault();
  2028. const payload = {
  2029. data: {
  2030. illustId: this.illustId,
  2031. type: 'image-item-image',
  2032. },
  2033. position: {
  2034. x: event.clientX,
  2035. y: event.clientY,
  2036. },
  2037. };
  2038. this.$store.commit('contextMenu/activate', payload);
  2039. }
  2040. },
  2041. controlUgoira(event) {
  2042. if (!this.ugoiraMeta) {
  2043. return;
  2044. }
  2045. if (!this.ugoiraPlayer) {
  2046. try {
  2047. this.ugoiraPlayer = new ZipImagePlayer({
  2048. autosize: true,
  2049. canvas: this.$refs.smallUgoiraPreview,
  2050. chunkSize: 300000,
  2051. loop: true,
  2052. metadata: this.ugoiraMeta,
  2053. source: this.ugoiraMeta.src,
  2054. });
  2055. } catch (error) {
  2056. $print.error(error);
  2057. }
  2058. }
  2059. if (this.canHoverPlay) {
  2060. if (event.type === 'mouseenter') {
  2061. this.ugoiraPlayed = true;
  2062. this.ugoiraPlayer.play();
  2063. } else {
  2064. this.ugoiraPlayed = false;
  2065. this.ugoiraPlayer.pause();
  2066. this.ugoiraPlayer.rewind();
  2067. }
  2068. }
  2069. },
  2070. async oneClickBookmarkAdd() {
  2071. if (!this.selfIsBookmarked) {
  2072. if (await PixivAPI.postRPCAddBookmark(this.illustId)) {
  2073. this.selfIsBookmarked = true;
  2074. }
  2075. } else {
  2076. let bookmarkId = this.bookmarkId;
  2077. if (!bookmarkId) {
  2078. const data = await PixivAPI.getIllustBookmarkData(this.illustId);
  2079. bookmarkId = data.bookmarkData.id;
  2080. }
  2081. if (await PixivAPI.postRPCDeleteBookmark(bookmarkId)) {
  2082. this.selfIsBookmarked = false;
  2083. this.selfIsPrivateBookmark = false;
  2084. }
  2085. }
  2086. this.$store.commit('pixiv/editImgItem', {
  2087. illustId: this.illustId,
  2088. isBookmarked: this.selfIsBookmarked,
  2089. type: 'edit-bookmarked',
  2090. });
  2091. },
  2092. },
  2093. };
  2094. const __vue_script__$8 = script$8;
  2095. var __vue_render__$8 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"image-item-image"},[_c('a',{staticClass:"image-flexbox",attrs:{"href":_vm.illustPageUrl,"rel":"noopener"},on:{"contextmenu":function($event){return _vm.activateContextMenu($event)},"mouseenter":_vm.controlUgoira,"mouseleave":_vm.controlUgoira}},[(_vm.illustPageCount > 1)?_c('IndicatorMultiple',{attrs:{"illust-page-count":_vm.illustPageCount}}):_vm._e(),_vm._v(" "),_c('img',{directives:[{name:"show",rawName:"v-show",value:(!_vm.ugoiraPlayed),expression:"!ugoiraPlayed"}],attrs:{"data-src":_vm.imgUrl,"src":_vm.imgUrl}}),_vm._v(" "),(_vm.isUgoira)?_c('IconUgoiraPlay',{directives:[{name:"show",rawName:"v-show",value:(!_vm.ugoiraPlayed),expression:"!ugoiraPlayed"}],staticClass:"ugoira-icon",attrs:{"size":60}}):_vm._e(),_vm._v(" "),(_vm.isUgoira)?_c('canvas',{directives:[{name:"show",rawName:"v-show",value:(_vm.ugoiraPlayed),expression:"ugoiraPlayed"}],ref:"smallUgoiraPreview"}):_vm._e()],1),_vm._v(" "),_c('div',{staticClass:"bookmark-heart-block",on:{"click":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"left",37,$event.key,["Left","ArrowLeft"])){ return null; }if('button' in $event && $event.button !== 0){ return null; }$event.stopPropagation();return _vm.oneClickBookmarkAdd($event)}}},[_c('IconBookmarkHeart',{attrs:{"actived":_vm.selfIsBookmarked,"is-private":_vm.selfIsPrivateBookmark}})],1),_vm._v(" "),(_vm.isSelfBookmarkPage)?_c('div',{staticClass:"bookmark-input-container"},[_c('input',{attrs:{"type":"checkbox","name":"book_id[]"},domProps:{"value":_vm.bookmarkId}})]):_vm._e()])};
  2096. var __vue_staticRenderFns__$8 = [];
  2097. const __vue_inject_styles__$8 = function (inject) {
  2098. if (!inject) return
  2099. inject("data-v-3ad0b8ac_0", { source: ".image-item-image[data-v-3ad0b8ac]{display:flex;align-items:center;justify-content:center;position:relative}.image-flexbox[data-v-3ad0b8ac]{display:flex;flex-flow:column;justify-content:center;align-items:center;z-index:0;border:1px solid rgba(0,0,0,.04);position:relative;height:var(--default-image-item-image-square-size);width:var(--default-image-item-image-square-size)}.image-flexbox[data-v-3ad0b8ac]:hover{text-decoration:none}.top-right-slot[data-v-3ad0b8ac]{flex:none;display:flex;align-items:center;z-index:1;box-sizing:border-box;margin:0 0 -24px auto;padding:6px;height:24px;background:#000;background:rgba(0,0,0,.4);border-radius:0 0 0 4px;color:#fff;font-size:12px;line-height:1;font-weight:700}.ugoira-icon[data-v-3ad0b8ac]{position:absolute}canvas[data-v-3ad0b8ac],img[data-v-3ad0b8ac]{max-height:100%;max-width:100%}.bookmark-input-container[data-v-3ad0b8ac]{position:absolute;left:0;top:0;background:rgba(0,0,0,.4);padding:6px;border-radius:0 0 4px 0}.bookmark-heart-block[data-v-3ad0b8ac]{position:absolute;bottom:0;right:0}", map: undefined, media: undefined });
  2100. };
  2101. const __vue_scope_id__$8 = "data-v-3ad0b8ac";
  2102. const __vue_module_identifier__$8 = undefined;
  2103. const __vue_is_functional_template__$8 = false;
  2104. var DefaultImageItemImage = normalizeComponent_1(
  2105. { render: __vue_render__$8, staticRenderFns: __vue_staticRenderFns__$8 },
  2106. __vue_inject_styles__$8,
  2107. __vue_script__$8,
  2108. __vue_scope_id__$8,
  2109. __vue_is_functional_template__$8,
  2110. __vue_module_identifier__$8,
  2111. browser,
  2112. undefined
  2113. );
  2114. var script$9 = {
  2115. components: { FontAwesomeIcon },
  2116. props: {
  2117. bookmarkCount: {
  2118. default: 0,
  2119. type: Number,
  2120. },
  2121. illustId: {
  2122. default: '',
  2123. type: String,
  2124. },
  2125. illustTitle: {
  2126. default: '',
  2127. type: String,
  2128. },
  2129. isFollowed: {
  2130. default: false,
  2131. type: Boolean,
  2132. },
  2133. profileImgUrl: {
  2134. default: '',
  2135. type: String,
  2136. },
  2137. userId: {
  2138. default: '',
  2139. type: String,
  2140. },
  2141. userName: {
  2142. default: '',
  2143. type: String,
  2144. },
  2145. },
  2146. computed: {
  2147. bookmarkDetailUrl() {
  2148. return `/bookmark_detail.php?illust_id=${this.illustId}`;
  2149. },
  2150. bookmarkTooltipMsg() {
  2151. return this.$t('mainView.bookmarkTooltip', {
  2152. count: this.bookmarkCount,
  2153. });
  2154. },
  2155. illustPageUrl() {
  2156. return `/member_illust.php?mode=medium&illust_id=${this.illustId}`;
  2157. },
  2158. isEnableUserTooltip() {
  2159. return this.$store.state.config.userTooltip;
  2160. },
  2161. profileImgStyle() {
  2162. return {
  2163. backgroundImage: `url(${this.profileImgUrl})`,
  2164. };
  2165. },
  2166. userPageUrl() {
  2167. return `/member_illust.php?id=${this.userId}`;
  2168. },
  2169. },
  2170. methods: {
  2171. activateContextMenu(event) {
  2172. if (this.$store.state.config.contextMenu) {
  2173. event.preventDefault();
  2174. const payload = {
  2175. position: {
  2176. x: event.clientX,
  2177. y: event.clientY,
  2178. },
  2179. };
  2180. const ct = event.currentTarget;
  2181. if (ct.classList.contains('user-info')) {
  2182. payload.data = {
  2183. illustId: this.illustId,
  2184. type: 'image-item-title-user',
  2185. };
  2186. } else {
  2187. payload.data = {
  2188. illustId: this.illustId,
  2189. type: 'image-item-image',
  2190. };
  2191. }
  2192. this.$store.commit('contextMenu/activate', payload);
  2193. }
  2194. },
  2195. },
  2196. };
  2197. const __vue_script__$9 = script$9;
  2198. var __vue_render__$9 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('figcaption',{staticClass:"image-item-title-user"},[_c('ul',[_c('li',{staticClass:"title-text",on:{"contextmenu":function($event){return _vm.activateContextMenu($event)}}},[_c('a',{attrs:{"href":_vm.illustPageUrl,"title":_vm.illustTitle}},[_vm._v(_vm._s(_vm.illustTitle))])]),_vm._v(" "),_c('li',{staticClass:"user-info",on:{"contextmenu":function($event){return _vm.activateContextMenu($event)}}},[_c('a',{staticClass:"user-link",class:_vm.isEnableUserTooltip ? 'ui-profile-popup' : '',attrs:{"href":_vm.userPageUrl,"title":_vm.userName,"data-user_id":_vm.userId,"data-user_name":_vm.userName,"target":"_blank"}},[_c('span',{staticClass:"user-img",style:(_vm.profileImgStyle)}),_vm._v(" "),_c('span',[_vm._v(_vm._s(_vm.userName))])]),_vm._v(" "),(_vm.isFollowed)?_c('FontAwesomeIcon',{staticClass:"user-followed-indicator",attrs:{"icon":'rss'}}):_vm._e()],1),_vm._v(" "),(_vm.bookmarkCount > 0)?_c('li',[_c('ul',{staticClass:"count-list"},[_c('li',[_c('a',{staticClass:"_ui-tooltip bookmark-count",attrs:{"href":_vm.bookmarkDetailUrl,"data-tooltip":_vm.$t('mainView.bookmarkTooltip', { count: _vm.bookmarkCount })}},[_c('i',{staticClass:"_icon _bookmark-icon-inline"}),_vm._v("\n "+_vm._s(_vm.bookmarkCount)+"\n ")])])])]):_vm._e()])])};
  2199. var __vue_staticRenderFns__$9 = [];
  2200. const __vue_inject_styles__$9 = function (inject) {
  2201. if (!inject) return
  2202. inject("data-v-3c0faed8_0", { source: ".image-item-title-user[data-v-3c0faed8]{max-width:100%;margin:8px auto;text-align:center;color:#333;font-size:12px;line-height:1}.title-text[data-v-3c0faed8]{margin:4px 0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:700}.user-info[data-v-3c0faed8]{display:inline-flex;align-items:center}.user-link[data-v-3c0faed8]{font-size:12px;display:inline-flex;align-items:center}.user-img[data-v-3c0faed8]{width:20px;height:20px;display:inline-block;background-size:cover;border-radius:50%;margin-right:4px}.user-followed-indicator[data-v-3c0faed8]{display:inline-block;margin-left:4px;width:16px;height:16px;color:#1e90ff}", map: undefined, media: undefined });
  2203. };
  2204. const __vue_scope_id__$9 = "data-v-3c0faed8";
  2205. const __vue_module_identifier__$9 = undefined;
  2206. const __vue_is_functional_template__$9 = false;
  2207. var DefaultImageItemTitle = normalizeComponent_1(
  2208. { render: __vue_render__$9, staticRenderFns: __vue_staticRenderFns__$9 },
  2209. __vue_inject_styles__$9,
  2210. __vue_script__$9,
  2211. __vue_scope_id__$9,
  2212. __vue_is_functional_template__$9,
  2213. __vue_module_identifier__$9,
  2214. browser,
  2215. undefined
  2216. );
  2217. var script$a = {
  2218. components: { DefaultImageItemImage, DefaultImageItemTitle },
  2219. props: {
  2220. bookmarkCount: {
  2221. default: 0,
  2222. type: Number,
  2223. },
  2224. bookmarkId: {
  2225. default: '',
  2226. type: String,
  2227. },
  2228. illustId: {
  2229. default: '',
  2230. type: String,
  2231. },
  2232. illustPageCount: {
  2233. default: 1,
  2234. type: Number,
  2235. },
  2236. illustTitle: {
  2237. default: '',
  2238. type: String,
  2239. },
  2240. imgUrl: {
  2241. default: '',
  2242. type: String,
  2243. },
  2244. isBookmarked: {
  2245. default: false,
  2246. type: Boolean,
  2247. },
  2248. isFollowed: {
  2249. default: false,
  2250. type: Boolean,
  2251. },
  2252. isPrivateBookmark: {
  2253. default: false,
  2254. type: Boolean,
  2255. },
  2256. isUgoira: {
  2257. default: false,
  2258. type: Boolean,
  2259. },
  2260. profileImgUrl: {
  2261. default: '',
  2262. type: String,
  2263. },
  2264. userId: {
  2265. default: '',
  2266. type: String,
  2267. },
  2268. userName: {
  2269. default: '',
  2270. type: String,
  2271. },
  2272. },
  2273. };
  2274. const __vue_script__$a = script$a;
  2275. var __vue_render__$a = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"image-item"},[_c('figure',{staticClass:"image-item-inner"},[_c('DefaultImageItemImage',{attrs:{"img-url":_vm.imgUrl,"illust-id":_vm.illustId,"illust-page-count":_vm.illustPageCount,"is-ugoira":_vm.isUgoira,"is-bookmarked":_vm.isBookmarked,"is-private-bookmark":_vm.isPrivateBookmark,"bookmark-id":_vm.bookmarkId}}),_vm._v(" "),_c('DefaultImageItemTitle',{attrs:{"illust-id":_vm.illustId,"illust-title":_vm.illustTitle,"user-name":_vm.userName,"user-id":_vm.userId,"is-followed":_vm.isFollowed,"profile-img-url":_vm.profileImgUrl,"bookmark-count":_vm.bookmarkCount}})],1)])};
  2276. var __vue_staticRenderFns__$a = [];
  2277. const __vue_inject_styles__$a = function (inject) {
  2278. if (!inject) return
  2279. inject("data-v-149e5fa6_0", { source: ".image-item[data-v-149e5fa6]{display:flex;justify-content:center;margin:0 0 30px 0;padding:10px;height:auto;width:200px}.image-item-inner[data-v-149e5fa6]{display:flex;flex-flow:column;max-width:100%;max-height:300px}", map: undefined, media: undefined });
  2280. };
  2281. const __vue_scope_id__$a = "data-v-149e5fa6";
  2282. const __vue_module_identifier__$a = undefined;
  2283. const __vue_is_functional_template__$a = false;
  2284. var DefaultImageItem = normalizeComponent_1(
  2285. { render: __vue_render__$a, staticRenderFns: __vue_staticRenderFns__$a },
  2286. __vue_inject_styles__$a,
  2287. __vue_script__$a,
  2288. __vue_scope_id__$a,
  2289. __vue_is_functional_template__$a,
  2290. __vue_module_identifier__$a,
  2291. browser,
  2292. undefined
  2293. );
  2294. var script$b = {
  2295. components: { DefaultImageItem },
  2296. computed: {
  2297. defaultProcessedLibrary() {
  2298. const { shows, hides } = this.displayIndices;
  2299. const iiLib = this.$store.getters['pixiv/imageItemLibrary'];
  2300. return shows.concat(hides).map(idx => iiLib[idx]);
  2301. },
  2302. displayIndices() {
  2303. return this.$store.getters['pixiv/defaultDisplayIndices'];
  2304. },
  2305. imageToShowCount() {
  2306. const { shows } = this.displayIndices;
  2307. return shows.length;
  2308. },
  2309. },
  2310. methods: {
  2311. getThumbUrl(urls) {
  2312. if (this.$store.getters.config.croppedThumb) {
  2313. return urls.thumb;
  2314. }
  2315. return urls.regular;
  2316. },
  2317. },
  2318. };
  2319. const __vue_script__$b = script$b;
  2320. var __vue_render__$b = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{attrs:{"id":"patchouli-default-image-item-page"}},_vm._l((_vm.defaultProcessedLibrary),function(d,index){return _c('DefaultImageItem',{directives:[{name:"show",rawName:"v-show",value:(index < _vm.imageToShowCount),expression:"index < imageToShowCount"}],key:d.illustId,attrs:{"img-url":_vm.getThumbUrl(d.urls),"illust-id":d.illustId,"illust-title":d.illustTitle,"illust-page-count":d.illustPageCount,"is-ugoira":d.isUgoira,"user-name":d.userName,"user-id":d.userId,"profile-img-url":d.profileImg,"bookmark-count":d.bookmarkCount,"is-private-bookmark":d.isPrivateBookmark,"is-bookmarked":d.isBookmarked,"is-followed":d.isFollowed,"bookmark-id":d.bookmarkId}})}),1)};
  2321. var __vue_staticRenderFns__$b = [];
  2322. const __vue_inject_styles__$b = function (inject) {
  2323. if (!inject) return
  2324. inject("data-v-0d55836a_0", { source: "#patchouli-default-image-item-page[data-v-0d55836a]{display:flex;flex-flow:wrap;justify-content:space-around}", map: undefined, media: undefined });
  2325. };
  2326. const __vue_scope_id__$b = "data-v-0d55836a";
  2327. const __vue_module_identifier__$b = undefined;
  2328. const __vue_is_functional_template__$b = false;
  2329. var DefaultImageItemPage = normalizeComponent_1(
  2330. { render: __vue_render__$b, staticRenderFns: __vue_staticRenderFns__$b },
  2331. __vue_inject_styles__$b,
  2332. __vue_script__$b,
  2333. __vue_scope_id__$b,
  2334. __vue_is_functional_template__$b,
  2335. __vue_module_identifier__$b,
  2336. browser,
  2337. undefined
  2338. );
  2339. var script$c = {
  2340. components: {
  2341. FontAwesomeIcon,
  2342. IconBookmarkHeart,
  2343. IconUgoiraPlay,
  2344. IndicatorMultiple,
  2345. },
  2346. props: {
  2347. bookmarkCount: {
  2348. default: 0,
  2349. type: Number,
  2350. },
  2351. bookmarkId: {
  2352. default: '',
  2353. type: String,
  2354. },
  2355. illustId: {
  2356. default: '',
  2357. type: String,
  2358. },
  2359. illustPageCount: {
  2360. default: 1,
  2361. type: Number,
  2362. },
  2363. illustTitle: {
  2364. default: '',
  2365. type: String,
  2366. },
  2367. isBookmarked: {
  2368. default: false,
  2369. type: Boolean,
  2370. },
  2371. isFollowed: {
  2372. default: false,
  2373. type: Boolean,
  2374. },
  2375. isUgoira: {
  2376. default: false,
  2377. type: Boolean,
  2378. },
  2379. profileImgUrl: {
  2380. default: '',
  2381. type: String,
  2382. },
  2383. showUserProfile: {
  2384. default: true,
  2385. type: Boolean,
  2386. },
  2387. thumbImgUrl: {
  2388. default: '',
  2389. type: String,
  2390. },
  2391. userId: {
  2392. default: '',
  2393. type: String,
  2394. },
  2395. userName: {
  2396. default: '',
  2397. type: String,
  2398. },
  2399. },
  2400. data() {
  2401. return {
  2402. selfBookmarkId: this.bookmarkId,
  2403. selfIsBookmarked: this.isBookmarked,
  2404. ugoiraMeta: null,
  2405. ugoiraPlayed: false,
  2406. ugoiraPlayer: null,
  2407. };
  2408. },
  2409. computed: {
  2410. canHoverPlay() {
  2411. return this.$store.getters.config.hoverPlay;
  2412. },
  2413. illustMainImgStyle() {
  2414. return {
  2415. backgroundImage: this.ugoiraPlayed ? 'none' : `url(${this.thumbImgUrl})`,
  2416. };
  2417. },
  2418. illustPageUrl() {
  2419. return `/member_illust.php?mode=medium&illust_id=${this.illustId}`;
  2420. },
  2421. profileImgStyle() {
  2422. return {
  2423. backgroundImage: `url(${this.profileImgUrl})`,
  2424. };
  2425. },
  2426. userPageUrl() {
  2427. return `/member_illust.php?id=${this.userId}`;
  2428. },
  2429. },
  2430. mounted() {
  2431. this.$nextTick(async() => {
  2432. if (this.isUgoira && this.canHoverPlay) {
  2433. this.ugoiraMeta = await PixivAPI.getIllustUgoiraMetaData(this.illustId);
  2434. }
  2435. });
  2436. },
  2437. methods: {
  2438. activateContextMenu(event) {
  2439. if (this.$store.getters.config.contextMenu) {
  2440. event.preventDefault();
  2441. const payload = {
  2442. position: {
  2443. x: event.clientX,
  2444. y: event.clientY,
  2445. },
  2446. };
  2447. const ct = event.currentTarget;
  2448. if (ct.classList.contains('user-profile-name')) {
  2449. payload.data = {
  2450. illustId: this.illustId,
  2451. type: 'image-item-title-user',
  2452. };
  2453. } else {
  2454. payload.data = {
  2455. illustId: this.illustId,
  2456. type: 'image-item-image',
  2457. };
  2458. }
  2459. this.$store.commit('contextMenu/activate', payload);
  2460. }
  2461. },
  2462. controlUgoira(event) {
  2463. if (!this.ugoiraMeta) {
  2464. return;
  2465. }
  2466. if (!this.ugoiraPlayer) {
  2467. try {
  2468. this.ugoiraPlayer = new ZipImagePlayer({
  2469. autosize: true,
  2470. canvas: this.$refs.smallUgoiraPreview,
  2471. chunkSize: 300000,
  2472. loop: true,
  2473. metadata: this.ugoiraMeta,
  2474. source: this.ugoiraMeta.src,
  2475. });
  2476. } catch (error) {
  2477. $print.error(error);
  2478. }
  2479. }
  2480. if (this.canHoverPlay) {
  2481. if (event.type === 'mouseenter') {
  2482. this.ugoiraPlayed = true;
  2483. this.ugoiraPlayer.play();
  2484. } else {
  2485. this.ugoiraPlayed = false;
  2486. this.ugoiraPlayer.pause();
  2487. this.ugoiraPlayer.rewind();
  2488. }
  2489. }
  2490. },
  2491. async oneClickBookmarkAdd() {
  2492. if (!this.selfIsBookmarked) {
  2493. if (await PixivAPI.postRPCAddBookmark(this.illustId)) {
  2494. this.selfIsBookmarked = true;
  2495. }
  2496. } else {
  2497. if (!this.selfBookmarkId) {
  2498. const data = await PixivAPI.getIllustBookmarkData(this.illustId);
  2499. this.selfBookmarkId = data.bookmarkData.id;
  2500. }
  2501. if (await PixivAPI.postRPCDeleteBookmark(this.selfBookmarkId)) {
  2502. this.selfIsBookmarked = false;
  2503. }
  2504. }
  2505. this.$store.commit('pixiv/editImgItem', {
  2506. illustId: this.illustId,
  2507. isBookmarked: this.selfIsBookmarked,
  2508. type: 'edit-bookmarked',
  2509. });
  2510. },
  2511. },
  2512. };
  2513. const __vue_script__$c = script$c;
  2514. var __vue_render__$c = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('li',{staticClass:"illust-item-root"},[_c('a',{staticClass:"illust-main",attrs:{"href":_vm.illustPageUrl},on:{"contextmenu":function($event){return _vm.activateContextMenu($event)},"mouseenter":_vm.controlUgoira,"mouseleave":_vm.controlUgoira}},[_c('div',{staticClass:"illust-main-indicators"},[(_vm.illustPageCount > 1)?_c('IndicatorMultiple',{attrs:{"illust-page-count":_vm.illustPageCount}}):_vm._e()],1),_vm._v(" "),_c('div',{staticClass:"illust-main-img",style:(_vm.illustMainImgStyle)},[(_vm.isUgoira)?_c('IconUgoiraPlay',{directives:[{name:"show",rawName:"v-show",value:(!_vm.ugoiraPlayed),expression:"!ugoiraPlayed"}]}):_vm._e(),_vm._v(" "),(_vm.isUgoira)?_c('canvas',{directives:[{name:"show",rawName:"v-show",value:(_vm.ugoiraPlayed),expression:"ugoiraPlayed"}],ref:"smallUgoiraPreview",staticClass:"illust-main-ugoira"}):_vm._e()],1)]),_vm._v(" "),_c('div',{staticClass:"illust-buttons"},[_c('div',[_c('button',{attrs:{"type":"button"},on:{"click":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"left",37,$event.key,["Left","ArrowLeft"])){ return null; }if('button' in $event && $event.button !== 0){ return null; }$event.preventDefault();$event.stopPropagation();return _vm.oneClickBookmarkAdd($event)}}},[_c('IconBookmarkHeart',{attrs:{"actived":_vm.selfIsBookmarked}})],1)])]),_vm._v(" "),_c('a',{staticClass:"illust-title",attrs:{"href":_vm.illustPageUrl},on:{"contextmenu":function($event){return _vm.activateContextMenu($event)}}},[_vm._v(_vm._s(_vm.illustTitle))]),_vm._v(" "),_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.showUserProfile),expression:"showUserProfile"}],staticClass:"user-profile"},[_c('div',[_c('a',{staticClass:"user-profile-img",style:(_vm.profileImgStyle),attrs:{"href":_vm.illustPageUrl}})]),_vm._v(" "),_c('a',{staticClass:"user-profile-name",attrs:{"href":_vm.userPageUrl},on:{"contextmenu":function($event){return _vm.activateContextMenu($event)}}},[_vm._v(_vm._s(_vm.userName))]),_vm._v(" "),(_vm.isFollowed)?_c('FontAwesomeIcon',{staticClass:"user-followed-indicator",attrs:{"icon":'rss'}}):_vm._e()],1),_vm._v(" "),_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.bookmarkCount > 0),expression:"bookmarkCount > 0"}],staticClass:"illust-popularity"},[_c('span',[_vm._v(_vm._s(_vm.bookmarkCount))])])])};
  2515. var __vue_staticRenderFns__$c = [];
  2516. const __vue_inject_styles__$c = function (inject) {
  2517. if (!inject) return
  2518. inject("data-v-7f2906da_0", { source: ".illust-item-root[data-v-7f2906da]{margin:0 12px 24px}.illust-main[data-v-7f2906da]{text-decoration:none}.illust-main-indicators[data-v-7f2906da]{display:flex;position:absolute;width:var(--new-default-image-item-square-size);justify-content:end}.illust-main-img[data-v-7f2906da]{align-items:center;background-color:#fff;background-position:50%;background-repeat:no-repeat;background-size:cover;border-radius:4px;display:flex;height:var(--new-default-image-item-square-size);justify-content:center;margin-bottom:8px;position:relative;width:var(--new-default-image-item-square-size)}.illust-main-img[data-v-7f2906da]::before{background-color:rgba(0,0,0,.02);content:\"\";display:block;height:100%;left:0;position:absolute;top:0;width:100%}.illust-main-ugoira[data-v-7f2906da]{object-fit:contain;height:var(--new-default-image-item-square-size);width:var(--new-default-image-item-square-size)}.illust-buttons[data-v-7f2906da]{display:flex;height:32px;justify-content:flex-end;margin-bottom:8px;margin-top:-40px}.illust-buttons>div[data-v-7f2906da]{z-index:1}.illust-buttons>div>button[data-v-7f2906da]{background:0 0;border:none;box-sizing:content-box;cursor:pointer;display:inline-block;height:32px;line-height:1;padding:0}.illust-title[data-v-7f2906da]{color:#177082;display:block;font-size:14px;font-weight:700;line-height:1;margin:0 0 4px;overflow:hidden;text-decoration:none;text-overflow:ellipsis;white-space:nowrap;width:var(--new-default-image-item-square-size)}.user-profile[data-v-7f2906da]{align-items:center;display:flex;width:var(--new-default-image-item-square-size);margin-bottom:4px}.user-profile>div[data-v-7f2906da]{display:inline-block;margin-right:4px}.user-profile-img[data-v-7f2906da]{background-size:cover;border-radius:50%;display:block;flex:none;position:relative;overflow:hidden;width:16px;height:16px}.user-profile-name[data-v-7f2906da]{color:#999;font-size:12px;line-height:1;overflow:hidden;text-decoration:none;text-overflow:ellipsis;white-space:nowrap;flex:1}.user-followed-indicator[data-v-7f2906da]{display:inline-block;margin-left:4px;width:16px;height:16px;color:#1e90ff}.illust-popularity[data-v-7f2906da]{display:flex;width:100%;justify-content:center}.illust-popularity>span[data-v-7f2906da]{background-color:#cef;color:#0069b1;padding:2px 8px;border-radius:8px;font-weight:700}.illust-popularity>span[data-v-7f2906da]::before{content:\"❤️\";margin-right:4px}", map: undefined, media: undefined });
  2519. };
  2520. const __vue_scope_id__$c = "data-v-7f2906da";
  2521. const __vue_module_identifier__$c = undefined;
  2522. const __vue_is_functional_template__$c = false;
  2523. var NewDefaultImageItem = normalizeComponent_1(
  2524. { render: __vue_render__$c, staticRenderFns: __vue_staticRenderFns__$c },
  2525. __vue_inject_styles__$c,
  2526. __vue_script__$c,
  2527. __vue_scope_id__$c,
  2528. __vue_is_functional_template__$c,
  2529. __vue_module_identifier__$c,
  2530. browser,
  2531. undefined
  2532. );
  2533. var script$d = {};
  2534. const __vue_script__$d = script$d;
  2535. var __vue_render__$d = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _vm._m(0)};
  2536. var __vue_staticRenderFns__$d = [function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"ils-grid"},[_c('div',{staticClass:"ils-cell ils-1"}),_vm._v(" "),_c('div',{staticClass:"ils-cell ils-2"}),_vm._v(" "),_c('div',{staticClass:"ils-cell ils-3"}),_vm._v(" "),_c('div',{staticClass:"ils-cell ils-4"}),_vm._v(" "),_c('div',{staticClass:"ils-cell ils-5"}),_vm._v(" "),_c('div',{staticClass:"ils-cell ils-6"}),_vm._v(" "),_c('div',{staticClass:"ils-cell ils-7"}),_vm._v(" "),_c('div',{staticClass:"ils-cell ils-8"}),_vm._v(" "),_c('div',{staticClass:"ils-cell ils-9"})])}];
  2537. const __vue_inject_styles__$d = function (inject) {
  2538. if (!inject) return
  2539. inject("data-v-08feaed6_0", { source: ".ils-grid[data-v-08feaed6]{width:var(--loading-icon-size);height:var(--loading-icon-size);margin:100px auto}.ils-grid .ils-cell[data-v-08feaed6]{width:33%;height:33%;background-color:var(--loading-icon-color);float:left;-webkit-animation:ilsGridScaleDelay-data-v-08feaed6 1.3s infinite ease-in-out;animation:ilsGridScaleDelay-data-v-08feaed6 1.3s infinite ease-in-out}.ils-grid .ils-1[data-v-08feaed6]{-webkit-animation-delay:.2s;animation-delay:.2s}.ils-grid .ils-2[data-v-08feaed6]{-webkit-animation-delay:.3s;animation-delay:.3s}.ils-grid .ils-3[data-v-08feaed6]{-webkit-animation-delay:.4s;animation-delay:.4s}.ils-grid .ils-4[data-v-08feaed6]{-webkit-animation-delay:.1s;animation-delay:.1s}.ils-grid .ils-5[data-v-08feaed6]{-webkit-animation-delay:.2s;animation-delay:.2s}.ils-grid .ils-6[data-v-08feaed6]{-webkit-animation-delay:.3s;animation-delay:.3s}.ils-grid .ils-7[data-v-08feaed6]{-webkit-animation-delay:0s;animation-delay:0s}.ils-grid .ils-8[data-v-08feaed6]{-webkit-animation-delay:.1s;animation-delay:.1s}.ils-grid .ils-9[data-v-08feaed6]{-webkit-animation-delay:.2s;animation-delay:.2s}@-webkit-keyframes ilsGridScaleDelay-data-v-08feaed6{0%,100%,70%{-webkit-transform:scale3D(1,1,1);transform:scale3D(1,1,1)}35%{-webkit-transform:scale3D(0,0,1);transform:scale3D(0,0,1)}}@keyframes ilsGridScaleDelay-data-v-08feaed6{0%,100%,70%{-webkit-transform:scale3D(1,1,1);transform:scale3D(1,1,1)}35%{-webkit-transform:scale3D(0,0,1);transform:scale3D(0,0,1)}}", map: undefined, media: undefined });
  2540. };
  2541. const __vue_scope_id__$d = "data-v-08feaed6";
  2542. const __vue_module_identifier__$d = undefined;
  2543. const __vue_is_functional_template__$d = false;
  2544. var IconLoadingSpin = normalizeComponent_1(
  2545. { render: __vue_render__$d, staticRenderFns: __vue_staticRenderFns__$d },
  2546. __vue_inject_styles__$d,
  2547. __vue_script__$d,
  2548. __vue_scope_id__$d,
  2549. __vue_is_functional_template__$d,
  2550. __vue_module_identifier__$d,
  2551. browser,
  2552. undefined
  2553. );
  2554. var script$e = {
  2555. components: { IconLoadingSpin, NewDefaultImageItem },
  2556. data() {
  2557. return {
  2558. routeIsInited: Array(NPP_TYPE_COUNT).fill(false),
  2559. };
  2560. },
  2561. computed: {
  2562. displayIndices() {
  2563. return this.$store.getters['pixiv/nppDisplayIndices'];
  2564. },
  2565. hasNoResult() {
  2566. return !this.imageToShowCount;
  2567. },
  2568. imageToShowCount() {
  2569. const { shows } = this.displayIndices;
  2570. return shows.length;
  2571. },
  2572. isSelfBookmarkPage() {
  2573. return this.$store.getters.isSelfBookmarkPage;
  2574. },
  2575. nppProcessedLibrary() {
  2576. const { shows, hides } = this.displayIndices;
  2577. const iiLib = this.$store.getters['pixiv/imageItemLibrary'];
  2578. return shows.concat(hides).map(idx => iiLib[idx]);
  2579. },
  2580. nppType() {
  2581. return this.$store.getters['pixiv/nppType'];
  2582. },
  2583. rest() {
  2584. return this.$store.getters.sp.rest;
  2585. },
  2586. status() {
  2587. return this.$store.getters['pixiv/status'];
  2588. },
  2589. uid() {
  2590. return this.$store.getters.sp.id;
  2591. },
  2592. },
  2593. mounted() {
  2594. this.$nextTick(() => {
  2595. this.routeIsInited[this.nppType] = true;
  2596. });
  2597. },
  2598. methods: {
  2599. async clickRoute(event) {
  2600. await this.$store.dispatch('pixiv/pause');
  2601. const tid = event.currentTarget.id;
  2602. const thref = event.currentTarget.href;
  2603. if (this.isSamePath(location.href, thref)) {
  2604. return;
  2605. }
  2606. history.pushState(null, '', thref);
  2607. switch (tid) {
  2608. case 'patchouli-npp-all':
  2609. this.$store.commit('setMainPageType', {
  2610. forceSet: MAIN_PAGE_TYPE.NEW_PROFILE,
  2611. });
  2612. break;
  2613. case 'patchouli-npp-illust':
  2614. this.$store.commit('setMainPageType', {
  2615. forceSet: MAIN_PAGE_TYPE.NEW_PROFILE_ILLUST,
  2616. });
  2617. break;
  2618. case 'patchouli-npp-manga':
  2619. this.$store.commit('setMainPageType', {
  2620. forceSet: MAIN_PAGE_TYPE.NEW_PROFILE_MANGA,
  2621. });
  2622. break;
  2623. case 'patchouli-npp-bookmark':
  2624. case 'patchouli-npp-view-bookmark-switch-public':
  2625. case 'patchouli-npp-view-bookmark-switch-private':
  2626. this.$store.commit('updateSearchParam');
  2627. this.$store.commit('setMainPageType', {
  2628. forceSet: MAIN_PAGE_TYPE.NEW_PROFILE_BOOKMARK,
  2629. });
  2630. break;
  2631. default:
  2632. break;
  2633. }
  2634. if (!this.routeIsInited[this.nppType]) {
  2635. this.$store.dispatch('pixiv/start', { force: true, times: 1 });
  2636. this.routeIsInited[this.nppType] = true;
  2637. }
  2638. },
  2639. isSamePath(href0, href1) {
  2640. const a0 = $el('a', { href: href0 });
  2641. const a1 = $el('a', { href: href1 });
  2642. if (a0.pathname !== a1.pathname) {
  2643. return false;
  2644. }
  2645. const sp0 = new URLSearchParams(a0.search);
  2646. const sp1 = new URLSearchParams(a1.search);
  2647. const keysSet = new Set([...sp0.keys(), ...sp1.keys()]);
  2648. for (const k of keysSet) {
  2649. if (sp0.get(k) !== sp1.get(k)) {
  2650. return false;
  2651. }
  2652. }
  2653. return true;
  2654. },
  2655. },
  2656. };
  2657. const __vue_script__$e = script$e;
  2658. var __vue_render__$e = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{attrs:{"id":"patchouli-new-profile-page"}},[_c('nav',{attrs:{"id":"patchouli-npp-nav"}},[_c('a',{class:{'current': _vm.nppType === 0},attrs:{"id":"patchouli-npp-all","href":("/member.php?id=" + _vm.uid)},on:{"click":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"left",37,$event.key,["Left","ArrowLeft"])){ return null; }if('button' in $event && $event.button !== 0){ return null; }$event.preventDefault();return _vm.clickRoute($event)}}},[_vm._v(_vm._s(_vm.$t('mainView.newProfilePage.contents')))]),_vm._v(" "),_c('a',{class:{'current': _vm.nppType === 1},attrs:{"id":"patchouli-npp-illust","href":("/member_illust.php?id=" + _vm.uid + "&type=illust")},on:{"click":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"left",37,$event.key,["Left","ArrowLeft"])){ return null; }if('button' in $event && $event.button !== 0){ return null; }$event.preventDefault();return _vm.clickRoute($event)}}},[_vm._v(_vm._s(_vm.$t('mainView.newProfilePage.illustrations')))]),_vm._v(" "),_c('a',{class:{'current': _vm.nppType === 2},attrs:{"id":"patchouli-npp-manga","href":("/member_illust.php?id=" + _vm.uid + "&type=manga")},on:{"click":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"left",37,$event.key,["Left","ArrowLeft"])){ return null; }if('button' in $event && $event.button !== 0){ return null; }$event.preventDefault();return _vm.clickRoute($event)}}},[_vm._v(_vm._s(_vm.$t('mainView.newProfilePage.manga')))]),_vm._v(" "),_c('a',{class:{'current': _vm.nppType === 3},attrs:{"id":"patchouli-npp-bookmark","href":("/bookmark.php?id=" + _vm.uid + "&rest=show")},on:{"click":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"left",37,$event.key,["Left","ArrowLeft"])){ return null; }if('button' in $event && $event.button !== 0){ return null; }$event.preventDefault();return _vm.clickRoute($event)}}},[_vm._v(_vm._s(_vm.$t('mainView.newProfilePage.bookmarks')))])]),_vm._v(" "),_c('div',{attrs:{"id":"patchouli-npp-view"}},[_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.isSelfBookmarkPage),expression:"isSelfBookmarkPage"}],staticClass:"ω",attrs:{"id":"patchouli-npp-view-bookmark-switch"}},[_c('nav',[_c('a',{class:{'current': _vm.nppType === 3},attrs:{"id":"patchouli-npp-view-bookmark-switch-public","href":("/bookmark.php?id=" + _vm.uid + "&rest=show")},on:{"click":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"left",37,$event.key,["Left","ArrowLeft"])){ return null; }if('button' in $event && $event.button !== 0){ return null; }$event.preventDefault();return _vm.clickRoute($event)}}},[_vm._v(_vm._s(_vm.$t('mainView.newProfilePage.publicBookmark')))]),_vm._v(" "),_c('a',{class:{'current': _vm.nppType === 4},attrs:{"id":"patchouli-npp-view-bookmark-switch-private","href":("/bookmark.php?id=" + _vm.uid + "&rest=hide")},on:{"click":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"left",37,$event.key,["Left","ArrowLeft"])){ return null; }if('button' in $event && $event.button !== 0){ return null; }$event.preventDefault();return _vm.clickRoute($event)}}},[_vm._v(_vm._s(_vm.$t('mainView.newProfilePage.privateBookmark')))])])]),_vm._v(" "),_c('div',{attrs:{"id":"patchouli-npp-view-header"}}),_vm._v(" "),_c('ul',{directives:[{name:"show",rawName:"v-show",value:(!_vm.hasNoResult),expression:"!hasNoResult"}],staticClass:"ω",attrs:{"id":"patchouli-npp-view-image-item-list"}},_vm._l((_vm.nppProcessedLibrary),function(d,index){return _c('NewDefaultImageItem',{directives:[{name:"show",rawName:"v-show",value:(index < _vm.imageToShowCount),expression:"index < imageToShowCount"}],key:d.illustId,attrs:{"illust-id":d.illustId,"bookmark-count":d.bookmarkCount,"bookmark-id":d.bookmarkId,"is-bookmarked":d.isBookmarked,"is-followed":d.isFollowed,"is-ugoira":d.isUgoira,"illust-page-count":d.illustPageCount,"illust-title":d.illustTitle,"thumb-img-url":d.urls.thumb,"profile-img-url":d.profileImg,"user-id":d.userId,"user-name":d.userName,"show-user-profile":_vm.uid !== d.userId}})}),1),_vm._v(" "),_c('span',{directives:[{name:"show",rawName:"v-show",value:(_vm.hasNoResult),expression:"hasNoResult"}],attrs:{"id":"patchouli-npp-view-no-result"}},[_vm._v(_vm._s(_vm.$t('mainView.newProfilePage.noResult')))]),_vm._v(" "),_c('span',{directives:[{name:"show",rawName:"v-show",value:(!_vm.status.isPaused && !_vm.status.isEnded),expression:"!status.isPaused && !status.isEnded"}],attrs:{"id":"patchouli-npp-view-loading"}},[_c('IconLoadingSpin')],1)])])};
  2659. var __vue_staticRenderFns__$e = [];
  2660. const __vue_inject_styles__$e = function (inject) {
  2661. if (!inject) return
  2662. inject("data-v-aa4aafec_0", { source: "#patchouli-npp-nav[data-v-aa4aafec]{display:flex;justify-content:center;background-color:#f9f8ff;width:100%}#patchouli-npp-nav>a[data-v-aa4aafec]{border-top:4px solid transparent;color:#999;font-size:16px;font-weight:700;margin:0 10px;padding:10px 20px;text-decoration:none;transition:color .2s}#patchouli-npp-nav>a[data-v-aa4aafec]:hover{color:#333;cursor:pointer}#patchouli-npp-nav>a.current[data-v-aa4aafec]{color:#333;border-bottom:4px solid #0096fa}#patchouli-npp-view[data-v-aa4aafec]{display:flex;flex-flow:column;min-height:340px;align-items:center}#patchouli-npp-view-bookmark-switch[data-v-aa4aafec]{display:flex;justify-content:flex-end;margin:24px auto 48px;width:1300px}#patchouli-npp-view-bookmark-switch a.current[data-v-aa4aafec]{background-color:#f5f5f5;color:#5c5c5c}#patchouli-npp-view-bookmark-switch a[data-v-aa4aafec]{border-radius:24px;color:#8f8f8f;font-size:16px;font-weight:700;padding:16px 24px;text-decoration:none}#patchouli-npp-view-image-item-list[data-v-aa4aafec]{list-style:none;display:flex;align-content:flex-start;justify-content:center;flex-wrap:wrap;padding:14px 0;margin:0 auto;width:1300px}#patchouli-npp-view-no-result[data-v-aa4aafec]{flex:1;display:inline-flex;align-items:center;color:#b8b8b8;font-size:20px;font-weight:700;line-height:1}#patchouli-npp-view-loading[data-v-aa4aafec]{flex:1;display:inline-flex;align-items:center}", map: undefined, media: undefined });
  2663. };
  2664. const __vue_scope_id__$e = "data-v-aa4aafec";
  2665. const __vue_module_identifier__$e = undefined;
  2666. const __vue_is_functional_template__$e = false;
  2667. var NewProfilePage = normalizeComponent_1(
  2668. { render: __vue_render__$e, staticRenderFns: __vue_staticRenderFns__$e },
  2669. __vue_inject_styles__$e,
  2670. __vue_script__$e,
  2671. __vue_scope_id__$e,
  2672. __vue_is_functional_template__$e,
  2673. __vue_module_identifier__$e,
  2674. browser,
  2675. undefined
  2676. );
  2677. var script$f = {
  2678. components: { ContextMenu, DefaultImageItemPage, NewProfilePage },
  2679. props: {
  2680. id: {
  2681. default: '',
  2682. type: String,
  2683. },
  2684. },
  2685. computed: {
  2686. isNewProfilePage() {
  2687. return this.$store.getters['pixiv/nppType'] >= 0;
  2688. },
  2689. },
  2690. };
  2691. const __vue_script__$f = script$f;
  2692. var __vue_render__$f = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{attrs:{"id":_vm.id}},[(_vm.isNewProfilePage)?_c('NewProfilePage'):_c('DefaultImageItemPage'),_vm._v(" "),_c('ContextMenu')],1)};
  2693. var __vue_staticRenderFns__$f = [];
  2694. const __vue_inject_styles__$f = undefined;
  2695. const __vue_scope_id__$f = "data-v-ace52af6";
  2696. const __vue_module_identifier__$f = undefined;
  2697. const __vue_is_functional_template__$f = false;
  2698. var mainView = normalizeComponent_1(
  2699. { render: __vue_render__$f, staticRenderFns: __vue_staticRenderFns__$f },
  2700. __vue_inject_styles__$f,
  2701. __vue_script__$f,
  2702. __vue_scope_id__$f,
  2703. __vue_is_functional_template__$f,
  2704. __vue_module_identifier__$f,
  2705. undefined,
  2706. undefined
  2707. );
  2708. var script$g = {
  2709. components: { FontAwesomeIcon },
  2710. props: {
  2711. id: {
  2712. default: '',
  2713. type: String,
  2714. },
  2715. },
  2716. data() {
  2717. return {
  2718. previewCurrentIndex: 0,
  2719. previewSrcList: [],
  2720. previewUgoiraMetaData: null,
  2721. ugoiraPlayers: [],
  2722. };
  2723. },
  2724. computed: {
  2725. xc() {
  2726. return this.$store.getters.config;
  2727. },
  2728. xdata() {
  2729. return this.$store.getters['coverLayer/data'];
  2730. },
  2731. xmode() {
  2732. return this.$store.getters['coverLayer/mode'];
  2733. },
  2734. },
  2735. watch: {
  2736. async xmode(value) {
  2737. if (value === 'preview') {
  2738. const imageItem = this.xdata;
  2739. if (imageItem.isUgoira) {
  2740. this.previewUgoiraMetaData = await PixivAPI.getIllustUgoiraMetaData(
  2741. imageItem.illustId
  2742. );
  2743. this.initZipImagePlayer();
  2744. this.previewSrcList.push(imageItem.urls.thumb);
  2745. this.previewSrcList.push(imageItem.urls.original);
  2746. } else if (imageItem.illustPageCount > 1) {
  2747. const indexArray = Array.from(
  2748. Array(imageItem.illustPageCount).keys()
  2749. );
  2750. const srcs = indexArray.map(idx =>
  2751. imageItem.urls.original.replace('p0', `p${idx}`)
  2752. );
  2753. this.previewSrcList.push(...srcs);
  2754. } else {
  2755. this.previewSrcList.push(imageItem.urls.original);
  2756. }
  2757. } else if (!value) {
  2758. this.previewSrcList.length = 0;
  2759. this.previewCurrentIndex = 0;
  2760. this.previewUgoiraMetaData = null;
  2761. this.ugoiraPlayers.forEach(player => player.stop());
  2762. this.ugoiraPlayers.length = 0;
  2763. }
  2764. },
  2765. },
  2766. updated() {
  2767. if (this.xmode === 'preview') {
  2768. this.$refs.coverLayerRoot.focus();
  2769. }
  2770. },
  2771. methods: {
  2772. clickBase(event) {
  2773. this.$store.commit('coverLayer/close');
  2774. const blacklist = [
  2775. ...new Set(
  2776. this.$refs.blacklistTextarea.value
  2777. .split('\n')
  2778. .map(s => s.trim())
  2779. .filter(Boolean)
  2780. ),
  2781. ];
  2782. blacklist.sort((a, b) => a - b);
  2783. this.$store.commit('setConfig', { blacklist });
  2784. this.$store.commit('saveConfig');
  2785. },
  2786. clickSwitch(event) {
  2787. if (event.currentTarget.id === 'config-context-menu-switch') {
  2788. this.xc.contextMenu = toInt(!this.xc.contextMenu);
  2789. }
  2790. if (event.currentTarget.id === 'config-user-tooltip-switch') {
  2791. this.xc.userTooltip = toInt(!this.xc.userTooltip);
  2792. }
  2793. if (event.currentTarget.id === 'config-hover-play-switch') {
  2794. this.xc.hoverPlay = toInt(!this.xc.hoverPlay);
  2795. }
  2796. },
  2797. initZipImagePlayer() {
  2798. const meta = this.previewUgoiraMetaData;
  2799. this.$refs.previewOriginalUgoiraCanvas.width = 0;
  2800. this.$refs.previewUgoiraCanvas.width = 0;
  2801. const opt = {
  2802. autoStart: true,
  2803. autosize: true,
  2804. canvas: this.$refs.previewUgoiraCanvas,
  2805. chunkSize: 300000,
  2806. loop: true,
  2807. metadata: meta,
  2808. source: meta.src,
  2809. };
  2810. this.ugoiraPlayers.push(new ZipImagePlayer(opt));
  2811. this.ugoiraPlayers.push(
  2812. new ZipImagePlayer(
  2813. Object.assign({}, opt, {
  2814. canvas: this.$refs.previewOriginalUgoiraCanvas,
  2815. source: meta.originalSrc,
  2816. })
  2817. )
  2818. );
  2819. },
  2820. jumpByKeyup(event) {
  2821. if (this.xmode === 'preview') {
  2822. if (event.key === 'ArrowLeft') {
  2823. this.jumpPrev();
  2824. } else if (event.key === 'ArrowRight') {
  2825. this.jumpNext();
  2826. }
  2827. }
  2828. },
  2829. jumpByWheel(event) {
  2830. if (this.xmode === 'preview') {
  2831. if (event.deltaY < 0) {
  2832. this.jumpPrev();
  2833. } else if (event.deltaY > 0) {
  2834. this.jumpNext();
  2835. }
  2836. }
  2837. },
  2838. jumpNext() {
  2839. const t = this.previewSrcList.length;
  2840. const c = this.previewCurrentIndex;
  2841. this.jumpTo((c + 1) % t);
  2842. },
  2843. jumpPrev() {
  2844. const t = this.previewSrcList.length;
  2845. const c = this.previewCurrentIndex;
  2846. this.jumpTo((c + t - 1) % t);
  2847. },
  2848. jumpTo(index) {
  2849. this.previewCurrentIndex = index;
  2850. },
  2851. },
  2852. };
  2853. const __vue_script__$g = script$g;
  2854. var __vue_render__$g = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.xmode),expression:"xmode"}],ref:"coverLayerRoot",attrs:{"id":_vm.id,"tabindex":"0"},on:{"keyup":_vm.jumpByKeyup,"click":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"left",37,$event.key,["Left","ArrowLeft"])){ return null; }if('button' in $event && $event.button !== 0){ return null; }return _vm.clickBase($event)},"scroll":function($event){$event.stopPropagation();$event.preventDefault();},"wheel":function($event){$event.stopPropagation();$event.preventDefault();return _vm.jumpByWheel($event)}}},[_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.xmode === 'config'),expression:"xmode === 'config'"}],attrs:{"id":"marisa-config-mode"},on:{"click":function($event){$event.stopPropagation();}}},[_c('a',{attrs:{"id":"config-context-menu-switch"},on:{"click":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"left",37,$event.key,["Left","ArrowLeft"])){ return null; }if('button' in $event && $event.button !== 0){ return null; }return _vm.clickSwitch($event)}}},[_c('a',{directives:[{name:"show",rawName:"v-show",value:(_vm.xc.contextMenu),expression:"xc.contextMenu"}],attrs:{"id":"config-context-menu-switch-on","role":"button"}},[_c('FontAwesomeIcon',{attrs:{"icon":'toggle-on'}})],1),_vm._v(" "),_c('a',{directives:[{name:"show",rawName:"v-show",value:(!_vm.xc.contextMenu),expression:"!xc.contextMenu"}],attrs:{"id":"config-context-menu-switch-off","role":"button"}},[_c('FontAwesomeIcon',{attrs:{"icon":'toggle-off'}})],1),_vm._v(" "),_c('span',{attrs:{"id":"config-context-menu-label"}},[_vm._v(_vm._s(_vm.$t('config.contextMenuExtension')))])]),_vm._v(" "),_c('a',{attrs:{"id":"config-user-tooltip-switch"},on:{"click":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"left",37,$event.key,["Left","ArrowLeft"])){ return null; }if('button' in $event && $event.button !== 0){ return null; }return _vm.clickSwitch($event)}}},[_c('a',{directives:[{name:"show",rawName:"v-show",value:(_vm.xc.userTooltip),expression:"xc.userTooltip"}],attrs:{"id":"config-user-tooltip-switch-on","role":"button"}},[_c('FontAwesomeIcon',{attrs:{"icon":'toggle-on'}})],1),_vm._v(" "),_c('a',{directives:[{name:"show",rawName:"v-show",value:(!_vm.xc.userTooltip),expression:"!xc.userTooltip"}],attrs:{"id":"config-user-tooltip-switch-off","role":"button"}},[_c('FontAwesomeIcon',{attrs:{"icon":'toggle-off'}})],1),_vm._v(" "),_c('span',{attrs:{"id":"config-user-tooltip-label"}},[_vm._v(_vm._s(_vm.$t('config.userTooltip')))])]),_vm._v(" "),_c('a',{attrs:{"id":"config-hover-play-switch"},on:{"click":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"left",37,$event.key,["Left","ArrowLeft"])){ return null; }if('button' in $event && $event.button !== 0){ return null; }return _vm.clickSwitch($event)}}},[_c('a',{directives:[{name:"show",rawName:"v-show",value:(_vm.xc.hoverPlay),expression:"xc.hoverPlay"}],attrs:{"id":"config-hover-play-switch-on","role":"button"}},[_c('FontAwesomeIcon',{attrs:{"icon":'toggle-on'}})],1),_vm._v(" "),_c('a',{directives:[{name:"show",rawName:"v-show",value:(!_vm.xc.hoverPlay),expression:"!xc.hoverPlay"}],attrs:{"id":"config-hover-play-switch-off","role":"button"}},[_c('FontAwesomeIcon',{attrs:{"icon":'toggle-off'}})],1),_vm._v(" "),_c('span',{attrs:{"id":"config-hover-play-label"}},[_vm._v(_vm._s(_vm.$t('config.hoverPlay')))])]),_vm._v(" "),_c('a',{attrs:{"id":"marisa-config-blacklist-label"}},[_c('FontAwesomeIcon',{attrs:{"icon":'eye-slash'}}),_vm._v("\n "+_vm._s(_vm.$t('config.blacklist'))+"\n ")],1),_vm._v(" "),_c('textarea',{ref:"blacklistTextarea",attrs:{"id":"marisa-config-blacklist-textarea","spellcheck":"false","rows":"5"},domProps:{"value":_vm.xc.blacklist.join('\n')}})]),_vm._v(" "),_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.xmode === 'preview'),expression:"xmode === 'preview'"}],attrs:{"id":"marisa-preview-mode"},on:{"click":function($event){$event.stopPropagation();}}},[_c('div',{attrs:{"id":"marisa-preview-display-area"}},[_c('a',{directives:[{name:"show",rawName:"v-show",value:(!_vm.previewUgoiraMetaData),expression:"!previewUgoiraMetaData"}],attrs:{"href":_vm.previewSrcList[_vm.previewCurrentIndex],"target":"_blank"}},[_c('img',{attrs:{"src":_vm.previewSrcList[_vm.previewCurrentIndex]}})]),_vm._v(" "),_c('div',{directives:[{name:"show",rawName:"v-show",value:(!!_vm.previewUgoiraMetaData),expression:"!!previewUgoiraMetaData"}]},[_c('canvas',{directives:[{name:"show",rawName:"v-show",value:(_vm.previewCurrentIndex === 0),expression:"previewCurrentIndex === 0"}],ref:"previewUgoiraCanvas"}),_vm._v(" "),_c('canvas',{directives:[{name:"show",rawName:"v-show",value:(_vm.previewCurrentIndex === 1),expression:"previewCurrentIndex === 1"}],ref:"previewOriginalUgoiraCanvas"})])]),_vm._v(" "),_c('ul',{directives:[{name:"show",rawName:"v-show",value:(_vm.previewSrcList.length > 1),expression:"previewSrcList.length > 1"}],attrs:{"id":"marisa-preview-thumbnails-area"}},_vm._l((_vm.previewSrcList),function(pSrc,index){return _c('li',{key:pSrc},[_c('a',{class:(index === _vm.previewCurrentIndex) ? 'current-preview' : '',on:{"click":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"left",37,$event.key,["Left","ArrowLeft"])){ return null; }if('button' in $event && $event.button !== 0){ return null; }return _vm.jumpTo(index)}}},[_c('img',{attrs:{"src":pSrc}})])])}),0)])])};
  2855. var __vue_staticRenderFns__$g = [];
  2856. const __vue_inject_styles__$g = function (inject) {
  2857. if (!inject) return
  2858. inject("data-v-020aa59c_0", { source: "#Marisa[data-v-020aa59c]{background-color:#000a;position:fixed;height:100%;width:100%;z-index:5;top:0;left:0;display:flex;align-items:center;justify-content:center}#marisa-config-mode[data-v-020aa59c],#marisa-preview-mode[data-v-020aa59c]{min-width:100px;min-height:100px;background-color:#eef}#marisa-config-mode[data-v-020aa59c]{display:flex;flex-flow:column;padding:10px;border-radius:10px;font-size:18px;white-space:nowrap}#marisa-config-mode a[data-v-020aa59c]{color:#00186c;text-decoration:none;display:inline-flex}#marisa-config-mode>a[data-v-020aa59c]{align-items:center;justify-content:center;margin:2px 0}#marisa-config-mode [id$=switch][data-v-020aa59c]{cursor:pointer}#marisa-config-mode svg[data-v-020aa59c]{height:18px;margin:0 4px}#marisa-config-blacklist-textarea[data-v-020aa59c]{box-sizing:border-box;flex:1;resize:none;font-size:11pt;height:90px}#marisa-preview-mode[data-v-020aa59c]{width:70%;height:100%;box-sizing:border-box;display:grid;grid-template-rows:minmax(0,auto) max-content}#marisa-preview-display-area[data-v-020aa59c]{border:2px #00186c solid;box-sizing:border-box;text-align:center}#marisa-preview-display-area>a[data-v-020aa59c],#marisa-preview-display-area>div[data-v-020aa59c]{display:inline-flex;height:100%;justify-content:center;align-items:center}#marisa-preview-display-area>a>img[data-v-020aa59c],#marisa-preview-display-area>div>canvas[data-v-020aa59c]{object-fit:contain;max-width:100%;max-height:100%}#marisa-preview-thumbnails-area[data-v-020aa59c]{background-color:#f8f8ff;display:flex;align-items:center;overflow-x:auto;overflow-y:hidden;height:100%;border:2px solid #014;box-sizing:border-box;border-top:0;margin:0;padding:0;list-style:none}#marisa-preview-thumbnails-area>li[data-v-020aa59c]{margin:0 10px;display:inline-flex}#marisa-preview-thumbnails-area>li>a[data-v-020aa59c]{cursor:pointer;display:inline-flex;border:3px solid transparent}#marisa-preview-thumbnails-area>li>a.current-preview[data-v-020aa59c]{border:3px solid #db7093}#marisa-preview-thumbnails-area>li>a>img[data-v-020aa59c]{max-height:100px;box-sizing:border-box;display:inline-block}", map: undefined, media: undefined });
  2859. };
  2860. const __vue_scope_id__$g = "data-v-020aa59c";
  2861. const __vue_module_identifier__$g = undefined;
  2862. const __vue_is_functional_template__$g = false;
  2863. var coverLayer$1 = normalizeComponent_1(
  2864. { render: __vue_render__$g, staticRenderFns: __vue_staticRenderFns__$g },
  2865. __vue_inject_styles__$g,
  2866. __vue_script__$g,
  2867. __vue_scope_id__$g,
  2868. __vue_is_functional_template__$g,
  2869. __vue_module_identifier__$g,
  2870. browser,
  2871. undefined
  2872. );
  2873. if (unsafeWindow) {
  2874. const { globalInitData, pixiv } = unsafeWindow;
  2875. const { DataView, ArrayBuffer } = unsafeWindow;
  2876. Object.assign(window, {
  2877. ArrayBuffer,
  2878. DataView,
  2879. globalInitData,
  2880. pixiv,
  2881. });
  2882. }
  2883. vuexStore.dispatch('init')
  2884. .then(() => {
  2885. if (vuexStore.getters.MPT === MAIN_PAGE_TYPE.NO_SUPPORT) {
  2886. return;
  2887. }
  2888. const Koakuma = new Vue({
  2889. i18n,
  2890. store: vuexStore,
  2891. data: {
  2892. name: 'Koakuma',
  2893. },
  2894. computed: {
  2895. currentLocale() {
  2896. return this.$store.getters.locale;
  2897. },
  2898. },
  2899. watch: {
  2900. currentLocale(newValue) {
  2901. this.$i18n.locale = newValue;
  2902. },
  2903. },
  2904. render(h) {
  2905. return h(ctrlPanel, { props: { id: this.name } });
  2906. },
  2907. });
  2908. const Patchouli = new Vue({
  2909. i18n,
  2910. store: vuexStore,
  2911. data: {
  2912. name: 'Patchouli',
  2913. },
  2914. computed: {
  2915. currentLocale() {
  2916. return this.$store.getters.locale;
  2917. },
  2918. },
  2919. watch: {
  2920. currentLocale(newValue) {
  2921. this.$i18n.locale = newValue;
  2922. },
  2923. },
  2924. render(h) {
  2925. return h(mainView, { props: { id: this.name } });
  2926. },
  2927. });
  2928. const Marisa = new Vue({
  2929. i18n,
  2930. store: vuexStore,
  2931. data: {
  2932. name: 'Marisa',
  2933. },
  2934. computed: {
  2935. currentLocale() {
  2936. return this.$store.getters.locale;
  2937. },
  2938. },
  2939. watch: {
  2940. currentLocale(newValue) {
  2941. this.$i18n.locale = newValue;
  2942. },
  2943. },
  2944. render(h) {
  2945. return h(coverLayer$1, { props: { id: this.name } });
  2946. },
  2947. });
  2948. if (vuexStore.getters['pixiv/nppType'] < 0) {
  2949. $('._global-header').classList.add('koakuma-placeholder');
  2950. }
  2951. vuexStore.dispatch('pixiv/start', { isFirst: true, times: 1 })
  2952. .then(() => {
  2953. Patchouli.$mount(vuexStore.getters.mountPointMainView);
  2954. Koakuma.$mount(vuexStore.getters.mountPointCtrlPanel);
  2955. Marisa.$mount(vuexStore.getters.mountPointCoverLayer);
  2956. vuexStore.commit('applyConfig');
  2957. if (vuexStore.getters['pixiv/nppType'] < 0) {
  2958. $('._global-header').classList.remove('koakuma-placeholder');
  2959. }
  2960. })
  2961. .catch(error => {
  2962. $print.error('main#init: Fail to first mount', error);
  2963. });
  2964. document.body.addEventListener('click', (event) => {
  2965. const koakuma = Koakuma.$children[0];
  2966. if (!event.target.closest('#koakuma-bookmark-input-usual-switch')) {
  2967. koakuma.usualSwitchOn = false;
  2968. }
  2969. if (!event.target.closest('#koakuma-sorting-order-select-switch')) {
  2970. koakuma.sortingOrderSwitchOn = false;
  2971. }
  2972. if (vuexStore.getters['contextMenu/active']) {
  2973. vuexStore.commit('contextMenu/deactivate');
  2974. }
  2975. });
  2976. if (vuexStore.getters.MPT === MAIN_PAGE_TYPE.SEARCH) {
  2977. const menuItems = $('ul.menu-items');
  2978. [...menuItems.children].forEach((item, index) => {
  2979. const textContent = item.textContent;
  2980. const a = $el('a', { href: 'javascript:;', textContent });
  2981. item.removeChild(item.firstChild);
  2982. item.appendChild(a);
  2983. item.addEventListener('click', () => {
  2984. [...menuItems.children].forEach(_item => _item.classList.remove('current'));
  2985. item.classList.add('current');
  2986. const target = $('#koakuma-bookmark-tags-filter-input');
  2987. if (index === 1) {
  2988. target.value = '-R-18';
  2989. } else if (index === 2) {
  2990. target.value = 'R-18';
  2991. } else {
  2992. target.value = '';
  2993. }
  2994. Koakuma.$children[0].tagsFilterInput({ target });
  2995. });
  2996. });
  2997. }
  2998. Object.assign(unsafeWindow, {
  2999. Koakuma,
  3000. Marisa,
  3001. Patchouli,
  3002. vuexStore,
  3003. });
  3004. })
  3005. .catch($print.error);
  3006.  
  3007. }(Vue, VueI18n, Vuex));