Greasy Fork is available in English.

115+

为115网盘添加一些功能

// ==UserScript==
// @name         115+
// @namespace    https://github.com/lvzhenbo/115-plus
// @version      1.2.3
// @author       lvzhenbo
// @description  为115网盘添加一些功能
// @license      MIT
// @icon         https://115.com/favicon.ico
// @supportURL   https://github.com/lvzhenbo/115-plus/issues
// @match        https://115.com/*
// @require      https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.global.prod.js
// @require      data:application/javascript,%3Bwindow.Vue%3DVue%3B
// @require      https://cdn.jsdelivr.net/npm/[email protected]/dist/index.prod.js
// @require      https://cdn.jsdelivr.net/npm/[email protected]/dist/index.min.js
// @require      https://cdn.jsdelivr.net/npm/[email protected]/dist/index.min.js
// @require      https://cdn.jsdelivr.net/npm/[email protected]/BigInteger.min.js
// @require      https://cdn.jsdelivr.net/npm/[email protected]/crypto-js.min.js
// @connect      115.com
// @connect      v.anxia.com
// @grant        GM_addStyle
// @grant        GM_cookie
// @grant        GM_getValue
// @grant        GM_openInTab
// @grant        GM_setValue
// @grant        GM_xmlhttpRequest
// ==/UserScript==

(e=>{if(typeof GM_addStyle=="function"){GM_addStyle(e);return}const r=document.createElement("style");r.textContent=e,document.head.append(r)})(' @charset "UTF-8";[data-v-83bc69cf] .n-button__content{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px}.xgplayer.not-allow-autoplay .xgplayer-controls,.xgplayer.xgplayer-nostart .xgplayer-controls,.xgplayer.xgplayer-inactive .controls-autohide{pointer-events:none;visibility:hidden;cursor:default;opacity:0}.xgplayer.not-allow-autoplay .xgplayer-controls-initshow,.xgplayer.xgplayer-nostart .xgplayer-controls-initshow{pointer-events:auto;visibility:visible;opacity:1}.xgplayer .xgplayer-controls{display:block;position:absolute;visibility:visible;height:48px;left:0;right:0;bottom:0;opacity:1;z-index:10;background-image:linear-gradient(180deg,transparent,rgba(0,0,0,.37),rgba(0,0,0,.75),rgba(0,0,0,.75));transition:opacity .5s ease,visibility .5s ease}.xgplayer .xgplayer-controls.show{display:block;opacity:1;visibility:visible;pointer-events:auto}.xgplayer .xg-inner-controls{position:absolute;height:40px;bottom:0;justify-content:space-between;display:flex}.xgplayer .xg-left-grid,.xgplayer .xg-right-grid{position:relative;display:flex;flex-wrap:wrap;flex-shrink:1;height:100%;z-index:1}.xgplayer .xg-right-grid{flex-direction:row-reverse}.xgplayer .xg-right-grid>:first-child{margin-right:0}.xgplayer .xg-right-grid xg-icon{margin-left:0}.xgplayer .xg-left-grid>:first-child{margin-left:0}.xgplayer .xg-left-grid xg-icon{margin-right:0}.xgplayer .xg-center-grid{display:block;position:absolute;left:0;right:0;outline:none;top:-20px;padding:5px 0;text-align:center}.xgplayer .flex-controls .xg-inner-controls{justify-content:space-around;display:flex;bottom:8px}.xgplayer .flex-controls .xg-center-grid{display:flex;flex:1;position:relative;top:0;height:100%;justify-content:space-between;align-items:center;left:0;right:0;padding:0 16px}.xgplayer.xgplayer-mobile .xg-center-grid{z-index:2}.xgplayer.xgplayer-mobile .flex-controls .xg-center-grid{padding:0 8px}.xgplayer .bottom-controls .xg-center-grid{top:20px;padding:0}.xgplayer .bottom-controls .xg-left-grid,.xgplayer .bottom-controls .xg-right-grid{bottom:10px}.xgplayer .mini-controls{background-image:none}.xgplayer .mini-controls .xg-inner-controls{bottom:0;left:0;right:0}.xgplayer .mini-controls .xg-center-grid{bottom:-28px;top:auto;padding:0}.xgplayer .mini-controls .xg-left-grid,.xgplayer .mini-controls .xg-right-grid{display:none}.xgplayer .controls-follow{bottom:70px;transition:bottom .3s ease}.xgplayer.flex-controls .controls-follow{bottom:45px}.xgplayer.xgplayer-inactive .controls-follow,.xgplayer.no-controls .controls-follow,.xgplayer.mini-controls .controls-follow{bottom:10px}.xgplayer-fullscreen-parent{position:fixed;left:0;top:0;width:100%;height:100%;z-index:9999}.xgplayer-fullscreen-parent .xgplayer.xgplayer-is-cssfullscreen,.xgplayer-fullscreen-parent .xgplayer.xgplayer-is-fullscreen{z-index:10;position:absolute}.xgplayer-rotate-parent{position:fixed;top:0;left:100%;bottom:0;right:0;width:100vh;height:100vw;z-index:9999;transform-origin:top left;transform:rotate(90deg)}.xgplayer-rotate-parent .xgplayer.xgplayer-rotate-fullscreen{position:absolute;top:0;left:0;z-index:10;margin:0;padding:0;width:100%;height:100%;transform:rotate(0)}.xgplayer-rotate-parent .xgplayer-mobile video{z-index:-1}.xgplayer{position:relative;width:100%;height:100%;overflow:hidden;font-family:PingFang SC,Helvetica Neue,Helvetica,STHeiTi,Microsoft YaHei,WenQuanYi Micro Hei,sans-serif;font-size:14px;font-weight:400;background:#000;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer}.xgplayer *{margin:0;padding:0;border:0;vertical-align:baseline;white-space:normal;word-wrap:normal;overflow-wrap:normal}.xgplayer ul,.xgplayer li{list-style:none}.xgplayer .xgplayer-none{display:none}.xgplayer.xgplayer-is-fullscreen{position:fixed;top:0;left:0;width:100%;height:100%;margin:0;padding:0;z-index:9999}.xgplayer.xgplayer-is-cssfullscreen{position:fixed;left:0;top:0;width:100%;height:100%;z-index:9999}.xgplayer.xgplayer-rotate-fullscreen{position:fixed;top:0;left:100%;bottom:0;right:0;width:100vh;height:100vw;transform-origin:top left;transform:rotate(90deg);z-index:9999}.xgplayer.xgplayer-rotate-fullscreen.xgplayer-mobile video{z-index:-1}.xgplayer xg-video-container.xg-video-container{position:absolute;top:0;bottom:48px;display:block;width:100%}.xgplayer video{position:absolute;top:0;left:0;width:100%;height:100%;outline:none}.xgplayer[data-xgfill=contain] video{-o-object-fit:contain;object-fit:contain}.xgplayer[data-xgfill=cover] video{-o-object-fit:cover;object-fit:cover}.xgplayer[data-xgfill=fill] video{-o-object-fit:fill;object-fit:fill}.xgplayer .xg-pos{left:10px;right:10px}.xgplayer .xg-margin{margin-left:16px;margin-right:16px}.xgplayer .xg-bottom{bottom:0}.xgplayer .btn-text{position:relative;top:50%;height:24px;font-size:13px;text-align:center}.xgplayer .btn-text span{display:inline-block;min-width:52px;height:24px;line-height:24px;background:#00000061;border-radius:12px}.xgplayer xg-icon{position:relative;box-sizing:border-box;height:40px;margin-left:16px;margin-right:16px;cursor:pointer;color:#fffc;fill:#fff}.xgplayer xg-icon.xg-icon-disable{cursor:not-allowed}.xgplayer xg-icon .xg-tips{top:-30px;left:50%;transform:translate(-50%)}.xgplayer xg-icon:active .xg-tips,.xgplayer xg-icon:hover .xg-tips{display:block}.xgplayer xg-icon:active .xg-tips.hide,.xgplayer xg-icon:hover .xg-tips.hide{display:none}.xgplayer xg-icon .xgplayer-icon{position:relative;top:50%;transform:translateY(-50%);cursor:pointer}.xgplayer xg-icon .xg-icon-disable{cursor:not-allowed}.xgplayer xg-icon .xg-img{width:100%}.xgplayer xg-icon svg,.xgplayer xg-icon img{height:100%;display:block}.xgplayer xg-bar{display:block}.xgplayer.xgplayer-inactive xg-bar,.xgplayer.xgplayer-mini xg-bar{display:none}.xgplayer.xgplayer-inactive .xg-top-bar{display:flex}.xgplayer.xgplayer-inactive .xg-top-bar.top-bar-autohide{display:none}.xgplayer .xg-top-bar{position:absolute;z-index:10;top:0;padding:0 16px;display:flex;height:50px}.xgplayer .xg-top-bar xg-icon{position:relative;top:10px;left:0;width:34px;margin-top:0}.xgplayer .xg-top-bar xg-icon:first-child{margin-left:0}.xgplayer .xg-left-bar,.xgplayer .xg-right-bar{position:absolute;z-index:9;top:50px;bottom:50px;width:50px}.xgplayer .xg-left-bar{left:0}.xgplayer .xg-right-bar{right:0}.xgplayer .xg-tips{display:none;position:absolute;padding:4px 6px;background:#0000008a;border-radius:4px;font-size:12px;color:#fff;text-align:center;white-space:nowrap;opacity:.85}.xgplayer .xg-margin{left:0;right:0}.xgplayer-mobile{-webkit-tap-highlight-color:rgba(0,0,0,0)}.xgplayer-mobile *{text-decoration:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.xgplayer-mobile.xgplayer-rotate-fullscreen .xg-top-bar,.xgplayer-mobile.xgplayer-rotate-fullscreen .xg-pos{left:6%;right:6%}.xgplayer-mobile xg-icon:hover .xg-tips{display:none}.xg-list-slide-scroll::-webkit-scrollbar-track{background-color:transparent;display:none}.xg-list-slide-scroll:hover::-webkit-scrollbar-track{display:block}.xg-list-slide-scroll::-webkit-scrollbar{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:#0000;height:4px;width:4px}.xg-list-slide-scroll::-webkit-scrollbar-corner{background:transparent;display:none}.xg-list-slide-scroll::-webkit-scrollbar-thumb{background:#ffffff80;border-radius:3px;display:none;width:4px}.xg-list-slide-scroll:hover::-webkit-scrollbar-thumb{display:block}@media only screen and (max-width: 480px){.xgplayer-mobile xg-icon{margin-right:10px;margin-left:10px}.xgplayer-mobile .xg-top-bar{left:10px;right:10px}}@media screen and (orientation: portrait){.xgplayer-mobile.xgplayer-is-fullscreen .xgplayer-controls,.xgplayer-mobile.xgplayer-is-cssfullscreen .xgplayer-controls{bottom:34px;bottom:constant(safe-area-inset-bottom);bottom:env(safe-area-inset-bottom)}.xgplayer-mobile.xgplayer-is-fullscreen .xg-top-bar,.xgplayer-mobile.xgplayer-is-cssfullscreen .xg-top-bar{top:34px;top:constant(safe-area-inset-top);top:env(safe-area-inset-top)}}@media only screen and (orientation: landscape){.xgplayer-mobile.xgplayer-is-fullscreen .xg-top-bar,.xgplayer-mobile.xgplayer-is-fullscreen .xg-pos{left:6%;right:6%}.xgplayer-mobile.xgplayer-rotate-fullscreen{left:0;width:100vw;height:100vh;transform:rotate(0)}}.xgplayer .xgplayer-screen-container{display:block;width:100%}.xgplayer .xg-options-icon{display:none;cursor:pointer}.xgplayer .xg-options-icon.show{display:block}@keyframes xg_right_options_active{0%{transform:translate(50%)}to{transform:translate(-50%)}}@keyframes xg_right_options_hide{0%{transform:translate(-50%)}to{transform:translate(50%)}}@keyframes xg_left_options_active{0%{transform:translate(-50%)}to{transform:translate(50%)}}@keyframes xg_left_options_hide{0%{transform:translate(50%)}to{transform:translate(-50%)}}.xgplayer .xg-options-list{display:none;position:absolute;z-index:5;width:78px;right:50%;bottom:100%;background:#0000008a;border-radius:1px;transform:translate(50%);cursor:pointer;overflow:auto;height:0;opacity:.85;font-size:14px;color:#fffc}.xgplayer .xg-options-list li{height:20px;line-height:20px;position:relative;padding:4px 0;text-align:center;color:#fffc}.xgplayer .xg-options-list li:hover,.xgplayer .xg-options-list li.selected{color:red;opacity:1}.xgplayer .xg-options-list li:nth-child(1){position:relative;margin-top:12px}.xgplayer .xg-options-list li:last-child{position:relative;margin-bottom:12px}.xgplayer .xg-options-list:hover{opacity:1}.xgplayer .xg-options-list.active{display:block;height:auto}.xgplayer .xg-options-list.xg-side-list{width:20%;height:100%;bottom:0;background:#000000e6;display:flex;flex-direction:column;box-sizing:border-box}.xgplayer .xg-options-list.xg-side-list li{flex:1;width:100%;padding:0;position:relative}.xgplayer .xg-options-list.xg-side-list li span{display:block;position:relative;top:50%;transform:translateY(-50%);pointer-events:none}.xgplayer .xg-options-list.xg-side-list li:nth-child(1){margin-top:20px}.xgplayer .xg-options-list.xg-side-list li:last-child{margin-bottom:20px}.xgplayer .xg-options-list.xg-right-side{right:-10.5%}.xgplayer .xg-options-list.xg-right-side.active{height:100%;animation:xg_right_options_active .2s ease-out forwards}.xgplayer .xg-options-list.xg-right-side.hide{height:100%;animation:xg_right_options_hide .2s ease-in forwards}.xgplayer .xg-options-list.xg-left-side{left:-10.5%;transform:translate(-50%)}.xgplayer .xg-options-list.xg-left-side.active{height:100%;animation:xg_left_options_active .2s ease-out forwards}.xgplayer .xg-options-list.xg-left-side.hide{height:100%;animation:xg_left_options_hide .2s ease-in forwards}@media only screen and (max-width: 480px){.xgplayer-mobile .xg-options-icon.portrait{display:none}.xgplayer-mobile .xg-options-list li:hover{color:#fffc}.xgplayer-mobile .xg-options-list li.selected{color:red}}.xgplayer-replay{display:none}.xgplayer .xgplayer-replay{display:none;position:absolute;left:50%;top:50%;width:100px;height:100px;justify-content:center;align-items:center;flex-direction:column;z-index:5;transform:translate(-50%,-50%);cursor:pointer}.xgplayer .xgplayer-replay .xgplayer-replay-txt{display:inline-block;font-size:14px;color:#fff;line-height:34px;text-align:center}.xgplayer.xgplayer-mobile .xgplayer-replay-svg{width:50px;height:50px}.xgplayer.xgplayer-mobile .xgplayer-replay-txt{line-height:24px;font-size:12px}.xgplayer .xgplayer-poster{display:block;opacity:1;visibility:visible;position:absolute;left:0;top:0;width:100%;height:100%;background-position:center center;background-size:100% auto;background-repeat:no-repeat;transition:opacity .3s ease,visibility .3s ease;pointer-events:none}.xgplayer .xgplayer-poster.hide,.xgplayer.xgplayer-playing .xgplayer-poster{opacity:0;visibility:hidden}.xgplayer.xgplayer-playing .xg-not-hidden,.xgplayer.xgplayer-is-enter .xgplayer-poster.xg-showplay,.xgplayer.xgplayer-playing .xgplayer-poster.xg-showplay,.xgplayer.xgplayer-nostart .xgplayer-poster,.xgplayer.xgplayer-ended .xgplayer-poster,.xgplayer.not-allow-autoplay .xgplayer-poster{opacity:1;visibility:visible}.xgplayer.xgplayer-nostart .xgplayer-poster.hide,.xgplayer.xgplayer-ended .xgplayer-poster.hide,.xgplayer.not-allow-autoplay .xgplayer-poster.hide{opacity:0;visibility:hidden}@keyframes playPause{0%{transform:scale(1);opacity:1}99%{transform:scale(1.3);opacity:0}to{transform:scale(1);opacity:0}}.xgplayer xg-start-inner{display:block;width:100%;height:100%;overflow:hidden;border-radius:50%;background:#00000061}.xgplayer .xgplayer-start{width:70px;height:70px;position:absolute;left:50%;top:50%;z-index:5;transform:translate(-50%,-50%);cursor:pointer}.xgplayer .xgplayer-start svg{width:100%;height:100%}.xgplayer .xgplayer-start.hide,.xgplayer .xgplayer-start.focus-hide{display:none;pointer-events:none}.xgplayer .xgplayer-start:hover{opacity:.85}.xgplayer .xgplayer-start .xg-icon-play{display:block}.xgplayer .xgplayer-start .xg-icon-pause,.xgplayer .xgplayer-start[data-state=pause] .xg-icon-play{display:none}.xgplayer .xgplayer-start[data-state=pause] .xg-icon-pause,.xgplayer .xgplayer-start.interact{display:block}.xgplayer .xgplayer-start.interact xg-start-inner{animation:playPause .4s .1s ease-out forwards}.xgplayer .xgplayer-start.show{display:block}.xgplayer.xgplayer-mobile xg-start-inner{background:initial;border-radius:0}.xgplayer.xgplayer-mobile .xgplayer-start{height:50px;width:50px}.xgplayer.xgplayer-mobile .xgplayer-start:hover{opacity:1}.xgplayer.xgplayer-inactive .xgplayer-start.auto-hide,.xgplayer.xgplayer-is-enter .xgplayer-start.auto-hide,.xgplayer.xgplayer-isloading.xgplayer-playing .xgplayer-start,.xgplayer.xgplayer-is-enter .xgplayer-start,.xgplayer.xgplayer-is-error .xgplayer-start,.xgplayer.xgplayer-is-enter .xgplayer-start.show,.xgplayer.xgplayer-is-error .xgplayer-start.show{display:none}.xgplayer-enter{display:none;position:absolute;left:0;top:0;width:100%;height:100%;background:#000c;z-index:5;pointer-events:none}.xgplayer-enter .show{display:block}.xgplayer-enter .xgplayer-enter-spinner{display:block;position:absolute;z-index:1;left:50%;top:50%;height:100px;width:100px;transform:translate(-50%,-50%)}.xgplayer-enter .xgplayer-enter-spinner div{width:6%;height:13%;background-color:#ffffffb3;position:absolute;left:45%;top:45%;opacity:0;border-radius:30px;animation:fade 1s linear infinite}.xgplayer-enter .xgplayer-enter-spinner div.xgplayer-enter-bar1{transform:rotate(0) translateY(-140%);animation-delay:-0s}.xgplayer-enter .xgplayer-enter-spinner div.xgplayer-enter-bar2{transform:rotate(30deg) translateY(-140%);animation-delay:-.9163s}.xgplayer-enter .xgplayer-enter-spinner div.xgplayer-enter-bar3{transform:rotate(60deg) translateY(-140%);animation-delay:-.833s}.xgplayer-enter .xgplayer-enter-spinner div.xgplayer-enter-bar4{transform:rotate(90deg) translateY(-140%);animation-delay:-.7497s}.xgplayer-enter .xgplayer-enter-spinner div.xgplayer-enter-bar5{transform:rotate(120deg) translateY(-140%);animation-delay:-.6664s}.xgplayer-enter .xgplayer-enter-spinner div.xgplayer-enter-bar6{transform:rotate(150deg) translateY(-140%);animation-delay:-.5831s}.xgplayer-enter .xgplayer-enter-spinner div.xgplayer-enter-bar7{transform:rotate(180deg) translateY(-140%);animation-delay:-.4998s}.xgplayer-enter .xgplayer-enter-spinner div.xgplayer-enter-bar8{transform:rotate(210deg) translateY(-140%);animation-delay:-.4165s}.xgplayer-enter .xgplayer-enter-spinner div.xgplayer-enter-bar9{transform:rotate(240deg) translateY(-140%);animation-delay:-.3332s}.xgplayer-enter .xgplayer-enter-spinner div.xgplayer-enter-bar10{transform:rotate(270deg) translateY(-140%);animation-delay:-.2499s}.xgplayer-enter .xgplayer-enter-spinner div.xgplayer-enter-bar11{transform:rotate(300deg) translateY(-140%);animation-delay:-.1666s}.xgplayer-enter .xgplayer-enter-spinner div.xgplayer-enter-bar12{transform:rotate(330deg) translateY(-142%);animation-delay:-.0833s}@keyframes fade{0%{opacity:1}to{opacity:.25}}.xgplayer.xgplayer-is-enter .xgplayer-enter{display:block;opacity:1;transition:opacity .3s}.xgplayer.xgplayer-nostart .xgplayer-enter{display:none}.xgplayer.xgplayer-mobile .xgplayer-enter .xgplayer-enter-spinner{width:70px;height:70px}.xg-mini-layer{display:none;position:absolute;top:0;left:0;width:100%;height:100%;z-index:11;background:linear-gradient(180deg,#393939e6,#39393900 50.27%)}.xg-mini-layer .mask{pointer-events:none;position:absolute;top:0;left:0;height:100%;width:100%;background-color:#0006}.xg-mini-layer xg-mini-header{display:flex;top:0;left:0;right:40px;box-sizing:border-box;padding:10px 3px 0 8px;justify-content:space-between;color:#fff;font-size:14px;position:absolute;z-index:22}.xg-mini-layer xg-mini-header .xgplayer-pip-disableBtn{pointer-events:all}.xg-mini-layer xg-mini-header #disabledMini{display:none;position:relative}.xg-mini-layer xg-mini-header #disabledMini+label{cursor:pointer;position:relative;display:flex;align-items:center}.xg-mini-layer xg-mini-header #disabledMini+label:before{content:"";color:#ff142b;background-color:transparent;border-radius:2px;border:solid 1px #cdcdcd;width:16px;height:16px;display:inline-block;text-align:center;vertical-align:middle;line-height:16px;margin-right:7px}.xg-mini-layer xg-mini-header #disabledMini:checked+label{color:#ff142b}.xg-mini-layer xg-mini-header #disabledMini:checked+label:before{border-color:#ff142b}.xg-mini-layer xg-mini-header #disabledMini:checked+label:after{content:"";position:absolute;width:4px;height:8px;border-color:#ff142b;border-style:solid;border-width:0px 2px 2px 0px;transform:rotate(45deg);left:6px;top:5px}.xg-mini-layer xg-mini-header .xgplayer-mini-disableBtn xg-tips{position:absolute;padding:4px 6px;white-space:nowrap;bottom:-30px;right:15px;border-radius:4px;background-color:#0000008a;display:none}.xg-mini-layer xg-mini-header .xgplayer-mini-disableBtn:hover #disabledMini+label:before{border-color:#ff142b}.xg-mini-layer xg-mini-header .xgplayer-mini-disableBtn:hover #disabledMini+label{color:#ff142b}.xg-mini-layer xg-mini-header .xgplayer-mini-disableBtn:hover xg-tips{display:block}.xg-mini-layer .mini-cancel-btn{cursor:pointer;display:block;color:#fff;width:40px;height:38px;position:absolute;right:0;top:0;text-align:center;line-height:38px}.xg-mini-layer .play-icon{cursor:pointer;height:48px;width:48px;position:absolute;background:#0000008a;border-radius:24px;top:50%;left:50%;margin:-24px 0 0 -24px}.xg-mini-layer .play-icon svg,.xg-mini-layer .play-icon img{width:50px;height:50px;fill:#faf7f7}.xg-mini-layer .xg-icon-play{display:none}.xg-mini-layer .xg-icon-pause,.xg-mini-layer[data-state=pause] .xg-icon-play{display:block}.xg-mini-layer[data-state=pause] .xg-icon-pause{display:none}.xgplayer-miniicon{position:relative;outline:none;display:block}.xgplayer-miniicon .name{text-align:center;font-size:13px;line-height:20px;height:20px;color:#fffc;line-height:40px}.xgplayer-miniicon .name span{font-size:13px;width:60px;height:20px;line-height:20px;background:#00000061;border-radius:10px;display:inline-block;vertical-align:middle}.xgplayer-mini{position:fixed;width:320px;height:180px;z-index:91;box-shadow:0 4px 7px 2px #0003}.xgplayer-mini:hover{cursor:move}.xgplayer-mini:hover .xg-mini-layer{display:block}.xgplayer-mini.xgplayer-ended .xg-mini-layer{display:none}.xgplayer-mobile .xg-mini-layer .play-icon{background:none;border-radius:initial}.xgplayer.xgplayer-inactive{cursor:none}.xgplayer xg-thumbnail{display:block}.xgplayer xg-trigger{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:absolute;top:0;left:0;height:100%;width:100%}.xgplayer xg-trigger .time-preview{display:none;position:absolute;width:200px;margin:0 auto;padding:0 20px 30px;top:50%;left:50%;transform:translate(-50%,-50%);color:#fff;text-shadow:0 0 1px rgba(0,0,0,.54);font-size:18px;text-align:center;pointer-events:none}.xgplayer xg-trigger .time-preview span{line-height:24px}.xgplayer xg-trigger .time-preview .xg-cur{color:red}.xgplayer xg-trigger .time-preview .xg-separator{font-size:14px}.xgplayer xg-trigger .time-preview .xg-seek-show{transform:translate(-10px)}.xgplayer xg-trigger .time-preview .xg-seek-show.xg-back .xg-seek-pre{transform:rotate(180deg) translate(-5px)}.xgplayer xg-trigger .time-preview .xg-seek-show.hide-seek-icon .xg-seek-icon{display:none}.xgplayer xg-trigger .time-preview .xg-bar{width:96px;height:2px;margin:8px auto 0;border-radius:10px;box-sizing:content-box;background:#ffffff4d}.xgplayer xg-trigger .time-preview .xg-bar .xg-curbar{width:0;height:100%;background-color:red}.xgplayer xg-trigger .time-preview .xg-bar.hide{display:none}.xgplayer xg-trigger .mobile-thumbnail{position:relative;left:50%;transform:translate(-50%)}.xgplayer xg-trigger .xg-top-note{position:absolute;height:32px;width:135px;top:26px;left:50%;margin-left:-78px;background:#0000004d;border-radius:100px;color:#fff}.xgplayer xg-trigger .xg-top-note span{display:block;line-height:32px;height:32px;font-size:13px;text-align:center}.xgplayer xg-trigger .xg-top-note i{color:red;margin:0 5px}.xgplayer xg-trigger .xg-playbackrate{display:none}.xgplayer xg-trigger[data-xg-action=seeking] .time-preview{display:block}.xgplayer xg-trigger[data-xg-action=playbackrate] .xg-playbackrate{display:block}.xgplayer .gradient{display:none;position:absolute;top:0;left:0;height:100%;width:100%;pointer-events:none;background-image:linear-gradient(#0009,#0000005c 20%,#0000 36%,#0000 70%,#0000003d 77%,#0000005c 83%,#0009)}.xgplayer .gradient.top{background-image:linear-gradient(#0009,#0000005c 20%,#0000 36%,#0000 70%)}.xgplayer .gradient.bottom{background-image:linear-gradient(#0000 70%,#0000003d 77%,#0000005c 83%,#0009)}.xgplayer .gradient.none,.xgplayer-mobile .xgplayer-controls{background-image:initial}.xgplayer-mobile.xgplayer-playing .gradient{display:block}.xgplayer-mobile.xgplayer-inactive .gradient{background-image:initial}.xgplayer-mobile .xgmask{position:absolute;height:100%;z-index:10;top:0;left:0;width:100%;pointer-events:none;background-color:#0000}@media (prefers-color-scheme: dark){.xgplayer-mobile xg-trigger .time-preview{color:#fff}.xgplayer-mobile xg-trigger .time-preview span.xg-cur{color:red}.xgplayer-mobile xg-trigger .time-preview .xg-bar{background-color:#ffffff4d}.xgplayer-mobile xg-trigger .time-preview .xg-bar.xg-curbar{background-color:red}}@keyframes loadingRotate{0%{transform:rotate(0)}25%{transform:rotate(90deg)}50%{transform:rotate(180deg)}75%{transform:rotate(270deg)}to{transform:rotate(360deg)}}@keyframes loadingDashOffset{0%{stroke-dashoffset:236}to{stroke-dashoffset:0}}xg-loading-inner{display:block;height:100%;width:100%;transform-origin:center;animation:loadingRotate 1s .1s linear infinite}.xgplayer-loading{display:none;width:70px;height:70px;overflow:hidden;position:absolute;z-index:10;left:50%;top:50%;transform:translate(-50%,-50%);pointer-events:none}.xgplayer-loading svg,.xgplayer-loading img{width:100%;height:100%}.xgplayer-mobile .xgplayer-loading{width:50px;height:50px}.xgplayer-isloading .xgplayer-loading{display:block}.xgplayer-nostart .xgplayer-loading,.xgplayer-pause .xgplayer-loading,.xgplayer-is-enter .xgplayer-loading,.xgplayer-is-ended .xgplayer-loading,.xgplayer-is-error .xgplayer-loading{display:none}.xgplayer .xgplayer-progress{display:flex;align-items:center;position:relative;min-width:10px;height:20px;left:0;right:0;top:0;outline:none;flex:1;cursor:pointer}.xgplayer .xgplayer-progress-outer{position:relative;width:100%;height:2px;border-radius:3px;cursor:pointer}.xgplayer .progress-list{display:flex;height:100%;width:100%;border-radius:inherit}.xgplayer .xgplayer-progress-inner{position:relative;flex:1;height:100%;background:#ffffff4d;transition:height .2s ease-in,opacity .2s ease-out;border-radius:inherit;margin-right:2px;pointer-events:none}.xgplayer .xgplayer-progress-inner:last-child,.xgplayer .xgplayer-progress-inner:only-child{margin-right:0}.xgplayer .inner-focus-point{background:#fff;position:relative}.xgplayer .inner-focus-point:before,.xgplayer .inner-focus-point:after{position:absolute;content:" ";display:block;width:2px;height:300%;top:50%;z-index:1;transform:translateY(-50%);border-radius:3px;background:#fff}.xgplayer .inner-focus-point:before{left:0}.xgplayer .inner-focus-point:after{right:0}.xgplayer .xgplayer-progress-cache,.xgplayer .xgplayer-progress-played{display:block;height:100%;width:0;position:absolute;top:0;left:0;border-radius:inherit}.xgplayer .xgplayer-progress-played{background:linear-gradient(-90deg,#fa1f41,#e31106)}.xgplayer .xgplayer-progress-cache{background:#ffffff80}.xgplayer .xgplayer-progress-btn{display:block;background:#ff5e5e4e;border:.5px solid rgba(255,94,94,.056545);box-shadow:0 0 1px #ff000062;width:20px;height:20px;border-radius:30px;left:0;top:50%;position:absolute;z-index:1;transform:translate(-50%,-50%);box-sizing:border-box;pointer-events:none}.xgplayer .xgplayer-progress-btn:before{content:" ";display:block;position:relative;width:12px;height:12px;left:50%;top:50%;transform:translate(-50%,-50%);border-radius:30px;background:#fff}.xgplayer .xgplayer-progress-btn.active{border:4px solid rgba(255,94,94,.064057)}.xgplayer .xgplayer-progress-btn.active:before{box-shadow:0 0 3px #f85959b0}.xgplayer .xgplayer-progress-dot{display:inline-block;position:absolute;height:100%;width:5px;top:0;background:#fff;border-radius:6px;z-index:16}.xgplayer .xgplayer-progress-dot .xgplayer-progress-tip{position:absolute;left:25%;top:-40px;height:auto;line-height:30px;width:auto;transform:scale(.8) translate(-50%);background:#0000004d;border-radius:6px;border:1px solid rgba(0,0,0,.8);cursor:default;white-space:nowrap;display:none}.xgplayer .xgplayer-progress-dot:hover .xgplayer-progress-tip{display:block}.xgplayer .flex-controls .xgplayer-progress{transform:translateY(0)}.xgplayer.xgplayer-pc .xgplayer-progress-btn{transform:translate(-50%,-50%) scale(0)}.xgplayer.xgplayer-pc .xgplayer-progress-outer{height:3px}.xgplayer.xgplayer-pc .xgplayer-progress-inner{margin-right:4px}.xgplayer.xgplayer-pc .xgplayer-progress-inner:last-child,.xgplayer.xgplayer-pc .xgplayer-progress-inner:only-child{margin-right:0}.xgplayer.xgplayer-pc .inner-focus-point:before,.xgplayer.xgplayer-pc .inner-focus-point:after{width:3px}.xgplayer.xgplayer-pc .inner-focus-highlight{background:#fffc}.xgplayer.xgplayer-pc .xgplayer-progress.active .xgplayer-progress-outer{height:6px;margin-bottom:3px;transition:height .3s ease,margin-bottom .3s ease}.xgplayer.xgplayer-pc .xgplayer-progress.active .xgplayer-progress-btn{transform:translate(-50%,-50%) scale(1)}.xgplayer.xgplayer-pc .xgplayer-progress.active .inner-focus-point:before,.xgplayer.xgplayer-pc .xgplayer-progress.active .inner-focus-point:after{width:6px}.xgplayer .xgplayer-progress-bottom .xgplayer-progress-outer{top:9px}.xgplayer .xgplayer-progress-bottom .xgplayer-progress-btn:before{height:6px;width:6px}.xgplayer.xgplayer-mobile .xgplayer-progress-bottom .xgplayer-progress-outer{height:4px}@media (prefers-color-scheme: dark){.xgplayer .xgplayer-progress .xgplayer-progress-inner{background-color:#ffffff4d}.xgplayer .xgplayer-progress .inner-focus-highlight{background:#fffc}.xgplayer .xgplayer-progress .xgplayer-progress-btn{background:#ff5e5e4e;border:.5px solid rgba(255,94,94,.056545);box-shadow:0 0 1px #ff000062}.xgplayer .xgplayer-progress .xgplayer-progress-btn:before{background-color:#fff}.xgplayer .xgplayer-progress .xgplayer-progress-played{background-color:linear-gradient(-90deg,#FA1F41 0%,#E31106 100%)}.xgplayer .xgplayer-progress .xgplayer-progress-cache{background-color:#ffffff80}}.xg-mini-progress{display:none;position:absolute;height:2px;left:0;right:0;bottom:0;pointer-events:none}.xg-mini-progress xg-mini-progress-played,.xg-mini-progress xg-mini-progress-cache{height:100%;width:0;position:absolute;top:0;left:0;border-radius:inherit}.xg-mini-progress xg-mini-progress-played{background:linear-gradient(-90deg,#fa1f41,#e31106)}.xg-mini-progress xg-mini-progress-cache{background:#ffffff80}.xg-mini-progress-show,.xgplayer-inactive .xg-mini-progress,.xgplayer-mini .xg-mini-progress{display:block}.xgplayer .xgplayer-play .xg-icon-play{display:none}.xgplayer .xgplayer-play .xg-icon-pause,.xgplayer .xgplayer-play[data-state=pause] .xg-icon-play{display:block}.xgplayer .xgplayer-play[data-state=pause] .xg-icon-pause,.xgplayer .xgplayer-fullscreen .xg-exit-fullscreen{display:none}.xgplayer .xgplayer-fullscreen .xg-get-fullscreen,.xgplayer .xgplayer-fullscreen[data-state=full] .xg-exit-fullscreen{display:block}.xgplayer .xgplayer-fullscreen[data-state=full] .xg-get-fullscreen{display:none}.xgplayer .xg-top-bar .xgplayer-back{position:relative;left:0;top:16px;width:34px;height:40px;display:none}.xgplayer .xg-top-bar .xgplayer-back.show{display:block}.xgplayer .xgplayer-time{pointer-events:none;min-width:40px;font-size:14px;font-family:PingFangSC-Semibold;color:#fff;text-align:center;display:inline-block;line-height:40px}.xgplayer .xgplayer-time span{display:inline-block;line-height:40px;height:40px}.xgplayer .xgplayer-time span .time-min-width{text-align:center;min-width:2ch}.xgplayer .xgplayer-time span .time-min-width:first-child{text-align:right}.xgplayer .xgplayer-time span .time-min-width:last-child{text-align:left}.xgplayer .xgplayer-time .time-duration{color:#ffffff80}.xgplayer .xgplayer-time .time-live-tag{display:none}.xgplayer .xgplayer-time.xg-time-left{margin-left:0}.xgplayer .xgplayer-time.xg-time-right{margin-right:0}.xgplayer.xgplayer-mobile .xgplayer-time{min-width:30px;font-size:12px}.xgplayer.xgplayer-mobile .xgplayer-time.xg-time-left{margin-right:8px}.xgplayer.xgplayer-mobile .xgplayer-time.xg-time-right{margin-left:8px}.xgplayer .xgplayer-volume.slide-show .xgplayer-slider{display:block}.xgplayer .xgplayer-slider{display:none;position:absolute;width:28px;height:92px;background:#0000008a;border-radius:1px;bottom:40px;outline:none}.xgplayer .xgplayer-slider:after{content:" ";display:block;height:15px;width:28px;position:absolute;bottom:-15px;left:0;z-index:20;cursor:initial}.xgplayer .xgplayer-value-label{position:absolute;left:0;right:0;bottom:100%;padding:5px 0 0;font-size:12px;background-color:#0000008a;color:#fff;text-align:center}.xgplayer .xgplayer-bar,.xgplayer .xgplayer-drag{display:block;position:absolute;bottom:6px;left:12px;background:#ffffff4d;border-radius:100px;width:4px;height:76px;outline:none;cursor:pointer}.xgplayer .xgplayer-drag{bottom:0;left:0;background:#fa1f41;max-height:76px}.xgplayer .xgplayer-drag:after{content:" ";display:inline-block;width:8px;height:8px;background:#fff;box-shadow:0 0 5px #00000042;position:absolute;border-radius:50%;left:-2px;top:-4px}.xgplayer .xgplayer-volume[data-state=normal] .xg-volume{display:block}.xgplayer .xgplayer-volume[data-state=normal] .xg-volume-small,.xgplayer .xgplayer-volume[data-state=normal] .xg-volume-mute,.xgplayer .xgplayer-volume[data-state=small] .xg-volume{display:none}.xgplayer .xgplayer-volume[data-state=small] .xg-volume-small{display:block}.xgplayer .xgplayer-volume[data-state=small] .xg-volume-mute,.xgplayer .xgplayer-volume[data-state=mute] .xg-volume,.xgplayer .xgplayer-volume[data-state=mute] .xg-volume-small{display:none}.xgplayer .xgplayer-volume[data-state=mute] .xg-volume-mute{display:block}.xgplayer.xgplayer-mobile .xgplayer-volume .xgplayer-slider,.xgplayer .xgplayer-pip .xg-exit-pip{display:none}.xgplayer .xgplayer-pip .xg-get-pip,.xgplayer .xgplayer-pip[data-state=pip] .xg-exit-pip{display:block}.xgplayer .xgplayer-pip[data-state=pip] .xg-get-pip{display:none}.xgplayer .xgplayer-playnext{position:relative;display:none;cursor:pointer}.xgplayer .xgplayer-playnext .xgplayer-tips .xgplayer-tip-playnext{display:block}.xgplayer .xgplayer-playnext:hover{opacity:.85}.xgplayer .xgplayer-playnext:hover .xgplayer-tips{display:block}.lang-is-en .xgplayer-playnext .xgplayer-tips{margin-left:-25px}.lang-is-jp .xgplayer-playnext .xgplayer-tips{margin-left:-38px}.xgplayer .xgplayer-download{position:relative;display:block;cursor:pointer}.lang-is-en .xgplayer-download .xgplayer-tips{margin-left:-32px}.lang-is-jp .xgplayer-download .xgplayer-tips{margin-left:-40px}.xgplayer .xgplayer-shot{display:none}.xgplayer-definition{display:none;cursor:pointer}.xgplayer .xgplayer-playbackrate{display:none;cursor:default}.xgplayer .xgplayer-cssfullscreen .xg-get-cssfull{display:block}.xgplayer .xgplayer-cssfullscreen .xg-exit-cssfull,.xgplayer .xgplayer-cssfullscreen[data-state=full] .xg-get-cssfull{display:none}.xgplayer .xgplayer-cssfullscreen[data-state=full] .xg-exit-cssfull{display:block}.xgplayer-error{background:#000;display:none;position:absolute;left:0;top:0;width:100%;height:100%;z-index:6;color:#fff;text-align:center;line-height:100%;justify-content:center;align-items:center}.xgplayer-error .xgplayer-error-refresh{color:#fa1f41;padding:0 3px;cursor:pointer}.xgplayer-error .xgplayer-error-text{line-height:18px;margin:auto 6px 20px;display:block}.xgplayer-is-error .xgplayer-error{display:flex}.xgplayer .xgplayer-prompt{display:block;pointer-events:none;position:absolute;z-index:1;padding:6px 12px 5px;opacity:0;left:10px;background:#00000080;border-radius:50px;font-size:12px;line-height:17px;text-align:center;color:#fff}.xgplayer .xgplayer-prompt.show{display:block;opacity:1;z-index:10;pointer-events:initial}.xgplayer .xgplayer-prompt.arrow{transform:translate(-50%)}.xgplayer .xgplayer-prompt.arrow:after{content:"";display:block;position:absolute;left:50%;bottom:0;width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-top:8px solid rgba(0,0,0,.5);transform:translate(-50%,100%)}.xgplayer .xgplayer-prompt .highlight{display:inline-block;margin-left:6px;color:red;cursor:pointer}.xgplayer.xgplayer-is-error .xgplayer-prompt.show{display:none;opacity:1}.xgplayer .xgplayer-spot{position:absolute;top:0;left:0;height:100%;background:#fff;border-radius:12px}.xgplayer .xgplayer-spot.mini{min-width:6px;transform:translate(-50%)}.xgplayer .xgplayer-spot.active .xgplayer-spot-pop{display:block;opacity:1;pointer-events:initial}.xgplayer .xgplayer-spot-pop{display:block;opacity:0;pointer-events:none;position:absolute;left:50%;bottom:5px;padding-bottom:5px;transform:translate(-50%)}.xgplayer-mobile .xgplayer-spot{height:3px;min-width:3px;top:50%;opacity:1;transform:translateY(-50%)}.xgplayer-mobile .xgplayer-spot.mini{min-width:3px;transform:translate(-50%,-50%)}.xgplayer .xgplayer-progress.active .xgplayer-spot{opacity:1;transition:opacity .3s;visibility:visible}.xgplayer .xg-spot-info{position:absolute;left:0;bottom:100%;display:none}.xgplayer .xg-spot-info.short-line .xg-spot-line{height:6px}.xgplayer .xg-spot-info.short-line .xg-spot-content{bottom:-4px}.xgplayer .xg-spot-info.no-thumbnail .xg-spot-thumbnail{display:none}.xgplayer .xg-spot-info.no-thumbnail .xgplayer-progress-point{display:block}.xgplayer .xg-spot-info.no-timepoint .xgplayer-progress-point,.xgplayer .xg-spot-info.hide{display:none}.xgplayer .xgplayer-progress.active .xg-spot-info{display:block}.xgplayer .xgplayer-progress.active .xg-spot-info.hide{display:none}.xgplayer .xg-spot-line{position:relative;bottom:-7px;margin-left:50%;display:block;width:1px;height:41px;background-color:#fff;pointer-events:none}.xgplayer .xgplayer-progress-point{display:none;position:relative;bottom:-4px;left:50%;transform:translate(-50%);background:#0000008a;font-size:11px;color:#fff;padding:4px 6px;border-radius:4px;text-align:center;opacity:.85;white-space:nowrap}.xgplayer .xg-spot-content{position:relative;bottom:-7px;color:#fff;border-radius:2px 2px 0 0}.xgplayer .xg-spot-ext-text{position:relative;bottom:-7px}.xgplayer .xg-spot-thumbnail{position:relative;background-color:#111010;pointer-events:none;border-radius:2px 2px 0 0}.xgplayer .xg-spot-time{position:absolute;bottom:2px;font-size:12px;line-height:16.8px;left:50%;transform:translate(-50%);pointer-events:none}.xgplayer .progress-thumbnail{margin:0 auto;display:block}.xgplayer .xg-spot-text{display:none;padding:5px 8px;background:#000c;border-radius:0 0 2px 2px;pointer-events:none;box-sizing:border-box}.xgplayer .spot-inner-text{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;line-height:20px;font-size:12px;max-height:40px}.xgplayer .xg-spot-content.show-text .xg-spot-text{display:block}.xgplayer .product .xg-spot-text{background:#3370ff}.xgplayer .product .xg-spot-line{border-left:10px solid transparent;border-right:10px solid transparent;border-top:7px solid #3370FF;width:0;height:15px;left:-10px;background:none}.xgplayer .xgvideo-preview{position:absolute;width:100%;height:100%;top:0;left:0;opacity:0;visibility:hidden;transition:visibility .3s,opacity .3s;background-color:#000}.xgplayer .xgvideo-preview .xgvideo-thumbnail{position:relative;top:50%;left:50%;transform:translate(-50%,-50%);border-radius:0}.xgplayer .xgvideo-preview.show{opacity:1;visibility:visible}.xgplayer-dynamic-bg,.xgplayer-dynamic-bg canvas,.xgplayer-dynamic-bg xgmask,.xgplayer-dynamic-bg xgfilter{display:block;position:absolute;top:0;left:0;height:100%;width:100%;pointer-events:none}.xgplayer-dynamic-bg canvas{transform:translateZ(0)}.xgplayer-dynamic-bg xgmask{background:#000000b3}.n-card-header__close .n-base-icon,.n-icon{font-size:18px} ');

(function (vue, naiveUi, CryptoJS, bigInt, Player, HlsJsPlugin) {
  'use strict';

  var _GM_cookie = /* @__PURE__ */ (() => typeof GM_cookie != "undefined" ? GM_cookie : void 0)();
  var _GM_getValue = /* @__PURE__ */ (() => typeof GM_getValue != "undefined" ? GM_getValue : void 0)();
  var _GM_openInTab = /* @__PURE__ */ (() => typeof GM_openInTab != "undefined" ? GM_openInTab : void 0)();
  var _GM_setValue = /* @__PURE__ */ (() => typeof GM_setValue != "undefined" ? GM_setValue : void 0)();
  var _GM_xmlhttpRequest = /* @__PURE__ */ (() => typeof GM_xmlhttpRequest != "undefined" ? GM_xmlhttpRequest : void 0)();
  const gKts = [
    240,
    229,
    105,
    174,
    191,
    220,
    191,
    138,
    26,
    69,
    232,
    190,
    125,
    166,
    115,
    184,
    222,
    143,
    231,
    196,
    69,
    218,
    134,
    196,
    155,
    100,
    139,
    20,
    106,
    180,
    241,
    170,
    56,
    1,
    53,
    158,
    38,
    105,
    44,
    134,
    0,
    107,
    79,
    165,
    54,
    52,
    98,
    166,
    42,
    150,
    104,
    24,
    242,
    74,
    253,
    189,
    107,
    151,
    143,
    77,
    143,
    137,
    19,
    183,
    108,
    142,
    147,
    237,
    14,
    13,
    72,
    62,
    215,
    47,
    136,
    216,
    254,
    254,
    126,
    134,
    80,
    149,
    79,
    209,
    235,
    131,
    38,
    52,
    219,
    102,
    123,
    156,
    126,
    157,
    122,
    129,
    50,
    234,
    182,
    51,
    222,
    58,
    169,
    89,
    52,
    102,
    59,
    170,
    186,
    129,
    96,
    72,
    185,
    213,
    129,
    156,
    248,
    108,
    132,
    119,
    255,
    84,
    120,
    38,
    95,
    190,
    232,
    30,
    54,
    159,
    52,
    128,
    92,
    69,
    44,
    155,
    118,
    213,
    27,
    143,
    204,
    195,
    184,
    245
  ];
  const gKeyS = [41, 35, 33, 94];
  const gKeyL = [120, 6, 173, 76, 51, 134, 93, 24, 76, 1, 63, 70];
  const md5 = CryptoJS.MD5;
  const wait = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
  const getDownLoadUrl = async (code) => {
    const time = Math.floor((/* @__PURE__ */ new Date()).getTime() / 1e3);
    const { data, key } = m115Encode(
      JSON.stringify({
        pickcode: code
      }),
      time
    );
    const download = {
      name: "",
      url: "",
      code: ""
    };
    await wait(1e3);
    const res = await request({
      method: "POST",
      url: `http://proapi.115.com/app/chrome/downurl?t=${time}`,
      data: `data=${encodeURIComponent(data)}`,
      headers: {
        "Content-Type": "application/x-www-form-urlencoded"
      }
    });
    const json = JSON.parse(res.responseText);
    if (!json.state) {
      throw new Error(json.msg);
    } else {
      const data2 = Object.values(JSON.parse(m115Decode(json.data, key)))[0];
      download.name = data2.file_name;
      download.url = data2.url.url;
      download.code = data2.pick_code;
      return download;
    }
  };
  const m115Encode = (code, time) => {
    const key = stringToBytes(md5(`!@###@#${time}DFDR@#@#`).toString());
    const bytes = stringToBytes(code);
    const tmp1 = m115SymEncode(bytes, bytes.length, key);
    const tmp2 = key.slice(0, 16).concat(tmp1);
    return {
      data: m115AsymEncode(tmp2, tmp2.length),
      key
    };
  };
  const m115Decode = function(src, key) {
    const bytes = stringToBytes(window.atob(src));
    const tmp = m115AsymDecode(bytes, bytes.length);
    return bytesToString(m115SymDecode(tmp.slice(16), tmp.length - 16, key, tmp.slice(0, 16)));
  };
  const stringToBytes = (str) => {
    const arr = [];
    const strLength = str.length;
    for (let i = 0; i < strLength; i++) {
      arr.push(str.charCodeAt(i));
    }
    return arr;
  };
  const m115SymEncode = (src, srclen, key1) => {
    let ret;
    const k1 = m115Getkey(4, key1);
    const k2 = m115Getkey(12, null);
    ret = xor115Enc(src, srclen, k1, 4);
    ret.reverse();
    ret = xor115Enc(ret, srclen, k2, 12);
    return ret;
  };
  const m115SymDecode = (src, srclen, key1, key2) => {
    const k1 = m115Getkey(4, key1);
    const k2 = m115Getkey(12, key2);
    let ret = xor115Enc(src, srclen, k2, 12);
    ret.reverse();
    ret = xor115Enc(ret, srclen, k1, 4);
    return ret;
  };
  const m115Getkey = (length, key) => {
    if (key != null) {
      const results = [];
      for (let i = 0; i < length; i++) {
        results.push(key[i] + gKts[length * i] & 255 ^ gKts[length * (length - 1 - i)]);
      }
      return results;
    }
    if (length === 12) {
      return gKeyL.slice(0);
    }
    return gKeyS.slice(0);
  };
  const xor115Enc = (src, srclen, key, keylen) => {
    const mod4 = srclen % 4;
    const ret = [];
    if (mod4 !== 0) {
      for (let i = 0, j = 0; 0 <= mod4 ? j < mod4 : j > mod4; i = 0 <= mod4 ? ++j : --j) {
        ret.push(src[i] ^ key[i % keylen]);
      }
    }
    for (let i = mod4, k = mod4; mod4 <= srclen ? k < srclen : k > srclen; i = mod4 <= srclen ? ++k : --k) {
      ret.push(src[i] ^ key[(i - mod4) % keylen]);
    }
    return ret;
  };
  const m115AsymEncode = (src, srclen) => {
    const m = 128 - 11;
    let ret = "";
    const ref2 = Math.floor((srclen + m - 1) / m);
    for (let i = 0, j = 0; 0 <= ref2 ? j < ref2 : j > ref2; i = 0 <= ref2 ? ++j : --j) {
      ret += RSA().encrypt(bytesToString(src.slice(i * m, Math.min((i + 1) * m, srclen))));
    }
    return window.btoa(RSA().hex2a(ret));
  };
  const m115AsymDecode = function(src, srclen) {
    const m = 128;
    let ret = "";
    const ref2 = Math.floor((srclen + m - 1) / m);
    for (let i = 0, j = 0; 0 <= ref2 ? j < ref2 : j > ref2; i = 0 <= ref2 ? ++j : --j) {
      ret += RSA().decrypt(bytesToString(src.slice(i * m, Math.min((i + 1) * m, srclen))));
    }
    return stringToBytes(ret);
  };
  const bytesToString = (b) => {
    let ret = "";
    for (let j = 0; j < b.length; j++) {
      ret += String.fromCharCode(b[j]);
    }
    return ret;
  };
  const RSA = () => {
    const n = bigInt(
      "8686980c0f5a24c4b9d43020cd2c22703ff3f450756529058b1cf88f09b8602136477198a6e2683149659bd122c33592fdb5ad47944ad1ea4d36c6b172aad6338c3bb6ac6227502d010993ac967d1aef00f0c8e038de2e4d3bc2ec368af2e9f10a6f1eda4f7262f136420c07c331b871bf139f74f3010e3c4fe57df3afb71683",
      16
    );
    const e = bigInt("10001", 16);
    const pkcs1pad2 = (s, n2) => {
      if (n2 < s.length + 11) {
        return null;
      }
      const ba = [];
      let i = s.length - 1;
      while (i >= 0 && n2 > 0) {
        ba[--n2] = s.charCodeAt(i--);
      }
      ba[--n2] = 0;
      while (n2 > 2) {
        ba[--n2] = 255;
      }
      ba[--n2] = 2;
      ba[--n2] = 0;
      const c = a2hex(ba);
      return bigInt(c, 16);
    };
    const pkcs1unpad2 = (a) => {
      let b = a.toString(16);
      if (b.length % 2 !== 0) {
        b = "0" + b;
      }
      const c = hex2a(b);
      let i = 1;
      while (c.charCodeAt(i) !== 0) {
        i++;
      }
      return c.slice(i + 1);
    };
    const a2hex = (byteArray) => {
      let hexString = "";
      for (let i = 0; i < byteArray.length; i++) {
        let nextHexByte = byteArray[i].toString(16);
        if (nextHexByte.length < 2) {
          nextHexByte = "0" + nextHexByte;
        }
        hexString += nextHexByte;
      }
      return hexString;
    };
    const hex2a = (hex) => {
      let str = "";
      for (let i = 0; i < hex.length; i += 2) {
        str += String.fromCharCode(parseInt(hex.substr(i, 2), 16));
      }
      return str;
    };
    const encrypt = (text) => {
      const m = pkcs1pad2(text, 128);
      if (m === null) {
        return null;
      }
      let h = m.modPow(e, n).toString(16);
      while (h.length < 128 * 2) {
        h = "0" + h;
      }
      return h;
    };
    const decrypt = (text) => {
      const ba = [];
      let i = 0;
      while (i < text.length) {
        ba[i] = text.charCodeAt(i);
        i += 1;
      }
      const c = bigInt(a2hex(ba), 16).modPow(e, n);
      const d = pkcs1unpad2(c);
      return d;
    };
    return {
      encrypt,
      decrypt,
      hex2a
    };
  };
  const settings = _GM_getValue("settings", null);
  const request = (req) => {
    return new Promise((resolve, reject) => {
      _GM_xmlhttpRequest({
        method: req.method,
        url: req.url,
        data: req.data,
        headers: req.headers,
        cookie: req.cookie,
        anonymous: req.anonymous,
        onload: (response) => {
          resolve(response);
        },
        onerror: (error) => {
          reject(error);
        }
      });
    });
  };
  const getCookie = () => {
    return new Promise((resolve, reject) => {
      _GM_cookie.list({ domain: "115.com" }, (cookie, error) => {
        if (error) {
          reject(error);
        } else {
          resolve(cookie);
        }
      });
    });
  };
  const useTheme = () => {
    const osThemeRef = naiveUi.useOsTheme();
    const theme = vue.computed(
      () => osThemeRef.value === "dark" && (settings == null ? void 0 : settings.darkMode.enable) ? naiveUi.darkTheme : null
    );
    return theme;
  };
  const buttonThemeOverrides = {
    textColorTextHover: "#2777F8",
    textColorTextPressed: "#2777F8",
    textColorTextFocus: "#2777F8"
  };
  const menuThemeOverrides = {
    itemColorActive: "#EEF0FF",
    itemColorActiveHover: "#EEF0FF",
    itemTextColorActive: "#2777F8",
    itemTextColorActiveHover: "#2777F8"
  };
  const _hoisted_1$7 = {
    style: {
      "border-right": "1px solid #edeeef",
      "height": "100%"
    }
  };
  const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
    __name: "Sidebar",
    setup(__props) {
      const menuOptions = [{
        label: () => vue.createVNode("a", {
          "href": "//115.com/?cid=0&offset=0&mode=wangpan"
        }, [vue.createTextVNode("全部文件")]),
        key: "all"
      }, {
        label: () => vue.createVNode("a", {
          "href": "//115.com/?tab=upload&mode=wangpan"
        }, [vue.createTextVNode("最近上传")]),
        key: "upload"
      }, {
        label: () => vue.createVNode("a", {
          "href": "//115.com/?tab=offline&mode=wangpan"
        }, [vue.createTextVNode("云下载")]),
        key: "offline"
      }];
      const menuValue = vue.ref("all");
      const theme = useTheme();
      const url = new URL(window.location.href);
      if (url.searchParams.has("cid")) {
        menuValue.value = "all";
      } else if (url.searchParams.has("tab")) {
        const tab = url.searchParams.get("tab");
        if (tab === "upload") {
          menuValue.value = "upload";
        } else if (tab === "offline") {
          menuValue.value = "offline";
        }
      }
      return (_ctx, _cache) => {
        const _component_NMenu = naiveUi.NMenu;
        const _component_NConfigProvider = naiveUi.NConfigProvider;
        return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$7, [vue.createVNode(_component_NConfigProvider, {
          theme: vue.unref(theme)
        }, {
          default: vue.withCtx(() => [vue.createVNode(_component_NMenu, {
            value: vue.unref(menuValue),
            "onUpdate:value": _cache[0] || (_cache[0] = ($event) => vue.isRef(menuValue) ? menuValue.value = $event : null),
            options: menuOptions,
            "theme-overrides": vue.unref(menuThemeOverrides)
          }, null, 8, ["value", "theme-overrides"])]),
          _: 1
        }, 8, ["theme"])]);
      };
    }
  });
  function tryOnScopeDispose(fn) {
    if (vue.getCurrentScope()) {
      vue.onScopeDispose(fn);
      return true;
    }
    return false;
  }
  function toValue(r) {
    return typeof r === "function" ? r() : vue.unref(r);
  }
  const isClient = typeof window !== "undefined" && typeof document !== "undefined";
  typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
  const toString = Object.prototype.toString;
  const isObject = (val) => toString.call(val) === "[object Object]";
  const noop = () => {
  };
  function createSingletonPromise(fn) {
    let _promise;
    function wrapper() {
      if (!_promise)
        _promise = fn();
      return _promise;
    }
    wrapper.reset = async () => {
      const _prev = _promise;
      _promise = void 0;
      if (_prev)
        await _prev;
    };
    return wrapper;
  }
  function useTimeoutFn(cb, interval, options = {}) {
    const {
      immediate = true
    } = options;
    const isPending = vue.ref(false);
    let timer = null;
    function clear() {
      if (timer) {
        clearTimeout(timer);
        timer = null;
      }
    }
    function stop() {
      isPending.value = false;
      clear();
    }
    function start(...args) {
      clear();
      isPending.value = true;
      timer = setTimeout(() => {
        isPending.value = false;
        timer = null;
        cb(...args);
      }, toValue(interval));
    }
    if (immediate) {
      isPending.value = true;
      if (isClient)
        start();
    }
    tryOnScopeDispose(stop);
    return {
      isPending: vue.readonly(isPending),
      start,
      stop
    };
  }
  const defaultWindow = isClient ? window : void 0;
  const defaultNavigator = isClient ? window.navigator : void 0;
  function unrefElement(elRef) {
    var _a;
    const plain = toValue(elRef);
    return (_a = plain == null ? void 0 : plain.$el) != null ? _a : plain;
  }
  function useEventListener(...args) {
    let target;
    let events2;
    let listeners;
    let options;
    if (typeof args[0] === "string" || Array.isArray(args[0])) {
      [events2, listeners, options] = args;
      target = defaultWindow;
    } else {
      [target, events2, listeners, options] = args;
    }
    if (!target)
      return noop;
    if (!Array.isArray(events2))
      events2 = [events2];
    if (!Array.isArray(listeners))
      listeners = [listeners];
    const cleanups = [];
    const cleanup = () => {
      cleanups.forEach((fn) => fn());
      cleanups.length = 0;
    };
    const register = (el, event, listener, options2) => {
      el.addEventListener(event, listener, options2);
      return () => el.removeEventListener(event, listener, options2);
    };
    const stopWatch = vue.watch(
      () => [unrefElement(target), toValue(options)],
      ([el, options2]) => {
        cleanup();
        if (!el)
          return;
        const optionsClone = isObject(options2) ? { ...options2 } : options2;
        cleanups.push(
          ...events2.flatMap((event) => {
            return listeners.map((listener) => register(el, event, listener, optionsClone));
          })
        );
      },
      { immediate: true, flush: "post" }
    );
    const stop = () => {
      stopWatch();
      cleanup();
    };
    tryOnScopeDispose(stop);
    return stop;
  }
  function useMounted() {
    const isMounted = vue.ref(false);
    const instance = vue.getCurrentInstance();
    if (instance) {
      vue.onMounted(() => {
        isMounted.value = true;
      }, instance);
    }
    return isMounted;
  }
  function useSupported(callback) {
    const isMounted = useMounted();
    return vue.computed(() => {
      isMounted.value;
      return Boolean(callback());
    });
  }
  function usePermission(permissionDesc, options = {}) {
    const {
      controls = false,
      navigator = defaultNavigator
    } = options;
    const isSupported = useSupported(() => navigator && "permissions" in navigator);
    const permissionStatus = vue.shallowRef();
    const desc = typeof permissionDesc === "string" ? { name: permissionDesc } : permissionDesc;
    const state = vue.shallowRef();
    const update = () => {
      var _a, _b;
      state.value = (_b = (_a = permissionStatus.value) == null ? void 0 : _a.state) != null ? _b : "prompt";
    };
    useEventListener(permissionStatus, "change", update);
    const query = createSingletonPromise(async () => {
      if (!isSupported.value)
        return;
      if (!permissionStatus.value) {
        try {
          permissionStatus.value = await navigator.permissions.query(desc);
        } catch (e) {
          permissionStatus.value = void 0;
        } finally {
          update();
        }
      }
      if (controls)
        return vue.toRaw(permissionStatus.value);
    });
    query();
    if (controls) {
      return {
        state,
        isSupported,
        query
      };
    } else {
      return state;
    }
  }
  function useClipboard(options = {}) {
    const {
      navigator = defaultNavigator,
      read = false,
      source,
      copiedDuring = 1500,
      legacy = false
    } = options;
    const isClipboardApiSupported = useSupported(() => navigator && "clipboard" in navigator);
    const permissionRead = usePermission("clipboard-read");
    const permissionWrite = usePermission("clipboard-write");
    const isSupported = vue.computed(() => isClipboardApiSupported.value || legacy);
    const text = vue.ref("");
    const copied = vue.ref(false);
    const timeout = useTimeoutFn(() => copied.value = false, copiedDuring);
    function updateText() {
      if (isClipboardApiSupported.value && isAllowed(permissionRead.value)) {
        navigator.clipboard.readText().then((value) => {
          text.value = value;
        });
      } else {
        text.value = legacyRead();
      }
    }
    if (isSupported.value && read)
      useEventListener(["copy", "cut"], updateText);
    async function copy(value = toValue(source)) {
      if (isSupported.value && value != null) {
        if (isClipboardApiSupported.value && isAllowed(permissionWrite.value))
          await navigator.clipboard.writeText(value);
        else
          legacyCopy(value);
        text.value = value;
        copied.value = true;
        timeout.start();
      }
    }
    function legacyCopy(value) {
      const ta = document.createElement("textarea");
      ta.value = value != null ? value : "";
      ta.style.position = "absolute";
      ta.style.opacity = "0";
      document.body.appendChild(ta);
      ta.select();
      document.execCommand("copy");
      ta.remove();
    }
    function legacyRead() {
      var _a, _b, _c;
      return (_c = (_b = (_a = document == null ? void 0 : document.getSelection) == null ? void 0 : _a.call(document)) == null ? void 0 : _b.toString()) != null ? _c : "";
    }
    function isAllowed(status) {
      return status === "granted" || status === "prompt";
    }
    return {
      isSupported,
      text,
      copied,
      copy
    };
  }
  const DefaultMagicKeysAliasMap = {
    ctrl: "control",
    command: "meta",
    cmd: "meta",
    option: "alt",
    up: "arrowup",
    down: "arrowdown",
    left: "arrowleft",
    right: "arrowright"
  };
  function useMagicKeys(options = {}) {
    const {
      reactive: useReactive = false,
      target = defaultWindow,
      aliasMap = DefaultMagicKeysAliasMap,
      passive = true,
      onEventFired = noop
    } = options;
    const current = vue.reactive(/* @__PURE__ */ new Set());
    const obj = {
      toJSON() {
        return {};
      },
      current
    };
    const refs = useReactive ? vue.reactive(obj) : obj;
    const metaDeps = /* @__PURE__ */ new Set();
    const usedKeys = /* @__PURE__ */ new Set();
    function setRefs(key, value) {
      if (key in refs) {
        if (useReactive)
          refs[key] = value;
        else
          refs[key].value = value;
      }
    }
    function reset() {
      current.clear();
      for (const key of usedKeys)
        setRefs(key, false);
    }
    function updateRefs(e, value) {
      var _a, _b;
      const key = (_a = e.key) == null ? void 0 : _a.toLowerCase();
      const code = (_b = e.code) == null ? void 0 : _b.toLowerCase();
      const values = [code, key].filter(Boolean);
      if (key) {
        if (value)
          current.add(key);
        else
          current.delete(key);
      }
      for (const key2 of values) {
        usedKeys.add(key2);
        setRefs(key2, value);
      }
      if (key === "meta" && !value) {
        metaDeps.forEach((key2) => {
          current.delete(key2);
          setRefs(key2, false);
        });
        metaDeps.clear();
      } else if (typeof e.getModifierState === "function" && e.getModifierState("Meta") && value) {
        [...current, ...values].forEach((key2) => metaDeps.add(key2));
      }
    }
    useEventListener(target, "keydown", (e) => {
      updateRefs(e, true);
      return onEventFired(e);
    }, { passive });
    useEventListener(target, "keyup", (e) => {
      updateRefs(e, false);
      return onEventFired(e);
    }, { passive });
    useEventListener("blur", reset, { passive: true });
    useEventListener("focus", reset, { passive: true });
    const proxy = new Proxy(
      refs,
      {
        get(target2, prop, rec) {
          if (typeof prop !== "string")
            return Reflect.get(target2, prop, rec);
          prop = prop.toLowerCase();
          if (prop in aliasMap)
            prop = aliasMap[prop];
          if (!(prop in refs)) {
            if (/[+_-]/.test(prop)) {
              const keys2 = prop.split(/[+_-]/g).map((i) => i.trim());
              refs[prop] = vue.computed(() => keys2.every((key) => toValue(proxy[key])));
            } else {
              refs[prop] = vue.ref(false);
            }
          }
          const r = Reflect.get(target2, prop, rec);
          return useReactive ? toValue(r) : r;
        }
      }
    );
    return proxy;
  }
  function usePageLeave(options = {}) {
    const { window: window2 = defaultWindow } = options;
    const isLeft = vue.ref(false);
    const handler = (event) => {
      if (!window2)
        return;
      event = event || window2.event;
      const from = event.relatedTarget || event.toElement;
      isLeft.value = !from;
    };
    if (window2) {
      useEventListener(window2, "mouseout", handler, { passive: true });
      useEventListener(window2.document, "mouseleave", handler, { passive: true });
      useEventListener(window2.document, "mouseenter", handler, { passive: true });
    }
    return isLeft;
  }
  const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
    __name: "DownloadContent",
    setup(__props) {
      const message2 = naiveUi.useMessage();
      const showDownload = vue.ref(false);
      const downloads = vue.ref([]);
      const keys = useMagicKeys();
      const ctrlAltD = keys["Ctrl+Alt+D"];
      const ctrlAltO = keys["Ctrl+Alt+O"];
      const videoList = vue.ref([]);
      const bc = new BroadcastChannel("115Plus");
      vue.watch(ctrlAltD, (v) => {
        if (v) {
          handleDownload();
        }
      });
      vue.watch(ctrlAltO, (v) => {
        if (v) {
          openFile();
        }
      });
      const getSelectFile = () => {
        const files = [];
        downloads.value = [];
        const lists = document.querySelectorAll(".list-contents > ul > li");
        lists.forEach((item) => {
          const checkbox = item.querySelector('input[type="checkbox"]');
          if (checkbox && checkbox.checked) {
            files.push({
              name: item.getAttribute("title"),
              isDir: item.getAttribute("file_type") === "0" ? true : false,
              code: item.getAttribute("pick_code"),
              cateId: item.getAttribute("cate_id") || "",
              fileMode: item.getAttribute("file_mode") || ""
            });
          }
        });
        if (files.length === 0) {
          message2.destroyAll();
          message2.warning("请选择文件");
          return false;
        }
        return files;
      };
      const handleDownload = async () => {
        try {
          const selectFiles = getSelectFile();
          if (!selectFiles) return;
          const loading = message2.loading("获取下载链接中,如果文件较多等待时间会比较长,并且有几率卡住", {
            duration: 0
          });
          for (const file of selectFiles) {
            if (file.isDir) {
              const children = await getForderDownLoads(file.cateId);
              downloads.value.push({
                name: file.name,
                code: file.cateId,
                children
              });
            } else {
              const download = await getDownLoadUrl(file.code);
              downloads.value.push(download);
            }
          }
          loading.destroy();
          if (downloads.value.length === 0) {
            message2.error("获取下载链接失败");
          } else {
            showDownload.value = true;
          }
        } catch (error) {
          console.error(error);
          message2.error(`获取信息失败,错误信息:${error}`);
        }
      };
      const openFile = () => {
        const files = getSelectFile();
        if (!files) return;
        files.forEach((file) => {
          if (file.isDir) {
            _GM_openInTab(`https://115.com/?cid=${file.cateId}&offset=0&tab=&mode=wangpan`, {
              setParent: settings == null ? void 0 : settings.openNewTab.setParent
            });
          } else if (file.fileMode === "9") {
            _GM_openInTab(`https://v.anxia.com/?pickcode=${file.code}&share_id=0`, {
              setParent: settings == null ? void 0 : settings.openNewTab.setParent
            });
          }
        });
      };
      const handlePlay = async () => {
        var _a;
        try {
          const files = getSelectFile();
          if (!files) return;
          videoList.value = [];
          for (const file of files) {
            if (file.isDir) {
              message2.error("暂不支持选择文件夹播放,请勿选择文件夹");
              return;
            }
            if (file.fileMode === "9") {
              videoList.value.push({
                name: file.name,
                code: file.code
              });
            }
          }
          if (videoList.value.length === 0) {
            message2.error("未选择视频文件");
            return;
          }
          bc.postMessage({
            type: "VideoPlay",
            data: JSON.stringify(videoList.value),
            url: (_a = window.top) == null ? void 0 : _a.location.href
          });
        } catch (error) {
          console.error(error);
          message2.error(`视频播放失败,错误信息:${error}`);
        }
      };
      const handleFolderPlay = async () => {
        var _a;
        try {
          const url = new URL(window.parent.location.href);
          const files = await getForderVideos(url.searchParams.get("cid"));
          if (files.length === 0) {
            message2.error("文件夹内没有视频文件");
            return;
          }
          videoList.value = files.map((item) => {
            return {
              name: item.n,
              code: item.pc
            };
          });
          bc.postMessage({
            type: "VideoPlay",
            data: JSON.stringify(videoList.value),
            url: (_a = window.top) == null ? void 0 : _a.location.href
          });
        } catch (error) {
          console.error(error);
          message2.error(`视频播放失败,错误信息:${error}`);
        }
      };
      const getForderVideos = async (cid) => {
        var _a, _b, _c;
        const cookie = await getCookie();
        const res = await request({
          method: "GET",
          url: `https://v.anxia.com/aps/natsort/files.php?aid=1&cid=${cid}&offset=0&limit=9999&show_dir=0&nf=&qid=0&type=4&source=&format=json&star=&is_q=&is_share=&r_all=1&o=file_name&asc=1&cur=1&natsort=1`,
          cookie: `CID=${(_a = cookie.find((item) => item.name === "CID")) == null ? void 0 : _a.value};SEID=${(_b = cookie.find((item) => item.name === "SEID")) == null ? void 0 : _b.value};UID=${(_c = cookie.find((item) => item.name === "UID")) == null ? void 0 : _c.value}`,
          anonymous: true
        });
        const json = JSON.parse(res.responseText);
        if (json.state) {
          return json.data;
        } else {
          if (json.error) {
            throw new Error(json.error);
          } else {
            throw new Error("获取文件夹文件失败");
          }
        }
      };
      const getForderDownLoads = async (id) => {
        const temp = [];
        const files = await getForderFiles(id);
        for (const file of files) {
          if (file.fid) {
            const download = await getDownLoadUrl(file.pc);
            temp.push(download);
          } else {
            const children = await getForderDownLoads(file.cid);
            temp.push({
              name: file.n,
              code: file.pc,
              children
            });
          }
        }
        return temp;
      };
      const getForderFiles = async (id) => {
        const res = await request({
          method: "GET",
          url: `https://webapi.115.com/files?aid=1&cid=${id}&show_dir=1&limit=9999&format=json`
        });
        const json = JSON.parse(res.responseText);
        if (json.state) {
          return json.data;
        } else {
          if (json.error) {
            throw new Error(json.error);
          } else {
            throw new Error("获取文件夹中的文件失败");
          }
        }
      };
      const suffixRender = (info) => {
        if (info.option.url) {
          return vue.createVNode(naiveUi.NButton, {
            "text": true,
            "theme-overrides": buttonThemeOverrides,
            "tag": "a",
            "href": info.option.url,
            "target": "_blank"
          }, {
            default: () => [vue.createTextVNode("下载")]
          });
        } else {
          return void 0;
        }
      };
      return (_ctx, _cache) => {
        const _component_NTree = naiveUi.NTree;
        const _component_NModal = naiveUi.NModal;
        return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [(vue.unref(settings) ? vue.unref(settings).download.enable : true) ? (vue.openBlock(), vue.createBlock(vue.unref(naiveUi.NButton), {
          key: 0,
          text: "",
          "theme-overrides": vue.unref(buttonThemeOverrides),
          onClick: handleDownload
        }, {
          default: vue.withCtx(() => _cache[1] || (_cache[1] = [vue.createTextVNode(" 下载 ")])),
          _: 1
        }, 8, ["theme-overrides"])) : vue.createCommentVNode("", true), (vue.unref(settings) ? vue.unref(settings).openNewTab.enable : true) ? (vue.openBlock(), vue.createBlock(vue.unref(naiveUi.NButton), {
          key: 1,
          text: "",
          "theme-overrides": vue.unref(buttonThemeOverrides),
          style: {
            "margin-left": "1rem"
          },
          onClick: openFile
        }, {
          default: vue.withCtx(() => _cache[2] || (_cache[2] = [vue.createTextVNode(" 批量新标签打开 ")])),
          _: 1
        }, 8, ["theme-overrides"])) : vue.createCommentVNode("", true), (vue.unref(settings) ? vue.unref(settings).video.enable : true) ? (vue.openBlock(), vue.createBlock(vue.unref(naiveUi.NButton), {
          key: 2,
          text: "",
          "theme-overrides": vue.unref(buttonThemeOverrides),
          style: {
            "margin-left": "1rem"
          },
          onClick: handlePlay
        }, {
          default: vue.withCtx(() => _cache[3] || (_cache[3] = [vue.createTextVNode(" 播放 ")])),
          _: 1
        }, 8, ["theme-overrides"])) : vue.createCommentVNode("", true), (vue.unref(settings) ? vue.unref(settings).video.enable : true) ? (vue.openBlock(), vue.createBlock(vue.unref(naiveUi.NButton), {
          key: 3,
          text: "",
          "theme-overrides": vue.unref(buttonThemeOverrides),
          style: {
            "margin-left": "1rem"
          },
          onClick: handleFolderPlay
        }, {
          default: vue.withCtx(() => _cache[4] || (_cache[4] = [vue.createTextVNode(" 播放当前文件夹 ")])),
          _: 1
        }, 8, ["theme-overrides"])) : vue.createCommentVNode("", true), vue.createVNode(_component_NModal, {
          show: vue.unref(showDownload),
          "onUpdate:show": _cache[0] || (_cache[0] = ($event) => vue.isRef(showDownload) ? showDownload.value = $event : null),
          style: {
            "width": "40%"
          },
          title: "文件下载",
          bordered: false,
          preset: "card"
        }, {
          default: vue.withCtx(() => [vue.createVNode(_component_NTree, {
            data: vue.unref(downloads),
            "block-line": "",
            "expand-on-click": "",
            "key-field": "code",
            "label-field": "name",
            "show-line": "",
            "virtual-scroll": "",
            style: {
              "max-height": "40vh"
            },
            "render-suffix": suffixRender
          }, null, 8, ["data"])]),
          _: 1
        }, 8, ["show"])], 64);
      };
    }
  });
  const _hoisted_1$6 = { style: { "height": "100%", "display": "flex", "align-items": "center", "margin-left": "1rem" } };
  const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
    __name: "Download",
    setup(__props) {
      const theme = useTheme();
      return (_ctx, _cache) => {
        const _component_DownloadContent = _sfc_main$8;
        const _component_NMessageProvider = naiveUi.NMessageProvider;
        const _component_NModalProvider = naiveUi.NModalProvider;
        const _component_NConfigProvider = naiveUi.NConfigProvider;
        return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$6, [
          vue.createVNode(_component_NConfigProvider, { theme: vue.unref(theme) }, {
            default: vue.withCtx(() => [
              vue.createVNode(_component_NModalProvider, null, {
                default: vue.withCtx(() => [
                  vue.createVNode(_component_NMessageProvider, null, {
                    default: vue.withCtx(() => [
                      vue.createVNode(_component_DownloadContent)
                    ]),
                    _: 1
                  })
                ]),
                _: 1
              })
            ]),
            _: 1
          }, 8, ["theme"])
        ]);
      };
    }
  });
  const _hoisted_1$5 = {
    xmlns: "http://www.w3.org/2000/svg",
    "xmlns:xlink": "http://www.w3.org/1999/xlink",
    viewBox: "0 0 1024 1024"
  };
  const _hoisted_2$5 = /* @__PURE__ */ vue.createElementVNode(
    "path",
    {
      d: "M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z",
      fill: "currentColor"
    },
    null,
    -1
    /* HOISTED */
  );
  const _hoisted_3$3 = [_hoisted_2$5];
  const CopyOutlined = vue.defineComponent({
    name: "CopyOutlined",
    render: function render(_ctx, _cache) {
      return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$5, _hoisted_3$3);
    }
  });
  const _hoisted_1$4 = {
    xmlns: "http://www.w3.org/2000/svg",
    "xmlns:xlink": "http://www.w3.org/1999/xlink",
    viewBox: "0 0 1024 1024"
  };
  const _hoisted_2$4 = /* @__PURE__ */ vue.createElementVNode(
    "path",
    {
      d: "M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z",
      fill: "currentColor"
    },
    null,
    -1
    /* HOISTED */
  );
  const _hoisted_3$2 = [_hoisted_2$4];
  const DeleteOutlined = vue.defineComponent({
    name: "DeleteOutlined",
    render: function render2(_ctx, _cache) {
      return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$4, _hoisted_3$2);
    }
  });
  const _hoisted_1$3 = {
    xmlns: "http://www.w3.org/2000/svg",
    "xmlns:xlink": "http://www.w3.org/1999/xlink",
    viewBox: "0 0 1024 1024"
  };
  const _hoisted_2$3 = /* @__PURE__ */ vue.createElementVNode(
    "path",
    {
      d: "M880 298.4H521L403.7 186.2a8.15 8.15 0 0 0-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z",
      fill: "currentColor"
    },
    null,
    -1
    /* HOISTED */
  );
  const _hoisted_3$1 = [_hoisted_2$3];
  const FolderOutlined = vue.defineComponent({
    name: "FolderOutlined",
    render: function render3(_ctx, _cache) {
      return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$3, _hoisted_3$1);
    }
  });
  const _hoisted_1$2 = {
    xmlns: "http://www.w3.org/2000/svg",
    "xmlns:xlink": "http://www.w3.org/1999/xlink",
    viewBox: "0 0 1024 1024"
  };
  const _hoisted_2$2 = /* @__PURE__ */ vue.createElementVNode(
    "path",
    {
      d: "M924.8 625.7l-65.5-56c3.1-19 4.7-38.4 4.7-57.8s-1.6-38.8-4.7-57.8l65.5-56a32.03 32.03 0 0 0 9.3-35.2l-.9-2.6a443.74 443.74 0 0 0-79.7-137.9l-1.8-2.1a32.12 32.12 0 0 0-35.1-9.5l-81.3 28.9c-30-24.6-63.5-44-99.7-57.6l-15.7-85a32.05 32.05 0 0 0-25.8-25.7l-2.7-.5c-52.1-9.4-106.9-9.4-159 0l-2.7.5a32.05 32.05 0 0 0-25.8 25.7l-15.8 85.4a351.86 351.86 0 0 0-99 57.4l-81.9-29.1a32 32 0 0 0-35.1 9.5l-1.8 2.1a446.02 446.02 0 0 0-79.7 137.9l-.9 2.6c-4.5 12.5-.8 26.5 9.3 35.2l66.3 56.6c-3.1 18.8-4.6 38-4.6 57.1c0 19.2 1.5 38.4 4.6 57.1L99 625.5a32.03 32.03 0 0 0-9.3 35.2l.9 2.6c18.1 50.4 44.9 96.9 79.7 137.9l1.8 2.1a32.12 32.12 0 0 0 35.1 9.5l81.9-29.1c29.8 24.5 63.1 43.9 99 57.4l15.8 85.4a32.05 32.05 0 0 0 25.8 25.7l2.7.5a449.4 449.4 0 0 0 159 0l2.7-.5a32.05 32.05 0 0 0 25.8-25.7l15.7-85a350 350 0 0 0 99.7-57.6l81.3 28.9a32 32 0 0 0 35.1-9.5l1.8-2.1c34.8-41.1 61.6-87.5 79.7-137.9l.9-2.6c4.5-12.3.8-26.3-9.3-35zM788.3 465.9c2.5 15.1 3.8 30.6 3.8 46.1s-1.3 31-3.8 46.1l-6.6 40.1l74.7 63.9a370.03 370.03 0 0 1-42.6 73.6L721 702.8l-31.4 25.8c-23.9 19.6-50.5 35-79.3 45.8l-38.1 14.3l-17.9 97a377.5 377.5 0 0 1-85 0l-17.9-97.2l-37.8-14.5c-28.5-10.8-55-26.2-78.7-45.7l-31.4-25.9l-93.4 33.2c-17-22.9-31.2-47.6-42.6-73.6l75.5-64.5l-6.5-40c-2.4-14.9-3.7-30.3-3.7-45.5c0-15.3 1.2-30.6 3.7-45.5l6.5-40l-75.5-64.5c11.3-26.1 25.6-50.7 42.6-73.6l93.4 33.2l31.4-25.9c23.7-19.5 50.2-34.9 78.7-45.7l37.9-14.3l17.9-97.2c28.1-3.2 56.8-3.2 85 0l17.9 97l38.1 14.3c28.7 10.8 55.4 26.2 79.3 45.8l31.4 25.8l92.8-32.9c17 22.9 31.2 47.6 42.6 73.6L781.8 426l6.5 39.9zM512 326c-97.2 0-176 78.8-176 176s78.8 176 176 176s176-78.8 176-176s-78.8-176-176-176zm79.2 255.2A111.6 111.6 0 0 1 512 614c-29.9 0-58-11.7-79.2-32.8A111.6 111.6 0 0 1 400 502c0-29.9 11.7-58 32.8-79.2C454 401.6 482.1 390 512 390c29.9 0 58 11.6 79.2 32.8A111.6 111.6 0 0 1 624 502c0 29.9-11.7 58-32.8 79.2z",
      fill: "currentColor"
    },
    null,
    -1
    /* HOISTED */
  );
  const _hoisted_3 = [_hoisted_2$2];
  const SettingOutlined = vue.defineComponent({
    name: "SettingOutlined",
    render: function render4(_ctx, _cache) {
      return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$2, _hoisted_3);
    }
  });
  const _hoisted_1$1 = { style: { "display": "flex", "justify-content": "center", "margin-top": "8px" } };
  const _hoisted_2$1 = { style: { "display": "flex", "justify-content": "end" } };
  const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
    __name: "Setting",
    setup(__props) {
      const showSetting = vue.ref(false);
      const theme = useTheme();
      const settingsRef = vue.ref(
        settings ?? {
          sidebar: {
            enable: true
          },
          download: {
            enable: true
          },
          openNewTab: {
            enable: true,
            setParent: false
          },
          oldButton: {
            enable: true,
            deleteSource: true
          },
          video: {
            enable: true,
            volume: 1,
            defaultPlaybackRate: 1,
            autoplay: true,
            history: true
          },
          darkMode: {
            enable: false
          },
          fp: {
            enable: true
          }
        }
      );
      const handleOpen = () => {
        showSetting.value = true;
      };
      const handleClose = () => {
        showSetting.value = false;
      };
      const handleSave = () => {
        _GM_setValue("settings", settingsRef.value);
        handleClose();
        history.go(0);
      };
      return (_ctx, _cache) => {
        const _component_NIcon = naiveUi.NIcon;
        const _component_NButton = naiveUi.NButton;
        const _component_NSwitch = naiveUi.NSwitch;
        const _component_NFormItem = naiveUi.NFormItem;
        const _component_NForm = naiveUi.NForm;
        const _component_NTabPane = naiveUi.NTabPane;
        const _component_NSlider = naiveUi.NSlider;
        const _component_NRadio = naiveUi.NRadio;
        const _component_NSpace = naiveUi.NSpace;
        const _component_NRadioGroup = naiveUi.NRadioGroup;
        const _component_NTabs = naiveUi.NTabs;
        const _component_NCard = naiveUi.NCard;
        const _component_NModal = naiveUi.NModal;
        const _component_NConfigProvider = naiveUi.NConfigProvider;
        return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$1, [
          vue.createVNode(_component_NConfigProvider, { theme: vue.unref(theme) }, {
            default: vue.withCtx(() => [
              vue.createVNode(_component_NButton, {
                text: "",
                style: { "font-size": "12px" },
                "theme-overrides": vue.unref(buttonThemeOverrides),
                onClick: handleOpen
              }, {
                default: vue.withCtx(() => [
                  vue.createElementVNode("div", null, [
                    vue.createVNode(_component_NIcon, { size: "24" }, {
                      default: vue.withCtx(() => [
                        vue.createVNode(vue.unref(SettingOutlined))
                      ]),
                      _: 1
                    })
                  ]),
                  _cache[14] || (_cache[14] = vue.createElementVNode("div", null, " 115+ 设置 ", -1))
                ]),
                _: 1
              }, 8, ["theme-overrides"]),
              vue.createVNode(_component_NModal, {
                show: vue.unref(showSetting),
                "onUpdate:show": _cache[13] || (_cache[13] = ($event) => vue.isRef(showSetting) ? showSetting.value = $event : null)
              }, {
                default: vue.withCtx(() => [
                  vue.createVNode(_component_NCard, {
                    style: { "width": "40%" },
                    title: "115+ 设置",
                    bordered: false,
                    role: "dialog",
                    closable: "",
                    onClose: handleClose
                  }, {
                    action: vue.withCtx(() => [
                      vue.createElementVNode("div", _hoisted_2$1, [
                        vue.createVNode(_component_NButton, {
                          type: "primary",
                          onClick: handleSave
                        }, {
                          default: vue.withCtx(() => _cache[24] || (_cache[24] = [
                            vue.createTextVNode("保存")
                          ])),
                          _: 1
                        })
                      ])
                    ]),
                    default: vue.withCtx(() => [
                      vue.createVNode(_component_NTabs, {
                        type: "segment",
                        animated: ""
                      }, {
                        default: vue.withCtx(() => [
                          vue.createVNode(_component_NTabPane, {
                            name: "functionSwitch",
                            tab: "功能开关"
                          }, {
                            default: vue.withCtx(() => [
                              vue.createVNode(_component_NForm, {
                                ref: "formRef",
                                "label-placement": "left",
                                "label-width": "auto",
                                "show-feedback": false
                              }, {
                                default: vue.withCtx(() => [
                                  vue.createVNode(_component_NFormItem, {
                                    label: "精简侧边栏",
                                    path: "sidebar.enable"
                                  }, {
                                    default: vue.withCtx(() => [
                                      vue.createVNode(_component_NSwitch, {
                                        value: vue.unref(settingsRef).sidebar.enable,
                                        "onUpdate:value": _cache[0] || (_cache[0] = ($event) => vue.unref(settingsRef).sidebar.enable = $event)
                                      }, null, 8, ["value"])
                                    ]),
                                    _: 1
                                  }),
                                  vue.createVNode(_component_NFormItem, {
                                    label: "下载文件",
                                    path: "download.enable"
                                  }, {
                                    default: vue.withCtx(() => [
                                      vue.createVNode(_component_NSwitch, {
                                        value: vue.unref(settingsRef).download.enable,
                                        "onUpdate:value": _cache[1] || (_cache[1] = ($event) => vue.unref(settingsRef).download.enable = $event)
                                      }, null, 8, ["value"])
                                    ]),
                                    _: 1
                                  }),
                                  vue.createVNode(_component_NFormItem, {
                                    label: "批量新标签打开",
                                    path: "openNewTab.enable"
                                  }, {
                                    default: vue.withCtx(() => [
                                      vue.createVNode(_component_NSwitch, {
                                        value: vue.unref(settingsRef).openNewTab.enable,
                                        "onUpdate:value": _cache[2] || (_cache[2] = ($event) => vue.unref(settingsRef).openNewTab.enable = $event)
                                      }, null, 8, ["value"])
                                    ]),
                                    _: 1
                                  }),
                                  vue.createVNode(_component_NFormItem, {
                                    label: "自定义离线下载按钮和云下载列表",
                                    path: "oldButton.enable"
                                  }, {
                                    default: vue.withCtx(() => [
                                      vue.createVNode(_component_NSwitch, {
                                        value: vue.unref(settingsRef).oldButton.enable,
                                        "onUpdate:value": _cache[3] || (_cache[3] = ($event) => vue.unref(settingsRef).oldButton.enable = $event)
                                      }, null, 8, ["value"])
                                    ]),
                                    _: 1
                                  }),
                                  vue.createVNode(_component_NFormItem, {
                                    label: "视频播放",
                                    path: "video.enable"
                                  }, {
                                    default: vue.withCtx(() => [
                                      vue.createVNode(_component_NSwitch, {
                                        value: vue.unref(settingsRef).video.enable,
                                        "onUpdate:value": _cache[4] || (_cache[4] = ($event) => vue.unref(settingsRef).video.enable = $event)
                                      }, null, 8, ["value"])
                                    ]),
                                    _: 1
                                  }),
                                  vue.createVNode(_component_NFormItem, {
                                    label: "跟随系统暗黑模式",
                                    path: "darkMode.enable"
                                  }, {
                                    default: vue.withCtx(() => [
                                      vue.createVNode(_component_NSwitch, {
                                        value: vue.unref(settingsRef).darkMode.enable,
                                        "onUpdate:value": _cache[5] || (_cache[5] = ($event) => vue.unref(settingsRef).darkMode.enable = $event)
                                      }, null, 8, ["value"])
                                    ]),
                                    _: 1
                                  }),
                                  vue.createVNode(_component_NFormItem, {
                                    label: "去水印",
                                    path: "fp.enable"
                                  }, {
                                    default: vue.withCtx(() => [
                                      vue.createVNode(_component_NSwitch, {
                                        value: vue.unref(settingsRef).fp.enable,
                                        "onUpdate:value": _cache[6] || (_cache[6] = ($event) => vue.unref(settingsRef).fp.enable = $event)
                                      }, null, 8, ["value"])
                                    ]),
                                    _: 1
                                  })
                                ]),
                                _: 1
                              }, 512)
                            ]),
                            _: 1
                          }),
                          vue.createVNode(_component_NTabPane, {
                            name: "playSetting",
                            tab: "播放设置"
                          }, {
                            default: vue.withCtx(() => [
                              vue.createVNode(_component_NForm, {
                                ref: "formRef",
                                "label-placement": "left",
                                "label-width": "auto",
                                "show-feedback": false
                              }, {
                                default: vue.withCtx(() => [
                                  vue.createVNode(_component_NFormItem, {
                                    label: "默认音量",
                                    path: "video.volume"
                                  }, {
                                    default: vue.withCtx(() => [
                                      vue.createVNode(_component_NSlider, {
                                        value: vue.unref(settingsRef).video.volume,
                                        "onUpdate:value": _cache[7] || (_cache[7] = ($event) => vue.unref(settingsRef).video.volume = $event),
                                        step: 0.01,
                                        max: 1,
                                        "format-tooltip": (v) => `${(v * 100).toFixed(0)}%`
                                      }, null, 8, ["value", "format-tooltip"])
                                    ]),
                                    _: 1
                                  }),
                                  vue.createVNode(_component_NFormItem, {
                                    label: "默认速度",
                                    path: "video.defaultPlaybackRate"
                                  }, {
                                    default: vue.withCtx(() => [
                                      vue.createVNode(_component_NRadioGroup, {
                                        value: vue.unref(settingsRef).video.defaultPlaybackRate,
                                        "onUpdate:value": _cache[8] || (_cache[8] = ($event) => vue.unref(settingsRef).video.defaultPlaybackRate = $event),
                                        name: "radiogroup"
                                      }, {
                                        default: vue.withCtx(() => [
                                          vue.createVNode(_component_NSpace, null, {
                                            default: vue.withCtx(() => [
                                              vue.createVNode(_component_NRadio, { value: 0.5 }, {
                                                default: vue.withCtx(() => _cache[15] || (_cache[15] = [
                                                  vue.createTextVNode(" 0.5x ")
                                                ])),
                                                _: 1
                                              }),
                                              vue.createVNode(_component_NRadio, { value: 0.75 }, {
                                                default: vue.withCtx(() => _cache[16] || (_cache[16] = [
                                                  vue.createTextVNode(" 0.75x ")
                                                ])),
                                                _: 1
                                              }),
                                              vue.createVNode(_component_NRadio, { value: 1 }, {
                                                default: vue.withCtx(() => _cache[17] || (_cache[17] = [
                                                  vue.createTextVNode(" 1x ")
                                                ])),
                                                _: 1
                                              }),
                                              vue.createVNode(_component_NRadio, { value: 1.25 }, {
                                                default: vue.withCtx(() => _cache[18] || (_cache[18] = [
                                                  vue.createTextVNode(" 1.25x ")
                                                ])),
                                                _: 1
                                              }),
                                              vue.createVNode(_component_NRadio, { value: 1.5 }, {
                                                default: vue.withCtx(() => _cache[19] || (_cache[19] = [
                                                  vue.createTextVNode(" 1.5x ")
                                                ])),
                                                _: 1
                                              }),
                                              vue.createVNode(_component_NRadio, { value: 2 }, {
                                                default: vue.withCtx(() => _cache[20] || (_cache[20] = [
                                                  vue.createTextVNode(" 2x ")
                                                ])),
                                                _: 1
                                              }),
                                              vue.createVNode(_component_NRadio, { value: 3 }, {
                                                default: vue.withCtx(() => _cache[21] || (_cache[21] = [
                                                  vue.createTextVNode(" 3x ")
                                                ])),
                                                _: 1
                                              }),
                                              vue.createVNode(_component_NRadio, { value: 4 }, {
                                                default: vue.withCtx(() => _cache[22] || (_cache[22] = [
                                                  vue.createTextVNode(" 4x ")
                                                ])),
                                                _: 1
                                              }),
                                              vue.createVNode(_component_NRadio, { value: 5 }, {
                                                default: vue.withCtx(() => _cache[23] || (_cache[23] = [
                                                  vue.createTextVNode(" 5x ")
                                                ])),
                                                _: 1
                                              })
                                            ]),
                                            _: 1
                                          })
                                        ]),
                                        _: 1
                                      }, 8, ["value"])
                                    ]),
                                    _: 1
                                  }),
                                  vue.createVNode(_component_NFormItem, {
                                    label: "自动播放",
                                    path: "video.autoplay"
                                  }, {
                                    default: vue.withCtx(() => [
                                      vue.createVNode(_component_NSwitch, {
                                        value: vue.unref(settingsRef).video.autoplay,
                                        "onUpdate:value": _cache[9] || (_cache[9] = ($event) => vue.unref(settingsRef).video.autoplay = $event)
                                      }, null, 8, ["value"])
                                    ]),
                                    _: 1
                                  }),
                                  vue.createVNode(_component_NFormItem, {
                                    label: "同步播放进度",
                                    path: "video.history"
                                  }, {
                                    default: vue.withCtx(() => [
                                      vue.createVNode(_component_NSwitch, {
                                        value: vue.unref(settingsRef).video.history,
                                        "onUpdate:value": _cache[10] || (_cache[10] = ($event) => vue.unref(settingsRef).video.history = $event)
                                      }, null, 8, ["value"])
                                    ]),
                                    _: 1
                                  })
                                ]),
                                _: 1
                              }, 512)
                            ]),
                            _: 1
                          }),
                          vue.createVNode(_component_NTabPane, {
                            name: "cloudDownloadSetting",
                            tab: "离线下载设置"
                          }, {
                            default: vue.withCtx(() => [
                              vue.createVNode(_component_NForm, {
                                ref: "formRef",
                                "label-placement": "left",
                                "label-width": "auto",
                                "show-feedback": false
                              }, {
                                default: vue.withCtx(() => [
                                  vue.createVNode(_component_NFormItem, {
                                    label: "默认删除源文件",
                                    path: "oldButton.deleteSource"
                                  }, {
                                    default: vue.withCtx(() => [
                                      vue.createVNode(_component_NSwitch, {
                                        value: vue.unref(settingsRef).oldButton.deleteSource,
                                        "onUpdate:value": _cache[11] || (_cache[11] = ($event) => vue.unref(settingsRef).oldButton.deleteSource = $event)
                                      }, null, 8, ["value"])
                                    ]),
                                    _: 1
                                  })
                                ]),
                                _: 1
                              }, 512)
                            ]),
                            _: 1
                          }),
                          vue.createVNode(_component_NTabPane, {
                            name: "otherSeetting",
                            tab: "其他设置"
                          }, {
                            default: vue.withCtx(() => [
                              vue.createVNode(_component_NForm, {
                                ref: "formRef",
                                "label-placement": "left",
                                "label-width": "auto",
                                "show-feedback": false
                              }, {
                                default: vue.withCtx(() => [
                                  vue.createVNode(_component_NFormItem, {
                                    label: "火狐默认在身份组内打开标签",
                                    path: "openNewTab.setParent"
                                  }, {
                                    default: vue.withCtx(() => [
                                      vue.createVNode(_component_NSwitch, {
                                        value: vue.unref(settingsRef).openNewTab.setParent,
                                        "onUpdate:value": _cache[12] || (_cache[12] = ($event) => vue.unref(settingsRef).openNewTab.setParent = $event)
                                      }, null, 8, ["value"])
                                    ]),
                                    _: 1
                                  })
                                ]),
                                _: 1
                              }, 512)
                            ]),
                            _: 1
                          })
                        ]),
                        _: 1
                      })
                    ]),
                    _: 1
                  })
                ]),
                _: 1
              }, 8, ["show"])
            ]),
            _: 1
          }, 8, ["theme"])
        ]);
      };
    }
  });
  const _export_sfc = (sfc, props) => {
    const target = sfc.__vccOpts || sfc;
    for (const [key, val] of props) {
      target[key] = val;
    }
    return target;
  };
  const Setting = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-83bc69cf"]]);
  const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
    __name: "CloudDownload",
    setup(__props) {
      const theme = useTheme();
      const options = [
        {
          label: "云下载",
          key: "CloudDownload"
        }
      ];
      const bc = new BroadcastChannel("115Plus");
      const handleSelect = (option) => {
        var _a;
        if (option === "CloudDownload") {
          bc.postMessage({
            type: "CloudDownload",
            url: (_a = window.top) == null ? void 0 : _a.location.href
          });
        }
      };
      const handleDownload = () => {
        var _a;
        bc.postMessage({
          type: "OfflineDownload",
          url: (_a = window.top) == null ? void 0 : _a.location.href
        });
      };
      return (_ctx, _cache) => {
        const _component_NButton = naiveUi.NButton;
        const _component_NDropdown = naiveUi.NDropdown;
        const _component_NConfigProvider = naiveUi.NConfigProvider;
        return vue.openBlock(), vue.createBlock(_component_NConfigProvider, { theme: vue.unref(theme) }, {
          default: vue.withCtx(() => [
            vue.createVNode(_component_NDropdown, {
              trigger: "hover",
              options,
              onSelect: handleSelect
            }, {
              default: vue.withCtx(() => [
                vue.createVNode(_component_NButton, { onClick: handleDownload }, {
                  default: vue.withCtx(() => _cache[0] || (_cache[0] = [
                    vue.createTextVNode("离线下载")
                  ])),
                  _: 1
                })
              ]),
              _: 1
            })
          ]),
          _: 1
        }, 8, ["theme"]);
      };
    }
  });
  const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
    __name: "VideoModal",
    props: /* @__PURE__ */ vue.mergeModels({
      data: {}
    }, {
      "show": {
        type: Boolean,
        default: false
      },
      "showModifiers": {}
    }),
    emits: ["update:show"],
    setup(__props) {
      const show = vue.useModel(__props, "show");
      const props = __props;
      const message2 = naiveUi.useMessage();
      const menuOptions = vue.ref([]);
      const menuValue = vue.ref("");
      const videoList = vue.ref([]);
      const videoRef = vue.ref(null);
      const player = vue.ref(null);
      const saveTimer = vue.ref(null);
      const layoutHeight = vue.ref(700);
      vue.watch(show, (value) => {
        if (value) {
          videoList.value = [...props.data];
          play();
        }
      });
      const play = async () => {
        try {
          menuOptions.value = videoList.value.map((item) => {
            return {
              label: item.name,
              key: item.code
            };
          });
          menuValue.value = videoList.value[0].code;
          videoList.value[0].url = await getVideoUrl(videoList.value[0].code);
          videoList.value[0].time = await getVideoHistory(videoList.value[0].code) || 0;
          if (videoRef.value) {
            const playerConfig = {
              el: videoRef.value,
              url: videoList.value[0].url,
              autoplay: settings ? settings.video.autoplay : true,
              fluid: true,
              volume: settings ? settings.video.volume : 1,
              defaultPlaybackRate: settings ? settings.video.defaultPlaybackRate : 1,
              playbackRate: { list: [5, 4, 3, 2, 1.5, 1.25, 1, 0.75, 0.5] },
              rotate: true,
              pip: true,
              dynamicBg: {
                disable: false
              }
            };
            if (document.createElement("video").canPlayType("application/vnd.apple.mpegurl")) {
              player.value = new Player(playerConfig);
            } else if (HlsJsPlugin.isSupported()) {
              player.value = new Player({
                ...playerConfig,
                isLive: false,
                plugins: [HlsJsPlugin]
              });
            }
            if (player.value) {
              if (!settings || settings.video.history) {
                player.value.currentTime = videoList.value[0].time;
                saveTimer.value = setInterval(() => {
                  if (player.value.paused) {
                    return;
                  }
                  const time = player.value.currentTime;
                  if (time && Math.floor(time) !== videoList.value[0].time) {
                    videoList.value[0].time = Math.floor(time);
                    setVideoHistory(videoList.value[0].code, Math.floor(time));
                  }
                }, 5e3);
              }
              player.value.on(Player.Events.VIDEO_RESIZE, () => {
                var _a;
                layoutHeight.value = ((_a = videoRef.value) == null ? void 0 : _a.clientHeight) || 700;
              });
            }
          }
        } catch (error) {
          console.error(error);
          message2.error(`视频播放失败,错误信息:${error}`);
        }
      };
      const getVideoUrl = async (code) => {
        var _a, _b, _c;
        const cookie = await getCookie();
        const res = await request({
          method: "GET",
          url: `https://v.anxia.com/webapi/files/video?pickcode=${code}&share_id=0&local=1`,
          cookie: `CID=${(_a = cookie.find((item) => item.name === "CID")) == null ? void 0 : _a.value};SEID=${(_b = cookie.find((item) => item.name === "SEID")) == null ? void 0 : _b.value};UID=${(_c = cookie.find((item) => item.name === "UID")) == null ? void 0 : _c.value}`,
          anonymous: true
        });
        const json = JSON.parse(res.responseText);
        if (json.state) {
          if (json.video_url) {
            return json.video_url.replace("http://", "https://");
          } else {
            throw new Error("视频地址获取失败");
          }
        } else {
          throw new Error(json.error);
        }
      };
      const getVideoHistory = async (code) => {
        var _a, _b, _c;
        const cookie = await getCookie();
        const res = await request({
          method: "GET",
          url: `https://v.anxia.com/webapi/files/history?pick_code=${code}&fetch=one&category=1&share_id=0`,
          cookie: `CID=${(_a = cookie.find((item) => item.name === "CID")) == null ? void 0 : _a.value};SEID=${(_b = cookie.find((item) => item.name === "SEID")) == null ? void 0 : _b.value};UID=${(_c = cookie.find((item) => item.name === "UID")) == null ? void 0 : _c.value}`,
          anonymous: true
        });
        const json = JSON.parse(res.responseText);
        if (json.state) {
          return json.data.time ? json.data.time : 0;
        } else {
          if (json.error) {
            throw new Error(json.error);
          } else {
            return 0;
          }
        }
      };
      const setVideoHistory = async (code, time) => {
        var _a, _b, _c;
        const cookie = await getCookie();
        request({
          method: "POST",
          url: "https://v.anxia.com/webapi/files/history",
          headers: {
            "Content-Type": "application/x-www-form-urlencoded"
          },
          cookie: `CID=${(_a = cookie.find((item) => item.name === "CID")) == null ? void 0 : _a.value};SEID=${(_b = cookie.find((item) => item.name === "SEID")) == null ? void 0 : _b.value};UID=${(_c = cookie.find((item) => item.name === "UID")) == null ? void 0 : _c.value}`,
          anonymous: true,
          data: `op=update&pick_code=${code}&time=${time}&definition=0&category=1&share_id=0`
        });
      };
      const handleVideoClose = () => {
        if (saveTimer.value) {
          clearInterval(saveTimer.value);
          saveTimer.value = null;
        }
        if (player.value) {
          player.value.destroy();
          player.value = null;
        }
        show.value = false;
      };
      const handleMenuUpdate = async (value) => {
        try {
          if (player.value) {
            const videoIndex = videoList.value.findIndex((item) => item.code === value);
            if (!videoList.value[videoIndex].url) {
              videoList.value[videoIndex].url = await getVideoUrl(value);
              videoList.value[videoIndex].time = await getVideoHistory(value) || 0;
            }
            if (saveTimer.value) {
              clearInterval(saveTimer.value);
              saveTimer.value = null;
            }
            player.value.src = videoList.value[videoIndex].url;
            if (!settings || settings.video.autoplay) {
              player.value.play();
            }
            if (!settings || settings.video.history) {
              player.value.currentTime = videoList.value[videoIndex].time;
              saveTimer.value = setInterval(() => {
                if (player.value.paused) {
                  return;
                }
                const time = player.value.currentTime;
                if (time && Math.floor(time) !== videoList.value[videoIndex].time) {
                  videoList.value[videoIndex].time = Math.floor(time);
                  setVideoHistory(value, Math.floor(time));
                }
              }, 5e3);
            }
          }
        } catch (error) {
          console.error(error);
          message2.error(`视频播放失败,错误信息:${error}`);
        }
      };
      return (_ctx, _cache) => {
        const _component_NMenu = naiveUi.NMenu;
        const _component_NLayoutSider = naiveUi.NLayoutSider;
        const _component_NLayout = naiveUi.NLayout;
        const _component_NModal = naiveUi.NModal;
        return vue.openBlock(), vue.createBlock(_component_NModal, {
          show: show.value,
          "onUpdate:show": _cache[1] || (_cache[1] = ($event) => show.value = $event),
          style: { "width": "60%" },
          title: "视频播放",
          preset: "card",
          bordered: false,
          onAfterLeave: handleVideoClose
        }, {
          default: vue.withCtx(() => [
            vue.createVNode(_component_NLayout, {
              "has-sider": "",
              "content-style": { height: vue.unref(layoutHeight) + "px" }
            }, {
              default: vue.withCtx(() => [
                vue.createVNode(_component_NLayoutSider, {
                  "native-scrollbar": false,
                  bordered: ""
                }, {
                  default: vue.withCtx(() => [
                    vue.createVNode(_component_NMenu, {
                      value: vue.unref(menuValue),
                      "onUpdate:value": [
                        _cache[0] || (_cache[0] = ($event) => vue.isRef(menuValue) ? menuValue.value = $event : null),
                        handleMenuUpdate
                      ],
                      options: vue.unref(menuOptions),
                      "theme-overrides": vue.unref(menuThemeOverrides)
                    }, null, 8, ["value", "options", "theme-overrides"])
                  ]),
                  _: 1
                }),
                vue.createVNode(_component_NLayout, { "native-scrollbar": false }, {
                  default: vue.withCtx(() => [
                    vue.createElementVNode("div", {
                      ref_key: "videoRef",
                      ref: videoRef,
                      class: "video-js"
                    }, null, 512)
                  ]),
                  _: 1
                })
              ]),
              _: 1
            }, 8, ["content-style"])
          ]),
          _: 1
        }, 8, ["show"]);
      };
    }
  });
  const _hoisted_1 = { style: { "display": "flex", "justify-content": "space-between" } };
  const _hoisted_2 = { style: { "display": "flex", "justify-content": "space-between" } };
  const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
    __name: "OfflineDownloadModal",
    props: /* @__PURE__ */ vue.mergeModels({
      signData: {},
      downPath: {}
    }, {
      "show": {
        type: Boolean,
        default: false
      },
      "showModifiers": {}
    }),
    emits: ["update:show"],
    setup(__props) {
      const show = vue.useModel(__props, "show");
      const props = __props;
      const message2 = naiveUi.useMessage();
      const url = vue.ref("");
      const pathId = vue.ref("");
      const countData = vue.ref({
        used: 0,
        count: 0
      });
      const showCaptcha = vue.ref(false);
      const iframe = vue.ref(null);
      const showResult = vue.ref(false);
      const resultData = vue.ref({
        success: 0,
        fail: 0,
        list: []
      });
      const resultTitle = vue.computed(() => {
        return (resultData.value.success ? resultData.value.success + "个任务添加成功," : "") + resultData.value.fail + "个任务添加失败";
      });
      vue.watch(show, (value) => {
        if (value) {
          getCount();
        }
      });
      const getCount = async () => {
        try {
          const res = await request({
            url: `https://115.com/web/lixian/?ct=lixian&ac=get_quota_package_info`,
            method: "GET"
          });
          const json = JSON.parse(res.responseText);
          countData.value.used = json.used;
          countData.value.count = json.count;
          if (json.used >= json.count) {
            message2.error("本月配额已用完");
          }
        } catch (error) {
          message2.error(error);
        }
      };
      const handleDownload = async () => {
        if (!url.value) {
          message2.error("下载链接不能为空");
          return;
        }
        if (pathId.value && !/^\d+$/.test(pathId.value)) {
          message2.error("文件夹ID只能为数字");
          return;
        }
        try {
          const sp = new URLSearchParams();
          sp.append("savepath", "");
          sp.append("wp_path_id", pathId.value ? pathId.value : props.downPath.file_id);
          const urls = url.value.split("\n").filter((item) => item.trim());
          if (urls.length > 1) {
            urls.forEach((item, index) => {
              sp.append(`url[${index}]`, item);
            });
          } else {
            sp.append("url", urls[0]);
          }
          sp.append("uid", props.downPath.user_id);
          sp.append("sign", props.signData.sign);
          sp.append("time", props.signData.time);
          const res = await request({
            url: `https://115.com/web/lixian/?ct=lixian&ac=add_task_url${urls.length > 1 ? "s" : ""}`,
            method: "POST",
            data: sp,
            headers: {
              "Content-Type": "application/x-www-form-urlencoded",
              Accept: "application/json, text/javascript, */*; q=0.01",
              Origin: "https://115.com",
              "X-Requested-With": "XMLHttpRequest"
            }
          });
          const json = JSON.parse(res.responseText);
          if (json.state) {
            if (urls.length > 1) {
              json.result.forEach((item) => {
                if (item.state) {
                  resultData.value.success++;
                } else {
                  resultData.value.fail++;
                  resultData.value.list.push({ url: item.url, error: item.error_msg || "未知原因" });
                }
              });
              if (resultData.value.fail) {
                showResult.value = true;
                return;
              }
            }
            message2.success("添加下载成功");
            show.value = false;
            url.value = "";
            pathId.value = "";
          } else {
            if (json.errcode === 911) {
              message2.warning(json.error_msg);
              showCaptcha.value = true;
              vue.nextTick(() => {
                if (iframe.value) {
                  iframe.value.onload = () => {
                    var _a;
                    const contentWindow = (_a = iframe.value) == null ? void 0 : _a.contentWindow;
                    const iframeUrl = contentWindow == null ? void 0 : contentWindow.location.href;
                    if (iframeUrl !== "https://captchaapi.115.com/?ac=security_code&type=web") {
                      message2.success("验证成功, 请重试");
                      showCaptcha.value = false;
                    }
                  };
                }
              });
            } else {
              if (json.error_msg) {
                throw json.error_msg;
              } else {
                throw "添加失败";
              }
            }
          }
        } catch (error) {
          message2.error(error);
        }
      };
      const handleCencel = () => {
        showResult.value = false;
        show.value = false;
      };
      return (_ctx, _cache) => {
        const _component_NInput = naiveUi.NInput;
        const _component_NFormItem = naiveUi.NFormItem;
        const _component_NButton = naiveUi.NButton;
        const _component_NModal = naiveUi.NModal;
        const _component_NEllipsis = naiveUi.NEllipsis;
        const _component_NText = naiveUi.NText;
        const _component_NListItem = naiveUi.NListItem;
        const _component_NScrollbar = naiveUi.NScrollbar;
        const _component_NList = naiveUi.NList;
        const _component_NSpace = naiveUi.NSpace;
        const _component_NResult = naiveUi.NResult;
        return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
          vue.createVNode(_component_NModal, {
            show: show.value,
            "onUpdate:show": _cache[2] || (_cache[2] = ($event) => show.value = $event),
            style: { "width": "40%" },
            title: "添加离线下载",
            preset: "card",
            bordered: false
          }, {
            action: vue.withCtx(() => [
              vue.createElementVNode("div", _hoisted_1, [
                vue.createElementVNode("div", null, "本月配额:剩" + vue.toDisplayString(vue.unref(countData).count - vue.unref(countData).used) + "/总" + vue.toDisplayString(vue.unref(countData).count), 1),
                vue.createElementVNode("div", null, [
                  vue.createVNode(_component_NButton, {
                    type: "primary",
                    disabled: vue.unref(countData).used >= vue.unref(countData).count,
                    onClick: handleDownload
                  }, {
                    default: vue.withCtx(() => _cache[7] || (_cache[7] = [
                      vue.createTextVNode(" 开始下载 ")
                    ])),
                    _: 1
                  }, 8, ["disabled"])
                ])
              ])
            ]),
            default: vue.withCtx(() => [
              vue.createElementVNode("div", null, [
                vue.createVNode(_component_NInput, {
                  value: vue.unref(url),
                  "onUpdate:value": _cache[0] || (_cache[0] = ($event) => vue.isRef(url) ? url.value = $event : null),
                  type: "textarea",
                  placeholder: "支持HTTP、HTTPS、FTP、磁力链和电驴链接,换行可添加多个",
                  clearable: "",
                  rows: 10
                }, null, 8, ["value"]),
                vue.createVNode(_component_NFormItem, {
                  label: "保存到:",
                  "label-placement": "left",
                  style: { "margin-top": "10px" }
                }, {
                  default: vue.withCtx(() => [
                    vue.createVNode(_component_NInput, {
                      value: vue.unref(pathId),
                      "onUpdate:value": _cache[1] || (_cache[1] = ($event) => vue.isRef(pathId) ? pathId.value = $event : null),
                      placeholder: "暂时只支持填入文件夹ID,不填默认云下载文件夹"
                    }, null, 8, ["value"])
                  ]),
                  _: 1
                })
              ])
            ]),
            _: 1
          }, 8, ["show"]),
          vue.createVNode(_component_NModal, {
            show: vue.unref(showCaptcha),
            "onUpdate:show": _cache[3] || (_cache[3] = ($event) => vue.isRef(showCaptcha) ? showCaptcha.value = $event : null),
            title: "验证账号",
            style: { "width": "360px" },
            preset: "card"
          }, {
            default: vue.withCtx(() => [
              vue.createElementVNode("iframe", {
                ref_key: "iframe",
                ref: iframe,
                src: "https://captchaapi.115.com/?ac=security_code&type=web",
                style: { "width": "100%", "height": "500px", "border": "none" }
              }, null, 512)
            ]),
            _: 1
          }, 8, ["show"]),
          vue.createVNode(_component_NModal, {
            show: vue.unref(showResult),
            "onUpdate:show": _cache[5] || (_cache[5] = ($event) => vue.isRef(showResult) ? showResult.value = $event : null),
            title: "下载任务错误列表",
            style: { "width": "40%" },
            preset: "card",
            "close-on-esc": false,
            "mask-closable": false,
            onAfterLeave: _cache[6] || (_cache[6] = () => {
              vue.unref(resultData).success = 0;
              vue.unref(resultData).fail = 0;
              vue.unref(resultData).list = [];
            })
          }, {
            default: vue.withCtx(() => [
              vue.createVNode(_component_NResult, {
                status: "warning",
                size: "small",
                title: vue.unref(resultTitle)
              }, {
                footer: vue.withCtx(() => [
                  vue.createVNode(_component_NSpace, { justify: "end" }, {
                    default: vue.withCtx(() => [
                      vue.createVNode(_component_NButton, { onClick: handleCencel }, {
                        default: vue.withCtx(() => _cache[9] || (_cache[9] = [
                          vue.createTextVNode("取消")
                        ])),
                        _: 1
                      }),
                      vue.createVNode(_component_NButton, {
                        type: "primary",
                        onClick: _cache[4] || (_cache[4] = ($event) => showResult.value = false)
                      }, {
                        default: vue.withCtx(() => _cache[10] || (_cache[10] = [
                          vue.createTextVNode("重试")
                        ])),
                        _: 1
                      })
                    ]),
                    _: 1
                  })
                ]),
                default: vue.withCtx(() => [
                  vue.createVNode(_component_NList, null, {
                    header: vue.withCtx(() => _cache[8] || (_cache[8] = [
                      vue.createTextVNode(" 失败任务列表: ")
                    ])),
                    default: vue.withCtx(() => [
                      vue.createVNode(_component_NScrollbar, { style: { "max-height": "120px" } }, {
                        default: vue.withCtx(() => [
                          (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(resultData).list, (item, index) => {
                            return vue.openBlock(), vue.createBlock(_component_NListItem, { key: index }, {
                              default: vue.withCtx(() => [
                                vue.createElementVNode("div", _hoisted_2, [
                                  vue.createVNode(_component_NEllipsis, { style: { "max-width": "300px" } }, {
                                    default: vue.withCtx(() => [
                                      vue.createTextVNode(vue.toDisplayString(item.url), 1)
                                    ]),
                                    _: 2
                                  }, 1024),
                                  vue.createElementVNode("div", null, [
                                    vue.createVNode(_component_NText, { type: "error" }, {
                                      default: vue.withCtx(() => [
                                        vue.createTextVNode(vue.toDisplayString(item.error), 1)
                                      ]),
                                      _: 2
                                    }, 1024)
                                  ])
                                ])
                              ]),
                              _: 2
                            }, 1024);
                          }), 128))
                        ]),
                        _: 1
                      })
                    ]),
                    _: 1
                  })
                ]),
                _: 1
              }, 8, ["title"])
            ]),
            _: 1
          }, 8, ["show"])
        ], 64);
      };
    }
  });
  /**
   * filesize
   *
   * @copyright 2024 Jason Mulligan <[email protected]>
   * @license BSD-3-Clause
   * @version 10.1.6
   */
  const ARRAY = "array";
  const BIT = "bit";
  const BITS = "bits";
  const BYTE = "byte";
  const BYTES = "bytes";
  const EMPTY = "";
  const EXPONENT = "exponent";
  const FUNCTION = "function";
  const IEC = "iec";
  const INVALID_NUMBER = "Invalid number";
  const INVALID_ROUND = "Invalid rounding method";
  const JEDEC = "jedec";
  const OBJECT = "object";
  const PERIOD = ".";
  const ROUND = "round";
  const S = "s";
  const SI = "si";
  const SI_KBIT = "kbit";
  const SI_KBYTE = "kB";
  const SPACE = " ";
  const STRING = "string";
  const ZERO = "0";
  const STRINGS = {
    symbol: {
      iec: {
        bits: ["bit", "Kibit", "Mibit", "Gibit", "Tibit", "Pibit", "Eibit", "Zibit", "Yibit"],
        bytes: ["B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB"]
      },
      jedec: {
        bits: ["bit", "Kbit", "Mbit", "Gbit", "Tbit", "Pbit", "Ebit", "Zbit", "Ybit"],
        bytes: ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"]
      }
    },
    fullform: {
      iec: ["", "kibi", "mebi", "gibi", "tebi", "pebi", "exbi", "zebi", "yobi"],
      jedec: ["", "kilo", "mega", "giga", "tera", "peta", "exa", "zetta", "yotta"]
    }
  };
  function filesize(arg, {
    bits = false,
    pad = false,
    base = -1,
    round = 2,
    locale = EMPTY,
    localeOptions = {},
    separator = EMPTY,
    spacer = SPACE,
    symbols = {},
    standard = EMPTY,
    output = STRING,
    fullform = false,
    fullforms = [],
    exponent = -1,
    roundingMethod = ROUND,
    precision = 0
  } = {}) {
    let e = exponent, num = Number(arg), result = [], val = 0, u = EMPTY;
    if (standard === SI) {
      base = 10;
      standard = JEDEC;
    } else if (standard === IEC || standard === JEDEC) {
      base = 2;
    } else if (base === 2) {
      standard = IEC;
    } else {
      base = 10;
      standard = JEDEC;
    }
    const ceil = base === 10 ? 1e3 : 1024, full = fullform === true, neg = num < 0, roundingFunc = Math[roundingMethod];
    if (typeof arg !== "bigint" && isNaN(arg)) {
      throw new TypeError(INVALID_NUMBER);
    }
    if (typeof roundingFunc !== FUNCTION) {
      throw new TypeError(INVALID_ROUND);
    }
    if (neg) {
      num = -num;
    }
    if (e === -1 || isNaN(e)) {
      e = Math.floor(Math.log(num) / Math.log(ceil));
      if (e < 0) {
        e = 0;
      }
    }
    if (e > 8) {
      if (precision > 0) {
        precision += 8 - e;
      }
      e = 8;
    }
    if (output === EXPONENT) {
      return e;
    }
    if (num === 0) {
      result[0] = 0;
      u = result[1] = STRINGS.symbol[standard][bits ? BITS : BYTES][e];
    } else {
      val = num / (base === 2 ? Math.pow(2, e * 10) : Math.pow(1e3, e));
      if (bits) {
        val = val * 8;
        if (val >= ceil && e < 8) {
          val = val / ceil;
          e++;
        }
      }
      const p = Math.pow(10, e > 0 ? round : 0);
      result[0] = roundingFunc(val * p) / p;
      if (result[0] === ceil && e < 8 && exponent === -1) {
        result[0] = 1;
        e++;
      }
      u = result[1] = base === 10 && e === 1 ? bits ? SI_KBIT : SI_KBYTE : STRINGS.symbol[standard][bits ? BITS : BYTES][e];
    }
    if (neg) {
      result[0] = -result[0];
    }
    if (precision > 0) {
      result[0] = result[0].toPrecision(precision);
    }
    result[1] = symbols[result[1]] || result[1];
    if (locale === true) {
      result[0] = result[0].toLocaleString();
    } else if (locale.length > 0) {
      result[0] = result[0].toLocaleString(locale, localeOptions);
    } else if (separator.length > 0) {
      result[0] = result[0].toString().replace(PERIOD, separator);
    }
    if (pad && round > 0) {
      const i = result[0].toString(), x = separator || ((i.match(/(\D)/g) || []).pop() || PERIOD), tmp = i.toString().split(x), s = tmp[1] || EMPTY, l = s.length, n = round - l;
      result[0] = `${tmp[0]}${x}${s.padEnd(l + n, ZERO)}`;
    }
    if (full) {
      result[1] = fullforms[e] ? fullforms[e] : STRINGS.fullform[standard][e] + (bits ? BIT : BYTE) + (result[0] === 1 ? EMPTY : S);
    }
    return output === ARRAY ? result : output === OBJECT ? {
      value: result[0],
      symbol: result[1],
      exponent: e,
      unit: u
    } : result.join(spacer);
  }
  const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
    __name: "CloudDownloadModal",
    props: /* @__PURE__ */ vue.mergeModels({
      signData: {},
      downPath: {}
    }, {
      "show": {
        type: Boolean,
        default: false
      },
      "showModifiers": {}
    }),
    emits: ["update:show"],
    setup(__props) {
      const show = vue.useModel(__props, "show");
      const props = __props;
      const message2 = naiveUi.useMessage();
      const dialog = naiveUi.useDialog();
      const {
        copy
      } = useClipboard();
      const columns = [{
        title: "文件名",
        key: "name"
      }, {
        title: "大小",
        key: "size",
        width: 100,
        render(row) {
          return filesize(row.size, {
            standard: "jedec"
          });
        }
      }, {
        title: "进度",
        key: "percentDone",
        width: 300,
        render(row) {
          if (row.percentDone === 100) {
            return "已完成";
          } else {
            return vue.createVNode(naiveUi.NProgress, {
              "type": "line",
              "percentage": Math.floor(row.percentDone),
              "processing": true
            }, null);
          }
        }
      }, {
        title: "操作",
        key: "action",
        width: 150,
        render: (row) => {
          return vue.createVNode(naiveUi.NSpace, null, {
            default: () => [row.file_id ? vue.createVNode(naiveUi.NButton, {
              "text": true,
              "onClick": () => _GM_openInTab(`https://115.com/?cid=${row.file_id}&offset=0&tab=&mode=wangpan`, {
                setParent: settings == null ? void 0 : settings.openNewTab.setParent
              })
            }, {
              icon: () => vue.createVNode(naiveUi.NIcon, null, {
                default: () => [vue.createVNode(FolderOutlined, null, null)]
              })
            }) : null, vue.createVNode(naiveUi.NButton, {
              "text": true,
              "onClick": async () => {
                await copy(row.url);
                message2.success("复制成功!");
              }
            }, {
              icon: () => vue.createVNode(naiveUi.NIcon, null, {
                default: () => [vue.createVNode(CopyOutlined, null, null)]
              })
            }), vue.createVNode(naiveUi.NButton, {
              "text": true,
              "onClick": () => {
                dialog.warning({
                  title: "信息提示",
                  content: () => vue.createVNode("div", {
                    "style": {
                      display: "flex",
                      flexDirection: "column",
                      alignItems: "center"
                    }
                  }, [vue.createVNode("div", {
                    "style": {
                      marginBottom: "10px"
                    }
                  }, [vue.createTextVNode("是否确认删除该下载任务?")]), vue.createVNode(naiveUi.NCheckbox, {
                    "checked": flag.value,
                    "onUpdate:checked": ($event) => flag.value = $event,
                    "checked-value": 1,
                    "unchecked-value": 0
                  }, {
                    default: () => [vue.createTextVNode("删除源文件")]
                  })]),
                  positiveText: "确定",
                  negativeText: "取消",
                  onPositiveClick: () => {
                    handleDelete(row.info_hash);
                  }
                });
              }
            }, {
              icon: () => vue.createVNode(naiveUi.NIcon, null, {
                default: () => [vue.createVNode(DeleteOutlined, null, null)]
              })
            })]
          });
        }
      }];
      const data = vue.ref([]);
      const pagination = vue.reactive({
        page: 1,
        pageCount: 1,
        pageSize: 30
      });
      const loading = vue.ref(false);
      const flag = vue.ref(0);
      vue.onMounted(() => {
        if (settings == null ? void 0 : settings.oldButton.deleteSource) {
          flag.value = 1;
        }
      });
      vue.watch(show, (value) => {
        if (value) {
          getList();
        }
      });
      const getList = async (page) => {
        try {
          loading.value = true;
          const sp = new URLSearchParams();
          sp.append("sign", props.signData.sign);
          sp.append("time", props.signData.time);
          sp.append("page", page ? page.toString() : pagination.page.toString());
          sp.append("uid", props.downPath.user_id);
          const res = await request({
            url: `https://115.com/web/lixian/?ct=lixian&ac=task_lists`,
            method: "POST",
            data: sp,
            headers: {
              "Content-Type": "application/x-www-form-urlencoded"
            }
          });
          const json = JSON.parse(res.responseText);
          if (json.state) {
            data.value = json.tasks;
            pagination.page = json.page;
            pagination.pageCount = json.page_count;
            pagination.itemCount = json.count;
          } else {
            if (json.error) {
              throw new Error(json.error);
            } else {
              throw new Error("获取签名失败");
            }
          }
        } catch (error) {
          message2.error(error);
        } finally {
          loading.value = false;
        }
      };
      const handlePageChange = (page) => {
        getList(page);
      };
      const handleDelete = async (hash) => {
        try {
          const sp = new URLSearchParams();
          sp.append("sign", props.signData.sign);
          sp.append("time", props.signData.time);
          sp.append("hash[0]", hash);
          sp.append("uid", props.downPath.user_id);
          if (flag.value) {
            sp.append("flag", flag.value.toString());
          }
          const res = await request({
            url: `https://115.com/web/lixian/?ct=lixian&ac=task_del`,
            method: "POST",
            data: sp,
            headers: {
              "Content-Type": "application/x-www-form-urlencoded"
            }
          });
          const json = JSON.parse(res.responseText);
          if (json.state) {
            message2.success("删除成功");
            getList();
          } else {
            if (json.error) {
              throw new Error(json.error);
            } else {
              throw new Error("删除失败");
            }
          }
        } catch (error) {
          message2.error(error);
        }
      };
      return (_ctx, _cache) => {
        const _component_NDataTable = naiveUi.NDataTable;
        const _component_NModal = naiveUi.NModal;
        return vue.openBlock(), vue.createBlock(_component_NModal, {
          show: show.value,
          "onUpdate:show": _cache[0] || (_cache[0] = ($event) => show.value = $event),
          style: {
            "width": "80%"
          },
          title: "云下载",
          preset: "card",
          bordered: false
        }, {
          default: vue.withCtx(() => [vue.createVNode(_component_NDataTable, {
            remote: "",
            "flex-height": "",
            columns,
            data: vue.unref(data),
            pagination: vue.unref(pagination),
            "row-key": (row) => row.info_hash,
            loading: vue.unref(loading),
            style: {
              "height": "70vh"
            },
            "onUpdate:page": handlePageChange
          }, null, 8, ["data", "pagination", "row-key", "loading"])]),
          _: 1
        }, 8, ["show"]);
      };
    }
  });
  const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
    __name: "AppContent",
    setup(__props) {
      const message2 = naiveUi.useMessage();
      const isLeft = usePageLeave();
      const bc = new BroadcastChannel("115Plus");
      const showList = vue.ref(false);
      const showDownload = vue.ref(false);
      const showVideo = vue.ref(false);
      const videoList = vue.ref([]);
      const signData = vue.ref({
        sign: "",
        time: ""
      });
      const downPath = vue.ref({
        file_id: "",
        user_id: ""
      });
      vue.onMounted(async () => {
        bc.onmessage = (event) => {
          console.log(event.data);
          if (isLeft.value || event.data.url !== window.location.href) {
            return;
          }
          if (event.data.type === "CloudDownload") {
            showList.value = true;
          } else if (event.data.type === "VideoPlay") {
            videoList.value = JSON.parse(event.data.data);
            showVideo.value = true;
          } else if (event.data.type === "OfflineDownload") {
            showDownload.value = true;
          }
        };
        const cookies = await getCookie();
        if (cookies.find((item) => item.name === "UID")) {
          getSign();
          getDownPath();
        }
      });
      const getSign = async () => {
        try {
          const res = await request({
            url: `https://115.com/?ct=offline&ac=space&_${Date.now()}`,
            method: "GET"
          });
          const json = JSON.parse(res.responseText);
          if (json.state) {
            signData.value.sign = json.sign;
            signData.value.time = json.time;
          } else {
            if (json.error) {
              throw new Error(json.error);
            } else {
              throw new Error("获取签名失败");
            }
          }
        } catch (error) {
          message2.error(error);
        }
      };
      const getDownPath = async () => {
        try {
          const res = await request({
            url: `https://webapi.115.com/offine/downpath`,
            method: "GET"
          });
          const json = JSON.parse(res.responseText);
          if (json.state) {
            downPath.value.file_id = json.data[0].file_id;
            downPath.value.user_id = json.data[0].user_id;
          } else {
            if (json.error) {
              throw new Error(json.error);
            } else {
              throw new Error("获取云下载路径失败");
            }
          }
        } catch (error) {
          message2.error(error);
        }
      };
      return (_ctx, _cache) => {
        const _component_CloudDownloadModal = _sfc_main$2;
        const _component_OfflineDownloadModal = _sfc_main$3;
        const _component_VideoModal = _sfc_main$4;
        return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
          vue.createVNode(_component_CloudDownloadModal, {
            show: vue.unref(showList),
            "onUpdate:show": _cache[0] || (_cache[0] = ($event) => vue.isRef(showList) ? showList.value = $event : null),
            "down-path": vue.unref(downPath),
            "sign-data": vue.unref(signData)
          }, null, 8, ["show", "down-path", "sign-data"]),
          vue.createVNode(_component_OfflineDownloadModal, {
            show: vue.unref(showDownload),
            "onUpdate:show": _cache[1] || (_cache[1] = ($event) => vue.isRef(showDownload) ? showDownload.value = $event : null),
            "down-path": vue.unref(downPath),
            "sign-data": vue.unref(signData)
          }, null, 8, ["show", "down-path", "sign-data"]),
          vue.createVNode(_component_VideoModal, {
            show: vue.unref(showVideo),
            "onUpdate:show": _cache[2] || (_cache[2] = ($event) => vue.isRef(showVideo) ? showVideo.value = $event : null),
            data: vue.unref(videoList)
          }, null, 8, ["show", "data"])
        ], 64);
      };
    }
  });
  const _sfc_main = /* @__PURE__ */ vue.defineComponent({
    __name: "App",
    setup(__props) {
      const theme = useTheme();
      return (_ctx, _cache) => {
        const _component_AppContent = _sfc_main$1;
        const _component_NMessageProvider = naiveUi.NMessageProvider;
        const _component_NModalProvider = naiveUi.NModalProvider;
        const _component_NDialogProvider = naiveUi.NDialogProvider;
        const _component_NConfigProvider = naiveUi.NConfigProvider;
        return vue.openBlock(), vue.createBlock(_component_NConfigProvider, { theme: vue.unref(theme) }, {
          default: vue.withCtx(() => [
            vue.createVNode(_component_NDialogProvider, null, {
              default: vue.withCtx(() => [
                vue.createVNode(_component_NModalProvider, null, {
                  default: vue.withCtx(() => [
                    vue.createVNode(_component_NMessageProvider, null, {
                      default: vue.withCtx(() => [
                        vue.createVNode(_component_AppContent)
                      ]),
                      _: 1
                    })
                  ]),
                  _: 1
                })
              ]),
              _: 1
            })
          ]),
          _: 1
        }, 8, ["theme"]);
      };
    }
  });
  const { message } = naiveUi.createDiscreteApi(["message"]);
  if (settings) {
    let newSettings = settings;
    let flag = false;
    if (!settings.darkMode) {
      newSettings = {
        ...newSettings,
        darkMode: {
          enable: false
        }
      };
      flag = true;
    }
    if (!settings.fp) {
      newSettings = {
        ...newSettings,
        fp: {
          enable: true
        }
      };
      flag = true;
    }
    if (typeof settings.oldButton.deleteSource !== "boolean") {
      newSettings = {
        ...newSettings,
        oldButton: {
          enable: settings.oldButton.enable,
          deleteSource: true
        }
      };
      flag = true;
    }
    if (typeof settings.openNewTab.setParent !== "boolean") {
      newSettings = {
        ...newSettings,
        openNewTab: {
          enable: settings.openNewTab.enable,
          setParent: false
        }
      };
      flag = true;
    }
    _GM_setValue("settings", newSettings);
    if (flag) {
      message.loading("115+ 功能更新中,即将刷新页面……");
      setTimeout(() => {
        window.location.reload();
      }, 3e3);
    }
  }
  if (window.top === window.self) {
    vue.createApp(_sfc_main).mount(
      (() => {
        const body = document.querySelector("body");
        const app = document.createElement("div");
        if (body) {
          body.appendChild(app);
        }
        return app;
      })()
    );
  }
  vue.createApp(Setting).mount(
    (() => {
      const top_side = document.querySelector(".top-side");
      const setting = document.createElement("div");
      if (top_side) {
        top_side.appendChild(setting);
      }
      return setting;
    })()
  );
  if (!settings || settings.sidebar.enable) {
    vue.createApp(_sfc_main$9).mount(
      (() => {
        const wrap_hflow = document.getElementsByClassName("wrap-hflow")[0];
        const site_left_bar = document.getElementById("site_left_bar");
        const sidebar = document.createElement("div");
        sidebar.addEventListener("mousedown", (e) => {
          e.stopPropagation();
        });
        if (site_left_bar && wrap_hflow) {
          wrap_hflow.insertBefore(sidebar, site_left_bar);
          wrap_hflow.removeChild(site_left_bar);
        }
        return sidebar;
      })()
    );
  }
  if (!settings || settings.download.enable || settings.openNewTab.enable || settings.video.enable) {
    vue.createApp(_sfc_main$7).mount(
      (() => {
        const js_top_header_file_path_box = document.getElementById("js_top_header_file_path_box");
        const download = document.createElement("div");
        download.addEventListener("mousedown", (e) => {
          e.stopPropagation();
        });
        if (js_top_header_file_path_box) {
          js_top_header_file_path_box.appendChild(download);
        }
        return download;
      })()
    );
  }
  if (!settings || settings.oldButton.enable) {
    vue.createApp(_sfc_main$5).mount(
      (() => {
        const upload_btn_add_dir = document.querySelector(
          'a[data-dropdown-tab="upload_btn_add_dir"]'
        );
        const cloudDownload = document.createElement("div");
        cloudDownload.addEventListener("mousedown", (e) => {
          e.stopPropagation();
        });
        cloudDownload.style.display = "inline-block";
        if (upload_btn_add_dir) {
          upload_btn_add_dir.parentNode.insertBefore(cloudDownload, upload_btn_add_dir.nextSibling);
        }
        return cloudDownload;
      })()
    );
  }
  if (!settings || settings.fp.enable) {
    const observer = new MutationObserver((mutationsList) => {
      mutationsList.some((mutation) => {
        if (mutation.type === "childList" && mutation.addedNodes.length > 0) {
          const fp = document.querySelector('div[class|="fp"]');
          if (fp && fp.style.display !== "none") {
            fp.style.display = "none";
          }
          return true;
        }
        return false;
      });
    });
    observer.observe(document.querySelector("body"), { childList: true });
  }

})(Vue, naive, CryptoJS, bigInt, Player, HlsJsPlugin);