import{D as u,n as y,c as m,B as c}from"./vendor-mini-lit-CpUQub-j.js";import{b as p,r as d,t as h}from"./vendor-lit-B2r-dKc0.js";import"./vendor-lucide-B9Yl1Gez.js";import"./vendor-marked-_iteVaMm.js";var f=Object.defineProperty,b=Object.getOwnPropertyDescriptor,n=(t,r,e,o)=>{for(var i=o>1?void 0:o?b(r,e):r,s=t.length-1,a;s>=0;s--)(a=t[s])&&(i=(o?a(r,e,i):a(i))||i);return o&&i&&f(r,e,i),i};let l=class extends u{constructor(){super(...arguments),this.url="",this.dialogTitle="Copy session link",this.modalWidth="min(520px, 92vw)",this.modalHeight="auto"}createRenderRoot(){return this}static show(t,r){const e=new l;e.url=t,e.dialogTitle=r?.title||"Copy session link",document.body.appendChild(e),e.open(),queueMicrotask(()=>{const o=e.querySelector("input[data-copy-link-input]");o&&(o.focus(),o.select())})}async copy(){try{await navigator.clipboard.writeText(this.url)}catch{const t=this.querySelector("input[data-copy-link-input]");if(t){t.focus(),t.select();try{document.execCommand("copy")}catch{}}}}renderContent(){return p`
			${y({className:"flex flex-col",children:p`
					${m({title:this.dialogTitle,description:"Press Ctrl/Cmd+C to copy, or use the button below."})}
					<div class="mt-4">
						<input
							type="text"
							readonly
							data-copy-link-input
							data-testid="copy-link-fallback-input"
							class="w-full px-3 py-2 text-sm font-mono border border-border rounded bg-muted text-foreground"
							.value=${this.url}
							@click=${t=>t.target.select()}
						/>
					</div>
					<div class="mt-4 flex justify-end gap-2 border-t border-border pt-3">
						${c({variant:"outline",size:"sm",onClick:()=>this.close(),children:"Close"})}
						${c({variant:"default",size:"sm",onClick:()=>this.copy(),children:"Copy"})}
					</div>
				`})}
		`}};n([d()],l.prototype,"url",2);n([d()],l.prototype,"dialogTitle",2);l=n([h("copy-link-fallback-dialog")],l);export{l as CopyLinkFallbackDialog};
