V2EX Next V2Next

V2Next - 一个好用的V2EX脚本!

当前为 2024-11-23 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name V2EX Next V2Next
  3. // @namespace http://tampermonkey.net/
  4. // @version 10.19
  5. // @author zyronon
  6. // @description V2Next - 一个好用的V2EX脚本!
  7. // @license GPL License
  8. // @icon https://v2ex-script.vercel.app/favicon.ico
  9. // @homepage https://github.com/zyronon/V2Next
  10. // @homepageURL https://github.com/zyronon/V2Next
  11. // @supportURL https://update.greasyfork.org/scripts/458024/V2Next.user.js
  12. // @match https://v2ex.com/
  13. // @match https://v2ex.com/?tab=*
  14. // @match https://v2ex.com/t/*
  15. // @match https://v2ex.com/recent*
  16. // @match https://v2ex.com/go/*
  17. // @match https://v2ex.com/member/*
  18. // @match https://v2ex.com/changes*
  19. // @match https://*.v2ex.com/
  20. // @match https://*.v2ex.com/?tab=*
  21. // @match https://*.v2ex.com/t/*
  22. // @match https://*.v2ex.com/recent*
  23. // @match https://*.v2ex.com/go/*
  24. // @match https://*.v2ex.com/member/*
  25. // @match https://*.v2ex.com/changes*
  26. // @require https://cdn.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.min.js
  27. // @require https://cdn.jsdelivr.net/npm/vue@3.4.14/dist/vue.global.prod.min.js
  28. // @require https://cdn.jsdelivr.net/npm/dayjs@1.11.13/dayjs.min.js
  29. // @grant GM_addStyle
  30. // @grant GM_openInTab
  31. // @grant GM_registerMenuCommand
  32. // ==/UserScript==
  33.  
  34.  
  35. (function (vue, dayjs) {
  36. 'use strict';
  37.  
  38. var PageType = /* @__PURE__ */ ((PageType2) => {
  39. PageType2["Home"] = "Home";
  40. PageType2["Node"] = "Node";
  41. PageType2["Post"] = "Post";
  42. PageType2["Member"] = "Member";
  43. PageType2["Changes"] = "Changes";
  44. PageType2["Hot"] = "Hot";
  45. return PageType2;
  46. })(PageType || {});
  47. var CommentDisplayType = /* @__PURE__ */ ((CommentDisplayType2) => {
  48. CommentDisplayType2[CommentDisplayType2["FloorInFloor"] = 0] = "FloorInFloor";
  49. CommentDisplayType2[CommentDisplayType2["FloorInFloorNoCallUser"] = 4] = "FloorInFloorNoCallUser";
  50. CommentDisplayType2[CommentDisplayType2["FloorInFloorNested"] = 5] = "FloorInFloorNested";
  51. CommentDisplayType2[CommentDisplayType2["Like"] = 1] = "Like";
  52. CommentDisplayType2[CommentDisplayType2["V2exOrigin"] = 2] = "V2exOrigin";
  53. CommentDisplayType2[CommentDisplayType2["OnlyOp"] = 3] = "OnlyOp";
  54. CommentDisplayType2[CommentDisplayType2["New"] = 6] = "New";
  55. return CommentDisplayType2;
  56. })(CommentDisplayType || {});
  57. const _sfc_main$m = {
  58. name: "Tooltip",
  59. props: {
  60. title: {
  61. type: String,
  62. default() {
  63. return "";
  64. }
  65. },
  66. disabled: {
  67. type: Boolean,
  68. default() {
  69. return false;
  70. }
  71. }
  72. },
  73. data() {
  74. return {
  75. show: false
  76. };
  77. },
  78. methods: {
  79. showPop(e2) {
  80. if (this.disabled)
  81. return;
  82. if (!this.title)
  83. return;
  84. e2.stopPropagation();
  85. let rect = e2.target.getBoundingClientRect();
  86. this.show = true;
  87. vue.nextTick(() => {
  88. var _a, _b;
  89. let tip = (_b = (_a = this.$refs) == null ? void 0 : _a.tip) == null ? void 0 : _b.getBoundingClientRect();
  90. if (!tip)
  91. return;
  92. if (rect.top < 50) {
  93. this.$refs.tip.style.top = rect.top + rect.height + 10 + "px";
  94. } else {
  95. this.$refs.tip.style.top = rect.top - tip.height - 10 + "px";
  96. }
  97. let tipWidth = tip.width;
  98. let rectWidth = rect.width;
  99. this.$refs.tip.style.left = rect.left - (tipWidth - rectWidth) / 2 + "px";
  100. });
  101. }
  102. },
  103. render() {
  104. let Vnode = this.$slots.default()[0];
  105. return vue.createVNode(vue.Fragment, null, [this.show && this.title && vue.createVNode(vue.Teleport, {
  106. "to": "body"
  107. }, {
  108. default: () => [vue.createVNode(vue.Transition, {
  109. "name": "fade"
  110. }, {
  111. default: () => [vue.createVNode("div", {
  112. "ref": "tip",
  113. "className": "tip"
  114. }, [this.title])]
  115. })]
  116. }), vue.createVNode(Vnode, {
  117. "onClick": () => this.show = false,
  118. "onmouseenter": (e2) => this.showPop(e2),
  119. "onmouseleave": () => this.show = false
  120. }, null)]);
  121. }
  122. };
  123. const _export_sfc = (sfc, props) => {
  124. const target = sfc.__vccOpts || sfc;
  125. for (const [key, val] of props) {
  126. target[key] = val;
  127. }
  128. return target;
  129. };
  130. const Tooltip = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-ee672411"]]);
  131. const _sfc_main$l = /* @__PURE__ */ vue.defineComponent({
  132. __name: "BaseSwitch",
  133. props: {
  134. modelValue: { type: Boolean }
  135. },
  136. emits: ["update:modelValue"],
  137. setup(__props, { emit: __emit }) {
  138. return (_ctx, _cache) => {
  139. return vue.openBlock(), vue.createElementBlock("div", {
  140. class: vue.normalizeClass(["switch", { active: _ctx.modelValue }]),
  141. onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:modelValue", !_ctx.modelValue))
  142. }, null, 2);
  143. };
  144. }
  145. });
  146. const BaseSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-e7c0fbef"]]);
  147. var _GM_openInTab = /* @__PURE__ */ (() => typeof GM_openInTab != "undefined" ? GM_openInTab : void 0)();
  148. var _GM_registerMenuCommand = /* @__PURE__ */ (() => typeof GM_registerMenuCommand != "undefined" ? GM_registerMenuCommand : void 0)();
  149. const functions = {
  150. async refreshOnce(once) {
  151. return new Promise((resolve) => {
  152. if (once) {
  153. if (typeof once === "string") {
  154. let res = once.match(/var once = "([\d]+)";/);
  155. if (res && res[1])
  156. resolve(Number(res[1]));
  157. }
  158. if (typeof once === "number")
  159. resolve(once);
  160. }
  161. window.fetchOnce().then((r2) => {
  162. resolve(r2);
  163. });
  164. });
  165. },
  166. clone: (val) => JSON.parse(JSON.stringify(val)),
  167. createList(post, replyList, withRedundList = true) {
  168. post.replyList = replyList;
  169. post.topReplyList = this.clone(replyList).filter((v) => v.thankCount >= window.config.topReplyLoveMinCount).sort((a, b) => b.thankCount - a.thankCount).slice(0, window.config.topReplyCount);
  170. post.replyCount = replyList.length;
  171. post.allReplyUsers = Array.from(new Set(replyList.map((v) => v.username)));
  172. post.nestedReplies = functions.createNestedList(this.clone(replyList), post.topReplyList);
  173. if (withRedundList) {
  174. post.nestedRedundReplies = functions.createNestedRedundantList(this.clone(replyList), post.topReplyList);
  175. }
  176. return post;
  177. },
  178. //获取所有回复
  179. getAllReply(repliesMap = []) {
  180. return repliesMap.sort((a, b) => a.i - b.i).reduce((pre, i) => {
  181. pre = pre.concat(i.replyList);
  182. return pre;
  183. }, []);
  184. },
  185. //查找子回复
  186. findChildren(item, endList, all, topReplyList) {
  187. var _a;
  188. const fn = (child, endList2, parent) => {
  189. child.level = parent.level + 1;
  190. let rIndex2 = all.findIndex((v) => v.floor === child.floor);
  191. if (rIndex2 > -1) {
  192. all[rIndex2].isUse = true;
  193. }
  194. parent.children.push(this.findChildren(child, endList2, all, topReplyList));
  195. };
  196. item.children = [];
  197. let floorReplyList = [];
  198. for (let i = 0; i < endList.length; i++) {
  199. let currentItem = endList[i];
  200. if (currentItem.isUse)
  201. continue;
  202. if (currentItem.replyFloor === item.floor) {
  203. if (currentItem.replyUsers.length === 1 && currentItem.replyUsers[0] === item.username) {
  204. currentItem.isUse = true;
  205. floorReplyList.push({ endList: endList.slice(i + 1), currentItem });
  206. } else {
  207. currentItem.isWrong = true;
  208. }
  209. }
  210. }
  211. floorReplyList.reverse().map(({ currentItem, endList: endList2 }) => {
  212. fn(currentItem, endList2, item);
  213. });
  214. let nextMeIndex = endList.findIndex((v) => {
  215. var _a2;
  216. return v.username === item.username && ((_a2 = v.replyUsers) == null ? void 0 : _a2[0]) !== item.username;
  217. });
  218. let findList = nextMeIndex > -1 ? endList.slice(0, nextMeIndex) : endList;
  219. for (let i = 0; i < findList.length; i++) {
  220. let currentItem = findList[i];
  221. if (currentItem.isUse)
  222. continue;
  223. if (currentItem.replyUsers.length === 1) {
  224. if (currentItem.replyFloor !== -1) {
  225. if (((_a = all[currentItem.replyFloor - 1]) == null ? void 0 : _a.username) === currentItem.replyUsers[0]) {
  226. continue;
  227. }
  228. }
  229. let endList2 = endList.slice(i + 1);
  230. if (currentItem.username === item.username) {
  231. if (currentItem.replyUsers[0] === item.username) {
  232. fn(currentItem, endList2, item);
  233. }
  234. break;
  235. } else {
  236. if (currentItem.replyUsers[0] === item.username) {
  237. fn(currentItem, endList2, item);
  238. }
  239. }
  240. } else {
  241. if (currentItem.username === item.username)
  242. break;
  243. }
  244. }
  245. item.children = item.children.sort((a, b) => a.floor - b.floor);
  246. item.replyCount = item.children.reduce((a, b) => {
  247. return a + (b.children.length ? b.replyCount + 1 : 1);
  248. }, 0);
  249. let rIndex = topReplyList.findIndex((v) => v.floor === item.floor);
  250. if (rIndex > -1) {
  251. topReplyList[rIndex].children = item.children;
  252. topReplyList[rIndex].replyCount = item.replyCount;
  253. }
  254. return item;
  255. },
  256. //生成嵌套回复
  257. createNestedList(allList = [], topReplyList = []) {
  258. if (!allList.length)
  259. return [];
  260. let list = allList;
  261. let nestedList = [];
  262. list.map((item, index) => {
  263. let startList = list.slice(0, index);
  264. let startReplyUsers = Array.from(new Set(startList.map((v) => v.username)));
  265. let endList = list.slice(index + 1);
  266. if (index === 0) {
  267. nestedList.push(this.findChildren(item, endList, list, topReplyList));
  268. } else {
  269. if (!item.isUse) {
  270. let isOneLevelReply = false;
  271. if (item.replyUsers.length) {
  272. if (item.replyUsers.length > 1) {
  273. isOneLevelReply = true;
  274. } else {
  275. isOneLevelReply = !startReplyUsers.find((v) => v === item.replyUsers[0]);
  276. }
  277. } else {
  278. isOneLevelReply = true;
  279. }
  280. if (isOneLevelReply) {
  281. item.level = 0;
  282. nestedList.push(this.findChildren(item, endList, list, topReplyList));
  283. }
  284. }
  285. }
  286. });
  287. return nestedList;
  288. },
  289. //生成嵌套冗余回复
  290. createNestedRedundantList(allList = [], topReplyList) {
  291. if (!allList.length)
  292. return [];
  293. let list = allList;
  294. let nestedList = [];
  295. list.map((item, index) => {
  296. let startList = list.slice(0, index);
  297. let startReplyUsers = Array.from(new Set(startList.map((v) => v.username)));
  298. let endList = list.slice(index + 1);
  299. if (index === 0) {
  300. nestedList.push(this.findChildren(item, endList, list, topReplyList));
  301. } else {
  302. if (!item.isUse) {
  303. let isOneLevelReply = false;
  304. if (item.replyUsers.length) {
  305. if (item.replyUsers.length > 1) {
  306. isOneLevelReply = true;
  307. } else {
  308. isOneLevelReply = !startReplyUsers.find((v) => v === item.replyUsers[0]);
  309. }
  310. } else {
  311. isOneLevelReply = true;
  312. }
  313. if (isOneLevelReply) {
  314. item.level = 0;
  315. nestedList.push(this.findChildren(item, endList, list, topReplyList));
  316. }
  317. } else {
  318. let newItem = this.clone(item);
  319. newItem.children = [];
  320. newItem.level = 0;
  321. newItem.isDup = true;
  322. nestedList.push(newItem);
  323. }
  324. }
  325. });
  326. return nestedList;
  327. },
  328. //解析A标签
  329. parseA(a) {
  330. let href = a.href;
  331. let id;
  332. if (href.includes("/t/")) {
  333. id = a.pathname.substring("/t/".length);
  334. }
  335. return { href, id, title: a.innerText };
  336. },
  337. //图片链接转Img标签
  338. checkPhotoLink2Img(dom) {
  339. let replaceImgur = window.config.replaceImgur;
  340. let is_add = false;
  341. let prefix_img = replaceImgur ? DefaultVal.imgurProxy : "";
  342. let imgList = dom.querySelectorAll("img");
  343. imgList.forEach((img) => {
  344. let href = img.src;
  345. if (href.includes("imgur.com")) {
  346. img.setAttribute("originUrl", img.src);
  347. img.setAttribute("notice", "此img标签由V2Next脚本解析");
  348. img.setAttribute("referrerpolicy", "no-referrer");
  349. if (href.includes(".png") || href.includes(".jpg") || href.includes(".jpeg") || href.includes(".gif") || href.includes(".PNG") || href.includes(".JPG") || href.includes(".JPEG") || href.includes(".GIF"))
  350. ;
  351. else {
  352. href = href + ".png";
  353. }
  354. if (!is_add && replaceImgur) {
  355. let meta = document.createElement("meta");
  356. meta.setAttribute("name", "referrer");
  357. meta.setAttribute("content", "no-referrer");
  358. document.getElementsByTagName("head")[0].appendChild(meta);
  359. is_add = true;
  360. }
  361. img.src = prefix_img + href;
  362. }
  363. });
  364. let aList = dom.querySelectorAll("a");
  365. aList.forEach((a) => {
  366. let href = a.href;
  367. if (a.children.length == 0 && a.innerText == href) {
  368. if (href.includes(".png") || href.includes(".jpg") || href.includes(".jpeg") || href.includes(".gif") || href.includes(".PNG") || href.includes(".JPG") || href.includes(".JPEG") || href.includes(".GIF")) {
  369. let img = document.createElement("img");
  370. img.setAttribute("originUrl", a.href);
  371. img.setAttribute("notice", "此img标签由V2Next脚本解析");
  372. img.setAttribute("referrerpolicy", "no-referrer");
  373. if (href.includes("imgur.com")) {
  374. if (!is_add && replaceImgur) {
  375. let meta = document.createElement("meta");
  376. meta.setAttribute("name", "referrer");
  377. meta.setAttribute("content", "no-referrer");
  378. document.getElementsByTagName("head")[0].appendChild(meta);
  379. is_add = true;
  380. }
  381. img.src = prefix_img + href;
  382. } else {
  383. img.src = href;
  384. }
  385. a.innerText = "";
  386. a.append(img);
  387. }
  388. }
  389. });
  390. },
  391. //检测帖子回复长度
  392. async checkPostReplies(id, needOpen = true) {
  393. return new Promise(async (resolve) => {
  394. let res = await functions.getPostDetailByApi(id);
  395. if ((res == null ? void 0 : res.replies) > window.config.maxReplyCountLimit) {
  396. if (needOpen) {
  397. functions.openNewTab(`https://${location.origin}/t/${id}?p=1&script=1`);
  398. }
  399. return resolve(true);
  400. }
  401. resolve(false);
  402. });
  403. },
  404. async sleep(time) {
  405. return new Promise((resolve) => {
  406. setTimeout(resolve, time);
  407. });
  408. },
  409. //打开新标签页
  410. openNewTab(href, active = false) {
  411. let isSafariBrowser = /Safari/.test(navigator.userAgent) && !/Chrome/.test(navigator.userAgent);
  412. if (isSafariBrowser) {
  413. let tempId = "a_blank_" + Date.now();
  414. let a = document.createElement("a");
  415. a.setAttribute("href", href);
  416. a.setAttribute("target", "_blank");
  417. a.setAttribute("id", tempId);
  418. a.setAttribute("script", "1");
  419. if (!document.getElementById(tempId)) {
  420. document.body.appendChild(a);
  421. }
  422. a.click();
  423. } else {
  424. _GM_openInTab(href, { active });
  425. }
  426. },
  427. async cbChecker(val, count = 0) {
  428. if (window.cb) {
  429. window.cb(val);
  430. } else {
  431. while (!window.cb && count < 30) {
  432. await functions.sleep(500);
  433. count++;
  434. }
  435. window.cb && window.cb(val);
  436. }
  437. },
  438. //初始化脚本菜单
  439. initMonkeyMenu() {
  440. try {
  441. _GM_registerMenuCommand("脚本设置", () => {
  442. functions.cbChecker({ type: "openSetting" });
  443. });
  444. _GM_registerMenuCommand("仓库地址", () => {
  445. functions.openNewTab(window.const.git);
  446. });
  447. _GM_registerMenuCommand("反馈 & 建议", functions.feedback);
  448. } catch (e2) {
  449. console.error("无法使用Tampermonkey");
  450. }
  451. },
  452. feedback() {
  453. functions.openNewTab(DefaultVal.issue);
  454. },
  455. //检测页面类型
  456. checkPageType(a) {
  457. let l = a || window.location;
  458. let data = { pageType: null, pageData: { id: "", pageNo: null }, username: "" };
  459. if (l.pathname === "/") {
  460. data.pageType = PageType.Home;
  461. } else if (l.pathname === "/changes") {
  462. data.pageType = PageType.Changes;
  463. } else if (l.pathname === "/v2hot") {
  464. data.pageType = PageType.Hot;
  465. } else if (l.pathname === "/recent") {
  466. data.pageType = PageType.Changes;
  467. } else if (l.href.match(/.com\/?tab=/)) {
  468. data.pageType = PageType.Home;
  469. } else if (l.href.match(/.com\/go\//)) {
  470. if (!l.href.includes("/links")) {
  471. data.pageType = PageType.Node;
  472. }
  473. } else if (l.href.match(/.com\/member/)) {
  474. data.pageType = PageType.Member;
  475. data.username = l.pathname.replace("/member/", "").replace("/replies", "").replace("/topics", "");
  476. } else {
  477. let r2 = l.href.match(/.com\/t\/([\d]+)/);
  478. if (r2 && !l.pathname.includes("review") && !l.pathname.includes("info")) {
  479. data.pageType = PageType.Post;
  480. data.pageData.id = r2[1];
  481. if (l.search) {
  482. let pr = l.href.match(/\?p=([\d]+)/);
  483. if (pr)
  484. data.pageData.pageNo = Number(pr[1]);
  485. }
  486. }
  487. }
  488. return data;
  489. },
  490. //通过api获取主题详情
  491. getPostDetailByApi(id) {
  492. return new Promise((resolve) => {
  493. fetch(`${location.origin}/api/topics/show.json?id=${id}`).then(async (r2) => {
  494. if (r2.status === 200) {
  495. let res = await r2.json();
  496. if (res) {
  497. let d2 = res[0];
  498. resolve(d2);
  499. }
  500. }
  501. });
  502. });
  503. },
  504. appendPostContent(res, el) {
  505. let a = document.createElement("a");
  506. a.href = res.href;
  507. a.classList.add("post-content");
  508. let div = document.createElement("div");
  509. div.innerHTML = res.content_rendered;
  510. a.append(div);
  511. el.append(a);
  512. const checkHeight2 = () => {
  513. var _a;
  514. if (div.clientHeight < 300) {
  515. a.classList.add("show-all");
  516. } else {
  517. let showMore = document.createElement("div");
  518. showMore.classList.add("show-more");
  519. showMore.innerHTML = "显示更多/收起";
  520. showMore.onclick = function(e2) {
  521. e2.stopPropagation();
  522. a.classList.toggle("show-all");
  523. };
  524. (_a = a.parentNode) == null ? void 0 : _a.append(showMore);
  525. }
  526. };
  527. checkHeight2();
  528. },
  529. //从本地读取配置
  530. initConfig() {
  531. let configStr = localStorage.getItem("v2ex-config");
  532. let configMap = {};
  533. let configObj = {};
  534. let userName = window.user.username || "default";
  535. if (configStr) {
  536. configMap = JSON.parse(configStr);
  537. configObj = configMap[userName];
  538. if (configObj) {
  539. window.config = functions.deepAssign(window.config, configObj);
  540. }
  541. }
  542. configMap[userName] = window.config;
  543. localStorage.setItem("v2ex-config", JSON.stringify(configMap));
  544. },
  545. deepAssign(...arg) {
  546. let name, options, src, copy;
  547. let length = arguments.length;
  548. let i = 1;
  549. let target = arguments[0] || {};
  550. if (typeof target !== "object") {
  551. target = {};
  552. }
  553. for (; i < length; i++) {
  554. options = arguments[i];
  555. if (options != null) {
  556. for (name in options) {
  557. src = target[name];
  558. copy = options[name];
  559. if (copy && typeof copy == "object") {
  560. target[name] = this.deepAssign(src, copy);
  561. } else if (copy !== void 0) {
  562. target[name] = copy;
  563. }
  564. }
  565. }
  566. }
  567. return target;
  568. },
  569. //生成dom,从html字符串
  570. genDomFromHtmlString(htmlText) {
  571. let bodyText = htmlText.match(/<body[^>]*>([\s\S]+?)<\/body>/g);
  572. let body = document.createElement("html");
  573. body.innerHTML = bodyText[0];
  574. return body;
  575. },
  576. stopEvent(e2) {
  577. e2.preventDefault();
  578. e2.stopPropagation();
  579. }
  580. };
  581. const DefaultPost = {
  582. allReplyUsers: [],
  583. content_rendered: "",
  584. createDate: "",
  585. createDateAgo: "",
  586. lastReplyDate: "",
  587. lastReplyUsername: "",
  588. fr: "",
  589. replyList: [],
  590. topReplyList: [],
  591. nestedReplies: [],
  592. nestedRedundReplies: [],
  593. username: "",
  594. url: "",
  595. href: "",
  596. member: {
  597. avatar: "",
  598. username: ""
  599. },
  600. node: {
  601. title: "",
  602. url: ""
  603. },
  604. headerTemplate: "",
  605. title: "",
  606. id: "",
  607. type: "post",
  608. once: "",
  609. replyCount: 0,
  610. clickCount: 0,
  611. thankCount: 0,
  612. collectCount: 0,
  613. lastReadFloor: 0,
  614. isFavorite: false,
  615. isIgnore: false,
  616. isThanked: false,
  617. isReport: false,
  618. inList: false
  619. };
  620. const getDefaultPost = (val = {}) => {
  621. return Object.assign(functions.clone(DefaultPost), val);
  622. };
  623. const DefaultUser = {
  624. tagPrefix: "--用户标签--",
  625. tags: {},
  626. tagsId: "",
  627. username: "",
  628. avatar: "",
  629. readPrefix: "--已读楼层--",
  630. readNoteItemId: "",
  631. readList: {},
  632. imgurPrefix: "--imgur图片删除hash--",
  633. imgurList: {},
  634. imgurNoteId: "",
  635. configPrefix: "--config--",
  636. configNoteId: ""
  637. };
  638. const DefaultVal = {
  639. pageType: void 0,
  640. pageData: { pageNo: 1 },
  641. targetUserName: "",
  642. currentVersion: 3,
  643. cb: null,
  644. git: "https://github.com/zyronon/V2Next",
  645. shortGit: "zyronon/V2Next",
  646. issue: "https://github.com/zyronon/V2Next/issues",
  647. pcLog: "https://greasyfork.org/zh-CN/scripts/458024/versions",
  648. pcScript: "https://greasyfork.org/zh-CN/scripts/458024",
  649. mobileScript: "https://greasyfork.org/zh-CN/scripts/485356",
  650. homeUrl: "https://v2ex-script.vercel.app/",
  651. hotUrl: "https://v2hotlist.vercel.app/hot/",
  652. imgurProxy: "https://img.noobzone.ru/getimg.php?url="
  653. };
  654. function getDefaultConfig(val = {}) {
  655. return Object.assign({
  656. showToolbar: true,
  657. autoOpenDetail: true,
  658. openTag: false,
  659. //给用户打标签
  660. clickPostItemOpenDetail: true,
  661. closePostDetailBySpace: true,
  662. //点击空白处关闭详情
  663. contentAutoCollapse: true,
  664. //正文超长自动折叠
  665. viewType: "card",
  666. commentDisplayType: CommentDisplayType.FloorInFloorNoCallUser,
  667. newTabOpen: false,
  668. //新标签打开
  669. newTabOpenActive: false,
  670. base64: true,
  671. //base功能
  672. sov2ex: false,
  673. postWidth: "",
  674. showTopReply: true,
  675. topReplyLoveMinCount: 3,
  676. topReplyCount: 5,
  677. autoJumpLastReadFloor: false,
  678. rememberLastReadFloor: false,
  679. autoSignin: true,
  680. customBgColor: "",
  681. version: DefaultVal.currentVersion,
  682. collectBrowserNotice: false,
  683. fontSizeType: "normal",
  684. notice: {
  685. uid: "",
  686. text: "",
  687. ddWebhook: "",
  688. takeOverNoticePage: true,
  689. whenNewNoticeGlimmer: false,
  690. loopCheckNotice: false,
  691. loopCheckNoticeInterval: 5
  692. },
  693. replaceImgur: false,
  694. maxReplyCountLimit: 400
  695. }, val);
  696. }
  697. const emojiEmoticons = [
  698. {
  699. title: "常用",
  700. list: [
  701. "😅",
  702. "😭",
  703. "😂",
  704. "🥰",
  705. "😰",
  706. "🤡",
  707. "👀",
  708. "🐴",
  709. "🐶",
  710. "❓",
  711. "❤️",
  712. "💔",
  713. "⭐",
  714. "🔥",
  715. "💩",
  716. "🔞",
  717. "⚠️",
  718. "🎁",
  719. "🎉"
  720. ]
  721. },
  722. {
  723. title: "小黄脸",
  724. list: [
  725. "😀",
  726. "😁",
  727. "😂",
  728. "🤣",
  729. "😅",
  730. "😊",
  731. "😋",
  732. "😘",
  733. "🥰",
  734. "😗",
  735. "🤩",
  736. "🤔",
  737. "🤨",
  738. "😐",
  739. "😑",
  740. "🙄",
  741. "😏",
  742. "😪",
  743. "😫",
  744. "🥱",
  745. "😜",
  746. "😒",
  747. "😔",
  748. "😨",
  749. "😰",
  750. "😱",
  751. "🥵",
  752. "😡",
  753. "🥳",
  754. "🥺",
  755. "🤭",
  756. "🧐",
  757. "😎",
  758. "🤓",
  759. "😭",
  760. "🤑",
  761. "🤮"
  762. ]
  763. },
  764. {
  765. title: "手势",
  766. list: [
  767. "🤏",
  768. "👉",
  769. "✌️",
  770. "👌",
  771. "👍",
  772. "👎",
  773. "🤝",
  774. "🙏",
  775. "👏"
  776. ]
  777. },
  778. {
  779. title: "其他",
  780. list: ["🔞", "👻", "🤡", "🐔", "👀", "💩", "🐴", "🦄", "🐧", "🐶"]
  781. }
  782. ];
  783. const classicsEmoticons = [
  784. {
  785. name: "[狗头]",
  786. low: "https://i.imgur.com/io2SM1h.png",
  787. high: "https://i.imgur.com/0icl60r.png"
  788. },
  789. {
  790. name: "[doge]",
  791. low: "https://i.imgur.com/duWRpIu.png",
  792. high: "https://i.imgur.com/HyphI6d.png"
  793. },
  794. {
  795. name: "[受虐滑稽]",
  796. low: "https://i.imgur.com/Iy0taMy.png",
  797. high: "https://i.imgur.com/PS1pxd9.png"
  798. },
  799. {
  800. name: "[马]",
  801. low: "https://i.imgur.com/8EKZv7I.png",
  802. high: "https://i.imgur.com/ANFUX52.png"
  803. },
  804. {
  805. name: "[二哈]",
  806. low: "https://i.imgur.com/XKj1Tkx.png",
  807. high: "https://i.imgur.com/dOeP4XD.png"
  808. },
  809. {
  810. name: "[舔屏]",
  811. low: "https://i.imgur.com/Cvl7dyN.png",
  812. high: "https://i.imgur.com/LmETy9N.png"
  813. },
  814. {
  815. name: "[辣眼睛]",
  816. low: "https://i.imgur.com/cPNPYD5.png",
  817. high: "https://i.imgur.com/3fSUmi8.png"
  818. },
  819. {
  820. name: "[吃瓜]",
  821. low: "https://i.imgur.com/ee8Lq7H.png",
  822. high: "https://i.imgur.com/0L26og9.png"
  823. },
  824. {
  825. name: "[不高兴]",
  826. low: "https://i.imgur.com/huX6coX.png",
  827. high: "https://i.imgur.com/N7JEuvc.png"
  828. },
  829. // {
  830. // name: '[呵呵]',
  831. // low: 'https://i.imgur.com/RvoLAbX.png',
  832. // high: 'https://i.imgur.com/xSzIqrK.png'
  833. // },
  834. {
  835. name: "[真棒]",
  836. low: "https://i.imgur.com/xr1UOz1.png",
  837. high: "https://i.imgur.com/w8YEw9Q.png"
  838. },
  839. {
  840. name: "[鄙视]",
  841. low: "https://i.imgur.com/u6jlqVq.png",
  842. high: "https://i.imgur.com/8JFNANq.png"
  843. },
  844. {
  845. name: "[疑问]",
  846. low: "https://i.imgur.com/F29pmQ6.png",
  847. high: "https://i.imgur.com/EbbTQAR.png"
  848. },
  849. {
  850. name: "[吐舌]",
  851. low: "https://i.imgur.com/InmIzl9.png",
  852. high: "https://i.imgur.com/Ovj56Cd.png"
  853. },
  854. // {
  855. // name: '[嘲笑]',
  856. // low: 'https://i.imgur.com/BaWcsMR.png',
  857. // high: 'https://i.imgur.com/0OGfJw4.png'
  858. // },
  859. // {
  860. // name: '[滑稽]',
  861. // low: 'https://i.imgur.com/lmbN0yI.png',
  862. // high: 'https://i.imgur.com/Pc0wH85.png'
  863. // },
  864. {
  865. name: "[笑眼]",
  866. low: "https://i.imgur.com/ZveiiGy.png",
  867. high: "https://i.imgur.com/PI1CfEr.png"
  868. },
  869. // {
  870. // name: '[狂汗]',
  871. // low: 'https://i.imgur.com/veWihk6.png',
  872. // high: 'https://i.imgur.com/3LtHdQv.png'
  873. // },
  874. {
  875. name: "[大哭]",
  876. low: "https://i.imgur.com/hu4oR6C.png",
  877. high: "https://i.imgur.com/b4X9XLE.png"
  878. },
  879. {
  880. name: "[喷]",
  881. low: "https://i.imgur.com/bkw3VRr.png",
  882. high: "https://i.imgur.com/wnZL13L.png"
  883. },
  884. {
  885. name: "[苦笑]",
  886. low: "https://i.imgur.com/VUWFktU.png",
  887. high: "https://i.imgur.com/NAfspZ1.png"
  888. },
  889. {
  890. name: "[喝酒]",
  891. low: "https://i.imgur.com/2ZZSapE.png",
  892. high: "https://i.imgur.com/rVbSVak.png"
  893. },
  894. {
  895. name: "[捂脸]",
  896. low: "https://i.imgur.com/krir4IG.png",
  897. high: "https://i.imgur.com/qqBqgVm.png"
  898. },
  899. // {
  900. // name: '[呕]',
  901. // low: 'https://i.imgur.com/6CUiUxv.png',
  902. // high: 'https://i.imgur.com/kgdxRsG.png'
  903. // },
  904. {
  905. name: "[阴险]",
  906. low: "https://i.imgur.com/MA8YqTP.png",
  907. high: "https://i.imgur.com/e94jbaT.png"
  908. },
  909. {
  910. name: "[怒]",
  911. low: "https://i.imgur.com/n4kWfGB.png",
  912. high: "https://i.imgur.com/iMXxNxh.png"
  913. }
  914. // {
  915. // name: '[衰]',
  916. // low: 'https://i.imgur.com/voHFDyQ.png',
  917. // high: 'https://i.imgur.com/XffE6gu.png'
  918. // },
  919. // {
  920. // name: '[合十]',
  921. // low: 'https://i.imgur.com/I8x3ang.png',
  922. // high: 'https://i.imgur.com/T4rJVee.png'
  923. // },
  924. // {
  925. // name: '[赞]',
  926. // low: 'https://i.imgur.com/lG44yUl.png',
  927. // high: 'https://i.imgur.com/AoF5PLp.png'
  928. // },
  929. // {
  930. // name: '[踩]',
  931. // low: 'https://i.imgur.com/cJp0uKZ.png',
  932. // high: 'https://i.imgur.com/1XYGfXj.png'
  933. // },
  934. // {
  935. // name: '[爱心]',
  936. // low: 'https://i.imgur.com/sLENaF5.png',
  937. // high: 'https://i.imgur.com/dND56oX.png'
  938. // },
  939. //
  940. // {
  941. // name: '[心碎]',
  942. // low: 'https://i.imgur.com/AZxJzve.png',
  943. // high: 'https://i.imgur.com/RiUsPci.png'
  944. // },
  945. ];
  946. const matchIconName = /^[a-z0-9]+(-[a-z0-9]+)*$/;
  947. const stringToIcon = (value, validate, allowSimpleName, provider = "") => {
  948. const colonSeparated = value.split(":");
  949. if (value.slice(0, 1) === "@") {
  950. if (colonSeparated.length < 2 || colonSeparated.length > 3) {
  951. return null;
  952. }
  953. provider = colonSeparated.shift().slice(1);
  954. }
  955. if (colonSeparated.length > 3 || !colonSeparated.length) {
  956. return null;
  957. }
  958. if (colonSeparated.length > 1) {
  959. const name2 = colonSeparated.pop();
  960. const prefix = colonSeparated.pop();
  961. const result = {
  962. // Allow provider without '@': "provider:prefix:name"
  963. provider: colonSeparated.length > 0 ? colonSeparated[0] : provider,
  964. prefix,
  965. name: name2
  966. };
  967. return validate && !validateIconName(result) ? null : result;
  968. }
  969. const name = colonSeparated[0];
  970. const dashSeparated = name.split("-");
  971. if (dashSeparated.length > 1) {
  972. const result = {
  973. provider,
  974. prefix: dashSeparated.shift(),
  975. name: dashSeparated.join("-")
  976. };
  977. return validate && !validateIconName(result) ? null : result;
  978. }
  979. if (allowSimpleName && provider === "") {
  980. const result = {
  981. provider,
  982. prefix: "",
  983. name
  984. };
  985. return validate && !validateIconName(result, allowSimpleName) ? null : result;
  986. }
  987. return null;
  988. };
  989. const validateIconName = (icon, allowSimpleName) => {
  990. if (!icon) {
  991. return false;
  992. }
  993. return !!((icon.provider === "" || icon.provider.match(matchIconName)) && (allowSimpleName && icon.prefix === "" || icon.prefix.match(matchIconName)) && icon.name.match(matchIconName));
  994. };
  995. const defaultIconDimensions = Object.freeze(
  996. {
  997. left: 0,
  998. top: 0,
  999. width: 16,
  1000. height: 16
  1001. }
  1002. );
  1003. const defaultIconTransformations = Object.freeze({
  1004. rotate: 0,
  1005. vFlip: false,
  1006. hFlip: false
  1007. });
  1008. const defaultIconProps = Object.freeze({
  1009. ...defaultIconDimensions,
  1010. ...defaultIconTransformations
  1011. });
  1012. const defaultExtendedIconProps = Object.freeze({
  1013. ...defaultIconProps,
  1014. body: "",
  1015. hidden: false
  1016. });
  1017. function mergeIconTransformations(obj1, obj2) {
  1018. const result = {};
  1019. if (!obj1.hFlip !== !obj2.hFlip) {
  1020. result.hFlip = true;
  1021. }
  1022. if (!obj1.vFlip !== !obj2.vFlip) {
  1023. result.vFlip = true;
  1024. }
  1025. const rotate = ((obj1.rotate || 0) + (obj2.rotate || 0)) % 4;
  1026. if (rotate) {
  1027. result.rotate = rotate;
  1028. }
  1029. return result;
  1030. }
  1031. function mergeIconData(parent, child) {
  1032. const result = mergeIconTransformations(parent, child);
  1033. for (const key in defaultExtendedIconProps) {
  1034. if (key in defaultIconTransformations) {
  1035. if (key in parent && !(key in result)) {
  1036. result[key] = defaultIconTransformations[key];
  1037. }
  1038. } else if (key in child) {
  1039. result[key] = child[key];
  1040. } else if (key in parent) {
  1041. result[key] = parent[key];
  1042. }
  1043. }
  1044. return result;
  1045. }
  1046. function getIconsTree(data, names) {
  1047. const icons = data.icons;
  1048. const aliases = data.aliases || /* @__PURE__ */ Object.create(null);
  1049. const resolved = /* @__PURE__ */ Object.create(null);
  1050. function resolve(name) {
  1051. if (icons[name]) {
  1052. return resolved[name] = [];
  1053. }
  1054. if (!(name in resolved)) {
  1055. resolved[name] = null;
  1056. const parent = aliases[name] && aliases[name].parent;
  1057. const value = parent && resolve(parent);
  1058. if (value) {
  1059. resolved[name] = [parent].concat(value);
  1060. }
  1061. }
  1062. return resolved[name];
  1063. }
  1064. (names || Object.keys(icons).concat(Object.keys(aliases))).forEach(resolve);
  1065. return resolved;
  1066. }
  1067. function internalGetIconData(data, name, tree) {
  1068. const icons = data.icons;
  1069. const aliases = data.aliases || /* @__PURE__ */ Object.create(null);
  1070. let currentProps = {};
  1071. function parse(name2) {
  1072. currentProps = mergeIconData(
  1073. icons[name2] || aliases[name2],
  1074. currentProps
  1075. );
  1076. }
  1077. parse(name);
  1078. tree.forEach(parse);
  1079. return mergeIconData(data, currentProps);
  1080. }
  1081. function parseIconSet(data, callback) {
  1082. const names = [];
  1083. if (typeof data !== "object" || typeof data.icons !== "object") {
  1084. return names;
  1085. }
  1086. if (data.not_found instanceof Array) {
  1087. data.not_found.forEach((name) => {
  1088. callback(name, null);
  1089. names.push(name);
  1090. });
  1091. }
  1092. const tree = getIconsTree(data);
  1093. for (const name in tree) {
  1094. const item = tree[name];
  1095. if (item) {
  1096. callback(name, internalGetIconData(data, name, item));
  1097. names.push(name);
  1098. }
  1099. }
  1100. return names;
  1101. }
  1102. const optionalPropertyDefaults = {
  1103. provider: "",
  1104. aliases: {},
  1105. not_found: {},
  1106. ...defaultIconDimensions
  1107. };
  1108. function checkOptionalProps(item, defaults) {
  1109. for (const prop in defaults) {
  1110. if (prop in item && typeof item[prop] !== typeof defaults[prop]) {
  1111. return false;
  1112. }
  1113. }
  1114. return true;
  1115. }
  1116. function quicklyValidateIconSet(obj) {
  1117. if (typeof obj !== "object" || obj === null) {
  1118. return null;
  1119. }
  1120. const data = obj;
  1121. if (typeof data.prefix !== "string" || !obj.icons || typeof obj.icons !== "object") {
  1122. return null;
  1123. }
  1124. if (!checkOptionalProps(obj, optionalPropertyDefaults)) {
  1125. return null;
  1126. }
  1127. const icons = data.icons;
  1128. for (const name in icons) {
  1129. const icon = icons[name];
  1130. if (!name.match(matchIconName) || typeof icon.body !== "string" || !checkOptionalProps(
  1131. icon,
  1132. defaultExtendedIconProps
  1133. )) {
  1134. return null;
  1135. }
  1136. }
  1137. const aliases = data.aliases || /* @__PURE__ */ Object.create(null);
  1138. for (const name in aliases) {
  1139. const icon = aliases[name];
  1140. const parent = icon.parent;
  1141. if (!name.match(matchIconName) || typeof parent !== "string" || !icons[parent] && !aliases[parent] || !checkOptionalProps(
  1142. icon,
  1143. defaultExtendedIconProps
  1144. )) {
  1145. return null;
  1146. }
  1147. }
  1148. return data;
  1149. }
  1150. const dataStorage = /* @__PURE__ */ Object.create(null);
  1151. function newStorage(provider, prefix) {
  1152. return {
  1153. provider,
  1154. prefix,
  1155. icons: /* @__PURE__ */ Object.create(null),
  1156. missing: /* @__PURE__ */ new Set()
  1157. };
  1158. }
  1159. function getStorage(provider, prefix) {
  1160. const providerStorage = dataStorage[provider] || (dataStorage[provider] = /* @__PURE__ */ Object.create(null));
  1161. return providerStorage[prefix] || (providerStorage[prefix] = newStorage(provider, prefix));
  1162. }
  1163. function addIconSet(storage2, data) {
  1164. if (!quicklyValidateIconSet(data)) {
  1165. return [];
  1166. }
  1167. return parseIconSet(data, (name, icon) => {
  1168. if (icon) {
  1169. storage2.icons[name] = icon;
  1170. } else {
  1171. storage2.missing.add(name);
  1172. }
  1173. });
  1174. }
  1175. function addIconToStorage(storage2, name, icon) {
  1176. try {
  1177. if (typeof icon.body === "string") {
  1178. storage2.icons[name] = { ...icon };
  1179. return true;
  1180. }
  1181. } catch (err) {
  1182. }
  1183. return false;
  1184. }
  1185. let simpleNames = false;
  1186. function allowSimpleNames(allow) {
  1187. if (typeof allow === "boolean") {
  1188. simpleNames = allow;
  1189. }
  1190. return simpleNames;
  1191. }
  1192. function getIconData(name) {
  1193. const icon = typeof name === "string" ? stringToIcon(name, true, simpleNames) : name;
  1194. if (icon) {
  1195. const storage2 = getStorage(icon.provider, icon.prefix);
  1196. const iconName = icon.name;
  1197. return storage2.icons[iconName] || (storage2.missing.has(iconName) ? null : void 0);
  1198. }
  1199. }
  1200. function addIcon(name, data) {
  1201. const icon = stringToIcon(name, true, simpleNames);
  1202. if (!icon) {
  1203. return false;
  1204. }
  1205. const storage2 = getStorage(icon.provider, icon.prefix);
  1206. return addIconToStorage(storage2, icon.name, data);
  1207. }
  1208. function addCollection(data, provider) {
  1209. if (typeof data !== "object") {
  1210. return false;
  1211. }
  1212. if (typeof provider !== "string") {
  1213. provider = data.provider || "";
  1214. }
  1215. if (simpleNames && !provider && !data.prefix) {
  1216. let added = false;
  1217. if (quicklyValidateIconSet(data)) {
  1218. data.prefix = "";
  1219. parseIconSet(data, (name, icon) => {
  1220. if (icon && addIcon(name, icon)) {
  1221. added = true;
  1222. }
  1223. });
  1224. }
  1225. return added;
  1226. }
  1227. const prefix = data.prefix;
  1228. if (!validateIconName({
  1229. provider,
  1230. prefix,
  1231. name: "a"
  1232. })) {
  1233. return false;
  1234. }
  1235. const storage2 = getStorage(provider, prefix);
  1236. return !!addIconSet(storage2, data);
  1237. }
  1238. const defaultIconSizeCustomisations = Object.freeze({
  1239. width: null,
  1240. height: null
  1241. });
  1242. const defaultIconCustomisations = Object.freeze({
  1243. // Dimensions
  1244. ...defaultIconSizeCustomisations,
  1245. // Transformations
  1246. ...defaultIconTransformations
  1247. });
  1248. const unitsSplit = /(-?[0-9.]*[0-9]+[0-9.]*)/g;
  1249. const unitsTest = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
  1250. function calculateSize(size, ratio, precision) {
  1251. if (ratio === 1) {
  1252. return size;
  1253. }
  1254. precision = precision || 100;
  1255. if (typeof size === "number") {
  1256. return Math.ceil(size * ratio * precision) / precision;
  1257. }
  1258. if (typeof size !== "string") {
  1259. return size;
  1260. }
  1261. const oldParts = size.split(unitsSplit);
  1262. if (oldParts === null || !oldParts.length) {
  1263. return size;
  1264. }
  1265. const newParts = [];
  1266. let code = oldParts.shift();
  1267. let isNumber = unitsTest.test(code);
  1268. while (true) {
  1269. if (isNumber) {
  1270. const num = parseFloat(code);
  1271. if (isNaN(num)) {
  1272. newParts.push(code);
  1273. } else {
  1274. newParts.push(Math.ceil(num * ratio * precision) / precision);
  1275. }
  1276. } else {
  1277. newParts.push(code);
  1278. }
  1279. code = oldParts.shift();
  1280. if (code === void 0) {
  1281. return newParts.join("");
  1282. }
  1283. isNumber = !isNumber;
  1284. }
  1285. }
  1286. const isUnsetKeyword = (value) => value === "unset" || value === "undefined" || value === "none";
  1287. function iconToSVG(icon, customisations) {
  1288. const fullIcon = {
  1289. ...defaultIconProps,
  1290. ...icon
  1291. };
  1292. const fullCustomisations = {
  1293. ...defaultIconCustomisations,
  1294. ...customisations
  1295. };
  1296. const box = {
  1297. left: fullIcon.left,
  1298. top: fullIcon.top,
  1299. width: fullIcon.width,
  1300. height: fullIcon.height
  1301. };
  1302. let body = fullIcon.body;
  1303. [fullIcon, fullCustomisations].forEach((props) => {
  1304. const transformations = [];
  1305. const hFlip = props.hFlip;
  1306. const vFlip = props.vFlip;
  1307. let rotation = props.rotate;
  1308. if (hFlip) {
  1309. if (vFlip) {
  1310. rotation += 2;
  1311. } else {
  1312. transformations.push(
  1313. "translate(" + (box.width + box.left).toString() + " " + (0 - box.top).toString() + ")"
  1314. );
  1315. transformations.push("scale(-1 1)");
  1316. box.top = box.left = 0;
  1317. }
  1318. } else if (vFlip) {
  1319. transformations.push(
  1320. "translate(" + (0 - box.left).toString() + " " + (box.height + box.top).toString() + ")"
  1321. );
  1322. transformations.push("scale(1 -1)");
  1323. box.top = box.left = 0;
  1324. }
  1325. let tempValue;
  1326. if (rotation < 0) {
  1327. rotation -= Math.floor(rotation / 4) * 4;
  1328. }
  1329. rotation = rotation % 4;
  1330. switch (rotation) {
  1331. case 1:
  1332. tempValue = box.height / 2 + box.top;
  1333. transformations.unshift(
  1334. "rotate(90 " + tempValue.toString() + " " + tempValue.toString() + ")"
  1335. );
  1336. break;
  1337. case 2:
  1338. transformations.unshift(
  1339. "rotate(180 " + (box.width / 2 + box.left).toString() + " " + (box.height / 2 + box.top).toString() + ")"
  1340. );
  1341. break;
  1342. case 3:
  1343. tempValue = box.width / 2 + box.left;
  1344. transformations.unshift(
  1345. "rotate(-90 " + tempValue.toString() + " " + tempValue.toString() + ")"
  1346. );
  1347. break;
  1348. }
  1349. if (rotation % 2 === 1) {
  1350. if (box.left !== box.top) {
  1351. tempValue = box.left;
  1352. box.left = box.top;
  1353. box.top = tempValue;
  1354. }
  1355. if (box.width !== box.height) {
  1356. tempValue = box.width;
  1357. box.width = box.height;
  1358. box.height = tempValue;
  1359. }
  1360. }
  1361. if (transformations.length) {
  1362. body = '<g transform="' + transformations.join(" ") + '">' + body + "</g>";
  1363. }
  1364. });
  1365. const customisationsWidth = fullCustomisations.width;
  1366. const customisationsHeight = fullCustomisations.height;
  1367. const boxWidth = box.width;
  1368. const boxHeight = box.height;
  1369. let width;
  1370. let height;
  1371. if (customisationsWidth === null) {
  1372. height = customisationsHeight === null ? "1em" : customisationsHeight === "auto" ? boxHeight : customisationsHeight;
  1373. width = calculateSize(height, boxWidth / boxHeight);
  1374. } else {
  1375. width = customisationsWidth === "auto" ? boxWidth : customisationsWidth;
  1376. height = customisationsHeight === null ? calculateSize(width, boxHeight / boxWidth) : customisationsHeight === "auto" ? boxHeight : customisationsHeight;
  1377. }
  1378. const attributes = {};
  1379. const setAttr = (prop, value) => {
  1380. if (!isUnsetKeyword(value)) {
  1381. attributes[prop] = value.toString();
  1382. }
  1383. };
  1384. setAttr("width", width);
  1385. setAttr("height", height);
  1386. attributes.viewBox = box.left.toString() + " " + box.top.toString() + " " + boxWidth.toString() + " " + boxHeight.toString();
  1387. return {
  1388. attributes,
  1389. body
  1390. };
  1391. }
  1392. const regex = /\sid="(\S+)"/g;
  1393. const randomPrefix = "IconifyId" + Date.now().toString(16) + (Math.random() * 16777216 | 0).toString(16);
  1394. let counter = 0;
  1395. function replaceIDs(body, prefix = randomPrefix) {
  1396. const ids = [];
  1397. let match;
  1398. while (match = regex.exec(body)) {
  1399. ids.push(match[1]);
  1400. }
  1401. if (!ids.length) {
  1402. return body;
  1403. }
  1404. const suffix = "suffix" + (Math.random() * 16777216 | Date.now()).toString(16);
  1405. ids.forEach((id) => {
  1406. const newID = typeof prefix === "function" ? prefix(id) : prefix + (counter++).toString();
  1407. const escapedID = id.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
  1408. body = body.replace(
  1409. // Allowed characters before id: [#;"]
  1410. // Allowed characters after id: [)"], .[a-z]
  1411. new RegExp('([#;"])(' + escapedID + ')([")]|\\.[a-z])', "g"),
  1412. "$1" + newID + suffix + "$3"
  1413. );
  1414. });
  1415. body = body.replace(new RegExp(suffix, "g"), "");
  1416. return body;
  1417. }
  1418. const storage = /* @__PURE__ */ Object.create(null);
  1419. function setAPIModule(provider, item) {
  1420. storage[provider] = item;
  1421. }
  1422. function getAPIModule(provider) {
  1423. return storage[provider] || storage[""];
  1424. }
  1425. function createAPIConfig(source) {
  1426. let resources;
  1427. if (typeof source.resources === "string") {
  1428. resources = [source.resources];
  1429. } else {
  1430. resources = source.resources;
  1431. if (!(resources instanceof Array) || !resources.length) {
  1432. return null;
  1433. }
  1434. }
  1435. const result = {
  1436. // API hosts
  1437. resources,
  1438. // Root path
  1439. path: source.path || "/",
  1440. // URL length limit
  1441. maxURL: source.maxURL || 500,
  1442. // Timeout before next host is used.
  1443. rotate: source.rotate || 750,
  1444. // Timeout before failing query.
  1445. timeout: source.timeout || 5e3,
  1446. // Randomise default API end point.
  1447. random: source.random === true,
  1448. // Start index
  1449. index: source.index || 0,
  1450. // Receive data after time out (used if time out kicks in first, then API module sends data anyway).
  1451. dataAfterTimeout: source.dataAfterTimeout !== false
  1452. };
  1453. return result;
  1454. }
  1455. const configStorage = /* @__PURE__ */ Object.create(null);
  1456. const fallBackAPISources = [
  1457. "https://api.simplesvg.com",
  1458. "https://api.unisvg.com"
  1459. ];
  1460. const fallBackAPI = [];
  1461. while (fallBackAPISources.length > 0) {
  1462. if (fallBackAPISources.length === 1) {
  1463. fallBackAPI.push(fallBackAPISources.shift());
  1464. } else {
  1465. if (Math.random() > 0.5) {
  1466. fallBackAPI.push(fallBackAPISources.shift());
  1467. } else {
  1468. fallBackAPI.push(fallBackAPISources.pop());
  1469. }
  1470. }
  1471. }
  1472. configStorage[""] = createAPIConfig({
  1473. resources: ["https://api.iconify.design"].concat(fallBackAPI)
  1474. });
  1475. function addAPIProvider(provider, customConfig) {
  1476. const config2 = createAPIConfig(customConfig);
  1477. if (config2 === null) {
  1478. return false;
  1479. }
  1480. configStorage[provider] = config2;
  1481. return true;
  1482. }
  1483. function getAPIConfig(provider) {
  1484. return configStorage[provider];
  1485. }
  1486. const detectFetch = () => {
  1487. let callback;
  1488. try {
  1489. callback = fetch;
  1490. if (typeof callback === "function") {
  1491. return callback;
  1492. }
  1493. } catch (err) {
  1494. }
  1495. };
  1496. let fetchModule = detectFetch();
  1497. function calculateMaxLength(provider, prefix) {
  1498. const config2 = getAPIConfig(provider);
  1499. if (!config2) {
  1500. return 0;
  1501. }
  1502. let result;
  1503. if (!config2.maxURL) {
  1504. result = 0;
  1505. } else {
  1506. let maxHostLength = 0;
  1507. config2.resources.forEach((item) => {
  1508. const host = item;
  1509. maxHostLength = Math.max(maxHostLength, host.length);
  1510. });
  1511. const url = prefix + ".json?icons=";
  1512. result = config2.maxURL - maxHostLength - config2.path.length - url.length;
  1513. }
  1514. return result;
  1515. }
  1516. function shouldAbort(status) {
  1517. return status === 404;
  1518. }
  1519. const prepare = (provider, prefix, icons) => {
  1520. const results = [];
  1521. const maxLength = calculateMaxLength(provider, prefix);
  1522. const type = "icons";
  1523. let item = {
  1524. type,
  1525. provider,
  1526. prefix,
  1527. icons: []
  1528. };
  1529. let length = 0;
  1530. icons.forEach((name, index) => {
  1531. length += name.length + 1;
  1532. if (length >= maxLength && index > 0) {
  1533. results.push(item);
  1534. item = {
  1535. type,
  1536. provider,
  1537. prefix,
  1538. icons: []
  1539. };
  1540. length = name.length;
  1541. }
  1542. item.icons.push(name);
  1543. });
  1544. results.push(item);
  1545. return results;
  1546. };
  1547. function getPath(provider) {
  1548. if (typeof provider === "string") {
  1549. const config2 = getAPIConfig(provider);
  1550. if (config2) {
  1551. return config2.path;
  1552. }
  1553. }
  1554. return "/";
  1555. }
  1556. const send = (host, params, callback) => {
  1557. if (!fetchModule) {
  1558. callback("abort", 424);
  1559. return;
  1560. }
  1561. let path = getPath(params.provider);
  1562. switch (params.type) {
  1563. case "icons": {
  1564. const prefix = params.prefix;
  1565. const icons = params.icons;
  1566. const iconsList = icons.join(",");
  1567. const urlParams = new URLSearchParams({
  1568. icons: iconsList
  1569. });
  1570. path += prefix + ".json?" + urlParams.toString();
  1571. break;
  1572. }
  1573. case "custom": {
  1574. const uri = params.uri;
  1575. path += uri.slice(0, 1) === "/" ? uri.slice(1) : uri;
  1576. break;
  1577. }
  1578. default:
  1579. callback("abort", 400);
  1580. return;
  1581. }
  1582. let defaultError = 503;
  1583. fetchModule(host + path).then((response) => {
  1584. const status = response.status;
  1585. if (status !== 200) {
  1586. setTimeout(() => {
  1587. callback(shouldAbort(status) ? "abort" : "next", status);
  1588. });
  1589. return;
  1590. }
  1591. defaultError = 501;
  1592. return response.json();
  1593. }).then((data) => {
  1594. if (typeof data !== "object" || data === null) {
  1595. setTimeout(() => {
  1596. if (data === 404) {
  1597. callback("abort", data);
  1598. } else {
  1599. callback("next", defaultError);
  1600. }
  1601. });
  1602. return;
  1603. }
  1604. setTimeout(() => {
  1605. callback("success", data);
  1606. });
  1607. }).catch(() => {
  1608. callback("next", defaultError);
  1609. });
  1610. };
  1611. const fetchAPIModule = {
  1612. prepare,
  1613. send
  1614. };
  1615. function sortIcons(icons) {
  1616. const result = {
  1617. loaded: [],
  1618. missing: [],
  1619. pending: []
  1620. };
  1621. const storage2 = /* @__PURE__ */ Object.create(null);
  1622. icons.sort((a, b) => {
  1623. if (a.provider !== b.provider) {
  1624. return a.provider.localeCompare(b.provider);
  1625. }
  1626. if (a.prefix !== b.prefix) {
  1627. return a.prefix.localeCompare(b.prefix);
  1628. }
  1629. return a.name.localeCompare(b.name);
  1630. });
  1631. let lastIcon = {
  1632. provider: "",
  1633. prefix: "",
  1634. name: ""
  1635. };
  1636. icons.forEach((icon) => {
  1637. if (lastIcon.name === icon.name && lastIcon.prefix === icon.prefix && lastIcon.provider === icon.provider) {
  1638. return;
  1639. }
  1640. lastIcon = icon;
  1641. const provider = icon.provider;
  1642. const prefix = icon.prefix;
  1643. const name = icon.name;
  1644. const providerStorage = storage2[provider] || (storage2[provider] = /* @__PURE__ */ Object.create(null));
  1645. const localStorage2 = providerStorage[prefix] || (providerStorage[prefix] = getStorage(provider, prefix));
  1646. let list;
  1647. if (name in localStorage2.icons) {
  1648. list = result.loaded;
  1649. } else if (prefix === "" || localStorage2.missing.has(name)) {
  1650. list = result.missing;
  1651. } else {
  1652. list = result.pending;
  1653. }
  1654. const item = {
  1655. provider,
  1656. prefix,
  1657. name
  1658. };
  1659. list.push(item);
  1660. });
  1661. return result;
  1662. }
  1663. function removeCallback(storages, id) {
  1664. storages.forEach((storage2) => {
  1665. const items = storage2.loaderCallbacks;
  1666. if (items) {
  1667. storage2.loaderCallbacks = items.filter((row) => row.id !== id);
  1668. }
  1669. });
  1670. }
  1671. function updateCallbacks(storage2) {
  1672. if (!storage2.pendingCallbacksFlag) {
  1673. storage2.pendingCallbacksFlag = true;
  1674. setTimeout(() => {
  1675. storage2.pendingCallbacksFlag = false;
  1676. const items = storage2.loaderCallbacks ? storage2.loaderCallbacks.slice(0) : [];
  1677. if (!items.length) {
  1678. return;
  1679. }
  1680. let hasPending = false;
  1681. const provider = storage2.provider;
  1682. const prefix = storage2.prefix;
  1683. items.forEach((item) => {
  1684. const icons = item.icons;
  1685. const oldLength = icons.pending.length;
  1686. icons.pending = icons.pending.filter((icon) => {
  1687. if (icon.prefix !== prefix) {
  1688. return true;
  1689. }
  1690. const name = icon.name;
  1691. if (storage2.icons[name]) {
  1692. icons.loaded.push({
  1693. provider,
  1694. prefix,
  1695. name
  1696. });
  1697. } else if (storage2.missing.has(name)) {
  1698. icons.missing.push({
  1699. provider,
  1700. prefix,
  1701. name
  1702. });
  1703. } else {
  1704. hasPending = true;
  1705. return true;
  1706. }
  1707. return false;
  1708. });
  1709. if (icons.pending.length !== oldLength) {
  1710. if (!hasPending) {
  1711. removeCallback([storage2], item.id);
  1712. }
  1713. item.callback(
  1714. icons.loaded.slice(0),
  1715. icons.missing.slice(0),
  1716. icons.pending.slice(0),
  1717. item.abort
  1718. );
  1719. }
  1720. });
  1721. });
  1722. }
  1723. }
  1724. let idCounter = 0;
  1725. function storeCallback(callback, icons, pendingSources) {
  1726. const id = idCounter++;
  1727. const abort = removeCallback.bind(null, pendingSources, id);
  1728. if (!icons.pending.length) {
  1729. return abort;
  1730. }
  1731. const item = {
  1732. id,
  1733. icons,
  1734. callback,
  1735. abort
  1736. };
  1737. pendingSources.forEach((storage2) => {
  1738. (storage2.loaderCallbacks || (storage2.loaderCallbacks = [])).push(item);
  1739. });
  1740. return abort;
  1741. }
  1742. function listToIcons(list, validate = true, simpleNames2 = false) {
  1743. const result = [];
  1744. list.forEach((item) => {
  1745. const icon = typeof item === "string" ? stringToIcon(item, validate, simpleNames2) : item;
  1746. if (icon) {
  1747. result.push(icon);
  1748. }
  1749. });
  1750. return result;
  1751. }
  1752. var defaultConfig = {
  1753. resources: [],
  1754. index: 0,
  1755. timeout: 2e3,
  1756. rotate: 750,
  1757. random: false,
  1758. dataAfterTimeout: false
  1759. };
  1760. function sendQuery(config2, payload, query, done) {
  1761. const resourcesCount = config2.resources.length;
  1762. const startIndex = config2.random ? Math.floor(Math.random() * resourcesCount) : config2.index;
  1763. let resources;
  1764. if (config2.random) {
  1765. let list = config2.resources.slice(0);
  1766. resources = [];
  1767. while (list.length > 1) {
  1768. const nextIndex = Math.floor(Math.random() * list.length);
  1769. resources.push(list[nextIndex]);
  1770. list = list.slice(0, nextIndex).concat(list.slice(nextIndex + 1));
  1771. }
  1772. resources = resources.concat(list);
  1773. } else {
  1774. resources = config2.resources.slice(startIndex).concat(config2.resources.slice(0, startIndex));
  1775. }
  1776. const startTime = Date.now();
  1777. let status = "pending";
  1778. let queriesSent = 0;
  1779. let lastError;
  1780. let timer = null;
  1781. let queue = [];
  1782. let doneCallbacks = [];
  1783. if (typeof done === "function") {
  1784. doneCallbacks.push(done);
  1785. }
  1786. function resetTimer() {
  1787. if (timer) {
  1788. clearTimeout(timer);
  1789. timer = null;
  1790. }
  1791. }
  1792. function abort() {
  1793. if (status === "pending") {
  1794. status = "aborted";
  1795. }
  1796. resetTimer();
  1797. queue.forEach((item) => {
  1798. if (item.status === "pending") {
  1799. item.status = "aborted";
  1800. }
  1801. });
  1802. queue = [];
  1803. }
  1804. function subscribe(callback, overwrite) {
  1805. if (overwrite) {
  1806. doneCallbacks = [];
  1807. }
  1808. if (typeof callback === "function") {
  1809. doneCallbacks.push(callback);
  1810. }
  1811. }
  1812. function getQueryStatus() {
  1813. return {
  1814. startTime,
  1815. payload,
  1816. status,
  1817. queriesSent,
  1818. queriesPending: queue.length,
  1819. subscribe,
  1820. abort
  1821. };
  1822. }
  1823. function failQuery() {
  1824. status = "failed";
  1825. doneCallbacks.forEach((callback) => {
  1826. callback(void 0, lastError);
  1827. });
  1828. }
  1829. function clearQueue() {
  1830. queue.forEach((item) => {
  1831. if (item.status === "pending") {
  1832. item.status = "aborted";
  1833. }
  1834. });
  1835. queue = [];
  1836. }
  1837. function moduleResponse(item, response, data) {
  1838. const isError = response !== "success";
  1839. queue = queue.filter((queued) => queued !== item);
  1840. switch (status) {
  1841. case "pending":
  1842. break;
  1843. case "failed":
  1844. if (isError || !config2.dataAfterTimeout) {
  1845. return;
  1846. }
  1847. break;
  1848. default:
  1849. return;
  1850. }
  1851. if (response === "abort") {
  1852. lastError = data;
  1853. failQuery();
  1854. return;
  1855. }
  1856. if (isError) {
  1857. lastError = data;
  1858. if (!queue.length) {
  1859. if (!resources.length) {
  1860. failQuery();
  1861. } else {
  1862. execNext();
  1863. }
  1864. }
  1865. return;
  1866. }
  1867. resetTimer();
  1868. clearQueue();
  1869. if (!config2.random) {
  1870. const index = config2.resources.indexOf(item.resource);
  1871. if (index !== -1 && index !== config2.index) {
  1872. config2.index = index;
  1873. }
  1874. }
  1875. status = "completed";
  1876. doneCallbacks.forEach((callback) => {
  1877. callback(data);
  1878. });
  1879. }
  1880. function execNext() {
  1881. if (status !== "pending") {
  1882. return;
  1883. }
  1884. resetTimer();
  1885. const resource = resources.shift();
  1886. if (resource === void 0) {
  1887. if (queue.length) {
  1888. timer = setTimeout(() => {
  1889. resetTimer();
  1890. if (status === "pending") {
  1891. clearQueue();
  1892. failQuery();
  1893. }
  1894. }, config2.timeout);
  1895. return;
  1896. }
  1897. failQuery();
  1898. return;
  1899. }
  1900. const item = {
  1901. status: "pending",
  1902. resource,
  1903. callback: (status2, data) => {
  1904. moduleResponse(item, status2, data);
  1905. }
  1906. };
  1907. queue.push(item);
  1908. queriesSent++;
  1909. timer = setTimeout(execNext, config2.rotate);
  1910. query(resource, payload, item.callback);
  1911. }
  1912. setTimeout(execNext);
  1913. return getQueryStatus;
  1914. }
  1915. function initRedundancy(cfg) {
  1916. const config2 = {
  1917. ...defaultConfig,
  1918. ...cfg
  1919. };
  1920. let queries = [];
  1921. function cleanup() {
  1922. queries = queries.filter((item) => item().status === "pending");
  1923. }
  1924. function query(payload, queryCallback, doneCallback) {
  1925. const query2 = sendQuery(
  1926. config2,
  1927. payload,
  1928. queryCallback,
  1929. (data, error) => {
  1930. cleanup();
  1931. if (doneCallback) {
  1932. doneCallback(data, error);
  1933. }
  1934. }
  1935. );
  1936. queries.push(query2);
  1937. return query2;
  1938. }
  1939. function find(callback) {
  1940. return queries.find((value) => {
  1941. return callback(value);
  1942. }) || null;
  1943. }
  1944. const instance = {
  1945. query,
  1946. find,
  1947. setIndex: (index) => {
  1948. config2.index = index;
  1949. },
  1950. getIndex: () => config2.index,
  1951. cleanup
  1952. };
  1953. return instance;
  1954. }
  1955. function emptyCallback$1() {
  1956. }
  1957. const redundancyCache = /* @__PURE__ */ Object.create(null);
  1958. function getRedundancyCache(provider) {
  1959. if (!redundancyCache[provider]) {
  1960. const config2 = getAPIConfig(provider);
  1961. if (!config2) {
  1962. return;
  1963. }
  1964. const redundancy = initRedundancy(config2);
  1965. const cachedReundancy = {
  1966. config: config2,
  1967. redundancy
  1968. };
  1969. redundancyCache[provider] = cachedReundancy;
  1970. }
  1971. return redundancyCache[provider];
  1972. }
  1973. function sendAPIQuery(target, query, callback) {
  1974. let redundancy;
  1975. let send2;
  1976. if (typeof target === "string") {
  1977. const api = getAPIModule(target);
  1978. if (!api) {
  1979. callback(void 0, 424);
  1980. return emptyCallback$1;
  1981. }
  1982. send2 = api.send;
  1983. const cached = getRedundancyCache(target);
  1984. if (cached) {
  1985. redundancy = cached.redundancy;
  1986. }
  1987. } else {
  1988. const config2 = createAPIConfig(target);
  1989. if (config2) {
  1990. redundancy = initRedundancy(config2);
  1991. const moduleKey = target.resources ? target.resources[0] : "";
  1992. const api = getAPIModule(moduleKey);
  1993. if (api) {
  1994. send2 = api.send;
  1995. }
  1996. }
  1997. }
  1998. if (!redundancy || !send2) {
  1999. callback(void 0, 424);
  2000. return emptyCallback$1;
  2001. }
  2002. return redundancy.query(query, send2, callback)().abort;
  2003. }
  2004. const browserCacheVersion = "iconify2";
  2005. const browserCachePrefix = "iconify";
  2006. const browserCacheCountKey = browserCachePrefix + "-count";
  2007. const browserCacheVersionKey = browserCachePrefix + "-version";
  2008. const browserStorageHour = 36e5;
  2009. const browserStorageCacheExpiration = 168;
  2010. function getStoredItem(func, key) {
  2011. try {
  2012. return func.getItem(key);
  2013. } catch (err) {
  2014. }
  2015. }
  2016. function setStoredItem(func, key, value) {
  2017. try {
  2018. func.setItem(key, value);
  2019. return true;
  2020. } catch (err) {
  2021. }
  2022. }
  2023. function removeStoredItem(func, key) {
  2024. try {
  2025. func.removeItem(key);
  2026. } catch (err) {
  2027. }
  2028. }
  2029. function setBrowserStorageItemsCount(storage2, value) {
  2030. return setStoredItem(storage2, browserCacheCountKey, value.toString());
  2031. }
  2032. function getBrowserStorageItemsCount(storage2) {
  2033. return parseInt(getStoredItem(storage2, browserCacheCountKey)) || 0;
  2034. }
  2035. const browserStorageConfig = {
  2036. local: true,
  2037. session: true
  2038. };
  2039. const browserStorageEmptyItems = {
  2040. local: /* @__PURE__ */ new Set(),
  2041. session: /* @__PURE__ */ new Set()
  2042. };
  2043. let browserStorageStatus = false;
  2044. function setBrowserStorageStatus(status) {
  2045. browserStorageStatus = status;
  2046. }
  2047. let _window = typeof window === "undefined" ? {} : window;
  2048. function getBrowserStorage(key) {
  2049. const attr = key + "Storage";
  2050. try {
  2051. if (_window && _window[attr] && typeof _window[attr].length === "number") {
  2052. return _window[attr];
  2053. }
  2054. } catch (err) {
  2055. }
  2056. browserStorageConfig[key] = false;
  2057. }
  2058. function iterateBrowserStorage(key, callback) {
  2059. const func = getBrowserStorage(key);
  2060. if (!func) {
  2061. return;
  2062. }
  2063. const version = getStoredItem(func, browserCacheVersionKey);
  2064. if (version !== browserCacheVersion) {
  2065. if (version) {
  2066. const total2 = getBrowserStorageItemsCount(func);
  2067. for (let i = 0; i < total2; i++) {
  2068. removeStoredItem(func, browserCachePrefix + i.toString());
  2069. }
  2070. }
  2071. setStoredItem(func, browserCacheVersionKey, browserCacheVersion);
  2072. setBrowserStorageItemsCount(func, 0);
  2073. return;
  2074. }
  2075. const minTime = Math.floor(Date.now() / browserStorageHour) - browserStorageCacheExpiration;
  2076. const parseItem = (index) => {
  2077. const name = browserCachePrefix + index.toString();
  2078. const item = getStoredItem(func, name);
  2079. if (typeof item !== "string") {
  2080. return;
  2081. }
  2082. try {
  2083. const data = JSON.parse(item);
  2084. if (typeof data === "object" && typeof data.cached === "number" && data.cached > minTime && typeof data.provider === "string" && typeof data.data === "object" && typeof data.data.prefix === "string" && // Valid item: run callback
  2085. callback(data, index)) {
  2086. return true;
  2087. }
  2088. } catch (err) {
  2089. }
  2090. removeStoredItem(func, name);
  2091. };
  2092. let total = getBrowserStorageItemsCount(func);
  2093. for (let i = total - 1; i >= 0; i--) {
  2094. if (!parseItem(i)) {
  2095. if (i === total - 1) {
  2096. total--;
  2097. setBrowserStorageItemsCount(func, total);
  2098. } else {
  2099. browserStorageEmptyItems[key].add(i);
  2100. }
  2101. }
  2102. }
  2103. }
  2104. function initBrowserStorage() {
  2105. if (browserStorageStatus) {
  2106. return;
  2107. }
  2108. setBrowserStorageStatus(true);
  2109. for (const key in browserStorageConfig) {
  2110. iterateBrowserStorage(key, (item) => {
  2111. const iconSet = item.data;
  2112. const provider = item.provider;
  2113. const prefix = iconSet.prefix;
  2114. const storage2 = getStorage(
  2115. provider,
  2116. prefix
  2117. );
  2118. if (!addIconSet(storage2, iconSet).length) {
  2119. return false;
  2120. }
  2121. const lastModified = iconSet.lastModified || -1;
  2122. storage2.lastModifiedCached = storage2.lastModifiedCached ? Math.min(storage2.lastModifiedCached, lastModified) : lastModified;
  2123. return true;
  2124. });
  2125. }
  2126. }
  2127. function updateLastModified(storage2, lastModified) {
  2128. const lastValue = storage2.lastModifiedCached;
  2129. if (
  2130. // Matches or newer
  2131. lastValue && lastValue >= lastModified
  2132. ) {
  2133. return lastValue === lastModified;
  2134. }
  2135. storage2.lastModifiedCached = lastModified;
  2136. if (lastValue) {
  2137. for (const key in browserStorageConfig) {
  2138. iterateBrowserStorage(key, (item) => {
  2139. const iconSet = item.data;
  2140. return item.provider !== storage2.provider || iconSet.prefix !== storage2.prefix || iconSet.lastModified === lastModified;
  2141. });
  2142. }
  2143. }
  2144. return true;
  2145. }
  2146. function storeInBrowserStorage(storage2, data) {
  2147. if (!browserStorageStatus) {
  2148. initBrowserStorage();
  2149. }
  2150. function store(key) {
  2151. let func;
  2152. if (!browserStorageConfig[key] || !(func = getBrowserStorage(key))) {
  2153. return;
  2154. }
  2155. const set = browserStorageEmptyItems[key];
  2156. let index;
  2157. if (set.size) {
  2158. set.delete(index = Array.from(set).shift());
  2159. } else {
  2160. index = getBrowserStorageItemsCount(func);
  2161. if (!setBrowserStorageItemsCount(func, index + 1)) {
  2162. return;
  2163. }
  2164. }
  2165. const item = {
  2166. cached: Math.floor(Date.now() / browserStorageHour),
  2167. provider: storage2.provider,
  2168. data
  2169. };
  2170. return setStoredItem(
  2171. func,
  2172. browserCachePrefix + index.toString(),
  2173. JSON.stringify(item)
  2174. );
  2175. }
  2176. if (data.lastModified && !updateLastModified(storage2, data.lastModified)) {
  2177. return;
  2178. }
  2179. if (!Object.keys(data.icons).length) {
  2180. return;
  2181. }
  2182. if (data.not_found) {
  2183. data = Object.assign({}, data);
  2184. delete data.not_found;
  2185. }
  2186. if (!store("local")) {
  2187. store("session");
  2188. }
  2189. }
  2190. function emptyCallback() {
  2191. }
  2192. function loadedNewIcons(storage2) {
  2193. if (!storage2.iconsLoaderFlag) {
  2194. storage2.iconsLoaderFlag = true;
  2195. setTimeout(() => {
  2196. storage2.iconsLoaderFlag = false;
  2197. updateCallbacks(storage2);
  2198. });
  2199. }
  2200. }
  2201. function loadNewIcons(storage2, icons) {
  2202. if (!storage2.iconsToLoad) {
  2203. storage2.iconsToLoad = icons;
  2204. } else {
  2205. storage2.iconsToLoad = storage2.iconsToLoad.concat(icons).sort();
  2206. }
  2207. if (!storage2.iconsQueueFlag) {
  2208. storage2.iconsQueueFlag = true;
  2209. setTimeout(() => {
  2210. storage2.iconsQueueFlag = false;
  2211. const { provider, prefix } = storage2;
  2212. const icons2 = storage2.iconsToLoad;
  2213. delete storage2.iconsToLoad;
  2214. let api;
  2215. if (!icons2 || !(api = getAPIModule(provider))) {
  2216. return;
  2217. }
  2218. const params = api.prepare(provider, prefix, icons2);
  2219. params.forEach((item) => {
  2220. sendAPIQuery(provider, item, (data) => {
  2221. if (typeof data !== "object") {
  2222. item.icons.forEach((name) => {
  2223. storage2.missing.add(name);
  2224. });
  2225. } else {
  2226. try {
  2227. const parsed = addIconSet(
  2228. storage2,
  2229. data
  2230. );
  2231. if (!parsed.length) {
  2232. return;
  2233. }
  2234. const pending = storage2.pendingIcons;
  2235. if (pending) {
  2236. parsed.forEach((name) => {
  2237. pending.delete(name);
  2238. });
  2239. }
  2240. storeInBrowserStorage(storage2, data);
  2241. } catch (err) {
  2242. console.error(err);
  2243. }
  2244. }
  2245. loadedNewIcons(storage2);
  2246. });
  2247. });
  2248. });
  2249. }
  2250. }
  2251. const loadIcons = (icons, callback) => {
  2252. const cleanedIcons = listToIcons(icons, true, allowSimpleNames());
  2253. const sortedIcons = sortIcons(cleanedIcons);
  2254. if (!sortedIcons.pending.length) {
  2255. let callCallback = true;
  2256. if (callback) {
  2257. setTimeout(() => {
  2258. if (callCallback) {
  2259. callback(
  2260. sortedIcons.loaded,
  2261. sortedIcons.missing,
  2262. sortedIcons.pending,
  2263. emptyCallback
  2264. );
  2265. }
  2266. });
  2267. }
  2268. return () => {
  2269. callCallback = false;
  2270. };
  2271. }
  2272. const newIcons = /* @__PURE__ */ Object.create(null);
  2273. const sources = [];
  2274. let lastProvider, lastPrefix;
  2275. sortedIcons.pending.forEach((icon) => {
  2276. const { provider, prefix } = icon;
  2277. if (prefix === lastPrefix && provider === lastProvider) {
  2278. return;
  2279. }
  2280. lastProvider = provider;
  2281. lastPrefix = prefix;
  2282. sources.push(getStorage(provider, prefix));
  2283. const providerNewIcons = newIcons[provider] || (newIcons[provider] = /* @__PURE__ */ Object.create(null));
  2284. if (!providerNewIcons[prefix]) {
  2285. providerNewIcons[prefix] = [];
  2286. }
  2287. });
  2288. sortedIcons.pending.forEach((icon) => {
  2289. const { provider, prefix, name } = icon;
  2290. const storage2 = getStorage(provider, prefix);
  2291. const pendingQueue = storage2.pendingIcons || (storage2.pendingIcons = /* @__PURE__ */ new Set());
  2292. if (!pendingQueue.has(name)) {
  2293. pendingQueue.add(name);
  2294. newIcons[provider][prefix].push(name);
  2295. }
  2296. });
  2297. sources.forEach((storage2) => {
  2298. const { provider, prefix } = storage2;
  2299. if (newIcons[provider][prefix].length) {
  2300. loadNewIcons(storage2, newIcons[provider][prefix]);
  2301. }
  2302. });
  2303. return callback ? storeCallback(callback, sortedIcons, sources) : emptyCallback;
  2304. };
  2305. function mergeCustomisations(defaults, item) {
  2306. const result = {
  2307. ...defaults
  2308. };
  2309. for (const key in item) {
  2310. const value = item[key];
  2311. const valueType = typeof value;
  2312. if (key in defaultIconSizeCustomisations) {
  2313. if (value === null || value && (valueType === "string" || valueType === "number")) {
  2314. result[key] = value;
  2315. }
  2316. } else if (valueType === typeof result[key]) {
  2317. result[key] = key === "rotate" ? value % 4 : value;
  2318. }
  2319. }
  2320. return result;
  2321. }
  2322. const separator = /[\s,]+/;
  2323. function flipFromString(custom, flip) {
  2324. flip.split(separator).forEach((str) => {
  2325. const value = str.trim();
  2326. switch (value) {
  2327. case "horizontal":
  2328. custom.hFlip = true;
  2329. break;
  2330. case "vertical":
  2331. custom.vFlip = true;
  2332. break;
  2333. }
  2334. });
  2335. }
  2336. function rotateFromString(value, defaultValue = 0) {
  2337. const units = value.replace(/^-?[0-9.]*/, "");
  2338. function cleanup(value2) {
  2339. while (value2 < 0) {
  2340. value2 += 4;
  2341. }
  2342. return value2 % 4;
  2343. }
  2344. if (units === "") {
  2345. const num = parseInt(value);
  2346. return isNaN(num) ? 0 : cleanup(num);
  2347. } else if (units !== value) {
  2348. let split = 0;
  2349. switch (units) {
  2350. case "%":
  2351. split = 25;
  2352. break;
  2353. case "deg":
  2354. split = 90;
  2355. }
  2356. if (split) {
  2357. let num = parseFloat(value.slice(0, value.length - units.length));
  2358. if (isNaN(num)) {
  2359. return 0;
  2360. }
  2361. num = num / split;
  2362. return num % 1 === 0 ? cleanup(num) : 0;
  2363. }
  2364. }
  2365. return defaultValue;
  2366. }
  2367. function iconToHTML(body, attributes) {
  2368. let renderAttribsHTML = body.indexOf("xlink:") === -1 ? "" : ' xmlns:xlink="http://www.w3.org/1999/xlink"';
  2369. for (const attr in attributes) {
  2370. renderAttribsHTML += " " + attr + '="' + attributes[attr] + '"';
  2371. }
  2372. return '<svg xmlns="http://www.w3.org/2000/svg"' + renderAttribsHTML + ">" + body + "</svg>";
  2373. }
  2374. function encodeSVGforURL(svg) {
  2375. return svg.replace(/"/g, "'").replace(/%/g, "%25").replace(/#/g, "%23").replace(/</g, "%3C").replace(/>/g, "%3E").replace(/\s+/g, " ");
  2376. }
  2377. function svgToData(svg) {
  2378. return "data:image/svg+xml," + encodeSVGforURL(svg);
  2379. }
  2380. function svgToURL(svg) {
  2381. return 'url("' + svgToData(svg) + '")';
  2382. }
  2383. const defaultExtendedIconCustomisations = {
  2384. ...defaultIconCustomisations,
  2385. inline: false
  2386. };
  2387. const svgDefaults = {
  2388. "xmlns": "http://www.w3.org/2000/svg",
  2389. "xmlns:xlink": "http://www.w3.org/1999/xlink",
  2390. "aria-hidden": true,
  2391. "role": "img"
  2392. };
  2393. const commonProps = {
  2394. display: "inline-block"
  2395. };
  2396. const monotoneProps = {
  2397. backgroundColor: "currentColor"
  2398. };
  2399. const coloredProps = {
  2400. backgroundColor: "transparent"
  2401. };
  2402. const propsToAdd = {
  2403. Image: "var(--svg)",
  2404. Repeat: "no-repeat",
  2405. Size: "100% 100%"
  2406. };
  2407. const propsToAddTo = {
  2408. webkitMask: monotoneProps,
  2409. mask: monotoneProps,
  2410. background: coloredProps
  2411. };
  2412. for (const prefix in propsToAddTo) {
  2413. const list = propsToAddTo[prefix];
  2414. for (const prop in propsToAdd) {
  2415. list[prefix + prop] = propsToAdd[prop];
  2416. }
  2417. }
  2418. const customisationAliases = {};
  2419. ["horizontal", "vertical"].forEach((prefix) => {
  2420. const attr = prefix.slice(0, 1) + "Flip";
  2421. customisationAliases[prefix + "-flip"] = attr;
  2422. customisationAliases[prefix.slice(0, 1) + "-flip"] = attr;
  2423. customisationAliases[prefix + "Flip"] = attr;
  2424. });
  2425. function fixSize(value) {
  2426. return value + (value.match(/^[-0-9.]+$/) ? "px" : "");
  2427. }
  2428. const render = (icon, props) => {
  2429. const customisations = mergeCustomisations(defaultExtendedIconCustomisations, props);
  2430. const componentProps = { ...svgDefaults };
  2431. const mode = props.mode || "svg";
  2432. const style = {};
  2433. const propsStyle = props.style;
  2434. const customStyle = typeof propsStyle === "object" && !(propsStyle instanceof Array) ? propsStyle : {};
  2435. for (let key in props) {
  2436. const value = props[key];
  2437. if (value === void 0) {
  2438. continue;
  2439. }
  2440. switch (key) {
  2441. case "icon":
  2442. case "style":
  2443. case "onLoad":
  2444. case "mode":
  2445. break;
  2446. case "inline":
  2447. case "hFlip":
  2448. case "vFlip":
  2449. customisations[key] = value === true || value === "true" || value === 1;
  2450. break;
  2451. case "flip":
  2452. if (typeof value === "string") {
  2453. flipFromString(customisations, value);
  2454. }
  2455. break;
  2456. case "color":
  2457. style.color = value;
  2458. break;
  2459. case "rotate":
  2460. if (typeof value === "string") {
  2461. customisations[key] = rotateFromString(value);
  2462. } else if (typeof value === "number") {
  2463. customisations[key] = value;
  2464. }
  2465. break;
  2466. case "ariaHidden":
  2467. case "aria-hidden":
  2468. if (value !== true && value !== "true") {
  2469. delete componentProps["aria-hidden"];
  2470. }
  2471. break;
  2472. default: {
  2473. const alias = customisationAliases[key];
  2474. if (alias) {
  2475. if (value === true || value === "true" || value === 1) {
  2476. customisations[alias] = true;
  2477. }
  2478. } else if (defaultExtendedIconCustomisations[key] === void 0) {
  2479. componentProps[key] = value;
  2480. }
  2481. }
  2482. }
  2483. }
  2484. const item = iconToSVG(icon, customisations);
  2485. const renderAttribs = item.attributes;
  2486. if (customisations.inline) {
  2487. style.verticalAlign = "-0.125em";
  2488. }
  2489. if (mode === "svg") {
  2490. componentProps.style = {
  2491. ...style,
  2492. ...customStyle
  2493. };
  2494. Object.assign(componentProps, renderAttribs);
  2495. let localCounter = 0;
  2496. let id = props.id;
  2497. if (typeof id === "string") {
  2498. id = id.replace(/-/g, "_");
  2499. }
  2500. componentProps["innerHTML"] = replaceIDs(item.body, id ? () => id + "ID" + localCounter++ : "iconifyVue");
  2501. return vue.h("svg", componentProps);
  2502. }
  2503. const { body, width, height } = icon;
  2504. const useMask = mode === "mask" || (mode === "bg" ? false : body.indexOf("currentColor") !== -1);
  2505. const html = iconToHTML(body, {
  2506. ...renderAttribs,
  2507. width: width + "",
  2508. height: height + ""
  2509. });
  2510. componentProps.style = {
  2511. ...style,
  2512. "--svg": svgToURL(html),
  2513. "width": fixSize(renderAttribs.width),
  2514. "height": fixSize(renderAttribs.height),
  2515. ...commonProps,
  2516. ...useMask ? monotoneProps : coloredProps,
  2517. ...customStyle
  2518. };
  2519. return vue.h("span", componentProps);
  2520. };
  2521. allowSimpleNames(true);
  2522. setAPIModule("", fetchAPIModule);
  2523. if (typeof document !== "undefined" && typeof window !== "undefined") {
  2524. initBrowserStorage();
  2525. const _window2 = window;
  2526. if (_window2.IconifyPreload !== void 0) {
  2527. const preload = _window2.IconifyPreload;
  2528. const err = "Invalid IconifyPreload syntax.";
  2529. if (typeof preload === "object" && preload !== null) {
  2530. (preload instanceof Array ? preload : [preload]).forEach((item) => {
  2531. try {
  2532. if (
  2533. // Check if item is an object and not null/array
  2534. typeof item !== "object" || item === null || item instanceof Array || // Check for 'icons' and 'prefix'
  2535. typeof item.icons !== "object" || typeof item.prefix !== "string" || // Add icon set
  2536. !addCollection(item)
  2537. ) {
  2538. console.error(err);
  2539. }
  2540. } catch (e2) {
  2541. console.error(err);
  2542. }
  2543. });
  2544. }
  2545. }
  2546. if (_window2.IconifyProviders !== void 0) {
  2547. const providers = _window2.IconifyProviders;
  2548. if (typeof providers === "object" && providers !== null) {
  2549. for (let key in providers) {
  2550. const err = "IconifyProviders[" + key + "] is invalid.";
  2551. try {
  2552. const value = providers[key];
  2553. if (typeof value !== "object" || !value || value.resources === void 0) {
  2554. continue;
  2555. }
  2556. if (!addAPIProvider(key, value)) {
  2557. console.error(err);
  2558. }
  2559. } catch (e2) {
  2560. console.error(err);
  2561. }
  2562. }
  2563. }
  2564. }
  2565. }
  2566. const emptyIcon = {
  2567. ...defaultIconProps,
  2568. body: ""
  2569. };
  2570. const Icon = vue.defineComponent({
  2571. // Do not inherit other attributes: it is handled by render()
  2572. inheritAttrs: false,
  2573. // Set initial data
  2574. data() {
  2575. return {
  2576. // Mounted status
  2577. iconMounted: false,
  2578. // Callback counter to trigger re-render
  2579. counter: 0
  2580. };
  2581. },
  2582. mounted() {
  2583. this._name = "";
  2584. this._loadingIcon = null;
  2585. this.iconMounted = true;
  2586. },
  2587. unmounted() {
  2588. this.abortLoading();
  2589. },
  2590. methods: {
  2591. abortLoading() {
  2592. if (this._loadingIcon) {
  2593. this._loadingIcon.abort();
  2594. this._loadingIcon = null;
  2595. }
  2596. },
  2597. // Get data for icon to render or null
  2598. getIcon(icon, onload) {
  2599. if (typeof icon === "object" && icon !== null && typeof icon.body === "string") {
  2600. this._name = "";
  2601. this.abortLoading();
  2602. return {
  2603. data: icon
  2604. };
  2605. }
  2606. let iconName;
  2607. if (typeof icon !== "string" || (iconName = stringToIcon(icon, false, true)) === null) {
  2608. this.abortLoading();
  2609. return null;
  2610. }
  2611. const data = getIconData(iconName);
  2612. if (!data) {
  2613. if (!this._loadingIcon || this._loadingIcon.name !== icon) {
  2614. this.abortLoading();
  2615. this._name = "";
  2616. if (data !== null) {
  2617. this._loadingIcon = {
  2618. name: icon,
  2619. abort: loadIcons([iconName], () => {
  2620. this.counter++;
  2621. })
  2622. };
  2623. }
  2624. }
  2625. return null;
  2626. }
  2627. this.abortLoading();
  2628. if (this._name !== icon) {
  2629. this._name = icon;
  2630. if (onload) {
  2631. onload(icon);
  2632. }
  2633. }
  2634. const classes = ["iconify"];
  2635. if (iconName.prefix !== "") {
  2636. classes.push("iconify--" + iconName.prefix);
  2637. }
  2638. if (iconName.provider !== "") {
  2639. classes.push("iconify--" + iconName.provider);
  2640. }
  2641. return { data, classes };
  2642. }
  2643. },
  2644. // Render icon
  2645. render() {
  2646. this.counter;
  2647. const props = this.$attrs;
  2648. const icon = this.iconMounted ? this.getIcon(props.icon, props.onLoad) : null;
  2649. if (!icon) {
  2650. return render(emptyIcon, props);
  2651. }
  2652. let newProps = props;
  2653. if (icon.classes) {
  2654. newProps = {
  2655. ...props,
  2656. class: (typeof props["class"] === "string" ? props["class"] + " " : "") + icon.classes.join(" ")
  2657. };
  2658. }
  2659. return render({
  2660. ...defaultIconProps,
  2661. ...icon.data
  2662. }, newProps);
  2663. }
  2664. });
  2665. const _hoisted_1$i = { class: "display-type" };
  2666. const _hoisted_2$f = { style: { "position": "relative" } };
  2667. const _hoisted_3$c = {
  2668. key: 0,
  2669. class: "type-list"
  2670. };
  2671. const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
  2672. __name: "BaseSelect",
  2673. props: {
  2674. displayType: {}
  2675. },
  2676. emits: ["update:displayType"],
  2677. setup(__props, { emit: __emit }) {
  2678. const props = __props;
  2679. const emit = __emit;
  2680. let state = vue.reactive({
  2681. showChangeDisplayType: false,
  2682. lastDisplayType: null
  2683. });
  2684. function changeOption(item) {
  2685. if (![CommentDisplayType.New, CommentDisplayType.Like].includes(props.displayType)) {
  2686. state.lastDisplayType = props.displayType;
  2687. }
  2688. emit("update:displayType", item);
  2689. state.showChangeDisplayType = false;
  2690. }
  2691. function clickDisplayType() {
  2692. if ([CommentDisplayType.New, CommentDisplayType.Like].includes(props.displayType)) {
  2693. return changeOption(state.lastDisplayType ?? CommentDisplayType.FloorInFloorNoCallUser);
  2694. }
  2695. state.showChangeDisplayType = !state.showChangeDisplayType;
  2696. }
  2697. const currentDisplayType = vue.computed(() => {
  2698. let judge = props.displayType;
  2699. if ([CommentDisplayType.New, CommentDisplayType.Like].includes(props.displayType)) {
  2700. judge = state.lastDisplayType;
  2701. }
  2702. switch (judge) {
  2703. case CommentDisplayType.FloorInFloorNoCallUser:
  2704. return "楼中楼";
  2705. case CommentDisplayType.FloorInFloor:
  2706. return "楼中楼(@)";
  2707. case CommentDisplayType.FloorInFloorNested:
  2708. return "冗余楼中楼";
  2709. case CommentDisplayType.V2exOrigin:
  2710. return "V2原版";
  2711. case CommentDisplayType.OnlyOp:
  2712. return "只看楼主";
  2713. default:
  2714. return "楼中楼";
  2715. }
  2716. });
  2717. return (_ctx, _cache) => {
  2718. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$i, [
  2719. vue.createElementVNode("div", {
  2720. class: vue.normalizeClass(["type", _ctx.displayType === vue.unref(CommentDisplayType).New && "active"]),
  2721. onClick: _cache[0] || (_cache[0] = ($event) => changeOption(vue.unref(CommentDisplayType).New))
  2722. }, "最新 ", 2),
  2723. vue.createElementVNode("div", {
  2724. class: vue.normalizeClass(["type", _ctx.displayType === vue.unref(CommentDisplayType).Like && "active"]),
  2725. onClick: _cache[1] || (_cache[1] = ($event) => changeOption(vue.unref(CommentDisplayType).Like))
  2726. }, "最热 ", 2),
  2727. vue.createElementVNode("div", _hoisted_2$f, [
  2728. vue.createElementVNode("div", {
  2729. class: vue.normalizeClass(["type", ![vue.unref(CommentDisplayType).New, vue.unref(CommentDisplayType).Like].includes(_ctx.displayType) && "active"]),
  2730. onClick: clickDisplayType
  2731. }, [
  2732. vue.createElementVNode("span", null, vue.toDisplayString(currentDisplayType.value), 1),
  2733. vue.createVNode(vue.unref(Icon), { icon: "mingcute:down-line" })
  2734. ], 2),
  2735. vue.unref(state).showChangeDisplayType ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$c, [
  2736. vue.createElementVNode("div", {
  2737. class: vue.normalizeClass(["item", _ctx.displayType === vue.unref(CommentDisplayType).FloorInFloorNoCallUser && "active"]),
  2738. onClick: _cache[2] || (_cache[2] = vue.withModifiers(($event) => changeOption(vue.unref(CommentDisplayType).FloorInFloorNoCallUser), ["stop"]))
  2739. }, "楼中楼 ", 2),
  2740. vue.createElementVNode("div", {
  2741. class: vue.normalizeClass(["item", _ctx.displayType === vue.unref(CommentDisplayType).FloorInFloor && "active"]),
  2742. onClick: _cache[3] || (_cache[3] = vue.withModifiers(($event) => changeOption(vue.unref(CommentDisplayType).FloorInFloor), ["stop"]))
  2743. }, "楼中楼(@) ", 2),
  2744. vue.createElementVNode("div", {
  2745. class: vue.normalizeClass(["item", _ctx.displayType === vue.unref(CommentDisplayType).FloorInFloorNested && "active"]),
  2746. onClick: _cache[4] || (_cache[4] = vue.withModifiers(($event) => changeOption(vue.unref(CommentDisplayType).FloorInFloorNested), ["stop"]))
  2747. }, "冗余楼中楼 ", 2),
  2748. vue.createElementVNode("div", {
  2749. class: vue.normalizeClass(["item", _ctx.displayType === vue.unref(CommentDisplayType).OnlyOp && "active"]),
  2750. onClick: _cache[5] || (_cache[5] = vue.withModifiers(($event) => changeOption(vue.unref(CommentDisplayType).OnlyOp), ["stop"]))
  2751. }, "只看楼主 ", 2),
  2752. vue.createElementVNode("div", {
  2753. class: vue.normalizeClass(["item", _ctx.displayType === vue.unref(CommentDisplayType).V2exOrigin && "active"]),
  2754. onClick: _cache[6] || (_cache[6] = vue.withModifiers(($event) => changeOption(vue.unref(CommentDisplayType).V2exOrigin), ["stop"]))
  2755. }, "V2原版 ", 2)
  2756. ])) : vue.createCommentVNode("", true)
  2757. ])
  2758. ]);
  2759. };
  2760. }
  2761. });
  2762. const BaseSelect = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-e4f684be"]]);
  2763. const eventBus = {
  2764. eventMap: /* @__PURE__ */ new Map(),
  2765. on(eventType, cb) {
  2766. let cbs = this.eventMap.get(eventType);
  2767. if (cbs) {
  2768. cbs.push(cb);
  2769. } else {
  2770. cbs = [cb];
  2771. }
  2772. this.eventMap.set(eventType, cbs);
  2773. },
  2774. offOne(eventType, cb) {
  2775. let cbs = this.eventMap.get(eventType);
  2776. if (cbs) {
  2777. let rIndex = cbs.findIndex((c) => c === cb);
  2778. if (rIndex > -1) {
  2779. cbs.splice(rIndex, 1);
  2780. }
  2781. }
  2782. this.eventMap.set(eventType, cbs);
  2783. },
  2784. emit(eventType, val) {
  2785. let cbs = this.eventMap.get(eventType);
  2786. if (cbs) {
  2787. cbs.map((cb) => cb(val));
  2788. }
  2789. },
  2790. off(eventType) {
  2791. let cbs = this.eventMap.has(eventType);
  2792. if (cbs) {
  2793. this.eventMap.delete(eventType);
  2794. }
  2795. },
  2796. clear() {
  2797. this.eventMap = /* @__PURE__ */ new Map();
  2798. }
  2799. };
  2800. const CMD = {
  2801. SHOW_TOOLTIP: "SHOW_TOOLTIP",
  2802. SHOW_MSG: "SHOW_MSG",
  2803. SET_CALL: "SET_CALL",
  2804. SHOW_CALL: "SHOW_CALL",
  2805. REFRESH_ONCE: "REFRESH_ONCE",
  2806. ADD_REPLY: "ADD_REPLY",
  2807. IGNORE: "IGNORE",
  2808. MERGE: "MERGE",
  2809. REMOVE: "REMOVE",
  2810. CHANGE_COMMENT_THANK: "CHANGE_COMMENT_THANK",
  2811. CHANGE_POST_THANK: "CHANGE_POST_THANK",
  2812. ADD_TAG: "ADD_TAG",
  2813. REMOVE_TAG: "REMOVE_TAG",
  2814. RELATION_REPLY: "RELATION_REPLY",
  2815. JUMP: "JUMP",
  2816. REFRESH_POST: "REFRESH_POST",
  2817. SHOW_CONFIRM_MODAL: "SHOW_CONFIRM_MODAL",
  2818. SHOW_CONFIRM_MODAL_CONFIRM: "SHOW_CONFIRM_MODAL_CONFIRM"
  2819. };
  2820. const _sfc_main$j = {
  2821. name: "PopConfirm",
  2822. props: {
  2823. title: {
  2824. type: String,
  2825. default() {
  2826. return "";
  2827. }
  2828. },
  2829. disabled: {
  2830. type: Boolean,
  2831. default() {
  2832. return false;
  2833. }
  2834. }
  2835. },
  2836. data() {
  2837. return {
  2838. id: ""
  2839. };
  2840. },
  2841. created() {
  2842. },
  2843. methods: {
  2844. cb(id) {
  2845. if (id === this.id) {
  2846. this.$emit("confirm");
  2847. this.id = "";
  2848. }
  2849. },
  2850. showPop(e2) {
  2851. if (this.disabled)
  2852. return;
  2853. let rect = e2.target.getBoundingClientRect();
  2854. this.id = Date.now();
  2855. eventBus.emit(CMD.SHOW_CONFIRM_MODAL, { title: this.title, rect, id: this.id });
  2856. eventBus.offOne(CMD.SHOW_CONFIRM_MODAL_CONFIRM, this.cb);
  2857. eventBus.on(CMD.SHOW_CONFIRM_MODAL_CONFIRM, this.cb);
  2858. }
  2859. },
  2860. unmounted() {
  2861. eventBus.offOne(CMD.SHOW_CONFIRM_MODAL_CONFIRM, this.cb);
  2862. }
  2863. };
  2864. function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
  2865. return vue.openBlock(), vue.createElementBlock("span", {
  2866. onClick: _cache[0] || (_cache[0] = vue.withModifiers((...args) => $options.showPop && $options.showPop(...args), ["stop"]))
  2867. }, [
  2868. vue.renderSlot(_ctx.$slots, "default")
  2869. ]);
  2870. }
  2871. const PopConfirm = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", _sfc_render$a]]);
  2872. const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
  2873. __name: "BaseLoading",
  2874. props: {
  2875. size: { default: "normal" }
  2876. },
  2877. setup(__props) {
  2878. return (_ctx, _cache) => {
  2879. return vue.openBlock(), vue.createElementBlock("div", {
  2880. class: vue.normalizeClass(["loading", [_ctx.size]])
  2881. }, null, 2);
  2882. };
  2883. }
  2884. });
  2885. const BaseLoading = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-2697baa2"]]);
  2886. const _hoisted_1$h = {
  2887. key: 1,
  2888. class: "key-notice"
  2889. };
  2890. const _hoisted_2$e = { class: "key" };
  2891. const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
  2892. __name: "BaseButton",
  2893. props: {
  2894. keyboard: {},
  2895. active: { type: Boolean },
  2896. disabled: { type: Boolean },
  2897. loading: { type: Boolean },
  2898. size: { default: "normal" },
  2899. type: { default: "primary" }
  2900. },
  2901. emits: ["click"],
  2902. setup(__props) {
  2903. return (_ctx, _cache) => {
  2904. return vue.openBlock(), vue.createBlock(Tooltip, {
  2905. disabled: !_ctx.keyboard,
  2906. title: `快捷键: ${_ctx.keyboard}`
  2907. }, {
  2908. default: vue.withCtx(() => [
  2909. vue.createElementVNode("div", vue.mergeProps({ class: "base-button" }, _ctx.$attrs, {
  2910. onClick: _cache[0] || (_cache[0] = (e2) => !_ctx.disabled && !_ctx.loading && _ctx.$emit("click", e2)),
  2911. class: [
  2912. _ctx.active && "active",
  2913. _ctx.size,
  2914. _ctx.type,
  2915. (_ctx.disabled || _ctx.loading) && "disabled",
  2916. !_ctx.disabled && "hvr-grow"
  2917. ]
  2918. }), [
  2919. vue.createElementVNode("span", {
  2920. style: vue.normalizeStyle({ opacity: _ctx.loading ? 0 : 1 })
  2921. }, [
  2922. vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
  2923. ], 4),
  2924. _ctx.loading ? (vue.openBlock(), vue.createBlock(BaseLoading, {
  2925. key: 0,
  2926. size: "small"
  2927. })) : vue.createCommentVNode("", true),
  2928. _ctx.keyboard ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$h, [
  2929. vue.createElementVNode("span", _hoisted_2$e, vue.toDisplayString(_ctx.keyboard), 1)
  2930. ])) : vue.createCommentVNode("", true)
  2931. ], 16)
  2932. ]),
  2933. _: 3
  2934. }, 8, ["disabled", "title"]);
  2935. };
  2936. }
  2937. });
  2938. const BaseButton = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-5a7d79ba"]]);
  2939. const _sfc_main$g = {
  2940. name: "Setting",
  2941. components: {
  2942. BaseButton,
  2943. PopConfirm,
  2944. Icon,
  2945. BaseSelect,
  2946. BaseSwitch,
  2947. Tooltip
  2948. },
  2949. inject: ["isNight"],
  2950. props: {
  2951. show: {
  2952. type: Boolean,
  2953. default() {
  2954. return false;
  2955. }
  2956. }
  2957. },
  2958. data() {
  2959. return {
  2960. tabIndex: 0
  2961. };
  2962. },
  2963. methods: {
  2964. confirm() {
  2965. this.close();
  2966. this.$emit("confirm");
  2967. },
  2968. close() {
  2969. this.$emit("update:show", false);
  2970. }
  2971. }
  2972. };
  2973. const _withScopeId$b = (n2) => (vue.pushScopeId("data-v-386b43d0"), n2 = n2(), vue.popScopeId(), n2);
  2974. const _hoisted_1$g = {
  2975. key: 0,
  2976. class: "setting-modal modal"
  2977. };
  2978. const _hoisted_2$d = { class: "modal-root" };
  2979. const _hoisted_3$b = { class: "modal-header" };
  2980. const _hoisted_4$b = /* @__PURE__ */ _withScopeId$b(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "title" }, " 使用需知 ", -1));
  2981. const _hoisted_5$9 = { class: "body" };
  2982. const _hoisted_6$9 = /* @__PURE__ */ _withScopeId$b(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "modal-content" }, [
  2983. /* @__PURE__ */ vue.createElementVNode("div", null, "开启此功能会带来以下影响"),
  2984. /* @__PURE__ */ vue.createElementVNode("div", null, "缺点"),
  2985. /* @__PURE__ */ vue.createElementVNode("div", { style: { "color": "red" } }, [
  2986. /* @__PURE__ */ vue.createElementVNode("div", null, "1、你的IP可能会被封禁"),
  2987. /* @__PURE__ */ vue.createElementVNode("div", null, "2、消耗更多流量,给服务器带来更大的负担"),
  2988. /* @__PURE__ */ vue.createElementVNode("div", null, "3、你的V站浏览进度条会变快")
  2989. ]),
  2990. /* @__PURE__ */ vue.createElementVNode("div", null, "优点"),
  2991. /* @__PURE__ */ vue.createElementVNode("div", null, "1、卡片模式,无需打开主题即可查看内容"),
  2992. /* @__PURE__ */ vue.createElementVNode("div", null, "2、打开主题时提前预览正文内容,无需等待加载"),
  2993. /* @__PURE__ */ vue.createElementVNode("div", null, "原理"),
  2994. /* @__PURE__ */ vue.createElementVNode("div", null, "1、解析列表所有主题ID,批量调用show.json接口,获取对应主题的正文"),
  2995. /* @__PURE__ */ vue.createElementVNode("div", null, "2、请求的主题数据会缓存到本地,不会重复请求,超过3天的数据会删除"),
  2996. /* @__PURE__ */ vue.createElementVNode("div", null, "3、前面4条会并发请求,4条以后的一秒请求一条")
  2997. ], -1));
  2998. const _hoisted_7$8 = { class: "btns" };
  2999. function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
  3000. const _component_Icon = vue.resolveComponent("Icon");
  3001. const _component_BaseButton = vue.resolveComponent("BaseButton");
  3002. return vue.openBlock(), vue.createBlock(vue.Transition, null, {
  3003. default: vue.withCtx(() => [
  3004. $props.show ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$g, [
  3005. vue.createElementVNode("div", {
  3006. class: "mask",
  3007. onClick: _cache[0] || (_cache[0] = (...args) => $options.close && $options.close(...args))
  3008. }),
  3009. vue.createElementVNode("div", _hoisted_2$d, [
  3010. vue.createElementVNode("div", _hoisted_3$b, [
  3011. _hoisted_4$b,
  3012. vue.createVNode(_component_Icon, {
  3013. icon: "ic:round-close",
  3014. onClick: $options.close
  3015. }, null, 8, ["onClick"])
  3016. ]),
  3017. vue.createElementVNode("div", _hoisted_5$9, [
  3018. _hoisted_6$9,
  3019. vue.createElementVNode("div", _hoisted_7$8, [
  3020. vue.createVNode(_component_BaseButton, {
  3021. type: "link",
  3022. onClick: $options.close
  3023. }, {
  3024. default: vue.withCtx(() => [
  3025. vue.createTextVNode("不同意")
  3026. ]),
  3027. _: 1
  3028. }, 8, ["onClick"]),
  3029. vue.createVNode(_component_BaseButton, { onClick: $options.confirm }, {
  3030. default: vue.withCtx(() => [
  3031. vue.createTextVNode("同意")
  3032. ]),
  3033. _: 1
  3034. }, 8, ["onClick"])
  3035. ])
  3036. ])
  3037. ])
  3038. ])) : vue.createCommentVNode("", true)
  3039. ]),
  3040. _: 1
  3041. });
  3042. }
  3043. const NoticeModal = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", _sfc_render$9], ["__scopeId", "data-v-386b43d0"]]);
  3044. const _sfc_main$f = {
  3045. name: "Setting",
  3046. components: {
  3047. NoticeModal,
  3048. PopConfirm,
  3049. Icon,
  3050. BaseSelect,
  3051. BaseSwitch,
  3052. Tooltip
  3053. },
  3054. inject: ["isNight"],
  3055. props: {
  3056. modelValue: {
  3057. type: Object,
  3058. default() {
  3059. return {};
  3060. }
  3061. },
  3062. show: {
  3063. type: Boolean,
  3064. default() {
  3065. return false;
  3066. }
  3067. }
  3068. },
  3069. data() {
  3070. return {
  3071. tabIndex: 0,
  3072. config: functions.clone(this.modelValue),
  3073. showNotice: false
  3074. };
  3075. },
  3076. computed: {
  3077. DefaultVal() {
  3078. return DefaultVal;
  3079. },
  3080. CommentDisplayType() {
  3081. return CommentDisplayType;
  3082. },
  3083. isNew() {
  3084. return this.config.version < DefaultVal.currentVersion && window.isDeadline;
  3085. }
  3086. },
  3087. watch: {
  3088. config: {
  3089. handler(n2) {
  3090. n2.topReplyLoveMinCount = Math.trunc(n2.topReplyLoveMinCount);
  3091. if (n2.topReplyLoveMinCount < 0) {
  3092. n2.topReplyLoveMinCount = 1;
  3093. }
  3094. this.$emit("update:modelValue", n2);
  3095. },
  3096. deep: true
  3097. },
  3098. "config.loopCheckNotice"(n2) {
  3099. if (n2) {
  3100. this.config.loopCheckNoticeInterval = 5;
  3101. this.config.whenNewNoticeGlimmer = false;
  3102. } else {
  3103. this.config.loopCheckNoticeInterval = 0;
  3104. this.config.whenNewNoticeGlimmer = false;
  3105. this.config.ddWebhook = "";
  3106. }
  3107. },
  3108. show(n2) {
  3109. if (n2) {
  3110. if (this.config.version < DefaultVal.currentVersion) {
  3111. $(".v2next-new").remove();
  3112. }
  3113. document.body.style.overflow = "hidden";
  3114. } else {
  3115. document.body.style.overflow = "unset";
  3116. }
  3117. }
  3118. },
  3119. methods: {
  3120. goPost() {
  3121. fetch(DefaultVal.hotUrl + "new.txt").then(async (r2) => {
  3122. let r22 = await r2.text();
  3123. if (r22) {
  3124. window.open(r22);
  3125. } else {
  3126. window.open(DefaultVal.git);
  3127. }
  3128. }).catch(() => window.open(DefaultVal.git));
  3129. },
  3130. close() {
  3131. if (window.isDeadline) {
  3132. this.config.version = DefaultVal.currentVersion;
  3133. }
  3134. this.$emit("update:show", false);
  3135. }
  3136. }
  3137. };
  3138. const _withScopeId$a = (n2) => (vue.pushScopeId("data-v-b34c6692"), n2 = n2(), vue.popScopeId(), n2);
  3139. const _hoisted_1$f = {
  3140. key: 0,
  3141. class: "setting-modal modal"
  3142. };
  3143. const _hoisted_2$c = { class: "modal-root" };
  3144. const _hoisted_3$a = { class: "modal-header" };
  3145. const _hoisted_4$a = { class: "title" };
  3146. const _hoisted_5$8 = { class: "small" };
  3147. const _hoisted_6$8 = ["href"];
  3148. const _hoisted_7$7 = {
  3149. key: 0,
  3150. class: "log"
  3151. };
  3152. const _hoisted_8$7 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "new" }, null, -1));
  3153. const _hoisted_9$7 = { class: "body" };
  3154. const _hoisted_10$7 = { class: "left" };
  3155. const _hoisted_11$7 = { class: "tabs" };
  3156. const _hoisted_12$7 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("span", null, "列表设置", -1));
  3157. const _hoisted_13$7 = [
  3158. _hoisted_12$7
  3159. ];
  3160. const _hoisted_14$6 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("span", null, "主题设置", -1));
  3161. const _hoisted_15$5 = [
  3162. _hoisted_14$6
  3163. ];
  3164. const _hoisted_16$5 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("span", null, "其他设置", -1));
  3165. const _hoisted_17$5 = [
  3166. _hoisted_16$5
  3167. ];
  3168. const _hoisted_18$5 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("span", null, "关于脚本", -1));
  3169. const _hoisted_19$4 = [
  3170. _hoisted_18$5
  3171. ];
  3172. const _hoisted_20$3 = { class: "icons" };
  3173. const _hoisted_21$3 = ["href"];
  3174. const _hoisted_22$3 = ["href"];
  3175. const _hoisted_23$3 = { class: "modal-content" };
  3176. const _hoisted_24$2 = { class: "scroll" };
  3177. const _hoisted_25$1 = { key: 0 };
  3178. const _hoisted_26$1 = { class: "row" };
  3179. const _hoisted_27$1 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "列表展示方式", -1));
  3180. const _hoisted_28$1 = { class: "wrapper" };
  3181. const _hoisted_29$1 = { class: "radio-group2" };
  3182. const _hoisted_30$1 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "desc danger" }, " 提示:此项需要刷新页面才能生效 ", -1));
  3183. const _hoisted_31$1 = { class: "row" };
  3184. const _hoisted_32$1 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "主题弹框显示", -1));
  3185. const _hoisted_33$1 = { class: "wrapper" };
  3186. const _hoisted_34$1 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "desc" }, [
  3187. /* @__PURE__ */ vue.createTextVNode(" 开启此选项后,主题会"),
  3188. /* @__PURE__ */ vue.createElementVNode("span", { class: "danger" }, "始终"),
  3189. /* @__PURE__ */ vue.createTextVNode("以弹框的方式显示。优先级大于“新标签页打开链接” ")
  3190. ], -1));
  3191. const _hoisted_35$1 = { class: "row" };
  3192. const _hoisted_36$1 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "新标签页打开链接", -1));
  3193. const _hoisted_37$1 = { class: "wrapper" };
  3194. const _hoisted_38$1 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "desc" }, " 网页上所有链接通过新标签页打开 ", -1));
  3195. const _hoisted_39$1 = { class: "row" };
  3196. const _hoisted_40$1 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "打开新标签页时立即切换过去", -1));
  3197. const _hoisted_41$1 = { class: "wrapper" };
  3198. const _hoisted_42$1 = { key: 1 };
  3199. const _hoisted_43$1 = { class: "row" };
  3200. const _hoisted_44$1 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "回复类型", -1));
  3201. const _hoisted_45$1 = { class: "wrapper" };
  3202. const _hoisted_46$1 = { class: "row" };
  3203. const _hoisted_47$1 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "详情页中显示“回复类型”", -1));
  3204. const _hoisted_48 = { class: "wrapper" };
  3205. const _hoisted_49 = { class: "row" };
  3206. const _hoisted_50 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "替换Imgur源", -1));
  3207. const _hoisted_51 = { class: "wrapper" };
  3208. const _hoisted_52 = { class: "row" };
  3209. const _hoisted_53 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "单独打开主题时默认显示楼中楼", -1));
  3210. const _hoisted_54 = { class: "wrapper" };
  3211. const _hoisted_55 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "desc" }, " 单独打开这种地址 https://v2ex.com/t/xxxx 时,是否默认显示楼中楼 ", -1));
  3212. const _hoisted_56 = { class: "row" };
  3213. const _hoisted_57 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "点击左右两侧透明处关闭主题详情弹框", -1));
  3214. const _hoisted_58 = { class: "wrapper" };
  3215. const _hoisted_59 = { class: "row" };
  3216. const _hoisted_60 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "正文超长自动折叠", -1));
  3217. const _hoisted_61 = { class: "wrapper" };
  3218. const _hoisted_62 = { class: "row" };
  3219. const _hoisted_63 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "主题宽度", -1));
  3220. const _hoisted_64 = { class: "wrapper" };
  3221. const _hoisted_65 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "desc" }, [
  3222. /* @__PURE__ */ vue.createTextVNode(" 未设定此值时,则默认宽度为77rem。接受合法的width值: "),
  3223. /* @__PURE__ */ vue.createElementVNode("a", {
  3224. href: "https://vue3js.cn/interview/css/em_px_rem_vh_vw.html#%E4%BA%8C%E3%80%81%E5%8D%95%E4%BD%8D",
  3225. target: "_blank"
  3226. }, "rem、px、vw、vh(点此查看)"),
  3227. /* @__PURE__ */ vue.createTextVNode("。 vw代表屏幕百分比,如想要屏幕的66%,请填写66vw ")
  3228. ], -1));
  3229. const _hoisted_66 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "desc" }, " 提示:此项设置以后,单独打开详情页时会出现主题突然变宽(窄)的问题,暂时无解 ", -1));
  3230. const _hoisted_67 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "desc danger" }, " 提示:此项需要刷新页面才能生效 ", -1));
  3231. const _hoisted_68 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "row" }, [
  3232. /* @__PURE__ */ vue.createElementVNode("label", { class: "main-title" }, "高赞回复")
  3233. ], -1));
  3234. const _hoisted_69 = { class: "row" };
  3235. const _hoisted_70 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "显示高赞回复", -1));
  3236. const _hoisted_71 = { class: "wrapper" };
  3237. const _hoisted_72 = { class: "row" };
  3238. const _hoisted_73 = { class: "item-title" };
  3239. const _hoisted_74 = { class: "wrapper" };
  3240. const _hoisted_75 = { class: "row" };
  3241. const _hoisted_76 = { class: "item-title" };
  3242. const _hoisted_77 = { class: "wrapper" };
  3243. const _hoisted_78 = { key: 2 };
  3244. const _hoisted_79 = { class: "row" };
  3245. const _hoisted_80 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "用户打标签(跨平台,数据保存在自己的记事本):", -1));
  3246. const _hoisted_81 = { class: "wrapper" };
  3247. const _hoisted_82 = { class: "row" };
  3248. const _hoisted_83 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "划词显示Base64解码框", -1));
  3249. const _hoisted_84 = { class: "wrapper" };
  3250. const _hoisted_85 = { class: "row" };
  3251. const _hoisted_86 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "自动签到", -1));
  3252. const _hoisted_87 = { class: "wrapper" };
  3253. const _hoisted_88 = { class: "row" };
  3254. const _hoisted_89 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "自定义背景", -1));
  3255. const _hoisted_90 = { class: "wrapper" };
  3256. const _hoisted_91 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "desc" }, [
  3257. /* @__PURE__ */ vue.createTextVNode(" 未设定此值时,则脚本就什么都不做,V站大部分页面背景颜色默认为 #e2e2e2,少部分页面有特定背景。接受一个合法的css color值:例如"),
  3258. /* @__PURE__ */ vue.createElementVNode("a", {
  3259. href: "https://developer.mozilla.org/zh-CN/docs/Web/CSS/color_value",
  3260. target: "_blank"
  3261. }, "red、#ffffff、rgb(222,222,22)(点此查看)"),
  3262. /* @__PURE__ */ vue.createTextVNode("等等。 ")
  3263. ], -1));
  3264. const _hoisted_92 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "desc danger" }, " 提示:此项需要刷新页面才能生效 ", -1));
  3265. const _hoisted_93 = { class: "row" };
  3266. const _hoisted_94 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "收藏时提醒添加到书签", -1));
  3267. const _hoisted_95 = { class: "wrapper" };
  3268. const _hoisted_96 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "desc" }, " V站帐号一旦被封禁,则无法登录,无法查看账号收藏了 ", -1));
  3269. const _hoisted_97 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "row" }, [
  3270. /* @__PURE__ */ vue.createElementVNode("label", { class: "main-title" }, "消息通知")
  3271. ], -1));
  3272. const _hoisted_98 = { class: "row" };
  3273. const _hoisted_99 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "接管未读提醒页面", -1));
  3274. const _hoisted_100 = { class: "wrapper" };
  3275. const _hoisted_101 = { class: "row" };
  3276. const _hoisted_102 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "定时查询未读提醒", -1));
  3277. const _hoisted_103 = { class: "wrapper" };
  3278. const _hoisted_104 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "desc" }, " 开启此功能会带来以下影响: 1、你的IP可能会被封禁 2、消耗更多流量,给服务器带来更大的负担 3、你的V站浏览进度条会变快 ", -1));
  3279. const _hoisted_105 = {
  3280. key: 0,
  3281. class: "sub-content"
  3282. };
  3283. const _hoisted_106 = { class: "row" };
  3284. const _hoisted_107 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "查询间隔", -1));
  3285. const _hoisted_108 = { class: "wrapper" };
  3286. const _hoisted_109 = ["value"];
  3287. const _hoisted_110 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "desc" }, " 设置值太小,会导致频繁请求,你的IP可能会被封禁,建议设置为5,即每次5分钟查询一次 ", -1));
  3288. const _hoisted_111 = { class: "row" };
  3289. const _hoisted_112 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "当有新未读提醒时,网页标题闪烁", -1));
  3290. const _hoisted_113 = { class: "wrapper" };
  3291. const _hoisted_114 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "row" }, [
  3292. /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "钉钉Webhook地址")
  3293. ], -1));
  3294. const _hoisted_115 = { class: "desc" };
  3295. const _hoisted_116 = ["value"];
  3296. const _hoisted_117 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "desc danger" }, " 提示:此项需要刷新页面才能生效 ", -1));
  3297. const _hoisted_118 = { key: 3 };
  3298. const _hoisted_119 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("h1", null, "V2EX Next", -1));
  3299. const _hoisted_120 = { class: "project-desc" };
  3300. const _hoisted_121 = { style: { "line-height": "2" } };
  3301. const _hoisted_122 = ["href"];
  3302. const _hoisted_123 = ["href"];
  3303. const _hoisted_124 = ["href"];
  3304. const _hoisted_125 = ["href"];
  3305. const _hoisted_126 = ["href"];
  3306. const _hoisted_127 = ["href"];
  3307. function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
  3308. const _component_Icon = vue.resolveComponent("Icon");
  3309. const _component_BaseSwitch = vue.resolveComponent("BaseSwitch");
  3310. const _component_BaseSelect = vue.resolveComponent("BaseSelect");
  3311. const _component_NoticeModal = vue.resolveComponent("NoticeModal");
  3312. return vue.openBlock(), vue.createBlock(vue.Transition, null, {
  3313. default: vue.withCtx(() => [
  3314. $props.show ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$f, [
  3315. vue.createElementVNode("div", {
  3316. class: "mask",
  3317. onClick: _cache[0] || (_cache[0] = (...args) => $options.close && $options.close(...args))
  3318. }),
  3319. vue.createElementVNode("div", _hoisted_2$c, [
  3320. vue.createElementVNode("div", _hoisted_3$a, [
  3321. vue.createElementVNode("div", _hoisted_4$a, [
  3322. vue.createTextVNode(" 脚本设置 "),
  3323. vue.createElementVNode("div", _hoisted_5$8, [
  3324. vue.createElementVNode("a", {
  3325. href: $options.DefaultVal.mobileScript,
  3326. target: "_blank"
  3327. }, "(脚本现已支持移动端!)", 8, _hoisted_6$8)
  3328. ])
  3329. ]),
  3330. vue.createVNode(_component_Icon, {
  3331. icon: "ic:round-close",
  3332. onClick: $options.close
  3333. }, null, 8, ["onClick"])
  3334. ]),
  3335. $options.isNew ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7$7, [
  3336. vue.createElementVNode("a", {
  3337. onClick: _cache[1] || (_cache[1] = (...args) => $options.goPost && $options.goPost(...args))
  3338. }, "New:手机App现已发布,支持楼中楼!PC脚本新增历史最热数据、imgur换源功能!点击查看详细介绍"),
  3339. _hoisted_8$7
  3340. ])) : vue.createCommentVNode("", true),
  3341. vue.createElementVNode("div", _hoisted_9$7, [
  3342. vue.createElementVNode("div", _hoisted_10$7, [
  3343. vue.createElementVNode("div", _hoisted_11$7, [
  3344. vue.createElementVNode("div", {
  3345. class: vue.normalizeClass(["tab", $data.tabIndex === 0 && "active"]),
  3346. onClick: _cache[2] || (_cache[2] = ($event) => $data.tabIndex = 0)
  3347. }, _hoisted_13$7, 2),
  3348. vue.createElementVNode("div", {
  3349. class: vue.normalizeClass(["tab", $data.tabIndex === 1 && "active"]),
  3350. onClick: _cache[3] || (_cache[3] = ($event) => $data.tabIndex = 1)
  3351. }, _hoisted_15$5, 2),
  3352. vue.createElementVNode("div", {
  3353. class: vue.normalizeClass(["tab", $data.tabIndex === 2 && "active"]),
  3354. onClick: _cache[4] || (_cache[4] = ($event) => $data.tabIndex = 2)
  3355. }, _hoisted_17$5, 2),
  3356. vue.createElementVNode("div", {
  3357. class: vue.normalizeClass(["tab", $data.tabIndex === 3 && "active"]),
  3358. onClick: _cache[5] || (_cache[5] = ($event) => $data.tabIndex = 3)
  3359. }, _hoisted_19$4, 2)
  3360. ]),
  3361. vue.createElementVNode("div", _hoisted_20$3, [
  3362. vue.createElementVNode("a", {
  3363. href: $options.DefaultVal.git,
  3364. target: "_blank"
  3365. }, [
  3366. vue.createVNode(_component_Icon, { icon: "mdi:github" })
  3367. ], 8, _hoisted_21$3),
  3368. vue.createElementVNode("a", {
  3369. href: $options.DefaultVal.homeUrl,
  3370. target: "_blank"
  3371. }, [
  3372. vue.createVNode(_component_Icon, { icon: "iconamoon:home-light" })
  3373. ], 8, _hoisted_22$3)
  3374. ])
  3375. ]),
  3376. vue.createElementVNode("div", _hoisted_23$3, [
  3377. vue.createElementVNode("div", _hoisted_24$2, [
  3378. $data.tabIndex === 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_25$1, [
  3379. vue.createElementVNode("div", _hoisted_26$1, [
  3380. _hoisted_27$1,
  3381. vue.createElementVNode("div", _hoisted_28$1, [
  3382. vue.createElementVNode("div", _hoisted_29$1, [
  3383. vue.createElementVNode("div", {
  3384. class: vue.normalizeClass(["radio", $data.config.viewType === "simple" ? "active" : ""]),
  3385. onClick: _cache[6] || (_cache[6] = ($event) => $data.config.viewType = "simple")
  3386. }, "简洁 ", 2),
  3387. vue.createElementVNode("div", {
  3388. class: vue.normalizeClass(["radio", $data.config.viewType === "table" ? "active" : ""]),
  3389. onClick: _cache[7] || (_cache[7] = ($event) => $data.config.viewType = "table")
  3390. }, "表格 ", 2),
  3391. vue.createElementVNode("div", {
  3392. class: vue.normalizeClass(["radio", $data.config.viewType === "card" ? "active" : ""]),
  3393. onClick: _cache[8] || (_cache[8] = ($event) => $data.showNotice = true)
  3394. }, "卡片 ", 2)
  3395. ])
  3396. ])
  3397. ]),
  3398. _hoisted_30$1,
  3399. vue.createElementVNode("div", _hoisted_31$1, [
  3400. _hoisted_32$1,
  3401. vue.createElementVNode("div", _hoisted_33$1, [
  3402. vue.createVNode(_component_BaseSwitch, {
  3403. modelValue: $data.config.clickPostItemOpenDetail,
  3404. "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => $data.config.clickPostItemOpenDetail = $event)
  3405. }, null, 8, ["modelValue"])
  3406. ])
  3407. ]),
  3408. _hoisted_34$1,
  3409. vue.createElementVNode("div", _hoisted_35$1, [
  3410. _hoisted_36$1,
  3411. vue.createElementVNode("div", _hoisted_37$1, [
  3412. vue.createVNode(_component_BaseSwitch, {
  3413. modelValue: $data.config.newTabOpen,
  3414. "onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => $data.config.newTabOpen = $event)
  3415. }, null, 8, ["modelValue"])
  3416. ])
  3417. ]),
  3418. _hoisted_38$1,
  3419. vue.createElementVNode("div", _hoisted_39$1, [
  3420. _hoisted_40$1,
  3421. vue.createElementVNode("div", _hoisted_41$1, [
  3422. vue.createVNode(_component_BaseSwitch, {
  3423. modelValue: $data.config.newTabOpenActive,
  3424. "onUpdate:modelValue": _cache[11] || (_cache[11] = ($event) => $data.config.newTabOpenActive = $event)
  3425. }, null, 8, ["modelValue"])
  3426. ])
  3427. ])
  3428. ])) : vue.createCommentVNode("", true),
  3429. $data.tabIndex === 1 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_42$1, [
  3430. vue.createElementVNode("div", _hoisted_43$1, [
  3431. _hoisted_44$1,
  3432. vue.createElementVNode("div", _hoisted_45$1, [
  3433. vue.createVNode(_component_BaseSelect, {
  3434. "display-type": $data.config.commentDisplayType,
  3435. "onUpdate:displayType": _cache[12] || (_cache[12] = ($event) => $data.config.commentDisplayType = $event)
  3436. }, null, 8, ["display-type"])
  3437. ])
  3438. ]),
  3439. vue.createElementVNode("div", _hoisted_46$1, [
  3440. _hoisted_47$1,
  3441. vue.createElementVNode("div", _hoisted_48, [
  3442. vue.createVNode(_component_BaseSwitch, {
  3443. modelValue: $data.config.showToolbar,
  3444. "onUpdate:modelValue": _cache[13] || (_cache[13] = ($event) => $data.config.showToolbar = $event)
  3445. }, null, 8, ["modelValue"])
  3446. ])
  3447. ]),
  3448. vue.createElementVNode("div", _hoisted_49, [
  3449. _hoisted_50,
  3450. vue.createElementVNode("div", _hoisted_51, [
  3451. vue.createVNode(_component_BaseSwitch, {
  3452. modelValue: $data.config.replaceImgur,
  3453. "onUpdate:modelValue": _cache[14] || (_cache[14] = ($event) => $data.config.replaceImgur = $event)
  3454. }, null, 8, ["modelValue"])
  3455. ])
  3456. ]),
  3457. vue.createElementVNode("div", _hoisted_52, [
  3458. _hoisted_53,
  3459. vue.createElementVNode("div", _hoisted_54, [
  3460. vue.createVNode(_component_BaseSwitch, {
  3461. modelValue: $data.config.autoOpenDetail,
  3462. "onUpdate:modelValue": _cache[15] || (_cache[15] = ($event) => $data.config.autoOpenDetail = $event)
  3463. }, null, 8, ["modelValue"])
  3464. ])
  3465. ]),
  3466. _hoisted_55,
  3467. vue.createElementVNode("div", _hoisted_56, [
  3468. _hoisted_57,
  3469. vue.createElementVNode("div", _hoisted_58, [
  3470. vue.createVNode(_component_BaseSwitch, {
  3471. modelValue: $data.config.closePostDetailBySpace,
  3472. "onUpdate:modelValue": _cache[16] || (_cache[16] = ($event) => $data.config.closePostDetailBySpace = $event)
  3473. }, null, 8, ["modelValue"])
  3474. ])
  3475. ]),
  3476. vue.createElementVNode("div", _hoisted_59, [
  3477. _hoisted_60,
  3478. vue.createElementVNode("div", _hoisted_61, [
  3479. vue.createVNode(_component_BaseSwitch, {
  3480. modelValue: $data.config.contentAutoCollapse,
  3481. "onUpdate:modelValue": _cache[17] || (_cache[17] = ($event) => $data.config.contentAutoCollapse = $event)
  3482. }, null, 8, ["modelValue"])
  3483. ])
  3484. ]),
  3485. vue.createElementVNode("div", _hoisted_62, [
  3486. _hoisted_63,
  3487. vue.createElementVNode("div", _hoisted_64, [
  3488. vue.withDirectives(vue.createElementVNode("input", {
  3489. type: "text",
  3490. "onUpdate:modelValue": _cache[18] || (_cache[18] = ($event) => $data.config.postWidth = $event)
  3491. }, null, 512), [
  3492. [vue.vModelText, $data.config.postWidth]
  3493. ])
  3494. ])
  3495. ]),
  3496. _hoisted_65,
  3497. _hoisted_66,
  3498. _hoisted_67,
  3499. _hoisted_68,
  3500. vue.createElementVNode("div", _hoisted_69, [
  3501. _hoisted_70,
  3502. vue.createElementVNode("div", _hoisted_71, [
  3503. vue.createVNode(_component_BaseSwitch, {
  3504. modelValue: $data.config.showTopReply,
  3505. "onUpdate:modelValue": _cache[19] || (_cache[19] = ($event) => $data.config.showTopReply = $event)
  3506. }, null, 8, ["modelValue"])
  3507. ])
  3508. ]),
  3509. vue.createElementVNode("div", _hoisted_72, [
  3510. vue.createElementVNode("label", _hoisted_73, "最多显示" + vue.toDisplayString($data.config.topReplyCount) + "个高赞回复", 1),
  3511. vue.createElementVNode("div", _hoisted_74, [
  3512. vue.withDirectives(vue.createElementVNode("input", {
  3513. type: "number",
  3514. min: "1",
  3515. "onUpdate:modelValue": _cache[20] || (_cache[20] = ($event) => $data.config.topReplyCount = $event)
  3516. }, null, 512), [
  3517. [vue.vModelText, $data.config.topReplyCount]
  3518. ])
  3519. ])
  3520. ]),
  3521. vue.createElementVNode("div", _hoisted_75, [
  3522. vue.createElementVNode("label", _hoisted_76, "最少需要" + vue.toDisplayString($data.config.topReplyLoveMinCount) + "个赞才能被判定为高赞", 1),
  3523. vue.createElementVNode("div", _hoisted_77, [
  3524. vue.withDirectives(vue.createElementVNode("input", {
  3525. type: "number",
  3526. min: "1",
  3527. "onUpdate:modelValue": _cache[21] || (_cache[21] = ($event) => $data.config.topReplyLoveMinCount = $event)
  3528. }, null, 512), [
  3529. [vue.vModelText, $data.config.topReplyLoveMinCount]
  3530. ])
  3531. ])
  3532. ])
  3533. ])) : vue.createCommentVNode("", true),
  3534. $data.tabIndex === 2 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_78, [
  3535. vue.createElementVNode("div", _hoisted_79, [
  3536. _hoisted_80,
  3537. vue.createElementVNode("div", _hoisted_81, [
  3538. vue.createVNode(_component_BaseSwitch, {
  3539. modelValue: $data.config.openTag,
  3540. "onUpdate:modelValue": _cache[22] || (_cache[22] = ($event) => $data.config.openTag = $event)
  3541. }, null, 8, ["modelValue"])
  3542. ])
  3543. ]),
  3544. vue.createElementVNode("div", _hoisted_82, [
  3545. _hoisted_83,
  3546. vue.createElementVNode("div", _hoisted_84, [
  3547. vue.createVNode(_component_BaseSwitch, {
  3548. modelValue: $data.config.base64,
  3549. "onUpdate:modelValue": _cache[23] || (_cache[23] = ($event) => $data.config.base64 = $event)
  3550. }, null, 8, ["modelValue"])
  3551. ])
  3552. ]),
  3553. vue.createElementVNode("div", _hoisted_85, [
  3554. _hoisted_86,
  3555. vue.createElementVNode("div", _hoisted_87, [
  3556. vue.createVNode(_component_BaseSwitch, {
  3557. modelValue: $data.config.autoSignin,
  3558. "onUpdate:modelValue": _cache[24] || (_cache[24] = ($event) => $data.config.autoSignin = $event)
  3559. }, null, 8, ["modelValue"])
  3560. ])
  3561. ]),
  3562. vue.createElementVNode("div", _hoisted_88, [
  3563. _hoisted_89,
  3564. vue.createElementVNode("div", _hoisted_90, [
  3565. vue.withDirectives(vue.createElementVNode("input", {
  3566. type: "text",
  3567. "onUpdate:modelValue": _cache[25] || (_cache[25] = ($event) => $data.config.customBgColor = $event)
  3568. }, null, 512), [
  3569. [vue.vModelText, $data.config.customBgColor]
  3570. ])
  3571. ])
  3572. ]),
  3573. _hoisted_91,
  3574. _hoisted_92,
  3575. vue.createElementVNode("div", _hoisted_93, [
  3576. _hoisted_94,
  3577. vue.createElementVNode("div", _hoisted_95, [
  3578. vue.createVNode(_component_BaseSwitch, {
  3579. modelValue: $data.config.collectBrowserNotice,
  3580. "onUpdate:modelValue": _cache[26] || (_cache[26] = ($event) => $data.config.collectBrowserNotice = $event)
  3581. }, null, 8, ["modelValue"])
  3582. ])
  3583. ]),
  3584. _hoisted_96,
  3585. _hoisted_97,
  3586. vue.createElementVNode("div", _hoisted_98, [
  3587. _hoisted_99,
  3588. vue.createElementVNode("div", _hoisted_100, [
  3589. vue.createVNode(_component_BaseSwitch, {
  3590. modelValue: $data.config.notice.takeOverNoticePage,
  3591. "onUpdate:modelValue": _cache[27] || (_cache[27] = ($event) => $data.config.notice.takeOverNoticePage = $event)
  3592. }, null, 8, ["modelValue"])
  3593. ])
  3594. ]),
  3595. vue.createElementVNode("div", _hoisted_101, [
  3596. _hoisted_102,
  3597. vue.createElementVNode("div", _hoisted_103, [
  3598. vue.createVNode(_component_BaseSwitch, {
  3599. modelValue: $data.config.notice.loopCheckNotice,
  3600. "onUpdate:modelValue": _cache[28] || (_cache[28] = ($event) => $data.config.notice.loopCheckNotice = $event)
  3601. }, null, 8, ["modelValue"])
  3602. ])
  3603. ]),
  3604. _hoisted_104,
  3605. $data.config.notice.loopCheckNotice ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_105, [
  3606. vue.createElementVNode("div", _hoisted_106, [
  3607. _hoisted_107,
  3608. vue.createElementVNode("div", _hoisted_108, [
  3609. vue.createElementVNode("input", {
  3610. type: "number",
  3611. value: $data.config.notice.loopCheckNoticeInterval,
  3612. onBlur: _cache[29] || (_cache[29] = (e2) => $data.config.notice.loopCheckNoticeInterval = e2.target.value),
  3613. style: { "margin-right": "1rem" }
  3614. }, null, 40, _hoisted_109),
  3615. vue.createTextVNode("分钟 ")
  3616. ])
  3617. ]),
  3618. _hoisted_110,
  3619. vue.createElementVNode("div", _hoisted_111, [
  3620. _hoisted_112,
  3621. vue.createElementVNode("div", _hoisted_113, [
  3622. vue.createVNode(_component_BaseSwitch, {
  3623. modelValue: $data.config.notice.whenNewNoticeGlimmer,
  3624. "onUpdate:modelValue": _cache[30] || (_cache[30] = ($event) => $data.config.notice.whenNewNoticeGlimmer = $event)
  3625. }, null, 8, ["modelValue"])
  3626. ])
  3627. ]),
  3628. _hoisted_114,
  3629. vue.createElementVNode("div", _hoisted_115, [
  3630. vue.createElementVNode("input", {
  3631. type: "text",
  3632. value: $data.config.notice.ddWebhook,
  3633. onBlur: _cache[31] || (_cache[31] = (e2) => $data.config.notice.ddWebhook = e2.target.value),
  3634. style: { "width": "100%" }
  3635. }, null, 40, _hoisted_116)
  3636. ])
  3637. ])) : vue.createCommentVNode("", true),
  3638. _hoisted_117
  3639. ])) : vue.createCommentVNode("", true),
  3640. $data.tabIndex === 3 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_118, [
  3641. _hoisted_119,
  3642. vue.createElementVNode("div", _hoisted_120, [
  3643. vue.createElementVNode("div", _hoisted_121, [
  3644. vue.createElementVNode("div", null, [
  3645. vue.createTextVNode("官网:"),
  3646. vue.createElementVNode("a", {
  3647. href: $options.DefaultVal.homeUrl,
  3648. target: "_blank"
  3649. }, vue.toDisplayString($options.DefaultVal.homeUrl), 9, _hoisted_122)
  3650. ]),
  3651. vue.createElementVNode("div", null, [
  3652. vue.createTextVNode("GitHub地址:"),
  3653. vue.createElementVNode("a", {
  3654. href: $options.DefaultVal.git,
  3655. target: "_blank"
  3656. }, vue.toDisplayString($options.DefaultVal.git), 9, _hoisted_123)
  3657. ]),
  3658. vue.createElementVNode("div", null, [
  3659. vue.createTextVNode("PC脚本地址:"),
  3660. vue.createElementVNode("a", {
  3661. href: $options.DefaultVal.pcScript,
  3662. target: "_blank"
  3663. }, vue.toDisplayString($options.DefaultVal.pcScript), 9, _hoisted_124)
  3664. ]),
  3665. vue.createElementVNode("div", null, [
  3666. vue.createTextVNode("移动端脚本地址:"),
  3667. vue.createElementVNode("a", {
  3668. href: $options.DefaultVal.mobileScript,
  3669. target: "_blank"
  3670. }, vue.toDisplayString($options.DefaultVal.mobileScript), 9, _hoisted_125)
  3671. ]),
  3672. vue.createElementVNode("div", null, [
  3673. vue.createTextVNode("反馈: "),
  3674. vue.createElementVNode("a", {
  3675. href: $options.DefaultVal.issue,
  3676. target: "_blank"
  3677. }, vue.toDisplayString($options.DefaultVal.issue), 9, _hoisted_126)
  3678. ]),
  3679. vue.createElementVNode("div", null, [
  3680. vue.createTextVNode("更新日志:"),
  3681. vue.createElementVNode("a", {
  3682. href: $options.DefaultVal.pcLog,
  3683. target: "_blank"
  3684. }, vue.toDisplayString($options.DefaultVal.pcLog), 9, _hoisted_127)
  3685. ])
  3686. ])
  3687. ])
  3688. ])) : vue.createCommentVNode("", true)
  3689. ])
  3690. ])
  3691. ])
  3692. ]),
  3693. vue.createVNode(_component_NoticeModal, {
  3694. show: $data.showNotice,
  3695. "onUpdate:show": _cache[32] || (_cache[32] = ($event) => $data.showNotice = $event),
  3696. onConfirm: _cache[33] || (_cache[33] = ($event) => $data.config.viewType = "card")
  3697. }, null, 8, ["show"])
  3698. ])) : vue.createCommentVNode("", true)
  3699. ]),
  3700. _: 1
  3701. });
  3702. }
  3703. const Setting = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", _sfc_render$8], ["__scopeId", "data-v-b34c6692"]]);
  3704. const _sfc_main$e = {
  3705. name: "Point",
  3706. components: { PopConfirm, Icon },
  3707. inject: ["post", "isLogin"],
  3708. props: {
  3709. item: {
  3710. type: Object,
  3711. default() {
  3712. return {};
  3713. }
  3714. },
  3715. apiUrl: ""
  3716. },
  3717. computed: {
  3718. disabled() {
  3719. return this.item.username === window.user.username || this.item.isThanked || !this.isLogin;
  3720. }
  3721. },
  3722. methods: {
  3723. thankError() {
  3724. if (!this.isLogin) {
  3725. return eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "请先登录!" });
  3726. }
  3727. if (this.item.username === window.user.username) {
  3728. return eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "不能感谢自己" });
  3729. }
  3730. if (this.item.isThanked) {
  3731. return eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "已经感谢过了" });
  3732. }
  3733. },
  3734. async thank() {
  3735. this.$emit("addThank");
  3736. let url = `${location.origin}/thank/${this.apiUrl}?once=${this.post.once}`;
  3737. $.post(url).then((res) => {
  3738. if (!res.success) {
  3739. this.$emit("recallThank");
  3740. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: res.message });
  3741. }
  3742. eventBus.emit(CMD.REFRESH_ONCE, res.once);
  3743. }, (err) => {
  3744. this.$emit("recallThank");
  3745. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "感谢失败" });
  3746. eventBus.emit(CMD.REFRESH_ONCE);
  3747. });
  3748. }
  3749. }
  3750. };
  3751. const _hoisted_1$e = {
  3752. key: 2,
  3753. class: "link-num"
  3754. };
  3755. const _hoisted_2$b = { key: 3 };
  3756. function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
  3757. const _component_Icon = vue.resolveComponent("Icon");
  3758. const _component_PopConfirm = vue.resolveComponent("PopConfirm");
  3759. return vue.openBlock(), vue.createBlock(_component_PopConfirm, {
  3760. disabled: $options.disabled,
  3761. title: `确认花费 10 个铜币向 @${$props.item.username} 的这条回复发送感谢?`,
  3762. onConfirm: $options.thank
  3763. }, {
  3764. default: vue.withCtx(() => [
  3765. vue.createElementVNode("div", {
  3766. class: vue.normalizeClass(["tool", [$options.disabled && "disabled"]]),
  3767. onClick: _cache[0] || (_cache[0] = (...args) => $options.thankError && $options.thankError(...args))
  3768. }, [
  3769. $props.item.isThanked ? (vue.openBlock(), vue.createBlock(_component_Icon, {
  3770. key: 0,
  3771. color: "rgb(224,42,42)",
  3772. icon: "icon-park-solid:like"
  3773. })) : (vue.openBlock(), vue.createBlock(_component_Icon, {
  3774. key: 1,
  3775. color: !$props.item.thankCount ? null : "rgb(224,42,42)",
  3776. icon: "icon-park-outline:like"
  3777. }, null, 8, ["color"])),
  3778. $props.item.thankCount ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$e, vue.toDisplayString($props.item.thankCount), 1)) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_2$b, "感谢"))
  3779. ], 2)
  3780. ]),
  3781. _: 1
  3782. }, 8, ["disabled", "title", "onConfirm"]);
  3783. }
  3784. const Point = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_render$7]]);
  3785. const _sfc_main$d = {
  3786. name: "Author",
  3787. components: { PopConfirm, Point, Icon },
  3788. inject: ["isLogin", "tags", "config", "isNight"],
  3789. props: {
  3790. modelValue: false,
  3791. comment: {
  3792. type: Object,
  3793. default() {
  3794. return {};
  3795. }
  3796. },
  3797. type: {
  3798. type: String,
  3799. default() {
  3800. return "list";
  3801. }
  3802. }
  3803. },
  3804. computed: {
  3805. isDev() {
  3806. return false;
  3807. },
  3808. pointInfo() {
  3809. return {
  3810. isThanked: this.comment.isThanked,
  3811. thankCount: this.comment.thankCount,
  3812. username: this.comment.username
  3813. };
  3814. },
  3815. myTags() {
  3816. return this.tags[this.comment.username] ?? [];
  3817. },
  3818. context() {
  3819. return this.comment.replyUsers.length;
  3820. }
  3821. },
  3822. methods: {
  3823. jump() {
  3824. eventBus.emit(CMD.JUMP, this.comment.floor);
  3825. },
  3826. showRelationReply() {
  3827. if (!this.comment.replyUsers.length) {
  3828. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "该回复无上下文" });
  3829. return;
  3830. }
  3831. eventBus.emit(CMD.RELATION_REPLY, {
  3832. left: this.comment.replyUsers,
  3833. right: this.comment.username,
  3834. rightFloor: this.comment.floor
  3835. });
  3836. },
  3837. addTag() {
  3838. eventBus.emit(CMD.ADD_TAG, this.comment.username);
  3839. },
  3840. removeTag(tag) {
  3841. eventBus.emit(CMD.REMOVE_TAG, { username: this.comment.username, tag });
  3842. },
  3843. checkIsLogin(emitName = "") {
  3844. if (!this.isLogin) {
  3845. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "请先登录!" });
  3846. return false;
  3847. }
  3848. this.$emit(emitName);
  3849. return true;
  3850. },
  3851. addThank() {
  3852. eventBus.emit(CMD.CHANGE_COMMENT_THANK, { id: this.comment.id, type: "add" });
  3853. },
  3854. recallThank() {
  3855. eventBus.emit(CMD.CHANGE_COMMENT_THANK, { id: this.comment.id, type: "recall" });
  3856. }
  3857. }
  3858. };
  3859. const _withScopeId$9 = (n2) => (vue.pushScopeId("data-v-64aa1930"), n2 = n2(), vue.popScopeId(), n2);
  3860. const _hoisted_1$d = { class: "Author-left" };
  3861. const _hoisted_2$a = ["href"];
  3862. const _hoisted_3$9 = ["src"];
  3863. const _hoisted_4$9 = { class: "texts" };
  3864. const _hoisted_5$7 = ["href"];
  3865. const _hoisted_6$7 = {
  3866. key: 0,
  3867. class: "owner"
  3868. };
  3869. const _hoisted_7$6 = {
  3870. key: 1,
  3871. class: "dup"
  3872. };
  3873. const _hoisted_8$6 = {
  3874. key: 2,
  3875. class: "mod"
  3876. };
  3877. const _hoisted_9$6 = { class: "ago" };
  3878. const _hoisted_10$6 = { class: "my-tag" };
  3879. const _hoisted_11$6 = /* @__PURE__ */ _withScopeId$9(() => /* @__PURE__ */ vue.createElementVNode("i", { class: "fa fa-tag" }, null, -1));
  3880. const _hoisted_12$6 = ["onClick"];
  3881. const _hoisted_13$6 = { class: "Author-right" };
  3882. const _hoisted_14$5 = {
  3883. key: 0,
  3884. class: "toolbar"
  3885. };
  3886. const _hoisted_15$4 = { class: "tool" };
  3887. const _hoisted_16$4 = /* @__PURE__ */ _withScopeId$9(() => /* @__PURE__ */ vue.createElementVNode("span", null, "隐藏", -1));
  3888. const _hoisted_17$4 = /* @__PURE__ */ _withScopeId$9(() => /* @__PURE__ */ vue.createElementVNode("span", null, "上下文", -1));
  3889. const _hoisted_18$4 = /* @__PURE__ */ _withScopeId$9(() => /* @__PURE__ */ vue.createElementVNode("span", null, "跳转", -1));
  3890. const _hoisted_19$3 = /* @__PURE__ */ _withScopeId$9(() => /* @__PURE__ */ vue.createElementVNode("span", null, "回复", -1));
  3891. function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
  3892. const _component_Icon = vue.resolveComponent("Icon");
  3893. const _component_PopConfirm = vue.resolveComponent("PopConfirm");
  3894. const _component_Point = vue.resolveComponent("Point");
  3895. return vue.openBlock(), vue.createElementBlock("div", {
  3896. class: vue.normalizeClass(["Author", { expand: !$props.modelValue }])
  3897. }, [
  3898. vue.createElementVNode("div", _hoisted_1$d, [
  3899. !$props.modelValue ? (vue.openBlock(), vue.createBlock(_component_Icon, {
  3900. key: 0,
  3901. onClick: _cache[0] || (_cache[0] = vue.withModifiers(($event) => _ctx.$emit("update:modelValue", true), ["stop"])),
  3902. color: "#177EC9",
  3903. class: "expand-icon",
  3904. icon: "gravity-ui:chevrons-expand-up-right"
  3905. })) : vue.createCommentVNode("", true),
  3906. $options.config.viewType !== "simple" ? (vue.openBlock(), vue.createElementBlock("a", {
  3907. key: 1,
  3908. class: "avatar",
  3909. href: `/member/${$props.comment.username}`
  3910. }, [
  3911. vue.createElementVNode("img", {
  3912. src: $props.comment.avatar,
  3913. alt: ""
  3914. }, null, 8, _hoisted_3$9)
  3915. ], 8, _hoisted_2$a)) : vue.createCommentVNode("", true),
  3916. vue.createElementVNode("span", _hoisted_4$9, [
  3917. vue.createElementVNode("strong", null, [
  3918. vue.createElementVNode("a", {
  3919. href: `/member/${$props.comment.username}`,
  3920. class: vue.normalizeClass(["username", { "dark": $options.isNight }])
  3921. }, vue.toDisplayString($props.comment.username), 11, _hoisted_5$7)
  3922. ]),
  3923. $props.comment.isOp ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6$7, "OP")) : vue.createCommentVNode("", true),
  3924. $props.comment.isDup ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7$6, "DUP")) : vue.createCommentVNode("", true),
  3925. $props.comment.isMod ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_8$6, "MOD")) : vue.createCommentVNode("", true),
  3926. vue.createElementVNode("span", _hoisted_9$6, vue.toDisplayString($props.comment.date), 1),
  3927. $options.isLogin && $options.config.openTag ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 3 }, [
  3928. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.myTags, (i) => {
  3929. return vue.openBlock(), vue.createElementBlock("span", _hoisted_10$6, [
  3930. _hoisted_11$6,
  3931. vue.createElementVNode("span", null, vue.toDisplayString(i), 1),
  3932. vue.createElementVNode("i", {
  3933. class: "fa fa-trash-o remove",
  3934. onClick: vue.withModifiers(($event) => $options.removeTag(i), ["stop"])
  3935. }, null, 8, _hoisted_12$6)
  3936. ]);
  3937. }), 256)),
  3938. vue.createElementVNode("span", {
  3939. class: "add-tag ago",
  3940. onClick: _cache[1] || (_cache[1] = vue.withModifiers((...args) => $options.addTag && $options.addTag(...args), ["stop"])),
  3941. title: "添加标签"
  3942. }, "+")
  3943. ], 64)) : vue.createCommentVNode("", true)
  3944. ])
  3945. ]),
  3946. vue.createElementVNode("div", _hoisted_13$6, [
  3947. $options.isLogin ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_14$5, [
  3948. vue.createVNode(_component_PopConfirm, {
  3949. title: "确认隐藏这条回复?",
  3950. onConfirm: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("hide"))
  3951. }, {
  3952. default: vue.withCtx(() => [
  3953. vue.createElementVNode("div", _hoisted_15$4, [
  3954. vue.createVNode(_component_Icon, { icon: "fluent:eye-hide-24-regular" }),
  3955. _hoisted_16$4
  3956. ])
  3957. ]),
  3958. _: 1
  3959. }),
  3960. $options.context ? (vue.openBlock(), vue.createElementBlock("div", {
  3961. key: 0,
  3962. class: "tool",
  3963. onClick: _cache[3] || (_cache[3] = vue.withModifiers((...args) => $options.showRelationReply && $options.showRelationReply(...args), ["stop"]))
  3964. }, [
  3965. vue.createVNode(_component_Icon, { icon: "iconoir:page-search" }),
  3966. _hoisted_17$4
  3967. ])) : vue.createCommentVNode("", true),
  3968. $props.type === "top" ? (vue.openBlock(), vue.createElementBlock("div", {
  3969. key: 1,
  3970. class: "tool",
  3971. onClick: _cache[4] || (_cache[4] = vue.withModifiers((...args) => $options.jump && $options.jump(...args), ["stop"]))
  3972. }, [
  3973. vue.createVNode(_component_Icon, { icon: "icon-park-outline:to-bottom" }),
  3974. _hoisted_18$4
  3975. ])) : vue.createCommentVNode("", true),
  3976. vue.createElementVNode("div", {
  3977. class: "tool",
  3978. onClick: _cache[5] || (_cache[5] = vue.withModifiers(($event) => $options.checkIsLogin("reply"), ["stop"]))
  3979. }, [
  3980. vue.createVNode(_component_Icon, { icon: "mynaui:message" }),
  3981. _hoisted_19$3
  3982. ]),
  3983. vue.withDirectives(vue.createVNode(_component_Point, {
  3984. item: $options.pointInfo,
  3985. onAddThank: $options.addThank,
  3986. onRecallThank: $options.recallThank,
  3987. "api-url": "reply/" + $props.comment.id
  3988. }, null, 8, ["item", "onAddThank", "onRecallThank", "api-url"]), [
  3989. [vue.vShow, !$props.comment.thankCount]
  3990. ])
  3991. ])) : vue.createCommentVNode("", true),
  3992. vue.withDirectives(vue.createVNode(_component_Point, {
  3993. item: $options.pointInfo,
  3994. onAddThank: $options.addThank,
  3995. onRecallThank: $options.recallThank,
  3996. "api-url": "reply/" + $props.comment.id
  3997. }, null, 8, ["item", "onAddThank", "onRecallThank", "api-url"]), [
  3998. [vue.vShow, $props.comment.thankCount]
  3999. ]),
  4000. vue.createElementVNode("div", {
  4001. class: vue.normalizeClass(["floor", { isDev: $options.isDev }])
  4002. }, vue.toDisplayString($props.comment.floor), 3)
  4003. ])
  4004. ], 2);
  4005. }
  4006. const Author = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_render$6], ["__scopeId", "data-v-64aa1930"]]);
  4007. const _withScopeId$8 = (n2) => (vue.pushScopeId("data-v-19618aa1"), n2 = n2(), vue.popScopeId(), n2);
  4008. const _hoisted_1$c = { class: "get-cursor" };
  4009. const _hoisted_2$9 = ["innerHTML"];
  4010. const _hoisted_3$8 = { class: "toolbar" };
  4011. const _hoisted_4$8 = { class: "left" };
  4012. const _hoisted_5$6 = { class: "upload" };
  4013. const _hoisted_6$6 = {
  4014. key: 0,
  4015. style: { "color": "black", "font-size": "1.4rem" }
  4016. };
  4017. const _hoisted_7$5 = { class: "right" };
  4018. const _hoisted_8$5 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "title" }, "经典", -1));
  4019. const _hoisted_9$5 = { class: "list" };
  4020. const _hoisted_10$5 = ["src", "onClick"];
  4021. const _hoisted_11$5 = { class: "emoji" };
  4022. const _hoisted_12$5 = { class: "title" };
  4023. const _hoisted_13$5 = { class: "list" };
  4024. const _hoisted_14$4 = ["onClick"];
  4025. const _sfc_main$c = {
  4026. __name: "PostEditor",
  4027. props: {
  4028. replyUser: null,
  4029. replyFloor: null,
  4030. useType: {
  4031. type: String,
  4032. default() {
  4033. return "reply-comment";
  4034. }
  4035. }
  4036. },
  4037. emits: ["close"],
  4038. setup(__props, { expose: __expose, emit: __emit }) {
  4039. const props = __props;
  4040. const { replyUser, replyFloor, useType } = props;
  4041. const replyInfo = replyUser ? `@${replyUser} #${replyFloor} ` : "";
  4042. const emits = __emit;
  4043. const post = vue.inject("post");
  4044. const show = vue.inject("show");
  4045. const isNight = vue.inject("isNight");
  4046. vue.inject("pageType");
  4047. const allReplyUsers = vue.inject("allReplyUsers");
  4048. let isFocus = vue.ref(false);
  4049. const loading = vue.ref(false);
  4050. const uploadLoading = vue.ref(false);
  4051. const isShowEmoticons = vue.ref(false);
  4052. const editorId = vue.ref("editorId_" + Date.now());
  4053. const content = vue.ref(replyInfo);
  4054. const txtRef = vue.ref(null);
  4055. const cursorRef = vue.ref(null);
  4056. const emoticonsRef = vue.ref(null);
  4057. const none = vue.ref('<span style="white-space:pre-wrap;"> </span>');
  4058. const imgurClientIdPool = [
  4059. "3107b9ef8b316f3",
  4060. "442b04f26eefc8a",
  4061. "59cfebe717c09e4",
  4062. "60605aad4a62882",
  4063. "6c65ab1d3f5452a",
  4064. "83e123737849aa9",
  4065. "9311f6be1c10160",
  4066. "c4a4a563f698595",
  4067. "81be04b9e4a08ce"
  4068. ];
  4069. __expose({ content, isFocus: () => isFocus.value });
  4070. const editorClass = vue.computed(() => {
  4071. return [useType, isFocus.value ? "isFocus" : "", isNight.value ? "isNight" : ""];
  4072. });
  4073. const cursorHtml = vue.computed(() => {
  4074. var _a;
  4075. if (!txtRef.value || !content.value)
  4076. return "";
  4077. let index = ((_a = txtRef.value) == null ? void 0 : _a.selectionStart) || 0;
  4078. return content.value.substring(0, index).replace(/</g, "<").replace(/>/g, ">").replace(/\n/g, "<br/>").replace(/\s/g, none.value);
  4079. });
  4080. const disabled = vue.computed(() => {
  4081. if (content.value) {
  4082. return content.value === replyInfo;
  4083. } else {
  4084. return true;
  4085. }
  4086. });
  4087. function drop(e2) {
  4088. e2.preventDefault();
  4089. upload(e2.dataTransfer.files[0]);
  4090. }
  4091. async function upload(file) {
  4092. if (!file)
  4093. return;
  4094. if (uploadLoading.value)
  4095. return;
  4096. uploadLoading.value = true;
  4097. const formData = new FormData();
  4098. formData.append("image", file);
  4099. const randomIndex = Math.floor(Math.random() * imgurClientIdPool.length);
  4100. const clidenId = imgurClientIdPool[randomIndex];
  4101. const res = await fetch("https://api.imgur.com/3/upload", {
  4102. method: "POST",
  4103. headers: { Authorization: `Client-ID ${clidenId}` },
  4104. body: formData
  4105. });
  4106. uploadLoading.value = false;
  4107. if (res.ok) {
  4108. const resData = await res.json();
  4109. if (resData.success) {
  4110. return insert(" " + resData.data.link + " ");
  4111. }
  4112. }
  4113. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "上传失败" });
  4114. }
  4115. async function submit() {
  4116. if (disabled.value || loading.value)
  4117. return;
  4118. loading.value = true;
  4119. let submit_content = content.value.replace(/\[((?!\[).)+\]/g, function(match) {
  4120. let item2 = classicsEmoticons.find((v) => v.name === match);
  4121. if (item2) {
  4122. return item2.low + " ";
  4123. }
  4124. return match;
  4125. });
  4126. let show_content = content.value.replace(/https?:\/\/(i\.)?imgur\.com\/((?!http).)+\.(gif|png|jpg|jpeg|GIF|PNG|JPG|JPEG)/g, function(match) {
  4127. return `<img src="${match}" data-originUrl="${match}" data-notice="这个img标签由v2ex-超级增强脚本解析" style="max-width: 100%">`;
  4128. });
  4129. show_content = show_content.replace(/\[((?!\[).)+\]/g, function(match) {
  4130. let item2 = classicsEmoticons.find((v) => v.name === match);
  4131. if (item2) {
  4132. return `<a target="_blank" href="${item2.low}" rel="nofollow noopener"><img src="${item2.low}" class="embedded_image" rel="noreferrer"></a> `;
  4133. }
  4134. return match;
  4135. });
  4136. let matchUsers = show_content.match(/@([\w]+?[\s])/g);
  4137. if (matchUsers) {
  4138. matchUsers.map((i) => {
  4139. let username = i.replace("@", "").replace(" ", "");
  4140. show_content = show_content.replace(username, `<a href="/member/${username}">${username}</a>`);
  4141. });
  4142. }
  4143. show_content = show_content.replaceAll("\n", "<br/>");
  4144. let item = {
  4145. thankCount: 0,
  4146. isThanked: false,
  4147. isOp: post.value.username === window.user.username,
  4148. isDup: false,
  4149. id: Date.now(),
  4150. username: window.user.username,
  4151. avatar: window.user.avatar,
  4152. date: "几秒前",
  4153. floor: post.value.replyCount + 1,
  4154. reply_content: show_content ?? "",
  4155. children: [],
  4156. replyUsers: replyUser ? [replyUser] : [],
  4157. replyFloor: replyFloor || -1,
  4158. level: useType === "reply-comment" ? 1 : 0
  4159. };
  4160. item.hideCallUserReplyContent = item.reply_content;
  4161. if (item.replyUsers.length === 1) {
  4162. item.hideCallUserReplyContent = item.reply_content.replace(/@<a href="\/member\/[\s\S]+?<\/a>(\s#[\d]+)?\s(<br>)?/, () => "");
  4163. }
  4164. let url = `${location.origin}/t/${post.value.id}`;
  4165. $.post(url, { content: submit_content, once: post.value.once }).then(
  4166. // $.post(url, {content: submit_content, once: 123}).then(
  4167. (res) => {
  4168. loading.value = false;
  4169. let r2 = res.search("你上一条回复的内容和这条相同");
  4170. if (r2 > -1)
  4171. return eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "你上一条回复的内容和这条相同" });
  4172. r2 = res.search("请不要在每一个回复中都包括外链,这看起来像是在 spamming");
  4173. if (r2 > -1)
  4174. return eventBus.emit(CMD.SHOW_MSG, {
  4175. type: "error",
  4176. text: "请不要在每一个回复中都包括外链,这看起来像是在 spamming"
  4177. });
  4178. let r22 = res.search("创建新回复");
  4179. if (r22 > -1) {
  4180. eventBus.emit(CMD.REFRESH_ONCE, res);
  4181. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "回复出现了问题,请使用原版进行回复" });
  4182. let clientWidth = window.document.body.clientWidth;
  4183. let windowWidth = 1200;
  4184. let left = clientWidth / 2 - windowWidth / 2;
  4185. let newWin = window.open("创建新回复", "", `width=${windowWidth},height=600,left=${left},top=100`);
  4186. newWin.document.write(res);
  4187. let loop = setInterval(function() {
  4188. if (newWin.closed) {
  4189. clearInterval(loop);
  4190. eventBus.emit(CMD.REFRESH_POST);
  4191. }
  4192. }, 1e3);
  4193. return;
  4194. }
  4195. content.value = replyInfo;
  4196. emits("close");
  4197. eventBus.emit(CMD.REFRESH_ONCE, res);
  4198. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: "回复成功" });
  4199. eventBus.emit(CMD.ADD_REPLY, item);
  4200. },
  4201. (err) => {
  4202. console.log("err", err);
  4203. loading.value = false;
  4204. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "回复失败" });
  4205. }
  4206. ).catch((r2) => {
  4207. console.log("catch", r2);
  4208. });
  4209. }
  4210. function getEmojiSrc(url) {
  4211. return window.config.replaceImgur ? DefaultVal.imgurProxy + url : url;
  4212. }
  4213. function showEmoticons(e2) {
  4214. if (isShowEmoticons.value) {
  4215. return isShowEmoticons.value = false;
  4216. }
  4217. let rect = e2.currentTarget.getBoundingClientRect();
  4218. emoticonsRef.value.style.left = rect.left + 30 + "px";
  4219. emoticonsRef.value.style.bottom = window.innerHeight - rect.top - 20 + "px";
  4220. isShowEmoticons.value = true;
  4221. }
  4222. function off() {
  4223. eventBus.emit(CMD.SHOW_CALL, { show: false });
  4224. eventBus.off(CMD.SET_CALL);
  4225. }
  4226. function checkHeight2() {
  4227. txtRef.value.style.height = 0;
  4228. txtRef.value.style.height = txtRef.value.scrollHeight + "px";
  4229. }
  4230. function insert(str) {
  4231. let cursorPos = txtRef.value.selectionStart;
  4232. let start = content.value.slice(0, cursorPos);
  4233. let end = content.value.slice(cursorPos, content.value.length);
  4234. content.value = start + str + end;
  4235. let moveCursorPos = start.length + str.length;
  4236. setTimeout(() => {
  4237. txtRef.value.focus();
  4238. txtRef.value.setSelectionRange(moveCursorPos, moveCursorPos);
  4239. checkHeight2();
  4240. });
  4241. }
  4242. function showCallPopover(text) {
  4243. let r2 = cursorRef.value.getBoundingClientRect();
  4244. eventBus.emit(CMD.SHOW_CALL, { show: true, top: r2.top, left: r2.left, text });
  4245. eventBus.off(CMD.SET_CALL);
  4246. eventBus.on(CMD.SET_CALL, (e2) => {
  4247. let cursorPos = txtRef.value.selectionStart;
  4248. let start = content.value.slice(0, cursorPos);
  4249. let end = content.value.slice(cursorPos, content.value.length);
  4250. let lastCallPos = start.lastIndexOf("@");
  4251. start = content.value.slice(0, lastCallPos + 1);
  4252. if (e2 === "管理员") {
  4253. e2 = "Livid @Kai @Olivia @GordianZ @sparanoid @drymonfidelia";
  4254. }
  4255. if (e2 === "所有人") {
  4256. e2 = allReplyUsers.value.map((v, i) => {
  4257. if (i)
  4258. return "@" + v;
  4259. else
  4260. return v;
  4261. }).join(" ");
  4262. }
  4263. content.value = start + e2 + " " + end;
  4264. let moveCursorPos = start.length + e2.length + 1;
  4265. setTimeout(() => {
  4266. txtRef.value.setSelectionRange(moveCursorPos, moveCursorPos);
  4267. checkHeight2();
  4268. });
  4269. eventBus.off(CMD.SET_CALL);
  4270. });
  4271. }
  4272. function onKeydown(e2) {
  4273. let code = e2.keyCode;
  4274. switch (code) {
  4275. case 8:
  4276. if (content.value === "@") {
  4277. off();
  4278. }
  4279. break;
  4280. case 37:
  4281. case 38:
  4282. case 39:
  4283. case 40:
  4284. setTimeout(() => onInput({ data: "" }), 100);
  4285. break;
  4286. case 27:
  4287. e2.preventDefault();
  4288. e2.stopPropagation();
  4289. e2.stopImmediatePropagation();
  4290. return false;
  4291. case 13:
  4292. if (e2.ctrlKey)
  4293. submit();
  4294. if (e2.metaKey)
  4295. submit();
  4296. break;
  4297. }
  4298. }
  4299. function onInput(e2) {
  4300. let cursorPos = txtRef.value.selectionStart;
  4301. if (!content.value)
  4302. return;
  4303. if (e2.data === " ") {
  4304. return off();
  4305. }
  4306. if (e2.data === "@") {
  4307. if (content.value.length !== 1) {
  4308. if (content.value[cursorPos - 2] === " " || content.value[cursorPos - 2] === "\n") {
  4309. return showCallPopover("");
  4310. }
  4311. } else {
  4312. return showCallPopover("");
  4313. }
  4314. off();
  4315. } else {
  4316. checkHeight2();
  4317. let judgeStr = content.value.slice(0, cursorPos);
  4318. let lastCallPos = judgeStr.lastIndexOf("@");
  4319. if (lastCallPos === -1) {
  4320. return off();
  4321. }
  4322. let callStr = judgeStr.slice(lastCallPos, cursorPos);
  4323. let hasSpace = callStr.includes(" ");
  4324. if (hasSpace) {
  4325. off();
  4326. } else {
  4327. if (lastCallPos === 0) {
  4328. return showCallPopover(callStr.replace("@", ""));
  4329. }
  4330. if (content.value.length !== 1) {
  4331. if (content.value[lastCallPos - 1] === " " || content.value[lastCallPos - 1] === "\n") {
  4332. return showCallPopover(callStr.replace("@", ""));
  4333. }
  4334. } else {
  4335. return showCallPopover(callStr.replace("@", ""));
  4336. }
  4337. off();
  4338. }
  4339. }
  4340. }
  4341. function onPaste(e2) {
  4342. const dataTransferItemList = e2.clipboardData.items;
  4343. const items = [].slice.call(dataTransferItemList).filter(function(item) {
  4344. return item.type.indexOf("image") !== -1;
  4345. });
  4346. if (items.length === 0) {
  4347. return;
  4348. }
  4349. const dataTransferItem = items[0];
  4350. const blob = dataTransferItem.getAsFile();
  4351. upload(blob);
  4352. }
  4353. function onBlur() {
  4354. document.removeEventListener("paste", onPaste);
  4355. isFocus.value = false;
  4356. }
  4357. function onFocusin() {
  4358. document.addEventListener("paste", onPaste);
  4359. }
  4360. vue.watch(() => show, (n2) => {
  4361. if (n2.value)
  4362. isShowEmoticons.value = false;
  4363. }, { deep: true });
  4364. vue.onMounted(() => {
  4365. $(`.${editorId.value}`).each(function() {
  4366. this.setAttribute("style", "height:" + this.scrollHeight + "px;overflow-y:hidden;");
  4367. }).on("input", function() {
  4368. this.style.height = 0;
  4369. this.style.height = this.scrollHeight + "px";
  4370. });
  4371. if (useType === "reply-comment") {
  4372. txtRef.value && txtRef.value.focus();
  4373. }
  4374. });
  4375. vue.onBeforeUnmount(() => {
  4376. $(`.${editorId.value}`).off();
  4377. });
  4378. return (_ctx, _cache) => {
  4379. return vue.openBlock(), vue.createElementBlock("div", {
  4380. class: vue.normalizeClass(["post-editor-wrapper", editorClass.value])
  4381. }, [
  4382. vue.withDirectives(vue.createElementVNode("textarea", {
  4383. class: vue.normalizeClass(["post-editor", editorId.value]),
  4384. ref_key: "txtRef",
  4385. ref: txtRef,
  4386. onFocus: _cache[0] || (_cache[0] = ($event) => vue.isRef(isFocus) ? isFocus.value = true : isFocus = true),
  4387. onBlur,
  4388. onFocusin,
  4389. placeholder: "请尽量让自己的回复能够对别人有帮助",
  4390. onInput,
  4391. onKeydown,
  4392. onDrop: drop,
  4393. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => content.value = $event)
  4394. }, null, 34), [
  4395. [vue.vModelText, content.value]
  4396. ]),
  4397. vue.createElementVNode("div", _hoisted_1$c, [
  4398. vue.createElementVNode("span", { innerHTML: cursorHtml.value }, null, 8, _hoisted_2$9),
  4399. vue.createElementVNode("span", {
  4400. class: "cursor",
  4401. ref_key: "cursorRef",
  4402. ref: cursorRef
  4403. }, "|", 512)
  4404. ]),
  4405. vue.createElementVNode("div", _hoisted_3$8, [
  4406. vue.createElementVNode("div", _hoisted_4$8, [
  4407. vue.createVNode(vue.unref(Icon), {
  4408. onClick: vue.withModifiers(showEmoticons, ["stop"]),
  4409. icon: "streamline:smiley-happy"
  4410. }),
  4411. vue.createElementVNode("div", _hoisted_5$6, [
  4412. vue.createElementVNode("input", {
  4413. type: "file",
  4414. accept: "image/*",
  4415. onChange: _cache[2] || (_cache[2] = (e2) => upload(e2.currentTarget.files[0]))
  4416. }, null, 32),
  4417. vue.createVNode(vue.unref(Icon), { icon: "lets-icons:img-load-box-fill" })
  4418. ]),
  4419. uploadLoading.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_6$6, "上传中.....")) : vue.createCommentVNode("", true)
  4420. ]),
  4421. vue.createElementVNode("div", _hoisted_7$5, [
  4422. vue.unref(useType) === "reply-comment" ? (vue.openBlock(), vue.createBlock(BaseButton, {
  4423. key: 0,
  4424. type: "link",
  4425. size: "small",
  4426. style: { "margin-right": "1rem", "cursor": "pointer" },
  4427. onClick: _cache[3] || (_cache[3] = vue.withModifiers(($event) => emits("close"), ["stop"]))
  4428. }, {
  4429. default: vue.withCtx(() => [
  4430. vue.createTextVNode(" 关闭 ")
  4431. ]),
  4432. _: 1
  4433. })) : vue.createCommentVNode("", true),
  4434. vue.createVNode(BaseButton, {
  4435. size: "small",
  4436. disabled: disabled.value,
  4437. loading: loading.value,
  4438. onClick: vue.withModifiers(submit, ["stop"])
  4439. }, {
  4440. default: vue.withCtx(() => [
  4441. vue.createTextVNode("回复 ")
  4442. ]),
  4443. _: 1
  4444. }, 8, ["disabled", "loading"])
  4445. ])
  4446. ]),
  4447. vue.withDirectives(vue.createElementVNode("div", {
  4448. class: "emoticon-pack",
  4449. ref_key: "emoticonsRef",
  4450. ref: emoticonsRef
  4451. }, [
  4452. vue.createVNode(vue.unref(Icon), {
  4453. icon: "ic:round-close",
  4454. onClick: _cache[4] || (_cache[4] = vue.withModifiers(($event) => isShowEmoticons.value = false, ["stop"]))
  4455. }),
  4456. _hoisted_8$5,
  4457. vue.createElementVNode("div", _hoisted_9$5, [
  4458. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(classicsEmoticons), (item) => {
  4459. return vue.openBlock(), vue.createElementBlock("img", {
  4460. src: getEmojiSrc(item.high),
  4461. referrerpolicy: "no-referrer",
  4462. onClick: vue.withModifiers(($event) => {
  4463. insert(item.name);
  4464. isShowEmoticons.value = false;
  4465. }, ["stop"])
  4466. }, null, 8, _hoisted_10$5);
  4467. }), 256))
  4468. ]),
  4469. vue.createElementVNode("div", _hoisted_11$5, [
  4470. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(emojiEmoticons), (item) => {
  4471. return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
  4472. vue.createElementVNode("div", _hoisted_12$5, vue.toDisplayString(item.title), 1),
  4473. vue.createElementVNode("div", _hoisted_13$5, [
  4474. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(item.list, (emoji) => {
  4475. return vue.openBlock(), vue.createElementBlock("span", {
  4476. onClick: vue.withModifiers(($event) => {
  4477. insert(emoji);
  4478. isShowEmoticons.value = false;
  4479. }, ["stop"])
  4480. }, vue.toDisplayString(emoji), 9, _hoisted_14$4);
  4481. }), 256))
  4482. ])
  4483. ], 64);
  4484. }), 256))
  4485. ])
  4486. ], 512), [
  4487. [vue.vShow, isShowEmoticons.value]
  4488. ])
  4489. ], 2);
  4490. };
  4491. }
  4492. };
  4493. const PostEditor = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-19618aa1"]]);
  4494. const _hoisted_1$b = {
  4495. key: 0,
  4496. class: "html-wrapper"
  4497. };
  4498. const _hoisted_2$8 = ["innerHTML"];
  4499. const checkHeight = 900;
  4500. const _sfc_main$b = {
  4501. __name: "BaseHtmlRender",
  4502. props: ["html"],
  4503. setup(__props) {
  4504. const config2 = vue.inject("config");
  4505. const props = __props;
  4506. const contentRef = vue.ref(null);
  4507. const mask = vue.ref(false);
  4508. const handOpen = vue.ref(false);
  4509. function mouseup(e2) {
  4510. if (!config2.value.base64)
  4511. return;
  4512. let selectionText = window.getSelection().toString();
  4513. if (selectionText) {
  4514. let r2 = selectionText.match(/([A-Za-z0-9+/=]+)/g);
  4515. if (r2) {
  4516. if (r2[0].length < 4)
  4517. return;
  4518. eventBus.emit(CMD.SHOW_TOOLTIP, { text: r2[0], e: e2 });
  4519. }
  4520. }
  4521. }
  4522. vue.watch(config2.value, (newVale) => {
  4523. if (!newVale.contentAutoCollapse) {
  4524. mask.value = false;
  4525. }
  4526. });
  4527. vue.watch([() => contentRef.value, () => props.html], () => {
  4528. if (!contentRef.value || !props.html)
  4529. return;
  4530. if (!config2.value.contentAutoCollapse)
  4531. return;
  4532. contentRef.value.querySelectorAll("img").forEach((item) => {
  4533. item.removeEventListener("load", checkContentHeight);
  4534. item.addEventListener("load", checkContentHeight);
  4535. });
  4536. checkContentHeight();
  4537. }, { immediate: true, flush: "post" });
  4538. function checkContentHeight() {
  4539. if (handOpen.value)
  4540. return;
  4541. if (!contentRef.value)
  4542. return;
  4543. let rect = contentRef.value.getBoundingClientRect();
  4544. mask.value = rect.height >= checkHeight;
  4545. }
  4546. return (_ctx, _cache) => {
  4547. return props.html ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$b, [
  4548. vue.createElementVNode("div", {
  4549. class: vue.normalizeClass({ mask: mask.value })
  4550. }, [
  4551. vue.createElementVNode("div", {
  4552. ref_key: "contentRef",
  4553. ref: contentRef,
  4554. innerHTML: props.html,
  4555. onMouseup: mouseup
  4556. }, null, 40, _hoisted_2$8)
  4557. ], 2),
  4558. mask.value ? (vue.openBlock(), vue.createElementBlock("div", {
  4559. key: 0,
  4560. class: "expand",
  4561. onClick: _cache[0] || (_cache[0] = ($event) => {
  4562. mask.value = false;
  4563. handOpen.value = true;
  4564. })
  4565. }, "展开")) : vue.createCommentVNode("", true)
  4566. ])) : vue.createCommentVNode("", true);
  4567. };
  4568. }
  4569. };
  4570. const BaseHtmlRender = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-6f61a860"]]);
  4571. const _sfc_main$a = {
  4572. name: "TopSubComment",
  4573. components: { BaseHtmlRender, Author, PostEditor, Point, Icon },
  4574. inject: ["post", "postDetailWidth", "show", "isNight", "isLogin", "tags", "config"],
  4575. props: {
  4576. modelValue: {
  4577. reply_content: ""
  4578. },
  4579. level: -1
  4580. },
  4581. data() {
  4582. return {
  4583. expand: true,
  4584. edit: false,
  4585. replyInfo: `@${this.modelValue.username} #${this.modelValue.floor} `,
  4586. floor: this.modelValue.floor
  4587. };
  4588. },
  4589. watch: {
  4590. show(e2) {
  4591. if (e2) {
  4592. this.edit = false;
  4593. }
  4594. }
  4595. },
  4596. computed: {
  4597. myTags() {
  4598. return this.tags[this.modelValue.username] ?? [];
  4599. }
  4600. },
  4601. methods: {
  4602. jump() {
  4603. eventBus.emit(CMD.JUMP, this.modelValue.floor);
  4604. }
  4605. }
  4606. };
  4607. const _withScopeId$7 = (n2) => (vue.pushScopeId("data-v-d3f8c94b"), n2 = n2(), vue.popScopeId(), n2);
  4608. const _hoisted_1$a = ["data-floor"];
  4609. const _hoisted_2$7 = /* @__PURE__ */ _withScopeId$7(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "left expand-line" }, null, -1));
  4610. const _hoisted_3$7 = { class: "right" };
  4611. const _hoisted_4$7 = { class: "simple-wrapper" };
  4612. function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
  4613. const _component_Author = vue.resolveComponent("Author");
  4614. const _component_BaseHtmlRender = vue.resolveComponent("BaseHtmlRender");
  4615. const _component_PostEditor = vue.resolveComponent("PostEditor");
  4616. const _component_TopSubComment = vue.resolveComponent("TopSubComment", true);
  4617. return vue.openBlock(), vue.createElementBlock("div", {
  4618. class: vue.normalizeClass(["top-sub-comment", $props.level === 1 && "top-sub-reply"]),
  4619. ref: "comment",
  4620. "data-floor": $data.floor
  4621. }, [
  4622. _hoisted_2$7,
  4623. vue.createElementVNode("div", _hoisted_3$7, [
  4624. vue.createVNode(_component_Author, {
  4625. modelValue: $data.expand,
  4626. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.expand = $event),
  4627. comment: $props.modelValue,
  4628. onReply: _cache[1] || (_cache[1] = ($event) => $data.edit = !$data.edit),
  4629. type: "top"
  4630. }, null, 8, ["modelValue", "comment"]),
  4631. vue.createVNode(_component_BaseHtmlRender, {
  4632. class: "top-reply_content reply_content",
  4633. html: $props.modelValue.hideCallUserReplyContent
  4634. }, null, 8, ["html"]),
  4635. $data.edit ? (vue.openBlock(), vue.createBlock(_component_PostEditor, {
  4636. key: 0,
  4637. onClose: _cache[2] || (_cache[2] = ($event) => $data.edit = false),
  4638. replyInfo: $data.replyInfo,
  4639. replyUser: $props.modelValue.username,
  4640. replyFloor: $props.modelValue.floor
  4641. }, null, 8, ["replyInfo", "replyUser", "replyFloor"])) : vue.createCommentVNode("", true),
  4642. vue.createElementVNode("div", _hoisted_4$7, [
  4643. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($props.modelValue.children, (item, index) => {
  4644. return vue.openBlock(), vue.createBlock(_component_TopSubComment, {
  4645. modelValue: $props.modelValue.children[index],
  4646. "onUpdate:modelValue": ($event) => $props.modelValue.children[index] = $event,
  4647. key: index
  4648. }, null, 8, ["modelValue", "onUpdate:modelValue"]);
  4649. }), 128))
  4650. ])
  4651. ])
  4652. ], 10, _hoisted_1$a);
  4653. }
  4654. const TopSubComment = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", _sfc_render$5], ["__scopeId", "data-v-d3f8c94b"]]);
  4655. const _sfc_main$9 = {
  4656. name: "Comment",
  4657. components: { BaseHtmlRender, Author, PostEditor, Point, Icon, TopSubComment },
  4658. inject: ["post", "postDetailWidth", "show", "isNight", "config"],
  4659. props: {
  4660. modelValue: {
  4661. reply_content: ""
  4662. },
  4663. type: {
  4664. type: String,
  4665. default() {
  4666. return "list";
  4667. }
  4668. }
  4669. },
  4670. data() {
  4671. return {
  4672. edit: false,
  4673. ding: false,
  4674. expand: true,
  4675. expandTopReply: true,
  4676. expandWrong: false,
  4677. replyInfo: `@${this.modelValue.username} #${this.modelValue.floor} `,
  4678. cssStyle: null,
  4679. floor: this.modelValue.floor
  4680. };
  4681. },
  4682. watch: {
  4683. show(e2) {
  4684. if (e2) {
  4685. this.edit = false;
  4686. }
  4687. },
  4688. postDetailWidth(n2, o) {
  4689. this.checkIsTooLong(n2);
  4690. }
  4691. },
  4692. computed: {
  4693. CommentDisplayType() {
  4694. return CommentDisplayType;
  4695. },
  4696. myClass() {
  4697. return {
  4698. isOp: this.modelValue.isOp,
  4699. isSimple: this.config.viewType === "simple",
  4700. ding: this.ding,
  4701. isLevelOne: this.type === "top" ? true : this.modelValue.level === 0,
  4702. ["c_" + this.floor]: this.type !== "top"
  4703. };
  4704. }
  4705. },
  4706. mounted() {
  4707. this.checkIsTooLong(this.postDetailWidth);
  4708. },
  4709. methods: {
  4710. checkIsTooLong(postDetailWidth) {
  4711. if (postDetailWidth !== 0) {
  4712. let rect = this.$refs.comment.getBoundingClientRect();
  4713. let ban = postDetailWidth * 0.6;
  4714. if (ban < rect.width && rect.width < ban + 25 && this.modelValue.children.length) {
  4715. this.expand = false;
  4716. let padding = 2;
  4717. this.cssStyle = {
  4718. padding: "1rem 0",
  4719. width: `calc(${postDetailWidth}px - ${padding}rem)`,
  4720. transform: `translateX(calc(${rect.width - postDetailWidth}px + ${padding}rem))`,
  4721. background: this.isNight ? "#18222d" : "white"
  4722. };
  4723. }
  4724. }
  4725. },
  4726. //高亮一下
  4727. showDing() {
  4728. this.ding = true;
  4729. setTimeout(() => {
  4730. this.ding = false;
  4731. }, 2e3);
  4732. },
  4733. hide() {
  4734. let url = `${location.origin}/ignore/reply/${this.modelValue.id}?once=${this.post.once}`;
  4735. eventBus.emit(CMD.REMOVE, this.modelValue.floor);
  4736. $.post(url).then((res) => {
  4737. eventBus.emit(CMD.REFRESH_ONCE);
  4738. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: "隐藏成功" });
  4739. }, (err) => {
  4740. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "隐藏成功,仅本次有效(接口调用失败!)" });
  4741. });
  4742. },
  4743. toggle() {
  4744. this.expand = !this.expand;
  4745. },
  4746. jump() {
  4747. eventBus.emit(CMD.JUMP, this.modelValue.floor);
  4748. }
  4749. }
  4750. };
  4751. const _withScopeId$6 = (n2) => (vue.pushScopeId("data-v-dd44e74f"), n2 = n2(), vue.popScopeId(), n2);
  4752. const _hoisted_1$9 = ["data-floor"];
  4753. const _hoisted_2$6 = { class: "comment-content" };
  4754. const _hoisted_3$6 = { class: "right" };
  4755. const _hoisted_4$6 = { class: "w" };
  4756. const _hoisted_5$5 = {
  4757. key: 0,
  4758. class: "wrong-wrapper"
  4759. };
  4760. const _hoisted_6$5 = ["href"];
  4761. const _hoisted_7$4 = { class: "del-line" };
  4762. const _hoisted_8$4 = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ vue.createElementVNode("i", {
  4763. class: "fa fa-question-circle-o wrong-icon",
  4764. "aria-hidden": "true"
  4765. }, null, -1));
  4766. const _hoisted_9$4 = {
  4767. key: 0,
  4768. class: "warning"
  4769. };
  4770. const _hoisted_10$4 = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ vue.createElementVNode("br", null, null, -1));
  4771. const _hoisted_11$4 = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ vue.createElementVNode("br", null, null, -1));
  4772. const _hoisted_12$4 = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ vue.createElementVNode("br", null, null, -1));
  4773. const _hoisted_13$4 = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ vue.createElementVNode("br", null, null, -1));
  4774. const _hoisted_14$3 = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ vue.createElementVNode("br", null, null, -1));
  4775. const _hoisted_15$3 = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ vue.createElementVNode("a", {
  4776. href: "https://github.com/zyronon/V2Next/issues",
  4777. target: "_blank"
  4778. }, "这里", -1));
  4779. const _hoisted_16$3 = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "gang" }, null, -1));
  4780. const _hoisted_17$3 = { class: "simple-wrapper" };
  4781. const _hoisted_18$3 = {
  4782. key: 0,
  4783. class: "top-reply-wrap"
  4784. };
  4785. function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
  4786. const _component_Author = vue.resolveComponent("Author");
  4787. const _component_BaseHtmlRender = vue.resolveComponent("BaseHtmlRender");
  4788. const _component_PostEditor = vue.resolveComponent("PostEditor");
  4789. const _component_Icon = vue.resolveComponent("Icon");
  4790. const _component_TopSubComment = vue.resolveComponent("TopSubComment");
  4791. const _component_Comment = vue.resolveComponent("Comment", true);
  4792. return vue.openBlock(), vue.createElementBlock("div", {
  4793. class: vue.normalizeClass(["comment", $options.myClass]),
  4794. ref: "comment",
  4795. "data-floor": $data.floor
  4796. }, [
  4797. vue.createVNode(_component_Author, {
  4798. modelValue: $data.expand,
  4799. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.expand = $event),
  4800. comment: $props.modelValue,
  4801. onReply: _cache[1] || (_cache[1] = ($event) => $data.edit = !$data.edit),
  4802. type: $props.type,
  4803. onHide: $options.hide
  4804. }, null, 8, ["modelValue", "comment", "type", "onHide"]),
  4805. $data.cssStyle && !$data.expand ? (vue.openBlock(), vue.createElementBlock("div", {
  4806. key: 0,
  4807. class: "more ago",
  4808. onClick: _cache[2] || (_cache[2] = ($event) => $data.expand = !$data.expand)
  4809. }, " 由于嵌套回复层级太深,自动将后续回复隐藏 ")) : vue.createCommentVNode("", true),
  4810. $data.expand ? (vue.openBlock(), vue.createElementBlock("div", {
  4811. key: 1,
  4812. class: "comment-content-w",
  4813. style: vue.normalizeStyle($data.cssStyle)
  4814. }, [
  4815. $data.cssStyle ? (vue.openBlock(), vue.createElementBlock("div", {
  4816. key: 0,
  4817. class: "more ago",
  4818. onClick: _cache[3] || (_cache[3] = ($event) => $data.expand = !$data.expand)
  4819. }, " 由于嵌套回复层级太深,自动将以下回复移至可见范围 ")) : vue.createCommentVNode("", true),
  4820. vue.createElementVNode("div", _hoisted_2$6, [
  4821. vue.createElementVNode("div", {
  4822. class: "left expand-line",
  4823. onClick: _cache[4] || (_cache[4] = (...args) => $options.toggle && $options.toggle(...args))
  4824. }),
  4825. vue.createElementVNode("div", _hoisted_3$6, [
  4826. vue.createElementVNode("div", _hoisted_4$6, [
  4827. $props.modelValue.isWrong ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$5, [
  4828. vue.createElementVNode("span", {
  4829. onClick: _cache[5] || (_cache[5] = ($event) => $data.expandWrong = !$data.expandWrong),
  4830. title: "点击楼层号查看提示"
  4831. }, [
  4832. vue.createElementVNode("a", {
  4833. href: "/member/" + $props.modelValue.replyUsers[0]
  4834. }, "@" + vue.toDisplayString($props.modelValue.replyUsers[0]) + "  ", 9, _hoisted_6$5),
  4835. vue.createElementVNode("span", _hoisted_7$4, "#" + vue.toDisplayString($props.modelValue.replyFloor), 1),
  4836. _hoisted_8$4
  4837. ]),
  4838. $data.expandWrong ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_9$4, [
  4839. vue.createTextVNode(" 这条回复似乎有点问题,指定的楼层号与@的人对应不上 "),
  4840. _hoisted_10$4,
  4841. vue.createTextVNode(" 原因可能有下面几种: "),
  4842. _hoisted_11$4,
  4843. vue.createTextVNode(" 一、屏蔽用户导致楼层塌陷:你屏蔽了A,自A以后的回复的楼层号都会减1 "),
  4844. _hoisted_12$4,
  4845. vue.createTextVNode(" 二、忽略回复导致楼层塌陷:原理同上 "),
  4846. _hoisted_13$4,
  4847. vue.createTextVNode(" 三、层主回复时指定错了楼层号(同一,层主屏蔽了别人,导致楼层塌陷) "),
  4848. _hoisted_14$3,
  4849. vue.createTextVNode(" 四、脚本解析错误,请在 "),
  4850. _hoisted_15$3,
  4851. vue.createTextVNode("反馈 ")
  4852. ])) : vue.createCommentVNode("", true)
  4853. ])) : vue.createCommentVNode("", true),
  4854. $options.config.commentDisplayType === $options.CommentDisplayType.FloorInFloorNoCallUser && $props.type !== "top" ? (vue.openBlock(), vue.createBlock(_component_BaseHtmlRender, {
  4855. key: 1,
  4856. class: "reply_content",
  4857. html: $props.modelValue.hideCallUserReplyContent
  4858. }, null, 8, ["html"])) : (vue.openBlock(), vue.createBlock(_component_BaseHtmlRender, {
  4859. key: 2,
  4860. class: "reply_content",
  4861. html: $props.modelValue.reply_content
  4862. }, null, 8, ["html"])),
  4863. $data.edit ? (vue.openBlock(), vue.createBlock(_component_PostEditor, {
  4864. key: 3,
  4865. onClose: _cache[6] || (_cache[6] = ($event) => $data.edit = false),
  4866. replyInfo: $data.replyInfo,
  4867. replyUser: $props.modelValue.username,
  4868. replyFloor: $props.modelValue.floor
  4869. }, null, 8, ["replyInfo", "replyUser", "replyFloor"])) : vue.createCommentVNode("", true),
  4870. $props.type === "top" && $props.modelValue.replyCount ? (vue.openBlock(), vue.createElementBlock("div", {
  4871. key: 4,
  4872. class: "reply-count",
  4873. onClick: _cache[7] || (_cache[7] = ($event) => $data.expandTopReply = !$data.expandTopReply)
  4874. }, [
  4875. _hoisted_16$3,
  4876. vue.createElementVNode("span", null, " 共有" + vue.toDisplayString($props.modelValue.replyCount) + " 条回复 ", 1),
  4877. $data.expandTopReply ? (vue.openBlock(), vue.createBlock(_component_Icon, {
  4878. key: 0,
  4879. icon: "ep:arrow-up-bold"
  4880. })) : (vue.openBlock(), vue.createBlock(_component_Icon, {
  4881. key: 1,
  4882. icon: "ep:arrow-down-bold"
  4883. }))
  4884. ])) : vue.createCommentVNode("", true)
  4885. ]),
  4886. vue.createElementVNode("div", _hoisted_17$3, [
  4887. $props.type === "top" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
  4888. $data.expandTopReply && $props.modelValue.replyCount ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_18$3, [
  4889. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($props.modelValue.children, (item, index) => {
  4890. return vue.openBlock(), vue.createBlock(_component_TopSubComment, {
  4891. level: 1,
  4892. modelValue: $props.modelValue.children[index],
  4893. "onUpdate:modelValue": ($event) => $props.modelValue.children[index] = $event,
  4894. key: index
  4895. }, null, 8, ["modelValue", "onUpdate:modelValue"]);
  4896. }), 128))
  4897. ])) : vue.createCommentVNode("", true)
  4898. ], 64)) : (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 1 }, vue.renderList($props.modelValue.children, (item, index) => {
  4899. return vue.openBlock(), vue.createBlock(_component_Comment, {
  4900. modelValue: $props.modelValue.children[index],
  4901. "onUpdate:modelValue": ($event) => $props.modelValue.children[index] = $event,
  4902. key: index
  4903. }, null, 8, ["modelValue", "onUpdate:modelValue"]);
  4904. }), 128))
  4905. ])
  4906. ])
  4907. ]),
  4908. $data.cssStyle ? (vue.openBlock(), vue.createElementBlock("div", {
  4909. key: 1,
  4910. class: "more ago",
  4911. onClick: _cache[8] || (_cache[8] = ($event) => $data.expand = !$data.expand)
  4912. }, " 由于嵌套回复层级太深,自动将以上回复移至可见范围 ")) : vue.createCommentVNode("", true)
  4913. ], 4)) : vue.createCommentVNode("", true)
  4914. ], 10, _hoisted_1$9);
  4915. }
  4916. const Comment = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render$4], ["__scopeId", "data-v-dd44e74f"]]);
  4917. const _sfc_main$8 = {
  4918. name: "Toolbar",
  4919. components: { Icon, BaseLoading },
  4920. inject: [
  4921. "isLogin",
  4922. "post",
  4923. "pageType"
  4924. ],
  4925. data() {
  4926. return {
  4927. timer: null,
  4928. loading: false,
  4929. loading2: false,
  4930. loading3: false
  4931. };
  4932. },
  4933. methods: {
  4934. checkIsLogin(emitName = "") {
  4935. if (!this.isLogin) {
  4936. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "请先登录!" });
  4937. return false;
  4938. }
  4939. this.$emit(emitName);
  4940. return true;
  4941. },
  4942. tweet() {
  4943. var _a;
  4944. let username = ((_a = window.user) == null ? void 0 : _a.username) ?? "";
  4945. let url = `https://twitter.com/intent/tweet?url=${location.origin}/t/${this.post.id}?r=${username}&related=v2ex&text=${this.post.title}`;
  4946. window.open(url, "_blank", "width=550,height=370");
  4947. },
  4948. async report() {
  4949. if (!this.checkIsLogin())
  4950. return;
  4951. if (this.loading3)
  4952. return;
  4953. let isReport = this.post.isReport;
  4954. if (isReport) {
  4955. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: "你已对本主题进行了报告" });
  4956. return;
  4957. }
  4958. let url = `${location.origin}/report/topic/${this.post.id}?once=${this.post.once}`;
  4959. this.loading3 = true;
  4960. let apiRes = await fetch(url);
  4961. this.loading3 = false;
  4962. if (apiRes.redirected) {
  4963. let htmlText = await apiRes.text();
  4964. if (htmlText.search("你已对本主题进行了报告")) {
  4965. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: "你已对本主题进行了报告" });
  4966. eventBus.emit(CMD.REFRESH_ONCE, htmlText);
  4967. eventBus.emit(CMD.MERGE, { isReport: !isReport });
  4968. return;
  4969. }
  4970. }
  4971. eventBus.emit(CMD.REFRESH_ONCE);
  4972. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "操作失败,请重试" });
  4973. },
  4974. async toggleIgnore() {
  4975. if (!this.checkIsLogin())
  4976. return;
  4977. let url = `${location.origin}/${this.post.isIgnore ? "unignore" : "ignore"}/topic/${this.post.id}?once=${this.post.once}`;
  4978. if (this.pageType === PageType.Post) {
  4979. this.loading2 = true;
  4980. let apiRes = await fetch(url);
  4981. if (apiRes.redirected) {
  4982. if (!this.post.isIgnore) {
  4983. window.location = location.origin;
  4984. }
  4985. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: this.post.isIgnore ? "取消成功" : "忽略成功" });
  4986. eventBus.emit(CMD.MERGE, { isIgnore: !this.post.isIgnore });
  4987. } else {
  4988. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "忽略失败" });
  4989. }
  4990. this.loading2 = false;
  4991. } else {
  4992. if (this.post.isIgnore) {
  4993. this.loading2 = true;
  4994. } else {
  4995. eventBus.emit(CMD.IGNORE);
  4996. }
  4997. let apiRes = await fetch(url);
  4998. if (apiRes.redirected) {
  4999. if (this.post.isIgnore) {
  5000. eventBus.emit(CMD.REFRESH_ONCE);
  5001. }
  5002. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: this.post.isIgnore ? "取消成功" : "忽略成功" });
  5003. eventBus.emit(CMD.MERGE, { isIgnore: !this.post.isIgnore });
  5004. } else {
  5005. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "忽略成功,仅本次有效(接口调用失败!)" });
  5006. }
  5007. this.loading2 = false;
  5008. }
  5009. },
  5010. async toggleFavorite() {
  5011. if (!this.checkIsLogin())
  5012. return;
  5013. if (this.loading)
  5014. return;
  5015. let isFavorite = this.post.isFavorite;
  5016. if (!isFavorite && config.collectBrowserNotice) {
  5017. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: "别忘记按Command/Cmd/CTRL + D添加到书签哦" });
  5018. }
  5019. let url = `${location.origin}/${isFavorite ? "unfavorite" : "favorite"}/topic/${this.post.id}?once=${this.post.once}`;
  5020. this.loading = true;
  5021. let apiRes = await fetch(url);
  5022. this.loading = false;
  5023. if (apiRes.redirected) {
  5024. let htmlText = await apiRes.text();
  5025. if (htmlText.search(isFavorite ? "加入收藏" : "取消收藏")) {
  5026. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: isFavorite ? "取消成功" : "收藏成功" });
  5027. eventBus.emit(CMD.MERGE, { collectCount: isFavorite ? this.post.collectCount - 1 : this.post.collectCount + 1 });
  5028. eventBus.emit(CMD.REFRESH_ONCE, htmlText);
  5029. eventBus.emit(CMD.MERGE, { isFavorite: !isFavorite });
  5030. return;
  5031. }
  5032. }
  5033. eventBus.emit(CMD.REFRESH_ONCE);
  5034. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "操作失败" });
  5035. }
  5036. }
  5037. };
  5038. const _withScopeId$5 = (n2) => (vue.pushScopeId("data-v-30dac564"), n2 = n2(), vue.popScopeId(), n2);
  5039. const _hoisted_1$8 = { class: "toolbar" };
  5040. const _hoisted_2$5 = /* @__PURE__ */ _withScopeId$5(() => /* @__PURE__ */ vue.createElementVNode("span", null, "回复", -1));
  5041. const _hoisted_3$5 = {
  5042. key: 0,
  5043. class: "tool no-hover"
  5044. };
  5045. const _hoisted_4$5 = /* @__PURE__ */ _withScopeId$5(() => /* @__PURE__ */ vue.createElementVNode("span", null, "Tweet", -1));
  5046. function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
  5047. const _component_Icon = vue.resolveComponent("Icon");
  5048. const _component_BaseLoading = vue.resolveComponent("BaseLoading");
  5049. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$8, [
  5050. vue.renderSlot(_ctx.$slots, "default", {}, void 0, true),
  5051. vue.createElementVNode("div", {
  5052. class: "tool",
  5053. onClick: _cache[0] || (_cache[0] = vue.withModifiers(($event) => $options.checkIsLogin("reply"), ["stop"]))
  5054. }, [
  5055. vue.createVNode(_component_Icon, { icon: "mynaui:message" }),
  5056. _hoisted_2$5
  5057. ]),
  5058. vue.createElementVNode("div", {
  5059. class: vue.normalizeClass(["tool", { disabled: $data.loading }]),
  5060. onClick: _cache[1] || (_cache[1] = vue.withModifiers((...args) => $options.toggleFavorite && $options.toggleFavorite(...args), ["stop"]))
  5061. }, [
  5062. $data.loading ? (vue.openBlock(), vue.createBlock(_component_BaseLoading, {
  5063. key: 0,
  5064. size: "small"
  5065. })) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
  5066. $options.post.isFavorite ? (vue.openBlock(), vue.createBlock(_component_Icon, {
  5067. key: 0,
  5068. color: "rgb(224,42,42)",
  5069. icon: "iconoir:star-solid"
  5070. })) : (vue.openBlock(), vue.createBlock(_component_Icon, {
  5071. key: 1,
  5072. icon: "iconoir:star"
  5073. }))
  5074. ], 64)),
  5075. vue.createElementVNode("span", null, vue.toDisplayString($options.post.isFavorite ? "取消" : "") + "收藏", 1)
  5076. ], 2),
  5077. $options.post.collectCount !== 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$5, [
  5078. vue.createElementVNode("span", null, vue.toDisplayString($options.post.collectCount + "人收藏"), 1)
  5079. ])) : vue.createCommentVNode("", true),
  5080. vue.createElementVNode("div", {
  5081. class: "tool",
  5082. onClick: _cache[2] || (_cache[2] = vue.withModifiers((...args) => $options.tweet && $options.tweet(...args), ["stop"]))
  5083. }, [
  5084. vue.createVNode(_component_Icon, { icon: "uil:share" }),
  5085. _hoisted_4$5
  5086. ]),
  5087. vue.createElementVNode("div", {
  5088. class: vue.normalizeClass(["tool", { "disabled": $data.loading2 }]),
  5089. onClick: _cache[3] || (_cache[3] = vue.withModifiers((...args) => $options.toggleIgnore && $options.toggleIgnore(...args), ["stop"]))
  5090. }, [
  5091. $data.loading2 ? (vue.openBlock(), vue.createBlock(_component_BaseLoading, {
  5092. key: 0,
  5093. size: "small"
  5094. })) : (vue.openBlock(), vue.createBlock(_component_Icon, {
  5095. key: 1,
  5096. icon: "fluent:eye-hide-24-regular"
  5097. })),
  5098. vue.createElementVNode("span", null, vue.toDisplayString($options.post.isIgnore ? "取消忽略" : "忽略"), 1)
  5099. ], 2),
  5100. vue.createElementVNode("div", {
  5101. class: vue.normalizeClass(["tool", { "disabled": $data.loading3 }]),
  5102. onClick: _cache[4] || (_cache[4] = vue.withModifiers((...args) => $options.report && $options.report(...args), ["stop"]))
  5103. }, [
  5104. $data.loading3 ? (vue.openBlock(), vue.createBlock(_component_BaseLoading, {
  5105. key: 0,
  5106. size: "small"
  5107. })) : (vue.openBlock(), vue.createBlock(_component_Icon, {
  5108. key: 1,
  5109. class: "black",
  5110. icon: "solar:danger-triangle-outline"
  5111. })),
  5112. vue.createElementVNode("span", null, vue.toDisplayString($options.post.isReport ? "你已对本主题进行了报告" : "报告"), 1)
  5113. ], 2)
  5114. ]);
  5115. }
  5116. const Toolbar = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_render$3], ["__scopeId", "data-v-30dac564"]]);
  5117. const _withScopeId$4 = (n2) => (vue.pushScopeId("data-v-4a063111"), n2 = n2(), vue.popScopeId(), n2);
  5118. const _hoisted_1$7 = ["href"];
  5119. const _hoisted_2$4 = ["src"];
  5120. const _hoisted_3$4 = { class: "texts" };
  5121. const _hoisted_4$4 = {
  5122. key: 0,
  5123. class: "point"
  5124. };
  5125. const _hoisted_5$4 = { class: "link-num" };
  5126. const _hoisted_6$4 = { class: "my-tag" };
  5127. const _hoisted_7$3 = /* @__PURE__ */ _withScopeId$4(() => /* @__PURE__ */ vue.createElementVNode("i", { class: "fa fa-tag" }, null, -1));
  5128. const _hoisted_8$3 = {
  5129. key: 2,
  5130. class: "ago"
  5131. };
  5132. const _hoisted_9$3 = {
  5133. key: 3,
  5134. class: "mod"
  5135. };
  5136. const _hoisted_10$3 = {
  5137. key: 4,
  5138. class: "owner"
  5139. };
  5140. const _hoisted_11$3 = ["href"];
  5141. const _hoisted_12$3 = {
  5142. key: 5,
  5143. class: "owner"
  5144. };
  5145. const _hoisted_13$3 = {
  5146. key: 6,
  5147. class: "mod"
  5148. };
  5149. const _hoisted_14$2 = {
  5150. key: 7,
  5151. class: "ago"
  5152. };
  5153. const _hoisted_15$2 = { class: "my-tag" };
  5154. const _hoisted_16$2 = /* @__PURE__ */ _withScopeId$4(() => /* @__PURE__ */ vue.createElementVNode("i", { class: "fa fa-tag" }, null, -1));
  5155. const _hoisted_17$2 = {
  5156. key: 9,
  5157. class: "point"
  5158. };
  5159. const _hoisted_18$2 = { class: "link-num" };
  5160. const _hoisted_19$2 = ["href"];
  5161. const _hoisted_20$2 = ["src"];
  5162. const _hoisted_21$2 = { class: "Author-right" };
  5163. const _hoisted_22$2 = { class: "floor" };
  5164. const _hoisted_23$2 = /* @__PURE__ */ _withScopeId$4(() => /* @__PURE__ */ vue.createElementVNode("span", null, "跳转", -1));
  5165. const _hoisted_24$1 = [
  5166. _hoisted_23$2
  5167. ];
  5168. const _sfc_main$7 = {
  5169. __name: "SingleComment",
  5170. props: {
  5171. comment: {
  5172. reply_content: ""
  5173. },
  5174. isRight: {
  5175. type: Boolean,
  5176. default() {
  5177. return false;
  5178. }
  5179. }
  5180. },
  5181. setup(__props) {
  5182. const config2 = vue.inject("config");
  5183. const isLogin = vue.inject("isLogin");
  5184. const tags = vue.inject("tags");
  5185. const props = __props;
  5186. const myTags = vue.computed(() => {
  5187. return tags[props.comment.username] ?? [];
  5188. });
  5189. function jump() {
  5190. eventBus.emit(CMD.JUMP, props.comment.floor);
  5191. }
  5192. return (_ctx, _cache) => {
  5193. return vue.openBlock(), vue.createElementBlock("div", {
  5194. class: vue.normalizeClass(["comment", { isSimple: vue.unref(config2).viewType === "simple" }]),
  5195. ref: "comment"
  5196. }, [
  5197. !__props.isRight ? (vue.openBlock(), vue.createElementBlock("a", {
  5198. key: 0,
  5199. class: "avatar",
  5200. href: `/member/${__props.comment.username}`
  5201. }, [
  5202. vue.createElementVNode("img", {
  5203. src: __props.comment.avatar,
  5204. alt: ""
  5205. }, null, 8, _hoisted_2$4)
  5206. ], 8, _hoisted_1$7)) : vue.createCommentVNode("", true),
  5207. vue.createElementVNode("div", {
  5208. class: vue.normalizeClass(["comment-body", { isRight: __props.isRight }])
  5209. }, [
  5210. vue.createElementVNode("div", _hoisted_3$4, [
  5211. __props.comment.thankCount && __props.isRight ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$4, [
  5212. __props.comment.isThanked ? (vue.openBlock(), vue.createBlock(vue.unref(Icon), {
  5213. key: 0,
  5214. color: "rgb(224,42,42)",
  5215. icon: "icon-park-solid:like"
  5216. })) : (vue.openBlock(), vue.createBlock(vue.unref(Icon), {
  5217. key: 1,
  5218. color: !__props.comment.thankCount ? null : "rgb(224,42,42)",
  5219. icon: "icon-park-outline:like"
  5220. }, null, 8, ["color"])),
  5221. vue.createElementVNode("div", _hoisted_5$4, vue.toDisplayString(__props.comment.thankCount), 1)
  5222. ])) : vue.createCommentVNode("", true),
  5223. vue.unref(isLogin) && vue.unref(config2).openTag && __props.isRight ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 1 }, vue.renderList(myTags.value, (i) => {
  5224. return vue.openBlock(), vue.createElementBlock("span", _hoisted_6$4, [
  5225. _hoisted_7$3,
  5226. vue.createElementVNode("span", null, vue.toDisplayString(i), 1)
  5227. ]);
  5228. }), 256)) : vue.createCommentVNode("", true),
  5229. __props.isRight ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_8$3, vue.toDisplayString(__props.comment.date), 1)) : vue.createCommentVNode("", true),
  5230. __props.comment.isMod && __props.isRight ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_9$3, "MOD")) : vue.createCommentVNode("", true),
  5231. __props.comment.isOp && __props.isRight ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_10$3, "OP")) : vue.createCommentVNode("", true),
  5232. vue.createElementVNode("a", {
  5233. href: `/member/${__props.comment.username}`,
  5234. class: "username"
  5235. }, vue.toDisplayString(__props.comment.username), 9, _hoisted_11$3),
  5236. __props.comment.isOp && !__props.isRight ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_12$3, "OP")) : vue.createCommentVNode("", true),
  5237. __props.comment.isMod && !__props.isRight ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_13$3, "MOD")) : vue.createCommentVNode("", true),
  5238. !__props.isRight ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_14$2, vue.toDisplayString(__props.comment.date), 1)) : vue.createCommentVNode("", true),
  5239. vue.unref(isLogin) && vue.unref(config2).openTag && !__props.isRight ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 8 }, vue.renderList(myTags.value, (i) => {
  5240. return vue.openBlock(), vue.createElementBlock("span", _hoisted_15$2, [
  5241. _hoisted_16$2,
  5242. vue.createElementVNode("span", null, vue.toDisplayString(i), 1)
  5243. ]);
  5244. }), 256)) : vue.createCommentVNode("", true),
  5245. __props.comment.thankCount && !__props.isRight ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_17$2, [
  5246. __props.comment.isThanked ? (vue.openBlock(), vue.createBlock(vue.unref(Icon), {
  5247. key: 0,
  5248. color: "rgb(224,42,42)",
  5249. icon: "icon-park-solid:like"
  5250. })) : (vue.openBlock(), vue.createBlock(vue.unref(Icon), {
  5251. key: 1,
  5252. color: !__props.comment.thankCount ? null : "rgb(224,42,42)",
  5253. icon: "icon-park-outline:like"
  5254. }, null, 8, ["color"])),
  5255. vue.createElementVNode("div", _hoisted_18$2, vue.toDisplayString(__props.comment.thankCount), 1)
  5256. ])) : vue.createCommentVNode("", true)
  5257. ]),
  5258. vue.createVNode(BaseHtmlRender, {
  5259. class: "reply_content",
  5260. html: __props.comment.reply_content
  5261. }, null, 8, ["html"])
  5262. ], 2),
  5263. __props.isRight ? (vue.openBlock(), vue.createElementBlock("a", {
  5264. key: 1,
  5265. class: "avatar",
  5266. href: `/member/${__props.comment.username}`
  5267. }, [
  5268. vue.createElementVNode("img", {
  5269. src: __props.comment.avatar,
  5270. alt: ""
  5271. }, null, 8, _hoisted_20$2)
  5272. ], 8, _hoisted_19$2)) : vue.createCommentVNode("", true),
  5273. vue.createElementVNode("div", _hoisted_21$2, [
  5274. vue.createElementVNode("div", _hoisted_22$2, vue.toDisplayString(__props.comment.floor), 1),
  5275. vue.createElementVNode("div", {
  5276. class: "tool jump",
  5277. onClick: vue.withModifiers(jump, ["stop"])
  5278. }, _hoisted_24$1)
  5279. ])
  5280. ], 2);
  5281. };
  5282. }
  5283. };
  5284. const SingleComment = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-4a063111"]]);
  5285. function _css(el, key, value) {
  5286. const reg = /^-?\d+.?\d*(px|pt|em|rem|vw|vh|%|rpx|ms)$/i;
  5287. if (value === void 0) {
  5288. let val = null;
  5289. if ("getComputedStyle" in window) {
  5290. val = window.getComputedStyle(el, null)[key];
  5291. } else {
  5292. val = el.currentStyle[key];
  5293. }
  5294. return reg.test(val) ? parseFloat(val) : val;
  5295. } else {
  5296. if ([
  5297. "top",
  5298. "left",
  5299. "bottom",
  5300. "right",
  5301. "width",
  5302. "height",
  5303. "font-size",
  5304. "margin",
  5305. "padding"
  5306. ].includes(key)) {
  5307. if (!reg.test(value)) {
  5308. if (!String(value).includes("calc")) {
  5309. value += "px";
  5310. }
  5311. }
  5312. }
  5313. if (key === "transform") {
  5314. el.style.webkitTransform = el.style.MsTransform = el.style.msTransform = el.style.MozTransform = el.style.OTransform = el.style.transform = value;
  5315. } else {
  5316. el.style[key] = value;
  5317. }
  5318. }
  5319. }
  5320. function getImgSize(naturalWidth, naturalHeight, maxWidth, maxHeight) {
  5321. const imgRatio = naturalWidth / naturalHeight;
  5322. const maxRatio = maxWidth / maxHeight;
  5323. let width, height;
  5324. if (imgRatio >= maxRatio) {
  5325. if (naturalWidth > maxWidth) {
  5326. width = maxWidth;
  5327. height = maxWidth / naturalWidth * naturalHeight;
  5328. } else {
  5329. width = naturalWidth;
  5330. height = naturalHeight;
  5331. }
  5332. } else {
  5333. if (naturalHeight > maxHeight) {
  5334. width = maxHeight / naturalHeight * naturalWidth;
  5335. height = maxHeight;
  5336. } else {
  5337. width = naturalWidth;
  5338. height = naturalHeight;
  5339. }
  5340. }
  5341. if (height === 0) {
  5342. height = maxHeight;
  5343. width = height * 1.3;
  5344. } else {
  5345. if (height < 24) {
  5346. height = 50;
  5347. width = height * imgRatio;
  5348. } else if (height < 100) {
  5349. height = 300;
  5350. width = height * imgRatio;
  5351. } else {
  5352. height = maxHeight;
  5353. width = height * imgRatio;
  5354. }
  5355. if (width > maxWidth) {
  5356. width = maxWidth;
  5357. height = width / imgRatio;
  5358. }
  5359. }
  5360. console.log(width, height);
  5361. return { width, height };
  5362. }
  5363. const _sfc_main$6 = {
  5364. name: "detail",
  5365. components: {
  5366. BaseSelect,
  5367. BaseButton,
  5368. SingleComment,
  5369. PopConfirm,
  5370. Comment,
  5371. PostEditor,
  5372. Point,
  5373. Toolbar,
  5374. BaseHtmlRender,
  5375. Tooltip,
  5376. BaseLoading,
  5377. Icon
  5378. },
  5379. inject: ["allReplyUsers", "post", "tags", "isLogin", "config", "pageType", "isNight"],
  5380. provide() {
  5381. return {
  5382. postDetailWidth: vue.computed(() => this.postDetailWidth)
  5383. };
  5384. },
  5385. props: {
  5386. modelValue: {
  5387. type: Boolean,
  5388. default() {
  5389. return false;
  5390. }
  5391. },
  5392. loading: {
  5393. type: Boolean,
  5394. default() {
  5395. return false;
  5396. }
  5397. },
  5398. refreshLoading: {
  5399. type: Boolean,
  5400. default() {
  5401. return false;
  5402. }
  5403. },
  5404. displayType: CommentDisplayType.FloorInFloorNoCallUser
  5405. },
  5406. data() {
  5407. return {
  5408. isSticky: false,
  5409. selectCallIndex: 0,
  5410. postDetailWidth: 0,
  5411. showCallList: false,
  5412. showRelationReply: false,
  5413. replyText: "",
  5414. callStyle: {
  5415. top: 0,
  5416. left: 0
  5417. },
  5418. targetUser: {
  5419. left: [],
  5420. right: "",
  5421. rightFloor: -1
  5422. },
  5423. currentFloor: "",
  5424. showOpTag: false,
  5425. rect: {},
  5426. result: {},
  5427. x: 0,
  5428. y: 0,
  5429. scale: 1,
  5430. minScale: 0.2,
  5431. maxScale: 16,
  5432. preview: {
  5433. rect: {},
  5434. result: {},
  5435. x: 0,
  5436. y: 0,
  5437. scale: 1,
  5438. minScale: 0.2,
  5439. maxScale: 16
  5440. }
  5441. };
  5442. },
  5443. computed: {
  5444. functions() {
  5445. return functions;
  5446. },
  5447. canAppend() {
  5448. if (this.isMy) {
  5449. let create = new Date(this.post.createDate);
  5450. return Date.now() - create.valueOf() > 1e3 * 60 * 30;
  5451. }
  5452. return false;
  5453. },
  5454. canEditMove() {
  5455. if (this.isMy) {
  5456. let create = new Date(this.post.createDate);
  5457. return Date.now() - create.valueOf() < 1e3 * 60 * 10;
  5458. }
  5459. return false;
  5460. },
  5461. isMy() {
  5462. return this.post.member.username === window.user.username;
  5463. },
  5464. myTags() {
  5465. return this.tags[this.post.member.username] ?? [];
  5466. },
  5467. CommentDisplayType() {
  5468. return CommentDisplayType;
  5469. },
  5470. isPost() {
  5471. return this.pageType === PageType.Post;
  5472. },
  5473. filterCallList() {
  5474. if (this.showCallList) {
  5475. let list = ["管理员", "所有人"].concat(this.allReplyUsers);
  5476. if (this.replyText)
  5477. return list.filter((i) => i.search(this.replyText) > -1);
  5478. return list;
  5479. }
  5480. return [];
  5481. },
  5482. replyList() {
  5483. if ([CommentDisplayType.FloorInFloor, CommentDisplayType.FloorInFloorNoCallUser].includes(this.displayType))
  5484. return this.post.nestedReplies;
  5485. if (this.displayType === CommentDisplayType.Like) {
  5486. return functions.clone(this.post.nestedReplies).sort((a, b) => b.thankCount - a.thankCount);
  5487. }
  5488. if (this.displayType === CommentDisplayType.New) {
  5489. return functions.clone(this.post.replyList).reverse();
  5490. }
  5491. if (this.displayType === CommentDisplayType.V2exOrigin)
  5492. return this.post.replyList;
  5493. if (this.displayType === CommentDisplayType.FloorInFloorNested)
  5494. return this.post.nestedRedundReplies;
  5495. if (this.displayType === CommentDisplayType.OnlyOp)
  5496. return this.post.replyList.filter((v) => {
  5497. var _a;
  5498. return v.username === ((_a = this.post.member) == null ? void 0 : _a.username);
  5499. });
  5500. return [];
  5501. },
  5502. //关联回复
  5503. relationReply() {
  5504. if (this.targetUser.left.length && this.targetUser.right) {
  5505. return this.post.replyList.filter((v) => {
  5506. if (this.targetUser.left.concat(this.targetUser.right).includes(v.username)) {
  5507. if (v.floor > this.targetUser.rightFloor) {
  5508. if (v.replyUsers.includes(this.targetUser.right)) {
  5509. return true;
  5510. }
  5511. if (v.username === this.targetUser.right) {
  5512. for (let i = 0; i < this.targetUser.left.length; i++) {
  5513. if (v.replyUsers.includes(this.targetUser.left[i])) {
  5514. return true;
  5515. }
  5516. }
  5517. }
  5518. } else {
  5519. return true;
  5520. }
  5521. }
  5522. return false;
  5523. });
  5524. }
  5525. return [];
  5526. }
  5527. },
  5528. watch: {
  5529. "post.id"(n2, o) {
  5530. if (this.$refs["post-editor"]) {
  5531. this.$refs["post-editor"].content = "";
  5532. vue.nextTick(() => {
  5533. var _a, _b;
  5534. (_b = (_a = this.$refs) == null ? void 0 : _a.detail) == null ? void 0 : _b.scrollTo({ top: 0 });
  5535. });
  5536. }
  5537. },
  5538. "post.headerTemplate"(n2, o) {
  5539. let mountEl = document.querySelector(".main-wrapper .post-wrapper .html-wrapper .header");
  5540. if (mountEl) {
  5541. this.showOpTag = true;
  5542. }
  5543. },
  5544. modelValue: {
  5545. handler(newVal) {
  5546. if (this.isPost)
  5547. return;
  5548. if (newVal) {
  5549. this.currentFloor = "";
  5550. vue.nextTick(() => {
  5551. var _a, _b;
  5552. (_b = (_a = this.$refs) == null ? void 0 : _a.main) == null ? void 0 : _b.focus();
  5553. });
  5554. } else {
  5555. this.isSticky = false;
  5556. this.showRelationReply = false;
  5557. }
  5558. }
  5559. }
  5560. },
  5561. mounted() {
  5562. vue.nextTick(() => {
  5563. setTimeout(() => {
  5564. var _a;
  5565. this.postDetailWidth = ((_a = this.$refs.mainWrapper) == null ? void 0 : _a.getBoundingClientRect().width) || 0;
  5566. }, 500);
  5567. });
  5568. if (this.isLogin) {
  5569. const observer = new IntersectionObserver(
  5570. ([e2]) => e2.target.toggleAttribute("stuck", e2.intersectionRatio < 1),
  5571. { threshold: [1] }
  5572. );
  5573. observer.observe(this.$refs.replyBox);
  5574. window.addEventListener("keydown", this.onKeyDown);
  5575. }
  5576. eventBus.on(CMD.SHOW_CALL, (val) => {
  5577. if (val.show) {
  5578. this.showCallList = true;
  5579. this.replyText = val.text;
  5580. if (this.isPost) {
  5581. this.callStyle.top = val.top + $(window.win()).scrollTop() + -40 + "px";
  5582. } else {
  5583. this.callStyle.top = val.top + $(".post-detail").scrollTop() + 15 + "px";
  5584. }
  5585. this.callStyle.left = val.left - $(".main")[0].getBoundingClientRect().left + 10 + "px";
  5586. if (this.selectCallIndex >= this.filterCallList.length) {
  5587. this.selectCallIndex = 0;
  5588. }
  5589. } else {
  5590. this.replyText = "";
  5591. this.showCallList = false;
  5592. this.selectCallIndex = 0;
  5593. }
  5594. });
  5595. eventBus.on(CMD.RELATION_REPLY, (val) => {
  5596. this.targetUser = val;
  5597. this.showRelationReply = true;
  5598. });
  5599. eventBus.on(CMD.JUMP, this.jump);
  5600. },
  5601. beforeUnmount() {
  5602. window.removeEventListener("keydown", this.onKeyDown);
  5603. eventBus.off(CMD.SHOW_CALL);
  5604. },
  5605. methods: {
  5606. addTag() {
  5607. eventBus.emit(CMD.ADD_TAG, this.post.member.username);
  5608. },
  5609. removeTag(tag) {
  5610. eventBus.emit(CMD.REMOVE_TAG, { username: this.post.member.username, tag });
  5611. },
  5612. closePreviewModal() {
  5613. let previewModal = document.querySelector(".preview-modal");
  5614. let s = document.querySelector(".shadow");
  5615. let domRect = this.preview.rect;
  5616. _css(s, "transition", "all 0.3s");
  5617. _css(s, "width", domRect.width);
  5618. _css(s, "height", domRect.height);
  5619. _css(s, "transform", `translate3d(${domRect.x}px, ${domRect.y}px, 0) scale(1)`);
  5620. let mask = document.querySelector(".preview-modal .mask");
  5621. _css(mask, "opacity", 0);
  5622. setTimeout(() => {
  5623. _css(s, "transition", "all 0s");
  5624. s.remove();
  5625. _css(previewModal, "top", "-1000vh");
  5626. _css(document.body, "overflow", "auto");
  5627. }, 300);
  5628. },
  5629. stop(e2) {
  5630. e2.stopPropagation();
  5631. e2.stopImmediatePropagation();
  5632. if (e2.target.tagName === "IMG") {
  5633. console.log("e", e2.target.src);
  5634. if (/cdn\.v2ex\.com.*avatar/i.test(e2.target.src)) {
  5635. console.log("t");
  5636. }
  5637. this.preview = {
  5638. rect: {},
  5639. result: {},
  5640. x: 0,
  5641. y: 0,
  5642. scale: 1,
  5643. minScale: 0.2,
  5644. maxScale: 16
  5645. };
  5646. e2.preventDefault();
  5647. let domRect = e2.target.getBoundingClientRect();
  5648. let previewModal = document.querySelector(".preview-modal");
  5649. _css(previewModal, "top", "0");
  5650. let s = e2.target.cloneNode();
  5651. s.classList.add("shadow");
  5652. previewModal.append(s);
  5653. _css(s, "transition", "all 0s");
  5654. _css(s, "width", domRect.width);
  5655. _css(s, "height", domRect.height);
  5656. _css(s, "transform", `translate3d(${domRect.x}px, ${domRect.y}px, 0) scale(1)`);
  5657. let t = ".3";
  5658. let sw = domRect.width / window.innerWidth;
  5659. let sh = domRect.height / window.innerHeight;
  5660. domRect.sw = sw;
  5661. domRect.sh = sh;
  5662. this.preview.rect = domRect;
  5663. this.preview.result = getImgSize(
  5664. s.naturalWidth,
  5665. s.naturalHeight,
  5666. window.innerWidth * 0.95,
  5667. window.innerHeight * 0.9
  5668. );
  5669. this.preview.x = (window.innerWidth - this.preview.result.width) * 0.5;
  5670. this.preview.y = (window.innerHeight - this.preview.result.height) * 0.5;
  5671. let isPointerdown = false;
  5672. let isMove = false;
  5673. let lastPointermove = { x: 0, y: 0 };
  5674. let diff = { x: 0, y: 0 };
  5675. s.addEventListener("pointerdown", function(e3) {
  5676. isPointerdown = true;
  5677. isMove = false;
  5678. s.setPointerCapture(e3.pointerId);
  5679. lastPointermove = { x: e3.clientX, y: e3.clientY };
  5680. });
  5681. s.addEventListener("pointermove", (e3) => {
  5682. if (isPointerdown) {
  5683. isMove = true;
  5684. const current = { x: e3.clientX, y: e3.clientY };
  5685. diff.x = current.x - lastPointermove.x;
  5686. diff.y = current.y - lastPointermove.y;
  5687. lastPointermove = { x: current.x, y: current.y };
  5688. this.preview.x += diff.x;
  5689. this.preview.y += diff.y;
  5690. _css(s, "transition", "all 0.1s");
  5691. _css(s, "transform", `translate3d(${this.preview.x}px, ${this.preview.y}px, 0) scale(${this.preview.scale})`);
  5692. }
  5693. e3.preventDefault();
  5694. });
  5695. s.addEventListener("pointerup", () => {
  5696. if (isPointerdown) {
  5697. isPointerdown = false;
  5698. if (!isMove) {
  5699. this.closePreviewModal();
  5700. }
  5701. }
  5702. });
  5703. s.addEventListener("pointercancel", function(e3) {
  5704. if (isPointerdown) {
  5705. isPointerdown = false;
  5706. }
  5707. });
  5708. let mask = document.querySelector(".preview-modal .mask");
  5709. _css(mask, "transition", "all 0s");
  5710. _css(mask, "opacity", 0);
  5711. setTimeout(() => {
  5712. _css(s, "transition", `all ${t}s`);
  5713. _css(mask, "transition", `all ${t}s`);
  5714. _css(mask, "opacity", 1);
  5715. _css(s, "transform", `translate3d(${this.preview.x}px, ${this.preview.y}px, 0) scale(${this.preview.scale})`);
  5716. _css(s, "width", this.preview.result.width);
  5717. _css(s, "height", this.preview.result.height);
  5718. }, 0);
  5719. setTimeout(() => {
  5720. _css(document.body, "overflow", "hidden");
  5721. }, 300);
  5722. return false;
  5723. }
  5724. },
  5725. wheel(e2) {
  5726. let d2 = e2.deltaY < 0 ? 0.1 : -0.1;
  5727. let ratio = 1 + d2;
  5728. let _scale = this.preview.scale * ratio;
  5729. if (_scale > this.preview.maxScale) {
  5730. ratio = this.preview.maxScale / this.preview.scale;
  5731. this.preview.scale = this.preview.maxScale;
  5732. } else if (_scale < this.preview.minScale) {
  5733. ratio = this.preview.minScale / this.preview.scale;
  5734. this.preview.scale = this.preview.minScale;
  5735. } else {
  5736. this.preview.scale = _scale;
  5737. }
  5738. if (e2.target.tagName === "IMG") {
  5739. const origin = {
  5740. x: d2 * this.preview.result.width / 2,
  5741. y: d2 * this.preview.result.height / 2
  5742. };
  5743. this.preview.x -= d2 * (e2.clientX - this.preview.x) - origin.x;
  5744. this.preview.y -= d2 * (e2.clientY - this.preview.y) - origin.y;
  5745. }
  5746. let s = document.querySelector(".shadow");
  5747. _css(s, "transition", "all 0.2s");
  5748. _css(s, "transform", `translate3d(${this.preview.x}px, ${this.preview.y}px, 0) scale(${this.preview.scale})`);
  5749. e2.preventDefault();
  5750. },
  5751. jump(floor) {
  5752. let lastItem = this.replyList[this.replyList.length - 1];
  5753. if (floor === "") {
  5754. floor = lastItem.floor;
  5755. } else {
  5756. try {
  5757. floor = Number(floor);
  5758. } catch (e2) {
  5759. floor = lastItem.floor;
  5760. }
  5761. if (floor === 0) {
  5762. floor = 1;
  5763. }
  5764. if (floor > lastItem.floor)
  5765. floor = lastItem.floor;
  5766. }
  5767. if (!this.post.replyList.length) {
  5768. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "没有回复可跳转!" });
  5769. return;
  5770. }
  5771. if (floor > this.post.replyList.length) {
  5772. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "没有找到对应回复!" });
  5773. return;
  5774. }
  5775. let comment = $(`.c_${floor}`);
  5776. if (!comment.length) {
  5777. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "没有找到对应回复!" });
  5778. return;
  5779. }
  5780. comment[0].scrollIntoView({ behavior: "smooth", block: "center", inline: "center" });
  5781. comment.addClass("ding");
  5782. this.currentFloor = floor + 1;
  5783. setTimeout(() => {
  5784. comment.removeClass("ding");
  5785. }, 2e3);
  5786. },
  5787. collapseTopReplyList() {
  5788. $(this.$refs.topReply).slideToggle("fast");
  5789. },
  5790. goBottom() {
  5791. this.isSticky = false;
  5792. setTimeout(() => {
  5793. if (this.isPost) {
  5794. let body = $("body , html");
  5795. let scrollHeight = body.prop("scrollHeight");
  5796. body.animate({ scrollTop: scrollHeight - 850 }, 300);
  5797. } else {
  5798. this.$refs.detail.scrollTo({ top: this.$refs.detail.scrollHeight, behavior: "smooth" });
  5799. }
  5800. });
  5801. },
  5802. close(from) {
  5803. if (this.isPost)
  5804. return;
  5805. if (from === "space") {
  5806. if (this.config.closePostDetailBySpace) {
  5807. this.$emit("update:modelValue", false);
  5808. }
  5809. } else {
  5810. this.$emit("update:modelValue", false);
  5811. }
  5812. },
  5813. setCall(e2) {
  5814. eventBus.emit(CMD.SET_CALL, e2);
  5815. this.showCallList = false;
  5816. },
  5817. onKeyDown(e2) {
  5818. if (!this.modelValue)
  5819. return;
  5820. if (!this.showCallList)
  5821. return;
  5822. let length = this.filterCallList.slice(0, 10).length;
  5823. if (e2.keyCode === 13) {
  5824. this.setCall(this.filterCallList[this.selectCallIndex]);
  5825. e2.preventDefault();
  5826. }
  5827. if (e2.keyCode === 38) {
  5828. this.selectCallIndex--;
  5829. if (this.selectCallIndex < 0) {
  5830. this.selectCallIndex = length - 1;
  5831. }
  5832. e2.preventDefault();
  5833. }
  5834. if (e2.keyCode === 40) {
  5835. this.selectCallIndex++;
  5836. if (this.selectCallIndex > length - 1) {
  5837. this.selectCallIndex = 0;
  5838. }
  5839. e2.preventDefault();
  5840. }
  5841. },
  5842. changeOption(item) {
  5843. this.$emit("update:displayType", item);
  5844. },
  5845. addThank() {
  5846. eventBus.emit(CMD.CHANGE_POST_THANK, { id: this.post.id, type: "add" });
  5847. },
  5848. recallThank() {
  5849. eventBus.emit(CMD.CHANGE_POST_THANK, { id: this.post.id, type: "recall" });
  5850. },
  5851. scrollTop() {
  5852. if (this.isPost) {
  5853. $("body , html").animate({ scrollTop: 0 }, 300);
  5854. } else {
  5855. this.$refs.detail.scrollTo({ top: 0, behavior: "smooth" });
  5856. }
  5857. }
  5858. }
  5859. };
  5860. const _withScopeId$3 = (n2) => (vue.pushScopeId("data-v-0863ff2a"), n2 = n2(), vue.popScopeId(), n2);
  5861. const _hoisted_1$6 = { class: "my-box post-wrapper" };
  5862. const _hoisted_2$3 = { class: "header" };
  5863. const _hoisted_3$3 = { class: "fr" };
  5864. const _hoisted_4$3 = ["href"];
  5865. const _hoisted_5$3 = ["src", "alt"];
  5866. const _hoisted_6$3 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode("a", { href: "/packages/pcckages/pc/public" }, "V2EX", -1));
  5867. const _hoisted_7$2 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode("span", { class: "chevron" }, "  ›  ", -1));
  5868. const _hoisted_8$2 = ["href"];
  5869. const _hoisted_9$2 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "sep10" }, null, -1));
  5870. const _hoisted_10$2 = ["id"];
  5871. const _hoisted_11$2 = ["onclick"];
  5872. const _hoisted_12$2 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode("li", { class: "fa fa-chevron-up" }, null, -1));
  5873. const _hoisted_13$2 = ["onclick"];
  5874. const _hoisted_14$1 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode("li", { class: "fa fa-chevron-down" }, null, -1));
  5875. const _hoisted_15$1 = [
  5876. _hoisted_14$1
  5877. ];
  5878. const _hoisted_16$1 = { class: "gray" };
  5879. const _hoisted_17$1 = ["href"];
  5880. const _hoisted_18$1 = ["title"];
  5881. const _hoisted_19$1 = ["href"];
  5882. const _hoisted_20$1 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode("li", { class: "fa fa-info-circle" }, null, -1));
  5883. const _hoisted_21$1 = [
  5884. _hoisted_20$1
  5885. ];
  5886. const _hoisted_22$1 = ["href"];
  5887. const _hoisted_23$1 = ["href"];
  5888. const _hoisted_24 = ["href"];
  5889. const _hoisted_25 = { class: "my-tag" };
  5890. const _hoisted_26 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode("i", { class: "fa fa-tag" }, null, -1));
  5891. const _hoisted_27 = ["onClick"];
  5892. const _hoisted_28 = {
  5893. key: 0,
  5894. class: "my-box"
  5895. };
  5896. const _hoisted_29 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode("span", null, "高赞回复", -1));
  5897. const _hoisted_30 = { class: "top-reply" };
  5898. const _hoisted_31 = { class: "tool" };
  5899. const _hoisted_32 = { ref: "topReply" };
  5900. const _hoisted_33 = { class: "my-box comment-wrapper" };
  5901. const _hoisted_34 = {
  5902. key: 0,
  5903. class: "my-cell flex"
  5904. };
  5905. const _hoisted_35 = { key: 0 };
  5906. const _hoisted_36 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode("strong", { class: "snow" }, "•", -1));
  5907. const _hoisted_37 = ["innerHTML"];
  5908. const _hoisted_38 = {
  5909. key: 0,
  5910. class: "loading-wrapper"
  5911. };
  5912. const _hoisted_39 = {
  5913. key: 1,
  5914. class: "comments"
  5915. };
  5916. const _hoisted_40 = {
  5917. key: 1,
  5918. id: "no-comments-yet"
  5919. };
  5920. const _hoisted_41 = { class: "my-cell flex" };
  5921. const _hoisted_42 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode("span", null, "添加一条新回复", -1));
  5922. const _hoisted_43 = { class: "notice-right gray" };
  5923. const _hoisted_44 = { class: "p1" };
  5924. const _hoisted_45 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode("span", { class: "gray" }, "上下文", -1));
  5925. const _hoisted_46 = { class: "top-reply" };
  5926. const _hoisted_47 = ["onClick"];
  5927. function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
  5928. const _component_BaseHtmlRender = vue.resolveComponent("BaseHtmlRender");
  5929. const _component_Point = vue.resolveComponent("Point");
  5930. const _component_Toolbar = vue.resolveComponent("Toolbar");
  5931. const _component_Icon = vue.resolveComponent("Icon");
  5932. const _component_Tooltip = vue.resolveComponent("Tooltip");
  5933. const _component_Comment = vue.resolveComponent("Comment");
  5934. const _component_BaseSelect = vue.resolveComponent("BaseSelect");
  5935. const _component_BaseLoading = vue.resolveComponent("BaseLoading");
  5936. const _component_PostEditor = vue.resolveComponent("PostEditor");
  5937. const _component_SingleComment = vue.resolveComponent("SingleComment");
  5938. return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
  5939. class: vue.normalizeClass(["post-detail", [$options.isNight ? "isNight" : "", $options.pageType]]),
  5940. ref: "detail",
  5941. onKeydown: _cache[22] || (_cache[22] = vue.withKeys(($event) => $options.close(), ["esc"])),
  5942. onClick: _cache[23] || (_cache[23] = ($event) => $options.close("space"))
  5943. }, [
  5944. vue.createElementVNode("div", {
  5945. ref: "main",
  5946. class: "main",
  5947. tabindex: "1",
  5948. onClick: _cache[19] || (_cache[19] = (...args) => $options.stop && $options.stop(...args))
  5949. }, [
  5950. vue.createElementVNode("div", {
  5951. class: "main-wrapper",
  5952. ref: "mainWrapper",
  5953. style: vue.normalizeStyle({ width: $options.config.postWidth + "!important" })
  5954. }, [
  5955. vue.createElementVNode("div", _hoisted_1$6, [
  5956. vue.createElementVNode("div", _hoisted_2$3, [
  5957. vue.createElementVNode("div", _hoisted_3$3, [
  5958. vue.createElementVNode("a", {
  5959. href: `/member/${$options.post.member.username}`,
  5960. style: { "width": "73px", "height": "73px", "display": "inline-block" }
  5961. }, [
  5962. $options.post.member.avatar_large ? (vue.openBlock(), vue.createElementBlock("img", {
  5963. key: 0,
  5964. src: $options.post.member.avatar_large,
  5965. class: "avatar",
  5966. style: { "width": "73px", "height": "73px" },
  5967. border: "0",
  5968. align: "default",
  5969. alt: $options.post.member.username
  5970. }, null, 8, _hoisted_5$3)) : vue.createCommentVNode("", true)
  5971. ], 8, _hoisted_4$3)
  5972. ]),
  5973. _hoisted_6$3,
  5974. _hoisted_7$2,
  5975. vue.createElementVNode("a", {
  5976. href: $options.post.node.url
  5977. }, vue.toDisplayString($options.post.node.title), 9, _hoisted_8$2),
  5978. _hoisted_9$2,
  5979. vue.createElementVNode("h1", null, vue.toDisplayString($options.post.title), 1),
  5980. vue.createElementVNode("div", {
  5981. id: `topic_${$options.post.id}_votes`,
  5982. class: "votes"
  5983. }, [
  5984. vue.createElementVNode("a", {
  5985. href: "javascript:",
  5986. onclick: `upVoteTopic(${$options.post.id});`,
  5987. class: "vote"
  5988. }, [
  5989. _hoisted_12$2,
  5990. vue.createTextVNode("   ")
  5991. ], 8, _hoisted_11$2),
  5992. vue.createTextVNode("   "),
  5993. vue.createElementVNode("a", {
  5994. href: "javascript:",
  5995. onclick: `downVoteTopic(${$options.post.id});`,
  5996. class: "vote"
  5997. }, _hoisted_15$1, 8, _hoisted_13$2)
  5998. ], 8, _hoisted_10$2),
  5999. vue.createTextVNode("   "),
  6000. vue.createElementVNode("small", _hoisted_16$1, [
  6001. vue.createElementVNode("a", {
  6002. href: `/member/${$options.post.member.username}`
  6003. }, vue.toDisplayString($options.post.member.username), 9, _hoisted_17$1),
  6004. vue.createTextVNode(" · "),
  6005. $options.post.member.createDate ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
  6006. vue.createElementVNode("span", {
  6007. class: vue.normalizeClass($options.post.member.isNew && "danger")
  6008. }, vue.toDisplayString($options.post.member.createDate), 3),
  6009. vue.createTextVNode(" · ")
  6010. ], 64)) : vue.createCommentVNode("", true),
  6011. $options.post.createDateAgo ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
  6012. vue.createElementVNode("span", {
  6013. title: $options.post.createDate
  6014. }, vue.toDisplayString($options.post.createDateAgo), 9, _hoisted_18$1),
  6015. vue.createTextVNode(" · ")
  6016. ], 64)) : vue.createCommentVNode("", true),
  6017. vue.createTextVNode(" " + vue.toDisplayString($options.post.clickCount) + " 次点击 ", 1),
  6018. $options.isMy ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
  6019. vue.createTextVNode("   "),
  6020. vue.createElementVNode("a", {
  6021. href: `/t/${$options.post.id}/info`
  6022. }, _hoisted_21$1, 8, _hoisted_19$1),
  6023. vue.createTextVNode("   "),
  6024. $options.canAppend ? (vue.openBlock(), vue.createElementBlock("a", {
  6025. key: 0,
  6026. href: `/append/topic/${$options.post.id}`,
  6027. class: "op"
  6028. }, "APPEND", 8, _hoisted_22$1)) : vue.createCommentVNode("", true),
  6029. $options.canEditMove ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
  6030. vue.createElementVNode("a", {
  6031. href: `/move/topic/${$options.post.id}`,
  6032. class: "op"
  6033. }, "MOVE", 8, _hoisted_23$1),
  6034. vue.createTextVNode("  "),
  6035. vue.createElementVNode("a", {
  6036. href: `/edit/topic/${$options.post.id}`,
  6037. class: "op"
  6038. }, "EDIT", 8, _hoisted_24)
  6039. ], 64)) : vue.createCommentVNode("", true)
  6040. ], 64)) : vue.createCommentVNode("", true)
  6041. ]),
  6042. $options.isLogin && $options.config.openTag ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
  6043. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.myTags, (i) => {
  6044. return vue.openBlock(), vue.createElementBlock("span", _hoisted_25, [
  6045. _hoisted_26,
  6046. vue.createElementVNode("span", null, vue.toDisplayString(i), 1),
  6047. vue.createElementVNode("i", {
  6048. class: "fa fa-trash-o remove",
  6049. onClick: vue.withModifiers(($event) => $options.removeTag(i), ["stop"])
  6050. }, null, 8, _hoisted_27)
  6051. ]);
  6052. }), 256)),
  6053. vue.createElementVNode("span", {
  6054. class: "add-tag ago",
  6055. onClick: _cache[0] || (_cache[0] = vue.withModifiers((...args) => $options.addTag && $options.addTag(...args), ["stop"])),
  6056. title: "添加标签"
  6057. }, "+")
  6058. ], 64)) : vue.createCommentVNode("", true)
  6059. ]),
  6060. $options.post.headerTemplate ? (vue.openBlock(), vue.createBlock(_component_BaseHtmlRender, {
  6061. key: 0,
  6062. html: $options.post.headerTemplate
  6063. }, null, 8, ["html"])) : (vue.openBlock(), vue.createBlock(_component_BaseHtmlRender, {
  6064. key: 1,
  6065. html: $options.post.jsonContent
  6066. }, null, 8, ["html"])),
  6067. vue.createVNode(_component_Toolbar, {
  6068. onReply: _cache[1] || (_cache[1] = ($event) => $data.isSticky = !$data.isSticky)
  6069. }, {
  6070. default: vue.withCtx(() => [
  6071. vue.createVNode(_component_Point, {
  6072. onAddThank: $options.addThank,
  6073. onRecallThank: $options.recallThank,
  6074. item: {
  6075. isThanked: $options.post.isThanked,
  6076. thankCount: $options.post.thankCount,
  6077. username: $options.post.username
  6078. },
  6079. "api-url": "topic/" + $options.post.id
  6080. }, null, 8, ["onAddThank", "onRecallThank", "item", "api-url"])
  6081. ]),
  6082. _: 1
  6083. })
  6084. ]),
  6085. $options.post.topReplyList.length && $options.config.showTopReply ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_28, [
  6086. vue.createElementVNode("div", {
  6087. class: "my-cell flex",
  6088. onClick: _cache[2] || (_cache[2] = vue.withModifiers((...args) => $options.collapseTopReplyList && $options.collapseTopReplyList(...args), ["stop"]))
  6089. }, [
  6090. _hoisted_29,
  6091. vue.createElementVNode("div", _hoisted_30, [
  6092. vue.createVNode(_component_Tooltip, { title: "收起高赞回复" }, {
  6093. default: vue.withCtx(() => [
  6094. vue.createElementVNode("div", _hoisted_31, [
  6095. vue.createVNode(_component_Icon, { icon: "gravity-ui:chevrons-collapse-vertical" })
  6096. ])
  6097. ]),
  6098. _: 1
  6099. })
  6100. ])
  6101. ]),
  6102. vue.createElementVNode("div", _hoisted_32, [
  6103. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.post.topReplyList, (item, index) => {
  6104. return vue.openBlock(), vue.createBlock(_component_Comment, {
  6105. key: item.floor,
  6106. type: "top",
  6107. modelValue: $options.post.topReplyList[index],
  6108. "onUpdate:modelValue": ($event) => $options.post.topReplyList[index] = $event
  6109. }, null, 8, ["modelValue", "onUpdate:modelValue"]);
  6110. }), 128))
  6111. ], 512)
  6112. ])) : vue.createCommentVNode("", true),
  6113. vue.createElementVNode("div", _hoisted_33, [
  6114. $options.post.replyList.length || $props.loading ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_34, [
  6115. vue.createElementVNode("div", null, [
  6116. vue.createTextVNode(vue.toDisplayString($options.post.replyCount) + " 条回复 ", 1),
  6117. $options.post.lastReplyDate ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_35, [
  6118. vue.createTextVNode("  "),
  6119. _hoisted_36,
  6120. vue.createTextVNode("  " + vue.toDisplayString($options.post.lastReplyDate), 1)
  6121. ])) : vue.createCommentVNode("", true)
  6122. ]),
  6123. $options.config.showToolbar ? (vue.openBlock(), vue.createBlock(_component_BaseSelect, {
  6124. key: 0,
  6125. "display-type": $props.displayType,
  6126. "onUpdate:displayType": _cache[3] || (_cache[3] = (e2) => _ctx.$emit("update:displayType", e2))
  6127. }, null, 8, ["display-type"])) : (vue.openBlock(), vue.createElementBlock("div", {
  6128. key: 1,
  6129. class: "fr",
  6130. innerHTML: $options.post.fr
  6131. }, null, 8, _hoisted_37))
  6132. ])) : vue.createCommentVNode("", true),
  6133. $options.replyList.length || $props.loading ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
  6134. $props.loading ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_38, [
  6135. vue.createVNode(_component_BaseLoading, { size: "large" })
  6136. ])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_39, [
  6137. $props.modelValue ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 0 }, vue.renderList($options.replyList, (item, index) => {
  6138. return vue.openBlock(), vue.createBlock(_component_Comment, {
  6139. key: item.floor,
  6140. modelValue: $options.replyList[index],
  6141. "onUpdate:modelValue": ($event) => $options.replyList[index] = $event
  6142. }, null, 8, ["modelValue", "onUpdate:modelValue"]);
  6143. }), 128)) : vue.createCommentVNode("", true)
  6144. ]))
  6145. ], 64)) : vue.createCommentVNode("", true)
  6146. ]),
  6147. !($options.replyList.length || $props.loading) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_40, "目前尚无回复")) : vue.createCommentVNode("", true),
  6148. $options.isLogin ? (vue.openBlock(), vue.createElementBlock("div", {
  6149. key: 2,
  6150. class: vue.normalizeClass(["my-box", { "sticky": $data.isSticky }]),
  6151. ref: "replyBox"
  6152. }, [
  6153. vue.createElementVNode("div", _hoisted_41, [
  6154. _hoisted_42,
  6155. vue.createElementVNode("div", _hoisted_43, [
  6156. $data.isSticky ? (vue.openBlock(), vue.createElementBlock("a", {
  6157. key: 0,
  6158. style: { "margin-right": "2rem" },
  6159. onClick: _cache[4] || (_cache[4] = vue.withModifiers(($event) => $data.isSticky = false, ["stop"]))
  6160. }, "取消回复框停靠")) : vue.createCommentVNode("", true),
  6161. vue.createElementVNode("a", {
  6162. onClick: _cache[5] || (_cache[5] = vue.withModifiers((...args) => $options.scrollTop && $options.scrollTop(...args), ["stop"]))
  6163. }, "回到顶部")
  6164. ])
  6165. ]),
  6166. vue.createElementVNode("div", _hoisted_44, [
  6167. vue.createVNode(_component_PostEditor, {
  6168. onClose: $options.goBottom,
  6169. ref: "post-editor",
  6170. useType: "reply-post",
  6171. onClick: _cache[6] || (_cache[6] = vue.withModifiers(($event) => $data.isSticky = true, ["stop"]))
  6172. }, null, 8, ["onClose"])
  6173. ])
  6174. ], 2)) : vue.createCommentVNode("", true)
  6175. ], 4),
  6176. $data.showRelationReply ? (vue.openBlock(), vue.createElementBlock("div", {
  6177. key: 0,
  6178. class: "relationReply",
  6179. onClick: _cache[10] || (_cache[10] = vue.withModifiers(($event) => $options.close("space"), ["stop"]))
  6180. }, [
  6181. vue.createElementVNode("div", {
  6182. class: "my-cell flex",
  6183. onClick: _cache[8] || (_cache[8] = vue.withModifiers((...args) => $options.stop && $options.stop(...args), ["stop"]))
  6184. }, [
  6185. _hoisted_45,
  6186. vue.createElementVNode("div", _hoisted_46, [
  6187. vue.createVNode(_component_Icon, {
  6188. icon: "ic:round-close",
  6189. onClick: _cache[7] || (_cache[7] = vue.withModifiers(($event) => $data.showRelationReply = false, ["stop"]))
  6190. })
  6191. ])
  6192. ]),
  6193. vue.createElementVNode("div", {
  6194. class: "comments",
  6195. onClick: _cache[9] || (_cache[9] = vue.withModifiers((...args) => $options.stop && $options.stop(...args), ["stop"]))
  6196. }, [
  6197. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.relationReply, (item, index) => {
  6198. return vue.openBlock(), vue.createBlock(_component_SingleComment, {
  6199. "is-right": item.username === $data.targetUser.right,
  6200. key: item.floor,
  6201. comment: item
  6202. }, null, 8, ["is-right", "comment"]);
  6203. }), 128))
  6204. ])
  6205. ])) : vue.createCommentVNode("", true),
  6206. $data.showCallList && $options.filterCallList.length ? (vue.openBlock(), vue.createElementBlock("div", {
  6207. key: 1,
  6208. class: "call-list",
  6209. style: vue.normalizeStyle($data.callStyle)
  6210. }, [
  6211. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.filterCallList, (item, index) => {
  6212. return vue.openBlock(), vue.createElementBlock("div", {
  6213. class: vue.normalizeClass(["call-item", { select: index === $data.selectCallIndex }]),
  6214. onClick: vue.withModifiers(($event) => $options.setCall(item), ["stop"])
  6215. }, [
  6216. vue.createElementVNode("a", null, vue.toDisplayString(item), 1)
  6217. ], 10, _hoisted_47);
  6218. }), 256))
  6219. ], 4)) : vue.createCommentVNode("", true),
  6220. vue.createElementVNode("div", {
  6221. class: "close-btn",
  6222. onClick: _cache[11] || (_cache[11] = vue.withModifiers(($event) => $options.close("btn"), ["stop"]))
  6223. }, [
  6224. vue.createVNode(_component_Icon, { icon: "icon-park-outline:close" })
  6225. ]),
  6226. vue.createElementVNode("div", {
  6227. class: "open-new-tab",
  6228. onClick: _cache[12] || (_cache[12] = vue.withModifiers(($event) => $options.functions.openNewTab("https://www.v2ex.com/t/" + $options.post.id, $options.config.newTabOpenActive), ["stop"]))
  6229. }, [
  6230. vue.createVNode(_component_Icon, { icon: "majesticons:open" })
  6231. ]),
  6232. vue.createElementVNode("div", {
  6233. class: "refresh gray",
  6234. onClick: _cache[13] || (_cache[13] = vue.withModifiers(($event) => _ctx.$emit("refresh"), ["stop"]))
  6235. }, [
  6236. $props.refreshLoading ? (vue.openBlock(), vue.createBlock(_component_BaseLoading, { key: 0 })) : (vue.openBlock(), vue.createBlock(_component_Icon, {
  6237. key: 1,
  6238. icon: "material-symbols:refresh"
  6239. }))
  6240. ]),
  6241. vue.createElementVNode("div", {
  6242. class: "scroll-to gray",
  6243. onClick: _cache[17] || (_cache[17] = vue.withModifiers(($event) => $options.jump($data.currentFloor), ["stop"]))
  6244. }, [
  6245. vue.createVNode(_component_Icon, { icon: "lucide:move-down" }),
  6246. vue.withDirectives(vue.createElementVNode("input", {
  6247. type: "text",
  6248. "onUpdate:modelValue": _cache[14] || (_cache[14] = ($event) => $data.currentFloor = $event),
  6249. onClick: _cache[15] || (_cache[15] = vue.withModifiers((...args) => $options.stop && $options.stop(...args), ["stop"])),
  6250. onKeydown: _cache[16] || (_cache[16] = vue.withKeys(($event) => $options.jump($data.currentFloor), ["enter"]))
  6251. }, null, 544), [
  6252. [vue.vModelText, $data.currentFloor]
  6253. ])
  6254. ]),
  6255. vue.createElementVNode("div", {
  6256. class: "scroll-top gray",
  6257. onClick: _cache[18] || (_cache[18] = vue.withModifiers((...args) => $options.scrollTop && $options.scrollTop(...args), ["stop"]))
  6258. }, [
  6259. vue.createVNode(_component_Icon, { icon: "lucide:move-up" })
  6260. ])
  6261. ], 512),
  6262. (vue.openBlock(), vue.createBlock(vue.Teleport, { to: "body" }, [
  6263. vue.createElementVNode("div", {
  6264. class: "preview-modal",
  6265. onWheel: _cache[21] || (_cache[21] = (...args) => $options.wheel && $options.wheel(...args))
  6266. }, [
  6267. vue.createElementVNode("div", {
  6268. class: "mask",
  6269. onClick: _cache[20] || (_cache[20] = (...args) => $options.closePreviewModal && $options.closePreviewModal(...args))
  6270. }),
  6271. vue.createVNode(_component_Icon, {
  6272. class: "close",
  6273. icon: "fontisto:close-a",
  6274. onClick: $options.closePreviewModal
  6275. }, null, 8, ["onClick"])
  6276. ], 32)
  6277. ]))
  6278. ], 34)), [
  6279. [vue.vShow, $props.modelValue]
  6280. ]);
  6281. }
  6282. const PostDetail = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$2], ["__scopeId", "data-v-0863ff2a"]]);
  6283. const _hoisted_1$5 = { key: 1 };
  6284. const _sfc_main$5 = {
  6285. __name: "Base64Tooltip",
  6286. setup(__props) {
  6287. const tooltip = vue.ref(null);
  6288. const show = vue.ref(false);
  6289. const originalText = vue.ref("");
  6290. const decodeText = vue.ref("");
  6291. const styleObject = vue.reactive({
  6292. left: "-100vw",
  6293. top: "-100vh"
  6294. });
  6295. vue.onMounted(() => {
  6296. eventBus.on(CMD.SHOW_TOOLTIP, ({ text, e: e2 }) => {
  6297. setTimeout(() => show.value = true);
  6298. originalText.value = text;
  6299. decodeText.value = "";
  6300. styleObject.left = e2.clientX + "px";
  6301. styleObject.top = e2.clientY + 20 + "px";
  6302. });
  6303. window.addEventListener("click", (e2) => {
  6304. if (!tooltip.value)
  6305. return;
  6306. if (!tooltip.value.contains(e2.target) && show.value) {
  6307. show.value = false;
  6308. }
  6309. }, { capture: true });
  6310. const fn = () => show.value && (show.value = false);
  6311. $(".post-detail", document).on("scroll", fn);
  6312. });
  6313. function copy() {
  6314. if (navigator.clipboard) {
  6315. navigator.clipboard.writeText(decodeText.value);
  6316. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: "复制成功" });
  6317. } else {
  6318. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "复制失败!浏览器不支持!" });
  6319. }
  6320. }
  6321. function base64ToArrayBuffer(base64) {
  6322. let binary_string = window.atob(base64);
  6323. let len = binary_string.length;
  6324. let bytes = new Uint8Array(len);
  6325. for (let i = 0; i < len; i++) {
  6326. bytes[i] = binary_string.charCodeAt(i);
  6327. }
  6328. return bytes.buffer;
  6329. }
  6330. function decode() {
  6331. try {
  6332. new Blob([base64ToArrayBuffer(originalText.value)]).text().then((r2) => {
  6333. decodeText.value = r2;
  6334. });
  6335. } catch (e2) {
  6336. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "Base64解码失败!不是标准数据!" });
  6337. }
  6338. }
  6339. return (_ctx, _cache) => {
  6340. return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
  6341. class: "base64_tooltip",
  6342. style: vue.normalizeStyle(styleObject),
  6343. onClick: decode,
  6344. ref_key: "tooltip",
  6345. ref: tooltip
  6346. }, [
  6347. !decodeText.value ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
  6348. vue.createTextVNode(" Base64解码:" + vue.toDisplayString(originalText.value) + " ", 1),
  6349. vue.createVNode(vue.unref(Icon), { icon: "system-uicons:translate" })
  6350. ], 64)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$5, [
  6351. vue.createElementVNode("span", null, vue.toDisplayString(decodeText.value), 1),
  6352. vue.createVNode(BaseButton, {
  6353. class: "btn",
  6354. size: "small",
  6355. onClick: copy
  6356. }, {
  6357. default: vue.withCtx(() => [
  6358. vue.createTextVNode("点击复制")
  6359. ]),
  6360. _: 1
  6361. })
  6362. ]))
  6363. ], 4)), [
  6364. [vue.vShow, show.value]
  6365. ]);
  6366. };
  6367. }
  6368. };
  6369. const Base64Tooltip = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-06429e70"]]);
  6370. const _sfc_main$4 = {
  6371. name: "Msg",
  6372. components: { Icon },
  6373. props: {
  6374. type: "",
  6375. text: ""
  6376. },
  6377. created() {
  6378. setTimeout(() => {
  6379. this.$emit("close");
  6380. }, 3e3);
  6381. }
  6382. };
  6383. const _hoisted_1$4 = { class: "right" };
  6384. function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
  6385. const _component_Icon = vue.resolveComponent("Icon");
  6386. return vue.openBlock(), vue.createElementBlock("div", {
  6387. class: vue.normalizeClass(["msg", $props.type])
  6388. }, [
  6389. vue.createElementVNode("div", {
  6390. class: "left",
  6391. onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("close"))
  6392. }, [
  6393. vue.createVNode(_component_Icon, { icon: "ic:round-close" })
  6394. ]),
  6395. vue.createElementVNode("div", _hoisted_1$4, vue.toDisplayString($props.text), 1)
  6396. ], 2);
  6397. }
  6398. const Msg = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$1], ["__scopeId", "data-v-8bf692ea"]]);
  6399. const _withScopeId$2 = (n2) => (vue.pushScopeId("data-v-0f1f99f7"), n2 = n2(), vue.popScopeId(), n2);
  6400. const _hoisted_1$3 = {
  6401. key: 0,
  6402. class: "tag-modal modal"
  6403. };
  6404. const _hoisted_2$2 = { class: "wrapper" };
  6405. const _hoisted_3$2 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "title" }, " 添加标签 ", -1));
  6406. const _hoisted_4$2 = { class: "option" };
  6407. const _hoisted_5$2 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ vue.createElementVNode("span", null, "用户:", -1));
  6408. const _hoisted_6$2 = { class: "btns" };
  6409. const _sfc_main$3 = {
  6410. __name: "TagModal",
  6411. props: ["tags"],
  6412. emits: ["update:tags"],
  6413. setup(__props, { emit: __emit }) {
  6414. const tagModal = vue.reactive({
  6415. show: false,
  6416. currentUsername: "",
  6417. tag: ""
  6418. });
  6419. const props = __props;
  6420. const emit = __emit;
  6421. const inputRef = vue.ref();
  6422. vue.onMounted(() => {
  6423. eventBus.on(CMD.ADD_TAG, (username) => {
  6424. tagModal.currentUsername = username;
  6425. tagModal.show = true;
  6426. vue.nextTick(() => {
  6427. inputRef.value.focus();
  6428. });
  6429. });
  6430. });
  6431. async function addTag() {
  6432. if (!tagModal.tag) {
  6433. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "请输入标签" });
  6434. return;
  6435. }
  6436. let oldTag = functions.clone(props.tags);
  6437. let tempTag = functions.clone(props.tags);
  6438. let userTags = tempTag[tagModal.currentUsername] ?? [];
  6439. let rIndex = userTags.findIndex((v) => v === tagModal.tag);
  6440. if (rIndex > -1) {
  6441. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "标签已存在!" });
  6442. return;
  6443. } else {
  6444. userTags.push(tagModal.tag);
  6445. }
  6446. tempTag[tagModal.currentUsername] = userTags;
  6447. emit("update:tags", tempTag);
  6448. tagModal.tag = "";
  6449. tagModal.show = false;
  6450. let res = await window.parse.saveTags(tempTag);
  6451. if (!res) {
  6452. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "标签添加失败!" });
  6453. emit("update:tags", oldTag);
  6454. }
  6455. }
  6456. return (_ctx, _cache) => {
  6457. return vue.openBlock(), vue.createBlock(vue.Transition, null, {
  6458. default: vue.withCtx(() => [
  6459. tagModal.show ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$3, [
  6460. vue.createElementVNode("div", {
  6461. class: "mask",
  6462. onClick: _cache[0] || (_cache[0] = vue.withModifiers(($event) => tagModal.show = false, ["stop"]))
  6463. }),
  6464. vue.createElementVNode("div", _hoisted_2$2, [
  6465. _hoisted_3$2,
  6466. vue.createElementVNode("div", _hoisted_4$2, [
  6467. _hoisted_5$2,
  6468. vue.createElementVNode("div", null, [
  6469. vue.createElementVNode("b", null, vue.toDisplayString(tagModal.currentUsername), 1)
  6470. ])
  6471. ]),
  6472. vue.withDirectives(vue.createElementVNode("input", {
  6473. type: "text",
  6474. ref_key: "inputRef",
  6475. ref: inputRef,
  6476. style: { "width": "100%" },
  6477. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => tagModal.tag = $event),
  6478. onKeydown: vue.withKeys(addTag, ["enter"])
  6479. }, null, 544), [
  6480. [vue.vModelText, tagModal.tag]
  6481. ]),
  6482. vue.createElementVNode("div", _hoisted_6$2, [
  6483. vue.createVNode(BaseButton, {
  6484. type: "link",
  6485. onClick: _cache[2] || (_cache[2] = vue.withModifiers(($event) => {
  6486. tagModal.show = false;
  6487. tagModal.tag = "";
  6488. }, ["stop"]))
  6489. }, {
  6490. default: vue.withCtx(() => [
  6491. vue.createTextVNode("取消")
  6492. ]),
  6493. _: 1
  6494. }),
  6495. vue.createVNode(BaseButton, {
  6496. onClick: vue.withModifiers(addTag, ["stop"])
  6497. }, {
  6498. default: vue.withCtx(() => [
  6499. vue.createTextVNode("确定")
  6500. ]),
  6501. _: 1
  6502. })
  6503. ])
  6504. ])
  6505. ])) : vue.createCommentVNode("", true)
  6506. ]),
  6507. _: 1
  6508. });
  6509. };
  6510. }
  6511. };
  6512. const TagModal = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-0f1f99f7"]]);
  6513. const _hoisted_1$2 = { class: "msgs" };
  6514. const _sfc_main$2 = {
  6515. __name: "MsgModal",
  6516. setup(__props) {
  6517. const msgList = vue.reactive([
  6518. // {type: 'success', text: '123', id: Date.now()}
  6519. ]);
  6520. vue.onMounted(() => {
  6521. eventBus.on(CMD.SHOW_MSG, (val) => {
  6522. msgList.push({ ...val, id: Date.now() });
  6523. });
  6524. });
  6525. function removeMsg(id) {
  6526. let rIndex = msgList.findIndex((item) => item.id === id);
  6527. if (rIndex > -1) {
  6528. msgList.splice(rIndex, 1);
  6529. }
  6530. }
  6531. return (_ctx, _cache) => {
  6532. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$2, [
  6533. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(msgList, (v) => {
  6534. return vue.openBlock(), vue.createBlock(Msg, {
  6535. key: v.id,
  6536. type: v.type,
  6537. text: v.text,
  6538. onClose: ($event) => removeMsg(v.id)
  6539. }, null, 8, ["type", "text", "onClose"]);
  6540. }), 128))
  6541. ]);
  6542. };
  6543. }
  6544. };
  6545. const MsgModal = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-b73f4332"]]);
  6546. let u = ".__cf_email__", f = "data-cfemail", d = document.createElement("div");
  6547. function e(e2) {
  6548. console.error(e2);
  6549. }
  6550. function r(e2, t) {
  6551. let r2 = e2.substr(t, 2);
  6552. return parseInt(r2, 16);
  6553. }
  6554. function n(href, index) {
  6555. let o = "", a = r(href, index);
  6556. for (let i = index + 2; i < href.length; i += 2) {
  6557. let l = r(href, i) ^ a;
  6558. o += String.fromCharCode(l);
  6559. }
  6560. try {
  6561. o = decodeURIComponent(escape(o));
  6562. } catch (u2) {
  6563. e(u2);
  6564. }
  6565. d.innerHTML = '<a href="' + o.replace(/"/g, "&quot;") + '"></a>';
  6566. return d.childNodes[0].getAttribute("href") || "";
  6567. }
  6568. function decodeEmail(body) {
  6569. try {
  6570. let as = body.find(u);
  6571. as.each(function() {
  6572. try {
  6573. let o = this, a = o.parentNode, i = o.getAttribute(f);
  6574. if (i) {
  6575. let l = n(i, 0), d2 = document.createTextNode(l);
  6576. a.replaceChild(d2, o);
  6577. }
  6578. } catch (h2) {
  6579. e(h2);
  6580. }
  6581. });
  6582. } catch (s) {
  6583. e(s);
  6584. }
  6585. }
  6586. const _withScopeId$1 = (n2) => (vue.pushScopeId("data-v-77aa374e"), n2 = n2(), vue.popScopeId(), n2);
  6587. const _hoisted_1$1 = {
  6588. key: 0,
  6589. class: "NotificationModal modal"
  6590. };
  6591. const _hoisted_2$1 = { class: "modal-root" };
  6592. const _hoisted_3$1 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "title" }, " 提醒系统 ", -1));
  6593. const _hoisted_4$1 = { class: "modal-body" };
  6594. const _hoisted_5$1 = { class: "filter" };
  6595. const _hoisted_6$1 = { class: "list-wrap" };
  6596. const _hoisted_7$1 = { class: "notify-wrap" };
  6597. const _hoisted_8$1 = ["innerHTML"];
  6598. const _hoisted_9$1 = {
  6599. key: 0,
  6600. class: "loading-wrap"
  6601. };
  6602. const _hoisted_10$1 = { class: "footer" };
  6603. const _hoisted_11$1 = ["innerHTML"];
  6604. const _hoisted_12$1 = { class: "total" };
  6605. const _hoisted_13$1 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ vue.createElementVNode("span", null, "总共收到提醒", -1));
  6606. const _sfc_main$1 = {
  6607. __name: "NotificationModal",
  6608. props: ["modelValue", "list", "total", "pages", "loading"],
  6609. emits: ["update:modelValue"],
  6610. setup(__props, { emit: __emit }) {
  6611. const props = __props;
  6612. const emit = __emit;
  6613. const index = vue.ref("all");
  6614. vue.onMounted(() => {
  6615. });
  6616. vue.watch([index, () => props.list], () => {
  6617. $(".notify-wrap").scrollTop(0);
  6618. });
  6619. vue.watch(() => props.modelValue, (n2) => {
  6620. if (n2) {
  6621. document.body.style.overflow = "hidden";
  6622. } else {
  6623. document.body.style.overflow = "unset";
  6624. $(".notify-wrap").scrollTop(0);
  6625. }
  6626. });
  6627. function close() {
  6628. emit("update:modelValue", false);
  6629. }
  6630. return (_ctx, _cache) => {
  6631. return vue.openBlock(), vue.createBlock(vue.Transition, null, {
  6632. default: vue.withCtx(() => [
  6633. __props.modelValue ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$1, [
  6634. vue.createElementVNode("div", {
  6635. class: "mask",
  6636. onClick: vue.withModifiers(close, ["stop"])
  6637. }),
  6638. vue.createElementVNode("div", _hoisted_2$1, [
  6639. vue.createElementVNode("div", { class: "modal-header" }, [
  6640. _hoisted_3$1,
  6641. vue.createElementVNode("i", {
  6642. class: "fa fa-times",
  6643. onClick: close
  6644. })
  6645. ]),
  6646. vue.createElementVNode("div", _hoisted_4$1, [
  6647. vue.createElementVNode("div", _hoisted_5$1, [
  6648. vue.createElementVNode("div", {
  6649. class: vue.normalizeClass(index.value === "all" && "active"),
  6650. onClick: _cache[0] || (_cache[0] = ($event) => index.value = "all")
  6651. }, "全部", 2),
  6652. vue.createElementVNode("div", {
  6653. class: vue.normalizeClass(index.value === "reply" && "active"),
  6654. onClick: _cache[1] || (_cache[1] = ($event) => index.value = "reply")
  6655. }, "回复", 2),
  6656. vue.createElementVNode("div", {
  6657. class: vue.normalizeClass(index.value === "star" && "active"),
  6658. onClick: _cache[2] || (_cache[2] = ($event) => index.value = "star")
  6659. }, "感谢", 2),
  6660. vue.createElementVNode("div", {
  6661. class: vue.normalizeClass(index.value === "collect" && "active"),
  6662. onClick: _cache[3] || (_cache[3] = ($event) => index.value = "collect")
  6663. }, "收藏", 2)
  6664. ]),
  6665. vue.createElementVNode("div", _hoisted_6$1, [
  6666. vue.createElementVNode("div", _hoisted_7$1, [
  6667. vue.createElementVNode("div", {
  6668. id: "notifications",
  6669. class: vue.normalizeClass(index.value),
  6670. innerHTML: __props.list
  6671. }, null, 10, _hoisted_8$1)
  6672. ]),
  6673. __props.loading ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_9$1, [
  6674. vue.createVNode(BaseLoading)
  6675. ])) : vue.createCommentVNode("", true)
  6676. ]),
  6677. vue.createElementVNode("div", _hoisted_10$1, [
  6678. vue.createElementVNode("div", {
  6679. innerHTML: __props.pages,
  6680. class: "pages"
  6681. }, null, 8, _hoisted_11$1),
  6682. vue.createElementVNode("div", _hoisted_12$1, [
  6683. _hoisted_13$1,
  6684. vue.createTextVNode(vue.toDisplayString(__props.total), 1)
  6685. ])
  6686. ])
  6687. ])
  6688. ])
  6689. ])) : vue.createCommentVNode("", true)
  6690. ]),
  6691. _: 1
  6692. });
  6693. };
  6694. }
  6695. };
  6696. const NotificationModal = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-77aa374e"]]);
  6697. const _sfc_main = {
  6698. components: {
  6699. Icon,
  6700. BaseButton,
  6701. NotificationModal,
  6702. BaseLoading,
  6703. BaseSwitch,
  6704. MsgModal,
  6705. TagModal,
  6706. Tooltip,
  6707. Setting,
  6708. PostDetail,
  6709. Base64Tooltip,
  6710. Msg
  6711. },
  6712. provide() {
  6713. return {
  6714. isLogin: vue.computed(() => this.isLogin),
  6715. isNight: vue.computed(() => this.isNight),
  6716. pageType: vue.computed(() => this.pageType),
  6717. tags: vue.computed(() => this.tags),
  6718. show: vue.computed(() => this.show),
  6719. post: vue.computed(() => this.current),
  6720. config: vue.computed(() => this.config),
  6721. allReplyUsers: vue.computed(() => {
  6722. var _a, _b, _c;
  6723. if ((_a = this.current) == null ? void 0 : _a.replyList) {
  6724. return Array.from(new Set(((_c = (_b = this.current) == null ? void 0 : _b.replyList) == null ? void 0 : _c.map((v) => v.username)) ?? []));
  6725. }
  6726. return [];
  6727. }),
  6728. showConfig: this.showConfig
  6729. };
  6730. },
  6731. data() {
  6732. return {
  6733. loading: window.pageType === PageType.Post,
  6734. refreshLoading: false,
  6735. loadMore: false,
  6736. isLogin: !!window.user.username,
  6737. pageType: window.pageType,
  6738. isNight: window.isNight,
  6739. stopMe: window.stopMe,
  6740. //停止使用脚本
  6741. show: false,
  6742. current: getDefaultPost(),
  6743. list: [],
  6744. config: functions.clone(window.config),
  6745. tags: window.user.tags,
  6746. configModal: {
  6747. show: false
  6748. },
  6749. notificationModal: {
  6750. show: false,
  6751. loading: false,
  6752. list: "",
  6753. total: 0
  6754. },
  6755. previewModal: {
  6756. show: false,
  6757. src: ""
  6758. },
  6759. popConfirmModal: {
  6760. show: false,
  6761. title: "",
  6762. id: ""
  6763. },
  6764. timer: -1,
  6765. timer2: -1,
  6766. pageInfo: {
  6767. title: "",
  6768. number: 0
  6769. },
  6770. calendar: {
  6771. show: false,
  6772. year: "",
  6773. month: "",
  6774. dayCount: 0,
  6775. firstDayWeek: 0,
  6776. select: ""
  6777. }
  6778. };
  6779. },
  6780. computed: {
  6781. targetUserTags() {
  6782. return this.tags[window.targetUserName] ?? [];
  6783. },
  6784. isList() {
  6785. return [PageType.Home, PageType.Node].includes(this.pageType);
  6786. },
  6787. isPost() {
  6788. return this.pageType === PageType.Post;
  6789. },
  6790. isMember() {
  6791. return this.pageType === PageType.Member;
  6792. }
  6793. },
  6794. watch: {
  6795. config: {
  6796. handler(newVal, oldVal) {
  6797. console.log("config", functions.clone(newVal).notice, functions.clone(oldVal).notice);
  6798. let configStr = localStorage.getItem("v2ex-config");
  6799. if (configStr) {
  6800. let configObj = JSON.parse(configStr);
  6801. configObj[window.user.username || "default"] = newVal;
  6802. localStorage.setItem("v2ex-config", JSON.stringify(configObj));
  6803. }
  6804. window.config = newVal;
  6805. window.parse.editNoteItem(window.user.configPrefix + JSON.stringify(window.config), window.user.configNoteId);
  6806. },
  6807. deep: true
  6808. },
  6809. tags(newVal) {
  6810. window.user.tags = newVal;
  6811. },
  6812. "config.viewType"(newVal) {
  6813. if (!newVal)
  6814. return;
  6815. if (newVal === "card") {
  6816. $(".post-item").each(function() {
  6817. $(this).addClass("preview");
  6818. });
  6819. } else {
  6820. $(".post-item").each(function() {
  6821. $(this).removeClass("preview");
  6822. });
  6823. }
  6824. },
  6825. "pageInfo.number"(newVal) {
  6826. clearInterval(this.timer2);
  6827. if (newVal) {
  6828. document.title = `(${this.pageInfo.number}) ` + this.pageInfo.title;
  6829. if (this.config.notice.whenNewNoticeGlimmer) {
  6830. let c = 0;
  6831. this.timer2 = setInterval(() => {
  6832. c++;
  6833. document.title = this.pageInfo.title;
  6834. if (c % 2 === 0) {
  6835. document.title = `(${this.pageInfo.number}) ` + this.pageInfo.title;
  6836. }
  6837. }, 1e3);
  6838. }
  6839. } else {
  6840. document.title = this.pageInfo.title;
  6841. }
  6842. },
  6843. show(newVal) {
  6844. if (this.pageType === PageType.Post)
  6845. return;
  6846. if (newVal) {
  6847. document.body.style.overflow = "hidden";
  6848. if (!window.history.state) {
  6849. window.history.pushState({}, 0, this.current.href);
  6850. }
  6851. vue.nextTick(() => {
  6852. this.pageInfo.title = document.title = this.current.title ?? "V2EX";
  6853. });
  6854. } else {
  6855. document.body.style.overflow = "unset";
  6856. this.pageInfo.title = document.title = "V2EX";
  6857. if (window.history.state) {
  6858. window.history.back();
  6859. }
  6860. }
  6861. }
  6862. },
  6863. created() {
  6864. let that = this;
  6865. this.initEvent();
  6866. window.cb = this.winCb;
  6867. if (!window.canParseV2exPage)
  6868. return;
  6869. $(document).on("click", "a", this.clickA);
  6870. $(document).on("click", ".post-item", function(e2) {
  6871. if (e2.currentTarget.getAttribute("script"))
  6872. return;
  6873. if (that.stopMe)
  6874. return true;
  6875. if (this.classList.contains("preview")) {
  6876. if (e2.target.tagName !== "A" && e2.target.tagName !== "IMG" && !e2.target.classList.contains("toggle")) {
  6877. let id = this.dataset["id"];
  6878. let href = this.dataset["href"];
  6879. if (id) {
  6880. that.clickPost(e2, id, href);
  6881. } else {
  6882. if (href)
  6883. location.href = href;
  6884. }
  6885. }
  6886. }
  6887. });
  6888. $(document).on("click", ".toggle", (e2) => {
  6889. if (this.stopMe)
  6890. return true;
  6891. let id = e2.target.dataset["id"];
  6892. let itemDom = document.querySelector(`.id_${id}`);
  6893. if (itemDom.classList.contains("preview")) {
  6894. e2.target.innerText = "预览";
  6895. itemDom.classList.remove("preview");
  6896. } else {
  6897. if (this.config.viewType !== "card") {
  6898. let index = this.list.findIndex((v) => v.id == id);
  6899. if (index > -1) {
  6900. e2.target.innerText = "收起";
  6901. itemDom.classList.add("preview");
  6902. } else {
  6903. e2.target.innerText = "加载中";
  6904. functions.getPostDetailByApi(id).then((res) => {
  6905. if (res.content_rendered) {
  6906. res.href = itemDom.dataset["href"];
  6907. this.list.push(getDefaultPost(res));
  6908. itemDom.classList.add("preview");
  6909. e2.target.innerText = "收起";
  6910. functions.appendPostContent(res, itemDom);
  6911. } else {
  6912. e2.target.innerText = "预览";
  6913. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "主题暂无正文!" });
  6914. }
  6915. });
  6916. }
  6917. } else {
  6918. e2.target.innerText = "收起";
  6919. itemDom.classList.add("preview");
  6920. }
  6921. }
  6922. });
  6923. window.onpopstate = (event) => {
  6924. if (event.state) {
  6925. if (!this.show)
  6926. this.show = true;
  6927. } else {
  6928. if (this.show)
  6929. this.show = false;
  6930. }
  6931. };
  6932. if (this.config.notice.takeOverNoticePage) {
  6933. window.deleteNotification = (nId, token) => {
  6934. let item = $("#n_" + nId);
  6935. item.slideUp("fast");
  6936. $.post({
  6937. url: "/delete/notification/" + nId + "?once=" + token,
  6938. success() {
  6939. $.get({
  6940. url: "/notifications/below/" + window.notificationBottom,
  6941. success(data, status, request) {
  6942. item.remove();
  6943. $("#notifications").append(that.checkReplyItemType(data));
  6944. window.notificationBottom = request.getResponseHeader("X-V2EX-New-Notification-Bottom");
  6945. },
  6946. error() {
  6947. item.slideDown("fast");
  6948. }
  6949. });
  6950. },
  6951. error() {
  6952. item.slideDown("fast");
  6953. }
  6954. });
  6955. };
  6956. }
  6957. },
  6958. beforeUnmount() {
  6959. clearInterval(this.timer);
  6960. eventBus.clear();
  6961. $(document).off("click", "a", this.clickA);
  6962. },
  6963. methods: {
  6964. getMonthDayInfo(num) {
  6965. let now = dayjs();
  6966. now = now.year(this.calendar.year);
  6967. now = now.month(this.calendar.month);
  6968. if (num > 0) {
  6969. now = now.add(1, "month");
  6970. } else {
  6971. now = now.subtract(1, "month");
  6972. }
  6973. this.calendar.year = now.year();
  6974. this.calendar.month = now.month();
  6975. this.calendar.dayCount = now.daysInMonth();
  6976. this.calendar.firstDayWeek = now.startOf("month").day();
  6977. },
  6978. checkReplyItemType(val) {
  6979. let d2 = $(val);
  6980. let str = d2.html();
  6981. if (str.includes("提到了你") || str.includes("回复了你")) {
  6982. d2.addClass("reply");
  6983. }
  6984. if (str.includes("感谢了你")) {
  6985. d2.addClass("star");
  6986. }
  6987. if (str.includes("收藏了你")) {
  6988. d2.addClass("collect");
  6989. }
  6990. return d2;
  6991. },
  6992. async getUnreadMessagesCount() {
  6993. var _a, _b;
  6994. const res = await fetch(`${location.origin}/mission`);
  6995. const htmlText = await res.text();
  6996. const $page = $(htmlText);
  6997. const text = $page.find('#Rightbar a[href^="/notifications"]').text();
  6998. if (text.includes("未读提醒")) {
  6999. const countStr = (_a = text.match(/\d+/)) == null ? void 0 : _a.at(0);
  7000. if (countStr) {
  7001. return Number((_b = text.match(/\d+/)) == null ? void 0 : _b.at(0));
  7002. }
  7003. } else {
  7004. return 0;
  7005. }
  7006. throw new Error("无法获取未读消息数量");
  7007. },
  7008. clickA(e2) {
  7009. let that = this;
  7010. if (e2.currentTarget.getAttribute("script"))
  7011. return;
  7012. if (that.stopMe)
  7013. return true;
  7014. let { pageType } = functions.checkPageType(e2.currentTarget);
  7015. let { href, id, title } = functions.parseA(e2.currentTarget);
  7016. switch (pageType) {
  7017. case PageType.Post:
  7018. if (id) {
  7019. that.clickPost(e2, id, href, title);
  7020. }
  7021. break;
  7022. case PageType.Node:
  7023. case PageType.Home:
  7024. case PageType.Changes:
  7025. return;
  7026. case PageType.Hot:
  7027. let date = e2.currentTarget.search.replace("?", "");
  7028. if (date === "setting") {
  7029. if (this.calendar.show) {
  7030. $("#Rightbar > .sep20:first").css("height", "var(--component-margin)");
  7031. } else {
  7032. $("#Rightbar > .sep20:first").css("height", "unset");
  7033. let now2 = dayjs();
  7034. this.calendar.year = now2.year();
  7035. this.calendar.month = now2.month();
  7036. this.calendar.dayCount = now2.daysInMonth();
  7037. this.calendar.firstDayWeek = now2.startOf("month").day();
  7038. this.calendar.select = `${this.calendar.year}-${this.calendar.month + 1}-${now2.date()}`;
  7039. }
  7040. this.calendar.show = !this.calendar.show;
  7041. functions.stopEvent(e2);
  7042. return;
  7043. }
  7044. let now = dayjs();
  7045. let day = "";
  7046. switch (Number(date)) {
  7047. case -1:
  7048. day = now.subtract(1, "day").format("YYYY-M-D");
  7049. break;
  7050. case -2:
  7051. day = now.subtract(2, "day").format("YYYY-M-D");
  7052. break;
  7053. case 3:
  7054. day = "3d";
  7055. break;
  7056. case 7:
  7057. day = "7d";
  7058. break;
  7059. case 30:
  7060. day = "30d";
  7061. break;
  7062. default:
  7063. day = date;
  7064. if (dayjs(day).isSame(now, "day")) {
  7065. functions.stopEvent(e2);
  7066. return location.reload();
  7067. }
  7068. }
  7069. if (day) {
  7070. fetch(DefaultVal.hotUrl + day + ".json").then(async (r2) => {
  7071. let r1 = await r2.json();
  7072. $(".cell.item.post-item").remove();
  7073. r1.reverse().map((v) => {
  7074. let s = `
  7075. <div class="cell item post-item id_${v.id}" style="" data-href="https://www.v2ex.com/t/${v.id}#reply${v.replyCount}">
  7076. <table cellpadding="0" cellspacing="0" border="0" width="100%">
  7077. <tbody>
  7078. <tr>
  7079. <td width="48" valign="top" align="center">
  7080. <a href="/member/${v.username}">
  7081. <img src="${v.avatar}" class="avatar"
  7082. border="0" align="default"
  7083. width="48"
  7084. style="width: 48px; max-height: 48px;"
  7085. alt="ice9191">
  7086. </a>
  7087. </td>
  7088. <td width="10"></td>
  7089. <td width="auto" valign="middle">
  7090. <span class="item_title">
  7091. <a href="https://www.v2ex.com/t/${v.id}#reply${v.replyCount}" class="topic-link" id="topic-link-${v.id}">${v.title}</a>
  7092. </span>
  7093. <div class="sep5"></div>
  7094. <span class="topic_info">
  7095. <div class="votes"></div>
  7096. <a class="node" href="/go/${v.nodeUrl}">${v.nodeTitle}</a> &nbsp;•&nbsp;
  7097. <strong><a href="/member/${v.username}">${v.username}</a></strong> &nbsp;•&nbsp;
  7098. <span title="${v.lastReplyDate}">${v.lastReplyDateAgo}</span> &nbsp;•&nbsp; 最后回复来自
  7099. <strong><a href="/member/${v.lastReplyUsername}">${v.lastReplyUsername}</a></strong>
  7100. </span>
  7101. </td>
  7102. <td width="70" align="right" valign="middle" style="position: relative;">
  7103. <a href="/t/${v.id}#reply${v.replyCount}" class="count_livid">${v.replyCount}</a>
  7104. <div data-id="${v.id}" class="toggle">预览</div>
  7105. </td>
  7106. </tr>
  7107. </tbody>
  7108. </table>
  7109. </div>
  7110. `;
  7111. $("#app").after($(s));
  7112. });
  7113. }).catch((e3) => {
  7114. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "暂无点击日期的最热数据!" });
  7115. });
  7116. }
  7117. functions.stopEvent(e2);
  7118. return;
  7119. default:
  7120. if (e2.currentTarget.href.includes("/settings/night/toggle"))
  7121. return;
  7122. if (e2.currentTarget.href === location.origin + "/#;")
  7123. return;
  7124. if (e2.currentTarget.href.includes("/notifications")) {
  7125. this.pageInfo.number = 0;
  7126. $("#money").parent().prev().replaceWith(`<a href="/notifications">0 未读提醒</a>`);
  7127. if (this.config.notice.takeOverNoticePage) {
  7128. this.notificationModal.loading = true;
  7129. this.notificationModal.show = true;
  7130. fetch(href).then(async (r2) => {
  7131. let htmlText = await r2.text();
  7132. let bodyText = htmlText.match(/<body[^>]*>([\s\S]+?)<\/body>/g);
  7133. let res = htmlText.match(/var notificationBottom = ([\d]+);/);
  7134. if (res && res[1]) {
  7135. window.notificationBottom = Number(res[1]);
  7136. console.log(" window.notificationBottom", window.notificationBottom);
  7137. }
  7138. let body = $(bodyText[0]);
  7139. let list = body.find("#notifications");
  7140. list.children().each(function() {
  7141. that.checkReplyItemType(this);
  7142. });
  7143. let h2 = list.html();
  7144. let d2 = body.find("#Main > .box > .header .fr .gray");
  7145. if (d2.length) {
  7146. this.notificationModal.total = d2.text();
  7147. }
  7148. this.notificationModal.list = h2;
  7149. let p = list.next();
  7150. let tds = p.find(".button");
  7151. tds.each(function() {
  7152. let href2 = this.getAttribute("onclick");
  7153. if (href2) {
  7154. this.innerHTML = `<a href=${href2.replace("location.href=", "")}>${this.innerHTML}</a>`;
  7155. this.setAttribute("onclick", "");
  7156. }
  7157. });
  7158. this.notificationModal.pages = p.html();
  7159. this.notificationModal.loading = false;
  7160. }).catch((e3) => {
  7161. this.notificationModal.loading = false;
  7162. });
  7163. functions.stopEvent(e2);
  7164. return;
  7165. }
  7166. }
  7167. if (that.config.newTabOpen) {
  7168. functions.stopEvent(e2);
  7169. functions.openNewTab(e2.currentTarget.href, that.config.newTabOpenActive);
  7170. }
  7171. return;
  7172. }
  7173. },
  7174. async clickPost(e2, id, href, title = "") {
  7175. if (id) {
  7176. if (this.config.clickPostItemOpenDetail) {
  7177. functions.stopEvent(e2);
  7178. let postItem = getDefaultPost();
  7179. let index = this.list.findIndex((v) => v.id == id);
  7180. if (index > -1) {
  7181. postItem = this.list[index];
  7182. }
  7183. if (!postItem.title)
  7184. postItem.title = title ?? "加载中";
  7185. postItem.id = id;
  7186. postItem.href = href;
  7187. this.getPostDetail(postItem);
  7188. return;
  7189. }
  7190. if (this.config.newTabOpen) {
  7191. functions.stopEvent(e2);
  7192. functions.openNewTab(`https://www.v2ex.com/t/${id}?p=1`, this.config.newTabOpenActive);
  7193. }
  7194. }
  7195. },
  7196. showPost() {
  7197. this.show = true;
  7198. $(`#Wrapper #Main .box:lt(3)`).each(function() {
  7199. $(this).hide();
  7200. });
  7201. },
  7202. showConfig() {
  7203. this.configModal.show = true;
  7204. },
  7205. resetTitle() {
  7206. let r2 = document.title.match(/\s?\(\d+\)\s?/);
  7207. if (r2 && r2.length) {
  7208. this.pageInfo.title = document.title.replace(r2[0], "");
  7209. } else {
  7210. this.pageInfo.title = document.title;
  7211. }
  7212. },
  7213. async getNotice(body) {
  7214. if (!body) {
  7215. let res = await fetch("/t");
  7216. if (res.status === 200) {
  7217. let htmlText = await res.text();
  7218. let bodyText = htmlText.match(/<body[^>]*>([\s\S]+?)<\/body>/g);
  7219. body = $(bodyText[0]);
  7220. }
  7221. }
  7222. let notify = body.find('a[href="/notifications"]');
  7223. if (notify.length) {
  7224. this.resetTitle();
  7225. let text = notify.text();
  7226. if (text !== "0 未读提醒") {
  7227. this.pageInfo.number = text.replace(" 未读提醒", "");
  7228. console.log("text", text, this.config.notice.ddWebhook);
  7229. if (this.config.notice.text !== text) {
  7230. console.log("有新消息", text, this.config.notice.text);
  7231. $("#money").parent().prev().replaceWith(`<div><div class="orange-dot"></div><strong><a href="/notifications">${text}</a></strong></div>`);
  7232. this.config.notice.text = text;
  7233. if (this.config.notice.ddWebhook) {
  7234. let n2 = /* @__PURE__ */ new Date();
  7235. let s = n2.getSeconds();
  7236. s = s < 10 ? "0" + s : s;
  7237. let m = n2.getMinutes();
  7238. m = m < 10 ? "0" + m : m;
  7239. let h2 = n2.getHours();
  7240. h2 = h2 < 10 ? "0" + h2 : h2;
  7241. $.ajax("https://car-back.ttentau.top/index.php/v1/config/forward", {
  7242. method: "POST",
  7243. contentType: "application/json",
  7244. data: JSON.stringify({
  7245. url: this.config.notice.ddWebhook,
  7246. "text": notify.text() + `,时间:${n2.getFullYear()}/${n2.getMonth() + 1}/${n2.getDate()} ${h2}:${m}:${s}`
  7247. })
  7248. });
  7249. }
  7250. }
  7251. } else {
  7252. $("#money").parent().prev().replaceWith(`<a href="/notifications">${text}</a>`);
  7253. console.log("消息清空");
  7254. this.config.notice.text = "";
  7255. }
  7256. }
  7257. },
  7258. async winCb({ type, value }) {
  7259. console.log("回调的类型", type, value);
  7260. if (type === "openSetting") {
  7261. this.showConfig();
  7262. }
  7263. if (type === "syncData") {
  7264. this.stopMe = window.stopMe;
  7265. }
  7266. if (type === "getConfigSuccess") {
  7267. if (window.config.version < DefaultVal.currentVersion && window.isDeadline) {
  7268. $(".v2next-setting span").after(`<div class="new v2next-new">new</div>`);
  7269. }
  7270. if (window.isLogin && window.config.notice.loopCheckNotice) {
  7271. this.getNotice($(document.body));
  7272. this.timer = setInterval(this.getNotice, 1e3 * 60 * Number(window.config.notice.loopCheckNoticeInterval));
  7273. }
  7274. this.config = window.config;
  7275. this.tags = window.user.tags;
  7276. }
  7277. if (type === "syncList") {
  7278. this.list = Object.assign(this.list, window.postList);
  7279. }
  7280. if (type === "warningNotice") {
  7281. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: value });
  7282. }
  7283. if (this.stopMe)
  7284. return;
  7285. if (type === "restorePost") {
  7286. this.show = false;
  7287. this.loading = false;
  7288. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "脚本无法查看此页面!" });
  7289. $(`#Wrapper #Main .box:lt(3)`).each(function() {
  7290. $(this).show();
  7291. });
  7292. }
  7293. if (type === "postContent") {
  7294. this.current = Object.assign(this.current, value);
  7295. this.current.inList = true;
  7296. if (this.config.autoOpenDetail) {
  7297. this.showPost();
  7298. }
  7299. }
  7300. if (type === "postReplies") {
  7301. this.loading = false;
  7302. this.current = Object.assign(this.current, value);
  7303. this.list.push(functions.clone(this.current));
  7304. }
  7305. },
  7306. regenerateReplyList() {
  7307. if (this.current.replyList.length) {
  7308. functions.createList(this.current, this.current.replyList);
  7309. } else {
  7310. this.current.replyCount = 0;
  7311. this.current.nestedReplies = [];
  7312. this.current.nestedRedundReplies = [];
  7313. }
  7314. if (this.list.length) {
  7315. let rIndex = this.list.findIndex((i) => i.id === this.current.id);
  7316. if (rIndex > -1) {
  7317. this.list[rIndex] = functions.clone(this.current);
  7318. }
  7319. }
  7320. },
  7321. initEvent() {
  7322. eventBus.on(CMD.CHANGE_COMMENT_THANK, (val) => {
  7323. const { id, type } = val;
  7324. let currentI = this.current.replyList.findIndex((i) => i.id === id);
  7325. if (currentI > -1) {
  7326. this.current.replyList[currentI].isThanked = type === "add";
  7327. if (type === "add") {
  7328. this.current.replyList[currentI].thankCount++;
  7329. } else {
  7330. this.current.replyList[currentI].thankCount--;
  7331. }
  7332. this.regenerateReplyList();
  7333. }
  7334. });
  7335. eventBus.on(CMD.CHANGE_POST_THANK, (val) => {
  7336. const { id, type } = val;
  7337. this.current.isThanked = type === "add";
  7338. if (type === "add") {
  7339. this.current.thankCount++;
  7340. } else {
  7341. this.current.thankCount--;
  7342. }
  7343. let currentI = this.list.findIndex((i) => i.id === id);
  7344. if (currentI > -1) {
  7345. this.list[currentI].isThanked = type === "add";
  7346. if (type === "add") {
  7347. this.list[currentI].thankCount++;
  7348. } else {
  7349. this.list[currentI].thankCount++;
  7350. }
  7351. }
  7352. });
  7353. eventBus.on(CMD.REMOVE, (val) => {
  7354. let removeIndex = this.current.replyList.findIndex((i) => i.floor === val);
  7355. if (removeIndex > -1) {
  7356. this.current.replyList.splice(removeIndex, 1);
  7357. }
  7358. this.regenerateReplyList();
  7359. });
  7360. eventBus.on(CMD.IGNORE, () => {
  7361. this.show = false;
  7362. let rIndex = this.list.findIndex((i) => i.id === this.current.id);
  7363. if (rIndex > -1) {
  7364. this.list.splice(rIndex, 1);
  7365. }
  7366. this.current = getDefaultPost();
  7367. });
  7368. eventBus.on(CMD.MERGE, (val) => {
  7369. this.current = Object.assign(this.current, val);
  7370. let rIndex = this.list.findIndex((i) => i.id === this.current.id);
  7371. if (rIndex > -1) {
  7372. this.list[rIndex] = functions.clone(this.current);
  7373. }
  7374. });
  7375. eventBus.on(CMD.ADD_REPLY, (item) => {
  7376. this.current.replyList.push(item);
  7377. this.regenerateReplyList();
  7378. });
  7379. eventBus.on(CMD.REFRESH_ONCE, async (once) => {
  7380. if (once) {
  7381. if (typeof once === "string") {
  7382. let res = once.match(/var once = "([\d]+)";/);
  7383. if (res && res[1]) {
  7384. this.current.once = Number(res[1]);
  7385. return;
  7386. }
  7387. }
  7388. if (typeof once === "number") {
  7389. this.current.once = once;
  7390. return;
  7391. }
  7392. }
  7393. window.fetchOnce().then((r2) => {
  7394. this.current.once = r2;
  7395. });
  7396. });
  7397. eventBus.on(CMD.REMOVE_TAG, async ({ username, tag }) => {
  7398. let oldTag = functions.clone(this.tags);
  7399. let tags = this.tags[username] ?? [];
  7400. let rIndex = tags.findIndex((v) => v === tag);
  7401. if (rIndex > -1) {
  7402. tags.splice(rIndex, 1);
  7403. }
  7404. this.tags[username] = tags;
  7405. let res = await window.parse.saveTags(this.tags);
  7406. if (!res) {
  7407. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "标签删除失败!" });
  7408. this.tags = oldTag;
  7409. }
  7410. });
  7411. eventBus.on(CMD.SHOW_CONFIRM_MODAL, (val) => {
  7412. const { rect, title, id } = val;
  7413. this.popConfirmModal.show = true;
  7414. this.popConfirmModal.title = title;
  7415. this.popConfirmModal.id = id;
  7416. vue.nextTick(() => {
  7417. this.$refs.tip.style.top = rect.top + "px";
  7418. this.$refs.tip.style.left = rect.left + rect.width / 2 - 50 + "px";
  7419. });
  7420. });
  7421. },
  7422. async getPostDetail(post) {
  7423. this.current = post;
  7424. this.show = true;
  7425. let url = location.origin + "/t/" + this.current.id;
  7426. this.current.url = url;
  7427. let alreadyHasReply = this.current.replyList.length;
  7428. if (alreadyHasReply) {
  7429. this.refreshLoading = true;
  7430. } else {
  7431. this.loading = true;
  7432. functions.getPostDetailByApi(this.current.id).then((d2) => {
  7433. d2.replyCount = d2.replies;
  7434. this.current = Object.assign(this.current, d2);
  7435. if (this.current.replyCount > window.config.maxReplyCountLimit) {
  7436. functions.openNewTab(`${location.origin}/t/${this.current.id}?p=1&script=1`, true);
  7437. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "由于回复数量较多,已为您单独打开此主题" });
  7438. this.loading = this.show = false;
  7439. return;
  7440. } else {
  7441. this.current.jsonContent = `
  7442. <div class="cell">
  7443. <div class="topic_content">
  7444. <div class="markdown_body">
  7445. ${(d2 == null ? void 0 : d2.content_rendered) ?? ""}
  7446. </div>
  7447. </div>
  7448. </div>`;
  7449. }
  7450. });
  7451. }
  7452. let apiRes = await window.fetch(url + "?p=1");
  7453. if (apiRes.status === 404) {
  7454. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "主题未找到" });
  7455. return this.refreshLoading = this.loading = false;
  7456. }
  7457. if (apiRes.status === 403) {
  7458. this.refreshLoading = this.show = this.loading = false;
  7459. functions.openNewTab(`${location.origin}/t/${post.id}?p=1&script=0`, true);
  7460. return;
  7461. }
  7462. if (apiRes.redirected) {
  7463. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "没有权限" });
  7464. return this.refreshLoading = this.loading = false;
  7465. }
  7466. let htmlText = await apiRes.text();
  7467. let hasPermission = htmlText.search("你要查看的页面需要先登录");
  7468. if (hasPermission > -1) {
  7469. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "你要查看的页面需要先登录" });
  7470. return this.refreshLoading = this.loading = false;
  7471. }
  7472. let bodyText = htmlText.match(/<body[^>]*>([\s\S]+?)<\/body>/g);
  7473. let body = $(bodyText[0]);
  7474. decodeEmail(body);
  7475. await window.parse.getPostDetail(this.current, body, htmlText);
  7476. let index = this.list.findIndex((v) => v.id == this.current.id);
  7477. if (index > -1) {
  7478. this.list[index] = functions.clone(this.current);
  7479. } else {
  7480. this.list.push(functions.clone(this.current));
  7481. }
  7482. this.refreshLoading = this.loading = false;
  7483. await window.parse.parseOp(this.current);
  7484. console.log("当前主题", this.current);
  7485. },
  7486. addTargetUserTag() {
  7487. eventBus.emit(CMD.ADD_TAG, window.targetUserName);
  7488. },
  7489. removeTargetUserTag(tag) {
  7490. eventBus.emit(CMD.REMOVE_TAG, { username: window.targetUserName, tag });
  7491. },
  7492. popConfirmModalCancel() {
  7493. this.popConfirmModal.show = false;
  7494. },
  7495. popConfirmModalConfirm() {
  7496. this.popConfirmModalCancel();
  7497. eventBus.emit(CMD.SHOW_CONFIRM_MODAL_CONFIRM, this.popConfirmModal.id);
  7498. }
  7499. }
  7500. };
  7501. const _withScopeId = (n2) => (vue.pushScopeId("data-v-d9e3ae7c"), n2 = n2(), vue.popScopeId(), n2);
  7502. const _hoisted_1 = {
  7503. key: 0,
  7504. class: ""
  7505. };
  7506. const _hoisted_2 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "sep" }, null, -1));
  7507. const _hoisted_3 = { class: "box calender" };
  7508. const _hoisted_4 = { class: "month" };
  7509. const _hoisted_5 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "fade" }, "历史最热", -1));
  7510. const _hoisted_6 = { class: "ca-title" };
  7511. const _hoisted_7 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "calender-header" }, [
  7512. /* @__PURE__ */ vue.createElementVNode("div", null, "日"),
  7513. /* @__PURE__ */ vue.createElementVNode("div", null, "一"),
  7514. /* @__PURE__ */ vue.createElementVNode("div", null, "二"),
  7515. /* @__PURE__ */ vue.createElementVNode("div", null, "三"),
  7516. /* @__PURE__ */ vue.createElementVNode("div", null, "四"),
  7517. /* @__PURE__ */ vue.createElementVNode("div", null, "五"),
  7518. /* @__PURE__ */ vue.createElementVNode("div", null, "六")
  7519. ], -1));
  7520. const _hoisted_8 = { class: "days" };
  7521. const _hoisted_9 = ["onClick"];
  7522. const _hoisted_10 = ["href"];
  7523. const _hoisted_11 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "sep" }, null, -1));
  7524. const _hoisted_12 = {
  7525. key: 0,
  7526. class: "target-user-tags p1"
  7527. };
  7528. const _hoisted_13 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("span", null, "标签:", -1));
  7529. const _hoisted_14 = { class: "my-tag" };
  7530. const _hoisted_15 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("i", { class: "fa fa-tag" }, null, -1));
  7531. const _hoisted_16 = ["onClick"];
  7532. const _hoisted_17 = {
  7533. key: 1,
  7534. class: "my-box p2",
  7535. style: { "margin-top": "2rem", "margin-bottom": "0" }
  7536. };
  7537. const _hoisted_18 = {
  7538. key: 0,
  7539. class: "flex flex-center"
  7540. };
  7541. const _hoisted_19 = {
  7542. key: 1,
  7543. class: "loaded"
  7544. };
  7545. const _hoisted_20 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("span", null, "楼中楼解析完成", -1));
  7546. const _hoisted_21 = {
  7547. key: 0,
  7548. ref: "tip",
  7549. class: "pop-confirm-content"
  7550. };
  7551. const _hoisted_22 = { class: "text" };
  7552. const _hoisted_23 = { class: "options" };
  7553. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  7554. const _component_Setting = vue.resolveComponent("Setting");
  7555. const _component_TagModal = vue.resolveComponent("TagModal");
  7556. const _component_PostDetail = vue.resolveComponent("PostDetail");
  7557. const _component_Base64Tooltip = vue.resolveComponent("Base64Tooltip");
  7558. const _component_MsgModal = vue.resolveComponent("MsgModal");
  7559. const _component_NotificationModal = vue.resolveComponent("NotificationModal");
  7560. const _component_BaseLoading = vue.resolveComponent("BaseLoading");
  7561. const _component_BaseButton = vue.resolveComponent("BaseButton");
  7562. return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
  7563. vue.createVNode(_component_Setting, {
  7564. modelValue: $data.config,
  7565. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.config = $event),
  7566. show: $data.configModal.show,
  7567. "onUpdate:show": _cache[1] || (_cache[1] = ($event) => $data.configModal.show = $event)
  7568. }, null, 8, ["modelValue", "show"]),
  7569. vue.createVNode(_component_TagModal, {
  7570. tags: $data.tags,
  7571. "onUpdate:tags": _cache[2] || (_cache[2] = ($event) => $data.tags = $event)
  7572. }, null, 8, ["tags"]),
  7573. vue.createVNode(_component_PostDetail, {
  7574. modelValue: $data.show,
  7575. "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $data.show = $event),
  7576. ref: "postDetail",
  7577. displayType: $data.config.commentDisplayType,
  7578. "onUpdate:displayType": _cache[4] || (_cache[4] = ($event) => $data.config.commentDisplayType = $event),
  7579. onRefresh: _cache[5] || (_cache[5] = ($event) => $options.getPostDetail($data.current)),
  7580. loading: $data.loading,
  7581. refreshLoading: $data.refreshLoading
  7582. }, null, 8, ["modelValue", "displayType", "loading", "refreshLoading"]),
  7583. vue.createVNode(_component_Base64Tooltip),
  7584. vue.createVNode(_component_MsgModal),
  7585. (vue.openBlock(), vue.createBlock(vue.Teleport, { to: "#Rightbar > .sep20" }, [
  7586. $data.calendar.show ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
  7587. _hoisted_2,
  7588. vue.createElementVNode("div", _hoisted_3, [
  7589. vue.createElementVNode("div", _hoisted_4, [
  7590. _hoisted_5,
  7591. vue.createElementVNode("div", _hoisted_6, [
  7592. vue.createElementVNode("i", {
  7593. class: "fa fa-arrow-left",
  7594. onClick: _cache[6] || (_cache[6] = ($event) => $options.getMonthDayInfo(-1)),
  7595. "aria-hidden": "true"
  7596. }),
  7597. vue.createElementVNode("span", null, vue.toDisplayString($data.calendar.year) + "年" + vue.toDisplayString($data.calendar.month + 1) + "月", 1),
  7598. vue.createElementVNode("i", {
  7599. class: "fa fa-arrow-right",
  7600. onClick: _cache[7] || (_cache[7] = ($event) => $options.getMonthDayInfo(1)),
  7601. "aria-hidden": "true"
  7602. })
  7603. ])
  7604. ]),
  7605. _hoisted_7,
  7606. vue.createElementVNode("div", _hoisted_8, [
  7607. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($data.calendar.dayCount + $data.calendar.firstDayWeek, (i) => {
  7608. return vue.openBlock(), vue.createElementBlock("div", {
  7609. class: vue.normalizeClass([
  7610. "day",
  7611. $data.calendar.select === `${$data.calendar.year}-${$data.calendar.month + 1}-${i - $data.calendar.firstDayWeek}` ? "active" : ""
  7612. ]),
  7613. onClick: ($event) => $data.calendar.select = `${$data.calendar.year}-${$data.calendar.month + 1}-${i - $data.calendar.firstDayWeek}`
  7614. }, [
  7615. i - $data.calendar.firstDayWeek > 0 ? (vue.openBlock(), vue.createElementBlock("a", {
  7616. key: 0,
  7617. href: `/v2hot?${$data.calendar.year}-${$data.calendar.month + 1}-${i - $data.calendar.firstDayWeek}`
  7618. }, vue.toDisplayString(i - $data.calendar.firstDayWeek > 0 ? i - $data.calendar.firstDayWeek : ""), 9, _hoisted_10)) : vue.createCommentVNode("", true)
  7619. ], 10, _hoisted_9);
  7620. }), 256))
  7621. ])
  7622. ]),
  7623. _hoisted_11
  7624. ])) : vue.createCommentVNode("", true)
  7625. ])),
  7626. vue.createVNode(_component_NotificationModal, {
  7627. modelValue: $data.notificationModal.show,
  7628. "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => $data.notificationModal.show = $event),
  7629. list: $data.notificationModal.list,
  7630. loading: $data.notificationModal.loading,
  7631. total: $data.notificationModal.total,
  7632. pages: $data.notificationModal.pages
  7633. }, null, 8, ["modelValue", "list", "loading", "total", "pages"]),
  7634. !$data.stopMe ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
  7635. $options.isMember && $data.isLogin && $data.config.openTag ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_12, [
  7636. _hoisted_13,
  7637. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.targetUserTags, (i) => {
  7638. return vue.openBlock(), vue.createElementBlock("span", _hoisted_14, [
  7639. _hoisted_15,
  7640. vue.createElementVNode("span", null, vue.toDisplayString(i), 1),
  7641. vue.createElementVNode("i", {
  7642. class: "fa fa-trash-o remove",
  7643. onClick: ($event) => $options.removeTargetUserTag(i)
  7644. }, null, 8, _hoisted_16)
  7645. ]);
  7646. }), 256)),
  7647. vue.createElementVNode("span", {
  7648. class: "add-tag ago",
  7649. onClick: _cache[9] || (_cache[9] = (...args) => $options.addTargetUserTag && $options.addTargetUserTag(...args)),
  7650. title: "添加标签"
  7651. }, "+")
  7652. ])) : vue.createCommentVNode("", true),
  7653. $options.isPost && !$data.show ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_17, [
  7654. $data.loading ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_18, [
  7655. vue.createVNode(_component_BaseLoading)
  7656. ])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_19, [
  7657. _hoisted_20,
  7658. vue.createVNode(_component_BaseButton, {
  7659. size: "small",
  7660. onClick: $options.showPost
  7661. }, {
  7662. default: vue.withCtx(() => [
  7663. vue.createTextVNode("点击显示")
  7664. ]),
  7665. _: 1
  7666. }, 8, ["onClick"])
  7667. ]))
  7668. ])) : vue.createCommentVNode("", true)
  7669. ], 64)) : vue.createCommentVNode("", true),
  7670. (vue.openBlock(), vue.createBlock(vue.Teleport, { to: "body" }, [
  7671. vue.createVNode(vue.Transition, null, {
  7672. default: vue.withCtx(() => [
  7673. $data.popConfirmModal.show ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_21, [
  7674. vue.createElementVNode("div", _hoisted_22, vue.toDisplayString($data.popConfirmModal.title), 1),
  7675. vue.createElementVNode("div", _hoisted_23, [
  7676. vue.createVNode(_component_BaseButton, {
  7677. type: "link",
  7678. size: "small",
  7679. onClick: vue.withModifiers($options.popConfirmModalCancel, ["stop"])
  7680. }, {
  7681. default: vue.withCtx(() => [
  7682. vue.createTextVNode("取消")
  7683. ]),
  7684. _: 1
  7685. }, 8, ["onClick"]),
  7686. vue.createVNode(_component_BaseButton, {
  7687. size: "small",
  7688. onClick: vue.withModifiers($options.popConfirmModalConfirm, ["stop"])
  7689. }, {
  7690. default: vue.withCtx(() => [
  7691. vue.createTextVNode("确认")
  7692. ]),
  7693. _: 1
  7694. }, 8, ["onClick"])
  7695. ])
  7696. ], 512)) : vue.createCommentVNode("", true)
  7697. ]),
  7698. _: 1
  7699. })
  7700. ]))
  7701. ], 64);
  7702. }
  7703. const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-d9e3ae7c"]]);
  7704. let isMobile = !document.querySelector("#Rightbar");
  7705. let $section = document.createElement("section");
  7706. $section.id = "app";
  7707. function run() {
  7708. window.user = DefaultUser;
  7709. window.targetUserName = "";
  7710. window.pageType = void 0;
  7711. window.pageData = { pageNo: 1 };
  7712. window.config = getDefaultConfig();
  7713. window.isNight = $(".Night").length === 1;
  7714. window.cb = null;
  7715. window.stopMe = false;
  7716. window.isLogin = false;
  7717. window.postList = [];
  7718. window.isDeadline = dayjs().isAfter(dayjs("2024-11-26"));
  7719. window.parse = {
  7720. //解析主题内容
  7721. async parsePostContent(post, body, htmlText) {
  7722. let once = htmlText.match(/var once = "([\d]+)";/);
  7723. if (once && once[1]) {
  7724. post.once = once[1];
  7725. }
  7726. post.isReport = htmlText.includes("你已对本主题进行了报告");
  7727. let wrapper = body.find("#Main");
  7728. if (!post.title || !post.content_rendered) {
  7729. let h1 = wrapper.find("h1");
  7730. if (h1) {
  7731. post.title = h1[0].innerText;
  7732. }
  7733. }
  7734. let as = wrapper.find(".header > a");
  7735. if (as.length) {
  7736. post.node.title = as[1].innerText;
  7737. post.node.url = as[1].href;
  7738. }
  7739. let aName = wrapper.find(".header small.gray a:nth-child(1)");
  7740. if (aName.length) {
  7741. post.member.username = aName[0].innerText;
  7742. }
  7743. let spanEl = wrapper.find(".header small.gray span");
  7744. if (spanEl.length) {
  7745. post.createDateAgo = spanEl[0].innerText;
  7746. post.createDate = spanEl[0].title;
  7747. }
  7748. let avatarEl = wrapper.find(".header .avatar");
  7749. if (avatarEl.length) {
  7750. post.member.avatar_large = avatarEl[0].src;
  7751. }
  7752. let topic_buttons = body.find(".topic_buttons");
  7753. if (topic_buttons.length) {
  7754. let favoriteNode = topic_buttons.find(".tb:first");
  7755. if (favoriteNode.length) {
  7756. post.isFavorite = favoriteNode[0].innerText === "取消收藏";
  7757. }
  7758. let ignoreNode = topic_buttons.find(".tb:nth-child(3)");
  7759. if (ignoreNode.length) {
  7760. post.isIgnore = ignoreNode[0].innerText === "取消忽略";
  7761. }
  7762. let thankNode = topic_buttons.find("#topic_thank .tb");
  7763. if (!thankNode.length) {
  7764. post.isThanked = true;
  7765. }
  7766. let topic_stats = topic_buttons.find(".topic_stats");
  7767. if (topic_stats.length) {
  7768. let text = topic_stats[0].innerText;
  7769. let reg1 = text.matchAll(/([\d]+)[\s]*人收藏/g);
  7770. let collectCountReg = [...reg1];
  7771. if (collectCountReg.length) {
  7772. post.collectCount = Number(collectCountReg[0][1]);
  7773. }
  7774. reg1 = text.matchAll(/([\d]+)[\s]*likes/g);
  7775. collectCountReg = [...reg1];
  7776. if (collectCountReg.length) {
  7777. post.collectCount = Number(collectCountReg[0][1]);
  7778. }
  7779. let reg2 = text.matchAll(/([\d]+)[\s]*人感谢/g);
  7780. let thankCountReg = [...reg2];
  7781. if (thankCountReg.length) {
  7782. post.thankCount = Number(thankCountReg[0][1]);
  7783. }
  7784. let reg3 = text.matchAll(/([\d]+)[\s]*次点击/g);
  7785. let clickCountReg = [...reg3];
  7786. if (clickCountReg.length) {
  7787. post.clickCount = Number(clickCountReg[0][1]);
  7788. }
  7789. reg3 = text.matchAll(/([\d]+)[\s]*views/g);
  7790. clickCountReg = [...reg3];
  7791. if (clickCountReg.length) {
  7792. post.clickCount = Number(clickCountReg[0][1]);
  7793. }
  7794. }
  7795. }
  7796. let header = body.find(`#Main .box`).first();
  7797. let temp = header.clone();
  7798. temp.find(".topic_buttons").remove();
  7799. temp.find(".inner").remove();
  7800. temp.find(".header").remove();
  7801. functions.checkPhotoLink2Img(temp[0]);
  7802. post.headerTemplate = temp[0].innerHTML;
  7803. return post;
  7804. },
  7805. //解析OP信息
  7806. async parseOp(post) {
  7807. if (!post.member.id) {
  7808. let userRes = await fetch(location.origin + "/api/members/show.json?username=" + post.member.username);
  7809. if (userRes.status === 200) {
  7810. post.member = await userRes.json();
  7811. }
  7812. }
  7813. if (post.member.id) {
  7814. let date = new Date(post.member.created * 1e3);
  7815. let createStr = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`;
  7816. date.setHours(0);
  7817. date.setMinutes(0);
  7818. date.setSeconds(0);
  7819. date.setMilliseconds(0);
  7820. let now = /* @__PURE__ */ new Date();
  7821. now.setHours(0);
  7822. now.setMinutes(0);
  7823. now.setSeconds(0);
  7824. now.setMilliseconds(0);
  7825. let d2 = now.getTime() - date.getTime();
  7826. let isNew = d2 <= 1e3 * 60 * 60 * 24 * 15;
  7827. post.member.createDate = createStr + " 注册";
  7828. post.member.isNew = isNew;
  7829. } else {
  7830. post.member.createDate = "用户已被注销/封禁";
  7831. post.member.isNew = true;
  7832. }
  7833. return post;
  7834. },
  7835. //获取主题所有回复
  7836. async getPostAllReplies(post, body, htmlText, pageNo = 1) {
  7837. var _a, _b;
  7838. if (body.find("#no-comments-yet").length) {
  7839. return post;
  7840. }
  7841. let boxs = body.find(`#Main .box`);
  7842. let box = boxs[1];
  7843. let cells = box.querySelectorAll(".cell");
  7844. if (cells && cells.length) {
  7845. post.fr = cells[0].querySelector(".cell .fr").innerHTML;
  7846. cells = Array.from(cells);
  7847. let snow = cells[0].querySelector(".snow");
  7848. post.lastReplyDate = ((_b = (_a = snow == null ? void 0 : snow.nextSibling) == null ? void 0 : _a.nodeValue) == null ? void 0 : _b.trim()) || "";
  7849. let repliesMap = [];
  7850. if (cells[1].id) {
  7851. repliesMap.push({ i: pageNo, replyList: this.parsePageReplies(cells.slice(1)) });
  7852. let replyList = functions.getAllReply(repliesMap);
  7853. functions.createList(post, replyList);
  7854. return post;
  7855. } else {
  7856. let promiseList = [];
  7857. return new Promise((resolve, reject) => {
  7858. repliesMap.push({ i: pageNo, replyList: this.parsePageReplies(cells.slice(2, cells.length - 1)) });
  7859. let pages = cells[1].querySelectorAll("a.page_normal");
  7860. pages = Array.from(pages);
  7861. let url = location.origin + "/t/" + post.id;
  7862. for (let i = 0; i < pages.length; i++) {
  7863. let currentPageNo = Number(pages[i].innerText);
  7864. promiseList.push(this.fetchPostOtherPageReplies(url + "?p=" + currentPageNo, currentPageNo));
  7865. }
  7866. Promise.allSettled(promiseList).then(
  7867. (results) => {
  7868. results.filter((result) => result.status === "fulfilled").map((v) => repliesMap.push(v.value));
  7869. let replyList = functions.getAllReply(repliesMap);
  7870. functions.createList(post, replyList);
  7871. resolve(post);
  7872. }
  7873. );
  7874. });
  7875. }
  7876. }
  7877. },
  7878. //请求主题其他页的回复
  7879. fetchPostOtherPageReplies(href, pageNo) {
  7880. return new Promise((resolve) => {
  7881. $.get(href).then((res) => {
  7882. let s = res.match(/<body[^>]*>([\s\S]+?)<\/body>/g);
  7883. let box = $(s[0]).find("#Main .box")[1];
  7884. let cells = box.querySelectorAll(".cell");
  7885. cells = Array.from(cells);
  7886. resolve({ i: pageNo, replyList: this.parsePageReplies(cells.slice(2, cells.length - 1)) });
  7887. }).catch((r2) => {
  7888. if (r2.status === 403) {
  7889. functions.cbChecker({ type: "restorePost", value: null });
  7890. }
  7891. });
  7892. });
  7893. },
  7894. //解析页面的回复
  7895. parsePageReplies(nodes) {
  7896. let replyList = [];
  7897. nodes.forEach((node, index) => {
  7898. if (!node.id)
  7899. return;
  7900. let item = {
  7901. level: 0,
  7902. thankCount: 0,
  7903. replyCount: 0,
  7904. isThanked: false,
  7905. isOp: false,
  7906. isDup: false,
  7907. id: node.id.replace("r_", "")
  7908. };
  7909. let reply_content = node.querySelector(".reply_content");
  7910. functions.checkPhotoLink2Img(reply_content);
  7911. item.reply_content = reply_content.innerHTML;
  7912. item.reply_text = reply_content.textContent;
  7913. let { users, floor } = this.parseReplyContent(item.reply_content);
  7914. item.hideCallUserReplyContent = item.reply_content;
  7915. if (users.length === 1) {
  7916. item.hideCallUserReplyContent = item.reply_content.replace(/@<a href="\/member\/[\s\S]+?<\/a>(\s#[\d]+)?\s(<br>)?/, () => "");
  7917. }
  7918. item.replyUsers = users;
  7919. item.replyFloor = floor;
  7920. let ago = node.querySelector(".ago");
  7921. item.date = ago.textContent;
  7922. let userNode = node.querySelector("strong a");
  7923. item.username = userNode.textContent;
  7924. let avatar = node.querySelector("td img");
  7925. item.avatar = avatar.src;
  7926. let no = node.querySelector(".no");
  7927. item.floor = Number(no.textContent);
  7928. let thank_area = node.querySelector(".thank_area");
  7929. if (thank_area) {
  7930. item.isThanked = thank_area.classList.contains("thanked");
  7931. }
  7932. let small = node.querySelector(".small");
  7933. if (small) {
  7934. item.thankCount = Number(small.textContent);
  7935. }
  7936. let op = node.querySelector(".op");
  7937. if (op) {
  7938. item.isOp = true;
  7939. }
  7940. let mod = node.querySelector(".mod");
  7941. if (mod) {
  7942. item.isMod = true;
  7943. }
  7944. replyList.push(item);
  7945. });
  7946. return replyList;
  7947. },
  7948. //解析回复内容,解析出@用户,回复楼层。用于后续生成嵌套楼层
  7949. parseReplyContent(str) {
  7950. if (!str)
  7951. return;
  7952. let users = [];
  7953. let getUsername = (userStr) => {
  7954. let endIndex = userStr.indexOf('">');
  7955. if (endIndex > -1) {
  7956. let user = userStr.substring(0, endIndex);
  7957. if (!users.find((i) => i === user)) {
  7958. users.push(user);
  7959. }
  7960. }
  7961. };
  7962. let userReg = /@<a href="\/member\/([\s\S]+?)<\/a>/g;
  7963. let has = str.matchAll(userReg);
  7964. let res2 = [...has];
  7965. if (res2.length > 1) {
  7966. res2.map((item) => {
  7967. getUsername(item[1]);
  7968. });
  7969. }
  7970. if (res2.length === 1) {
  7971. getUsername(res2[0][1]);
  7972. }
  7973. let floor = -1;
  7974. if (users.length === 1) {
  7975. let floorReg = /@<a href="\/member\/[\s\S]+?<\/a>[\s]+#([\d]+)/g;
  7976. let hasFloor = str.matchAll(floorReg);
  7977. let res = [...hasFloor];
  7978. if (res.length) {
  7979. floor = Number(res[0][1]);
  7980. }
  7981. }
  7982. return { users, floor };
  7983. },
  7984. //获取主题详情
  7985. async getPostDetail(post, body, htmlText, pageNo = 1) {
  7986. post = await this.parsePostContent(post, body, htmlText);
  7987. return await this.getPostAllReplies(post, body, htmlText, pageNo);
  7988. },
  7989. //解析页面主题列表
  7990. parsePagePostList(list, box) {
  7991. list.forEach((itemDom) => {
  7992. let item_title = itemDom.querySelector(".item_title");
  7993. if (!item_title)
  7994. return;
  7995. let item = getDefaultPost();
  7996. itemDom.classList.add("post-item");
  7997. let a = item_title.querySelector("a");
  7998. let { href, id } = functions.parseA(a);
  7999. item.id = String(Number(id));
  8000. a.href = item.href = href;
  8001. item.url = location.origin + "/api/topics/show.json?id=" + item.id;
  8002. itemDom.classList.add(`id_${id}`);
  8003. itemDom.dataset["href"] = href;
  8004. let td = itemDom.querySelector("td:nth-child(4)");
  8005. if (!td) {
  8006. td = itemDom.querySelector("td:nth-child(2)");
  8007. }
  8008. td.style.position = "relative";
  8009. let toggle = document.createElement("div");
  8010. toggle.dataset["id"] = item.id;
  8011. toggle.classList.add("toggle");
  8012. toggle.innerText = "预览";
  8013. td.append(toggle);
  8014. if (window.config.viewType === "card") {
  8015. window.postList.push(item);
  8016. }
  8017. });
  8018. localStorage.setItem("d", "");
  8019. if (window.pageType === PageType.Home) {
  8020. const a = () => {
  8021. let d2;
  8022. if (window.user.username) {
  8023. d2 = $(window.atob("LnYycC1ob3Zlci1idG4=")).length;
  8024. } else {
  8025. d2 = $(window.atob("LnYycC1mb290ZXI=")).length;
  8026. }
  8027. if (d2 !== 0) {
  8028. window.stopMe = true;
  8029. localStorage.setItem("d", "1");
  8030. functions.cbChecker({ type: "syncData" });
  8031. } else {
  8032. localStorage.setItem("d", "");
  8033. }
  8034. };
  8035. a();
  8036. setTimeout(a, 1e3);
  8037. setTimeout(a, 2e3);
  8038. setTimeout(a, 3e3);
  8039. setTimeout(a, 5e3);
  8040. setTimeout(a, 1e4);
  8041. setTimeout(a, 15e3);
  8042. }
  8043. const setF = (res) => {
  8044. let rIndex = window.postList.findIndex((w) => w.id == res.id);
  8045. if (rIndex > -1) {
  8046. window.postList[rIndex] = Object.assign(window.postList[rIndex], res);
  8047. functions.cbChecker({ type: "syncList" });
  8048. }
  8049. let itemDom = box.querySelector(`.id_${res.id}`);
  8050. itemDom.classList.add("preview");
  8051. if (res.content_rendered) {
  8052. functions.appendPostContent(res, itemDom);
  8053. }
  8054. };
  8055. if (window.config.viewType === "card" && !window.stopMe) {
  8056. let cacheDataStr = localStorage.getItem("cacheData");
  8057. let cacheData = [];
  8058. if (cacheDataStr) {
  8059. cacheData = JSON.parse(cacheDataStr);
  8060. let now = Date.now();
  8061. cacheData = cacheData.filter((v) => {
  8062. return v.created > now / 1e3 - 60 * 60 * 24 * 3;
  8063. });
  8064. }
  8065. let fetchIndex = 0;
  8066. for (let i = 0; i < window.postList.length; i++) {
  8067. let item = window.postList[i];
  8068. let rItem = cacheData.find((w) => w.id == item.id);
  8069. if (rItem) {
  8070. rItem.href = item.href;
  8071. setF(rItem);
  8072. } else {
  8073. fetchIndex++;
  8074. setTimeout(() => {
  8075. $.get(item.url).then((v) => {
  8076. if (v && v.length) {
  8077. let res = getDefaultPost(v[0]);
  8078. res.href = item.href;
  8079. cacheData.push(res);
  8080. localStorage.setItem("cacheData", JSON.stringify(cacheData));
  8081. setF(res);
  8082. }
  8083. });
  8084. }, fetchIndex < 4 ? 0 : (fetchIndex - 4) * 1e3);
  8085. }
  8086. }
  8087. }
  8088. },
  8089. //创建记事本子条目
  8090. async createNoteItem(itemName) {
  8091. return new Promise(async (resolve) => {
  8092. if (!window.isLogin)
  8093. return resolve(null);
  8094. let data = new FormData();
  8095. data.append("content", itemName);
  8096. data.append("parent_id", 0);
  8097. data.append("syntax", 0);
  8098. let apiRes = await fetch(`${location.origin}/notes/new`, { method: "post", body: data });
  8099. if (apiRes.redirected && apiRes.status === 200) {
  8100. resolve(apiRes.url.substr(-5));
  8101. return;
  8102. }
  8103. resolve(null);
  8104. });
  8105. },
  8106. //编辑记事本子条目
  8107. async editNoteItem(val, id) {
  8108. if (!window.isLogin)
  8109. return;
  8110. if (!id)
  8111. return;
  8112. let data = new FormData();
  8113. data.append("content", val);
  8114. data.append("syntax", 0);
  8115. let apiRes = await fetch(`${location.origin}/notes/edit/${id}`, {
  8116. method: "post",
  8117. body: data
  8118. });
  8119. return apiRes.redirected && apiRes.status === 200;
  8120. },
  8121. //标签操作
  8122. async saveTags(val) {
  8123. if (!window.isLogin)
  8124. return;
  8125. for (const [key, value] of Object.entries(val)) {
  8126. if (!value.length)
  8127. delete val[key];
  8128. }
  8129. return await this.editNoteItem(window.user.tagPrefix + JSON.stringify(val), window.user.tagsId);
  8130. },
  8131. //imgur图片删除hash操作
  8132. async saveImgurList(val) {
  8133. if (!window.isLogin)
  8134. return;
  8135. return;
  8136. }
  8137. };
  8138. function initMonkeyMenu() {
  8139. try {
  8140. _GM_registerMenuCommand("脚本设置", () => {
  8141. functions.cbChecker({ type: "openSetting" });
  8142. });
  8143. _GM_registerMenuCommand("仓库地址", () => {
  8144. functions.openNewTab(DefaultVal.git, true);
  8145. });
  8146. _GM_registerMenuCommand("反馈 & 建议", functions.feedback);
  8147. } catch (e2) {
  8148. console.error("无法使用Tampermonkey");
  8149. }
  8150. }
  8151. function initStyle() {
  8152. if (window.isNight) {
  8153. document.documentElement.classList.add("dark");
  8154. }
  8155. let style2 = `
  8156. html, body {
  8157. font-size: 62.5%;
  8158. }
  8159. :root{
  8160. --box-border-radius:8px;
  8161. }
  8162. .page_current, .page_normal {
  8163. --box-border-radius: 5px;
  8164. padding: .6rem 0.8rem!important;
  8165. }
  8166. .box{
  8167. box-shadow:rgba(0, 0, 0, 0.08) 0px 4px 12px;
  8168. }
  8169. #Tabs{
  8170. border-top-left-radius: var(--box-border-radius) !important;
  8171. border-top-right-radius: var(--box-border-radius) !important;
  8172. }
  8173. #Main .cell .count_livid {
  8174. font-size: 14px;
  8175. font-weight: bold;
  8176. padding: 3px 10px;
  8177. border-radius: 5px;
  8178. }
  8179.  
  8180. #Wrapper {
  8181. height: unset !important;
  8182. width: unset !important;
  8183. }
  8184.  
  8185. #Wrapper > .content {
  8186. height: unset !important;
  8187. width: unset !important;
  8188. max-width:1100px !important;
  8189. }
  8190.  
  8191. ${location.href.includes("wow") ? "" : `
  8192. .post-item {
  8193. background: white;
  8194. }
  8195. `}
  8196.  
  8197. .post-item > .post-content {
  8198. height: 0;
  8199. margin-top: 0;
  8200. }
  8201.  
  8202. .post-item:hover .toggle {
  8203. display: flex;
  8204. }
  8205.  
  8206. .toggle {
  8207. position: absolute;
  8208. right: ${window.config.viewType === "simple" ? "5rem" : 0};
  8209. top: ${window.config.viewType === "simple" ? 0 : "0.5rem"};
  8210. width: 5rem;
  8211. height: 100%;
  8212. display: flex;
  8213. justify-content: flex-end;
  8214. align-items: flex-end;
  8215. cursor: pointer;
  8216. font-size: 1.2rem;
  8217. color: var(--link-color);
  8218. display: none;
  8219. padding-right: 1rem;
  8220. }
  8221.  
  8222. .preview {
  8223. margin: 1rem 0;
  8224. border: 1px solid transparent;
  8225. border-radius: var(--box-border-radius);
  8226. cursor: pointer;
  8227. }
  8228.  
  8229. .preview:hover {
  8230. border: 1px solid #c8c8c8;
  8231. }
  8232.  
  8233. .preview > .post-content {
  8234. height: unset !important;
  8235. margin-top: 0.5rem !important;
  8236. }
  8237.  
  8238. .preview > .post-content.show-all {
  8239. max-height: unset;
  8240. -webkit-mask-image:none;
  8241. }
  8242.  
  8243. .preview .topic-link:link {
  8244. color: black !important;
  8245. }
  8246.  
  8247. .post-content {
  8248. margin-top: 0.5rem;
  8249. display: block;
  8250. max-height: 30rem;
  8251. overflow: hidden;
  8252. text-decoration: unset !important;
  8253. line-break: anywhere;
  8254. -webkit-mask-image: linear-gradient(180deg,#000 60%,transparent);
  8255. }
  8256.  
  8257. .show-more {
  8258. display: none;
  8259. }
  8260.  
  8261. .preview > .show-more {
  8262. font-size: 1.3rem;
  8263. text-align: right;
  8264. height: 3rem;
  8265. display: flex;
  8266. align-items: center;
  8267. justify-content: center;
  8268. position: relative;
  8269. z-index: 9;
  8270. }
  8271.  
  8272. .post-content:visited {
  8273. color: #afb9c1 !important;
  8274. }
  8275.  
  8276. .post-content:link {
  8277. color: #494949;
  8278. }
  8279. ${location.href.includes("wow") ? "" : `
  8280. .Night .post-item {
  8281. background: #18222d !important;
  8282. }
  8283. `}
  8284.  
  8285. .Night .preview {
  8286. border: 1px solid #3b536e;
  8287. }
  8288.  
  8289. .Night .preview > .post-content:link {
  8290. color: #d1d5d9;
  8291. }
  8292.  
  8293. .Night .preview > .post-content:visited {
  8294. color: #393f4e !important;
  8295. }
  8296. .Night .preview .topic-link:link {
  8297. color: #c0dbff !important;
  8298. }
  8299. ${window.config.viewType === "simple" ? `
  8300. ${window.pageType !== PageType.Member ? `
  8301. .item table tr td:first-child{display:none;}
  8302. #Rightbar .cell table:first-child tr td:first-child{display:none;}
  8303. .item table tr td .sep5{display:none;}
  8304. .item table tr td .topic_info{display:none;}
  8305. .item {border-bottom:none;}
  8306. .avatar,#avatar{display:none;}
  8307. ` : ""}
  8308. #Logo {background-image:url('https://i.imgur.com/i9VgUtM.png');}
  8309. .bigger a, .top:nth-last-child(5){color: transparent!important;text-shadow: #b0b0b0 0 0 6px;user-select: none;}
  8310. // .bigger a:before,.top:nth-last-child(5):before{content:'Mona Lisa';position: absolute;background: white;}
  8311. #Rightbar .cell table:first-child tr td:first-child{display:none;}
  8312. ` : ""}
  8313.  
  8314. ${window.config.customBgColor ? `#Wrapper {
  8315. background: ${window.config.customBgColor} !important;
  8316. background-image: unset !important;
  8317. }` : ""}
  8318. .top{
  8319. position:relative;
  8320. }
  8321. .new{
  8322. position: absolute;
  8323. background: red;
  8324. font-size: 10px;
  8325. border-radius: 4px;
  8326. padding: 0px 2px;
  8327. color: white;
  8328. right: -9px;
  8329. top: -3px;
  8330. }
  8331. }
  8332. `;
  8333. let addStyle2 = document.createElement("style");
  8334. addStyle2.rel = "stylesheet";
  8335. addStyle2.type = "text/css";
  8336. addStyle2.innerHTML = style2;
  8337. window.document.head.append(addStyle2);
  8338. }
  8339. function qianDao() {
  8340. let timeNow = (/* @__PURE__ */ new Date()).getUTCFullYear() + "/" + ((/* @__PURE__ */ new Date()).getUTCMonth() + 1) + "/" + (/* @__PURE__ */ new Date()).getUTCDate();
  8341. if (window.pageType === PageType.Home) {
  8342. let qiandao2 = document.querySelector('.box .inner a[href="/mission/daily"]');
  8343. if (qiandao2) {
  8344. qianDao_(qiandao2, timeNow);
  8345. } else if (document.getElementById("gift_v2excellent")) {
  8346. document.getElementById("gift_v2excellent").click();
  8347. localStorage.setItem("menu_clockInTime", timeNow);
  8348. } else
  8349. ;
  8350. } else {
  8351. let timeOld = localStorage.getItem("menu_clockInTime");
  8352. if (!timeOld || timeOld != timeNow) {
  8353. qianDaoStatus_(timeNow);
  8354. }
  8355. }
  8356. }
  8357. function qianDao_(qiandao2, timeNow) {
  8358. let url = location.origin + "/mission/daily/redeem?" + RegExp("once\\=(\\d+)").exec(document.querySelector("div#Top .tools, #menu-body").innerHTML)[0];
  8359. $.get(url).then((r2) => {
  8360. let bodyText = r2.match(/<body[^>]*>([\s\S]+?)<\/body>/g);
  8361. let html = $(bodyText[0]);
  8362. if (html.find("li.fa.fa-ok-sign").length) {
  8363. html = html.find("#Main").text().match(/已连续登录 (\d+?) 天/)[0];
  8364. localStorage.setItem("menu_clockInTime", timeNow);
  8365. console.info("[V2Next] 自动签到完成!");
  8366. if (qiandao2) {
  8367. qiandao2.textContent = `自动签到完成!${html}`;
  8368. qiandao2.href = "javascript:void(0);";
  8369. }
  8370. } else {
  8371. console.warn("[V2Next] 自动签到失败!请关闭其他插件或脚本。如果连续几天都签到失败,请联系作者解决!");
  8372. if (qiandao2)
  8373. qiandao2.textContent = "自动签到失败!请尝试手动签到!";
  8374. }
  8375. });
  8376. }
  8377. function qianDaoStatus_(timeNow) {
  8378. $.get(location.origin + "/mission/daily").then((r2) => {
  8379. let bodyText = r2.match(/<body[^>]*>([\s\S]+?)<\/body>/g);
  8380. let html = $(bodyText[0]);
  8381. if (html.find('input[value^="领取"]').length) {
  8382. qianDao_(null, timeNow);
  8383. } else {
  8384. console.info("[V2Next] 已经签过到了。");
  8385. localStorage.setItem("menu_clockInTime", timeNow);
  8386. }
  8387. });
  8388. }
  8389. function getNoteItemContent(id, prefix) {
  8390. return new Promise((resolve, reject) => {
  8391. $.get(location.origin + "/notes/edit/" + id).then((r2) => {
  8392. let bodyText = r2.match(/<body[^>]*>([\s\S]+?)<\/body>/g);
  8393. let body = $(bodyText[0]);
  8394. let text = body.find(".note_editor").text();
  8395. if (text === prefix) {
  8396. resolve({});
  8397. } else {
  8398. let tagJson = text.substring(prefix.length);
  8399. try {
  8400. resolve(JSON.parse(tagJson));
  8401. } catch (e2) {
  8402. resolve({});
  8403. }
  8404. }
  8405. });
  8406. });
  8407. }
  8408. async function initNoteData() {
  8409. $.get(location.origin + "/notes").then(async (r2) => {
  8410. let bodyText = r2.match(/<body[^>]*>([\s\S]+?)<\/body>/g);
  8411. let body = $(bodyText[0]);
  8412. let items = body.find("#Main .box .note_item_title a");
  8413. if (window.config.openTag) {
  8414. let tagItems2 = Array.from(items).filter((v) => v.innerText.includes(window.user.tagPrefix));
  8415. if (tagItems2.length) {
  8416. window.user.tagsId = tagItems2[0].href.substr(-5);
  8417. window.user.tags = await getNoteItemContent(window.user.tagsId, window.user.tagPrefix);
  8418. } else {
  8419. let r22 = await window.parse.createNoteItem(window.user.tagPrefix);
  8420. r22 && (window.user.tagsId = r22);
  8421. }
  8422. }
  8423. let tagItems = Array.from(items).filter((v) => v.innerText.includes(window.user.configPrefix));
  8424. if (tagItems.length) {
  8425. window.user.configNoteId = tagItems[0].href.substr(-5);
  8426. let config2 = await getNoteItemContent(window.user.configNoteId, window.user.configPrefix);
  8427. window.config = functions.deepAssign(window.config, config2);
  8428. } else {
  8429. let r22 = await window.parse.createNoteItem(window.user.configPrefix);
  8430. r22 && (window.user.configNoteId = r22);
  8431. }
  8432. functions.cbChecker({ type: "syncData" });
  8433. functions.cbChecker({ type: "getConfigSuccess" });
  8434. });
  8435. }
  8436. function addSettingText() {
  8437. let setting = $(`<a href="/" class="top v2next-setting"><span>脚本设置</span></a>`);
  8438. setting.on("click", function(e2) {
  8439. functions.stopEvent(e2);
  8440. functions.cbChecker({ type: "openSetting" });
  8441. });
  8442. $(".tools").prepend(setting);
  8443. }
  8444. async function init() {
  8445. let top2 = document.querySelector(".tools .top:nth-child(2)");
  8446. if (top2 && top2.textContent !== "注册") {
  8447. window.isLogin = true;
  8448. window.user.username = top2.textContent;
  8449. window.user.avatar = $("#Rightbar .box .avatar").attr("src");
  8450. }
  8451. functions.initConfig();
  8452. let box;
  8453. let list;
  8454. let last;
  8455. let headerWrap;
  8456. let { pageData, pageType, username } = functions.checkPageType();
  8457. window.pageType = pageType;
  8458. window.pageData = pageData;
  8459. window.targetUserName = username;
  8460. initStyle();
  8461. switch (window.pageType) {
  8462. case PageType.Node:
  8463. box = document.querySelectorAll("#Wrapper #Main .box");
  8464. try {
  8465. headerWrap = $('<div class="post-item"></div>');
  8466. if (window.config.viewType === "card")
  8467. headerWrap[0].classList.add("preview");
  8468. $(box[1]).prepend(headerWrap);
  8469. $(box[1]).children().slice(1, 3).each(function() {
  8470. if (this.classList.contains("cell")) {
  8471. headerWrap.append(this);
  8472. }
  8473. });
  8474. headerWrap = $('<div class="post-item"></div>');
  8475. if (window.config.viewType === "card")
  8476. headerWrap[0].classList.add("preview");
  8477. $(box[1]).append(headerWrap);
  8478. $(box[1]).children().slice(2).each(function() {
  8479. if (this.classList.contains("cell")) {
  8480. headerWrap.append(this);
  8481. }
  8482. });
  8483. box[1].style.boxShadow = "unset";
  8484. box[1].style.background = "unset";
  8485. box[1].style.overflow = "hidden";
  8486. } catch (e2) {
  8487. console.log("PageType-Node解析报错了", e2);
  8488. }
  8489. let topics = box[1].querySelector("#TopicsNode");
  8490. list = topics.querySelectorAll(".cell");
  8491. list[0].before($section);
  8492. window.parse.parsePagePostList(list, box[1]);
  8493. break;
  8494. case PageType.Changes:
  8495. case PageType.Home:
  8496. box = document.querySelector("#Wrapper #Main .box");
  8497. try {
  8498. headerWrap = $('<div class="post-item"></div>');
  8499. if (window.config.viewType === "card")
  8500. headerWrap[0].classList.add("preview");
  8501. $(box).prepend(headerWrap);
  8502. $(box).children().slice(1, 3).each(function() {
  8503. if (!this.classList.contains("item")) {
  8504. headerWrap.append(this);
  8505. }
  8506. });
  8507. if (window.isDeadline && $(".tab_current").text() == "最热") {
  8508. headerWrap.append($(`<div class="cell" id="SecondaryTabs"><div class="fr"><a href="/v2hot?3">3天最热</a> &nbsp; &nbsp; <a href="/v2hot?7">7天最热</a> &nbsp; &nbsp; <a href="/v2hot?30">30天最热</a> &nbsp; &nbsp; <a href="/v2hot?setting"><i class="fa fa-calendar" aria-hidden="true"></i></a></div><a href="/v2hot?-1">昨天最热</a> &nbsp; &nbsp; <a href="/v2hot?-2">前天最热</a> &nbsp; &nbsp; </div>`));
  8509. }
  8510. last = $(box).children().last();
  8511. last.addClass("cell post-item");
  8512. if (window.config.viewType === "card")
  8513. last[0].classList.add("preview");
  8514. box.style.boxShadow = "unset";
  8515. box.style.background = "unset";
  8516. box.style.overflow = "hidden";
  8517. } catch (e2) {
  8518. console.log("PageType-Home解析报错了", e2);
  8519. }
  8520. list = box.querySelectorAll(".item");
  8521. list[0].before($section);
  8522. window.parse.parsePagePostList(list, box);
  8523. break;
  8524. case PageType.Post:
  8525. let d2 = localStorage.getItem("d");
  8526. if (d2) {
  8527. window.stopMe = true;
  8528. functions.cbChecker({ type: "syncData" });
  8529. return;
  8530. }
  8531. box = document.querySelector("#Wrapper #Main .box");
  8532. box.after($section);
  8533. let r2 = await functions.checkPostReplies(window.pageData.id, false);
  8534. if (r2) {
  8535. window.stopMe = true;
  8536. functions.cbChecker({ type: "syncData" });
  8537. functions.cbChecker({ type: "warningNotice", value: "由于回复数量较多,脚本已停止解析楼中楼" });
  8538. return;
  8539. }
  8540. if (window.config.postWidth) {
  8541. let Main = $("#Main");
  8542. Main.css({
  8543. "width": window.config.postWidth,
  8544. margin: "unset"
  8545. });
  8546. $("#Wrapper > .content").css({
  8547. "max-width": "unset",
  8548. display: "flex",
  8549. "justify-content": "center",
  8550. gap: "20px"
  8551. });
  8552. Main.after($("#Rightbar"));
  8553. }
  8554. let post = getDefaultPost({ id: window.pageData.id });
  8555. let body = $(document.body);
  8556. let htmlText = document.documentElement.outerHTML;
  8557. window.parse.parsePostContent(
  8558. post,
  8559. body,
  8560. htmlText
  8561. ).then(async (res) => {
  8562. await functions.cbChecker({ type: "postContent", value: res });
  8563. await window.parse.parseOp(res);
  8564. });
  8565. window.parse.getPostAllReplies(
  8566. post,
  8567. body,
  8568. htmlText,
  8569. window.pageData.pageNo
  8570. ).then(async (res1) => {
  8571. await functions.cbChecker({ type: "postReplies", value: res1 });
  8572. });
  8573. break;
  8574. case PageType.Member:
  8575. box = document.querySelectorAll("#Wrapper #Main .box");
  8576. if (location.pathname.includes("/replies")) {
  8577. box[0].after($section);
  8578. } else if (location.pathname.includes("/topics")) {
  8579. box[0].after($section);
  8580. } else {
  8581. if (window.config.openTag) {
  8582. box[0].style.borderBottom = "none";
  8583. box[0].style["border-bottom-left-radius"] = "0";
  8584. box[0].style["border-bottom-right-radius"] = "0";
  8585. }
  8586. try {
  8587. headerWrap = $('<div class="post-item"></div>');
  8588. if (window.config.viewType === "card")
  8589. headerWrap[0].classList.add("preview");
  8590. $(box[1]).prepend(headerWrap);
  8591. $(box[1]).children().slice(1, 2).each(function() {
  8592. if (!this.classList.contains("item")) {
  8593. headerWrap.append(this);
  8594. }
  8595. });
  8596. last = $(box[1]).children().last();
  8597. last.addClass("cell post-item");
  8598. if (window.config.viewType === "card")
  8599. last[0].classList.add("preview");
  8600. box[1].style.boxShadow = "unset";
  8601. box[1].style.background = "unset";
  8602. box[1].style.overflow = "hidden";
  8603. } catch (e2) {
  8604. console.log("PageType-Member解析报错了", e2);
  8605. }
  8606. list = box[1].querySelectorAll(".cell");
  8607. box[0].after($section);
  8608. window.parse.parsePagePostList(list, box[1]);
  8609. }
  8610. break;
  8611. default:
  8612. window.stopMe = true;
  8613. functions.cbChecker({ type: "syncData" });
  8614. console.error("未知页面");
  8615. break;
  8616. }
  8617. if (window.isLogin) {
  8618. initNoteData();
  8619. try {
  8620. if (window.config.autoSignin)
  8621. qianDao();
  8622. } catch (e2) {
  8623. console.log("签到失败");
  8624. }
  8625. }
  8626. addSettingText();
  8627. initMonkeyMenu();
  8628. window.addEventListener("error", (e2) => {
  8629. let dom = e2.target;
  8630. let originImgUrl = dom.getAttribute("originUrl");
  8631. if (originImgUrl) {
  8632. let a = document.createElement("a");
  8633. a.href = originImgUrl;
  8634. a.setAttribute("notice", "此标签由v2ex超级增强脚本转换图片失败后恢复");
  8635. a.innerText = originImgUrl;
  8636. a.target = "_blank";
  8637. dom.parentNode.replaceChild(a, dom);
  8638. }
  8639. }, true);
  8640. }
  8641. window.canParseV2exPage = !window.location.search.includes("script");
  8642. if (window.canParseV2exPage) {
  8643. init();
  8644. } else {
  8645. let box = document.querySelector("#Wrapper #Main .box");
  8646. box.after($section);
  8647. window.stopMe = true;
  8648. functions.cbChecker({ type: "syncData" });
  8649. if (window.location.search.includes("script=0")) {
  8650. functions.cbChecker({ type: "warningNotice", value: "脚本无法查看此主题,已为您单独打开此主题" });
  8651. }
  8652. if (window.location.search.includes("script=1")) {
  8653. functions.cbChecker({ type: "warningNotice", value: "由于回复数量较多,已为您单独打开此主题并停止解析楼中楼" });
  8654. }
  8655. }
  8656. }
  8657. if (!isMobile) {
  8658. console.log("V2EX PC端");
  8659. (o=>{if(typeof GM_addStyle=="function"){GM_addStyle(o);return}const r=document.createElement("style");r.textContent=o,document.head.append(r)})(' .tip[data-v-ee672411]{position:fixed;font-size:1.6rem;z-index:9999;max-width:10rem;border-radius:.5rem;padding:1rem;color:var(--color-font-8);background:var(--color-tooltip-bg);box-shadow:0 0 6px 1px var(--color-tooltip-shadow)}.v-enter-active[data-v-e7c0fbef],.v-leave-active[data-v-e7c0fbef]{transition:opacity .3s ease}.v-enter-from[data-v-e7c0fbef],.v-leave-to[data-v-e7c0fbef]{opacity:0}.username[data-v-e7c0fbef]{font-weight:700;font-size:1.4rem;margin-right:1rem}.link-num[data-v-e7c0fbef]{font-size:1.2rem;font-weight:700;color:#e02a2a}.owner[data-v-e7c0fbef]{display:inline-block;background-color:transparent;color:#1484cd;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid #1484cd;font-size:1.2rem;font-weight:700;margin-right:1rem;transform:scale(.8)}.mod[data-v-e7c0fbef]{display:inline-block;background-color:transparent;color:#1484cd;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid #1484cd;font-size:1.2rem;font-weight:700;transform:scale(.8);background:#1484cd;color:#fff;margin-right:1rem}.my-tag[data-v-e7c0fbef]{font-size:1.4rem;color:red;margin-left:1rem}.my-tag:hover .remove[data-v-e7c0fbef]{display:inline}.my-tag .remove[data-v-e7c0fbef]{cursor:pointer;margin-left:.5rem;display:none}.add-tag[data-v-e7c0fbef]{font-size:2.4rem;transform:translateY(.2rem);line-height:1rem;display:inline-block;margin-left:1rem;cursor:pointer;position:absolute;display:none}.floor[data-v-e7c0fbef]{margin-left:.5rem;font-size:1.1rem;line-height:1rem;border-radius:.5rem;display:inline-block;background-color:var(--color-floor);color:var(--color-floor-font);padding:3px 9px;cursor:default}[data-v-e7c0fbef]:root{--color-main-bg: #e2e2e2;--color-second-bg: white;--color-third-bg: #e2e2e2;--color-item-bg: white;--color-swtich-bg: #dcdfe6;--color-active: #409eff;--color-font: #999;--color-font-8: rgba(0, 0, 0, .8);--color-font-3: rgba(0, 0, 0, .3);--color-font-pure: black;--color-input-bg: white;--color-input-border: #e2e2e2;--color-input-border-hover: #a3a6ad;--color-radio-border: #e2e2e2;--color-tooltip-bg: white;--color-tooltip-shadow: #bbbbbb;--color-scrollbar: #93ade3;--color-line: #e2e2e2;--color-loading-1: #00000033;--color-loading-2: #000;--color-floor: #f0f0f0;--color-floor-font: #bdbdbd;--color-editor-toolbar: #f6f7f8;--color-sp-btn-bg: #f1f1f1;--color-call-list-bg: white;--color-top-reply-wrap-bg: #f2f3f5;--color-top-reply-wrap-line: #d2d2d2}html.dark[data-v-e7c0fbef]{--color-main-bg: #22303f;--color-second-bg: #18222d;--color-third-bg: #31475e;--color-item-bg: #18222d;--color-swtich-bg: #4c4d4f;--color-active: #409eff;--color-font: rgba(255, 255, 255, .5);--color-font-8: rgba(255, 255, 255, .8);--color-font-3: rgba(255, 255, 255, .3);--color-font-pure: white;--color-input-bg: #333333;--color-input-border: #6c6e72;--color-input-border-hover: #a3a6ad;--color-radio-border: #454847;--color-tooltip-bg: #31475e;--color-tooltip-shadow: #3b3b3b;--color-scrollbar: #5c5d5e;--color-line: var(--box-border-color);--color-loading-1: rgba(178, 177, 177, .2);--color-loading-2: #ffffff;--color-floor: #293b4d;--color-floor-font: rgba(255, 255, 255, .3);--color-editor-toolbar: var(--box-background-hover-color);--color-sp-btn-bg: #31475e;--color-call-list-bg: #31475e;--color-top-reply-wrap-bg: #212f3e;--color-top-reply-wrap-line: #3b536d}html[data-v-e7c0fbef],body[data-v-e7c0fbef]{font-size:62.5%}.flex[data-v-e7c0fbef]{display:flex;align-items:center;justify-content:space-between}.flex-end[data-v-e7c0fbef]{justify-content:flex-end}.flex-center[data-v-e7c0fbef]{justify-content:center}.p1[data-v-e7c0fbef]{padding:1rem}.p2[data-v-e7c0fbef]{padding:2rem}.p0[data-v-e7c0fbef]{padding:0!important}body :is(.topic_content,.reply_content) a[href^=http][data-v-e7c0fbef]{text-underline-offset:.7ex;text-decoration:underline 1px}a[data-v-e7c0fbef]{text-decoration:none;cursor:pointer}a[data-v-e7c0fbef]:hover{text-decoration:underline}.tool[data-v-e7c0fbef]{position:relative;display:flex;align-items:center;border-radius:.3rem;cursor:pointer;height:2.6rem;padding:0 .5rem;gap:.2rem}.tool>svg[data-v-e7c0fbef]{width:1.6rem!important;height:1.6rem!important}.tool[data-v-e7c0fbef]:hover{background:var(--color-third-bg)}.tool.no-hover[data-v-e7c0fbef]{cursor:default}.tool.no-hover[data-v-e7c0fbef]:hover{background:unset!important}.tool.disabled[data-v-e7c0fbef]{cursor:not-allowed}.tool.disabled[data-v-e7c0fbef]:hover{background:unset!important}.my-node[data-v-e7c0fbef]{border-radius:.2rem;padding:.4rem;font-size:1rem;color:#999;background:#f5f5f5;cursor:pointer}.my-node[data-v-e7c0fbef]:hover{text-decoration:none;background:#e2e2e2}.msgs[data-v-e7c0fbef]{position:fixed;margin-left:calc(50% - 25rem);width:50rem;z-index:9999;bottom:0;left:0;right:0}.my-box[data-v-e7c0fbef]{box-shadow:0 2px 3px #0000001a;box-shadow:#00000014 0 4px 12px;border-radius:var(--box-border-radius);background:var(--box-background-color);margin-bottom:2rem;width:100%;box-sizing:border-box;transition:background-color .3s}.my-cell[data-v-e7c0fbef]{color:var(--color-font);padding:.8rem 1rem;font-size:1.4rem;line-height:150%;text-align:left;border-bottom:1px solid var(--color-line)}.modal[data-v-e7c0fbef]{position:fixed;z-index:1001;width:100vw;height:100vh;left:0;top:0;display:flex;justify-content:center;align-items:center}.modal .title[data-v-e7c0fbef]{font-size:2.4rem;margin-bottom:1rem;text-align:center}.modal .option[data-v-e7c0fbef]{display:flex;align-items:center;padding:.6rem 0}.modal .option>span[data-v-e7c0fbef]{position:relative}.modal .mask[data-v-e7c0fbef]{position:fixed;width:100vw;height:100vh;left:0;top:0;background-color:#1d1c1c47}.radio-group2[data-v-e7c0fbef]{display:inline-flex;border-radius:.5rem;overflow:hidden;border:1px solid var(--color-radio-border);background:var(--box-background-alt-color)}.radio-group2 .radio[data-v-e7c0fbef]{cursor:pointer;background:transparent;padding:.5rem 1.2rem;border-left:1px solid var(--color-radio-border);font-size:1.3rem;color:var(--color-gray)}.radio-group2 .radio[data-v-e7c0fbef]:first-child{border-left:none}.radio-group2 .active[data-v-e7c0fbef]{background:var(--color-third-bg);color:var(--color-font)}.pop-confirm[data-v-e7c0fbef]{position:relative;display:inline-flex;justify-content:center}input[data-v-e7c0fbef]{height:3rem;outline:unset;border:1px solid var(--color-input-border);padding:0 .5rem;border-radius:5px;box-sizing:border-box;transition:all .3s;background:var(--color-input-bg);color:var(--color-font)}input[data-v-e7c0fbef]:hover{border:1px solid var(--color-input-border-hover)}input[data-v-e7c0fbef]:focus{border:1px solid var(--color-active)}.danger[data-v-e7c0fbef]{color:red!important}.pop-confirm-content[data-v-e7c0fbef]{position:fixed;background:var(--color-tooltip-bg);box-shadow:0 0 6px 1px var(--color-tooltip-shadow);color:var(--color-font-8);padding:1.5rem;border-radius:.8rem;transform:translate(-50%,calc(-100% - 1rem));z-index:1003}.pop-confirm-content .text[data-v-e7c0fbef]{text-align:start;font-size:1.6rem;width:15rem;min-width:15rem}.pop-confirm-content .options[data-v-e7c0fbef]{margin-top:1.5rem;display:flex;justify-content:flex-end;align-items:center;gap:1rem}.switch[data-v-e7c0fbef]{width:4.5rem;height:2.2rem;border-radius:2rem;position:relative;display:flex;align-items:center;background:var(--color-swtich-bg);transition:all .3s}.switch.active[data-v-e7c0fbef]{background:var(--color-active)}.switch.active[data-v-e7c0fbef]:before{right:.2rem}.switch[data-v-e7c0fbef]:before{position:absolute;content:" ";transition:all .3s;right:calc(100% - 2rem);width:1.8rem;height:1.8rem;background:white;border-radius:50%}.display-type[data-v-e4f684be]{height:3rem;padding:0 .3rem;background:var(--color-sp-btn-bg);border-radius:1rem;display:flex;font-size:1.4rem;align-items:center;color:#a9a9a9}.display-type .type[data-v-e4f684be]{border-radius:.8rem;padding:0 1.3rem;height:2.8rem;align-items:center;display:flex;position:relative;cursor:pointer}.display-type .type.active[data-v-e4f684be]{background:var(--color-second-bg);color:var(--color-font-pure);box-shadow:0 0 6px 0 var(--color-tooltip-shadow)}.display-type .type-list[data-v-e4f684be]{position:absolute;background:var(--color-sp-btn-bg);right:0;top:3rem;font-size:1.4rem;box-shadow:0 0 6px 0 var(--color-tooltip-shadow);border-radius:.6rem;z-index:9;color:var(--color-font)}.display-type .type-list .item[data-v-e4f684be]{word-break:keep-all;padding:.8rem 1rem;cursor:pointer}.display-type .type-list .item.active[data-v-e4f684be],.display-type .type-list .item[data-v-e4f684be]:hover{color:var(--color-font-pure)}.display-type svg[data-v-e4f684be]{width:1.5rem}.loading[data-v-2697baa2]{border:2px solid;border-color:var(--color-loading-2) var(--color-loading-1) var(--color-loading-1) var(--color-loading-1);border-radius:100%;animation:circle-2697baa2 infinite 1s linear;width:2rem;height:2rem}.loading.small[data-v-2697baa2]{width:1.2rem;height:1.2rem}.loading.large[data-v-2697baa2]{width:3rem;height:3rem}@keyframes circle-2697baa2{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.base-button[data-v-5a7d79ba]{cursor:pointer;border-radius:.6rem;padding:0 1.5rem;display:inline-flex;align-items:center;justify-content:center;transition:all .3s;height:3.6rem;line-height:1;position:relative}.base-button .loading[data-v-5a7d79ba]{position:absolute}.base-button.disabled[data-v-5a7d79ba]{opacity:.6;cursor:not-allowed;-webkit-user-select:none;user-select:none}.base-button.small[data-v-5a7d79ba]{height:3rem}.base-button.small>span[data-v-5a7d79ba]{font-size:1.3rem}.base-button.large[data-v-5a7d79ba]{height:5rem;font-size:1.8rem;padding:0 2.2rem}.base-button.large>span[data-v-5a7d79ba]{font-size:1.8rem}.base-button[data-v-5a7d79ba]:hover:not(.link){opacity:.7}.base-button.primary[data-v-5a7d79ba]{background:var(--color-active)}.base-button.primary>span[data-v-5a7d79ba]{color:#fff}.base-button.gary[data-v-5a7d79ba]{background:#4b5563}.base-button.link[data-v-5a7d79ba]{border-radius:0;border-bottom:2px solid transparent}.base-button.link>span[data-v-5a7d79ba]{color:var(--color-font-8)}.base-button.link[data-v-5a7d79ba]:hover{border-bottom:2px solid var(--color-font-8)}.base-button.active[data-v-5a7d79ba]{opacity:.4}.key-notice[data-v-5a7d79ba]{margin-left:1rem;display:flex;align-items:center;justify-content:center;font-size:1.2rem;color:#fff}.key-notice .key[data-v-5a7d79ba]{transform:scale(.8)}.setting-modal .modal-root[data-v-386b43d0]{z-index:9;background:var(--color-main-bg);border-radius:1rem;font-size:1.4rem;overflow:hidden;color:var(--color-font-pure)}.setting-modal .modal-root .modal-header[data-v-386b43d0]{padding:1.4rem;display:flex;justify-content:center;position:relative}.setting-modal .modal-root .modal-header .title[data-v-386b43d0]{font-size:2.2rem;text-align:left;margin-bottom:0}.setting-modal .modal-root .modal-header svg[data-v-386b43d0]{position:absolute;right:1rem;cursor:pointer;font-size:2.6rem}.setting-modal .modal-root .body[data-v-386b43d0]{width:60rem}.setting-modal .modal-root .body .modal-content[data-v-386b43d0]{background:var(--color-second-bg);flex:1;height:100%;box-sizing:border-box;padding:1rem 1rem 1rem 2rem;font-size:1.6rem;text-align:left;line-height:1.6}.setting-modal .modal-root .body .btns[data-v-386b43d0]{margin:1.5rem;display:flex;justify-content:flex-end;align-items:center;gap:1.5rem;font-size:1.4rem}.setting-modal .modal-root[data-v-b34c6692]{z-index:9;background:var(--color-main-bg);border-radius:1rem;font-size:1.4rem;overflow:hidden;color:var(--color-font-pure)}.setting-modal .modal-root .modal-header[data-v-b34c6692]{padding:2.4rem;display:flex;justify-content:space-between}.setting-modal .modal-root .modal-header .title[data-v-b34c6692]{font-size:2.6rem;font-weight:700;text-align:left;margin-bottom:0}.setting-modal .modal-root .modal-header svg[data-v-b34c6692]{cursor:pointer;font-size:2.6rem}.setting-modal .modal-root .body[data-v-b34c6692]{width:45vw;height:70vh;display:flex}.setting-modal .modal-root .body .left[data-v-b34c6692]{display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-size:1.8rem}.setting-modal .modal-root .body .left .tabs[data-v-b34c6692]{padding:1rem 2rem;display:flex;flex-direction:column;gap:1rem}.setting-modal .modal-root .body .left .tabs .tab[data-v-b34c6692]{cursor:pointer;padding:1rem 1.5rem;border-radius:.8rem;display:flex;align-items:center;gap:1rem}.setting-modal .modal-root .body .left .tabs .tab.active[data-v-b34c6692]{background:var(--color-item-bg)}.setting-modal .modal-root .body .left .icons[data-v-b34c6692]{display:flex;gap:1rem;margin-bottom:2rem;font-size:2.4rem}.setting-modal .modal-root .body .modal-content[data-v-b34c6692]{background:var(--color-second-bg);flex:1;height:100%;box-sizing:border-box;padding:1rem 1rem 1rem 2rem;border-radius:1rem;display:flex}.setting-modal .modal-root .body .modal-content .scroll[data-v-b34c6692]{flex:1;padding-right:1rem;overflow:auto}.setting-modal .modal-root .body .modal-content .scroll .row[data-v-b34c6692]{min-height:5rem;display:flex;justify-content:space-between;align-items:center}.setting-modal .modal-root .body .modal-content .scroll .row .wrapper[data-v-b34c6692]{height:3rem;flex:1;display:flex;justify-content:flex-end;align-items:center;gap:var(--space)}.setting-modal .modal-root .body .modal-content .scroll .row .wrapper span[data-v-b34c6692]{text-align:right;font-size:1.4rem;color:gray}.setting-modal .modal-root .body .modal-content .scroll .row .wrapper .set-key[data-v-b34c6692]{align-items:center}.setting-modal .modal-root .body .modal-content .scroll .row .wrapper .set-key input[data-v-b34c6692]{width:15rem;box-sizing:border-box;margin-right:1rem;height:2.8rem;outline:none;font-size:1.6rem;border:1px solid gray;border-radius:.3rem;padding:0 .5rem;background:var(--color-second-bg);color:var(--color-font-1)}.setting-modal .modal-root .body .modal-content .scroll .row .main-title[data-v-b34c6692]{font-size:2.2rem;font-weight:700;color:var(--color-font-8)}.setting-modal .modal-root .body .modal-content .scroll .row .item-title[data-v-b34c6692]{font-size:1.8rem}.setting-modal .modal-root .body .modal-content .scroll .desc[data-v-b34c6692]{margin-bottom:1rem;font-size:1.4rem;text-align:left;color:var(--color-font)}.setting-modal .modal-root .body .modal-content .scroll .project-desc[data-v-b34c6692]{text-align:start;font-size:1.6rem;padding-bottom:10rem}.setting-modal .modal-root .body .modal-content .scroll .line[data-v-b34c6692]{border-bottom:1px solid #c4c3c3}.sub-content[data-v-b34c6692]{padding:0 2rem 1rem;border-radius:1rem;background:#f3f3f3;margin-bottom:1rem}.log[data-v-b34c6692]{position:relative;text-align:left;margin-bottom:20px;padding-left:20px;font-size:16px;color:#6495ed;text-decoration:underline}.Author[data-v-64aa1930]{display:flex;align-items:center;justify-content:space-between;font-size:1.2rem;position:relative}.Author.expand[data-v-64aa1930]{margin-bottom:0}.Author .Author-left[data-v-64aa1930]{display:flex;align-items:center;max-width:65%;word-break:break-all}.Author .Author-left .username[data-v-64aa1930]{font-size:1.4rem;margin-right:.6rem}.Author .Author-left .expand-icon[data-v-64aa1930]{cursor:pointer;margin-right:.6rem;width:2rem;height:2rem;transform:rotate(90deg)}.Author .Author-left .avatar[data-v-64aa1930]{margin-right:.8rem;display:flex}.Author .Author-left .avatar img[data-v-64aa1930]{width:2.8rem;height:2.8rem;border-radius:.4rem}.Author .Author-left .texts[data-v-64aa1930]{flex:1}.Author .Author-left .owner[data-v-64aa1930]{display:inline-block;background-color:transparent;color:#1484cd;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid #1484cd;font-size:1.2rem;font-weight:700;margin-right:.6rem;transform:scale(.8)}.Author .Author-left .dup[data-v-64aa1930]{display:inline-block;background-color:transparent;color:red;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid red;font-size:1.2rem;font-weight:700;margin-right:.6rem;transform:scale(.8)}.Author .Author-left .mod[data-v-64aa1930]{display:inline-block;background-color:transparent;color:#1484cd;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid #1484cd;font-size:1.2rem;font-weight:700;transform:scale(.8);background:#1484cd;color:#fff;margin-right:.6rem}.Author:hover .add-tag[data-v-64aa1930]{display:inline-block}.Author .Author-right[data-v-64aa1930]{position:absolute;right:0;display:flex;align-items:center}.Author .Author-right .toolbar[data-v-64aa1930]{display:flex;align-items:center;color:var(--color-gray);opacity:0;gap:.2rem}.Author .Author-right .toolbar[data-v-64aa1930]:hover{opacity:1}.post-editor-wrapper[data-v-19618aa1]{width:100%;box-sizing:border-box;position:relative;overflow:hidden;transition:all .3s;color:var(--color-font)}.post-editor-wrapper.reply-post .post-editor[data-v-19618aa1]{border:1px solid var(--color-line)}.post-editor-wrapper.reply-post.isFocus .post-editor[data-v-19618aa1]{border:1px solid var(--color-active)}.post-editor-wrapper.reply-comment[data-v-19618aa1]{border-radius:var(--box-border-radius);overflow:hidden;border:1px solid var(--color-line)}.post-editor-wrapper.reply-comment.isFocus[data-v-19618aa1]{border:1px solid var(--color-active)}.post-editor-wrapper.reply-comment .toolbar[data-v-19618aa1]{background:var(--color-editor-toolbar)}.post-editor-wrapper .post-editor[data-v-19618aa1]{border-radius:var(--box-border-radius);transition:border .3s;width:100%;max-width:100%;padding:.6rem 1.4rem;box-sizing:border-box;outline:none;font-family:Avenir,Helvetica,Arial,sans-serif;font-size:1.4rem;min-height:13rem;resize:none;background:var(--box-background-color);color:var(--color-font-pure);border:1px solid transparent}.post-editor-wrapper .toolbar[data-v-19618aa1]{box-sizing:border-box;padding:.5rem 1rem;width:100%;position:relative;display:flex;justify-content:space-between;align-items:center}.post-editor-wrapper .toolbar .left[data-v-19618aa1]{display:flex;align-items:center;gap:1rem;font-size:2.6rem}.post-editor-wrapper .toolbar .left svg[data-v-19618aa1]{cursor:pointer}.post-editor-wrapper .toolbar .left .upload[data-v-19618aa1]{width:2.6rem;height:2.6rem;overflow:hidden;display:flex;justify-content:center;align-items:center}.post-editor-wrapper .toolbar .left .upload input[data-v-19618aa1]{width:2.6rem;height:2.6rem;cursor:pointer;position:absolute;opacity:0}.post-editor-wrapper .toolbar span[data-v-19618aa1]{color:gray;font-size:1.3rem}.post-editor-wrapper .get-cursor[data-v-19618aa1]{border-radius:var(--box-border-radius);transition:border .3s;width:100%;max-width:100%;padding:.6rem 1.4rem;box-sizing:border-box;outline:none;font-family:Avenir,Helvetica,Arial,sans-serif;font-size:1.4rem;min-height:13rem;resize:none;background:var(--box-background-color);color:var(--color-font-pure);border:1px solid transparent;position:absolute;top:0;z-index:-100}.post-editor-wrapper .emoticon-pack[data-v-19618aa1]{z-index:999999999;border-radius:1rem;padding:1rem;width:31rem;max-width:31rem;height:30rem;max-height:30rem;overflow:auto;background:var(--color-third-bg);border:1px solid var(--color-font-3);box-shadow:0 9px 24px -3px #0000000f,0 4px 8px -1px #0000001f;position:fixed;bottom:11rem;left:14rem}.post-editor-wrapper .emoticon-pack svg[data-v-19618aa1]{cursor:pointer;position:absolute;right:.8rem;font-size:2.4rem}.post-editor-wrapper .emoticon-pack .list[data-v-19618aa1]{margin:1rem 0;display:flex;flex-wrap:wrap}.post-editor-wrapper .emoticon-pack img[data-v-19618aa1]{cursor:pointer;width:calc(100% / 7);padding:.5rem;box-sizing:border-box}.post-editor-wrapper .emoticon-pack span[data-v-19618aa1]{width:calc(100% / 7);display:inline-block;cursor:pointer;font-size:2.3rem;text-align:center}.v-enter-active[data-v-6f61a860],.v-leave-active[data-v-6f61a860]{transition:opacity .3s ease}.v-enter-from[data-v-6f61a860],.v-leave-to[data-v-6f61a860]{opacity:0}.username[data-v-6f61a860]{font-weight:700;font-size:1.4rem;margin-right:1rem}.link-num[data-v-6f61a860]{font-size:1.2rem;font-weight:700;color:#e02a2a}.owner[data-v-6f61a860]{display:inline-block;background-color:transparent;color:#1484cd;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid #1484cd;font-size:1.2rem;font-weight:700;margin-right:1rem;transform:scale(.8)}.mod[data-v-6f61a860]{display:inline-block;background-color:transparent;color:#1484cd;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid #1484cd;font-size:1.2rem;font-weight:700;transform:scale(.8);background:#1484cd;color:#fff;margin-right:1rem}.my-tag[data-v-6f61a860]{font-size:1.4rem;color:red;margin-left:1rem}.my-tag:hover .remove[data-v-6f61a860]{display:inline}.my-tag .remove[data-v-6f61a860]{cursor:pointer;margin-left:.5rem;display:none}.add-tag[data-v-6f61a860]{font-size:2.4rem;transform:translateY(.2rem);line-height:1rem;display:inline-block;margin-left:1rem;cursor:pointer;position:absolute;display:none}.floor[data-v-6f61a860]{margin-left:.5rem;font-size:1.1rem;line-height:1rem;border-radius:.5rem;display:inline-block;background-color:var(--color-floor);color:var(--color-floor-font);padding:3px 9px;cursor:default}[data-v-6f61a860]:root{--color-main-bg: #e2e2e2;--color-second-bg: white;--color-third-bg: #e2e2e2;--color-item-bg: white;--color-swtich-bg: #dcdfe6;--color-active: #409eff;--color-font: #999;--color-font-8: rgba(0, 0, 0, .8);--color-font-3: rgba(0, 0, 0, .3);--color-font-pure: black;--color-input-bg: white;--color-input-border: #e2e2e2;--color-input-border-hover: #a3a6ad;--color-radio-border: #e2e2e2;--color-tooltip-bg: white;--color-tooltip-shadow: #bbbbbb;--color-scrollbar: #93ade3;--color-line: #e2e2e2;--color-loading-1: #00000033;--color-loading-2: #000;--color-floor: #f0f0f0;--color-floor-font: #bdbdbd;--color-editor-toolbar: #f6f7f8;--color-sp-btn-bg: #f1f1f1;--color-call-list-bg: white;--color-top-reply-wrap-bg: #f2f3f5;--color-top-reply-wrap-line: #d2d2d2}html.dark[data-v-6f61a860]{--color-main-bg: #22303f;--color-second-bg: #18222d;--color-third-bg: #31475e;--color-item-bg: #18222d;--color-swtich-bg: #4c4d4f;--color-active: #409eff;--color-font: rgba(255, 255, 255, .5);--color-font-8: rgba(255, 255, 255, .8);--color-font-3: rgba(255, 255, 255, .3);--color-font-pure: white;--color-input-bg: #333333;--color-input-border: #6c6e72;--color-input-border-hover: #a3a6ad;--color-radio-border: #454847;--color-tooltip-bg: #31475e;--color-tooltip-shadow: #3b3b3b;--color-scrollbar: #5c5d5e;--color-line: var(--box-border-color);--color-loading-1: rgba(178, 177, 177, .2);--color-loading-2: #ffffff;--color-floor: #293b4d;--color-floor-font: rgba(255, 255, 255, .3);--color-editor-toolbar: var(--box-background-hover-color);--color-sp-btn-bg: #31475e;--color-call-list-bg: #31475e;--color-top-reply-wrap-bg: #212f3e;--color-top-reply-wrap-line: #3b536d}html[data-v-6f61a860],body[data-v-6f61a860]{font-size:62.5%}.flex[data-v-6f61a860]{display:flex;align-items:center;justify-content:space-between}.flex-end[data-v-6f61a860]{justify-content:flex-end}.flex-center[data-v-6f61a860]{justify-content:center}.p1[data-v-6f61a860]{padding:1rem}.p2[data-v-6f61a860]{padding:2rem}.p0[data-v-6f61a860]{padding:0!important}body :is(.topic_content,.reply_content) a[href^=http][data-v-6f61a860]{text-underline-offset:.7ex;text-decoration:underline 1px}a[data-v-6f61a860]{text-decoration:none;cursor:pointer}a[data-v-6f61a860]:hover{text-decoration:underline}.tool[data-v-6f61a860]{position:relative;display:flex;align-items:center;border-radius:.3rem;cursor:pointer;height:2.6rem;padding:0 .5rem;gap:.2rem}.tool>svg[data-v-6f61a860]{width:1.6rem!important;height:1.6rem!important}.tool[data-v-6f61a860]:hover{background:var(--color-third-bg)}.tool.no-hover[data-v-6f61a860]{cursor:default}.tool.no-hover[data-v-6f61a860]:hover{background:unset!important}.tool.disabled[data-v-6f61a860]{cursor:not-allowed}.tool.disabled[data-v-6f61a860]:hover{background:unset!important}.my-node[data-v-6f61a860]{border-radius:.2rem;padding:.4rem;font-size:1rem;color:#999;background:#f5f5f5;cursor:pointer}.my-node[data-v-6f61a860]:hover{text-decoration:none;background:#e2e2e2}.msgs[data-v-6f61a860]{position:fixed;margin-left:calc(50% - 25rem);width:50rem;z-index:9999;bottom:0;left:0;right:0}.my-box[data-v-6f61a860]{box-shadow:0 2px 3px #0000001a;box-shadow:#00000014 0 4px 12px;border-radius:var(--box-border-radius);background:var(--box-background-color);margin-bottom:2rem;width:100%;box-sizing:border-box;transition:background-color .3s}.my-cell[data-v-6f61a860]{color:var(--color-font);padding:.8rem 1rem;font-size:1.4rem;line-height:150%;text-align:left;border-bottom:1px solid var(--color-line)}.modal[data-v-6f61a860]{position:fixed;z-index:1001;width:100vw;height:100vh;left:0;top:0;display:flex;justify-content:center;align-items:center}.modal .title[data-v-6f61a860]{font-size:2.4rem;margin-bottom:1rem;text-align:center}.modal .option[data-v-6f61a860]{display:flex;align-items:center;padding:.6rem 0}.modal .option>span[data-v-6f61a860]{position:relative}.modal .mask[data-v-6f61a860]{position:fixed;width:100vw;height:100vh;left:0;top:0;background-color:#1d1c1c47}.radio-group2[data-v-6f61a860]{display:inline-flex;border-radius:.5rem;overflow:hidden;border:1px solid var(--color-radio-border);background:var(--box-background-alt-color)}.radio-group2 .radio[data-v-6f61a860]{cursor:pointer;background:transparent;padding:.5rem 1.2rem;border-left:1px solid var(--color-radio-border);font-size:1.3rem;color:var(--color-gray)}.radio-group2 .radio[data-v-6f61a860]:first-child{border-left:none}.radio-group2 .active[data-v-6f61a860]{background:var(--color-third-bg);color:var(--color-font)}.pop-confirm[data-v-6f61a860]{position:relative;display:inline-flex;justify-content:center}input[data-v-6f61a860]{height:3rem;outline:unset;border:1px solid var(--color-input-border);padding:0 .5rem;border-radius:5px;box-sizing:border-box;transition:all .3s;background:var(--color-input-bg);color:var(--color-font)}input[data-v-6f61a860]:hover{border:1px solid var(--color-input-border-hover)}input[data-v-6f61a860]:focus{border:1px solid var(--color-active)}.danger[data-v-6f61a860]{color:red!important}.pop-confirm-content[data-v-6f61a860]{position:fixed;background:var(--color-tooltip-bg);box-shadow:0 0 6px 1px var(--color-tooltip-shadow);color:var(--color-font-8);padding:1.5rem;border-radius:.8rem;transform:translate(-50%,calc(-100% - 1rem));z-index:1003}.pop-confirm-content .text[data-v-6f61a860]{text-align:start;font-size:1.6rem;width:15rem;min-width:15rem}.pop-confirm-content .options[data-v-6f61a860]{margin-top:1.5rem;display:flex;justify-content:flex-end;align-items:center;gap:1rem}.html-wrapper[data-v-6f61a860]{position:relative}.html-wrapper .mask[data-v-6f61a860]{max-height:90rem;overflow:hidden;-webkit-mask-image:linear-gradient(180deg,#000 80%,transparent)}.html-wrapper .expand[data-v-6f61a860]{position:absolute;z-index:1;bottom:2rem;padding:.2rem 1.5rem;border-radius:2rem;border:1px solid gray;background:white;color:gray;left:50%;transform:translate(-50%);cursor:pointer}.top-sub-comment[data-v-d3f8c94b]{width:100%;box-sizing:border-box;margin-top:.8rem;display:flex;position:relative}.top-sub-comment .expand-line[data-v-d3f8c94b]{width:1.6rem;position:relative}.top-sub-comment .expand-line[data-v-d3f8c94b]:after{position:absolute;left:50%;top:2%;content:" ";height:98%;width:0;border-right:1px solid var(--color-top-reply-wrap-line)}.top-sub-comment .right[data-v-d3f8c94b]{flex:1;width:calc(100% - 3rem)}.top-sub-comment .right .w .post-editor-wrapper[data-v-d3f8c94b]{margin-top:1rem}.top-sub-comment[data-v-d3f8c94b] .avatar{display:none!important}.top-sub-comment.top-sub-reply[data-v-d3f8c94b]:first-child{margin-top:0}.top-sub-comment.top-sub-reply>.expand-line[data-v-d3f8c94b]{width:1rem}.top-sub-comment.top-sub-reply>.expand-line[data-v-d3f8c94b]:after{display:none}.comment[data-v-dd44e74f]{width:100%;box-sizing:border-box;margin-top:.6rem}.comment.isLevelOne[data-v-dd44e74f]{border-bottom:1px solid var(--color-line);padding:.8rem 1rem;margin-top:0}.comment.ding[data-v-dd44e74f]{background:rgba(255,255,0,.3)!important}.comment.isSimple .avatar[data-v-dd44e74f],.comment.isSimple .expand-line[data-v-dd44e74f]{display:none}.comment.isSimple .simple-wrapper[data-v-dd44e74f]{padding-left:2.8rem}.comment.isSimple .w[data-v-dd44e74f]{padding-left:0!important;padding-top:.5rem}.comment .comment-content-w .more[data-v-dd44e74f]{text-align:center;margin:2rem 0}.comment .comment-content[data-v-dd44e74f]{display:flex;position:relative}.comment .comment-content .expand-line[data-v-dd44e74f]{cursor:pointer;margin-top:.6rem;width:2rem;min-width:2rem;position:relative}.comment .comment-content .expand-line[data-v-dd44e74f]:after{position:absolute;left:50%;content:" ";height:100%;width:0;border-right:1px solid var(--color-line)}.comment .comment-content .expand-line[data-v-dd44e74f]:hover:after{border-right:2px solid var(--color-active)}.comment .comment-content .right[data-v-dd44e74f]{flex:1;width:calc(100% - 3rem)}.comment .comment-content .right .w[data-v-dd44e74f]{padding-left:1rem}.comment .comment-content .right .w .post-editor-wrapper[data-v-dd44e74f]{margin-top:1rem}.wrong-wrapper[data-v-dd44e74f]{font-size:1.4rem;margin-bottom:1rem}.wrong-wrapper span[data-v-dd44e74f]{cursor:pointer}.wrong-wrapper .del-line[data-v-dd44e74f]{text-decoration:line-through}.wrong-wrapper .wrong-icon[data-v-dd44e74f]{margin-left:.5rem}.wrong-wrapper .warning[data-v-dd44e74f]{border-top:1px solid #e1e1e1;border-bottom:1px solid #e1e1e1;padding:1rem 0;margin-top:1rem;font-size:1.2rem;color:red}.reply-count[data-v-dd44e74f]{padding:.8rem 0 .4rem;border-radius:.2rem;font-size:1.3rem;display:flex;align-items:center;color:gray;gap:1rem;cursor:pointer}.reply-count .gang[data-v-dd44e74f]{width:2rem;height:0;border-bottom:1px solid #d5d5d5}.reply-count svg[data-v-dd44e74f]{font-size:1rem}.top-reply-wrap[data-v-dd44e74f]{background:var(--color-top-reply-wrap-bg);border-radius:.8rem;padding:.6rem;padding-left:0;margin-left:1rem}.toolbar[data-v-30dac564]{border-top:1px solid var(--color-line);height:3.8rem;padding-left:.6rem;display:flex;align-items:center;color:var(--color-gray);font-size:1.2rem;gap:.5rem}.comment[data-v-4a063111]{width:100%;box-sizing:border-box;display:flex;gap:1rem;padding:1rem;border-bottom:1px solid var(--color-line)}.comment.isSimple .avatar[data-v-4a063111]{display:none}.comment.isSimple .reply_content[data-v-4a063111]{margin-top:.5rem!important}.comment .avatar[data-v-4a063111]{display:flex}.comment .avatar img[data-v-4a063111]{width:3.8rem;height:3.8rem;border-radius:.3rem}.comment .comment-body[data-v-4a063111]{flex:1;display:flex;flex-direction:column}.comment .comment-body .texts[data-v-4a063111]{display:flex;align-items:center}.comment .comment-body .reply_content[data-v-4a063111]{margin-top:1rem;max-width:calc(100% - 5rem)}.comment .isRight[data-v-4a063111]{align-items:flex-end}.comment .isRight .owner[data-v-4a063111],.comment .isRight .mod[data-v-4a063111],.comment .isRight .username[data-v-4a063111]{margin:0 0 0 1rem}.comment .Author-right[data-v-4a063111]{display:flex;flex-direction:column;align-items:center}.comment .Author-right .floor[data-v-4a063111]{margin-left:0}.comment .Author-right .jump[data-v-4a063111]{color:#929596;margin-top:.4rem;font-size:1.4rem}.comment .point[data-v-4a063111]{margin:0 .5rem;font-size:1.6rem;display:flex;gap:.5rem;align-items:center;font-weight:700;color:#000}.sticky{position:sticky;bottom:-2px;z-index:2;background:var(--box-background-hover-color)!important}.sticky[stuck]{box-shadow:0 2px 20px #00000059!important}.preview-modal{position:fixed;width:100vw;height:100vh;left:0;top:-1000vh;z-index:9999}.preview-modal .close{font-size:2rem;color:#fff;position:absolute;right:2rem;top:2rem;cursor:pointer}.preview-modal .mask{position:absolute;left:0;top:0;width:100%;height:100%;background:rgba(0,0,0,.7);transition:all .3s}.v-enter-active[data-v-0863ff2a],.v-leave-active[data-v-0863ff2a]{transition:opacity .3s ease}.v-enter-from[data-v-0863ff2a],.v-leave-to[data-v-0863ff2a]{opacity:0}.username[data-v-0863ff2a]{font-weight:700;font-size:1.4rem;margin-right:1rem}.link-num[data-v-0863ff2a]{font-size:1.2rem;font-weight:700;color:#e02a2a}.owner[data-v-0863ff2a]{display:inline-block;background-color:transparent;color:#1484cd;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid #1484cd;font-size:1.2rem;font-weight:700;margin-right:1rem;transform:scale(.8)}.mod[data-v-0863ff2a]{display:inline-block;background-color:transparent;color:#1484cd;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid #1484cd;font-size:1.2rem;font-weight:700;transform:scale(.8);background:#1484cd;color:#fff;margin-right:1rem}.my-tag[data-v-0863ff2a]{font-size:1.4rem;color:red;margin-left:1rem}.my-tag:hover .remove[data-v-0863ff2a]{display:inline}.my-tag .remove[data-v-0863ff2a]{cursor:pointer;margin-left:.5rem;display:none}.add-tag[data-v-0863ff2a]{font-size:2.4rem;transform:translateY(.2rem);line-height:1rem;display:inline-block;margin-left:1rem;cursor:pointer;position:absolute;display:none}.floor[data-v-0863ff2a]{margin-left:.5rem;font-size:1.1rem;line-height:1rem;border-radius:.5rem;display:inline-block;background-color:var(--color-floor);color:var(--color-floor-font);padding:3px 9px;cursor:default}[data-v-0863ff2a]:root{--color-main-bg: #e2e2e2;--color-second-bg: white;--color-third-bg: #e2e2e2;--color-item-bg: white;--color-swtich-bg: #dcdfe6;--color-active: #409eff;--color-font: #999;--color-font-8: rgba(0, 0, 0, .8);--color-font-3: rgba(0, 0, 0, .3);--color-font-pure: black;--color-input-bg: white;--color-input-border: #e2e2e2;--color-input-border-hover: #a3a6ad;--color-radio-border: #e2e2e2;--color-tooltip-bg: white;--color-tooltip-shadow: #bbbbbb;--color-scrollbar: #93ade3;--color-line: #e2e2e2;--color-loading-1: #00000033;--color-loading-2: #000;--color-floor: #f0f0f0;--color-floor-font: #bdbdbd;--color-editor-toolbar: #f6f7f8;--color-sp-btn-bg: #f1f1f1;--color-call-list-bg: white;--color-top-reply-wrap-bg: #f2f3f5;--color-top-reply-wrap-line: #d2d2d2}html.dark[data-v-0863ff2a]{--color-main-bg: #22303f;--color-second-bg: #18222d;--color-third-bg: #31475e;--color-item-bg: #18222d;--color-swtich-bg: #4c4d4f;--color-active: #409eff;--color-font: rgba(255, 255, 255, .5);--color-font-8: rgba(255, 255, 255, .8);--color-font-3: rgba(255, 255, 255, .3);--color-font-pure: white;--color-input-bg: #333333;--color-input-border: #6c6e72;--color-input-border-hover: #a3a6ad;--color-radio-border: #454847;--color-tooltip-bg: #31475e;--color-tooltip-shadow: #3b3b3b;--color-scrollbar: #5c5d5e;--color-line: var(--box-border-color);--color-loading-1: rgba(178, 177, 177, .2);--color-loading-2: #ffffff;--color-floor: #293b4d;--color-floor-font: rgba(255, 255, 255, .3);--color-editor-toolbar: var(--box-background-hover-color);--color-sp-btn-bg: #31475e;--color-call-list-bg: #31475e;--color-top-reply-wrap-bg: #212f3e;--color-top-reply-wrap-line: #3b536d}html[data-v-0863ff2a],body[data-v-0863ff2a]{font-size:62.5%}.flex[data-v-0863ff2a]{display:flex;align-items:center;justify-content:space-between}.flex-end[data-v-0863ff2a]{justify-content:flex-end}.flex-center[data-v-0863ff2a]{justify-content:center}.p1[data-v-0863ff2a]{padding:1rem}.p2[data-v-0863ff2a]{padding:2rem}.p0[data-v-0863ff2a]{padding:0!important}body :is(.topic_content,.reply_content) a[href^=http][data-v-0863ff2a]{text-underline-offset:.7ex;text-decoration:underline 1px}a[data-v-0863ff2a]{text-decoration:none;cursor:pointer}a[data-v-0863ff2a]:hover{text-decoration:underline}.tool[data-v-0863ff2a]{position:relative;display:flex;align-items:center;border-radius:.3rem;cursor:pointer;height:2.6rem;padding:0 .5rem;gap:.2rem}.tool>svg[data-v-0863ff2a]{width:1.6rem!important;height:1.6rem!important}.tool[data-v-0863ff2a]:hover{background:var(--color-third-bg)}.tool.no-hover[data-v-0863ff2a]{cursor:default}.tool.no-hover[data-v-0863ff2a]:hover{background:unset!important}.tool.disabled[data-v-0863ff2a]{cursor:not-allowed}.tool.disabled[data-v-0863ff2a]:hover{background:unset!important}.my-node[data-v-0863ff2a]{border-radius:.2rem;padding:.4rem;font-size:1rem;color:#999;background:#f5f5f5;cursor:pointer}.my-node[data-v-0863ff2a]:hover{text-decoration:none;background:#e2e2e2}.msgs[data-v-0863ff2a]{position:fixed;margin-left:calc(50% - 25rem);width:50rem;z-index:9999;bottom:0;left:0;right:0}.my-box[data-v-0863ff2a]{box-shadow:0 2px 3px #0000001a;box-shadow:#00000014 0 4px 12px;border-radius:var(--box-border-radius);background:var(--box-background-color);margin-bottom:2rem;width:100%;box-sizing:border-box;transition:background-color .3s}.my-cell[data-v-0863ff2a]{color:var(--color-font);padding:.8rem 1rem;font-size:1.4rem;line-height:150%;text-align:left;border-bottom:1px solid var(--color-line)}.modal[data-v-0863ff2a]{position:fixed;z-index:1001;width:100vw;height:100vh;left:0;top:0;display:flex;justify-content:center;align-items:center}.modal .title[data-v-0863ff2a]{font-size:2.4rem;margin-bottom:1rem;text-align:center}.modal .option[data-v-0863ff2a]{display:flex;align-items:center;padding:.6rem 0}.modal .option>span[data-v-0863ff2a]{position:relative}.modal .mask[data-v-0863ff2a]{position:fixed;width:100vw;height:100vh;left:0;top:0;background-color:#1d1c1c47}.radio-group2[data-v-0863ff2a]{display:inline-flex;border-radius:.5rem;overflow:hidden;border:1px solid var(--color-radio-border);background:var(--box-background-alt-color)}.radio-group2 .radio[data-v-0863ff2a]{cursor:pointer;background:transparent;padding:.5rem 1.2rem;border-left:1px solid var(--color-radio-border);font-size:1.3rem;color:var(--color-gray)}.radio-group2 .radio[data-v-0863ff2a]:first-child{border-left:none}.radio-group2 .active[data-v-0863ff2a]{background:var(--color-third-bg);color:var(--color-font)}.pop-confirm[data-v-0863ff2a]{position:relative;display:inline-flex;justify-content:center}input[data-v-0863ff2a]{height:3rem;outline:unset;border:1px solid var(--color-input-border);padding:0 .5rem;border-radius:5px;box-sizing:border-box;transition:all .3s;background:var(--color-input-bg);color:var(--color-font)}input[data-v-0863ff2a]:hover{border:1px solid var(--color-input-border-hover)}input[data-v-0863ff2a]:focus{border:1px solid var(--color-active)}.danger[data-v-0863ff2a]{color:red!important}.pop-confirm-content[data-v-0863ff2a]{position:fixed;background:var(--color-tooltip-bg);box-shadow:0 0 6px 1px var(--color-tooltip-shadow);color:var(--color-font-8);padding:1.5rem;border-radius:.8rem;transform:translate(-50%,calc(-100% - 1rem));z-index:1003}.pop-confirm-content .text[data-v-0863ff2a]{text-align:start;font-size:1.6rem;width:15rem;min-width:15rem}.pop-confirm-content .options[data-v-0863ff2a]{margin-top:1.5rem;display:flex;justify-content:flex-end;align-items:center;gap:1rem}.Post[data-v-0863ff2a]{position:unset!important;background:transparent!important;overflow:unset!important}.Post .main[data-v-0863ff2a]{background:transparent!important;padding:unset!important;width:100%!important}.Post .close-btn[data-v-0863ff2a],.Post .open-new-tab[data-v-0863ff2a]{display:none}.post-detail[data-v-0863ff2a]{text-align:start;position:fixed;z-index:1002;left:0;right:0;bottom:0;top:0;background:rgba(46,47,48,.8);overflow:auto;font-size:1.4rem;display:flex;justify-content:center;flex-wrap:wrap}.post-detail[data-v-0863ff2a] .subtle{background-color:#ecfdf5e6;border-left:4px solid #a7f3d0}.post-detail.isNight[data-v-0863ff2a] .subtle{background-color:#1a3332;border-left:4px solid #047857}.post-detail .main[data-v-0863ff2a]{display:flex;justify-content:flex-end;padding:3rem 8rem 15rem;background:var(--color-main-bg);position:relative;outline:none}.post-detail .main .main-wrapper[data-v-0863ff2a]{width:77rem;padding-bottom:2rem;display:flex;flex-direction:column;align-items:center;position:relative}.post-detail .main .main-wrapper .post-wrapper .header:hover .add-tag[data-v-0863ff2a]{display:inline-block}.post-detail .main .main-wrapper .loading-wrapper[data-v-0863ff2a]{height:20rem;display:flex;justify-content:center;align-items:center}.post-detail .main .main-wrapper #no-comments-yet[data-v-0863ff2a]{color:#a9a9a9;font-weight:700;text-align:center;width:100%;margin-bottom:2rem;box-sizing:border-box}.post-detail .main .relationReply[data-v-0863ff2a]{position:fixed;width:25vw;top:6.5rem;bottom:15rem;z-index:100;transform:translate(calc(100% + 2rem));font-size:2rem;overflow:hidden}.post-detail .main .relationReply .my-cell[data-v-0863ff2a]{background:var(--color-second-bg);border-radius:var(--box-border-radius) var(--box-border-radius) 0 0}.post-detail .main .relationReply .comments[data-v-0863ff2a]{max-height:calc(100% - 4.2rem);overflow:auto;background:var(--color-second-bg);border-radius:0 0 var(--box-border-radius) var(--box-border-radius)}.post-detail .main .call-list[data-v-0863ff2a]{z-index:9;position:absolute;top:12rem;border:1px solid var(--color-main-bg);background:var(--color-call-list-bg);box-shadow:0 5px 15px #0000001a;overflow:auto;max-height:30rem;border-radius:var(--box-border-radius);min-width:8rem;box-sizing:content-box}.post-detail .main .call-list .call-item[data-v-0863ff2a]{border-top:1px solid var(--color-main-bg);height:3rem;display:flex;padding:0 1rem;align-items:center;cursor:pointer;font-size:14px;box-sizing:border-box}.post-detail .main .call-list .call-item .select[data-v-0863ff2a],.post-detail .main .call-list .call-item[data-v-0863ff2a]:hover,.post-detail .main .call-list .call-item.select[data-v-0863ff2a]{background:var(--color-main-bg);text-decoration:none}.post-detail .main .call-list .call-item[data-v-0863ff2a]:nth-child(1){border-top:1px solid transparent}@media screen and (max-width: 1280px){.post-detail .main-wrapper[data-v-0863ff2a]{width:60vw!important}}.post-detail .scroll-top[data-v-0863ff2a]{cursor:pointer;position:fixed;border-radius:.6rem;display:flex;align-items:center;justify-content:center;bottom:10rem;z-index:99;padding:.8rem 0;gap:1rem;width:4.2rem;transform:translate(6rem);font-size:2rem;background:var(--color-sp-btn-bg);color:var(--color-font-3)}.post-detail .scroll-top svg[data-v-0863ff2a]{font-size:2.4rem}.post-detail .refresh[data-v-0863ff2a]{cursor:pointer;position:fixed;border-radius:.6rem;display:flex;align-items:center;justify-content:center;bottom:10rem;z-index:99;padding:.8rem 0;gap:1rem;width:4.2rem;transform:translate(6rem);font-size:2rem;background:var(--color-sp-btn-bg);color:var(--color-font-3);bottom:23.5rem}.post-detail .refresh svg[data-v-0863ff2a]{font-size:2.4rem}.post-detail .scroll-to[data-v-0863ff2a]{cursor:pointer;position:fixed;border-radius:.6rem;align-items:center;justify-content:center;bottom:10rem;z-index:99;padding:.8rem 0;gap:1rem;width:4.2rem;transform:translate(6rem);font-size:2rem;background:var(--color-sp-btn-bg);color:var(--color-font-3);bottom:15rem;display:flex;flex-direction:column}.post-detail .scroll-to svg[data-v-0863ff2a]{font-size:2.4rem}.post-detail .scroll-to input[data-v-0863ff2a]{height:2.6rem;width:3.6rem;font-size:1.4rem;text-align:center;color:gray}.post-detail .msg[data-v-0863ff2a]{cursor:pointer;position:fixed;border-radius:.6rem;display:flex;align-items:center;justify-content:center;bottom:10rem;z-index:99;padding:.8rem 0;gap:1rem;width:4.2rem;transform:translate(6rem);font-size:2rem;background:var(--color-sp-btn-bg);color:var(--color-font-3);bottom:5rem}.post-detail .msg svg[data-v-0863ff2a]{font-size:2.4rem}.post-detail .close-btn[data-v-0863ff2a]{color:var(--color-font-3);cursor:pointer;position:fixed;top:3rem;transform:translate(4rem);font-size:2.4rem}.post-detail .top-reply[data-v-0863ff2a]{color:var(--color-font-3);cursor:pointer;font-size:2rem;display:flex}.post-detail .open-new-tab[data-v-0863ff2a]{color:var(--color-font-3);cursor:pointer;position:fixed;top:3rem;transform:translate(4rem);font-size:2.4rem;top:8rem}.base64_tooltip[data-v-06429e70]{box-shadow:0 3px 6px -4px #0000001f,0 6px 16px #00000014,0 9px 28px 8px #0000000d;background:var(--color-third-bg);min-height:2.2rem;max-width:20rem;padding:1rem;position:fixed;z-index:9998;display:flex;align-items:center;border-radius:.5rem;cursor:pointer;line-break:anywhere;font-size:1.4rem;color:var(--color-font-8)}.base64_tooltip svg[data-v-06429e70]{margin-left:1rem;font-size:3rem;color:var(--color-gray)}.base64_tooltip[data-v-06429e70] .base-button{margin-left:1rem;margin-top:1rem}.msg[data-v-8bf692ea]{cursor:default;margin-bottom:2rem;display:flex;font-size:1.4rem;box-sizing:border-box;border-radius:var(--box-border-radius);color:var(--color-font-8);background:var(--color-tooltip-bg);box-shadow:0 0 6px 1px var(--color-tooltip-shadow)}.msg.success .left[data-v-8bf692ea]{background:var(--color-active)}.msg.warning .left[data-v-8bf692ea]{background:#c8c002}.msg.error .left[data-v-8bf692ea]{background:red}.msg .left[data-v-8bf692ea]{border-radius:var(--box-border-radius) 0 0 var(--box-border-radius);display:flex;align-items:center;background:var(--color-active);color:#fff;width:3.6rem;font-size:2.4rem;justify-content:center}.msg .left svg[data-v-8bf692ea]{cursor:pointer}.msg .right[data-v-8bf692ea]{flex:1;padding:1rem 2rem;display:flex;justify-content:space-between;align-items:center}.tag-modal[data-v-0f1f99f7]{z-index:1003}.tag-modal .wrapper[data-v-0f1f99f7]{z-index:9;background:var(--color-main-bg);color:var(--color-font-8);border-radius:1rem;font-size:1.4rem;padding:2rem 4rem;width:25rem}.tag-modal .wrapper .title[data-v-0f1f99f7]{font-weight:700}.tag-modal .wrapper .btns[data-v-0f1f99f7]{margin-top:1.5rem;display:flex;justify-content:flex-end;align-items:center;gap:1.5rem;font-size:1.4rem}.msgs[data-v-b73f4332]{position:fixed;margin-left:calc(50% - 25rem);width:50rem;z-index:9999;bottom:0;left:0;right:0}.NotificationModal .modal-root[data-v-77aa374e]{z-index:9;background:var(--color-second-bg);color:var(--color-font-8);border-radius:1rem;font-size:1.4rem;width:50vw;height:80vh;display:flex;flex-direction:column;padding:1.4rem;gap:1rem}.NotificationModal .modal-root .modal-header[data-v-77aa374e]{display:flex;justify-content:space-between}.NotificationModal .modal-root .modal-header .title[data-v-77aa374e]{font-size:2.6rem;font-weight:700;text-align:left;margin-bottom:0}.NotificationModal .modal-root .modal-header i[data-v-77aa374e]{cursor:pointer;font-size:2.2rem}.NotificationModal .modal-root .modal-body[data-v-77aa374e]{padding-top:0;flex:1;gap:1rem;display:flex;flex-direction:column;overflow:hidden}.NotificationModal .modal-root .modal-body .filter[data-v-77aa374e]{display:flex;gap:1rem}.NotificationModal .modal-root .modal-body .filter div[data-v-77aa374e]{border-radius:.4rem;padding:.4rem 1rem;background:gainsboro;cursor:pointer}.NotificationModal .modal-root .modal-body .filter div.active[data-v-77aa374e]{background:#445;color:#fff}.NotificationModal .modal-root .modal-body .list-wrap[data-v-77aa374e]{flex:1;position:relative;overflow:hidden}.NotificationModal .modal-root .modal-body .list-wrap .loading-wrap[data-v-77aa374e]{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;justify-content:center;align-items:center;background:rgba(255,255,255,.7)}.NotificationModal .modal-root .modal-body .list-wrap .notify-wrap[data-v-77aa374e]{overflow:auto;height:100%}.NotificationModal .modal-root .modal-body .list-wrap #notifications[data-v-77aa374e] .cell{display:none;padding:1.2rem 0}.NotificationModal .modal-root .modal-body .list-wrap #notifications[data-v-77aa374e] .cell a.node{padding:.6rem 1rem;border-radius:.4rem}.NotificationModal .modal-root .modal-body .list-wrap #notifications[data-v-77aa374e] .cell .payload{margin-top:.4rem;font-size:1.7rem}.NotificationModal .modal-root .modal-body #notifications.all[data-v-77aa374e] .cell,.NotificationModal .modal-root .modal-body #notifications.reply[data-v-77aa374e] .reply,.NotificationModal .modal-root .modal-body #notifications.star[data-v-77aa374e] .star,.NotificationModal .modal-root .modal-body #notifications.collect[data-v-77aa374e] .collect{display:block}.NotificationModal .modal-root .modal-body .footer[data-v-77aa374e]{width:100%;display:flex;align-items:center;gap:2rem}.NotificationModal .modal-root .modal-body .footer .pages[data-v-77aa374e]{flex:1}.NotificationModal .modal-root .modal-body .footer .total[data-v-77aa374e]{font-weight:700}.NotificationModal .modal-root .modal-body .footer .total span[data-v-77aa374e]{color:#d3d3d3;font-weight:400;margin-right:.4rem}.NotificationModal .modal-root .modal-body[data-v-77aa374e] .super.button{padding:0;background:unset;height:26px;width:37px}.NotificationModal .modal-root .modal-body[data-v-77aa374e] .super.button a{display:block}.NotificationModal .modal-root .modal-body[data-v-77aa374e] .super.button a:hover{text-decoration:none}.v-enter-active,.v-leave-active{transition:opacity .3s ease}.v-enter-from,.v-leave-to{opacity:0}.username{font-weight:700;font-size:1.4rem;margin-right:1rem}.link-num{font-size:1.2rem;font-weight:700;color:#e02a2a}.owner{display:inline-block;background-color:transparent;color:#1484cd;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid #1484cd;font-size:1.2rem;font-weight:700;margin-right:1rem;transform:scale(.8)}.mod{display:inline-block;background-color:transparent;color:#1484cd;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid #1484cd;font-size:1.2rem;font-weight:700;transform:scale(.8);background:#1484cd;color:#fff;margin-right:1rem}.my-tag{font-size:1.4rem;color:red;margin-left:1rem}.my-tag:hover .remove{display:inline}.my-tag .remove{cursor:pointer;margin-left:.5rem;display:none}.add-tag{font-size:2.4rem;transform:translateY(.2rem);line-height:1rem;display:inline-block;margin-left:1rem;cursor:pointer;position:absolute;display:none}.floor{margin-left:.5rem;font-size:1.1rem;line-height:1rem;border-radius:.5rem;display:inline-block;background-color:var(--color-floor);color:var(--color-floor-font);padding:3px 9px;cursor:default}:root{--color-main-bg: #e2e2e2;--color-second-bg: white;--color-third-bg: #e2e2e2;--color-item-bg: white;--color-swtich-bg: #dcdfe6;--color-active: #409eff;--color-font: #999;--color-font-8: rgba(0, 0, 0, .8);--color-font-3: rgba(0, 0, 0, .3);--color-font-pure: black;--color-input-bg: white;--color-input-border: #e2e2e2;--color-input-border-hover: #a3a6ad;--color-radio-border: #e2e2e2;--color-tooltip-bg: white;--color-tooltip-shadow: #bbbbbb;--color-scrollbar: #93ade3;--color-line: #e2e2e2;--color-loading-1: #00000033;--color-loading-2: #000;--color-floor: #f0f0f0;--color-floor-font: #bdbdbd;--color-editor-toolbar: #f6f7f8;--color-sp-btn-bg: #f1f1f1;--color-call-list-bg: white;--color-top-reply-wrap-bg: #f2f3f5;--color-top-reply-wrap-line: #d2d2d2}html.dark{--color-main-bg: #22303f;--color-second-bg: #18222d;--color-third-bg: #31475e;--color-item-bg: #18222d;--color-swtich-bg: #4c4d4f;--color-active: #409eff;--color-font: rgba(255, 255, 255, .5);--color-font-8: rgba(255, 255, 255, .8);--color-font-3: rgba(255, 255, 255, .3);--color-font-pure: white;--color-input-bg: #333333;--color-input-border: #6c6e72;--color-input-border-hover: #a3a6ad;--color-radio-border: #454847;--color-tooltip-bg: #31475e;--color-tooltip-shadow: #3b3b3b;--color-scrollbar: #5c5d5e;--color-line: var(--box-border-color);--color-loading-1: rgba(178, 177, 177, .2);--color-loading-2: #ffffff;--color-floor: #293b4d;--color-floor-font: rgba(255, 255, 255, .3);--color-editor-toolbar: var(--box-background-hover-color);--color-sp-btn-bg: #31475e;--color-call-list-bg: #31475e;--color-top-reply-wrap-bg: #212f3e;--color-top-reply-wrap-line: #3b536d}html,body{font-size:62.5%}.flex{display:flex;align-items:center;justify-content:space-between}.flex-end{justify-content:flex-end}.flex-center{justify-content:center}.p1{padding:1rem}.p2{padding:2rem}.p0{padding:0!important}body :is(.topic_content,.reply_content) a[href^=http]{text-underline-offset:.7ex;text-decoration:underline 1px}a{text-decoration:none;cursor:pointer}a:hover{text-decoration:underline}.tool{position:relative;display:flex;align-items:center;border-radius:.3rem;cursor:pointer;height:2.6rem;padding:0 .5rem;gap:.2rem}.tool>svg{width:1.6rem!important;height:1.6rem!important}.tool:hover{background:var(--color-third-bg)}.tool.no-hover{cursor:default}.tool.no-hover:hover{background:unset!important}.tool.disabled{cursor:not-allowed}.tool.disabled:hover{background:unset!important}.my-node{border-radius:.2rem;padding:.4rem;font-size:1rem;color:#999;background:#f5f5f5;cursor:pointer}.my-node:hover{text-decoration:none;background:#e2e2e2}.msgs{position:fixed;margin-left:calc(50% - 25rem);width:50rem;z-index:9999;bottom:0;left:0;right:0}.my-box{box-shadow:0 2px 3px #0000001a;box-shadow:#00000014 0 4px 12px;border-radius:var(--box-border-radius);background:var(--box-background-color);margin-bottom:2rem;width:100%;box-sizing:border-box;transition:background-color .3s}.my-cell{color:var(--color-font);padding:.8rem 1rem;font-size:1.4rem;line-height:150%;text-align:left;border-bottom:1px solid var(--color-line)}.modal{position:fixed;z-index:1001;width:100vw;height:100vh;left:0;top:0;display:flex;justify-content:center;align-items:center}.modal .title{font-size:2.4rem;margin-bottom:1rem;text-align:center}.modal .option{display:flex;align-items:center;padding:.6rem 0}.modal .option>span{position:relative}.modal .mask{position:fixed;width:100vw;height:100vh;left:0;top:0;background-color:#1d1c1c47}.radio-group2{display:inline-flex;border-radius:.5rem;overflow:hidden;border:1px solid var(--color-radio-border);background:var(--box-background-alt-color)}.radio-group2 .radio{cursor:pointer;background:transparent;padding:.5rem 1.2rem;border-left:1px solid var(--color-radio-border);font-size:1.3rem;color:var(--color-gray)}.radio-group2 .radio:first-child{border-left:none}.radio-group2 .active{background:var(--color-third-bg);color:var(--color-font)}.pop-confirm{position:relative;display:inline-flex;justify-content:center}input{height:3rem;outline:unset;border:1px solid var(--color-input-border);padding:0 .5rem;border-radius:5px;box-sizing:border-box;transition:all .3s;background:var(--color-input-bg);color:var(--color-font)}input:hover{border:1px solid var(--color-input-border-hover)}input:focus{border:1px solid var(--color-active)}.danger{color:red!important}.pop-confirm-content{position:fixed;background:var(--color-tooltip-bg);box-shadow:0 0 6px 1px var(--color-tooltip-shadow);color:var(--color-font-8);padding:1.5rem;border-radius:.8rem;transform:translate(-50%,calc(-100% - 1rem));z-index:1003}.pop-confirm-content .text{text-align:start;font-size:1.6rem;width:15rem;min-width:15rem}.pop-confirm-content .options{margin-top:1.5rem;display:flex;justify-content:flex-end;align-items:center;gap:1rem}.target-user-tags[data-v-d9e3ae7c]{background:var(--color-second-bg);color:var(--color-font);word-break:break-all;text-align:start;font-size:1.4rem;box-shadow:0 2px 3px #0000001a;border-bottom-left-radius:3px;border-bottom-right-radius:3px}.target-user-tags .add-tag[data-v-d9e3ae7c]{display:inline-block}.loaded[data-v-d9e3ae7c]{font-size:1.4rem;display:flex;align-items:center;gap:1rem;color:var(--color-font-pure)}.calender[data-v-d9e3ae7c]{padding:10px;font-size:14px;color:var(--link-color)}.calender .month[data-v-d9e3ae7c]{height:30px;display:flex;justify-content:space-between;align-items:center}.calender .month .ca-title[data-v-d9e3ae7c]{flex:1;display:flex;justify-content:flex-end;align-items:center;gap:10px}.calender .month i[data-v-d9e3ae7c]{height:100%;width:30px;cursor:pointer;color:#a9a9a9}.calender .calender-header[data-v-d9e3ae7c]{display:flex;height:30px;align-items:center}.calender .calender-header div[data-v-d9e3ae7c]{flex:1}.calender .days[data-v-d9e3ae7c]{display:grid;grid-template-columns:repeat(7,1fr)}.calender .days .day[data-v-d9e3ae7c]{height:30px}.calender .days .day a[data-v-d9e3ae7c]{display:inline-flex;height:100%;width:100%;justify-content:center;align-items:center}.calender .days .active[data-v-d9e3ae7c]{background:#40a9ff;border-radius:4px}.calender .days .active a[data-v-d9e3ae7c]{color:#fff!important} ');
  8660. run();
  8661. let vueApp = vue.createApp(App);
  8662. vueApp.config.unwrapInjectedRef = true;
  8663. vueApp.mount($section);
  8664. }
  8665.  
  8666. })(Vue, dayjs);