diff --git a/javascript/index.js b/javascript/index.js index e1f867a..3b4fb0e 100644 --- a/javascript/index.js +++ b/javascript/index.js @@ -12,7 +12,7 @@ Promise.resolve().then(async () => { Infinite Image Browsing - + diff --git a/scripts/iib/api.py b/scripts/iib/api.py index 2850c1b..009e625 100644 --- a/scripts/iib/api.py +++ b/scripts/iib/api.py @@ -598,14 +598,22 @@ def infinite_image_browsing_api(app: FastAPI, **kwargs): and_tags: List[int] or_tags: List[int] not_tags: List[int] + cursor: str + size = 200 @app.post(db_pre + "/match_images_by_tags", dependencies=[Depends(verify_secret)]) async def match_image_by_tags(req: MatchImagesByTagsReq): conn = DataBase.get_conn() - imgs = ImageTag.get_images_by_tags( - conn, {"and": req.and_tags, "or": req.or_tags, "not": req.not_tags} + imgs, next_cursor = ImageTag.get_images_by_tags( + conn=conn, + tag_dict={"and": req.and_tags, "or": req.or_tags, "not": req.not_tags}, + cursor=req.cursor, + limit=req.size ) - return filter_allowed_files([x.to_file_info() for x in imgs]) + return { + "files": filter_allowed_files([x.to_file_info() for x in imgs]), + "cursor": next_cursor + } @app.get(db_pre + "/img_selected_custom_tag", dependencies=[Depends(verify_secret)]) async def get_img_selected_custom_tag(path: str): @@ -711,10 +719,13 @@ def infinite_image_browsing_api(app: FastAPI, **kwargs): ImageTag.remove(conn, image_id=req.img_id, tag_id=req.tag_id) @app.get(db_pre + "/search_by_substr", dependencies=[Depends(verify_secret)]) - async def search_by_substr(substr: str): + async def search_by_substr(substr: str, cursor: str = '', size = 200): conn = DataBase.get_conn() - imgs = DbImg.find_by_substring(conn=conn, substring=substr) - return filter_allowed_files([x.to_file_info() for x in imgs]) + imgs, next_cursor = DbImg.find_by_substring(conn=conn, substring=substr, cursor=cursor, limit=size) + return { + "files": filter_allowed_files([x.to_file_info() for x in imgs]), + "cursor": next_cursor + } class ScannedPathModel(BaseModel): path: str diff --git a/scripts/iib/db/datamodel.py b/scripts/iib/db/datamodel.py index 3cf8c17..e889c16 100644 --- a/scripts/iib/db/datamodel.py +++ b/scripts/iib/db/datamodel.py @@ -21,6 +21,12 @@ class FileInfoDict(TypedDict): bytes: bytes created_time: float fullpath: str + +class Cursor: + def __init__(self, has_next = True, next = ''): + self.has_next = has_next + self.next = next + class DataBase: local = threading.local() @@ -74,6 +80,7 @@ class Image: "date": self.date, "created_date": self.date, "size": human_readable_size(self.size), + "is_under_scanned_path": True, "bytes": self.size, "name": os.path.basename(self.path), "fullpath": self.path, @@ -163,6 +170,8 @@ class Image: @classmethod def safe_batch_remove(cls, conn: Connection, image_ids: List[int]) -> None: + if not(image_ids): + return with closing(conn.cursor()) as cur: try: placeholders = ",".join("?" * len(image_ids)) @@ -174,12 +183,18 @@ class Image: conn.commit() @classmethod - def find_by_substring(cls, conn: Connection, substring: str, limit: int = 500) -> List["Image"]: + def find_by_substring(cls, conn: Connection, substring: str, limit: int = 500, cursor = '') -> tuple[List["Image"], Cursor]: + api_cur = Cursor() with closing(conn.cursor()) as cur: - cur.execute("SELECT * FROM image WHERE path LIKE ? OR exif LIKE ? ORDER BY date DESC LIMIT ?", - (f"%{substring}%", f"%{substring}%", limit)) + if cursor: + sql = f"SELECT * FROM image WHERE (path LIKE ? OR exif LIKE ?) AND (date < ?) ORDER BY date DESC LIMIT ?" + cur.execute(sql, (f"%{substring}%", f"%{substring}%", cursor, limit)) + else: + sql = "SELECT * FROM image WHERE path LIKE ? OR exif LIKE ? ORDER BY date DESC LIMIT ?" + cur.execute(sql, (f"%{substring}%", f"%{substring}%", limit)) rows = cur.fetchall() - + + api_cur.has_next = len(rows) >= limit images = [] deleted_ids = [] for row in rows: @@ -188,8 +203,10 @@ class Image: images.append(img) else: deleted_ids.append(img.id) - cls.safe_batch_remove(conn, deleted_ids) - return images + cls.safe_batch_remove(conn, deleted_ids) + if images: + api_cur.next = str(images[-1].date) + return images, api_cur class Tag: @@ -352,8 +369,8 @@ class ImageTag: @classmethod def get_images_by_tags( - cls, conn: Connection, tag_dict: Dict[str, List[int]], limit: int = 500 - ) -> List[Image]: + cls, conn: Connection, tag_dict: Dict[str, List[int]], limit: int = 500, cursor = '' + ) -> tuple[List[Image], Cursor]: query = """ SELECT image.id, image.path, image.size,image.date FROM image @@ -392,6 +409,9 @@ class ImageTag: )""".format(",".join("?" * len(tag_ids))) ) params.extend(tag_ids) + if cursor: + where_clauses.append("(image.date < ?)") + params.append(cursor) if where_clauses: query += " WHERE " + " AND ".join(where_clauses) @@ -404,6 +424,7 @@ class ImageTag: query += " ORDER BY date DESC LIMIT ?" params.append(limit) + api_cur = Cursor() with closing(conn.cursor()) as cur: cur.execute(query, params) rows = cur.fetchall() @@ -416,7 +437,10 @@ class ImageTag: else: deleted_ids.append(img.id) Image.safe_batch_remove(conn, deleted_ids) - return images + api_cur.has_next = len(rows) >= limit + if images: + api_cur.next = str(images[-1].date) + return images, api_cur @classmethod def batch_get_tags_by_path(cls, conn: Connection, paths: List[str], type = "custom") -> Dict[str, List[Tag]]: diff --git a/vue/dist/assets/FileItem-a4a4ada7.js b/vue/dist/assets/FileItem-dbdcf20b.js similarity index 55% rename from vue/dist/assets/FileItem-a4a4ada7.js rename to vue/dist/assets/FileItem-dbdcf20b.js index 0a2d1f1..cd78dd3 100644 --- a/vue/dist/assets/FileItem-a4a4ada7.js +++ b/vue/dist/assets/FileItem-dbdcf20b.js @@ -1,4 +1,4 @@ -var ln=Object.defineProperty;var sn=(e,t,n)=>t in e?ln(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Qe=(e,t,n)=>(sn(e,typeof t!="symbol"?t+"":t,n),n);import{P as Te,c3 as on,a as ne,d as he,bq as Bt,u as ze,c as w,bZ as Mt,_ as cn,V as de,a0 as we,aj as V,bL as ot,a3 as ct,bo as un,h as ie,c4 as dn,b as fn,ay as vn,c5 as pn,a2 as ut,bK as hn,c6 as mn,c7 as gn,$ as H,b0 as yn,z as te,aA as bn,a1 as wn,ag as ce,c8 as An,aR as kn,c9 as Sn,ca as Cn,aM as $t,am as Be,bn as Ye,cb as In,cc as En,c2 as ke,cd as _n,ce as On,R as ue,ai as L,U as Pn,cf as Ze,x as R,cg as Nt,ch as dt,ci as xn,cj as Tn,ck as zt,cl as G,k as Xe,ah as Bn,cm as Ft,ar as ee,cn as et,l as pe,aC as Me,aw as Mn,ap as De,co as $n,cp as ft,an as Qt,bQ as vt,bP as Nn,cq as Ee,cr as zn,aD as Fn,bO as Dt,cs as Qn,ct as Dn,t as Ve,as as pt,al as me,cu as ht,c1 as Ln,L as oe,J as Rn,bX as mt,cv as jn,cw as Hn,bW as Vn,cx as Un,cy as Jn,cz as Wn,at as Kn,au as qn,ax as Lt,o as x,m as J,cA as Gn,cB as Yn,cC as Zn,cD as Xn,cE as ei,a5 as ti,y as W,cF as Se,C as Y,n as $,A as $e,cG as gt,bG as ni,cH as ii,B as ai,N as ye,v as j,r as K,W as Rt,cI as ri,b_ as li,M as jt,cJ as si,cK as oi,p as se,ae as ci,cL as ui,X as di}from"./index-f1d763a2.js";import{h as fi,r as vi,a as pi,t as hi}from"./db-328ec51d.js";import{t as Le,l as fe,C as mi,g as gi}from"./shortcut-6ab7aba6.js";var Ht=function(){return{arrow:{type:[Boolean,Object],default:void 0},trigger:{type:[Array,String]},overlay:Te.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}}},Re=on(),yi=function(){return ne(ne({},Ht()),{},{type:Re.type,size:String,htmlType:Re.htmlType,href:String,disabled:{type:Boolean,default:void 0},prefixCls:String,icon:Te.any,title:String,loading:Re.loading,onClick:{type:Function}})},bi=["type","disabled","loading","htmlType","class","overlay","trigger","align","visible","onVisibleChange","placement","href","title","icon","mouseEnterDelay","mouseLeaveDelay","overlayClassName","overlayStyle","destroyPopupOnHide","onClick","onUpdate:visible"],wi=de.Group;const Ne=he({compatConfig:{MODE:3},name:"ADropdownButton",inheritAttrs:!1,__ANT_BUTTON:!0,props:Bt(yi(),{trigger:"hover",placement:"bottomRight",type:"default"}),slots:["icon","leftButton","rightButton","overlay"],setup:function(t,n){var i=n.slots,a=n.attrs,r=n.emit,v=function(S){r("update:visible",S),r("visibleChange",S)},c=ze("dropdown-button",t),h=c.prefixCls,y=c.direction,d=c.getPopupContainer;return function(){var m,S,p=ne(ne({},t),a),l=p.type,s=l===void 0?"default":l,o=p.disabled,f=p.loading,A=p.htmlType,g=p.class,u=g===void 0?"":g,I=p.overlay,k=I===void 0?(m=i.overlay)===null||m===void 0?void 0:m.call(i):I,_=p.trigger,E=p.align,T=p.visible;p.onVisibleChange;var C=p.placement,Q=C===void 0?y.value==="rtl"?"bottomLeft":"bottomRight":C,N=p.href,F=p.title,O=p.icon,M=O===void 0?((S=i.icon)===null||S===void 0?void 0:S.call(i))||w(Mt,null,null):O,D=p.mouseEnterDelay,b=p.mouseLeaveDelay,P=p.overlayClassName,z=p.overlayStyle,Z=p.destroyPopupOnHide,U=p.onClick;p["onUpdate:visible"];var X=cn(p,bi),q={align:E,disabled:o,trigger:o?[]:_,placement:Q,getPopupContainer:d.value,onVisibleChange:v,mouseEnterDelay:D,mouseLeaveDelay:b,visible:T,overlayClassName:P,overlayStyle:z,destroyPopupOnHide:Z},re=w(de,{type:s,disabled:o,loading:f,onClick:U,htmlType:A,href:N,title:F},{default:i.default}),le=w(de,{type:s,icon:M},null);return w(wi,ne(ne({},X),{},{class:we(h.value,u)}),{default:function(){return[i.leftButton?i.leftButton({button:re}):re,w(ve,q,{default:function(){return[i.rightButton?i.rightButton({button:le}):le]},overlay:function(){return k}})]}})}}});var Vt=he({compatConfig:{MODE:3},name:"ADropdown",inheritAttrs:!1,props:Bt(Ht(),{mouseEnterDelay:.15,mouseLeaveDelay:.1,placement:"bottomLeft",trigger:"hover"}),slots:["overlay"],setup:function(t,n){var i=n.slots,a=n.attrs,r=n.emit,v=ze("dropdown",t),c=v.prefixCls,h=v.rootPrefixCls,y=v.direction,d=v.getPopupContainer,m=V(function(){var s=t.placement,o=s===void 0?"":s,f=t.transitionName;return f!==void 0?f:o.indexOf("top")>=0?"".concat(h.value,"-slide-down"):"".concat(h.value,"-slide-up")}),S=function(){var o,f,A,g=t.overlay||((o=i.overlay)===null||o===void 0?void 0:o.call(i)),u=Array.isArray(g)?g[0]:g;if(!u)return null;var I=u.props||{};ot(!I.mode||I.mode==="vertical","Dropdown",'mode="'.concat(I.mode,`" is not supported for Dropdown's Menu.`));var k=I.selectable,_=k===void 0?!1:k,E=I.expandIcon,T=E===void 0?(f=u.children)===null||f===void 0||(A=f.expandIcon)===null||A===void 0?void 0:A.call(f):E,C=typeof T<"u"&&ut(T)?T:w("span",{class:"".concat(c.value,"-menu-submenu-arrow")},[w(hn,{class:"".concat(c.value,"-menu-submenu-arrow-icon")},null)]),Q=ut(u)?ct(u,{mode:"vertical",selectable:_,expandIcon:function(){return C}}):u;return Q},p=V(function(){var s=t.placement;if(!s)return y.value==="rtl"?"bottomRight":"bottomLeft";if(s.includes("Center")){var o=s.slice(0,s.indexOf("Center"));return ot(!s.includes("Center"),"Dropdown","You are using '".concat(s,"' placement in Dropdown, which is deprecated. Try to use '").concat(o,"' instead.")),o}return s}),l=function(o){r("update:visible",o),r("visibleChange",o)};return function(){var s,o,f=t.arrow,A=t.trigger,g=t.disabled,u=t.overlayClassName,I=(s=i.default)===null||s===void 0?void 0:s.call(i)[0],k=ct(I,un({class:we(I==null||(o=I.props)===null||o===void 0?void 0:o.class,ie({},"".concat(c.value,"-rtl"),y.value==="rtl"),"".concat(c.value,"-trigger"))},g?{disabled:g}:{})),_=we(u,ie({},"".concat(c.value,"-rtl"),y.value==="rtl")),E=g?[]:A,T;E&&E.indexOf("contextmenu")!==-1&&(T=!0);var C=dn({arrowPointAtCenter:fn(f)==="object"&&f.pointAtCenter,autoAdjustOverflow:!0}),Q=vn(ne(ne(ne({},t),a),{},{builtinPlacements:C,overlayClassName:_,arrow:f,alignPoint:T,prefixCls:c.value,getPopupContainer:d.value,transitionName:m.value,trigger:E,onVisibleChange:l,placement:p.value}),["overlay","onUpdate:visible"]);return w(pn,Q,{default:function(){return[k]},overlay:S})}}});Vt.Button=Ne;const ve=Vt;var Ai=function(){return{prefixCls:String,checked:{type:Boolean,default:void 0},onChange:{type:Function},onClick:{type:Function},"onUpdate:checked":Function}},ki=he({compatConfig:{MODE:3},name:"ACheckableTag",props:Ai(),setup:function(t,n){var i=n.slots,a=n.emit,r=ze("tag",t),v=r.prefixCls,c=function(d){var m=t.checked;a("update:checked",!m),a("change",!m),a("click",d)},h=V(function(){var y;return we(v.value,(y={},ie(y,"".concat(v.value,"-checkable"),!0),ie(y,"".concat(v.value,"-checkable-checked"),t.checked),y))});return function(){var y;return w("span",{class:h.value,onClick:c},[(y=i.default)===null||y===void 0?void 0:y.call(i)])}}});const Ue=ki;var Si=new RegExp("^(".concat(mn.join("|"),")(-inverse)?$")),Ci=new RegExp("^(".concat(gn.join("|"),")$")),Ii=function(){return{prefixCls:String,color:{type:String},closable:{type:Boolean,default:!1},closeIcon:Te.any,visible:{type:Boolean,default:void 0},onClose:{type:Function},"onUpdate:visible":Function,icon:Te.any}},be=he({compatConfig:{MODE:3},name:"ATag",props:Ii(),slots:["closeIcon","icon"],setup:function(t,n){var i=n.slots,a=n.emit,r=n.attrs,v=ze("tag",t),c=v.prefixCls,h=v.direction,y=H(!0);yn(function(){t.visible!==void 0&&(y.value=t.visible)});var d=function(l){l.stopPropagation(),a("update:visible",!1),a("close",l),!l.defaultPrevented&&t.visible===void 0&&(y.value=!1)},m=V(function(){var p=t.color;return p?Si.test(p)||Ci.test(p):!1}),S=V(function(){var p;return we(c.value,(p={},ie(p,"".concat(c.value,"-").concat(t.color),m.value),ie(p,"".concat(c.value,"-has-color"),t.color&&!m.value),ie(p,"".concat(c.value,"-hidden"),!y.value),ie(p,"".concat(c.value,"-rtl"),h.value==="rtl"),p))});return function(){var p,l,s,o=t.icon,f=o===void 0?(p=i.icon)===null||p===void 0?void 0:p.call(i):o,A=t.color,g=t.closeIcon,u=g===void 0?(l=i.closeIcon)===null||l===void 0?void 0:l.call(i):g,I=t.closable,k=I===void 0?!1:I,_=function(){return k?u?w("span",{class:"".concat(c.value,"-close-icon"),onClick:d},[u]):w(wn,{class:"".concat(c.value,"-close-icon"),onClick:d},null):null},E={backgroundColor:A&&!m.value?A:void 0},T=f||null,C=(s=i.default)===null||s===void 0?void 0:s.call(i),Q=T?w(te,null,[T,w("span",null,[C])]):C,N="onClick"in r,F=w("span",{class:S.value,style:E},[Q,_()]);return N?w(bn,null,{default:function(){return[F]}}):F}}});be.CheckableTag=Ue;be.install=function(e){return e.component(be.name,be),e.component(Ue.name,Ue),e};const Ei=be;ve.Button=Ne;ve.install=function(e){return e.component(ve.name,ve),e.component(Ne.name,Ne),e};var _i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3a32.05 32.05 0 00.6 45.3l183.7 179.1-43.4 252.9a31.95 31.95 0 0046.4 33.7L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3z"}}]},name:"star",theme:"filled"};const Oi=_i;function yt(e){for(var t=1;t{document.addEventListener(...e),$t(()=>document.removeEventListener(...e))},Ui="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghgg0Aj8i0JO4OzsrPv69Wv+hi2qPHr0qNvf39+iI97soRIh4f3z58/u7du3SXX7Xt7Z2enevHmzfQe+oSN2apSAPj09TSrb+XKI/f379+08+A0cNRE2ANkupk+ACNPvkSPcAAEibACyXUyfABGm3yNHuAECRNgAZLuYPgEirKlHu7u7XdyytGwHAd8jjNyng4OD7vnz51dbPT8/7z58+NB9+/bt6jU/TI+AGWHEnrx48eJ/EsSmHzx40L18+fLyzxF3ZVMjEyDCiEDjMYZZS5wiPXnyZFbJaxMhQIQRGzHvWR7XCyOCXsOmiDAi1HmPMMQjDpbpEiDCiL358eNHurW/5SnWdIBbXiDCiA38/Pnzrce2YyZ4//59F3ePLNMl4PbpiL2J0L979+7yDtHDhw8vtzzvdGnEXdvUigSIsCLAWavHp/+qM0BcXMd/q25n1vF57TYBp0a3mUzilePj4+7k5KSLb6gt6ydAhPUzXnoPR0dHl79WGTNCfBnn1uvSCJdegQhLI1vvCk+fPu2ePXt2tZOYEV6/fn31dz+shwAR1sP1cqvLntbEN9MxA9xcYjsxS1jWR4AIa2Ibzx0tc44fYX/16lV6NDFLXH+YL32jwiACRBiEbf5KcXoTIsQSpzXx4N28Ja4BQoK7rgXiydbHjx/P25TaQAJEGAguWy0+2Q8PD6/Ki4R8EVl+bzBOnZY95fq9rj9zAkTI2SxdidBHqG9+skdw43borCXO/ZcJdraPWdv22uIEiLA4q7nvvCug8WTqzQveOH26fodo7g6uFe/a17W3+nFBAkRYENRdb1vkkz1CH9cPsVy/jrhr27PqMYvENYNlHAIesRiBYwRy0V+8iXP8+/fvX11Mr7L7ECueb/r48eMqm7FuI2BGWDEG8cm+7G3NEOfmdcTQw4h9/55lhm7DekRYKQPZF2ArbXTAyu4kDYB2YxUzwg0gi/41ztHnfQG26HbGel/crVrm7tNY+/1btkOEAZ2M05r4FB7r9GbAIdxaZYrHdOsgJ/wCEQY0J74TmOKnbxxT9n3FgGGWWsVdowHtjt9Nnvf7yQM2aZU/TIAIAxrw6dOnAWtZZcoEnBpNuTuObWMEiLAx1HY0ZQJEmHJ3HNvGCBBhY6jtaMoEiJB0Z29vL6ls58vxPcO8/zfrdo5qvKO+d3Fx8Wu8zf1dW4p/cPzLly/dtv9Ts/EbcvGAHhHyfBIhZ6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg==",Ce=new WeakMap;function Ji(e,t){return{useHookShareState:i=>{const a=En();Be(a),Ce.has(a)||(Ce.set(a,Ye(e(a,i??(t==null?void 0:t())))),$t(()=>{Ce.delete(a)}));const r=Ce.get(a);return Be(r),{state:r,toRefs(){return In(r)}}}}}var Wi={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-600 72h560v208H232V136zm560 480H232V408h560v208zm0 272H232V680h560v208zM304 240a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"database",theme:"outlined"};const Ki=Wi;function At(e){for(var t=1;t(await ke.value.get("/files",{params:{folder_path:e}})).data,oa=async e=>(await ke.value.post("/delete_files",{file_paths:e})).data,Kt=async(e,t,n)=>(await ke.value.post("/move_files",{file_paths:e,dest:t,create_dest_folder:n})).data,ca=async(e,t,n)=>(await ke.value.post("/copy_files",{file_paths:e,dest:t,create_dest_folder:n})).data,ua=async e=>{await ke.value.post("/mkdirs",{dest_folder:e})};var qt={exports:{}};/* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress - * @license MIT */(function(e,t){(function(n,i){e.exports=i})(_n,function(){var n={};n.version="0.3.5";var i=n.settings={minimum:.08,easing:"linear",positionUsing:"",speed:200,trickle:!0,trickleSpeed:200,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'
'};n.configure=function(l){var s,o;for(s in l)o=l[s],o!==void 0&&l.hasOwnProperty(s)&&(i[s]=o);return this},n.status=null,n.set=function(l){var s=n.isStarted();l=a(l,i.minimum,1),n.status=l===1?null:l;var o=n.render(!s),f=o.querySelector(i.barSelector),A=i.speed,g=i.easing;return o.offsetWidth,c(function(u){i.positionUsing===""&&(i.positionUsing=n.getPositioningCSS()),h(f,v(l,A,g)),l===1?(h(o,{transition:"none",opacity:1}),o.offsetWidth,setTimeout(function(){h(o,{transition:"all "+A+"ms linear",opacity:0}),setTimeout(function(){n.remove(),u()},A)},A)):setTimeout(u,A)}),this},n.isStarted=function(){return typeof n.status=="number"},n.start=function(){n.status||n.set(0);var l=function(){setTimeout(function(){n.status&&(n.trickle(),l())},i.trickleSpeed)};return i.trickle&&l(),this},n.done=function(l){return!l&&!n.status?this:n.inc(.3+.5*Math.random()).set(1)},n.inc=function(l){var s=n.status;return s?s>1?void 0:(typeof l!="number"&&(s>=0&&s<.2?l=.1:s>=.2&&s<.5?l=.04:s>=.5&&s<.8?l=.02:s>=.8&&s<.99?l=.005:l=0),s=a(s+l,0,.994),n.set(s)):n.start()},n.trickle=function(){return n.inc()},function(){var l=0,s=0;n.promise=function(o){return!o||o.state()==="resolved"?this:(s===0&&n.start(),l++,s++,o.always(function(){s--,s===0?(l=0,n.done()):n.set((l-s)/l)}),this)}}(),n.getElement=function(){var l=n.getParent();if(l){var s=Array.prototype.slice.call(l.querySelectorAll(".nprogress")).filter(function(o){return o.parentElement===l});if(s.length>0)return s[0]}return null},n.getParent=function(){if(i.parent instanceof HTMLElement)return i.parent;if(typeof i.parent=="string")return document.querySelector(i.parent)},n.render=function(l){if(n.isRendered())return n.getElement();d(document.documentElement,"nprogress-busy");var s=document.createElement("div");s.id="nprogress",s.className="nprogress",s.innerHTML=i.template;var o=s.querySelector(i.barSelector),f=l?"-100":r(n.status||0),A=n.getParent(),g;return h(o,{transition:"all 0 linear",transform:"translate3d("+f+"%,0,0)"}),i.showSpinner||(g=s.querySelector(i.spinnerSelector),g&&p(g)),A!=document.body&&d(A,"nprogress-custom-parent"),A.appendChild(s),s},n.remove=function(){n.status=null,m(document.documentElement,"nprogress-busy"),m(n.getParent(),"nprogress-custom-parent");var l=n.getElement();l&&p(l)},n.isRendered=function(){return!!n.getElement()},n.getPositioningCSS=function(){var l=document.body.style,s="WebkitTransform"in l?"Webkit":"MozTransform"in l?"Moz":"msTransform"in l?"ms":"OTransform"in l?"O":"";return s+"Perspective"in l?"translate3d":s+"Transform"in l?"translate":"margin"};function a(l,s,o){return lo?o:l}function r(l){return(-1+l)*100}function v(l,s,o){var f;return i.positionUsing==="translate3d"?f={transform:"translate3d("+r(l)+"%,0,0)"}:i.positionUsing==="translate"?f={transform:"translate("+r(l)+"%,0)"}:f={"margin-left":r(l)+"%"},f.transition="all "+s+"ms "+o,f}var c=function(){var l=[];function s(){var o=l.shift();o&&o(s)}return function(o){l.push(o),l.length==1&&s()}}(),h=function(){var l=["Webkit","O","Moz","ms"],s={};function o(u){return u.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(I,k){return k.toUpperCase()})}function f(u){var I=document.body.style;if(u in I)return u;for(var k=l.length,_=u.charAt(0).toUpperCase()+u.slice(1),E;k--;)if(E=l[k]+_,E in I)return E;return u}function A(u){return u=o(u),s[u]||(s[u]=f(u))}function g(u,I,k){I=A(I),u.style[I]=k}return function(u,I){var k=arguments,_,E;if(k.length==2)for(_ in I)E=I[_],E!==void 0&&I.hasOwnProperty(_)&&g(u,_,E);else g(u,k[1],k[2])}}();function y(l,s){var o=typeof l=="string"?l:S(l);return o.indexOf(" "+s+" ")>=0}function d(l,s){var o=S(l),f=o+s;y(o,s)||(l.className=f.substring(1))}function m(l,s){var o=S(l),f;y(l,s)&&(f=o.replace(" "+s+" "," "),l.className=f.substring(1,f.length-1))}function S(l){return(" "+(l&&l.className||"")+" ").replace(/\s+/gi," ")}function p(l){l&&l.parentNode&&l.parentNode.removeChild(l)}return n})})(qt);var da=qt.exports;const fa=On(da),va=e=>{const t=H("");return new Promise(n=>{ue.confirm({title:L("inputFolderName"),content:()=>w(Pn,{value:t.value,"onUpdate:value":i=>t.value=i},null),async onOk(){if(!t.value)return;const i=Ze(e,t.value);await ua(i),n()}})})},Gt=()=>w("p",{style:{background:"var(--zp-secondary-background)",padding:"8px",borderLeft:"4px solid var(--primary-color)"}},[R("Tips: "),L("multiSelectTips")]);function pa(){const e=[];for(let a=0;a<72;a++){const v=`hsl(${a*7.2}, 90%, 35%)`;e.push(v)}return e}const It=pa(),Yt=Nt("useTagStore",()=>{const e=Ye(new Map),t=async r=>{if(r=r.filter(v=>!e.has(v)),!!r.length)try{r.forEach(c=>e.set(c,[]));const v=await fi(r);for(const c in v)e.set(c,v[c])}catch{r.forEach(v=>e.delete(v))}},n=new Map;return{tagMap:e,getColor:r=>{let v=n.get(r);if(!v){const c=dt.hash.sha256.hash(r),h=parseInt(dt.codec.hex.fromBits(c),16)%It.length;v=It[h],n.set(r,v)}return v},fetchImageTags:t,refreshTags:async r=>{r.forEach(v=>e.delete(v)),await t(r)}}}),ha=Nt("useBatchDownloadStore",()=>{const e=H([]);return{selectdFiles:e,addFiles:n=>{e.value=xn([...e.value,...n])}}});class Et{constructor(t,n=Tn.CREATED_TIME_DESC){Qe(this,"root");Qe(this,"execQueue",[]);this.sortMethod=n,this.root={children:[],info:{name:t,size:"-",bytes:0,created_time:"",is_under_scanned_path:!0,date:"",type:"dir",fullpath:t}},this.fetchChildren(this.root)}reset(){return this.root.children=[],this.fetchChildren(this.root)}get images(){const t=n=>n.children.map(i=>{if(i.info.type==="dir")return t(i);if(G(i.info.name))return i.info}).filter(i=>i).flat(1);return t(this.root)}get isCompleted(){return this.execQueue.length===0}async fetchChildren(t){const{files:n}=await ge(t.info.fullpath);return t.children=zt(n,this.sortMethod).map(i=>({info:i,children:[]})),this.execQueue.shift(),this.execQueue.unshift(...t.children.filter(i=>i.info.type==="dir").map(i=>({fn:()=>this.fetchChildren(i),...i}))),t}async next(){const t=Di(this.execQueue);if(!t)return null;const n=await t.fn();return this.execQueue=this.execQueue.slice(),this.root={...this.root},n}}function je(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!Vn(e)}const _e=new Map,B=Xe(),ma=ha(),Zt=Yt(),_t=Bn(),Ie=new BroadcastChannel("iib-image-transfer-bus"),{eventEmitter:Oe,useEventListen:Je}=Ft(),{useHookShareState:ae}=Ji((e,{images:t})=>{const n=H({tabIdx:-1,paneIdx:-1}),i=V(()=>fe(a.value)),a=H([]),r=V(()=>{var A;return a.value.map(g=>g.curr).slice((A=B.conf)!=null&&A.is_win?1:0)}),v=V(()=>Ze(...r.value)),c=H(B.defaultSortingMethod),h=H(n.value.walkModePath?new Et(n.value.walkModePath,c.value):void 0);pe([()=>n.value.walkModePath,c],()=>{h.value=n.value.walkModePath?new Et(n.value.walkModePath,c.value):void 0});const y=Ye(new Set);pe(i,()=>y.clear());const d=V(()=>{var I;if(t.value)return t.value;if(h.value)return h.value.images.filter(k=>!y.has(k.fullpath));if(!i.value)return[];const A=((I=i.value)==null?void 0:I.files)??[],g=c.value;return zt((k=>B.onlyFoldersAndImages?k.filter(_=>_.type==="dir"||G(_.name)):k)(A),g).filter(k=>!y.has(k.fullpath))}),m=H([]),S=H(-1),p=V(()=>h.value?!h.value.isCompleted:!1),l=H(!1),s=H(!1),o=()=>{var A,g,u;return(u=(g=(A=B.tabList)==null?void 0:A[n.value.tabIdx])==null?void 0:g.panes)==null?void 0:u[n.value.paneIdx]},f=Ft();return f.useEventListen("selectAll",()=>{console.log(`select all 0 -> ${d.value.length}`),m.value=Jt(0,d.value.length)}),{previewing:s,spinning:l,canLoadNext:p,multiSelectedIdxs:m,previewIdx:S,basePath:r,currLocation:v,currPage:i,stack:a,sortMethod:c,sortedFiles:d,scroller:H(),stackViewEl:H(),props:n,getPane:o,walker:h,deletedFiles:y,...f}},()=>({images:H()}));function ir(){const{previewIdx:e,eventEmitter:t,canLoadNext:n,previewing:i,sortedFiles:a,scroller:r,props:v}=ae().toRefs(),{state:c}=ae();let h=null;const y=(p,l)=>{var s;i.value=p,h!=null&&!p&&l&&((s=r.value)==null||s.scrollToItem(h),h=null)},d=()=>{v.value.walkModePath&&!S("next")&&n&&(ee.info(L("loadingNextFolder")),t.value.emit("loadNextDir",!0))};Ae("keydown",p=>{var l;if(i.value){let s=e.value;if(["ArrowDown","ArrowRight"].includes(p.key))for(s++;a.value[s]&&!G(a.value[s].name);)s++;else if(["ArrowUp","ArrowLeft"].includes(p.key))for(s--;a.value[s]&&!G(a.value[s].name);)s--;if(G((l=a.value[s])==null?void 0:l.name)??""){e.value=s;const o=r.value;o&&!(s>=o.$_startIndex&&s<=o.$_endIndex)&&(h=s)}d()}});const m=p=>{var s;let l=e.value;if(p==="next")for(l++;a.value[l]&&!G(a.value[l].name);)l++;else if(p==="prev")for(l--;a.value[l]&&!G(a.value[l].name);)l--;if(G((s=a.value[l])==null?void 0:s.name)??""){e.value=l;const o=r.value;o&&!(l>=o.$_startIndex&&l<=o.$_endIndex)&&(h=l)}d()},S=p=>{var s;let l=e.value;if(p==="next")for(l++;a.value[l]&&!G(a.value[l].name);)l++;else if(p==="prev")for(l--;a.value[l]&&!G(a.value[l].name);)l--;return G((s=a.value[l])==null?void 0:s.name)??""};return Je("removeFiles",async()=>{var p;i.value&&!c.sortedFiles[e.value]&&(ee.info(L("manualExitFullScreen"),5),await et(500),(p=document.querySelector(".ant-image-preview-operations-operation .anticon-close"))==null||p.click(),e.value=-1)}),{previewIdx:e,onPreviewVisibleChange:y,previewing:i,previewImgMove:m,canPreview:S}}function ar(){const e=H(),{scroller:t,stackViewEl:n,stack:i,currPage:a,currLocation:r,useEventListen:v,eventEmitter:c,getPane:h,props:y,deletedFiles:d,walker:m,sortedFiles:S}=ae().toRefs();pe(()=>i.value.length,Me((b,P)=>{var z;b!==P&&((z=t.value)==null||z.scrollToItem(0))},300));const p=async b=>{var P;await A(b),y.value.walkModePath&&(await et(),await((P=m.value)==null?void 0:P.reset()),c.value.emit("loadNextDir"))};Mn(async()=>{var b;if(!i.value.length){const P=await ge("/");i.value.push({files:P.files,curr:"/"})}e.value=new fa,e.value.configure({parent:n.value}),y.value.path&&y.value.path!=="/"?await p(y.value.walkModePath??y.value.path):(b=B.conf)!=null&&b.home&&A(B.conf.home)}),pe(r,Me(b=>{const P=h.value();if(!P)return;P.path=b;const z=P.path.split("/").pop(),U=(()=>{var X;if(!y.value.walkModePath){const q=Ee(b);for(const[re,le]of Object.entries(B.pathAliasMap))if(q.startsWith(le))return q.replace(le,re);return z}return"Walk: "+(((X=B.quickMovePaths.find(q=>q.dir===P.walkModePath))==null?void 0:X.zh)??z)})();P.name=De("div",{style:"display:flex;align-items:center"},[De(Gi),De("span",{class:"line-clamp-1",style:"max-width: 256px"},U)]),P.nameFallbackStr=U,B.recent=B.recent.filter(X=>X.key!==P.key),B.recent.unshift({path:b,key:P.key}),B.recent.length>20&&(B.recent=B.recent.slice(0,20))},300));const l=()=>Ve(r.value),s=async b=>{var P,z;if(b.type==="dir")try{(P=e.value)==null||P.start();const{files:Z}=await ge(b.fullpath);i.value.push({files:Z,curr:b.name})}finally{(z=e.value)==null||z.done()}},o=b=>{for(;b(Be(B.conf,"global.conf load failed"),B.conf.is_win?b.toLowerCase()==P.toLowerCase():b==P),A=async b=>{var z,Z;const P=i.value.slice();try{$n(b)||(b=Ze(((z=B.conf)==null?void 0:z.sd_cwd)??"/",b));const U=ft(b),X=i.value.map(q=>q.curr);for(X.shift();X[0]&&U[0]&&f(X[0],U[0]);)X.shift(),U.shift();for(let q=0;qf(le.name,q));if(!re)throw console.error({frags:U,frag:q,stack:Qt(i.value)}),new Error(`${q} not found`);await s(re)}}catch(U){throw ee.error(L("moveFailedCheckPath")+(U instanceof Error?U.message:"")),console.error(b,ft(b),a.value),i.value=P,U}},g=vt(async()=>{var b,P,z;try{if((b=e.value)==null||b.start(),m.value)await m.value.reset(),c.value.emit("loadNextDir");else{const{files:Z}=await ge(i.value.length===1?"/":r.value);fe(i.value).files=Z}d.value.clear(),(P=t.value)==null||P.scrollToItem(0),ee.success(L("refreshCompleted"))}finally{(z=e.value)==null||z.done()}});Nn("returnToIIB",vt(async()=>{var b,P;if(!y.value.walkModePath)try{(b=e.value)==null||b.start();const{files:z}=await ge(i.value.length===1?"/":r.value);fe(i.value).files.map(U=>U.date).join()!==z.map(U=>U.date).join()&&(fe(i.value).files=z,ee.success(L("autoUpdate")))}finally{(P=e.value)==null||P.done()}})),v.value("refresh",g);const u=b=>{y.value.walkModePath&&(h.value().walkModePath=b),p(b)},I=V(()=>B.quickMovePaths.map(b=>({...b,path:Ee(b.dir)}))),k=V(()=>{const b=Ee(r.value);return I.value.find(z=>z.path===b)}),_=async()=>{const b=k.value;if(b){if(!b.can_delete)return;await vi(r.value),ee.success(L("removeCompleted"))}else await pi(r.value),ee.success(L("addCompleted"));pt.emit("searchIndexExpired"),pt.emit("updateGlobalSetting")},E=H(!1),T=H(r.value),C=()=>{E.value=!0,T.value=r.value},Q=async()=>{await A(T.value),E.value=!1};Ae("click",()=>{E.value=!1});const N=()=>{const b=parent.location,P=b.href.substring(0,b.href.length-b.search.length),z=new URLSearchParams(b.search);z.set("action","open"),m.value&&z.set("walk","1"),z.set("path",r.value);const Z=`${P}?${z.toString()}`;Ve(Z,L("copyLocationUrlSuccessMsg"))},F=()=>c.value.emit("selectAll"),O=async()=>{await va(r.value),await g()},M=()=>{const b=r.value;_e.set(b,i.value);const P=B.tabList[y.value.tabIdx],z={type:"local",key:me(),path:b,name:L("local"),stackKey:b,walkModePath:b};P.panes.push(z),P.key=z.key},D=V(()=>!m.value&&S.value.some(b=>b.type==="dir"));return{locInputValue:T,isLocationEditing:E,onLocEditEnter:Q,onEditBtnClick:C,addToSearchScanPathAndQuickMove:_,searchPathInfo:k,refresh:g,copyLocation:l,back:o,openNext:s,currPage:a,currLocation:r,to:A,stack:i,scroller:t,share:N,selectAll:F,quickMoveTo:u,onCreateFloderBtnClick:O,onWalkBtnClick:M,showWalkButton:D}}function rr(){const{scroller:e,sortedFiles:t,sortMethod:n,currLocation:i,stackViewEl:a,canLoadNext:r,previewIdx:v,props:c,walker:h}=ae().toRefs(),{state:y}=ae(),d=H(!1),m=H(B.defaultGridCellWidth),S=V(()=>m.value+16),p=44,{width:l}=zn(a),s=V(()=>~~(l.value/S.value)),o=V(()=>{const k=S.value;return{first:k+(m.value<=160?0:p),second:k}}),f=H(!1),A=async()=>{var k;if(!(f.value||!c.value.walkModePath||!r.value))try{f.value=!0,await((k=h.value)==null?void 0:k.next())}finally{f.value=!1}},g=async(k=!1)=>{const _=e.value,E=()=>k?v.value:(_==null?void 0:_.$_endIndex)??0;for(;!t.value.length||E()>t.value.length-20&&r.value;)await et(30),await A()};y.useEventListen("loadNextDir",g);const u=()=>{const k=e.value;if(k){const _=t.value.slice(Math.max(k.$_startIndex-10,0),k.$_endIndex+10).filter(E=>E.is_under_scanned_path&&G(E.name)).map(E=>E.fullpath);Zt.fetchImageTags(_)}};pe(i,Me(u,150));const I=Me(()=>{g(),u()},300);return{gridItems:s,sortedFiles:t,sortMethodConv:Fn,moreActionsDropdownShow:d,gridSize:S,sortMethod:n,onScroll:I,loadNextDir:A,loadNextDirLoading:f,canLoadNext:r,itemSize:o,cellWidth:m,onViewedImagesChange:u}}function lr(){const{currLocation:e,sortedFiles:t,currPage:n,multiSelectedIdxs:i,eventEmitter:a,walker:r}=ae().toRefs(),v=()=>{i.value=[]};return Ae("click",v),Ae("blur",v),pe(n,v),{onFileDragStart:(d,m)=>{const S=Qt(t.value[m]);_t.fileDragging=!0,console.log("onFileDragStart set drag file ",d,m,S);const p=[S];let l=S.type==="dir";if(i.value.includes(m)){const o=i.value.map(f=>t.value[f]);p.push(...o),l=o.some(f=>f.type==="dir")}const s={includeDir:l,loc:e.value||"search-result",path:ht(p,"fullpath").map(o=>o.fullpath),nodes:ht(p,"fullpath"),__id:"FileTransferData"};d.dataTransfer.setData("text/plain",JSON.stringify(s))},onDrop:async d=>{if(r.value)return;const m=Ln(d);if(!m)return;const S=e.value;if(m.loc===S)return;const p=Dt(),l=async()=>p.pushAction(async()=>{await ca(m.path,S),a.value.emit("refresh"),ue.destroyAll()}),s=()=>p.pushAction(async()=>{await Kt(m.path,S),Oe.emit("removeFiles",{paths:m.path,loc:m.loc}),a.value.emit("refresh"),ue.destroyAll()});ue.confirm({title:L("confirm")+"?",width:"60vw",content:()=>{let o,f,A;return w("div",null,[w("div",null,[`${L("moveSelectedFilesTo")} ${S}`,w("ol",{style:{maxHeight:"50vh",overflow:"auto"}},[m.path.map(g=>w("li",null,[g.split(/[/\\]/).pop()]))])]),w(Gt,null,null),w("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end"},class:"actions"},[w(de,{onClick:ue.destroyAll},je(o=L("cancel"))?o:{default:()=>[o]}),w(de,{type:"primary",loading:!p.isIdle,onClick:l},je(f=L("copy"))?f:{default:()=>[f]}),w(de,{type:"primary",loading:!p.isIdle,onClick:s},je(A=L("move"))?A:{default:()=>[A]})])])},maskClosable:!0,wrapClassName:"hidden-antd-btns-modal"})},multiSelectedIdxs:i,onFileDragEnd:()=>{_t.fileDragging=!1}}}function sr({openNext:e}){const t=H(!1),n=H(""),{sortedFiles:i,previewIdx:a,multiSelectedIdxs:r,stack:v,currLocation:c,spinning:h,previewing:y,stackViewEl:d,eventEmitter:m,props:S,deletedFiles:p}=ae().toRefs(),l=Ee;Je("removeFiles",({paths:g,loc:u})=>{l(u)!==l(c.value)||!fe(v.value)||(g.forEach(k=>p.value.add(k)),g.filter(G).forEach(k=>p.value.add(k.replace(/\.\w+$/,".txt"))))}),Je("addFiles",({files:g,loc:u})=>{if(l(u)!==l(c.value))return;const I=fe(v.value);I&&I.files.unshift(...g)});const s=Dt(),o=async(g,u,I)=>{a.value=I,B.fullscreenPreviewInitialUrl=oe(u);const k=r.value.indexOf(I);if(g.shiftKey){if(k!==-1)r.value.splice(k,1);else{r.value.push(I),r.value.sort((T,C)=>T-C);const _=r.value[0],E=r.value[r.value.length-1];r.value=Jt(_,E+1)}g.stopPropagation()}else g.ctrlKey||g.metaKey?(k!==-1?r.value.splice(k,1):r.value.push(I),g.stopPropagation()):await e(u)},f=async(g,u,I)=>{var Q,N,F;const k=oe(u),_=c.value,E={IIB_container_id:parent.IIB_container_id},T=()=>{let O=[];return r.value.includes(I)?O=r.value.map(M=>i.value[M]):O.push(u),O},C=async O=>{if(!h.value)try{h.value=!0,await Un(u.fullpath),Ie.postMessage({...E,event:"click_hidden_button",btnEleId:"iib_hidden_img_update_trigger"});const M=setTimeout(()=>Jn.warn({message:L("long_loading"),duration:20}),5e3);await Wn(),clearTimeout(M),Ie.postMessage({...E,event:"click_hidden_button",btnEleId:`iib_hidden_tab_${O}`})}catch(M){console.error(M),ee.error("发送图像失败,请携带console的错误消息找开发者")}finally{h.value=!1}};if(`${g.key}`.startsWith("toggle-tag-")){const O=+`${g.key}`.split("toggle-tag-")[1],{is_remove:M}=await hi({tag_id:O,img_path:u.fullpath}),D=(N=(Q=B.conf)==null?void 0:Q.all_custom_tags.find(b=>b.id===O))==null?void 0:N.name;Zt.refreshTags([u.fullpath]),ee.success(L(M?"removedTagFromImage":"addedTagToImage",{tag:D}));return}switch(g.key){case"previewInNewWindow":return window.open(k);case"download":{const O=T();Hn(O.map(M=>oe(M,!0)));break}case"copyPreviewUrl":return Ve(parent.document.location.origin+k);case"send2txt2img":return C("txt2img");case"send2img2img":return C("img2img");case"send2inpaint":return C("inpaint");case"send2extras":return C("extras");case"send2savedDir":{const O=B.quickMovePaths.find(b=>b.key==="outdir_save");if(!O)return ee.error(L("unknownSavedDir"));const M=jn(O.dir,(F=B.conf)==null?void 0:F.sd_cwd),D=T();await Kt(D.map(b=>b.fullpath),M,!0),Oe.emit("removeFiles",{paths:D.map(b=>b.fullpath),loc:c.value}),Oe.emit("addFiles",{files:D,loc:M});break}case"send2controlnet-img2img":case"send2controlnet-txt2img":{const O=g.key.split("-")[1];Ie.postMessage({...E,event:"send_to_control_net",type:O,url:oe(u)});break}case"send2outpaint":{n.value=await s.pushAction(()=>mt(u.fullpath)).res;const[O,M]=(n.value||"").split(` -`);Ie.postMessage({...E,event:"send_to_outpaint",url:oe(u),prompt:O,negPrompt:M.slice(17)});break}case"openWithWalkMode":{_e.set(_,v.value);const O=B.tabList[S.value.tabIdx],M={type:"local",key:me(),path:u.fullpath,name:L("local"),stackKey:_,walkModePath:u.fullpath};O.panes.push(M),O.key=M.key;break}case"openInNewTab":{_e.set(_,v.value);const O=B.tabList[S.value.tabIdx],M={type:"local",key:me(),path:u.fullpath,name:L("local"),stackKey:_};O.panes.push(M),O.key=M.key;break}case"openOnTheRight":{_e.set(_,v.value);let O=B.tabList[S.value.tabIdx+1];O||(O={panes:[],key:"",id:me()},B.tabList[S.value.tabIdx+1]=O);const M={type:"local",key:me(),path:u.fullpath,name:L("local"),stackKey:_};O.panes.push(M),O.key=M.key;break}case"send2BatchDownload":{ma.addFiles(T());break}case"viewGenInfo":{t.value=!0,n.value=await s.pushAction(()=>mt(u.fullpath)).res;break}case"openWithLocalFileBrowser":{await Rn(u.fullpath);break}case"deleteFiles":{const O=T(),M=async()=>{const D=O.map(b=>b.fullpath);await oa(D),ee.success(L("deleteSuccess")),Oe.emit("removeFiles",{paths:D,loc:c.value})};if(O.length===1&&B.ignoredConfirmActions.deleteOneOnly)return M();await new Promise(D=>{ue.confirm({title:L("confirmDelete"),maskClosable:!0,width:"60vw",content:()=>w("div",null,[w("ol",{style:{maxHeight:"50vh",overflow:"auto"}},[O.map(b=>w("li",null,[b.fullpath.split(/[/\\]/).pop()]))]),w(Gt,null,null),w(mi,{checked:B.ignoredConfirmActions.deleteOneOnly,"onUpdate:checked":b=>B.ignoredConfirmActions.deleteOneOnly=b},{default:()=>[L("deleteOneOnlySkipConfirm"),R(" ("),L("resetOnGlobalSettingsPage"),R(")")]})]),async onOk(){await M(),D()}})});break}}return{}},{isOutside:A}=Qn(d);return Ae("keydown",g=>{var I,k,_;const u=gi(g);if(y.value){const E=(I=Object.entries(B.shortcut).find(T=>T[1]===u&&T[1]))==null?void 0:I[0];if(E){g.stopPropagation(),g.preventDefault();const T=a.value,C=i.value[T];switch(E){case"delete":return oe(C)===B.fullscreenPreviewInitialUrl?ee.warn(L("fullscreenRestriction")):f({key:"deleteFiles"},C,T);default:{const Q=(k=/^toggle_tag_(.*)$/.exec(E))==null?void 0:k[1],N=(_=B.conf)==null?void 0:_.all_custom_tags.find(F=>F.name===Q);return N?f({key:`toggle-tag-${N.id}`},C,T):void 0}}}}else!A.value&&["Ctrl + KeyA","Cmd + KeyA"].includes(u)&&(g.preventDefault(),g.stopPropagation(),m.value.emit("selectAll"))}),{onFileItemClick:o,onContextMenuClick:f,showGenInfo:t,imageGenInfo:n,q:s}}const or=()=>{const{stackViewEl:e}=ae().toRefs(),t=H(-1);return Dn(e,n=>{var a;let i=n.target;for(;i.parentElement;)if(i=i.parentElement,i.tagName.toLowerCase()==="li"&&i.classList.contains("file-item-trigger")){const r=(a=i.dataset)==null?void 0:a.idx;r&&Number.isSafeInteger(+r)&&(t.value=+r);return}}),{showMenuIdx:t}};function ga(){var e=window.navigator.userAgent,t=e.indexOf("MSIE ");if(t>0)return parseInt(e.substring(t+5,e.indexOf(".",t)),10);var n=e.indexOf("Trident/");if(n>0){var i=e.indexOf("rv:");return parseInt(e.substring(i+3,e.indexOf(".",i)),10)}var a=e.indexOf("Edge/");return a>0?parseInt(e.substring(a+5,e.indexOf(".",a)),10):-1}let Pe;function We(){We.init||(We.init=!0,Pe=ga()!==-1)}var Fe={name:"ResizeObserver",props:{emitOnMount:{type:Boolean,default:!1},ignoreWidth:{type:Boolean,default:!1},ignoreHeight:{type:Boolean,default:!1}},emits:["notify"],mounted(){We(),Lt(()=>{this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitOnMount&&this.emitSize()});const e=document.createElement("object");this._resizeObject=e,e.setAttribute("aria-hidden","true"),e.setAttribute("tabindex",-1),e.onload=this.addResizeHandlers,e.type="text/html",Pe&&this.$el.appendChild(e),e.data="about:blank",Pe||this.$el.appendChild(e)},beforeUnmount(){this.removeResizeHandlers()},methods:{compareAndNotify(){(!this.ignoreWidth&&this._w!==this.$el.offsetWidth||!this.ignoreHeight&&this._h!==this.$el.offsetHeight)&&(this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitSize())},emitSize(){this.$emit("notify",{width:this._w,height:this._h})},addResizeHandlers(){this._resizeObject.contentDocument.defaultView.addEventListener("resize",this.compareAndNotify),this.compareAndNotify()},removeResizeHandlers(){this._resizeObject&&this._resizeObject.onload&&(!Pe&&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=Gn();Kn("data-v-b329ee4c");const ba={class:"resize-observer",tabindex:"-1"};qn();const wa=ya((e,t,n,i,a,r)=>(x(),J("div",ba)));Fe.render=wa;Fe.__scopeId="data-v-b329ee4c";Fe.__file="src/components/ResizeObserver.vue";function xe(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?xe=function(t){return typeof t}:xe=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xe(e)}function Aa(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ot(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,i=new Array(t);n2&&arguments[2]!==void 0?arguments[2]:{},i,a,r,v=function(h){for(var y=arguments.length,d=new Array(y>1?y-1:0),m=1;m1){var y=c.find(function(m){return m.isIntersecting});y&&(h=y)}if(a.callback){var d=h.isIntersecting&&h.intersectionRatio>=a.threshold;if(d===a.oldResult)return;a.oldResult=d,a.callback(d,h)}},this.options.intersection),Lt(function(){a.observer&&a.observer.observe(a.el)})}}},{key:"destroyObserver",value:function(){this.observer&&(this.observer.disconnect(),this.observer=null),this.callback&&this.callback._clear&&(this.callback._clear(),this.callback=null)}},{key:"threshold",get:function(){return this.options.intersection&&typeof this.options.intersection.threshold=="number"?this.options.intersection.threshold:0}}]),e}();function en(e,t,n){var i=t.value;if(i)if(typeof IntersectionObserver>"u")console.warn("[vue-observe-visibility] IntersectionObserver API is not available in your browser. Please install this polyfill: https://github.com/w3c/IntersectionObserver/tree/master/polyfill");else{var a=new Pa(e,i,n);e._vue_visibilityState=a}}function xa(e,t,n){var i=t.value,a=t.oldValue;if(!Xt(i,a)){var r=e._vue_visibilityState;if(!i){tn(e);return}r?r.createObserver(i,n):en(e,{value:i},n)}}function tn(e){var t=e._vue_visibilityState;t&&(t.destroyObserver(),delete e._vue_visibilityState)}var Ta={beforeMount:en,updated:xa,unmounted:tn},Ba={itemsLimit:1e3},Ma=/(auto|scroll)/;function nn(e,t){return e.parentNode===null?t:nn(e.parentNode,t.concat([e]))}var He=function(t,n){return getComputedStyle(t,null).getPropertyValue(n)},$a=function(t){return He(t,"overflow")+He(t,"overflow-y")+He(t,"overflow-x")},Na=function(t){return Ma.test($a(t))};function xt(e){if(e instanceof HTMLElement||e instanceof SVGElement){for(var t=nn(e.parentNode,[]),n=0;n{this.$_prerender=!1,this.updateVisibleItems(!0),this.ready=!0})},activated(){const e=this.$_lastUpdateScrollPosition;typeof e=="number"&&this.$nextTick(()=>{this.scrollToPosition(e)})},beforeUnmount(){this.removeListeners()},methods:{addView(e,t,n,i,a){const r=Yn({id:Da++,index:t,used:!0,key:i,type:a}),v=Zn({item:n,position:0,nr:r});return e.push(v),v},unuseView(e,t=!1){const n=this.$_unusedViews,i=e.nr.type;let a=n.get(i);a||(a=[],n.set(i,a)),a.push(e),t||(e.nr.used=!1,e.position=-9999)},handleResize(){this.$emit("resize"),this.ready&&this.updateVisibleItems(!1)},handleScroll(e){if(!this.$_scrollDirty){if(this.$_scrollDirty=!0,this.$_updateTimeout)return;const t=()=>requestAnimationFrame(()=>{this.$_scrollDirty=!1;const{continuous:n}=this.updateVisibleItems(!1,!0);n||(clearTimeout(this.$_refreshTimout),this.$_refreshTimout=setTimeout(this.handleScroll,this.updateInterval+100))});t(),this.updateInterval&&(this.$_updateTimeout=setTimeout(()=>{this.$_updateTimeout=0,this.$_scrollDirty&&t()},this.updateInterval))}},handleVisibilityChange(e,t){this.ready&&(e||t.boundingClientRect.width!==0||t.boundingClientRect.height!==0?(this.$emit("visible"),requestAnimationFrame(()=>{this.updateVisibleItems(!1)})):this.$emit("hidden"))},updateVisibleItems(e,t=!1){const n=this.itemSize,i=this.gridItems||1,a=this.itemSecondarySize||n,r=this.$_computedMinItemSize,v=this.typeField,c=this.simpleArray?null:this.keyField,h=this.items,y=h.length,d=this.sizes,m=this.$_views,S=this.$_unusedViews,p=this.pool,l=this.itemIndexByKey;let s,o,f,A,g;if(!y)s=o=A=g=f=0;else if(this.$_prerender)s=A=0,o=g=Math.min(this.prerender,h.length),f=null;else{const C=this.getScroll();if(t){let F=C.start-this.$_lastUpdateScrollPosition;if(F<0&&(F=-F),n===null&&FC.start&&(M=D),D=~~((O+M)/2);while(D!==b);for(D<0&&(D=0),s=D,f=d[y-1].accumulator,o=D;oy&&(o=y)),A=s;Ay&&(o=y),A<0&&(A=0),g>y&&(g=y),f=Math.ceil(y/i)*n}}o-s>Ba.itemsLimit&&this.itemsLimitError(),this.totalSize=f;let u;const I=s<=this.$_endIndex&&o>=this.$_startIndex;if(I)for(let C=0,Q=p.length;C=o)&&this.unuseView(u));const k=I?null:new Map;let _,E,T;for(let C=s;C=N.length)&&(u=this.addView(p,C,_,Q,E),this.unuseView(u,!0),N=S.get(E)),u=N[T],k.set(E,T+1)),m.delete(u.nr.key),u.nr.used=!0,u.nr.index=C,u.nr.key=Q,u.nr.type=E,m.set(Q,u),F=!0;else if(!u.nr.used&&(u.nr.used=!0,u.nr.index=C,F=!0,N)){const O=N.indexOf(u);O!==-1&&N.splice(O,1)}u.item=_,F&&(C===h.length-1&&this.$emit("scroll-end"),C===0&&this.$emit("scroll-start")),n===null?(u.position=d[C-1].accumulator,u.offset=0):(u.position=Math.floor(C/i)*n,u.offset=C%i*a)}return this.$_startIndex=s,this.$_endIndex=o,this.emitUpdate&&this.$emit("update",s,o,A,g),clearTimeout(this.$_sortTimer),this.$_sortTimer=setTimeout(this.sortViews,this.updateInterval+300),{continuous:I}},getListenerTarget(){let e=xt(this.$el);return window.document&&(e===window.document.documentElement||e===window.document.body)&&(e=window),e},getScroll(){const{$el:e,direction:t}=this,n=t==="vertical";let i;if(this.pageMode){const a=e.getBoundingClientRect(),r=n?a.height:a.width;let v=-(n?a.top:a.left),c=n?window.innerHeight:window.innerWidth;v<0&&(c+=v,v=0),v+c>r&&(c=r-v),i={start:v,end:v+c}}else n?i={start:e.scrollTop,end:e.scrollTop+e.clientHeight}:i={start:e.scrollLeft,end:e.scrollLeft+e.clientWidth};return i},applyPageMode(){this.pageMode?this.addListeners():this.removeListeners()},addListeners(){this.listenerTarget=this.getListenerTarget(),this.listenerTarget.addEventListener("scroll",this.handleScroll,Ge?{passive:!0}:!1),this.listenerTarget.addEventListener("resize",this.handleResize)},removeListeners(){this.listenerTarget&&(this.listenerTarget.removeEventListener("scroll",this.handleScroll),this.listenerTarget.removeEventListener("resize",this.handleResize),this.listenerTarget=null)},scrollToItem(e){let t;const n=this.gridItems||1;this.itemSize===null?t=e>0?this.sizes[e-1].accumulator:0:t=Math.floor(e/n)*this.itemSize,this.scrollToPosition(t)},scrollToPosition(e){const t=this.direction==="vertical"?{scroll:"scrollTop",start:"top"}:{scroll:"scrollLeft",start:"left"};let n,i,a;if(this.pageMode){const r=xt(this.$el),v=r.tagName==="HTML"?0:r[t.scroll],c=r.getBoundingClientRect(),y=this.$el.getBoundingClientRect()[t.start]-c[t.start];n=r,i=t.scroll,a=e+v+y}else n=this.$el,i=t.scroll,a=e;n[i]=a},itemsLimitError(){throw setTimeout(()=>{console.log("It seems the scroller element isn't scrolling, so it tries to render all the items at once.","Scroller:",this.$el),console.log("Make sure the scroller has a fixed height (or width) and 'overflow-y' (or 'overflow-x') set to 'auto' so it can scroll correctly and only render the items visible in the scroll viewport.")}),new Error("Rendered items limit reached")},sortViews(){this.pool.sort((e,t)=>e.nr.index-t.nr.index)}}};const La={key:0,ref:"before",class:"vue-recycle-scroller__slot"},Ra={key:1,ref:"after",class:"vue-recycle-scroller__slot"};function ja(e,t,n,i,a,r){const v=Xn("ResizeObserver"),c=ei("observe-visibility");return ti((x(),W("div",{class:ye(["vue-recycle-scroller",{ready:a.ready,"page-mode":n.pageMode,[`direction-${e.direction}`]:!0}]),onScrollPassive:t[0]||(t[0]=(...h)=>r.handleScroll&&r.handleScroll(...h))},[e.$slots.before?(x(),W("div",La,[Se(e.$slots,"before")],512)):Y("v-if",!0),(x(),J(gt(n.listTag),{ref:"wrapper",style:ai({[e.direction==="vertical"?"minHeight":"minWidth"]:a.totalSize+"px"}),class:ye(["vue-recycle-scroller__item-wrapper",n.listClass])},{default:$(()=>[(x(!0),W(te,null,$e(a.pool,h=>(x(),J(gt(n.itemTag),ni({key:h.nr.id,style:a.ready?{transform:`translate${e.direction==="vertical"?"Y":"X"}(${h.position}px) translate${e.direction==="vertical"?"X":"Y"}(${h.offset}px)`,width:n.gridItems?`${e.direction==="vertical"&&n.itemSecondarySize||n.itemSize}px`:void 0,height:n.gridItems?`${e.direction==="horizontal"&&n.itemSecondarySize||n.itemSize}px`:void 0}:null,class:["vue-recycle-scroller__item-view",[n.itemClass,{hover:!n.skipHover&&a.hoverKey===h.nr.key}]]},ii(n.skipHover?{}:{mouseenter:()=>{a.hoverKey=h.nr.key},mouseleave:()=>{a.hoverKey=null}})),{default:$(()=>[Se(e.$slots,"default",{item:h.item,index:h.nr.index,active:h.nr.used})]),_:2},1040,["style","class"]))),128)),Se(e.$slots,"empty")]),_:3},8,["style","class"])),e.$slots.after?(x(),W("div",Ra,[Se(e.$slots,"after")],512)):Y("v-if",!0),w(v,{onNotify:r.handleResize},null,8,["onNotify"])],34)),[[c,r.handleVisibilityChange]])}an.render=ja;an.__file="src/components/RecycleScroller.vue";const Tt=he({__name:"ContextMenu",props:{file:{},idx:{},selectedTag:{},disableDelete:{type:Boolean}},emits:["contextMenuClick"],setup(e,{emit:t}){const n=e,i=Xe(),a=V(()=>{var r;return(((r=i.conf)==null?void 0:r.all_custom_tags)??[]).reduce((v,c)=>[...v,{...c,selected:!!n.selectedTag.find(h=>h.id===c.id)}],[])});return(r,v)=>{const c=Rt,h=ri,y=li,d=jt;return x(),J(d,{onClick:v[0]||(v[0]=m=>t("contextMenuClick",m,r.file,r.idx))},{default:$(()=>{var m;return[w(c,{key:"deleteFiles",disabled:r.disableDelete},{default:$(()=>[R(j(r.$t("deleteSelected")),1)]),_:1},8,["disabled"]),r.file.type==="dir"?(x(),W(te,{key:0},[w(c,{key:"openInNewTab"},{default:$(()=>[R(j(r.$t("openInNewTab")),1)]),_:1}),w(c,{key:"openOnTheRight"},{default:$(()=>[R(j(r.$t("openOnTheRight")),1)]),_:1}),w(c,{key:"openWithWalkMode"},{default:$(()=>[R(j(r.$t("openWithWalkMode")),1)]),_:1})],64)):Y("",!0),r.file.type==="file"?(x(),W(te,{key:1},[K(G)(r.file.name)?(x(),W(te,{key:0},[w(c,{key:"viewGenInfo"},{default:$(()=>[R(j(r.$t("viewGenerationInfo")),1)]),_:1}),w(h),((m=K(i).conf)==null?void 0:m.launch_mode)!=="server"?(x(),W(te,{key:0},[w(c,{key:"send2txt2img"},{default:$(()=>[R(j(r.$t("sendToTxt2img")),1)]),_:1}),w(c,{key:"send2img2img"},{default:$(()=>[R(j(r.$t("sendToImg2img")),1)]),_:1}),w(c,{key:"send2inpaint"},{default:$(()=>[R(j(r.$t("sendToInpaint")),1)]),_:1}),w(c,{key:"send2extras"},{default:$(()=>[R(j(r.$t("sendToExtraFeatures")),1)]),_:1}),w(y,{key:"sendToThirdPartyExtension",title:r.$t("sendToThirdPartyExtension")},{default:$(()=>[w(c,{key:"send2controlnet-txt2img"},{default:$(()=>[R("ControlNet - "+j(r.$t("t2i")),1)]),_:1}),w(c,{key:"send2controlnet-img2img"},{default:$(()=>[R("ControlNet - "+j(r.$t("i2i")),1)]),_:1}),w(c,{key:"send2outpaint"},{default:$(()=>[R("openOutpaint")]),_:1})]),_:1},8,["title"])],64)):Y("",!0),w(c,{key:"send2BatchDownload"},{default:$(()=>[R(j(r.$t("sendToBatchDownload")),1)]),_:1}),w(c,{key:"send2savedDir"},{default:$(()=>[R(j(r.$t("send2savedDir")),1)]),_:1}),w(h),w(y,{key:"toggle-tag",title:r.$t("toggleTag")},{default:$(()=>[(x(!0),W(te,null,$e(a.value,S=>(x(),J(c,{key:`toggle-tag-${S.id}`},{default:$(()=>[R(j(S.name)+" ",1),S.selected?(x(),J(K(Ut),{key:0})):(x(),J(K(Wt),{key:1}))]),_:2},1024))),128))]),_:1},8,["title"]),w(c,{key:"openWithLocalFileBrowser"},{default:$(()=>[R(j(r.$t("openWithLocalFileBrowser")),1)]),_:1})],64)):Y("",!0),w(c,{key:"previewInNewWindow"},{default:$(()=>[R(j(r.$t("previewInNewWindow")),1)]),_:1}),w(c,{key:"download"},{default:$(()=>[R(j(r.$t("download")),1)]),_:1}),w(c,{key:"copyPreviewUrl"},{default:$(()=>[R(j(r.$t("copySourceFilePreviewLink")),1)]),_:1})],64)):Y("",!0)]}),_:1})}}}),Ha=["data-idx"],Va={key:1,class:"more"},Ua={class:"float-btn-wrap"},Ja={key:0,class:"tags-container"},Wa={key:3,class:"preview-icon-wrap"},Ka={key:4,class:"profile"},qa={class:"name line-clamp-1"},Ga={class:"basic-info"},Ya=he({__name:"FileItem",props:{file:{},idx:{},selected:{type:Boolean,default:!1},showMenuIdx:{},cellWidth:{},fullScreenPreviewImageUrl:{},enableRightClickMenu:{type:Boolean,default:!0},enableCloseIcon:{type:Boolean,default:!1}},emits:["update:showMenuIdx","fileItemClick","dragstart","dragend","previewVisibleChange","contextMenuClick","close-icon-click"],setup(e,{emit:t}){const n=e;si(d=>({"48583e07":d.$props.cellWidth+"px"}));const i=Xe(),a=Yt(),r=V(()=>a.tagMap.get(n.file.fullpath)??[]),v=V(()=>{const d=i.gridThumbnailResolution;return i.enableThumbnail?oi(n.file,[d,d].join("x")):oe(n.file)}),c=V(()=>{var d;return(((d=i.conf)==null?void 0:d.all_custom_tags)??[]).reduce((m,S)=>[...m,{...S,selected:!!r.value.find(p=>p.id===S.id)}],[])}),h=V(()=>c.value.find(d=>d.type==="custom"&&d.name==="like")),y=()=>{Be(h.value),t("contextMenuClick",{key:`toggle-tag-${h.value.id}`},n.file,n.idx)};return(d,m)=>{const S=ve,p=Rt,l=jt,s=ui,o=Ei;return x(),J(S,{trigger:["contextmenu"],visible:K(i).longPressOpenContextMenu?typeof d.idx=="number"&&d.showMenuIdx===d.idx:void 0,"onUpdate:visible":m[7]||(m[7]=f=>typeof d.idx=="number"&&t("update:showMenuIdx",f?d.idx:-1))},{overlay:$(()=>[d.enableRightClickMenu?(x(),J(Tt,{key:0,file:d.file,idx:d.idx,"selected-tag":r.value,onContextMenuClick:m[6]||(m[6]=(f,A,g)=>t("contextMenuClick",f,A,g))},null,8,["file","idx","selected-tag"])):Y("",!0)]),default:$(()=>[(x(),W("li",{class:ye(["file file-item-trigger grid",{clickable:d.file.type==="dir",selected:d.selected}]),"data-idx":d.idx,key:d.file.name,draggable:"true",onDragstart:m[3]||(m[3]=f=>t("dragstart",f,d.idx)),onDragend:m[4]||(m[4]=f=>t("dragend",f,d.idx)),onClickCapture:m[5]||(m[5]=f=>t("fileItemClick",f,d.file,d.idx))},[se("div",null,[d.enableCloseIcon?(x(),W("div",{key:0,class:"close-icon",onClick:m[0]||(m[0]=f=>t("close-icon-click"))},[w(K(ci))])):Y("",!0),d.enableRightClickMenu?(x(),W("div",Va,[w(S,null,{overlay:$(()=>[w(Tt,{file:d.file,idx:d.idx,"selected-tag":r.value,onContextMenuClick:m[1]||(m[1]=(f,A,g)=>t("contextMenuClick",f,A,g))},null,8,["file","idx","selected-tag"])]),default:$(()=>[se("div",Ua,[w(K(Mt))])]),_:1}),d.file.type==="file"?(x(),J(S,{key:0},{overlay:$(()=>[c.value.length>1?(x(),J(l,{key:0,onClick:m[2]||(m[2]=f=>t("contextMenuClick",f,d.file,d.idx))},{default:$(()=>[(x(!0),W(te,null,$e(c.value,f=>(x(),J(p,{key:`toggle-tag-${f.id}`},{default:$(()=>[R(j(f.name)+" ",1),f.selected?(x(),J(K(Ut),{key:0})):(x(),J(K(Wt),{key:1}))]),_:2},1024))),128))]),_:1})):Y("",!0)]),default:$(()=>{var f,A;return[se("div",{class:ye(["float-btn-wrap",{"like-selected":(f=h.value)==null?void 0:f.selected}]),onClick:y},[(A=h.value)!=null&&A.selected?(x(),J(K(ea),{key:0})):(x(),J(K(aa),{key:1}))],2)]}),_:1})):Y("",!0)])):Y("",!0),K(G)(d.file.name)?(x(),W("div",{style:{position:"relative"},key:d.file.fullpath,class:ye(`idx-${d.idx}`)},[w(s,{src:v.value,fallback:K(Ui),preview:{src:d.fullScreenPreviewImageUrl,onVisibleChange:(f,A)=>t("previewVisibleChange",f,A)}},null,8,["src","fallback","preview"]),r.value&&d.cellWidth>128?(x(),W("div",Ja,[(x(!0),W(te,null,$e(r.value,f=>(x(),J(o,{key:f.id,color:K(a).getColor(f.name)},{default:$(()=>[R(j(f.name),1)]),_:2},1032,["color"]))),128))])):Y("",!0)],2)):(x(),W("div",Wa,[d.file.type==="file"?(x(),J(K(Mi),{key:0,class:"icon center"})):(x(),J(K(Fi),{key:1,class:"icon center"}))])),d.cellWidth>128?(x(),W("div",Ka,[se("div",qa,j(d.file.name),1),se("div",Ga,[se("div",null,j(d.file.size),1),se("div",null,j(d.file.date),1)])])):Y("",!0)])],42,Ha))]),_:1},8,["visible"])}}});const cr=di(Ya,[["__scopeId","data-v-0c11fc42"]]);export{ve as D,cr as F,Tt as _,ar as a,rr as b,lr as c,sr as d,ir as e,or as f,an as g,Yt as h,Je as i,Ae as j,ha as k,_e as s,ae as u}; +var ln=Object.defineProperty;var sn=(e,t,n)=>t in e?ln(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Qe=(e,t,n)=>(sn(e,typeof t!="symbol"?t+"":t,n),n);import{P as Te,c5 as on,a as ne,d as he,bq as Bt,u as ze,c as A,b$ as Mt,_ as cn,V as de,a0 as we,aj as V,bL as ot,a3 as ct,bo as un,h as ie,c6 as dn,b as fn,ay as vn,c7 as pn,a2 as ut,bK as hn,c8 as mn,c9 as gn,$ as H,b0 as yn,z as te,aA as bn,a1 as wn,ag as ce,ca as An,aR as kn,cb as Sn,cc as Cn,aM as $t,am as Be,bn as Ye,cd as In,ce as En,c4 as ke,cf as _n,cg as On,R as ue,ai as L,U as Pn,ch as Ze,x as R,ci as Nt,cj as dt,ck as xn,cl as Tn,cm as zt,cn as G,k as Xe,ah as Bn,co as Ft,ar as ee,cp as et,l as pe,aC as Me,aw as Mn,ap as De,cq as $n,cr as ft,an as Qt,bQ as vt,bP as Nn,cs as Ee,ct as zn,aD as Fn,bO as Dt,cu as Qn,cv as Dn,t as Ve,as as pt,al as me,cw as ht,c3 as Ln,L as oe,J as Rn,bZ as mt,cx as jn,cy as Hn,bY as Vn,cz as Un,cA as Jn,cB as Wn,at as Kn,au as qn,ax as Lt,o as T,m as J,cC as Gn,cD as Yn,cE as Zn,cF as Xn,cG as ei,a5 as ti,y as W,cH as Se,C as Y,n as N,A as $e,cI as gt,bG as ni,cJ as ii,B as ai,N as ye,v as j,r as K,W as Rt,cK as ri,c0 as li,M as jt,cL as si,cM as oi,p as se,ae as ci,cN as ui,X as di}from"./index-1537dba6.js";import{h as fi,r as vi,a as pi,t as hi}from"./db-925e828e.js";import{t as Le,l as fe,C as mi,g as gi}from"./shortcut-ec395f0e.js";var Ht=function(){return{arrow:{type:[Boolean,Object],default:void 0},trigger:{type:[Array,String]},overlay:Te.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}}},Re=on(),yi=function(){return ne(ne({},Ht()),{},{type:Re.type,size:String,htmlType:Re.htmlType,href:String,disabled:{type:Boolean,default:void 0},prefixCls:String,icon:Te.any,title:String,loading:Re.loading,onClick:{type:Function}})},bi=["type","disabled","loading","htmlType","class","overlay","trigger","align","visible","onVisibleChange","placement","href","title","icon","mouseEnterDelay","mouseLeaveDelay","overlayClassName","overlayStyle","destroyPopupOnHide","onClick","onUpdate:visible"],wi=de.Group;const Ne=he({compatConfig:{MODE:3},name:"ADropdownButton",inheritAttrs:!1,__ANT_BUTTON:!0,props:Bt(yi(),{trigger:"hover",placement:"bottomRight",type:"default"}),slots:["icon","leftButton","rightButton","overlay"],setup:function(t,n){var i=n.slots,a=n.attrs,r=n.emit,f=function(k){r("update:visible",k),r("visibleChange",k)},c=ze("dropdown-button",t),h=c.prefixCls,y=c.direction,d=c.getPopupContainer;return function(){var m,k,v=ne(ne({},t),a),l=v.type,s=l===void 0?"default":l,o=v.disabled,p=v.loading,w=v.htmlType,g=v.class,u=g===void 0?"":g,C=v.overlay,_=C===void 0?(m=i.overlay)===null||m===void 0?void 0:m.call(i):C,I=v.trigger,E=v.align,P=v.visible;v.onVisibleChange;var S=v.placement,B=S===void 0?y.value==="rtl"?"bottomLeft":"bottomRight":S,z=v.href,Q=v.title,O=v.icon,$=O===void 0?((k=i.icon)===null||k===void 0?void 0:k.call(i))||A(Mt,null,null):O,D=v.mouseEnterDelay,b=v.mouseLeaveDelay,x=v.overlayClassName,F=v.overlayStyle,Z=v.destroyPopupOnHide,U=v.onClick;v["onUpdate:visible"];var X=cn(v,bi),q={align:E,disabled:o,trigger:o?[]:I,placement:B,getPopupContainer:d.value,onVisibleChange:f,mouseEnterDelay:D,mouseLeaveDelay:b,visible:P,overlayClassName:x,overlayStyle:F,destroyPopupOnHide:Z},re=A(de,{type:s,disabled:o,loading:p,onClick:U,htmlType:w,href:z,title:Q},{default:i.default}),le=A(de,{type:s,icon:$},null);return A(wi,ne(ne({},X),{},{class:we(h.value,u)}),{default:function(){return[i.leftButton?i.leftButton({button:re}):re,A(ve,q,{default:function(){return[i.rightButton?i.rightButton({button:le}):le]},overlay:function(){return _}})]}})}}});var Vt=he({compatConfig:{MODE:3},name:"ADropdown",inheritAttrs:!1,props:Bt(Ht(),{mouseEnterDelay:.15,mouseLeaveDelay:.1,placement:"bottomLeft",trigger:"hover"}),slots:["overlay"],setup:function(t,n){var i=n.slots,a=n.attrs,r=n.emit,f=ze("dropdown",t),c=f.prefixCls,h=f.rootPrefixCls,y=f.direction,d=f.getPopupContainer,m=V(function(){var s=t.placement,o=s===void 0?"":s,p=t.transitionName;return p!==void 0?p:o.indexOf("top")>=0?"".concat(h.value,"-slide-down"):"".concat(h.value,"-slide-up")}),k=function(){var o,p,w,g=t.overlay||((o=i.overlay)===null||o===void 0?void 0:o.call(i)),u=Array.isArray(g)?g[0]:g;if(!u)return null;var C=u.props||{};ot(!C.mode||C.mode==="vertical","Dropdown",'mode="'.concat(C.mode,`" is not supported for Dropdown's Menu.`));var _=C.selectable,I=_===void 0?!1:_,E=C.expandIcon,P=E===void 0?(p=u.children)===null||p===void 0||(w=p.expandIcon)===null||w===void 0?void 0:w.call(p):E,S=typeof P<"u"&&ut(P)?P:A("span",{class:"".concat(c.value,"-menu-submenu-arrow")},[A(hn,{class:"".concat(c.value,"-menu-submenu-arrow-icon")},null)]),B=ut(u)?ct(u,{mode:"vertical",selectable:I,expandIcon:function(){return S}}):u;return B},v=V(function(){var s=t.placement;if(!s)return y.value==="rtl"?"bottomRight":"bottomLeft";if(s.includes("Center")){var o=s.slice(0,s.indexOf("Center"));return ot(!s.includes("Center"),"Dropdown","You are using '".concat(s,"' placement in Dropdown, which is deprecated. Try to use '").concat(o,"' instead.")),o}return s}),l=function(o){r("update:visible",o),r("visibleChange",o)};return function(){var s,o,p=t.arrow,w=t.trigger,g=t.disabled,u=t.overlayClassName,C=(s=i.default)===null||s===void 0?void 0:s.call(i)[0],_=ct(C,un({class:we(C==null||(o=C.props)===null||o===void 0?void 0:o.class,ie({},"".concat(c.value,"-rtl"),y.value==="rtl"),"".concat(c.value,"-trigger"))},g?{disabled:g}:{})),I=we(u,ie({},"".concat(c.value,"-rtl"),y.value==="rtl")),E=g?[]:w,P;E&&E.indexOf("contextmenu")!==-1&&(P=!0);var S=dn({arrowPointAtCenter:fn(p)==="object"&&p.pointAtCenter,autoAdjustOverflow:!0}),B=vn(ne(ne(ne({},t),a),{},{builtinPlacements:S,overlayClassName:I,arrow:p,alignPoint:P,prefixCls:c.value,getPopupContainer:d.value,transitionName:m.value,trigger:E,onVisibleChange:l,placement:v.value}),["overlay","onUpdate:visible"]);return A(pn,B,{default:function(){return[_]},overlay:k})}}});Vt.Button=Ne;const ve=Vt;var Ai=function(){return{prefixCls:String,checked:{type:Boolean,default:void 0},onChange:{type:Function},onClick:{type:Function},"onUpdate:checked":Function}},ki=he({compatConfig:{MODE:3},name:"ACheckableTag",props:Ai(),setup:function(t,n){var i=n.slots,a=n.emit,r=ze("tag",t),f=r.prefixCls,c=function(d){var m=t.checked;a("update:checked",!m),a("change",!m),a("click",d)},h=V(function(){var y;return we(f.value,(y={},ie(y,"".concat(f.value,"-checkable"),!0),ie(y,"".concat(f.value,"-checkable-checked"),t.checked),y))});return function(){var y;return A("span",{class:h.value,onClick:c},[(y=i.default)===null||y===void 0?void 0:y.call(i)])}}});const Ue=ki;var Si=new RegExp("^(".concat(mn.join("|"),")(-inverse)?$")),Ci=new RegExp("^(".concat(gn.join("|"),")$")),Ii=function(){return{prefixCls:String,color:{type:String},closable:{type:Boolean,default:!1},closeIcon:Te.any,visible:{type:Boolean,default:void 0},onClose:{type:Function},"onUpdate:visible":Function,icon:Te.any}},be=he({compatConfig:{MODE:3},name:"ATag",props:Ii(),slots:["closeIcon","icon"],setup:function(t,n){var i=n.slots,a=n.emit,r=n.attrs,f=ze("tag",t),c=f.prefixCls,h=f.direction,y=H(!0);yn(function(){t.visible!==void 0&&(y.value=t.visible)});var d=function(l){l.stopPropagation(),a("update:visible",!1),a("close",l),!l.defaultPrevented&&t.visible===void 0&&(y.value=!1)},m=V(function(){var v=t.color;return v?Si.test(v)||Ci.test(v):!1}),k=V(function(){var v;return we(c.value,(v={},ie(v,"".concat(c.value,"-").concat(t.color),m.value),ie(v,"".concat(c.value,"-has-color"),t.color&&!m.value),ie(v,"".concat(c.value,"-hidden"),!y.value),ie(v,"".concat(c.value,"-rtl"),h.value==="rtl"),v))});return function(){var v,l,s,o=t.icon,p=o===void 0?(v=i.icon)===null||v===void 0?void 0:v.call(i):o,w=t.color,g=t.closeIcon,u=g===void 0?(l=i.closeIcon)===null||l===void 0?void 0:l.call(i):g,C=t.closable,_=C===void 0?!1:C,I=function(){return _?u?A("span",{class:"".concat(c.value,"-close-icon"),onClick:d},[u]):A(wn,{class:"".concat(c.value,"-close-icon"),onClick:d},null):null},E={backgroundColor:w&&!m.value?w:void 0},P=p||null,S=(s=i.default)===null||s===void 0?void 0:s.call(i),B=P?A(te,null,[P,A("span",null,[S])]):S,z="onClick"in r,Q=A("span",{class:k.value,style:E},[B,I()]);return z?A(bn,null,{default:function(){return[Q]}}):Q}}});be.CheckableTag=Ue;be.install=function(e){return e.component(be.name,be),e.component(Ue.name,Ue),e};const Ei=be;ve.Button=Ne;ve.install=function(e){return e.component(ve.name,ve),e.component(Ne.name,Ne),e};var _i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3a32.05 32.05 0 00.6 45.3l183.7 179.1-43.4 252.9a31.95 31.95 0 0046.4 33.7L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3z"}}]},name:"star",theme:"filled"};const Oi=_i;function yt(e){for(var t=1;t{document.addEventListener(...e),$t(()=>document.removeEventListener(...e))},Ui="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghgg0Aj8i0JO4OzsrPv69Wv+hi2qPHr0qNvf39+iI97soRIh4f3z58/u7du3SXX7Xt7Z2enevHmzfQe+oSN2apSAPj09TSrb+XKI/f379+08+A0cNRE2ANkupk+ACNPvkSPcAAEibACyXUyfABGm3yNHuAECRNgAZLuYPgEirKlHu7u7XdyytGwHAd8jjNyng4OD7vnz51dbPT8/7z58+NB9+/bt6jU/TI+AGWHEnrx48eJ/EsSmHzx40L18+fLyzxF3ZVMjEyDCiEDjMYZZS5wiPXnyZFbJaxMhQIQRGzHvWR7XCyOCXsOmiDAi1HmPMMQjDpbpEiDCiL358eNHurW/5SnWdIBbXiDCiA38/Pnzrce2YyZ4//59F3ePLNMl4PbpiL2J0L979+7yDtHDhw8vtzzvdGnEXdvUigSIsCLAWavHp/+qM0BcXMd/q25n1vF57TYBp0a3mUzilePj4+7k5KSLb6gt6ydAhPUzXnoPR0dHl79WGTNCfBnn1uvSCJdegQhLI1vvCk+fPu2ePXt2tZOYEV6/fn31dz+shwAR1sP1cqvLntbEN9MxA9xcYjsxS1jWR4AIa2Ibzx0tc44fYX/16lV6NDFLXH+YL32jwiACRBiEbf5KcXoTIsQSpzXx4N28Ja4BQoK7rgXiydbHjx/P25TaQAJEGAguWy0+2Q8PD6/Ki4R8EVl+bzBOnZY95fq9rj9zAkTI2SxdidBHqG9+skdw43borCXO/ZcJdraPWdv22uIEiLA4q7nvvCug8WTqzQveOH26fodo7g6uFe/a17W3+nFBAkRYENRdb1vkkz1CH9cPsVy/jrhr27PqMYvENYNlHAIesRiBYwRy0V+8iXP8+/fvX11Mr7L7ECueb/r48eMqm7FuI2BGWDEG8cm+7G3NEOfmdcTQw4h9/55lhm7DekRYKQPZF2ArbXTAyu4kDYB2YxUzwg0gi/41ztHnfQG26HbGel/crVrm7tNY+/1btkOEAZ2M05r4FB7r9GbAIdxaZYrHdOsgJ/wCEQY0J74TmOKnbxxT9n3FgGGWWsVdowHtjt9Nnvf7yQM2aZU/TIAIAxrw6dOnAWtZZcoEnBpNuTuObWMEiLAx1HY0ZQJEmHJ3HNvGCBBhY6jtaMoEiJB0Z29vL6ls58vxPcO8/zfrdo5qvKO+d3Fx8Wu8zf1dW4p/cPzLly/dtv9Ts/EbcvGAHhHyfBIhZ6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg==",Ce=new WeakMap;function Ji(e,t){return{useHookShareState:i=>{const a=En();Be(a),Ce.has(a)||(Ce.set(a,Ye(e(a,i??(t==null?void 0:t())))),$t(()=>{Ce.delete(a)}));const r=Ce.get(a);return Be(r),{state:r,toRefs(){return In(r)}}}}}var Wi={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-600 72h560v208H232V136zm560 480H232V408h560v208zm0 272H232V680h560v208zM304 240a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"database",theme:"outlined"};const Ki=Wi;function At(e){for(var t=1;t(await ke.value.get("/files",{params:{folder_path:e}})).data,oa=async e=>(await ke.value.post("/delete_files",{file_paths:e})).data,Kt=async(e,t,n)=>(await ke.value.post("/move_files",{file_paths:e,dest:t,create_dest_folder:n})).data,ca=async(e,t,n)=>(await ke.value.post("/copy_files",{file_paths:e,dest:t,create_dest_folder:n})).data,ua=async e=>{await ke.value.post("/mkdirs",{dest_folder:e})};var qt={exports:{}};/* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress + * @license MIT */(function(e,t){(function(n,i){e.exports=i})(_n,function(){var n={};n.version="0.3.5";var i=n.settings={minimum:.08,easing:"linear",positionUsing:"",speed:200,trickle:!0,trickleSpeed:200,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'
'};n.configure=function(l){var s,o;for(s in l)o=l[s],o!==void 0&&l.hasOwnProperty(s)&&(i[s]=o);return this},n.status=null,n.set=function(l){var s=n.isStarted();l=a(l,i.minimum,1),n.status=l===1?null:l;var o=n.render(!s),p=o.querySelector(i.barSelector),w=i.speed,g=i.easing;return o.offsetWidth,c(function(u){i.positionUsing===""&&(i.positionUsing=n.getPositioningCSS()),h(p,f(l,w,g)),l===1?(h(o,{transition:"none",opacity:1}),o.offsetWidth,setTimeout(function(){h(o,{transition:"all "+w+"ms linear",opacity:0}),setTimeout(function(){n.remove(),u()},w)},w)):setTimeout(u,w)}),this},n.isStarted=function(){return typeof n.status=="number"},n.start=function(){n.status||n.set(0);var l=function(){setTimeout(function(){n.status&&(n.trickle(),l())},i.trickleSpeed)};return i.trickle&&l(),this},n.done=function(l){return!l&&!n.status?this:n.inc(.3+.5*Math.random()).set(1)},n.inc=function(l){var s=n.status;return s?s>1?void 0:(typeof l!="number"&&(s>=0&&s<.2?l=.1:s>=.2&&s<.5?l=.04:s>=.5&&s<.8?l=.02:s>=.8&&s<.99?l=.005:l=0),s=a(s+l,0,.994),n.set(s)):n.start()},n.trickle=function(){return n.inc()},function(){var l=0,s=0;n.promise=function(o){return!o||o.state()==="resolved"?this:(s===0&&n.start(),l++,s++,o.always(function(){s--,s===0?(l=0,n.done()):n.set((l-s)/l)}),this)}}(),n.getElement=function(){var l=n.getParent();if(l){var s=Array.prototype.slice.call(l.querySelectorAll(".nprogress")).filter(function(o){return o.parentElement===l});if(s.length>0)return s[0]}return null},n.getParent=function(){if(i.parent instanceof HTMLElement)return i.parent;if(typeof i.parent=="string")return document.querySelector(i.parent)},n.render=function(l){if(n.isRendered())return n.getElement();d(document.documentElement,"nprogress-busy");var s=document.createElement("div");s.id="nprogress",s.className="nprogress",s.innerHTML=i.template;var o=s.querySelector(i.barSelector),p=l?"-100":r(n.status||0),w=n.getParent(),g;return h(o,{transition:"all 0 linear",transform:"translate3d("+p+"%,0,0)"}),i.showSpinner||(g=s.querySelector(i.spinnerSelector),g&&v(g)),w!=document.body&&d(w,"nprogress-custom-parent"),w.appendChild(s),s},n.remove=function(){n.status=null,m(document.documentElement,"nprogress-busy"),m(n.getParent(),"nprogress-custom-parent");var l=n.getElement();l&&v(l)},n.isRendered=function(){return!!n.getElement()},n.getPositioningCSS=function(){var l=document.body.style,s="WebkitTransform"in l?"Webkit":"MozTransform"in l?"Moz":"msTransform"in l?"ms":"OTransform"in l?"O":"";return s+"Perspective"in l?"translate3d":s+"Transform"in l?"translate":"margin"};function a(l,s,o){return lo?o:l}function r(l){return(-1+l)*100}function f(l,s,o){var p;return i.positionUsing==="translate3d"?p={transform:"translate3d("+r(l)+"%,0,0)"}:i.positionUsing==="translate"?p={transform:"translate("+r(l)+"%,0)"}:p={"margin-left":r(l)+"%"},p.transition="all "+s+"ms "+o,p}var c=function(){var l=[];function s(){var o=l.shift();o&&o(s)}return function(o){l.push(o),l.length==1&&s()}}(),h=function(){var l=["Webkit","O","Moz","ms"],s={};function o(u){return u.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(C,_){return _.toUpperCase()})}function p(u){var C=document.body.style;if(u in C)return u;for(var _=l.length,I=u.charAt(0).toUpperCase()+u.slice(1),E;_--;)if(E=l[_]+I,E in C)return E;return u}function w(u){return u=o(u),s[u]||(s[u]=p(u))}function g(u,C,_){C=w(C),u.style[C]=_}return function(u,C){var _=arguments,I,E;if(_.length==2)for(I in C)E=C[I],E!==void 0&&C.hasOwnProperty(I)&&g(u,I,E);else g(u,_[1],_[2])}}();function y(l,s){var o=typeof l=="string"?l:k(l);return o.indexOf(" "+s+" ")>=0}function d(l,s){var o=k(l),p=o+s;y(o,s)||(l.className=p.substring(1))}function m(l,s){var o=k(l),p;y(l,s)&&(p=o.replace(" "+s+" "," "),l.className=p.substring(1,p.length-1))}function k(l){return(" "+(l&&l.className||"")+" ").replace(/\s+/gi," ")}function v(l){l&&l.parentNode&&l.parentNode.removeChild(l)}return n})})(qt);var da=qt.exports;const fa=On(da),va=e=>{const t=H("");return new Promise(n=>{ue.confirm({title:L("inputFolderName"),content:()=>A(Pn,{value:t.value,"onUpdate:value":i=>t.value=i},null),async onOk(){if(!t.value)return;const i=Ze(e,t.value);await ua(i),n()}})})},Gt=()=>A("p",{style:{background:"var(--zp-secondary-background)",padding:"8px",borderLeft:"4px solid var(--primary-color)"}},[R("Tips: "),L("multiSelectTips")]);function pa(){const e=[];for(let a=0;a<72;a++){const f=`hsl(${a*7.2}, 90%, 35%)`;e.push(f)}return e}const It=pa(),Yt=Nt("useTagStore",()=>{const e=Ye(new Map),t=async r=>{if(r=r.filter(f=>!e.has(f)),!!r.length)try{r.forEach(c=>e.set(c,[]));const f=await fi(r);for(const c in f)e.set(c,f[c])}catch{r.forEach(f=>e.delete(f))}},n=new Map;return{tagMap:e,getColor:r=>{let f=n.get(r);if(!f){const c=dt.hash.sha256.hash(r),h=parseInt(dt.codec.hex.fromBits(c),16)%It.length;f=It[h],n.set(r,f)}return f},fetchImageTags:t,refreshTags:async r=>{r.forEach(f=>e.delete(f)),await t(r)}}}),ha=Nt("useBatchDownloadStore",()=>{const e=H([]);return{selectdFiles:e,addFiles:n=>{e.value=xn([...e.value,...n])}}});class Et{constructor(t,n=Tn.CREATED_TIME_DESC){Qe(this,"root");Qe(this,"execQueue",[]);this.sortMethod=n,this.root={children:[],info:{name:t,size:"-",bytes:0,created_time:"",is_under_scanned_path:!0,date:"",type:"dir",fullpath:t}},this.fetchChildren(this.root)}reset(){return this.root.children=[],this.fetchChildren(this.root)}get images(){const t=n=>n.children.map(i=>{if(i.info.type==="dir")return t(i);if(G(i.info.name))return i.info}).filter(i=>i).flat(1);return t(this.root)}get isCompleted(){return this.execQueue.length===0}async fetchChildren(t){const{files:n}=await ge(t.info.fullpath);return t.children=zt(n,this.sortMethod).map(i=>({info:i,children:[]})),this.execQueue.shift(),this.execQueue.unshift(...t.children.filter(i=>i.info.type==="dir").map(i=>({fn:()=>this.fetchChildren(i),...i}))),t}async next(){const t=Di(this.execQueue);if(!t)return null;const n=await t.fn();return this.execQueue=this.execQueue.slice(),this.root={...this.root},n}}function je(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!Vn(e)}const _e=new Map,M=Xe(),ma=ha(),Zt=Yt(),_t=Bn(),Ie=new BroadcastChannel("iib-image-transfer-bus"),{eventEmitter:Oe,useEventListen:Je}=Ft(),{useHookShareState:ae}=Ji((e,{images:t})=>{const n=H({tabIdx:-1,paneIdx:-1}),i=V(()=>fe(a.value)),a=H([]),r=V(()=>{var w;return a.value.map(g=>g.curr).slice((w=M.conf)!=null&&w.is_win?1:0)}),f=V(()=>Ze(...r.value)),c=H(M.defaultSortingMethod),h=H(n.value.walkModePath?new Et(n.value.walkModePath,c.value):void 0);pe([()=>n.value.walkModePath,c],()=>{h.value=n.value.walkModePath?new Et(n.value.walkModePath,c.value):void 0});const y=Ye(new Set);pe(i,()=>y.clear());const d=V(()=>{var C;if(t.value)return t.value;if(h.value)return h.value.images.filter(_=>!y.has(_.fullpath));if(!i.value)return[];const w=((C=i.value)==null?void 0:C.files)??[],g=c.value;return zt((_=>M.onlyFoldersAndImages?_.filter(I=>I.type==="dir"||G(I.name)):_)(w),g).filter(_=>!y.has(_.fullpath))}),m=H([]),k=H(-1),v=V(()=>h.value?!h.value.isCompleted:!1),l=H(!1),s=H(!1),o=()=>{var w,g,u;return(u=(g=(w=M.tabList)==null?void 0:w[n.value.tabIdx])==null?void 0:g.panes)==null?void 0:u[n.value.paneIdx]},p=Ft();return p.useEventListen("selectAll",()=>{console.log(`select all 0 -> ${d.value.length}`),m.value=Jt(0,d.value.length)}),{previewing:s,spinning:l,canLoadNext:v,multiSelectedIdxs:m,previewIdx:k,basePath:r,currLocation:f,currPage:i,stack:a,sortMethod:c,sortedFiles:d,scroller:H(),stackViewEl:H(),props:n,getPane:o,walker:h,deletedFiles:y,...p}},()=>({images:H()}));function ir(){const{previewIdx:e,eventEmitter:t,canLoadNext:n,previewing:i,sortedFiles:a,scroller:r,props:f}=ae().toRefs(),{state:c}=ae();let h=null;const y=(v,l)=>{var s;i.value=v,h!=null&&!v&&l&&((s=r.value)==null||s.scrollToItem(h),h=null)},d=()=>{f.value.walkModePath&&!k("next")&&n&&(ee.info(L("loadingNextFolder")),t.value.emit("loadNextDir",!0))};Ae("keydown",v=>{var l;if(i.value){let s=e.value;if(["ArrowDown","ArrowRight"].includes(v.key))for(s++;a.value[s]&&!G(a.value[s].name);)s++;else if(["ArrowUp","ArrowLeft"].includes(v.key))for(s--;a.value[s]&&!G(a.value[s].name);)s--;if(G((l=a.value[s])==null?void 0:l.name)??""){e.value=s;const o=r.value;o&&!(s>=o.$_startIndex&&s<=o.$_endIndex)&&(h=s)}d()}});const m=v=>{var s;let l=e.value;if(v==="next")for(l++;a.value[l]&&!G(a.value[l].name);)l++;else if(v==="prev")for(l--;a.value[l]&&!G(a.value[l].name);)l--;if(G((s=a.value[l])==null?void 0:s.name)??""){e.value=l;const o=r.value;o&&!(l>=o.$_startIndex&&l<=o.$_endIndex)&&(h=l)}d()},k=v=>{var s;let l=e.value;if(v==="next")for(l++;a.value[l]&&!G(a.value[l].name);)l++;else if(v==="prev")for(l--;a.value[l]&&!G(a.value[l].name);)l--;return G((s=a.value[l])==null?void 0:s.name)??""};return Je("removeFiles",async()=>{var v;i.value&&!c.sortedFiles[e.value]&&(ee.info(L("manualExitFullScreen"),5),await et(500),(v=document.querySelector(".ant-image-preview-operations-operation .anticon-close"))==null||v.click(),e.value=-1)}),{previewIdx:e,onPreviewVisibleChange:y,previewing:i,previewImgMove:m,canPreview:k}}function ar(){const e=H(),{scroller:t,stackViewEl:n,stack:i,currPage:a,currLocation:r,useEventListen:f,eventEmitter:c,getPane:h,props:y,deletedFiles:d,walker:m,sortedFiles:k}=ae().toRefs();pe(()=>i.value.length,Me((b,x)=>{var F;b!==x&&((F=t.value)==null||F.scrollToItem(0))},300));const v=async b=>{var x;await w(b),y.value.walkModePath&&(await et(),await((x=m.value)==null?void 0:x.reset()),c.value.emit("loadNextDir"))};Mn(async()=>{var b;if(!i.value.length){const x=await ge("/");i.value.push({files:x.files,curr:"/"})}e.value=new fa,e.value.configure({parent:n.value}),y.value.path&&y.value.path!=="/"?await v(y.value.walkModePath??y.value.path):(b=M.conf)!=null&&b.home&&w(M.conf.home)}),pe(r,Me(b=>{const x=h.value();if(!x)return;x.path=b;const F=x.path.split("/").pop(),U=(()=>{var X;if(!y.value.walkModePath){const q=Ee(b);for(const[re,le]of Object.entries(M.pathAliasMap))if(q.startsWith(le))return q.replace(le,re);return F}return"Walk: "+(((X=M.quickMovePaths.find(q=>q.dir===x.walkModePath))==null?void 0:X.zh)??F)})();x.name=De("div",{style:"display:flex;align-items:center"},[De(Gi),De("span",{class:"line-clamp-1",style:"max-width: 256px"},U)]),x.nameFallbackStr=U,M.recent=M.recent.filter(X=>X.key!==x.key),M.recent.unshift({path:b,key:x.key}),M.recent.length>20&&(M.recent=M.recent.slice(0,20))},300));const l=()=>Ve(r.value),s=async b=>{var x,F;if(b.type==="dir")try{(x=e.value)==null||x.start();const{files:Z}=await ge(b.fullpath);i.value.push({files:Z,curr:b.name})}finally{(F=e.value)==null||F.done()}},o=b=>{for(;b(Be(M.conf,"global.conf load failed"),M.conf.is_win?b.toLowerCase()==x.toLowerCase():b==x),w=async b=>{var F,Z;const x=i.value.slice();try{$n(b)||(b=Ze(((F=M.conf)==null?void 0:F.sd_cwd)??"/",b));const U=ft(b),X=i.value.map(q=>q.curr);for(X.shift();X[0]&&U[0]&&p(X[0],U[0]);)X.shift(),U.shift();for(let q=0;qp(le.name,q));if(!re)throw console.error({frags:U,frag:q,stack:Qt(i.value)}),new Error(`${q} not found`);await s(re)}}catch(U){throw ee.error(L("moveFailedCheckPath")+(U instanceof Error?U.message:"")),console.error(b,ft(b),a.value),i.value=x,U}},g=vt(async()=>{var b,x,F;try{if((b=e.value)==null||b.start(),m.value)await m.value.reset(),c.value.emit("loadNextDir");else{const{files:Z}=await ge(i.value.length===1?"/":r.value);fe(i.value).files=Z}d.value.clear(),(x=t.value)==null||x.scrollToItem(0),ee.success(L("refreshCompleted"))}finally{(F=e.value)==null||F.done()}});Nn("returnToIIB",vt(async()=>{var b,x;if(!y.value.walkModePath)try{(b=e.value)==null||b.start();const{files:F}=await ge(i.value.length===1?"/":r.value);fe(i.value).files.map(U=>U.date).join()!==F.map(U=>U.date).join()&&(fe(i.value).files=F,ee.success(L("autoUpdate")))}finally{(x=e.value)==null||x.done()}})),f.value("refresh",g);const u=b=>{y.value.walkModePath&&(h.value().walkModePath=b),v(b)},C=V(()=>M.quickMovePaths.map(b=>({...b,path:Ee(b.dir)}))),_=V(()=>{const b=Ee(r.value);return C.value.find(F=>F.path===b)}),I=async()=>{const b=_.value;if(b){if(!b.can_delete)return;await vi(r.value),ee.success(L("removeCompleted"))}else await pi(r.value),ee.success(L("addCompleted"));pt.emit("searchIndexExpired"),pt.emit("updateGlobalSetting")},E=H(!1),P=H(r.value),S=()=>{E.value=!0,P.value=r.value},B=async()=>{await w(P.value),E.value=!1};Ae("click",()=>{E.value=!1});const z=()=>{const b=parent.location,x=b.href.substring(0,b.href.length-b.search.length),F=new URLSearchParams(b.search);F.set("action","open"),m.value&&F.set("walk","1"),F.set("path",r.value);const Z=`${x}?${F.toString()}`;Ve(Z,L("copyLocationUrlSuccessMsg"))},Q=()=>c.value.emit("selectAll"),O=async()=>{await va(r.value),await g()},$=()=>{const b=r.value;_e.set(b,i.value);const x=M.tabList[y.value.tabIdx],F={type:"local",key:me(),path:b,name:L("local"),stackKey:b,walkModePath:b};x.panes.push(F),x.key=F.key},D=V(()=>!m.value&&k.value.some(b=>b.type==="dir"));return{locInputValue:P,isLocationEditing:E,onLocEditEnter:B,onEditBtnClick:S,addToSearchScanPathAndQuickMove:I,searchPathInfo:_,refresh:g,copyLocation:l,back:o,openNext:s,currPage:a,currLocation:r,to:w,stack:i,scroller:t,share:z,selectAll:Q,quickMoveTo:u,onCreateFloderBtnClick:O,onWalkBtnClick:$,showWalkButton:D}}function rr({fetchNext:e}={}){const{scroller:t,sortedFiles:n,sortMethod:i,currLocation:a,stackViewEl:r,canLoadNext:f,previewIdx:c,props:h,walker:y}=ae().toRefs(),{state:d}=ae(),m=H(!1),k=H(M.defaultGridCellWidth),v=V(()=>k.value+16),l=44,{width:s}=zn(r),o=V(()=>~~(s.value/v.value)),p=V(()=>{const I=v.value;return{first:I+(k.value<=160?0:l),second:I}}),w=H(!1),g=async()=>{var I;if(!(w.value||!h.value.walkModePath||!f.value))try{w.value=!0,await((I=y.value)==null?void 0:I.next())}finally{w.value=!1}},u=async(I=!1)=>{const E=t.value,P=()=>I?c.value:(E==null?void 0:E.$_endIndex)??0,S=()=>{const B=n.value.length;return B?e?P()>B-20:P()>B-20&&f.value:!0};for(;S();){const B=await(e??g)();if(typeof B=="boolean"&&!B)return;await et(30)}};d.useEventListen("loadNextDir",u);const C=()=>{const I=t.value;if(I){const E=n.value.slice(Math.max(I.$_startIndex-10,0),I.$_endIndex+10).filter(P=>P.is_under_scanned_path&&G(P.name)).map(P=>P.fullpath);Zt.fetchImageTags(E)}};pe(a,Me(C,150));const _=Me(async()=>{await u(),C()},150);return{gridItems:o,sortedFiles:n,sortMethodConv:Fn,moreActionsDropdownShow:m,gridSize:v,sortMethod:i,onScroll:_,loadNextDir:g,loadNextDirLoading:w,canLoadNext:f,itemSize:p,cellWidth:k}}function lr(){const{currLocation:e,sortedFiles:t,currPage:n,multiSelectedIdxs:i,eventEmitter:a,walker:r}=ae().toRefs(),f=()=>{i.value=[]};return Ae("click",f),Ae("blur",f),pe(n,f),{onFileDragStart:(d,m)=>{const k=Qt(t.value[m]);_t.fileDragging=!0,console.log("onFileDragStart set drag file ",d,m,k);const v=[k];let l=k.type==="dir";if(i.value.includes(m)){const o=i.value.map(p=>t.value[p]);v.push(...o),l=o.some(p=>p.type==="dir")}const s={includeDir:l,loc:e.value||"search-result",path:ht(v,"fullpath").map(o=>o.fullpath),nodes:ht(v,"fullpath"),__id:"FileTransferData"};d.dataTransfer.setData("text/plain",JSON.stringify(s))},onDrop:async d=>{if(r.value)return;const m=Ln(d);if(!m)return;const k=e.value;if(m.loc===k)return;const v=Dt(),l=async()=>v.pushAction(async()=>{await ca(m.path,k),a.value.emit("refresh"),ue.destroyAll()}),s=()=>v.pushAction(async()=>{await Kt(m.path,k),Oe.emit("removeFiles",{paths:m.path,loc:m.loc}),a.value.emit("refresh"),ue.destroyAll()});ue.confirm({title:L("confirm")+"?",width:"60vw",content:()=>{let o,p,w;return A("div",null,[A("div",null,[`${L("moveSelectedFilesTo")} ${k}`,A("ol",{style:{maxHeight:"50vh",overflow:"auto"}},[m.path.map(g=>A("li",null,[g.split(/[/\\]/).pop()]))])]),A(Gt,null,null),A("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end"},class:"actions"},[A(de,{onClick:ue.destroyAll},je(o=L("cancel"))?o:{default:()=>[o]}),A(de,{type:"primary",loading:!v.isIdle,onClick:l},je(p=L("copy"))?p:{default:()=>[p]}),A(de,{type:"primary",loading:!v.isIdle,onClick:s},je(w=L("move"))?w:{default:()=>[w]})])])},maskClosable:!0,wrapClassName:"hidden-antd-btns-modal"})},multiSelectedIdxs:i,onFileDragEnd:()=>{_t.fileDragging=!1}}}function sr({openNext:e}){const t=H(!1),n=H(""),{sortedFiles:i,previewIdx:a,multiSelectedIdxs:r,stack:f,currLocation:c,spinning:h,previewing:y,stackViewEl:d,eventEmitter:m,props:k,deletedFiles:v}=ae().toRefs(),l=Ee;Je("removeFiles",({paths:g,loc:u})=>{l(u)!==l(c.value)||!fe(f.value)||(g.forEach(_=>v.value.add(_)),g.filter(G).forEach(_=>v.value.add(_.replace(/\.\w+$/,".txt"))))}),Je("addFiles",({files:g,loc:u})=>{if(l(u)!==l(c.value))return;const C=fe(f.value);C&&C.files.unshift(...g)});const s=Dt(),o=async(g,u,C)=>{a.value=C,M.fullscreenPreviewInitialUrl=oe(u);const _=r.value.indexOf(C);if(g.shiftKey){if(_!==-1)r.value.splice(_,1);else{r.value.push(C),r.value.sort((P,S)=>P-S);const I=r.value[0],E=r.value[r.value.length-1];r.value=Jt(I,E+1)}g.stopPropagation()}else g.ctrlKey||g.metaKey?(_!==-1?r.value.splice(_,1):r.value.push(C),g.stopPropagation()):await e(u)},p=async(g,u,C)=>{var B,z,Q;const _=oe(u),I=c.value,E={IIB_container_id:parent.IIB_container_id},P=()=>{let O=[];return r.value.includes(C)?O=r.value.map($=>i.value[$]):O.push(u),O},S=async O=>{if(!h.value)try{h.value=!0,await Un(u.fullpath),Ie.postMessage({...E,event:"click_hidden_button",btnEleId:"iib_hidden_img_update_trigger"});const $=setTimeout(()=>Jn.warn({message:L("long_loading"),duration:20}),5e3);await Wn(),clearTimeout($),Ie.postMessage({...E,event:"click_hidden_button",btnEleId:`iib_hidden_tab_${O}`})}catch($){console.error($),ee.error("发送图像失败,请携带console的错误消息找开发者")}finally{h.value=!1}};if(`${g.key}`.startsWith("toggle-tag-")){const O=+`${g.key}`.split("toggle-tag-")[1],{is_remove:$}=await hi({tag_id:O,img_path:u.fullpath}),D=(z=(B=M.conf)==null?void 0:B.all_custom_tags.find(b=>b.id===O))==null?void 0:z.name;Zt.refreshTags([u.fullpath]),ee.success(L($?"removedTagFromImage":"addedTagToImage",{tag:D}));return}switch(g.key){case"previewInNewWindow":return window.open(_);case"download":{const O=P();Hn(O.map($=>oe($,!0)));break}case"copyPreviewUrl":return Ve(parent.document.location.origin+_);case"send2txt2img":return S("txt2img");case"send2img2img":return S("img2img");case"send2inpaint":return S("inpaint");case"send2extras":return S("extras");case"send2savedDir":{const O=M.quickMovePaths.find(b=>b.key==="outdir_save");if(!O)return ee.error(L("unknownSavedDir"));const $=jn(O.dir,(Q=M.conf)==null?void 0:Q.sd_cwd),D=P();await Kt(D.map(b=>b.fullpath),$,!0),Oe.emit("removeFiles",{paths:D.map(b=>b.fullpath),loc:c.value}),Oe.emit("addFiles",{files:D,loc:$});break}case"send2controlnet-img2img":case"send2controlnet-txt2img":{const O=g.key.split("-")[1];Ie.postMessage({...E,event:"send_to_control_net",type:O,url:oe(u)});break}case"send2outpaint":{n.value=await s.pushAction(()=>mt(u.fullpath)).res;const[O,$]=(n.value||"").split(` +`);Ie.postMessage({...E,event:"send_to_outpaint",url:oe(u),prompt:O,negPrompt:$.slice(17)});break}case"openWithWalkMode":{_e.set(I,f.value);const O=M.tabList[k.value.tabIdx],$={type:"local",key:me(),path:u.fullpath,name:L("local"),stackKey:I,walkModePath:u.fullpath};O.panes.push($),O.key=$.key;break}case"openInNewTab":{_e.set(I,f.value);const O=M.tabList[k.value.tabIdx],$={type:"local",key:me(),path:u.fullpath,name:L("local"),stackKey:I};O.panes.push($),O.key=$.key;break}case"openOnTheRight":{_e.set(I,f.value);let O=M.tabList[k.value.tabIdx+1];O||(O={panes:[],key:"",id:me()},M.tabList[k.value.tabIdx+1]=O);const $={type:"local",key:me(),path:u.fullpath,name:L("local"),stackKey:I};O.panes.push($),O.key=$.key;break}case"send2BatchDownload":{ma.addFiles(P());break}case"viewGenInfo":{t.value=!0,n.value=await s.pushAction(()=>mt(u.fullpath)).res;break}case"openWithLocalFileBrowser":{await Rn(u.fullpath);break}case"deleteFiles":{const O=P(),$=async()=>{const D=O.map(b=>b.fullpath);await oa(D),ee.success(L("deleteSuccess")),Oe.emit("removeFiles",{paths:D,loc:c.value})};if(O.length===1&&M.ignoredConfirmActions.deleteOneOnly)return $();await new Promise(D=>{ue.confirm({title:L("confirmDelete"),maskClosable:!0,width:"60vw",content:()=>A("div",null,[A("ol",{style:{maxHeight:"50vh",overflow:"auto"}},[O.map(b=>A("li",null,[b.fullpath.split(/[/\\]/).pop()]))]),A(Gt,null,null),A(mi,{checked:M.ignoredConfirmActions.deleteOneOnly,"onUpdate:checked":b=>M.ignoredConfirmActions.deleteOneOnly=b},{default:()=>[L("deleteOneOnlySkipConfirm"),R(" ("),L("resetOnGlobalSettingsPage"),R(")")]})]),async onOk(){await $(),D()}})});break}}return{}},{isOutside:w}=Qn(d);return Ae("keydown",g=>{var C,_,I;const u=gi(g);if(y.value){const E=(C=Object.entries(M.shortcut).find(P=>P[1]===u&&P[1]))==null?void 0:C[0];if(E){g.stopPropagation(),g.preventDefault();const P=a.value,S=i.value[P];switch(E){case"delete":return oe(S)===M.fullscreenPreviewInitialUrl?ee.warn(L("fullscreenRestriction")):p({key:"deleteFiles"},S,P);default:{const B=(_=/^toggle_tag_(.*)$/.exec(E))==null?void 0:_[1],z=(I=M.conf)==null?void 0:I.all_custom_tags.find(Q=>Q.name===B);return z?p({key:`toggle-tag-${z.id}`},S,P):void 0}}}}else!w.value&&["Ctrl + KeyA","Cmd + KeyA"].includes(u)&&(g.preventDefault(),g.stopPropagation(),m.value.emit("selectAll"))}),{onFileItemClick:o,onContextMenuClick:p,showGenInfo:t,imageGenInfo:n,q:s}}const or=()=>{const{stackViewEl:e}=ae().toRefs(),t=H(-1);return Dn(e,n=>{var a;let i=n.target;for(;i.parentElement;)if(i=i.parentElement,i.tagName.toLowerCase()==="li"&&i.classList.contains("file-item-trigger")){const r=(a=i.dataset)==null?void 0:a.idx;r&&Number.isSafeInteger(+r)&&(t.value=+r);return}}),{showMenuIdx:t}};function ga(){var e=window.navigator.userAgent,t=e.indexOf("MSIE ");if(t>0)return parseInt(e.substring(t+5,e.indexOf(".",t)),10);var n=e.indexOf("Trident/");if(n>0){var i=e.indexOf("rv:");return parseInt(e.substring(i+3,e.indexOf(".",i)),10)}var a=e.indexOf("Edge/");return a>0?parseInt(e.substring(a+5,e.indexOf(".",a)),10):-1}let Pe;function We(){We.init||(We.init=!0,Pe=ga()!==-1)}var Fe={name:"ResizeObserver",props:{emitOnMount:{type:Boolean,default:!1},ignoreWidth:{type:Boolean,default:!1},ignoreHeight:{type:Boolean,default:!1}},emits:["notify"],mounted(){We(),Lt(()=>{this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitOnMount&&this.emitSize()});const e=document.createElement("object");this._resizeObject=e,e.setAttribute("aria-hidden","true"),e.setAttribute("tabindex",-1),e.onload=this.addResizeHandlers,e.type="text/html",Pe&&this.$el.appendChild(e),e.data="about:blank",Pe||this.$el.appendChild(e)},beforeUnmount(){this.removeResizeHandlers()},methods:{compareAndNotify(){(!this.ignoreWidth&&this._w!==this.$el.offsetWidth||!this.ignoreHeight&&this._h!==this.$el.offsetHeight)&&(this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitSize())},emitSize(){this.$emit("notify",{width:this._w,height:this._h})},addResizeHandlers(){this._resizeObject.contentDocument.defaultView.addEventListener("resize",this.compareAndNotify),this.compareAndNotify()},removeResizeHandlers(){this._resizeObject&&this._resizeObject.onload&&(!Pe&&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=Gn();Kn("data-v-b329ee4c");const ba={class:"resize-observer",tabindex:"-1"};qn();const wa=ya((e,t,n,i,a,r)=>(T(),J("div",ba)));Fe.render=wa;Fe.__scopeId="data-v-b329ee4c";Fe.__file="src/components/ResizeObserver.vue";function xe(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?xe=function(t){return typeof t}:xe=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xe(e)}function Aa(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ot(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,i=new Array(t);n2&&arguments[2]!==void 0?arguments[2]:{},i,a,r,f=function(h){for(var y=arguments.length,d=new Array(y>1?y-1:0),m=1;m1){var y=c.find(function(m){return m.isIntersecting});y&&(h=y)}if(a.callback){var d=h.isIntersecting&&h.intersectionRatio>=a.threshold;if(d===a.oldResult)return;a.oldResult=d,a.callback(d,h)}},this.options.intersection),Lt(function(){a.observer&&a.observer.observe(a.el)})}}},{key:"destroyObserver",value:function(){this.observer&&(this.observer.disconnect(),this.observer=null),this.callback&&this.callback._clear&&(this.callback._clear(),this.callback=null)}},{key:"threshold",get:function(){return this.options.intersection&&typeof this.options.intersection.threshold=="number"?this.options.intersection.threshold:0}}]),e}();function en(e,t,n){var i=t.value;if(i)if(typeof IntersectionObserver>"u")console.warn("[vue-observe-visibility] IntersectionObserver API is not available in your browser. Please install this polyfill: https://github.com/w3c/IntersectionObserver/tree/master/polyfill");else{var a=new Pa(e,i,n);e._vue_visibilityState=a}}function xa(e,t,n){var i=t.value,a=t.oldValue;if(!Xt(i,a)){var r=e._vue_visibilityState;if(!i){tn(e);return}r?r.createObserver(i,n):en(e,{value:i},n)}}function tn(e){var t=e._vue_visibilityState;t&&(t.destroyObserver(),delete e._vue_visibilityState)}var Ta={beforeMount:en,updated:xa,unmounted:tn},Ba={itemsLimit:1e3},Ma=/(auto|scroll)/;function nn(e,t){return e.parentNode===null?t:nn(e.parentNode,t.concat([e]))}var He=function(t,n){return getComputedStyle(t,null).getPropertyValue(n)},$a=function(t){return He(t,"overflow")+He(t,"overflow-y")+He(t,"overflow-x")},Na=function(t){return Ma.test($a(t))};function xt(e){if(e instanceof HTMLElement||e instanceof SVGElement){for(var t=nn(e.parentNode,[]),n=0;n{this.$_prerender=!1,this.updateVisibleItems(!0),this.ready=!0})},activated(){const e=this.$_lastUpdateScrollPosition;typeof e=="number"&&this.$nextTick(()=>{this.scrollToPosition(e)})},beforeUnmount(){this.removeListeners()},methods:{addView(e,t,n,i,a){const r=Yn({id:Da++,index:t,used:!0,key:i,type:a}),f=Zn({item:n,position:0,nr:r});return e.push(f),f},unuseView(e,t=!1){const n=this.$_unusedViews,i=e.nr.type;let a=n.get(i);a||(a=[],n.set(i,a)),a.push(e),t||(e.nr.used=!1,e.position=-9999)},handleResize(){this.$emit("resize"),this.ready&&this.updateVisibleItems(!1)},handleScroll(e){if(!this.$_scrollDirty){if(this.$_scrollDirty=!0,this.$_updateTimeout)return;const t=()=>requestAnimationFrame(()=>{this.$_scrollDirty=!1;const{continuous:n}=this.updateVisibleItems(!1,!0);n||(clearTimeout(this.$_refreshTimout),this.$_refreshTimout=setTimeout(this.handleScroll,this.updateInterval+100))});t(),this.updateInterval&&(this.$_updateTimeout=setTimeout(()=>{this.$_updateTimeout=0,this.$_scrollDirty&&t()},this.updateInterval))}},handleVisibilityChange(e,t){this.ready&&(e||t.boundingClientRect.width!==0||t.boundingClientRect.height!==0?(this.$emit("visible"),requestAnimationFrame(()=>{this.updateVisibleItems(!1)})):this.$emit("hidden"))},updateVisibleItems(e,t=!1){const n=this.itemSize,i=this.gridItems||1,a=this.itemSecondarySize||n,r=this.$_computedMinItemSize,f=this.typeField,c=this.simpleArray?null:this.keyField,h=this.items,y=h.length,d=this.sizes,m=this.$_views,k=this.$_unusedViews,v=this.pool,l=this.itemIndexByKey;let s,o,p,w,g;if(!y)s=o=w=g=p=0;else if(this.$_prerender)s=w=0,o=g=Math.min(this.prerender,h.length),p=null;else{const S=this.getScroll();if(t){let Q=S.start-this.$_lastUpdateScrollPosition;if(Q<0&&(Q=-Q),n===null&&QS.start&&($=D),D=~~((O+$)/2);while(D!==b);for(D<0&&(D=0),s=D,p=d[y-1].accumulator,o=D;oy&&(o=y)),w=s;wy&&(o=y),w<0&&(w=0),g>y&&(g=y),p=Math.ceil(y/i)*n}}o-s>Ba.itemsLimit&&this.itemsLimitError(),this.totalSize=p;let u;const C=s<=this.$_endIndex&&o>=this.$_startIndex;if(C)for(let S=0,B=v.length;S=o)&&this.unuseView(u));const _=C?null:new Map;let I,E,P;for(let S=s;S=z.length)&&(u=this.addView(v,S,I,B,E),this.unuseView(u,!0),z=k.get(E)),u=z[P],_.set(E,P+1)),m.delete(u.nr.key),u.nr.used=!0,u.nr.index=S,u.nr.key=B,u.nr.type=E,m.set(B,u),Q=!0;else if(!u.nr.used&&(u.nr.used=!0,u.nr.index=S,Q=!0,z)){const O=z.indexOf(u);O!==-1&&z.splice(O,1)}u.item=I,Q&&(S===h.length-1&&this.$emit("scroll-end"),S===0&&this.$emit("scroll-start")),n===null?(u.position=d[S-1].accumulator,u.offset=0):(u.position=Math.floor(S/i)*n,u.offset=S%i*a)}return this.$_startIndex=s,this.$_endIndex=o,this.emitUpdate&&this.$emit("update",s,o,w,g),clearTimeout(this.$_sortTimer),this.$_sortTimer=setTimeout(this.sortViews,this.updateInterval+300),{continuous:C}},getListenerTarget(){let e=xt(this.$el);return window.document&&(e===window.document.documentElement||e===window.document.body)&&(e=window),e},getScroll(){const{$el:e,direction:t}=this,n=t==="vertical";let i;if(this.pageMode){const a=e.getBoundingClientRect(),r=n?a.height:a.width;let f=-(n?a.top:a.left),c=n?window.innerHeight:window.innerWidth;f<0&&(c+=f,f=0),f+c>r&&(c=r-f),i={start:f,end:f+c}}else n?i={start:e.scrollTop,end:e.scrollTop+e.clientHeight}:i={start:e.scrollLeft,end:e.scrollLeft+e.clientWidth};return i},applyPageMode(){this.pageMode?this.addListeners():this.removeListeners()},addListeners(){this.listenerTarget=this.getListenerTarget(),this.listenerTarget.addEventListener("scroll",this.handleScroll,Ge?{passive:!0}:!1),this.listenerTarget.addEventListener("resize",this.handleResize)},removeListeners(){this.listenerTarget&&(this.listenerTarget.removeEventListener("scroll",this.handleScroll),this.listenerTarget.removeEventListener("resize",this.handleResize),this.listenerTarget=null)},scrollToItem(e){let t;const n=this.gridItems||1;this.itemSize===null?t=e>0?this.sizes[e-1].accumulator:0:t=Math.floor(e/n)*this.itemSize,this.scrollToPosition(t)},scrollToPosition(e){const t=this.direction==="vertical"?{scroll:"scrollTop",start:"top"}:{scroll:"scrollLeft",start:"left"};let n,i,a;if(this.pageMode){const r=xt(this.$el),f=r.tagName==="HTML"?0:r[t.scroll],c=r.getBoundingClientRect(),y=this.$el.getBoundingClientRect()[t.start]-c[t.start];n=r,i=t.scroll,a=e+f+y}else n=this.$el,i=t.scroll,a=e;n[i]=a},itemsLimitError(){throw setTimeout(()=>{console.log("It seems the scroller element isn't scrolling, so it tries to render all the items at once.","Scroller:",this.$el),console.log("Make sure the scroller has a fixed height (or width) and 'overflow-y' (or 'overflow-x') set to 'auto' so it can scroll correctly and only render the items visible in the scroll viewport.")}),new Error("Rendered items limit reached")},sortViews(){this.pool.sort((e,t)=>e.nr.index-t.nr.index)}}};const La={key:0,ref:"before",class:"vue-recycle-scroller__slot"},Ra={key:1,ref:"after",class:"vue-recycle-scroller__slot"};function ja(e,t,n,i,a,r){const f=Xn("ResizeObserver"),c=ei("observe-visibility");return ti((T(),W("div",{class:ye(["vue-recycle-scroller",{ready:a.ready,"page-mode":n.pageMode,[`direction-${e.direction}`]:!0}]),onScrollPassive:t[0]||(t[0]=(...h)=>r.handleScroll&&r.handleScroll(...h))},[e.$slots.before?(T(),W("div",La,[Se(e.$slots,"before")],512)):Y("v-if",!0),(T(),J(gt(n.listTag),{ref:"wrapper",style:ai({[e.direction==="vertical"?"minHeight":"minWidth"]:a.totalSize+"px"}),class:ye(["vue-recycle-scroller__item-wrapper",n.listClass])},{default:N(()=>[(T(!0),W(te,null,$e(a.pool,h=>(T(),J(gt(n.itemTag),ni({key:h.nr.id,style:a.ready?{transform:`translate${e.direction==="vertical"?"Y":"X"}(${h.position}px) translate${e.direction==="vertical"?"X":"Y"}(${h.offset}px)`,width:n.gridItems?`${e.direction==="vertical"&&n.itemSecondarySize||n.itemSize}px`:void 0,height:n.gridItems?`${e.direction==="horizontal"&&n.itemSecondarySize||n.itemSize}px`:void 0}:null,class:["vue-recycle-scroller__item-view",[n.itemClass,{hover:!n.skipHover&&a.hoverKey===h.nr.key}]]},ii(n.skipHover?{}:{mouseenter:()=>{a.hoverKey=h.nr.key},mouseleave:()=>{a.hoverKey=null}})),{default:N(()=>[Se(e.$slots,"default",{item:h.item,index:h.nr.index,active:h.nr.used})]),_:2},1040,["style","class"]))),128)),Se(e.$slots,"empty")]),_:3},8,["style","class"])),e.$slots.after?(T(),W("div",Ra,[Se(e.$slots,"after")],512)):Y("v-if",!0),A(f,{onNotify:r.handleResize},null,8,["onNotify"])],34)),[[c,r.handleVisibilityChange]])}an.render=ja;an.__file="src/components/RecycleScroller.vue";const Tt=he({__name:"ContextMenu",props:{file:{},idx:{},selectedTag:{},disableDelete:{type:Boolean}},emits:["contextMenuClick"],setup(e,{emit:t}){const n=e,i=Xe(),a=V(()=>{var r;return(((r=i.conf)==null?void 0:r.all_custom_tags)??[]).reduce((f,c)=>[...f,{...c,selected:!!n.selectedTag.find(h=>h.id===c.id)}],[])});return(r,f)=>{const c=Rt,h=ri,y=li,d=jt;return T(),J(d,{onClick:f[0]||(f[0]=m=>t("contextMenuClick",m,r.file,r.idx))},{default:N(()=>{var m;return[A(c,{key:"deleteFiles",disabled:r.disableDelete},{default:N(()=>[R(j(r.$t("deleteSelected")),1)]),_:1},8,["disabled"]),r.file.type==="dir"?(T(),W(te,{key:0},[A(c,{key:"openInNewTab"},{default:N(()=>[R(j(r.$t("openInNewTab")),1)]),_:1}),A(c,{key:"openOnTheRight"},{default:N(()=>[R(j(r.$t("openOnTheRight")),1)]),_:1}),A(c,{key:"openWithWalkMode"},{default:N(()=>[R(j(r.$t("openWithWalkMode")),1)]),_:1})],64)):Y("",!0),r.file.type==="file"?(T(),W(te,{key:1},[K(G)(r.file.name)?(T(),W(te,{key:0},[A(c,{key:"viewGenInfo"},{default:N(()=>[R(j(r.$t("viewGenerationInfo")),1)]),_:1}),A(h),((m=K(i).conf)==null?void 0:m.launch_mode)!=="server"?(T(),W(te,{key:0},[A(c,{key:"send2txt2img"},{default:N(()=>[R(j(r.$t("sendToTxt2img")),1)]),_:1}),A(c,{key:"send2img2img"},{default:N(()=>[R(j(r.$t("sendToImg2img")),1)]),_:1}),A(c,{key:"send2inpaint"},{default:N(()=>[R(j(r.$t("sendToInpaint")),1)]),_:1}),A(c,{key:"send2extras"},{default:N(()=>[R(j(r.$t("sendToExtraFeatures")),1)]),_:1}),A(y,{key:"sendToThirdPartyExtension",title:r.$t("sendToThirdPartyExtension")},{default:N(()=>[A(c,{key:"send2controlnet-txt2img"},{default:N(()=>[R("ControlNet - "+j(r.$t("t2i")),1)]),_:1}),A(c,{key:"send2controlnet-img2img"},{default:N(()=>[R("ControlNet - "+j(r.$t("i2i")),1)]),_:1}),A(c,{key:"send2outpaint"},{default:N(()=>[R("openOutpaint")]),_:1})]),_:1},8,["title"])],64)):Y("",!0),A(c,{key:"send2BatchDownload"},{default:N(()=>[R(j(r.$t("sendToBatchDownload")),1)]),_:1}),A(c,{key:"send2savedDir"},{default:N(()=>[R(j(r.$t("send2savedDir")),1)]),_:1}),A(h),A(y,{key:"toggle-tag",title:r.$t("toggleTag")},{default:N(()=>[(T(!0),W(te,null,$e(a.value,k=>(T(),J(c,{key:`toggle-tag-${k.id}`},{default:N(()=>[R(j(k.name)+" ",1),k.selected?(T(),J(K(Ut),{key:0})):(T(),J(K(Wt),{key:1}))]),_:2},1024))),128))]),_:1},8,["title"]),A(c,{key:"openWithLocalFileBrowser"},{default:N(()=>[R(j(r.$t("openWithLocalFileBrowser")),1)]),_:1})],64)):Y("",!0),A(c,{key:"previewInNewWindow"},{default:N(()=>[R(j(r.$t("previewInNewWindow")),1)]),_:1}),A(c,{key:"download"},{default:N(()=>[R(j(r.$t("download")),1)]),_:1}),A(c,{key:"copyPreviewUrl"},{default:N(()=>[R(j(r.$t("copySourceFilePreviewLink")),1)]),_:1})],64)):Y("",!0)]}),_:1})}}}),Ha=["data-idx"],Va={key:1,class:"more"},Ua={class:"float-btn-wrap"},Ja={key:0,class:"tags-container"},Wa={key:3,class:"preview-icon-wrap"},Ka={key:4,class:"profile"},qa={class:"name line-clamp-1"},Ga={class:"basic-info"},Ya=he({__name:"FileItem",props:{file:{},idx:{},selected:{type:Boolean,default:!1},showMenuIdx:{},cellWidth:{},fullScreenPreviewImageUrl:{},enableRightClickMenu:{type:Boolean,default:!0},enableCloseIcon:{type:Boolean,default:!1}},emits:["update:showMenuIdx","fileItemClick","dragstart","dragend","previewVisibleChange","contextMenuClick","close-icon-click"],setup(e,{emit:t}){const n=e;si(d=>({"48583e07":d.$props.cellWidth+"px"}));const i=Xe(),a=Yt(),r=V(()=>a.tagMap.get(n.file.fullpath)??[]),f=V(()=>{const d=i.gridThumbnailResolution;return i.enableThumbnail?oi(n.file,[d,d].join("x")):oe(n.file)}),c=V(()=>{var d;return(((d=i.conf)==null?void 0:d.all_custom_tags)??[]).reduce((m,k)=>[...m,{...k,selected:!!r.value.find(v=>v.id===k.id)}],[])}),h=V(()=>c.value.find(d=>d.type==="custom"&&d.name==="like")),y=()=>{Be(h.value),t("contextMenuClick",{key:`toggle-tag-${h.value.id}`},n.file,n.idx)};return(d,m)=>{const k=ve,v=Rt,l=jt,s=ui,o=Ei;return T(),J(k,{trigger:["contextmenu"],visible:K(i).longPressOpenContextMenu?typeof d.idx=="number"&&d.showMenuIdx===d.idx:void 0,"onUpdate:visible":m[7]||(m[7]=p=>typeof d.idx=="number"&&t("update:showMenuIdx",p?d.idx:-1))},{overlay:N(()=>[d.enableRightClickMenu?(T(),J(Tt,{key:0,file:d.file,idx:d.idx,"selected-tag":r.value,onContextMenuClick:m[6]||(m[6]=(p,w,g)=>t("contextMenuClick",p,w,g))},null,8,["file","idx","selected-tag"])):Y("",!0)]),default:N(()=>[(T(),W("li",{class:ye(["file file-item-trigger grid",{clickable:d.file.type==="dir",selected:d.selected}]),"data-idx":d.idx,key:d.file.name,draggable:"true",onDragstart:m[3]||(m[3]=p=>t("dragstart",p,d.idx)),onDragend:m[4]||(m[4]=p=>t("dragend",p,d.idx)),onClickCapture:m[5]||(m[5]=p=>t("fileItemClick",p,d.file,d.idx))},[se("div",null,[d.enableCloseIcon?(T(),W("div",{key:0,class:"close-icon",onClick:m[0]||(m[0]=p=>t("close-icon-click"))},[A(K(ci))])):Y("",!0),d.enableRightClickMenu?(T(),W("div",Va,[A(k,null,{overlay:N(()=>[A(Tt,{file:d.file,idx:d.idx,"selected-tag":r.value,onContextMenuClick:m[1]||(m[1]=(p,w,g)=>t("contextMenuClick",p,w,g))},null,8,["file","idx","selected-tag"])]),default:N(()=>[se("div",Ua,[A(K(Mt))])]),_:1}),d.file.type==="file"?(T(),J(k,{key:0},{overlay:N(()=>[c.value.length>1?(T(),J(l,{key:0,onClick:m[2]||(m[2]=p=>t("contextMenuClick",p,d.file,d.idx))},{default:N(()=>[(T(!0),W(te,null,$e(c.value,p=>(T(),J(v,{key:`toggle-tag-${p.id}`},{default:N(()=>[R(j(p.name)+" ",1),p.selected?(T(),J(K(Ut),{key:0})):(T(),J(K(Wt),{key:1}))]),_:2},1024))),128))]),_:1})):Y("",!0)]),default:N(()=>{var p,w;return[se("div",{class:ye(["float-btn-wrap",{"like-selected":(p=h.value)==null?void 0:p.selected}]),onClick:y},[(w=h.value)!=null&&w.selected?(T(),J(K(ea),{key:0})):(T(),J(K(aa),{key:1}))],2)]}),_:1})):Y("",!0)])):Y("",!0),K(G)(d.file.name)?(T(),W("div",{style:{position:"relative"},key:d.file.fullpath,class:ye(`idx-${d.idx}`)},[A(s,{src:f.value,fallback:K(Ui),preview:{src:d.fullScreenPreviewImageUrl,onVisibleChange:(p,w)=>t("previewVisibleChange",p,w)}},null,8,["src","fallback","preview"]),r.value&&d.cellWidth>128?(T(),W("div",Ja,[(T(!0),W(te,null,$e(r.value,p=>(T(),J(o,{key:p.id,color:K(a).getColor(p.name)},{default:N(()=>[R(j(p.name),1)]),_:2},1032,["color"]))),128))])):Y("",!0)],2)):(T(),W("div",Wa,[d.file.type==="file"?(T(),J(K(Mi),{key:0,class:"icon center"})):(T(),J(K(Fi),{key:1,class:"icon center"}))])),d.cellWidth>128?(T(),W("div",Ka,[se("div",qa,j(d.file.name),1),se("div",Ga,[se("div",null,j(d.file.size),1),se("div",null,j(d.file.date),1)])])):Y("",!0)])],42,Ha))]),_:1},8,["visible"])}}});const cr=di(Ya,[["__scopeId","data-v-0c11fc42"]]);export{ve as D,cr as F,Tt as _,ar as a,rr as b,lr as c,sr as d,ir as e,or as f,an as g,Je as h,Yt as i,Ae as j,ha as k,_e as s,ae as u}; diff --git a/vue/dist/assets/ImgSliPagePane-088a359b.js b/vue/dist/assets/ImgSliPagePane-5cfc1ce0.js similarity index 74% rename from vue/dist/assets/ImgSliPagePane-088a359b.js rename to vue/dist/assets/ImgSliPagePane-5cfc1ce0.js index 359d5cc..e6de0b3 100644 --- a/vue/dist/assets/ImgSliPagePane-088a359b.js +++ b/vue/dist/assets/ImgSliPagePane-5cfc1ce0.js @@ -1 +1 @@ -import{d as t,o as a,m as r,b$ as n}from"./index-f1d763a2.js";const p=t({__name:"ImgSliPagePane",props:{paneIdx:{},tabIdx:{},left:{},right:{}},setup(o){return(e,s)=>(a(),r(n,{left:e.left,right:e.right},null,8,["left","right"]))}});export{p as default}; +import{d as t,o as a,m as r,c1 as n}from"./index-1537dba6.js";const p=t({__name:"ImgSliPagePane",props:{paneIdx:{},tabIdx:{},left:{},right:{}},setup(o){return(e,s)=>(a(),r(n,{left:e.left,right:e.right},null,8,["left","right"]))}});export{p as default}; diff --git a/vue/dist/assets/MatchedImageGrid-4f83f417.css b/vue/dist/assets/MatchedImageGrid-4f83f417.css new file mode 100644 index 0000000..dd620f2 --- /dev/null +++ b/vue/dist/assets/MatchedImageGrid-4f83f417.css @@ -0,0 +1 @@ +.preview-switch[data-v-6cc08968]{position:fixed;top:0;bottom:0;left:0;right:0;display:flex;align-items:center;justify-content:space-between;z-index:11111;pointer-events:none}.preview-switch>*[data-v-6cc08968]{color:#fff;margin:16px;font-size:4em;pointer-events:all;cursor:pointer}.preview-switch>*.disable[data-v-6cc08968]{opacity:0;pointer-events:none;cursor:none}.container[data-v-6cc08968]{background:var(--zp-secondary-background)}.container .file-list[data-v-6cc08968]{list-style:none;padding:8px;height:100%;overflow:auto;height:var(--pane-max-height);width:100%} diff --git a/vue/dist/assets/MatchedImageGrid-a7ac5220.js b/vue/dist/assets/MatchedImageGrid-a7ac5220.js new file mode 100644 index 0000000..2f7b09d --- /dev/null +++ b/vue/dist/assets/MatchedImageGrid-a7ac5220.js @@ -0,0 +1 @@ +import{d as q,l as Q,ax as W,o as r,y as h,c as l,n as a,r as e,s as y,p as b,t as X,v as S,x as j,m as M,L as H,C as m,N as T,Q as J,R as K,X as Y}from"./index-1537dba6.js";import{L as Z,R as ee,f as te,S as ie}from"./fullScreenContextMenu-bb0fc66b.js";import{g as se,F as le}from"./FileItem-dbdcf20b.js";import{g as ne}from"./db-925e828e.js";import{c as ae,u as oe}from"./hook-3618bdfa.js";import"./shortcut-ec395f0e.js";const re={class:"hint"},de={key:1,class:"preview-switch"},ce=q({__name:"MatchedImageGrid",props:{tabIdx:{},paneIdx:{},selectedTagIds:{},id:{}},setup(V){const u=V,p=ae(c=>ne(u.selectedTagIds,c)),{queue:D,images:i,onContextMenuClickU:g,stackViewEl:F,previewIdx:n,previewing:f,onPreviewVisibleChange:z,previewImgMove:v,canPreview:I,itemSize:w,gridItems:$,showGenInfo:o,imageGenInfo:k,q:B,multiSelectedIdxs:G,onFileItemClick:N,scroller:x,showMenuIdx:d,onFileDragStart:R,onFileDragEnd:E,cellWidth:P,onScroll:C}=oe(p);return Q(()=>u.selectedTagIds,async()=>{await p.reset(),await W(),x.value.scrollToItem(0),C()},{immediate:!0}),(c,t)=>{const U=J,A=K,L=ie;return r(),h("div",{class:"container",ref_key:"stackViewEl",ref:F},[l(L,{size:"large",spinning:!e(D).isIdle},{default:a(()=>[l(A,{visible:e(o),"onUpdate:visible":t[1]||(t[1]=s=>y(o)?o.value=s:null),width:"70vw","mask-closable":"",onOk:t[2]||(t[2]=s=>o.value=!1)},{cancelText:a(()=>[]),default:a(()=>[l(U,{active:"",loading:!e(B).isIdle},{default:a(()=>[b("div",{style:{width:"100%","word-break":"break-all","white-space":"pre-line","max-height":"70vh",overflow:"auto"},onDblclick:t[0]||(t[0]=s=>e(X)(e(k)))},[b("div",re,S(c.$t("doubleClickToCopy")),1),j(" "+S(e(k)),1)],32)]),_:1},8,["loading"])]),_:1},8,["visible"]),e(i)?(r(),M(e(se),{key:0,ref_key:"scroller",ref:x,class:"file-list",items:e(i),"item-size":e(w).first,"key-field":"fullpath","item-secondary-size":e(w).second,gridItems:e($),onScroll:e(C)},{default:a(({item:s,index:_})=>[l(le,{idx:_,file:s,"cell-width":e(P),"show-menu-idx":e(d),"onUpdate:showMenuIdx":t[3]||(t[3]=O=>y(d)?d.value=O:null),onDragstart:e(R),onDragend:e(E),onFileItemClick:e(N),"full-screen-preview-image-url":e(i)[e(n)]?e(H)(e(i)[e(n)]):"",selected:e(G).includes(_),onContextMenuClick:e(g),onPreviewVisibleChange:e(z)},null,8,["idx","file","cell-width","show-menu-idx","onDragstart","onDragend","onFileItemClick","full-screen-preview-image-url","selected","onContextMenuClick","onPreviewVisibleChange"])]),_:1},8,["items","item-size","item-secondary-size","gridItems","onScroll"])):m("",!0),e(f)?(r(),h("div",de,[l(e(Z),{onClick:t[4]||(t[4]=s=>e(v)("prev")),class:T({disable:!e(I)("prev")})},null,8,["class"]),l(e(ee),{onClick:t[5]||(t[5]=s=>e(v)("next")),class:T({disable:!e(I)("next")})},null,8,["class"])])):m("",!0)]),_:1},8,["spinning"]),e(f)&&e(i)&&e(i)[e(n)]?(r(),M(te,{key:0,file:e(i)[e(n)],idx:e(n),onContextMenuClick:e(g)},null,8,["file","idx","onContextMenuClick"])):m("",!0)],512)}}});const Ie=Y(ce,[["__scopeId","data-v-6cc08968"]]);export{Ie as default}; diff --git a/vue/dist/assets/MatchedImageGrid-bcc691aa.js b/vue/dist/assets/MatchedImageGrid-bcc691aa.js deleted file mode 100644 index b5f2cc1..0000000 --- a/vue/dist/assets/MatchedImageGrid-bcc691aa.js +++ /dev/null @@ -1 +0,0 @@ -import{d as q,l as Q,ax as W,o as r,y as _,c as s,n as a,r as e,s as h,p as y,t as X,v as b,x as j,m as M,L as H,C as m,N as S,Q as J,R as K,X as Y}from"./index-f1d763a2.js";import{L as Z,R as ee,f as te,S as ie}from"./fullScreenContextMenu-c371385f.js";import{g as le,F as se}from"./FileItem-a4a4ada7.js";import{g as ne}from"./db-328ec51d.js";import{u as ae}from"./hook-cd0f6c09.js";import"./shortcut-6ab7aba6.js";const oe={class:"hint"},re={key:1,class:"preview-switch"},de=q({__name:"MatchedImageGrid",props:{tabIdx:{},paneIdx:{},selectedTagIds:{},id:{}},setup(T){const u=T,{queue:p,images:i,onContextMenuClickU:g,stackViewEl:V,previewIdx:n,previewing:v,onPreviewVisibleChange:D,previewImgMove:f,canPreview:w,itemSize:I,gridItems:F,showGenInfo:o,imageGenInfo:k,q:z,multiSelectedIdxs:$,onFileItemClick:B,scroller:x,showMenuIdx:d,onFileDragStart:G,onFileDragEnd:N,cellWidth:R,onScroll:A,updateImageTag:E}=ae();return Q(()=>u.selectedTagIds,async()=>{const{res:c}=p.pushAction(()=>ne(u.selectedTagIds));i.value=await c,await W(),E(),x.value.scrollToItem(0)},{immediate:!0}),(c,t)=>{const P=J,U=K,L=ie;return r(),_("div",{class:"container",ref_key:"stackViewEl",ref:V},[s(L,{size:"large",spinning:!e(p).isIdle},{default:a(()=>[s(U,{visible:e(o),"onUpdate:visible":t[1]||(t[1]=l=>h(o)?o.value=l:null),width:"70vw","mask-closable":"",onOk:t[2]||(t[2]=l=>o.value=!1)},{cancelText:a(()=>[]),default:a(()=>[s(P,{active:"",loading:!e(z).isIdle},{default:a(()=>[y("div",{style:{width:"100%","word-break":"break-all","white-space":"pre-line","max-height":"70vh",overflow:"auto"},onDblclick:t[0]||(t[0]=l=>e(X)(e(k)))},[y("div",oe,b(c.$t("doubleClickToCopy")),1),j(" "+b(e(k)),1)],32)]),_:1},8,["loading"])]),_:1},8,["visible"]),e(i)?(r(),M(e(le),{key:0,ref_key:"scroller",ref:x,class:"file-list",items:e(i),"item-size":e(I).first,"key-field":"fullpath","item-secondary-size":e(I).second,gridItems:e(F),onScroll:e(A)},{default:a(({item:l,index:C})=>[s(se,{idx:C,file:l,"cell-width":e(R),"show-menu-idx":e(d),"onUpdate:showMenuIdx":t[3]||(t[3]=O=>h(d)?d.value=O:null),onDragstart:e(G),onDragend:e(N),onFileItemClick:e(B),"full-screen-preview-image-url":e(i)[e(n)]?e(H)(e(i)[e(n)]):"",selected:e($).includes(C),onContextMenuClick:e(g),onPreviewVisibleChange:e(D)},null,8,["idx","file","cell-width","show-menu-idx","onDragstart","onDragend","onFileItemClick","full-screen-preview-image-url","selected","onContextMenuClick","onPreviewVisibleChange"])]),_:1},8,["items","item-size","item-secondary-size","gridItems","onScroll"])):m("",!0),e(v)?(r(),_("div",re,[s(e(Z),{onClick:t[4]||(t[4]=l=>e(f)("prev")),class:S({disable:!e(w)("prev")})},null,8,["class"]),s(e(ee),{onClick:t[5]||(t[5]=l=>e(f)("next")),class:S({disable:!e(w)("next")})},null,8,["class"])])):m("",!0)]),_:1},8,["spinning"]),e(v)&&e(i)&&e(i)[e(n)]?(r(),M(te,{key:0,file:e(i)[e(n)],idx:e(n),onContextMenuClick:e(g)},null,8,["file","idx","onContextMenuClick"])):m("",!0)],512)}}});const fe=Y(de,[["__scopeId","data-v-d698e678"]]);export{fe as default}; diff --git a/vue/dist/assets/MatchedImageGrid-bdeb2907.css b/vue/dist/assets/MatchedImageGrid-bdeb2907.css deleted file mode 100644 index 36ffc6c..0000000 --- a/vue/dist/assets/MatchedImageGrid-bdeb2907.css +++ /dev/null @@ -1 +0,0 @@ -.preview-switch[data-v-d698e678]{position:fixed;top:0;bottom:0;left:0;right:0;display:flex;align-items:center;justify-content:space-between;z-index:11111;pointer-events:none}.preview-switch>*[data-v-d698e678]{color:#fff;margin:16px;font-size:4em;pointer-events:all;cursor:pointer}.preview-switch>*.disable[data-v-d698e678]{opacity:0;pointer-events:none;cursor:none}.container[data-v-d698e678]{background:var(--zp-secondary-background)}.container .file-list[data-v-d698e678]{list-style:none;padding:8px;height:100%;overflow:auto;height:var(--pane-max-height);width:100%} diff --git a/vue/dist/assets/SubstrSearch-03c71861.css b/vue/dist/assets/SubstrSearch-03c71861.css deleted file mode 100644 index 9530c9d..0000000 --- a/vue/dist/assets/SubstrSearch-03c71861.css +++ /dev/null @@ -1 +0,0 @@ -.search-bar[data-v-bb005cb9]{padding:8px;display:flex}.preview-switch[data-v-bb005cb9]{position:fixed;top:0;bottom:0;left:0;right:0;display:flex;align-items:center;justify-content:space-between;z-index:11111;pointer-events:none}.preview-switch>*[data-v-bb005cb9]{color:#fff;margin:16px;font-size:4em;pointer-events:all;cursor:pointer}.preview-switch>*.disable[data-v-bb005cb9]{opacity:0;pointer-events:none;cursor:none}.container[data-v-bb005cb9]{background:var(--zp-secondary-background)}.container .file-list[data-v-bb005cb9]{list-style:none;padding:8px;height:100%;overflow:auto;height:var(--pane-max-height);width:100%} diff --git a/vue/dist/assets/SubstrSearch-10662b2a.js b/vue/dist/assets/SubstrSearch-10662b2a.js deleted file mode 100644 index b2bfbb0..0000000 --- a/vue/dist/assets/SubstrSearch-10662b2a.js +++ /dev/null @@ -1 +0,0 @@ -import{d as Y,$,aw as Z,bQ as ee,bP as B,o,y as k,c as r,r as e,bT as ne,m,n as u,x as w,v,C as g,s as V,p as F,t as te,L as ae,N as A,ax as se,ar as le,ai as ie,U as oe,V as re,Q as ue,R as de,X as ce}from"./index-f1d763a2.js";import{L as pe,R as me,f as ve,S as ge}from"./fullScreenContextMenu-c371385f.js";/* empty css */import{g as fe,F as ke}from"./FileItem-a4a4ada7.js";import{b as T,c as we,f as be,u as ye}from"./db-328ec51d.js";import{u as Ie}from"./hook-cd0f6c09.js";import"./shortcut-6ab7aba6.js";const xe={key:0,class:"search-bar"},Ce={class:"hint"},_e={key:1,class:"preview-switch"},he=Y({__name:"SubstrSearch",setup(Se){const{queue:l,images:a,onContextMenuClickU:b,stackViewEl:U,previewIdx:d,previewing:y,onPreviewVisibleChange:E,previewImgMove:I,canPreview:x,itemSize:C,gridItems:R,showGenInfo:c,imageGenInfo:_,q:N,multiSelectedIdxs:P,onFileItemClick:L,scroller:h,showMenuIdx:f,onFileDragStart:q,onFileDragEnd:G,cellWidth:K,onScroll:O,updateImageTag:Q}=Ie(),p=$(""),t=$();Z(async()=>{t.value=await T(),t.value.img_count&&t.value.expired&&S()});const S=ee(()=>l.pushAction(async()=>(await ye(),t.value=await T(),t.value)).res),M=async()=>{a.value=await l.pushAction(()=>be(p.value)).res,await se(),Q(),h.value.scrollToItem(0),a.value.length||le.info(ie("fuzzy-search-noResults"))};return B("returnToIIB",async()=>{const i=await l.pushAction(we).res;t.value.expired=i.expired}),B("searchIndexExpired",()=>t.value&&(t.value.expired=!0)),(i,n)=>{const H=oe,z=re,W=ue,X=de,j=ge;return o(),k("div",{class:"container",ref_key:"stackViewEl",ref:U},[t.value?(o(),k("div",xe,[r(H,{value:p.value,"onUpdate:value":n[0]||(n[0]=s=>p.value=s),placeholder:i.$t("fuzzy-search-placeholder"),disabled:!e(l).isIdle,onKeydown:ne(M,["enter"])},null,8,["value","placeholder","disabled","onKeydown"]),t.value.expired||!t.value.img_count?(o(),m(z,{key:0,onClick:e(S),loading:!e(l).isIdle,type:"primary"},{default:u(()=>[w(v(t.value.img_count===0?i.$t("generateIndexHint"):i.$t("UpdateIndex")),1)]),_:1},8,["onClick","loading"])):(o(),m(z,{key:1,type:"primary",onClick:M,loading:!e(l).isIdle,disabled:!p.value},{default:u(()=>[w(v(i.$t("search")),1)]),_:1},8,["loading","disabled"]))])):g("",!0),r(j,{size:"large",spinning:!e(l).isIdle},{default:u(()=>[r(X,{visible:e(c),"onUpdate:visible":n[2]||(n[2]=s=>V(c)?c.value=s:null),width:"70vw","mask-closable":"",onOk:n[3]||(n[3]=s=>c.value=!1)},{cancelText:u(()=>[]),default:u(()=>[r(W,{active:"",loading:!e(N).isIdle},{default:u(()=>[F("div",{style:{width:"100%","word-break":"break-all","white-space":"pre-line","max-height":"70vh",overflow:"auto"},onDblclick:n[1]||(n[1]=s=>e(te)(e(_)))},[F("div",Ce,v(i.$t("doubleClickToCopy")),1),w(" "+v(e(_)),1)],32)]),_:1},8,["loading"])]),_:1},8,["visible"]),e(a)?(o(),m(e(fe),{key:0,ref_key:"scroller",ref:h,class:"file-list",items:e(a),"item-size":e(C).first,"key-field":"fullpath","item-secondary-size":e(C).second,gridItems:e(R),onScroll:e(O)},{default:u(({item:s,index:D})=>[r(ke,{idx:D,file:s,"show-menu-idx":e(f),"onUpdate:showMenuIdx":n[4]||(n[4]=J=>V(f)?f.value=J:null),onFileItemClick:e(L),"full-screen-preview-image-url":e(a)[e(d)]?e(ae)(e(a)[e(d)]):"","cell-width":e(K),selected:e(P).includes(D),onContextMenuClick:e(b),onDragstart:e(q),onDragend:e(G),onPreviewVisibleChange:e(E)},null,8,["idx","file","show-menu-idx","onFileItemClick","full-screen-preview-image-url","cell-width","selected","onContextMenuClick","onDragstart","onDragend","onPreviewVisibleChange"])]),_:1},8,["items","item-size","item-secondary-size","gridItems","onScroll"])):g("",!0),e(y)?(o(),k("div",_e,[r(e(pe),{onClick:n[5]||(n[5]=s=>e(I)("prev")),class:A({disable:!e(x)("prev")})},null,8,["class"]),r(e(me),{onClick:n[6]||(n[6]=s=>e(I)("next")),class:A({disable:!e(x)("next")})},null,8,["class"])])):g("",!0)]),_:1},8,["spinning"]),e(y)&&e(a)&&e(a)[e(d)]?(o(),m(ve,{key:1,file:e(a)[e(d)],idx:e(d),onContextMenuClick:e(b)},null,8,["file","idx","onContextMenuClick"])):g("",!0)],512)}}});const Ae=ce(he,[["__scopeId","data-v-bb005cb9"]]);export{Ae as default}; diff --git a/vue/dist/assets/SubstrSearch-2f0f3ee4.js b/vue/dist/assets/SubstrSearch-2f0f3ee4.js new file mode 100644 index 0000000..e9718d1 --- /dev/null +++ b/vue/dist/assets/SubstrSearch-2f0f3ee4.js @@ -0,0 +1 @@ +import{d as Y,$ as V,aw as Z,bQ as ee,bP as F,o as l,y as k,c as o,r as e,bT as te,m,n as r,x as w,v,C as f,s as U,p as A,t as ae,L as ne,N as E,ax as se,ar as ie,ai as le,U as oe,V as re,Q as de,R as ue,X as ce}from"./index-1537dba6.js";import{L as pe,R as me,f as ve,S as fe}from"./fullScreenContextMenu-bb0fc66b.js";/* empty css */import{g as ge,F as ke}from"./FileItem-dbdcf20b.js";import{b as T,c as we,f as Ie,u as ye}from"./db-925e828e.js";import{c as xe,u as be}from"./hook-3618bdfa.js";import"./shortcut-ec395f0e.js";const Ce={key:0,class:"search-bar"},he={class:"hint"},_e={key:1,class:"preview-switch"},Se=Y({__name:"SubstrSearch",setup(Me){const c=V(""),I=xe(n=>Ie(c.value,n)),{queue:d,images:i,onContextMenuClickU:y,stackViewEl:R,previewIdx:u,previewing:x,onPreviewVisibleChange:N,previewImgMove:b,canPreview:C,itemSize:h,gridItems:P,showGenInfo:p,imageGenInfo:_,q:L,multiSelectedIdxs:q,onFileItemClick:G,scroller:S,showMenuIdx:g,onFileDragStart:K,onFileDragEnd:O,cellWidth:Q,onScroll:M}=be(I),a=V();Z(async()=>{a.value=await T(),a.value.img_count&&a.value.expired&&z()});const z=ee(()=>d.pushAction(async()=>(await ye(),a.value=await T(),a.value)).res),D=async()=>{await I.reset({refetch:!0}),await se(),M(),S.value.scrollToItem(0),i.value.length||ie.info(le("fuzzy-search-noResults"))};return F("returnToIIB",async()=>{const n=await d.pushAction(we).res;a.value.expired=n.expired}),F("searchIndexExpired",()=>a.value&&(a.value.expired=!0)),(n,t)=>{const H=oe,$=re,W=de,X=ue,j=fe;return l(),k("div",{class:"container",ref_key:"stackViewEl",ref:R},[a.value?(l(),k("div",Ce,[o(H,{value:c.value,"onUpdate:value":t[0]||(t[0]=s=>c.value=s),placeholder:n.$t("fuzzy-search-placeholder"),disabled:!e(d).isIdle,onKeydown:te(D,["enter"])},null,8,["value","placeholder","disabled","onKeydown"]),a.value.expired||!a.value.img_count?(l(),m($,{key:0,onClick:e(z),loading:!e(d).isIdle,type:"primary"},{default:r(()=>[w(v(a.value.img_count===0?n.$t("generateIndexHint"):n.$t("UpdateIndex")),1)]),_:1},8,["onClick","loading"])):(l(),m($,{key:1,type:"primary",onClick:D,loading:!e(d).isIdle,disabled:!c.value},{default:r(()=>[w(v(n.$t("search")),1)]),_:1},8,["loading","disabled"]))])):f("",!0),o(j,{size:"large",spinning:!e(d).isIdle},{default:r(()=>[o(X,{visible:e(p),"onUpdate:visible":t[2]||(t[2]=s=>U(p)?p.value=s:null),width:"70vw","mask-closable":"",onOk:t[3]||(t[3]=s=>p.value=!1)},{cancelText:r(()=>[]),default:r(()=>[o(W,{active:"",loading:!e(L).isIdle},{default:r(()=>[A("div",{style:{width:"100%","word-break":"break-all","white-space":"pre-line","max-height":"70vh",overflow:"auto"},onDblclick:t[1]||(t[1]=s=>e(ae)(e(_)))},[A("div",he,v(n.$t("doubleClickToCopy")),1),w(" "+v(e(_)),1)],32)]),_:1},8,["loading"])]),_:1},8,["visible"]),e(i)?(l(),m(e(ge),{key:0,ref_key:"scroller",ref:S,class:"file-list",items:e(i),"item-size":e(h).first,"key-field":"fullpath","item-secondary-size":e(h).second,gridItems:e(P),onScroll:e(M)},{default:r(({item:s,index:B})=>[o(ke,{idx:B,file:s,"show-menu-idx":e(g),"onUpdate:showMenuIdx":t[4]||(t[4]=J=>U(g)?g.value=J:null),onFileItemClick:e(G),"full-screen-preview-image-url":e(i)[e(u)]?e(ne)(e(i)[e(u)]):"","cell-width":e(Q),selected:e(q).includes(B),onContextMenuClick:e(y),onDragstart:e(K),onDragend:e(O),onPreviewVisibleChange:e(N)},null,8,["idx","file","show-menu-idx","onFileItemClick","full-screen-preview-image-url","cell-width","selected","onContextMenuClick","onDragstart","onDragend","onPreviewVisibleChange"])]),_:1},8,["items","item-size","item-secondary-size","gridItems","onScroll"])):f("",!0),e(x)?(l(),k("div",_e,[o(e(pe),{onClick:t[5]||(t[5]=s=>e(b)("prev")),class:E({disable:!e(C)("prev")})},null,8,["class"]),o(e(me),{onClick:t[6]||(t[6]=s=>e(b)("next")),class:E({disable:!e(C)("next")})},null,8,["class"])])):f("",!0)]),_:1},8,["spinning"]),e(x)&&e(i)&&e(i)[e(u)]?(l(),m(ve,{key:1,file:e(i)[e(u)],idx:e(u),onContextMenuClick:e(y)},null,8,["file","idx","onContextMenuClick"])):f("",!0)],512)}}});const Ae=ce(Se,[["__scopeId","data-v-d4ab92e4"]]);export{Ae as default}; diff --git a/vue/dist/assets/SubstrSearch-aa382998.css b/vue/dist/assets/SubstrSearch-aa382998.css new file mode 100644 index 0000000..1f82524 --- /dev/null +++ b/vue/dist/assets/SubstrSearch-aa382998.css @@ -0,0 +1 @@ +.search-bar[data-v-d4ab92e4]{padding:8px;display:flex}.preview-switch[data-v-d4ab92e4]{position:fixed;top:0;bottom:0;left:0;right:0;display:flex;align-items:center;justify-content:space-between;z-index:11111;pointer-events:none}.preview-switch>*[data-v-d4ab92e4]{color:#fff;margin:16px;font-size:4em;pointer-events:all;cursor:pointer}.preview-switch>*.disable[data-v-d4ab92e4]{opacity:0;pointer-events:none;cursor:none}.container[data-v-d4ab92e4]{background:var(--zp-secondary-background)}.container .file-list[data-v-d4ab92e4]{list-style:none;padding:8px;height:100%;overflow:auto;height:var(--pane-max-height);width:100%} diff --git a/vue/dist/assets/TagSearch-2cc53223.js b/vue/dist/assets/TagSearch-c173660b.js similarity index 99% rename from vue/dist/assets/TagSearch-2cc53223.js rename to vue/dist/assets/TagSearch-c173660b.js index 4333dcb..594148b 100644 --- a/vue/dist/assets/TagSearch-2cc53223.js +++ b/vue/dist/assets/TagSearch-c173660b.js @@ -1 +1 @@ -import{P as D,Z as _e,d as ae,bq as ge,aY as be,$ as F,bH as Ce,l as xe,u as he,aj as J,a0 as Z,h as x,c as v,a as W,bI as Ie,b as Ae,f as we,bJ as ke,a3 as se,bK as Pe,a2 as $e,i as Oe,b0 as Se,bL as Be,a5 as Ke,a6 as Te,a7 as Ee,ag as Ne,aT as Re,aR as Me,bM as je,aS as De,bN as Fe,k as Ue,bO as Ve,al as Le,aw as qe,bP as oe,bQ as ze,o as C,y as S,C as q,z as Y,p as M,v as B,r as K,S as te,m as Q,n as V,x as z,A as ie,N as re,bR as Ge,q as ce,a1 as He,ak as Qe,ar as de,ai as ne,R as Je,V as ue,U as We,bS as Xe,X as Ye}from"./index-f1d763a2.js";/* empty css *//* empty css */import{b as ve,c as Ze,d as ea,e as aa,u as ta}from"./db-328ec51d.js";var na=function(){return{prefixCls:String,activeKey:{type:[Array,Number,String]},defaultActiveKey:{type:[Array,Number,String]},accordion:{type:Boolean,default:void 0},destroyInactivePanel:{type:Boolean,default:void 0},bordered:{type:Boolean,default:void 0},expandIcon:Function,openAnimation:D.object,expandIconPosition:D.oneOf(_e("left","right")),collapsible:{type:String},ghost:{type:Boolean,default:void 0},onChange:Function,"onUpdate:activeKey":Function}},me=function(){return{openAnimation:D.object,prefixCls:String,header:D.any,headerClass:String,showArrow:{type:Boolean,default:void 0},isActive:{type:Boolean,default:void 0},destroyInactivePanel:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},accordion:{type:Boolean,default:void 0},forceRender:{type:Boolean,default:void 0},expandIcon:Function,extra:D.any,panelKey:D.oneOfType([D.string,D.number]),collapsible:{type:String},role:String,onItemClick:{type:Function}}};function fe(l){var e=l;if(!Array.isArray(e)){var t=Ae(e);e=t==="number"||t==="string"?[e]:[]}return e.map(function(s){return String(s)})}const X=ae({compatConfig:{MODE:3},name:"ACollapse",inheritAttrs:!1,props:ge(na(),{accordion:!1,destroyInactivePanel:!1,bordered:!0,openAnimation:be("ant-motion-collapse",!1),expandIconPosition:"left"}),slots:["expandIcon"],setup:function(e,t){var s=t.attrs,c=t.slots,n=t.emit,o=F(fe(Ce([e.activeKey,e.defaultActiveKey])));xe(function(){return e.activeKey},function(){o.value=fe(e.activeKey)},{deep:!0});var f=he("collapse",e),g=f.prefixCls,P=f.direction,T=J(function(){var d=e.expandIconPosition;return d!==void 0?d:P.value==="rtl"?"right":"left"}),h=function(r){var u=e.expandIcon,y=u===void 0?c.expandIcon:u,_=y?y(r):v(Pe,{rotate:r.isActive?90:void 0},null);return v("div",null,[$e(Array.isArray(y)?_[0]:_)?se(_,{class:"".concat(g.value,"-arrow")},!1):_])},E=function(r){e.activeKey===void 0&&(o.value=r);var u=e.accordion?r[0]:r;n("update:activeKey",u),n("change",u)},$=function(r){var u=o.value;if(e.accordion)u=u[0]===r?[]:[r];else{u=Oe(u);var y=u.indexOf(r),_=y>-1;_?u.splice(y,1):u.push(r)}E(u)},j=function(r,u){var y,_,R;if(!ke(r)){var a=o.value,i=e.accordion,b=e.destroyInactivePanel,k=e.collapsible,O=e.openAnimation,I=String((y=r.key)!==null&&y!==void 0?y:u),w=r.props||{},A=w.header,p=A===void 0?(_=r.children)===null||_===void 0||(R=_.header)===null||R===void 0?void 0:R.call(_):A,G=w.headerClass,m=w.collapsible,L=w.disabled,U=!1;i?U=a[0]===I:U=a.indexOf(I)>-1;var H=m??k;(L||L==="")&&(H="disabled");var ye={key:I,panelKey:I,header:p,headerClass:G,isActive:U,prefixCls:g.value,destroyInactivePanel:b,openAnimation:O,accordion:i,onItemClick:H==="disabled"?null:$,expandIcon:h,collapsible:H};return se(r,ye)}},N=function(){var r;return we((r=c.default)===null||r===void 0?void 0:r.call(c)).map(j)};return function(){var d,r=e.accordion,u=e.bordered,y=e.ghost,_=Z((d={},x(d,g.value,!0),x(d,"".concat(g.value,"-borderless"),!u),x(d,"".concat(g.value,"-icon-position-").concat(T.value),!0),x(d,"".concat(g.value,"-rtl"),P.value==="rtl"),x(d,"".concat(g.value,"-ghost"),!!y),x(d,s.class,!!s.class),d));return v("div",W(W({class:_},Ie(s)),{},{style:s.style,role:r?"tablist":null}),[N()])}}}),la=ae({compatConfig:{MODE:3},name:"PanelContent",props:me(),setup:function(e,t){var s=t.slots,c=F(!1);return Se(function(){(e.isActive||e.forceRender)&&(c.value=!0)}),function(){var n,o;if(!c.value)return null;var f=e.prefixCls,g=e.isActive,P=e.role;return v("div",{ref:F,class:Z("".concat(f,"-content"),(n={},x(n,"".concat(f,"-content-active"),g),x(n,"".concat(f,"-content-inactive"),!g),n)),role:P},[v("div",{class:"".concat(f,"-content-box")},[(o=s.default)===null||o===void 0?void 0:o.call(s)])])}}}),ee=ae({compatConfig:{MODE:3},name:"ACollapsePanel",inheritAttrs:!1,props:ge(me(),{showArrow:!0,isActive:!1,onItemClick:function(){},headerClass:"",forceRender:!1}),slots:["expandIcon","extra","header"],setup:function(e,t){var s=t.slots,c=t.emit,n=t.attrs;Be(e.disabled===void 0,"Collapse.Panel",'`disabled` is deprecated. Please use `collapsible="disabled"` instead.');var o=he("collapse",e),f=o.prefixCls,g=function(){c("itemClick",e.panelKey)},P=function(h){(h.key==="Enter"||h.keyCode===13||h.which===13)&&g()};return function(){var T,h,E,$,j=e.header,N=j===void 0?(T=s.header)===null||T===void 0?void 0:T.call(s):j,d=e.headerClass,r=e.isActive,u=e.showArrow,y=e.destroyInactivePanel,_=e.accordion,R=e.forceRender,a=e.openAnimation,i=e.expandIcon,b=i===void 0?s.expandIcon:i,k=e.extra,O=k===void 0?(h=s.extra)===null||h===void 0?void 0:h.call(s):k,I=e.collapsible,w=I==="disabled",A=f.value,p=Z("".concat(A,"-header"),(E={},x(E,d,d),x(E,"".concat(A,"-header-collapsible-only"),I==="header"),E)),G=Z(($={},x($,"".concat(A,"-item"),!0),x($,"".concat(A,"-item-active"),r),x($,"".concat(A,"-item-disabled"),w),x($,"".concat(A,"-no-arrow"),!u),x($,"".concat(n.class),!!n.class),$)),m=v("i",{class:"arrow"},null);u&&typeof b=="function"&&(m=b(e));var L=Ke(v(la,{prefixCls:A,isActive:r,forceRender:R,role:_?"tabpanel":null},{default:s.default}),[[Te,r]]),U=W({appear:!1,css:!1},a);return v("div",W(W({},n),{},{class:G}),[v("div",{class:p,onClick:function(){return I!=="header"&&g()},role:_?"tab":"button",tabindex:w?-1:0,"aria-expanded":r,onKeypress:P},[u&&m,I==="header"?v("span",{onClick:g,class:"".concat(A,"-header-text")},[N]):N,O&&v("div",{class:"".concat(A,"-extra")},[O])]),v(Ee,U,{default:function(){return[!y||r?L:null]}})])}}});X.Panel=ee;X.install=function(l){return l.component(X.name,X),l.component(ee.name,ee),l};var sa={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M869 487.8L491.2 159.9c-2.9-2.5-6.6-3.9-10.5-3.9h-88.5c-7.4 0-10.8 9.2-5.2 14l350.2 304H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h585.1L386.9 854c-5.6 4.9-2.2 14 5.2 14h91.5c1.9 0 3.8-.7 5.2-2L869 536.2a32.07 32.07 0 000-48.4z"}}]},name:"arrow-right",theme:"outlined"};const oa=sa;function pe(l){for(var e=1;e!s.isIdle),n=F(),o=F({and_tags:[],or_tags:[],not_tags:[]}),f=J(()=>n.value?n.value.tags.slice().sort((a,i)=>i.count-a.count):[]),g=["custom","Model","lora","lyco","pos","size","Postprocess upscaler","Postprocess upscale by","Sampler"].reduce((a,i,b)=>(a[i]=b,a),{}),P=J(()=>Object.entries(xa(f.value,a=>a.type)).sort((a,i)=>g[a[0]]-g[i[0]])),T=Le(),h=F(P.value.map(a=>a[0]));qe(async()=>{n.value=await ve(),h.value=P.value.map(a=>a[0]),n.value.img_count&&n.value.expired&&E()}),oe("searchIndexExpired",()=>n.value&&(n.value.expired=!0));const E=ze(()=>s.pushAction(async()=>(await ta(),n.value=await ve(),h.value=P.value.map(a=>a[0]),n.value)).res),$=()=>{t.openTagSearchMatchedImageGridInRight(e.tabIdx,T,o.value)};oe("returnToIIB",async()=>{const a=await s.pushAction(Ze).res;n.value.expired=a.expired});const j=(a,i=!1)=>(i?`[${a.type}] `:"")+(a.display_name?`${a.display_name} : ${a.name}`:a.name),N=F(!1),d=F(""),r=async()=>{var i,b,k;if(!d.value){N.value=!1;return}const a=await s.pushAction(()=>ea({tag_name:d.value})).res;a.type!=="custom"&&de.error(ne("existInOtherType")),(i=n.value)!=null&&i.tags.find(O=>O.id===a.id)?de.error(ne("alreadyExists")):((b=n.value)==null||b.tags.push(a),(k=t.conf)==null||k.all_custom_tags.push(a)),d.value="",N.value=!1},u=a=>{Je.confirm({title:ne("confirmDelete"),async onOk(){var b,k,O,I;await aa({tag_id:a});const i=((b=n.value)==null?void 0:b.tags.findIndex(w=>w.id===a))??-1;(k=n.value)==null||k.tags.splice(i,1),(I=t.conf)==null||I.all_custom_tags.splice((O=t.conf)==null?void 0:O.all_custom_tags.findIndex(w=>w.id===a),1)}})},y=J(()=>new Set([o.value.and_tags,o.value.or_tags,o.value.not_tags].flat())),_=a=>{y.value.has(a.id)?(o.value.and_tags=o.value.and_tags.filter(i=>i!==a.id),o.value.or_tags=o.value.or_tags.filter(i=>i!==a.id),o.value.not_tags=o.value.not_tags.filter(i=>i!==a.id)):o.value.and_tags.push(a.id)},R={value:a=>a.id,text:j,optionText:a=>j(a,!0)};return(a,i)=>{const b=ue,k=We,O=ue,I=Xe,w=ee,A=X;return C(),S("div",Ia,[q("",!0),n.value?(C(),S(Y,{key:1},[M("div",null,[M("div",Aa,[M("div",wa,B(a.$t("exactMatch")),1),v(K(te),{conv:R,mode:"multiple",style:{width:"100%"},options:f.value,value:o.value.and_tags,"onUpdate:value":i[0]||(i[0]=p=>o.value.and_tags=p),disabled:!f.value.length,placeholder:a.$t("selectExactMatchTag")},null,8,["options","value","disabled","placeholder"]),n.value.expired||!n.value.img_count?(C(),Q(b,{key:0,onClick:K(E),loading:!K(s).isIdle,type:"primary"},{default:V(()=>[z(B(n.value.img_count===0?a.$t("generateIndexHint"):a.$t("UpdateIndex")),1)]),_:1},8,["onClick","loading"])):(C(),Q(b,{key:1,type:"primary",onClick:$,loading:!K(s).isIdle,disabled:!o.value.and_tags.length},{default:V(()=>[z(B(a.$t("search")),1)]),_:1},8,["loading","disabled"]))]),M("div",ka,[M("div",Pa,B(a.$t("anyMatch")),1),v(K(te),{conv:R,mode:"multiple",style:{width:"100%"},options:f.value,value:o.value.or_tags,"onUpdate:value":i[1]||(i[1]=p=>o.value.or_tags=p),disabled:!f.value.length,placeholder:a.$t("selectAnyMatchTag")},null,8,["options","value","disabled","placeholder"])]),M("div",$a,[M("div",Oa,B(a.$t("exclude")),1),v(K(te),{conv:R,mode:"multiple",style:{width:"100%"},options:f.value,value:o.value.not_tags,"onUpdate:value":i[2]||(i[2]=p=>o.value.not_tags=p),disabled:!f.value.length,placeholder:a.$t("selectExcludeTag")},null,8,["options","value","disabled","placeholder"])])]),f.value.filter(p=>p.type!=="custom").length?q("",!0):(C(),S("p",Sa,B(a.$t("needGenerateIdx")),1)),M("div",Ba,[(C(!0),S(Y,null,ie(P.value,([p,G])=>(C(),S("ul",{class:"tag-list",key:p},[M("h3",{class:"cat-name",onClick:m=>h.value.includes(p)?h.value.splice(h.value.indexOf(p),1):h.value.push(p)},[v(K(ra),{class:re(["arrow",{down:h.value.includes(p)}])},null,8,["class"]),z(" "+B(a.$t(p)),1)],8,Ka),v(A,{ghost:"",activeKey:h.value,"onUpdate:activeKey":i[5]||(i[5]=m=>h.value=m)},{expandIcon:V(()=>[]),default:V(()=>[(C(),Q(w,{key:p},{default:V(()=>[(C(!0),S(Y,null,ie(G,(m,L)=>(C(),S("li",{key:m.id,class:re(["tag",{selected:y.value.has(m.id)}]),onClick:U=>_(m)},[y.value.has(m.id)?(C(),Q(K(Ge),{key:0})):q("",!0),z(" "+B(j(m))+" ",1),p==="custom"&&L!==0?(C(),S("span",{key:1,class:"remove",onClickCapture:ce(U=>u(m.id),["stop"])},[v(K(He))],40,Ea)):q("",!0)],10,Ta))),128)),p==="custom"?(C(),S("li",{key:0,class:"tag",onClick:i[4]||(i[4]=m=>N.value=!0)},[N.value?(C(),Q(I,{key:0,compact:""},{default:V(()=>[v(k,{value:d.value,"onUpdate:value":i[3]||(i[3]=m=>d.value=m),style:{width:"128px"},loading:c.value,"allow-clear":"",size:"small"},null,8,["value","loading"]),v(O,{size:"small",type:"primary",onClickCapture:ce(r,["stop"]),loading:c.value},{default:V(()=>[z(B(d.value?a.$t("submit"):a.$t("cancel")),1)]),_:1},8,["onClickCapture","loading"])]),_:1})):(C(),S(Y,{key:1},[v(K(Qe)),z(" "+B(a.$t("add")),1)],64))])):q("",!0)]),_:2},1024))]),_:2},1032,["activeKey"])]))),128))])],64)):q("",!0)])}}});const Fa=Ye(Na,[["__scopeId","data-v-d3d0aa40"]]);export{Fa as default}; +import{P as D,Z as _e,d as ae,bq as ge,aY as be,$ as F,bH as Ce,l as xe,u as he,aj as J,a0 as Z,h as x,c as v,a as W,bI as Ie,b as Ae,f as we,bJ as ke,a3 as se,bK as Pe,a2 as $e,i as Oe,b0 as Se,bL as Be,a5 as Ke,a6 as Te,a7 as Ee,ag as Ne,aT as Re,aR as Me,bM as je,aS as De,bN as Fe,k as Ue,bO as Ve,al as Le,aw as qe,bP as oe,bQ as ze,o as C,y as S,C as q,z as Y,p as M,v as B,r as K,S as te,m as Q,n as V,x as z,A as ie,N as re,bR as Ge,q as ce,a1 as He,ak as Qe,ar as de,ai as ne,R as Je,V as ue,U as We,bS as Xe,X as Ye}from"./index-1537dba6.js";/* empty css *//* empty css */import{b as ve,c as Ze,d as ea,e as aa,u as ta}from"./db-925e828e.js";var na=function(){return{prefixCls:String,activeKey:{type:[Array,Number,String]},defaultActiveKey:{type:[Array,Number,String]},accordion:{type:Boolean,default:void 0},destroyInactivePanel:{type:Boolean,default:void 0},bordered:{type:Boolean,default:void 0},expandIcon:Function,openAnimation:D.object,expandIconPosition:D.oneOf(_e("left","right")),collapsible:{type:String},ghost:{type:Boolean,default:void 0},onChange:Function,"onUpdate:activeKey":Function}},me=function(){return{openAnimation:D.object,prefixCls:String,header:D.any,headerClass:String,showArrow:{type:Boolean,default:void 0},isActive:{type:Boolean,default:void 0},destroyInactivePanel:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},accordion:{type:Boolean,default:void 0},forceRender:{type:Boolean,default:void 0},expandIcon:Function,extra:D.any,panelKey:D.oneOfType([D.string,D.number]),collapsible:{type:String},role:String,onItemClick:{type:Function}}};function fe(l){var e=l;if(!Array.isArray(e)){var t=Ae(e);e=t==="number"||t==="string"?[e]:[]}return e.map(function(s){return String(s)})}const X=ae({compatConfig:{MODE:3},name:"ACollapse",inheritAttrs:!1,props:ge(na(),{accordion:!1,destroyInactivePanel:!1,bordered:!0,openAnimation:be("ant-motion-collapse",!1),expandIconPosition:"left"}),slots:["expandIcon"],setup:function(e,t){var s=t.attrs,c=t.slots,n=t.emit,o=F(fe(Ce([e.activeKey,e.defaultActiveKey])));xe(function(){return e.activeKey},function(){o.value=fe(e.activeKey)},{deep:!0});var f=he("collapse",e),g=f.prefixCls,P=f.direction,T=J(function(){var d=e.expandIconPosition;return d!==void 0?d:P.value==="rtl"?"right":"left"}),h=function(r){var u=e.expandIcon,y=u===void 0?c.expandIcon:u,_=y?y(r):v(Pe,{rotate:r.isActive?90:void 0},null);return v("div",null,[$e(Array.isArray(y)?_[0]:_)?se(_,{class:"".concat(g.value,"-arrow")},!1):_])},E=function(r){e.activeKey===void 0&&(o.value=r);var u=e.accordion?r[0]:r;n("update:activeKey",u),n("change",u)},$=function(r){var u=o.value;if(e.accordion)u=u[0]===r?[]:[r];else{u=Oe(u);var y=u.indexOf(r),_=y>-1;_?u.splice(y,1):u.push(r)}E(u)},j=function(r,u){var y,_,R;if(!ke(r)){var a=o.value,i=e.accordion,b=e.destroyInactivePanel,k=e.collapsible,O=e.openAnimation,I=String((y=r.key)!==null&&y!==void 0?y:u),w=r.props||{},A=w.header,p=A===void 0?(_=r.children)===null||_===void 0||(R=_.header)===null||R===void 0?void 0:R.call(_):A,G=w.headerClass,m=w.collapsible,L=w.disabled,U=!1;i?U=a[0]===I:U=a.indexOf(I)>-1;var H=m??k;(L||L==="")&&(H="disabled");var ye={key:I,panelKey:I,header:p,headerClass:G,isActive:U,prefixCls:g.value,destroyInactivePanel:b,openAnimation:O,accordion:i,onItemClick:H==="disabled"?null:$,expandIcon:h,collapsible:H};return se(r,ye)}},N=function(){var r;return we((r=c.default)===null||r===void 0?void 0:r.call(c)).map(j)};return function(){var d,r=e.accordion,u=e.bordered,y=e.ghost,_=Z((d={},x(d,g.value,!0),x(d,"".concat(g.value,"-borderless"),!u),x(d,"".concat(g.value,"-icon-position-").concat(T.value),!0),x(d,"".concat(g.value,"-rtl"),P.value==="rtl"),x(d,"".concat(g.value,"-ghost"),!!y),x(d,s.class,!!s.class),d));return v("div",W(W({class:_},Ie(s)),{},{style:s.style,role:r?"tablist":null}),[N()])}}}),la=ae({compatConfig:{MODE:3},name:"PanelContent",props:me(),setup:function(e,t){var s=t.slots,c=F(!1);return Se(function(){(e.isActive||e.forceRender)&&(c.value=!0)}),function(){var n,o;if(!c.value)return null;var f=e.prefixCls,g=e.isActive,P=e.role;return v("div",{ref:F,class:Z("".concat(f,"-content"),(n={},x(n,"".concat(f,"-content-active"),g),x(n,"".concat(f,"-content-inactive"),!g),n)),role:P},[v("div",{class:"".concat(f,"-content-box")},[(o=s.default)===null||o===void 0?void 0:o.call(s)])])}}}),ee=ae({compatConfig:{MODE:3},name:"ACollapsePanel",inheritAttrs:!1,props:ge(me(),{showArrow:!0,isActive:!1,onItemClick:function(){},headerClass:"",forceRender:!1}),slots:["expandIcon","extra","header"],setup:function(e,t){var s=t.slots,c=t.emit,n=t.attrs;Be(e.disabled===void 0,"Collapse.Panel",'`disabled` is deprecated. Please use `collapsible="disabled"` instead.');var o=he("collapse",e),f=o.prefixCls,g=function(){c("itemClick",e.panelKey)},P=function(h){(h.key==="Enter"||h.keyCode===13||h.which===13)&&g()};return function(){var T,h,E,$,j=e.header,N=j===void 0?(T=s.header)===null||T===void 0?void 0:T.call(s):j,d=e.headerClass,r=e.isActive,u=e.showArrow,y=e.destroyInactivePanel,_=e.accordion,R=e.forceRender,a=e.openAnimation,i=e.expandIcon,b=i===void 0?s.expandIcon:i,k=e.extra,O=k===void 0?(h=s.extra)===null||h===void 0?void 0:h.call(s):k,I=e.collapsible,w=I==="disabled",A=f.value,p=Z("".concat(A,"-header"),(E={},x(E,d,d),x(E,"".concat(A,"-header-collapsible-only"),I==="header"),E)),G=Z(($={},x($,"".concat(A,"-item"),!0),x($,"".concat(A,"-item-active"),r),x($,"".concat(A,"-item-disabled"),w),x($,"".concat(A,"-no-arrow"),!u),x($,"".concat(n.class),!!n.class),$)),m=v("i",{class:"arrow"},null);u&&typeof b=="function"&&(m=b(e));var L=Ke(v(la,{prefixCls:A,isActive:r,forceRender:R,role:_?"tabpanel":null},{default:s.default}),[[Te,r]]),U=W({appear:!1,css:!1},a);return v("div",W(W({},n),{},{class:G}),[v("div",{class:p,onClick:function(){return I!=="header"&&g()},role:_?"tab":"button",tabindex:w?-1:0,"aria-expanded":r,onKeypress:P},[u&&m,I==="header"?v("span",{onClick:g,class:"".concat(A,"-header-text")},[N]):N,O&&v("div",{class:"".concat(A,"-extra")},[O])]),v(Ee,U,{default:function(){return[!y||r?L:null]}})])}}});X.Panel=ee;X.install=function(l){return l.component(X.name,X),l.component(ee.name,ee),l};var sa={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M869 487.8L491.2 159.9c-2.9-2.5-6.6-3.9-10.5-3.9h-88.5c-7.4 0-10.8 9.2-5.2 14l350.2 304H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h585.1L386.9 854c-5.6 4.9-2.2 14 5.2 14h91.5c1.9 0 3.8-.7 5.2-2L869 536.2a32.07 32.07 0 000-48.4z"}}]},name:"arrow-right",theme:"outlined"};const oa=sa;function pe(l){for(var e=1;e!s.isIdle),n=F(),o=F({and_tags:[],or_tags:[],not_tags:[]}),f=J(()=>n.value?n.value.tags.slice().sort((a,i)=>i.count-a.count):[]),g=["custom","Model","lora","lyco","pos","size","Postprocess upscaler","Postprocess upscale by","Sampler"].reduce((a,i,b)=>(a[i]=b,a),{}),P=J(()=>Object.entries(xa(f.value,a=>a.type)).sort((a,i)=>g[a[0]]-g[i[0]])),T=Le(),h=F(P.value.map(a=>a[0]));qe(async()=>{n.value=await ve(),h.value=P.value.map(a=>a[0]),n.value.img_count&&n.value.expired&&E()}),oe("searchIndexExpired",()=>n.value&&(n.value.expired=!0));const E=ze(()=>s.pushAction(async()=>(await ta(),n.value=await ve(),h.value=P.value.map(a=>a[0]),n.value)).res),$=()=>{t.openTagSearchMatchedImageGridInRight(e.tabIdx,T,o.value)};oe("returnToIIB",async()=>{const a=await s.pushAction(Ze).res;n.value.expired=a.expired});const j=(a,i=!1)=>(i?`[${a.type}] `:"")+(a.display_name?`${a.display_name} : ${a.name}`:a.name),N=F(!1),d=F(""),r=async()=>{var i,b,k;if(!d.value){N.value=!1;return}const a=await s.pushAction(()=>ea({tag_name:d.value})).res;a.type!=="custom"&&de.error(ne("existInOtherType")),(i=n.value)!=null&&i.tags.find(O=>O.id===a.id)?de.error(ne("alreadyExists")):((b=n.value)==null||b.tags.push(a),(k=t.conf)==null||k.all_custom_tags.push(a)),d.value="",N.value=!1},u=a=>{Je.confirm({title:ne("confirmDelete"),async onOk(){var b,k,O,I;await aa({tag_id:a});const i=((b=n.value)==null?void 0:b.tags.findIndex(w=>w.id===a))??-1;(k=n.value)==null||k.tags.splice(i,1),(I=t.conf)==null||I.all_custom_tags.splice((O=t.conf)==null?void 0:O.all_custom_tags.findIndex(w=>w.id===a),1)}})},y=J(()=>new Set([o.value.and_tags,o.value.or_tags,o.value.not_tags].flat())),_=a=>{y.value.has(a.id)?(o.value.and_tags=o.value.and_tags.filter(i=>i!==a.id),o.value.or_tags=o.value.or_tags.filter(i=>i!==a.id),o.value.not_tags=o.value.not_tags.filter(i=>i!==a.id)):o.value.and_tags.push(a.id)},R={value:a=>a.id,text:j,optionText:a=>j(a,!0)};return(a,i)=>{const b=ue,k=We,O=ue,I=Xe,w=ee,A=X;return C(),S("div",Ia,[q("",!0),n.value?(C(),S(Y,{key:1},[M("div",null,[M("div",Aa,[M("div",wa,B(a.$t("exactMatch")),1),v(K(te),{conv:R,mode:"multiple",style:{width:"100%"},options:f.value,value:o.value.and_tags,"onUpdate:value":i[0]||(i[0]=p=>o.value.and_tags=p),disabled:!f.value.length,placeholder:a.$t("selectExactMatchTag")},null,8,["options","value","disabled","placeholder"]),n.value.expired||!n.value.img_count?(C(),Q(b,{key:0,onClick:K(E),loading:!K(s).isIdle,type:"primary"},{default:V(()=>[z(B(n.value.img_count===0?a.$t("generateIndexHint"):a.$t("UpdateIndex")),1)]),_:1},8,["onClick","loading"])):(C(),Q(b,{key:1,type:"primary",onClick:$,loading:!K(s).isIdle,disabled:!o.value.and_tags.length},{default:V(()=>[z(B(a.$t("search")),1)]),_:1},8,["loading","disabled"]))]),M("div",ka,[M("div",Pa,B(a.$t("anyMatch")),1),v(K(te),{conv:R,mode:"multiple",style:{width:"100%"},options:f.value,value:o.value.or_tags,"onUpdate:value":i[1]||(i[1]=p=>o.value.or_tags=p),disabled:!f.value.length,placeholder:a.$t("selectAnyMatchTag")},null,8,["options","value","disabled","placeholder"])]),M("div",$a,[M("div",Oa,B(a.$t("exclude")),1),v(K(te),{conv:R,mode:"multiple",style:{width:"100%"},options:f.value,value:o.value.not_tags,"onUpdate:value":i[2]||(i[2]=p=>o.value.not_tags=p),disabled:!f.value.length,placeholder:a.$t("selectExcludeTag")},null,8,["options","value","disabled","placeholder"])])]),f.value.filter(p=>p.type!=="custom").length?q("",!0):(C(),S("p",Sa,B(a.$t("needGenerateIdx")),1)),M("div",Ba,[(C(!0),S(Y,null,ie(P.value,([p,G])=>(C(),S("ul",{class:"tag-list",key:p},[M("h3",{class:"cat-name",onClick:m=>h.value.includes(p)?h.value.splice(h.value.indexOf(p),1):h.value.push(p)},[v(K(ra),{class:re(["arrow",{down:h.value.includes(p)}])},null,8,["class"]),z(" "+B(a.$t(p)),1)],8,Ka),v(A,{ghost:"",activeKey:h.value,"onUpdate:activeKey":i[5]||(i[5]=m=>h.value=m)},{expandIcon:V(()=>[]),default:V(()=>[(C(),Q(w,{key:p},{default:V(()=>[(C(!0),S(Y,null,ie(G,(m,L)=>(C(),S("li",{key:m.id,class:re(["tag",{selected:y.value.has(m.id)}]),onClick:U=>_(m)},[y.value.has(m.id)?(C(),Q(K(Ge),{key:0})):q("",!0),z(" "+B(j(m))+" ",1),p==="custom"&&L!==0?(C(),S("span",{key:1,class:"remove",onClickCapture:ce(U=>u(m.id),["stop"])},[v(K(He))],40,Ea)):q("",!0)],10,Ta))),128)),p==="custom"?(C(),S("li",{key:0,class:"tag",onClick:i[4]||(i[4]=m=>N.value=!0)},[N.value?(C(),Q(I,{key:0,compact:""},{default:V(()=>[v(k,{value:d.value,"onUpdate:value":i[3]||(i[3]=m=>d.value=m),style:{width:"128px"},loading:c.value,"allow-clear":"",size:"small"},null,8,["value","loading"]),v(O,{size:"small",type:"primary",onClickCapture:ce(r,["stop"]),loading:c.value},{default:V(()=>[z(B(d.value?a.$t("submit"):a.$t("cancel")),1)]),_:1},8,["onClickCapture","loading"])]),_:1})):(C(),S(Y,{key:1},[v(K(Qe)),z(" "+B(a.$t("add")),1)],64))])):q("",!0)]),_:2},1024))]),_:2},1032,["activeKey"])]))),128))])],64)):q("",!0)])}}});const Fa=Ye(Na,[["__scopeId","data-v-d3d0aa40"]]);export{Fa as default}; diff --git a/vue/dist/assets/batchDownload-b6818413.js b/vue/dist/assets/batchDownload-4e2062de.js similarity index 83% rename from vue/dist/assets/batchDownload-b6818413.js rename to vue/dist/assets/batchDownload-4e2062de.js index be7a84e..9765d4e 100644 --- a/vue/dist/assets/batchDownload-b6818413.js +++ b/vue/dist/assets/batchDownload-4e2062de.js @@ -1 +1 @@ -import{d as v,c0 as C,bO as I,o as i,y as _,p as f,c,n as r,x as h,v as d,r as e,m as F,L as x,c1 as z,c2 as B,V as $,X as R}from"./index-f1d763a2.js";import{u as S,b as V,k as E,F as A,g as L}from"./FileItem-a4a4ada7.js";import"./db-328ec51d.js";import"./shortcut-6ab7aba6.js";const T={class:"actions-panel actions"},N={key:0,class:"file-list"},U={class:"hint"},H=v({__name:"batchDownload",props:{tabIdx:{},paneIdx:{},id:{}},setup(O){const{stackViewEl:w}=S().toRefs(),{itemSize:p,gridItems:k,cellWidth:b}=V(),l=E(),{selectdFiles:n}=C(l),u=I(),y=async t=>{const s=z(t);s&&l.addFiles(s.nodes)},D=async()=>{u.pushAction(async()=>{const t=await B.value.post("/zip",{paths:n.value.map(o=>o.fullpath)},{responseType:"blob"}),s=window.URL.createObjectURL(new Blob([t.data])),a=document.createElement("a");a.href=s,a.setAttribute("download",`iib_${new Date().toLocaleString()}.zip`),document.body.appendChild(a),a.click()})},g=t=>{n.value.splice(t,1)};return(t,s)=>{const a=$;return i(),_("div",{class:"container",ref_key:"stackViewEl",ref:w,onDrop:y},[f("div",T,[c(a,{onClick:s[0]||(s[0]=o=>e(l).selectdFiles=[])},{default:r(()=>[h(d(t.$t("clear")),1)]),_:1}),c(a,{onClick:D,type:"primary",loading:!e(u).isIdle},{default:r(()=>[h(d(t.$t("zipDownload")),1)]),_:1},8,["loading"])]),e(n).length?(i(),F(e(L),{key:1,ref:"scroller",class:"file-list",items:e(n).slice(),"item-size":e(p).first,"key-field":"fullpath","item-secondary-size":e(p).second,gridItems:e(k)},{default:r(({item:o,index:m})=>[c(A,{idx:m,file:o,"cell-width":e(b),"enable-close-icon":"",onCloseIconClick:j=>g(m),"full-screen-preview-image-url":e(x)(o),"enable-right-click-menu":!1},null,8,["idx","file","cell-width","onCloseIconClick","full-screen-preview-image-url"])]),_:1},8,["items","item-size","item-secondary-size","gridItems"])):(i(),_("div",N,[f("p",U,d(t.$t("batchDownloaDDragAndDropHint")),1)]))],544)}}});const G=R(H,[["__scopeId","data-v-aab31da2"]]);export{G as default}; +import{d as v,c2 as C,bO as I,o as i,y as _,p as f,c,n as r,x as h,v as d,r as e,m as F,L as x,c3 as z,c4 as B,V as $,X as R}from"./index-1537dba6.js";import{u as S,b as V,k as E,F as A,g as L}from"./FileItem-dbdcf20b.js";import"./db-925e828e.js";import"./shortcut-ec395f0e.js";const T={class:"actions-panel actions"},N={key:0,class:"file-list"},U={class:"hint"},H=v({__name:"batchDownload",props:{tabIdx:{},paneIdx:{},id:{}},setup(O){const{stackViewEl:w}=S().toRefs(),{itemSize:p,gridItems:k,cellWidth:b}=V(),l=E(),{selectdFiles:n}=C(l),u=I(),y=async t=>{const s=z(t);s&&l.addFiles(s.nodes)},D=async()=>{u.pushAction(async()=>{const t=await B.value.post("/zip",{paths:n.value.map(o=>o.fullpath)},{responseType:"blob"}),s=window.URL.createObjectURL(new Blob([t.data])),a=document.createElement("a");a.href=s,a.setAttribute("download",`iib_${new Date().toLocaleString()}.zip`),document.body.appendChild(a),a.click()})},g=t=>{n.value.splice(t,1)};return(t,s)=>{const a=$;return i(),_("div",{class:"container",ref_key:"stackViewEl",ref:w,onDrop:y},[f("div",T,[c(a,{onClick:s[0]||(s[0]=o=>e(l).selectdFiles=[])},{default:r(()=>[h(d(t.$t("clear")),1)]),_:1}),c(a,{onClick:D,type:"primary",loading:!e(u).isIdle},{default:r(()=>[h(d(t.$t("zipDownload")),1)]),_:1},8,["loading"])]),e(n).length?(i(),F(e(L),{key:1,ref:"scroller",class:"file-list",items:e(n).slice(),"item-size":e(p).first,"key-field":"fullpath","item-secondary-size":e(p).second,gridItems:e(k)},{default:r(({item:o,index:m})=>[c(A,{idx:m,file:o,"cell-width":e(b),"enable-close-icon":"",onCloseIconClick:j=>g(m),"full-screen-preview-image-url":e(x)(o),"enable-right-click-menu":!1},null,8,["idx","file","cell-width","onCloseIconClick","full-screen-preview-image-url"])]),_:1},8,["items","item-size","item-secondary-size","gridItems"])):(i(),_("div",N,[f("p",U,d(t.$t("batchDownloaDDragAndDropHint")),1)]))],544)}}});const G=R(H,[["__scopeId","data-v-aab31da2"]]);export{G as default}; diff --git a/vue/dist/assets/db-328ec51d.js b/vue/dist/assets/db-328ec51d.js deleted file mode 100644 index 5b130d0..0000000 --- a/vue/dist/assets/db-328ec51d.js +++ /dev/null @@ -1 +0,0 @@ -import{c2 as t}from"./index-f1d763a2.js";const o=async()=>(await t.value.get("/db/basic_info")).data,c=async()=>(await t.value.get("/db/expired_dirs")).data,r=async()=>{await t.value.post("/db/update_image_data",{},{timeout:1/0})},d=async a=>(await t.value.post("/db/match_images_by_tags",a)).data,g=async a=>(await t.value.post("/db/add_custom_tag",a)).data,u=async a=>(await t.value.post("/db/toggle_custom_tag_to_img",a)).data,p=async a=>{await t.value.post("/db/remove_custom_tag",a)},i=async a=>(await t.value.get("/db/search_by_substr",{params:{substr:a}})).data,e="/db/scanned_paths",m=async a=>{await t.value.post(e,{path:a})},_=async a=>{await t.value.delete(e,{data:{path:a}})},b=async a=>(await t.value.post("/db/get_image_tags",{paths:a})).data;export{m as a,o as b,c,g as d,p as e,i as f,d as g,b as h,_ as r,u as t,r as u}; diff --git a/vue/dist/assets/db-925e828e.js b/vue/dist/assets/db-925e828e.js new file mode 100644 index 0000000..5b2284d --- /dev/null +++ b/vue/dist/assets/db-925e828e.js @@ -0,0 +1 @@ +import{c4 as t}from"./index-1537dba6.js";const c=async()=>(await t.value.get("/db/basic_info")).data,r=async()=>(await t.value.get("/db/expired_dirs")).data,d=async()=>{await t.value.post("/db/update_image_data",{},{timeout:1/0})},g=async(a,s)=>(await t.value.post("/db/match_images_by_tags",{...a,cursor:s})).data,u=async a=>(await t.value.post("/db/add_custom_tag",a)).data,p=async a=>(await t.value.post("/db/toggle_custom_tag_to_img",a)).data,i=async a=>{await t.value.post("/db/remove_custom_tag",a)},m=async(a,s)=>(await t.value.get("/db/search_by_substr",{params:{substr:a,cursor:s}})).data,e="/db/scanned_paths",_=async a=>{await t.value.post(e,{path:a})},b=async a=>{await t.value.delete(e,{data:{path:a}})},y=async a=>(await t.value.post("/db/get_image_tags",{paths:a})).data;export{_ as a,c as b,r as c,u as d,i as e,m as f,g,y as h,b as r,p as t,d as u}; diff --git a/vue/dist/assets/emptyStartup-a755d79c.js b/vue/dist/assets/emptyStartup-d6bd91f2.js similarity index 98% rename from vue/dist/assets/emptyStartup-a755d79c.js rename to vue/dist/assets/emptyStartup-d6bd91f2.js index 6ca72f0..5393c77 100644 --- a/vue/dist/assets/emptyStartup-a755d79c.js +++ b/vue/dist/assets/emptyStartup-d6bd91f2.js @@ -1 +1 @@ -import{Y as he,Z as me,d as ce,u as fe,$ as D,g as H,a0 as ge,h as O,c as p,a1 as _e,a2 as be,a3 as ye,a4 as ke,a5 as we,a6 as Ce,a as te,a7 as Oe,P as S,a8 as Se,a9 as $e,aa as Ie,ab as xe,ac as Pe,ad as ze,ae as Ae,af as Me,ag as ie,k as De,ah as Te,ai as g,aj as ne,o as d,y as f,p as a,v as c,r as h,C as y,m as W,n as $,q as I,z as j,A as B,x as V,ak as Ee,al as ae,am as Fe,an as Le,ao as Ne,R as X,ap as He,U as je,aq as Be,ar as Y,as as R,V as Ve,at as Re,au as qe,X as Ge}from"./index-f1d763a2.js";import{a as Qe,r as Ue}from"./db-328ec51d.js";var We={success:Se,info:$e,error:Ie,warning:xe},Xe={success:Pe,info:ze,error:Ae,warning:Me},Ye=me("success","info","warning","error"),Ze=function(){return{type:S.oneOf(Ye),closable:{type:Boolean,default:void 0},closeText:S.any,message:S.any,description:S.any,afterClose:Function,showIcon:{type:Boolean,default:void 0},prefixCls:String,banner:{type:Boolean,default:void 0},icon:S.any,closeIcon:S.any,onClose:Function}},Je=ce({compatConfig:{MODE:3},name:"AAlert",inheritAttrs:!1,props:Ze(),setup:function(n,e){var i=e.slots,m=e.emit,k=e.attrs,x=e.expose,P=fe("alert",n),G=P.prefixCls,Q=P.direction,C=D(!1),T=D(!1),E=D(),t=function(l){l.preventDefault();var b=E.value;b.style.height="".concat(b.offsetHeight,"px"),b.style.height="".concat(b.offsetHeight,"px"),C.value=!0,m("close",l)},r=function(){var l;C.value=!1,T.value=!0,(l=n.afterClose)===null||l===void 0||l.call(n)};x({animationEnd:r});var _=D({});return function(){var u,l,b=n.banner,z=n.closeIcon,o=z===void 0?(u=i.closeIcon)===null||u===void 0?void 0:u.call(i):z,w=n.closable,A=n.type,M=n.showIcon,U=H(i,n,"closeText"),F=H(i,n,"description"),K=H(i,n,"message"),L=H(i,n,"icon");M=b&&M===void 0?!0:M,A=b&&A===void 0?"warning":A||"info";var re=(F?Xe:We)[A]||null;U&&(w=!0);var v=G.value,ue=ge(v,(l={},O(l,"".concat(v,"-").concat(A),!0),O(l,"".concat(v,"-closing"),C.value),O(l,"".concat(v,"-with-description"),!!F),O(l,"".concat(v,"-no-icon"),!M),O(l,"".concat(v,"-banner"),!!b),O(l,"".concat(v,"-closable"),w),O(l,"".concat(v,"-rtl"),Q.value==="rtl"),l)),de=w?p("button",{type:"button",onClick:t,class:"".concat(v,"-close-icon"),tabindex:0},[U?p("span",{class:"".concat(v,"-close-text")},[U]):o===void 0?p(_e,null,null):o]):null,pe=L&&(be(L)?ye(L,{class:"".concat(v,"-icon")}):p("span",{class:"".concat(v,"-icon")},[L]))||p(re,{class:"".concat(v,"-icon")},null),ve=ke("".concat(v,"-motion"),{appear:!1,css:!0,onAfterLeave:r,onBeforeLeave:function(N){N.style.maxHeight="".concat(N.offsetHeight,"px")},onLeave:function(N){N.style.maxHeight="0px"}});return T.value?null:p(Oe,ve,{default:function(){return[we(p("div",te(te({role:"alert"},k),{},{style:[k.style,_.value],class:[k.class,ue],"data-show":!C.value,ref:E}),[M?pe:null,p("div",{class:"".concat(v,"-content")},[K?p("div",{class:"".concat(v,"-message")},[K]):null,F?p("div",{class:"".concat(v,"-description")},[F]):null]),de]),[[Ce,!C.value]])]}})}}});const Ke=he(Je);var et={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M688 312v-48c0-4.4-3.6-8-8-8H296c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8zm-392 88c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H296zm376 116c-119.3 0-216 96.7-216 216s96.7 216 216 216 216-96.7 216-216-96.7-216-216-216zm107.5 323.5C750.8 868.2 712.6 884 672 884s-78.8-15.8-107.5-44.5C535.8 810.8 520 772.6 520 732s15.8-78.8 44.5-107.5C593.2 595.8 631.4 580 672 580s78.8 15.8 107.5 44.5C808.2 653.2 824 691.4 824 732s-15.8 78.8-44.5 107.5zM761 656h-44.3c-2.6 0-5 1.2-6.5 3.3l-63.5 87.8-23.1-31.9a7.92 7.92 0 00-6.5-3.3H573c-6.5 0-10.3 7.4-6.5 12.7l73.8 102.1c3.2 4.4 9.7 4.4 12.9 0l114.2-158c3.9-5.3.1-12.7-6.4-12.7zM440 852H208V148h560v344c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V108c0-17.7-14.3-32-32-32H168c-17.7 0-32 14.3-32 32v784c0 17.7 14.3 32 32 32h272c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8z"}}]},name:"file-done",theme:"outlined"};const tt=et;function se(s){for(var n=1;n(Re("data-v-1cab3726"),s=s(),qe(),s),ct={class:"container"},it={class:"header"},rt={key:0,style:{"margin-left":"16px","font-size":"1.5em"}},ut=q(()=>a("div",{"flex-placeholder":""},null,-1)),dt=q(()=>a("a",{href:"https://github.com/zanllp/sd-webui-infinite-image-browsing",target:"_blank",class:"last-record"},"Github",-1)),pt={href:"https://github.com/zanllp/sd-webui-infinite-image-browsing/blob/main/.env.example",target:"_blank",class:"last-record"},vt={href:"https://github.com/zanllp/sd-webui-infinite-image-browsing/wiki/Change-log",target:"_blank",class:"last-record"},ht={href:"https://github.com/zanllp/sd-webui-infinite-image-browsing/issues/90",target:"_blank",class:"last-record"},mt={class:"access-mode-message"},ft=q(()=>a("div",{"flex-placeholder":""},null,-1)),gt={class:"access-mode-message"},_t=q(()=>a("div",{"flex-placeholder":""},null,-1)),bt={class:"content"},yt={key:0,class:"feature-item"},kt={key:1,class:"feature-item"},wt={class:"text line-clamp-1"},Ct=["onClick"],Ot={class:"text line-clamp-2"},St={class:"feature-item"},$t=["onClick"],It={class:"text line-clamp-1"},xt={class:"text line-clamp-1"},Pt={class:"text line-clamp-1"},zt={class:"text line-clamp-1"},At={key:2,class:"feature-item recent"},Mt={class:"title"},Dt=["onClick"],Tt={class:"text line-clamp-1"},Et=ce({__name:"emptyStartup",props:{tabIdx:{},paneIdx:{}},setup(s){const n=s,e=De(),i=Te(),m={local:g("local"),"tag-search":g("imgSearch"),"fuzzy-search":g("fuzzy-search"),"global-setting":g("globalSettings"),"batch-download":g("batchDownload")+" / "+g("archive")},k=(t,r,_=!1)=>{let u;switch(t){case"tag-search-matched-image-grid":case"img-sli":return;case"global-setting":case"tag-search":case"batch-download":case"fuzzy-search":case"empty":u={type:t,name:m[t],key:Date.now()+ae()};break;case"local":u={type:t,name:m[t],key:Date.now()+ae(),path:r,walkModePath:_?r:void 0}}const l=e.tabList[n.tabIdx];l.panes.splice(n.paneIdx,1,u),l.key=u.key},x=ne(()=>{var t;return(t=e.tabListHistoryRecord)==null?void 0:t[1]}),P=ne(()=>e.quickMovePaths.filter(({key:t})=>t==="outdir_txt2img_samples"||t==="outdir_img2img_samples")),G=window.parent!==window,Q=()=>window.parent.open("/infinite_image_browsing"+(window.parent.location.href.includes("theme=dark")?"?__theme=dark":"")),C=()=>{Fe(x.value),e.tabList=Le(x.value.tabs)},T=async()=>{let t;if({}.TAURI_ARCH){const r=await Ne({directory:!0});if(typeof r=="string")t=r;else return}else t=await new Promise(r=>{const _=D("");X.confirm({title:g("inputTargetFolderPath"),content:()=>He(je,{value:_.value,"onUpdate:value":u=>_.value=u}),async onOk(){const u=_.value;(await Be([u]))[u]?r(_.value):Y.error(g("pathDoesNotExist"))}})});X.confirm({content:g("confirmToAddToQuickMove"),async onOk(){await Qe(t),Y.success(g("addCompleted")),R.emit("searchIndexExpired"),R.emit("updateGlobalSetting")}})},E=t=>{X.confirm({content:g("confirmDelete"),closable:!0,async onOk(){await Ue(t),Y.success(g("removeCompleted")),R.emit("searchIndexExpired"),R.emit("updateGlobalSetting")}})};return(t,r)=>{var l,b,z;const _=Ke,u=Ve;return d(),f("div",ct,[a("div",it,[a("h1",null,c(t.$t("welcome")),1),(l=h(e).conf)!=null&&l.enable_access_control&&h(e).dontShowAgain?(d(),f("div",rt,[p(h(le),{title:"Access Control mode",style:{"vertical-align":"text-bottom"}})])):y("",!0),ut,dt,a("a",pt,c(t.$t("privacyAndSecurity")),1),a("a",vt,c(t.$t("changlog")),1),a("a",ht,c(t.$t("faq")),1)]),(b=h(e).conf)!=null&&b.enable_access_control&&!h(e).dontShowAgain?(d(),W(_,{key:0,"show-icon":""},{message:$(()=>[a("div",mt,[a("div",null,c(t.$t("accessControlModeTips")),1),ft,a("a",{onClick:r[0]||(r[0]=I(o=>h(e).dontShowAgain=!0,["prevent"]))},c(t.$t("dontShowAgain")),1)])]),icon:$(()=>[p(h(le))]),_:1})):y("",!0),h(e).dontShowAgainNewImgOpts?y("",!0):(d(),W(_,{key:1,"show-icon":""},{message:$(()=>[a("div",gt,[a("div",null,c(t.$t("majorUpdateCustomCellSizeTips")),1),_t,a("a",{onClick:r[1]||(r[1]=I(o=>h(e).dontShowAgainNewImgOpts=!0,["prevent"]))},c(t.$t("dontShowAgain")),1)])]),_:1})),a("div",bt,[P.value.length?(d(),f("div",yt,[a("h2",null,c(t.$t("walkMode")),1),a("ul",null,[(d(!0),f(j,null,B(P.value,o=>(d(),f("li",{key:o.dir,class:"item"},[p(u,{onClick:w=>k("local",o.dir,!0),ghost:"",type:"primary",block:""},{default:$(()=>[V(c(o.zh),1)]),_:2},1032,["onClick"])]))),128))])])):y("",!0),h(e).quickMovePaths.length?(d(),f("div",kt,[a("h2",null,c(t.$t("launchFromQuickMove")),1),a("ul",null,[a("li",{onClick:T,class:"item",style:{"text-align":""}},[a("span",wt,[p(h(Ee)),V(" "+c(t.$t("add")),1)])]),(d(!0),f(j,null,B(h(e).quickMovePaths,o=>(d(),f("li",{key:o.key,class:"item rem",onClick:I(w=>k("local",o.dir),["prevent"])},[a("span",Ot,c(o.zh),1),o.can_delete?(d(),W(u,{key:0,type:"link",onClick:I(w=>E(o.dir),["stop"])},{default:$(()=>[V(c(t.$t("remove")),1)]),_:2},1032,["onClick"])):y("",!0)],8,Ct))),128))])])):y("",!0),a("div",St,[a("h2",null,c(t.$t("launch")),1),a("ul",null,[(d(!0),f(j,null,B(Object.keys(m),o=>(d(),f("li",{key:o,class:"item",onClick:I(w=>k(o),["prevent"])},[a("span",It,c(m[o]),1)],8,$t))),128)),a("li",{class:"item",onClick:r[2]||(r[2]=o=>h(i).opened=!0)},[a("span",xt,c(t.$t("imgCompare")),1)]),G?(d(),f("li",{key:0,class:"item",onClick:Q},[a("span",Pt,c(t.$t("openInNewWindow")),1)])):y("",!0),(z=x.value)!=null&&z.tabs.length?(d(),f("li",{key:1,class:"item",onClick:C},[a("span",zt,c(t.$t("restoreLastRecord")),1)])):y("",!0)])]),h(e).recent.length?(d(),f("div",At,[a("div",Mt,[a("h2",null,c(t.$t("recent")),1),p(u,{onClick:r[3]||(r[3]=o=>h(e).recent=[]),type:"link"},{default:$(()=>[V(c(t.$t("clear")),1)]),_:1})]),a("ul",null,[(d(!0),f(j,null,B(h(e).recent,o=>(d(),f("li",{key:o.key,class:"item",onClick:I(w=>k("local",o.path),["prevent"])},[p(h(at),{class:"icon"}),a("span",Tt,c(o.path),1)],8,Dt))),128))])])):y("",!0)])])}}});const Nt=Ge(Et,[["__scopeId","data-v-1cab3726"]]);export{Nt as default}; +import{Y as he,Z as me,d as ce,u as fe,$ as D,g as H,a0 as ge,h as O,c as p,a1 as _e,a2 as be,a3 as ye,a4 as ke,a5 as we,a6 as Ce,a as te,a7 as Oe,P as S,a8 as Se,a9 as $e,aa as Ie,ab as xe,ac as Pe,ad as ze,ae as Ae,af as Me,ag as ie,k as De,ah as Te,ai as g,aj as ne,o as d,y as f,p as a,v as c,r as h,C as y,m as W,n as $,q as I,z as j,A as B,x as V,ak as Ee,al as ae,am as Fe,an as Le,ao as Ne,R as X,ap as He,U as je,aq as Be,ar as Y,as as R,V as Ve,at as Re,au as qe,X as Ge}from"./index-1537dba6.js";import{a as Qe,r as Ue}from"./db-925e828e.js";var We={success:Se,info:$e,error:Ie,warning:xe},Xe={success:Pe,info:ze,error:Ae,warning:Me},Ye=me("success","info","warning","error"),Ze=function(){return{type:S.oneOf(Ye),closable:{type:Boolean,default:void 0},closeText:S.any,message:S.any,description:S.any,afterClose:Function,showIcon:{type:Boolean,default:void 0},prefixCls:String,banner:{type:Boolean,default:void 0},icon:S.any,closeIcon:S.any,onClose:Function}},Je=ce({compatConfig:{MODE:3},name:"AAlert",inheritAttrs:!1,props:Ze(),setup:function(n,e){var i=e.slots,m=e.emit,k=e.attrs,x=e.expose,P=fe("alert",n),G=P.prefixCls,Q=P.direction,C=D(!1),T=D(!1),E=D(),t=function(l){l.preventDefault();var b=E.value;b.style.height="".concat(b.offsetHeight,"px"),b.style.height="".concat(b.offsetHeight,"px"),C.value=!0,m("close",l)},r=function(){var l;C.value=!1,T.value=!0,(l=n.afterClose)===null||l===void 0||l.call(n)};x({animationEnd:r});var _=D({});return function(){var u,l,b=n.banner,z=n.closeIcon,o=z===void 0?(u=i.closeIcon)===null||u===void 0?void 0:u.call(i):z,w=n.closable,A=n.type,M=n.showIcon,U=H(i,n,"closeText"),F=H(i,n,"description"),K=H(i,n,"message"),L=H(i,n,"icon");M=b&&M===void 0?!0:M,A=b&&A===void 0?"warning":A||"info";var re=(F?Xe:We)[A]||null;U&&(w=!0);var v=G.value,ue=ge(v,(l={},O(l,"".concat(v,"-").concat(A),!0),O(l,"".concat(v,"-closing"),C.value),O(l,"".concat(v,"-with-description"),!!F),O(l,"".concat(v,"-no-icon"),!M),O(l,"".concat(v,"-banner"),!!b),O(l,"".concat(v,"-closable"),w),O(l,"".concat(v,"-rtl"),Q.value==="rtl"),l)),de=w?p("button",{type:"button",onClick:t,class:"".concat(v,"-close-icon"),tabindex:0},[U?p("span",{class:"".concat(v,"-close-text")},[U]):o===void 0?p(_e,null,null):o]):null,pe=L&&(be(L)?ye(L,{class:"".concat(v,"-icon")}):p("span",{class:"".concat(v,"-icon")},[L]))||p(re,{class:"".concat(v,"-icon")},null),ve=ke("".concat(v,"-motion"),{appear:!1,css:!0,onAfterLeave:r,onBeforeLeave:function(N){N.style.maxHeight="".concat(N.offsetHeight,"px")},onLeave:function(N){N.style.maxHeight="0px"}});return T.value?null:p(Oe,ve,{default:function(){return[we(p("div",te(te({role:"alert"},k),{},{style:[k.style,_.value],class:[k.class,ue],"data-show":!C.value,ref:E}),[M?pe:null,p("div",{class:"".concat(v,"-content")},[K?p("div",{class:"".concat(v,"-message")},[K]):null,F?p("div",{class:"".concat(v,"-description")},[F]):null]),de]),[[Ce,!C.value]])]}})}}});const Ke=he(Je);var et={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M688 312v-48c0-4.4-3.6-8-8-8H296c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8zm-392 88c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H296zm376 116c-119.3 0-216 96.7-216 216s96.7 216 216 216 216-96.7 216-216-96.7-216-216-216zm107.5 323.5C750.8 868.2 712.6 884 672 884s-78.8-15.8-107.5-44.5C535.8 810.8 520 772.6 520 732s15.8-78.8 44.5-107.5C593.2 595.8 631.4 580 672 580s78.8 15.8 107.5 44.5C808.2 653.2 824 691.4 824 732s-15.8 78.8-44.5 107.5zM761 656h-44.3c-2.6 0-5 1.2-6.5 3.3l-63.5 87.8-23.1-31.9a7.92 7.92 0 00-6.5-3.3H573c-6.5 0-10.3 7.4-6.5 12.7l73.8 102.1c3.2 4.4 9.7 4.4 12.9 0l114.2-158c3.9-5.3.1-12.7-6.4-12.7zM440 852H208V148h560v344c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V108c0-17.7-14.3-32-32-32H168c-17.7 0-32 14.3-32 32v784c0 17.7 14.3 32 32 32h272c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8z"}}]},name:"file-done",theme:"outlined"};const tt=et;function se(s){for(var n=1;n(Re("data-v-1cab3726"),s=s(),qe(),s),ct={class:"container"},it={class:"header"},rt={key:0,style:{"margin-left":"16px","font-size":"1.5em"}},ut=q(()=>a("div",{"flex-placeholder":""},null,-1)),dt=q(()=>a("a",{href:"https://github.com/zanllp/sd-webui-infinite-image-browsing",target:"_blank",class:"last-record"},"Github",-1)),pt={href:"https://github.com/zanllp/sd-webui-infinite-image-browsing/blob/main/.env.example",target:"_blank",class:"last-record"},vt={href:"https://github.com/zanllp/sd-webui-infinite-image-browsing/wiki/Change-log",target:"_blank",class:"last-record"},ht={href:"https://github.com/zanllp/sd-webui-infinite-image-browsing/issues/90",target:"_blank",class:"last-record"},mt={class:"access-mode-message"},ft=q(()=>a("div",{"flex-placeholder":""},null,-1)),gt={class:"access-mode-message"},_t=q(()=>a("div",{"flex-placeholder":""},null,-1)),bt={class:"content"},yt={key:0,class:"feature-item"},kt={key:1,class:"feature-item"},wt={class:"text line-clamp-1"},Ct=["onClick"],Ot={class:"text line-clamp-2"},St={class:"feature-item"},$t=["onClick"],It={class:"text line-clamp-1"},xt={class:"text line-clamp-1"},Pt={class:"text line-clamp-1"},zt={class:"text line-clamp-1"},At={key:2,class:"feature-item recent"},Mt={class:"title"},Dt=["onClick"],Tt={class:"text line-clamp-1"},Et=ce({__name:"emptyStartup",props:{tabIdx:{},paneIdx:{}},setup(s){const n=s,e=De(),i=Te(),m={local:g("local"),"tag-search":g("imgSearch"),"fuzzy-search":g("fuzzy-search"),"global-setting":g("globalSettings"),"batch-download":g("batchDownload")+" / "+g("archive")},k=(t,r,_=!1)=>{let u;switch(t){case"tag-search-matched-image-grid":case"img-sli":return;case"global-setting":case"tag-search":case"batch-download":case"fuzzy-search":case"empty":u={type:t,name:m[t],key:Date.now()+ae()};break;case"local":u={type:t,name:m[t],key:Date.now()+ae(),path:r,walkModePath:_?r:void 0}}const l=e.tabList[n.tabIdx];l.panes.splice(n.paneIdx,1,u),l.key=u.key},x=ne(()=>{var t;return(t=e.tabListHistoryRecord)==null?void 0:t[1]}),P=ne(()=>e.quickMovePaths.filter(({key:t})=>t==="outdir_txt2img_samples"||t==="outdir_img2img_samples")),G=window.parent!==window,Q=()=>window.parent.open("/infinite_image_browsing"+(window.parent.location.href.includes("theme=dark")?"?__theme=dark":"")),C=()=>{Fe(x.value),e.tabList=Le(x.value.tabs)},T=async()=>{let t;if({}.TAURI_ARCH){const r=await Ne({directory:!0});if(typeof r=="string")t=r;else return}else t=await new Promise(r=>{const _=D("");X.confirm({title:g("inputTargetFolderPath"),content:()=>He(je,{value:_.value,"onUpdate:value":u=>_.value=u}),async onOk(){const u=_.value;(await Be([u]))[u]?r(_.value):Y.error(g("pathDoesNotExist"))}})});X.confirm({content:g("confirmToAddToQuickMove"),async onOk(){await Qe(t),Y.success(g("addCompleted")),R.emit("searchIndexExpired"),R.emit("updateGlobalSetting")}})},E=t=>{X.confirm({content:g("confirmDelete"),closable:!0,async onOk(){await Ue(t),Y.success(g("removeCompleted")),R.emit("searchIndexExpired"),R.emit("updateGlobalSetting")}})};return(t,r)=>{var l,b,z;const _=Ke,u=Ve;return d(),f("div",ct,[a("div",it,[a("h1",null,c(t.$t("welcome")),1),(l=h(e).conf)!=null&&l.enable_access_control&&h(e).dontShowAgain?(d(),f("div",rt,[p(h(le),{title:"Access Control mode",style:{"vertical-align":"text-bottom"}})])):y("",!0),ut,dt,a("a",pt,c(t.$t("privacyAndSecurity")),1),a("a",vt,c(t.$t("changlog")),1),a("a",ht,c(t.$t("faq")),1)]),(b=h(e).conf)!=null&&b.enable_access_control&&!h(e).dontShowAgain?(d(),W(_,{key:0,"show-icon":""},{message:$(()=>[a("div",mt,[a("div",null,c(t.$t("accessControlModeTips")),1),ft,a("a",{onClick:r[0]||(r[0]=I(o=>h(e).dontShowAgain=!0,["prevent"]))},c(t.$t("dontShowAgain")),1)])]),icon:$(()=>[p(h(le))]),_:1})):y("",!0),h(e).dontShowAgainNewImgOpts?y("",!0):(d(),W(_,{key:1,"show-icon":""},{message:$(()=>[a("div",gt,[a("div",null,c(t.$t("majorUpdateCustomCellSizeTips")),1),_t,a("a",{onClick:r[1]||(r[1]=I(o=>h(e).dontShowAgainNewImgOpts=!0,["prevent"]))},c(t.$t("dontShowAgain")),1)])]),_:1})),a("div",bt,[P.value.length?(d(),f("div",yt,[a("h2",null,c(t.$t("walkMode")),1),a("ul",null,[(d(!0),f(j,null,B(P.value,o=>(d(),f("li",{key:o.dir,class:"item"},[p(u,{onClick:w=>k("local",o.dir,!0),ghost:"",type:"primary",block:""},{default:$(()=>[V(c(o.zh),1)]),_:2},1032,["onClick"])]))),128))])])):y("",!0),h(e).quickMovePaths.length?(d(),f("div",kt,[a("h2",null,c(t.$t("launchFromQuickMove")),1),a("ul",null,[a("li",{onClick:T,class:"item",style:{"text-align":""}},[a("span",wt,[p(h(Ee)),V(" "+c(t.$t("add")),1)])]),(d(!0),f(j,null,B(h(e).quickMovePaths,o=>(d(),f("li",{key:o.key,class:"item rem",onClick:I(w=>k("local",o.dir),["prevent"])},[a("span",Ot,c(o.zh),1),o.can_delete?(d(),W(u,{key:0,type:"link",onClick:I(w=>E(o.dir),["stop"])},{default:$(()=>[V(c(t.$t("remove")),1)]),_:2},1032,["onClick"])):y("",!0)],8,Ct))),128))])])):y("",!0),a("div",St,[a("h2",null,c(t.$t("launch")),1),a("ul",null,[(d(!0),f(j,null,B(Object.keys(m),o=>(d(),f("li",{key:o,class:"item",onClick:I(w=>k(o),["prevent"])},[a("span",It,c(m[o]),1)],8,$t))),128)),a("li",{class:"item",onClick:r[2]||(r[2]=o=>h(i).opened=!0)},[a("span",xt,c(t.$t("imgCompare")),1)]),G?(d(),f("li",{key:0,class:"item",onClick:Q},[a("span",Pt,c(t.$t("openInNewWindow")),1)])):y("",!0),(z=x.value)!=null&&z.tabs.length?(d(),f("li",{key:1,class:"item",onClick:C},[a("span",zt,c(t.$t("restoreLastRecord")),1)])):y("",!0)])]),h(e).recent.length?(d(),f("div",At,[a("div",Mt,[a("h2",null,c(t.$t("recent")),1),p(u,{onClick:r[3]||(r[3]=o=>h(e).recent=[]),type:"link"},{default:$(()=>[V(c(t.$t("clear")),1)]),_:1})]),a("ul",null,[(d(!0),f(j,null,B(h(e).recent,o=>(d(),f("li",{key:o.key,class:"item",onClick:I(w=>k("local",o.path),["prevent"])},[p(h(at),{class:"icon"}),a("span",Tt,c(o.path),1)],8,Dt))),128))])])):y("",!0)])])}}});const Nt=Ge(Et,[["__scopeId","data-v-1cab3726"]]);export{Nt as default}; diff --git a/vue/dist/assets/fullScreenContextMenu-c371385f.js b/vue/dist/assets/fullScreenContextMenu-bb0fc66b.js similarity index 97% rename from vue/dist/assets/fullScreenContextMenu-c371385f.js rename to vue/dist/assets/fullScreenContextMenu-bb0fc66b.js index c07d2c2..535e830 100644 --- a/vue/dist/assets/fullScreenContextMenu-c371385f.js +++ b/vue/dist/assets/fullScreenContextMenu-bb0fc66b.js @@ -1,2 +1,2 @@ -import{d as de,bq as pe,aI as me,bU as ge,ax as he,aC as F,bV as ye,bW as Q,e as Z,c as o,_ as be,h as C,a as J,bz as we,P as K,ag as A,aw as Oe,aM as _e,l as fe,k as Ee,$ as T,aj as R,bO as Le,bX as $e,bY as Se,ai as z,o as y,y as w,p as j,r as d,m as ee,n as v,L as te,bZ as xe,C as N,z as B,x as g,v as p,t as ne,A as ie,N as ae,B as Pe,q as Ce,V as Me,W as ke,b_ as De,M as ze,X as je}from"./index-f1d763a2.js";import{h as Ne,j as Ae,_ as Te,D as We}from"./FileItem-a4a4ada7.js";import"./shortcut-6ab7aba6.js";var Ie=["class","style"],Be=function(){return{prefixCls:String,spinning:{type:Boolean,default:void 0},size:String,wrapperClassName:String,tip:K.any,delay:Number,indicator:K.any}},I=null;function Fe(t,e){return!!t&&!!e&&!isNaN(Number(e))}function Ct(t){var e=t.indicator;I=typeof e=="function"?e:function(){return o(e,null,null)}}const Mt=de({compatConfig:{MODE:3},name:"ASpin",inheritAttrs:!1,props:pe(Be(),{size:"default",spinning:!0,wrapperClassName:""}),setup:function(){return{originalUpdateSpinning:null,configProvider:me("configProvider",ge)}},data:function(){var e=this.spinning,i=this.delay,n=Fe(e,i);return{sSpinning:e&&!n}},created:function(){this.originalUpdateSpinning=this.updateSpinning,this.debouncifyUpdateSpinning(this.$props)},mounted:function(){this.updateSpinning()},updated:function(){var e=this;he(function(){e.debouncifyUpdateSpinning(),e.updateSpinning()})},beforeUnmount:function(){this.cancelExistingSpin()},methods:{debouncifyUpdateSpinning:function(e){var i=e||this.$props,n=i.delay;n&&(this.cancelExistingSpin(),this.updateSpinning=F(this.originalUpdateSpinning,n))},updateSpinning:function(){var e=this.spinning,i=this.sSpinning;i!==e&&(this.sSpinning=e)},cancelExistingSpin:function(){var e=this.updateSpinning;e&&e.cancel&&e.cancel()},renderIndicator:function(e){var i="".concat(e,"-dot"),n=ye(this,"indicator");return n===null?null:(Array.isArray(n)&&(n=n.length===1?n[0]:n),Q(n)?Z(n,{class:i}):I&&Q(I())?Z(I(),{class:i}):o("span",{class:"".concat(i," ").concat(e,"-dot-spin")},[o("i",{class:"".concat(e,"-dot-item")},null),o("i",{class:"".concat(e,"-dot-item")},null),o("i",{class:"".concat(e,"-dot-item")},null),o("i",{class:"".concat(e,"-dot-item")},null)]))}},render:function(){var e,i,n,l=this.$props,O=l.size,_=l.prefixCls,L=l.tip,$=L===void 0?(e=(i=this.$slots).tip)===null||e===void 0?void 0:e.call(i):L,S=l.wrapperClassName,x=this.$attrs,P=x.class,M=x.style,c=be(x,Ie),b=this.configProvider,k=b.getPrefixCls,E=b.direction,a=k("spin",_),u=this.sSpinning,r=(n={},C(n,a,!0),C(n,"".concat(a,"-sm"),O==="small"),C(n,"".concat(a,"-lg"),O==="large"),C(n,"".concat(a,"-spinning"),u),C(n,"".concat(a,"-show-text"),!!$),C(n,"".concat(a,"-rtl"),E==="rtl"),C(n,P,!!P),n),f=o("div",J(J({},c),{},{style:M,class:r}),[this.renderIndicator(a),$?o("div",{class:"".concat(a,"-text")},[$]):null]),s=we(this);if(s&&s.length){var h,D=(h={},C(h,"".concat(a,"-container"),!0),C(h,"".concat(a,"-blur"),u),h);return o("div",{class:["".concat(a,"-nested-loading"),S]},[u&&o("div",{key:"loading"},[f]),o("div",{class:D,key:"container"},[s])])}return f}});var Ue={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 Ve=Ue;function re(t){for(var e=1;e{r.stopPropagation(),r.preventDefault(),!(!t.value||!e.value)&&(O=r instanceof MouseEvent?r.clientX:r.touches[0].clientX,_=r instanceof MouseEvent?r.clientY:r.touches[0].clientY,L=t.value.offsetWidth,$=t.value.offsetHeight,l.x=e.value.offsetLeft,l.y=e.value.offsetTop,document.documentElement.addEventListener("mousemove",c),document.documentElement.addEventListener("touchmove",c),document.documentElement.addEventListener("mouseup",b),document.documentElement.addEventListener("touchend",b))},c=r=>{if(!t.value||!e.value)return;let f=L+((r instanceof MouseEvent?r.clientX:r.touches[0].clientX)-O),s=$+((r instanceof MouseEvent?r.clientY:r.touches[0].clientY)-_),h=l.x+((r instanceof MouseEvent?r.clientX:r.touches[0].clientX)-O),D=l.y+((r instanceof MouseEvent?r.clientY:r.touches[0].clientY)-_);h+e.value.offsetWidth>window.innerWidth&&(h=window.innerWidth-e.value.offsetWidth),t.value.offsetLeft+f>window.innerWidth&&(f=window.innerWidth-t.value.offsetLeft),D+e.value.offsetHeight>window.innerHeight&&(D=window.innerHeight-e.value.offsetHeight),t.value.offsetTop+s>window.innerHeight&&(s=window.innerHeight-t.value.offsetTop),t.value.style.width=`${f}px`,t.value.style.height=`${s}px`,e.value.style.left=`${h}px`,e.value.style.top=`${D}px`,n!=null&&n.onResize&&n.onResize(f,s)},b=()=>{document.documentElement.removeEventListener("mousemove",c),document.documentElement.removeEventListener("touchmove",c),document.documentElement.removeEventListener("mouseup",b),document.documentElement.removeEventListener("touchend",b)},k=r=>{r.stopPropagation(),r.preventDefault(),!(!t.value||!i.value)&&(P=!0,S=t.value.offsetLeft,x=t.value.offsetTop,O=r instanceof MouseEvent?r.clientX:r.touches[0].clientX,_=r instanceof MouseEvent?r.clientY:r.touches[0].clientY,document.documentElement.addEventListener("mousemove",E),document.documentElement.addEventListener("touchmove",E),document.documentElement.addEventListener("mouseup",a),document.documentElement.addEventListener("touchend",a))},E=r=>{if(!t.value||!i.value||!P)return;const f=S+((r instanceof MouseEvent?r.clientX:r.touches[0].clientX)-O),s=x+((r instanceof MouseEvent?r.clientY:r.touches[0].clientY)-_);f<0?t.value.style.left="0px":f+t.value.offsetWidth>window.innerWidth?t.value.style.left=`${window.innerWidth-t.value.offsetWidth}px`:t.value.style.left=`${f}px`,s<0?t.value.style.top="0px":s+t.value.offsetHeight>window.innerHeight?t.value.style.top=`${window.innerHeight-t.value.offsetHeight}px`:t.value.style.top=`${s}px`,n!=null&&n.onDrag&&n.onDrag(f,s)},a=()=>{P=!1,document.documentElement.removeEventListener("mousemove",E),document.documentElement.removeEventListener("touchmove",E),document.documentElement.removeEventListener("mouseup",a),document.documentElement.removeEventListener("touchend",a)},u=()=>{if(!t.value||!e.value)return;let r=t.value.offsetLeft,f=t.value.offsetTop,s=t.value.offsetWidth,h=t.value.offsetHeight;r+s>window.innerWidth&&(r=window.innerWidth-s,r<0&&(r=0,s=window.innerWidth)),f+h>window.innerHeight&&(f=window.innerHeight-h,f<0&&(f=0,h=window.innerHeight)),t.value.style.left=`${r}px`,t.value.style.top=`${f}px`,t.value.style.width=`${s}px`,t.value.style.height=`${h}px`};return Oe(()=>{!t.value||!n||(typeof n.width=="number"&&(t.value.style.width=`${n.width}px`),typeof n.height=="number"&&(t.value.style.height=`${n.height}px`),typeof n.left=="number"&&(t.value.style.left=`${n.left}px`),typeof n.top=="number"&&(t.value.style.top=`${n.top}px`),u(),window.addEventListener("resize",u))}),_e(()=>{document.documentElement.removeEventListener("mousemove",c),document.documentElement.removeEventListener("touchmove",c),document.documentElement.removeEventListener("mouseup",b),document.documentElement.removeEventListener("touchend",b),document.documentElement.removeEventListener("mousemove",E),document.documentElement.removeEventListener("touchmove",E),document.documentElement.removeEventListener("mouseup",a),document.documentElement.removeEventListener("touchend",a),window.removeEventListener("resize",u)}),fe(()=>[t.value,e.value,i.value],([r,f,s])=>{r&&f&&(f.addEventListener("mousedown",M),f.addEventListener("touchstart",M)),r&&s&&(s.addEventListener("mousedown",k),s.addEventListener("touchstart",k))}),{handleResizeMouseDown:M,handleDragMouseDown:k}}const dt={class:"container"},ft={class:"action-bar"},vt=["title"],pt=["title"],mt={key:0,class:"icon",style:{cursor:"pointer"}},gt={key:0,"flex-placeholder":""},ht={key:1,class:"action-bar"},yt={key:0,class:"gen-info"},bt={class:"info-tags"},wt={class:"name"},Ot={class:"value"},_t={key:0,class:"tags-container"},Et=["onClick"],Lt=["title"],$t=de({__name:"fullScreenContextMenu",props:{file:{},idx:{}},emits:["contextMenuClick"],setup(t,{emit:e}){const i=t,n=Ee(),l=Ne(),O=T(),_=R(()=>l.tagMap.get(i.file.fullpath)??[]),L=T(""),$=Le(),S=T("");fe(()=>{var a;return(a=i==null?void 0:i.file)==null?void 0:a.fullpath},async a=>{a&&($.tasks.forEach(u=>u.cancel()),$.pushAction(()=>$e(a)).res.then(u=>{S.value=u}))},{immediate:!0});const x=T(),P=T(),M={left:100,top:100,width:512,height:384,expanded:!0},c=Se("fullScreenContextMenu.vue-drag",M);c.value&&(c.value.left<0||c.value.top<0)&&(c.value={...M}),ct(O,x,P,{...c.value,onDrag:F(function(a,u){c.value={...c.value,left:a,top:u}},300),onResize:F(function(a,u){c.value={...c.value,width:a,height:u}},300)});function b(a){return a.parentNode}Ae("load",a=>{const u=a.target;u.className==="ant-image-preview-img"&&(L.value=`${u.naturalWidth} x ${u.naturalHeight}`)},{capture:!0});const k=R(()=>{const a=[{name:z("fileName"),val:i.file.name},{name:z("fileSize"),val:i.file.size}];return L.value&&a.push({name:z("resolution"),val:L.value}),a}),E=()=>{ne(S.value.split(` +import{d as de,bq as pe,aI as me,bW as ge,ax as he,aC as F,bX as ye,bY as Q,e as Z,c as o,_ as be,h as C,a as J,bz as we,P as K,ag as A,aw as Oe,aM as _e,l as fe,k as Ee,$ as T,aj as R,bO as Le,bZ as $e,b_ as Se,ai as z,o as y,y as w,p as j,r as d,m as ee,n as v,L as te,b$ as xe,C as N,z as B,x as g,v as p,t as ne,A as ie,N as ae,B as Pe,q as Ce,V as Me,W as ke,c0 as De,M as ze,X as je}from"./index-1537dba6.js";import{i as Ne,j as Ae,_ as Te,D as We}from"./FileItem-dbdcf20b.js";import"./shortcut-ec395f0e.js";var Ie=["class","style"],Be=function(){return{prefixCls:String,spinning:{type:Boolean,default:void 0},size:String,wrapperClassName:String,tip:K.any,delay:Number,indicator:K.any}},I=null;function Fe(t,e){return!!t&&!!e&&!isNaN(Number(e))}function Ct(t){var e=t.indicator;I=typeof e=="function"?e:function(){return o(e,null,null)}}const Mt=de({compatConfig:{MODE:3},name:"ASpin",inheritAttrs:!1,props:pe(Be(),{size:"default",spinning:!0,wrapperClassName:""}),setup:function(){return{originalUpdateSpinning:null,configProvider:me("configProvider",ge)}},data:function(){var e=this.spinning,i=this.delay,n=Fe(e,i);return{sSpinning:e&&!n}},created:function(){this.originalUpdateSpinning=this.updateSpinning,this.debouncifyUpdateSpinning(this.$props)},mounted:function(){this.updateSpinning()},updated:function(){var e=this;he(function(){e.debouncifyUpdateSpinning(),e.updateSpinning()})},beforeUnmount:function(){this.cancelExistingSpin()},methods:{debouncifyUpdateSpinning:function(e){var i=e||this.$props,n=i.delay;n&&(this.cancelExistingSpin(),this.updateSpinning=F(this.originalUpdateSpinning,n))},updateSpinning:function(){var e=this.spinning,i=this.sSpinning;i!==e&&(this.sSpinning=e)},cancelExistingSpin:function(){var e=this.updateSpinning;e&&e.cancel&&e.cancel()},renderIndicator:function(e){var i="".concat(e,"-dot"),n=ye(this,"indicator");return n===null?null:(Array.isArray(n)&&(n=n.length===1?n[0]:n),Q(n)?Z(n,{class:i}):I&&Q(I())?Z(I(),{class:i}):o("span",{class:"".concat(i," ").concat(e,"-dot-spin")},[o("i",{class:"".concat(e,"-dot-item")},null),o("i",{class:"".concat(e,"-dot-item")},null),o("i",{class:"".concat(e,"-dot-item")},null),o("i",{class:"".concat(e,"-dot-item")},null)]))}},render:function(){var e,i,n,l=this.$props,O=l.size,_=l.prefixCls,L=l.tip,$=L===void 0?(e=(i=this.$slots).tip)===null||e===void 0?void 0:e.call(i):L,S=l.wrapperClassName,x=this.$attrs,P=x.class,M=x.style,c=be(x,Ie),b=this.configProvider,k=b.getPrefixCls,E=b.direction,a=k("spin",_),u=this.sSpinning,r=(n={},C(n,a,!0),C(n,"".concat(a,"-sm"),O==="small"),C(n,"".concat(a,"-lg"),O==="large"),C(n,"".concat(a,"-spinning"),u),C(n,"".concat(a,"-show-text"),!!$),C(n,"".concat(a,"-rtl"),E==="rtl"),C(n,P,!!P),n),f=o("div",J(J({},c),{},{style:M,class:r}),[this.renderIndicator(a),$?o("div",{class:"".concat(a,"-text")},[$]):null]),s=we(this);if(s&&s.length){var h,D=(h={},C(h,"".concat(a,"-container"),!0),C(h,"".concat(a,"-blur"),u),h);return o("div",{class:["".concat(a,"-nested-loading"),S]},[u&&o("div",{key:"loading"},[f]),o("div",{class:D,key:"container"},[s])])}return f}});var Ue={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 Ve=Ue;function re(t){for(var e=1;e{r.stopPropagation(),r.preventDefault(),!(!t.value||!e.value)&&(O=r instanceof MouseEvent?r.clientX:r.touches[0].clientX,_=r instanceof MouseEvent?r.clientY:r.touches[0].clientY,L=t.value.offsetWidth,$=t.value.offsetHeight,l.x=e.value.offsetLeft,l.y=e.value.offsetTop,document.documentElement.addEventListener("mousemove",c),document.documentElement.addEventListener("touchmove",c),document.documentElement.addEventListener("mouseup",b),document.documentElement.addEventListener("touchend",b))},c=r=>{if(!t.value||!e.value)return;let f=L+((r instanceof MouseEvent?r.clientX:r.touches[0].clientX)-O),s=$+((r instanceof MouseEvent?r.clientY:r.touches[0].clientY)-_),h=l.x+((r instanceof MouseEvent?r.clientX:r.touches[0].clientX)-O),D=l.y+((r instanceof MouseEvent?r.clientY:r.touches[0].clientY)-_);h+e.value.offsetWidth>window.innerWidth&&(h=window.innerWidth-e.value.offsetWidth),t.value.offsetLeft+f>window.innerWidth&&(f=window.innerWidth-t.value.offsetLeft),D+e.value.offsetHeight>window.innerHeight&&(D=window.innerHeight-e.value.offsetHeight),t.value.offsetTop+s>window.innerHeight&&(s=window.innerHeight-t.value.offsetTop),t.value.style.width=`${f}px`,t.value.style.height=`${s}px`,e.value.style.left=`${h}px`,e.value.style.top=`${D}px`,n!=null&&n.onResize&&n.onResize(f,s)},b=()=>{document.documentElement.removeEventListener("mousemove",c),document.documentElement.removeEventListener("touchmove",c),document.documentElement.removeEventListener("mouseup",b),document.documentElement.removeEventListener("touchend",b)},k=r=>{r.stopPropagation(),r.preventDefault(),!(!t.value||!i.value)&&(P=!0,S=t.value.offsetLeft,x=t.value.offsetTop,O=r instanceof MouseEvent?r.clientX:r.touches[0].clientX,_=r instanceof MouseEvent?r.clientY:r.touches[0].clientY,document.documentElement.addEventListener("mousemove",E),document.documentElement.addEventListener("touchmove",E),document.documentElement.addEventListener("mouseup",a),document.documentElement.addEventListener("touchend",a))},E=r=>{if(!t.value||!i.value||!P)return;const f=S+((r instanceof MouseEvent?r.clientX:r.touches[0].clientX)-O),s=x+((r instanceof MouseEvent?r.clientY:r.touches[0].clientY)-_);f<0?t.value.style.left="0px":f+t.value.offsetWidth>window.innerWidth?t.value.style.left=`${window.innerWidth-t.value.offsetWidth}px`:t.value.style.left=`${f}px`,s<0?t.value.style.top="0px":s+t.value.offsetHeight>window.innerHeight?t.value.style.top=`${window.innerHeight-t.value.offsetHeight}px`:t.value.style.top=`${s}px`,n!=null&&n.onDrag&&n.onDrag(f,s)},a=()=>{P=!1,document.documentElement.removeEventListener("mousemove",E),document.documentElement.removeEventListener("touchmove",E),document.documentElement.removeEventListener("mouseup",a),document.documentElement.removeEventListener("touchend",a)},u=()=>{if(!t.value||!e.value)return;let r=t.value.offsetLeft,f=t.value.offsetTop,s=t.value.offsetWidth,h=t.value.offsetHeight;r+s>window.innerWidth&&(r=window.innerWidth-s,r<0&&(r=0,s=window.innerWidth)),f+h>window.innerHeight&&(f=window.innerHeight-h,f<0&&(f=0,h=window.innerHeight)),t.value.style.left=`${r}px`,t.value.style.top=`${f}px`,t.value.style.width=`${s}px`,t.value.style.height=`${h}px`};return Oe(()=>{!t.value||!n||(typeof n.width=="number"&&(t.value.style.width=`${n.width}px`),typeof n.height=="number"&&(t.value.style.height=`${n.height}px`),typeof n.left=="number"&&(t.value.style.left=`${n.left}px`),typeof n.top=="number"&&(t.value.style.top=`${n.top}px`),u(),window.addEventListener("resize",u))}),_e(()=>{document.documentElement.removeEventListener("mousemove",c),document.documentElement.removeEventListener("touchmove",c),document.documentElement.removeEventListener("mouseup",b),document.documentElement.removeEventListener("touchend",b),document.documentElement.removeEventListener("mousemove",E),document.documentElement.removeEventListener("touchmove",E),document.documentElement.removeEventListener("mouseup",a),document.documentElement.removeEventListener("touchend",a),window.removeEventListener("resize",u)}),fe(()=>[t.value,e.value,i.value],([r,f,s])=>{r&&f&&(f.addEventListener("mousedown",M),f.addEventListener("touchstart",M)),r&&s&&(s.addEventListener("mousedown",k),s.addEventListener("touchstart",k))}),{handleResizeMouseDown:M,handleDragMouseDown:k}}const dt={class:"container"},ft={class:"action-bar"},vt=["title"],pt=["title"],mt={key:0,class:"icon",style:{cursor:"pointer"}},gt={key:0,"flex-placeholder":""},ht={key:1,class:"action-bar"},yt={key:0,class:"gen-info"},bt={class:"info-tags"},wt={class:"name"},Ot={class:"value"},_t={key:0,class:"tags-container"},Et=["onClick"],Lt=["title"],$t=de({__name:"fullScreenContextMenu",props:{file:{},idx:{}},emits:["contextMenuClick"],setup(t,{emit:e}){const i=t,n=Ee(),l=Ne(),O=T(),_=R(()=>l.tagMap.get(i.file.fullpath)??[]),L=T(""),$=Le(),S=T("");fe(()=>{var a;return(a=i==null?void 0:i.file)==null?void 0:a.fullpath},async a=>{a&&($.tasks.forEach(u=>u.cancel()),$.pushAction(()=>$e(a)).res.then(u=>{S.value=u}))},{immediate:!0});const x=T(),P=T(),M={left:100,top:100,width:512,height:384,expanded:!0},c=Se("fullScreenContextMenu.vue-drag",M);c.value&&(c.value.left<0||c.value.top<0)&&(c.value={...M}),ct(O,x,P,{...c.value,onDrag:F(function(a,u){c.value={...c.value,left:a,top:u}},300),onResize:F(function(a,u){c.value={...c.value,width:a,height:u}},300)});function b(a){return a.parentNode}Ae("load",a=>{const u=a.target;u.className==="ant-image-preview-img"&&(L.value=`${u.naturalWidth} x ${u.naturalHeight}`)},{capture:!0});const k=R(()=>{const a=[{name:z("fileName"),val:i.file.name},{name:z("fileSize"),val:i.file.size}];return L.value&&a.push({name:z("resolution"),val:L.value}),a}),E=()=>{ne(S.value.split(` `)[0])};return(a,u)=>{var G;const r=We,f=Me,s=ke,h=De,D=ze;return y(),w("div",{ref_key:"el",ref:O,class:ae(["full-screen-menu",{"unset-size":!d(c).expanded}]),onWheelCapture:u[4]||(u[4]=Ce(()=>{},["stop"]))},[j("div",dt,[j("div",ft,[j("div",{ref_key:"dragHandle",ref:P,class:"icon",style:{cursor:"grab"},title:d(z)("dragToMovePanel")},[o(d(Qe))],8,vt),j("div",{class:"icon",style:{cursor:"pointer"},onClick:u[0]||(u[0]=m=>d(c).expanded=!d(c).expanded),title:d(z)("clickToToggleMaximizeMinimize")},[d(c).expanded?(y(),ee(d(Re),{key:0})):(y(),ee(d(it),{key:1}))],8,pt),o(r,{"get-popup-container":b},{overlay:v(()=>[o(Te,{file:a.file,idx:a.idx,"selected-tag":_.value,"disable-delete":d(te)(a.file)===d(n).fullscreenPreviewInitialUrl,onContextMenuClick:u[1]||(u[1]=(m,W,ve)=>e("contextMenuClick",m,W,ve))},null,8,["file","idx","selected-tag","disable-delete"])]),default:v(()=>[d(c).expanded?N("",!0):(y(),w("div",mt,[o(d(xe))]))]),_:1}),d(c).expanded?(y(),w("div",gt)):N("",!0),d(c).expanded?(y(),w("div",ht,[o(r,{trigger:["hover"],"get-popup-container":b},{overlay:v(()=>[o(D,{onClick:u[2]||(u[2]=m=>e("contextMenuClick",m,a.file,a.idx))},{default:v(()=>{var m;return[((m=d(n).conf)==null?void 0:m.launch_mode)!=="server"?(y(),w(B,{key:0},[o(s,{key:"send2txt2img"},{default:v(()=>[g(p(a.$t("sendToTxt2img")),1)]),_:1}),o(s,{key:"send2img2img"},{default:v(()=>[g(p(a.$t("sendToImg2img")),1)]),_:1}),o(s,{key:"send2inpaint"},{default:v(()=>[g(p(a.$t("sendToInpaint")),1)]),_:1}),o(s,{key:"send2extras"},{default:v(()=>[g(p(a.$t("sendToExtraFeatures")),1)]),_:1}),o(h,{key:"sendToThirdPartyExtension",title:a.$t("sendToThirdPartyExtension")},{default:v(()=>[o(s,{key:"send2controlnet-txt2img"},{default:v(()=>[g("ControlNet - "+p(a.$t("t2i")),1)]),_:1}),o(s,{key:"send2controlnet-img2img"},{default:v(()=>[g("ControlNet - "+p(a.$t("i2i")),1)]),_:1}),o(s,{key:"send2outpaint"},{default:v(()=>[g("openOutpaint")]),_:1})]),_:1},8,["title"])],64)):N("",!0),o(s,{key:"send2BatchDownload"},{default:v(()=>[g(p(a.$t("sendToBatchDownload")),1)]),_:1}),o(s,{key:"send2savedDir"},{default:v(()=>[g(p(a.$t("send2savedDir")),1)]),_:1}),o(s,{key:"deleteFiles",disabled:d(te)(a.file)===d(n).fullscreenPreviewInitialUrl},{default:v(()=>[g(p(a.$t("deleteSelected")),1)]),_:1},8,["disabled"]),o(s,{key:"previewInNewWindow"},{default:v(()=>[g(p(a.$t("previewInNewWindow")),1)]),_:1}),o(s,{key:"download"},{default:v(()=>[g(p(a.$t("download")),1)]),_:1}),o(s,{key:"copyPreviewUrl"},{default:v(()=>[g(p(a.$t("copySourceFilePreviewLink")),1)]),_:1})]}),_:1})]),default:v(()=>[o(f,null,{default:v(()=>[g(p(d(z)("openContextMenu")),1)]),_:1})]),_:1}),o(f,{onClick:u[3]||(u[3]=m=>d(ne)(S.value))},{default:v(()=>[g(p(a.$t("copyPrompt")),1)]),_:1}),o(f,{onClick:E},{default:v(()=>[g(p(a.$t("copyPositivePrompt")),1)]),_:1})])):N("",!0)]),d(c).expanded?(y(),w("div",yt,[j("div",bt,[(y(!0),w(B,null,ie(k.value,m=>(y(),w("span",{class:"info-tag",key:m.name},[j("span",wt,p(m.name),1),j("span",Ot,p(m.val),1)]))),128))]),(G=d(n).conf)!=null&&G.all_custom_tags?(y(),w("div",_t,[(y(!0),w(B,null,ie(d(n).conf.all_custom_tags,m=>(y(),w("div",{class:ae(["tag",{selected:_.value.some(W=>W.id===m.id)}]),onClick:W=>e("contextMenuClick",{key:`toggle-tag-${m.id}`},a.file,a.idx),key:m.id,style:Pe({"--tag-color":d(l).getColor(m.name)})},p(m.name),15,Et))),128))])):N("",!0),g(" "+p(S.value),1)])):N("",!0)]),d(c).expanded?(y(),w("div",{key:0,class:"mouse-sensor",ref_key:"resizeHandle",ref:x,title:d(z)("dragToResizePanel")},[o(d(Ye))],8,Lt)):N("",!0)],34)}}});const zt=je($t,[["__scopeId","data-v-83aabf1b"]]);export{kt as L,Dt as R,Mt as S,zt as f,Ct as s}; diff --git a/vue/dist/assets/globalSetting-96a71e1c.js b/vue/dist/assets/globalSetting-192fee94.js similarity index 97% rename from vue/dist/assets/globalSetting-96a71e1c.js rename to vue/dist/assets/globalSetting-192fee94.js index d4942a3..05f718f 100644 --- a/vue/dist/assets/globalSetting-96a71e1c.js +++ b/vue/dist/assets/globalSetting-192fee94.js @@ -1 +1 @@ -import{Y as te,Z as ae,d as D,j as le,av as oe,w as O,$ as U,aj as E,l as q,u as ue,aw as ie,ax as de,h as $,c as a,a as P,ay as se,az as ce,g as R,aA as re,P as s,aB as G,k as X,aC as he,o as b,y as x,n as c,r as n,ai as C,m as V,C as B,p,z as M,v as w,S as z,aD as fe,I as me,x as F,A as W,q as j,E as ve,aE as ge,aF as _e,aG as pe,aH as be,V as Ce,U as ke,X as we}from"./index-f1d763a2.js";import{N as L,_ as Y,F as ye}from"./numInput-0325e3d4.js";import{g as Se,C as $e}from"./shortcut-6ab7aba6.js";/* empty css *//* empty css */var Te=ae("small","default"),xe=function(){return{id:String,prefixCls:String,size:s.oneOf(Te),disabled:{type:Boolean,default:void 0},checkedChildren:s.any,unCheckedChildren:s.any,tabindex:s.oneOfType([s.string,s.number]),autofocus:{type:Boolean,default:void 0},loading:{type:Boolean,default:void 0},checked:s.oneOfType([s.string,s.number,s.looseBool]),checkedValue:s.oneOfType([s.string,s.number,s.looseBool]).def(!0),unCheckedValue:s.oneOfType([s.string,s.number,s.looseBool]).def(!1),onChange:{type:Function},onClick:{type:Function},onKeydown:{type:Function},onMouseup:{type:Function},"onUpdate:checked":{type:Function},onBlur:Function,onFocus:Function}},Ie=D({compatConfig:{MODE:3},name:"ASwitch",__ANT_SWITCH:!0,inheritAttrs:!1,props:xe(),slots:["checkedChildren","unCheckedChildren"],setup:function(e,u){var g=u.attrs,y=u.slots,h=u.expose,r=u.emit,l=le();oe(function(){O(!("defaultChecked"in g),"Switch","'defaultChecked' is deprecated, please use 'v-model:checked'"),O(!("value"in g),"Switch","`value` is not validate prop, do you mean `checked`?")});var t=U(e.checked!==void 0?e.checked:g.defaultChecked),_=E(function(){return t.value===e.checkedValue});q(function(){return e.checked},function(){t.value=e.checked});var m=ue("switch",e),f=m.prefixCls,A=m.direction,I=m.size,S=U(),T=function(){var o;(o=S.value)===null||o===void 0||o.focus()},i=function(){var o;(o=S.value)===null||o===void 0||o.blur()};h({focus:T,blur:i}),ie(function(){de(function(){e.autofocus&&!e.disabled&&S.value.focus()})});var v=function(o,k){e.disabled||(r("update:checked",o),r("change",o,k),l.onFieldChange())},K=function(o){r("blur",o)},J=function(o){T();var k=_.value?e.unCheckedValue:e.checkedValue;v(k,o),r("click",k,o)},Q=function(o){o.keyCode===G.LEFT?v(e.unCheckedValue,o):o.keyCode===G.RIGHT&&v(e.checkedValue,o),r("keydown",o)},ee=function(o){var k;(k=S.value)===null||k===void 0||k.blur(),r("mouseup",o)},ne=E(function(){var d;return d={},$(d,"".concat(f.value,"-small"),I.value==="small"),$(d,"".concat(f.value,"-loading"),e.loading),$(d,"".concat(f.value,"-checked"),_.value),$(d,"".concat(f.value,"-disabled"),e.disabled),$(d,f.value,!0),$(d,"".concat(f.value,"-rtl"),A.value==="rtl"),d});return function(){var d;return a(re,{insertExtraNode:!0},{default:function(){return[a("button",P(P(P({},se(e,["prefixCls","checkedChildren","unCheckedChildren","checked","autofocus","checkedValue","unCheckedValue","id","onChange","onUpdate:checked"])),g),{},{id:(d=e.id)!==null&&d!==void 0?d:l.id.value,onKeydown:Q,onClick:J,onBlur:K,onMouseup:ee,type:"button",role:"switch","aria-checked":t.value,disabled:e.disabled||e.loading,class:[g.class,ne.value],ref:S}),[a("div",{class:"".concat(f.value,"-handle")},[e.loading?a(ce,{class:"".concat(f.value,"-loading-icon")},null):null]),a("span",{class:"".concat(f.value,"-inner")},[_.value?R(y,e,"checkedChildren"):R(y,e,"unCheckedChildren")])])]}})}}});const Z=te(Ie);const H="/infinite_image_browsing/fe-static/assets/sample-55dcafc6.webp",Fe=["width","height","src"],Ve=D({__name:"ImageSetting",setup(N){function e(y,h){return new Promise(r=>{const l=new Image;l.onload=()=>{const t=document.createElement("canvas");t.width=l.width*h,t.height=l.height*h,t.getContext("2d").drawImage(l,0,0,t.width,t.height),r(t.toDataURL())},l.src=y})}const u=X(),g=U("");return q(()=>[u.enableThumbnail,u.gridThumbnailResolution],he(async()=>{u.enableThumbnail&&(g.value=await e(H,u.gridThumbnailResolution/1024))},300),{immediate:!0,deep:!0}),(y,h)=>{const r=Y,l=Z;return b(),x(M,null,[a(r,{label:n(C)("defaultGridCellWidth")},{default:c(()=>[a(L,{min:64,max:1024,step:32,modelValue:n(u).defaultGridCellWidth,"onUpdate:modelValue":h[0]||(h[0]=t=>n(u).defaultGridCellWidth=t)},null,8,["modelValue"])]),_:1},8,["label"]),a(r,{label:n(C)("useThumbnailPreview")},{default:c(()=>[a(l,{checked:n(u).enableThumbnail,"onUpdate:checked":h[1]||(h[1]=t=>n(u).enableThumbnail=t)},null,8,["checked"])]),_:1},8,["label"]),n(u).enableThumbnail?(b(),V(r,{key:0,label:n(C)("thumbnailResolution")},{default:c(()=>[a(L,{modelValue:n(u).gridThumbnailResolution,"onUpdate:modelValue":h[2]||(h[2]=t=>n(u).gridThumbnailResolution=t),min:256,max:1024,step:64},null,8,["modelValue"])]),_:1},8,["label"])):B("",!0),a(r,{label:n(C)("livePreview")},{default:c(()=>[p("div",null,[p("img",{width:n(u).defaultGridCellWidth,height:n(u).defaultGridCellWidth,src:n(u).enableThumbnail?g.value:n(H)},null,8,Fe)])]),_:1},8,["label"])],64)}}}),Be={class:"panel"},Me={style:{"margin-top":"0"}},Ue={class:"lang-select-wrap"},Ne={class:"col"},Ae={class:"col"},Ke={class:"col"},Pe=D({__name:"globalSetting",setup(N){const e=X(),u=U(!1),g=async()=>{window.location.reload()},y=[{value:"en",text:"English"},{value:"zh",text:"中文"},{value:"de",text:"Deutsch"}],h=(l,t)=>{const _=Se(l);_&&(e.shortcut[t]=_)},r=async()=>{await ge("shutdown_api_server_command"),await _e.removeFile(pe),await be()};return(l,t)=>{const _=Z,m=Y,f=Ce,A=$e,I=ke,S=ye;return b(),x("div",Be,[B("",!0),a(S,null,{default:c(()=>{var T;return[p("h2",Me,w(n(C)("ImageBrowsingSettings")),1),a(Ve),p("h2",null,w(n(C)("other")),1),a(m,{label:l.$t("onlyFoldersAndImages")},{default:c(()=>[a(_,{checked:n(e).onlyFoldersAndImages,"onUpdate:checked":t[0]||(t[0]=i=>n(e).onlyFoldersAndImages=i)},null,8,["checked"])]),_:1},8,["label"]),a(m,{label:l.$t("defaultSortingMethod")},{default:c(()=>[a(n(z),{value:n(e).defaultSortingMethod,"onUpdate:value":t[1]||(t[1]=i=>n(e).defaultSortingMethod=i),conv:n(fe),options:n(me)},null,8,["value","conv","options"])]),_:1},8,["label"]),a(m,{label:l.$t("longPressOpenContextMenu")},{default:c(()=>[a(_,{checked:n(e).longPressOpenContextMenu,"onUpdate:checked":t[2]||(t[2]=i=>n(e).longPressOpenContextMenu=i)},null,8,["checked"])]),_:1},8,["label"]),a(m,{label:l.$t("lang")},{default:c(()=>[p("div",Ue,[a(n(z),{options:y,value:n(e).lang,"onUpdate:value":t[3]||(t[3]=i=>n(e).lang=i),onChange:t[4]||(t[4]=i=>u.value=!0)},null,8,["value"])]),u.value?(b(),V(f,{key:0,type:"primary",onClick:g,ghost:""},{default:c(()=>[F(w(n(C)("langChangeReload")),1)]),_:1})):B("",!0)]),_:1},8,["label"]),(b(!0),x(M,null,W(n(e).ignoredConfirmActions,(i,v)=>(b(),V(m,{label:l.$t(v+"SkipConfirm"),key:v},{default:c(()=>[a(A,{checked:n(e).ignoredConfirmActions[v],"onUpdate:checked":K=>n(e).ignoredConfirmActions[v]=K},null,8,["checked","onUpdate:checked"])]),_:2},1032,["label"]))),128)),p("h2",null,w(n(C)("shortcutKey")),1),a(m,{label:l.$t("deleteSelected")},{default:c(()=>[p("div",Ne,[a(I,{value:n(e).shortcut.delete,onKeydown:t[5]||(t[5]=j(i=>h(i,"delete"),["stop","prevent"])),placeholder:l.$t("shortcutKeyDescription")},null,8,["value","placeholder"]),a(f,{onClick:t[6]||(t[6]=i=>n(e).shortcut.delete=""),class:"clear-btn"},{default:c(()=>[F(w(l.$t("clear")),1)]),_:1})])]),_:1},8,["label"]),(b(!0),x(M,null,W(((T=n(e).conf)==null?void 0:T.all_custom_tags)??[],i=>(b(),V(m,{label:l.$t("toggleTagSelection",{tag:i.name}),key:i.id},{default:c(()=>[p("div",Ae,[a(I,{value:n(e).shortcut[`toggle_tag_${i.name}`],onKeydown:j(v=>h(v,`toggle_tag_${i.name}`),["stop","prevent"]),placeholder:l.$t("shortcutKeyDescription")},null,8,["value","onKeydown","placeholder"]),a(f,{onClick:v=>n(e).shortcut[`toggle_tag_${i.name}`]="",class:"clear-btn"},{default:c(()=>[F(w(l.$t("clear")),1)]),_:2},1032,["onClick"])])]),_:2},1032,["label"]))),128)),n(ve)?(b(),x(M,{key:0},[p("h2",null,w(n(C)("clientSpecificSettings")),1),a(m,null,{default:c(()=>[p("div",Ke,[a(f,{onClick:r,class:"clear-btn"},{default:c(()=>[F(w(l.$t("initiateSoftwareStartupConfig")),1)]),_:1})])]),_:1})],64)):B("",!0)]}),_:1})])}}});const ze=we(Pe,[["__scopeId","data-v-4633948c"]]);export{ze as default}; +import{Y as te,Z as ae,d as D,j as le,av as oe,w as O,$ as U,aj as E,l as q,u as ue,aw as ie,ax as de,h as $,c as a,a as P,ay as se,az as ce,g as R,aA as re,P as s,aB as G,k as X,aC as he,o as b,y as x,n as c,r as n,ai as C,m as V,C as B,p,z as M,v as w,S as z,aD as fe,I as me,x as F,A as W,q as j,E as ve,aE as ge,aF as _e,aG as pe,aH as be,V as Ce,U as ke,X as we}from"./index-1537dba6.js";import{N as L,_ as Y,F as ye}from"./numInput-ba0cd880.js";import{g as Se,C as $e}from"./shortcut-ec395f0e.js";/* empty css *//* empty css */var Te=ae("small","default"),xe=function(){return{id:String,prefixCls:String,size:s.oneOf(Te),disabled:{type:Boolean,default:void 0},checkedChildren:s.any,unCheckedChildren:s.any,tabindex:s.oneOfType([s.string,s.number]),autofocus:{type:Boolean,default:void 0},loading:{type:Boolean,default:void 0},checked:s.oneOfType([s.string,s.number,s.looseBool]),checkedValue:s.oneOfType([s.string,s.number,s.looseBool]).def(!0),unCheckedValue:s.oneOfType([s.string,s.number,s.looseBool]).def(!1),onChange:{type:Function},onClick:{type:Function},onKeydown:{type:Function},onMouseup:{type:Function},"onUpdate:checked":{type:Function},onBlur:Function,onFocus:Function}},Ie=D({compatConfig:{MODE:3},name:"ASwitch",__ANT_SWITCH:!0,inheritAttrs:!1,props:xe(),slots:["checkedChildren","unCheckedChildren"],setup:function(e,u){var g=u.attrs,y=u.slots,h=u.expose,r=u.emit,l=le();oe(function(){O(!("defaultChecked"in g),"Switch","'defaultChecked' is deprecated, please use 'v-model:checked'"),O(!("value"in g),"Switch","`value` is not validate prop, do you mean `checked`?")});var t=U(e.checked!==void 0?e.checked:g.defaultChecked),_=E(function(){return t.value===e.checkedValue});q(function(){return e.checked},function(){t.value=e.checked});var m=ue("switch",e),f=m.prefixCls,A=m.direction,I=m.size,S=U(),T=function(){var o;(o=S.value)===null||o===void 0||o.focus()},i=function(){var o;(o=S.value)===null||o===void 0||o.blur()};h({focus:T,blur:i}),ie(function(){de(function(){e.autofocus&&!e.disabled&&S.value.focus()})});var v=function(o,k){e.disabled||(r("update:checked",o),r("change",o,k),l.onFieldChange())},K=function(o){r("blur",o)},J=function(o){T();var k=_.value?e.unCheckedValue:e.checkedValue;v(k,o),r("click",k,o)},Q=function(o){o.keyCode===G.LEFT?v(e.unCheckedValue,o):o.keyCode===G.RIGHT&&v(e.checkedValue,o),r("keydown",o)},ee=function(o){var k;(k=S.value)===null||k===void 0||k.blur(),r("mouseup",o)},ne=E(function(){var d;return d={},$(d,"".concat(f.value,"-small"),I.value==="small"),$(d,"".concat(f.value,"-loading"),e.loading),$(d,"".concat(f.value,"-checked"),_.value),$(d,"".concat(f.value,"-disabled"),e.disabled),$(d,f.value,!0),$(d,"".concat(f.value,"-rtl"),A.value==="rtl"),d});return function(){var d;return a(re,{insertExtraNode:!0},{default:function(){return[a("button",P(P(P({},se(e,["prefixCls","checkedChildren","unCheckedChildren","checked","autofocus","checkedValue","unCheckedValue","id","onChange","onUpdate:checked"])),g),{},{id:(d=e.id)!==null&&d!==void 0?d:l.id.value,onKeydown:Q,onClick:J,onBlur:K,onMouseup:ee,type:"button",role:"switch","aria-checked":t.value,disabled:e.disabled||e.loading,class:[g.class,ne.value],ref:S}),[a("div",{class:"".concat(f.value,"-handle")},[e.loading?a(ce,{class:"".concat(f.value,"-loading-icon")},null):null]),a("span",{class:"".concat(f.value,"-inner")},[_.value?R(y,e,"checkedChildren"):R(y,e,"unCheckedChildren")])])]}})}}});const Z=te(Ie);const H="/infinite_image_browsing/fe-static/assets/sample-55dcafc6.webp",Fe=["width","height","src"],Ve=D({__name:"ImageSetting",setup(N){function e(y,h){return new Promise(r=>{const l=new Image;l.onload=()=>{const t=document.createElement("canvas");t.width=l.width*h,t.height=l.height*h,t.getContext("2d").drawImage(l,0,0,t.width,t.height),r(t.toDataURL())},l.src=y})}const u=X(),g=U("");return q(()=>[u.enableThumbnail,u.gridThumbnailResolution],he(async()=>{u.enableThumbnail&&(g.value=await e(H,u.gridThumbnailResolution/1024))},300),{immediate:!0,deep:!0}),(y,h)=>{const r=Y,l=Z;return b(),x(M,null,[a(r,{label:n(C)("defaultGridCellWidth")},{default:c(()=>[a(L,{min:64,max:1024,step:32,modelValue:n(u).defaultGridCellWidth,"onUpdate:modelValue":h[0]||(h[0]=t=>n(u).defaultGridCellWidth=t)},null,8,["modelValue"])]),_:1},8,["label"]),a(r,{label:n(C)("useThumbnailPreview")},{default:c(()=>[a(l,{checked:n(u).enableThumbnail,"onUpdate:checked":h[1]||(h[1]=t=>n(u).enableThumbnail=t)},null,8,["checked"])]),_:1},8,["label"]),n(u).enableThumbnail?(b(),V(r,{key:0,label:n(C)("thumbnailResolution")},{default:c(()=>[a(L,{modelValue:n(u).gridThumbnailResolution,"onUpdate:modelValue":h[2]||(h[2]=t=>n(u).gridThumbnailResolution=t),min:256,max:1024,step:64},null,8,["modelValue"])]),_:1},8,["label"])):B("",!0),a(r,{label:n(C)("livePreview")},{default:c(()=>[p("div",null,[p("img",{width:n(u).defaultGridCellWidth,height:n(u).defaultGridCellWidth,src:n(u).enableThumbnail?g.value:n(H)},null,8,Fe)])]),_:1},8,["label"])],64)}}}),Be={class:"panel"},Me={style:{"margin-top":"0"}},Ue={class:"lang-select-wrap"},Ne={class:"col"},Ae={class:"col"},Ke={class:"col"},Pe=D({__name:"globalSetting",setup(N){const e=X(),u=U(!1),g=async()=>{window.location.reload()},y=[{value:"en",text:"English"},{value:"zh",text:"中文"},{value:"de",text:"Deutsch"}],h=(l,t)=>{const _=Se(l);_&&(e.shortcut[t]=_)},r=async()=>{await ge("shutdown_api_server_command"),await _e.removeFile(pe),await be()};return(l,t)=>{const _=Z,m=Y,f=Ce,A=$e,I=ke,S=ye;return b(),x("div",Be,[B("",!0),a(S,null,{default:c(()=>{var T;return[p("h2",Me,w(n(C)("ImageBrowsingSettings")),1),a(Ve),p("h2",null,w(n(C)("other")),1),a(m,{label:l.$t("onlyFoldersAndImages")},{default:c(()=>[a(_,{checked:n(e).onlyFoldersAndImages,"onUpdate:checked":t[0]||(t[0]=i=>n(e).onlyFoldersAndImages=i)},null,8,["checked"])]),_:1},8,["label"]),a(m,{label:l.$t("defaultSortingMethod")},{default:c(()=>[a(n(z),{value:n(e).defaultSortingMethod,"onUpdate:value":t[1]||(t[1]=i=>n(e).defaultSortingMethod=i),conv:n(fe),options:n(me)},null,8,["value","conv","options"])]),_:1},8,["label"]),a(m,{label:l.$t("longPressOpenContextMenu")},{default:c(()=>[a(_,{checked:n(e).longPressOpenContextMenu,"onUpdate:checked":t[2]||(t[2]=i=>n(e).longPressOpenContextMenu=i)},null,8,["checked"])]),_:1},8,["label"]),a(m,{label:l.$t("lang")},{default:c(()=>[p("div",Ue,[a(n(z),{options:y,value:n(e).lang,"onUpdate:value":t[3]||(t[3]=i=>n(e).lang=i),onChange:t[4]||(t[4]=i=>u.value=!0)},null,8,["value"])]),u.value?(b(),V(f,{key:0,type:"primary",onClick:g,ghost:""},{default:c(()=>[F(w(n(C)("langChangeReload")),1)]),_:1})):B("",!0)]),_:1},8,["label"]),(b(!0),x(M,null,W(n(e).ignoredConfirmActions,(i,v)=>(b(),V(m,{label:l.$t(v+"SkipConfirm"),key:v},{default:c(()=>[a(A,{checked:n(e).ignoredConfirmActions[v],"onUpdate:checked":K=>n(e).ignoredConfirmActions[v]=K},null,8,["checked","onUpdate:checked"])]),_:2},1032,["label"]))),128)),p("h2",null,w(n(C)("shortcutKey")),1),a(m,{label:l.$t("deleteSelected")},{default:c(()=>[p("div",Ne,[a(I,{value:n(e).shortcut.delete,onKeydown:t[5]||(t[5]=j(i=>h(i,"delete"),["stop","prevent"])),placeholder:l.$t("shortcutKeyDescription")},null,8,["value","placeholder"]),a(f,{onClick:t[6]||(t[6]=i=>n(e).shortcut.delete=""),class:"clear-btn"},{default:c(()=>[F(w(l.$t("clear")),1)]),_:1})])]),_:1},8,["label"]),(b(!0),x(M,null,W(((T=n(e).conf)==null?void 0:T.all_custom_tags)??[],i=>(b(),V(m,{label:l.$t("toggleTagSelection",{tag:i.name}),key:i.id},{default:c(()=>[p("div",Ae,[a(I,{value:n(e).shortcut[`toggle_tag_${i.name}`],onKeydown:j(v=>h(v,`toggle_tag_${i.name}`),["stop","prevent"]),placeholder:l.$t("shortcutKeyDescription")},null,8,["value","onKeydown","placeholder"]),a(f,{onClick:v=>n(e).shortcut[`toggle_tag_${i.name}`]="",class:"clear-btn"},{default:c(()=>[F(w(l.$t("clear")),1)]),_:2},1032,["onClick"])])]),_:2},1032,["label"]))),128)),n(ve)?(b(),x(M,{key:0},[p("h2",null,w(n(C)("clientSpecificSettings")),1),a(m,null,{default:c(()=>[p("div",Ke,[a(f,{onClick:r,class:"clear-btn"},{default:c(()=>[F(w(l.$t("initiateSoftwareStartupConfig")),1)]),_:1})])]),_:1})],64)):B("",!0)]}),_:1})])}}});const ze=we(Pe,[["__scopeId","data-v-4633948c"]]);export{ze as default}; diff --git a/vue/dist/assets/hook-3618bdfa.js b/vue/dist/assets/hook-3618bdfa.js new file mode 100644 index 0000000..dcab026 --- /dev/null +++ b/vue/dist/assets/hook-3618bdfa.js @@ -0,0 +1 @@ +import{bn as A,$ as g,bU as q,bV as x,am as k,aj as D,bO as j,bd as z}from"./index-1537dba6.js";import{u as G,b as N,f as O,c as Q,d as U,e as H,h as L}from"./FileItem-dbdcf20b.js";let T=0;const V=()=>++T,W=(r,l,{dataUpdateStrategy:c="replace"}={})=>{const s=A([""]),u=g(!1),t=g(),a=g(!1);let f=g(-1);const v=new Set,b=e=>{var n;c==="replace"?t.value=e:c==="merge"&&(k((Array.isArray(t.value)||typeof t.value>"u")&&Array.isArray(e),"数据更新策略为合并时仅可用于值为数组的情况"),t.value=[...(n=t==null?void 0:t.value)!==null&&n!==void 0?n:[],...e])},d=e=>x(void 0,void 0,void 0,function*(){if(a.value||u.value&&typeof e>"u")return!1;a.value=!0;const n=V();f.value=n;try{let o;if(typeof e=="number"){if(o=s[e],typeof o!="string")return!1}else o=s[s.length-1];const p=yield r(o);if(v.has(n))return v.delete(n),!1;b(l(p));const i=p.cursor;if((e===s.length-1||typeof e!="number")&&(u.value=!i.has_next,i.has_next)){const I=i.next_cursor||i.next;k(typeof I=="string"),s.push(I)}}finally{f.value===n&&(a.value=!1)}return!0}),h=()=>{v.add(f.value),a.value=!1},w=(e=!1)=>x(void 0,void 0,void 0,function*(){const{refetch:n,force:o}=typeof e=="object"?e:{refetch:e};o&&h(),k(!a.value),s.splice(0,s.length,""),a.value=!1,t.value=void 0,u.value=!1,n&&(yield d())}),m=()=>({next:()=>x(void 0,void 0,void 0,function*(){if(a.value)throw new Error("不允许同时迭代");return{done:!(yield d()),value:t.value}})});return q({abort:h,load:u,next:d,res:t,loading:a,cursorStack:s,reset:w,[Symbol.asyncIterator]:m,iter:{[Symbol.asyncIterator]:m}})},J=r=>A(W(r,l=>l.files,{dataUpdateStrategy:"merge"})),K=r=>{const l=A(new Set),c=D(()=>(r.res??[]).filter(y=>!l.has(y.fullpath))),s=j(),{stackViewEl:u,multiSelectedIdxs:t,stack:a,scroller:f}=G({images:c}).toRefs(),{itemSize:v,gridItems:b,cellWidth:d,onScroll:h}=N({fetchNext:()=>r.next()}),{showMenuIdx:w}=O(),{onFileDragStart:m,onFileDragEnd:e}=Q(),{showGenInfo:n,imageGenInfo:o,q:p,onContextMenuClick:i,onFileItemClick:I}=U({openNext:z}),{previewIdx:C,previewing:F,onPreviewVisibleChange:_,previewImgMove:E,canPreview:M}=H(),P=async(y,S,R)=>{a.value=[{curr:"",files:c.value}],await i(y,S,R)};return L("removeFiles",async({paths:y})=>{y.forEach(S=>l.add(S))}),{images:c,scroller:f,queue:s,iter:r,onContextMenuClickU:P,stackViewEl:u,previewIdx:C,previewing:F,onPreviewVisibleChange:_,previewImgMove:E,canPreview:M,itemSize:v,gridItems:b,showGenInfo:n,imageGenInfo:o,q:p,onContextMenuClick:i,onFileItemClick:I,showMenuIdx:w,multiSelectedIdxs:t,onFileDragStart:m,onFileDragEnd:e,cellWidth:d,onScroll:h}};export{J as c,K as u}; diff --git a/vue/dist/assets/hook-cd0f6c09.js b/vue/dist/assets/hook-cd0f6c09.js deleted file mode 100644 index 59b389d..0000000 --- a/vue/dist/assets/hook-cd0f6c09.js +++ /dev/null @@ -1 +0,0 @@ -import{$ as q,bO as D,bd as E,aC as P}from"./index-f1d763a2.js";import{h as $,u as z,b as G,f as O,c as Q,d as R,e as V,i as _}from"./FileItem-a4a4ada7.js";const L=()=>{const e=q(),c=D(),l=$(),{stackViewEl:u,multiSelectedIdxs:r,stack:m,scroller:n}=z({images:e}).toRefs(),{itemSize:v,gridItems:d,cellWidth:g}=G(),{showMenuIdx:f}=O(),{onFileDragStart:I,onFileDragEnd:p}=Q(),{showGenInfo:h,imageGenInfo:w,q:x,onContextMenuClick:o,onFileItemClick:S}=R({openNext:E}),{previewIdx:C,previewing:F,onPreviewVisibleChange:b,previewImgMove:k,canPreview:M}=V(),y=async(s,t,a)=>{m.value=[{curr:"",files:e.value}],await o(s,t,a)};_("removeFiles",async({paths:s})=>{var t;e.value=(t=e.value)==null?void 0:t.filter(a=>!s.includes(a.fullpath))});const i=()=>{const s=n.value;if(s&&e.value){const t=e.value.slice(Math.max(s.$_startIndex-10,0),s.$_endIndex+10).map(a=>a.fullpath);l.fetchImageTags(t)}},T=P(i,300);return{scroller:n,queue:c,images:e,onContextMenuClickU:y,stackViewEl:u,previewIdx:C,previewing:F,onPreviewVisibleChange:b,previewImgMove:k,canPreview:M,itemSize:v,gridItems:d,showGenInfo:h,imageGenInfo:w,q:x,onContextMenuClick:o,onFileItemClick:S,showMenuIdx:f,multiSelectedIdxs:r,onFileDragStart:I,onFileDragEnd:p,cellWidth:g,onScroll:T,updateImageTag:i}};export{L as u}; diff --git a/vue/dist/assets/index-f1d763a2.js b/vue/dist/assets/index-1537dba6.js similarity index 99% rename from vue/dist/assets/index-f1d763a2.js rename to vue/dist/assets/index-1537dba6.js index cb3be8a..56b1f2b 100644 --- a/vue/dist/assets/index-f1d763a2.js +++ b/vue/dist/assets/index-1537dba6.js @@ -189,4 +189,4 @@ Note that this is not an issue if running this frontend on a browser instead of * pinia v2.1.3 * (c) 2023 Eduardo San Martin Morote * @license MIT - */let T_;const su=t=>T_=t,I_=Symbol();function yf(t){return t&&typeof t=="object"&&Object.prototype.toString.call(t)==="[object Object]"&&typeof t.toJSON!="function"}var ro;(function(t){t.direct="direct",t.patchObject="patch object",t.patchFunction="patch function"})(ro||(ro={}));function Qj(){const t=Of(!0),e=t.run(()=>W({}));let n=[],r=[];const a=Cs({install(i){su(a),a._a=i,i.provide(I_,a),i.config.globalProperties.$pinia=a,r.forEach(o=>n.push(o)),r=[]},use(i){return!this._a&&!Jj?r.push(i):n.push(i),this},_p:n,_a:null,_e:t,_s:new Map,state:e});return a}const A_=()=>{};function Sy(t,e,n,r=A_){t.push(e);const a=()=>{const i=t.indexOf(e);i>-1&&(t.splice(i,1),r())};return!n&&Ef()&&Gy(a),a}function Da(t,...e){t.slice().forEach(n=>{n(...e)})}const Zj=t=>t();function bf(t,e){t instanceof Map&&e instanceof Map&&e.forEach((n,r)=>t.set(r,n)),t instanceof Set&&e instanceof Set&&e.forEach(t.add,t);for(const n in e){if(!e.hasOwnProperty(n))continue;const r=e[n],a=t[n];yf(a)&&yf(r)&&t.hasOwnProperty(n)&&!tt(r)&&!wr(r)?t[n]=bf(a,r):t[n]=r}return t}const ez=Symbol();function tz(t){return!yf(t)||!t.hasOwnProperty(ez)}const{assign:Rr}=Object;function nz(t){return!!(tt(t)&&t.effect)}function rz(t,e,n,r){const{state:a,actions:i,getters:o}=e,l=n.state.value[t];let s;function u(){l||(n.state.value[t]=a?a():{});const f=lb(n.state.value[t]);return Rr(f,i,Object.keys(o||{}).reduce((v,h)=>(v[h]=Cs(K(()=>{su(n);const g=n._s.get(t);return o[h].call(g,g)})),v),{}))}return s=M_(t,u,e,n,r,!0),s}function M_(t,e,n={},r,a,i){let o;const l=Rr({actions:{}},n),s={deep:!0};let u,f,v=[],h=[],g;const c=r.state.value[t];!i&&!c&&(r.state.value[t]={}),W({});let d;function m(I){let P;u=f=!1,typeof I=="function"?(I(r.state.value[t]),P={type:ro.patchFunction,storeId:t,events:g}):(bf(r.state.value[t],I),P={type:ro.patchObject,payload:I,storeId:t,events:g});const k=d=Symbol();Ke().then(()=>{d===k&&(u=!0)}),f=!0,Da(v,P,r.state.value[t])}const p=i?function(){const{state:P}=n,k=P?P():{};this.$patch(L=>{Rr(L,k)})}:A_;function y(){o.stop(),v=[],h=[],r._s.delete(t)}function b(I,P){return function(){su(r);const k=Array.from(arguments),L=[],F=[];function j(M){L.push(M)}function z(M){F.push(M)}Da(h,{args:k,name:I,store:C,after:j,onError:z});let $;try{$=P.apply(this&&this.$id===t?this:C,k)}catch(M){throw Da(F,M),M}return $ instanceof Promise?$.then(M=>(Da(L,M),M)).catch(M=>(Da(F,M),Promise.reject(M))):(Da(L,$),$)}}const w={_p:r,$id:t,$onAction:Sy.bind(null,h),$patch:m,$reset:p,$subscribe(I,P={}){const k=Sy(v,I,P.detached,()=>L()),L=o.run(()=>pe(()=>r.state.value[t],F=>{(P.flush==="sync"?f:u)&&I({storeId:t,type:ro.direct,events:g},F)},Rr({},s,P)));return k},$dispose:y},C=rt(w);r._s.set(t,C);const _=r._a&&r._a.runWithContext||Zj,O=r._e.run(()=>(o=Of(),_(()=>o.run(e))));for(const I in O){const P=O[I];if(tt(P)&&!nz(P)||wr(P))i||(c&&tz(P)&&(tt(P)?P.value=c[I]:bf(P,c[I])),r.state.value[t][I]=P);else if(typeof P=="function"){const k=b(I,P);O[I]=k,l.actions[I]=P}}return Rr(C,O),Rr(ke(C),O),Object.defineProperty(C,"$state",{get:()=>r.state.value[t],set:I=>{m(P=>{Rr(P,I)})}}),r._p.forEach(I=>{Rr(C,o.run(()=>I({store:C,app:r._a,pinia:r,options:l})))}),c&&i&&n.hydrate&&n.hydrate(C.$state,c),u=!0,f=!0,C}function k_(t,e,n){let r,a;const i=typeof e=="function";typeof t=="string"?(r=t,a=i?n:e):(a=t,r=t.id);function o(l,s){const u=Ex();return l=l||(u?Xe(I_,null):null),l&&su(l),l=T_,l._s.has(r)||(i?M_(r,e,a,l):rz(r,a,l)),l._s.get(r)}return o.$id=r,o}function az(t){{t=ke(t);const e={};for(const n in t){const r=t[n];(tt(r)||wr(r))&&(e[n]=Kt(t,n))}return e}}const iz=t=>Yc({...t,name:typeof t.name=="string"?t.name:t.nameFallbackStr??""}),oz=t=>({...t,panes:t.panes.map(iz)}),Wo=k_("useGlobalStore",()=>{const t=W(),e=W([]),n=W(!0),r=W(512),a=W(Av.CREATED_TIME_DESC),i=W(256),o=()=>({type:"empty",name:Ae("emptyStartPage"),key:br()}),l=W([]);Re(()=>{const b=o();l.value.push({panes:[b],key:b.key,id:br()})});const s=W(),u=W(new Array),f=Date.now(),v=W(),h=()=>{var w;const b=ke(l.value).map(oz);((w=v.value)==null?void 0:w[0].time)!==f?v.value=[{tabs:b,time:f},...v.value??[]]:v.value[0].tabs=b,v.value=v.value.slice(0,2)},g=async(b,w,C)=>{let _=l.value.map(I=>I.panes).flat().find(I=>I.type==="tag-search-matched-image-grid"&&I.id===w);if(_){_.selectedTagIds=Yc(C);return}else _={type:"tag-search-matched-image-grid",id:w,selectedTagIds:Yc(C),key:br(),name:Ae("searchResults")};const O=l.value[b+1];O?(O.key=_.key,O.panes.push(_)):l.value.push({panes:[_],key:_.key,id:br()})},c=W(Y1());pe(c,b=>wv.global.locale.value=b);const d=W(!1),m=W({delete:""}),p=K(()=>{const b=["outdir_extras_samples","outdir_save","outdir_txt2img_samples","outdir_img2img_samples","outdir_img2img_grids","outdir_txt2img_grids"],w=e.value.filter(C=>b.includes(C.key)).map(C=>[C.zh,C.dir]);return Object.fromEntries(w)}),y=rt({deleteOneOnly:!1});return{defaultSortingMethod:a,defaultGridCellWidth:i,pathAliasMap:p,createEmptyPane:o,lang:c,tabList:l,conf:t,quickMovePaths:e,enableThumbnail:n,dragingTab:s,saveRecord:h,recent:u,tabListHistoryRecord:v,gridThumbnailResolution:r,longPressOpenContextMenu:d,openTagSearchMatchedImageGridInRight:g,onlyFoldersAndImages:W(!0),fullscreenPreviewInitialUrl:W(""),shortcut:m,dontShowAgain:W(!1),dontShowAgainNewImgOpts:W(!1),ignoredConfirmActions:y}},{persist:{paths:["dontShowAgainNewImgOpts","defaultSortingMethod","defaultGridCellWidth","dontShowAgain","lang","enableThumbnail","tabListHistoryRecord","recent","gridThumbnailResolution","longPressOpenContextMenu","onlyFoldersAndImages","shortcut","ignoredConfirmActions"]}}),ao=encodeURIComponent,vs=(t,e=!1)=>`${Iv.value}/file?path=${ao(t.fullpath)}&t=${ao(t.date)}${e?`&disposition=${ao(t.name)}`:""}`,xy=(t,e="512x512")=>`${Iv.value}/image-thumbnail?path=${ao(t.fullpath)}&size=${e}&t=${ao(t.date)}`,lz=t=>typeof t=="object"&&t.__id==="FileTransferData",sz=t=>{var n;const e=JSON.parse(((n=t.dataTransfer)==null?void 0:n.getData("text"))??"{}");return lz(e)?e:null},B9=t=>Q1(t,"fullpath");function uz(t){var r;if(typeof t!="string")return!1;const e=[".jpg",".jpeg",".png",".gif",".bmp",".webp"],n=(r=t.split(".").pop())==null?void 0:r.toLowerCase();return n!==void 0&&e.includes(`.${n}`)}function j9(t){const e=document.createElement("a");e.style.display="none",document.body.appendChild(e),t.forEach(n=>{e.href=n,e.download="",e.click()}),document.body.removeChild(e)}function N_(){try{return parent.window.gradioApp()}catch{}const t=parent.document.getElementsByTagName("gradio-app"),e=t.length==0?null:t[0].shadowRoot;return e||document}const cz=()=>{const t=N_().querySelectorAll("#tabs > .tabitem[id^=tab_]");return Array.from(t).findIndex(e=>e.id.includes("infinite-image-browsing"))},fz=()=>{try{N_().querySelector("#tabs").querySelectorAll("button")[cz()].click()}catch(t){console.error(t)}},dz=async(t,e=100,n=1e3)=>new Promise(r=>{const a=(i=0)=>{const o=t();o!=null||i>n/e?r(o):setTimeout(()=>a(++i),e)};a()}),vz=(t,...e)=>e.reduce((n,r)=>(n[r]=t==null?void 0:t[r],n),{}),pz=()=>rt(new Io(-1,0,-1,"throw")),z9=async(t,e)=>{try{if(navigator.clipboard)await navigator.clipboard.writeText(t);else{const n=document.createElement("input");n.value=t,document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n)}ba.success(e??Ae("copied"))}catch{ba.error("copy failed. maybe it's non-secure environment")}},{useEventListen:Py,eventEmitter:$_}=J1();function W9(t){let e=null,n=!1;return async function(...r){if(n)return e;n=!0;try{return e=t.apply(this,r),await e}finally{n=!1}}}function hz(t){const e=parent.location.href,n=new URLSearchParams(parent.location.search);t.forEach(a=>{n.delete(a)});const r=`${e.split("?")[0]}${n.size?"?":""}${n.toString()}`;return parent.history.pushState(null,"",r),r}const mz=t=>new Promise((e,n)=>{const r=new Image;r.onload=()=>e(r),r.onerror=a=>n(a),r.src=t});function gz(t){return!!/^(?:\/|[a-z]:\/)/i.test(di(t))}function di(t){if(!t)return"";t=t.replace(/\\/g,"/"),t=t.replace(/\/+/g,"/");const e=t.split("/"),n=[];for(let i=0;i{const n=gz(t)?t:di(yz(e,t));return di(n)},V9=t=>{t=di(t);const e=t.split("/").filter(n=>n);return e[0].endsWith(":")&&(e[0]=e[0]+"/"),e},Oy=async({global_setting:t,sd_cwd:e,home:n,extra_paths:r,cwd:a})=>{const o={...vz(t,"outdir_grids","outdir_extras_samples","outdir_img2img_grids","outdir_img2img_samples","outdir_grids","outdir_extras_samples","outdir_samples","outdir_txt2img_grids","outdir_txt2img_samples","outdir_save"),cwd:e,home:n,desktop:`${n}/Desktop`};Object.keys(o).forEach(h=>{const g=h;if(o[g])try{o[g]=bz(o[g],e)}catch(c){console.error(c)}});const l=await qj(Object.values(o).filter(h=>h)),s={outdir_txt2img_samples:Ae("t2i"),outdir_img2img_samples:Ae("i2i"),outdir_save:Ae("saveButtonSavesTo"),outdir_extras_samples:Ae("extra"),outdir_grids:Ae("gridImage"),outdir_img2img_grids:Ae("i2i-grid"),outdir_samples:Ae("image"),outdir_txt2img_grids:Ae("t2i-grid"),cwd:Ae("workingFolder"),home:"home",desktop:Ae("desktop")},u={home:n,[Ae("desktop")]:o.desktop,[Ae("workingFolder")]:a,[Ae("t2i")]:o.outdir_txt2img_samples,[Ae("i2i")]:o.outdir_img2img_samples},f=h=>{h=di(h);const g=[];for(const[c,d]of Object.entries(u))c&&d&&g.push(h.replace(d,"$"+c));return g.sort((c,d)=>c.length-d.length)[0]},v=Object.keys(s).filter(h=>l[o[h]]).map(h=>{const g=h;return{key:g,zh:s[g],dir:o[g],can_delete:!1}}).concat(r.map(h=>({key:h.path,zh:f(h.path),dir:h.path,can_delete:!0})));return Q1(v,"key")};const R_={name:"splitpanes",emits:["ready","resize","resized","pane-click","pane-maximize","pane-add","pane-remove","splitter-click"],props:{horizontal:{type:Boolean},pushOtherPanes:{type:Boolean,default:!0},dblClickSplitter:{type:Boolean,default:!0},rtl:{type:Boolean,default:!1},firstSplitter:{type:Boolean}},provide(){return{requestUpdate:this.requestUpdate,onPaneAdd:this.onPaneAdd,onPaneRemove:this.onPaneRemove,onPaneClick:this.onPaneClick}},data:()=>({container:null,ready:!1,panes:[],touch:{mouseDown:!1,dragging:!1,activeSplitter:null},splitterTaps:{splitter:null,timeoutId:null}}),computed:{panesCount(){return this.panes.length},indexedPanes(){return this.panes.reduce((t,e)=>(t[e.id]=e)&&t,{})}},methods:{updatePaneComponents(){this.panes.forEach(t=>{t.update&&t.update({[this.horizontal?"height":"width"]:`${this.indexedPanes[t.id].size}%`})})},bindEvents(){document.addEventListener("mousemove",this.onMouseMove,{passive:!1}),document.addEventListener("mouseup",this.onMouseUp),"ontouchstart"in window&&(document.addEventListener("touchmove",this.onMouseMove,{passive:!1}),document.addEventListener("touchend",this.onMouseUp))},unbindEvents(){document.removeEventListener("mousemove",this.onMouseMove,{passive:!1}),document.removeEventListener("mouseup",this.onMouseUp),"ontouchstart"in window&&(document.removeEventListener("touchmove",this.onMouseMove,{passive:!1}),document.removeEventListener("touchend",this.onMouseUp))},onMouseDown(t,e){this.bindEvents(),this.touch.mouseDown=!0,this.touch.activeSplitter=e},onMouseMove(t){this.touch.mouseDown&&(t.preventDefault(),this.touch.dragging=!0,this.calculatePanesSize(this.getCurrentMouseDrag(t)),this.$emit("resize",this.panes.map(e=>({min:e.min,max:e.max,size:e.size}))))},onMouseUp(){this.touch.dragging&&this.$emit("resized",this.panes.map(t=>({min:t.min,max:t.max,size:t.size}))),this.touch.mouseDown=!1,setTimeout(()=>{this.touch.dragging=!1,this.unbindEvents()},100)},onSplitterClick(t,e){"ontouchstart"in window&&(t.preventDefault(),this.dblClickSplitter&&(this.splitterTaps.splitter===e?(clearTimeout(this.splitterTaps.timeoutId),this.splitterTaps.timeoutId=null,this.onSplitterDblClick(t,e),this.splitterTaps.splitter=null):(this.splitterTaps.splitter=e,this.splitterTaps.timeoutId=setTimeout(()=>{this.splitterTaps.splitter=null},500)))),this.touch.dragging||this.$emit("splitter-click",this.panes[e])},onSplitterDblClick(t,e){let n=0;this.panes=this.panes.map((r,a)=>(r.size=a===e?r.max:r.min,a!==e&&(n+=r.min),r)),this.panes[e].size-=n,this.$emit("pane-maximize",this.panes[e]),this.$emit("resized",this.panes.map(r=>({min:r.min,max:r.max,size:r.size})))},onPaneClick(t,e){this.$emit("pane-click",this.indexedPanes[e])},getCurrentMouseDrag(t){const e=this.container.getBoundingClientRect(),{clientX:n,clientY:r}="ontouchstart"in window&&t.touches?t.touches[0]:t;return{x:n-e.left,y:r-e.top}},getCurrentDragPercentage(t){t=t[this.horizontal?"y":"x"];const e=this.container[this.horizontal?"clientHeight":"clientWidth"];return this.rtl&&!this.horizontal&&(t=e-t),t*100/e},calculatePanesSize(t){const e=this.touch.activeSplitter;let n={prevPanesSize:this.sumPrevPanesSize(e),nextPanesSize:this.sumNextPanesSize(e),prevReachedMinPanes:0,nextReachedMinPanes:0};const r=0+(this.pushOtherPanes?0:n.prevPanesSize),a=100-(this.pushOtherPanes?0:n.nextPanesSize),i=Math.max(Math.min(this.getCurrentDragPercentage(t),a),r);let o=[e,e+1],l=this.panes[o[0]]||null,s=this.panes[o[1]]||null;const u=l.max<100&&i>=l.max+n.prevPanesSize,f=s.max<100&&i<=100-(s.max+this.sumNextPanesSize(e+1));if(u||f){u?(l.size=l.max,s.size=Math.max(100-l.max-n.prevPanesSize-n.nextPanesSize,0)):(l.size=Math.max(100-s.max-n.prevPanesSize-this.sumNextPanesSize(e+1),0),s.size=s.max);return}if(this.pushOtherPanes){const v=this.doPushOtherPanes(n,i);if(!v)return;({sums:n,panesToResize:o}=v),l=this.panes[o[0]]||null,s=this.panes[o[1]]||null}l!==null&&(l.size=Math.min(Math.max(i-n.prevPanesSize-n.prevReachedMinPanes,l.min),l.max)),s!==null&&(s.size=Math.min(Math.max(100-i-n.nextPanesSize-n.nextReachedMinPanes,s.min),s.max))},doPushOtherPanes(t,e){const n=this.touch.activeSplitter,r=[n,n+1];return e{i>r[0]&&i<=n&&(a.size=a.min,t.prevReachedMinPanes+=a.min)}),t.prevPanesSize=this.sumPrevPanesSize(r[0]),r[0]===void 0)?(t.prevReachedMinPanes=0,this.panes[0].size=this.panes[0].min,this.panes.forEach((a,i)=>{i>0&&i<=n&&(a.size=a.min,t.prevReachedMinPanes+=a.min)}),this.panes[r[1]].size=100-t.prevReachedMinPanes-this.panes[0].min-t.prevPanesSize-t.nextPanesSize,null):e>100-t.nextPanesSize-this.panes[r[1]].min&&(r[1]=this.findNextExpandedPane(n).index,t.nextReachedMinPanes=0,r[1]>n+1&&this.panes.forEach((a,i)=>{i>n&&i{i=n+1&&(a.size=a.min,t.nextReachedMinPanes+=a.min)}),this.panes[r[0]].size=100-t.prevPanesSize-t.nextReachedMinPanes-this.panes[this.panesCount-1].min-t.nextPanesSize,null):{sums:t,panesToResize:r}},sumPrevPanesSize(t){return this.panes.reduce((e,n,r)=>e+(re+(r>t+1?n.size:0),0)},findPrevExpandedPane(t){return[...this.panes].reverse().find(e=>e.indexe.min)||{}},findNextExpandedPane(t){return this.panes.find(e=>e.index>t+1&&e.size>e.min)||{}},checkSplitpanesNodes(){Array.from(this.container.children).forEach(t=>{const e=t.classList.contains("splitpanes__pane"),n=t.classList.contains("splitpanes__splitter");!e&&!n&&(t.parentNode.removeChild(t),console.warn("Splitpanes: Only elements are allowed at the root of . One of your DOM nodes was removed."))})},addSplitter(t,e,n=!1){const r=t-1,a=document.createElement("div");a.classList.add("splitpanes__splitter"),n||(a.onmousedown=i=>this.onMouseDown(i,r),typeof window<"u"&&"ontouchstart"in window&&(a.ontouchstart=i=>this.onMouseDown(i,r)),a.onclick=i=>this.onSplitterClick(i,r+1)),this.dblClickSplitter&&(a.ondblclick=i=>this.onSplitterDblClick(i,r+1)),e.parentNode.insertBefore(a,e)},removeSplitter(t){t.onmousedown=void 0,t.onclick=void 0,t.ondblclick=void 0,t.parentNode.removeChild(t)},redoSplitters(){const t=Array.from(this.container.children);t.forEach(n=>{n.className.includes("splitpanes__splitter")&&this.removeSplitter(n)});let e=0;t.forEach(n=>{n.className.includes("splitpanes__pane")&&(!e&&this.firstSplitter?this.addSplitter(e,n,!0):e&&this.addSplitter(e,n),e++)})},requestUpdate({target:t,...e}){const n=this.indexedPanes[t._.uid];Object.entries(e).forEach(([r,a])=>n[r]=a)},onPaneAdd(t){let e=-1;Array.from(t.$el.parentNode.children).some(a=>(a.className.includes("splitpanes__pane")&&e++,a===t.$el));const n=parseFloat(t.minSize),r=parseFloat(t.maxSize);this.panes.splice(e,0,{id:t._.uid,index:e,min:isNaN(n)?0:n,max:isNaN(r)?100:r,size:t.size===null?null:parseFloat(t.size),givenSize:t.size,update:t.update}),this.panes.forEach((a,i)=>a.index=i),this.ready&&this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({addedPane:this.panes[e]}),this.$emit("pane-add",{index:e,panes:this.panes.map(a=>({min:a.min,max:a.max,size:a.size}))})})},onPaneRemove(t){const e=this.panes.findIndex(r=>r.id===t._.uid),n=this.panes.splice(e,1)[0];this.panes.forEach((r,a)=>r.index=a),this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({removedPane:{...n,index:e}}),this.$emit("pane-remove",{removed:n,panes:this.panes.map(r=>({min:r.min,max:r.max,size:r.size}))})})},resetPaneSizes(t={}){!t.addedPane&&!t.removedPane?this.initialPanesSizing():this.panes.some(e=>e.givenSize!==null||e.min||e.max<100)?this.equalizeAfterAddOrRemove(t):this.equalize(),this.ready&&this.$emit("resized",this.panes.map(e=>({min:e.min,max:e.max,size:e.size})))},equalize(){const t=100/this.panesCount;let e=0;const n=[],r=[];this.panes.forEach(a=>{a.size=Math.max(Math.min(t,a.max),a.min),e-=a.size,a.size>=a.max&&n.push(a.id),a.size<=a.min&&r.push(a.id)}),e>.1&&this.readjustSizes(e,n,r)},initialPanesSizing(){let t=100;const e=[],n=[];let r=0;this.panes.forEach(i=>{t-=i.size,i.size!==null&&r++,i.size>=i.max&&e.push(i.id),i.size<=i.min&&n.push(i.id)});let a=100;t>.1&&(this.panes.forEach(i=>{i.size===null&&(i.size=Math.max(Math.min(t/(this.panesCount-r),i.max),i.min)),a-=i.size}),a>.1&&this.readjustSizes(t,e,n))},equalizeAfterAddOrRemove({addedPane:t,removedPane:e}={}){let n=100/this.panesCount,r=0;const a=[],i=[];t&&t.givenSize!==null&&(n=(100-t.givenSize)/(this.panesCount-1)),this.panes.forEach(o=>{r-=o.size,o.size>=o.max&&a.push(o.id),o.size<=o.min&&i.push(o.id)}),!(Math.abs(r)<.1)&&(this.panes.forEach(o=>{t&&t.givenSize!==null&&t.id===o.id||(o.size=Math.max(Math.min(n,o.max),o.min)),r-=o.size,o.size>=o.max&&a.push(o.id),o.size<=o.min&&i.push(o.id)}),r>.1&&this.readjustSizes(r,a,i))},readjustSizes(t,e,n){let r;t>0?r=t/(this.panesCount-e.length):r=t/(this.panesCount-n.length),this.panes.forEach((a,i)=>{if(t>0&&!e.includes(a.id)){const o=Math.max(Math.min(a.size+r,a.max),a.min),l=o-a.size;t-=l,a.size=o}else if(!n.includes(a.id)){const o=Math.max(Math.min(a.size+r,a.max),a.min),l=o-a.size;t-=l,a.size=o}a.update({[this.horizontal?"height":"width"]:`${this.indexedPanes[a.id].size}%`})}),Math.abs(t)>.1&&this.$nextTick(()=>{this.ready&&console.warn("Splitpanes: Could not resize panes correctly due to their constraints.")})}},watch:{panes:{deep:!0,immediate:!1,handler(){this.updatePaneComponents()}},horizontal(){this.updatePaneComponents()},firstSplitter(){this.redoSplitters()},dblClickSplitter(t){[...this.container.querySelectorAll(".splitpanes__splitter")].forEach((e,n)=>{e.ondblclick=t?r=>this.onSplitterDblClick(r,n):void 0})}},beforeUnmount(){this.ready=!1},mounted(){this.container=this.$refs.container,this.checkSplitpanesNodes(),this.redoSplitters(),this.resetPaneSizes(),this.$emit("ready"),this.ready=!0},render(){return Kr("div",{ref:"container",class:["splitpanes",`splitpanes--${this.horizontal?"horizontal":"vertical"}`,{"splitpanes--dragging":this.touch.dragging}]},this.$slots.default())}},wz=(t,e)=>{const n=t.__vccOpts||t;for(const[r,a]of e)n[r]=a;return n},Cz={name:"pane",inject:["requestUpdate","onPaneAdd","onPaneRemove","onPaneClick"],props:{size:{type:[Number,String],default:null},minSize:{type:[Number,String],default:0},maxSize:{type:[Number,String],default:100}},data:()=>({style:{}}),mounted(){this.onPaneAdd(this)},beforeUnmount(){this.onPaneRemove(this)},methods:{update(t){this.style=t}},computed:{sizeNumber(){return this.size||this.size===0?parseFloat(this.size):null},minSizeNumber(){return parseFloat(this.minSize)},maxSizeNumber(){return parseFloat(this.maxSize)}},watch:{sizeNumber(t){this.requestUpdate({target:this,size:t})},minSizeNumber(t){this.requestUpdate({target:this,min:t})},maxSizeNumber(t){this.requestUpdate({target:this,max:t})}}};function _z(t,e,n,r,a,i){return Ye(),an("div",{class:"splitpanes__pane",onClick:e[0]||(e[0]=o=>i.onPaneClick(o,t._.uid)),style:vi(t.style)},[Wl(t.$slots,"default")],4)}const wf=wz(Cz,[["render",_z]]);function Mv(t){return Ef()?(Gy(t),!0):!1}function kv(t){return typeof t=="function"?t():xe(t)}const L_=typeof window<"u",Nv=()=>{};function Sz(t,e){function n(...r){return new Promise((a,i)=>{Promise.resolve(t(()=>e.apply(this,r),{fn:e,thisArg:this,args:r})).then(a).catch(i)})}return n}const D_=t=>t();function xz(t=D_){const e=W(!0);function n(){e.value=!1}function r(){e.value=!0}const a=(...i)=>{e.value&&t(...i)};return{isActive:ws(e),pause:n,resume:r,eventFilter:a}}function Pz(...t){if(t.length!==1)return Kt(...t);const e=t[0];return typeof e=="function"?ws(zS(()=>({get:e,set:Nv}))):W(e)}function Oz(t,e=!0){bt()?Re(t):e?t():Ke(t)}var Ey=Object.getOwnPropertySymbols,Ez=Object.prototype.hasOwnProperty,Tz=Object.prototype.propertyIsEnumerable,Iz=(t,e)=>{var n={};for(var r in t)Ez.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&Ey)for(var r of Ey(t))e.indexOf(r)<0&&Tz.call(t,r)&&(n[r]=t[r]);return n};function Az(t,e,n={}){const r=n,{eventFilter:a=D_}=r,i=Iz(r,["eventFilter"]);return pe(t,Sz(a,e),i)}var Mz=Object.defineProperty,kz=Object.defineProperties,Nz=Object.getOwnPropertyDescriptors,ps=Object.getOwnPropertySymbols,F_=Object.prototype.hasOwnProperty,B_=Object.prototype.propertyIsEnumerable,Ty=(t,e,n)=>e in t?Mz(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,$z=(t,e)=>{for(var n in e||(e={}))F_.call(e,n)&&Ty(t,n,e[n]);if(ps)for(var n of ps(e))B_.call(e,n)&&Ty(t,n,e[n]);return t},Rz=(t,e)=>kz(t,Nz(e)),Lz=(t,e)=>{var n={};for(var r in t)F_.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&ps)for(var r of ps(t))e.indexOf(r)<0&&B_.call(t,r)&&(n[r]=t[r]);return n};function Dz(t,e,n={}){const r=n,{eventFilter:a}=r,i=Lz(r,["eventFilter"]),{eventFilter:o,pause:l,resume:s,isActive:u}=xz(a);return{stop:Az(t,e,Rz($z({},i),{eventFilter:o})),pause:l,resume:s,isActive:u}}function Fz(t,e,n){let r;tt(n)?r={evaluating:n}:r=n||{};const{lazy:a=!1,evaluating:i=void 0,shallow:o=!0,onError:l=Nv}=r,s=W(!a),u=o?$n(e):W(e);let f=0;return st(async v=>{if(!s.value)return;f++;const h=f;let g=!1;i&&Promise.resolve().then(()=>{i.value=!0});try{const c=await t(d=>{v(()=>{i&&(i.value=!1),g||d()})});h===f&&(u.value=c)}catch(c){l(c)}finally{i&&h===f&&(i.value=!1),g=!0}}),a?K(()=>(s.value=!0,u.value)):u}function Hr(t){var e;const n=kv(t);return(e=n==null?void 0:n.$el)!=null?e:n}const Sr=L_?window:void 0,Bz=L_?window.document:void 0;function Pn(...t){let e,n,r,a;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,r,a]=t,e=Sr):[e,n,r,a]=t,!e)return Nv;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);const i=[],o=()=>{i.forEach(f=>f()),i.length=0},l=(f,v,h,g)=>(f.addEventListener(v,h,g),()=>f.removeEventListener(v,h,g)),s=pe(()=>[Hr(e),kv(a)],([f,v])=>{o(),f&&i.push(...n.flatMap(h=>r.map(g=>l(f,h,g,v))))},{immediate:!0,flush:"post"}),u=()=>{s(),o()};return Mv(u),u}const jz=500;function H9(t,e,n){var r,a;const i=K(()=>Hr(t));let o;function l(){o&&(clearTimeout(o),o=void 0)}function s(f){var v,h,g,c;(v=n==null?void 0:n.modifiers)!=null&&v.self&&f.target!==i.value||(l(),(h=n==null?void 0:n.modifiers)!=null&&h.prevent&&f.preventDefault(),(g=n==null?void 0:n.modifiers)!=null&&g.stop&&f.stopPropagation(),o=setTimeout(()=>e(f),(c=n==null?void 0:n.delay)!=null?c:jz))}const u={capture:(r=n==null?void 0:n.modifiers)==null?void 0:r.capture,once:(a=n==null?void 0:n.modifiers)==null?void 0:a.once};Pn(i,"pointerdown",s,u),Pn(i,"pointerup",l,u),Pn(i,"pointerleave",l,u)}function zz(){const t=W(!1);return bt()&&Re(()=>{t.value=!0}),t}function j_(t){const e=zz();return K(()=>(e.value,!!t()))}function Wz(t,e={}){const{window:n=Sr}=e,r=j_(()=>n&&"matchMedia"in n&&typeof n.matchMedia=="function");let a;const i=W(!1),o=()=>{a&&("removeEventListener"in a?a.removeEventListener("change",l):a.removeListener(l))},l=()=>{r.value&&(o(),a=n.matchMedia(Pz(t).value),i.value=!!(a!=null&&a.matches),a&&("addEventListener"in a?a.addEventListener("change",l):a.addListener(l)))};return st(l),Mv(()=>o()),i}const wl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Cl="__vueuse_ssr_handlers__",Vz=Hz();function Hz(){return Cl in wl||(wl[Cl]=wl[Cl]||{}),wl[Cl]}function Uz(t,e){return Vz[t]||e}function Kz(t){return t==null?"any":t instanceof Set?"set":t instanceof Map?"map":t instanceof Date?"date":typeof t=="boolean"?"boolean":typeof t=="string"?"string":typeof t=="object"?"object":Number.isNaN(t)?"any":"number"}var Gz=Object.defineProperty,Iy=Object.getOwnPropertySymbols,qz=Object.prototype.hasOwnProperty,Yz=Object.prototype.propertyIsEnumerable,Ay=(t,e,n)=>e in t?Gz(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,My=(t,e)=>{for(var n in e||(e={}))qz.call(e,n)&&Ay(t,n,e[n]);if(Iy)for(var n of Iy(e))Yz.call(e,n)&&Ay(t,n,e[n]);return t};const Xz={boolean:{read:t=>t==="true",write:t=>String(t)},object:{read:t=>JSON.parse(t),write:t=>JSON.stringify(t)},number:{read:t=>Number.parseFloat(t),write:t=>String(t)},any:{read:t=>t,write:t=>String(t)},string:{read:t=>t,write:t=>String(t)},map:{read:t=>new Map(JSON.parse(t)),write:t=>JSON.stringify(Array.from(t.entries()))},set:{read:t=>new Set(JSON.parse(t)),write:t=>JSON.stringify(Array.from(t))},date:{read:t=>new Date(t),write:t=>t.toISOString()}},ky="vueuse-storage";function Jz(t,e,n,r={}){var a;const{flush:i="pre",deep:o=!0,listenToStorageChanges:l=!0,writeDefaults:s=!0,mergeDefaults:u=!1,shallow:f,window:v=Sr,eventFilter:h,onError:g=I=>{console.error(I)}}=r,c=(f?$n:W)(e);if(!n)try{n=Uz("getDefaultStorage",()=>{var I;return(I=Sr)==null?void 0:I.localStorage})()}catch(I){g(I)}if(!n)return c;const d=kv(e),m=Kz(d),p=(a=r.serializer)!=null?a:Xz[m],{pause:y,resume:b}=Dz(c,()=>w(c.value),{flush:i,deep:o,eventFilter:h});return v&&l&&(Pn(v,"storage",O),Pn(v,ky,_)),O(),c;function w(I){try{if(I==null)n.removeItem(t);else{const P=p.write(I),k=n.getItem(t);k!==P&&(n.setItem(t,P),v&&v.dispatchEvent(new CustomEvent(ky,{detail:{key:t,oldValue:k,newValue:P,storageArea:n}})))}}catch(P){g(P)}}function C(I){const P=I?I.newValue:n.getItem(t);if(P==null)return s&&d!==null&&n.setItem(t,p.write(d)),d;if(!I&&u){const k=p.read(P);return typeof u=="function"?u(k,d):m==="object"&&!Array.isArray(k)?My(My({},d),k):k}else return typeof P!="string"?P:p.read(P)}function _(I){O(I.detail)}function O(I){if(!(I&&I.storageArea!==n)){if(I&&I.key==null){c.value=d;return}if(!(I&&I.key!==t)){y();try{c.value=C(I)}catch(P){g(P)}finally{I?Ke(b):b()}}}}}function Qz(t){return Wz("(prefers-color-scheme: dark)",t)}function Zz({document:t=Bz}={}){if(!t)return W("visible");const e=W(t.visibilityState);return Pn(t,"visibilitychange",()=>{e.value=t.visibilityState}),e}var Ny=Object.getOwnPropertySymbols,e7=Object.prototype.hasOwnProperty,t7=Object.prototype.propertyIsEnumerable,n7=(t,e)=>{var n={};for(var r in t)e7.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&Ny)for(var r of Ny(t))e.indexOf(r)<0&&t7.call(t,r)&&(n[r]=t[r]);return n};function r7(t,e,n={}){const r=n,{window:a=Sr}=r,i=n7(r,["window"]);let o;const l=j_(()=>a&&"ResizeObserver"in a),s=()=>{o&&(o.disconnect(),o=void 0)},u=K(()=>Array.isArray(t)?t.map(h=>Hr(h)):[Hr(t)]),f=pe(u,h=>{if(s(),l.value&&a){o=new ResizeObserver(e);for(const g of h)g&&o.observe(g,i)}},{immediate:!0,flush:"post",deep:!0}),v=()=>{s(),f()};return Mv(v),{isSupported:l,stop:v}}function a7(t,e={width:0,height:0},n={}){const{window:r=Sr,box:a="content-box"}=n,i=K(()=>{var s,u;return(u=(s=Hr(t))==null?void 0:s.namespaceURI)==null?void 0:u.includes("svg")}),o=W(e.width),l=W(e.height);return r7(t,([s])=>{const u=a==="border-box"?s.borderBoxSize:a==="content-box"?s.contentBoxSize:s.devicePixelContentBoxSize;if(r&&i.value){const f=Hr(t);if(f){const v=r.getComputedStyle(f);o.value=parseFloat(v.width),l.value=parseFloat(v.height)}}else if(u){const f=Array.isArray(u)?u:[u];o.value=f.reduce((v,{inlineSize:h})=>v+h,0),l.value=f.reduce((v,{blockSize:h})=>v+h,0)}else o.value=s.contentRect.width,l.value=s.contentRect.height},n),pe(()=>Hr(t),s=>{o.value=s?e.width:0,l.value=s?e.height:0}),{width:o,height:l}}function U9(t,e,n={}){const{window:r=Sr}=n;return Jz(t,e,r==null?void 0:r.localStorage,n)}const i7={page:t=>[t.pageX,t.pageY],client:t=>[t.clientX,t.clientY],screen:t=>[t.screenX,t.screenY],movement:t=>t instanceof Touch?null:[t.movementX,t.movementY]};function o7(t={}){const{type:e="page",touch:n=!0,resetOnTouchEnds:r=!1,initialValue:a={x:0,y:0},window:i=Sr,target:o=i,eventFilter:l}=t,s=W(a.x),u=W(a.y),f=W(null),v=typeof e=="function"?e:i7[e],h=p=>{const y=v(p);y&&([s.value,u.value]=y,f.value="mouse")},g=p=>{if(p.touches.length>0){const y=v(p.touches[0]);y&&([s.value,u.value]=y,f.value="touch")}},c=()=>{s.value=a.x,u.value=a.y},d=l?p=>l(()=>h(p),{}):p=>h(p),m=l?p=>l(()=>g(p),{}):p=>g(p);return o&&(Pn(o,"mousemove",d,{passive:!0}),Pn(o,"dragover",d,{passive:!0}),n&&e!=="movement"&&(Pn(o,"touchstart",m,{passive:!0}),Pn(o,"touchmove",m,{passive:!0}),r&&Pn(o,"touchend",c,{passive:!0}))),{x:s,y:u,sourceType:f}}function $y(t,e={}){const{handleOutside:n=!0,window:r=Sr}=e,{x:a,y:i,sourceType:o}=o7(e),l=W(t??(r==null?void 0:r.document.body)),s=W(0),u=W(0),f=W(0),v=W(0),h=W(0),g=W(0),c=W(!0);let d=()=>{};return r&&(d=pe([l,a,i],()=>{const m=Hr(l);if(!m)return;const{left:p,top:y,width:b,height:w}=m.getBoundingClientRect();f.value=p+r.pageXOffset,v.value=y+r.pageYOffset,h.value=w,g.value=b;const C=a.value-f.value,_=i.value-v.value;c.value=b===0||w===0||C<0||_<0||C>b||_>w,(n||!c.value)&&(s.value=C,u.value=_)},{immediate:!0}),Pn(document,"mouseleave",()=>{c.value=!0})),{x:a,y:i,sourceType:o,elementX:s,elementY:u,elementPositionX:f,elementPositionY:v,elementHeight:h,elementWidth:g,isOutside:c,stop:d}}const l7={style:{position:"relative"}},s7=fe({__name:"edgeTrigger",props:{tabIdx:{}},setup(t){const e=t,n=Wo(),r=W(),a=W(),{isOutside:i}=$y(a),{isOutside:o}=$y(r),l=K(()=>!i.value&&!!n.dragingTab),s=K(()=>!o.value&&!!n.dragingTab&&!l.value),u=(f,v)=>{var g,c,d,m;const h=JSON.parse(((g=f.dataTransfer)==null?void 0:g.getData("text"))??"{}");if(console.log("on-drop",v,h),(h==null?void 0:h.from)==="tab-drag"){if(f.stopPropagation(),n.dragingTab=void 0,v==="insert"&&h.tabIdx===e.tabIdx)return;const p=n.tabList,y=p[h.tabIdx].panes[h.paneIdx];p[h.tabIdx].panes.splice(h.paneIdx,1),v==="add-right"?(p[e.tabIdx].key=((c=p[e.tabIdx].panes[h.paneIdx-1])==null?void 0:c.key)??p[e.tabIdx].panes[0].key,p.splice(e.tabIdx+1,0,{panes:[y],key:y.key,id:br()})):(p[h.tabIdx].key=((d=p[h.tabIdx].panes[h.paneIdx-1])==null?void 0:d.key)??((m=p[h.tabIdx].panes[0])==null?void 0:m.key),p[e.tabIdx].panes.push(y),p[e.tabIdx].key=y.key),p[h.tabIdx].panes.length===0&&p.splice(h.tabIdx,1)}};return(f,v)=>(Ye(),an("div",{class:wa(["wrap",{accept:s.value}]),ref_key:"trigger",ref:r,onDragover:v[2]||(v[2]=Ln(()=>{},["prevent"])),onDrop:v[3]||(v[3]=Ln(h=>u(h,"insert"),["prevent"]))},[xn("div",{class:wa(["trigger",{accept:l.value}]),ref_key:"edgeTrigger",ref:a,onDragover:v[0]||(v[0]=Ln(()=>{},["prevent"])),onDrop:v[1]||(v[1]=Ln(h=>u(h,"add-right"),["prevent"]))},null,34),xn("div",l7,[Wl(f.$slots,"default",{},void 0,!0)])],34))}});const uu=(t,e)=>{const n=t.__vccOpts||t;for(const[r,a]of e)n[r]=a;return n},u7=uu(s7,[["__scopeId","data-v-10c5aba4"]]);const z_=k_("useImgSliStore",()=>{const t=W(!1),e=W(!1),n=W(!1),r=W(),a=W(),i=Wo(),o=K(()=>{var s;const l=i.tabList;for(const u of l)if(((s=u.panes.find(f=>f.key===u.key))==null?void 0:s.type)==="img-sli")return!0;return!1});return{drawerVisible:e,fileDragging:t,left:r,right:a,imgSliActived:o,opened:n}}),c7=t=>(pb("data-v-279a61df"),t=t(),hb(),t),f7={key:0,class:"dragging-port-wrap"},d7={class:"content"},v7={key:0,class:"img-wrap"},p7={key:1},h7=c7(()=>xn("div",{style:{padding:"16px"}},null,-1)),m7={key:0,class:"img-wrap"},g7={key:1},y7={key:0,class:"tips",style:{"max-width":"30vw"}},b7={class:"actions"},w7=fe({__name:"DraggingPort",setup(t){const e=z_(),n=Wo(),{left:r,right:a}=az(e),i=async(s,u)=>{const f=sz(s);if(f){const v=f.nodes[0];if(!uz(v.name))return;e[u]=v}},o=()=>{e.left=void 0,e.right=void 0,e.opened=!1},l=()=>{e_(r.value&&a.value);const s={type:"img-sli",left:r.value,right:a.value,name:`${Ae("imgCompare")} ( ${r.value.name} vs ${a.value.name})`,key:br()};n.tabList[0].panes.push(s),n.tabList[0].key=s.key};return(s,u)=>{const f=bF,v=Tn;return Ye(),Xt(lr,null,{default:_t(()=>[(xe(e).fileDragging||xe(r)||xe(a)||xe(e).opened)&&!xe(e).imgSliActived?(Ye(),an("div",f7,[xn("h2",null,qn(s.$t("imgCompare")),1),xn("div",d7,[xn("div",{class:"left port",onDragover:u[1]||(u[1]=Ln(()=>{},["prevent"])),onDrop:u[2]||(u[2]=Ln(h=>i(h,"left"),["prevent"]))},[xe(r)?(Ye(),an("div",v7,[x(f,{src:xe(xy)(xe(r)),preview:{src:xe(vs)(xe(r))}},null,8,["src","preview"]),x(xe(Jl),{class:"close",onClick:u[0]||(u[0]=h=>r.value=void 0)})])):(Ye(),an("div",p7,qn(s.$t("dragImageHere")),1))],32),h7,xn("div",{class:"right port",onDragover:u[4]||(u[4]=Ln(()=>{},["prevent"])),onDrop:u[5]||(u[5]=Ln(h=>i(h,"right"),["prevent"]))},[xe(a)?(Ye(),an("div",m7,[x(f,{src:xe(xy)(xe(a)),preview:{src:xe(vs)(xe(a))}},null,8,["src","preview"]),x(xe(Jl),{class:"close",onClick:u[3]||(u[3]=h=>a.value=void 0)})])):(Ye(),an("div",g7,qn(s.$t("dragImageHere")),1))],32)]),xe(e).opened?(Ye(),an("p",y7," Tips: "+qn(s.$t("imageCompareTips")),1)):pa("",!0),xn("div",b7,[xe(r)&&xe(a)?(Ye(),Xt(v,{key:0,type:"primary",onClick:u[6]||(u[6]=h=>xe(e).drawerVisible=!0)},{default:_t(()=>[Fn(qn(s.$t("confirm")),1)]),_:1})):pa("",!0),xe(r)&&xe(a)?(Ye(),Xt(v,{key:1,type:"primary",onClick:l},{default:_t(()=>[Fn(qn(s.$t("confirm"))+"("+qn(s.$t("openInNewTab"))+")",1)]),_:1})):pa("",!0),x(v,{style:{"margin-left":"16px"},onClick:o},{default:_t(()=>[Fn(qn(s.$t("close")),1)]),_:1})])])):pa("",!0)]),_:1})}}});const C7=uu(w7,[["__scopeId","data-v-279a61df"]]),_7={class:"container"},S7=["src"],x7=fe({__name:"ImgSliSide",props:{side:{},containerWidth:{},img:{},maxEdge:{},percent:{}},setup(t){const e=t,n=K(()=>{let r="";const i=e.containerWidth;return e.side==="left"?r=`calc(50% - ${(e.percent-50)/100*i}px)`:r=`calc(-50% - ${(e.percent-50)/100*i+4}px)`,`${e.maxEdge==="width"?"width:100%":"height:100%"};transform: translate(${r}, -50%)`});return(r,a)=>(Ye(),an("div",_7,[xn("img",{class:wa(["img",[r.side]]),style:vi(n.value),src:xe(vs)(r.img),onDragstart:a[0]||(a[0]=Ln(()=>{},["prevent","stop"]))},null,46,S7)]))}});const Ry=uu(x7,[["__scopeId","data-v-65d66859"]]),P7=fe({__name:"ImgSliComparePane",props:{left:{},right:{}},setup(t,{expose:e}){const n=t,r=W(50),a=([{size:u}])=>{r.value=u},i=W(),{width:o}=a7(i);e({requestFullScreen:()=>{var u;(u=i.value)==null||u.requestFullscreen()}});const s=Fz(async()=>{if(!n.left)return"width";const u=await mz(vs(n.left)),f=u.width/u.height,v=document.body.clientWidth/document.body.clientHeight;return f>v?"width":"height"});return(u,f)=>(Ye(),an("div",{ref_key:"wrapperEl",ref:i,style:{height:"100%"}},[x(xe(R_),{class:"default-theme",onResize:a},{default:_t(()=>[u.left?(Ye(),Xt(xe(wf),{key:0},{default:_t(()=>[x(Ry,{side:"left","max-edge":xe(s),"container-width":xe(o),percent:r.value,img:u.left},null,8,["max-edge","container-width","percent","img"])]),_:1})):pa("",!0),u.right?(Ye(),Xt(xe(wf),{key:1},{default:_t(()=>[x(Ry,{"max-edge":xe(s),percent:r.value,img:u.right,side:"right","container-width":xe(o)},null,8,["max-edge","percent","img","container-width"])]),_:1})):pa("",!0)]),_:1})],512))}});const O7={class:"actions"},E7=fe({__name:"ImgSliDrawer",setup(t){const e=z_(),n=W();return(r,a)=>{const i=Tn,o=d4;return Ye(),an(De,null,[x(o,{width:"100vw",visible:xe(e).drawerVisible,"onUpdate:visible":a[2]||(a[2]=l=>xe(e).drawerVisible=l),"destroy-on-close":"",class:"img-sli","close-icon":null},{footer:_t(()=>[xn("div",O7,[x(i,{onClick:a[0]||(a[0]=l=>xe(e).drawerVisible=!1)},{default:_t(()=>[Fn(qn(r.$t("close")),1)]),_:1}),x(i,{onClick:a[1]||(a[1]=l=>{var s;return(s=n.value)==null?void 0:s.requestFullScreen()})},{default:_t(()=>[Fn(qn(r.$t("fullscreenview")),1)]),_:1})])]),default:_t(()=>[xe(e).left&&xe(e).right?(Ye(),Xt(P7,{key:0,ref_key:"splitpane",ref:n,left:xe(e).left,right:xe(e).right},null,8,["left","right"])):pa("",!0)]),_:1},8,["visible"]),x(C7)],64)}}});const T7=fe({__name:"SplitViewTab",setup(t){const e=Wo(),n={local:Ir(()=>mr(()=>import("./stackView-4838be5c.js"),["assets/stackView-4838be5c.js","assets/fullScreenContextMenu-c371385f.js","assets/FileItem-a4a4ada7.js","assets/db-328ec51d.js","assets/shortcut-6ab7aba6.js","assets/shortcut-9fed83c2.css","assets/FileItem-b5f62029.css","assets/fullScreenContextMenu-61d0bdb7.css","assets/numInput-0325e3d4.js","assets/numInput-a08c6857.css","assets/stackView-c5da5c16.css","assets/index-f4bbe4b8.css","assets/index-d55a76b1.css"])),empty:Ir(()=>mr(()=>import("./emptyStartup-a755d79c.js"),["assets/emptyStartup-a755d79c.js","assets/db-328ec51d.js","assets/emptyStartup-cf762322.css"])),"global-setting":Ir(()=>mr(()=>import("./globalSetting-96a71e1c.js"),["assets/globalSetting-96a71e1c.js","assets/numInput-0325e3d4.js","assets/shortcut-6ab7aba6.js","assets/shortcut-9fed83c2.css","assets/numInput-a08c6857.css","assets/globalSetting-81978e8e.css","assets/index-f4bbe4b8.css","assets/index-d55a76b1.css"])),"tag-search-matched-image-grid":Ir(()=>mr(()=>import("./MatchedImageGrid-bcc691aa.js"),["assets/MatchedImageGrid-bcc691aa.js","assets/fullScreenContextMenu-c371385f.js","assets/FileItem-a4a4ada7.js","assets/db-328ec51d.js","assets/shortcut-6ab7aba6.js","assets/shortcut-9fed83c2.css","assets/FileItem-b5f62029.css","assets/fullScreenContextMenu-61d0bdb7.css","assets/hook-cd0f6c09.js","assets/MatchedImageGrid-bdeb2907.css"])),"tag-search":Ir(()=>mr(()=>import("./TagSearch-2cc53223.js"),["assets/TagSearch-2cc53223.js","assets/db-328ec51d.js","assets/TagSearch-ffd782da.css","assets/index-f4bbe4b8.css","assets/index-d55a76b1.css"])),"fuzzy-search":Ir(()=>mr(()=>import("./SubstrSearch-10662b2a.js"),["assets/SubstrSearch-10662b2a.js","assets/fullScreenContextMenu-c371385f.js","assets/FileItem-a4a4ada7.js","assets/db-328ec51d.js","assets/shortcut-6ab7aba6.js","assets/shortcut-9fed83c2.css","assets/FileItem-b5f62029.css","assets/fullScreenContextMenu-61d0bdb7.css","assets/hook-cd0f6c09.js","assets/SubstrSearch-03c71861.css","assets/index-f4bbe4b8.css"])),"img-sli":Ir(()=>mr(()=>import("./ImgSliPagePane-088a359b.js"),[])),"batch-download":Ir(()=>mr(()=>import("./batchDownload-b6818413.js"),["assets/batchDownload-b6818413.js","assets/FileItem-a4a4ada7.js","assets/db-328ec51d.js","assets/shortcut-6ab7aba6.js","assets/shortcut-9fed83c2.css","assets/FileItem-b5f62029.css","assets/batchDownload-08be3fc5.css"]))},r=(o,l,s)=>{var f,v;const u=e.tabList[o];if(s==="add"){const h={type:"empty",key:br(),name:Ae("emptyStartPage")};u.panes.push(h),u.key=h.key}else{const h=u.panes.findIndex(g=>g.key===l);if(u.key===l&&(u.key=((f=u.panes[h-1])==null?void 0:f.key)??((v=u.panes[1])==null?void 0:v.key)),u.panes.splice(h,1),u.panes.length===0&&e.tabList.splice(o,1),e.tabList.length===0){const g=e.createEmptyPane();e.tabList.push({panes:[g],key:g.key,id:br()})}}},a=W();pe(()=>e.tabList,async()=>{var o;await Ke(),e.saveRecord(),Array.from(((o=a.value)==null?void 0:o.querySelectorAll(".splitpanes__pane"))??[]).forEach((l,s)=>{Array.from(l.querySelectorAll(".ant-tabs-tab")??[]).forEach((u,f)=>{const v=u;v.setAttribute("draggable","true"),v.setAttribute("tabIdx",s.toString()),v.setAttribute("paneIdx",f.toString()),v.ondragend=()=>{e.dragingTab=void 0},v.ondragstart=h=>{e.dragingTab={tabIdx:s,paneIdx:f},h.dataTransfer.setData("text/plain",JSON.stringify({tabIdx:s,paneIdx:f,from:"tab-drag"}))}})})},{immediate:!0,deep:!0});const i=qc(()=>$_.emit("returnToIIB"),100);return Oz(async()=>{const o=window.parent;if(!await dz(()=>o==null?void 0:o.onUiTabChange,200,3e4)){console.log("watch tab change failed");return}o.onUiTabChange(()=>{const l=o.get_uiCurrentTabContent();l!=null&&l.id.includes("infinite-image-browsing")&&i()})}),pe(Zz(),o=>o&&i()),(o,l)=>{const s=ls,u=Qi;return Ye(),an("div",{ref_key:"container",ref:a},[x(xe(R_),{class:"default-theme"},{default:_t(()=>[(Ye(!0),an(De,null,Xv(xe(e).tabList,(f,v)=>(Ye(),Xt(xe(wf),{key:f.id},{default:_t(()=>[x(u7,{tabIdx:v},{default:_t(()=>[x(u,{type:"editable-card",activeKey:f.key,"onUpdate:activeKey":h=>f.key=h,onEdit:(h,g)=>r(v,h,g)},{default:_t(()=>[(Ye(!0),an(De,null,Xv(f.panes,(h,g)=>(Ye(),Xt(s,{key:h.key,tab:h.name,class:"pane"},{default:_t(()=>[(Ye(),Xt(gx(n[h.type]),Gf({tabIdx:v,paneIdx:g},h),null,16,["tabIdx","paneIdx"]))]),_:2},1032,["tab"]))),128))]),_:2},1032,["activeKey","onUpdate:activeKey","onEdit"])]),_:2},1032,["tabIdx"])]),_:2},1024))),128))]),_:1}),x(E7)],512)}}});const I7=uu(T7,[["__scopeId","data-v-c479b9de"]]),A7=async t=>{var r;const e=(r=t.conf)==null?void 0:r.global_setting,n=new URLSearchParams(parent.location.search);switch(n.get("action")){case"open":{let a=n.get("path");if(!a||!e)return;const i={extra:e.outdir_extras_samples,save:e.outdir_save,txt2img:e.outdir_txt2img_samples,img2img:e.outdir_img2img_samples};i[a]&&(a=i[a]);const o=t.tabList[0],l={type:"local",path:a,key:br(),name:"",walkModePath:n.get("walk")?a:void 0};o.panes.unshift(l),o.key=l.key,fz(),hz(["action","path","walk"]);break}}};function Ly(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!nr(t)}const W_="app.conf.json",io=W(),V_=()=>Ao.writeFile(W_,JSON.stringify(ke(io.value),null,4)),M7=fe({setup(){const t=async()=>{const e=await S_({directory:!0});if(typeof e=="string"){if(!await Ao.exists(`${e}/config.json`))return ba.error(Ae("tauriLaunchConfMessages.configNotFound"));if(!await Ao.exists(`${e}/extensions/sd-webui-infinite-image-browsing`))return ba.error(Ae("tauriLaunchConfMessages.folderNotFound"));io.value.sdwebui_dir=e,ba.info(Ae("tauriLaunchConfMessages.configCompletedMessage")),await V_(),await lu("shutdown_api_server_command"),await ou(1500),await w_()}};return()=>{let e,n;return x("div",{style:{padding:"32px 0"}},[x("div",{style:{padding:"16px 0"}},[x("h2",null,[Ae("tauriLaunchConf.readSdWebuiConfigTitle")]),x("p",null,[Ae("tauriLaunchConf.readSdWebuiConfigDescription")]),x(Tn,{onClick:t,type:"primary"},Ly(e=Ae("tauriLaunchConf.selectSdWebuiFolder"))?e:{default:()=>[e]})]),x("div",{style:{padding:"16px 0"}},[x("h2",null,[Ae("tauriLaunchConf.skipThisConfigTitle")]),x("p",null,[Ae("tauriLaunchConf.skipThisConfigDescription")]),x(Tn,{type:"primary",onClick:Bt.destroyAll},Ly(n=Ae("tauriLaunchConf.skipButton"))?n:{default:()=>[n]})])])}}}),k7=async()=>{try{io.value=JSON.parse(await Ao.readTextFile(W_))}catch{}io.value||(io.value={sdwebui_dir:""},await V_(),Bt.info({title:Ae("tauriLaunchConfMessages.firstTimeUserTitle"),content:x(M7,null,null),width:"80vw",okText:Ae("tauriLaunchConf.skipButton"),okButtonProps:{onClick:Bt.destroyAll}}))},N7=!!{}.TAURI_ARCH,$7=fe({__name:"App",setup(t){const e=Wo(),n=pz();return Py("updateGlobalSetting",async()=>{await Hj(),console.log(ds.value);const r=await Gj();e.conf=r;const a=await Oy(r);e.quickMovePaths=a.filter(i=>{var o,l;return(l=(o=i==null?void 0:i.dir)==null?void 0:o.trim)==null?void 0:l.call(o)}),A7(e)}),Py("returnToIIB",async()=>{const r=e.conf;if(!r)return;const a=r.global_setting;if(!a.outdir_txt2img_samples&&!a.outdir_img2img_samples)return;const i=new Set(e.quickMovePaths.map(l=>l.key));if(i.has("outdir_txt2img_samples")&&i.has("outdir_img2img_samples"))return;const o=await Oy(r);e.quickMovePaths=o.filter(l=>{var s,u;return(u=(s=l==null?void 0:l.dir)==null?void 0:s.trim)==null?void 0:u.call(s)})}),Re(async()=>{N7&&k7(),$_.emit("updateGlobalSetting")}),(r,a)=>{const i=rn;return Ye(),Xt(i,{loading:!xe(n).isIdle},{default:_t(()=>[x(I7)]),_:1},8,["loading"])}}});function R7(t){return typeof t=="object"&&t!==null}function Dy(t,e){return t=R7(t)?t:Object.create(null),new Proxy(t,{get(n,r,a){return r==="key"?Reflect.get(n,r,a):Reflect.get(n,r,a)||Reflect.get(e,r,a)}})}function L7(t,e){return e.reduce((n,r)=>n==null?void 0:n[r],t)}function D7(t,e,n){return e.slice(0,-1).reduce((r,a)=>/^(__proto__)$/.test(a)?{}:r[a]=r[a]||{},t)[e[e.length-1]]=n,t}function F7(t,e){return e.reduce((n,r)=>{const a=r.split(".");return D7(n,a,L7(t,a))},{})}function Fy(t,{storage:e,serializer:n,key:r,debug:a}){try{const i=e==null?void 0:e.getItem(r);i&&t.$patch(n==null?void 0:n.deserialize(i))}catch(i){a&&console.error(i)}}function By(t,{storage:e,serializer:n,key:r,paths:a,debug:i}){try{const o=Array.isArray(a)?F7(t,a):t;e.setItem(r,n.serialize(o))}catch(o){i&&console.error(o)}}function B7(t={}){return e=>{const{auto:n=!1}=t,{options:{persist:r=n},store:a}=e;if(!r)return;const i=(Array.isArray(r)?r.map(o=>Dy(o,t)):[Dy(r,t)]).map(({storage:o=localStorage,beforeRestore:l=null,afterRestore:s=null,serializer:u={serialize:JSON.stringify,deserialize:JSON.parse},key:f=a.$id,paths:v=null,debug:h=!1})=>{var g;return{storage:o,beforeRestore:l,afterRestore:s,serializer:u,key:((g=t.key)!=null?g:c=>c)(f),paths:v,debug:h}});a.$persist=()=>{i.forEach(o=>{By(a.$state,o)})},a.$hydrate=({runHooks:o=!0}={})=>{i.forEach(l=>{const{beforeRestore:s,afterRestore:u}=l;o&&(s==null||s(e)),Fy(a,l),o&&(u==null||u(e))})},i.forEach(o=>{const{beforeRestore:l,afterRestore:s}=o;l==null||l(e),Fy(a,o),s==null||s(e),a.$subscribe((u,f)=>{By(f,o)},{detached:!0})})}}var j7=B7();const H_=Qj();H_.use(j7);AP($7).use(H_).use(wv).mount("#zanllp_dev_gradio_fe");const z7=Qz(),W7=()=>{try{return parent.location.search.includes("theme=dark")}catch{}return!1};pe([z7,W7],async([t,e])=>{await ou();const n=document.getElementsByTagName("html")[0];if(t||e){document.body.classList.add("dark");const r=document.createElement("style"),{default:a}=await mr(()=>import("./antd.dark-35e9b327.js"),[]);r.innerHTML=a,r.setAttribute("antd-dark",""),n.appendChild(r)}else document.body.classList.remove("dark"),Array.from(n.querySelectorAll("style[antd-dark]")).forEach(r=>r.remove())},{immediate:!0});export{W as $,Xv as A,vi as B,pa as C,xN as D,N7 as E,e9 as F,V7 as G,zx as H,L9 as I,R9 as J,H7 as K,vs as L,Vr as M,wa as N,as as O,J as P,rn as Q,Bt as R,t_ as S,GN as T,At as U,Tn as V,Po as W,uu as X,No as Y,gi as Z,ut as _,T as a,$n as a$,ge as a0,Ci as a1,ar as a2,yt as a3,Ns as a4,or as a5,Is as a6,lr as a7,yT as a8,_T as a9,t$ as aA,Ce as aB,qc as aC,D9 as aD,Vj as aE,Ao as aF,W_ as aG,w_ as aH,Xe as aI,r9 as aJ,ct as aK,rm as aL,Qe as aM,t9 as aN,mI as aO,MT as aP,nh as aQ,Tw as aR,KD as aS,Ds as aT,g$ as aU,Zf as aV,_e as aW,ho as aX,F$ as aY,vE as aZ,CP as a_,id as aa,fT as ab,q0 as ac,Y0 as ad,Jl as ae,vd as af,lt as ag,z_ as ah,Ae as ai,K as aj,XR as ak,br as al,e_ as am,Yc as an,S_ as ao,Kr as ap,qj as aq,ba as ar,$_ as as,pb as at,hb as au,Bf as av,Re as aw,Ke as ax,xt as ay,Yl as az,ze as b,P7 as b$,st as b0,cE as b1,Z7 as b2,mi as b3,ke as b4,V$ as b5,Id as b6,_o as b7,bw as b8,_$ as b9,Fa as bA,J7 as bB,UN as bC,ux as bD,G7 as bE,K7 as bF,Gf as bG,Hc as bH,X7 as bI,s0 as bJ,eC as bK,En as bL,Wn as bM,wC as bN,pz as bO,Py as bP,W9 as bQ,TN as bR,h4 as bS,Y7 as bT,hI as bU,l0 as bV,nr as bW,$9 as bX,U9 as bY,Zw as bZ,Oo as b_,C$ as ba,WR as bb,NR as bc,SC as bd,rr as be,Kd as bf,Us as bg,Do as bh,TO as bi,VR as bj,Ks as bk,CL as bl,kl as bm,rt as bn,Nt as bo,B2 as bp,Jt as bq,Q7 as br,Jw as bs,Qw as bt,Dw as bu,Le as bv,Gt as bw,Sn as bx,Iw as by,kO as bz,x as c,az as c0,sz as c1,Si as c2,r$ as c3,VN as c4,JN as c5,BN as c6,n9 as c7,zn as c8,Ed as c9,QS as cA,Cs as cB,DS as cC,_b as cD,yx as cE,Wl as cF,gx as cG,U7 as cH,Gc as cI,q7 as cJ,xy as cK,bF as cL,Xf as cM,Tm as cN,_d as ca,lb as cb,bt as cc,kT as cd,sd as ce,yz as cf,k_ as cg,my as ch,B9 as ci,Av as cj,F9 as ck,uz as cl,J1 as cm,ou as cn,gz as co,V9 as cp,di as cq,a7 as cr,$y as cs,H9 as ct,Q1 as cu,bz as cv,j9 as cw,k9 as cx,aI as cy,N9 as cz,fe as d,jn as e,pn as f,Wr as g,te as h,He as i,Bd as j,Wo as k,pe as l,Xt as m,_t as n,Ye as o,xn as p,Ln as q,xe as r,tt as s,z9 as t,Ze as u,qn as v,ks as w,Fn as x,an as y,De as z}; + */let T_;const su=t=>T_=t,I_=Symbol();function yf(t){return t&&typeof t=="object"&&Object.prototype.toString.call(t)==="[object Object]"&&typeof t.toJSON!="function"}var ro;(function(t){t.direct="direct",t.patchObject="patch object",t.patchFunction="patch function"})(ro||(ro={}));function Qj(){const t=Of(!0),e=t.run(()=>W({}));let n=[],r=[];const a=Cs({install(i){su(a),a._a=i,i.provide(I_,a),i.config.globalProperties.$pinia=a,r.forEach(o=>n.push(o)),r=[]},use(i){return!this._a&&!Jj?r.push(i):n.push(i),this},_p:n,_a:null,_e:t,_s:new Map,state:e});return a}const A_=()=>{};function Sy(t,e,n,r=A_){t.push(e);const a=()=>{const i=t.indexOf(e);i>-1&&(t.splice(i,1),r())};return!n&&Ef()&&Gy(a),a}function Da(t,...e){t.slice().forEach(n=>{n(...e)})}const Zj=t=>t();function bf(t,e){t instanceof Map&&e instanceof Map&&e.forEach((n,r)=>t.set(r,n)),t instanceof Set&&e instanceof Set&&e.forEach(t.add,t);for(const n in e){if(!e.hasOwnProperty(n))continue;const r=e[n],a=t[n];yf(a)&&yf(r)&&t.hasOwnProperty(n)&&!tt(r)&&!wr(r)?t[n]=bf(a,r):t[n]=r}return t}const ez=Symbol();function tz(t){return!yf(t)||!t.hasOwnProperty(ez)}const{assign:Rr}=Object;function nz(t){return!!(tt(t)&&t.effect)}function rz(t,e,n,r){const{state:a,actions:i,getters:o}=e,l=n.state.value[t];let s;function u(){l||(n.state.value[t]=a?a():{});const f=lb(n.state.value[t]);return Rr(f,i,Object.keys(o||{}).reduce((v,h)=>(v[h]=Cs(K(()=>{su(n);const g=n._s.get(t);return o[h].call(g,g)})),v),{}))}return s=M_(t,u,e,n,r,!0),s}function M_(t,e,n={},r,a,i){let o;const l=Rr({actions:{}},n),s={deep:!0};let u,f,v=[],h=[],g;const c=r.state.value[t];!i&&!c&&(r.state.value[t]={}),W({});let d;function m(I){let P;u=f=!1,typeof I=="function"?(I(r.state.value[t]),P={type:ro.patchFunction,storeId:t,events:g}):(bf(r.state.value[t],I),P={type:ro.patchObject,payload:I,storeId:t,events:g});const k=d=Symbol();Ke().then(()=>{d===k&&(u=!0)}),f=!0,Da(v,P,r.state.value[t])}const p=i?function(){const{state:P}=n,k=P?P():{};this.$patch(L=>{Rr(L,k)})}:A_;function y(){o.stop(),v=[],h=[],r._s.delete(t)}function b(I,P){return function(){su(r);const k=Array.from(arguments),L=[],F=[];function j(M){L.push(M)}function z(M){F.push(M)}Da(h,{args:k,name:I,store:C,after:j,onError:z});let $;try{$=P.apply(this&&this.$id===t?this:C,k)}catch(M){throw Da(F,M),M}return $ instanceof Promise?$.then(M=>(Da(L,M),M)).catch(M=>(Da(F,M),Promise.reject(M))):(Da(L,$),$)}}const w={_p:r,$id:t,$onAction:Sy.bind(null,h),$patch:m,$reset:p,$subscribe(I,P={}){const k=Sy(v,I,P.detached,()=>L()),L=o.run(()=>pe(()=>r.state.value[t],F=>{(P.flush==="sync"?f:u)&&I({storeId:t,type:ro.direct,events:g},F)},Rr({},s,P)));return k},$dispose:y},C=rt(w);r._s.set(t,C);const _=r._a&&r._a.runWithContext||Zj,O=r._e.run(()=>(o=Of(),_(()=>o.run(e))));for(const I in O){const P=O[I];if(tt(P)&&!nz(P)||wr(P))i||(c&&tz(P)&&(tt(P)?P.value=c[I]:bf(P,c[I])),r.state.value[t][I]=P);else if(typeof P=="function"){const k=b(I,P);O[I]=k,l.actions[I]=P}}return Rr(C,O),Rr(ke(C),O),Object.defineProperty(C,"$state",{get:()=>r.state.value[t],set:I=>{m(P=>{Rr(P,I)})}}),r._p.forEach(I=>{Rr(C,o.run(()=>I({store:C,app:r._a,pinia:r,options:l})))}),c&&i&&n.hydrate&&n.hydrate(C.$state,c),u=!0,f=!0,C}function k_(t,e,n){let r,a;const i=typeof e=="function";typeof t=="string"?(r=t,a=i?n:e):(a=t,r=t.id);function o(l,s){const u=Ex();return l=l||(u?Xe(I_,null):null),l&&su(l),l=T_,l._s.has(r)||(i?M_(r,e,a,l):rz(r,a,l)),l._s.get(r)}return o.$id=r,o}function az(t){{t=ke(t);const e={};for(const n in t){const r=t[n];(tt(r)||wr(r))&&(e[n]=Kt(t,n))}return e}}const iz=t=>Yc({...t,name:typeof t.name=="string"?t.name:t.nameFallbackStr??""}),oz=t=>({...t,panes:t.panes.map(iz)}),Wo=k_("useGlobalStore",()=>{const t=W(),e=W([]),n=W(!0),r=W(512),a=W(Av.CREATED_TIME_DESC),i=W(256),o=()=>({type:"empty",name:Ae("emptyStartPage"),key:br()}),l=W([]);Re(()=>{const b=o();l.value.push({panes:[b],key:b.key,id:br()})});const s=W(),u=W(new Array),f=Date.now(),v=W(),h=()=>{var w;const b=ke(l.value).map(oz);((w=v.value)==null?void 0:w[0].time)!==f?v.value=[{tabs:b,time:f},...v.value??[]]:v.value[0].tabs=b,v.value=v.value.slice(0,2)},g=async(b,w,C)=>{let _=l.value.map(I=>I.panes).flat().find(I=>I.type==="tag-search-matched-image-grid"&&I.id===w);if(_){_.selectedTagIds=Yc(C);return}else _={type:"tag-search-matched-image-grid",id:w,selectedTagIds:Yc(C),key:br(),name:Ae("searchResults")};const O=l.value[b+1];O?(O.key=_.key,O.panes.push(_)):l.value.push({panes:[_],key:_.key,id:br()})},c=W(Y1());pe(c,b=>wv.global.locale.value=b);const d=W(!1),m=W({delete:""}),p=K(()=>{const b=["outdir_extras_samples","outdir_save","outdir_txt2img_samples","outdir_img2img_samples","outdir_img2img_grids","outdir_txt2img_grids"],w=e.value.filter(C=>b.includes(C.key)).map(C=>[C.zh,C.dir]);return Object.fromEntries(w)}),y=rt({deleteOneOnly:!1});return{defaultSortingMethod:a,defaultGridCellWidth:i,pathAliasMap:p,createEmptyPane:o,lang:c,tabList:l,conf:t,quickMovePaths:e,enableThumbnail:n,dragingTab:s,saveRecord:h,recent:u,tabListHistoryRecord:v,gridThumbnailResolution:r,longPressOpenContextMenu:d,openTagSearchMatchedImageGridInRight:g,onlyFoldersAndImages:W(!0),fullscreenPreviewInitialUrl:W(""),shortcut:m,dontShowAgain:W(!1),dontShowAgainNewImgOpts:W(!1),ignoredConfirmActions:y}},{persist:{paths:["dontShowAgainNewImgOpts","defaultSortingMethod","defaultGridCellWidth","dontShowAgain","lang","enableThumbnail","tabListHistoryRecord","recent","gridThumbnailResolution","longPressOpenContextMenu","onlyFoldersAndImages","shortcut","ignoredConfirmActions"]}}),ao=encodeURIComponent,vs=(t,e=!1)=>`${Iv.value}/file?path=${ao(t.fullpath)}&t=${ao(t.date)}${e?`&disposition=${ao(t.name)}`:""}`,xy=(t,e="512x512")=>`${Iv.value}/image-thumbnail?path=${ao(t.fullpath)}&size=${e}&t=${ao(t.date)}`,lz=t=>typeof t=="object"&&t.__id==="FileTransferData",sz=t=>{var n;const e=JSON.parse(((n=t.dataTransfer)==null?void 0:n.getData("text"))??"{}");return lz(e)?e:null},B9=t=>Q1(t,"fullpath");function uz(t){var r;if(typeof t!="string")return!1;const e=[".jpg",".jpeg",".png",".gif",".bmp",".webp"],n=(r=t.split(".").pop())==null?void 0:r.toLowerCase();return n!==void 0&&e.includes(`.${n}`)}function j9(t){const e=document.createElement("a");e.style.display="none",document.body.appendChild(e),t.forEach(n=>{e.href=n,e.download="",e.click()}),document.body.removeChild(e)}function N_(){try{return parent.window.gradioApp()}catch{}const t=parent.document.getElementsByTagName("gradio-app"),e=t.length==0?null:t[0].shadowRoot;return e||document}const cz=()=>{const t=N_().querySelectorAll("#tabs > .tabitem[id^=tab_]");return Array.from(t).findIndex(e=>e.id.includes("infinite-image-browsing"))},fz=()=>{try{N_().querySelector("#tabs").querySelectorAll("button")[cz()].click()}catch(t){console.error(t)}},dz=async(t,e=100,n=1e3)=>new Promise(r=>{const a=(i=0)=>{const o=t();o!=null||i>n/e?r(o):setTimeout(()=>a(++i),e)};a()}),vz=(t,...e)=>e.reduce((n,r)=>(n[r]=t==null?void 0:t[r],n),{}),pz=()=>rt(new Io(-1,0,-1,"throw")),z9=async(t,e)=>{try{if(navigator.clipboard)await navigator.clipboard.writeText(t);else{const n=document.createElement("input");n.value=t,document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n)}ba.success(e??Ae("copied"))}catch{ba.error("copy failed. maybe it's non-secure environment")}},{useEventListen:Py,eventEmitter:$_}=J1();function W9(t){let e=null,n=!1;return async function(...r){if(n)return e;n=!0;try{return e=t.apply(this,r),await e}finally{n=!1}}}function hz(t){const e=parent.location.href,n=new URLSearchParams(parent.location.search);t.forEach(a=>{n.delete(a)});const r=`${e.split("?")[0]}${n.size?"?":""}${n.toString()}`;return parent.history.pushState(null,"",r),r}const mz=t=>new Promise((e,n)=>{const r=new Image;r.onload=()=>e(r),r.onerror=a=>n(a),r.src=t});function gz(t){return!!/^(?:\/|[a-z]:\/)/i.test(di(t))}function di(t){if(!t)return"";t=t.replace(/\\/g,"/"),t=t.replace(/\/+/g,"/");const e=t.split("/"),n=[];for(let i=0;i{const n=gz(t)?t:di(yz(e,t));return di(n)},V9=t=>{t=di(t);const e=t.split("/").filter(n=>n);return e[0].endsWith(":")&&(e[0]=e[0]+"/"),e},Oy=async({global_setting:t,sd_cwd:e,home:n,extra_paths:r,cwd:a})=>{const o={...vz(t,"outdir_grids","outdir_extras_samples","outdir_img2img_grids","outdir_img2img_samples","outdir_grids","outdir_extras_samples","outdir_samples","outdir_txt2img_grids","outdir_txt2img_samples","outdir_save"),cwd:e,home:n,desktop:`${n}/Desktop`};Object.keys(o).forEach(h=>{const g=h;if(o[g])try{o[g]=bz(o[g],e)}catch(c){console.error(c)}});const l=await qj(Object.values(o).filter(h=>h)),s={outdir_txt2img_samples:Ae("t2i"),outdir_img2img_samples:Ae("i2i"),outdir_save:Ae("saveButtonSavesTo"),outdir_extras_samples:Ae("extra"),outdir_grids:Ae("gridImage"),outdir_img2img_grids:Ae("i2i-grid"),outdir_samples:Ae("image"),outdir_txt2img_grids:Ae("t2i-grid"),cwd:Ae("workingFolder"),home:"home",desktop:Ae("desktop")},u={home:n,[Ae("desktop")]:o.desktop,[Ae("workingFolder")]:a,[Ae("t2i")]:o.outdir_txt2img_samples,[Ae("i2i")]:o.outdir_img2img_samples},f=h=>{h=di(h);const g=[];for(const[c,d]of Object.entries(u))c&&d&&g.push(h.replace(d,"$"+c));return g.sort((c,d)=>c.length-d.length)[0]},v=Object.keys(s).filter(h=>l[o[h]]).map(h=>{const g=h;return{key:g,zh:s[g],dir:o[g],can_delete:!1}}).concat(r.map(h=>({key:h.path,zh:f(h.path),dir:h.path,can_delete:!0})));return Q1(v,"key")};const R_={name:"splitpanes",emits:["ready","resize","resized","pane-click","pane-maximize","pane-add","pane-remove","splitter-click"],props:{horizontal:{type:Boolean},pushOtherPanes:{type:Boolean,default:!0},dblClickSplitter:{type:Boolean,default:!0},rtl:{type:Boolean,default:!1},firstSplitter:{type:Boolean}},provide(){return{requestUpdate:this.requestUpdate,onPaneAdd:this.onPaneAdd,onPaneRemove:this.onPaneRemove,onPaneClick:this.onPaneClick}},data:()=>({container:null,ready:!1,panes:[],touch:{mouseDown:!1,dragging:!1,activeSplitter:null},splitterTaps:{splitter:null,timeoutId:null}}),computed:{panesCount(){return this.panes.length},indexedPanes(){return this.panes.reduce((t,e)=>(t[e.id]=e)&&t,{})}},methods:{updatePaneComponents(){this.panes.forEach(t=>{t.update&&t.update({[this.horizontal?"height":"width"]:`${this.indexedPanes[t.id].size}%`})})},bindEvents(){document.addEventListener("mousemove",this.onMouseMove,{passive:!1}),document.addEventListener("mouseup",this.onMouseUp),"ontouchstart"in window&&(document.addEventListener("touchmove",this.onMouseMove,{passive:!1}),document.addEventListener("touchend",this.onMouseUp))},unbindEvents(){document.removeEventListener("mousemove",this.onMouseMove,{passive:!1}),document.removeEventListener("mouseup",this.onMouseUp),"ontouchstart"in window&&(document.removeEventListener("touchmove",this.onMouseMove,{passive:!1}),document.removeEventListener("touchend",this.onMouseUp))},onMouseDown(t,e){this.bindEvents(),this.touch.mouseDown=!0,this.touch.activeSplitter=e},onMouseMove(t){this.touch.mouseDown&&(t.preventDefault(),this.touch.dragging=!0,this.calculatePanesSize(this.getCurrentMouseDrag(t)),this.$emit("resize",this.panes.map(e=>({min:e.min,max:e.max,size:e.size}))))},onMouseUp(){this.touch.dragging&&this.$emit("resized",this.panes.map(t=>({min:t.min,max:t.max,size:t.size}))),this.touch.mouseDown=!1,setTimeout(()=>{this.touch.dragging=!1,this.unbindEvents()},100)},onSplitterClick(t,e){"ontouchstart"in window&&(t.preventDefault(),this.dblClickSplitter&&(this.splitterTaps.splitter===e?(clearTimeout(this.splitterTaps.timeoutId),this.splitterTaps.timeoutId=null,this.onSplitterDblClick(t,e),this.splitterTaps.splitter=null):(this.splitterTaps.splitter=e,this.splitterTaps.timeoutId=setTimeout(()=>{this.splitterTaps.splitter=null},500)))),this.touch.dragging||this.$emit("splitter-click",this.panes[e])},onSplitterDblClick(t,e){let n=0;this.panes=this.panes.map((r,a)=>(r.size=a===e?r.max:r.min,a!==e&&(n+=r.min),r)),this.panes[e].size-=n,this.$emit("pane-maximize",this.panes[e]),this.$emit("resized",this.panes.map(r=>({min:r.min,max:r.max,size:r.size})))},onPaneClick(t,e){this.$emit("pane-click",this.indexedPanes[e])},getCurrentMouseDrag(t){const e=this.container.getBoundingClientRect(),{clientX:n,clientY:r}="ontouchstart"in window&&t.touches?t.touches[0]:t;return{x:n-e.left,y:r-e.top}},getCurrentDragPercentage(t){t=t[this.horizontal?"y":"x"];const e=this.container[this.horizontal?"clientHeight":"clientWidth"];return this.rtl&&!this.horizontal&&(t=e-t),t*100/e},calculatePanesSize(t){const e=this.touch.activeSplitter;let n={prevPanesSize:this.sumPrevPanesSize(e),nextPanesSize:this.sumNextPanesSize(e),prevReachedMinPanes:0,nextReachedMinPanes:0};const r=0+(this.pushOtherPanes?0:n.prevPanesSize),a=100-(this.pushOtherPanes?0:n.nextPanesSize),i=Math.max(Math.min(this.getCurrentDragPercentage(t),a),r);let o=[e,e+1],l=this.panes[o[0]]||null,s=this.panes[o[1]]||null;const u=l.max<100&&i>=l.max+n.prevPanesSize,f=s.max<100&&i<=100-(s.max+this.sumNextPanesSize(e+1));if(u||f){u?(l.size=l.max,s.size=Math.max(100-l.max-n.prevPanesSize-n.nextPanesSize,0)):(l.size=Math.max(100-s.max-n.prevPanesSize-this.sumNextPanesSize(e+1),0),s.size=s.max);return}if(this.pushOtherPanes){const v=this.doPushOtherPanes(n,i);if(!v)return;({sums:n,panesToResize:o}=v),l=this.panes[o[0]]||null,s=this.panes[o[1]]||null}l!==null&&(l.size=Math.min(Math.max(i-n.prevPanesSize-n.prevReachedMinPanes,l.min),l.max)),s!==null&&(s.size=Math.min(Math.max(100-i-n.nextPanesSize-n.nextReachedMinPanes,s.min),s.max))},doPushOtherPanes(t,e){const n=this.touch.activeSplitter,r=[n,n+1];return e{i>r[0]&&i<=n&&(a.size=a.min,t.prevReachedMinPanes+=a.min)}),t.prevPanesSize=this.sumPrevPanesSize(r[0]),r[0]===void 0)?(t.prevReachedMinPanes=0,this.panes[0].size=this.panes[0].min,this.panes.forEach((a,i)=>{i>0&&i<=n&&(a.size=a.min,t.prevReachedMinPanes+=a.min)}),this.panes[r[1]].size=100-t.prevReachedMinPanes-this.panes[0].min-t.prevPanesSize-t.nextPanesSize,null):e>100-t.nextPanesSize-this.panes[r[1]].min&&(r[1]=this.findNextExpandedPane(n).index,t.nextReachedMinPanes=0,r[1]>n+1&&this.panes.forEach((a,i)=>{i>n&&i{i=n+1&&(a.size=a.min,t.nextReachedMinPanes+=a.min)}),this.panes[r[0]].size=100-t.prevPanesSize-t.nextReachedMinPanes-this.panes[this.panesCount-1].min-t.nextPanesSize,null):{sums:t,panesToResize:r}},sumPrevPanesSize(t){return this.panes.reduce((e,n,r)=>e+(re+(r>t+1?n.size:0),0)},findPrevExpandedPane(t){return[...this.panes].reverse().find(e=>e.indexe.min)||{}},findNextExpandedPane(t){return this.panes.find(e=>e.index>t+1&&e.size>e.min)||{}},checkSplitpanesNodes(){Array.from(this.container.children).forEach(t=>{const e=t.classList.contains("splitpanes__pane"),n=t.classList.contains("splitpanes__splitter");!e&&!n&&(t.parentNode.removeChild(t),console.warn("Splitpanes: Only elements are allowed at the root of . One of your DOM nodes was removed."))})},addSplitter(t,e,n=!1){const r=t-1,a=document.createElement("div");a.classList.add("splitpanes__splitter"),n||(a.onmousedown=i=>this.onMouseDown(i,r),typeof window<"u"&&"ontouchstart"in window&&(a.ontouchstart=i=>this.onMouseDown(i,r)),a.onclick=i=>this.onSplitterClick(i,r+1)),this.dblClickSplitter&&(a.ondblclick=i=>this.onSplitterDblClick(i,r+1)),e.parentNode.insertBefore(a,e)},removeSplitter(t){t.onmousedown=void 0,t.onclick=void 0,t.ondblclick=void 0,t.parentNode.removeChild(t)},redoSplitters(){const t=Array.from(this.container.children);t.forEach(n=>{n.className.includes("splitpanes__splitter")&&this.removeSplitter(n)});let e=0;t.forEach(n=>{n.className.includes("splitpanes__pane")&&(!e&&this.firstSplitter?this.addSplitter(e,n,!0):e&&this.addSplitter(e,n),e++)})},requestUpdate({target:t,...e}){const n=this.indexedPanes[t._.uid];Object.entries(e).forEach(([r,a])=>n[r]=a)},onPaneAdd(t){let e=-1;Array.from(t.$el.parentNode.children).some(a=>(a.className.includes("splitpanes__pane")&&e++,a===t.$el));const n=parseFloat(t.minSize),r=parseFloat(t.maxSize);this.panes.splice(e,0,{id:t._.uid,index:e,min:isNaN(n)?0:n,max:isNaN(r)?100:r,size:t.size===null?null:parseFloat(t.size),givenSize:t.size,update:t.update}),this.panes.forEach((a,i)=>a.index=i),this.ready&&this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({addedPane:this.panes[e]}),this.$emit("pane-add",{index:e,panes:this.panes.map(a=>({min:a.min,max:a.max,size:a.size}))})})},onPaneRemove(t){const e=this.panes.findIndex(r=>r.id===t._.uid),n=this.panes.splice(e,1)[0];this.panes.forEach((r,a)=>r.index=a),this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({removedPane:{...n,index:e}}),this.$emit("pane-remove",{removed:n,panes:this.panes.map(r=>({min:r.min,max:r.max,size:r.size}))})})},resetPaneSizes(t={}){!t.addedPane&&!t.removedPane?this.initialPanesSizing():this.panes.some(e=>e.givenSize!==null||e.min||e.max<100)?this.equalizeAfterAddOrRemove(t):this.equalize(),this.ready&&this.$emit("resized",this.panes.map(e=>({min:e.min,max:e.max,size:e.size})))},equalize(){const t=100/this.panesCount;let e=0;const n=[],r=[];this.panes.forEach(a=>{a.size=Math.max(Math.min(t,a.max),a.min),e-=a.size,a.size>=a.max&&n.push(a.id),a.size<=a.min&&r.push(a.id)}),e>.1&&this.readjustSizes(e,n,r)},initialPanesSizing(){let t=100;const e=[],n=[];let r=0;this.panes.forEach(i=>{t-=i.size,i.size!==null&&r++,i.size>=i.max&&e.push(i.id),i.size<=i.min&&n.push(i.id)});let a=100;t>.1&&(this.panes.forEach(i=>{i.size===null&&(i.size=Math.max(Math.min(t/(this.panesCount-r),i.max),i.min)),a-=i.size}),a>.1&&this.readjustSizes(t,e,n))},equalizeAfterAddOrRemove({addedPane:t,removedPane:e}={}){let n=100/this.panesCount,r=0;const a=[],i=[];t&&t.givenSize!==null&&(n=(100-t.givenSize)/(this.panesCount-1)),this.panes.forEach(o=>{r-=o.size,o.size>=o.max&&a.push(o.id),o.size<=o.min&&i.push(o.id)}),!(Math.abs(r)<.1)&&(this.panes.forEach(o=>{t&&t.givenSize!==null&&t.id===o.id||(o.size=Math.max(Math.min(n,o.max),o.min)),r-=o.size,o.size>=o.max&&a.push(o.id),o.size<=o.min&&i.push(o.id)}),r>.1&&this.readjustSizes(r,a,i))},readjustSizes(t,e,n){let r;t>0?r=t/(this.panesCount-e.length):r=t/(this.panesCount-n.length),this.panes.forEach((a,i)=>{if(t>0&&!e.includes(a.id)){const o=Math.max(Math.min(a.size+r,a.max),a.min),l=o-a.size;t-=l,a.size=o}else if(!n.includes(a.id)){const o=Math.max(Math.min(a.size+r,a.max),a.min),l=o-a.size;t-=l,a.size=o}a.update({[this.horizontal?"height":"width"]:`${this.indexedPanes[a.id].size}%`})}),Math.abs(t)>.1&&this.$nextTick(()=>{this.ready&&console.warn("Splitpanes: Could not resize panes correctly due to their constraints.")})}},watch:{panes:{deep:!0,immediate:!1,handler(){this.updatePaneComponents()}},horizontal(){this.updatePaneComponents()},firstSplitter(){this.redoSplitters()},dblClickSplitter(t){[...this.container.querySelectorAll(".splitpanes__splitter")].forEach((e,n)=>{e.ondblclick=t?r=>this.onSplitterDblClick(r,n):void 0})}},beforeUnmount(){this.ready=!1},mounted(){this.container=this.$refs.container,this.checkSplitpanesNodes(),this.redoSplitters(),this.resetPaneSizes(),this.$emit("ready"),this.ready=!0},render(){return Kr("div",{ref:"container",class:["splitpanes",`splitpanes--${this.horizontal?"horizontal":"vertical"}`,{"splitpanes--dragging":this.touch.dragging}]},this.$slots.default())}},wz=(t,e)=>{const n=t.__vccOpts||t;for(const[r,a]of e)n[r]=a;return n},Cz={name:"pane",inject:["requestUpdate","onPaneAdd","onPaneRemove","onPaneClick"],props:{size:{type:[Number,String],default:null},minSize:{type:[Number,String],default:0},maxSize:{type:[Number,String],default:100}},data:()=>({style:{}}),mounted(){this.onPaneAdd(this)},beforeUnmount(){this.onPaneRemove(this)},methods:{update(t){this.style=t}},computed:{sizeNumber(){return this.size||this.size===0?parseFloat(this.size):null},minSizeNumber(){return parseFloat(this.minSize)},maxSizeNumber(){return parseFloat(this.maxSize)}},watch:{sizeNumber(t){this.requestUpdate({target:this,size:t})},minSizeNumber(t){this.requestUpdate({target:this,min:t})},maxSizeNumber(t){this.requestUpdate({target:this,max:t})}}};function _z(t,e,n,r,a,i){return Ye(),an("div",{class:"splitpanes__pane",onClick:e[0]||(e[0]=o=>i.onPaneClick(o,t._.uid)),style:vi(t.style)},[Wl(t.$slots,"default")],4)}const wf=wz(Cz,[["render",_z]]);function Mv(t){return Ef()?(Gy(t),!0):!1}function kv(t){return typeof t=="function"?t():xe(t)}const L_=typeof window<"u",Nv=()=>{};function Sz(t,e){function n(...r){return new Promise((a,i)=>{Promise.resolve(t(()=>e.apply(this,r),{fn:e,thisArg:this,args:r})).then(a).catch(i)})}return n}const D_=t=>t();function xz(t=D_){const e=W(!0);function n(){e.value=!1}function r(){e.value=!0}const a=(...i)=>{e.value&&t(...i)};return{isActive:ws(e),pause:n,resume:r,eventFilter:a}}function Pz(...t){if(t.length!==1)return Kt(...t);const e=t[0];return typeof e=="function"?ws(zS(()=>({get:e,set:Nv}))):W(e)}function Oz(t,e=!0){bt()?Re(t):e?t():Ke(t)}var Ey=Object.getOwnPropertySymbols,Ez=Object.prototype.hasOwnProperty,Tz=Object.prototype.propertyIsEnumerable,Iz=(t,e)=>{var n={};for(var r in t)Ez.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&Ey)for(var r of Ey(t))e.indexOf(r)<0&&Tz.call(t,r)&&(n[r]=t[r]);return n};function Az(t,e,n={}){const r=n,{eventFilter:a=D_}=r,i=Iz(r,["eventFilter"]);return pe(t,Sz(a,e),i)}var Mz=Object.defineProperty,kz=Object.defineProperties,Nz=Object.getOwnPropertyDescriptors,ps=Object.getOwnPropertySymbols,F_=Object.prototype.hasOwnProperty,B_=Object.prototype.propertyIsEnumerable,Ty=(t,e,n)=>e in t?Mz(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,$z=(t,e)=>{for(var n in e||(e={}))F_.call(e,n)&&Ty(t,n,e[n]);if(ps)for(var n of ps(e))B_.call(e,n)&&Ty(t,n,e[n]);return t},Rz=(t,e)=>kz(t,Nz(e)),Lz=(t,e)=>{var n={};for(var r in t)F_.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&ps)for(var r of ps(t))e.indexOf(r)<0&&B_.call(t,r)&&(n[r]=t[r]);return n};function Dz(t,e,n={}){const r=n,{eventFilter:a}=r,i=Lz(r,["eventFilter"]),{eventFilter:o,pause:l,resume:s,isActive:u}=xz(a);return{stop:Az(t,e,Rz($z({},i),{eventFilter:o})),pause:l,resume:s,isActive:u}}function Fz(t,e,n){let r;tt(n)?r={evaluating:n}:r=n||{};const{lazy:a=!1,evaluating:i=void 0,shallow:o=!0,onError:l=Nv}=r,s=W(!a),u=o?$n(e):W(e);let f=0;return st(async v=>{if(!s.value)return;f++;const h=f;let g=!1;i&&Promise.resolve().then(()=>{i.value=!0});try{const c=await t(d=>{v(()=>{i&&(i.value=!1),g||d()})});h===f&&(u.value=c)}catch(c){l(c)}finally{i&&h===f&&(i.value=!1),g=!0}}),a?K(()=>(s.value=!0,u.value)):u}function Hr(t){var e;const n=kv(t);return(e=n==null?void 0:n.$el)!=null?e:n}const Sr=L_?window:void 0,Bz=L_?window.document:void 0;function Pn(...t){let e,n,r,a;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,r,a]=t,e=Sr):[e,n,r,a]=t,!e)return Nv;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);const i=[],o=()=>{i.forEach(f=>f()),i.length=0},l=(f,v,h,g)=>(f.addEventListener(v,h,g),()=>f.removeEventListener(v,h,g)),s=pe(()=>[Hr(e),kv(a)],([f,v])=>{o(),f&&i.push(...n.flatMap(h=>r.map(g=>l(f,h,g,v))))},{immediate:!0,flush:"post"}),u=()=>{s(),o()};return Mv(u),u}const jz=500;function H9(t,e,n){var r,a;const i=K(()=>Hr(t));let o;function l(){o&&(clearTimeout(o),o=void 0)}function s(f){var v,h,g,c;(v=n==null?void 0:n.modifiers)!=null&&v.self&&f.target!==i.value||(l(),(h=n==null?void 0:n.modifiers)!=null&&h.prevent&&f.preventDefault(),(g=n==null?void 0:n.modifiers)!=null&&g.stop&&f.stopPropagation(),o=setTimeout(()=>e(f),(c=n==null?void 0:n.delay)!=null?c:jz))}const u={capture:(r=n==null?void 0:n.modifiers)==null?void 0:r.capture,once:(a=n==null?void 0:n.modifiers)==null?void 0:a.once};Pn(i,"pointerdown",s,u),Pn(i,"pointerup",l,u),Pn(i,"pointerleave",l,u)}function zz(){const t=W(!1);return bt()&&Re(()=>{t.value=!0}),t}function j_(t){const e=zz();return K(()=>(e.value,!!t()))}function Wz(t,e={}){const{window:n=Sr}=e,r=j_(()=>n&&"matchMedia"in n&&typeof n.matchMedia=="function");let a;const i=W(!1),o=()=>{a&&("removeEventListener"in a?a.removeEventListener("change",l):a.removeListener(l))},l=()=>{r.value&&(o(),a=n.matchMedia(Pz(t).value),i.value=!!(a!=null&&a.matches),a&&("addEventListener"in a?a.addEventListener("change",l):a.addListener(l)))};return st(l),Mv(()=>o()),i}const wl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Cl="__vueuse_ssr_handlers__",Vz=Hz();function Hz(){return Cl in wl||(wl[Cl]=wl[Cl]||{}),wl[Cl]}function Uz(t,e){return Vz[t]||e}function Kz(t){return t==null?"any":t instanceof Set?"set":t instanceof Map?"map":t instanceof Date?"date":typeof t=="boolean"?"boolean":typeof t=="string"?"string":typeof t=="object"?"object":Number.isNaN(t)?"any":"number"}var Gz=Object.defineProperty,Iy=Object.getOwnPropertySymbols,qz=Object.prototype.hasOwnProperty,Yz=Object.prototype.propertyIsEnumerable,Ay=(t,e,n)=>e in t?Gz(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,My=(t,e)=>{for(var n in e||(e={}))qz.call(e,n)&&Ay(t,n,e[n]);if(Iy)for(var n of Iy(e))Yz.call(e,n)&&Ay(t,n,e[n]);return t};const Xz={boolean:{read:t=>t==="true",write:t=>String(t)},object:{read:t=>JSON.parse(t),write:t=>JSON.stringify(t)},number:{read:t=>Number.parseFloat(t),write:t=>String(t)},any:{read:t=>t,write:t=>String(t)},string:{read:t=>t,write:t=>String(t)},map:{read:t=>new Map(JSON.parse(t)),write:t=>JSON.stringify(Array.from(t.entries()))},set:{read:t=>new Set(JSON.parse(t)),write:t=>JSON.stringify(Array.from(t))},date:{read:t=>new Date(t),write:t=>t.toISOString()}},ky="vueuse-storage";function Jz(t,e,n,r={}){var a;const{flush:i="pre",deep:o=!0,listenToStorageChanges:l=!0,writeDefaults:s=!0,mergeDefaults:u=!1,shallow:f,window:v=Sr,eventFilter:h,onError:g=I=>{console.error(I)}}=r,c=(f?$n:W)(e);if(!n)try{n=Uz("getDefaultStorage",()=>{var I;return(I=Sr)==null?void 0:I.localStorage})()}catch(I){g(I)}if(!n)return c;const d=kv(e),m=Kz(d),p=(a=r.serializer)!=null?a:Xz[m],{pause:y,resume:b}=Dz(c,()=>w(c.value),{flush:i,deep:o,eventFilter:h});return v&&l&&(Pn(v,"storage",O),Pn(v,ky,_)),O(),c;function w(I){try{if(I==null)n.removeItem(t);else{const P=p.write(I),k=n.getItem(t);k!==P&&(n.setItem(t,P),v&&v.dispatchEvent(new CustomEvent(ky,{detail:{key:t,oldValue:k,newValue:P,storageArea:n}})))}}catch(P){g(P)}}function C(I){const P=I?I.newValue:n.getItem(t);if(P==null)return s&&d!==null&&n.setItem(t,p.write(d)),d;if(!I&&u){const k=p.read(P);return typeof u=="function"?u(k,d):m==="object"&&!Array.isArray(k)?My(My({},d),k):k}else return typeof P!="string"?P:p.read(P)}function _(I){O(I.detail)}function O(I){if(!(I&&I.storageArea!==n)){if(I&&I.key==null){c.value=d;return}if(!(I&&I.key!==t)){y();try{c.value=C(I)}catch(P){g(P)}finally{I?Ke(b):b()}}}}}function Qz(t){return Wz("(prefers-color-scheme: dark)",t)}function Zz({document:t=Bz}={}){if(!t)return W("visible");const e=W(t.visibilityState);return Pn(t,"visibilitychange",()=>{e.value=t.visibilityState}),e}var Ny=Object.getOwnPropertySymbols,e7=Object.prototype.hasOwnProperty,t7=Object.prototype.propertyIsEnumerable,n7=(t,e)=>{var n={};for(var r in t)e7.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&Ny)for(var r of Ny(t))e.indexOf(r)<0&&t7.call(t,r)&&(n[r]=t[r]);return n};function r7(t,e,n={}){const r=n,{window:a=Sr}=r,i=n7(r,["window"]);let o;const l=j_(()=>a&&"ResizeObserver"in a),s=()=>{o&&(o.disconnect(),o=void 0)},u=K(()=>Array.isArray(t)?t.map(h=>Hr(h)):[Hr(t)]),f=pe(u,h=>{if(s(),l.value&&a){o=new ResizeObserver(e);for(const g of h)g&&o.observe(g,i)}},{immediate:!0,flush:"post",deep:!0}),v=()=>{s(),f()};return Mv(v),{isSupported:l,stop:v}}function a7(t,e={width:0,height:0},n={}){const{window:r=Sr,box:a="content-box"}=n,i=K(()=>{var s,u;return(u=(s=Hr(t))==null?void 0:s.namespaceURI)==null?void 0:u.includes("svg")}),o=W(e.width),l=W(e.height);return r7(t,([s])=>{const u=a==="border-box"?s.borderBoxSize:a==="content-box"?s.contentBoxSize:s.devicePixelContentBoxSize;if(r&&i.value){const f=Hr(t);if(f){const v=r.getComputedStyle(f);o.value=parseFloat(v.width),l.value=parseFloat(v.height)}}else if(u){const f=Array.isArray(u)?u:[u];o.value=f.reduce((v,{inlineSize:h})=>v+h,0),l.value=f.reduce((v,{blockSize:h})=>v+h,0)}else o.value=s.contentRect.width,l.value=s.contentRect.height},n),pe(()=>Hr(t),s=>{o.value=s?e.width:0,l.value=s?e.height:0}),{width:o,height:l}}function U9(t,e,n={}){const{window:r=Sr}=n;return Jz(t,e,r==null?void 0:r.localStorage,n)}const i7={page:t=>[t.pageX,t.pageY],client:t=>[t.clientX,t.clientY],screen:t=>[t.screenX,t.screenY],movement:t=>t instanceof Touch?null:[t.movementX,t.movementY]};function o7(t={}){const{type:e="page",touch:n=!0,resetOnTouchEnds:r=!1,initialValue:a={x:0,y:0},window:i=Sr,target:o=i,eventFilter:l}=t,s=W(a.x),u=W(a.y),f=W(null),v=typeof e=="function"?e:i7[e],h=p=>{const y=v(p);y&&([s.value,u.value]=y,f.value="mouse")},g=p=>{if(p.touches.length>0){const y=v(p.touches[0]);y&&([s.value,u.value]=y,f.value="touch")}},c=()=>{s.value=a.x,u.value=a.y},d=l?p=>l(()=>h(p),{}):p=>h(p),m=l?p=>l(()=>g(p),{}):p=>g(p);return o&&(Pn(o,"mousemove",d,{passive:!0}),Pn(o,"dragover",d,{passive:!0}),n&&e!=="movement"&&(Pn(o,"touchstart",m,{passive:!0}),Pn(o,"touchmove",m,{passive:!0}),r&&Pn(o,"touchend",c,{passive:!0}))),{x:s,y:u,sourceType:f}}function $y(t,e={}){const{handleOutside:n=!0,window:r=Sr}=e,{x:a,y:i,sourceType:o}=o7(e),l=W(t??(r==null?void 0:r.document.body)),s=W(0),u=W(0),f=W(0),v=W(0),h=W(0),g=W(0),c=W(!0);let d=()=>{};return r&&(d=pe([l,a,i],()=>{const m=Hr(l);if(!m)return;const{left:p,top:y,width:b,height:w}=m.getBoundingClientRect();f.value=p+r.pageXOffset,v.value=y+r.pageYOffset,h.value=w,g.value=b;const C=a.value-f.value,_=i.value-v.value;c.value=b===0||w===0||C<0||_<0||C>b||_>w,(n||!c.value)&&(s.value=C,u.value=_)},{immediate:!0}),Pn(document,"mouseleave",()=>{c.value=!0})),{x:a,y:i,sourceType:o,elementX:s,elementY:u,elementPositionX:f,elementPositionY:v,elementHeight:h,elementWidth:g,isOutside:c,stop:d}}const l7={style:{position:"relative"}},s7=fe({__name:"edgeTrigger",props:{tabIdx:{}},setup(t){const e=t,n=Wo(),r=W(),a=W(),{isOutside:i}=$y(a),{isOutside:o}=$y(r),l=K(()=>!i.value&&!!n.dragingTab),s=K(()=>!o.value&&!!n.dragingTab&&!l.value),u=(f,v)=>{var g,c,d,m;const h=JSON.parse(((g=f.dataTransfer)==null?void 0:g.getData("text"))??"{}");if(console.log("on-drop",v,h),(h==null?void 0:h.from)==="tab-drag"){if(f.stopPropagation(),n.dragingTab=void 0,v==="insert"&&h.tabIdx===e.tabIdx)return;const p=n.tabList,y=p[h.tabIdx].panes[h.paneIdx];p[h.tabIdx].panes.splice(h.paneIdx,1),v==="add-right"?(p[e.tabIdx].key=((c=p[e.tabIdx].panes[h.paneIdx-1])==null?void 0:c.key)??p[e.tabIdx].panes[0].key,p.splice(e.tabIdx+1,0,{panes:[y],key:y.key,id:br()})):(p[h.tabIdx].key=((d=p[h.tabIdx].panes[h.paneIdx-1])==null?void 0:d.key)??((m=p[h.tabIdx].panes[0])==null?void 0:m.key),p[e.tabIdx].panes.push(y),p[e.tabIdx].key=y.key),p[h.tabIdx].panes.length===0&&p.splice(h.tabIdx,1)}};return(f,v)=>(Ye(),an("div",{class:wa(["wrap",{accept:s.value}]),ref_key:"trigger",ref:r,onDragover:v[2]||(v[2]=Ln(()=>{},["prevent"])),onDrop:v[3]||(v[3]=Ln(h=>u(h,"insert"),["prevent"]))},[xn("div",{class:wa(["trigger",{accept:l.value}]),ref_key:"edgeTrigger",ref:a,onDragover:v[0]||(v[0]=Ln(()=>{},["prevent"])),onDrop:v[1]||(v[1]=Ln(h=>u(h,"add-right"),["prevent"]))},null,34),xn("div",l7,[Wl(f.$slots,"default",{},void 0,!0)])],34))}});const uu=(t,e)=>{const n=t.__vccOpts||t;for(const[r,a]of e)n[r]=a;return n},u7=uu(s7,[["__scopeId","data-v-10c5aba4"]]);const z_=k_("useImgSliStore",()=>{const t=W(!1),e=W(!1),n=W(!1),r=W(),a=W(),i=Wo(),o=K(()=>{var s;const l=i.tabList;for(const u of l)if(((s=u.panes.find(f=>f.key===u.key))==null?void 0:s.type)==="img-sli")return!0;return!1});return{drawerVisible:e,fileDragging:t,left:r,right:a,imgSliActived:o,opened:n}}),c7=t=>(pb("data-v-279a61df"),t=t(),hb(),t),f7={key:0,class:"dragging-port-wrap"},d7={class:"content"},v7={key:0,class:"img-wrap"},p7={key:1},h7=c7(()=>xn("div",{style:{padding:"16px"}},null,-1)),m7={key:0,class:"img-wrap"},g7={key:1},y7={key:0,class:"tips",style:{"max-width":"30vw"}},b7={class:"actions"},w7=fe({__name:"DraggingPort",setup(t){const e=z_(),n=Wo(),{left:r,right:a}=az(e),i=async(s,u)=>{const f=sz(s);if(f){const v=f.nodes[0];if(!uz(v.name))return;e[u]=v}},o=()=>{e.left=void 0,e.right=void 0,e.opened=!1},l=()=>{e_(r.value&&a.value);const s={type:"img-sli",left:r.value,right:a.value,name:`${Ae("imgCompare")} ( ${r.value.name} vs ${a.value.name})`,key:br()};n.tabList[0].panes.push(s),n.tabList[0].key=s.key};return(s,u)=>{const f=bF,v=Tn;return Ye(),Xt(lr,null,{default:_t(()=>[(xe(e).fileDragging||xe(r)||xe(a)||xe(e).opened)&&!xe(e).imgSliActived?(Ye(),an("div",f7,[xn("h2",null,qn(s.$t("imgCompare")),1),xn("div",d7,[xn("div",{class:"left port",onDragover:u[1]||(u[1]=Ln(()=>{},["prevent"])),onDrop:u[2]||(u[2]=Ln(h=>i(h,"left"),["prevent"]))},[xe(r)?(Ye(),an("div",v7,[x(f,{src:xe(xy)(xe(r)),preview:{src:xe(vs)(xe(r))}},null,8,["src","preview"]),x(xe(Jl),{class:"close",onClick:u[0]||(u[0]=h=>r.value=void 0)})])):(Ye(),an("div",p7,qn(s.$t("dragImageHere")),1))],32),h7,xn("div",{class:"right port",onDragover:u[4]||(u[4]=Ln(()=>{},["prevent"])),onDrop:u[5]||(u[5]=Ln(h=>i(h,"right"),["prevent"]))},[xe(a)?(Ye(),an("div",m7,[x(f,{src:xe(xy)(xe(a)),preview:{src:xe(vs)(xe(a))}},null,8,["src","preview"]),x(xe(Jl),{class:"close",onClick:u[3]||(u[3]=h=>a.value=void 0)})])):(Ye(),an("div",g7,qn(s.$t("dragImageHere")),1))],32)]),xe(e).opened?(Ye(),an("p",y7," Tips: "+qn(s.$t("imageCompareTips")),1)):pa("",!0),xn("div",b7,[xe(r)&&xe(a)?(Ye(),Xt(v,{key:0,type:"primary",onClick:u[6]||(u[6]=h=>xe(e).drawerVisible=!0)},{default:_t(()=>[Fn(qn(s.$t("confirm")),1)]),_:1})):pa("",!0),xe(r)&&xe(a)?(Ye(),Xt(v,{key:1,type:"primary",onClick:l},{default:_t(()=>[Fn(qn(s.$t("confirm"))+"("+qn(s.$t("openInNewTab"))+")",1)]),_:1})):pa("",!0),x(v,{style:{"margin-left":"16px"},onClick:o},{default:_t(()=>[Fn(qn(s.$t("close")),1)]),_:1})])])):pa("",!0)]),_:1})}}});const C7=uu(w7,[["__scopeId","data-v-279a61df"]]),_7={class:"container"},S7=["src"],x7=fe({__name:"ImgSliSide",props:{side:{},containerWidth:{},img:{},maxEdge:{},percent:{}},setup(t){const e=t,n=K(()=>{let r="";const i=e.containerWidth;return e.side==="left"?r=`calc(50% - ${(e.percent-50)/100*i}px)`:r=`calc(-50% - ${(e.percent-50)/100*i+4}px)`,`${e.maxEdge==="width"?"width:100%":"height:100%"};transform: translate(${r}, -50%)`});return(r,a)=>(Ye(),an("div",_7,[xn("img",{class:wa(["img",[r.side]]),style:vi(n.value),src:xe(vs)(r.img),onDragstart:a[0]||(a[0]=Ln(()=>{},["prevent","stop"]))},null,46,S7)]))}});const Ry=uu(x7,[["__scopeId","data-v-65d66859"]]),P7=fe({__name:"ImgSliComparePane",props:{left:{},right:{}},setup(t,{expose:e}){const n=t,r=W(50),a=([{size:u}])=>{r.value=u},i=W(),{width:o}=a7(i);e({requestFullScreen:()=>{var u;(u=i.value)==null||u.requestFullscreen()}});const s=Fz(async()=>{if(!n.left)return"width";const u=await mz(vs(n.left)),f=u.width/u.height,v=document.body.clientWidth/document.body.clientHeight;return f>v?"width":"height"});return(u,f)=>(Ye(),an("div",{ref_key:"wrapperEl",ref:i,style:{height:"100%"}},[x(xe(R_),{class:"default-theme",onResize:a},{default:_t(()=>[u.left?(Ye(),Xt(xe(wf),{key:0},{default:_t(()=>[x(Ry,{side:"left","max-edge":xe(s),"container-width":xe(o),percent:r.value,img:u.left},null,8,["max-edge","container-width","percent","img"])]),_:1})):pa("",!0),u.right?(Ye(),Xt(xe(wf),{key:1},{default:_t(()=>[x(Ry,{"max-edge":xe(s),percent:r.value,img:u.right,side:"right","container-width":xe(o)},null,8,["max-edge","percent","img","container-width"])]),_:1})):pa("",!0)]),_:1})],512))}});const O7={class:"actions"},E7=fe({__name:"ImgSliDrawer",setup(t){const e=z_(),n=W();return(r,a)=>{const i=Tn,o=d4;return Ye(),an(De,null,[x(o,{width:"100vw",visible:xe(e).drawerVisible,"onUpdate:visible":a[2]||(a[2]=l=>xe(e).drawerVisible=l),"destroy-on-close":"",class:"img-sli","close-icon":null},{footer:_t(()=>[xn("div",O7,[x(i,{onClick:a[0]||(a[0]=l=>xe(e).drawerVisible=!1)},{default:_t(()=>[Fn(qn(r.$t("close")),1)]),_:1}),x(i,{onClick:a[1]||(a[1]=l=>{var s;return(s=n.value)==null?void 0:s.requestFullScreen()})},{default:_t(()=>[Fn(qn(r.$t("fullscreenview")),1)]),_:1})])]),default:_t(()=>[xe(e).left&&xe(e).right?(Ye(),Xt(P7,{key:0,ref_key:"splitpane",ref:n,left:xe(e).left,right:xe(e).right},null,8,["left","right"])):pa("",!0)]),_:1},8,["visible"]),x(C7)],64)}}});const T7=fe({__name:"SplitViewTab",setup(t){const e=Wo(),n={local:Ir(()=>mr(()=>import("./stackView-07039d5a.js"),["assets/stackView-07039d5a.js","assets/fullScreenContextMenu-bb0fc66b.js","assets/FileItem-dbdcf20b.js","assets/db-925e828e.js","assets/shortcut-ec395f0e.js","assets/shortcut-9fed83c2.css","assets/FileItem-b5f62029.css","assets/fullScreenContextMenu-61d0bdb7.css","assets/numInput-ba0cd880.js","assets/numInput-a08c6857.css","assets/stackView-c5da5c16.css","assets/index-f4bbe4b8.css","assets/index-d55a76b1.css"])),empty:Ir(()=>mr(()=>import("./emptyStartup-d6bd91f2.js"),["assets/emptyStartup-d6bd91f2.js","assets/db-925e828e.js","assets/emptyStartup-cf762322.css"])),"global-setting":Ir(()=>mr(()=>import("./globalSetting-192fee94.js"),["assets/globalSetting-192fee94.js","assets/numInput-ba0cd880.js","assets/shortcut-ec395f0e.js","assets/shortcut-9fed83c2.css","assets/numInput-a08c6857.css","assets/globalSetting-81978e8e.css","assets/index-f4bbe4b8.css","assets/index-d55a76b1.css"])),"tag-search-matched-image-grid":Ir(()=>mr(()=>import("./MatchedImageGrid-a7ac5220.js"),["assets/MatchedImageGrid-a7ac5220.js","assets/fullScreenContextMenu-bb0fc66b.js","assets/FileItem-dbdcf20b.js","assets/db-925e828e.js","assets/shortcut-ec395f0e.js","assets/shortcut-9fed83c2.css","assets/FileItem-b5f62029.css","assets/fullScreenContextMenu-61d0bdb7.css","assets/hook-3618bdfa.js","assets/MatchedImageGrid-4f83f417.css"])),"tag-search":Ir(()=>mr(()=>import("./TagSearch-c173660b.js"),["assets/TagSearch-c173660b.js","assets/db-925e828e.js","assets/TagSearch-ffd782da.css","assets/index-f4bbe4b8.css","assets/index-d55a76b1.css"])),"fuzzy-search":Ir(()=>mr(()=>import("./SubstrSearch-2f0f3ee4.js"),["assets/SubstrSearch-2f0f3ee4.js","assets/fullScreenContextMenu-bb0fc66b.js","assets/FileItem-dbdcf20b.js","assets/db-925e828e.js","assets/shortcut-ec395f0e.js","assets/shortcut-9fed83c2.css","assets/FileItem-b5f62029.css","assets/fullScreenContextMenu-61d0bdb7.css","assets/hook-3618bdfa.js","assets/SubstrSearch-aa382998.css","assets/index-f4bbe4b8.css"])),"img-sli":Ir(()=>mr(()=>import("./ImgSliPagePane-5cfc1ce0.js"),[])),"batch-download":Ir(()=>mr(()=>import("./batchDownload-4e2062de.js"),["assets/batchDownload-4e2062de.js","assets/FileItem-dbdcf20b.js","assets/db-925e828e.js","assets/shortcut-ec395f0e.js","assets/shortcut-9fed83c2.css","assets/FileItem-b5f62029.css","assets/batchDownload-08be3fc5.css"]))},r=(o,l,s)=>{var f,v;const u=e.tabList[o];if(s==="add"){const h={type:"empty",key:br(),name:Ae("emptyStartPage")};u.panes.push(h),u.key=h.key}else{const h=u.panes.findIndex(g=>g.key===l);if(u.key===l&&(u.key=((f=u.panes[h-1])==null?void 0:f.key)??((v=u.panes[1])==null?void 0:v.key)),u.panes.splice(h,1),u.panes.length===0&&e.tabList.splice(o,1),e.tabList.length===0){const g=e.createEmptyPane();e.tabList.push({panes:[g],key:g.key,id:br()})}}},a=W();pe(()=>e.tabList,async()=>{var o;await Ke(),e.saveRecord(),Array.from(((o=a.value)==null?void 0:o.querySelectorAll(".splitpanes__pane"))??[]).forEach((l,s)=>{Array.from(l.querySelectorAll(".ant-tabs-tab")??[]).forEach((u,f)=>{const v=u;v.setAttribute("draggable","true"),v.setAttribute("tabIdx",s.toString()),v.setAttribute("paneIdx",f.toString()),v.ondragend=()=>{e.dragingTab=void 0},v.ondragstart=h=>{e.dragingTab={tabIdx:s,paneIdx:f},h.dataTransfer.setData("text/plain",JSON.stringify({tabIdx:s,paneIdx:f,from:"tab-drag"}))}})})},{immediate:!0,deep:!0});const i=qc(()=>$_.emit("returnToIIB"),100);return Oz(async()=>{const o=window.parent;if(!await dz(()=>o==null?void 0:o.onUiTabChange,200,3e4)){console.log("watch tab change failed");return}o.onUiTabChange(()=>{const l=o.get_uiCurrentTabContent();l!=null&&l.id.includes("infinite-image-browsing")&&i()})}),pe(Zz(),o=>o&&i()),(o,l)=>{const s=ls,u=Qi;return Ye(),an("div",{ref_key:"container",ref:a},[x(xe(R_),{class:"default-theme"},{default:_t(()=>[(Ye(!0),an(De,null,Xv(xe(e).tabList,(f,v)=>(Ye(),Xt(xe(wf),{key:f.id},{default:_t(()=>[x(u7,{tabIdx:v},{default:_t(()=>[x(u,{type:"editable-card",activeKey:f.key,"onUpdate:activeKey":h=>f.key=h,onEdit:(h,g)=>r(v,h,g)},{default:_t(()=>[(Ye(!0),an(De,null,Xv(f.panes,(h,g)=>(Ye(),Xt(s,{key:h.key,tab:h.name,class:"pane"},{default:_t(()=>[(Ye(),Xt(gx(n[h.type]),Gf({tabIdx:v,paneIdx:g},h),null,16,["tabIdx","paneIdx"]))]),_:2},1032,["tab"]))),128))]),_:2},1032,["activeKey","onUpdate:activeKey","onEdit"])]),_:2},1032,["tabIdx"])]),_:2},1024))),128))]),_:1}),x(E7)],512)}}});const I7=uu(T7,[["__scopeId","data-v-c479b9de"]]),A7=async t=>{var r;const e=(r=t.conf)==null?void 0:r.global_setting,n=new URLSearchParams(parent.location.search);switch(n.get("action")){case"open":{let a=n.get("path");if(!a||!e)return;const i={extra:e.outdir_extras_samples,save:e.outdir_save,txt2img:e.outdir_txt2img_samples,img2img:e.outdir_img2img_samples};i[a]&&(a=i[a]);const o=t.tabList[0],l={type:"local",path:a,key:br(),name:"",walkModePath:n.get("walk")?a:void 0};o.panes.unshift(l),o.key=l.key,fz(),hz(["action","path","walk"]);break}}};function Ly(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!nr(t)}const W_="app.conf.json",io=W(),V_=()=>Ao.writeFile(W_,JSON.stringify(ke(io.value),null,4)),M7=fe({setup(){const t=async()=>{const e=await S_({directory:!0});if(typeof e=="string"){if(!await Ao.exists(`${e}/config.json`))return ba.error(Ae("tauriLaunchConfMessages.configNotFound"));if(!await Ao.exists(`${e}/extensions/sd-webui-infinite-image-browsing`))return ba.error(Ae("tauriLaunchConfMessages.folderNotFound"));io.value.sdwebui_dir=e,ba.info(Ae("tauriLaunchConfMessages.configCompletedMessage")),await V_(),await lu("shutdown_api_server_command"),await ou(1500),await w_()}};return()=>{let e,n;return x("div",{style:{padding:"32px 0"}},[x("div",{style:{padding:"16px 0"}},[x("h2",null,[Ae("tauriLaunchConf.readSdWebuiConfigTitle")]),x("p",null,[Ae("tauriLaunchConf.readSdWebuiConfigDescription")]),x(Tn,{onClick:t,type:"primary"},Ly(e=Ae("tauriLaunchConf.selectSdWebuiFolder"))?e:{default:()=>[e]})]),x("div",{style:{padding:"16px 0"}},[x("h2",null,[Ae("tauriLaunchConf.skipThisConfigTitle")]),x("p",null,[Ae("tauriLaunchConf.skipThisConfigDescription")]),x(Tn,{type:"primary",onClick:Bt.destroyAll},Ly(n=Ae("tauriLaunchConf.skipButton"))?n:{default:()=>[n]})])])}}}),k7=async()=>{try{io.value=JSON.parse(await Ao.readTextFile(W_))}catch{}io.value||(io.value={sdwebui_dir:""},await V_(),Bt.info({title:Ae("tauriLaunchConfMessages.firstTimeUserTitle"),content:x(M7,null,null),width:"80vw",okText:Ae("tauriLaunchConf.skipButton"),okButtonProps:{onClick:Bt.destroyAll}}))},N7=!!{}.TAURI_ARCH,$7=fe({__name:"App",setup(t){const e=Wo(),n=pz();return Py("updateGlobalSetting",async()=>{await Hj(),console.log(ds.value);const r=await Gj();e.conf=r;const a=await Oy(r);e.quickMovePaths=a.filter(i=>{var o,l;return(l=(o=i==null?void 0:i.dir)==null?void 0:o.trim)==null?void 0:l.call(o)}),A7(e)}),Py("returnToIIB",async()=>{const r=e.conf;if(!r)return;const a=r.global_setting;if(!a.outdir_txt2img_samples&&!a.outdir_img2img_samples)return;const i=new Set(e.quickMovePaths.map(l=>l.key));if(i.has("outdir_txt2img_samples")&&i.has("outdir_img2img_samples"))return;const o=await Oy(r);e.quickMovePaths=o.filter(l=>{var s,u;return(u=(s=l==null?void 0:l.dir)==null?void 0:s.trim)==null?void 0:u.call(s)})}),Re(async()=>{N7&&k7(),$_.emit("updateGlobalSetting")}),(r,a)=>{const i=rn;return Ye(),Xt(i,{loading:!xe(n).isIdle},{default:_t(()=>[x(I7)]),_:1},8,["loading"])}}});function R7(t){return typeof t=="object"&&t!==null}function Dy(t,e){return t=R7(t)?t:Object.create(null),new Proxy(t,{get(n,r,a){return r==="key"?Reflect.get(n,r,a):Reflect.get(n,r,a)||Reflect.get(e,r,a)}})}function L7(t,e){return e.reduce((n,r)=>n==null?void 0:n[r],t)}function D7(t,e,n){return e.slice(0,-1).reduce((r,a)=>/^(__proto__)$/.test(a)?{}:r[a]=r[a]||{},t)[e[e.length-1]]=n,t}function F7(t,e){return e.reduce((n,r)=>{const a=r.split(".");return D7(n,a,L7(t,a))},{})}function Fy(t,{storage:e,serializer:n,key:r,debug:a}){try{const i=e==null?void 0:e.getItem(r);i&&t.$patch(n==null?void 0:n.deserialize(i))}catch(i){a&&console.error(i)}}function By(t,{storage:e,serializer:n,key:r,paths:a,debug:i}){try{const o=Array.isArray(a)?F7(t,a):t;e.setItem(r,n.serialize(o))}catch(o){i&&console.error(o)}}function B7(t={}){return e=>{const{auto:n=!1}=t,{options:{persist:r=n},store:a}=e;if(!r)return;const i=(Array.isArray(r)?r.map(o=>Dy(o,t)):[Dy(r,t)]).map(({storage:o=localStorage,beforeRestore:l=null,afterRestore:s=null,serializer:u={serialize:JSON.stringify,deserialize:JSON.parse},key:f=a.$id,paths:v=null,debug:h=!1})=>{var g;return{storage:o,beforeRestore:l,afterRestore:s,serializer:u,key:((g=t.key)!=null?g:c=>c)(f),paths:v,debug:h}});a.$persist=()=>{i.forEach(o=>{By(a.$state,o)})},a.$hydrate=({runHooks:o=!0}={})=>{i.forEach(l=>{const{beforeRestore:s,afterRestore:u}=l;o&&(s==null||s(e)),Fy(a,l),o&&(u==null||u(e))})},i.forEach(o=>{const{beforeRestore:l,afterRestore:s}=o;l==null||l(e),Fy(a,o),s==null||s(e),a.$subscribe((u,f)=>{By(f,o)},{detached:!0})})}}var j7=B7();const H_=Qj();H_.use(j7);AP($7).use(H_).use(wv).mount("#zanllp_dev_gradio_fe");const z7=Qz(),W7=()=>{try{return parent.location.search.includes("theme=dark")}catch{}return!1};pe([z7,W7],async([t,e])=>{await ou();const n=document.getElementsByTagName("html")[0];if(t||e){document.body.classList.add("dark");const r=document.createElement("style"),{default:a}=await mr(()=>import("./antd.dark-35e9b327.js"),[]);r.innerHTML=a,r.setAttribute("antd-dark",""),n.appendChild(r)}else document.body.classList.remove("dark"),Array.from(n.querySelectorAll("style[antd-dark]")).forEach(r=>r.remove())},{immediate:!0});export{W as $,Xv as A,vi as B,pa as C,xN as D,N7 as E,e9 as F,V7 as G,zx as H,L9 as I,R9 as J,H7 as K,vs as L,Vr as M,wa as N,as as O,J as P,rn as Q,Bt as R,t_ as S,GN as T,At as U,Tn as V,Po as W,uu as X,No as Y,gi as Z,ut as _,T as a,$n as a$,ge as a0,Ci as a1,ar as a2,yt as a3,Ns as a4,or as a5,Is as a6,lr as a7,yT as a8,_T as a9,t$ as aA,Ce as aB,qc as aC,D9 as aD,Vj as aE,Ao as aF,W_ as aG,w_ as aH,Xe as aI,r9 as aJ,ct as aK,rm as aL,Qe as aM,t9 as aN,mI as aO,MT as aP,nh as aQ,Tw as aR,KD as aS,Ds as aT,g$ as aU,Zf as aV,_e as aW,ho as aX,F$ as aY,vE as aZ,CP as a_,id as aa,fT as ab,q0 as ac,Y0 as ad,Jl as ae,vd as af,lt as ag,z_ as ah,Ae as ai,K as aj,XR as ak,br as al,e_ as am,Yc as an,S_ as ao,Kr as ap,qj as aq,ba as ar,$_ as as,pb as at,hb as au,Bf as av,Re as aw,Ke as ax,xt as ay,Yl as az,ze as b,Zw as b$,st as b0,cE as b1,Z7 as b2,mi as b3,ke as b4,V$ as b5,Id as b6,_o as b7,bw as b8,_$ as b9,Fa as bA,J7 as bB,UN as bC,ux as bD,G7 as bE,K7 as bF,Gf as bG,Hc as bH,X7 as bI,s0 as bJ,eC as bK,En as bL,Wn as bM,wC as bN,pz as bO,Py as bP,W9 as bQ,TN as bR,h4 as bS,Y7 as bT,hf as bU,C5 as bV,hI as bW,l0 as bX,nr as bY,$9 as bZ,U9 as b_,C$ as ba,WR as bb,NR as bc,SC as bd,rr as be,Kd as bf,Us as bg,Do as bh,TO as bi,VR as bj,Ks as bk,CL as bl,kl as bm,rt as bn,Nt as bo,B2 as bp,Jt as bq,Q7 as br,Jw as bs,Qw as bt,Dw as bu,Le as bv,Gt as bw,Sn as bx,Iw as by,kO as bz,x as c,Oo as c0,P7 as c1,az as c2,sz as c3,Si as c4,r$ as c5,VN as c6,JN as c7,BN as c8,n9 as c9,aI as cA,N9 as cB,QS as cC,Cs as cD,DS as cE,_b as cF,yx as cG,Wl as cH,gx as cI,U7 as cJ,Gc as cK,q7 as cL,xy as cM,bF as cN,Xf as cO,Tm as cP,zn as ca,Ed as cb,_d as cc,lb as cd,bt as ce,kT as cf,sd as cg,yz as ch,k_ as ci,my as cj,B9 as ck,Av as cl,F9 as cm,uz as cn,J1 as co,ou as cp,gz as cq,V9 as cr,di as cs,a7 as ct,$y as cu,H9 as cv,Q1 as cw,bz as cx,j9 as cy,k9 as cz,fe as d,jn as e,pn as f,Wr as g,te as h,He as i,Bd as j,Wo as k,pe as l,Xt as m,_t as n,Ye as o,xn as p,Ln as q,xe as r,tt as s,z9 as t,Ze as u,qn as v,ks as w,Fn as x,an as y,De as z}; diff --git a/vue/dist/assets/numInput-0325e3d4.js b/vue/dist/assets/numInput-ba0cd880.js similarity index 99% rename from vue/dist/assets/numInput-0325e3d4.js rename to vue/dist/assets/numInput-ba0cd880.js index c8552b4..48bb1b4 100644 --- a/vue/dist/assets/numInput-0325e3d4.js +++ b/vue/dist/assets/numInput-ba0cd880.js @@ -1,4 +1,4 @@ -import{aj as I,aI as Le,$ as Q,aw as ht,aJ as Hr,aK as mt,Z as we,d as ae,u as ye,aL as kt,b as ce,aM as Fe,aN as Mt,a0 as ee,h as M,c as T,a as k,aO as Ur,i as re,aP as He,aQ as me,a2 as Qt,e as Gr,aR as Jt,aS as er,aT as Wr,aU as Kr,aV as zr,aW as tr,z as Re,aX as Xr,l as oe,aY as Yr,aZ as Zr,a_ as Qr,a8 as Jr,ab as en,aa as tn,az as rn,a$ as rr,b0 as nr,b1 as ar,an as je,b2 as nn,b3 as an,P as K,b4 as et,ax as ir,b5 as gt,b6 as ln,b7 as un,b8 as Ot,b9 as on,ba as sn,bb as fn,bc as cn,bd as dn,be as vn,bf as hn,bg as lr,bh as mn,bi as gn,bj as pn,bk as bn,bl as yn,bm as xn,r as ge,bn as wn,bo as Ne,aC as Sn,bp as ur,bq as pt,br as Fn,w as Me,ag as Cn,bs as or,bt as sr,bu as Nn,bv as De,_ as $e,aB as ue,j as fr,D as Vn,ay as kn,a3 as Mn,bw as cr,bx as Ve,by as bt,bz as On,bA as tt,bB as Pn,bC as $n,bD as En,T as An,Y as Tn,bE as In,bF as Bn,o as _n,y as jn,bG as Pt,X as qn}from"./index-f1d763a2.js";import{t as Rn,l as Dn}from"./shortcut-6ab7aba6.js";var Ln=Symbol("SizeProvider"),Hn=function(e){var t=e?I(function(){return e.size}):Le(Ln,I(function(){return"default"}));return t};function Un(n,e,t){var r=-1,a=n.length;e<0&&(e=-e>a?0:a+e),t=t>a?a:t,t<0&&(t+=a),a=e>t?0:t-e>>>0,e>>>=0;for(var i=Array(a);++r0?"".concat(m[0]/-2,"px"):void 0,F=m[1]>0?"".concat(m[1]/-2,"px"):void 0;return d&&(b.marginLeft=d,b.marginRight=d),c.value?b.rowGap="".concat(m[1],"px"):F&&(b.marginTop=F,b.marginBottom=F),b});return function(){var m;return T("div",{class:f.value,style:y.value},[(m=r.default)===null||m===void 0?void 0:m.call(r)])}}});const Qn=Zn;function Jn(n){return typeof n=="number"?"".concat(n," ").concat(n," auto"):/^\d+(\.\d+)?(px|em|rem|%)$/.test(n)?"0 0 ".concat(n):n}var ea=function(){return{span:[String,Number],order:[String,Number],offset:[String,Number],push:[String,Number],pull:[String,Number],xs:{type:[String,Number,Object],default:void 0},sm:{type:[String,Number,Object],default:void 0},md:{type:[String,Number,Object],default:void 0},lg:{type:[String,Number,Object],default:void 0},xl:{type:[String,Number,Object],default:void 0},xxl:{type:[String,Number,Object],default:void 0},xxxl:{type:[String,Number,Object],default:void 0},prefixCls:String,flex:[String,Number]}};const vr=ae({compatConfig:{MODE:3},name:"ACol",props:ea(),setup:function(e,t){var r=t.slots,a=zn(),i=a.gutter,l=a.supportFlexGap,u=a.wrap,o=ye("col",e),c=o.prefixCls,s=o.direction,f=I(function(){var m,b=e.span,d=e.order,F=e.offset,h=e.push,S=e.pull,g=c.value,v={};return["xs","sm","md","lg","xl","xxl","xxxl"].forEach(function(p){var N,C={},x=e[p];typeof x=="number"?C.span=x:ce(x)==="object"&&(C=x||{}),v=k(k({},v),{},(N={},M(N,"".concat(g,"-").concat(p,"-").concat(C.span),C.span!==void 0),M(N,"".concat(g,"-").concat(p,"-order-").concat(C.order),C.order||C.order===0),M(N,"".concat(g,"-").concat(p,"-offset-").concat(C.offset),C.offset||C.offset===0),M(N,"".concat(g,"-").concat(p,"-push-").concat(C.push),C.push||C.push===0),M(N,"".concat(g,"-").concat(p,"-pull-").concat(C.pull),C.pull||C.pull===0),M(N,"".concat(g,"-rtl"),s.value==="rtl"),N))}),ee(g,(m={},M(m,"".concat(g,"-").concat(b),b!==void 0),M(m,"".concat(g,"-order-").concat(d),d),M(m,"".concat(g,"-offset-").concat(F),F),M(m,"".concat(g,"-push-").concat(h),h),M(m,"".concat(g,"-pull-").concat(S),S),m),v)}),y=I(function(){var m=e.flex,b=i.value,d={};if(b&&b[0]>0){var F="".concat(b[0]/2,"px");d.paddingLeft=F,d.paddingRight=F}if(b&&b[1]>0&&!l.value){var h="".concat(b[1]/2,"px");d.paddingTop=h,d.paddingBottom=h}return m&&(d.flex=Jn(m),u.value===!1&&!d.minWidth&&(d.minWidth=0)),d});return function(){var m;return T("div",{class:f.value,style:y.value},[(m=r.default)===null||m===void 0?void 0:m.call(r)])}}});function be(){return be=Object.assign?Object.assign.bind():function(n){for(var e=1;e"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function qe(n,e,t){return ra()?qe=Reflect.construct.bind():qe=function(a,i,l){var u=[null];u.push.apply(u,i);var o=Function.bind.apply(a,u),c=new o;return l&&Ee(c,l.prototype),c},qe.apply(null,arguments)}function na(n){return Function.toString.call(n).indexOf("[native code]")!==-1}function nt(n){var e=typeof Map=="function"?new Map:void 0;return nt=function(r){if(r===null||!na(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(r))return e.get(r);e.set(r,a)}function a(){return qe(r,arguments,rt(this).constructor)}return a.prototype=Object.create(r.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),Ee(a,r)},nt(n)}var aa=/%[sdj%]/g,ia=function(){};typeof process<"u"&&process.env;function at(n){if(!n||!n.length)return null;var e={};return n.forEach(function(t){var r=t.field;e[r]=e[r]||[],e[r].push(t)}),e}function le(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r=i)return u;switch(u){case"%s":return String(t[a++]);case"%d":return Number(t[a++]);case"%j":try{return JSON.stringify(t[a++])}catch{return"[Circular]"}break;default:return u}});return l}return n}function la(n){return n==="string"||n==="url"||n==="hex"||n==="email"||n==="date"||n==="pattern"}function te(n,e){return!!(n==null||e==="array"&&Array.isArray(n)&&!n.length||la(e)&&typeof n=="string"&&!n)}function ua(n,e,t){var r=[],a=0,i=n.length;function l(u){r.push.apply(r,u||[]),a++,a===i&&t(r)}n.forEach(function(u){e(u,l)})}function $t(n,e,t){var r=0,a=n.length;function i(l){if(l&&l.length){t(l);return}var u=r;r=r+1,ua?0:a+e),t=t>a?a:t,t<0&&(t+=a),a=e>t?0:t-e>>>0,e>>>=0;for(var i=Array(a);++r0?"".concat(m[0]/-2,"px"):void 0,F=m[1]>0?"".concat(m[1]/-2,"px"):void 0;return d&&(b.marginLeft=d,b.marginRight=d),c.value?b.rowGap="".concat(m[1],"px"):F&&(b.marginTop=F,b.marginBottom=F),b});return function(){var m;return T("div",{class:f.value,style:y.value},[(m=r.default)===null||m===void 0?void 0:m.call(r)])}}});const Qn=Zn;function Jn(n){return typeof n=="number"?"".concat(n," ").concat(n," auto"):/^\d+(\.\d+)?(px|em|rem|%)$/.test(n)?"0 0 ".concat(n):n}var ea=function(){return{span:[String,Number],order:[String,Number],offset:[String,Number],push:[String,Number],pull:[String,Number],xs:{type:[String,Number,Object],default:void 0},sm:{type:[String,Number,Object],default:void 0},md:{type:[String,Number,Object],default:void 0},lg:{type:[String,Number,Object],default:void 0},xl:{type:[String,Number,Object],default:void 0},xxl:{type:[String,Number,Object],default:void 0},xxxl:{type:[String,Number,Object],default:void 0},prefixCls:String,flex:[String,Number]}};const vr=ae({compatConfig:{MODE:3},name:"ACol",props:ea(),setup:function(e,t){var r=t.slots,a=zn(),i=a.gutter,l=a.supportFlexGap,u=a.wrap,o=ye("col",e),c=o.prefixCls,s=o.direction,f=I(function(){var m,b=e.span,d=e.order,F=e.offset,h=e.push,S=e.pull,g=c.value,v={};return["xs","sm","md","lg","xl","xxl","xxxl"].forEach(function(p){var N,C={},x=e[p];typeof x=="number"?C.span=x:ce(x)==="object"&&(C=x||{}),v=k(k({},v),{},(N={},M(N,"".concat(g,"-").concat(p,"-").concat(C.span),C.span!==void 0),M(N,"".concat(g,"-").concat(p,"-order-").concat(C.order),C.order||C.order===0),M(N,"".concat(g,"-").concat(p,"-offset-").concat(C.offset),C.offset||C.offset===0),M(N,"".concat(g,"-").concat(p,"-push-").concat(C.push),C.push||C.push===0),M(N,"".concat(g,"-").concat(p,"-pull-").concat(C.pull),C.pull||C.pull===0),M(N,"".concat(g,"-rtl"),s.value==="rtl"),N))}),ee(g,(m={},M(m,"".concat(g,"-").concat(b),b!==void 0),M(m,"".concat(g,"-order-").concat(d),d),M(m,"".concat(g,"-offset-").concat(F),F),M(m,"".concat(g,"-push-").concat(h),h),M(m,"".concat(g,"-pull-").concat(S),S),m),v)}),y=I(function(){var m=e.flex,b=i.value,d={};if(b&&b[0]>0){var F="".concat(b[0]/2,"px");d.paddingLeft=F,d.paddingRight=F}if(b&&b[1]>0&&!l.value){var h="".concat(b[1]/2,"px");d.paddingTop=h,d.paddingBottom=h}return m&&(d.flex=Jn(m),u.value===!1&&!d.minWidth&&(d.minWidth=0)),d});return function(){var m;return T("div",{class:f.value,style:y.value},[(m=r.default)===null||m===void 0?void 0:m.call(r)])}}});function be(){return be=Object.assign?Object.assign.bind():function(n){for(var e=1;e"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function qe(n,e,t){return ra()?qe=Reflect.construct.bind():qe=function(a,i,l){var u=[null];u.push.apply(u,i);var o=Function.bind.apply(a,u),c=new o;return l&&Ee(c,l.prototype),c},qe.apply(null,arguments)}function na(n){return Function.toString.call(n).indexOf("[native code]")!==-1}function nt(n){var e=typeof Map=="function"?new Map:void 0;return nt=function(r){if(r===null||!na(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(r))return e.get(r);e.set(r,a)}function a(){return qe(r,arguments,rt(this).constructor)}return a.prototype=Object.create(r.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),Ee(a,r)},nt(n)}var aa=/%[sdj%]/g,ia=function(){};typeof process<"u"&&process.env;function at(n){if(!n||!n.length)return null;var e={};return n.forEach(function(t){var r=t.field;e[r]=e[r]||[],e[r].push(t)}),e}function le(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r=i)return u;switch(u){case"%s":return String(t[a++]);case"%d":return Number(t[a++]);case"%j":try{return JSON.stringify(t[a++])}catch{return"[Circular]"}break;default:return u}});return l}return n}function la(n){return n==="string"||n==="url"||n==="hex"||n==="email"||n==="date"||n==="pattern"}function te(n,e){return!!(n==null||e==="array"&&Array.isArray(n)&&!n.length||la(e)&&typeof n=="string"&&!n)}function ua(n,e,t){var r=[],a=0,i=n.length;function l(u){r.push.apply(r,u||[]),a++,a===i&&t(r)}n.forEach(function(u){e(u,l)})}function $t(n,e,t){var r=0,a=n.length;function i(l){if(l&&l.length){t(l);return}var u=r;r=r+1,u=n.length?{done:!0}:{done:!1,value:n[o++]}},e:function(c){throw c},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var k=!0,m=!1,g;return{s:function(){u=u.call(n)},n:function(){var c=u.next();return k=c.done,c},e:function(c){m=!0,g=c},f:function(){try{!k&&u.return!=null&&u.return()}finally{if(m)throw g}}}}var X=1/0,de=17976931348623157e292;function ke(n){if(!n)return n===0?n:0;if(n=Z(n),n===X||n===-X){var e=n<0?-1:1;return e*de}return n===n?n:0}var se=["prefixCls","name","id","type","disabled","readonly","tabindex","autofocus","value","required"],fe={prefixCls:String,name:String,id:String,type:String,defaultChecked:{type:[Boolean,Number],default:void 0},checked:{type:[Boolean,Number],default:void 0},disabled:Boolean,tabindex:{type:[Number,String]},readonly:Boolean,autofocus:Boolean,value:Y.any,required:Boolean};const ve=H({compatConfig:{MODE:3},name:"Checkbox",inheritAttrs:!1,props:ee(fe,{prefixCls:"rc-checkbox",type:"checkbox",defaultChecked:!1}),emits:["click","change"],setup:function(e,u){var o=u.attrs,s=u.emit,k=u.expose,m=M(e.checked===void 0?e.defaultChecked:e.checked),g=M();q(function(){return e.checked},function(){m.value=e.checked}),k({focus:function(){var t;(t=g.value)===null||t===void 0||t.focus()},blur:function(){var t;(t=g.value)===null||t===void 0||t.blur()}});var d=M(),c=function(t){if(!e.disabled){e.checked===void 0&&(m.value=t.target.checked),t.shiftKey=d.value;var C={target:f(f({},e),{},{checked:t.target.checked}),stopPropagation:function(){t.stopPropagation()},preventDefault:function(){t.preventDefault()},nativeEvent:t};e.checked!==void 0&&(g.value.checked=!!e.checked),s("change",C),d.value=!1}},p=function(t){s("click",t),d.value=t.shiftKey};return function(){var r,t=e.prefixCls,C=e.name,S=e.id,V=e.type,w=e.disabled,x=e.readonly,a=e.tabindex,l=e.autofocus,v=e.value,h=e.required,b=T(e,se),i=o.class,I=o.onFocus,A=o.onBlur,G=o.onKeydown,K=o.onKeypress,$=o.onKeyup,O=f(f({},b),o),y=Object.keys(O).reduce(function(N,P){return(P.substr(0,5)==="aria-"||P.substr(0,5)==="data-"||P==="role")&&(N[P]=O[P]),N},{}),E=U(t,i,(r={},B(r,"".concat(t,"-checked"),m.value),B(r,"".concat(t,"-disabled"),w),r)),D=f(f({name:C,id:S,type:V,readonly:x,disabled:w,tabindex:a,class:"".concat(t,"-input"),checked:!!m.value,autofocus:l,value:v},y),{},{onChange:c,onClick:p,onFocus:I,onBlur:A,onKeydown:G,onKeypress:K,onKeyup:$,required:h});return _("span",{class:E},[_("input",f({ref:g},D),null),_("span",{class:"".concat(t,"-inner")},null)])}}});function Ce(n){var e=n==null?0:n.length;return e?n[e-1]:void 0}var he=function(){return{name:String,prefixCls:String,options:{type:Array,default:function(){return[]}},disabled:Boolean,id:String}},be=function(){return f(f({},he()),{},{defaultValue:{type:Array},value:{type:Array},onChange:{type:Function},"onUpdate:value":{type:Function}})},me=function(){return{prefixCls:String,defaultChecked:{type:Boolean,default:void 0},checked:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},isGroup:{type:Boolean,default:void 0},value:Y.any,name:String,id:String,indeterminate:{type:Boolean,default:void 0},type:{type:String,default:"checkbox"},autofocus:{type:Boolean,default:void 0},onChange:Function,"onUpdate:checked":Function,onClick:Function,skipGroup:{type:Boolean,default:!1}}},ge=function(){return f(f({},me()),{},{indeterminate:{type:Boolean,default:!1}})},L=Symbol("CheckboxGroupContext"),pe=["indeterminate","skipGroup","id"],ye=["onMouseenter","onMouseleave","onInput","class","style"];const F=H({compatConfig:{MODE:3},name:"ACheckbox",inheritAttrs:!1,__ANT_CHECKBOX:!0,props:ge(),setup:function(e,u){var o=u.emit,s=u.attrs,k=u.slots,m=u.expose,g=z(),d=J("checkbox",e),c=d.prefixCls,p=d.direction,r=ne(L,void 0),t=Symbol("checkboxUniId");ae(function(){!e.skipGroup&&r&&r.registerValue(t,e.value)}),te(function(){r&&r.cancelValue(t)}),re(function(){ue(e.checked!==void 0||r||e.value===void 0,"Checkbox","`value` is not validate prop, do you mean `checked`?")});var C=function(a){var l=a.target.checked;o("update:checked",l),o("change",a)},S=M(),V=function(){var a;(a=S.value)===null||a===void 0||a.focus()},w=function(){var a;(a=S.value)===null||a===void 0||a.blur()};return m({focus:V,blur:w}),function(){var x,a,l=le((x=k.default)===null||x===void 0?void 0:x.call(k)),v=e.indeterminate,h=e.skipGroup,b=e.id,i=b===void 0?g.id.value:b,I=T(e,pe),A=s.onMouseenter,G=s.onMouseleave;s.onInput;var K=s.class,$=s.style,O=T(s,ye),y=f(f({},I),{},{id:i,prefixCls:c.value},O);r&&!h?(y.onChange=function(){for(var N=arguments.length,P=new Array(N),j=0;j0&&(h=r.value.map(function(i){var I;return _(F,{prefixCls:d.value,key:i.value.toString(),disabled:"disabled"in i?i.disabled:e.disabled,indeterminate:i.indeterminate,value:i.value,checked:p.value.indexOf(i.value)!==-1,onChange:i.onChange,class:"".concat(b,"-item")},{default:function(){return[i.label===void 0?(I=o.label)===null||I===void 0?void 0:I.call(o,i):i.label]}})})),_("div",{class:[b,B({},"".concat(b,"-rtl"),c.value==="rtl")],id:v},[h||((a=o.default)===null||a===void 0?void 0:a.call(o))])}}});F.Group=W;F.install=function(n){return n.component(F.name,F),n.component(W.name,W),n};const Se=n=>{const e=[];return n.shiftKey&&e.push("Shift"),n.ctrlKey&&e.push("Ctrl"),n.metaKey&&e.push("Cmd"),(n.code.startsWith("Key")||n.code.startsWith("Digit"))&&e.push(n.code),e.join(" + ")};export{F as C,Se as g,Ce as l,ke as t}; +import{cO as Q,cP as Z,d as H,bq as ee,$ as _,l as q,_ as T,a as f,a0 as U,h as B,c as w,P as Y,j as z,u as J,aI as ne,b0 as ae,aM as te,aw as re,w as ue,f as le,aj as R,aK as oe,i as ie}from"./index-1537dba6.js";function ce(n,e){var u=typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(!u){if(Array.isArray(n)||(u=Q(n))||e&&n&&typeof n.length=="number"){u&&(n=u);var o=0,s=function(){};return{s,n:function(){return o>=n.length?{done:!0}:{done:!1,value:n[o++]}},e:function(c){throw c},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var k=!0,m=!1,g;return{s:function(){u=u.call(n)},n:function(){var c=u.next();return k=c.done,c},e:function(c){m=!0,g=c},f:function(){try{!k&&u.return!=null&&u.return()}finally{if(m)throw g}}}}var X=1/0,de=17976931348623157e292;function ke(n){if(!n)return n===0?n:0;if(n=Z(n),n===X||n===-X){var e=n<0?-1:1;return e*de}return n===n?n:0}var se=["prefixCls","name","id","type","disabled","readonly","tabindex","autofocus","value","required"],fe={prefixCls:String,name:String,id:String,type:String,defaultChecked:{type:[Boolean,Number],default:void 0},checked:{type:[Boolean,Number],default:void 0},disabled:Boolean,tabindex:{type:[Number,String]},readonly:Boolean,autofocus:Boolean,value:Y.any,required:Boolean};const ve=H({compatConfig:{MODE:3},name:"Checkbox",inheritAttrs:!1,props:ee(fe,{prefixCls:"rc-checkbox",type:"checkbox",defaultChecked:!1}),emits:["click","change"],setup:function(e,u){var o=u.attrs,s=u.emit,k=u.expose,m=_(e.checked===void 0?e.defaultChecked:e.checked),g=_();q(function(){return e.checked},function(){m.value=e.checked}),k({focus:function(){var t;(t=g.value)===null||t===void 0||t.focus()},blur:function(){var t;(t=g.value)===null||t===void 0||t.blur()}});var d=_(),c=function(t){if(!e.disabled){e.checked===void 0&&(m.value=t.target.checked),t.shiftKey=d.value;var C={target:f(f({},e),{},{checked:t.target.checked}),stopPropagation:function(){t.stopPropagation()},preventDefault:function(){t.preventDefault()},nativeEvent:t};e.checked!==void 0&&(g.value.checked=!!e.checked),s("change",C),d.value=!1}},p=function(t){s("click",t),d.value=t.shiftKey};return function(){var r,t=e.prefixCls,C=e.name,S=e.id,V=e.type,K=e.disabled,x=e.readonly,a=e.tabindex,l=e.autofocus,v=e.value,h=e.required,b=T(e,se),i=o.class,I=o.onFocus,A=o.onBlur,G=o.onKeydown,M=o.onKeypress,$=o.onKeyup,N=f(f({},b),o),y=Object.keys(N).reduce(function(O,P){return(P.substr(0,5)==="aria-"||P.substr(0,5)==="data-"||P==="role")&&(O[P]=N[P]),O},{}),E=U(t,i,(r={},B(r,"".concat(t,"-checked"),m.value),B(r,"".concat(t,"-disabled"),K),r)),D=f(f({name:C,id:S,type:V,readonly:x,disabled:K,tabindex:a,class:"".concat(t,"-input"),checked:!!m.value,autofocus:l,value:v},y),{},{onChange:c,onClick:p,onFocus:I,onBlur:A,onKeydown:G,onKeypress:M,onKeyup:$,required:h});return w("span",{class:E},[w("input",f({ref:g},D),null),w("span",{class:"".concat(t,"-inner")},null)])}}});function Ce(n){var e=n==null?0:n.length;return e?n[e-1]:void 0}var he=function(){return{name:String,prefixCls:String,options:{type:Array,default:function(){return[]}},disabled:Boolean,id:String}},be=function(){return f(f({},he()),{},{defaultValue:{type:Array},value:{type:Array},onChange:{type:Function},"onUpdate:value":{type:Function}})},me=function(){return{prefixCls:String,defaultChecked:{type:Boolean,default:void 0},checked:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},isGroup:{type:Boolean,default:void 0},value:Y.any,name:String,id:String,indeterminate:{type:Boolean,default:void 0},type:{type:String,default:"checkbox"},autofocus:{type:Boolean,default:void 0},onChange:Function,"onUpdate:checked":Function,onClick:Function,skipGroup:{type:Boolean,default:!1}}},ge=function(){return f(f({},me()),{},{indeterminate:{type:Boolean,default:!1}})},L=Symbol("CheckboxGroupContext"),pe=["indeterminate","skipGroup","id"],ye=["onMouseenter","onMouseleave","onInput","class","style"];const F=H({compatConfig:{MODE:3},name:"ACheckbox",inheritAttrs:!1,__ANT_CHECKBOX:!0,props:ge(),setup:function(e,u){var o=u.emit,s=u.attrs,k=u.slots,m=u.expose,g=z(),d=J("checkbox",e),c=d.prefixCls,p=d.direction,r=ne(L,void 0),t=Symbol("checkboxUniId");ae(function(){!e.skipGroup&&r&&r.registerValue(t,e.value)}),te(function(){r&&r.cancelValue(t)}),re(function(){ue(e.checked!==void 0||r||e.value===void 0,"Checkbox","`value` is not validate prop, do you mean `checked`?")});var C=function(a){var l=a.target.checked;o("update:checked",l),o("change",a)},S=_(),V=function(){var a;(a=S.value)===null||a===void 0||a.focus()},K=function(){var a;(a=S.value)===null||a===void 0||a.blur()};return m({focus:V,blur:K}),function(){var x,a,l=le((x=k.default)===null||x===void 0?void 0:x.call(k)),v=e.indeterminate,h=e.skipGroup,b=e.id,i=b===void 0?g.id.value:b,I=T(e,pe),A=s.onMouseenter,G=s.onMouseleave;s.onInput;var M=s.class,$=s.style,N=T(s,ye),y=f(f({},I),{},{id:i,prefixCls:c.value},N);r&&!h?(y.onChange=function(){for(var O=arguments.length,P=new Array(O),j=0;j0&&(h=r.value.map(function(i){var I;return w(F,{prefixCls:d.value,key:i.value.toString(),disabled:"disabled"in i?i.disabled:e.disabled,indeterminate:i.indeterminate,value:i.value,checked:p.value.indexOf(i.value)!==-1,onChange:i.onChange,class:"".concat(b,"-item")},{default:function(){return[i.label===void 0?(I=o.label)===null||I===void 0?void 0:I.call(o,i):i.label]}})})),w("div",{class:[b,B({},"".concat(b,"-rtl"),c.value==="rtl")],id:v},[h||((a=o.default)===null||a===void 0?void 0:a.call(o))])}}});F.Group=W;F.install=function(n){return n.component(F.name,F),n.component(W.name,W),n};const Se=n=>{const e=[];return n.shiftKey&&e.push("Shift"),n.ctrlKey&&e.push("Ctrl"),n.metaKey&&e.push("Cmd"),(n.code.startsWith("Key")||n.code.startsWith("Digit"))&&e.push(n.code),e.join(" + ")};export{F as C,Se as g,Ce as l,ke as t}; diff --git a/vue/dist/assets/stackView-4838be5c.js b/vue/dist/assets/stackView-07039d5a.js similarity index 96% rename from vue/dist/assets/stackView-4838be5c.js rename to vue/dist/assets/stackView-07039d5a.js index 607c350..b2fd424 100644 --- a/vue/dist/assets/stackView-4838be5c.js +++ b/vue/dist/assets/stackView-07039d5a.js @@ -1 +1 @@ -import{d as Y,u as ie,g as U,_ as xe,c as a,a as re,P as X,D as Se,f as Pe,w as Xe,b as Ye,e as Ze,h as he,M as oe,i as et,j as tt,F as se,k as nt,l as at,o as d,m as F,n as i,p as u,q as v,r as e,s as T,t as rt,v as c,x as L,y as w,z as ne,A as ae,B as ot,C as V,E as st,G as lt,H as it,S as ut,I as dt,J as ct,K as pt,L as mt,N as we,O as vt,Q as ft,R as kt,T as bt,U as gt,V as Ct,W as _t,X as yt}from"./index-f1d763a2.js";import{S as W,s as ht,L as wt,R as It,f as xt}from"./fullScreenContextMenu-c371385f.js";import{F as N,N as St,_ as Pt}from"./numInput-0325e3d4.js";import"./shortcut-6ab7aba6.js";import{D as Me,u as Mt,a as $t,b as At,c as Rt,d as Bt,e as Dt,f as Ft,s as Nt,g as Et,F as Tt}from"./FileItem-a4a4ada7.js";/* empty css *//* empty css */import"./db-328ec51d.js";var Vt=["class","style"],zt=function(){return{prefixCls:String,href:String,separator:X.any,overlay:X.any,onClick:Function}};const q=Y({compatConfig:{MODE:3},name:"ABreadcrumbItem",inheritAttrs:!1,__ANT_BREADCRUMB_ITEM:!0,props:zt(),slots:["separator","overlay"],setup:function(o,_){var f=_.slots,b=_.attrs,h=ie("breadcrumb",o),y=h.prefixCls,S=function(I,p){var s=U(f,o,"overlay");return s?a(Me,{overlay:s,placement:"bottom"},{default:function(){return[a("span",{class:"".concat(p,"-overlay-link")},[I,a(Se,null,null)])]}}):I};return function(){var P,I=(P=U(f,o,"separator"))!==null&&P!==void 0?P:"/",p=U(f,o),s=b.class,g=b.style,k=xe(b,Vt),m;return o.href!==void 0?m=a("a",re({class:"".concat(y.value,"-link"),onClick:o.onClick},k),[p]):m=a("span",re({class:"".concat(y.value,"-link"),onClick:o.onClick},k),[p]),m=S(m,y.value),p?a("span",{class:s,style:g},[m,I&&a("span",{class:"".concat(y.value,"-separator")},[I])]):null}}});var Ot=function(){return{prefixCls:String,routes:{type:Array},params:X.any,separator:X.any,itemRender:{type:Function}}};function jt(r,o){if(!r.breadcrumbName)return null;var _=Object.keys(o).join("|"),f=r.breadcrumbName.replace(new RegExp(":(".concat(_,")"),"g"),function(b,h){return o[h]||b});return f}function Ie(r){var o=r.route,_=r.params,f=r.routes,b=r.paths,h=f.indexOf(o)===f.length-1,y=jt(o,_);return h?a("span",null,[y]):a("a",{href:"#/".concat(b.join("/"))},[y])}const z=Y({compatConfig:{MODE:3},name:"ABreadcrumb",props:Ot(),slots:["separator","itemRender"],setup:function(o,_){var f=_.slots,b=ie("breadcrumb",o),h=b.prefixCls,y=b.direction,S=function(s,g){return s=(s||"").replace(/^\//,""),Object.keys(g).forEach(function(k){s=s.replace(":".concat(k),g[k])}),s},P=function(s,g,k){var m=et(s),x=S(g||"",k);return x&&m.push(x),m},I=function(s){var g=s.routes,k=g===void 0?[]:g,m=s.params,x=m===void 0?{}:m,M=s.separator,$=s.itemRender,A=$===void 0?Ie:$,R=[];return k.map(function(C){var B=S(C.path,x);B&&R.push(B);var O=[].concat(R),j=null;return C.children&&C.children.length&&(j=a(oe,null,{default:function(){return[C.children.map(function(E){return a(oe.Item,{key:E.path||E.breadcrumbName},{default:function(){return[A({route:E,params:x,routes:k,paths:P(O,E.path,x)})]}})})]}})),a(q,{overlay:j,separator:M,key:B||C.breadcrumbName},{default:function(){return[A({route:C,params:x,routes:k,paths:O})]}})})};return function(){var p,s,g,k=o.routes,m=o.params,x=m===void 0?{}:m,M=Pe(U(f,o)),$=(p=U(f,o,"separator"))!==null&&p!==void 0?p:"/",A=o.itemRender||f.itemRender||Ie;k&&k.length>0?g=I({routes:k,params:x,separator:$,itemRender:A}):M.length&&(g=M.map(function(C,B){return Xe(Ye(C.type)==="object"&&(C.type.__ANT_BREADCRUMB_ITEM||C.type.__ANT_BREADCRUMB_SEPARATOR),"Breadcrumb","Only accepts Breadcrumb.Item and Breadcrumb.Separator as it's children"),Ze(C,{separator:$,key:B})}));var R=(s={},he(s,h.value,!0),he(s,"".concat(h.value,"-rtl"),y.value==="rtl"),s);return a("div",{class:R},[g])}}});var Lt=["separator","class"],Ut=function(){return{prefixCls:String}};const le=Y({compatConfig:{MODE:3},name:"ABreadcrumbSeparator",__ANT_BREADCRUMB_SEPARATOR:!0,inheritAttrs:!1,props:Ut(),setup:function(o,_){var f=_.slots,b=_.attrs,h=ie("breadcrumb",o),y=h.prefixCls;return function(){var S;b.separator;var P=b.class,I=xe(b,Lt),p=Pe((S=f.default)===null||S===void 0?void 0:S.call(f));return a("span",re({class:["".concat(y.value,"-separator"),P]},I),[p.length>0?p:"/"])}}});z.Item=q;z.Separator=le;z.install=function(r){return r.component(z.name,z),r.component(q.name,q),r.component(le.name,le),r};N.useInjectFormItemContext=tt;N.ItemRest=se;N.install=function(r){return r.component(N.name,N),r.component(N.Item.name,N.Item),r.component(se.name,se),r};W.setDefaultIndicator=ht;W.install=function(r){return r.component(W.name,W),r};const Wt={class:"hint"},qt={class:"location-bar"},Gt={key:0},Kt=["onClick"],Qt={key:3,style:{"margin-left":"8px"}},Ht={class:"actions"},Jt=["onClick"],Xt={style:{width:"512px",background:"var(--zp-primary-background)",padding:"16px","border-radius":"4px","box-shadow":"0 0 4px var(--zp-secondary-background)",border:"1px solid var(--zp-secondary-background)"}},Yt={style:{padding:"4px"}},Zt={style:{padding:"4px"}},en={style:{padding:"4px"}},tn={key:0,class:"view"},nn={style:{padding:"16px 0 32px"}},an={key:0,class:"preview-switch"},rn=Y({__name:"stackView",props:{tabIdx:{},paneIdx:{},path:{},walkModePath:{},stackKey:{}},setup(r){const o=r,_=nt(),{scroller:f,stackViewEl:b,props:h,multiSelectedIdxs:y,spinning:S}=Mt().toRefs(),{currLocation:P,currPage:I,refresh:p,copyLocation:s,back:g,openNext:k,stack:m,quickMoveTo:x,addToSearchScanPathAndQuickMove:M,searchPathInfo:$,locInputValue:A,isLocationEditing:R,onLocEditEnter:C,onEditBtnClick:B,share:O,selectAll:j,onCreateFloderBtnClick:G,onWalkBtnClick:E,showWalkButton:ue}=$t(),{gridItems:$e,sortMethodConv:Ae,moreActionsDropdownShow:Z,sortedFiles:K,sortMethod:ee,itemSize:de,loadNextDir:Re,loadNextDirLoading:Be,canLoadNext:De,onScroll:Fe,cellWidth:Q}=At(),{onDrop:Ne,onFileDragStart:Ee,onFileDragEnd:Te}=Rt(),{onFileItemClick:Ve,onContextMenuClick:ce,showGenInfo:H,imageGenInfo:pe,q:ze}=Bt({openNext:k}),{previewIdx:J,onPreviewVisibleChange:Oe,previewing:me,previewImgMove:ve,canPreview:fe}=Dt(),{showMenuIdx:te}=Ft();return at(()=>o,()=>{h.value=o;const l=Nt.get(o.stackKey??"");l&&(m.value=l.slice())},{immediate:!0}),(l,t)=>{const je=vt,Le=ft,Ue=kt,ke=q,be=z,We=bt,qe=gt,ge=Ct,Ge=_t,Ke=oe,Ce=Me,Qe=St,_e=Pt,He=N,Je=W;return d(),F(Je,{spinning:e(S),size:"large"},{default:i(()=>[a(je,{style:{display:"none"}}),u("div",{ref_key:"stackViewEl",ref:b,onDragover:t[24]||(t[24]=v(()=>{},["prevent"])),onDrop:t[25]||(t[25]=v(n=>e(Ne)(n),["prevent"])),class:"container"},[a(Ue,{visible:e(H),"onUpdate:visible":t[1]||(t[1]=n=>T(H)?H.value=n:null),width:"70vw","mask-closable":"",onOk:t[2]||(t[2]=n=>H.value=!1)},{cancelText:i(()=>[]),default:i(()=>[a(Le,{active:"",loading:!e(ze).isIdle},{default:i(()=>[u("div",{style:{width:"100%","word-break":"break-all","white-space":"pre-line","max-height":"70vh",overflow:"auto","z-index":"9999"},onDblclick:t[0]||(t[0]=n=>e(rt)(e(pe)))},[u("div",Wt,c(l.$t("doubleClickToCopy")),1),L(" "+c(e(pe)),1)],32)]),_:1},8,["loading"])]),_:1},8,["visible"]),u("div",qt,[o.walkModePath?(d(),w("div",Gt,[a(We,null,{title:i(()=>[L(c(l.$t("walk-mode-move-message")),1)]),default:i(()=>[a(be,{style:{flex:"1"}},{default:i(()=>[(d(!0),w(ne,null,ae(e(m),(n,D)=>(d(),F(ke,{key:D},{default:i(()=>[u("span",null,c(n.curr==="/"?l.$t("root"):n.curr.replace(/:\/$/,l.$t("drive"))),1)]),_:2},1024))),128))]),_:1})]),_:1})])):(d(),w("div",{key:1,class:"breadcrumb",style:ot({flex:e(R)?1:""})},[e(R)?(d(),F(qe,{key:0,style:{flex:"1"},value:e(A),"onUpdate:value":t[3]||(t[3]=n=>T(A)?A.value=n:null),onClick:t[4]||(t[4]=v(()=>{},["stop"])),onPressEnter:e(C)},null,8,["value","onPressEnter"])):(d(),F(be,{key:1,style:{flex:"1"}},{default:i(()=>[(d(!0),w(ne,null,ae(e(m),(n,D)=>(d(),F(ke,{key:D},{default:i(()=>[u("a",{onClick:v(ye=>e(g)(D),["prevent"])},c(n.curr==="/"?l.$t("root"):n.curr.replace(/:\/$/,l.$t("drive"))),9,Kt)]),_:2},1024))),128))]),_:1})),e(R)?(d(),F(ge,{key:2,size:"small",onClick:e(C),type:"primary"},{default:i(()=>[L(c(l.$t("go")),1)]),_:1},8,["onClick"])):(d(),w("div",Qt,[u("a",{onClick:t[5]||(t[5]=v((...n)=>e(s)&&e(s)(...n),["prevent"])),style:{"margin-right":"4px"}},c(l.$t("copy")),1),u("a",{onClick:t[6]||(t[6]=v((...n)=>e(B)&&e(B)(...n),["prevent","stop"]))},c(l.$t("edit")),1)]))],4)),u("div",Ht,[u("a",{class:"opt",onClick:t[7]||(t[7]=v((...n)=>e(p)&&e(p)(...n),["prevent"]))},c(l.$t("refresh")),1),e(ue)?(d(),w("a",{key:0,class:"opt",onClick:t[8]||(t[8]=v((...n)=>e(E)&&e(E)(...n),["prevent"]))}," Walk ")):V("",!0),u("a",{class:"opt",onClick:t[9]||(t[9]=v((...n)=>e(j)&&e(j)(...n),["prevent","stop"]))},c(l.$t("selectAll")),1),e(st)?V("",!0):(d(),w("a",{key:1,class:"opt",onClick:t[10]||(t[10]=v((...n)=>e(O)&&e(O)(...n),["prevent"]))},c(l.$t("share")),1)),a(Ce,null,{overlay:i(()=>[a(Ke,null,{default:i(()=>[(d(!0),w(ne,null,ae(e(_).quickMovePaths,n=>(d(),F(Ge,{key:n.dir},{default:i(()=>[u("a",{onClick:v(D=>e(x)(n.dir),["prevent"])},c(n.zh),9,Jt)]),_:2},1024))),128))]),_:1})]),default:i(()=>[u("a",{class:"opt",onClick:t[11]||(t[11]=v(()=>{},["prevent"]))},[L(c(l.$t("quickMove"))+" ",1),a(e(Se))])]),_:1}),a(Ce,{trigger:["click"],visible:e(Z),"onUpdate:visible":t[20]||(t[20]=n=>T(Z)?Z.value=n:null),placement:"bottomLeft",getPopupContainer:n=>n.parentNode},{overlay:i(()=>[u("div",Xt,[a(He,lt(it({labelCol:{span:6},wrapperCol:{span:18}})),{default:i(()=>[a(_e,{label:l.$t("gridCellWidth")},{default:i(()=>[a(Qe,{modelValue:e(Q),"onUpdate:modelValue":t[13]||(t[13]=n=>T(Q)?Q.value=n:null),max:1024,min:64,step:64},null,8,["modelValue"])]),_:1},8,["label"]),a(_e,{label:l.$t("sortingMethod")},{default:i(()=>[a(e(ut),{value:e(ee),"onUpdate:value":t[14]||(t[14]=n=>T(ee)?ee.value=n:null),onClick:t[15]||(t[15]=v(()=>{},["stop"])),conv:e(Ae),options:e(dt)},null,8,["value","conv","options"])]),_:1},8,["label"]),u("div",Yt,[e($)?e($).can_delete?(d(),w("a",{key:1,onClick:t[17]||(t[17]=v((...n)=>e(M)&&e(M)(...n),["prevent"]))},c(l.$t("removeFromSearchScanPathAndQuickMove")),1)):V("",!0):(d(),w("a",{key:0,onClick:t[16]||(t[16]=v((...n)=>e(M)&&e(M)(...n),["prevent"]))},c(l.$t("addToSearchScanPathAndQuickMove")),1))]),u("div",Zt,[u("a",{onClick:t[18]||(t[18]=v(n=>e(ct)(e(P)+"/"),["prevent"]))},c(l.$t("openWithLocalFileBrowser")),1)]),u("div",en,[u("a",{onClick:t[19]||(t[19]=v((...n)=>e(G)&&e(G)(...n),["prevent"]))},c(l.$t("createFolder")),1)])]),_:1},16)])]),default:i(()=>[u("a",{class:"opt",onClick:t[12]||(t[12]=v(()=>{},["prevent"]))},c(l.$t("more")),1)]),_:1},8,["visible","getPopupContainer"])])]),e(I)?(d(),w("div",tn,[a(e(Et),{class:"file-list",items:e(K),ref_key:"scroller",ref:f,onScroll:e(Fe),"item-size":e(de).first,"key-field":"fullpath","item-secondary-size":e(de).second,gridItems:e($e)},pt({default:i(({item:n,index:D})=>[a(Tt,{idx:parseInt(D),file:n,"full-screen-preview-image-url":e(K)[e(J)]?e(mt)(e(K)[e(J)]):"","show-menu-idx":e(te),"onUpdate:showMenuIdx":t[21]||(t[21]=ye=>T(te)?te.value=ye:null),selected:e(y).includes(D),"cell-width":e(Q),onFileItemClick:e(Ve),onDragstart:e(Ee),onDragend:e(Te),onPreviewVisibleChange:e(Oe),onContextMenuClick:e(ce)},null,8,["idx","file","full-screen-preview-image-url","show-menu-idx","selected","cell-width","onFileItemClick","onDragstart","onDragend","onPreviewVisibleChange","onContextMenuClick"])]),_:2},[o.walkModePath?{name:"after",fn:i(()=>[u("div",nn,[a(ge,{onClick:e(Re),loading:e(Be),block:"",type:"primary",disabled:!e(De),ghost:""},{default:i(()=>[L(c(l.$t("loadNextPage")),1)]),_:1},8,["onClick","loading","disabled"])])]),key:"0"}:void 0]),1032,["items","onScroll","item-size","item-secondary-size","gridItems"]),e(me)?(d(),w("div",an,[a(e(wt),{onClick:t[22]||(t[22]=n=>e(ve)("prev")),class:we({disable:!e(fe)("prev")})},null,8,["class"]),a(e(It),{onClick:t[23]||(t[23]=n=>e(ve)("next")),class:we({disable:!e(fe)("next")})},null,8,["class"])])):V("",!0)])):V("",!0)],544),e(me)?(d(),F(xt,{key:0,file:e(K)[e(J)],idx:e(J),onContextMenuClick:e(ce)},null,8,["file","idx","onContextMenuClick"])):V("",!0)]),_:1},8,["spinning"])}}});const vn=yt(rn,[["__scopeId","data-v-e5dabb69"]]);export{vn as default}; +import{d as Y,u as ie,g as U,_ as xe,c as a,a as re,P as X,D as Se,f as Pe,w as Xe,b as Ye,e as Ze,h as he,M as oe,i as et,j as tt,F as se,k as nt,l as at,o as d,m as F,n as i,p as u,q as v,r as e,s as T,t as rt,v as c,x as L,y as w,z as ne,A as ae,B as ot,C as V,E as st,G as lt,H as it,S as ut,I as dt,J as ct,K as pt,L as mt,N as we,O as vt,Q as ft,R as kt,T as bt,U as gt,V as Ct,W as _t,X as yt}from"./index-1537dba6.js";import{S as W,s as ht,L as wt,R as It,f as xt}from"./fullScreenContextMenu-bb0fc66b.js";import{F as N,N as St,_ as Pt}from"./numInput-ba0cd880.js";import"./shortcut-ec395f0e.js";import{D as Me,u as Mt,a as $t,b as At,c as Rt,d as Bt,e as Dt,f as Ft,s as Nt,g as Et,F as Tt}from"./FileItem-dbdcf20b.js";/* empty css *//* empty css */import"./db-925e828e.js";var Vt=["class","style"],zt=function(){return{prefixCls:String,href:String,separator:X.any,overlay:X.any,onClick:Function}};const q=Y({compatConfig:{MODE:3},name:"ABreadcrumbItem",inheritAttrs:!1,__ANT_BREADCRUMB_ITEM:!0,props:zt(),slots:["separator","overlay"],setup:function(o,_){var f=_.slots,b=_.attrs,h=ie("breadcrumb",o),y=h.prefixCls,S=function(I,p){var s=U(f,o,"overlay");return s?a(Me,{overlay:s,placement:"bottom"},{default:function(){return[a("span",{class:"".concat(p,"-overlay-link")},[I,a(Se,null,null)])]}}):I};return function(){var P,I=(P=U(f,o,"separator"))!==null&&P!==void 0?P:"/",p=U(f,o),s=b.class,g=b.style,k=xe(b,Vt),m;return o.href!==void 0?m=a("a",re({class:"".concat(y.value,"-link"),onClick:o.onClick},k),[p]):m=a("span",re({class:"".concat(y.value,"-link"),onClick:o.onClick},k),[p]),m=S(m,y.value),p?a("span",{class:s,style:g},[m,I&&a("span",{class:"".concat(y.value,"-separator")},[I])]):null}}});var Ot=function(){return{prefixCls:String,routes:{type:Array},params:X.any,separator:X.any,itemRender:{type:Function}}};function jt(r,o){if(!r.breadcrumbName)return null;var _=Object.keys(o).join("|"),f=r.breadcrumbName.replace(new RegExp(":(".concat(_,")"),"g"),function(b,h){return o[h]||b});return f}function Ie(r){var o=r.route,_=r.params,f=r.routes,b=r.paths,h=f.indexOf(o)===f.length-1,y=jt(o,_);return h?a("span",null,[y]):a("a",{href:"#/".concat(b.join("/"))},[y])}const z=Y({compatConfig:{MODE:3},name:"ABreadcrumb",props:Ot(),slots:["separator","itemRender"],setup:function(o,_){var f=_.slots,b=ie("breadcrumb",o),h=b.prefixCls,y=b.direction,S=function(s,g){return s=(s||"").replace(/^\//,""),Object.keys(g).forEach(function(k){s=s.replace(":".concat(k),g[k])}),s},P=function(s,g,k){var m=et(s),x=S(g||"",k);return x&&m.push(x),m},I=function(s){var g=s.routes,k=g===void 0?[]:g,m=s.params,x=m===void 0?{}:m,M=s.separator,$=s.itemRender,A=$===void 0?Ie:$,R=[];return k.map(function(C){var B=S(C.path,x);B&&R.push(B);var O=[].concat(R),j=null;return C.children&&C.children.length&&(j=a(oe,null,{default:function(){return[C.children.map(function(E){return a(oe.Item,{key:E.path||E.breadcrumbName},{default:function(){return[A({route:E,params:x,routes:k,paths:P(O,E.path,x)})]}})})]}})),a(q,{overlay:j,separator:M,key:B||C.breadcrumbName},{default:function(){return[A({route:C,params:x,routes:k,paths:O})]}})})};return function(){var p,s,g,k=o.routes,m=o.params,x=m===void 0?{}:m,M=Pe(U(f,o)),$=(p=U(f,o,"separator"))!==null&&p!==void 0?p:"/",A=o.itemRender||f.itemRender||Ie;k&&k.length>0?g=I({routes:k,params:x,separator:$,itemRender:A}):M.length&&(g=M.map(function(C,B){return Xe(Ye(C.type)==="object"&&(C.type.__ANT_BREADCRUMB_ITEM||C.type.__ANT_BREADCRUMB_SEPARATOR),"Breadcrumb","Only accepts Breadcrumb.Item and Breadcrumb.Separator as it's children"),Ze(C,{separator:$,key:B})}));var R=(s={},he(s,h.value,!0),he(s,"".concat(h.value,"-rtl"),y.value==="rtl"),s);return a("div",{class:R},[g])}}});var Lt=["separator","class"],Ut=function(){return{prefixCls:String}};const le=Y({compatConfig:{MODE:3},name:"ABreadcrumbSeparator",__ANT_BREADCRUMB_SEPARATOR:!0,inheritAttrs:!1,props:Ut(),setup:function(o,_){var f=_.slots,b=_.attrs,h=ie("breadcrumb",o),y=h.prefixCls;return function(){var S;b.separator;var P=b.class,I=xe(b,Lt),p=Pe((S=f.default)===null||S===void 0?void 0:S.call(f));return a("span",re({class:["".concat(y.value,"-separator"),P]},I),[p.length>0?p:"/"])}}});z.Item=q;z.Separator=le;z.install=function(r){return r.component(z.name,z),r.component(q.name,q),r.component(le.name,le),r};N.useInjectFormItemContext=tt;N.ItemRest=se;N.install=function(r){return r.component(N.name,N),r.component(N.Item.name,N.Item),r.component(se.name,se),r};W.setDefaultIndicator=ht;W.install=function(r){return r.component(W.name,W),r};const Wt={class:"hint"},qt={class:"location-bar"},Gt={key:0},Kt=["onClick"],Qt={key:3,style:{"margin-left":"8px"}},Ht={class:"actions"},Jt=["onClick"],Xt={style:{width:"512px",background:"var(--zp-primary-background)",padding:"16px","border-radius":"4px","box-shadow":"0 0 4px var(--zp-secondary-background)",border:"1px solid var(--zp-secondary-background)"}},Yt={style:{padding:"4px"}},Zt={style:{padding:"4px"}},en={style:{padding:"4px"}},tn={key:0,class:"view"},nn={style:{padding:"16px 0 32px"}},an={key:0,class:"preview-switch"},rn=Y({__name:"stackView",props:{tabIdx:{},paneIdx:{},path:{},walkModePath:{},stackKey:{}},setup(r){const o=r,_=nt(),{scroller:f,stackViewEl:b,props:h,multiSelectedIdxs:y,spinning:S}=Mt().toRefs(),{currLocation:P,currPage:I,refresh:p,copyLocation:s,back:g,openNext:k,stack:m,quickMoveTo:x,addToSearchScanPathAndQuickMove:M,searchPathInfo:$,locInputValue:A,isLocationEditing:R,onLocEditEnter:C,onEditBtnClick:B,share:O,selectAll:j,onCreateFloderBtnClick:G,onWalkBtnClick:E,showWalkButton:ue}=$t(),{gridItems:$e,sortMethodConv:Ae,moreActionsDropdownShow:Z,sortedFiles:K,sortMethod:ee,itemSize:de,loadNextDir:Re,loadNextDirLoading:Be,canLoadNext:De,onScroll:Fe,cellWidth:Q}=At(),{onDrop:Ne,onFileDragStart:Ee,onFileDragEnd:Te}=Rt(),{onFileItemClick:Ve,onContextMenuClick:ce,showGenInfo:H,imageGenInfo:pe,q:ze}=Bt({openNext:k}),{previewIdx:J,onPreviewVisibleChange:Oe,previewing:me,previewImgMove:ve,canPreview:fe}=Dt(),{showMenuIdx:te}=Ft();return at(()=>o,()=>{h.value=o;const l=Nt.get(o.stackKey??"");l&&(m.value=l.slice())},{immediate:!0}),(l,t)=>{const je=vt,Le=ft,Ue=kt,ke=q,be=z,We=bt,qe=gt,ge=Ct,Ge=_t,Ke=oe,Ce=Me,Qe=St,_e=Pt,He=N,Je=W;return d(),F(Je,{spinning:e(S),size:"large"},{default:i(()=>[a(je,{style:{display:"none"}}),u("div",{ref_key:"stackViewEl",ref:b,onDragover:t[24]||(t[24]=v(()=>{},["prevent"])),onDrop:t[25]||(t[25]=v(n=>e(Ne)(n),["prevent"])),class:"container"},[a(Ue,{visible:e(H),"onUpdate:visible":t[1]||(t[1]=n=>T(H)?H.value=n:null),width:"70vw","mask-closable":"",onOk:t[2]||(t[2]=n=>H.value=!1)},{cancelText:i(()=>[]),default:i(()=>[a(Le,{active:"",loading:!e(ze).isIdle},{default:i(()=>[u("div",{style:{width:"100%","word-break":"break-all","white-space":"pre-line","max-height":"70vh",overflow:"auto","z-index":"9999"},onDblclick:t[0]||(t[0]=n=>e(rt)(e(pe)))},[u("div",Wt,c(l.$t("doubleClickToCopy")),1),L(" "+c(e(pe)),1)],32)]),_:1},8,["loading"])]),_:1},8,["visible"]),u("div",qt,[o.walkModePath?(d(),w("div",Gt,[a(We,null,{title:i(()=>[L(c(l.$t("walk-mode-move-message")),1)]),default:i(()=>[a(be,{style:{flex:"1"}},{default:i(()=>[(d(!0),w(ne,null,ae(e(m),(n,D)=>(d(),F(ke,{key:D},{default:i(()=>[u("span",null,c(n.curr==="/"?l.$t("root"):n.curr.replace(/:\/$/,l.$t("drive"))),1)]),_:2},1024))),128))]),_:1})]),_:1})])):(d(),w("div",{key:1,class:"breadcrumb",style:ot({flex:e(R)?1:""})},[e(R)?(d(),F(qe,{key:0,style:{flex:"1"},value:e(A),"onUpdate:value":t[3]||(t[3]=n=>T(A)?A.value=n:null),onClick:t[4]||(t[4]=v(()=>{},["stop"])),onPressEnter:e(C)},null,8,["value","onPressEnter"])):(d(),F(be,{key:1,style:{flex:"1"}},{default:i(()=>[(d(!0),w(ne,null,ae(e(m),(n,D)=>(d(),F(ke,{key:D},{default:i(()=>[u("a",{onClick:v(ye=>e(g)(D),["prevent"])},c(n.curr==="/"?l.$t("root"):n.curr.replace(/:\/$/,l.$t("drive"))),9,Kt)]),_:2},1024))),128))]),_:1})),e(R)?(d(),F(ge,{key:2,size:"small",onClick:e(C),type:"primary"},{default:i(()=>[L(c(l.$t("go")),1)]),_:1},8,["onClick"])):(d(),w("div",Qt,[u("a",{onClick:t[5]||(t[5]=v((...n)=>e(s)&&e(s)(...n),["prevent"])),style:{"margin-right":"4px"}},c(l.$t("copy")),1),u("a",{onClick:t[6]||(t[6]=v((...n)=>e(B)&&e(B)(...n),["prevent","stop"]))},c(l.$t("edit")),1)]))],4)),u("div",Ht,[u("a",{class:"opt",onClick:t[7]||(t[7]=v((...n)=>e(p)&&e(p)(...n),["prevent"]))},c(l.$t("refresh")),1),e(ue)?(d(),w("a",{key:0,class:"opt",onClick:t[8]||(t[8]=v((...n)=>e(E)&&e(E)(...n),["prevent"]))}," Walk ")):V("",!0),u("a",{class:"opt",onClick:t[9]||(t[9]=v((...n)=>e(j)&&e(j)(...n),["prevent","stop"]))},c(l.$t("selectAll")),1),e(st)?V("",!0):(d(),w("a",{key:1,class:"opt",onClick:t[10]||(t[10]=v((...n)=>e(O)&&e(O)(...n),["prevent"]))},c(l.$t("share")),1)),a(Ce,null,{overlay:i(()=>[a(Ke,null,{default:i(()=>[(d(!0),w(ne,null,ae(e(_).quickMovePaths,n=>(d(),F(Ge,{key:n.dir},{default:i(()=>[u("a",{onClick:v(D=>e(x)(n.dir),["prevent"])},c(n.zh),9,Jt)]),_:2},1024))),128))]),_:1})]),default:i(()=>[u("a",{class:"opt",onClick:t[11]||(t[11]=v(()=>{},["prevent"]))},[L(c(l.$t("quickMove"))+" ",1),a(e(Se))])]),_:1}),a(Ce,{trigger:["click"],visible:e(Z),"onUpdate:visible":t[20]||(t[20]=n=>T(Z)?Z.value=n:null),placement:"bottomLeft",getPopupContainer:n=>n.parentNode},{overlay:i(()=>[u("div",Xt,[a(He,lt(it({labelCol:{span:6},wrapperCol:{span:18}})),{default:i(()=>[a(_e,{label:l.$t("gridCellWidth")},{default:i(()=>[a(Qe,{modelValue:e(Q),"onUpdate:modelValue":t[13]||(t[13]=n=>T(Q)?Q.value=n:null),max:1024,min:64,step:64},null,8,["modelValue"])]),_:1},8,["label"]),a(_e,{label:l.$t("sortingMethod")},{default:i(()=>[a(e(ut),{value:e(ee),"onUpdate:value":t[14]||(t[14]=n=>T(ee)?ee.value=n:null),onClick:t[15]||(t[15]=v(()=>{},["stop"])),conv:e(Ae),options:e(dt)},null,8,["value","conv","options"])]),_:1},8,["label"]),u("div",Yt,[e($)?e($).can_delete?(d(),w("a",{key:1,onClick:t[17]||(t[17]=v((...n)=>e(M)&&e(M)(...n),["prevent"]))},c(l.$t("removeFromSearchScanPathAndQuickMove")),1)):V("",!0):(d(),w("a",{key:0,onClick:t[16]||(t[16]=v((...n)=>e(M)&&e(M)(...n),["prevent"]))},c(l.$t("addToSearchScanPathAndQuickMove")),1))]),u("div",Zt,[u("a",{onClick:t[18]||(t[18]=v(n=>e(ct)(e(P)+"/"),["prevent"]))},c(l.$t("openWithLocalFileBrowser")),1)]),u("div",en,[u("a",{onClick:t[19]||(t[19]=v((...n)=>e(G)&&e(G)(...n),["prevent"]))},c(l.$t("createFolder")),1)])]),_:1},16)])]),default:i(()=>[u("a",{class:"opt",onClick:t[12]||(t[12]=v(()=>{},["prevent"]))},c(l.$t("more")),1)]),_:1},8,["visible","getPopupContainer"])])]),e(I)?(d(),w("div",tn,[a(e(Et),{class:"file-list",items:e(K),ref_key:"scroller",ref:f,onScroll:e(Fe),"item-size":e(de).first,"key-field":"fullpath","item-secondary-size":e(de).second,gridItems:e($e)},pt({default:i(({item:n,index:D})=>[a(Tt,{idx:parseInt(D),file:n,"full-screen-preview-image-url":e(K)[e(J)]?e(mt)(e(K)[e(J)]):"","show-menu-idx":e(te),"onUpdate:showMenuIdx":t[21]||(t[21]=ye=>T(te)?te.value=ye:null),selected:e(y).includes(D),"cell-width":e(Q),onFileItemClick:e(Ve),onDragstart:e(Ee),onDragend:e(Te),onPreviewVisibleChange:e(Oe),onContextMenuClick:e(ce)},null,8,["idx","file","full-screen-preview-image-url","show-menu-idx","selected","cell-width","onFileItemClick","onDragstart","onDragend","onPreviewVisibleChange","onContextMenuClick"])]),_:2},[o.walkModePath?{name:"after",fn:i(()=>[u("div",nn,[a(ge,{onClick:e(Re),loading:e(Be),block:"",type:"primary",disabled:!e(De),ghost:""},{default:i(()=>[L(c(l.$t("loadNextPage")),1)]),_:1},8,["onClick","loading","disabled"])])]),key:"0"}:void 0]),1032,["items","onScroll","item-size","item-secondary-size","gridItems"]),e(me)?(d(),w("div",an,[a(e(wt),{onClick:t[22]||(t[22]=n=>e(ve)("prev")),class:we({disable:!e(fe)("prev")})},null,8,["class"]),a(e(It),{onClick:t[23]||(t[23]=n=>e(ve)("next")),class:we({disable:!e(fe)("next")})},null,8,["class"])])):V("",!0)])):V("",!0)],544),e(me)?(d(),F(xt,{key:0,file:e(K)[e(J)],idx:e(J),onContextMenuClick:e(ce)},null,8,["file","idx","onContextMenuClick"])):V("",!0)]),_:1},8,["spinning"])}}});const vn=yt(rn,[["__scopeId","data-v-e5dabb69"]]);export{vn as default}; diff --git a/vue/dist/index.html b/vue/dist/index.html index 99995eb..298e701 100644 --- a/vue/dist/index.html +++ b/vue/dist/index.html @@ -7,7 +7,7 @@ Infinite Image Browsing - + diff --git a/vue/src/api/db.ts b/vue/src/api/db.ts index f3d2040..4b494d8 100644 --- a/vue/src/api/db.ts +++ b/vue/src/api/db.ts @@ -1,6 +1,7 @@ import { Dict } from '@/util' import type { FileNodeInfo } from './files' import { axiosInst } from './index' +import { PageCursor } from 'vue3-ts-util' export interface Tag { name: string @@ -37,9 +38,15 @@ export interface MatchImageByTagsReq { not_tags: number[] } -export const getImagesByTags = async (req: MatchImageByTagsReq) => { - const resp = await axiosInst.value.post('/db/match_images_by_tags', req) - return resp.data as FileNodeInfo[] +export const getImagesByTags = async (req: MatchImageByTagsReq, cursor: string) => { + const resp = await axiosInst.value.post('/db/match_images_by_tags', { + ...req, + cursor + }) + return resp.data as { + files: FileNodeInfo[], + cursor: PageCursor + } } export const addCustomTag = async (req: { tag_name: string }) => { @@ -65,9 +72,12 @@ export const getImageSelectedCustomTag = async (path: string) => { return resp.data as Tag[] } -export const getImagesBySubstr = async (substr: string) => { - const resp = await axiosInst.value.get('/db/search_by_substr', { params: { substr } }) - return resp.data as FileNodeInfo[] +export const getImagesBySubstr = async (substr: string, cursor: string) => { + const resp = await axiosInst.value.get('/db/search_by_substr', { params: { substr,cursor } }) + return resp.data as { + files: FileNodeInfo[], + cursor: PageCursor + } } const scannedPaths = `/db/scanned_paths` diff --git a/vue/src/page/TagSearch/MatchedImageGrid.vue b/vue/src/page/TagSearch/MatchedImageGrid.vue index 1d7b362..c70e622 100644 --- a/vue/src/page/TagSearch/MatchedImageGrid.vue +++ b/vue/src/page/TagSearch/MatchedImageGrid.vue @@ -9,7 +9,16 @@ import { nextTick, watch } from 'vue' import { copy2clipboardI18n } from '@/util' import fullScreenContextMenu from '@/page/fileTransfer/fullScreenContextMenu.vue' import { LeftCircleOutlined, RightCircleOutlined } from '@/icon' -import { useImageSearch } from './hook' +import { useImageSearch, createImageSearchIter } from './hook' + +const props = defineProps<{ + tabIdx: number + paneIdx: number + selectedTagIds: MatchImageByTagsReq + id: string +}>() + +const iter = createImageSearchIter(cursor => getImagesByTags(props.selectedTagIds, cursor)) const { queue, images, @@ -33,24 +42,15 @@ const { onFileDragEnd, cellWidth, onScroll, - updateImageTag -} = useImageSearch() - -const props = defineProps<{ - tabIdx: number - paneIdx: number - selectedTagIds: MatchImageByTagsReq - id: string -}>() +} = useImageSearch(iter) watch( () => props.selectedTagIds, async () => { - const { res } = queue.pushAction(() => getImagesByTags(props.selectedTagIds)) - images.value = await res + await iter.reset() await nextTick() - updateImageTag() scroller.value!.scrollToItem(0) + onScroll() // 重新获取 }, { immediate: true } ) diff --git a/vue/src/page/TagSearch/SubstrSearch.vue b/vue/src/page/TagSearch/SubstrSearch.vue index 71995a1..b1ceb7c 100644 --- a/vue/src/page/TagSearch/SubstrSearch.vue +++ b/vue/src/page/TagSearch/SubstrSearch.vue @@ -11,7 +11,10 @@ import fullScreenContextMenu from '@/page/fileTransfer/fullScreenContextMenu.vue import { LeftCircleOutlined, RightCircleOutlined } from '@/icon' import { message } from 'ant-design-vue' import { t } from '@/i18n' -import { useImageSearch } from './hook' +import { createImageSearchIter, useImageSearch } from './hook' + +const substr = ref('') +const iter = createImageSearchIter(cursor => getImagesBySubstr(substr.value, cursor)) const { queue, images, @@ -34,10 +37,8 @@ const { onFileDragStart, onFileDragEnd, cellWidth, - onScroll, - updateImageTag -} = useImageSearch() -const substr = ref('') + onScroll +} = useImageSearch(iter) const info = ref() @@ -57,9 +58,9 @@ const onUpdateBtnClick = makeAsyncFunctionSingle( }).res ) const query = async () => { - images.value = await queue.pushAction(() => getImagesBySubstr(substr.value)).res + await iter.reset({ refetch: true }) await nextTick() - updateImageTag() + onScroll() scroller.value!.scrollToItem(0) if (!images.value.length) { message.info(t('fuzzy-search-noResults')) diff --git a/vue/src/page/TagSearch/hook.ts b/vue/src/page/TagSearch/hook.ts index 3b57d40..5c414cb 100644 --- a/vue/src/page/TagSearch/hook.ts +++ b/vue/src/page/TagSearch/hook.ts @@ -1,7 +1,6 @@ -import type { FileNodeInfo } from '@/api/files' import { createReactiveQueue } from '@/util' import { identity } from 'lodash-es' -import { ref } from 'vue' +import { reactive, computed } from 'vue' import { useHookShareState, useFilesDisplay, @@ -11,15 +10,25 @@ import { usePreview, useEventListen } from '../fileTransfer/hook' -import { useTagStore } from '@/store/useTagStore' -import { debounce } from 'lodash-es' +import { makeAsyncIterator } from 'vue3-ts-util' +import { getImagesByTags } from '@/api/db' -export const useImageSearch = () => { - const images = ref() +export const createImageSearchIter = ( + fetchfn: (cursor: string) => ReturnType +) => { + return reactive(makeAsyncIterator(fetchfn, (v) => v.files, { + dataUpdateStrategy: 'merge' + })) +} + +export const useImageSearch = (iter: ReturnType) => { + const deletedImagePahts = reactive(new Set()) + const images = computed(() => (iter.res ?? []).filter((v) => !deletedImagePahts.has(v.fullpath))) const queue = createReactiveQueue() - const tagStore = useTagStore() - const { stackViewEl, multiSelectedIdxs, stack, scroller } = useHookShareState({ images }).toRefs() - const { itemSize, gridItems, cellWidth } = useFilesDisplay() + const { stackViewEl, multiSelectedIdxs, stack, scroller } = useHookShareState({ + images: images as any + }).toRefs() + const { itemSize, gridItems, cellWidth, onScroll } = useFilesDisplay({ fetchNext: () => iter.next() }) const { showMenuIdx } = useMobileOptimization() const { onFileDragStart, onFileDragEnd } = useFileTransfer() const { @@ -37,25 +46,15 @@ export const useImageSearch = () => { } useEventListen('removeFiles', async ({ paths }) => { - images.value = images.value?.filter((v) => !paths.includes(v.fullpath)) + paths.forEach((v) => deletedImagePahts.add(v)) }) - const updateImageTag = () => { - const s = scroller.value - if (s && images.value) { - const paths = images.value - .slice(Math.max(s.$_startIndex - 10, 0), s.$_endIndex + 10) - .map((v) => v.fullpath) - tagStore.fetchImageTags(paths) - } - } - - const onScroll = debounce(updateImageTag, 300) return { + images, scroller, queue, - images, + iter, onContextMenuClickU, stackViewEl, previewIdx, @@ -75,7 +74,6 @@ export const useImageSearch = () => { onFileDragStart, onFileDragEnd, cellWidth, - onScroll, - updateImageTag + onScroll } } diff --git a/vue/src/page/fileTransfer/hook.tsx b/vue/src/page/fileTransfer/hook.tsx index 507f05f..1582c3b 100644 --- a/vue/src/page/fileTransfer/hook.tsx +++ b/vue/src/page/fileTransfer/hook.tsx @@ -589,7 +589,7 @@ export function useLocation () { } } -export function useFilesDisplay () { +export function useFilesDisplay ({ fetchNext }: {fetchNext?: () => Promise} = { }) { const { scroller, sortedFiles, @@ -633,23 +633,33 @@ export function useFilesDisplay () { } } - const fill = async (isFullScreenPreview = false) => { - const s = scroller.value // 填充够一页,直到不行为止 + const fetchDataUntilViewFilled = async (isFullScreenPreview = false) => { + const s = scroller.value const currIdx = () => (isFullScreenPreview ? previewIdx.value : s?.$_endIndex ?? 0) - while ( - !sortedFiles.value.length || - (currIdx() > sortedFiles.value.length - 20 && canLoadNext.value) - ) { + const needLoad = () => { + const len = sortedFiles.value.length + if (!len) { + return true + } + if (fetchNext) { + return currIdx() > len - 20 + } + return currIdx() > len - 20 && canLoadNext.value // canLoadNext 是walker的,表示加载完成 + } + while (needLoad()) { + const ret = await (fetchNext ?? loadNextDir)() + if (typeof ret === 'boolean' && !ret) { + return // 返回false同样表示加载完成 + } await delay(30) - await loadNextDir() } } - state.useEventListen('loadNextDir', fill) + state.useEventListen('loadNextDir', fetchDataUntilViewFilled) - const onViewedImagesChange = () => { + const updateViewingImagesTag = () => { const s = scroller.value if (s) { const paths = sortedFiles.value.slice(Math.max(s.$_startIndex - 10, 0), s.$_endIndex + 10) @@ -659,12 +669,12 @@ export function useFilesDisplay () { } } - watch(currLocation, debounce(onViewedImagesChange, 150)) + watch(currLocation, debounce(updateViewingImagesTag, 150)) - const onScroll = debounce(() => { - fill() - onViewedImagesChange() - }, 300) + const onScroll = debounce(async () => { + await fetchDataUntilViewFilled() + updateViewingImagesTag() + }, 150) return { gridItems, @@ -678,8 +688,7 @@ export function useFilesDisplay () { loadNextDirLoading, canLoadNext, itemSize, - cellWidth, - onViewedImagesChange + cellWidth } }