Files
CloudFlare-ImgBed/frontend-dist/js/800.e2c8a8a6.js
T

2 lines
110 KiB
JavaScript

(self["webpackChunksanyue_imghub"]=self["webpackChunksanyue_imghub"]||[]).push([[800],{213:function(e,t,o){"use strict";o(85331),o(19104)},732:function(e,t,o){"use strict";o.d(t,{A:function(){return p}});var s=o(56768),a=o(24232);const l=["href","target"],i=["alt","src"];function n(e,t,o,n,r,d){return(0,s.uX)(),(0,s.CE)("a",{href:d.logoHref,target:o.target,class:(0,a.C4)(e.logo-e.link)},[(0,s.Lk)("img",{class:(0,a.C4)(d.logoClasses),alt:o.alt,src:d.logoUrl},null,10,i)],10,l)}var r=o(60782),d={name:"Logo",props:{href:{type:String,default:"https://github.com/MarSeventh/CloudFlare-ImgBed"},target:{type:String,default:"_blank",validator:e=>["_blank","_self","_parent","_top"].includes(e)},alt:{type:String,default:"Sanyue logo"},customSrc:{type:String,default:""},position:{type:String,default:"fixed",validator:e=>["fixed","relative","absolute","static"].includes(e)},size:{type:String,default:"normal",validator:e=>["small","normal","large"].includes(e)},enableHover:{type:Boolean,default:!0},useConfigLink:{type:Boolean,default:!1}},computed:{...(0,r.L8)(["userConfig"]),logoUrl(){return this.customSrc||this.userConfig?.logoUrl||o(33153)},logoHref(){return this.useConfigLink&&this.userConfig?.logoLink?this.userConfig.logoLink:this.href},logoClasses(){return{logo:!0,[`logo--${this.position}`]:!0,[`logo--${this.size}`]:!0,"logo--hover-enabled":this.enableHover}}}},c=o(71241);const u=(0,c.A)(d,[["render",n],["__scopeId","data-v-17f54292"]]);var p=u},808:function(e,t,o){"use strict";o.d(t,{A:function(){return m}});var s=o(56768),a=o(45130),l=o(24232);const i={id:"themeMask"},n=["cx","cy","r"],r=["r"],d=["opacity"];function c(e,t,o,c,u,p){const h=(0,s.g2)("font-awesome-icon");return(0,s.uX)(),(0,s.CE)("div",{id:"themeToggle",onClick:t[0]||(t[0]=(...e)=>p.handleToggleClick&&p.handleToggleClick(...e))},[(0,s.bF)(a.eB,{name:"icon-fade",mode:"out-in"},{default:(0,s.k6)(()=>[u.isAuto?((0,s.uX)(),(0,s.Wv)(h,{key:"auto-mode",icon:"circle-half-stroke",class:"auto-icon",style:{"font-size":"1.5em",color:"var(--theme-toggle-color)"}})):((0,s.uX)(),(0,s.CE)("svg",{key:"sun-moon",class:(0,l.C4)(["theme_toggle_svg",{dark:u.isDark}]),width:"1.5em",height:"1.5em",viewBox:"0 0 24 24",fill:"none","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",stroke:"currentColor"},[(0,s.Lk)("mask",i,[t[1]||(t[1]=(0,s.Lk)("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:"white"},null,-1)),(0,s.Lk)("circle",{class:"theme_toggle_circle1",fill:"black",cx:u.isDark?"50%":"100%",cy:u.isDark?"23%":"0%",r:u.isDark?"9":"5"},null,8,n)]),(0,s.Lk)("circle",{class:"theme_toggle_circle2",cx:"12",cy:"12",r:u.isDark?"9":"5",mask:"url(#themeMask)"},null,8,r),(0,s.Lk)("g",{class:"theme_toggle_g",stroke:"currentColor",opacity:u.isDark?0:1},[...t[2]||(t[2]=[(0,s.Lk)("line",{x1:"12",y1:"1",x2:"12",y2:"3"},null,-1),(0,s.Lk)("line",{x1:"12",y1:"21",x2:"12",y2:"23"},null,-1),(0,s.Lk)("line",{x1:"4.22",y1:"4.22",x2:"5.64",y2:"5.64"},null,-1),(0,s.Lk)("line",{x1:"18.36",y1:"18.36",x2:"19.78",y2:"19.78"},null,-1),(0,s.Lk)("line",{x1:"1",y1:"12",x2:"3",y2:"12"},null,-1),(0,s.Lk)("line",{x1:"21",y1:"12",x2:"23",y2:"12"},null,-1),(0,s.Lk)("line",{x1:"4.22",y1:"19.78",x2:"5.64",y2:"18.36"},null,-1),(0,s.Lk)("line",{x1:"18.36",y1:"5.64",x2:"19.78",y2:"4.22"},null,-1)])],8,d)],2))]),_:1})])}var u={name:"ToggleDark",data(){return{isDark:this.$store.getters.useDarkMode,isAuto:!this.$store.getters.cusDarkMode}},methods:{handleToggleClick(){this.isAuto?(this.isDark=!1,this.isAuto=!1,this.$store.commit("setCusDarkMode",!0),this.$store.commit("setUseDarkMode",!1)):this.isDark?(this.isAuto=!0,this.$store.commit("setCusDarkMode",!1)):(this.isDark=!0,this.$store.commit("setCusDarkMode",!0),this.$store.commit("setUseDarkMode",!0))}}},p=o(71241);const h=(0,p.A)(u,[["render",c],["__scopeId","data-v-c93807da"]]);var m=h},2893:function(e,t,o){"use strict";o(85331)},3261:function(e,t,o){"use strict";o(85331)},4885:function(e,t,o){"use strict";o(85331)},10456:function(e,t,o){"use strict";o(85331)},11393:function(e,t,o){o(79577),o(41549),o(49797),o(49631),o(35623),o(64979),function(t,o){e.exports=o()}(0,function(){return function(e){var t={};function o(s){if(t[s])return t[s].exports;var a=t[s]={i:s,l:!1,exports:{}};return e[s].call(a.exports,a,a.exports,o),a.l=!0,a.exports}return o.m=e,o.c=t,o.d=function(e,t,s){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:s})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var s=Object.create(null);if(o.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)o.d(s,a,function(t){return e[t]}.bind(null,a));return s},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=0)}([function(e,t,o){"use strict";var s;function a(e){return["image/png","image/jpeg","image/gif"].some(t=>t===e)}o.r(t),o.d(t,"canvastoDataURL",function(){return i}),o.d(t,"canvastoFile",function(){return n}),o.d(t,"dataURLtoFile",function(){return d}),o.d(t,"dataURLtoImage",function(){return c}),o.d(t,"downloadFile",function(){return u}),o.d(t,"filetoDataURL",function(){return p}),o.d(t,"imagetoCanvas",function(){return m}),o.d(t,"urltoBlob",function(){return g}),o.d(t,"urltoImage",function(){return f}),o.d(t,"compress",function(){return b}),o.d(t,"compressAccurately",function(){return k}),o.d(t,"EImageType",function(){return s}),function(e){e.PNG="image/png",e.JPEG="image/jpeg",e.GIF="image/gif"}(s||(s={}));var l=function(e,t,o,s){return new(o||(o=Promise))(function(a,l){function i(e){try{r(s.next(e))}catch(e){l(e)}}function n(e){try{r(s.throw(e))}catch(e){l(e)}}function r(e){var t;e.done?a(e.value):(t=e.value,t instanceof o?t:new o(function(e){e(t)})).then(i,n)}r((s=s.apply(e,t||[])).next())})};function i(e,t=.92,o=s.JPEG){return l(this,void 0,void 0,function*(){return a(o)||(o=s.JPEG),e.toDataURL(o,t)})}function n(e,t=.92,o=s.JPEG){return new Promise(s=>e.toBlob(e=>s(e),o,t))}var r=function(e,t,o,s){return new(o||(o=Promise))(function(a,l){function i(e){try{r(s.next(e))}catch(e){l(e)}}function n(e){try{r(s.throw(e))}catch(e){l(e)}}function r(e){var t;e.done?a(e.value):(t=e.value,t instanceof o?t:new o(function(e){e(t)})).then(i,n)}r((s=s.apply(e,t||[])).next())})};function d(e,t){return r(this,void 0,void 0,function*(){const o=e.split(",");let s=o[0].match(/:(.*?);/)[1];const l=atob(o[1]);let i=l.length;const n=new Uint8Array(i);for(;i--;)n[i]=l.charCodeAt(i);return a(t)&&(s=t),new Blob([n],{type:s})})}function c(e){return new Promise((t,o)=>{const s=new Image;s.onload=()=>t(s),s.onerror=()=>o(new Error("dataURLtoImage(): dataURL is illegal")),s.src=e})}function u(e,t){const o=document.createElement("a");o.href=window.URL.createObjectURL(e),o.download=t||Date.now().toString(36),document.body.appendChild(o);const s=document.createEvent("MouseEvents");s.initEvent("click",!1,!1),o.dispatchEvent(s),document.body.removeChild(o)}function p(e){return new Promise(t=>{const o=new FileReader;o.onloadend=e=>t(e.target.result),o.readAsDataURL(e)})}var h=function(e,t,o,s){return new(o||(o=Promise))(function(a,l){function i(e){try{r(s.next(e))}catch(e){l(e)}}function n(e){try{r(s.throw(e))}catch(e){l(e)}}function r(e){var t;e.done?a(e.value):(t=e.value,t instanceof o?t:new o(function(e){e(t)})).then(i,n)}r((s=s.apply(e,t||[])).next())})};function m(e,t={}){return h(this,void 0,void 0,function*(){const o=Object.assign({},t),s=document.createElement("canvas"),a=s.getContext("2d");let l,i;for(const e in o)Object.prototype.hasOwnProperty.call(o,e)&&(o[e]=Number(o[e]));if(o.scale){const t=o.scale>0&&o.scale<10?o.scale:1;i=e.width*t,l=e.height*t}else i=o.width||o.height*e.width/e.height||e.width,l=o.height||o.width*e.height/e.width||e.height;switch([5,6,7,8].some(e=>e===o.orientation)?(s.height=i,s.width=l):(s.height=l,s.width=i),o.orientation){case 3:a.rotate(180*Math.PI/180),a.drawImage(e,-s.width,-s.height,s.width,s.height);break;case 6:a.rotate(90*Math.PI/180),a.drawImage(e,0,-s.width,s.height,s.width);break;case 8:a.rotate(270*Math.PI/180),a.drawImage(e,-s.height,0,s.height,s.width);break;case 2:a.translate(s.width,0),a.scale(-1,1),a.drawImage(e,0,0,s.width,s.height);break;case 4:a.translate(s.width,0),a.scale(-1,1),a.rotate(180*Math.PI/180),a.drawImage(e,-s.width,-s.height,s.width,s.height);break;case 5:a.translate(s.width,0),a.scale(-1,1),a.rotate(90*Math.PI/180),a.drawImage(e,0,-s.width,s.height,s.width);break;case 7:a.translate(s.width,0),a.scale(-1,1),a.rotate(270*Math.PI/180),a.drawImage(e,-s.height,0,s.height,s.width);break;default:a.drawImage(e,0,0,s.width,s.height)}return s})}function g(e){return fetch(e).then(e=>e.blob())}function f(e){return new Promise((t,o)=>{const s=new Image;s.onload=()=>t(s),s.onerror=()=>o(new Error("urltoImage(): Image failed to load, please check the image URL")),s.src=e})}var y=function(e,t,o,s){return new(o||(o=Promise))(function(a,l){function i(e){try{r(s.next(e))}catch(e){l(e)}}function n(e){try{r(s.throw(e))}catch(e){l(e)}}function r(e){var t;e.done?a(e.value):(t=e.value,t instanceof o?t:new o(function(e){e(t)})).then(i,n)}r((s=s.apply(e,t||[])).next())})};function b(e,t={}){return y(this,void 0,void 0,function*(){if(!(e instanceof Blob))throw new Error("compress(): First arg must be a Blob object or a File object.");if("object"!=typeof t&&(t=Object.assign({quality:t})),t.quality=Number(t.quality),Number.isNaN(t.quality))return e;const o=yield p(e);let l=o.split(",")[0].match(/:(.*?);/)[1],n=s.JPEG;a(t.type)&&(n=t.type,l=t.type);const r=yield c(o),u=yield m(r,Object.assign({},t)),h=yield i(u,t.quality,n),g=yield d(h,l);return g.size>e.size?e:g})}function k(e,t={}){return y(this,void 0,void 0,function*(){if(!(e instanceof Blob))throw new Error("compressAccurately(): First arg must be a Blob object or a File object.");if("object"!=typeof t&&(t=Object.assign({size:t})),t.size=Number(t.size),Number.isNaN(t.size))return e;if(1024*t.size>e.size)return e;t.accuracy=Number(t.accuracy),(!t.accuracy||t.accuracy<.8||t.accuracy>.99)&&(t.accuracy=.95);const o=t.size*(2-t.accuracy)*1024,l=1024*t.size,n=t.size*t.accuracy*1024,r=yield p(e);let u=r.split(",")[0].match(/:(.*?);/)[1],h=s.JPEG;a(t.type)&&(h=t.type,u=t.type);const g=yield c(r),f=yield m(g,Object.assign({},t));let y,b=.5;const k=[null,null];for(let e=1;e<=7;e++){y=yield i(f,b,h);const t=.75*y.length;if(7===e){(o<t||n>t)&&(y=[y,...k].filter(e=>e).sort((e,t)=>Math.abs(.75*e.length-l)-Math.abs(.75*t.length-l))[0]);break}if(o<t)k[1]=y,b-=Math.pow(.5,e+1);else{if(!(n>t))break;k[0]=y,b+=Math.pow(.5,e+1)}}const v=yield d(y,u);return v.size>e.size?e:v})}}])})},13378:function(e,t,o){"use strict";o(85331),o(38736),o(79899)},15616:function(e,t,o){"use strict";o(85331),o(97197)},18785:function(e,t,o){"use strict";o(85331)},19104:function(e,t,o){"use strict";o(85331)},23597:function(e,t,o){"use strict";o(85331)},30694:function(e,t,o){"use strict";o(85331)},33153:function(e,t,o){"use strict";e.exports=o.p+"img/logo.e8dbfa27.png"},33892:function(e,t,o){"use strict";o.d(t,{A:function(){return $}});var s=o(99114),a=(o(85331),o(30694),o(49385)),l=(o(37952),o(30650)),i=(o(19104),o(31802)),n=(o(13378),o(80047)),r=(o(99648),o(56768)),d=o(45130),c=o(24232);const u={class:"directory-tree-picker"},p={class:"tree-container"},h={key:0,class:"error-state"},m={class:"error-text"},g={class:"node-label"},f={class:"tree-container"},y={key:0,class:"error-state"},b={class:"error-text"},k={class:"node-label"};function v(e,t,o,v,C,w){const F=(0,r.g2)("font-awesome-icon"),L=n.S2,U=i.qk,$=l.Vc,S=a.pw,T=s.A;return(0,r.uX)(),(0,r.CE)("div",u,[w.isDesktop?((0,r.uX)(),(0,r.Wv)($,{key:0,visible:C.popoverVisible,"onUpdate:visible":t[1]||(t[1]=e=>C.popoverVisible=e),placement:"bottom-start",width:320,trigger:"click","popper-class":"directory-tree-popover","show-arrow":!0,"hide-after":0,"show-after":50,transition:"el-zoom-in-top"},{reference:(0,r.k6)(()=>[(0,r.Lk)("span",{class:"popover-trigger-wrapper",onClick:t[0]||(t[0]=(0,d.D$)(()=>{},["stop"]))},[(0,r.RG)(e.$slots,"trigger",{},void 0,!0)])]),default:(0,r.k6)(()=>[(0,r.bo)(((0,r.uX)(),(0,r.CE)("div",p,[C.error?((0,r.uX)(),(0,r.CE)("div",h,[(0,r.bF)(F,{icon:"exclamation-circle",class:"error-icon"}),(0,r.Lk)("span",m,(0,c.v_)(C.error),1),(0,r.bF)(L,{type:"primary",size:"small",onClick:w.fetchDirectoryTree},{default:(0,r.k6)(()=>[(0,r.eW)((0,c.v_)(e.$t("directoryTree.retry")),1)]),_:1},8,["onClick"])])):((0,r.uX)(),(0,r.Wv)(U,{key:1,ref:"treeRef",data:C.treeData,props:C.treeProps,"node-key":"path","default-expand-all":!1,"expand-on-click-node":!1,"highlight-current":!0,"current-node-key":o.currentDirectory,class:"directory-tree",onNodeClick:w.handleNodeClick},{default:(0,r.k6)(({node:e,data:t})=>[(0,r.Lk)("span",{class:(0,c.C4)(["tree-node",{"is-current":t.path===o.currentDirectory}])},[(0,r.bF)(F,{icon:e.expanded?"folder-open":"folder",class:"folder-icon"},null,8,["icon"]),(0,r.Lk)("span",g,(0,c.v_)(t.name),1)],2)]),_:1},8,["data","props","current-node-key","onNodeClick"]))])),[[T,C.loading]])]),_:3},8,["visible"])):((0,r.uX)(),(0,r.CE)(r.FK,{key:1},[(0,r.Lk)("span",{class:"drawer-trigger-wrapper",onClick:t[2]||(t[2]=(...e)=>w.openDrawer&&w.openDrawer(...e))},[(0,r.RG)(e.$slots,"trigger",{},void 0,!0)]),(0,r.bF)(S,{modelValue:C.drawerVisible,"onUpdate:modelValue":t[3]||(t[3]=e=>C.drawerVisible=e),direction:"btt",size:"60%","show-close":!0,"with-header":!0,"z-index":3e3,title:e.$t("directoryTree.selectDirectory"),class:"directory-tree-drawer"},{default:(0,r.k6)(()=>[(0,r.bo)(((0,r.uX)(),(0,r.CE)("div",f,[C.error?((0,r.uX)(),(0,r.CE)("div",y,[(0,r.bF)(F,{icon:"exclamation-circle",class:"error-icon"}),(0,r.Lk)("span",b,(0,c.v_)(C.error),1),(0,r.bF)(L,{type:"primary",size:"small",onClick:w.fetchDirectoryTree},{default:(0,r.k6)(()=>[(0,r.eW)((0,c.v_)(e.$t("directoryTree.retry")),1)]),_:1},8,["onClick"])])):((0,r.uX)(),(0,r.Wv)(U,{key:1,ref:"treeRefMobile",data:C.treeData,props:C.treeProps,"node-key":"path","default-expand-all":!1,"expand-on-click-node":!1,"highlight-current":!0,"current-node-key":o.currentDirectory,class:"directory-tree mobile-tree",onNodeClick:w.handleNodeClick},{default:(0,r.k6)(({node:e,data:t})=>[(0,r.Lk)("span",{class:(0,c.C4)(["tree-node",{"is-current":t.path===o.currentDirectory}])},[(0,r.bF)(F,{icon:e.expanded?"folder-open":"folder",class:"folder-icon"},null,8,["icon"]),(0,r.Lk)("span",k,(0,c.v_)(t.name),1)],2)]),_:1},8,["data","props","current-node-key","onNodeClick"]))])),[[T,C.loading]])]),_:1},8,["modelValue","title"])],64))])}var C=o(457),w=o(70797),F={name:"DirectoryTreePicker",props:{currentDirectory:{type:String,default:""},source:{type:String,default:"upload",validator:e=>["upload","admin"].includes(e)}},data(){return{popoverVisible:!1,drawerVisible:!1,treeData:[],loading:!1,error:"",treeProps:{children:"children",label:"name"},windowWidth:window.innerWidth}},computed:{isDesktop(){return this.windowWidth>=769}},watch:{popoverVisible(e){e?this.fetchDirectoryTree():setTimeout(()=>{if(!this.popoverVisible&&this.$refs.treeRef){const e=this.$refs.treeRef.store;for(const t in e.nodesMap)e.nodesMap[t].expanded=!1}},200)},drawerVisible(e){e?this.fetchDirectoryTree():setTimeout(()=>{if(!this.drawerVisible&&this.$refs.treeRefMobile){const e=this.$refs.treeRefMobile.store;for(const t in e.nodesMap)e.nodesMap[t].expanded=!1}},300)},currentDirectory(e){this.$nextTick(()=>{this.$refs.treeRef&&e&&this.$refs.treeRef.setCurrentKey(e),this.$refs.treeRefMobile&&e&&this.$refs.treeRefMobile.setCurrentKey(e)})}},mounted(){window.addEventListener("resize",this.handleResize)},beforeUnmount(){window.removeEventListener("resize",this.handleResize)},methods:{handleResize(){this.windowWidth=window.innerWidth},openDrawer(){this.drawerVisible=!0},async fetchDirectoryTree(){this.loading=!0,this.error="";try{let e;if("admin"===this.source){const t=await(0,w.A)("/api/directoryTree",{method:"GET"});if(!t.ok)return void(401===t.status?this.error=this.$t("directoryTree.authFailed"):this.error=this.$t("directoryTree.serverError"));e=await t.json()}else{const t=await C.A.get("/api/directoryTree",{withAuthCode:!0});e=t.data}e.tree?this.treeData=[e.tree]:this.treeData=[]}catch(e){console.error("Failed to fetch directory tree:",e),401===e.response?.status?this.error=this.$t("directoryTree.authFailed"):this.error=this.$t("directoryTree.loadFailed")}finally{this.loading=!1}},handleNodeClick(e){let t=e.path;t&&!t.startsWith("/")?t="/"+t:t||(t="/"),this.$emit("select",t),this.popoverVisible=!1,this.drawerVisible=!1}}},L=o(71241);const U=(0,L.A)(F,[["render",v],["__scopeId","data-v-62eab69a"]]);var $=U},34396:function(e,t,o){"use strict";o(85331),o(4885)},34896:function(e,t,o){"use strict";o(85331)},37952:function(e,t,o){"use strict";o(85331),o(97197)},38736:function(e,t,o){"use strict";o(85331)},40670:function(e,t,o){"use strict";o(85331),o(99648),o(19104),o(85970)},50333:function(e,t,o){"use strict";o(85331),o(29092)},53676:function(e,t,o){"use strict";o.d(t,{A:function(){return u}});var s=o(56768);const a={key:0,class:"channel-svg-icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},l={key:1,class:"channel-svg-icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},i={key:2,class:"channel-svg-icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"};function n(e,t,o,n,r,d){const c=(0,s.g2)("font-awesome-icon");return(0,s.uX)(),(0,s.CE)("span",(0,s.v6)(e.$attrs,{class:"channel-icon-wrapper"}),["telegram"===o.type?((0,s.uX)(),(0,s.CE)("svg",a,[...t[0]||(t[0]=[(0,s.Lk)("path",{d:"M417.28 795.733333 429.226667 615.253333 756.906667 320C771.413333 306.773333 753.92 300.373333 734.72 311.893333L330.24 567.466667 155.306667 512C117.76 501.333333 117.333333 475.306667 163.84 456.533333L845.226667 193.706667C876.373333 179.626667 906.24 201.386667 894.293333 249.173333L778.24 795.733333C770.133333 834.56 746.666667 843.946667 714.24 826.026667L537.6 695.466667 452.693333 777.813333C442.88 787.626667 434.773333 795.733333 417.28 795.733333Z"},null,-1)])])):"huggingface"===o.type?((0,s.uX)(),(0,s.CE)("svg",l,[...t[1]||(t[1]=[(0,s.Fv)('<path d="M509.0304 870.656c94.6432 0 185.4464-37.3504 252.3904-103.8336a353.28 353.28 0 0 0 104.5504-250.6752 353.28 353.28 0 0 0-104.5504-250.6752 358.1952 358.1952 0 0 0-252.416-103.8336 358.1696 358.1696 0 0 0-252.3904 103.8336 353.28 353.28 0 0 0-104.5504 250.6752 353.28 353.28 0 0 0 104.5504 250.6752 358.1696 358.1696 0 0 0 252.416 103.8336z" fill="#FFD21E" data-v-33933ada></path><path d="M865.9712 516.1472a353.28 353.28 0 0 0-104.5504-250.6752 358.1952 358.1952 0 0 0-252.416-103.8336 358.1952 358.1952 0 0 0-252.3904 103.8336 353.28 353.28 0 0 0-104.5504 250.6752 353.28 353.28 0 0 0 104.5504 250.6752 358.1952 358.1952 0 0 0 252.416 103.8336c94.6432 0 185.4464-37.3504 252.3904-103.8336a353.28 353.28 0 0 0 104.5504-250.6752z m-754.9952 0c0-51.9168 10.3168-103.3216 30.3104-151.296a395.1616 395.1616 0 0 1 86.272-128.2304 398.208 398.208 0 0 1 129.152-85.6832 400.384 400.384 0 0 1 304.64 0c48.2816 19.8656 92.16 48.9728 129.1264 85.6832a395.1616 395.1616 0 0 1 86.272 128.256 392.96 392.96 0 0 1 30.2848 151.296c0 104.832-41.9328 205.3632-116.5568 279.5008a399.4112 399.4112 0 0 1-281.472 115.7888A399.4112 399.4112 0 0 1 227.584 795.6736a393.9584 393.9584 0 0 1-116.5824-279.5264z" fill="#FF9D0B" data-v-33933ada></path><path d="M624.9984 419.7376c13.1328 4.5056 18.2784 31.232 31.5136 24.2944a51.2 51.2 0 0 0 21.1456-20.8896 50.688 50.688 0 0 0-5.4272-56.4224 51.3792 51.3792 0 0 0-54.5792-16.5888c-9.728 2.8928-18.3552 8.6016-24.832 16.384a50.8416 50.8416 0 0 0-5.7344 56.3968c6.272 11.7248 26.1888-7.3472 38.016-3.2768l-0.1024 0.1024z m-241.92 0c-13.1328 4.5056-18.3808 31.232-31.5136 24.2944a51.2 51.2 0 0 1-21.1456-20.8896 50.688 50.688 0 0 1 5.4272-56.4224 51.4048 51.4048 0 0 1 54.5792-16.5888c9.728 2.8928 18.3808 8.6016 24.832 16.384a50.8416 50.8416 0 0 1 5.7344 56.3968c-6.272 11.7248-26.2912-7.3472-38.016-3.2768l0.1024 0.1024z" fill="#3A3B45" data-v-33933ada></path><path d="M506.4448 664.4736c100.9664 0 133.5296-89.344 133.5296-135.2704 0-23.8592-16.128-16.3072-41.984-3.6608-23.9616 11.7248-56.0896 27.9552-91.4432 27.9552-73.8304 0-133.5296-70.1952-133.5296-24.2944 0 45.9008 32.4608 135.2704 133.5296 135.2704h-0.1024z" fill="#FF323D" data-v-33933ada></path><path d="M429.1072 641.1264a88.8832 88.8832 0 0 1 54.4512-45.824c4.096-1.2032 8.32 5.8368 12.7232 13.056 4.096 6.9632 8.448 14.0032 12.7488 14.0032 4.608 0 9.216-6.9376 13.6448-13.7728 4.6336-7.168 9.1392-14.08 13.568-12.7488a88.32 88.32 0 0 1 51.3536 42.5216C625.92 608.384 640 559.4112 640 529.2032c0-23.8592-16.128-16.3072-42.0352-3.6608l-1.4336 0.7168c-23.7312 11.7248-55.3472 27.2384-90.0608 27.2384-34.7392 0-66.2528-15.5136-90.112-27.2384-26.7008-13.1584-43.4432-21.4272-43.4432 2.944 0 31.1296 15.0016 82.2272 56.192 111.9232z" fill="#3A3B45" data-v-33933ada></path><path d="M750.4128 467.712c8.8576 0 17.3312-3.5072 23.6032-9.728a33.024 33.024 0 0 0 0-46.8992 33.5104 33.5104 0 0 0-47.2064 0 33.024 33.024 0 0 0 0 46.8992c6.2464 6.2208 14.7456 9.728 23.6032 9.728z m-477.6448 0c8.8576 0 17.3568-3.5072 23.6032-9.728a33.024 33.024 0 0 0 0-46.8992 33.5104 33.5104 0 0 0-47.2064 0 33.024 33.024 0 0 0 0 46.8992c6.272 6.2208 14.7456 9.728 23.6032 9.728z m-68.7104 112.2048c-16.64 0-31.4368 6.7328-41.8048 19.072a60.6464 60.6464 0 0 0-13.6704 38.3488 73.472 73.472 0 0 0-19.9168-3.072c-15.9232 0-30.3104 6.0416-40.4736 16.9472a59.008 59.008 0 0 0-8.2176 71.424 54.016 54.016 0 0 0-18.3808 28.7744 59.3152 59.3152 0 0 0 8.192 48.3584 53.0176 53.0176 0 0 0-3.7888 51.2c10.496 23.68 36.6848 42.24 87.5264 62.2336 31.5392 12.4416 60.4928 20.4032 60.6976 20.5056a458.24 458.24 0 0 0 112.2816 16.3328c60.16 0 103.2192-18.3808 127.9744-54.4768 39.8592-58.0608 34.2016-111.2064-17.4592-162.432-28.4672-28.3648-47.4624-70.0672-51.3536-79.2576-8.0128-27.136-29.184-57.344-64.2048-57.344a58.88 58.88 0 0 0-47.2576 25.088c-10.2656-12.8256-20.3264-22.9376-29.3632-28.7488a76.3648 76.3648 0 0 0-40.7808-12.9536z m0 40.8064c5.2224 0 11.6992 2.2528 18.688 6.6304 21.9904 13.8752 64.2048 86.016 79.7184 114.048 5.12 9.3952 14.08 13.3632 21.9648 13.3632 15.9232 0 28.2624-15.616 1.536-35.5072-40.2432-29.8752-26.1888-78.7456-6.9632-81.7152 0.8192-0.2048 1.7408-0.2048 2.4576-0.2048 17.4592 0 25.1648 29.9008 25.1648 29.9008s22.6048 56.32 61.44 94.8736c38.7072 38.4768 40.7552 69.376 12.5184 110.4896-19.3024 28.0576-56.192 36.5312-94.08 36.5312-39.168 0-79.4112-9.216-101.888-14.8992-1.152-0.3072-138.1632-38.784-120.832-71.424 2.8928-5.504 7.7312-7.7568 13.7728-7.7568 24.448 0 68.8384 36.1216 88.0384 36.1216 4.1984 0 7.168-1.7408 8.5248-6.1184 8.1152-29.0816-123.8784-41.3184-112.7936-83.3536 2.048-7.424 7.296-10.3936 14.7968-10.3936 32.256 0 104.7808 56.3968 119.9872 56.3968 1.1264 0 2.048-0.2816 2.4576-1.024 7.6032-12.2368 3.3792-20.7872-50.3296-53.0432-53.504-32.2304-91.2128-51.6096-69.8624-74.752 2.4832-2.6624 5.9648-3.8912 10.2912-3.8912 32.5632 0 109.4912 69.5808 109.4912 69.5808s20.736 21.4272 33.3824 21.4272c2.8672 0 5.3504-1.024 6.9888-3.8912 8.832-14.8992-82.7904-83.8656-87.936-112.3072-3.4816-19.4048 2.4576-29.0816 13.4656-29.0816z" fill="#FF9D0B" data-v-33933ada></path><path d="M420.5824 872.6016c28.2368-41.216 26.1888-72.1152-12.544-110.592-38.8096-38.4512-61.4144-94.8736-61.4144-94.8736s-8.4224-32.64-27.648-29.5936c-19.2 3.072-33.28 51.84 7.0144 81.7152 40.1408 29.9008-8.0128 50.2016-23.552 22.144-15.3856-28.0576-57.7024-100.1728-79.6928-114.048-21.888-13.7728-37.2736-6.144-32.1536 22.4512 5.12 28.4416 96.8704 97.408 87.936 112.2048-8.96 15.0016-40.3712-17.4336-40.3712-17.4336s-98.304-88.8576-119.7568-65.7152c-21.376 23.168 16.3328 42.5472 69.8368 74.7776 53.7088 32.256 57.9328 40.8064 50.3296 53.0688-7.68 12.2368-126.1312-87.04-137.216-44.9024-11.1104 41.9328 120.8832 54.0672 112.768 83.1488-8.192 29.0816-93.056-54.8864-110.336-22.2464-17.4336 32.768 119.68 71.2192 120.832 71.5264 44.16 11.4176 156.6208 35.584 195.968-21.632z" fill="#FFD21E" data-v-33933ada></path><path d="M819.1232 579.9168c16.64 0 31.5392 6.7328 41.8048 19.072 8.8576 10.8544 13.6704 24.3968 13.6704 38.3488 6.5024-1.92 13.2352-2.9696 20.0192-3.072 15.9232 0 30.3104 6.0416 40.4736 16.9472a58.9824 58.9824 0 0 1 8.2176 71.424c9.0624 7.3728 15.4624 17.4592 18.2784 28.7744a59.2896 59.2896 0 0 1-8.192 48.3584 52.992 52.992 0 0 1 3.7888 51.2c-10.496 23.68-36.6848 42.24-87.424 62.208-31.6416 12.4672-60.5952 20.4288-60.8 20.5312-36.608 10.0608-74.3168 15.5392-112.2816 16.3328-60.1856 0-103.2192-18.3808-128-54.4768-39.8336-58.0608-34.176-111.2064 17.4848-162.432 28.544-28.3648 47.5648-70.0672 51.456-79.2576 8.0128-27.136 29.0816-57.344 64.1024-57.344a58.88 58.88 0 0 1 47.232 25.088c10.2912-12.8256 20.352-22.9376 29.4912-28.7488a76.3904 76.3904 0 0 1 40.6784-12.9536z m0 40.8064c-5.248 0-11.5968 2.2272-18.688 6.6304-21.888 13.8752-64.2048 86.016-79.7184 114.048a24.832 24.832 0 0 1-21.9648 13.3632c-15.8208 0-28.2624-15.616-1.4592-35.5072 40.192-29.8752 26.112-78.7456 6.912-81.7152a15.872 15.872 0 0 0-2.4832-0.2048c-17.4592 0-25.1648 29.9008-25.1648 29.9008s-22.6048 56.32-61.3376 94.8736c-38.8096 38.4512-40.8576 69.376-12.544 110.4896 19.2256 28.0576 56.2176 36.5312 94.0032 36.5312 39.2448 0 79.4112-9.216 102.016-14.8992 1.024-0.3072 138.1376-38.784 120.7808-71.424-2.9696-5.504-7.68-7.7568-13.7728-7.7568-24.4224 0-68.9152 36.1216-88.0128 36.1216-4.3264 0-7.296-1.7408-8.5248-6.144-8.2176-29.056 123.776-41.2928 112.6656-83.328-1.9456-7.424-7.168-10.3936-14.7712-10.3936-32.256 0-104.7808 56.3968-119.9872 56.3968-1.024 0-1.9456-0.3072-2.3552-1.024-7.6032-12.2368-3.5072-20.7872 50.1248-53.0432 53.7088-32.2304 91.392-51.6096 69.8368-74.752-2.3552-2.6624-5.8368-3.8912-10.0608-3.8912-32.6656 0-109.5936 69.5808-109.5936 69.5808s-20.736 21.4272-33.28 21.4272a7.6288 7.6288 0 0 1-6.9888-3.8912c-8.9344-14.8992 82.688-83.8656 87.808-112.3072 3.5072-19.4048-2.4576-29.0816-13.44-29.0816z" fill="#FF9D0B" data-v-33933ada></path><path d="M602.7008 872.6016c-28.2368-41.216-26.2912-72.1152 12.544-110.592 38.7072-38.4512 61.312-94.8736 61.312-94.8736s8.4224-32.64 27.7248-29.5936c19.1232 3.072 33.1776 51.84-6.9888 81.7152-40.2432 29.9008 8.0128 50.2016 23.424 22.144 15.5136-28.0576 57.856-100.1728 79.7184-114.048 21.8624-13.7728 37.376-6.144 32.1536 22.4512-5.12 28.4416-96.768 97.408-87.808 112.2048 8.8064 15.0016 40.2432-17.4336 40.2432-17.4336s98.4064-88.8576 119.7568-65.7152c21.376 23.168-16.2304 42.5472-69.8368 74.7776-53.7344 32.256-57.8304 40.8064-50.3296 53.0688 7.68 12.2368 126.1312-87.04 137.216-44.9024 11.1104 41.9328-120.7808 54.0672-112.6656 83.1488 8.192 29.0816 92.9536-54.8864 110.336-22.2464 17.3312 32.768-119.68 71.2192-120.832 71.5264-44.2624 11.4176-156.7232 35.584-195.968-21.632z" fill="#FFD21E" data-v-33933ada></path>',9)])])):"webdav"===o.type?((0,s.uX)(),(0,s.CE)("svg",i,[...t[2]||(t[2]=[(0,s.Lk)("path",{d:"M446.293333 810.666667C384 898.986667 262.4 921.173333 174.506667 859.733333c-87.466667-61.44-107.946667-183.893333-46.506667-273.066666a195.626667 195.626667 0 0 1 152.746667-84.48l2.133333 61.013333c-38.826667 2.986667-76.373333 23.04-100.693333 58.026667-42.666667 61.44-29.44 144.213333 29.013333 185.6 58.88 40.96 141.226667 25.173333 183.893333-35.84 13.226667-19.2 20.906667-40.106667 23.893334-61.44v-43.093334l238.08-1.706666 2.986666-4.693334c22.613333-39.253333 71.68-52.906667 110.08-30.72a81.066667 81.066667 0 0 1 29.013334 110.933334c-22.613333 38.826667-72.106667 52.48-110.506667 30.293333-17.493333-9.813333-29.866667-25.6-35.413333-43.52l-173.653334 0.853333a211.626667 211.626667 0 0 1-33.28 82.773334m310.613334-304.64c107.946667 13.226667 184.746667 110.08 171.52 216.32-13.226667 106.666667-111.36 182.186667-219.306667 168.96a197.504 197.504 0 0 1-146.346667-94.293334l52.906667-30.72a137.386667 137.386667 0 0 0 98.986667 61.866667c74.666667 8.96 140.8-41.813333 149.76-113.066667 8.96-71.253333-43.946667-136.533333-117.76-145.493333-23.04-2.56-45.226667 0.426667-65.28 7.68l-36.266667 18.773333-110.08-203.52h-9.386667a81.322667 81.322667 0 0 1-78.933333-83.2c1.28-44.373333 39.68-78.933333 84.48-77.226666 44.8 2.56 80.213333 38.826667 78.933333 83.2-0.853333 18.773333-8.106667 35.84-19.626666 49.066666l81.066666 149.76c26.453333-8.533333 55.466667-11.52 85.333334-8.106666M352 389.973333c-42.666667-100.266667 2.56-215.04 101.12-256.853333 98.986667-41.813333 213.333333 5.546667 256 105.813333 25.173333 58.453333 20.053333 122.453333-8.533333 173.653334l-52.906667-30.72c17.92-34.56 20.906667-76.8 3.84-116.48-29.013333-68.266667-106.24-101.12-172.373333-73.386667-66.56 28.16-96.426667 106.666667-67.413334 174.933333 11.946667 28.16 32 49.92 56.32 64.426667l16.64 8.96-130.986666 212.906667c1.28 2.133333 2.986667 4.693333 4.266666 8.106666 20.906667 38.826667 6.4 87.893333-32.853333 108.8-38.826667 20.906667-87.893333 5.546667-109.226667-34.56-20.906667-39.68-6.4-88.746667 32.853334-109.653333 16.64-8.96 34.986667-11.093333 52.48-7.253333l98.56-160.853334c-20.053333-18.346667-37.12-41.386667-47.786667-67.84z"},null,-1)])])):((0,s.uX)(),(0,s.Wv)(c,{key:3,icon:d.fontAwesomeIcon},null,8,["icon"]))],16)}var r={name:"ChannelIcon",inheritAttrs:!1,props:{type:{type:String,required:!0}},computed:{fontAwesomeIcon(){const e={cfr2:["fab","cloudflare"],s3:["fab","aws"],discord:["fab","discord"]};return e[this.type]||"server"}}},d=o(71241);const c=(0,d.A)(r,[["render",n],["__scopeId","data-v-33933ada"]]);var u=c},54800:function(e,t,o){"use strict";o.r(t),o.d(t,{default:function(){return To}});var s=o(78507),a=(o(85331),o(213),o(80047)),l=(o(99648),o(56768)),i=o(24232);const n={class:"history-header"},r={class:"header-left"},d={class:"record-count"},c={class:"header-right"},u={class:"timeline-header"},p={class:"date-label"},h={key:0,class:"grid-view"},m={class:"grid-preview"},g=["src"],f=["src"],y={key:2,class:"file-icon-wrapper"},b={class:"grid-overlay"},k={class:"grid-actions"},v={class:"grid-info"},C=["title"],w={class:"upload-time"},F={key:1,class:"list-view"},L={class:"list-preview"},U=["src"],$=["src"],S={key:2,class:"file-icon-wrapper-small"},T={class:"list-info"},_=["title"],x=["title"],A={class:"list-meta"},M={class:"upload-time"},R={class:"list-actions"},D={key:0,class:"load-more-container"},E={key:0,class:"loading-indicator"},I={key:1,class:"load-more-hint"},N={key:1,class:"no-more-hint"},P={key:1,class:"empty-state"};function z(e,t,o,z,V,W){const B=(0,l.g2)("font-awesome-icon"),H=a.S2,Q=s.R7;return(0,l.uX)(),(0,l.CE)("div",{class:(0,i.C4)(["history-container",{active:o.show}])},[(0,l.Lk)("div",n,[(0,l.Lk)("div",r,[(0,l.Lk)("h2",null,(0,i.v_)(e.$t("uploadHistory.title")),1),(0,l.Lk)("span",d,(0,i.v_)(e.$t("uploadHistory.totalRecords",{count:V.totalCount})),1)]),(0,l.Lk)("div",c,[(0,l.bF)(Q,{content:e.$t("uploadHistory.switchView"),placement:"bottom"},{default:(0,l.k6)(()=>[(0,l.bF)(H,{circle:"",onClick:W.toggleViewMode},{default:(0,l.k6)(()=>[(0,l.bF)(B,{icon:"grid"===V.viewMode?"list":"th-large"},null,8,["icon"])]),_:1},8,["onClick"])]),_:1},8,["content"]),(0,l.bF)(Q,{content:e.$t("uploadHistory.clearRecords"),placement:"bottom"},{default:(0,l.k6)(()=>[(0,l.bF)(H,{circle:"",type:"danger",onClick:W.clearHistory},{default:(0,l.k6)(()=>[(0,l.bF)(B,{icon:"trash-alt"})]),_:1},8,["onClick"])]),_:1},8,["content"]),(0,l.bF)(H,{circle:"",onClick:t[0]||(t[0]=t=>e.$emit("close"))},{default:(0,l.k6)(()=>[(0,l.bF)(B,{icon:"times"})]),_:1})])]),V.historyList.length>0?((0,l.uX)(),(0,l.CE)("div",{key:0,class:"history-content",ref:"historyContent",onScroll:t[3]||(t[3]=(...e)=>W.handleScroll&&W.handleScroll(...e))},[((0,l.uX)(!0),(0,l.CE)(l.FK,null,(0,l.pI)(W.groupedHistory,e=>((0,l.uX)(),(0,l.CE)("div",{key:e.date,class:"history-group"},[(0,l.Lk)("div",u,[t[4]||(t[4]=(0,l.Lk)("div",{class:"timeline-dot"},null,-1)),(0,l.Lk)("span",p,(0,i.v_)(e.date),1)]),"grid"===V.viewMode?((0,l.uX)(),(0,l.CE)("div",h,[((0,l.uX)(!0),(0,l.CE)(l.FK,null,(0,l.pI)(e.items,e=>((0,l.uX)(),(0,l.CE)("div",{key:e.time,class:"grid-item"},[(0,l.Lk)("div",m,[W.isImage(e.name)?((0,l.uX)(),(0,l.CE)("img",{key:0,src:e.url,loading:"lazy",onError:t[1]||(t[1]=(...e)=>W.handleImageError&&W.handleImageError(...e))},null,40,g)):W.isVideo(e.name)?((0,l.uX)(),(0,l.CE)("video",{key:1,src:e.url,muted:""},null,8,f)):((0,l.uX)(),(0,l.CE)("div",y,[(0,l.bF)(B,{icon:"file",class:"file-icon"})])),(0,l.Lk)("div",b,[(0,l.Lk)("div",k,[(0,l.bF)(H,{circle:"",size:"default",type:"primary",onClick:t=>W.copyLink(e.url)},{default:(0,l.k6)(()=>[(0,l.bF)(B,{icon:"copy"})]),_:1},8,["onClick"]),(0,l.bF)(H,{circle:"",size:"default",class:"action-btn-view",onClick:t=>W.openLink(e.url)},{default:(0,l.k6)(()=>[(0,l.bF)(B,{icon:"external-link-alt"})]),_:1},8,["onClick"]),(0,l.bF)(H,{circle:"",size:"default",type:"danger",onClick:t=>W.deleteItem(e)},{default:(0,l.k6)(()=>[(0,l.bF)(B,{icon:"trash-alt"})]),_:1},8,["onClick"])])])]),(0,l.Lk)("div",v,[(0,l.Lk)("div",{class:"file-name",title:e.name},(0,i.v_)(e.name),9,C),(0,l.Lk)("div",w,(0,i.v_)(W.formatTime(e.time)),1)])]))),128))])):((0,l.uX)(),(0,l.CE)("div",F,[((0,l.uX)(!0),(0,l.CE)(l.FK,null,(0,l.pI)(e.items,e=>((0,l.uX)(),(0,l.CE)("div",{key:e.time,class:"list-item"},[(0,l.Lk)("div",L,[W.isImage(e.name)?((0,l.uX)(),(0,l.CE)("img",{key:0,src:e.url,loading:"lazy",onError:t[2]||(t[2]=(...e)=>W.handleImageError&&W.handleImageError(...e))},null,40,U)):W.isVideo(e.name)?((0,l.uX)(),(0,l.CE)("video",{key:1,src:e.url,muted:""},null,8,$)):((0,l.uX)(),(0,l.CE)("div",S,[(0,l.bF)(B,{icon:"file"})]))]),(0,l.Lk)("div",T,[(0,l.Lk)("div",{class:"file-name",title:e.name},(0,i.v_)(e.name),9,_),(0,l.Lk)("div",{class:"file-url",title:e.url},(0,i.v_)(e.url),9,x)]),(0,l.Lk)("div",A,[(0,l.Lk)("div",M,(0,i.v_)(W.formatTime(e.time)),1)]),(0,l.Lk)("div",R,[(0,l.bF)(H,{circle:"",size:"small",type:"primary",onClick:t=>W.copyLink(e.url)},{default:(0,l.k6)(()=>[(0,l.bF)(B,{icon:"copy"})]),_:1},8,["onClick"]),(0,l.bF)(H,{circle:"",size:"small",class:"action-btn-view",onClick:t=>W.openLink(e.url)},{default:(0,l.k6)(()=>[(0,l.bF)(B,{icon:"external-link-alt"})]),_:1},8,["onClick"]),(0,l.bF)(H,{circle:"",size:"small",type:"danger",onClick:t=>W.deleteItem(e)},{default:(0,l.k6)(()=>[(0,l.bF)(B,{icon:"trash-alt"})]),_:1},8,["onClick"])])]))),128))]))]))),128)),W.hasMore?((0,l.uX)(),(0,l.CE)("div",D,[V.loadingMore?((0,l.uX)(),(0,l.CE)("div",E,[(0,l.bF)(B,{icon:"spinner",spin:""}),(0,l.Lk)("span",null,(0,i.v_)(e.$t("uploadHistory.loading")),1)])):((0,l.uX)(),(0,l.CE)("div",I,(0,i.v_)(e.$t("uploadHistory.pullToLoadMore")),1))])):V.historyList.length>0?((0,l.uX)(),(0,l.CE)("div",N,(0,i.v_)(e.$t("uploadHistory.noMoreRecords")),1)):(0,l.Q3)("",!0)],544)):((0,l.uX)(),(0,l.CE)("div",P,[(0,l.bF)(B,{icon:"history",class:"empty-icon"}),(0,l.Lk)("p",null,(0,i.v_)(e.$t("uploadHistory.emptyHistory")),1)]))],2)}o(44114),o(18111),o(22489),o(7588),o(61701);var V={name:"UploadHistory",props:{show:{type:Boolean,default:!1}},data(){return{historyList:[],allHistory:[],viewMode:"grid",pageSize:30,currentPage:0,loadingMore:!1,totalCount:0}},watch:{show(e){e&&this.resetAndLoad()}},computed:{hasMore(){return this.historyList.length<this.totalCount},groupedHistory(){const e={};return this.historyList.forEach(t=>{const o=new Date(t.time),s=`${o.getFullYear()}-${String(o.getMonth()+1).padStart(2,"0")}-${String(o.getDate()).padStart(2,"0")}`;e[s]||(e[s]=[]),e[s].push(t)}),Object.keys(e).sort((e,t)=>new Date(t)-new Date(e)).map(t=>({date:t,items:e[t]}))}},mounted(){const e=localStorage.getItem("historyViewMode");e&&(this.viewMode=e)},methods:{resetAndLoad(){this.historyList=[],this.currentPage=0,this.loadAllHistory(),this.loadMore()},loadAllHistory(){try{const e=JSON.parse(localStorage.getItem("uploadHistory")||"[]");this.allHistory=e.sort((e,t)=>t.time-e.time),this.totalCount=this.allHistory.length}catch(e){console.error("Failed to load history",e),this.allHistory=[],this.totalCount=0}},loadMore(){!this.loadingMore&&this.hasMore&&(this.loadingMore=!0,setTimeout(()=>{const e=this.currentPage*this.pageSize,t=e+this.pageSize,o=this.allHistory.slice(e,t);this.historyList=[...this.historyList,...o],this.currentPage++,this.loadingMore=!1},50))},handleScroll(e){const t=e.target,o=t.scrollTop,s=t.scrollHeight,a=t.clientHeight;s-o-a<100&&this.loadMore()},toggleViewMode(){this.viewMode="grid"===this.viewMode?"list":"grid",localStorage.setItem("historyViewMode",this.viewMode)},clearHistory(){this.$confirm(this.$t("uploadHistory.clearConfirmMessage"),this.$t("uploadHistory.clearConfirmTitle"),{confirmButtonText:this.$t("uploadHistory.clearConfirmOk"),cancelButtonText:this.$t("uploadHistory.clearConfirmCancel"),type:"warning"}).then(()=>{this.historyList=[],this.allHistory=[],this.totalCount=0,this.currentPage=0,localStorage.removeItem("uploadHistory"),this.$message.success(this.$t("uploadHistory.recordsCleared"))}).catch(()=>{})},deleteItem(e){this.$confirm(this.$t("uploadHistory.deleteConfirmMessage"),this.$t("uploadHistory.clearConfirmTitle"),{confirmButtonText:this.$t("uploadHistory.clearConfirmOk"),cancelButtonText:this.$t("uploadHistory.clearConfirmCancel"),type:"warning"}).then(()=>{this.historyList=this.historyList.filter(t=>t.time!==e.time),this.allHistory=this.allHistory.filter(t=>t.time!==e.time),this.totalCount=this.allHistory.length;try{localStorage.setItem("uploadHistory",JSON.stringify(this.allHistory)),this.$message.success(this.$t("uploadHistory.recordDeleted"))}catch(t){console.error("Failed to update history",t)}}).catch(()=>{})},isImage(e){const t=["jpg","jpeg","png","gif","bmp","webp","svg","tiff","ico","avif","heic","jfif","pjpeg","pjp"],o=e?e.split(".").pop().toLowerCase():"";return t.includes(o)},isVideo(e){const t=["mp4","webm","ogg","mkv"],o=e?e.split(".").pop().toLowerCase():"";return t.includes(o)},formatTime(e){const t=new Date(e),o=t.getFullYear(),s=String(t.getMonth()+1).padStart(2,"0"),a=String(t.getDate()).padStart(2,"0"),l=String(t.getHours()).padStart(2,"0"),i=String(t.getMinutes()).padStart(2,"0"),n=String(t.getSeconds()).padStart(2,"0");return`${o}-${s}-${a} ${l}:${i}:${n}`},copyLink(e){navigator.clipboard.writeText(e).then(()=>{this.$message.success(this.$t("uploadHistory.linkCopied"))}).catch(()=>{this.$message.error(this.$t("uploadHistory.copyFailed"))})},openLink(e){window.open(e,"_blank")},handleImageError(e){e.target.src=o(96682)}}},W=o(71241);const B=(0,W.A)(V,[["render",z],["__scopeId","data-v-f70e7770"]]);var H=B,Q=o(86975),X=o(9267),q=(o(15616),o(81418)),O=(o(50333),o(74757)),j=o(55558),G=(o(10456),o(39623)),K=(o(29092),o(76018)),J=(o(96808),o(67819),o(66810)),Y=(o(34396),o(4885),o(53676));const Z={class:"dialog-section"},ee={class:"section-header"},te={class:"section-title"},oe={class:"section-content"},se={class:"setting-item"},ae={class:"setting-label"},le={key:0,class:"setting-item"},ie={class:"setting-label"},ne={class:"setting-item"},re={class:"setting-label"},de={class:"setting-item"},ce={class:"setting-label"},ue={class:"dialog-section"},pe={class:"section-header"},he={class:"section-title"},me={class:"section-content"},ge={class:"dialog-section"},fe={class:"section-header"},ye={class:"section-title"},be={class:"section-content"},ke={class:"setting-item"},ve={class:"setting-label"},Ce={class:"setting-item"},we={class:"setting-label"},Fe={key:0,class:"setting-item slider-item"},Le={class:"setting-label"},Ue={class:"slider-wrapper"},$e={class:"slider-input-wrapper"},Se={key:1,class:"setting-item slider-item"},Te={class:"setting-label"},_e={class:"slider-wrapper"},xe={class:"slider-input-wrapper"},Ae={key:0,class:"dialog-section"},Me={class:"section-header"},Re={class:"section-title"},De={class:"section-content"},Ee={class:"setting-item"},Ie={class:"setting-label"},Ne={class:"dialog-action"};function Pe(e,t,o,n,r,d){const c=Y.A,u=J.ll,p=J.MQ,h=(0,l.g2)("font-awesome-icon"),m=s.R7,g=K.P9,f=K.AV,y=G.WK,b=j.qi,k=O.B8,v=q.lq,C=a.S2,w=X.kZ;return(0,l.uX)(),(0,l.Wv)(w,{title:e.$t("uploadSettings.title"),modelValue:d.visible,"onUpdate:modelValue":t[12]||(t[12]=e=>d.visible=e),width:d.dialogWidth,"show-close":!1,class:"settings-dialog settings-dialog-scope upload-settings-dialog"},{default:(0,l.k6)(()=>[(0,l.Lk)("div",Z,[(0,l.Lk)("div",ee,[(0,l.Lk)("span",te,(0,i.v_)(e.$t("uploadSettings.uploadChannel")),1)]),(0,l.Lk)("div",oe,[(0,l.Lk)("div",se,[(0,l.Lk)("span",ae,(0,i.v_)(e.$t("uploadSettings.channelType")),1),(0,l.bF)(p,{"model-value":o.uploadChannel,"onUpdate:modelValue":t[0]||(t[0]=t=>e.$emit("update:uploadChannel",t)),class:"radio-card-group compact"},{default:(0,l.k6)(()=>[(0,l.bF)(u,{label:"telegram",class:"radio-card"},{default:(0,l.k6)(()=>[(0,l.bF)(c,{type:"telegram",class:"channel-icon channel-brand-telegram"}),t[13]||(t[13]=(0,l.Lk)("span",null,"TG",-1))]),_:1}),(0,l.bF)(u,{label:"cfr2",class:"radio-card"},{default:(0,l.k6)(()=>[(0,l.bF)(c,{type:"cfr2",class:"channel-icon channel-brand-cfr2"}),t[14]||(t[14]=(0,l.Lk)("span",null,"R2",-1))]),_:1}),(0,l.bF)(u,{label:"s3",class:"radio-card"},{default:(0,l.k6)(()=>[(0,l.bF)(c,{type:"s3",class:"channel-icon channel-brand-s3"}),t[15]||(t[15]=(0,l.Lk)("span",null,"S3",-1))]),_:1}),(0,l.bF)(u,{label:"discord",class:"radio-card"},{default:(0,l.k6)(()=>[(0,l.bF)(c,{type:"discord",class:"channel-icon channel-brand-discord"}),t[16]||(t[16]=(0,l.Lk)("span",null,"DC",-1))]),_:1}),(0,l.bF)(u,{label:"huggingface",class:"radio-card"},{default:(0,l.k6)(()=>[(0,l.bF)(c,{type:"huggingface",class:"channel-icon channel-brand-huggingface"}),t[17]||(t[17]=(0,l.Lk)("span",null,"HF",-1))]),_:1}),(0,l.bF)(u,{label:"webdav",class:"radio-card"},{default:(0,l.k6)(()=>[(0,l.bF)(c,{type:"webdav",class:"channel-icon channel-brand-webdav"}),t[18]||(t[18]=(0,l.Lk)("span",null,"WD",-1))]),_:1})]),_:1},8,["model-value"])]),o.currentChannelList.length>1?((0,l.uX)(),(0,l.CE)("div",le,[(0,l.Lk)("span",ie,[(0,l.eW)((0,i.v_)(e.$t("uploadSettings.channelName"))+" ",1),(0,l.bF)(m,{content:e.$t("uploadSettings.channelNameTooltip"),placement:"top"},{default:(0,l.k6)(()=>[(0,l.bF)(h,{icon:"question-circle",class:"inline-help-icon"})]),_:1},8,["content"])]),(0,l.bF)(f,{"model-value":o.channelName,"onUpdate:modelValue":t[1]||(t[1]=t=>e.$emit("update:channelName",t)),placeholder:e.$t("uploadSettings.autoSelect"),clearable:"",class:"setting-input"},{default:(0,l.k6)(()=>[((0,l.uX)(!0),(0,l.CE)(l.FK,null,(0,l.pI)(o.currentChannelList,e=>((0,l.uX)(),(0,l.Wv)(g,{key:e.name,label:e.name,value:e.name},null,8,["label","value"]))),128))]),_:1},8,["model-value","placeholder"])])):(0,l.Q3)("",!0),(0,l.Lk)("div",ne,[(0,l.Lk)("span",re,(0,i.v_)(e.$t("uploadSettings.uploadDirectory")),1),(0,l.bF)(y,{"model-value":o.uploadFolder,"onUpdate:modelValue":d.handleUploadFolderInput,placeholder:e.$t("uploadSettings.uploadDirectoryPlaceholder"),class:"setting-input"},null,8,["model-value","onUpdate:modelValue","placeholder"])]),(0,l.Lk)("div",de,[(0,l.Lk)("span",ce,[(0,l.eW)((0,i.v_)(e.$t("uploadSettings.autoSwitch"))+" ",1),(0,l.bF)(m,{content:e.$t("uploadSettings.autoSwitchTooltip"),placement:"top"},{default:(0,l.k6)(()=>[(0,l.bF)(h,{icon:"question-circle",class:"inline-help-icon"})]),_:1},8,["content"])]),(0,l.bF)(b,{"model-value":o.autoRetry,"onUpdate:modelValue":t[2]||(t[2]=t=>e.$emit("update:autoRetry",t))},null,8,["model-value"])])])]),(0,l.Lk)("div",ue,[(0,l.Lk)("div",pe,[(0,l.Lk)("span",he,(0,i.v_)(e.$t("uploadSettings.fileNaming")),1)]),(0,l.Lk)("div",me,[(0,l.bF)(p,{"model-value":o.uploadNameType,"onUpdate:modelValue":t[3]||(t[3]=t=>e.$emit("update:uploadNameType",t)),class:"radio-card-group grid-2x2"},{default:(0,l.k6)(()=>[(0,l.bF)(u,{label:"default",class:"radio-card"},{default:(0,l.k6)(()=>[(0,l.bF)(h,{icon:"cog",class:"radio-icon"}),(0,l.Lk)("span",null,(0,i.v_)(e.$t("uploadSettings.namingDefault")),1)]),_:1}),(0,l.bF)(u,{label:"index",class:"radio-card"},{default:(0,l.k6)(()=>[(0,l.bF)(h,{icon:"hashtag",class:"radio-icon"}),(0,l.Lk)("span",null,(0,i.v_)(e.$t("uploadSettings.namingIndex")),1)]),_:1}),(0,l.bF)(u,{label:"origin",class:"radio-card"},{default:(0,l.k6)(()=>[(0,l.bF)(h,{icon:"file-signature",class:"radio-icon"}),(0,l.Lk)("span",null,(0,i.v_)(e.$t("uploadSettings.namingOrigin")),1)]),_:1}),(0,l.bF)(u,{label:"short",class:"radio-card"},{default:(0,l.k6)(()=>[(0,l.bF)(h,{icon:"compress-alt",class:"radio-icon"}),(0,l.Lk)("span",null,(0,i.v_)(e.$t("uploadSettings.namingShort")),1)]),_:1})]),_:1},8,["model-value"])])]),(0,l.Lk)("div",ge,[(0,l.Lk)("div",fe,[(0,l.Lk)("span",ye,(0,i.v_)(e.$t("uploadSettings.filePreprocess")),1),(0,l.bF)(m,{content:e.$t("uploadSettings.filePreprocessTooltip"),placement:"top"},{default:(0,l.k6)(()=>[(0,l.bF)(h,{icon:"question-circle",class:"section-help-icon"})]),_:1},8,["content"])]),(0,l.Lk)("div",be,[(0,l.Lk)("div",ke,[(0,l.Lk)("span",ve,[(0,l.eW)((0,i.v_)(e.$t("uploadSettings.convertToWebp"))+" ",1),(0,l.bF)(m,{content:e.$t("uploadSettings.convertToWebpTooltip"),placement:"top"},{default:(0,l.k6)(()=>[(0,l.bF)(h,{icon:"question-circle",class:"inline-help-icon"})]),_:1},8,["content"])]),(0,l.bF)(b,{"model-value":o.convertToWebp,"onUpdate:modelValue":t[4]||(t[4]=t=>e.$emit("update:convertToWebp",t))},null,8,["model-value"])]),(0,l.Lk)("div",Ce,[(0,l.Lk)("span",we,(0,i.v_)(e.$t("uploadSettings.fileCompress")),1),(0,l.bF)(b,{"model-value":o.customerCompress,"onUpdate:modelValue":t[5]||(t[5]=t=>e.$emit("update:customerCompress",t))},null,8,["model-value"])]),o.customerCompress?((0,l.uX)(),(0,l.CE)("div",Fe,[(0,l.Lk)("span",Le,[(0,l.eW)((0,i.v_)(e.$t("uploadSettings.compressThreshold"))+" ",1),(0,l.bF)(m,{content:e.$t("uploadSettings.compressThresholdTooltip"),placement:"top"},{default:(0,l.k6)(()=>[(0,l.bF)(h,{icon:"question-circle",class:"inline-help-icon"})]),_:1},8,["content"])]),(0,l.Lk)("div",Ue,[(0,l.bF)(k,{"model-value":o.compressBar,"onUpdate:modelValue":t[6]||(t[6]=t=>e.$emit("update:compressBar",t)),min:1,max:20,"format-tooltip":e=>`${e} MB`},null,8,["model-value","format-tooltip"]),(0,l.Lk)("div",$e,[(0,l.bF)(v,{"model-value":o.compressBar,"onUpdate:modelValue":t[7]||(t[7]=t=>e.$emit("update:compressBar",t)),min:1,max:20,step:1,"value-on-clear":1,class:"slider-input","controls-position":"right"},null,8,["model-value"]),t[19]||(t[19]=(0,l.Lk)("span",{class:"slider-unit"},"MB",-1))])])])):(0,l.Q3)("",!0),o.customerCompress?((0,l.uX)(),(0,l.CE)("div",Se,[(0,l.Lk)("span",Te,[(0,l.eW)((0,i.v_)(e.$t("uploadSettings.expectedSize"))+" ",1),(0,l.bF)(m,{content:e.$t("uploadSettings.expectedSizeTooltip"),placement:"top"},{default:(0,l.k6)(()=>[(0,l.bF)(h,{icon:"question-circle",class:"inline-help-icon"})]),_:1},8,["content"])]),(0,l.Lk)("div",_e,[(0,l.bF)(k,{"model-value":o.compressQuality,"onUpdate:modelValue":t[8]||(t[8]=t=>e.$emit("update:compressQuality",t)),min:.5,max:o.compressBar,step:.1,"format-tooltip":e=>`${e} MB`},null,8,["model-value","max","format-tooltip"]),(0,l.Lk)("div",xe,[(0,l.bF)(v,{"model-value":o.compressQuality,"onUpdate:modelValue":t[9]||(t[9]=t=>e.$emit("update:compressQuality",t)),min:.5,max:o.compressBar,step:.1,precision:1,"value-on-clear":.5,class:"slider-input","controls-position":"right"},null,8,["model-value","max"]),t[20]||(t[20]=(0,l.Lk)("span",{class:"slider-unit"},"MB",-1))])])])):(0,l.Q3)("",!0)])]),"telegram"===o.uploadChannel?((0,l.uX)(),(0,l.CE)("div",Ae,[(0,l.Lk)("div",Me,[(0,l.Lk)("span",Re,(0,i.v_)(e.$t("uploadSettings.serverCompress")),1),(0,l.bF)(m,{content:e.$t("uploadSettings.serverCompressTooltip"),placement:"top","raw-content":""},{default:(0,l.k6)(()=>[(0,l.bF)(h,{icon:"question-circle",class:"section-help-icon"})]),_:1},8,["content"])]),(0,l.Lk)("div",De,[(0,l.Lk)("div",Ee,[(0,l.Lk)("span",Ie,(0,i.v_)(e.$t("uploadSettings.enableCompress")),1),(0,l.bF)(b,{"model-value":o.serverCompress,"onUpdate:modelValue":t[10]||(t[10]=t=>e.$emit("update:serverCompress",t))},null,8,["model-value"])])])])):(0,l.Q3)("",!0),(0,l.Lk)("div",Ne,[(0,l.bF)(C,{type:"primary",onClick:t[11]||(t[11]=e=>d.visible=!1),class:"confirm-btn"},{default:(0,l.k6)(()=>[(0,l.eW)((0,i.v_)(e.$t("uploadSettings.confirm")),1)]),_:1})])]),_:1},8,["title","modelValue","width"])}var ze={name:"UploadSettingsDialog",components:{ChannelIcon:Y.A},methods:{handleUploadFolderInput(e){e&&!e.startsWith("/")&&(e="/"+e),this.$emit("update:uploadFolder",e)}},props:{modelValue:{type:Boolean,default:!1},uploadChannel:{type:String,default:"telegram"},channelName:{type:String,default:""},currentChannelList:{type:Array,default:()=>[]},uploadFolder:{type:String,default:""},autoRetry:{type:Boolean,default:!0},uploadNameType:{type:String,default:"default"},convertToWebp:{type:Boolean,default:!1},customerCompress:{type:Boolean,default:!0},compressBar:{type:Number,default:5},compressQuality:{type:Number,default:4},serverCompress:{type:Boolean,default:!0}},emits:["update:modelValue","update:uploadChannel","update:channelName","update:uploadFolder","update:autoRetry","update:uploadNameType","update:convertToWebp","update:customerCompress","update:compressBar","update:compressQuality","update:serverCompress"],computed:{visible:{get(){return this.modelValue},set(e){this.$emit("update:modelValue",e)}},dialogWidth(){return window.innerWidth>768?"50%":"90%"}}};const Ve=(0,W.A)(ze,[["render",Pe]]);var We=Ve,Be=o(88559),He=(o(85970),o(813)),Qe=(o(34896),o(69655)),Xe=(o(2893),o(74253));o(79899);const qe={class:"upload-list-item"},Oe=["href"],je={key:0,style:{width:"10vw","border-radius":"12px"},autoplay:"",muted:"",playsinline:"",loop:""},Ge=["src"],Ke=["src"],Je={key:2,style:{width:"10vw","border-radius":"12px"}},Ye={class:"upload-list-item-content"},Ze={class:"upload-list-item-name-wrapper"},et={key:0,class:"upload-list-item-url"},tt={class:"upload-list-item-url-row"},ot={class:"upload-list-item-url-row"},st={key:1,class:"upload-list-item-progress"},at={class:"upload-list-item-action"};function lt(e,t,o,s,a,n){const r=(0,l.g2)("font-awesome-icon"),d=Xe.$g,c=G.WK,u=Qe.ve,p=(0,l.g2)("Link"),h=He.tk,m=(0,l.g2)("Delete");return(0,l.uX)(),(0,l.CE)("div",qe,[(0,l.Lk)("a",{href:o.file.url,target:"_blank",class:"upload-list-item-preview"},[n.isVideo(o.file.name)?((0,l.uX)(),(0,l.CE)("video",je,[(0,l.Lk)("source",{src:o.file.url,type:"video/mp4"},null,8,Ge),t[7]||(t[7]=(0,l.eW)(" Your browser does not support the video tag. ",-1))])):n.isImage(o.file.name)?((0,l.uX)(),(0,l.CE)("img",{key:1,style:{width:"10vw","border-radius":"12px"},src:o.file.url,onError:t[0]||(t[0]=t=>e.$emit("preview-error",o.file))},null,40,Ke)):((0,l.uX)(),(0,l.CE)("div",Je,[(0,l.bF)(r,{icon:"file",class:"file-icon"})]))],8,Oe),(0,l.Lk)("div",Ye,[(0,l.Lk)("div",Ze,[(0,l.bF)(d,{class:"upload-list-item-name",truncated:""},{default:(0,l.k6)(()=>[(0,l.eW)((0,i.v_)(n.truncateFilename(o.file.name)),1)]),_:1})]),"done"===o.file.status?((0,l.uX)(),(0,l.CE)("div",et,[(0,l.Lk)("div",tt,[(0,l.bF)(c,{modelValue:o.file.finalURL,"onUpdate:modelValue":t[1]||(t[1]=e=>o.file.finalURL=e),readonly:"",onClick:n.selectAllText,size:n.urlSize},{prepend:(0,l.k6)(()=>[...t[8]||(t[8]=[(0,l.eW)("URL",-1)])]),_:1},8,["modelValue","onClick","size"]),(0,l.bF)(c,{modelValue:o.file.mdURL,"onUpdate:modelValue":t[2]||(t[2]=e=>o.file.mdURL=e),readonly:"",onClick:n.selectAllText,size:n.urlSize},{prepend:(0,l.k6)(()=>[...t[9]||(t[9]=[(0,l.eW)("MarkDown",-1)])]),_:1},8,["modelValue","onClick","size"])]),(0,l.Lk)("div",ot,[(0,l.bF)(c,{modelValue:o.file.htmlURL,"onUpdate:modelValue":t[3]||(t[3]=e=>o.file.htmlURL=e),readonly:"",onClick:n.selectAllText,size:n.urlSize},{prepend:(0,l.k6)(()=>[...t[10]||(t[10]=[(0,l.eW)("HTML",-1)])]),_:1},8,["modelValue","onClick","size"]),(0,l.bF)(c,{modelValue:o.file.ubbURL,"onUpdate:modelValue":t[4]||(t[4]=e=>o.file.ubbURL=e),readonly:"",onClick:n.selectAllText,size:n.urlSize},{prepend:(0,l.k6)(()=>[...t[11]||(t[11]=[(0,l.eW)("BBCode",-1)])]),_:1},8,["modelValue","onClick","size"])])])):((0,l.uX)(),(0,l.CE)("div",st,[(0,l.bF)(u,{percentage:o.file.progreess,status:o.file.status,"show-text":!1},null,8,["percentage","status"])]))]),(0,l.Lk)("div",at,[(0,l.Lk)("button",{class:"modern-file-action-btn modern-file-action-btn-primary",onClick:t[5]||(t[5]=t=>e.$emit("copy",o.file))},[(0,l.bF)(h,null,{default:(0,l.k6)(()=>[(0,l.bF)(p)]),_:1})]),(0,l.Lk)("button",{class:"modern-file-action-btn modern-file-action-btn-danger",onClick:t[6]||(t[6]=t=>e.$emit("remove",o.file))},[(0,l.bF)(h,null,{default:(0,l.k6)(()=>[(0,l.bF)(m)]),_:1})])])])}var it=o(57477);const nt=["jpg","jpeg","png","gif","bmp","webp","svg","tiff","ico","avif","heic","jfif","pjpeg","pjp","raw","cr2","nef","dng","eps","ai","emf","wmf"],rt=["mp4","webm","ogg","mkv"];var dt={name:"UploadFileItem",components:{Link:it.Link,Delete:it.Delete},props:{file:{type:Object,required:!0}},emits:["copy","remove","preview-error"],computed:{urlSize(){return window.innerWidth<768?"small":"default"}},methods:{isImage(e){const t=e.split(".").pop().toLowerCase();return nt.includes(t)},isVideo(e){const t=e.split(".").pop().toLowerCase();return rt.includes(t)},truncateFilename(e,t=20){if(!e||e.length<=t)return e;const o=e.lastIndexOf(".");let s,a;o>0?(s=e.substring(0,o),a=e.substring(o)):(s=e,a="");const l=a.length+4,i=t-l-3;return i<=0?e.substring(0,t-3)+"...":s.substring(0,i)+"..."+s.slice(-4)+a},selectAllText(e){navigator.clipboard.writeText(e.target.value).then(()=>{this.$message({type:"success",message:this.$t("uploadForm.copySuccess")})}).catch(()=>{this.$message({type:"error",message:this.$t("uploadForm.copyFailed")})})}}};const ct=(0,W.A)(dt,[["render",lt],["__scopeId","data-v-698179d6"]]);var ut=ct,pt=o(62086),ht=(o(40670),o(88830),o(23597),o(70683)),mt=(o(95385),o(3261),o(47358));const gt={class:"upload-form"},ft={class:"upload-card-glow",ref:"uploadCardGlow"},yt=["innerHTML"],bt={key:0,class:"upload-card"},kt={class:"paste-card-actions"},vt={class:"upload-list-dashboard-action"},Ct={class:"modern-action-group"},wt={class:"modern-dropdown-item-content"},Ft={class:"modern-action-btn modern-action-btn-danger"};function Lt(e,t,n,r,d,c){const u=(0,l.g2)("CameraFilled"),p=He.tk,h=mt.j5,m=G.WK,g=a.S2,f=J.Zh,y=J.MQ,b=ht.Ik,k=(0,l.g2)("List"),v=(0,l.g2)("Checked"),C=(0,l.g2)("Failed"),w=Xe.$g,F=(0,l.g2)("font-awesome-icon"),L=s.R7,U=j.qi,$=pt.c6,S=pt.Iy,T=pt.dW,_=ut,x=Be.kA;return(0,l.uX)(),(0,l.CE)("div",gt,[(0,l.Lk)("div",{class:"upload-card-wrapper",onMousemove:t[0]||(t[0]=(...e)=>c.handleUploadCardMouseMove&&c.handleUploadCardMouseMove(...e)),onMouseleave:t[1]||(t[1]=(...e)=>c.handleUploadCardMouseLeave&&c.handleUploadCardMouseLeave(...e))},[(0,l.Lk)("div",ft,null,512),"default"===n.uploadMethod?((0,l.uX)(),(0,l.Wv)(h,{key:0,class:(0,i.C4)(["upload-card",{"is-uploading":d.uploading,"upload-card-busy":d.fileList.length}]),drag:"",multiple:"","http-request":c.uploadFile,onSuccess:c.handleSuccess,"on-error":c.handleError,"before-upload":c.beforeUpload,"on-progress":c.handleProgress,"file-list":d.fileList,"show-file-list":!1},{default:(0,l.k6)(()=>[(0,l.bF)(p,{class:(0,i.C4)(["el-icon--upload",{"upload-list-busy":d.fileList.length}])},{default:(0,l.k6)(()=>[(0,l.bF)(u)]),_:1},8,["class"]),(0,l.Lk)("div",{class:(0,i.C4)(["el-upload__text",{"upload-list-busy":d.fileList.length}]),innerHTML:e.$t("upload.dragUploadText")},null,10,yt)]),_:1},8,["class","http-request","onSuccess","on-error","before-upload","on-progress","file-list"])):(0,l.Q3)("",!0)],32),"paste"===n.uploadMethod?((0,l.uX)(),(0,l.CE)("div",bt,[(0,l.bF)(b,{class:(0,i.C4)(["paste-card",{"is-uploading":d.uploading,"upload-card-busy":d.fileList.length}])},{default:(0,l.k6)(()=>[(0,l.bF)(m,{modelValue:d.pastedUrls,"onUpdate:modelValue":t[2]||(t[2]=e=>d.pastedUrls=e),class:"upload-card-textarea",placeholder:e.$t("upload.pasteUrlPlaceholder"),type:"textarea",rows:d.fileList.length?4:14},null,8,["modelValue","placeholder","rows"]),(0,l.Lk)("div",kt,[(0,l.bF)(g,{class:"paste-card-upload-button",type:"primary",size:c.pasteCardMethodButtonSize,onClick:c.handleUploadPasteUrls},{default:(0,l.k6)(()=>[(0,l.eW)((0,i.v_)(e.$t("upload.pasteUploadBtn")),1)]),_:1},8,["size","onClick"]),(0,l.bF)(y,{modelValue:d.pasteUploadMethod,"onUpdate:modelValue":t[3]||(t[3]=e=>d.pasteUploadMethod=e),class:"paste-card-method-group",size:c.pasteCardMethodButtonSize},{default:(0,l.k6)(()=>[(0,l.bF)(f,{label:"save"},{default:(0,l.k6)(()=>[(0,l.eW)((0,i.v_)(e.$t("upload.pasteSave")),1)]),_:1}),(0,l.bF)(f,{label:"external"},{default:(0,l.k6)(()=>[(0,l.eW)((0,i.v_)(e.$t("upload.pasteExternal")),1)]),_:1})]),_:1},8,["modelValue","size"])])]),_:1},8,["class"])])):(0,l.Q3)("",!0),(0,l.bF)(b,{class:(0,i.C4)(["upload-list-card",{"upload-list-busy":d.fileList.length,"is-uploading":d.uploading}])},{default:(0,l.k6)(()=>[(0,l.Lk)("div",{class:(0,i.C4)(["upload-list-container",{"upload-list-busy":d.fileList.length}])},[(0,l.bF)(x,{onScroll:c.handleScroll,ref:"scrollContainer"},{default:(0,l.k6)(()=>[(0,l.Lk)("div",{class:(0,i.C4)(["upload-list-dashboard",{"list-scrolled":d.listScrolled}])},[(0,l.bF)(w,{class:"upload-list-dashboard-title"},{default:(0,l.k6)(()=>[(0,l.bF)(p,null,{default:(0,l.k6)(()=>[(0,l.bF)(k)]),_:1}),(0,l.eW)((0,i.v_)(c.uploadingCount+c.waitingCount)+" ",1),(0,l.bF)(p,null,{default:(0,l.k6)(()=>[(0,l.bF)(v)]),_:1}),(0,l.eW)((0,i.v_)(c.uploadSuccessCount)+" ",1),(0,l.bF)(p,null,{default:(0,l.k6)(()=>[(0,l.bF)(C)]),_:1}),(0,l.eW)((0,i.v_)(c.uploadErrorCount),1)]),_:1}),(0,l.Lk)("div",vt,[(0,l.Lk)("div",Ct,[(0,l.bF)(L,{disabled:c.disableTooltip,content:e.$t("upload.copyAll"),placement:"top"},{default:(0,l.k6)(()=>[(0,l.Lk)("button",{class:"modern-action-btn modern-action-btn-copy",onClick:t[4]||(t[4]=(...e)=>c.copyAll&&c.copyAll(...e))},[(0,l.bF)(F,{icon:"copy"})])]),_:1},8,["disabled","content"]),(0,l.bF)(L,{disabled:c.disableTooltip,content:e.$t("upload.retryFailed"),placement:"top"},{default:(0,l.k6)(()=>[(0,l.bF)(T,null,{dropdown:(0,l.k6)(()=>[(0,l.bF)(S,{class:"modern-dropdown-menu"},{default:(0,l.k6)(()=>[(0,l.bF)($,null,{default:(0,l.k6)(()=>[(0,l.Lk)("div",wt,[(0,l.Lk)("span",null,(0,i.v_)(e.$t("uploadForm.autoRetry")),1),(0,l.bF)(U,{modelValue:d.autoReUpload,"onUpdate:modelValue":t[6]||(t[6]=e=>d.autoReUpload=e),onChange:c.handleAutoRetryChange,size:"small"},null,8,["modelValue","onChange"])])]),_:1})]),_:1})]),default:(0,l.k6)(()=>[(0,l.Lk)("button",{class:"modern-action-btn modern-action-btn-retry",onClick:t[5]||(t[5]=(...e)=>c.retryError&&c.retryError(...e))},[(0,l.bF)(F,{icon:"redo"})])]),_:1})]),_:1},8,["disabled","content"]),(0,l.bF)(L,{disabled:c.disableTooltip,content:e.$t("upload.clearList"),placement:"top"},{default:(0,l.k6)(()=>[(0,l.bF)(T,null,{dropdown:(0,l.k6)(()=>[(0,l.bF)(S,{class:"modern-dropdown-menu"},{default:(0,l.k6)(()=>[(0,l.bF)($,{onClick:c.clearFileList},{default:(0,l.k6)(()=>[(0,l.eW)((0,i.v_)(e.$t("upload.clearAll")),1)]),_:1},8,["onClick"]),(0,l.bF)($,{onClick:c.clearSuccessList},{default:(0,l.k6)(()=>[(0,l.eW)((0,i.v_)(e.$t("upload.clearUploaded")),1)]),_:1},8,["onClick"])]),_:1})]),default:(0,l.k6)(()=>[(0,l.Lk)("button",Ft,[(0,l.bF)(F,{icon:"trash-alt"})])]),_:1})]),_:1},8,["disabled","content"])])])],2),((0,l.uX)(!0),(0,l.CE)(l.FK,null,(0,l.pI)(d.fileList.slice().reverse(),e=>((0,l.uX)(),(0,l.Wv)(_,{key:e.name,file:e,onCopy:c.handleCopy,onRemove:c.handleRemove,onPreviewError:t[7]||(t[7]=e=>e.url=o(96682))},null,8,["file","onCopy","onRemove"]))),128))]),_:1},8,["onScroll"])],2)]),_:1},8,["class"])])}o(20116),o(18237),o(79577),o(41549),o(49797),o(49631),o(35623),o(64979);var Ut=o(457),$t=o(76334),St=o(60782);function Tt(e,t,o){const s=o+e;return{finalURL:s,mdURL:`![${t}](${s})`,htmlURL:`<img src="${s}" alt="${t}" width=100% />`,ubbURL:`[img]${s}[/img]`}}function _t(e,t){const o={url:e.finalURL,md:e.mdURL,html:e.htmlURL,ubb:e.ubbURL};return o[t]||e.finalURL}function xt(e,t){e.forEach(e=>{if("external"===e.uploadChannel)return;const o=Tt(e.srcID,e.name,t);Object.assign(e,o)})}const At=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Mt=(e,t)=>e>>>t|e<<32-t;function Rt(e,t){const o=new Uint32Array(64);for(let u=0;u<16;u++)o[u]=e[4*u]<<24|e[4*u+1]<<16|e[4*u+2]<<8|e[4*u+3];for(let u=16;u<64;u++){const e=Mt(o[u-15],7)^Mt(o[u-15],18)^o[u-15]>>>3,t=Mt(o[u-2],17)^Mt(o[u-2],19)^o[u-2]>>>10;o[u]=o[u-16]+e+o[u-7]+t>>>0}let[s,a,l,i,n,r,d,c]=t;for(let u=0;u<64;u++){const e=Mt(n,6)^Mt(n,11)^Mt(n,25),t=n&r^~n&d,p=c+e+t+At[u]+o[u]>>>0,h=Mt(s,2)^Mt(s,13)^Mt(s,22),m=s&a^s&l^a&l,g=h+m>>>0;c=d,d=r,r=n,n=i+p>>>0,i=l,l=a,a=s,s=p+g>>>0}t[0]=t[0]+s>>>0,t[1]=t[1]+a>>>0,t[2]=t[2]+l>>>0,t[3]=t[3]+i>>>0,t[4]=t[4]+n>>>0,t[5]=t[5]+r>>>0,t[6]=t[6]+d>>>0,t[7]=t[7]+c>>>0}function Dt(){let e=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),t=new Uint8Array(64),o=0,s=0;return{update(a){s+=a.length;let l=0;if(o>0){const s=64-o,i=Math.min(s,a.length);t.set(a.subarray(0,i),o),o+=i,l=i,64===o&&(Rt(t,e),o=0)}while(l+64<=a.length)Rt(a.subarray(l,l+64),e),l+=64;l<a.length&&(t.set(a.subarray(l),0),o=a.length-l)},digest(){const a=8*s;t[o++]=128,o>56&&(t.fill(0,o,64),Rt(t,e),o=0),t.fill(0,o,56);const l=new DataView(t.buffer);l.setUint32(56,Math.floor(a/4294967296),!1),l.setUint32(60,a>>>0,!1),Rt(t,e);let i="";for(let t=0;t<8;t++)i+=e[t].toString(16).padStart(8,"0");return i}}}async function Et(e){const t=Dt(),o=4194304;let s=0;while(s<e.size){const a=e.slice(s,Math.min(s+o,e.size)),l=await a.arrayBuffer();t.update(new Uint8Array(l)),s+=o,s%20971520<o&&console.log(`SHA256 progress: ${Math.min(100,Math.round(s/e.size*100))}%`)}return t.digest()}var It={name:"UploadForm",components:{UploadFileItem:ut},props:{selectedUrlForm:{type:String,default:"url",required:!1},customerCompress:{type:Boolean,default:!0,required:!1},compressQuality:{type:Number,default:4,required:!1},compressBar:{type:Number,default:5,required:!1},serverCompress:{type:Boolean,default:!0,required:!1},uploadChannel:{type:String,default:"telegram",required:!1},channelName:{type:String,default:"",required:!1},uploadNameType:{type:String,default:"default",required:!1},useCustomUrl:{type:String,default:"false",required:!1},customUrlPrefix:{type:String,default:"",required:!1},autoRetry:{type:Boolean,default:!0,required:!1},urlPrefix:{type:String,default:"",required:!1},uploadMethod:{type:String,default:"default",required:!1},uploadFolder:{type:String,default:"",required:!1},convertToWebp:{type:Boolean,default:!1,required:!1}},data(){return{fileList:[],uploading:!1,maxUploading:6,exceptionList:[],listScrolled:!1,fileListLength:0,uploadCount:0,pastedUrls:"",pasteUploadMethod:"save",autoReUpload:!0,maxRetryCount:10,retryTimer:null,retryDelay:12e3,uploadQueue:[],activeUploads:0,maxConcurrentUploads:6,abortControllers:new Map}},watch:{fileList:{handler(){this.fileList.length>this.fileListLength&&this.$nextTick(()=>{setTimeout(()=>{this.$refs.scrollContainer&&this.$refs.scrollContainer.setScrollTop(0)},100)}),this.fileListLength=this.fileList.length},deep:!0},useCustomUrl:{handler(){xt(this.fileList,this.rootUrl)},immediate:!0},customUrlPrefix:{handler(){"true"===this.useCustomUrl&&xt(this.fileList,this.rootUrl)},immediate:!0},autoReUpload(e){this.$store.commit("setStoreAutoReUpload",e)}},computed:{...(0,St.L8)(["storeAutoReUpload"]),uploadSuccessCount(){return this.fileList.filter(e=>"done"===e.status||"success"===e.status).length},uploadErrorCount(){return this.fileList.filter(e=>"exception"===e.status).length},uploadingCount(){return this.fileList.filter(e=>"uploading"===e.status).length},waitingCount(){return this.uploadQueue.length},urlSize(){return window.innerWidth<768?"small":"default"},disableTooltip(){return window.innerWidth<768},rootUrl(){return"true"===this.useCustomUrl?this.customUrlPrefix:this.urlPrefix||`${window.location.protocol}//${window.location.host}/file/`},pasteCardMethodButtonSize(){return this.fileList.length||window.innerWidth<768?"small":"medium"}},mounted(){document.addEventListener("paste",this.handlePaste),this.autoReUpload=this.storeAutoReUpload},beforeUnmount(){document.removeEventListener("paste",this.handlePaste),this.uploadQueue=[],this.fileList=[],this.activeUploads=0},methods:{truncateFilename(e,t=20){if(!e||e.length<=t)return e;const o=e.lastIndexOf(".");let s,a;o>0?(s=e.substring(0,o),a=e.substring(o)):(s=e,a="");const l=a.length+4,i=t-l-3;return i<=0?e.substring(0,t-3)+"...":s.substring(0,i)+"..."+s.slice(-4)+a},uploadFile(e){if(!this.fileList.find(t=>t.uid===e.file.uid))return;if(this.activeUploads>=this.maxConcurrentUploads){this.uploadQueue.push(e);const t=this.fileList.find(t=>t.uid===e.file.uid);return void(t&&(t.status="waiting"))}this.activeUploads++;const t=this.fileList.find(t=>t.uid===e.file.uid);t&&(t.status="uploading");const o=this.fileList.find(t=>t.uid===e.file.uid),s=o?.uploadChannel||this.uploadChannel;if("external"===s)return void this.uploadSingleFile(e);if("huggingface"===s){const t=20971520;return void(e.file.size>=t?this.uploadToHuggingFaceDirect(e):this.uploadSingleFile(e))}if("discord"===s){const t=9437184;return void(e.file.size>t?this.uploadFileInChunks(e):this.uploadSingleFile(e))}const a=20971520;e.file.size>a?this.uploadFileInChunks(e):this.uploadSingleFile(e)},processUploadQueue(){if(0===this.uploadQueue.length||this.activeUploads>=this.maxConcurrentUploads)return;const e=this.uploadQueue.shift();e&&this.fileList.find(t=>t.uid===e.file.uid)?this.uploadFile(e):this.processUploadQueue()},onUploadComplete(){this.activeUploads=Math.max(0,this.activeUploads-1),this.processUploadQueue(),0===this.activeUploads&&0===this.uploadQueue.length&&(this.uploading=!1)},async uploadSingleFile(e){const t=this.fileList.find(t=>t.uid===e.file.uid);if(!t)return;const o=t.serverCompress,s=t.uploadChannel||this.uploadChannel,a=this.autoRetry&&"external"!==s,l="external"===s?"default":this.uploadNameType,i=new AbortController;this.abortControllers.set(e.file.uid,i);const n=new FormData;if(n.append("file",e.file),"external"===s&&n.append("url",e.file.url),"huggingface"===s)try{console.log("Computing SHA256 for HuggingFace upload...");const t=await Et(e.file);n.append("sha256",t),console.log("SHA256 computed:",t)}catch(r){console.error("Failed to compute SHA256:",r)}(0,Ut.A)({url:"/upload?serverCompress="+o+"&uploadChannel="+s+(this.channelName?"&channelName="+encodeURIComponent(this.channelName):"")+"&uploadNameType="+l+"&autoRetry="+a+"&uploadFolder="+encodeURIComponent(this.uploadFolder),method:"post",data:n,withAuthCode:!0,signal:i.signal,onUploadProgress:t=>{const o=Math.round(t.loaded/t.total*100);e.onProgress({percent:o,file:e.file})}}).then(t=>{e.onSuccess(t,e.file)}).catch(t=>{"CanceledError"!==t.name&&"ERR_CANCELED"!==t.code?t.response&&401!==t.response.status?(this.exceptionList.push(e),e.onError(t,e.file)):t.response||(this.exceptionList.push(e),e.onError(t,e.file)):console.log("上传已取消:",e.file.name)}).finally(()=>{this.abortControllers.delete(e.file.uid),this.onUploadComplete()})},async uploadFileInChunks(e){const t=this.fileList.find(t=>t.uid===e.file.uid);if(!t)return;const o=t.uploadChannel||this.uploadChannel,s=new AbortController;this.abortControllers.set(e.file.uid,s);const a="discord"===o?9437184:16777216,l=e.file.size,i=e.file.type||"application/octet-stream",n=Math.ceil(l/a),r=t.serverCompress,d=this.autoRetry&&"external"!==o,c="external"===o?"default":this.uploadNameType;let u=null;if("huggingface"===o)try{console.log("Computing SHA256 for HuggingFace chunked upload..."),u=await Et(e.file),console.log("SHA256 computed:",u)}catch(p){console.error("Failed to compute SHA256:",p)}try{const t=new FormData;t.append("originalFileName",e.file.name),t.append("originalFileType",i),t.append("totalChunks",n.toString());const h=await(0,Ut.A)({url:"/upload?serverCompress="+r+"&uploadChannel="+o+(this.channelName?"&channelName="+encodeURIComponent(this.channelName):"")+"&uploadNameType="+c+"&autoRetry="+d+"&uploadFolder="+encodeURIComponent(this.uploadFolder)+"&initChunked=true",method:"post",data:t,withAuthCode:!0});if(!h.data.success)throw new Error(this.$t("uploadForm.chunkInitFailed")+": "+h.data.message);const m=h.data.uploadId;console.log("分块上传初始化成功,uploadId:",m);const g=this.fileList.find(t=>t.uid===e.file.uid);g&&(g.totalChunks=n,g.uploadId=m);const f=3,y=new Array(n).fill(0);let b=0,k=!1,v="",C=!1;const w=async t=>{if(k||C)return;const u=t*a,h=Math.min(u+a,l),g=e.file.slice(u,h),f=new FormData;f.append("file",g,`${e.file.name}.part${t.toString().padStart(3,"0")}`),f.append("chunkIndex",t.toString()),f.append("totalChunks",n.toString()),f.append("uploadId",m),f.append("originalFileName",e.file.name),f.append("originalFileType",i);let b=0;const w=3;while(b<w){if(k||C)return;try{return void await(0,Ut.A)({url:"/upload?serverCompress="+r+"&uploadChannel="+o+(this.channelName?"&channelName="+encodeURIComponent(this.channelName):"")+"&uploadNameType="+c+"&autoRetry="+d+"&uploadFolder="+encodeURIComponent(this.uploadFolder)+"&chunked=true",method:"post",data:f,withAuthCode:!0,signal:s.signal,onUploadProgress:o=>{if(k||C)return;const s=Math.round(o.loaded/o.total*100);y[t]=s;const a=Math.round(y.reduce((e,t)=>e+t,0)/n);e.onProgress({percent:a,file:e.file})}})}catch(p){if("CanceledError"===p.name||"ERR_CANCELED"===p.code)return C=!0,void console.log("分块上传已取消:",e.file.name);if(b++,console.warn(`分块 ${t+1}/${n} 上传失败 (重试 ${b}/${w}):`,p),b>=w)throw k=!0,v=`分块 ${t+1}/${n} 上传失败: ${p.message}`,new Error(v);await new Promise(e=>setTimeout(e,2e3*b))}}},F=[];for(let e=0;e<f;e++)F.push((async()=>{while(b<n&&!k&&!C){const t=b++;try{await w(t)}catch(e){C||(k=!0,v=e.message);break}}})());if(await Promise.all(F),C)return void console.log("分块上传已取消,跳过合并步骤");if(k)throw new Error(v||this.$t("uploadForm.uploadError"));this.$message({type:"info",message:this.$t("uploadForm.chunkMerging"),duration:0});const L=new FormData;L.append("uploadId",m),L.append("totalChunks",n.toString()),L.append("originalFileName",e.file.name),L.append("originalFileType",i),u&&L.append("sha256",u);const U=await(0,Ut.A)({url:"/upload?serverCompress="+r+"&uploadChannel="+o+(this.channelName?"&channelName="+encodeURIComponent(this.channelName):"")+"&uploadNameType="+c+"&autoRetry="+d+"&uploadFolder="+encodeURIComponent(this.uploadFolder)+"&chunked=true&merge=true",method:"post",data:L,withAuthCode:!0});this.$message.closeAll(),e.onSuccess(U,e.file)}catch(p){if("CanceledError"===p.name||"ERR_CANCELED"===p.code)return void console.log("分块上传已取消:",e.file.name);console.error("分块上传失败:",p);const t=this.fileList.find(t=>t.uid===e.file.uid);t&&t.uploadId&&this.cleanupUploadResources(t.uploadId,t.totalChunks).then(()=>{console.log(`已清理分块上传失败的资源: ${t.uploadId}`)}).catch(e=>{console.warn("清理分块上传失败资源时出错:",e)}),p.response&&401!==p.response.status?(this.exceptionList.push(e),e.onError(p,e.file)):p.response||(this.exceptionList.push(e),e.onError(p,e.file))}finally{this.abortControllers.delete(e.file.uid),this.onUploadComplete()}},handleRemove(e){this.abortControllers.has(e.uid)&&(this.abortControllers.get(e.uid).abort(),this.abortControllers.delete(e.uid)),this.uploadQueue=this.uploadQueue.filter(t=>t.file.uid!==e.uid),this.fileList=this.fileList.filter(t=>t.uid!==e.uid),this.$message({type:"info",message:this.$t("uploadForm.deleted",{name:this.truncateFilename(e.name)})})},async cleanupUploadResources(e,t=0){try{await(0,Ut.A)({url:`/upload?cleanup=true&uploadId=${e}&totalChunks=${t}`,method:"get",withAuthCode:!0,timeout:5e3}),console.log(`清理上传资源成功: ${e}`)}catch(o){console.warn("清理上传资源失败:",o)}},handleSuccess(e,t){const o=this.fileList.find(e=>e.uid===t.uid);if(o)try{const s=o.uploadChannel||this.uploadChannel;if("external"!==s){const s=e.data[0].src.replace("/file/","");o.url=`${window.location.protocol}//${window.location.host}/file/`+s;const a=Tt(s,t.name,this.rootUrl);Object.assign(o,a),o.srcID=s}o.progreess=100,o.status="success",this.saveToHistory(o),this.$message({type:"success",message:this.$t("uploadForm.uploadSuccess",{name:this.truncateFilename(t.name)})}),setTimeout(()=>{const e=this.fileList.find(e=>e.uid===t.uid);e&&(e.status="done")},1e3)}catch(s){this.$message.error(this.$t("uploadForm.uploadFailed",{name:this.truncateFilename(t.name)})),o.status="exception"}},saveToHistory(e){try{const t=JSON.parse(localStorage.getItem("uploadHistory")||"[]"),o={name:e.name,url:e.finalURL,time:Date.now(),type:e.name.split(".").pop().toLowerCase()};t.push(o),localStorage.setItem("uploadHistory",JSON.stringify(t))}catch(t){console.error("Failed to save history",t)}},handleError(e,t){const o=this.fileList.find(e=>e.uid===t.uid);o&&(this.$message.error(this.$t("uploadForm.uploadFailed",{name:this.truncateFilename(t.name)})),o.status="exception",this.autoReUpload&&this.scheduleAutoRetry())},handleCopy(e){const t=this.fileList.find(t=>t.uid===e.uid).status;"done"===t||"success"===t?(navigator.clipboard.writeText(_t(e,this.selectedUrlForm)),this.$message({type:"success",message:this.$t("uploadForm.copySuccess")})):this.$message({type:"warning",message:this.$t("uploadForm.fileNotUploaded")})},beforeUpload(e){return new Promise(async(t,o)=>{let s=e;const a=this.convertToWebp&&e.type.includes("image")&&!e.type.includes("webp")&&!e.type.includes("gif")&&!e.type.includes("svg");if(a)try{const t=await this.convertImageToWebp(e);t&&(s=t,console.log(`WebP转换成功: ${e.name} -> ${t.name}, 大小: ${(e.size/1024).toFixed(1)}KB -> ${(t.size/1024).toFixed(1)}KB`))}catch(r){console.warn("WebP转换失败,使用原文件:",r)}const l=s.type.includes("image")&&this.customerCompress&&s.size/1024/1024>this.compressBar,i=s.size/1024/1024<=1024||"telegram"!==this.uploadChannel,n=(e,o)=>{const s=URL.createObjectURL(e);this.fileList.push({uid:e.uid,name:e.name,url:s,finalURL:"",mdURL:"",htmlURL:"",ubbURL:"",srcID:"",status:"uploading",progreess:0,serverCompress:o,retryCount:0}),t(e)};if(l)$t.compressAccurately(s,1024*this.compressQuality).then(t=>{t.size/1024/1024>1024&&"telegram"===this.uploadChannel&&(this.$message.error(this.$t("uploadForm.compressedFileTooLarge",{name:s.name})),o(this.$t("uploadForm.fileSizeTooLarge"))),this.uploading=!0;const a=new File([t],s.name,{type:t.type});a.uid=e.uid;const l=this.uploadCount++,i=this.serverCompress&&a.size/1024/1024<10&&"telegram"===this.uploadChannel;0===l?n(a,i):setTimeout(()=>{n(a,i),this.uploadCount--},300*l)}).catch(e=>{this.$message.error(this.$t("uploadForm.compressFailedCannotUpload",{name:s.name})),o(e)});else if(i){this.uploading=!0;const e=this.uploadCount++,t="telegram"===this.uploadChannel&&this.serverCompress&&(!s.type.includes("image")||s.size/1024/1024<10);0===e?n(s,t):setTimeout(()=>{n(s,t),this.uploadCount--},300*e)}else this.$message.error(this.$t("uploadForm.fileTooLarge",{name:s.name})),o(this.$t("uploadForm.fileSizeTooLarge"))})},handleProgress(e){const t=this.fileList.find(t=>t.uid===e.file.uid);t&&(t.progreess=e.percent)},copyAll(){const e=this.fileList.filter(e=>"done"===e.status||"success"===e.status).map(e=>_t(e,this.selectedUrlForm)).join("\n");navigator.clipboard.writeText(e),this.$message({type:"success",message:this.$t("uploadForm.copyAllSuccess")})},clearFileList(){this.fileList.length>0?(this.abortControllers.forEach((e,t)=>{e.abort()}),this.abortControllers.clear(),this.uploadQueue=[],this.fileList=[],this.$message({type:"success",message:this.$t("uploadForm.fileListCleared")})):this.$message({type:"info",message:this.$t("uploadForm.fileListEmpty")})},clearSuccessList(){this.uploadSuccessCount>0?(this.fileList=this.fileList.filter(e=>"done"!==e.status&&"success"!==e.status),this.$message({type:"success",message:this.$t("uploadForm.successFilesCleared")})):this.$message({type:"info",message:this.$t("uploadForm.successFilesEmpty")})},handlePaste(e){if("INPUT"===e.target.tagName||"TEXTAREA"===e.target.tagName)return;const t=e.clipboardData.items;t.length>0&&this.uploadFromUrl(t)},handleUploadPasteUrls(){const e=this.pastedUrls.split("\n"),t=e.map(e=>e.trim()).filter(e=>""!==e).filter(e=>/^(https?:\/\/[^\s$.?#].[^\s]*)$/.test(e));if("save"===this.pasteUploadMethod)this.uploadFromUrl(t.map(e=>({kind:"string",getAsString:t=>{t(e)}})));else if("external"===this.pasteUploadMethod)for(let o=0;o<t.length;o++){const e=t[o],s=e.split("/").pop(),a=`![${s}](${e})`,l=`<img src="${e}" alt="${s}" width=100% />`,i=`[img]${e}[/img]`,n=new File([],e.split("/").pop(),{type:"text/plain"});n.uid=Date.now()+o,n.url=e,this.fileList.push({uid:n.uid,name:n.name,url:e,finalURL:e,mdURL:a,htmlURL:l,ubbURL:i,srcID:e,status:"uploading",progreess:0,serverCompress:!1,uploadChannel:"external",retryCount:0}),this.uploadFile({file:n,onProgress:e=>this.handleProgress(e),onSuccess:(e,t)=>this.handleSuccess(e,t),onError:(e,t)=>this.handleError(e,t)})}},uploadFromUrl(e){for(let t=0;t<e.length;t++)if("file"===e[t].kind){const o=e[t].getAsFile();o.uid=Date.now()+t;const s=this.beforeUpload(o);s instanceof Promise&&s.then(e=>{e instanceof File&&this.uploadFile({file:e,onProgress:e=>this.handleProgress(e),onSuccess:(e,t)=>this.handleSuccess(e,t),onError:(e,t)=>this.handleError(e,t)})}).catch(e=>{console.log(e)})}else"string"===e[t].kind&&e[t].getAsString(e=>{const o=/^(https?:\/\/[^\s$.?#].[^\s]*)$/;let s="";o.test(e)&&Ut.A.post("/api/fetchRes",{url:e},{responseType:"blob",withAuthCode:!0}).then(o=>{o.headers["content-type"];if(200!=o.status)throw new Error("URL地址请求失败");{const l=o.headers["content-disposition"];if(l){const e=/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/,t=/filename\*\s*=\s*UTF-8''([^;\n]*)/;let o=e.exec(l);if(null!=o&&o[1]){s=o[1].replace(/['"]/g,"");try{s=decodeURIComponent(s)}catch(a){s=""}}""===s&&(o=t.exec(l),null!=o&&o[1]&&(s=decodeURIComponent(o[1])))}if(""===s){const t=new URL(e);s=t.pathname.split("/").pop()}if(""===s){const o=new URL(e);let a=o.pathname.split(".").pop();(!a||""===a||a.length>10)&&(a="bin"),s="PastedFile"+Date.now()+t+"."+a}const i=o.data,n=new File([i],s,{type:i.type});n.uid=Date.now()+t;const r=this.beforeUpload(n);r instanceof Promise&&r.then(e=>{e instanceof File&&this.uploadFile({file:e,onProgress:e=>this.handleProgress(e),onSuccess:(e,t)=>this.handleSuccess(e,t),onError:(e,t)=>this.handleError(e,t)})}).catch(e=>{console.log(e)})}}).catch(e=>{this.$message({type:"warning",message:this.$t("uploadForm.urlRequestFailed")})})})},handleScroll(e){this.listScrolled=e.scrollTop>0&&this.fileList.length>0},retryError(){this.exceptionList.length>0?(this.retryFailedFiles(this.exceptionList),this.exceptionList=[]):this.$message({type:"info",message:this.$t("uploadForm.noFailedFiles")})},handleAutoRetryChange(e){this.$message({type:e?"success":"info",message:e?this.$t("uploadForm.autoRetryOn"):this.$t("uploadForm.autoRetryOff")}),e&&this.exceptionList.length>0&&this.scheduleAutoRetry()},retryFailedFiles(e){e.forEach(e=>{const t=e.retryCount||0;t<this.maxRetryCount?(e.retryCount=t+1,this.uploadFile({file:e.file,onProgress:e=>this.handleProgress(e),onSuccess:(e,t)=>this.handleSuccess(e,t),onError:(e,t)=>this.handleError(e,t)})):this.$message({type:"warning",message:this.$t("uploadForm.maxRetryReached",{name:e.name,max:this.maxRetryCount})})})},scheduleAutoRetry(){this.retryTimer&&clearTimeout(this.retryTimer),this.retryTimer=setTimeout(()=>{if(this.autoReUpload&&this.exceptionList.length>0){const e=[...this.exceptionList];this.exceptionList=[],this.retryFailedFiles(e)}},this.retryDelay)},async uploadToHuggingFaceDirect(e){const t=this.fileList.find(t=>t.uid===e.file.uid);if(!t)return;const o=new AbortController;this.abortControllers.set(e.file.uid,o);try{console.log("=== HuggingFace Direct Upload ==="),console.log("File:",e.file.name,"Size:",e.file.size),e.onProgress({percent:5,file:e.file}),console.log("Computing SHA256...");const t=await Et(e.file);if(console.log("SHA256:",t),o.signal.aborted)return void console.log("HuggingFace 上传已取消:",e.file.name);const s=new Uint8Array(await e.file.slice(0,512).arrayBuffer()),a=btoa(String.fromCharCode(...s));e.onProgress({percent:10,file:e.file}),console.log("Getting LFS upload URL...");const l=await(0,Ut.A)({url:"/upload/huggingface/getUploadUrl",method:"post",data:{fileSize:e.file.size,fileName:e.file.name,fileType:e.file.type,sha256:t,fileSample:a,channelName:this.channelName,uploadNameType:this.uploadNameType,uploadFolder:this.uploadFolder},withAuthCode:!0,signal:o.signal});if(!l.data.success)throw new Error(l.data.error||"Failed to get upload URL");const i=l.data;if(console.log("Upload info:",i),i.alreadyExists)console.log("File already exists in LFS, skipping upload"),e.onProgress({percent:90,file:e.file});else if(i.needsLfs&&i.uploadAction){const{href:t,header:s}=i.uploadAction;if(s?.chunk_size)await this.uploadToHuggingFaceMultipart(e,i,o);else{console.log("Uploading to S3 (basic)...");const a=await fetch(t,{method:"PUT",headers:s||{},body:e.file,signal:o.signal});if(!a.ok){const e=await a.text();throw new Error(`S3 upload failed: ${a.status} - ${e}`)}console.log("S3 upload complete")}}if(o.signal.aborted)return void console.log("HuggingFace 上传已取消:",e.file.name);e.onProgress({percent:95,file:e.file}),console.log("Committing file...");const n=await(0,Ut.A)({url:"/upload/huggingface/commitUpload",method:"post",data:{fullId:i.fullId,filePath:i.filePath,sha256:t,fileSize:e.file.size,fileName:e.file.name,fileType:e.file.type,channelName:i.channelName},withAuthCode:!0,signal:o.signal});if(!n.data.success)throw new Error(n.data.error||"Failed to commit file");console.log("Upload complete:",n.data);const r={data:[{src:n.data.src}]};e.onSuccess(r,e.file)}catch(s){if("CanceledError"===s.name||"ERR_CANCELED"===s.code||"AbortError"===s.name)return void console.log("HuggingFace 上传已取消:",e.file.name);console.error("HuggingFace direct upload error:",s),this.exceptionList.push(e),e.onError(s,e.file)}finally{this.abortControllers.delete(e.file.uid),this.onUploadComplete()}},async uploadToHuggingFaceMultipart(e,t,o){const{uploadAction:s}=t,{href:a,header:l}=s,i=parseInt(l.chunk_size),n=Object.keys(l).filter(e=>/^[0-9]+$/.test(e));console.log(`Multipart upload: ${n.length} parts, chunk size: ${i}`);const r=[],d=n.length;for(const u of n){if(o&&o.signal.aborted)throw console.log("HuggingFace 分片上传已取消"),new DOMException("Upload cancelled","AbortError");const t=parseInt(u)-1,s=t*i,a=Math.min(s+i,e.file.size),n=e.file.slice(s,a);console.log(`Uploading part ${u}/${d}`);const c=await fetch(l[u],{method:"PUT",body:n,signal:o?o.signal:void 0});if(!c.ok)throw new Error(`Failed to upload part ${u}: ${c.status}`);const p=c.headers.get("ETag");if(!p)throw new Error(`No ETag for part ${u}`);r.push({partNumber:parseInt(u),etag:p});const h=10+Math.round(parseInt(u)/d*80);e.onProgress({percent:h,file:e.file})}if(o&&o.signal.aborted)throw console.log("HuggingFace 分片上传已取消"),new DOMException("Upload cancelled","AbortError");console.log("Completing multipart upload...");const c=await fetch(a,{method:"POST",headers:{Accept:"application/vnd.git-lfs+json","Content-Type":"application/vnd.git-lfs+json"},body:JSON.stringify({oid:t.oid,parts:r}),signal:o?o.signal:void 0});if(!c.ok){const e=await c.text();throw new Error(`Multipart complete failed: ${c.status} - ${e}`)}console.log("Multipart upload complete")},async convertImageToWebp(e){return new Promise((t,o)=>{if(e.type.includes("gif")||e.type.includes("svg")||e.type.includes("webp"))return void t(null);const s=new Image,a=document.createElement("canvas"),l=a.getContext("2d");s.onload=()=>{a.width=s.width,a.height=s.height,l.drawImage(s,0,0),a.toBlob(a=>{if(a){const o=e.name,s=o.lastIndexOf("."),l=s>0?o.substring(0,s)+".webp":o+".webp",i=new File([a],l,{type:"image/webp"});i.uid=e.uid,t(i)}else o(new Error("WebP 转换失败"));URL.revokeObjectURL(s.src)},"image/webp",.92)},s.onerror=()=>{URL.revokeObjectURL(s.src),o(new Error(this.$t("uploadForm.imageLoadFailed")))},s.src=URL.createObjectURL(e)})},handleUploadCardMouseMove(e){const t=this.$refs.uploadCardGlow;if(!t)return;const o=e.currentTarget.getBoundingClientRect(),s=e.clientX-o.left,a=e.clientY-o.top;t.style.opacity="1",t.style.left=s+"px",t.style.top=a+"px"},handleUploadCardMouseLeave(){const e=this.$refs.uploadCardGlow;e&&(e.style.opacity="0")}},beforeDestroy(){this.retryTimer&&clearTimeout(this.retryTimer)}};const Nt=(0,W.A)(It,[["render",Lt],["__scopeId","data-v-fca24b68"]]);var Pt=Nt,zt=o(732),Vt=o(33892),Wt=o(45130);const Bt={class:"directory-suggestion-input",ref:"wrapperRef"},Ht={class:"suggestion-dropdown"},Qt={class:"suggestion-list"},Xt=["title","onMousedown"];function qt(e,t,o,s,a,n){const r=G.WK;return(0,l.uX)(),(0,l.CE)("div",Bt,[(0,l.bF)(r,{ref:"inputRef",modelValue:n.inputValue,"onUpdate:modelValue":t[0]||(t[0]=e=>n.inputValue=e),placeholder:o.placeholder,onFocus:n.handleFocus,onBlur:n.handleBlur,onInput:n.handleInput},null,8,["modelValue","placeholder","onFocus","onBlur","onInput"]),(0,l.bo)((0,l.Lk)("div",Ht,[(0,l.Lk)("ul",Qt,[((0,l.uX)(!0),(0,l.CE)(l.FK,null,(0,l.pI)(a.suggestions,(e,t)=>((0,l.uX)(),(0,l.CE)("li",{key:t,class:"suggestion-item",title:e.value,onMousedown:(0,Wt.D$)(t=>n.selectItem(e),["prevent"])},(0,i.v_)(e.value),41,Xt))),128))])],512),[[Wt.aG,a.dropdownVisible&&a.suggestions.length>0]])],512)}var Ot={name:"DirectorySuggestionInput",props:{modelValue:{type:String,default:""},placeholder:{type:String,default:""}},emits:["update:modelValue","focus","blur","select"],data(){return{directoryTreeRoot:null,directoryTreeLoaded:!1,directoryTreeLoading:!1,directoryChildrenMap:{},focusTime:null,dropdownVisible:!1,isFocused:!1,suggestions:[]}},computed:{inputValue:{get(){return this.modelValue},set(e){this.$emit("update:modelValue",e)}}},watch:{modelValue(){this.isFocused&&this.refreshSuggestions()}},methods:{handleFocus(){this.isFocused=!0,this.focusTime=Date.now(),this.ensureDirectoryTreeLoaded(),this.$emit("focus"),setTimeout(()=>{this.isFocused&&(this.refreshSuggestions(),this.dropdownVisible=!0)},500)},handleBlur(){this.isFocused=!1,this.dropdownVisible=!1,this.$emit("blur")},handleInput(e){this.$nextTick(()=>{this.refreshSuggestions(),this.isFocused&&(this.dropdownVisible=!0)})},selectItem(e){const t=e.value;this.inputValue=t,this.$emit("select",t);const o=this.normalizeDirectoryPath(t),s=this.directoryChildrenMap[o];s&&s.length>0?this.$nextTick(()=>{this.refreshSuggestions(),this.dropdownVisible=!0,this.$refs.inputRef?.focus()}):this.dropdownVisible=!1},refreshSuggestions(){this.suggestions=this.getDirectorySuggestions(this.modelValue||"")},normalizeDirectoryPath(e){if(!e)return"/";let t=e;return t.startsWith("/")||(t="/"+t),"/"===t||t.endsWith("/")||(t+="/"),t},buildDirectoryChildrenMap(e){const t={},o=e=>{const s=this.normalizeDirectoryPath(e.path),a=Array.isArray(e.children)?e.children:[];t[s]=a.map(e=>({name:e.name,path:this.normalizeDirectoryPath(e.path)})),a.forEach(o)};o(e),this.directoryChildrenMap=t},async ensureDirectoryTreeLoaded(){if(!this.directoryTreeLoaded&&!this.directoryTreeLoading){this.directoryTreeLoading=!0;try{const e=await Ut.A.get("/api/directoryTree",{withAuthCode:!0}),t=e?.data?.tree;t&&(this.directoryTreeRoot=t,this.buildDirectoryChildrenMap(t),this.directoryTreeLoaded=!0)}catch(e){console.error("Failed to load directory tree for autocomplete:",e)}finally{this.directoryTreeLoading=!1}}},parseDirectoryQuery(e){const t=e&&e.startsWith("/")?e:`/${e||""}`,o=t.slice(1),s=o.split("/"),a=s[s.length-1]||"",l=s.slice(0,-1).filter(Boolean),i=l.length>0?`/${l.join("/")}/`:"/";return{segmentInput:a,parentPath:i}},getDirectorySuggestions(e){const{segmentInput:t,parentPath:o}=this.parseDirectoryQuery(e),s=this.directoryChildrenMap[o]||[];if(!t)return s.slice(0,10).map(e=>({value:e.path}));const a=t.toLowerCase();return s.filter(e=>e.name.toLowerCase().startsWith(a)).slice(0,10).map(e=>({value:e.path}))}}};const jt=(0,W.A)(Ot,[["render",qt],["__scopeId","data-v-28b8eda7"]]);var Gt=jt,Kt=o(808);const Jt={class:"container"},Yt={class:"upload-home"},Zt={class:"quick-toolbar-actions"},eo={class:"quick-toolbar-actions-inner"},to={class:"header"},oo={class:"title"},so={class:"title-crayon-text","aria-hidden":"true"},ao={class:"main-title",href:"https://github.com/MarSeventh/CloudFlare-ImgBed",target:"_blank"},lo={class:"dialog-section"},io={class:"section-header"},no={class:"section-title"},ro={class:"section-content"},co={class:"dialog-section"},uo={class:"section-header"},po={class:"section-title"},ho={class:"section-content"},mo={class:"setting-item"},go={class:"setting-label"},fo={key:0,class:"setting-item"},yo={class:"setting-label"},bo={class:"dialog-action"},ko=["innerHTML"],vo={class:"dialog-footer"};function Co(e,t,o,n,r,d){const c=Kt.A,u=(0,l.g2)("font-awesome-icon"),p=a.S2,h=pt.c6,m=pt.Iy,g=pt.dW,f=Gt,y=G.WK,b=Vt.A,k=s.R7,v=zt.A,C=Pt,w=J.ll,F=J.MQ,L=j.qi,U=X.kZ,$=We,S=Q.A,T=H;return(0,l.uX)(),(0,l.CE)("div",Jt,[(0,l.Lk)("div",Yt,[(0,l.bF)(c,{class:"toggle-dark-button desktop-only"}),(0,l.bF)(g,{class:"more-dropdown desktop-only",trigger:"click",onCommand:d.handleDesktopMenuCommand},{dropdown:(0,l.k6)(()=>[(0,l.bF)(m,null,{default:(0,l.k6)(()=>[(0,l.bF)(h,{command:"showHistory"},{default:(0,l.k6)(()=>[(0,l.bF)(u,{icon:"history",style:{width:"16px","margin-right":"8px","text-align":"center"}}),(0,l.eW)(" "+(0,i.v_)(e.$t("upload.history")),1)]),_:1}),(0,l.bF)(h,{command:"showAnnouncement",disabled:!d.announcementAvailable},{default:(0,l.k6)(()=>[(0,l.bF)(u,{icon:"bullhorn",style:{width:"16px","margin-right":"8px","text-align":"center"}}),(0,l.eW)(" "+(0,i.v_)(e.$t("upload.announcement")),1)]),_:1},8,["disabled"]),(0,l.bF)(h,{command:"toggleLanguage"},{default:(0,l.k6)(()=>[(0,l.bF)(u,{icon:"globe",style:{width:"16px","margin-right":"8px","text-align":"center"}}),(0,l.eW)(" "+(0,i.v_)("zh-CN"===e.$i18n.locale?"English":"简体中文"),1)]),_:1}),(0,l.bF)(h,{command:"viewDocs"},{default:(0,l.k6)(()=>[(0,l.bF)(u,{icon:"book",style:{width:"16px","margin-right":"8px","text-align":"center"}}),(0,l.eW)(" "+(0,i.v_)(e.$t("upload.viewDocs")),1)]),_:1})]),_:1})]),default:(0,l.k6)(()=>[(0,l.bF)(p,{class:"more-button"},{default:(0,l.k6)(()=>[(0,l.bF)(u,{icon:"ellipsis-v",size:"lg"})]),_:1})]),_:1},8,["onCommand"]),(0,l.Lk)("div",{class:(0,i.C4)(["upload-folder-container",{"no-announcement":!d.announcementAvailable}])},[(0,l.Lk)("div",{class:(0,i.C4)(["upload-folder",{active:r.isFolderInputActive}])},[d.showDirectorySuggestions?((0,l.uX)(),(0,l.Wv)(f,{key:0,modelValue:r.uploadFolder,"onUpdate:modelValue":t[0]||(t[0]=e=>r.uploadFolder=e),class:"inner-folder-input",placeholder:e.$t("upload.folderPlaceholder"),onFocus:d.handleFolderInputFocus,onBlur:d.handleFolderInputBlur,onSelect:d.handleDirectorySelect},null,8,["modelValue","placeholder","onFocus","onBlur","onSelect"])):((0,l.uX)(),(0,l.Wv)(y,{key:1,class:"inner-folder-input",modelValue:r.uploadFolder,"onUpdate:modelValue":t[1]||(t[1]=e=>r.uploadFolder=e),placeholder:e.$t("upload.folderPlaceholder"),onFocus:d.handleFolderInputFocus,onBlur:d.handleFolderInputBlur},null,8,["modelValue","placeholder","onFocus","onBlur"]))],2),d.showDirectorySuggestions?((0,l.uX)(),(0,l.Wv)(b,{key:0,"current-directory":r.uploadFolder,source:"upload",onSelect:d.handleDirectorySelect},{trigger:(0,l.k6)(()=>[(0,l.bF)(p,{class:"directory-tree-trigger"},{default:(0,l.k6)(()=>[(0,l.bF)(u,{icon:"folder-tree"})]),_:1})]),_:1},8,["current-directory","onSelect"])):(0,l.Q3)("",!0)],2),(0,l.bF)(k,{content:e.$t("upload.switchUploadMethod"),placement:"bottom",disabled:d.disableTooltip},{default:(0,l.k6)(()=>[(0,l.bF)(p,{class:"upload-method-button desktop-only",onClick:d.handleChangeUploadMethod},{default:(0,l.k6)(()=>["default"===r.uploadMethod?((0,l.uX)(),(0,l.Wv)(u,{key:0,icon:"folder-open",class:"upload-method-icon",size:"lg"})):"paste"===r.uploadMethod?((0,l.uX)(),(0,l.Wv)(u,{key:1,icon:"paste",class:"upload-method-icon",size:"lg"})):(0,l.Q3)("",!0)]),_:1},8,["onClick"])]),_:1},8,["content","disabled"]),(0,l.bF)(g,{class:"mobile-more-dropdown mobile-only",trigger:"click",onCommand:d.handleMobileMenuCommand},{dropdown:(0,l.k6)(()=>[(0,l.bF)(m,null,{default:(0,l.k6)(()=>[(0,l.bF)(h,{command:"toggleTheme"},{default:(0,l.k6)(()=>[(0,l.bF)(u,{icon:d.getThemeIcon(),style:{width:"16px","margin-right":"8px","text-align":"center"}},null,8,["icon"]),(0,l.eW)(" "+(0,i.v_)(d.getThemeText()),1)]),_:1}),(0,l.bF)(h,{command:"toggleUploadMethod"},{default:(0,l.k6)(()=>[(0,l.bF)(u,{icon:"default"===r.uploadMethod?"paste":"folder-open",style:{width:"16px","margin-right":"8px","text-align":"center"}},null,8,["icon"]),(0,l.eW)(" "+(0,i.v_)("default"===r.uploadMethod?e.$t("upload.pasteUpload"):e.$t("upload.fileUpload")),1)]),_:1}),(0,l.bF)(h,{command:"showHistory"},{default:(0,l.k6)(()=>[(0,l.bF)(u,{icon:"history",style:{width:"16px","margin-right":"8px","text-align":"center"}}),(0,l.eW)(" "+(0,i.v_)(e.$t("upload.history")),1)]),_:1}),(0,l.bF)(h,{command:"showAnnouncement",disabled:!d.announcementAvailable},{default:(0,l.k6)(()=>[(0,l.bF)(u,{icon:"bullhorn",style:{width:"16px","margin-right":"8px","text-align":"center"}}),(0,l.eW)(" "+(0,i.v_)(e.$t("upload.announcement")),1)]),_:1},8,["disabled"]),(0,l.bF)(h,{command:"toggleLanguage"},{default:(0,l.k6)(()=>[(0,l.bF)(u,{icon:"globe",style:{width:"16px","margin-right":"8px","text-align":"center"}}),(0,l.eW)(" "+(0,i.v_)("zh-CN"===e.$i18n.locale?"English":"简体中文"),1)]),_:1}),(0,l.bF)(h,{command:"viewDocs"},{default:(0,l.k6)(()=>[(0,l.bF)(u,{icon:"book",style:{width:"16px","margin-right":"8px","text-align":"center"}}),(0,l.eW)(" "+(0,i.v_)(e.$t("upload.viewDocs")),1)]),_:1})]),_:1})]),default:(0,l.k6)(()=>[(0,l.bF)(p,{class:"mobile-more-button"},{default:(0,l.k6)(()=>[(0,l.bF)(u,{icon:"ellipsis-v",size:"lg"})]),_:1})]),_:1},8,["onCommand"]),(0,l.Lk)("div",{class:(0,i.C4)(["quick-toolbar",{"is-expanded":r.isQuickToolbarOpen}]),onMouseleave:t[5]||(t[5]=(...e)=>d.handleQuickToolbarLeave&&d.handleQuickToolbarLeave(...e))},[(0,l.Lk)("div",Zt,[(0,l.Lk)("div",eo,[(0,l.bF)(k,{disabled:d.disableTooltip||!r.isQuickToolbarOpen,content:e.$t("upload.logout"),placement:"left","hide-after":0},{default:(0,l.k6)(()=>[(0,l.bF)(p,{class:"quick-toolbar-button",onClick:t[2]||(t[2]=e=>d.handleQuickToolbarCommand("logout"))},{default:(0,l.k6)(()=>[(0,l.bF)(u,{icon:"sign-out-alt",class:"quick-toolbar-icon"})]),_:1})]),_:1},8,["disabled","content"]),(0,l.bF)(k,{disabled:d.disableTooltip||!r.isQuickToolbarOpen,content:e.$t("upload.manage"),placement:"left","hide-after":0},{default:(0,l.k6)(()=>[(0,l.bF)(p,{class:"quick-toolbar-button",onClick:t[3]||(t[3]=e=>d.handleQuickToolbarCommand("manage"))},{default:(0,l.k6)(()=>[(0,l.bF)(u,{icon:"cog",class:"quick-toolbar-icon"})]),_:1})]),_:1},8,["disabled","content"]),(0,l.bF)(k,{disabled:d.disableTooltip||!r.isQuickToolbarOpen,content:e.$t("upload.linkFormat"),placement:"left","hide-after":0},{default:(0,l.k6)(()=>[(0,l.bF)(p,{class:"quick-toolbar-button",onClick:t[4]||(t[4]=e=>d.handleQuickToolbarCommand("linkFormat"))},{default:(0,l.k6)(()=>[(0,l.bF)(u,{icon:"link",class:"quick-toolbar-icon"})]),_:1})]),_:1},8,["disabled","content"])])]),(0,l.bF)(k,{disabled:d.disableTooltip,content:e.$t("upload.settings"),placement:"left","hide-after":0},{default:(0,l.k6)(()=>[(0,l.bF)(p,{class:"quick-toolbar-button",onClick:d.openCompressDialog},{default:(0,l.k6)(()=>[(0,l.bF)(u,{icon:"cloud-upload",class:"quick-toolbar-icon"})]),_:1},8,["onClick"])]),_:1},8,["disabled","content"]),(0,l.bF)(p,{class:(0,i.C4)(["quick-toolbar-button quick-toolbar-more",{"is-active":r.isQuickToolbarOpen}]),"aria-expanded":r.isQuickToolbarOpen,onMouseenter:d.handleQuickToolbarMoreEnter,onClick:d.toggleQuickToolbar},{default:(0,l.k6)(()=>[(0,l.bF)(u,{icon:"chevron-down",class:"quick-toolbar-icon quick-toolbar-toggle-icon"})]),_:1},8,["class","aria-expanded","onMouseenter","onClick"])],34),(0,l.bF)(v,{useConfigLink:!0}),(0,l.Lk)("div",to,[(0,l.Lk)("h1",oo,[(0,l.Lk)("span",so,(0,i.v_)(d.ownerName)+" ImgHub",1),(0,l.Lk)("a",ao,(0,i.v_)(d.ownerName),1),t[24]||(t[24]=(0,l.eW)(" ImgHub ",-1))])]),(0,l.bF)(C,{selectedUrlForm:r.selectedUrlForm,customerCompress:r.customerCompress,compressQuality:r.compressQuality,compressBar:r.compressBar,serverCompress:r.serverCompress,uploadChannel:r.uploadChannel,channelName:r.channelName,uploadNameType:r.uploadNameType,useCustomUrl:r.useCustomUrl,customUrlPrefix:r.customUrlPrefix,autoRetry:r.autoRetry,urlPrefix:d.urlPrefix,uploadMethod:r.uploadMethod,uploadFolder:r.uploadFolder,convertToWebp:r.convertToWebp,class:"upload"},null,8,["selectedUrlForm","customerCompress","compressQuality","compressBar","serverCompress","uploadChannel","channelName","uploadNameType","useCustomUrl","customUrlPrefix","autoRetry","urlPrefix","uploadMethod","uploadFolder","convertToWebp"]),(0,l.bF)(U,{title:e.$t("settings.linkFormatTitle"),modelValue:r.showUrlDialog,"onUpdate:modelValue":t[10]||(t[10]=e=>r.showUrlDialog=e),width:d.dialogWidth,"show-close":!1,class:"settings-dialog settings-dialog-scope"},{default:(0,l.k6)(()=>[(0,l.Lk)("div",lo,[(0,l.Lk)("div",io,[(0,l.Lk)("span",no,(0,i.v_)(e.$t("settings.defaultCopyLink")),1)]),(0,l.Lk)("div",ro,[(0,l.bF)(F,{modelValue:r.selectedUrlForm,"onUpdate:modelValue":t[6]||(t[6]=e=>r.selectedUrlForm=e),onChange:d.changeUrlForm,class:"radio-card-group grid-2x2"},{default:(0,l.k6)(()=>[(0,l.bF)(w,{value:"url",class:"radio-card"},{default:(0,l.k6)(()=>[(0,l.bF)(u,{icon:"link",class:"radio-icon"}),(0,l.Lk)("span",null,(0,i.v_)(e.$t("settings.rawLink")),1)]),_:1}),(0,l.bF)(w,{value:"md",class:"radio-card"},{default:(0,l.k6)(()=>[(0,l.bF)(u,{icon:"code",class:"radio-icon"}),t[25]||(t[25]=(0,l.Lk)("span",null,"MarkDown",-1))]),_:1}),(0,l.bF)(w,{value:"html",class:"radio-card"},{default:(0,l.k6)(()=>[(0,l.bF)(u,{icon:"code-branch",class:"radio-icon"}),t[26]||(t[26]=(0,l.Lk)("span",null,"HTML",-1))]),_:1}),(0,l.bF)(w,{value:"ubb",class:"radio-card"},{default:(0,l.k6)(()=>[(0,l.bF)(u,{icon:"quote-right",class:"radio-icon"}),t[27]||(t[27]=(0,l.Lk)("span",null,"BBCode",-1))]),_:1})]),_:1},8,["modelValue","onChange"])])]),(0,l.Lk)("div",co,[(0,l.Lk)("div",uo,[(0,l.Lk)("span",po,(0,i.v_)(e.$t("settings.customLink")),1),(0,l.bF)(k,{content:e.$t("settings.customLinkTooltip"),placement:"top","raw-content":""},{default:(0,l.k6)(()=>[(0,l.bF)(u,{icon:"question-circle",class:"section-help-icon"})]),_:1},8,["content"])]),(0,l.Lk)("div",ho,[(0,l.Lk)("div",mo,[(0,l.Lk)("span",go,(0,i.v_)(e.$t("settings.enableCustom")),1),(0,l.bF)(L,{modelValue:r.useCustomUrl,"onUpdate:modelValue":t[7]||(t[7]=e=>r.useCustomUrl=e),"active-value":"true","inactive-value":"false"},null,8,["modelValue"])]),"true"===r.useCustomUrl?((0,l.uX)(),(0,l.CE)("div",fo,[(0,l.Lk)("span",yo,(0,i.v_)(e.$t("settings.customPrefix")),1),(0,l.bF)(y,{modelValue:r.customUrlPrefix,"onUpdate:modelValue":t[8]||(t[8]=e=>r.customUrlPrefix=e),placeholder:e.$t("settings.customPrefixPlaceholder"),class:"setting-input"},null,8,["modelValue","placeholder"])])):(0,l.Q3)("",!0)])]),(0,l.Lk)("div",bo,[(0,l.bF)(p,{type:"primary",onClick:t[9]||(t[9]=e=>r.showUrlDialog=!1),class:"confirm-btn"},{default:(0,l.k6)(()=>[(0,l.eW)((0,i.v_)(e.$t("settings.confirm")),1)]),_:1})])]),_:1},8,["title","modelValue","width"]),(0,l.bF)($,{modelValue:r.showCompressDialog,"onUpdate:modelValue":t[11]||(t[11]=e=>r.showCompressDialog=e),uploadChannel:r.uploadChannel,"onUpdate:uploadChannel":t[12]||(t[12]=e=>r.uploadChannel=e),channelName:r.channelName,"onUpdate:channelName":t[13]||(t[13]=e=>r.channelName=e),currentChannelList:d.currentChannelList,uploadFolder:r.uploadFolder,"onUpdate:uploadFolder":t[14]||(t[14]=e=>r.uploadFolder=e),autoRetry:r.autoRetry,"onUpdate:autoRetry":t[15]||(t[15]=e=>r.autoRetry=e),uploadNameType:r.uploadNameType,"onUpdate:uploadNameType":t[16]||(t[16]=e=>r.uploadNameType=e),convertToWebp:r.convertToWebp,"onUpdate:convertToWebp":t[17]||(t[17]=e=>r.convertToWebp=e),customerCompress:r.customerCompress,"onUpdate:customerCompress":t[18]||(t[18]=e=>r.customerCompress=e),compressBar:r.compressBar,"onUpdate:compressBar":t[19]||(t[19]=e=>r.compressBar=e),compressQuality:r.compressQuality,"onUpdate:compressQuality":t[20]||(t[20]=e=>r.compressQuality=e),serverCompress:r.serverCompress,"onUpdate:serverCompress":t[21]||(t[21]=e=>r.serverCompress=e)},null,8,["modelValue","uploadChannel","channelName","currentChannelList","uploadFolder","autoRetry","uploadNameType","convertToWebp","customerCompress","compressBar","compressQuality","serverCompress"])]),(0,l.bF)(S,{class:"footer"}),(0,l.bF)(U,{title:e.$t("upload.announcementTitle"),modelValue:r.showAnnouncementDialog,"onUpdate:modelValue":t[22]||(t[22]=e=>r.showAnnouncementDialog=e),width:d.dialogWidth,"show-close":!1,"close-on-click-modal":!1,"close-on-press-escape":!1,center:""},{footer:(0,l.k6)(()=>[(0,l.Lk)("span",vo,[(0,l.bF)(p,{type:"primary",onClick:d.acknowledgeAnnouncement},{default:(0,l.k6)(()=>[(0,l.eW)((0,i.v_)(e.$t("upload.announcementAck")),1)]),_:1},8,["onClick"])])]),default:(0,l.k6)(()=>[(0,l.Lk)("div",{innerHTML:r.announcementContent},null,8,ko)]),_:1},8,["title","modelValue","width"]),(0,l.bF)(T,{show:r.showHistory,onClose:t[23]||(t[23]=e=>r.showHistory=!1)},null,8,["show"])])}o(13579);var wo=o(46638),Fo=o(48903),Lo=o(90144),Uo=o(62388),$o={name:"UploadHome",mixins:[Fo.A],data(){return{selectedUrlForm:(0,Lo.KR)(""),showUrlDialog:!1,showCompressDialog:!1,customerCompress:!0,compressQuality:4,compressBar:5,convertToWebp:!1,serverCompress:!0,uploadChannel:"",channelName:"",availableChannels:{},uploadNameType:"",customUrlPrefix:"",useCustomUrl:"false",autoRetry:!0,useDefaultWallPaper:!1,uploadMethod:"default",uploadFolder:"",isFolderInputActive:!1,isQuickToolbarOpen:!1,isQuickToolbarPinned:!1,showAnnouncementDialog:!1,announcementContent:"",displayedAnnouncementRefreshAt:null,showHistory:!1,themeMode:"auto"}},watch:{customerCompress(e){this.updateCompressConfig("customerCompress",e)},compressQuality(e){this.updateCompressConfig("compressQuality",e)},compressBar(e){null===e||void 0===e||e<1?this.compressBar=1:(this.compressQuality>e&&(this.compressQuality=e),this.updateCompressConfig("compressBar",e))},serverCompress(e){this.updateCompressConfig("serverCompress",e)},convertToWebp(e){this.updateCompressConfig("convertToWebp",e)},uploadChannel(e){this.updateStoreUploadChannel(e);const t=this.availableChannels[e]||[],o=this.storeChannelName;o&&t.some(e=>e.name===o)?this.channelName=o:this.channelName=""},channelName(e){this.$store.commit("setStoreChannelName",e||"")},uploadNameType(e){this.updateStoreUploadNameType(e)},customUrlPrefix(e){this.$store.commit("setCustomUrlSettings",{key:"customUrlPrefix",value:e})},useCustomUrl(e){this.$store.commit("setCustomUrlSettings",{key:"useCustomUrl",value:e})},autoRetry(e){this.$store.commit("setStoreAutoRetry",e)},uploadFolder(e){if(this.validateUploadFolder(e,!1)){const t=(0,Uo.G)(e,{strict:!0});t.valid&&this.$store.commit("setStoreUploadFolder",e)}else this.$nextTick(()=>{this.uploadFolder=this.storeUploadFolder})}},computed:{...(0,St.L8)(["userConfig","uploadCopyUrlForm","compressConfig","storeUploadChannel","storeChannelName","storeUploadNameType","customUrlSettings","storeAutoRetry","storeUploadMethod","storeUploadFolder"]),ownerName(){return this.userConfig?.ownerName||"Sanyue"},dialogWidth(){return window.innerWidth>768?"50%":"90%"},disableTooltip(){return window.innerWidth<768},urlPrefix(){return this.userConfig?.urlPrefix||`${window.location.protocol}//${window.location.host}/file/`},announcementAvailable(){return!!this.userConfig?.announcement},showDirectorySuggestions(){return this.userConfig?.showDirectorySuggestions??!1},currentChannelList(){return this.availableChannels[this.uploadChannel]||[]}},mounted(){this.initializeBackground("uploadBkImg",".container",!0,!0),this.selectedUrlForm=this.uploadCopyUrlForm||"url",this.customerCompress=this.compressConfig.customerCompress??this.parseBoolean(this.userConfig?.defaultCustomerCompress,!0),this.compressQuality=this.compressConfig.compressQuality??this.parseNumber(this.userConfig?.defaultCompressQuality,4),this.compressBar=this.compressConfig.compressBar??this.parseNumber(this.userConfig?.defaultCompressBar,5),this.serverCompress=this.compressConfig.serverCompress??!0,this.convertToWebp=this.compressConfig.convertToWebp??this.parseBoolean(this.userConfig?.defaultConvertToWebp,!1),this.uploadChannel=this.storeUploadChannel||this.userConfig?.defaultUploadChannel||"telegram",this.autoRetry=this.storeAutoRetry,this.uploadNameType=this.storeUploadNameType||this.userConfig?.defaultUploadNameType||"default",this.customUrlPrefix=this.customUrlSettings.customUrlPrefix,this.useCustomUrl=this.customUrlSettings.useCustomUrl,this.uploadMethod=this.storeUploadMethod,this.fetchAvailableChannels(),this.uploadFolder=this.storeUploadFolder||this.userConfig?.defaultUploadFolder||"";const e=this.$store.getters.cusDarkMode,t=this.$store.getters.useDarkMode;this.themeMode=e?t?"dark":"light":"auto",this.showAnnouncementIfNeeded()},components:{UploadForm:Pt,Footer:Q.A,ToggleDark:Kt.A,Logo:zt.A,UploadHistory:H,UploadSettingsDialog:We,DirectoryTreePicker:Vt.A,DirectorySuggestionInput:Gt},methods:{async fetchAvailableChannels(){try{const e=await Ut.A.get("/api/channels",{withAuthCode:!0});if(e.data){this.availableChannels=e.data;const t=this.storeChannelName,o=this.userConfig?.defaultChannelName,s=this.availableChannels[this.uploadChannel]||[];t&&s.some(e=>e.name===t)?this.channelName=t:""!==t&&null!==t&&void 0!==t||""!==t&&o&&s.some(e=>e.name===o)&&(this.channelName=o)}}catch(e){console.error("Failed to fetch available channels:",e)}},validateUploadFolder(e,t=!0){e&&!e.startsWith("/")&&(e="/"+e,this.uploadFolder=e);const o=(0,Uo.G)(e,{strict:t});return!!o.valid||(this.$message.error(o.error),!1)},handleFolderInputFocus(){this.isFolderInputActive=!0},handleFolderInputBlur(){this.isFolderInputActive=!1,this.uploadFolder&&!this.uploadFolder.startsWith("/")&&(this.uploadFolder="/"+this.uploadFolder),this.validateUploadFolder(this.uploadFolder,!0)||this.$nextTick(()=>{this.uploadFolder=this.storeUploadFolder})},handleManage(){this.$router.push("/dashboard")},parseBoolean(e,t){return void 0===e||null===e?t:"boolean"===typeof e?e:"string"===typeof e?"true"===e:t},parseNumber(e,t){if(void 0===e||null===e)return t;const o=parseFloat(e);return isNaN(o)?t:o},openUrlDialog(){this.showUrlDialog=!0},handleLogout(){Ut.A.post("/api/auth/logout",{authType:"user"},{withCredentials:!0}).finally(()=>{this.$store.commit("setUserLoggedIn",!1),this.$router.push("/login"),this.$message.success(this.$t("upload.logoutSuccess"))})},changeUrlForm(){this.$store.commit("setUploadCopyUrlForm",this.selectedUrlForm)},openCompressDialog(){this.showCompressDialog=!0},updateCompressConfig(e,t){this.$store.commit("setCompressConfig",{key:e,value:t})},updateStoreUploadChannel(e){this.$store.commit("setStoreUploadChannel",e)},updateStoreUploadNameType(e){this.$store.commit("setStoreUploadNameType",e)},handleQuickToolbarMoreEnter(){this.isQuickToolbarOpen=!0},handleQuickToolbarLeave(){this.isQuickToolbarPinned||(this.isQuickToolbarOpen=!1)},toggleQuickToolbar(){this.isQuickToolbarPinned=!this.isQuickToolbarPinned,this.isQuickToolbarOpen=this.isQuickToolbarPinned},closeQuickToolbar(){this.isQuickToolbarPinned=!1,this.isQuickToolbarOpen=!1},handleQuickToolbarCommand(e){this.closeQuickToolbar(),"linkFormat"===e?this.openUrlDialog():"manage"===e?this.handleManage():"logout"===e&&this.handleLogout()},handleChangeUploadMethod(){this.uploadMethod="default"===this.uploadMethod?"paste":"default",this.$store.commit("setUploadMethod",this.uploadMethod)},handleMobileMenuCommand(e){if("toggleTheme"===e)"auto"===this.themeMode?(this.themeMode="light",this.$store.commit("setCusDarkMode",!0),this.$store.commit("setUseDarkMode",!1)):"light"===this.themeMode?(this.themeMode="dark",this.$store.commit("setCusDarkMode",!0),this.$store.commit("setUseDarkMode",!0)):(this.themeMode="auto",this.$store.commit("setCusDarkMode",!1));else if("toggleUploadMethod"===e)this.handleChangeUploadMethod();else if("viewDocs"===e)window.open("https://cfbed.sanyue.de/qa/","_blank");else if("showHistory"===e)this.showHistory=!0;else if("showAnnouncement"===e)this.handleShowAnnouncement();else if("toggleLanguage"===e){const e="zh-CN"===this.$i18n.locale?"en":"zh-CN";(0,wo.xS)(e)}},handleDesktopMenuCommand(e){if("viewDocs"===e)window.open("https://cfbed.sanyue.de/qa/","_blank");else if("showHistory"===e)this.showHistory=!0;else if("showAnnouncement"===e)this.handleShowAnnouncement();else if("toggleLanguage"===e){const e="zh-CN"===this.$i18n.locale?"en":"zh-CN";(0,wo.xS)(e)}},getThemeIcon(){return"auto"===this.themeMode?"sun":"light"===this.themeMode?"moon":"adjust"},getThemeText(){return"auto"===this.themeMode?this.$t("theme.lightMode"):"light"===this.themeMode?this.$t("theme.darkMode"):this.$t("theme.autoMode")},handleShowAnnouncement(){const e=this.userConfig?.announcement;e?this.openAnnouncement(e):this.$message.info(this.$t("upload.noAnnouncement"))},getAnnouncementRefreshAt(){const e=Number(this.userConfig?.announcementRefreshAt);return Number.isFinite(e)&&e>0?e:null},openAnnouncement(e){this.announcementContent=e,this.displayedAnnouncementRefreshAt=this.getAnnouncementRefreshAt(),this.showAnnouncementDialog=!0},showAnnouncementIfNeeded(){const e=this.userConfig?.announcement;if(!e)return;const t=this.getAnnouncementRefreshAt();if(t){const o=Number(localStorage.getItem("announcementAcknowledgedRefreshAt"));return void((!Number.isFinite(o)||t>o)&&this.openAnnouncement(e))}localStorage.getItem("announcementAcknowledgedAt")||this.openAnnouncement(e)},acknowledgeAnnouncement(){localStorage.setItem("announcementAcknowledgedAt",String(Date.now())),this.displayedAnnouncementRefreshAt&&localStorage.setItem("announcementAcknowledgedRefreshAt",String(this.displayedAnnouncementRefreshAt)),this.showAnnouncementDialog=!1},handleDirectorySelect(e){this.uploadFolder=e,this.validateUploadFolder(e,!0)&&this.$store.commit("setStoreUploadFolder",e)}}};const So=(0,W.A)($o,[["render",Co],["__scopeId","data-v-51cecbb0"]]);var To=So},62388:function(e,t,o){"use strict";o.d(t,{G:function(){return a}});var s=o(46638);function a(e,{strict:t=!0}={}){if(!e||""===e.trim())return{valid:!0};if("/"===e)return{valid:!0};if(!e.startsWith("/"))return{valid:!1,error:s.Ay.global.t("validation.pathMustStartWithSlash")};if(/(?:^|\/)\.\.(\/|$)/.test(e)||e.includes(".."))return{valid:!1,error:s.Ay.global.t("validation.pathTraversalNotAllowed")};const o=t?/\/\.(\/|$)/:/\/\.\//;if(o.test(e))return{valid:!1,error:s.Ay.global.t("validation.singleDotNotAllowed")};if(e.includes("//"))return{valid:!1,error:s.Ay.global.t("validation.consecutiveSlashNotAllowed")};const a=/[\\:\*\?"'<>\| \(\)\[\]\{\}#%\^`~;@&=\+\$,]/;return a.test(e)?{valid:!1,error:s.Ay.global.t("validation.invalidCharacters")}:{valid:!0}}},67819:function(e,t,o){"use strict";o(85331)},70797:function(e,t,o){"use strict";o.d(t,{A:function(){return i}});o(44114);var s=o(25507),a=o(16915);let l=!1;async function i(e,t={}){t.credentials="include",t.headers={...t.headers};const o=await fetch(e,t);return 401!==o.status||l||(l=!0,s.A.commit("setAdminLoggedIn",!1),a.A.push("/adminLogin").finally(()=>{l=!1})),o}},76334:function(e,t,o){e.exports=o(11393)},79899:function(e,t,o){"use strict";o(85331)},85970:function(e,t,o){"use strict";o(85331)},86975:function(e,t,o){"use strict";o.d(t,{A:function(){return p}});var s=o(56768),a=o(24232);const l={key:0,class:"page-footer"},i=["href"];function n(e,t,o,n,r,d){const c=(0,s.g2)("font-awesome-icon");return d.disableFooter?(0,s.Q3)("",!0):((0,s.uX)(),(0,s.CE)("div",l,[(0,s.Lk)("p",null,[(0,s.eW)("© 2024-"+(0,a.v_)(d.thisYear)+" Designed by ",1),t[0]||(t[0]=(0,s.Lk)("a",{class:"footer-name",href:"https://github.com/MarSeventh",target:"_blank"},"SanyueQi",-1)),t[1]||(t[1]=(0,s.eW)(" for You! ",-1)),(0,s.Lk)("a",{href:d.footerLink,target:"_blank"},[(0,s.bF)(c,{icon:"paper-plane",class:"footer-link-icon"})],8,i)])]))}var r=o(60782),d={name:"Footer",computed:{...(0,r.L8)(["userConfig"]),footerLink(){return this.userConfig?.footerLink||"https://github.com/MarSeventh"},thisYear(){return(new Date).getFullYear()},disableFooter(){return this.userConfig?.disableFooter||!1}}},c=o(71241);const u=(0,c.A)(d,[["render",n],["__scopeId","data-v-08acbaa9"]]);var p=u},88830:function(e,t,o){"use strict";o(85331)},95385:function(e,t,o){"use strict";o(85331)},96682:function(e,t,o){"use strict";e.exports=o.p+"img/404.8ed11fb3.png"},96808:function(e,t,o){"use strict";o(85331),o(18785),o(67819),o(85970),o(19104)}}]);
//# sourceMappingURL=800.e2c8a8a6.js.map