import{d as B,r as X,x as Y,O as z,c as i,h as u,f as s,e as l,w as t,j as _,F as V,i as h,_ as R,u as d,an as j,N as A,D as E,a5 as F,W as p,t as y,ai as S,b as v}from"./index-B3YJYWuL.js";import{d as I}from"./VCheckbox-D78puUFe.js";import{C as H}from"./Container-Bdq9NOs-.js";import{T as O}from"./Toolbar-CHKFZ92z.js";import{e as U}from"./eventbus-DvpacjVb.js";import{V as W}from"./VList-BLfQAYp3.js";import{V as k,a as q}from"./ItemsListing-DtfmXfFy.js";import{V as G}from"./VCard-RO2j5jca.js";import{x as J,z as K,V as Q,A as Z,B as ee,w as te}from"./VListItem-cb3L497C.js";import{V as oe}from"./PanelviewItemCompact-CcNCJwVO.js";import{_ as ae}from"./_plugin-vue_export-helper-DlAUqK2U.js";const se={style:{"margin-bottom":"10px"}},ie=B({__name:"MediaItemImages",props:{modelValue:{}},emits:["update:modelValue"],setup(w,{emit:b}){const C=w,m=X(!1),x=b,P=function(e){window.open(e,"_blank")},f=function(e,o){const n="clientX"in e?e.clientX:e.touches[0].clientX,c="clientY"in e?e.clientY:e.touches[0].clientY;U.emit("contextmenu",{items:[{label:"image_make_primary",icon:"mdi-star-box",action:()=>{N(o)}}],posX:n,posY:c})},M=function(e){return v.getProvider(e)?v.getProvider(e).name:e},L=function(e,o){P(I(o))},g=function(){m.value=!m.value},N=function(e){console.log("MakeImagePrimary",e);const o=[e];o.push(...C.modelValue.filter(n=>n!=e)),x("update:modelValue",o)},T=Y(()=>[{label:"tooltip.collapse_expand",icon:m.value?"mdi-chevron-up":"mdi-chevron-down",action:g,overflowAllowed:!1}]);return(e,o)=>{const n=z("hold");return i(),u("section",se,[s(O,{title:e.$t("images"),"menu-items":T.value,onTitleClicked:g},null,8,["title","menu-items"]),s(W),m.value?(i(),l(H,{key:0},{default:t(()=>[(i(!0),u(V,null,h(d(S),c=>(i(),l(k,{key:c},{default:t(()=>[(i(!0),u(V,null,h(e.modelValue.filter(a=>a.type==c),(a,$)=>(i(),l(q,{key:a.path,cols:"12",class:R(`col-${d(j)(e.$vuetify.display.width)}`)},{default:t(()=>[s(oe,null,{default:t(({props:D})=>[A((i(),l(G,E({ref_for:!0},D,{tile:"",hover:"",class:"panel-item",onClick:r=>{L(r,a)},onContextmenu:F(r=>{f(r,a)},["right","prevent"])}),{default:t(()=>[s(J,{src:d(I)(a,256),class:"bg-grey-lighten-2",width:"100%"},{placeholder:t(()=>[s(k,{align:"center",class:"fill-height ma-0",justify:"center"},{default:t(()=>[s(K,{color:"grey-lighten-5",indeterminate:""})]),_:1})]),_:2},1032,["src"]),s(Q,{variant:"text",slim:"",tile:"",density:"compact",class:"panel-item-details"},{default:t(()=>[s(Z,{width:"95%"},{default:t(()=>[p(y(e.$t("image_type")+": "+a.type),1)]),_:2},1024),s(ee,{class:"line-clamp-1",style:{"margin-right":"25px"}},{default:t(()=>[p(y(e.$t("image_source")+": "+M(a.provider)),1)]),_:2},1024),$==0?(i(),l(te,{key:0,size:"x-large",style:{position:"absolute",right:"0",bottom:"5px"},color:"orange",title:e.$t("tooltip.primary_image")},{default:t(()=>o[0]||(o[0]=[p("mdi-star-box")])),_:1},8,["title"])):_("",!0)]),_:2},1024)]),_:2},1040,["onClick","onContextmenu"])),[[n,r=>{f(r,a)}]])]),_:2},1024)]),_:2},1032,["class"]))),128))]),_:2},1024))),128))]),_:1})):_("",!0)])}}}),Ve=ae(ie,[["__scopeId","data-v-9e541720"]]);export{Ve as M};
