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