import{L as e,U as t,_ as n,bt as r,dt as i,nt as a,p as o,qt as s,u as c,v as l,z as u}from"./runtime-core.esm-bundler.v79eHMSw.js";import{t as d}from"./notification.Fq1yjFBe.js";import{t as f}from"./check.6zpAZ2Aa.js";import{t as p}from"./copy.CRB8JHf1.js";import{t as m}from"./i18n.DdD8a55v.js";import{t as h}from"./_plugin-vue_export-helper.BDNMzG2s.js";var g={class:`smb2b-shortcodechip`},_=h({__name:`ShortcodeChip`,props:{code:{type:String,required:!0}},setup(h){let _=h,v=i(!1),y=null,b=async()=>{try{await navigator.clipboard.writeText(_.code),v.value=!0,clearTimeout(y),y=setTimeout(()=>{v.value=!1},1500)}catch{d({type:`error`,message:m(`Copy failed — select the code and copy manually.`)})}};return e(()=>clearTimeout(y)),(e,i)=>{let d=t(`el-button`);return u(),o(`div`,g,[c(`code`,null,s(h.code),1),l(d,{size:`small`,icon:v.value?r(f):r(p),onClick:b},{default:a(()=>[n(s(v.value?r(m)(`Copied`):r(m)(`Copy`)),1)]),_:1},8,[`icon`])])}}},[[`__scopeId`,`data-v-0e45f5aa`]]);export{_ as t};