import{aT as C,J as k,Q as E,aU as $,d as w,v as A,g as B,e as _,l as p,o as d,a as m,w as t,b as f,c as R,t as a,s as T,m as n,n as h,_ as U,E as D,q as I,ay as N}from"./Dk4AzF7j.js";import{_ as V}from"./BnFHREeV.js";const x=()=>{const{text:i,copy:o,copied:s}=C(),{t:c}=k(),l=E();return $(s,()=>{s.value&&l.add({title:c("clipboardCopied"),icon:"i-heroicons-check-circle",color:"success"})},{throttle:600}),{text:i,copy:o}},z={key:0,class:"transition-discrete starting:o_opacity-0 starting:blur-sm starting:pointer-events-none ending:o_opacity-100 ending:blur-none ending:pointer-events-auto delay-700 duration-1000 ease-in-out"},q={class:"max-w-prose text-sm"},P={key:0,class:"text-xs o_mt-3 rounded-md bg-uiError/10 outline outline-uiError/20 o_p-2 max-w-prose"},S={class:"break-all o_mb-2"},j=w({__name:"DisplayApiError",props:{error:{},refresh:{},withRefresh:{type:Boolean,default:!0}},setup(i){const o=i,s=A(!1),c=N(()=>{o.refresh(),s.value=!1},2e3),l=()=>{s.value=!0,c()},{copy:g}=x(),y=B(()=>o.withRefresh?!!["408","403","429"].find(r=>o.error.message.includes(r)):!1);return(e,u)=>{const r=T,b=U,v=V;return e.error?(d(),_("div",z,[m(v,{color:"error",variant:"subtle",icon:"mdi:alarm-light",size:"sm",title:e.$t("UniversalAPIErrorTitle"),ui:{icon:"animate-pulse"}},{description:t(()=>[f("p",q,a(e.$t("UniversalAPIError")),1),e.error.message?(d(),_("div",P,[f("p",S,a(e.error.message),1),m(r,{color:"error",variant:"solid",type:"button",size:"sm",onClick:u[0]||(u[0]=F=>n(g)(e.error.message))},{default:t(()=>[h(a(e.$t("CopyErrorMessage")),1)]),_:1})])):p("",!0),n(y)?(d(),R(r,{key:1,color:"error",variant:"solid",type:"button",onClick:l},{trailing:t(()=>[m(b,{name:n(I).icoRefresh,class:D({"animate-spin":n(s)})},null,8,["name","class"])]),default:t(()=>[h(a(e.$t("RefreshingApi"))+" ",1)]),_:1})):p("",!0)]),_:1},8,["title"])])):p("",!0)}}}),M=Object.assign(j,{__name:"DisplayApiError"});export{M as _,x as u};
