import{P as He,a as E,d as se,aZ as xt,u as lt,c as p,b0 as yr,_ as Et,a1 as de,U as L,b1 as qt,a8 as Zt,a6 as ot,h as H,b2 as br,b as st,a7 as Nn,b3 as wr,an as Kt,b4 as Dn,r as I,aW as We,ac as Fe,a3 as Xt,ah as Cr,ag as Tn,b5 as Bn,a4 as De,x as oe,aA as Sr,s as ve,b6 as Me,b7 as Fn,e as pt,a5 as en,b8 as Ar,R as ne,b9 as Or,ba as Pr,bb as it,as as xr,bc as Er,ad as kt,aX as Te,bd as kr,be as tn,bf as Ir,$ as qe,ar as $r,bg as zr,bh as _r,bi as Lr,bj as Qn,bk as nn,bl as Mr,bm as Nr,bn as Dr,ao as Tr,bo as Br,bp as Fr,bq as Qr,W as ht,br as Rr,bs as jr,T as Q,bt as It,bu as Vr,v as $t,bv as Rn,bw as ge,bx as zt,by as pe,aB as jn,bz as rn,bA as Ur,bB as Hr,a$ as _t,bC as Wr,bD as le,A as Lt,bE as Vn,X as Gr,V as dt,bF as Jr,bG as Yr,bH as qr,Y as Un,Z as Hn,o as M,y as q,bI as Zr,bJ as Kr,bK as Xr,bL as ei,bM as ti,bN as ni,l as Z,bO as Ke,J as be,m as N,C as Mt,bP as an,bQ as ri,bR as ii,bS as ai,I as Ge,B as V,t as B,n as F,q as te,O as Wn,bT as Gn,M as Jn,Q as Yn,bU as li,z as oi}from"./index-ce048bd1.js";import{t as ft,l as Je}from"./index-c71fb108.js";import{_ as si,d as ui,D as ci,E as di,M as re,a as Ne,t as fi,b as qn}from"./db-5a2b8826.js";import{b as vi}from"./_baseIteratee-fae27375.js";import{b as mi,B as Ye,c as gi}from"./button-dfda9e18.js";var Zn=function(){return{arrow:{type:[Boolean,Object],default:void 0},trigger:{type:[Array,String]},overlay:He.any,visible:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},align:{type:Object},getPopupContainer:Function,prefixCls:String,transitionName:String,placement:String,overlayClassName:String,overlayStyle:{type:Object,default:void 0},forceRender:{type:Boolean,default:void 0},mouseEnterDelay:Number,mouseLeaveDelay:Number,openClassName:String,minOverlayWidthMatchTrigger:{type:Boolean,default:void 0},destroyPopupOnHide:{type:Boolean,default:void 0},onVisibleChange:{type:Function},"onUpdate:visible":{type:Function}}},vt=mi(),pi=function(){return E(E({},Zn()),{},{type:vt.type,size:String,htmlType:vt.htmlType,href:String,disabled:{type:Boolean,default:void 0},prefixCls:String,icon:He.any,title:String,loading:vt.loading,onClick:{type:Function}})},hi=["type","disabled","loading","htmlType","class","overlay","trigger","align","visible","onVisibleChange","placement","href","title","icon","mouseEnterDelay","mouseLeaveDelay","overlayClassName","overlayStyle","destroyPopupOnHide","onClick","onUpdate:visible"],yi=Ye.Group;const at=se({compatConfig:{MODE:3},name:"ADropdownButton",inheritAttrs:!1,__ANT_BUTTON:!0,props:xt(pi(),{trigger:"hover",placement:"bottomRight",type:"default"}),slots:["icon","leftButton","rightButton","overlay"],setup:function(e,n){var r=n.slots,i=n.attrs,c=n.emit,s=function(g){c("update:visible",g),c("visibleChange",g)},w=lt("dropdown-button",e),m=w.prefixCls,f=w.direction,y=w.getPopupContainer;return function(){var h,g,v=E(E({},e),i),a=v.type,l=a===void 0?"default":a,o=v.disabled,d=v.loading,A=v.htmlType,b=v.class,u=b===void 0?"":b,S=v.overlay,k=S===void 0?(h=r.overlay)===null||h===void 0?void 0:h.call(r):S,O=v.trigger,C=v.align,x=v.visible;v.onVisibleChange;var P=v.placement,$=P===void 0?f.value==="rtl"?"bottomLeft":"bottomRight":P,z=v.href,_=v.title,R=v.icon,J=R===void 0?((g=r.icon)===null||g===void 0?void 0:g.call(r))||p(yr,null,null):R,U=v.mouseEnterDelay,ie=v.mouseLeaveDelay,ue=v.overlayClassName,ce=v.overlayStyle,me=v.destroyPopupOnHide,T=v.onClick;v["onUpdate:visible"];var W=Et(v,hi),K={align:C,disabled:o,trigger:o?[]:O,placement:$,getPopupContainer:y.value,onVisibleChange:s,mouseEnterDelay:U,mouseLeaveDelay:ie,visible:x,overlayClassName:ue,overlayStyle:ce,destroyPopupOnHide:me},X=p(Ye,{type:l,disabled:o,loading:d,onClick:T,htmlType:A,href:z,title:_},{default:r.default}),Y=p(Ye,{type:l,icon:J},null);return p(yi,E(E({},W),{},{class:de(m.value,u)}),{default:function(){return[r.leftButton?r.leftButton({button:X}):X,p(xe,K,{default:function(){return[r.rightButton?r.rightButton({button:Y}):Y]},overlay:function(){return k}})]}})}}});var Kn=se({compatConfig:{MODE:3},name:"ADropdown",inheritAttrs:!1,props:xt(Zn(),{mouseEnterDelay:.15,mouseLeaveDelay:.1,placement:"bottomLeft",trigger:"hover"}),slots:["overlay"],setup:function(e,n){var r=n.slots,i=n.attrs,c=n.emit,s=lt("dropdown",e),w=s.prefixCls,m=s.rootPrefixCls,f=s.direction,y=s.getPopupContainer,h=L(function(){var l=e.placement,o=l===void 0?"":l,d=e.transitionName;return d!==void 0?d:o.indexOf("top")>=0?"".concat(m.value,"-slide-down"):"".concat(m.value,"-slide-up")}),g=function(){var o,d,A,b=e.overlay||((o=r.overlay)===null||o===void 0?void 0:o.call(r)),u=Array.isArray(b)?b[0]:b;if(!u)return null;var S=u.props||{};qt(!S.mode||S.mode==="vertical","Dropdown",'mode="'.concat(S.mode,`" is not supported for Dropdown's Menu.`));var k=S.selectable,O=k===void 0?!1:k,C=S.expandIcon,x=C===void 0?(d=u.children)===null||d===void 0||(A=d.expandIcon)===null||A===void 0?void 0:A.call(d):C,P=typeof x<"u"&&Kt(x)?x:p("span",{class:"".concat(w.value,"-menu-submenu-arrow")},[p(Dn,{class:"".concat(w.value,"-menu-submenu-arrow-icon")},null)]),$=Kt(u)?Zt(u,{mode:"vertical",selectable:O,expandIcon:function(){return P}}):u;return $},v=L(function(){var l=e.placement;if(!l)return f.value==="rtl"?"bottomRight":"bottomLeft";if(l.includes("Center")){var o=l.slice(0,l.indexOf("Center"));return qt(!l.includes("Center"),"Dropdown","You are using '".concat(l,"' placement in Dropdown, which is deprecated. Try to use '").concat(o,"' instead.")),o}return l}),a=function(o){c("update:visible",o),c("visibleChange",o)};return function(){var l,o,d=e.arrow,A=e.trigger,b=e.disabled,u=e.overlayClassName,S=(l=r.default)===null||l===void 0?void 0:l.call(r)[0],k=Zt(S,ot({class:de(S==null||(o=S.props)===null||o===void 0?void 0:o.class,H({},"".concat(w.value,"-rtl"),f.value==="rtl"),"".concat(w.value,"-trigger"))},b?{disabled:b}:{})),O=de(u,H({},"".concat(w.value,"-rtl"),f.value==="rtl")),C=b?[]:A,x;C&&C.indexOf("contextmenu")!==-1&&(x=!0);var P=br({arrowPointAtCenter:st(d)==="object"&&d.pointAtCenter,autoAdjustOverflow:!0}),$=Nn(E(E(E({},e),i),{},{builtinPlacements:P,overlayClassName:O,arrow:d,alignPoint:x,prefixCls:w.value,getPopupContainer:y.value,transitionName:h.value,trigger:C,onVisibleChange:a,placement:v.value}),["overlay","onUpdate:visible"]);return p(wr,$,{default:function(){return[k]},overlay:g})}}});Kn.Button=at;const xe=Kn;xe.Button=at;xe.install=function(t){return t.component(xe.name,xe),t.component(at.name,at),t};function bi(){var t=document.documentElement.clientWidth,e=window.innerHeight||document.documentElement.clientHeight;return{width:t,height:e}}function Xn(t){var e=t.getBoundingClientRect(),n=document.documentElement;return{left:e.left+(window.pageXOffset||n.scrollLeft)-(n.clientLeft||document.body.clientLeft||0),top:e.top+(window.pageYOffset||n.scrollTop)-(n.clientTop||document.body.clientTop||0)}}function wi(t){var e=I(null),n=We(E({},t)),r=I([]),i=function(s){e.value===null&&(r.value=[],e.value=Xt(function(){var w;r.value.forEach(function(m){w=E(E({},w),m)}),ot(n,w),e.value=null})),r.value.push(s)};return Fe(function(){e.value&&Xt.cancel(e.value)}),[n,i]}function ln(t,e,n,r){var i=e+n,c=(n-r)/2;if(n>r){if(e>0)return H({},t,c);if(e<0&&ir)return H({},t,e<0?c:-c);return{}}function Ci(t,e,n,r){var i=bi(),c=i.width,s=i.height,w=null;return t<=c&&e<=s?w={x:0,y:0}:(t>c||e>s)&&(w=E(E({},ln("x",n,t,c)),ln("y",r,e,s))),w}var on=Symbol("previewGroupContext"),Nt={provide:function(e){Cr(on,e)},inject:function(){return Tn(on,{isPreviewGroup:I(!1),previewUrls:L(function(){return new Map}),setPreviewUrls:function(){},current:I(null),setCurrent:function(){},setShowPreview:function(){},setMousePosition:function(){},registerImage:null,rootClassName:""})}},Si=se({compatConfig:{MODE:3},name:"PreviewGroup",inheritAttrs:!1,props:{previewPrefixCls:String,preview:{type:[Boolean,Object],default:!0},icons:{type:Object,default:function(){return{}}}},setup:function(e,n){var r=n.slots,i=L(function(){var C={visible:void 0,onVisibleChange:function(){},getContainer:void 0,current:0};return st(e.preview)==="object"?rr(e.preview,C):C}),c=We(new Map),s=I(),w=L(function(){return i.value.visible}),m=L(function(){return i.value.getContainer}),f=function(x,P){var $,z;($=(z=i.value).onVisibleChange)===null||$===void 0||$.call(z,x,P)},y=Bn(!!w.value,{value:w,onChange:f}),h=De(y,2),g=h[0],v=h[1],a=I(null),l=L(function(){return w.value!==void 0}),o=L(function(){return Array.from(c.keys())}),d=L(function(){return o.value[i.value.current]}),A=L(function(){return new Map(Array.from(c).filter(function(C){var x=De(C,2),P=x[1].canPreview;return!!P}).map(function(C){var x=De(C,2),P=x[0],$=x[1].url;return[P,$]}))}),b=function(x,P){var $=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;c.set(x,{url:P,canPreview:$})},u=function(x){s.value=x},S=function(x){a.value=x},k=function(x,P){var $=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,z=function(){c.delete(x)};return c.set(x,{url:P,canPreview:$}),z},O=function(x){x==null||x.stopPropagation(),v(!1),S(null)};return oe(d,function(C){u(C)},{immediate:!0,flush:"post"}),Sr(function(){g.value&&l.value&&u(d.value)},{flush:"post"}),Nt.provide({isPreviewGroup:I(!0),previewUrls:A,setPreviewUrls:b,current:s,setCurrent:u,setShowPreview:v,setMousePosition:S,registerImage:k}),function(){var C=ot({},(si(i.value),i.value));return p(ve,null,[r.default&&r.default(),p(tr,E(E({},C),{},{"ria-hidden":!g.value,visible:g.value,prefixCls:e.previewPrefixCls,onClose:O,mousePosition:a.value,src:A.value.get(s.value),icons:e.icons,getContainer:m.value}),null)])}}});const er=Si;var Oe={x:0,y:0},Ai=E(E({},ui()),{},{src:String,alt:String,rootClassName:String,icons:{type:Object,default:function(){return{}}}}),Oi=se({compatConfig:{MODE:3},name:"Preview",inheritAttrs:!1,props:Ai,emits:["close","afterClose"],setup:function(e,n){var r=n.emit,i=n.attrs,c=We(e.icons),s=c.rotateLeft,w=c.rotateRight,m=c.zoomIn,f=c.zoomOut,y=c.close,h=c.left,g=c.right,v=I(1),a=I(0),l=wi(Oe),o=De(l,2),d=o[0],A=o[1],b=function(){return r("close")},u=I(),S=We({originX:0,originY:0,deltaX:0,deltaY:0}),k=I(!1),O=Nt.inject(),C=O.previewUrls,x=O.current,P=O.isPreviewGroup,$=O.setCurrent,z=L(function(){return C.value.size}),_=L(function(){return Array.from(C.value.keys())}),R=L(function(){return _.value.indexOf(x.value)}),J=L(function(){return P.value?C.value.get(x.value):e.src}),U=L(function(){return P.value&&z.value>1}),ie=I({wheelDirection:0}),ue=function(){v.value=1,a.value=0,A(Oe),r("afterClose")},ce=function(){v.value++,A(Oe)},me=function(){v.value>1&&v.value--,A(Oe)},T=function(){a.value+=90},W=function(){a.value-=90},K=function(D){D.preventDefault(),D.stopPropagation(),R.value>0&&$(_.value[R.value-1])},X=function(D){D.preventDefault(),D.stopPropagation(),R.value0&&$(_.value[R.value-1]):D.keyCode===en.RIGHT&&R.value0?me():j<0&&ce()})}),Fn(function(){Re()}),function(){var j=e.visible,D=e.prefixCls,ae=e.rootClassName;return p(ci,E(E({},i),{},{transitionName:"zoom",maskTransitionName:"fade",closable:!1,keyboard:!0,prefixCls:D,onClose:b,afterClose:ue,visible:j,wrapClassName:Y,rootClassName:ae,getContainer:e.getContainer}),{default:function(){return[p("ul",{class:"".concat(e.prefixCls,"-operations")},[Qe.map(function(fe){var Ae=fe.icon,ye=fe.onClick,_e=fe.type,Le=fe.disabled;return p("li",{class:de(ee,H({},"".concat(e.prefixCls,"-operations-operation-disabled"),Le&&(Le==null?void 0:Le.value))),onClick:ye,key:_e},[pt(Ae,{class:he})])})]),p("div",{class:"".concat(e.prefixCls,"-img-wrapper"),style:{transform:"translate3d(".concat(d.x,"px, ").concat(d.y,"px, 0)")}},[p("img",{onMousedown:Ee,onDblclick:ze,ref:u,class:"".concat(e.prefixCls,"-img"),src:J.value,alt:e.alt,style:{transform:"scale3d(".concat(v.value,", ").concat(v.value,", 1) rotate(").concat(a.value,"deg)")}},null)]),U.value&&p("div",{class:de("".concat(e.prefixCls,"-switch-left"),H({},"".concat(e.prefixCls,"-switch-left-disabled"),R.value<=0)),onClick:K},[h]),U.value&&p("div",{class:de("".concat(e.prefixCls,"-switch-right"),H({},"".concat(e.prefixCls,"-switch-right-disabled"),R.value>=z.value-1)),onClick:X},[g])]}})}}});const tr=Oi;var Pi=["icons","maskClassName"],nr=function(){return{src:String,wrapperClassName:String,wrapperStyle:{type:Object,default:void 0},rootClassName:String,prefixCls:String,previewPrefixCls:String,previewMask:{type:[Boolean,Function],default:void 0},placeholder:He.any,fallback:String,preview:{type:[Boolean,Object],default:!0},onClick:{type:Function},onError:{type:Function}}},rr=function(e,n){var r=E({},e);return Object.keys(n).forEach(function(i){e[i]===void 0&&(r[i]=n[i])}),r},xi=0,ir=se({compatConfig:{MODE:3},name:"Image",inheritAttrs:!1,props:nr(),emits:["click","error"],setup:function(e,n){var r=n.attrs,i=n.slots,c=n.emit,s=L(function(){return e.prefixCls}),w=L(function(){return"".concat(s.value,"-preview")}),m=L(function(){var T={visible:void 0,onVisibleChange:function(){},getContainer:void 0};return st(e.preview)==="object"?rr(e.preview,T):T}),f=L(function(){var T;return(T=m.value.src)!==null&&T!==void 0?T:e.src}),y=L(function(){return e.placeholder&&e.placeholder!==!0||i.placeholder}),h=L(function(){return m.value.visible}),g=L(function(){return m.value.getContainer}),v=L(function(){return h.value!==void 0}),a=function(W,K){var X,Y;(X=(Y=m.value).onVisibleChange)===null||X===void 0||X.call(Y,W,K)},l=Bn(!!h.value,{value:h,onChange:a}),o=De(l,2),d=o[0],A=o[1];oe(d,function(T,W){a(T,W)});var b=I(y.value?"loading":"normal");oe(function(){return e.src},function(){b.value=y.value?"loading":"normal"});var u=I(null),S=L(function(){return b.value==="error"}),k=Nt.inject(),O=k.isPreviewGroup,C=k.setCurrent,x=k.setShowPreview,P=k.setMousePosition,$=k.registerImage,z=I(xi++),_=L(function(){return e.preview&&!S.value}),R=function(){b.value="normal"},J=function(W){b.value="error",c("error",W)},U=function(W){if(!v.value){var K=Xn(W.target),X=K.left,Y=K.top;O.value?(C(z.value),P({x:X,y:Y})):u.value={x:X,y:Y}}O.value?x(!0):A(!0),c("click",W)},ie=function(){A(!1),v.value||(u.value=null)},ue=I(null);oe(function(){return ue},function(){b.value==="loading"&&ue.value.complete&&(ue.value.naturalWidth||ue.value.naturalHeight)&&R()});var ce=function(){};Fe(function(){oe([f,_],function(){if(ce(),!O.value)return function(){};ce=$(z.value,f.value,_.value),_.value||ce()},{flush:"post",immediate:!0})}),Fn(function(){ce()});var me=function(W){return Ar(W)?W+"px":W};return function(){var T=e.prefixCls,W=e.wrapperClassName,K=e.fallback,X=e.src,Y=e.placeholder,ee=e.wrapperStyle,he=e.rootClassName,Qe=r.width,Ce=r.height,Ee=r.crossorigin,ke=r.decoding,Ie=r.alt,$e=r.sizes,ze=r.srcset,Re=r.usemap,j=r.class,D=r.style,ae=m.value,Se=ae.icons,fe=ae.maskClassName,Ae=Et(ae,Pi),ye=de(T,W,he,H({},"".concat(T,"-error"),S.value)),_e=S.value&&K?K:f.value,Le={crossorigin:Ee,decoding:ke,alt:Ie,sizes:$e,srcset:ze,usemap:Re,class:de("".concat(T,"-img"),H({},"".concat(T,"-img-placeholder"),Y===!0),j),style:E({height:Ce},D)};return p(ve,null,[p("div",{class:ye,onClick:_.value?U:function(hr){c("click",hr)},style:E({width:me(Qe),height:me(Ce)},ee)},[p("img",E(E(E({},Le),S.value&&K?{src:K}:{onLoad:R,onError:J,src:X}),{},{ref:ue}),null),b.value==="loading"&&p("div",{"aria-hidden":"true",class:"".concat(T,"-placeholder")},[Y||i.placeholder&&i.placeholder()]),i.previewMask&&_.value&&p("div",{class:["".concat(T,"-mask"),fe]},[i.previewMask()])]),!O.value&&_.value&&p(tr,E(E({},Ae),{},{"aria-hidden":!d.value,visible:d.value,prefixCls:w.value,onClose:ie,mousePosition:u.value,src:_e,alt:Ie,getContainer:g.value,icons:Se,rootClassName:he}),null)])}}});ir.PreviewGroup=er;const Ei=ir;var ki={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M672 418H144c-17.7 0-32 14.3-32 32v414c0 17.7 14.3 32 32 32h528c17.7 0 32-14.3 32-32V450c0-17.7-14.3-32-32-32zm-44 402H188V494h440v326z"}},{tag:"path",attrs:{d:"M819.3 328.5c-78.8-100.7-196-153.6-314.6-154.2l-.2-64c0-6.5-7.6-10.1-12.6-6.1l-128 101c-4 3.1-3.9 9.1 0 12.3L492 318.6c5.1 4 12.7.4 12.6-6.1v-63.9c12.9.1 25.9.9 38.8 2.5 42.1 5.2 82.1 18.2 119 38.7 38.1 21.2 71.2 49.7 98.4 84.3 27.1 34.7 46.7 73.7 58.1 115.8a325.95 325.95 0 016.5 140.9h74.9c14.8-103.6-11.3-213-81-302.3z"}}]},name:"rotate-left",theme:"outlined"};const Ii=ki;function sn(t){for(var e=1;e{document.addEventListener(...t),qe(()=>document.removeEventListener(...t))},Aa="data:image/png;base64,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",Xe=new WeakMap;function Oa(t,e){return{useHookShareState:r=>{const i=jr();ht(i),Xe.has(i)||(Xe.set(i,We(t(i,r??(e==null?void 0:e())))),qe(()=>{Xe.delete(i)}));const c=Xe.get(i);return ht(c),{state:c,toRefs(){return Rr(c)}}}}}var Pa={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-600 72h560v208H232V136zm560 480H232V408h560v208zm0 272H232V680h560v208zM304 240a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"database",theme:"outlined"};const xa=Pa;function bn(t){for(var e=1;e(t.DATE_ASC="date-asc",t.DATE_DESC="date-desc",t.NAME_ASC="name-asc",t.NAME_DESC="name-desc",t.SIZE_ASC="size-asc",t.SIZE_DESC="size-desc",t.CREATED_TIME_ASC="created-time-asc",t.CREATED_TIME_DESC="created-time-desc",t))(ur||{});const Za=(t,e)=>{const n=t.type==="dir"?1:0;return(e.type==="dir"?1:0)-n},xn=(t,e)=>{const n=Date.parse(t.date),r=Date.parse(e.date);return n-r},En=(t,e)=>{const n=Date.parse(t.created_time),r=Date.parse(e.created_time);return n-r},kn=(t,e)=>{const n=t.name.toLowerCase(),r=e.name.toLowerCase();return n.localeCompare(r)},In=(t,e)=>t.bytes-e.bytes,Ue=(t,e)=>{const n=(r,i)=>{switch(e){case"date-asc":return xn(r,i);case"date-desc":return xn(i,r);case"created-time-asc":return En(r,i);case"created-time-desc":return En(i,r);case"name-asc":return kn(r,i);case"name-desc":return kn(i,r);case"size-asc":return In(r,i);case"size-desc":return In(i,r);default:throw new Error(`Invalid sort method: ${e}`)}};return t.slice().sort((r,i)=>Za(r,i)||n(r,i))},Ve=async(t,e)=>(await It.get(`/files/${t}`,{params:{folder_path:e}})).data,Ka=async(t,e)=>(await It.post(`/delete_files/${t}`,{file_paths:e})).data,cr=async(t,e,n)=>(await It.post(`/move_files/${t}`,{file_paths:e,dest:n})).data;function dr(t){return!!/^(?:\/|[a-z]:\/)/i.test(Be(t))}function Be(t){t=t.replace(/\\/g,"/"),t=t.replace(/\/+/g,"/");const e=t.split("/"),n=[];for(let c=0;c{const n=dr(t)?t:Be(ut(e,t));return Be(n)},$n=t=>{t=Be(t);const e=t.split("/").filter(n=>n);return e[0].endsWith(":")&&(e[0]=e[0]+"/"),e};var bt={},el={get exports(){return bt},set exports(t){bt=t}};/* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress * @license MIT */(function(t,e){(function(n,r){t.exports=r})(Vr,function(){var n={};n.version="0.3.5";var r=n.settings={minimum:.08,easing:"linear",positionUsing:"",speed:200,trickle:!0,trickleSpeed:200,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'
'};n.configure=function(a){var l,o;for(l in a)o=a[l],o!==void 0&&a.hasOwnProperty(l)&&(r[l]=o);return this},n.status=null,n.set=function(a){var l=n.isStarted();a=i(a,r.minimum,1),n.status=a===1?null:a;var o=n.render(!l),d=o.querySelector(r.barSelector),A=r.speed,b=r.easing;return o.offsetWidth,w(function(u){r.positionUsing===""&&(r.positionUsing=n.getPositioningCSS()),m(d,s(a,A,b)),a===1?(m(o,{transition:"none",opacity:1}),o.offsetWidth,setTimeout(function(){m(o,{transition:"all "+A+"ms linear",opacity:0}),setTimeout(function(){n.remove(),u()},A)},A)):setTimeout(u,A)}),this},n.isStarted=function(){return typeof n.status=="number"},n.start=function(){n.status||n.set(0);var a=function(){setTimeout(function(){n.status&&(n.trickle(),a())},r.trickleSpeed)};return r.trickle&&a(),this},n.done=function(a){return!a&&!n.status?this:n.inc(.3+.5*Math.random()).set(1)},n.inc=function(a){var l=n.status;return l?l>1?void 0:(typeof a!="number"&&(l>=0&&l<.2?a=.1:l>=.2&&l<.5?a=.04:l>=.5&&l<.8?a=.02:l>=.8&&l<.99?a=.005:a=0),l=i(l+a,0,.994),n.set(l)):n.start()},n.trickle=function(){return n.inc()},function(){var a=0,l=0;n.promise=function(o){return!o||o.state()==="resolved"?this:(l===0&&n.start(),a++,l++,o.always(function(){l--,l===0?(a=0,n.done()):n.set((a-l)/a)}),this)}}(),n.getElement=function(){var a=n.getParent();if(a){var l=Array.prototype.slice.call(a.querySelectorAll(".nprogress")).filter(function(o){return o.parentElement===a});if(l.length>0)return l[0]}return null},n.getParent=function(){if(r.parent instanceof HTMLElement)return r.parent;if(typeof r.parent=="string")return document.querySelector(r.parent)},n.render=function(a){if(n.isRendered())return n.getElement();y(document.documentElement,"nprogress-busy");var l=document.createElement("div");l.id="nprogress",l.className="nprogress",l.innerHTML=r.template;var o=l.querySelector(r.barSelector),d=a?"-100":c(n.status||0),A=n.getParent(),b;return m(o,{transition:"all 0 linear",transform:"translate3d("+d+"%,0,0)"}),r.showSpinner||(b=l.querySelector(r.spinnerSelector),b&&v(b)),A!=document.body&&y(A,"nprogress-custom-parent"),A.appendChild(l),l},n.remove=function(){n.status=null,h(document.documentElement,"nprogress-busy"),h(n.getParent(),"nprogress-custom-parent");var a=n.getElement();a&&v(a)},n.isRendered=function(){return!!n.getElement()},n.getPositioningCSS=function(){var a=document.body.style,l="WebkitTransform"in a?"Webkit":"MozTransform"in a?"Moz":"msTransform"in a?"ms":"OTransform"in a?"O":"";return l+"Perspective"in a?"translate3d":l+"Transform"in a?"translate":"margin"};function i(a,l,o){return ao?o:a}function c(a){return(-1+a)*100}function s(a,l,o){var d;return r.positionUsing==="translate3d"?d={transform:"translate3d("+c(a)+"%,0,0)"}:r.positionUsing==="translate"?d={transform:"translate("+c(a)+"%,0)"}:d={"margin-left":c(a)+"%"},d.transition="all "+l+"ms "+o,d}var w=function(){var a=[];function l(){var o=a.shift();o&&o(l)}return function(o){a.push(o),a.length==1&&l()}}(),m=function(){var a=["Webkit","O","Moz","ms"],l={};function o(u){return u.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(S,k){return k.toUpperCase()})}function d(u){var S=document.body.style;if(u in S)return u;for(var k=a.length,O=u.charAt(0).toUpperCase()+u.slice(1),C;k--;)if(C=a[k]+O,C in S)return C;return u}function A(u){return u=o(u),l[u]||(l[u]=d(u))}function b(u,S,k){S=A(S),u.style[S]=k}return function(u,S){var k=arguments,O,C;if(k.length==2)for(O in S)C=S[O],C!==void 0&&S.hasOwnProperty(O)&&b(u,O,C);else b(u,k[1],k[2])}}();function f(a,l){var o=typeof a=="string"?a:g(a);return o.indexOf(" "+l+" ")>=0}function y(a,l){var o=g(a),d=o+l;f(o,l)||(a.className=d.substring(1))}function h(a,l){var o=g(a),d;f(a,l)&&(d=o.replace(" "+l+" "," "),a.className=d.substring(1,d.length-1))}function g(a){return(" "+(a&&a.className||"")+" ").replace(/\s+/gi," ")}function v(a){a&&a.parentNode&&a.parentNode.removeChild(a)}return n})})(el);const tl=bt,mt=new Map,G=$t(),zn=new BroadcastChannel("iib-image-transfer-bus"),wt=(t,e=!1)=>`/infinite_image_browsing/file?filename=${encodeURIComponent(t.fullpath)}${e?`&disposition=${encodeURIComponent(t.name)}`:""}`,nl=(t,e)=>`/infinite_image_browsing/image-thumbnail?path=${encodeURIComponent(t.fullpath)}&size=${e}`,{eventEmitter:tt,useEventListen:Ct}=Rn(),{useHookShareState:we}=Oa(()=>{const t=I({tabIdx:-1,paneIdx:-1}),e=L(()=>Je(n.value)),n=I([]),r=L(()=>{var g;return n.value.map(v=>v.curr).slice((g=G.conf)!=null&&g.is_win?1:0)}),i=L(()=>ut(...r.value)),c=I(ur.CREATED_TIME_DESC),s=L(()=>{var o;if(!e.value)return[];const g=((o=e.value)==null?void 0:o.files)??[],v=c.value,{walkFiles:a}=e.value,l=d=>G.onlyFoldersAndImages?d.filter(A=>A.type==="dir"||le(A.name)):d;return t.value.walkMode&&a?a.map(d=>Ue(l(d),v)).flat():Ue(l(g),v)}),w=I([]),m=I(-1),f=I(!0),y=I();return{spinning:I(!1),canLoadNext:f,multiSelectedIdxs:w,previewIdx:m,basePath:r,currLocation:i,currPage:e,stack:n,sortMethod:c,sortedFiles:s,scroller:I(),stackViewEl:I(),walkModePath:y,props:t,...Rn()}});function eo(t,e){const{previewIdx:n,eventEmitter:r,canLoadNext:i}=we().toRefs(),{state:c}=we(),s=L(()=>(e==null?void 0:e.files.value)??c.sortedFiles),w=L(()=>(e==null?void 0:e.scroller.value)??c.scroller),m=I(!1);let f=null;const y=(a,l)=>{var o;m.value=a,f!=null&&!a&&l&&((o=w.value)==null||o.scrollToItem(f),f=null)},h=()=>{t.walkMode&&!v("next")&&i&&(ge.info(Q("loadingNextFolder")),r.value.emit("loadNextDir"))};yt("keydown",a=>{var l;if(m.value){let o=n.value;if(["ArrowDown","ArrowRight"].includes(a.key))for(o++;s.value[o]&&!le(s.value[o].name);)o++;else if(["ArrowUp","ArrowLeft"].includes(a.key))for(o--;s.value[o]&&!le(s.value[o].name);)o--;if(le((l=s.value[o])==null?void 0:l.name)??""){n.value=o;const d=w.value;d&&!(o>=d.$_startIndex&&o<=d.$_endIndex)&&(f=o)}h()}});const g=a=>{var o;let l=n.value;if(a==="next")for(l++;s.value[l]&&!le(s.value[l].name);)l++;else if(a==="prev")for(l--;s.value[l]&&!le(s.value[l].name);)l--;if(le((o=s.value[l])==null?void 0:o.name)??""){n.value=l;const d=w.value;d&&!(l>=d.$_startIndex&&l<=d.$_endIndex)&&(f=l)}h()},v=a=>{var o;let l=n.value;if(a==="next")for(l++;s.value[l]&&!le(s.value[l].name);)l++;else if(a==="prev")for(l--;s.value[l]&&!le(s.value[l].name);)l--;return le((o=s.value[l])==null?void 0:o.name)??""};return Ct("removeFiles",async()=>{var a;m.value&&!c.sortedFiles[n.value]&&(ge.info(Q("manualExitFullScreen"),5),await zt(500),(a=document.querySelector(".ant-image-preview-operations-operation .anticon-close"))==null||a.click(),n.value=-1)}),{previewIdx:n,onPreviewVisibleChange:y,previewing:m,previewImgMove:g,canPreview:v}}function to(t){const e=I(),{scroller:n,stackViewEl:r,stack:i,currPage:c,currLocation:s,sortMethod:w,useEventListen:m,walkModePath:f,eventEmitter:y}=we().toRefs();oe(()=>i.value.length,Te((b,u)=>{var S;b!==u&&((S=n.value)==null||S.scrollToItem(0))},300));const h=async b=>{if(await o(b),t.walkMode){await zt();const[u]=Ue(c.value.files,w.value).filter(S=>S.type==="dir");u&&await o(u.fullpath),await y.value.emit("loadNextDir")}};Fe(async()=>{var b;if(!i.value.length){const u=await Ve("local","/");i.value.push({files:u.files,curr:"/"})}e.value=new tl,e.value.configure({parent:r.value}),t.path&&t.path!=="/"?await h(t.path):(b=G.conf)!=null&&b.home&&o(G.conf.home)}),oe(s,Te(b=>{const u=G.tabList[t.tabIdx].panes[t.paneIdx];u.path=b;const S=u.path.split("/").pop(),k=()=>{var O;return t.walkMode?"Walk: "+(((O=G.autoCompletedDirList.find(C=>C.dir===f.value))==null?void 0:O.zh)??S):S};u.name=pe("div",{style:"display:flex;align-items:center"},[pe(ka),pe("span",{class:"line-clamp-1",style:"max-width: 256px"},k())]),G.recent=G.recent.filter(O=>O.key!==u.key),G.recent.unshift({path:b,key:u.key}),G.recent.length>20&&(G.recent=G.recent.slice(0,20))},300));const g=()=>Lt(s.value),v=async b=>{var u,S;if(b.type==="dir")try{(u=e.value)==null||u.start();const{files:k}=await Ve("local",b.fullpath);i.value.push({files:k,curr:b.name})}finally{(S=e.value)==null||S.done()}},a=b=>{for(;b(ht(G.conf,"global.conf load failed"),G.conf.is_win?b.toLowerCase()==u.toLowerCase():b==u),o=async b=>{var S,k;const u=i.value.slice();try{dr(b)||(b=ut(((S=G.conf)==null?void 0:S.sd_cwd)??"/",b));const O=$n(b),C=i.value.map(x=>x.curr);for(C.shift();C[0]&&O[0]&&l(C[0],O[0]);)C.shift(),O.shift();for(let x=0;xl($.name,x));if(!P)throw console.error({frags:O,frag:x,stack:jn(i.value)}),new Error(`${x} not found`);await v(P)}}catch(O){throw ge.error(Q("moveFailedCheckPath")+(O instanceof Error?O.message:"")),console.error(b,$n(b),c.value),i.value=u,O}},d=rn(async()=>{var b,u,S;try{if((b=e.value)==null||b.start(),f.value)a(0),await h(f.value);else{const{files:k}=await Ve("local",i.value.length===1?"/":s.value);Je(i.value).files=k}(u=n.value)==null||u.scrollToItem(0),ge.success(Q("refreshCompleted"))}finally{(S=e.value)==null||S.done()}});return Ur("return-to-iib",rn(async()=>{var b,u;if(!t.walkMode)try{(b=e.value)==null||b.start();const{files:S}=await Ve("local",i.value.length===1?"/":s.value);Je(i.value).files=S,ge.success(Q("auto.refreshed"))}finally{(u=e.value)==null||u.done()}})),m.value("refresh",d),{refresh:d,copyLocation:g,back:a,openNext:v,currPage:c,currLocation:s,to:o,stack:i,scroller:n,quickMoveTo:b=>{t.walkMode&&(f.value=b),h(b)}}}function no(t){const{scroller:e,sortedFiles:n,stack:r,sortMethod:i,currLocation:c,currPage:s,stackViewEl:w,canLoadNext:m}=we().toRefs(),{state:f}=we(),y=I(!1),h=I("grid"),g={line:Q("detailList"),grid:Q("previewGrid"),"large-size-grid":Q("largePreviewGrid")},v={value:C=>C,text:C=>Q("sortBy")+" "+qa[C].toLocaleLowerCase()},a=272,l=64,o=a*2,{width:d}=Hr(w),A=L(()=>{const C=d.value;if(!(h.value==="line"||!C))return~~(C/(h.value==="grid"?a:o))}),b=L(()=>{const C=h.value;if(C==="line")return{first:80,second:void 0};const x=C==="grid"?a:o;return{first:x+l,second:x}}),u=I(!1),S=async()=>{var C;if(!(u.value||!t.walkMode||!m.value))try{u.value=!0;const x=r.value[r.value.length-2],P=Ue(x.files,i.value),$=P.findIndex(z=>{var _;return z.name===((_=s.value)==null?void 0:_.curr)});if($!==-1){const z=P[$+1],_=ut(c.value,"../",z.name),R=await Ve("local",_),J=s.value;J.curr=z.name,J.walkFiles||(J.walkFiles=[J.files]),J.walkFiles.push(R.files),console.log("curr page files length",(C=s.value)==null?void 0:C.files.length)}}catch(x){console.error("loadNextDir",x),m.value=!1}finally{u.value=!1}},k=async()=>{const C=e.value;for(;!n.value.length||C&&C.$_endIndex>n.value.length-20&&m.value;)await zt(100),await S()};f.useEventListen("loadNextDir",k);const O=Te(k,300);return{gridItems:A,sortedFiles:n,sortMethodConv:v,viewModeMap:g,moreActionsDropdownShow:y,viewMode:h,gridSize:a,sortMethod:i,largeGridSize:o,onScroll:O,loadNextDir:S,loadNextDirLoading:u,canLoadNext:m,itemSize:b}}function ro(){const{currLocation:t,sortedFiles:e,currPage:n,multiSelectedIdxs:r,eventEmitter:i}=we().toRefs(),c=()=>{r.value=[]};return yt("click",c),yt("blur",c),oe(n,c),{onFileDragStart:(m,f)=>{const y=jn(e.value[f]);console.log("onFileDragStart set drag file ",m,f,y);const h=[y];let g=y.type==="dir";if(r.value.includes(f)){const v=r.value.map(a=>e.value[a]);h.push(...v),g=v.some(a=>a.type==="dir")}m.dataTransfer.setData("text/plain",JSON.stringify({includeDir:g,loc:t.value,path:Sa(h,"fullpath").map(v=>v.fullpath)}))},onDrop:async m=>{var y;const f=JSON.parse(((y=m.dataTransfer)==null?void 0:y.getData("text"))||"{}");if(console.log(f),f.path&&typeof f.includeDir<"u"&&f.loc){const h=t.value;if(f.loc===h)return;const g=pe("div",[pe("div",`${Q("moveSelectedFilesTo")}${h}`),pe("ol",f.path.map(v=>v.split(/[/\\]/).pop()).map(v=>pe("li",v)))]);re.confirm({title:Q("confirm"),content:g,maskClosable:!0,async onOk(){await cr("local",f.path,h),tt.emit("removeFiles",{paths:f.path,loc:f.loc}),await i.value.emit("refresh")}})}},multiSelectedIdxs:r}}function io(t,{openNext:e}){const n=I(!1),r=I(""),{sortedFiles:i,previewIdx:c,multiSelectedIdxs:s,stack:w,currLocation:m,spinning:f}=we().toRefs(),y=Be;Ct("removeFiles",({paths:a,loc:l})=>{if(y(l)!==y(m.value))return;const o=Je(w.value);o&&(o.files=o.files.filter(d=>!a.includes(d.fullpath)),o.walkFiles&&(o.walkFiles=o.walkFiles.map(d=>d.filter(A=>!a.includes(A.fullpath)))))}),Ct("addFiles",({files:a,loc:l})=>{if(y(l)!==y(m.value))return;const o=Je(w.value);o&&o.files.unshift(...a)});const h=_t();return{onFileItemClick:async(a,l,o)=>{c.value=o;const d=s.value.indexOf(o);if(a.shiftKey){if(d!==-1)s.value.splice(d,1);else{s.value.push(o),s.value.sort((u,S)=>u-S);const A=s.value[0],b=s.value[s.value.length-1];s.value=Ca(A,b+1)}a.stopPropagation()}else a.ctrlKey||a.metaKey?(d!==-1?s.value.splice(d,1):s.value.push(o),a.stopPropagation()):await e(l)},onContextMenuClick:async(a,l,o)=>{var S,k;console.log(a,l);const d=wt(l),A=m.value,b=()=>{let O=[];return s.value.includes(o)?O=s.value.map(C=>i.value[C]):O.push(l),O},u=async O=>{if(!f.value)try{f.value=!0,await Jr(l.fullpath),zn.postMessage("iib_hidden_img_update_trigger");const C=setTimeout(()=>Yr.warn({message:Q("long_loading"),duration:20}),5e3);await qr(),clearTimeout(C),zn.postMessage(`iib_hidden_tab_${O}`)}catch(C){console.error(C),ge.error("发送图像失败,请携带console的错误消息找开发者")}finally{f.value=!1}};switch(a.key){case"previewInNewWindow":return window.open(d);case"download":return window.open(wt(l,!0));case"copyPreviewUrl":return Lt(parent.document.location.origin+d);case"send2txt2img":return u("txt2img");case"send2img2img":return u("img2img");case"send2inpaint":return u("inpaint");case"send2extras":return u("extras");case"send2savedDir":{const O=G.autoCompletedDirList.find(P=>P.key==="outdir_save");if(!O)return ge.error(Q("unknownSavedDir"));const C=Xa(O.dir,(S=G.conf)==null?void 0:S.sd_cwd),x=b();await cr("local",x.map(P=>P.fullpath),C),tt.emit("removeFiles",{paths:x.map(P=>P.fullpath),loc:m.value}),tt.emit("addFiles",{files:x,loc:C});break}case"openWithWalkMode":{mt.set(A,w.value);const O=G.tabList[t.tabIdx],C={type:"local",key:dt(),path:l.fullpath,name:Q("local"),stackKey:A,walkMode:!0};O.panes.push(C),O.key=C.key;break}case"openInNewTab":{mt.set(A,w.value);const O=G.tabList[t.tabIdx],C={type:"local",key:dt(),path:l.fullpath,name:Q("local"),stackKey:A};O.panes.push(C),O.key=C.key;break}case"openOnTheRight":{mt.set(A,w.value);let O=G.tabList[t.tabIdx+1];O||(O=Gr({panes:[],key:""}),G.tabList[t.tabIdx+1]=O);const C={type:"local",key:dt(),path:l.fullpath,name:Q("local"),stackKey:A};O.panes.push(C),O.key=C.key;break}case"viewGenInfo":{n.value=!0,r.value=await h.pushAction(()=>Vn(l.fullpath)).res;break}case"deleteFiles":{const O=b();await new Promise(C=>{re.confirm({title:Q("confirmDelete"),maskClosable:!0,content:pe("ol",{style:"max-height:50vh;overflow:auto;"},O.map(x=>x.fullpath.split(/[/\\]/).pop()).map(x=>pe("li",x))),async onOk(){const x=O.map(P=>P.fullpath);await Ka("local",x),ge.success(Q("deleteSuccess")),tt.emit("removeFiles",{paths:x,loc:m.value}),C()}})});break}}if(((k=a.keyPath)==null?void 0:k[0])==="toggle-tag"){const{is_remove:O}=await fi({tag_id:a.key,img_path:l.fullpath});ge.success(O?Q("removedTagFromImage"):Q("addedTagToImage"))}return{}},showGenInfo:n,imageGenInfo:r,q:h}}const ao=()=>{const{stackViewEl:t}=we().toRefs(),e=I(-1);return Wr(t,n=>{var i;let r=n.target;for(;r.parentElement;)if(r=r.parentElement,r.tagName.toLowerCase()==="li"&&r.classList.contains("file-item-trigger")){const c=(i=r.dataset)==null?void 0:i.idx;c&&Number.isSafeInteger(+c)&&(e.value=+c);return}}),{showMenuIdx:e}};function rl(){var t=window.navigator.userAgent,e=t.indexOf("MSIE ");if(e>0)return parseInt(t.substring(e+5,t.indexOf(".",e)),10);var n=t.indexOf("Trident/");if(n>0){var r=t.indexOf("rv:");return parseInt(t.substring(r+3,t.indexOf(".",r)),10)}var i=t.indexOf("Edge/");return i>0?parseInt(t.substring(i+5,t.indexOf(".",i)),10):-1}let nt;function St(){St.init||(St.init=!0,nt=rl()!==-1)}var ct={name:"ResizeObserver",props:{emitOnMount:{type:Boolean,default:!1},ignoreWidth:{type:Boolean,default:!1},ignoreHeight:{type:Boolean,default:!1}},emits:["notify"],mounted(){St(),kt(()=>{this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitOnMount&&this.emitSize()});const t=document.createElement("object");this._resizeObject=t,t.setAttribute("aria-hidden","true"),t.setAttribute("tabindex",-1),t.onload=this.addResizeHandlers,t.type="text/html",nt&&this.$el.appendChild(t),t.data="about:blank",nt||this.$el.appendChild(t)},beforeUnmount(){this.removeResizeHandlers()},methods:{compareAndNotify(){(!this.ignoreWidth&&this._w!==this.$el.offsetWidth||!this.ignoreHeight&&this._h!==this.$el.offsetHeight)&&(this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitSize())},emitSize(){this.$emit("notify",{width:this._w,height:this._h})},addResizeHandlers(){this._resizeObject.contentDocument.defaultView.addEventListener("resize",this.compareAndNotify),this.compareAndNotify()},removeResizeHandlers(){this._resizeObject&&this._resizeObject.onload&&(!nt&&this._resizeObject.contentDocument&&this._resizeObject.contentDocument.defaultView.removeEventListener("resize",this.compareAndNotify),this.$el.removeChild(this._resizeObject),this._resizeObject.onload=null,this._resizeObject=null)}}};const il=Zr();Un("data-v-b329ee4c");const al={class:"resize-observer",tabindex:"-1"};Hn();const ll=il((t,e,n,r,i,c)=>(M(),q("div",al)));ct.render=ll;ct.__scopeId="data-v-b329ee4c";ct.__file="src/components/ResizeObserver.vue";function rt(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?rt=function(e){return typeof e}:rt=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rt(t)}function ol(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _n(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n2&&arguments[2]!==void 0?arguments[2]:{},r,i,c,s=function(m){for(var f=arguments.length,y=new Array(f>1?f-1:0),h=1;h1){var f=w.find(function(h){return h.isIntersecting});f&&(m=f)}if(i.callback){var y=m.isIntersecting&&m.intersectionRatio>=i.threshold;if(y===i.oldResult)return;i.oldResult=y,i.callback(y,m)}},this.options.intersection),kt(function(){i.observer&&i.observer.observe(i.el)})}}},{key:"destroyObserver",value:function(){this.observer&&(this.observer.disconnect(),this.observer=null),this.callback&&this.callback._clear&&(this.callback._clear(),this.callback=null)}},{key:"threshold",get:function(){return this.options.intersection&&typeof this.options.intersection.threshold=="number"?this.options.intersection.threshold:0}}]),t}();function vr(t,e,n){var r=e.value;if(r)if(typeof IntersectionObserver>"u")console.warn("[vue-observe-visibility] IntersectionObserver API is not available in your browser. Please install this polyfill: https://github.com/w3c/IntersectionObserver/tree/master/polyfill");else{var i=new gl(t,r,n);t._vue_visibilityState=i}}function pl(t,e,n){var r=e.value,i=e.oldValue;if(!fr(r,i)){var c=t._vue_visibilityState;if(!r){mr(t);return}c?c.createObserver(r,n):vr(t,{value:r},n)}}function mr(t){var e=t._vue_visibilityState;e&&(e.destroyObserver(),delete t._vue_visibilityState)}var hl={beforeMount:vr,updated:pl,unmounted:mr},yl={itemsLimit:1e3},bl=/(auto|scroll)/;function gr(t,e){return t.parentNode===null?e:gr(t.parentNode,e.concat([t]))}var gt=function(e,n){return getComputedStyle(e,null).getPropertyValue(n)},wl=function(e){return gt(e,"overflow")+gt(e,"overflow-y")+gt(e,"overflow-x")},Cl=function(e){return bl.test(wl(e))};function Mn(t){if(t instanceof HTMLElement||t instanceof SVGElement){for(var e=gr(t.parentNode,[]),n=0;n{this.$_prerender=!1,this.updateVisibleItems(!0),this.ready=!0})},activated(){const t=this.$_lastUpdateScrollPosition;typeof t=="number"&&this.$nextTick(()=>{this.scrollToPosition(t)})},beforeUnmount(){this.removeListeners()},methods:{addView(t,e,n,r,i){const c=Kr({id:Pl++,index:e,used:!0,key:r,type:i}),s=Xr({item:n,position:0,nr:c});return t.push(s),s},unuseView(t,e=!1){const n=this.$_unusedViews,r=t.nr.type;let i=n.get(r);i||(i=[],n.set(r,i)),i.push(t),e||(t.nr.used=!1,t.position=-9999)},handleResize(){this.$emit("resize"),this.ready&&this.updateVisibleItems(!1)},handleScroll(t){if(!this.$_scrollDirty){if(this.$_scrollDirty=!0,this.$_updateTimeout)return;const e=()=>requestAnimationFrame(()=>{this.$_scrollDirty=!1;const{continuous:n}=this.updateVisibleItems(!1,!0);n||(clearTimeout(this.$_refreshTimout),this.$_refreshTimout=setTimeout(this.handleScroll,this.updateInterval+100))});e(),this.updateInterval&&(this.$_updateTimeout=setTimeout(()=>{this.$_updateTimeout=0,this.$_scrollDirty&&e()},this.updateInterval))}},handleVisibilityChange(t,e){this.ready&&(t||e.boundingClientRect.width!==0||e.boundingClientRect.height!==0?(this.$emit("visible"),requestAnimationFrame(()=>{this.updateVisibleItems(!1)})):this.$emit("hidden"))},updateVisibleItems(t,e=!1){const n=this.itemSize,r=this.gridItems||1,i=this.itemSecondarySize||n,c=this.$_computedMinItemSize,s=this.typeField,w=this.simpleArray?null:this.keyField,m=this.items,f=m.length,y=this.sizes,h=this.$_views,g=this.$_unusedViews,v=this.pool,a=this.itemIndexByKey;let l,o,d,A,b;if(!f)l=o=A=b=d=0;else if(this.$_prerender)l=A=0,o=b=Math.min(this.prerender,m.length),d=null;else{const P=this.getScroll();if(e){let _=P.start-this.$_lastUpdateScrollPosition;if(_<0&&(_=-_),n===null&&_P.start&&(J=U),U=~~((R+J)/2);while(U!==ie);for(U<0&&(U=0),l=U,d=y[f-1].accumulator,o=U;of&&(o=f)),A=l;Af&&(o=f),A<0&&(A=0),b>f&&(b=f),d=Math.ceil(f/r)*n}}o-l>yl.itemsLimit&&this.itemsLimitError(),this.totalSize=d;let u;const S=l<=this.$_endIndex&&o>=this.$_startIndex;if(S)for(let P=0,$=v.length;P<$;P++)u=v[P],u.nr.used&&(t&&(u.nr.index=a[u.item[w]]),(u.nr.index==null||u.nr.index=o)&&this.unuseView(u));const k=S?null:new Map;let O,C,x;for(let P=l;P=z.length)&&(u=this.addView(v,P,O,$,C),this.unuseView(u,!0),z=g.get(C)),u=z[x],k.set(C,x+1)),h.delete(u.nr.key),u.nr.used=!0,u.nr.index=P,u.nr.key=$,u.nr.type=C,h.set($,u),_=!0;else if(!u.nr.used&&(u.nr.used=!0,u.nr.index=P,_=!0,z)){const R=z.indexOf(u);R!==-1&&z.splice(R,1)}u.item=O,_&&(P===m.length-1&&this.$emit("scroll-end"),P===0&&this.$emit("scroll-start")),n===null?(u.position=y[P-1].accumulator,u.offset=0):(u.position=Math.floor(P/r)*n,u.offset=P%r*i)}return this.$_startIndex=l,this.$_endIndex=o,this.emitUpdate&&this.$emit("update",l,o,A,b),clearTimeout(this.$_sortTimer),this.$_sortTimer=setTimeout(this.sortViews,this.updateInterval+300),{continuous:S}},getListenerTarget(){let t=Mn(this.$el);return window.document&&(t===window.document.documentElement||t===window.document.body)&&(t=window),t},getScroll(){const{$el:t,direction:e}=this,n=e==="vertical";let r;if(this.pageMode){const i=t.getBoundingClientRect(),c=n?i.height:i.width;let s=-(n?i.top:i.left),w=n?window.innerHeight:window.innerWidth;s<0&&(w+=s,s=0),s+w>c&&(w=c-s),r={start:s,end:s+w}}else n?r={start:t.scrollTop,end:t.scrollTop+t.clientHeight}:r={start:t.scrollLeft,end:t.scrollLeft+t.clientWidth};return r},applyPageMode(){this.pageMode?this.addListeners():this.removeListeners()},addListeners(){this.listenerTarget=this.getListenerTarget(),this.listenerTarget.addEventListener("scroll",this.handleScroll,Pt?{passive:!0}:!1),this.listenerTarget.addEventListener("resize",this.handleResize)},removeListeners(){this.listenerTarget&&(this.listenerTarget.removeEventListener("scroll",this.handleScroll),this.listenerTarget.removeEventListener("resize",this.handleResize),this.listenerTarget=null)},scrollToItem(t){let e;const n=this.gridItems||1;this.itemSize===null?e=t>0?this.sizes[t-1].accumulator:0:e=Math.floor(t/n)*this.itemSize,this.scrollToPosition(e)},scrollToPosition(t){const e=this.direction==="vertical"?{scroll:"scrollTop",start:"top"}:{scroll:"scrollLeft",start:"left"};let n,r,i;if(this.pageMode){const c=Mn(this.$el),s=c.tagName==="HTML"?0:c[e.scroll],w=c.getBoundingClientRect(),f=this.$el.getBoundingClientRect()[e.start]-w[e.start];n=c,r=e.scroll,i=t+s+f}else n=this.$el,r=e.scroll,i=t;n[r]=i},itemsLimitError(){throw setTimeout(()=>{console.log("It seems the scroller element isn't scrolling, so it tries to render all the items at once.","Scroller:",this.$el),console.log("Make sure the scroller has a fixed height (or width) and 'overflow-y' (or 'overflow-x') set to 'auto' so it can scroll correctly and only render the items visible in the scroll viewport.")}),new Error("Rendered items limit reached")},sortViews(){this.pool.sort((t,e)=>t.nr.index-e.nr.index)}}};const xl={key:0,ref:"before",class:"vue-recycle-scroller__slot"},El={key:1,ref:"after",class:"vue-recycle-scroller__slot"};function kl(t,e,n,r,i,c){const s=ei("ResizeObserver"),w=ti("observe-visibility");return ni((M(),Z("div",{class:Ge(["vue-recycle-scroller",{ready:i.ready,"page-mode":n.pageMode,[`direction-${t.direction}`]:!0}]),onScrollPassive:e[0]||(e[0]=(...m)=>c.handleScroll&&c.handleScroll(...m))},[t.$slots.before?(M(),Z("div",xl,[Ke(t.$slots,"before")],512)):be("v-if",!0),(M(),q(an(n.listTag),{ref:"wrapper",style:ai({[t.direction==="vertical"?"minHeight":"minWidth"]:i.totalSize+"px"}),class:Ge(["vue-recycle-scroller__item-wrapper",n.listClass])},{default:N(()=>[(M(!0),Z(ve,null,Mt(i.pool,m=>(M(),q(an(n.itemTag),ri({key:m.nr.id,style:i.ready?{transform:`translate${t.direction==="vertical"?"Y":"X"}(${m.position}px) translate${t.direction==="vertical"?"X":"Y"}(${m.offset}px)`,width:n.gridItems?`${t.direction==="vertical"&&n.itemSecondarySize||n.itemSize}px`:void 0,height:n.gridItems?`${t.direction==="horizontal"&&n.itemSecondarySize||n.itemSize}px`:void 0}:null,class:["vue-recycle-scroller__item-view",[n.itemClass,{hover:!n.skipHover&&i.hoverKey===m.nr.key}]]},ii(n.skipHover?{}:{mouseenter:()=>{i.hoverKey=m.nr.key},mouseleave:()=>{i.hoverKey=null}})),{default:N(()=>[Ke(t.$slots,"default",{item:m.item,index:m.nr.index,active:m.nr.used})]),_:2},1040,["style","class"]))),128)),Ke(t.$slots,"empty")]),_:3},8,["style","class"])),t.$slots.after?(M(),Z("div",El,[Ke(t.$slots,"after")],512)):be("v-if",!0),p(s,{onNotify:c.handleResize},null,8,["onNotify"])],34)),[[w,c.handleVisibilityChange]])}pr.render=kl;pr.__file="src/components/RecycleScroller.vue";const Il=["data-idx"],$l={key:0},zl={key:1,class:"preview-icon-wrap"},_l={class:"profile"},Ll={class:"name line-clamp-1"},Ml={class:"basic-info"},Nl={class:"name line-clamp-1"},Dl={class:"basic-info"},Tl=se({__name:"FileItem",props:{file:null,idx:null,selected:{type:Boolean,default:!1},showMenuIdx:null,viewMode:{default:"grid"},fullScreenPreviewImageUrl:null},emits:["update:showMenuIdx","fileItemClick","dragstart","previewVisibleChange","contextMenuClick"],setup(t,{emit:e}){const n=t,r=$t(),i=I([]),c=L(()=>{var f;return(((f=r.conf)==null?void 0:f.all_custom_tags)??[]).reduce((y,h)=>[...y,{...h,selected:!!i.value.find(g=>g.id===h.id)}],[])}),s=()=>{var f;((f=n==null?void 0:n.file)==null?void 0:f.type)==="file"&&w.pushAction(()=>qn(n.file.fullpath)).res.then(y=>{i.value=y})},w=_t(),m=L(()=>n.viewMode==="grid"?[r.gridThumbnailSize,r.gridThumbnailSize].join():[r.largeGridThumbnailSize,r.largeGridThumbnailSize].join());return(f,y)=>{const h=Wi,g=Wn,v=Gn,a=Jn,l=xe;return M(),q(l,{trigger:["contextmenu"],visible:F(r).longPressOpenContextMenu?typeof t.idx=="number"&&t.showMenuIdx===t.idx:void 0,"onUpdate:visible":y[3]||(y[3]=o=>typeof t.idx=="number"&&e("update:showMenuIdx",o?t.idx:-1))},{overlay:N(()=>[p(a,{onClick:y[2]||(y[2]=o=>e("contextMenuClick",o,t.file,t.idx))},{default:N(()=>[p(g,{key:"deleteFiles"},{default:N(()=>[V(B(f.$t("deleteSelected")),1)]),_:1}),t.file.type==="dir"?(M(),Z(ve,{key:0},[p(g,{key:"openInNewTab"},{default:N(()=>[V(B(f.$t("openInNewTab")),1)]),_:1}),p(g,{key:"openOnTheRight"},{default:N(()=>[V(B(f.$t("openOnTheRight")),1)]),_:1}),p(g,{key:"openWithWalkMode"},{default:N(()=>[V(B(f.$t("openWithWalkMode")),1)]),_:1})],64)):be("",!0),t.file.type==="file"?(M(),Z(ve,{key:1},[p(g,{key:"previewInNewWindow"},{default:N(()=>[V(B(f.$t("previewInNewWindow")),1)]),_:1}),p(g,{key:"download"},{default:N(()=>[V(B(f.$t("downloadDirectly")),1)]),_:1}),p(g,{key:"copyPreviewUrl"},{default:N(()=>[V(B(f.$t("copySourceFilePreviewLink")),1)]),_:1}),F(le)(t.file.name)?(M(),Z(ve,{key:0},[p(g,{key:"viewGenInfo"},{default:N(()=>[V(B(f.$t("viewGenerationInfo")),1)]),_:1}),p(g,{key:"send2txt2img"},{default:N(()=>[V(B(f.$t("sendToTxt2img")),1)]),_:1}),p(g,{key:"send2img2img"},{default:N(()=>[V(B(f.$t("sendToImg2img")),1)]),_:1}),p(g,{key:"send2inpaint"},{default:N(()=>[V(B(f.$t("sendToInpaint")),1)]),_:1}),p(g,{key:"send2extras"},{default:N(()=>[V(B(f.$t("sendToExtraFeatures")),1)]),_:1}),p(g,{key:"send2savedDir"},{default:N(()=>[V(B(f.$t("send2savedDir")),1)]),_:1}),p(v,{key:"toggle-tag",title:f.$t("toggleTag")},{default:N(()=>[(M(!0),Z(ve,null,Mt(F(c),o=>(M(),q(g,{key:o.id},{default:N(()=>[V(B(o.name)+" ",1),o.selected?(M(),q(F(or),{key:0})):(M(),q(F(sr),{key:1}))]),_:2},1024))),128))]),_:1},8,["title"])],64)):be("",!0)],64)):be("",!0)]),_:1})]),default:N(()=>[(M(),Z("li",{class:Ge(["file file-item-trigger",{clickable:t.file.type==="dir",selected:t.selected,grid:t.viewMode==="grid"||t.viewMode==="large-size-grid","large-grid":t.viewMode==="large-size-grid"}]),"data-idx":t.idx,key:t.file.name,draggable:"true",onDragstart:y[0]||(y[0]=o=>e("dragstart",o,t.idx)),onContextmenu:s,onClickCapture:y[1]||(y[1]=o=>e("fileItemClick",o,t.file,t.idx))},[t.viewMode!=="line"?(M(),Z("div",$l,[F(le)(t.file.name)?(M(),q(h,{key:t.file.fullpath,class:Ge(`idx-${t.idx}`),src:F(r).enableThumbnail?F(nl)(t.file,F(m)):F(wt)(t.file),fallback:F(Aa),preview:{src:t.fullScreenPreviewImageUrl,onVisibleChange:(o,d)=>e("previewVisibleChange",o,d)}},null,8,["class","src","fallback","preview"])):(M(),Z("div",zl,[t.file.type==="file"?(M(),q(F(pn),{key:0,class:"icon center"})):(M(),q(F(yn),{key:1,class:"icon center"}))])),te("div",_l,[te("div",Ll,B(t.file.name),1),te("div",Ml,[te("div",null,B(t.file.size),1),te("div",null,B(t.file.date),1)])])])):(M(),Z(ve,{key:1},[t.file.type==="file"?(M(),q(F(pn),{key:0,class:"icon"})):(M(),q(F(yn),{key:1,class:"icon"})),te("div",Nl,B(t.file.name),1),te("div",Dl,[te("div",null,B(t.file.size),1),te("div",null,B(t.file.date),1)])],64))],42,Il))]),_:1},8,["visible"])}}});const lo=Yn(Tl,[["__scopeId","data-v-7e949e28"]]);function Bl(t,e,n,r){const i={x:0,y:0};let c=0,s=0,w=typeof(r==null?void 0:r.width)=="number"?r.width:0,m=typeof(r==null?void 0:r.height)=="number"?r.height:0,f=typeof(r==null?void 0:r.left)=="number"?r.left:0,y=typeof(r==null?void 0:r.top)=="number"?r.top:0,h=!1;const g=A=>{A.stopPropagation(),A.preventDefault(),!(!t.value||!e.value)&&(c=A.clientX,s=A.clientY,w=t.value.offsetWidth,m=t.value.offsetHeight,i.x=e.value.offsetLeft,i.y=e.value.offsetTop,document.documentElement.addEventListener("mousemove",v),document.documentElement.addEventListener("mouseup",a))},v=A=>{if(!t.value||!e.value)return;const b=w+A.clientX-c,u=m+A.clientY-s,S=i.x+A.clientX-c,k=i.y+A.clientY-s;t.value.style.width=`${b}px`,t.value.style.height=`${u}px`,e.value.style.left=`${S}px`,e.value.style.top=`${k}px`,r!=null&&r.onResize&&r.onResize(b,u)},a=()=>{document.documentElement.removeEventListener("mousemove",v),document.documentElement.removeEventListener("mouseup",a)},l=A=>{A.stopPropagation(),A.preventDefault(),!(!t.value||!n.value)&&(h=!0,f=t.value.offsetLeft,y=t.value.offsetTop,c=A.clientX,s=A.clientY,document.documentElement.addEventListener("mousemove",o),document.documentElement.addEventListener("mouseup",d))},o=A=>{if(!t.value||!n.value||!h)return;const b=f+A.clientX-c,u=y+A.clientY-s;t.value.style.left=`${b}px`,t.value.style.top=`${u}px`,r!=null&&r.onDrag&&r.onDrag(b,u)},d=()=>{h=!1,document.documentElement.removeEventListener("mousemove",o),document.documentElement.removeEventListener("mouseup",d)};return Fe(()=>{!t.value||!r||(typeof r.width=="number"&&(t.value.style.width=`${r.width}px`),typeof r.height=="number"&&(t.value.style.height=`${r.height}px`),typeof r.left=="number"&&(t.value.style.left=`${r.left}px`),typeof r.top=="number"&&(t.value.style.top=`${r.top}px`))}),qe(()=>{document.documentElement.removeEventListener("mousemove",v),document.documentElement.removeEventListener("mouseup",a),document.documentElement.removeEventListener("mousemove",o),document.documentElement.removeEventListener("mouseup",d)}),oe(()=>[t.value,e.value,n.value],([A,b,u])=>{A&&b&&u&&(b.addEventListener("mousedown",g),u.addEventListener("mousedown",l))}),{handleResizeMouseDown:g,handleDragMouseDown:l}}const Fl=t=>(Un("data-v-adc25b04"),t=t(),Hn(),t),Ql={class:"container"},Rl={class:"actoion-bar"},jl=Fl(()=>te("div",{"flex-placeholder":""},null,-1)),Vl={key:0,class:"gen-info"},Ul=se({__name:"fullScreenContextMenu",props:{file:null,idx:null},emits:["contextMenuClick"],setup(t,{emit:e}){const n=t,r=$t(),i=I(),c=I([]),s=L(()=>{var a;return(((a=r.conf)==null?void 0:a.all_custom_tags)??[]).reduce((l,o)=>[...l,{...o,selected:!!c.value.find(d=>d.id===o.id)}],[])}),w=_t(),m=I("");oe(()=>{var a;return(a=n==null?void 0:n.file)==null?void 0:a.fullpath},async a=>{a&&(w.tasks.forEach(l=>l.cancel()),w.pushAction(()=>Vn(a)).res.then(l=>{m.value=l}))},{immediate:!0});const f=a=>{a&&w.pushAction(()=>qn(n.file.fullpath)).res.then(l=>{c.value=l})},y=I(),h=I(),g=li("fullScreenContextMenu.vue-drag",{left:100,top:100,width:512,height:384,expanded:!0});Bl(i,y,h,{...g.value,onDrag:Te(function(a,l){g.value={...g.value,left:a,top:l}},300),onResize:Te(function(a,l){g.value={...g.value,width:a,height:l}},300)});function v(a){return a.parentNode}return(a,l)=>{const o=Ye,d=Wn,A=Gn,b=Jn,u=xe;return M(),Z("div",{ref_key:"el",ref:i,class:Ge(["full-screen-menu",{"unset-size":!F(g).expanded}]),onWheelCapture:l[3]||(l[3]=oi(()=>{},["stop"]))},[te("div",Ql,[te("div",Rl,[te("div",{ref_key:"dragHandle",ref:h,class:"icon",style:{cursor:"grab"}},[p(F(_a))],512),te("div",{class:"icon",style:{cursor:"pointer"},onClick:l[0]||(l[0]=S=>F(g).expanded=!F(g).expanded)},[F(g).expanded?(M(),q(F(Da),{key:0})):(M(),q(F(Qa),{key:1}))]),F(g).expanded?(M(),Z(ve,{key:0},[jl,p(u,{trigger:["hover"],style:{"z-index":"99999"},"get-popup-container":S=>v(S),onVisibleChange:f},{overlay:N(()=>[p(b,{onClick:l[1]||(l[1]=S=>e("contextMenuClick",S,t.file,t.idx)),style:{"z-index":"99999"}},{default:N(()=>[p(d,{key:"deleteFiles"},{default:N(()=>[V(B(a.$t("deleteSelected")),1)]),_:1}),p(d,{key:"send2txt2img"},{default:N(()=>[V(B(a.$t("sendToTxt2img")),1)]),_:1}),p(d,{key:"send2img2img"},{default:N(()=>[V(B(a.$t("sendToImg2img")),1)]),_:1}),p(d,{key:"send2inpaint"},{default:N(()=>[V(B(a.$t("sendToInpaint")),1)]),_:1}),p(d,{key:"send2extras"},{default:N(()=>[V(B(a.$t("sendToExtraFeatures")),1)]),_:1}),p(d,{key:"send2savedDir"},{default:N(()=>[V(B(a.$t("send2savedDir")),1)]),_:1}),p(A,{key:"toggle-tag",title:a.$t("toggleTag")},{default:N(()=>[(M(!0),Z(ve,null,Mt(F(s),S=>(M(),q(d,{key:S.id},{default:N(()=>[V(B(S.name)+" ",1),S.selected?(M(),q(F(or),{key:0})):(M(),q(F(sr),{key:1}))]),_:2},1024))),128))]),_:1},8,["title"])]),_:1})]),default:N(()=>[p(o,null,{default:N(()=>[V(B(F(Q)("openContextMenu")),1)]),_:1})]),_:1},8,["get-popup-container"]),p(o,{onClick:l[2]||(l[2]=S=>F(Lt)(m.value))},{default:N(()=>[V(B(a.$t("copyPrompt")),1)]),_:1})],64)):be("",!0)]),F(g).expanded?(M(),Z("div",Vl,B(m.value),1)):be("",!0)]),F(g).expanded?(M(),Z("div",{key:0,class:"mouse-sensor",ref_key:"resizeHandle",ref:y},null,512)):be("",!0)],34)}}});const oo=Yn(Ul,[["__scopeId","data-v-adc25b04"]]);export{xe as D,Kl as L,Xl as R,Zl as S,to as a,no as b,ro as c,io as d,eo as e,ao as f,mt as g,qa as h,pr as i,lo as j,oo as k,ql as s,wt as t,we as u};