import{P as pe,bU as gn,a as ne,d as le,bq as nt,u as Ne,c as h,bV as it,_ as Rt,V as se,a0 as we,aj as H,bL as St,a3 as At,bo as yn,h as R,bW as bn,b as wn,ay as Sn,bX as An,a2 as Et,bK as En,bY as kn,bZ as Cn,$ as V,b0 as _n,z as te,aA as On,a1 as In,aI as Pn,b_ as xn,ax as rt,aC as ue,b$ as $n,c0 as Re,e as kt,bz as Ln,ag as ie,c1 as Mn,aR as Tn,c2 as Nn,c3 as zn,aM as at,am as Je,bn as Jt,c4 as Bn,c5 as Fn,c6 as Ee,c7 as Dn,c8 as Qn,R as fe,ai as j,U as jn,c9 as ze,x as N,ca as Vn,bO as Be,cb as Ct,k as Fe,ah as Un,cc as Yt,ar as ee,cd as lt,l as he,aw as qt,ap as Qe,ce as Hn,cf as _t,an as Kt,bQ as Ot,bP as Wn,cg as Ie,ch as Rn,aD as Jn,ci as Yn,cj as qn,ck as K,cl as ye,t as Me,as as It,cm as Pt,cn as Kn,L as re,J as Gn,co as Ye,al as ke,cp as Xn,cq as Zn,cr as ei,cs as ti,at as ni,au as ii,o as M,m as J,ct as ri,cu as ai,cv as li,cw as si,cx as oi,a5 as ui,y as U,cy as Ce,E as q,n as P,A as Se,cz as xt,bG as ci,cA as di,B as fi,N as Ae,v as T,r as z,W as Gt,cB as vi,cC as Xt,M as Zt,cD as pi,cE as hi,p as G,cF as mi,X as en,cG as gi,q as yi}from"./index-bd9cfb84.js";import{t as je,l as ve,g as bi}from"./shortcut-6308494d.js";import{f as wi,h as Si,a as Ai,t as Ei}from"./db-a47df277.js";var tn=function(){return{arrow:{type:[Boolean,Object],default:void 0},trigger:{type:[Array,String]},overlay:pe.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}}},Ve=gn(),ki=function(){return ne(ne({},tn()),{},{type:Ve.type,size:String,htmlType:Ve.htmlType,href:String,disabled:{type:Boolean,default:void 0},prefixCls:String,icon:pe.any,title:String,loading:Ve.loading,onClick:{type:Function}})},Ci=["type","disabled","loading","htmlType","class","overlay","trigger","align","visible","onVisibleChange","placement","href","title","icon","mouseEnterDelay","mouseLeaveDelay","overlayClassName","overlayStyle","destroyPopupOnHide","onClick","onUpdate:visible"],_i=se.Group;const Te=le({compatConfig:{MODE:3},name:"ADropdownButton",inheritAttrs:!1,__ANT_BUTTON:!0,props:nt(ki(),{trigger:"hover",placement:"bottomRight",type:"default"}),slots:["icon","leftButton","rightButton","overlay"],setup:function(t,n){var i=n.slots,r=n.attrs,o=n.emit,p=function(w){o("update:visible",w),o("visibleChange",w)},c=Ne("dropdown-button",t),f=c.prefixCls,g=c.direction,S=c.getPopupContainer;return function(){var E,w,v=ne(ne({},t),r),l=v.type,s=l===void 0?"default":l,a=v.disabled,m=v.loading,y=v.htmlType,d=v.class,u=d===void 0?"":d,b=v.overlay,O=b===void 0?(E=i.overlay)===null||E===void 0?void 0:E.call(i):b,A=v.trigger,_=v.align,L=v.visible;v.onVisibleChange;var I=v.placement,B=I===void 0?g.value==="rtl"?"bottomLeft":"bottomRight":I,k=v.href,x=v.title,Q=v.icon,C=Q===void 0?((w=i.icon)===null||w===void 0?void 0:w.call(i))||h(it,null,null):Q,$=v.mouseEnterDelay,F=v.mouseLeaveDelay,X=v.overlayClassName,W=v.overlayStyle,Z=v.destroyPopupOnHide,Y=v.onClick;v["onUpdate:visible"];var ce=Rt(v,Ci),de={align:_,disabled:a,trigger:a?[]:A,placement:B,getPopupContainer:S.value,onVisibleChange:p,mouseEnterDelay:$,mouseLeaveDelay:F,visible:L,overlayClassName:X,overlayStyle:W,destroyPopupOnHide:Z},bt=h(se,{type:s,disabled:a,loading:m,onClick:Y,htmlType:y,href:k,title:x},{default:i.default}),wt=h(se,{type:s,icon:C},null);return h(_i,ne(ne({},ce),{},{class:we(f.value,u)}),{default:function(){return[i.leftButton?i.leftButton({button:bt}):bt,h(oe,de,{default:function(){return[i.rightButton?i.rightButton({button:wt}):wt]},overlay:function(){return O}})]}})}}});var nn=le({compatConfig:{MODE:3},name:"ADropdown",inheritAttrs:!1,props:nt(tn(),{mouseEnterDelay:.15,mouseLeaveDelay:.1,placement:"bottomLeft",trigger:"hover"}),slots:["overlay"],setup:function(t,n){var i=n.slots,r=n.attrs,o=n.emit,p=Ne("dropdown",t),c=p.prefixCls,f=p.rootPrefixCls,g=p.direction,S=p.getPopupContainer,E=H(function(){var s=t.placement,a=s===void 0?"":s,m=t.transitionName;return m!==void 0?m:a.indexOf("top")>=0?"".concat(f.value,"-slide-down"):"".concat(f.value,"-slide-up")}),w=function(){var a,m,y,d=t.overlay||((a=i.overlay)===null||a===void 0?void 0:a.call(i)),u=Array.isArray(d)?d[0]:d;if(!u)return null;var b=u.props||{};St(!b.mode||b.mode==="vertical","Dropdown",'mode="'.concat(b.mode,`" is not supported for Dropdown's Menu.`));var O=b.selectable,A=O===void 0?!1:O,_=b.expandIcon,L=_===void 0?(m=u.children)===null||m===void 0||(y=m.expandIcon)===null||y===void 0?void 0:y.call(m):_,I=typeof L<"u"&&Et(L)?L:h("span",{class:"".concat(c.value,"-menu-submenu-arrow")},[h(En,{class:"".concat(c.value,"-menu-submenu-arrow-icon")},null)]),B=Et(u)?At(u,{mode:"vertical",selectable:A,expandIcon:function(){return I}}):u;return B},v=H(function(){var s=t.placement;if(!s)return g.value==="rtl"?"bottomRight":"bottomLeft";if(s.includes("Center")){var a=s.slice(0,s.indexOf("Center"));return St(!s.includes("Center"),"Dropdown","You are using '".concat(s,"' placement in Dropdown, which is deprecated. Try to use '").concat(a,"' instead.")),a}return s}),l=function(a){o("update:visible",a),o("visibleChange",a)};return function(){var s,a,m=t.arrow,y=t.trigger,d=t.disabled,u=t.overlayClassName,b=(s=i.default)===null||s===void 0?void 0:s.call(i)[0],O=At(b,yn({class:we(b==null||(a=b.props)===null||a===void 0?void 0:a.class,R({},"".concat(c.value,"-rtl"),g.value==="rtl"),"".concat(c.value,"-trigger"))},d?{disabled:d}:{})),A=we(u,R({},"".concat(c.value,"-rtl"),g.value==="rtl")),_=d?[]:y,L;_&&_.indexOf("contextmenu")!==-1&&(L=!0);var I=bn({arrowPointAtCenter:wn(m)==="object"&&m.pointAtCenter,autoAdjustOverflow:!0}),B=Sn(ne(ne(ne({},t),r),{},{builtinPlacements:I,overlayClassName:A,arrow:m,alignPoint:L,prefixCls:c.value,getPopupContainer:S.value,transitionName:E.value,trigger:_,onVisibleChange:l,placement:v.value}),["overlay","onUpdate:visible"]);return h(An,B,{default:function(){return[O]},overlay:w})}}});nn.Button=Te;const oe=nn;var Oi=function(){return{prefixCls:String,checked:{type:Boolean,default:void 0},onChange:{type:Function},onClick:{type:Function},"onUpdate:checked":Function}},Ii=le({compatConfig:{MODE:3},name:"ACheckableTag",props:Oi(),setup:function(t,n){var i=n.slots,r=n.emit,o=Ne("tag",t),p=o.prefixCls,c=function(S){var E=t.checked;r("update:checked",!E),r("change",!E),r("click",S)},f=H(function(){var g;return we(p.value,(g={},R(g,"".concat(p.value,"-checkable"),!0),R(g,"".concat(p.value,"-checkable-checked"),t.checked),g))});return function(){var g;return h("span",{class:f.value,onClick:c},[(g=i.default)===null||g===void 0?void 0:g.call(i)])}}});const qe=Ii;var Pi=new RegExp("^(".concat(kn.join("|"),")(-inverse)?$")),xi=new RegExp("^(".concat(Cn.join("|"),")$")),$i=function(){return{prefixCls:String,color:{type:String},closable:{type:Boolean,default:!1},closeIcon:pe.any,visible:{type:Boolean,default:void 0},onClose:{type:Function},"onUpdate:visible":Function,icon:pe.any}},be=le({compatConfig:{MODE:3},name:"ATag",props:$i(),slots:["closeIcon","icon"],setup:function(t,n){var i=n.slots,r=n.emit,o=n.attrs,p=Ne("tag",t),c=p.prefixCls,f=p.direction,g=V(!0);_n(function(){t.visible!==void 0&&(g.value=t.visible)});var S=function(l){l.stopPropagation(),r("update:visible",!1),r("close",l),!l.defaultPrevented&&t.visible===void 0&&(g.value=!1)},E=H(function(){var v=t.color;return v?Pi.test(v)||xi.test(v):!1}),w=H(function(){var v;return we(c.value,(v={},R(v,"".concat(c.value,"-").concat(t.color),E.value),R(v,"".concat(c.value,"-has-color"),t.color&&!E.value),R(v,"".concat(c.value,"-hidden"),!g.value),R(v,"".concat(c.value,"-rtl"),f.value==="rtl"),v))});return function(){var v,l,s,a=t.icon,m=a===void 0?(v=i.icon)===null||v===void 0?void 0:v.call(i):a,y=t.color,d=t.closeIcon,u=d===void 0?(l=i.closeIcon)===null||l===void 0?void 0:l.call(i):d,b=t.closable,O=b===void 0?!1:b,A=function(){return O?u?h("span",{class:"".concat(c.value,"-close-icon"),onClick:S},[u]):h(In,{class:"".concat(c.value,"-close-icon"),onClick:S},null):null},_={backgroundColor:y&&!E.value?y:void 0},L=m||null,I=(s=i.default)===null||s===void 0?void 0:s.call(i),B=L?h(te,null,[L,h("span",null,[I])]):I,k="onClick"in o,x=h("span",{class:w.value,style:_},[B,A()]);return k?h(On,null,{default:function(){return[x]}}):x}}});be.CheckableTag=qe;be.install=function(e){return e.component(be.name,be),e.component(qe.name,qe),e};const Li=be;oe.Button=Te;oe.install=function(e){return e.component(oe.name,oe),e.component(Te.name,Te),e};var Mi=["class","style"],Ti=function(){return{prefixCls:String,spinning:{type:Boolean,default:void 0},size:String,wrapperClassName:String,tip:pe.any,delay:Number,indicator:pe.any}},Pe=null;function Ni(e,t){return!!e&&!!t&&!isNaN(Number(t))}function $a(e){var t=e.indicator;Pe=typeof t=="function"?t:function(){return h(t,null,null)}}const La=le({compatConfig:{MODE:3},name:"ASpin",inheritAttrs:!1,props:nt(Ti(),{size:"default",spinning:!0,wrapperClassName:""}),setup:function(){return{originalUpdateSpinning:null,configProvider:Pn("configProvider",xn)}},data:function(){var t=this.spinning,n=this.delay,i=Ni(t,n);return{sSpinning:t&&!i}},created:function(){this.originalUpdateSpinning=this.updateSpinning,this.debouncifyUpdateSpinning(this.$props)},mounted:function(){this.updateSpinning()},updated:function(){var t=this;rt(function(){t.debouncifyUpdateSpinning(),t.updateSpinning()})},beforeUnmount:function(){this.cancelExistingSpin()},methods:{debouncifyUpdateSpinning:function(t){var n=t||this.$props,i=n.delay;i&&(this.cancelExistingSpin(),this.updateSpinning=ue(this.originalUpdateSpinning,i))},updateSpinning:function(){var t=this.spinning,n=this.sSpinning;n!==t&&(this.sSpinning=t)},cancelExistingSpin:function(){var t=this.updateSpinning;t&&t.cancel&&t.cancel()},renderIndicator:function(t){var n="".concat(t,"-dot"),i=$n(this,"indicator");return i===null?null:(Array.isArray(i)&&(i=i.length===1?i[0]:i),Re(i)?kt(i,{class:n}):Pe&&Re(Pe())?kt(Pe(),{class:n}):h("span",{class:"".concat(n," ").concat(t,"-dot-spin")},[h("i",{class:"".concat(t,"-dot-item")},null),h("i",{class:"".concat(t,"-dot-item")},null),h("i",{class:"".concat(t,"-dot-item")},null),h("i",{class:"".concat(t,"-dot-item")},null)]))}},render:function(){var t,n,i,r=this.$props,o=r.size,p=r.prefixCls,c=r.tip,f=c===void 0?(t=(n=this.$slots).tip)===null||t===void 0?void 0:t.call(n):c,g=r.wrapperClassName,S=this.$attrs,E=S.class,w=S.style,v=Rt(S,Mi),l=this.configProvider,s=l.getPrefixCls,a=l.direction,m=s("spin",p),y=this.sSpinning,d=(i={},R(i,m,!0),R(i,"".concat(m,"-sm"),o==="small"),R(i,"".concat(m,"-lg"),o==="large"),R(i,"".concat(m,"-spinning"),y),R(i,"".concat(m,"-show-text"),!!f),R(i,"".concat(m,"-rtl"),a==="rtl"),R(i,E,!!E),i),u=h("div",ne(ne({},v),{},{style:w,class:d}),[this.renderIndicator(m),f?h("div",{class:"".concat(m,"-text")},[f]):null]),b=Ln(this);if(b&&b.length){var O,A=(O={},R(O,"".concat(m,"-container"),!0),R(O,"".concat(m,"-blur"),y),O);return h("div",{class:["".concat(m,"-nested-loading"),g]},[y&&h("div",{key:"loading"},[u]),h("div",{class:A,key:"container"},[b])])}return u}});var zi={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3a32.05 32.05 0 00.6 45.3l183.7 179.1-43.4 252.9a31.95 31.95 0 0046.4 33.7L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3z"}}]},name:"star",theme:"filled"};const Bi=zi;function $t(e){for(var t=1;t{document.addEventListener(...e),at(()=>document.removeEventListener(...e))},Zi="data:image/png;base64,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",_e=new WeakMap;function er(e,t){return{useHookShareState:i=>{const r=Fn();Je(r),_e.has(r)||(_e.set(r,Jt(e(r,i??(t==null?void 0:t())))),at(()=>{_e.delete(r)}));const o=_e.get(r);return Je(o),{state:o,toRefs(){return Bn(o)}}}}}var tr={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M855 160.1l-189.2 23.5c-6.6.8-9.3 8.8-4.7 13.5l54.7 54.7-153.5 153.5a8.03 8.03 0 000 11.3l45.1 45.1c3.1 3.1 8.2 3.1 11.3 0l153.6-153.6 54.7 54.7a7.94 7.94 0 0013.5-4.7L863.9 169a7.9 7.9 0 00-8.9-8.9zM416.6 562.3a8.03 8.03 0 00-11.3 0L251.8 715.9l-54.7-54.7a7.94 7.94 0 00-13.5 4.7L160.1 855c-.6 5.2 3.7 9.5 8.9 8.9l189.2-23.5c6.6-.8 9.3-8.8 4.7-13.5l-54.7-54.7 153.6-153.6c3.1-3.1 3.1-8.2 0-11.3l-45.2-45z"}}]},name:"arrows-alt",theme:"outlined"};const nr=tr;function Tt(e){for(var t=1;t(await Ee.value.get("/files",{params:{folder_path:e}})).data,xr=async e=>(await Ee.value.post("/delete_files",{file_paths:e})).data,sn=async(e,t,n)=>(await Ee.value.post("/move_files",{file_paths:e,dest:t,create_dest_folder:n})).data,$r=async(e,t,n)=>(await Ee.value.post("/copy_files",{file_paths:e,dest:t,create_dest_folder:n})).data,Lr=async e=>{await Ee.value.post("/mkdirs",{dest_folder:e})};var on={exports:{}};/* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress * @license MIT */(function(e,t){(function(n,i){e.exports=i})(Dn,function(){var n={};n.version="0.3.5";var i=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(l){var s,a;for(s in l)a=l[s],a!==void 0&&l.hasOwnProperty(s)&&(i[s]=a);return this},n.status=null,n.set=function(l){var s=n.isStarted();l=r(l,i.minimum,1),n.status=l===1?null:l;var a=n.render(!s),m=a.querySelector(i.barSelector),y=i.speed,d=i.easing;return a.offsetWidth,c(function(u){i.positionUsing===""&&(i.positionUsing=n.getPositioningCSS()),f(m,p(l,y,d)),l===1?(f(a,{transition:"none",opacity:1}),a.offsetWidth,setTimeout(function(){f(a,{transition:"all "+y+"ms linear",opacity:0}),setTimeout(function(){n.remove(),u()},y)},y)):setTimeout(u,y)}),this},n.isStarted=function(){return typeof n.status=="number"},n.start=function(){n.status||n.set(0);var l=function(){setTimeout(function(){n.status&&(n.trickle(),l())},i.trickleSpeed)};return i.trickle&&l(),this},n.done=function(l){return!l&&!n.status?this:n.inc(.3+.5*Math.random()).set(1)},n.inc=function(l){var s=n.status;return s?s>1?void 0:(typeof l!="number"&&(s>=0&&s<.2?l=.1:s>=.2&&s<.5?l=.04:s>=.5&&s<.8?l=.02:s>=.8&&s<.99?l=.005:l=0),s=r(s+l,0,.994),n.set(s)):n.start()},n.trickle=function(){return n.inc()},function(){var l=0,s=0;n.promise=function(a){return!a||a.state()==="resolved"?this:(s===0&&n.start(),l++,s++,a.always(function(){s--,s===0?(l=0,n.done()):n.set((l-s)/l)}),this)}}(),n.getElement=function(){var l=n.getParent();if(l){var s=Array.prototype.slice.call(l.querySelectorAll(".nprogress")).filter(function(a){return a.parentElement===l});if(s.length>0)return s[0]}return null},n.getParent=function(){if(i.parent instanceof HTMLElement)return i.parent;if(typeof i.parent=="string")return document.querySelector(i.parent)},n.render=function(l){if(n.isRendered())return n.getElement();S(document.documentElement,"nprogress-busy");var s=document.createElement("div");s.id="nprogress",s.className="nprogress",s.innerHTML=i.template;var a=s.querySelector(i.barSelector),m=l?"-100":o(n.status||0),y=n.getParent(),d;return f(a,{transition:"all 0 linear",transform:"translate3d("+m+"%,0,0)"}),i.showSpinner||(d=s.querySelector(i.spinnerSelector),d&&v(d)),y!=document.body&&S(y,"nprogress-custom-parent"),y.appendChild(s),s},n.remove=function(){n.status=null,E(document.documentElement,"nprogress-busy"),E(n.getParent(),"nprogress-custom-parent");var l=n.getElement();l&&v(l)},n.isRendered=function(){return!!n.getElement()},n.getPositioningCSS=function(){var l=document.body.style,s="WebkitTransform"in l?"Webkit":"MozTransform"in l?"Moz":"msTransform"in l?"ms":"OTransform"in l?"O":"";return s+"Perspective"in l?"translate3d":s+"Transform"in l?"translate":"margin"};function r(l,s,a){return la?a:l}function o(l){return(-1+l)*100}function p(l,s,a){var m;return i.positionUsing==="translate3d"?m={transform:"translate3d("+o(l)+"%,0,0)"}:i.positionUsing==="translate"?m={transform:"translate("+o(l)+"%,0)"}:m={"margin-left":o(l)+"%"},m.transition="all "+s+"ms "+a,m}var c=function(){var l=[];function s(){var a=l.shift();a&&a(s)}return function(a){l.push(a),l.length==1&&s()}}(),f=function(){var l=["Webkit","O","Moz","ms"],s={};function a(u){return u.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(b,O){return O.toUpperCase()})}function m(u){var b=document.body.style;if(u in b)return u;for(var O=l.length,A=u.charAt(0).toUpperCase()+u.slice(1),_;O--;)if(_=l[O]+A,_ in b)return _;return u}function y(u){return u=a(u),s[u]||(s[u]=m(u))}function d(u,b,O){b=y(b),u.style[b]=O}return function(u,b){var O=arguments,A,_;if(O.length==2)for(A in b)_=b[A],_!==void 0&&b.hasOwnProperty(A)&&d(u,A,_);else d(u,O[1],O[2])}}();function g(l,s){var a=typeof l=="string"?l:w(l);return a.indexOf(" "+s+" ")>=0}function S(l,s){var a=w(l),m=a+s;g(a,s)||(l.className=m.substring(1))}function E(l,s){var a=w(l),m;g(l,s)&&(m=a.replace(" "+s+" "," "),l.className=m.substring(1,m.length-1))}function w(l){return(" "+(l&&l.className||"")+" ").replace(/\s+/gi," ")}function v(l){l&&l.parentNode&&l.parentNode.removeChild(l)}return n})})(on);var Mr=on.exports;const Tr=Qn(Mr),Nr=e=>{const t=V("");return new Promise(n=>{fe.confirm({title:j("inputFolderName"),content:()=>h(jn,{value:t.value,"onUpdate:value":i=>t.value=i},null),async onOk(){if(!t.value)return;const i=ze(e,t.value);await Lr(i),n()}})})},un=()=>h("p",{style:{background:"var(--zp-secondary-background)",padding:"8px",borderLeft:"4px solid var(--primary-color)"}},[N("Tips: "),j("multiSelectTips")]),yt=Vn("useTagStore",()=>{const e=Be(),t=new Set,n=Jt(new Map),i=async f=>{if(f=f.filter(g=>!t.has(g)&&!n.has(g)),!!f.length)try{f.forEach(S=>n.set(S,[]));const g=await wi(f);for(const S in g)n.set(S,g[S])}finally{f.forEach(g=>t.delete(g))}},r=["pink","red","orange","green","cyan","blue","purple"],o=new Map;return{tagMap:n,q:e,getColor:f=>{let g=o.get(f);if(!g){const S=Ct.hash.sha256.hash(f),E=parseInt(Ct.codec.hex.fromBits(S),16)%r.length;g=r[E],o.set(f,g)}return g},fetchImageTags:i,refreshTags:async f=>{f.forEach(g=>n.delete(g)),await i(f)}}});function Ue(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!Re(e)}const He=new Map,D=Fe(),cn=yt(),Vt=Un(),Oe=new BroadcastChannel("iib-image-transfer-bus"),{eventEmitter:xe,useEventListen:Ke}=Yt(),{useHookShareState:ae}=er((e,{images:t})=>{const n=V({tabIdx:-1,paneIdx:-1}),i=H(()=>ve(r.value)),r=V([]),o=H(()=>{var s;return r.value.map(a=>a.curr).slice((s=D.conf)!=null&&s.is_win?1:0)}),p=H(()=>ze(...o.value)),c=V(D.defaultSortingMethod),f=H(()=>{var d;if(t.value)return t.value;if(!i.value)return[];const s=((d=i.value)==null?void 0:d.files)??[],a=c.value,{walkFiles:m}=i.value,y=u=>D.onlyFoldersAndImages?u.filter(b=>b.type==="dir"||K(b.name)):u;return n.value.walkModePath?m?m.map(u=>ye(y(u),a)).flat():ye(y(s),a):ye(y(s),a)}),g=V([]),S=V(-1),E=V(!0),w=V(!1),v=V(!1),l=()=>{var s,a,m;return(m=(a=(s=D.tabList)==null?void 0:s[n.value.tabIdx])==null?void 0:a.panes)==null?void 0:m[n.value.paneIdx]};return{previewing:v,spinning:w,canLoadNext:E,multiSelectedIdxs:g,previewIdx:S,basePath:o,currLocation:p,currPage:i,stack:r,sortMethod:c,sortedFiles:f,scroller:V(),stackViewEl:V(),props:n,getPane:l,...Yt()}},()=>({images:V()}));function Na(e){const{previewIdx:t,eventEmitter:n,canLoadNext:i,previewing:r,sortedFiles:o,scroller:p}=ae().toRefs(),{state:c}=ae();let f=null;const g=(v,l)=>{var s;r.value=v,f!=null&&!v&&l&&((s=p.value)==null||s.scrollToItem(f),f=null)},S=()=>{e.walkModePath&&!w("next")&&i&&(ee.info(j("loadingNextFolder")),n.value.emit("loadNextDir",!0))};me("keydown",v=>{var l;if(r.value){let s=t.value;if(["ArrowDown","ArrowRight"].includes(v.key))for(s++;o.value[s]&&!K(o.value[s].name);)s++;else if(["ArrowUp","ArrowLeft"].includes(v.key))for(s--;o.value[s]&&!K(o.value[s].name);)s--;if(K((l=o.value[s])==null?void 0:l.name)??""){t.value=s;const a=p.value;a&&!(s>=a.$_startIndex&&s<=a.$_endIndex)&&(f=s)}S()}});const E=v=>{var s;let l=t.value;if(v==="next")for(l++;o.value[l]&&!K(o.value[l].name);)l++;else if(v==="prev")for(l--;o.value[l]&&!K(o.value[l].name);)l--;if(K((s=o.value[l])==null?void 0:s.name)??""){t.value=l;const a=p.value;a&&!(l>=a.$_startIndex&&l<=a.$_endIndex)&&(f=l)}S()},w=v=>{var s;let l=t.value;if(v==="next")for(l++;o.value[l]&&!K(o.value[l].name);)l++;else if(v==="prev")for(l--;o.value[l]&&!K(o.value[l].name);)l--;return K((s=o.value[l])==null?void 0:s.name)??""};return Ke("removeFiles",async()=>{var v;r.value&&!c.sortedFiles[t.value]&&(ee.info(j("manualExitFullScreen"),5),await lt(500),(v=document.querySelector(".ant-image-preview-operations-operation .anticon-close"))==null||v.click(),t.value=-1)}),{previewIdx:t,onPreviewVisibleChange:g,previewing:r,previewImgMove:E,canPreview:w}}function za(e){const t=V(),{scroller:n,stackViewEl:i,stack:r,currPage:o,currLocation:p,sortMethod:c,useEventListen:f,eventEmitter:g,getPane:S,multiSelectedIdxs:E,sortedFiles:w}=ae().toRefs();he(()=>r.value.length,ue((C,$)=>{var F;C!==$&&((F=n.value)==null||F.scrollToItem(0))},300));const v=async C=>{if(await y(C),e.walkModePath){await lt();const[$]=ye(o.value.files,c.value).filter(F=>F.type==="dir");$&&await y($.fullpath),await g.value.emit("loadNextDir")}};qt(async()=>{var C;if(!r.value.length){const $=await ge("/");r.value.push({files:$.files,curr:"/"})}t.value=new Tr,t.value.configure({parent:i.value}),e.path&&e.path!=="/"?await v(e.walkModePath??e.path):(C=D.conf)!=null&&C.home&&y(D.conf.home)}),he(p,ue(C=>{const $=S.value();if(!$)return;$.path=C;const F=$.path.split("/").pop(),W=(()=>{var Z;if(!e.walkModePath){const Y=Ie(C);for(const[ce,de]of Object.entries(D.pathAliasMap))if(Y.startsWith(de))return Y.replace(de,ce);return F}return"Walk: "+(((Z=D.quickMovePaths.find(Y=>Y.dir===$.walkModePath))==null?void 0:Z.zh)??F)})();$.name=Qe("div",{style:"display:flex;align-items:center"},[Qe(or),Qe("span",{class:"line-clamp-1",style:"max-width: 256px"},W)]),$.nameFallbackStr=W,D.recent=D.recent.filter(Z=>Z.key!==$.key),D.recent.unshift({path:C,key:$.key}),D.recent.length>20&&(D.recent=D.recent.slice(0,20))},300));const l=()=>Me(p.value),s=async C=>{var $,F;if(C.type==="dir")try{($=t.value)==null||$.start();const{files:X}=await ge(C.fullpath);r.value.push({files:X,curr:C.name})}finally{(F=t.value)==null||F.done()}},a=C=>{for(;C(Je(D.conf,"global.conf load failed"),D.conf.is_win?C.toLowerCase()==$.toLowerCase():C==$),y=async C=>{var F,X;const $=r.value.slice();try{Hn(C)||(C=ze(((F=D.conf)==null?void 0:F.sd_cwd)??"/",C));const W=_t(C),Z=r.value.map(Y=>Y.curr);for(Z.shift();Z[0]&&W[0]&&m(Z[0],W[0]);)Z.shift(),W.shift();for(let Y=0;Ym(de.name,Y));if(!ce)throw console.error({frags:W,frag:Y,stack:Kt(r.value)}),new Error(`${Y} not found`);await s(ce)}}catch(W){throw ee.error(j("moveFailedCheckPath")+(W instanceof Error?W.message:"")),console.error(C,_t(C),o.value),r.value=$,W}},d=Ot(async()=>{var C,$,F;try{if((C=t.value)==null||C.start(),e.walkModePath)a(0),await v(e.walkModePath);else{const{files:X}=await ge(r.value.length===1?"/":p.value);ve(r.value).files=X}($=n.value)==null||$.scrollToItem(0),ee.success(j("refreshCompleted"))}finally{(F=t.value)==null||F.done()}});Wn("returnToIIB",Ot(async()=>{var C,$;if(!e.walkModePath)try{(C=t.value)==null||C.start();const{files:F}=await ge(r.value.length===1?"/":p.value);ve(r.value).files.map(W=>W.date).join()!==F.map(W=>W.date).join()&&(ve(r.value).files=F,ee.success(j("autoUpdate")))}finally{($=t.value)==null||$.done()}})),f.value("refresh",d);const u=C=>{e.walkModePath&&(S.value().walkModePath=C),v(C)},b=H(()=>D.quickMovePaths.map(C=>({...C,path:Ie(C.dir)}))),O=H(()=>{const C=Ie(p.value);return b.value.find(F=>F.path===C)}),A=async()=>{const C=O.value;if(C){if(!C.can_delete)return;await Si(p.value),ee.success(j("removeComplete"))}else await Ai(p.value),ee.success(j("addComplete"));It.emit("searchIndexExpired"),It.emit("updateGlobalSetting")},_=V(!1),L=V(p.value),I=()=>{_.value=!0,L.value=p.value},B=async()=>{await y(L.value),_.value=!1};me("click",()=>{_.value=!1});const k=()=>{const C=parent.location,$=C.href.substring(0,C.href.length-C.search.length),F=new URLSearchParams(C.search);F.set("action","open"),F.set("path",p.value);const X=`${$}?${F.toString()}`;Me(X,j("copyLocationUrlSuccessMsg"))},x=()=>{console.log(`select all 0 -> ${w.value.length}`),E.value=an(0,w.value.length)};return f.value("selectAll",x),{locInputValue:L,isLocationEditing:_,onLocEditEnter:B,onEditBtnClick:I,addToSearchScanPathAndQuickMove:A,searchPathInfo:O,refresh:d,copyLocation:l,back:a,openNext:s,currPage:o,currLocation:p,to:y,stack:r,scroller:n,share:k,selectAll:x,quickMoveTo:u,onCreateFloderBtnClick:async()=>{await Nr(p.value),await d()}}}function Ba(e){const{scroller:t,sortedFiles:n,stack:i,sortMethod:r,currLocation:o,currPage:p,stackViewEl:c,canLoadNext:f,previewIdx:g}=ae().toRefs(),{state:S}=ae(),E=V(!1),w=V(D.defaultGridCellWidth),v=H(()=>w.value+16),l=44,{width:s}=Rn(c),a=H(()=>~~(s.value/v.value)),m=H(()=>{const A=v.value;return{first:A+(w.value<=160?0:l),second:A}}),y=V(!1),d=async()=>{var A;if(!(y.value||!e.walkModePath||!f.value))try{y.value=!0;const _=i.value[i.value.length-2],L=ye(_.files,r.value),I=L.findIndex(B=>{var k;return B.name===((k=p.value)==null?void 0:k.curr)});if(I!==-1){const B=L[I+1],k=ze(o.value,"../",B.name),x=await ge(k),Q=p.value;Q.curr=B.name,Q.walkFiles||(Q.walkFiles=[Q.files]),Q.walkFiles.push(x.files),console.log("curr page files length",(A=p.value)==null?void 0:A.files.length)}}catch(_){console.error("loadNextDir",_),f.value=!1}finally{y.value=!1}},u=async(A=!1)=>{const _=t.value,L=()=>A?g.value:(_==null?void 0:_.$_endIndex)??0;for(;!n.value.length||L()>n.value.length-20&&f.value;)await lt(100),await d()};S.useEventListen("loadNextDir",u);const b=()=>{const A=t.value;if(A){const _=n.value.slice(Math.max(A.$_startIndex-10,0),A.$_endIndex+10).filter(L=>L.is_under_scanned_path&&K(L.name)).map(L=>L.fullpath);cn.fetchImageTags(_)}};he(o,ue(b,150));const O=ue(()=>{u(),b()},300);return{gridItems:a,sortedFiles:n,sortMethodConv:Jn,moreActionsDropdownShow:E,gridSize:v,sortMethod:r,onScroll:O,loadNextDir:d,loadNextDirLoading:y,canLoadNext:f,itemSize:m,cellWidth:w,onViewedImagesChange:b}}function Fa(){const{currLocation:e,sortedFiles:t,currPage:n,multiSelectedIdxs:i,eventEmitter:r}=ae().toRefs(),o=()=>{i.value=[]};return me("click",o),me("blur",o),he(n,o),{onFileDragStart:(g,S)=>{const E=Kt(t.value[S]);Vt.fileDragging=!0,console.log("onFileDragStart set drag file ",g,S,E);const w=[E];let v=E.type==="dir";if(i.value.includes(S)){const s=i.value.map(a=>t.value[a]);w.push(...s),v=s.some(a=>a.type==="dir")}const l={includeDir:v,loc:e.value||"search-result",path:Pt(w,"fullpath").map(s=>s.fullpath),nodes:Pt(w,"fullpath"),__id:"FileTransferData"};g.dataTransfer.setData("text/plain",JSON.stringify(l))},onDrop:async g=>{const S=Kn(g);if(!S)return;const E=e.value;if(S.loc===E)return;const w=Be(),v=async()=>w.pushAction(async()=>{await $r(S.path,E),r.value.emit("refresh"),fe.destroyAll()}),l=()=>w.pushAction(async()=>{await sn(S.path,E),xe.emit("removeFiles",{paths:S.path,loc:S.loc}),r.value.emit("refresh"),fe.destroyAll()});fe.confirm({title:j("confirm")+"?",width:"60vw",content:()=>{let s,a,m;return h("div",null,[h("div",null,[`${j("moveSelectedFilesTo")} ${E}`,h("ol",{style:{maxHeight:"50vh",overflow:"auto"}},[S.path.map(y=>h("li",null,[y.split(/[/\\]/).pop()]))])]),h(un,null,null),h("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end"},class:"actions"},[h(se,{onClick:fe.destroyAll},Ue(s=j("cancel"))?s:{default:()=>[s]}),h(se,{type:"primary",loading:!w.isIdle,onClick:v},Ue(a=j("copy"))?a:{default:()=>[a]}),h(se,{type:"primary",loading:!w.isIdle,onClick:l},Ue(m=j("move"))?m:{default:()=>[m]})])])},maskClosable:!0,wrapClassName:"hidden-antd-btns-modal"})},multiSelectedIdxs:i,onFileDragEnd:()=>{Vt.fileDragging=!1}}}function Da(e,{openNext:t}){const n=V(!1),i=V(""),{sortedFiles:r,previewIdx:o,multiSelectedIdxs:p,stack:c,currLocation:f,spinning:g,previewing:S,stackViewEl:E,eventEmitter:w}=ae().toRefs(),v=Ie;Ke("removeFiles",({paths:y,loc:d})=>{if(v(d)!==v(f.value))return;const u=ve(c.value);u&&(u.files=u.files.filter(b=>!y.includes(b.fullpath)),u.walkFiles&&(u.walkFiles=u.walkFiles.map(b=>b.filter(O=>!y.includes(O.fullpath)))))}),Ke("addFiles",({files:y,loc:d})=>{if(v(d)!==v(f.value))return;const u=ve(c.value);u&&u.files.unshift(...y)});const l=Be(),s=async(y,d,u)=>{o.value=u,D.fullscreenPreviewInitialUrl=re(d);const b=p.value.indexOf(u);if(y.shiftKey){if(b!==-1)p.value.splice(b,1);else{p.value.push(u),p.value.sort((_,L)=>_-L);const O=p.value[0],A=p.value[p.value.length-1];p.value=an(O,A+1)}y.stopPropagation()}else y.ctrlKey||y.metaKey?(b!==-1?p.value.splice(b,1):p.value.push(u),y.stopPropagation()):await t(d)},a=async(y,d,u)=>{var L,I,B;const b=re(d),O=f.value,A=()=>{let k=[];return p.value.includes(u)?k=p.value.map(x=>r.value[x]):k.push(d),k},_=async k=>{if(!g.value)try{g.value=!0,await Zn(d.fullpath),Oe.postMessage(JSON.stringify({event:"click_hidden_button",btnEleId:"iib_hidden_img_update_trigger"}));const x=setTimeout(()=>ei.warn({message:j("long_loading"),duration:20}),5e3);await ti(),clearTimeout(x),Oe.postMessage(JSON.stringify({event:"click_hidden_button",btnEleId:`iib_hidden_tab_${k}`}))}catch(x){console.error(x),ee.error("发送图像失败,请携带console的错误消息找开发者")}finally{g.value=!1}};if(`${y.key}`.startsWith("toggle-tag-")){const k=+`${y.key}`.split("toggle-tag-")[1],{is_remove:x}=await Ei({tag_id:k,img_path:d.fullpath}),Q=(I=(L=D.conf)==null?void 0:L.all_custom_tags.find(C=>C.id===k))==null?void 0:I.name;cn.refreshTags([d.fullpath]),ee.success(j(x?"removedTagFromImage":"addedTagToImage",{tag:Q}));return}switch(y.key){case"previewInNewWindow":return window.open(b);case"download":return window.open(re(d,!0));case"copyPreviewUrl":return Me(parent.document.location.origin+b);case"send2txt2img":return _("txt2img");case"send2img2img":return _("img2img");case"send2inpaint":return _("inpaint");case"send2extras":return _("extras");case"send2savedDir":{const k=D.quickMovePaths.find(C=>C.key==="outdir_save");if(!k)return ee.error(j("unknownSavedDir"));const x=Xn(k.dir,(B=D.conf)==null?void 0:B.sd_cwd),Q=A();await sn(Q.map(C=>C.fullpath),x,!0),xe.emit("removeFiles",{paths:Q.map(C=>C.fullpath),loc:f.value}),xe.emit("addFiles",{files:Q,loc:x});break}case"send2controlnet-img2img":case"send2controlnet-txt2img":{const k=y.key.split("-")[1];Oe.postMessage(JSON.stringify({event:"send_to_control_net",type:k,url:re(d)}));break}case"send2outpaint":{i.value=await l.pushAction(()=>Ye(d.fullpath)).res;const[k,x]=(i.value||"").split(` `);Oe.postMessage(JSON.stringify({event:"send_to_outpaint",url:re(d),prompt:k,negPrompt:x.slice(17)}));break}case"openWithWalkMode":{He.set(O,c.value);const k=D.tabList[e.tabIdx],x={type:"local",key:ke(),path:d.fullpath,name:j("local"),stackKey:O,walkModePath:d.fullpath};k.panes.push(x),k.key=x.key;break}case"openInNewTab":{He.set(O,c.value);const k=D.tabList[e.tabIdx],x={type:"local",key:ke(),path:d.fullpath,name:j("local"),stackKey:O};k.panes.push(x),k.key=x.key;break}case"openOnTheRight":{He.set(O,c.value);let k=D.tabList[e.tabIdx+1];k||(k={panes:[],key:"",id:ke()},D.tabList[e.tabIdx+1]=k);const x={type:"local",key:ke(),path:d.fullpath,name:j("local"),stackKey:O};k.panes.push(x),k.key=x.key;break}case"viewGenInfo":{n.value=!0,i.value=await l.pushAction(()=>Ye(d.fullpath)).res;break}case"openWithLocalFileBrowser":{await Gn(d.fullpath);break}case"deleteFiles":{const k=A();await new Promise(x=>{fe.confirm({title:j("confirmDelete"),maskClosable:!0,width:"60vw",content:h("div",null,[h("ol",{style:{maxHeight:"50vh",overflow:"auto"}},[k.map(Q=>h("li",null,[Q.fullpath.split(/[/\\]/).pop()]))]),h(un,null,null)]),async onOk(){const Q=k.map(C=>C.fullpath);await xr(Q),ee.success(j("deleteSuccess")),xe.emit("removeFiles",{paths:Q,loc:f.value}),x()}})});break}}return{}},{isOutside:m}=Yn(E);return me("keydown",y=>{var u,b,O;const d=bi(y);if(S.value){const A=(u=Object.entries(D.shortcut).find(_=>_[1]===d&&_[1]))==null?void 0:u[0];if(A){y.stopPropagation(),y.preventDefault();const _=o.value,L=r.value[_];switch(A){case"delete":return re(L)===D.fullscreenPreviewInitialUrl?ee.warn(j("fullscreenRestriction")):a({key:"deleteFiles"},L,_);default:{const I=(b=/^toggle_tag_(.*)$/.exec(A))==null?void 0:b[1],B=(O=D.conf)==null?void 0:O.all_custom_tags.find(k=>k.name===I);return B?a({key:`toggle-tag-${B.id}`},L,_):void 0}}}}else!m.value&&["Ctrl + KeyA","Cmd + KeyA"].includes(d)&&(y.preventDefault(),y.stopPropagation(),w.value.emit("selectAll"))}),{onFileItemClick:s,onContextMenuClick:a,showGenInfo:n,imageGenInfo:i,q:l}}const Qa=()=>{const{stackViewEl:e}=ae().toRefs(),t=V(-1);return qn(e,n=>{var r;let i=n.target;for(;i.parentElement;)if(i=i.parentElement,i.tagName.toLowerCase()==="li"&&i.classList.contains("file-item-trigger")){const o=(r=i.dataset)==null?void 0:r.idx;o&&Number.isSafeInteger(+o)&&(t.value=+o);return}}),{showMenuIdx:t}};function zr(){var e=window.navigator.userAgent,t=e.indexOf("MSIE ");if(t>0)return parseInt(e.substring(t+5,e.indexOf(".",t)),10);var n=e.indexOf("Trident/");if(n>0){var i=e.indexOf("rv:");return parseInt(e.substring(i+3,e.indexOf(".",i)),10)}var r=e.indexOf("Edge/");return r>0?parseInt(e.substring(r+5,e.indexOf(".",r)),10):-1}let $e;function Ge(){Ge.init||(Ge.init=!0,$e=zr()!==-1)}var De={name:"ResizeObserver",props:{emitOnMount:{type:Boolean,default:!1},ignoreWidth:{type:Boolean,default:!1},ignoreHeight:{type:Boolean,default:!1}},emits:["notify"],mounted(){Ge(),rt(()=>{this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitOnMount&&this.emitSize()});const e=document.createElement("object");this._resizeObject=e,e.setAttribute("aria-hidden","true"),e.setAttribute("tabindex",-1),e.onload=this.addResizeHandlers,e.type="text/html",$e&&this.$el.appendChild(e),e.data="about:blank",$e||this.$el.appendChild(e)},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&&(!$e&&this._resizeObject.contentDocument&&this._resizeObject.contentDocument.defaultView.removeEventListener("resize",this.compareAndNotify),this.$el.removeChild(this._resizeObject),this._resizeObject.onload=null,this._resizeObject=null)}}};const Br=ri();ni("data-v-b329ee4c");const Fr={class:"resize-observer",tabindex:"-1"};ii();const Dr=Br((e,t,n,i,r,o)=>(M(),J("div",Fr)));De.render=Dr;De.__scopeId="data-v-b329ee4c";De.__file="src/components/ResizeObserver.vue";function Le(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Le=function(t){return typeof t}:Le=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Le(e)}function Qr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ut(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,i=new Array(t);n2&&arguments[2]!==void 0?arguments[2]:{},i,r,o,p=function(f){for(var g=arguments.length,S=new Array(g>1?g-1:0),E=1;E1){var g=c.find(function(E){return E.isIntersecting});g&&(f=g)}if(r.callback){var S=f.isIntersecting&&f.intersectionRatio>=r.threshold;if(S===r.oldResult)return;r.oldResult=S,r.callback(S,f)}},this.options.intersection),rt(function(){r.observer&&r.observer.observe(r.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}}]),e}();function fn(e,t,n){var i=t.value;if(i)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 r=new Yr(e,i,n);e._vue_visibilityState=r}}function qr(e,t,n){var i=t.value,r=t.oldValue;if(!dn(i,r)){var o=e._vue_visibilityState;if(!i){vn(e);return}o?o.createObserver(i,n):fn(e,{value:i},n)}}function vn(e){var t=e._vue_visibilityState;t&&(t.destroyObserver(),delete e._vue_visibilityState)}var Kr={beforeMount:fn,updated:qr,unmounted:vn},Gr={itemsLimit:1e3},Xr=/(auto|scroll)/;function pn(e,t){return e.parentNode===null?t:pn(e.parentNode,t.concat([e]))}var We=function(t,n){return getComputedStyle(t,null).getPropertyValue(n)},Zr=function(t){return We(t,"overflow")+We(t,"overflow-y")+We(t,"overflow-x")},ea=function(t){return Xr.test(Zr(t))};function Wt(e){if(e instanceof HTMLElement||e instanceof SVGElement){for(var t=pn(e.parentNode,[]),n=0;n{this.$_prerender=!1,this.updateVisibleItems(!0),this.ready=!0})},activated(){const e=this.$_lastUpdateScrollPosition;typeof e=="number"&&this.$nextTick(()=>{this.scrollToPosition(e)})},beforeUnmount(){this.removeListeners()},methods:{addView(e,t,n,i,r){const o=ai({id:ra++,index:t,used:!0,key:i,type:r}),p=li({item:n,position:0,nr:o});return e.push(p),p},unuseView(e,t=!1){const n=this.$_unusedViews,i=e.nr.type;let r=n.get(i);r||(r=[],n.set(i,r)),r.push(e),t||(e.nr.used=!1,e.position=-9999)},handleResize(){this.$emit("resize"),this.ready&&this.updateVisibleItems(!1)},handleScroll(e){if(!this.$_scrollDirty){if(this.$_scrollDirty=!0,this.$_updateTimeout)return;const t=()=>requestAnimationFrame(()=>{this.$_scrollDirty=!1;const{continuous:n}=this.updateVisibleItems(!1,!0);n||(clearTimeout(this.$_refreshTimout),this.$_refreshTimout=setTimeout(this.handleScroll,this.updateInterval+100))});t(),this.updateInterval&&(this.$_updateTimeout=setTimeout(()=>{this.$_updateTimeout=0,this.$_scrollDirty&&t()},this.updateInterval))}},handleVisibilityChange(e,t){this.ready&&(e||t.boundingClientRect.width!==0||t.boundingClientRect.height!==0?(this.$emit("visible"),requestAnimationFrame(()=>{this.updateVisibleItems(!1)})):this.$emit("hidden"))},updateVisibleItems(e,t=!1){const n=this.itemSize,i=this.gridItems||1,r=this.itemSecondarySize||n,o=this.$_computedMinItemSize,p=this.typeField,c=this.simpleArray?null:this.keyField,f=this.items,g=f.length,S=this.sizes,E=this.$_views,w=this.$_unusedViews,v=this.pool,l=this.itemIndexByKey;let s,a,m,y,d;if(!g)s=a=y=d=m=0;else if(this.$_prerender)s=y=0,a=d=Math.min(this.prerender,f.length),m=null;else{const I=this.getScroll();if(t){let x=I.start-this.$_lastUpdateScrollPosition;if(x<0&&(x=-x),n===null&&xI.start&&(C=$),$=~~((Q+C)/2);while($!==F);for($<0&&($=0),s=$,m=S[g-1].accumulator,a=$;ag&&(a=g)),y=s;yg&&(a=g),y<0&&(y=0),d>g&&(d=g),m=Math.ceil(g/i)*n}}a-s>Gr.itemsLimit&&this.itemsLimitError(),this.totalSize=m;let u;const b=s<=this.$_endIndex&&a>=this.$_startIndex;if(b)for(let I=0,B=v.length;I=a)&&this.unuseView(u));const O=b?null:new Map;let A,_,L;for(let I=s;I=k.length)&&(u=this.addView(v,I,A,B,_),this.unuseView(u,!0),k=w.get(_)),u=k[L],O.set(_,L+1)),E.delete(u.nr.key),u.nr.used=!0,u.nr.index=I,u.nr.key=B,u.nr.type=_,E.set(B,u),x=!0;else if(!u.nr.used&&(u.nr.used=!0,u.nr.index=I,x=!0,k)){const Q=k.indexOf(u);Q!==-1&&k.splice(Q,1)}u.item=A,x&&(I===f.length-1&&this.$emit("scroll-end"),I===0&&this.$emit("scroll-start")),n===null?(u.position=S[I-1].accumulator,u.offset=0):(u.position=Math.floor(I/i)*n,u.offset=I%i*r)}return this.$_startIndex=s,this.$_endIndex=a,this.emitUpdate&&this.$emit("update",s,a,y,d),clearTimeout(this.$_sortTimer),this.$_sortTimer=setTimeout(this.sortViews,this.updateInterval+300),{continuous:b}},getListenerTarget(){let e=Wt(this.$el);return window.document&&(e===window.document.documentElement||e===window.document.body)&&(e=window),e},getScroll(){const{$el:e,direction:t}=this,n=t==="vertical";let i;if(this.pageMode){const r=e.getBoundingClientRect(),o=n?r.height:r.width;let p=-(n?r.top:r.left),c=n?window.innerHeight:window.innerWidth;p<0&&(c+=p,p=0),p+c>o&&(c=o-p),i={start:p,end:p+c}}else n?i={start:e.scrollTop,end:e.scrollTop+e.clientHeight}:i={start:e.scrollLeft,end:e.scrollLeft+e.clientWidth};return i},applyPageMode(){this.pageMode?this.addListeners():this.removeListeners()},addListeners(){this.listenerTarget=this.getListenerTarget(),this.listenerTarget.addEventListener("scroll",this.handleScroll,et?{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(e){let t;const n=this.gridItems||1;this.itemSize===null?t=e>0?this.sizes[e-1].accumulator:0:t=Math.floor(e/n)*this.itemSize,this.scrollToPosition(t)},scrollToPosition(e){const t=this.direction==="vertical"?{scroll:"scrollTop",start:"top"}:{scroll:"scrollLeft",start:"left"};let n,i,r;if(this.pageMode){const o=Wt(this.$el),p=o.tagName==="HTML"?0:o[t.scroll],c=o.getBoundingClientRect(),g=this.$el.getBoundingClientRect()[t.start]-c[t.start];n=o,i=t.scroll,r=e+p+g}else n=this.$el,i=t.scroll,r=e;n[i]=r},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((e,t)=>e.nr.index-t.nr.index)}}};const aa={key:0,ref:"before",class:"vue-recycle-scroller__slot"},la={key:1,ref:"after",class:"vue-recycle-scroller__slot"};function sa(e,t,n,i,r,o){const p=si("ResizeObserver"),c=oi("observe-visibility");return ui((M(),U("div",{class:Ae(["vue-recycle-scroller",{ready:r.ready,"page-mode":n.pageMode,[`direction-${e.direction}`]:!0}]),onScrollPassive:t[0]||(t[0]=(...f)=>o.handleScroll&&o.handleScroll(...f))},[e.$slots.before?(M(),U("div",aa,[Ce(e.$slots,"before")],512)):q("v-if",!0),(M(),J(xt(n.listTag),{ref:"wrapper",style:fi({[e.direction==="vertical"?"minHeight":"minWidth"]:r.totalSize+"px"}),class:Ae(["vue-recycle-scroller__item-wrapper",n.listClass])},{default:P(()=>[(M(!0),U(te,null,Se(r.pool,f=>(M(),J(xt(n.itemTag),ci({key:f.nr.id,style:r.ready?{transform:`translate${e.direction==="vertical"?"Y":"X"}(${f.position}px) translate${e.direction==="vertical"?"X":"Y"}(${f.offset}px)`,width:n.gridItems?`${e.direction==="vertical"&&n.itemSecondarySize||n.itemSize}px`:void 0,height:n.gridItems?`${e.direction==="horizontal"&&n.itemSecondarySize||n.itemSize}px`:void 0}:null,class:["vue-recycle-scroller__item-view",[n.itemClass,{hover:!n.skipHover&&r.hoverKey===f.nr.key}]]},di(n.skipHover?{}:{mouseenter:()=>{r.hoverKey=f.nr.key},mouseleave:()=>{r.hoverKey=null}})),{default:P(()=>[Ce(e.$slots,"default",{item:f.item,index:f.nr.index,active:f.nr.used})]),_:2},1040,["style","class"]))),128)),Ce(e.$slots,"empty")]),_:3},8,["style","class"])),e.$slots.after?(M(),U("div",la,[Ce(e.$slots,"after")],512)):q("v-if",!0),h(p,{onNotify:o.handleResize},null,8,["onNotify"])],34)),[[c,o.handleVisibilityChange]])}hn.render=sa;hn.__file="src/components/RecycleScroller.vue";const tt=le({__name:"ContextMenu",props:{file:{},idx:{},selectedTag:{},disableDelete:{type:Boolean}},emits:["contextMenuClick"],setup(e,{emit:t}){const n=e,i=Fe(),r=H(()=>{var o;return(((o=i.conf)==null?void 0:o.all_custom_tags)??[]).reduce((p,c)=>[...p,{...c,selected:!!n.selectedTag.find(f=>f.id===c.id)}],[])});return(o,p)=>{const c=Gt,f=vi,g=Xt,S=Zt;return M(),J(S,{onClick:p[0]||(p[0]=E=>t("contextMenuClick",E,o.file,o.idx))},{default:P(()=>{var E;return[h(c,{key:"deleteFiles",disabled:o.disableDelete},{default:P(()=>[N(T(o.$t("deleteSelected")),1)]),_:1},8,["disabled"]),o.file.type==="dir"?(M(),U(te,{key:0},[h(c,{key:"openInNewTab"},{default:P(()=>[N(T(o.$t("openInNewTab")),1)]),_:1}),h(c,{key:"openOnTheRight"},{default:P(()=>[N(T(o.$t("openOnTheRight")),1)]),_:1}),h(c,{key:"openWithWalkMode"},{default:P(()=>[N(T(o.$t("openWithWalkMode")),1)]),_:1})],64)):q("",!0),o.file.type==="file"?(M(),U(te,{key:1},[z(K)(o.file.name)?(M(),U(te,{key:0},[h(c,{key:"viewGenInfo"},{default:P(()=>[N(T(o.$t("viewGenerationInfo")),1)]),_:1}),h(f),((E=z(i).conf)==null?void 0:E.launch_mode)!=="server"?(M(),U(te,{key:0},[h(c,{key:"send2txt2img"},{default:P(()=>[N(T(o.$t("sendToTxt2img")),1)]),_:1}),h(c,{key:"send2img2img"},{default:P(()=>[N(T(o.$t("sendToImg2img")),1)]),_:1}),h(c,{key:"send2inpaint"},{default:P(()=>[N(T(o.$t("sendToInpaint")),1)]),_:1}),h(c,{key:"send2extras"},{default:P(()=>[N(T(o.$t("sendToExtraFeatures")),1)]),_:1}),h(g,{key:"sendToThirdPartyExtension",title:o.$t("sendToThirdPartyExtension")},{default:P(()=>[h(c,{key:"send2controlnet-txt2img"},{default:P(()=>[N("ControlNet - "+T(o.$t("t2i")),1)]),_:1}),h(c,{key:"send2controlnet-img2img"},{default:P(()=>[N("ControlNet - "+T(o.$t("i2i")),1)]),_:1}),h(c,{key:"send2outpaint"},{default:P(()=>[N("Outpaint")]),_:1})]),_:1},8,["title"])],64)):q("",!0),h(c,{key:"send2savedDir"},{default:P(()=>[N(T(o.$t("send2savedDir")),1)]),_:1}),h(f),h(g,{key:"toggle-tag",title:o.$t("toggleTag")},{default:P(()=>[(M(!0),U(te,null,Se(r.value,w=>(M(),J(c,{key:`toggle-tag-${w.id}`},{default:P(()=>[N(T(w.name)+" ",1),w.selected?(M(),J(z(rn),{key:0})):(M(),J(z(ln),{key:1}))]),_:2},1024))),128))]),_:1},8,["title"]),h(c,{key:"openWithLocalFileBrowser"},{default:P(()=>[N(T(o.$t("openWithLocalFileBrowser")),1)]),_:1})],64)):q("",!0),h(c,{key:"previewInNewWindow"},{default:P(()=>[N(T(o.$t("previewInNewWindow")),1)]),_:1}),h(c,{key:"download"},{default:P(()=>[N(T(o.$t("download")),1)]),_:1}),h(c,{key:"copyPreviewUrl"},{default:P(()=>[N(T(o.$t("copySourceFilePreviewLink")),1)]),_:1})],64)):q("",!0)]}),_:1})}}}),oa=["data-idx"],ua={class:"more"},ca={key:0,class:"tags-container"},da={key:1,class:"preview-icon-wrap"},fa={key:2,class:"profile"},va={class:"name line-clamp-1"},pa={class:"basic-info"},ha=le({__name:"FileItem",props:{file:{},idx:{},selected:{type:Boolean,default:!1},showMenuIdx:{},cellWidth:{},fullScreenPreviewImageUrl:{}},emits:["update:showMenuIdx","fileItemClick","dragstart","dragend","previewVisibleChange","contextMenuClick"],setup(e,{emit:t}){const n=e;pi(c=>({"6fc250a6":c.$props.cellWidth+"px"}));const i=Fe(),r=yt(),o=H(()=>r.tagMap.get(n.file.fullpath)??[]),p=H(()=>{const c=i.gridThumbnailResolution;return i.enableThumbnail?hi(n.file,[c,c].join("x")):re(n.file)});return(c,f)=>{const g=oe,S=mi,E=Li;return M(),J(g,{trigger:["contextmenu"],visible:z(i).longPressOpenContextMenu?typeof c.idx=="number"&&c.showMenuIdx===c.idx:void 0,"onUpdate:visible":f[5]||(f[5]=w=>typeof c.idx=="number"&&t("update:showMenuIdx",w?c.idx:-1))},{overlay:P(()=>[h(tt,{file:c.file,idx:c.idx,"selected-tag":o.value,onContextMenuClick:f[4]||(f[4]=(w,v,l)=>t("contextMenuClick",w,v,l))},null,8,["file","idx","selected-tag"])]),default:P(()=>[(M(),U("li",{class:Ae(["file file-item-trigger grid",{clickable:c.file.type==="dir",selected:c.selected}]),"data-idx":c.idx,key:c.file.name,draggable:"true",onDragstart:f[1]||(f[1]=w=>t("dragstart",w,c.idx)),onDragend:f[2]||(f[2]=w=>t("dragend",w,c.idx)),onClickCapture:f[3]||(f[3]=w=>t("fileItemClick",w,c.file,c.idx))},[G("div",null,[h(g,null,{overlay:P(()=>[h(tt,{file:c.file,idx:c.idx,"selected-tag":o.value,onContextMenuClick:f[0]||(f[0]=(w,v,l)=>t("contextMenuClick",w,v,l))},null,8,["file","idx","selected-tag"])]),default:P(()=>[G("div",ua,[h(z(it))])]),_:1}),z(K)(c.file.name)?(M(),U("div",{style:{position:"relative"},key:c.file.fullpath,class:Ae(`idx-${c.idx}`)},[h(S,{src:p.value,fallback:z(Zi),preview:{src:c.fullScreenPreviewImageUrl,onVisibleChange:(w,v)=>t("previewVisibleChange",w,v)}},null,8,["src","fallback","preview"]),o.value&&c.cellWidth>128?(M(),U("div",ca,[(M(!0),U(te,null,Se(o.value,w=>(M(),J(E,{key:w.id,color:z(r).getColor(w.name)},{default:P(()=>[N(T(w.name),1)]),_:2},1032,["color"]))),128))])):q("",!0)],2)):(M(),U("div",da,[c.file.type==="file"?(M(),J(z(Vi),{key:0,class:"icon center"})):(M(),J(z(Ri),{key:1,class:"icon center"}))])),c.cellWidth>128?(M(),U("div",fa,[G("div",va,T(c.file.name),1),G("div",pa,[G("div",null,T(c.file.size),1),G("div",null,T(c.file.date),1)])])):q("",!0)])],42,oa))]),_:1},8,["visible"])}}});const ja=en(ha,[["__scopeId","data-v-8d65ebcc"]]);function ma(e,t,n,i){const r={x:0,y:0};let o=0,p=0,c=typeof(i==null?void 0:i.width)=="number"?i.width:0,f=typeof(i==null?void 0:i.height)=="number"?i.height:0,g=typeof(i==null?void 0:i.left)=="number"?i.left:0,S=typeof(i==null?void 0:i.top)=="number"?i.top:0,E=!1;const w=d=>{d.stopPropagation(),d.preventDefault(),!(!e.value||!t.value)&&(o=d instanceof MouseEvent?d.clientX:d.touches[0].clientX,p=d instanceof MouseEvent?d.clientY:d.touches[0].clientY,c=e.value.offsetWidth,f=e.value.offsetHeight,r.x=t.value.offsetLeft,r.y=t.value.offsetTop,document.documentElement.addEventListener("mousemove",v),document.documentElement.addEventListener("touchmove",v),document.documentElement.addEventListener("mouseup",l),document.documentElement.addEventListener("touchend",l))},v=d=>{if(!e.value||!t.value)return;let u=c+((d instanceof MouseEvent?d.clientX:d.touches[0].clientX)-o),b=f+((d instanceof MouseEvent?d.clientY:d.touches[0].clientY)-p),O=r.x+((d instanceof MouseEvent?d.clientX:d.touches[0].clientX)-o),A=r.y+((d instanceof MouseEvent?d.clientY:d.touches[0].clientY)-p);O+t.value.offsetWidth>window.innerWidth&&(O=window.innerWidth-t.value.offsetWidth),e.value.offsetLeft+u>window.innerWidth&&(u=window.innerWidth-e.value.offsetLeft),A+t.value.offsetHeight>window.innerHeight&&(A=window.innerHeight-t.value.offsetHeight),e.value.offsetTop+b>window.innerHeight&&(b=window.innerHeight-e.value.offsetTop),e.value.style.width=`${u}px`,e.value.style.height=`${b}px`,t.value.style.left=`${O}px`,t.value.style.top=`${A}px`,i!=null&&i.onResize&&i.onResize(u,b)},l=()=>{document.documentElement.removeEventListener("mousemove",v),document.documentElement.removeEventListener("touchmove",v),document.documentElement.removeEventListener("mouseup",l),document.documentElement.removeEventListener("touchend",l)},s=d=>{d.stopPropagation(),d.preventDefault(),!(!e.value||!n.value)&&(E=!0,g=e.value.offsetLeft,S=e.value.offsetTop,o=d instanceof MouseEvent?d.clientX:d.touches[0].clientX,p=d instanceof MouseEvent?d.clientY:d.touches[0].clientY,document.documentElement.addEventListener("mousemove",a),document.documentElement.addEventListener("touchmove",a),document.documentElement.addEventListener("mouseup",m),document.documentElement.addEventListener("touchend",m))},a=d=>{if(!e.value||!n.value||!E)return;const u=g+((d instanceof MouseEvent?d.clientX:d.touches[0].clientX)-o),b=S+((d instanceof MouseEvent?d.clientY:d.touches[0].clientY)-p);u<0?e.value.style.left="0px":u+e.value.offsetWidth>window.innerWidth?e.value.style.left=`${window.innerWidth-e.value.offsetWidth}px`:e.value.style.left=`${u}px`,b<0?e.value.style.top="0px":b+e.value.offsetHeight>window.innerHeight?e.value.style.top=`${window.innerHeight-e.value.offsetHeight}px`:e.value.style.top=`${b}px`,i!=null&&i.onDrag&&i.onDrag(u,b)},m=()=>{E=!1,document.documentElement.removeEventListener("mousemove",a),document.documentElement.removeEventListener("touchmove",a),document.documentElement.removeEventListener("mouseup",m),document.documentElement.removeEventListener("touchend",m)},y=()=>{if(!e.value||!t.value)return;let d=e.value.offsetLeft,u=e.value.offsetTop,b=e.value.offsetWidth,O=e.value.offsetHeight;d+b>window.innerWidth&&(d=window.innerWidth-b,d<0&&(d=0,b=window.innerWidth)),u+O>window.innerHeight&&(u=window.innerHeight-O,u<0&&(u=0,O=window.innerHeight)),e.value.style.left=`${d}px`,e.value.style.top=`${u}px`,e.value.style.width=`${b}px`,e.value.style.height=`${O}px`};return qt(()=>{!e.value||!i||(typeof i.width=="number"&&(e.value.style.width=`${i.width}px`),typeof i.height=="number"&&(e.value.style.height=`${i.height}px`),typeof i.left=="number"&&(e.value.style.left=`${i.left}px`),typeof i.top=="number"&&(e.value.style.top=`${i.top}px`),y(),window.addEventListener("resize",y))}),at(()=>{document.documentElement.removeEventListener("mousemove",v),document.documentElement.removeEventListener("touchmove",v),document.documentElement.removeEventListener("mouseup",l),document.documentElement.removeEventListener("touchend",l),document.documentElement.removeEventListener("mousemove",a),document.documentElement.removeEventListener("touchmove",a),document.documentElement.removeEventListener("mouseup",m),document.documentElement.removeEventListener("touchend",m),window.removeEventListener("resize",y)}),he(()=>[e.value,t.value,n.value],([d,u,b])=>{d&&u&&(u.addEventListener("mousedown",w),u.addEventListener("touchstart",w)),d&&b&&(b.addEventListener("mousedown",s),b.addEventListener("touchstart",s))}),{handleResizeMouseDown:w,handleDragMouseDown:s}}const ga={class:"container"},ya={class:"action-bar"},ba={key:0,class:"icon",style:{cursor:"pointer"}},wa={key:0,"flex-placeholder":""},Sa={key:1,class:"action-bar"},Aa={key:0,class:"gen-info"},Ea={class:"tags"},ka={class:"name"},Ca={class:"value"},_a=le({__name:"fullScreenContextMenu",props:{file:{},idx:{}},emits:["contextMenuClick"],setup(e,{emit:t}){const n=e,i=Fe(),r=yt(),o=V(),p=H(()=>r.tagMap.get(n.file.fullpath)??[]),c=H(()=>{var a;return(((a=i.conf)==null?void 0:a.all_custom_tags)??[]).reduce((m,y)=>[...m,{...y,selected:!!p.value.find(d=>d.id===y.id)}],[])}),f=V(""),g=Be(),S=V("");he(()=>{var a;return(a=n==null?void 0:n.file)==null?void 0:a.fullpath},async a=>{a&&(g.tasks.forEach(m=>m.cancel()),g.pushAction(()=>Ye(a)).res.then(m=>{S.value=m}))},{immediate:!0});const E=V(),w=V(),v=gi("fullScreenContextMenu.vue-drag",{left:100,top:100,width:512,height:384,expanded:!0});ma(o,E,w,{...v.value,onDrag:ue(function(a,m){v.value={...v.value,left:a,top:m}},300),onResize:ue(function(a,m){v.value={...v.value,width:a,height:m}},300)});function l(a){return a.parentNode}me("load",a=>{const m=a.target;m.className==="ant-image-preview-img"&&(f.value=`${m.naturalWidth} x ${m.naturalHeight}`)},{capture:!0});const s=H(()=>{const a=[{name:j("fileName"),val:n.file.name},{name:j("fileSize"),val:n.file.size}];return f.value&&a.push({name:j("resolution"),val:f.value}),a});return(a,m)=>{const y=oe,d=se,u=Gt,b=Zt,O=Xt;return M(),U("div",{ref_key:"el",ref:o,class:Ae(["full-screen-menu",{"unset-size":!z(v).expanded}]),onWheelCapture:m[5]||(m[5]=yi(()=>{},["stop"]))},[G("div",ga,[G("div",ya,[G("div",{ref_key:"dragHandle",ref:w,class:"icon",style:{cursor:"grab"}},[h(z(fr))],512),G("div",{class:"icon",style:{cursor:"pointer"},onClick:m[0]||(m[0]=A=>z(v).expanded=!z(v).expanded)},[z(v).expanded?(M(),J(z(mr),{key:0})):(M(),J(z(wr),{key:1}))]),h(y,{"get-popup-container":l},{overlay:P(()=>[h(tt,{file:a.file,idx:a.idx,"selected-tag":p.value,"disable-delete":z(re)(a.file)===z(i).fullscreenPreviewInitialUrl,onContextMenuClick:m[1]||(m[1]=(A,_,L)=>t("contextMenuClick",A,_,L))},null,8,["file","idx","selected-tag","disable-delete"])]),default:P(()=>[z(v).expanded?q("",!0):(M(),U("div",ba,[h(z(it))]))]),_:1}),z(v).expanded?(M(),U("div",wa)):q("",!0),z(v).expanded?(M(),U("div",Sa,[h(y,{trigger:["hover"],"get-popup-container":l},{overlay:P(()=>[h(b,{onClick:m[2]||(m[2]=A=>t("contextMenuClick",A,a.file,a.idx))},{default:P(()=>[(M(!0),U(te,null,Se(c.value,A=>(M(),J(u,{key:`toggle-tag-${A.id}`},{default:P(()=>[N(T(A.name)+" ",1),A.selected?(M(),J(z(rn),{key:0})):(M(),J(z(ln),{key:1}))]),_:2},1024))),128))]),_:1})]),default:P(()=>[h(d,null,{default:P(()=>[N(T(a.$t("toggleTag")),1)]),_:1})]),_:1}),h(y,{trigger:["hover"],"get-popup-container":l},{overlay:P(()=>[h(b,{onClick:m[3]||(m[3]=A=>t("contextMenuClick",A,a.file,a.idx))},{default:P(()=>{var A;return[((A=z(i).conf)==null?void 0:A.launch_mode)!=="server"?(M(),U(te,{key:0},[h(u,{key:"send2txt2img"},{default:P(()=>[N(T(a.$t("sendToTxt2img")),1)]),_:1}),h(u,{key:"send2img2img"},{default:P(()=>[N(T(a.$t("sendToImg2img")),1)]),_:1}),h(u,{key:"send2inpaint"},{default:P(()=>[N(T(a.$t("sendToInpaint")),1)]),_:1}),h(u,{key:"send2extras"},{default:P(()=>[N(T(a.$t("sendToExtraFeatures")),1)]),_:1}),h(O,{key:"sendToThirdPartyExtension",title:a.$t("sendToThirdPartyExtension")},{default:P(()=>[h(u,{key:"send2controlnet-txt2img"},{default:P(()=>[N("ControlNet - "+T(a.$t("t2i")),1)]),_:1}),h(u,{key:"send2controlnet-img2img"},{default:P(()=>[N("ControlNet - "+T(a.$t("i2i")),1)]),_:1}),h(u,{key:"send2outpaint"},{default:P(()=>[N("Outpaint")]),_:1})]),_:1},8,["title"])],64)):q("",!0),h(u,{key:"send2savedDir"},{default:P(()=>[N(T(a.$t("send2savedDir")),1)]),_:1}),h(u,{key:"deleteFiles",disabled:z(re)(a.file)===z(i).fullscreenPreviewInitialUrl},{default:P(()=>[N(T(a.$t("deleteSelected")),1)]),_:1},8,["disabled"]),h(u,{key:"previewInNewWindow"},{default:P(()=>[N(T(a.$t("previewInNewWindow")),1)]),_:1}),h(u,{key:"download"},{default:P(()=>[N(T(a.$t("download")),1)]),_:1}),h(u,{key:"copyPreviewUrl"},{default:P(()=>[N(T(a.$t("copySourceFilePreviewLink")),1)]),_:1})]}),_:1})]),default:P(()=>[h(d,null,{default:P(()=>[N(T(z(j)("openContextMenu")),1)]),_:1})]),_:1}),h(d,{onClick:m[4]||(m[4]=A=>z(Me)(S.value))},{default:P(()=>[N(T(a.$t("copyPrompt")),1)]),_:1})])):q("",!0)]),z(v).expanded?(M(),U("div",Aa,[G("div",Ea,[(M(!0),U(te,null,Se(s.value,A=>(M(),U("span",{class:"tag",key:A.name},[G("span",ka,T(A.name),1),G("span",Ca,T(A.val),1)]))),128))]),N(" "+T(S.value),1)])):q("",!0)]),z(v).expanded?(M(),U("div",{key:0,class:"mouse-sensor",ref_key:"resizeHandle",ref:E},[h(z(rr))],512)):q("",!0)],34)}}});const Va=en(_a,[["__scopeId","data-v-08accd51"]]);export{oe as D,Ma as L,Ta as R,La as S,za as a,Ba as b,Fa as c,Da as d,Na as e,Qa as f,He as g,hn as h,ja as i,Va as j,yt as k,Ke as l,$a as s,ae as u};