import{r as a,d as r,h as e,a as t}from"./p-a599f720.js";import{i as c,e as o}from"./p-9811c98c.js";import{d as i}from"./p-40be18ee.js";import{S as s}from"./p-af705ed1.js";import{f as d,a as n}from"./p-6f211c3e.js";var l=function(a,r,e,t){var c,o=arguments.length,i=o<3?r:null===t?t=Object.getOwnPropertyDescriptor(r,e):t;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(a,r,e,t);else for(var s=a.length-1;s>=0;s--)(c=a[s])&&(i=(o<3?c(i):o>3?c(r,e,i):c(r,e))||i);return o>3&&i&&Object.defineProperty(r,e,i),i};const b=class{constructor(e){a(this,e),this.close=r(this,"close",7),this.t=c(),this.iconPack=o,this.keypressListener=a=>{"Escape"===a.key&&this.close.emit()},this.handleOutsideClick=()=>this.close.emit()}connectedCallback(){document.addEventListener("keydown",this.keypressListener),document.addEventListener("click",this.handleOutsideClick)}disconnectedCallback(){document.removeEventListener("keydown",this.keypressListener),document.removeEventListener("click",this.handleOutsideClick)}render(){return e(t,{key:"09122e4d61355092a9c82bc337ea002a6c2acd58",class:"scrollbar",onClick:a=>a.stopPropagation()},e("div",{key:"2c6c3f705abf067d866e02b81c4b3d610f09fede",class:"header"},e("div",{key:"66cd4c200a2e8704acdf75d8830c94ac2abdc6be",class:"shared-by-user"},this.t("chat.img.shared_by")," ",e("span",{key:"3b4a866b673f35a454e7115fdc5c915d68966b1d",class:"displayName"},d(n(this.image.displayName)))),e("div",{key:"29e0e95e3e3d3b36917745a8f0a47beb9b5e3f02",class:"actions"},e("rtk-button",{key:"5cd7383e265a02c8b57a0f712e9e445495498c32",onClick:()=>i(this.image.link,{fallbackName:"image"})},e("rtk-icon",{key:"b098e89f707cc4cf413a620319e0eb2fd10b729a",icon:this.iconPack.download,slot:"start"}),"Download"),e("rtk-button",{key:"2cd6b7c21f0357d3104618d96d853d8bd8fcc542",kind:"icon",variant:"secondary",onClick:()=>this.close.emit()},e("rtk-icon",{key:"891428595d7a61c5400dc884bf8e1a501009eed5",icon:this.iconPack.dismiss})))),e("div",{key:"6194a26ac1357b93776b1c77ff72d1502151d619",class:"image-ctr"},e("img",{key:"24f21e7fff100bea8e79d261f180a57dc14fa5f4",src:this.image.link})))}};l([s()],b.prototype,"t",void 0),l([s()],b.prototype,"iconPack",void 0),b.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}.scrollbar{scrollbar-width:thin;scrollbar-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))\n    var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar{height:var(--rtk-space-1\\.5, 6px);width:var(--rtk-space-1\\.5, 6px);border-radius:9999px;background-color:var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar-thumb{border-radius:9999px;background-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))}:host{width:1140px;max-width:100%;box-sizing:border-box;display:flex;flex-direction:column;padding:var(--rtk-space-6, 24px);padding-top:var(--rtk-space-5, 20px);overflow-y:auto;color:rgb(var(--rtk-colors-text-1000, 255 255 255));z-index:40;border-radius:var(--rtk-border-radius-md, 8px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-900, 26 26 26) / var(--tw-bg-opacity))}.displayName{font-weight:700}.image-ctr{margin-top:var(--rtk-space-2, 8px);box-sizing:border-box;display:flex;justify-content:center;overflow:hidden}.actions{display:flex;align-items:center;justify-content:flex-end;gap:var(--rtk-space-2, 8px)}img{box-sizing:border-box;display:block;max-height:100%;max-width:100%;-o-object-fit:contain;object-fit:contain}.header{display:flex;align-items:center;justify-content:space-between;padding-bottom:var(--rtk-space-4, 16px)}.shared-by-user{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}:host([size='sm']) .header{flex-direction:column}:host([size='sm']) .header .actions{margin-top:var(--rtk-space-4, 16px)}";export{b as rtk_image_viewer}