import{$ as e,C as t,G as n,L as r,U as i,Wt as a,_ as o,d as s,dt as c,g as l,h as u,r as d,u as f,v as p,y as m,z as h,zt as g}from"./vue.runtime.esm-bundler-DAWRyTnP.js";import{t as _}from"./notification-BM55Quw3.js";import{t as v}from"./_plugin-vue_export-helper-B7aGp3iI.js";var y={class:`overflow-hidden rounded-lg shadow-xs`},b={class:`p-4`},x={class:`flex items-start`},S={class:`shrink-0`},C={key:0,class:`w-6 h-6 text-green-400`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`},w={key:1,class:`w-6 h-6 text-blue-400`,fill:`currentColor`,viewBox:`0 0 20 20`,xmlns:`http://www.w3.org/2000/svg`},T={key:2,class:`w-6 h-6 text-red-400`,fill:`currentColor`,viewBox:`0 0 24 24`},E={class:`flex-1 w-0 ml-3 text-left`},D={class:`flex shrink-0`},O={components:{NotificationItem:{__name:`NotificationItem`,props:{notification:{type:Object,default:null}},setup(e){let t=e,n=_(),i=c(``),o=u(()=>t.notification.type==`success`),s=u(()=>t.notification.type==`error`),d=u(()=>t.notification.type==`info`);function v(){n.hideNotification(t.notification)}function O(){clearTimeout(i)}function k(){i.value=setTimeout(()=>{n.hideNotification(t.notification)},t.notification.time||5e3)}return r(()=>{k()}),(t,n)=>(h(),m(`div`,{class:g([o.value||d.value?`bg-white`:`bg-red-50`,`max-w-sm mb-3 rounded-lg shadow-lg cursor-pointer pointer-events-auto w-full md:w-96`]),onClick:f(v,[`stop`]),onMouseenter:O,onMouseleave:k},[l(`div`,y,[l(`div`,b,[l(`div`,x,[l(`div`,S,[o.value?(h(),m(`svg`,C,[...n[0]||=[l(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z`},null,-1)]])):p(``,!0),d.value?(h(),m(`svg`,w,[...n[1]||=[l(`path`,{"fill-rule":`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z`,"clip-rule":`evenodd`},null,-1)]])):p(``,!0),s.value?(h(),m(`svg`,T,[...n[2]||=[l(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z`,"clip-rule":`evenodd`},null,-1)]])):p(``,!0)]),l(`div`,E,[l(`p`,{class:g(`text-sm leading-5 font-medium ${o.value||d.value?`text-gray-900`:`text-red-800`}`)},a(e.notification.title?e.notification.title:o.value?`Success!`:`Error`),3),l(`p`,{class:g(`mt-1 text-sm leading-5 ${o.value||d.value?`text-gray-500`:`text-red-700`}`)},a(e.notification.message?e.notification.message:o.value?`Successful`:`Something went wrong`),3)]),l(`div`,D,[l(`button`,{class:g([o.value||d.value?` text-gray-400 focus:text-gray-500`:`text-red-400 focus:text-red-500`,`inline-flex w-5 h-5 transition duration-150 ease-in-out focus:outline-hidden`]),onClick:v},[...n[3]||=[l(`svg`,{class:`w-6 h-6`,fill:`currentColor`,viewBox:`0 0 20 20`,xmlns:`http://www.w3.org/2000/svg`},[l(`path`,{"fill-rule":`evenodd`,d:`M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z`,"clip-rule":`evenodd`})],-1)]],2)])])])])],34))}}},setup(){let e=_();return{notifications:u(()=>e.notifications)}}},k={class:`fixed inset-0 z-50 flex flex-col items-end justify-start w-full px-4 py-6 pointer-events-none sm:p-6`};function A(r,a,c,l,u,f){let p=n(`NotificationItem`);return h(),m(`div`,k,[t(d,{"enter-active-class":`transition duration-300 ease-out`,"enter-from-class":`translate-y-2 opacity-0 sm:translate-y-0 sm:translate-x-2`,"enter-to-class":`translate-y-0 opacity-100 sm:translate-x-0`,"leave-active-class":`transition duration-100 ease-in`,"leave-from-class":`opacity-100`,"leave-to-class":`opacity-0`},{default:e(()=>[(h(!0),m(s,null,i(l.notifications,e=>(h(),o(p,{key:e.id,notification:e},null,8,[`notification`]))),128))]),_:1})])}var j=v(O,[[`render`,A]]);export{j as t};