import{d as ce,m as F,ax as re,$ as pe,S as p,T as I,c as s,a2 as e,a1 as n,a4 as R,U as d,J as ue,W as o,V as m,a0 as V,ad as me,Y as k,ae as G,ag as ge,R as fe,ai as z,aN as ve,aO as he,bD as Ie,Z as ke}from"./index-93a218ca.js";import{S as _e}from"./index-c7fe1b25.js";import{L as Ce,R as we,f as Se,M as be}from"./MultiSelectKeep-e20b5f46.js";import{c as xe,d as ye,F as Me}from"./FileItem-9a94f7dd.js";import{c as Ae,u as De}from"./hook-983826b5.js";import{a as Te}from"./functionalCallableComp-685da399.js";import"./shortcut-ff09b8ec.js";import"./index-4596f42d.js";/* empty css              */import"./index-f60e0de3.js";const $e=c=>(ve("data-v-caebce58"),c=c(),he(),c),Fe={class:"hint"},Re={class:"action-bar"},Ve=$e(()=>d("div",{style:{padding:"16px 0 512px"}},null,-1)),Ge={key:1},ze={class:"no-res-hint"},Be={class:"hint"},Ne={key:2,class:"preview-switch"},Ue=ce({__name:"MatchedImageGrid",props:{tabIdx:{},paneIdx:{},selectedTagIds:{},id:{}},setup(c){const g=c,f=Ae(t=>Ie(g.selectedTagIds,t)),{queue:B,images:i,onContextMenuClickU:_,stackViewEl:N,previewIdx:r,previewing:C,onPreviewVisibleChange:U,previewImgMove:w,canPreview:S,itemSize:b,gridItems:J,showGenInfo:u,imageGenInfo:x,q:E,multiSelectedIdxs:v,onFileItemClick:L,scroller:y,showMenuIdx:h,onFileDragStart:O,onFileDragEnd:P,cellWidth:K,onScroll:M,saveAllFileAsJson:W,props:q,saveLoadedFileAsJson:Q,changeIndchecked:Y,seedChangeChecked:Z,getGenDiff:j,getGenDiffWatchDep:H}=De(f);F(()=>g.selectedTagIds,async()=>{var t;await f.reset(),await re(),(t=y.value)==null||t.scrollToItem(0),M()},{immediate:!0}),F(()=>g,async t=>{q.value=t},{deep:!0,immediate:!0});const X=pe(),{onClearAllSelected:ee,onSelectAll:te,onReverseSelect:le}=xe();return(t,l)=>{const se=be,ne=ge,ae=fe,A=z,ie=z,oe=_e;return p(),I("div",{class:"container",ref_key:"stackViewEl",ref:N},[s(se,{show:!!e(v).length||e(X).keepMultiSelect,onClearAllSelected:e(ee),onSelectAll:e(te),onReverseSelect:e(le)},null,8,["show","onClearAllSelected","onSelectAll","onReverseSelect"]),s(oe,{size:"large",spinning:!e(B).isIdle},{default:n(()=>{var D,T;return[s(ae,{visible:e(u),"onUpdate:visible":l[1]||(l[1]=a=>R(u)?u.value=a:null),width:"70vw","mask-closable":"",onOk:l[2]||(l[2]=a=>u.value=!1)},{cancelText:n(()=>[]),default:n(()=>[s(ne,{active:"",loading:!e(E).isIdle},{default:n(()=>[d("div",{style:{width:"100%","word-break":"break-all","white-space":"pre-line","max-height":"70vh",overflow:"auto"},onDblclick:l[0]||(l[0]=a=>e(ue)(e(x)))},[d("div",Fe,o(t.$t("doubleClickToCopy")),1),m(" "+o(e(x)),1)],32)]),_:1},8,["loading"])]),_:1},8,["visible"]),d("div",Re,[s(A,{onClick:e(Q)},{default:n(()=>[m(o(t.$t("saveLoadedImageAsJson")),1)]),_:1},8,["onClick"]),s(A,{onClick:e(W)},{default:n(()=>[m(o(t.$t("saveAllAsJson")),1)]),_:1},8,["onClick"])]),(D=e(i))!=null&&D.length?(p(),V(e(ye),{key:0,ref_key:"scroller",ref:y,class:"file-list",items:e(i),"item-size":e(b).first,"key-field":"fullpath","item-secondary-size":e(b).second,gridItems:e(J),onScroll:e(M)},{after:n(()=>[Ve]),default:n(({item:a,index:$})=>[s(Me,{idx:$,file:a,"cell-width":e(K),"show-menu-idx":e(h),"onUpdate:showMenuIdx":l[3]||(l[3]=de=>R(h)?h.value=de:null),onDragstart:e(O),onDragend:e(P),onFileItemClick:e(L),"full-screen-preview-image-url":e(i)[e(r)]?e(me)(e(i)[e(r)]):"",selected:e(v).includes($),onContextMenuClick:e(_),onPreviewVisibleChange:e(U),"is-selected-mutil-files":e(v).length>1,"enable-change-indicator":e(Y),"seed-change-checked":e(Z),"get-gen-diff":e(j),"get-gen-diff-watch-dep":e(H)},null,8,["idx","file","cell-width","show-menu-idx","onDragstart","onDragend","onFileItemClick","full-screen-preview-image-url","selected","onContextMenuClick","onPreviewVisibleChange","is-selected-mutil-files","enable-change-indicator","seed-change-checked","get-gen-diff","get-gen-diff-watch-dep"])]),_:1},8,["items","item-size","item-secondary-size","gridItems","onScroll"])):e(f).load&&t.selectedTagIds.and_tags.length===1&&!((T=t.selectedTagIds.folder_paths_str)!=null&&T.trim())?(p(),I("div",Ge,[d("div",ze,[d("p",Be,o(t.$t("tagSearchNoResultsMessage")),1),s(ie,{onClick:l[4]||(l[4]=a=>e(Te)()),type:"primary"},{default:n(()=>[m(o(t.$t("rebuildImageIndex")),1)]),_:1})])])):k("",!0),e(C)?(p(),I("div",Ne,[s(e(Ce),{onClick:l[5]||(l[5]=a=>e(w)("prev")),class:G({disable:!e(S)("prev")})},null,8,["class"]),s(e(we),{onClick:l[6]||(l[6]=a=>e(w)("next")),class:G({disable:!e(S)("next")})},null,8,["class"])])):k("",!0)]}),_:1},8,["spinning"]),e(C)&&e(i)&&e(i)[e(r)]?(p(),V(Se,{key:0,file:e(i)[e(r)],idx:e(r),onContextMenuClick:e(_)},null,8,["file","idx","onContextMenuClick"])):k("",!0)],512)}}});const Ze=ke(Ue,[["__scopeId","data-v-caebce58"]]);export{Ze as default};
