import{P as Ne,br as dr,a as $,d as se,b6 as wt,u as Xe,c as m,bs as fr,_ as St,U as Ze,a7 as fe,Y as M,bc as Jt,ae as Wt,ac as Ct,h as G,bt as vr,b as Ke,ad as mr,bu as pr,av as Yt,bb as _n,r as z,b3 as Te,ai as Qe,a9 as Zt,ap as gr,an as Mn,bv as zn,aa as Me,y as ae,aI as hr,bw as yr,s as de,bx as br,by as Pe,bz as Dn,e as ct,bA as wr,ab as qt,bB as Sr,W as Z,bm as Cr,bC as Ar,bD as Xt,aA as Er,bE as Or,bF as Pr,aj as At,b4 as ke,bG as xr,bH as Kt,bI as Ir,bJ as kr,aw as $r,bK as Lr,bL as _r,bM as Mr,a5 as Et,bN as zr,$ as dt,bO as Dr,X as B,bP as Ot,bQ as Nr,x as Pt,bR as Nn,bo as ie,am as Be,bS as ve,bT as Tr,bU as xt,bV as en,aJ as Tn,bj as tn,bk as Br,bW as ft,bX as Fr,bi as It,bY as Qr,bZ as re,B as kt,b_ as jr,v as Bn,K as Rr,b$ as Fn,a0 as Vr,Z as at,c0 as Ur,c1 as Hr,c2 as Gr,c3 as Jr,c4 as Wr,c5 as Yr,a1 as Qn,a2 as jn,o as N,z as W,c6 as Zr,c7 as qr,c8 as Xr,c9 as Kr,ca as ei,bd as ti,l as Y,cb as Ue,J as pe,m as _,E as $t,cc as nn,cd as ni,ce as ri,cf as ii,N as Fe,C as j,t as D,n as T,q,T as Rn,cg as ai,ch as li,M as Vn,V as Un,ci as oi,A as si}from"./index-92fc9ec5.js";import{t as lt,l as Ie}from"./index-5036710d.js";import{e as ui,f as ci,t as rn,h as Hn}from"./db-fbc584f0.js";import{b as di}from"./_baseIteratee-09571030.js";var Gn=function(){return{arrow:{type:[Boolean,Object],default:void 0},trigger:{type:[Array,String]},overlay:Ne.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}}},ot=dr(),fi=function(){return $($({},Gn()),{},{type:ot.type,size:String,htmlType:ot.htmlType,href:String,disabled:{type:Boolean,default:void 0},prefixCls:String,icon:Ne.any,title:String,loading:ot.loading,onClick:{type:Function}})},vi=["type","disabled","loading","htmlType","class","overlay","trigger","align","visible","onVisibleChange","placement","href","title","icon","mouseEnterDelay","mouseLeaveDelay","overlayClassName","overlayStyle","destroyPopupOnHide","onClick","onUpdate:visible"],mi=Ze.Group;const qe=se({compatConfig:{MODE:3},name:"ADropdownButton",inheritAttrs:!1,__ANT_BUTTON:!0,props:wt(fi(),{trigger:"hover",placement:"bottomRight",type:"default"}),slots:["icon","leftButton","rightButton","overlay"],setup:function(e,n){var r=n.slots,i=n.attrs,u=n.emit,c=function(C){u("update:visible",C),u("visibleChange",C)},S=Xe("dropdown-button",e),p=S.prefixCls,v=S.direction,A=S.getPopupContainer;return function(){var O,C,b=$($({},e),i),l=b.type,a=l===void 0?"default":l,o=b.disabled,s=b.loading,f=b.htmlType,P=b.class,d=P===void 0?"":P,x=b.overlay,w=x===void 0?(O=r.overlay)===null||O===void 0?void 0:O.call(r):x,g=b.trigger,h=b.align,E=b.visible;b.onVisibleChange;var y=b.placement,I=y===void 0?v.value==="rtl"?"bottomLeft":"bottomRight":y,k=b.href,L=b.title,Q=b.icon,X=Q===void 0?((C=r.icon)===null||C===void 0?void 0:C.call(r))||m(fr,null,null):Q,R=b.mouseEnterDelay,le=b.mouseLeaveDelay,ue=b.overlayClassName,ce=b.overlayStyle,he=b.destroyPopupOnHide,V=b.onClick;b["onUpdate:visible"];var J=St(b,vi),K={align:h,disabled:o,trigger:o?[]:g,placement:I,getPopupContainer:A.value,onVisibleChange:c,mouseEnterDelay:R,mouseLeaveDelay:le,visible:E,overlayClassName:ue,overlayStyle:ce,destroyPopupOnHide:he},ee=m(Ze,{type:a,disabled:o,loading:s,onClick:V,htmlType:f,href:k,title:L},{default:r.default}),te=m(Ze,{type:a,icon:X},null);return m(mi,$($({},J),{},{class:fe(p.value,d)}),{default:function(){return[r.leftButton?r.leftButton({button:ee}):ee,m(Ce,K,{default:function(){return[r.rightButton?r.rightButton({button:te}):te]},overlay:function(){return w}})]}})}}});var Jn=se({compatConfig:{MODE:3},name:"ADropdown",inheritAttrs:!1,props:wt(Gn(),{mouseEnterDelay:.15,mouseLeaveDelay:.1,placement:"bottomLeft",trigger:"hover"}),slots:["overlay"],setup:function(e,n){var r=n.slots,i=n.attrs,u=n.emit,c=Xe("dropdown",e),S=c.prefixCls,p=c.rootPrefixCls,v=c.direction,A=c.getPopupContainer,O=M(function(){var a=e.placement,o=a===void 0?"":a,s=e.transitionName;return s!==void 0?s:o.indexOf("top")>=0?"".concat(p.value,"-slide-down"):"".concat(p.value,"-slide-up")}),C=function(){var o,s,f,P=e.overlay||((o=r.overlay)===null||o===void 0?void 0:o.call(r)),d=Array.isArray(P)?P[0]:P;if(!d)return null;var x=d.props||{};Jt(!x.mode||x.mode==="vertical","Dropdown",'mode="'.concat(x.mode,`" is not supported for Dropdown's Menu.`));var w=x.selectable,g=w===void 0?!1:w,h=x.expandIcon,E=h===void 0?(s=d.children)===null||s===void 0||(f=s.expandIcon)===null||f===void 0?void 0:f.call(s):h,y=typeof E<"u"&&Yt(E)?E:m("span",{class:"".concat(S.value,"-menu-submenu-arrow")},[m(_n,{class:"".concat(S.value,"-menu-submenu-arrow-icon")},null)]),I=Yt(d)?Wt(d,{mode:"vertical",selectable:g,expandIcon:function(){return y}}):d;return I},b=M(function(){var a=e.placement;if(!a)return v.value==="rtl"?"bottomRight":"bottomLeft";if(a.includes("Center")){var o=a.slice(0,a.indexOf("Center"));return Jt(!a.includes("Center"),"Dropdown","You are using '".concat(a,"' placement in Dropdown, which is deprecated. Try to use '").concat(o,"' instead.")),o}return a}),l=function(o){u("update:visible",o),u("visibleChange",o)};return function(){var a,o,s=e.arrow,f=e.trigger,P=e.disabled,d=e.overlayClassName,x=(a=r.default)===null||a===void 0?void 0:a.call(r)[0],w=Wt(x,Ct({class:fe(x==null||(o=x.props)===null||o===void 0?void 0:o.class,G({},"".concat(S.value,"-rtl"),v.value==="rtl"),"".concat(S.value,"-trigger"))},P?{disabled:P}:{})),g=fe(d,G({},"".concat(S.value,"-rtl"),v.value==="rtl")),h=P?[]:f,E;h&&h.indexOf("contextmenu")!==-1&&(E=!0);var y=vr({arrowPointAtCenter:Ke(s)==="object"&&s.pointAtCenter,autoAdjustOverflow:!0}),I=mr($($($({},e),i),{},{builtinPlacements:y,overlayClassName:g,arrow:s,alignPoint:E,prefixCls:S.value,getPopupContainer:A.value,transitionName:O.value,trigger:h,onVisibleChange:l,placement:b.value}),["overlay","onUpdate:visible"]);return m(pr,I,{default:function(){return[w]},overlay:C})}}});Jn.Button=qe;const Ce=Jn;Ce.Button=qe;Ce.install=function(t){return t.component(Ce.name,Ce),t.component(qe.name,qe),t};function pi(){var t=document.documentElement.clientWidth,e=window.innerHeight||document.documentElement.clientHeight;return{width:t,height:e}}function Wn(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 gi(t){var e=z(null),n=Te($({},t)),r=z([]),i=function(c){e.value===null&&(r.value=[],e.value=Zt(function(){var S;r.value.forEach(function(p){S=$($({},S),p)}),Ct(n,S),e.value=null})),r.value.push(c)};return Qe(function(){e.value&&Zt.cancel(e.value)}),[n,i]}function an(t,e,n,r){var i=e+n,u=(n-r)/2;if(n>r){if(e>0)return G({},t,u);if(e<0&&ir)return G({},t,e<0?u:-u);return{}}function hi(t,e,n,r){var i=pi(),u=i.width,c=i.height,S=null;return t<=u&&e<=c?S={x:0,y:0}:(t>u||e>c)&&(S=$($({},an("x",n,t,u)),an("y",r,e,c))),S}var ln=Symbol("previewGroupContext"),Lt={provide:function(e){gr(ln,e)},inject:function(){return Mn(ln,{isPreviewGroup:z(!1),previewUrls:M(function(){return new Map}),setPreviewUrls:function(){},current:z(null),setCurrent:function(){},setShowPreview:function(){},setMousePosition:function(){},registerImage:null,rootClassName:""})}},yi=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=M(function(){var h={visible:void 0,onVisibleChange:function(){},getContainer:void 0,current:0};return Ke(e.preview)==="object"?Xn(e.preview,h):h}),u=Te(new Map),c=z(),S=M(function(){return i.value.visible}),p=M(function(){return i.value.getContainer}),v=function(E,y){var I,k;(I=(k=i.value).onVisibleChange)===null||I===void 0||I.call(k,E,y)},A=zn(!!S.value,{value:S,onChange:v}),O=Me(A,2),C=O[0],b=O[1],l=z(null),a=M(function(){return S.value!==void 0}),o=M(function(){return Array.from(u.keys())}),s=M(function(){return o.value[i.value.current]}),f=M(function(){return new Map(Array.from(u).filter(function(h){var E=Me(h,2),y=E[1].canPreview;return!!y}).map(function(h){var E=Me(h,2),y=E[0],I=E[1].url;return[y,I]}))}),P=function(E,y){var I=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;u.set(E,{url:y,canPreview:I})},d=function(E){c.value=E},x=function(E){l.value=E},w=function(E,y){var I=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,k=function(){u.delete(E)};return u.set(E,{url:y,canPreview:I}),k},g=function(E){E==null||E.stopPropagation(),b(!1),x(null)};return ae(s,function(h){d(h)},{immediate:!0,flush:"post"}),hr(function(){C.value&&a.value&&d(s.value)},{flush:"post"}),Lt.provide({isPreviewGroup:z(!0),previewUrls:f,setPreviewUrls:P,current:c,setCurrent:d,setShowPreview:b,setMousePosition:x,registerImage:w}),function(){var h=Ct({},(yr(i.value),i.value));return m(de,null,[r.default&&r.default(),m(Zn,$($({},h),{},{"ria-hidden":!C.value,visible:C.value,prefixCls:e.previewPrefixCls,onClose:g,mousePosition:l.value,src:f.value.get(c.value),icons:e.icons,getContainer:p.value}),null)])}}});const Yn=yi;var we={x:0,y:0},bi=$($({},br()),{},{src:String,alt:String,rootClassName:String,icons:{type:Object,default:function(){return{}}}}),wi=se({compatConfig:{MODE:3},name:"Preview",inheritAttrs:!1,props:bi,emits:["close","afterClose"],setup:function(e,n){var r=n.emit,i=n.attrs,u=Te(e.icons),c=u.rotateLeft,S=u.rotateRight,p=u.zoomIn,v=u.zoomOut,A=u.close,O=u.left,C=u.right,b=z(1),l=z(0),a=gi(we),o=Me(a,2),s=o[0],f=o[1],P=function(){return r("close")},d=z(),x=Te({originX:0,originY:0,deltaX:0,deltaY:0}),w=z(!1),g=Lt.inject(),h=g.previewUrls,E=g.current,y=g.isPreviewGroup,I=g.setCurrent,k=M(function(){return h.value.size}),L=M(function(){return Array.from(h.value.keys())}),Q=M(function(){return L.value.indexOf(E.value)}),X=M(function(){return y.value?h.value.get(E.value):e.src}),R=M(function(){return y.value&&k.value>1}),le=z({wheelDirection:0}),ue=function(){b.value=1,l.value=0,f(we),r("afterClose")},ce=function(){b.value++,f(we)},he=function(){b.value>1&&b.value--,f(we)},V=function(){l.value+=90},J=function(){l.value-=90},K=function(F){F.preventDefault(),F.stopPropagation(),Q.value>0&&I(L.value[Q.value-1])},ee=function(F){F.preventDefault(),F.stopPropagation(),Q.value0&&I(L.value[Q.value-1]):F.keyCode===qt.RIGHT&&Q.value0?he():U<0&&ce()})}),Dn(function(){Le()}),function(){var U=e.visible,F=e.prefixCls,ne=e.rootClassName;return m(wr,$($({},i),{},{transitionName:"zoom",maskTransitionName:"fade",closable:!1,keyboard:!0,prefixCls:F,onClose:P,afterClose:ue,visible:U,wrapClassName:te,rootClassName:ne,getContainer:e.getContainer}),{default:function(){return[m("ul",{class:"".concat(e.prefixCls,"-operations")},[tt.map(function(oe){var be=oe.icon,me=oe.onClick,Ee=oe.type,Oe=oe.disabled;return m("li",{class:fe(je,G({},"".concat(e.prefixCls,"-operations-operation-disabled"),Oe&&(Oe==null?void 0:Oe.value))),onClick:me,key:Ee},[ct(be,{class:Ae})])})]),m("div",{class:"".concat(e.prefixCls,"-img-wrapper"),style:{transform:"translate3d(".concat(s.x,"px, ").concat(s.y,"px, 0)")}},[m("img",{onMousedown:nt,onDblclick:it,ref:d,class:"".concat(e.prefixCls,"-img"),src:X.value,alt:e.alt,style:{transform:"scale3d(".concat(b.value,", ").concat(b.value,", 1) rotate(").concat(l.value,"deg)")}},null)]),R.value&&m("div",{class:fe("".concat(e.prefixCls,"-switch-left"),G({},"".concat(e.prefixCls,"-switch-left-disabled"),Q.value<=0)),onClick:K},[O]),R.value&&m("div",{class:fe("".concat(e.prefixCls,"-switch-right"),G({},"".concat(e.prefixCls,"-switch-right-disabled"),Q.value>=k.value-1)),onClick:ee},[C])]}})}}});const Zn=wi;var Si=["icons","maskClassName"],qn=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:Ne.any,fallback:String,preview:{type:[Boolean,Object],default:!0},onClick:{type:Function},onError:{type:Function}}},Xn=function(e,n){var r=$({},e);return Object.keys(n).forEach(function(i){e[i]===void 0&&(r[i]=n[i])}),r},Ci=0,Kn=se({compatConfig:{MODE:3},name:"Image",inheritAttrs:!1,props:qn(),emits:["click","error"],setup:function(e,n){var r=n.attrs,i=n.slots,u=n.emit,c=M(function(){return e.prefixCls}),S=M(function(){return"".concat(c.value,"-preview")}),p=M(function(){var V={visible:void 0,onVisibleChange:function(){},getContainer:void 0};return Ke(e.preview)==="object"?Xn(e.preview,V):V}),v=M(function(){var V;return(V=p.value.src)!==null&&V!==void 0?V:e.src}),A=M(function(){return e.placeholder&&e.placeholder!==!0||i.placeholder}),O=M(function(){return p.value.visible}),C=M(function(){return p.value.getContainer}),b=M(function(){return O.value!==void 0}),l=function(J,K){var ee,te;(ee=(te=p.value).onVisibleChange)===null||ee===void 0||ee.call(te,J,K)},a=zn(!!O.value,{value:O,onChange:l}),o=Me(a,2),s=o[0],f=o[1];ae(s,function(V,J){l(V,J)});var P=z(A.value?"loading":"normal");ae(function(){return e.src},function(){P.value=A.value?"loading":"normal"});var d=z(null),x=M(function(){return P.value==="error"}),w=Lt.inject(),g=w.isPreviewGroup,h=w.setCurrent,E=w.setShowPreview,y=w.setMousePosition,I=w.registerImage,k=z(Ci++),L=M(function(){return e.preview&&!x.value}),Q=function(){P.value="normal"},X=function(J){P.value="error",u("error",J)},R=function(J){if(!b.value){var K=Wn(J.target),ee=K.left,te=K.top;g.value?(h(k.value),y({x:ee,y:te})):d.value={x:ee,y:te}}g.value?E(!0):f(!0),u("click",J)},le=function(){f(!1),b.value||(d.value=null)},ue=z(null);ae(function(){return ue},function(){P.value==="loading"&&ue.value.complete&&(ue.value.naturalWidth||ue.value.naturalHeight)&&Q()});var ce=function(){};Qe(function(){ae([v,L],function(){if(ce(),!g.value)return function(){};ce=I(k.value,v.value,L.value),L.value||ce()},{flush:"post",immediate:!0})}),Dn(function(){ce()});var he=function(J){return Sr(J)?J+"px":J};return function(){var V=e.prefixCls,J=e.wrapperClassName,K=e.fallback,ee=e.src,te=e.placeholder,je=e.wrapperStyle,Ae=e.rootClassName,tt=r.width,$e=r.height,nt=r.crossorigin,Re=r.decoding,Ve=r.alt,rt=r.sizes,it=r.srcset,Le=r.usemap,U=r.class,F=r.style,ne=p.value,ye=ne.icons,oe=ne.maskClassName,be=St(ne,Si),me=fe(V,J,Ae,G({},"".concat(V,"-error"),x.value)),Ee=x.value&&K?K:v.value,Oe={crossorigin:nt,decoding:Re,alt:Ve,sizes:rt,srcset:it,usemap:Le,class:fe("".concat(V,"-img"),G({},"".concat(V,"-img-placeholder"),te===!0),U),style:$({height:$e},F)};return m(de,null,[m("div",{class:me,onClick:L.value?R:function(cr){u("click",cr)},style:$({width:he(tt),height:he($e)},je)},[m("img",$($($({},Oe),x.value&&K?{src:K}:{onLoad:Q,onError:X,src:ee}),{},{ref:ue}),null),P.value==="loading"&&m("div",{"aria-hidden":"true",class:"".concat(V,"-placeholder")},[te||i.placeholder&&i.placeholder()]),i.previewMask&&L.value&&m("div",{class:["".concat(V,"-mask"),oe]},[i.previewMask()])]),!g.value&&L.value&&m(Zn,$($({},be),{},{"aria-hidden":!s.value,visible:s.value,prefixCls:S.value,onClose:le,mousePosition:d.value,src:Ee,alt:Ve,getContainer:C.value,icons:ye,rootClassName:Ae}),null)])}}});Kn.PreviewGroup=Yn;const Ai=Kn;var Ei={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 Oi=Ei;function on(t){for(var e=1;e{document.addEventListener(...t),Et(()=>document.removeEventListener(...t))},ua="data:image/png;base64,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",He=new WeakMap;function ca(t,e){return{useHookShareState:r=>{const i=zr();dt(i),He.has(i)||(He.set(i,Te(t(i,r??(e==null?void 0:e())))),Et(()=>{He.delete(i)}));const u=He.get(i);return dt(u),{state:u,toRefs(){return Dr(u)}}}}}var da={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 fa=da;function gn(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))(rr||{});const ja=(t,e)=>{const n=t.type==="dir"?1:0;return(e.type==="dir"?1:0)-n},En=(t,e)=>{const n=Date.parse(t.date),r=Date.parse(e.date);return n-r},On=(t,e)=>{const n=Date.parse(t.created_time),r=Date.parse(e.created_time);return n-r},Pn=(t,e)=>{const n=t.name.toLowerCase(),r=e.name.toLowerCase();return n.localeCompare(r)},xn=(t,e)=>t.bytes-e.bytes,ze=(t,e)=>{const n=(r,i)=>{switch(e){case"date-asc":return En(r,i);case"date-desc":return En(i,r);case"created-time-asc":return On(r,i);case"created-time-desc":return On(i,r);case"name-asc":return Pn(r,i);case"name-desc":return Pn(i,r);case"size-asc":return xn(r,i);case"size-desc":return xn(i,r);default:throw new Error(`Invalid sort method: ${e}`)}};return t.slice().sort((r,i)=>ja(r,i)||n(r,i))},_e=async t=>(await Ot.get("/files",{params:{folder_path:t}})).data,Ra=async t=>(await Ot.post("/delete_files",{file_paths:t})).data,ir=async(t,e)=>(await Ot.post("/move_files",{file_paths:t,dest:e})).data;var mt={},Va={get exports(){return mt},set exports(t){mt=t}};/* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress * @license MIT */(function(t,e){(function(n,r){t.exports=r})(Nr,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(l){var a,o;for(a in l)o=l[a],o!==void 0&&l.hasOwnProperty(a)&&(r[a]=o);return this},n.status=null,n.set=function(l){var a=n.isStarted();l=i(l,r.minimum,1),n.status=l===1?null:l;var o=n.render(!a),s=o.querySelector(r.barSelector),f=r.speed,P=r.easing;return o.offsetWidth,S(function(d){r.positionUsing===""&&(r.positionUsing=n.getPositioningCSS()),p(s,c(l,f,P)),l===1?(p(o,{transition:"none",opacity:1}),o.offsetWidth,setTimeout(function(){p(o,{transition:"all "+f+"ms linear",opacity:0}),setTimeout(function(){n.remove(),d()},f)},f)):setTimeout(d,f)}),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())},r.trickleSpeed)};return r.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 a=n.status;return a?a>1?void 0:(typeof l!="number"&&(a>=0&&a<.2?l=.1:a>=.2&&a<.5?l=.04:a>=.5&&a<.8?l=.02:a>=.8&&a<.99?l=.005:l=0),a=i(a+l,0,.994),n.set(a)):n.start()},n.trickle=function(){return n.inc()},function(){var l=0,a=0;n.promise=function(o){return!o||o.state()==="resolved"?this:(a===0&&n.start(),l++,a++,o.always(function(){a--,a===0?(l=0,n.done()):n.set((l-a)/l)}),this)}}(),n.getElement=function(){var l=n.getParent();if(l){var a=Array.prototype.slice.call(l.querySelectorAll(".nprogress")).filter(function(o){return o.parentElement===l});if(a.length>0)return a[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(l){if(n.isRendered())return n.getElement();A(document.documentElement,"nprogress-busy");var a=document.createElement("div");a.id="nprogress",a.className="nprogress",a.innerHTML=r.template;var o=a.querySelector(r.barSelector),s=l?"-100":u(n.status||0),f=n.getParent(),P;return p(o,{transition:"all 0 linear",transform:"translate3d("+s+"%,0,0)"}),r.showSpinner||(P=a.querySelector(r.spinnerSelector),P&&b(P)),f!=document.body&&A(f,"nprogress-custom-parent"),f.appendChild(a),a},n.remove=function(){n.status=null,O(document.documentElement,"nprogress-busy"),O(n.getParent(),"nprogress-custom-parent");var l=n.getElement();l&&b(l)},n.isRendered=function(){return!!n.getElement()},n.getPositioningCSS=function(){var l=document.body.style,a="WebkitTransform"in l?"Webkit":"MozTransform"in l?"Moz":"msTransform"in l?"ms":"OTransform"in l?"O":"";return a+"Perspective"in l?"translate3d":a+"Transform"in l?"translate":"margin"};function i(l,a,o){return lo?o:l}function u(l){return(-1+l)*100}function c(l,a,o){var s;return r.positionUsing==="translate3d"?s={transform:"translate3d("+u(l)+"%,0,0)"}:r.positionUsing==="translate"?s={transform:"translate("+u(l)+"%,0)"}:s={"margin-left":u(l)+"%"},s.transition="all "+a+"ms "+o,s}var S=function(){var l=[];function a(){var o=l.shift();o&&o(a)}return function(o){l.push(o),l.length==1&&a()}}(),p=function(){var l=["Webkit","O","Moz","ms"],a={};function o(d){return d.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(x,w){return w.toUpperCase()})}function s(d){var x=document.body.style;if(d in x)return d;for(var w=l.length,g=d.charAt(0).toUpperCase()+d.slice(1),h;w--;)if(h=l[w]+g,h in x)return h;return d}function f(d){return d=o(d),a[d]||(a[d]=s(d))}function P(d,x,w){x=f(x),d.style[x]=w}return function(d,x){var w=arguments,g,h;if(w.length==2)for(g in x)h=x[g],h!==void 0&&x.hasOwnProperty(g)&&P(d,g,h);else P(d,w[1],w[2])}}();function v(l,a){var o=typeof l=="string"?l:C(l);return o.indexOf(" "+a+" ")>=0}function A(l,a){var o=C(l),s=o+a;v(o,a)||(l.className=s.substring(1))}function O(l,a){var o=C(l),s;v(l,a)&&(s=o.replace(" "+a+" "," "),l.className=s.substring(1,s.length-1))}function C(l){return(" "+(l&&l.className||"")+" ").replace(/\s+/gi," ")}function b(l){l&&l.parentNode&&l.parentNode.removeChild(l)}return n})})(Va);const Ua=mt,st=new Map,H=Pt(),In=new BroadcastChannel("iib-image-transfer-bus"),De=encodeURIComponent,xe=(t,e=!1)=>`/infinite_image_browsing/file?path=${De(t.fullpath)}&t=${De(t.date)}${e?`&disposition=${De(t.name)}`:""}`,Ha=(t,e)=>`/infinite_image_browsing/image-thumbnail?path=${De(t.fullpath)}&size=${e}&t=${De(t.date)}`,{eventEmitter:Je,useEventListen:pt}=Nn(),{useHookShareState:ge}=ca(()=>{const t=z({tabIdx:-1,paneIdx:-1}),e=M(()=>Ie(n.value)),n=z([]),r=M(()=>{var C;return n.value.map(b=>b.curr).slice((C=H.conf)!=null&&C.is_win?1:0)}),i=M(()=>xt(...r.value)),u=z(rr.CREATED_TIME_DESC),c=M(()=>{var o;if(!e.value)return[];const C=((o=e.value)==null?void 0:o.files)??[],b=u.value,{walkFiles:l}=e.value,a=s=>H.onlyFoldersAndImages?s.filter(f=>f.type==="dir"||re(f.name)):s;return t.value.walkMode&&l?l.map(s=>ze(a(s),b)).flat():ze(a(C),b)}),S=z([]),p=z(-1),v=z(!0),A=z();return{spinning:z(!1),canLoadNext:v,multiSelectedIdxs:S,previewIdx:p,basePath:r,currLocation:i,currPage:e,stack:n,sortMethod:u,sortedFiles:c,scroller:z(),stackViewEl:z(),walkModePath:A,props:t,...Nn()}});function Vl(t,e){const{previewIdx:n,eventEmitter:r,canLoadNext:i}=ge().toRefs(),{state:u}=ge(),c=M(()=>(e==null?void 0:e.files.value)??u.sortedFiles),S=M(()=>(e==null?void 0:e.scroller.value)??u.scroller),p=z(!1);let v=null;const A=(l,a)=>{var o;p.value=l,v!=null&&!l&&a&&((o=S.value)==null||o.scrollToItem(v),v=null)},O=()=>{t.walkMode&&!b("next")&&i&&(ie.info(B("loadingNextFolder")),r.value.emit("loadNextDir",!0))};vt("keydown",l=>{var a;if(p.value){let o=n.value;if(["ArrowDown","ArrowRight"].includes(l.key))for(o++;c.value[o]&&!re(c.value[o].name);)o++;else if(["ArrowUp","ArrowLeft"].includes(l.key))for(o--;c.value[o]&&!re(c.value[o].name);)o--;if(re((a=c.value[o])==null?void 0:a.name)??""){n.value=o;const s=S.value;s&&!(o>=s.$_startIndex&&o<=s.$_endIndex)&&(v=o)}O()}});const C=l=>{var o;let a=n.value;if(l==="next")for(a++;c.value[a]&&!re(c.value[a].name);)a++;else if(l==="prev")for(a--;c.value[a]&&!re(c.value[a].name);)a--;if(re((o=c.value[a])==null?void 0:o.name)??""){n.value=a;const s=S.value;s&&!(a>=s.$_startIndex&&a<=s.$_endIndex)&&(v=a)}O()},b=l=>{var o;let a=n.value;if(l==="next")for(a++;c.value[a]&&!re(c.value[a].name);)a++;else if(l==="prev")for(a--;c.value[a]&&!re(c.value[a].name);)a--;return re((o=c.value[a])==null?void 0:o.name)??""};return pt("removeFiles",async()=>{var l;p.value&&!u.sortedFiles[n.value]&&(ie.info(B("manualExitFullScreen"),5),await Be(500),(l=document.querySelector(".ant-image-preview-operations-operation .anticon-close"))==null||l.click(),n.value=-1)}),{previewIdx:n,onPreviewVisibleChange:A,previewing:p,previewImgMove:C,canPreview:b}}function Ul(t){const e=z(),{scroller:n,stackViewEl:r,stack:i,currPage:u,currLocation:c,sortMethod:S,useEventListen:p,walkModePath:v,eventEmitter:A}=ge().toRefs();ae(()=>i.value.length,ke((w,g)=>{var h;w!==g&&((h=n.value)==null||h.scrollToItem(0))},300));const O=async w=>{if(await o(w),t.walkMode){await Be();const[g]=ze(u.value.files,S.value).filter(h=>h.type==="dir");g&&await o(g.fullpath),await A.value.emit("loadNextDir")}};Qe(async()=>{var w;if(!i.value.length){const g=await _e("/");i.value.push({files:g.files,curr:"/"})}e.value=new Ua,e.value.configure({parent:r.value}),t.path&&t.path!=="/"?await O(t.path):(w=H.conf)!=null&&w.home&&o(H.conf.home)}),ae(c,ke(w=>{const g=H.tabList[t.tabIdx].panes[t.paneIdx];g.path=w;const h=g.path.split("/").pop(),E=()=>{var y;return t.walkMode?"Walk: "+(((y=H.autoCompletedDirList.find(I=>I.dir===v.value))==null?void 0:y.zh)??h):h};g.name=ve("div",{style:"display:flex;align-items:center"},[ve(ya),ve("span",{class:"line-clamp-1",style:"max-width: 256px"},E())]),H.recent=H.recent.filter(y=>y.key!==g.key),H.recent.unshift({path:w,key:g.key}),H.recent.length>20&&(H.recent=H.recent.slice(0,20))},300));const C=()=>kt(c.value),b=async w=>{var g,h;if(w.type==="dir")try{(g=e.value)==null||g.start();const{files:E}=await _e(w.fullpath);i.value.push({files:E,curr:w.name})}finally{(h=e.value)==null||h.done()}},l=w=>{for(;w(dt(H.conf,"global.conf load failed"),H.conf.is_win?w.toLowerCase()==g.toLowerCase():w==g),o=async w=>{var h,E;const g=i.value.slice();try{Tr(w)||(w=xt(((h=H.conf)==null?void 0:h.sd_cwd)??"/",w));const y=en(w),I=i.value.map(k=>k.curr);for(I.shift();I[0]&&y[0]&&a(I[0],y[0]);)I.shift(),y.shift();for(let k=0;ka(Q.name,k));if(!L)throw console.error({frags:y,frag:k,stack:Tn(i.value)}),new Error(`${k} not found`);await b(L)}}catch(y){throw ie.error(B("moveFailedCheckPath")+(y instanceof Error?y.message:"")),console.error(w,en(w),u.value),i.value=g,y}},s=tn(async()=>{var w,g,h;try{if((w=e.value)==null||w.start(),v.value)l(0),await O(v.value);else{const{files:E}=await _e(i.value.length===1?"/":c.value);Ie(i.value).files=E}(g=n.value)==null||g.scrollToItem(0),ie.success(B("refreshCompleted"))}finally{(h=e.value)==null||h.done()}});Br("return-to-iib",tn(async()=>{var w,g;if(!t.walkMode)try{(w=e.value)==null||w.start();const{files:h}=await _e(i.value.length===1?"/":c.value);Ie(i.value).files.map(y=>y.date).join()!==h.map(y=>y.date).join()&&(Ie(i.value).files=h,ie.success(B("autoUpdate")))}finally{(g=e.value)==null||g.done()}})),p.value("refresh",s);const f=w=>{t.walkMode&&(v.value=w),O(w)},P=M(()=>H.autoCompletedDirList.map(w=>({...w,path:ft(w.dir)}))),d=M(()=>{const w=ft(c.value);return P.value.find(h=>h.path===w)});return{addToSearchScanPathAndQuickMove:async()=>{const w=d.value;if(w){if(!w.can_delete)return;await ui(c.value),ie.success(B("removeComplete"))}else await ci(c.value),ie.success(B("addComplete"));await jr.emit("updateGlobalSetting")},searchPathInfo:d,refresh:s,copyLocation:C,back:l,openNext:b,currPage:u,currLocation:c,to:o,stack:i,scroller:n,quickMoveTo:f}}function Hl(t){const{scroller:e,sortedFiles:n,stack:r,sortMethod:i,currLocation:u,currPage:c,stackViewEl:S,canLoadNext:p,previewIdx:v}=ge().toRefs(),{state:A}=ge(),O=z(!1),C=z("grid"),b={line:B("detailList"),grid:B("previewGrid"),"large-size-grid":B("largePreviewGrid")},l={value:E=>E,text:E=>B("sortBy")+" "+Qa[E].toLocaleLowerCase()},a=272,o=64,s=a*2,{width:f}=Fr(S),P=M(()=>{const E=f.value;if(!(C.value==="line"||!E))return~~(E/(C.value==="grid"?a:s))}),d=M(()=>{const E=C.value;if(E==="line")return{first:80,second:void 0};const y=E==="grid"?a:s;return{first:y+o,second:y}}),x=z(!1),w=async()=>{var E;if(!(x.value||!t.walkMode||!p.value))try{x.value=!0;const y=r.value[r.value.length-2],I=ze(y.files,i.value),k=I.findIndex(L=>{var Q;return L.name===((Q=c.value)==null?void 0:Q.curr)});if(k!==-1){const L=I[k+1],Q=xt(u.value,"../",L.name),X=await _e(Q),R=c.value;R.curr=L.name,R.walkFiles||(R.walkFiles=[R.files]),R.walkFiles.push(X.files),console.log("curr page files length",(E=c.value)==null?void 0:E.files.length)}}catch(y){console.error("loadNextDir",y),p.value=!1}finally{x.value=!1}},g=async(E=!1)=>{const y=e.value,I=()=>E?v.value:(y==null?void 0:y.$_endIndex)??0;for(;!n.value.length||I()>n.value.length-20&&p.value;)await Be(100),await w()};A.useEventListen("loadNextDir",g);const h=ke(()=>g(),300);return{gridItems:P,sortedFiles:n,sortMethodConv:l,viewModeMap:b,moreActionsDropdownShow:O,viewMode:C,gridSize:a,sortMethod:i,largeGridSize:s,onScroll:h,loadNextDir:w,loadNextDirLoading:x,canLoadNext:p,itemSize:d}}function Gl(){const{currLocation:t,sortedFiles:e,currPage:n,multiSelectedIdxs:r,eventEmitter:i}=ge().toRefs(),u=()=>{r.value=[]};return vt("click",u),vt("blur",u),ae(n,u),{onFileDragStart:(p,v)=>{const A=Tn(e.value[v]);console.log("onFileDragStart set drag file ",p,v,A);const O=[A];let C=A.type==="dir";if(r.value.includes(v)){const b=r.value.map(l=>e.value[l]);O.push(...b),C=b.some(l=>l.type==="dir")}p.dataTransfer.setData("text/plain",JSON.stringify({includeDir:C,loc:t.value,path:sa(O,"fullpath").map(b=>b.fullpath)}))},onDrop:async p=>{var A;const v=JSON.parse(((A=p.dataTransfer)==null?void 0:A.getData("text"))||"{}");if(console.log(v),v.path&&typeof v.includeDir<"u"&&v.loc){const O=t.value;if(v.loc===O)return;const C=ve("div",[ve("div",`${B("moveSelectedFilesTo")}${O}`),ve("ol",v.path.map(b=>b.split(/[/\\]/).pop()).map(b=>ve("li",b)))]);Bn.confirm({title:B("confirm"),content:C,maskClosable:!0,async onOk(){await ir(v.path,O),Je.emit("removeFiles",{paths:v.path,loc:v.loc}),await i.value.emit("refresh")}})}},multiSelectedIdxs:r}}function Jl(t,{openNext:e}){const n=z(!1),r=z(""),{sortedFiles:i,previewIdx:u,multiSelectedIdxs:c,stack:S,currLocation:p,spinning:v}=ge().toRefs(),A=ft;pt("removeFiles",({paths:l,loc:a})=>{if(A(a)!==A(p.value))return;const o=Ie(S.value);o&&(o.files=o.files.filter(s=>!l.includes(s.fullpath)),o.walkFiles&&(o.walkFiles=o.walkFiles.map(s=>s.filter(f=>!l.includes(f.fullpath)))))}),pt("addFiles",({files:l,loc:a})=>{if(A(a)!==A(p.value))return;const o=Ie(S.value);o&&o.files.unshift(...l)});const O=It();return{onFileItemClick:async(l,a,o)=>{u.value=o,H.fullscreenPreviewInitialUrl=xe(a);const s=c.value.indexOf(o);if(l.shiftKey){if(s!==-1)c.value.splice(s,1);else{c.value.push(o),c.value.sort((d,x)=>d-x);const f=c.value[0],P=c.value[c.value.length-1];c.value=oa(f,P+1)}l.stopPropagation()}else l.ctrlKey||l.metaKey?(s!==-1?c.value.splice(s,1):c.value.push(o),l.stopPropagation()):await e(a)},onContextMenuClick:async(l,a,o)=>{var x,w;console.log(l,a);const s=xe(a),f=p.value,P=()=>{let g=[];return c.value.includes(o)?g=c.value.map(h=>i.value[h]):g.push(a),g},d=async g=>{if(!v.value)try{v.value=!0,await Gr(a.fullpath),In.postMessage("iib_hidden_img_update_trigger");const h=setTimeout(()=>Jr.warn({message:B("long_loading"),duration:20}),5e3);await Wr(),clearTimeout(h),In.postMessage(`iib_hidden_tab_${g}`)}catch(h){console.error(h),ie.error("发送图像失败,请携带console的错误消息找开发者")}finally{v.value=!1}};if(((x=l.keyPath)==null?void 0:x[0])==="toggle-tag"){const{is_remove:g}=await rn({tag_id:l.key,img_path:a.fullpath});ie.success(g?B("removedTagFromImage"):B("addedTagToImage"));return}else if(l.key.toString().startsWith("toggle-tag-")){const{is_remove:g}=await rn({tag_id:+l.key.toString().split("toggle-tag-")[1],img_path:a.fullpath});ie.success(g?B("removedTagFromImage"):B("addedTagToImage"));return}switch(l.key){case"previewInNewWindow":return window.open(s);case"download":return window.open(xe(a,!0));case"copyPreviewUrl":return kt(parent.document.location.origin+s);case"send2txt2img":return d("txt2img");case"send2img2img":return d("img2img");case"send2inpaint":return d("inpaint");case"send2extras":return d("extras");case"send2savedDir":{const g=H.autoCompletedDirList.find(y=>y.key==="outdir_save");if(!g)return ie.error(B("unknownSavedDir"));const h=Hr(g.dir,(w=H.conf)==null?void 0:w.sd_cwd),E=P();await ir(E.map(y=>y.fullpath),h),Je.emit("removeFiles",{paths:E.map(y=>y.fullpath),loc:p.value}),Je.emit("addFiles",{files:E,loc:h});break}case"send2controlnet-img2img":case"send2controlnet-txt2img":{const g=Ur(),h=Yr(),E=l.key.split("-")[1];E==="img2img"?h.switch_to_img2img():h.switch_to_txt2img(),await Be(100);const I=g.querySelector(`#${E}_controlnet`).querySelector(".label-wrap");I.className.includes("open")||(I.click(),await Be(100)),I.scrollIntoView();const L=await(await fetch(xe(a))).blob(),Q=new File([L],"image.jpg",{type:L.type,lastModified:Date.now()}),X=new DataTransfer;X.items.add(Q);const R=new ClipboardEvent("paste",{clipboardData:X,bubbles:!0});I.dispatchEvent(R);break}case"openWithWalkMode":{st.set(f,S.value);const g=H.tabList[t.tabIdx],h={type:"local",key:at(),path:a.fullpath,name:B("local"),stackKey:f,walkMode:!0};g.panes.push(h),g.key=h.key;break}case"openInNewTab":{st.set(f,S.value);const g=H.tabList[t.tabIdx],h={type:"local",key:at(),path:a.fullpath,name:B("local"),stackKey:f};g.panes.push(h),g.key=h.key;break}case"openOnTheRight":{st.set(f,S.value);let g=H.tabList[t.tabIdx+1];g||(g=Vr({panes:[],key:""}),H.tabList[t.tabIdx+1]=g);const h={type:"local",key:at(),path:a.fullpath,name:B("local"),stackKey:f};g.panes.push(h),g.key=h.key;break}case"viewGenInfo":{n.value=!0,r.value=await O.pushAction(()=>Fn(a.fullpath)).res;break}case"openWithLocalFileBrowser":{await Rr(a.fullpath);break}case"deleteFiles":{const g=P();await new Promise(h=>{Bn.confirm({title:B("confirmDelete"),maskClosable:!0,content:ve("ol",{style:"max-height:50vh;overflow:auto;"},g.map(E=>E.fullpath.split(/[/\\]/).pop()).map(E=>ve("li",E))),async onOk(){const E=g.map(y=>y.fullpath);await Ra(E),ie.success(B("deleteSuccess")),Je.emit("removeFiles",{paths:E,loc:p.value}),h()}})});break}}return{}},showGenInfo:n,imageGenInfo:r,q:O}}const Wl=()=>{const{stackViewEl:t}=ge().toRefs(),e=z(-1);return Qr(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 u=(i=r.dataset)==null?void 0:i.idx;u&&Number.isSafeInteger(+u)&&(e.value=+u);return}}),{showMenuIdx:e}};function Ga(){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 We;function gt(){gt.init||(gt.init=!0,We=Ga()!==-1)}var et={name:"ResizeObserver",props:{emitOnMount:{type:Boolean,default:!1},ignoreWidth:{type:Boolean,default:!1},ignoreHeight:{type:Boolean,default:!1}},emits:["notify"],mounted(){gt(),At(()=>{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",We&&this.$el.appendChild(t),t.data="about:blank",We||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&&(!We&&this._resizeObject.contentDocument&&this._resizeObject.contentDocument.defaultView.removeEventListener("resize",this.compareAndNotify),this.$el.removeChild(this._resizeObject),this._resizeObject.onload=null,this._resizeObject=null)}}};const Ja=Zr();Qn("data-v-b329ee4c");const Wa={class:"resize-observer",tabindex:"-1"};jn();const Ya=Ja((t,e,n,r,i,u)=>(N(),W("div",Wa)));et.render=Ya;et.__scopeId="data-v-b329ee4c";et.__file="src/components/ResizeObserver.vue";function Ye(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ye=function(e){return typeof e}:Ye=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ye(t)}function Za(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function kn(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,u,c=function(p){for(var v=arguments.length,A=new Array(v>1?v-1:0),O=1;O1){var v=S.find(function(O){return O.isIntersecting});v&&(p=v)}if(i.callback){var A=p.isIntersecting&&p.intersectionRatio>=i.threshold;if(A===i.oldResult)return;i.oldResult=A,i.callback(A,p)}},this.options.intersection),At(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 lr(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 il(t,r,n);t._vue_visibilityState=i}}function al(t,e,n){var r=e.value,i=e.oldValue;if(!ar(r,i)){var u=t._vue_visibilityState;if(!r){or(t);return}u?u.createObserver(r,n):lr(t,{value:r},n)}}function or(t){var e=t._vue_visibilityState;e&&(e.destroyObserver(),delete t._vue_visibilityState)}var ll={beforeMount:lr,updated:al,unmounted:or},ol={itemsLimit:1e3},sl=/(auto|scroll)/;function sr(t,e){return t.parentNode===null?e:sr(t.parentNode,e.concat([t]))}var ut=function(e,n){return getComputedStyle(e,null).getPropertyValue(n)},ul=function(e){return ut(e,"overflow")+ut(e,"overflow-y")+ut(e,"overflow-x")},cl=function(e){return sl.test(ul(e))};function Ln(t){if(t instanceof HTMLElement||t instanceof SVGElement){for(var e=sr(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 u=qr({id:ml++,index:e,used:!0,key:r,type:i}),c=Xr({item:n,position:0,nr:u});return t.push(c),c},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,u=this.$_computedMinItemSize,c=this.typeField,S=this.simpleArray?null:this.keyField,p=this.items,v=p.length,A=this.sizes,O=this.$_views,C=this.$_unusedViews,b=this.pool,l=this.itemIndexByKey;let a,o,s,f,P;if(!v)a=o=f=P=s=0;else if(this.$_prerender)a=f=0,o=P=Math.min(this.prerender,p.length),s=null;else{const y=this.getScroll();if(e){let L=y.start-this.$_lastUpdateScrollPosition;if(L<0&&(L=-L),n===null&&Ly.start&&(X=R),R=~~((Q+X)/2);while(R!==le);for(R<0&&(R=0),a=R,s=A[v-1].accumulator,o=R;ov&&(o=v)),f=a;fv&&(o=v),f<0&&(f=0),P>v&&(P=v),s=Math.ceil(v/r)*n}}o-a>ol.itemsLimit&&this.itemsLimitError(),this.totalSize=s;let d;const x=a<=this.$_endIndex&&o>=this.$_startIndex;if(x)for(let y=0,I=b.length;y=o)&&this.unuseView(d));const w=x?null:new Map;let g,h,E;for(let y=a;y=k.length)&&(d=this.addView(b,y,g,I,h),this.unuseView(d,!0),k=C.get(h)),d=k[E],w.set(h,E+1)),O.delete(d.nr.key),d.nr.used=!0,d.nr.index=y,d.nr.key=I,d.nr.type=h,O.set(I,d),L=!0;else if(!d.nr.used&&(d.nr.used=!0,d.nr.index=y,L=!0,k)){const Q=k.indexOf(d);Q!==-1&&k.splice(Q,1)}d.item=g,L&&(y===p.length-1&&this.$emit("scroll-end"),y===0&&this.$emit("scroll-start")),n===null?(d.position=A[y-1].accumulator,d.offset=0):(d.position=Math.floor(y/r)*n,d.offset=y%r*i)}return this.$_startIndex=a,this.$_endIndex=o,this.emitUpdate&&this.$emit("update",a,o,f,P),clearTimeout(this.$_sortTimer),this.$_sortTimer=setTimeout(this.sortViews,this.updateInterval+300),{continuous:x}},getListenerTarget(){let t=Ln(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(),u=n?i.height:i.width;let c=-(n?i.top:i.left),S=n?window.innerHeight:window.innerWidth;c<0&&(S+=c,c=0),c+S>u&&(S=u-c),r={start:c,end:c+S}}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,bt?{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 u=Ln(this.$el),c=u.tagName==="HTML"?0:u[e.scroll],S=u.getBoundingClientRect(),v=this.$el.getBoundingClientRect()[e.start]-S[e.start];n=u,r=e.scroll,i=t+c+v}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 pl={key:0,ref:"before",class:"vue-recycle-scroller__slot"},gl={key:1,ref:"after",class:"vue-recycle-scroller__slot"};function hl(t,e,n,r,i,u){const c=Kr("ResizeObserver"),S=ei("observe-visibility");return ti((N(),Y("div",{class:Fe(["vue-recycle-scroller",{ready:i.ready,"page-mode":n.pageMode,[`direction-${t.direction}`]:!0}]),onScrollPassive:e[0]||(e[0]=(...p)=>u.handleScroll&&u.handleScroll(...p))},[t.$slots.before?(N(),Y("div",pl,[Ue(t.$slots,"before")],512)):pe("v-if",!0),(N(),W(nn(n.listTag),{ref:"wrapper",style:ii({[t.direction==="vertical"?"minHeight":"minWidth"]:i.totalSize+"px"}),class:Fe(["vue-recycle-scroller__item-wrapper",n.listClass])},{default:_(()=>[(N(!0),Y(de,null,$t(i.pool,p=>(N(),W(nn(n.itemTag),ni({key:p.nr.id,style:i.ready?{transform:`translate${t.direction==="vertical"?"Y":"X"}(${p.position}px) translate${t.direction==="vertical"?"X":"Y"}(${p.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===p.nr.key}]]},ri(n.skipHover?{}:{mouseenter:()=>{i.hoverKey=p.nr.key},mouseleave:()=>{i.hoverKey=null}})),{default:_(()=>[Ue(t.$slots,"default",{item:p.item,index:p.nr.index,active:p.nr.used})]),_:2},1040,["style","class"]))),128)),Ue(t.$slots,"empty")]),_:3},8,["style","class"])),t.$slots.after?(N(),Y("div",gl,[Ue(t.$slots,"after")],512)):pe("v-if",!0),m(c,{onNotify:u.handleResize},null,8,["onNotify"])],34)),[[S,u.handleVisibilityChange]])}ur.render=hl;ur.__file="src/components/RecycleScroller.vue";const yl=["data-idx"],bl={key:0},wl={key:1,class:"preview-icon-wrap"},Sl={class:"profile"},Cl={class:"name line-clamp-1"},Al={class:"basic-info"},El={class:"name line-clamp-1"},Ol={class:"basic-info"},Pl=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=Pt(),i=z([]),u=M(()=>{var v;return(((v=r.conf)==null?void 0:v.all_custom_tags)??[]).reduce((A,O)=>[...A,{...O,selected:!!i.value.find(C=>C.id===O.id)}],[])}),c=()=>{var v;((v=n==null?void 0:n.file)==null?void 0:v.type)==="file"&&S.pushAction(()=>Hn(n.file.fullpath)).res.then(A=>{i.value=A})},S=It(),p=M(()=>n.viewMode==="grid"?[r.gridThumbnailSize,r.gridThumbnailSize].join("x"):[r.largeGridThumbnailSize,r.largeGridThumbnailSize].join("x"));return(v,A)=>{const O=Ri,C=Rn,b=ai,l=li,a=Vn,o=Ce;return N(),W(o,{trigger:["contextmenu"],visible:T(r).longPressOpenContextMenu?typeof t.idx=="number"&&t.showMenuIdx===t.idx:void 0,"onUpdate:visible":A[3]||(A[3]=s=>typeof t.idx=="number"&&e("update:showMenuIdx",s?t.idx:-1))},{overlay:_(()=>[m(a,{onClick:A[2]||(A[2]=s=>e("contextMenuClick",s,t.file,t.idx))},{default:_(()=>[m(C,{key:"deleteFiles"},{default:_(()=>[j(D(v.$t("deleteSelected")),1)]),_:1}),t.file.type==="dir"?(N(),Y(de,{key:0},[m(C,{key:"openInNewTab"},{default:_(()=>[j(D(v.$t("openInNewTab")),1)]),_:1}),m(C,{key:"openOnTheRight"},{default:_(()=>[j(D(v.$t("openOnTheRight")),1)]),_:1}),m(C,{key:"openWithWalkMode"},{default:_(()=>[j(D(v.$t("openWithWalkMode")),1)]),_:1})],64)):pe("",!0),t.file.type==="file"?(N(),Y(de,{key:1},[T(re)(t.file.name)?(N(),Y(de,{key:0},[m(C,{key:"viewGenInfo"},{default:_(()=>[j(D(v.$t("viewGenerationInfo")),1)]),_:1}),m(b),m(C,{key:"send2txt2img"},{default:_(()=>[j(D(v.$t("sendToTxt2img")),1)]),_:1}),m(C,{key:"send2img2img"},{default:_(()=>[j(D(v.$t("sendToImg2img")),1)]),_:1}),m(C,{key:"send2inpaint"},{default:_(()=>[j(D(v.$t("sendToInpaint")),1)]),_:1}),m(C,{key:"send2extras"},{default:_(()=>[j(D(v.$t("sendToExtraFeatures")),1)]),_:1}),m(l,{key:"send2controlnet",title:v.$t("sendToControlNet")},{default:_(()=>[m(C,{key:"send2controlnet-txt2img"},{default:_(()=>[j(D(v.$t("t2i")),1)]),_:1}),m(C,{key:"send2controlnet-img2img"},{default:_(()=>[j(D(v.$t("i2i")),1)]),_:1})]),_:1},8,["title"]),m(C,{key:"send2savedDir"},{default:_(()=>[j(D(v.$t("send2savedDir")),1)]),_:1}),m(b),m(l,{key:"toggle-tag",title:v.$t("toggleTag")},{default:_(()=>[(N(!0),Y(de,null,$t(T(u),s=>(N(),W(C,{key:s.id},{default:_(()=>[j(D(s.name)+" ",1),s.selected?(N(),W(T(tr),{key:0})):(N(),W(T(nr),{key:1}))]),_:2},1024))),128))]),_:1},8,["title"]),m(C,{key:"openWithLocalFileBrowser"},{default:_(()=>[j(D(v.$t("openWithLocalFileBrowser")),1)]),_:1})],64)):pe("",!0),m(C,{key:"previewInNewWindow"},{default:_(()=>[j(D(v.$t("previewInNewWindow")),1)]),_:1}),m(C,{key:"download"},{default:_(()=>[j(D(v.$t("downloadDirectly")),1)]),_:1}),m(C,{key:"copyPreviewUrl"},{default:_(()=>[j(D(v.$t("copySourceFilePreviewLink")),1)]),_:1})],64)):pe("",!0)]),_:1})]),default:_(()=>[(N(),Y("li",{class:Fe(["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:A[0]||(A[0]=s=>e("dragstart",s,t.idx)),onContextmenu:c,onClickCapture:A[1]||(A[1]=s=>e("fileItemClick",s,t.file,t.idx))},[t.viewMode!=="line"?(N(),Y("div",bl,[T(re)(t.file.name)?(N(),W(O,{key:t.file.fullpath,class:Fe(`idx-${t.idx}`),src:T(r).enableThumbnail?T(Ha)(t.file,T(p)):T(xe)(t.file),fallback:T(ua),preview:{src:t.fullScreenPreviewImageUrl,onVisibleChange:(s,f)=>e("previewVisibleChange",s,f)}},null,8,["class","src","fallback","preview"])):(N(),Y("div",wl,[t.file.type==="file"?(N(),W(T(vn),{key:0,class:"icon center"})):(N(),W(T(pn),{key:1,class:"icon center"}))])),q("div",Sl,[q("div",Cl,D(t.file.name),1),q("div",Al,[q("div",null,D(t.file.size),1),q("div",null,D(t.file.date),1)])])])):(N(),Y(de,{key:1},[t.file.type==="file"?(N(),W(T(vn),{key:0,class:"icon"})):(N(),W(T(pn),{key:1,class:"icon"})),q("div",El,D(t.file.name),1),q("div",Ol,[q("div",null,D(t.file.size),1),q("div",null,D(t.file.date),1)])],64))],42,yl))]),_:1},8,["visible"])}}});const Yl=Un(Pl,[["__scopeId","data-v-1ba471ae"]]);function xl(t,e,n,r){const i={x:0,y:0};let u=0,c=0,S=typeof(r==null?void 0:r.width)=="number"?r.width:0,p=typeof(r==null?void 0:r.height)=="number"?r.height:0,v=typeof(r==null?void 0:r.left)=="number"?r.left:0,A=typeof(r==null?void 0:r.top)=="number"?r.top:0,O=!1;const C=f=>{f.stopPropagation(),f.preventDefault(),!(!t.value||!e.value)&&(u=f instanceof MouseEvent?f.clientX:f.touches[0].clientX,c=f instanceof MouseEvent?f.clientY:f.touches[0].clientY,S=t.value.offsetWidth,p=t.value.offsetHeight,i.x=e.value.offsetLeft,i.y=e.value.offsetTop,document.documentElement.addEventListener("mousemove",b),document.documentElement.addEventListener("touchmove",b),document.documentElement.addEventListener("mouseup",l),document.documentElement.addEventListener("touchend",l))},b=f=>{if(!t.value||!e.value)return;const P=S+((f instanceof MouseEvent?f.clientX:f.touches[0].clientX)-u),d=p+((f instanceof MouseEvent?f.clientY:f.touches[0].clientY)-c),x=i.x+((f instanceof MouseEvent?f.clientX:f.touches[0].clientX)-u),w=i.y+((f instanceof MouseEvent?f.clientY:f.touches[0].clientY)-c);t.value.style.width=`${P}px`,t.value.style.height=`${d}px`,e.value.style.left=`${x}px`,e.value.style.top=`${w}px`,r!=null&&r.onResize&&r.onResize(P,d)},l=()=>{document.documentElement.removeEventListener("mousemove",b),document.documentElement.removeEventListener("touchmove",b),document.documentElement.removeEventListener("mouseup",l),document.documentElement.removeEventListener("touchend",l)},a=f=>{f.stopPropagation(),f.preventDefault(),!(!t.value||!n.value)&&(O=!0,v=t.value.offsetLeft,A=t.value.offsetTop,u=f instanceof MouseEvent?f.clientX:f.touches[0].clientX,c=f instanceof MouseEvent?f.clientY:f.touches[0].clientY,document.documentElement.addEventListener("mousemove",o),document.documentElement.addEventListener("touchmove",o),document.documentElement.addEventListener("mouseup",s),document.documentElement.addEventListener("touchend",s))},o=f=>{if(!t.value||!n.value||!O)return;const P=v+((f instanceof MouseEvent?f.clientX:f.touches[0].clientX)-u),d=A+((f instanceof MouseEvent?f.clientY:f.touches[0].clientY)-c);t.value.style.left=`${P}px`,t.value.style.top=`${d}px`,r!=null&&r.onDrag&&r.onDrag(P,d)},s=()=>{O=!1,document.documentElement.removeEventListener("mousemove",o),document.documentElement.removeEventListener("touchmove",o),document.documentElement.removeEventListener("mouseup",s),document.documentElement.removeEventListener("touchend",s)};return Qe(()=>{!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`))}),Et(()=>{document.documentElement.removeEventListener("mousemove",b),document.documentElement.removeEventListener("touchmove",b),document.documentElement.removeEventListener("mouseup",l),document.documentElement.removeEventListener("touchend",l),document.documentElement.removeEventListener("mousemove",o),document.documentElement.removeEventListener("touchmove",o),document.documentElement.removeEventListener("mouseup",s),document.documentElement.removeEventListener("touchend",s)}),ae(()=>[t.value,e.value,n.value],([f,P,d])=>{f&&P&&d&&(P.addEventListener("mousedown",C),P.addEventListener("touchstart",C),d.addEventListener("mousedown",a),d.addEventListener("touchstart",a))}),{handleResizeMouseDown:C,handleDragMouseDown:a}}const Il=t=>(Qn("data-v-bbddd009"),t=t(),jn(),t),kl={class:"container"},$l={class:"action-bar"},Ll=Il(()=>q("div",{"flex-placeholder":""},null,-1)),_l={key:0,class:"action-bar"},Ml={key:0,class:"gen-info"},zl=se({__name:"fullScreenContextMenu",props:{file:null,idx:null},emits:["contextMenuClick"],setup(t,{emit:e}){const n=t,r=Pt(),i=z(),u=z([]),c=M(()=>{var l;return(((l=r.conf)==null?void 0:l.all_custom_tags)??[]).reduce((a,o)=>[...a,{...o,selected:!!u.value.find(s=>s.id===o.id)}],[])}),S=It(),p=z("");ae(()=>{var l;return(l=n==null?void 0:n.file)==null?void 0:l.fullpath},async l=>{l&&(S.tasks.forEach(a=>a.cancel()),S.pushAction(()=>Fn(l)).res.then(a=>{p.value=a}))},{immediate:!0});const v=l=>{l&&S.pushAction(()=>Hn(n.file.fullpath)).res.then(a=>{u.value=a})},A=z(),O=z(),C=oi("fullScreenContextMenu.vue-drag",{left:100,top:100,width:512,height:384,expanded:!0});xl(i,A,O,{...C.value,onDrag:ke(function(l,a){C.value={...C.value,left:l,top:a}},300),onResize:ke(function(l,a){C.value={...C.value,width:l,height:a}},300)});function b(l){return l.parentNode}return(l,a)=>{const o=Ze,s=Rn,f=Vn,P=Ce;return N(),Y("div",{ref_key:"el",ref:i,class:Fe(["full-screen-menu",{"unset-size":!T(C).expanded}]),onWheelCapture:a[4]||(a[4]=si(()=>{},["stop"]))},[q("div",kl,[q("div",$l,[q("div",{ref_key:"dragHandle",ref:O,class:"icon",style:{cursor:"grab"}},[m(T(Ca))],512),q("div",{class:"icon",style:{cursor:"pointer"},onClick:a[0]||(a[0]=d=>T(C).expanded=!T(C).expanded)},[T(C).expanded?(N(),W(T(Pa),{key:0})):(N(),W(T($a),{key:1}))]),Ll,T(C).expanded?(N(),Y("div",_l,[m(P,{trigger:["hover"],"get-popup-container":b,onVisibleChange:v},{overlay:_(()=>[m(f,{onClick:a[1]||(a[1]=d=>e("contextMenuClick",d,t.file,t.idx))},{default:_(()=>[(N(!0),Y(de,null,$t(T(c),d=>(N(),W(s,{key:`toggle-tag-${d.id}`},{default:_(()=>[j(D(d.name)+" ",1),d.selected?(N(),W(T(tr),{key:0})):(N(),W(T(nr),{key:1}))]),_:2},1024))),128))]),_:1})]),default:_(()=>[m(o,null,{default:_(()=>[j(D(l.$t("toggleTag")),1)]),_:1})]),_:1}),m(P,{trigger:["hover"],"get-popup-container":b},{overlay:_(()=>[m(f,{onClick:a[2]||(a[2]=d=>e("contextMenuClick",d,t.file,t.idx))},{default:_(()=>[m(s,{key:"send2txt2img"},{default:_(()=>[j(D(l.$t("sendToTxt2img")),1)]),_:1}),m(s,{key:"send2img2img"},{default:_(()=>[j(D(l.$t("sendToImg2img")),1)]),_:1}),m(s,{key:"send2inpaint"},{default:_(()=>[j(D(l.$t("sendToInpaint")),1)]),_:1}),m(s,{key:"send2extras"},{default:_(()=>[j(D(l.$t("sendToExtraFeatures")),1)]),_:1}),m(s,{key:"send2savedDir"},{default:_(()=>[j(D(l.$t("send2savedDir")),1)]),_:1}),m(s,{key:"deleteFiles",disabled:T(xe)(t.file)===T(r).fullscreenPreviewInitialUrl},{default:_(()=>[j(D(l.$t("deleteSelected")),1)]),_:1},8,["disabled"]),m(s,{key:"previewInNewWindow"},{default:_(()=>[j(D(l.$t("previewInNewWindow")),1)]),_:1}),m(s,{key:"download"},{default:_(()=>[j(D(l.$t("downloadDirectly")),1)]),_:1}),m(s,{key:"copyPreviewUrl"},{default:_(()=>[j(D(l.$t("copySourceFilePreviewLink")),1)]),_:1})]),_:1})]),default:_(()=>[m(o,null,{default:_(()=>[j(D(T(B)("openContextMenu")),1)]),_:1})]),_:1}),m(o,{onClick:a[3]||(a[3]=d=>T(kt)(p.value))},{default:_(()=>[j(D(l.$t("copyPrompt")),1)]),_:1})])):pe("",!0)]),T(C).expanded?(N(),Y("div",Ml,D(p.value),1)):pe("",!0)]),T(C).expanded?(N(),Y("div",{key:0,class:"mouse-sensor",ref_key:"resizeHandle",ref:A},[m(T(ma))],512)):pe("",!0)],34)}}});const Zl=Un(zl,[["__scopeId","data-v-bbddd009"]]);export{Ce as D,jl as L,Rl as R,Ql as S,Ul as a,Hl as b,Gl as c,Jl as d,Vl as e,Wl as f,st as g,Qa as h,ur as i,Yl as j,Zl as k,pt as l,Fl as s,xe as t,ge as u};