UNPKG

tailvue

Version:

windicss, tailwindcss and unocss components for Vue

3 lines (2 loc) 45.8 kB
(function(x,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],o):(x=typeof globalThis<"u"?globalThis:x||self,o(x.tailvue={},x.Vue))})(this,function(x,o){"use strict";const Q=[{name:"white",primary:"border border-gray-300 shadow-sm font-medium rounded text-gray-700 bg-white",dark:"dark:border-gray-600 dark:bg-gray-700 dark:text-gray-400 hover:dark:bg-gray-600 dark:ring-offset-gray-800",active:"hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500",disabled:""},{name:"dark",primary:"border border-gray-600 shadow-sm font-medium rounded text-gray-400 bg-gray-700",active:"hover:bg-gray-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 ring-offset-gray-800",disabled:""},{name:"white-left",primary:"border border-gray-300 shadow-sm font-medium rounded-l-md text-gray-700 bg-white",dark:"dark:border-gray-600 dark:bg-gray-700 dark:text-gray-400 hover:dark:bg-gray-500 dark:ring-offset-gray-800",active:"hover:bg-gray-50 focus:z-10 focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500",disabled:""},{name:"white-mid",primary:"-ml-px relative inline-flex items-center border border-gray-300 shadow-sm font-medium text-gray-700 bg-white",dark:"dark:border-gray-600 dark:bg-gray-700 dark:text-gray-400 hover:dark:bg-gray-500 dark:ring-offset-gray-800",active:"hover:bg-gray-50 focus:z-10 focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500",disabled:""},{name:"white-right",primary:"-ml-px border border-gray-300 shadow-sm font-medium rounded-r-md text-gray-700 bg-white",dark:"dark:border-gray-600 dark:bg-gray-700 dark:text-gray-400 hover:dark:bg-gray-500 dark:ring-offset-gray-800",active:"hover:bg-gray-50 focus:z-10 focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500",disabled:""},{name:"text",primary:"text-gray-700",active:"hover:text-gray-500 hover:bg-gray-100 focus:outline-none active:text-gray-800 active:bg-gray-50"},{name:"indigo",primary:"border border-transparent font-medium rounded shadow-sm text-white bg-indigo-600",active:"hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500",disabled:""},{name:"indigo-light",primary:"text-indigo-700 bg-indigo-100",active:"hover:bg-indigo-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-300 active:bg-indigo-200",disabled:""},{name:"indigo-dark",primary:"text-indigo-200 bg-indigo-900 rounded shadow-sm",active:"hover:bg-indigo-700 hover:text-white focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-300 active:bg-indigo-800",disabled:""},{name:"red",primary:"bg-red-600 border border-transparent font-medium rounded shadow-sm text-white",active:"hover:bg-red-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 focus:shadow-outline-red active:bg-red-700",disabled:""},{name:"yellow",primary:"border border-transparent font-medium rounded shadow-sm text-white bg-yellow-600",active:"hover:bg-yellow-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-yellow-500 focus:shadow-outline-yellow active:bg-yellow-700",disabled:""},{name:"green",primary:"border border-transparent font-medium rounded shadow-sm text-white bg-green-600",active:"hover:bg-green-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500 focus:shadow-outline-green active:bg-green-700",disabled:""},{name:"emerald",primary:"border border-transparent font-medium rounded shadow-sm text-white bg-emerald-600",active:"hover:bg-emerald-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-emerald-500 focus:shadow-outline-emerald active:bg-emerald-700",disabled:""},{name:"teal",primary:"border border-transparent font-medium rounded shadow-sm text-white bg-teal-600",active:"hover:bg-teal-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-teal-500 focus:shadow-outline-teal active:bg-teal-700",disabled:""},{name:"blue",primary:"border border-transparent font-medium rounded shadow-sm text-white bg-blue-600",active:"hover:bg-blue-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 focus:shadow-outline-blue active:bg-blue-700",disabled:""},{name:"light-blue",primary:"border border-transparent font-medium rounded shadow-sm text-white bg-light-blue-600",active:"hover:bg-light-blue-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-light-blue-500 focus:shadow-outline-light-blue active:bg-light-blue-700",disabled:""},{name:"cyan",primary:"border border-transparent font-medium rounded shadow-sm text-white bg-cyan-600",active:"hover:bg-cyan-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-cyan-500 focus:shadow-outline-cyan active:bg-cyan-700",disabled:""},{name:"purple",primary:"border border-transparent font-medium rounded shadow-sm text-white bg-purple-600",active:"hover:bg-purple-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-purple-500 focus:shadow-outline-purple active:bg-purple-700",disabled:""},{name:"pink",primary:"border border-transparent font-medium rounded shadow-sm text-white bg-pink-600",active:"hover:bg-pink-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-pink-500 focus:shadow-outline-pink active:bg-pink-700",disabled:""}],Ge={key:0,class:"absolute top-0 right-0 -mr-1 -mt-1 z-10"},Qe={class:"flex w-3 h-3 relative"},P=o.defineComponent({__name:"PushButton",props:{alwaysClick:Boolean,customTheme:Object,theme:String,state:{type:String,default:"active"},size:{type:String,default:"m"},ping:Boolean,pingColor:{type:String,default:"bg-indigo-500"}},emits:["click"],setup(e,{emit:t}){const n=e,i=o.computed(()=>n.state==="active"),r=o.computed(()=>n.state==="disabled"),s=o.computed(()=>i.value?"cursor-pointer":r.value?"cursor-not-allowed":"cursor-wait"),a={xs:"px-2.5 py-1.5 text-xs leading-4",s:"px-3 py-2 text-sm leading-4",m:"px-4 py-2 text-sm leading-5",l:"px-4 py-2 text-base leading-6",xl:"px-6 py-3 text-base leading-6"},l=o.computed(()=>n.customTheme?n.customTheme:n.theme&&Q.find(({name:d})=>d===n.theme)?Q.find(({name:d})=>d===n.theme):Q.find(({name:d})=>d==="white"));function c(){i&&t("click")}return(d,f)=>(o.openBlock(),o.createElementBlock("button",{type:"button",class:o.normalizeClass(["relative inline-flex items-center bg-auto",[a[e.size],l.value.primary,l.value.dark,s.value,i.value?l.value.active:l.value.disabled]]),onClick:c},[o.renderSlot(d.$slots,"default"),e.ping?(o.openBlock(),o.createElementBlock("span",Ge,[o.createElementVNode("span",Qe,[o.createElementVNode("span",{class:o.normalizeClass(["animate-ping absolute inline-flex h-full w-full rounded-full opacity-75",e.pingColor])},null,2),o.createElementVNode("span",{class:o.normalizeClass(["relative inline-flex rounded-full h-3 w-3",e.pingColor])},null,2)])])):o.createCommentVNode("",!0)],2))}});function Ke(e){return o.getCurrentScope()?(o.onScopeDispose(e),!0):!1}function K(e){return typeof e=="function"?e():o.unref(e)}const We=typeof window<"u",Ye=()=>{};function Je(e){var t;const n=K(e);return(t=n==null?void 0:n.$el)!=null?t:n}const pe=We?window:void 0;function Xe(...e){let t,n,i,r;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,i,r]=e,t=pe):[t,n,i,r]=e,!t)return Ye;Array.isArray(n)||(n=[n]),Array.isArray(i)||(i=[i]);const s=[],a=()=>{s.forEach(f=>f()),s.length=0},l=(f,u,m,h)=>(f.addEventListener(u,m,h),()=>f.removeEventListener(u,m,h)),c=o.watch(()=>[Je(t),K(r)],([f,u])=>{a(),f&&s.push(...n.flatMap(m=>i.map(h=>l(f,m,h,u))))},{immediate:!0,flush:"post"}),d=()=>{c(),a()};return Ke(d),d}function Ze(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function et(...e){let t,n,i={};e.length===3?(t=e[0],n=e[1],i=e[2]):e.length===2?typeof e[1]=="object"?(t=!0,n=e[0],i=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);const{target:r=pe,eventName:s="keydown",passive:a=!1,dedupe:l=!1}=i,c=Ze(t);return Xe(r,s,f=>{f.repeat&&K(l)||c(f)&&n(f)},a)}const T=/^[a-z0-9]+(-[a-z0-9]+)*$/,k=Object.freeze({left:0,top:0,width:16,height:16,rotate:0,vFlip:!1,hFlip:!1});function D(e){return{...k,...e}}const z=(e,t,n,i="")=>{const r=e.split(":");if(e.slice(0,1)==="@"){if(r.length<2||r.length>3)return null;i=r.shift().slice(1)}if(r.length>3||!r.length)return null;if(r.length>1){const l=r.pop(),c=r.pop(),d={provider:r.length>0?r[0]:i,prefix:c,name:l};return t&&!A(d)?null:d}const s=r[0],a=s.split("-");if(a.length>1){const l={provider:i,prefix:a.shift(),name:a.join("-")};return t&&!A(l)?null:l}if(n&&i===""){const l={provider:i,prefix:"",name:s};return t&&!A(l,n)?null:l}return null},A=(e,t)=>e?!!((e.provider===""||e.provider.match(T))&&(t&&e.prefix===""||e.prefix.match(T))&&e.name.match(T)):!1;function tt(e,t){const n={...e};for(const i in k){const r=i;if(t[r]!==void 0){const s=t[r];if(n[r]===void 0){n[r]=s;continue}switch(r){case"rotate":n[r]=(n[r]+s)%4;break;case"hFlip":case"vFlip":n[r]=s!==n[r];break;default:n[r]=s}}}return n}function be(e,t,n=!1){function i(s,a){if(e.icons[s]!==void 0)return Object.assign({},e.icons[s]);if(a>5)return null;const l=e.aliases;if(l&&l[s]!==void 0){const d=l[s],f=i(d.parent,a+1);return f&&tt(f,d)}const c=e.chars;return!a&&c&&c[s]!==void 0?i(c[s],a+1):null}const r=i(t,0);if(r)for(const s in k)r[s]===void 0&&e[s]!==void 0&&(r[s]=e[s]);return r&&n?D(r):r}function nt(e){for(const t in k)if(e[t]!==void 0)return!0;return!1}function we(e,t,n){n=n||{};const i=[];if(typeof e!="object"||typeof e.icons!="object")return i;e.not_found instanceof Array&&e.not_found.forEach(a=>{t(a,null),i.push(a)});const r=e.icons;Object.keys(r).forEach(a=>{const l=be(e,a,!0);l&&(t(a,l),i.push(a))});const s=n.aliases||"all";if(s!=="none"&&typeof e.aliases=="object"){const a=e.aliases;Object.keys(a).forEach(l=>{if(s==="variations"&&nt(a[l]))return;const c=be(e,l,!0);c&&(t(l,c),i.push(l))})}return i}const W={provider:"string",aliases:"object",not_found:"object"};for(const e in k)W[e]=typeof k[e];function xe(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object")return null;for(const r in W)if(e[r]!==void 0&&typeof e[r]!==W[r])return null;const n=t.icons;for(const r in n){const s=n[r];if(!r.match(T)||typeof s.body!="string")return null;for(const a in k)if(s[a]!==void 0&&typeof s[a]!=typeof k[a])return null}const i=t.aliases;if(i)for(const r in i){const s=i[r],a=s.parent;if(!r.match(T)||typeof a!="string"||!n[a]&&!i[a])return null;for(const l in k)if(s[l]!==void 0&&typeof s[l]!=typeof k[l])return null}return t}const ot=1;let F=Object.create(null);try{const e=window||self;e&&e._iconifyStorage.version===ot&&(F=e._iconifyStorage.storage)}catch{}function rt(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:Object.create(null)}}function N(e,t){F[e]===void 0&&(F[e]=Object.create(null));const n=F[e];return n[t]===void 0&&(n[t]=rt(e,t)),n[t]}function Y(e,t){if(!xe(t))return[];const n=Date.now();return we(t,(i,r)=>{r?e.icons[i]=r:e.missing[i]=n})}function it(e,t,n){try{if(typeof n.body=="string")return e.icons[t]=Object.freeze(D(n)),!0}catch{}return!1}function st(e,t){const n=e.icons[t];return n===void 0?null:n}let M=!1;function ke(e){return typeof e=="boolean"&&(M=e),M}function at(e){const t=typeof e=="string"?z(e,!0,M):e;return t?st(N(t.provider,t.prefix),t.name):null}function lt(e,t){const n=z(e,!0,M);if(!n)return!1;const i=N(n.provider,n.prefix);return it(i,n.name,t)}function ct(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=typeof e.provider=="string"?e.provider:""),M&&t===""&&(typeof e.prefix!="string"||e.prefix==="")){let i=!1;return xe(e)&&(e.prefix="",we(e,(r,s)=>{s&&lt(r,s)&&(i=!0)})),i}if(typeof e.prefix!="string"||!A({provider:t,prefix:e.prefix,name:"a"}))return!1;const n=N(t,e.prefix);return!!Y(n,e)}const Ce=Object.freeze({inline:!1,width:null,height:null,hAlign:"center",vAlign:"middle",slice:!1,hFlip:!1,vFlip:!1,rotate:0});function dt(e,t){const n={};for(const i in e){const r=i;if(n[r]=e[r],t[r]===void 0)continue;const s=t[r];switch(r){case"inline":case"slice":typeof s=="boolean"&&(n[r]=s);break;case"hFlip":case"vFlip":s===!0&&(n[r]=!n[r]);break;case"hAlign":case"vAlign":typeof s=="string"&&s!==""&&(n[r]=s);break;case"width":case"height":(typeof s=="string"&&s!==""||typeof s=="number"&&s||s===null)&&(n[r]=s);break;case"rotate":typeof s=="number"&&(n[r]+=s);break}}return n}const ft=/(-?[0-9.]*[0-9]+[0-9.]*)/g,ut=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function J(e,t,n){if(t===1)return e;if(n=n===void 0?100:n,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const i=e.split(ft);if(i===null||!i.length)return e;const r=[];let s=i.shift(),a=ut.test(s);for(;;){if(a){const l=parseFloat(s);isNaN(l)?r.push(s):r.push(Math.ceil(l*t*n)/n)}else r.push(s);if(s=i.shift(),s===void 0)return r.join("");a=!a}}function mt(e){let t="";switch(e.hAlign){case"left":t+="xMin";break;case"right":t+="xMax";break;default:t+="xMid"}switch(e.vAlign){case"top":t+="YMin";break;case"bottom":t+="YMax";break;default:t+="YMid"}return t+=e.slice?" slice":" meet",t}function gt(e,t){const n={left:e.left,top:e.top,width:e.width,height:e.height};let i=e.body;[e,t].forEach(l=>{const c=[],d=l.hFlip,f=l.vFlip;let u=l.rotate;d?f?u+=2:(c.push("translate("+(n.width+n.left).toString()+" "+(0-n.top).toString()+")"),c.push("scale(-1 1)"),n.top=n.left=0):f&&(c.push("translate("+(0-n.left).toString()+" "+(n.height+n.top).toString()+")"),c.push("scale(1 -1)"),n.top=n.left=0);let m;switch(u<0&&(u-=Math.floor(u/4)*4),u=u%4,u){case 1:m=n.height/2+n.top,c.unshift("rotate(90 "+m.toString()+" "+m.toString()+")");break;case 2:c.unshift("rotate(180 "+(n.width/2+n.left).toString()+" "+(n.height/2+n.top).toString()+")");break;case 3:m=n.width/2+n.left,c.unshift("rotate(-90 "+m.toString()+" "+m.toString()+")");break}u%2===1&&((n.left!==0||n.top!==0)&&(m=n.left,n.left=n.top,n.top=m),n.width!==n.height&&(m=n.width,n.width=n.height,n.height=m)),c.length&&(i='<g transform="'+c.join(" ")+'">'+i+"</g>")});let r,s;t.width===null&&t.height===null?(s="1em",r=J(s,n.width/n.height)):t.width!==null&&t.height!==null?(r=t.width,s=t.height):t.height!==null?(s=t.height,r=J(s,n.width/n.height)):(r=t.width,s=J(r,n.height/n.width)),r==="auto"&&(r=n.width),s==="auto"&&(s=n.height),r=typeof r=="string"?r:r.toString()+"",s=typeof s=="string"?s:s.toString()+"";const a={attributes:{width:r,height:s,preserveAspectRatio:mt(t),viewBox:n.left.toString()+" "+n.top.toString()+" "+n.width.toString()+" "+n.height.toString()},body:i};return t.inline&&(a.inline=!0),a}const ht=/\sid="(\S+)"/g,yt="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let pt=0;function bt(e,t=yt){const n=[];let i;for(;i=ht.exec(e);)n.push(i[1]);return n.length&&n.forEach(r=>{const s=typeof t=="function"?t(r):t+(pt++).toString(),a=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+s+"$3")}),e}const X=Object.create(null);function wt(e,t){X[e]=t}function Z(e){return X[e]||X[""]}function ee(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path===void 0?"/":e.path,maxURL:e.maxURL?e.maxURL:500,rotate:e.rotate?e.rotate:750,timeout:e.timeout?e.timeout:5e3,random:e.random===!0,index:e.index?e.index:0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const te=Object.create(null),O=["https://api.simplesvg.com","https://api.unisvg.com"],q=[];for(;O.length>0;)O.length===1||Math.random()>.5?q.push(O.shift()):q.push(O.pop());te[""]=ee({resources:["https://api.iconify.design"].concat(q)});function xt(e,t){const n=ee(t);return n===null?!1:(te[e]=n,!0)}function ne(e){return te[e]}const Ee=(e,t)=>{let n=e,i=n.indexOf("?")!==-1;function r(s){switch(typeof s){case"boolean":return s?"true":"false";case"number":return encodeURIComponent(s);case"string":return encodeURIComponent(s);default:throw new Error("Invalid parameter")}}return Object.keys(t).forEach(s=>{let a;try{a=r(t[s])}catch{return}n+=(i?"&":"?")+encodeURIComponent(s)+"="+a,i=!0}),n},ve={},H={};let Ne=(()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}return null})();function kt(e,t){const n=ne(e);if(!n)return 0;let i;if(!n.maxURL)i=0;else{let s=0;n.resources.forEach(l=>{s=Math.max(s,l.length)});const a=Ee(t+".json",{icons:""});i=n.maxURL-s-n.path.length-a.length}const r=e+":"+t;return H[e]=n.path,ve[r]=i,i}function Ct(e){return e===404}const Et=(e,t,n)=>{const i=[];let r=ve[t];r===void 0&&(r=kt(e,t));const s="icons";let a={type:s,provider:e,prefix:t,icons:[]},l=0;return n.forEach((c,d)=>{l+=c.length+1,l>=r&&d>0&&(i.push(a),a={type:s,provider:e,prefix:t,icons:[]},l=c.length),a.icons.push(c)}),i.push(a),i};function vt(e){if(typeof e=="string"){if(H[e]===void 0){const t=ne(e);if(!t)return"/";H[e]=t.path}return H[e]}return"/"}const Nt={prepare:Et,send:(e,t,n)=>{if(!Ne){n("abort",424);return}let i=vt(t.provider);switch(t.type){case"icons":{const s=t.prefix,l=t.icons.join(",");i+=Ee(s+".json",{icons:l});break}case"custom":{const s=t.uri;i+=s.slice(0,1)==="/"?s.slice(1):s;break}default:n("abort",400);return}let r=503;Ne(e+i).then(s=>{const a=s.status;if(a!==200){setTimeout(()=>{n(Ct(a)?"abort":"next",a)});return}return r=501,s.json()}).then(s=>{if(typeof s!="object"||s===null){setTimeout(()=>{n("next",r)});return}setTimeout(()=>{n("success",s)})}).catch(()=>{n("next",r)})}};function Bt(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((r,s)=>r.provider!==s.provider?r.provider.localeCompare(s.provider):r.prefix!==s.prefix?r.prefix.localeCompare(s.prefix):r.name.localeCompare(s.name));let i={provider:"",prefix:"",name:""};return e.forEach(r=>{if(i.name===r.name&&i.prefix===r.prefix&&i.provider===r.provider)return;i=r;const s=r.provider,a=r.prefix,l=r.name;n[s]===void 0&&(n[s]=Object.create(null));const c=n[s];c[a]===void 0&&(c[a]=N(s,a));const d=c[a];let f;d.icons[l]!==void 0?f=t.loaded:a===""||d.missing[l]!==void 0?f=t.missing:f=t.pending;const u={provider:s,prefix:a,name:l};f.push(u)}),t}const C=Object.create(null),oe=Object.create(null);function Be(e,t){e.forEach(n=>{const i=n.provider;if(C[i]===void 0)return;const r=C[i],s=n.prefix,a=r[s];a&&(r[s]=a.filter(l=>l.id!==t))})}function St(e,t){oe[e]===void 0&&(oe[e]=Object.create(null));const n=oe[e];n[t]||(n[t]=!0,setTimeout(()=>{if(n[t]=!1,C[e]===void 0||C[e][t]===void 0)return;const i=C[e][t].slice(0);if(!i.length)return;const r=N(e,t);let s=!1;i.forEach(a=>{const l=a.icons,c=l.pending.length;l.pending=l.pending.filter(d=>{if(d.prefix!==t)return!0;const f=d.name;if(r.icons[f]!==void 0)l.loaded.push({provider:e,prefix:t,name:f});else if(r.missing[f]!==void 0)l.missing.push({provider:e,prefix:t,name:f});else return s=!0,!0;return!1}),l.pending.length!==c&&(s||Be([{provider:e,prefix:t}],a.id),a.callback(l.loaded.slice(0),l.missing.slice(0),l.pending.slice(0),a.abort))})}))}let It=0;function Vt(e,t,n){const i=It++,r=Be.bind(null,n,i);if(!t.pending.length)return r;const s={id:i,icons:t,callback:e,abort:r};return n.forEach(a=>{const l=a.provider,c=a.prefix;C[l]===void 0&&(C[l]=Object.create(null));const d=C[l];d[c]===void 0&&(d[c]=[]),d[c].push(s)}),r}function jt(e,t=!0,n=!1){const i=[];return e.forEach(r=>{const s=typeof r=="string"?z(r,!1,n):r;(!t||A(s,n))&&i.push({provider:s.provider,prefix:s.prefix,name:s.name})}),i}var Se={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Tt(e,t,n,i){const r=e.resources.length,s=e.random?Math.floor(Math.random()*r):e.index;let a;if(e.random){let g=e.resources.slice(0);for(a=[];g.length>1;){const w=Math.floor(Math.random()*g.length);a.push(g[w]),g=g.slice(0,w).concat(g.slice(w+1))}a=a.concat(g)}else a=e.resources.slice(s).concat(e.resources.slice(0,s));const l=Date.now();let c="pending",d=0,f,u=null,m=[],h=[];typeof i=="function"&&h.push(i);function y(){u&&(clearTimeout(u),u=null)}function v(){c==="pending"&&(c="aborted"),y(),m.forEach(g=>{g.status==="pending"&&(g.status="aborted")}),m=[]}function b(g,w){w&&(h=[]),typeof g=="function"&&h.push(g)}function $(){return{startTime:l,payload:t,status:c,queriesSent:d,queriesPending:m.length,subscribe:b,abort:v}}function U(){c="failed",h.forEach(g=>{g(void 0,f)})}function Ue(){m.forEach(g=>{g.status==="pending"&&(g.status="aborted")}),m=[]}function Rn(g,w,L){const G=w!=="success";switch(m=m.filter(I=>I!==g),c){case"pending":break;case"failed":if(G||!e.dataAfterTimeout)return;break;default:return}if(w==="abort"){f=L,U();return}if(G){f=L,m.length||(a.length?ye():U());return}if(y(),Ue(),!e.random){const I=e.resources.indexOf(g.resource);I!==-1&&I!==e.index&&(e.index=I)}c="completed",h.forEach(I=>{I(L)})}function ye(){if(c!=="pending")return;y();const g=a.shift();if(g===void 0){if(m.length){u=setTimeout(()=>{y(),c==="pending"&&(Ue(),U())},e.timeout);return}U();return}const w={status:"pending",resource:g,callback:(L,G)=>{Rn(w,L,G)}};m.push(w),d++,u=setTimeout(ye,e.rotate),n(g,t,w.callback)}return setTimeout(ye),$}function At(e){if(typeof e!="object"||typeof e.resources!="object"||!(e.resources instanceof Array)||!e.resources.length)throw new Error("Invalid Reduncancy configuration");const t=Object.create(null);let n;for(n in Se)e[n]!==void 0?t[n]=e[n]:t[n]=Se[n];return t}function Ie(e){const t=At(e);let n=[];function i(){n=n.filter(l=>l().status==="pending")}function r(l,c,d){const f=Tt(t,l,c,(u,m)=>{i(),d&&d(u,m)});return n.push(f),f}function s(l){const c=n.find(d=>l(d));return c!==void 0?c:null}return{query:r,find:s,setIndex:l=>{t.index=l},getIndex:()=>t.index,cleanup:i}}function Ve(){}const re=Object.create(null);function Mt(e){if(re[e]===void 0){const t=ne(e);if(!t)return;const n=Ie(t),i={config:t,redundancy:n};re[e]=i}return re[e]}function Ot(e,t,n){let i,r;if(typeof e=="string"){const s=Z(e);if(!s)return n(void 0,424),Ve;r=s.send;const a=Mt(e);a&&(i=a.redundancy)}else{const s=ee(e);if(s){i=Ie(s);const a=e.resources?e.resources[0]:"",l=Z(a);l&&(r=l.send)}}return!i||!r?(n(void 0,424),Ve):i.query(t,r,n)().abort}const ie={};function je(){}const B=Object.create(null),se=Object.create(null),ae=Object.create(null),le=Object.create(null);function _t(e,t){ae[e]===void 0&&(ae[e]=Object.create(null));const n=ae[e];n[t]||(n[t]=!0,setTimeout(()=>{n[t]=!1,St(e,t)}))}const Te=Object.create(null);function $t(e,t,n){function i(){const l=(e===""?"":"@"+e+":")+t,c=Math.floor(Date.now()/6e4);Te[l]<c&&(Te[l]=c,console.error('Unable to retrieve icons for "'+l+'" because API is not configured properly.'))}se[e]===void 0&&(se[e]=Object.create(null));const r=se[e];le[e]===void 0&&(le[e]=Object.create(null));const s=le[e];B[e]===void 0&&(B[e]=Object.create(null));const a=B[e];r[t]===void 0?r[t]=n:r[t]=r[t].concat(n).sort(),s[t]||(s[t]=!0,setTimeout(()=>{s[t]=!1;const l=r[t];delete r[t];const c=Z(e);if(!c){i();return}c.prepare(e,t,l).forEach(f=>{Ot(e,f,(u,m)=>{const h=N(e,t);if(typeof u!="object"){if(m!==404)return;const y=Date.now();f.icons.forEach(v=>{h.missing[v]=y})}else try{const y=Y(h,u);if(!y.length)return;const v=a[t];y.forEach(b=>{delete v[b]}),ie.store&&ie.store(e,u)}catch(y){console.error(y)}_t(e,t)})})}))}const Lt=(e,t)=>{const n=jt(e,!0,ke()),i=Bt(n);if(!i.pending.length){let d=!0;return t&&setTimeout(()=>{d&&t(i.loaded,i.missing,i.pending,je)}),()=>{d=!1}}const r=Object.create(null),s=[];let a,l;i.pending.forEach(d=>{const f=d.provider,u=d.prefix;if(u===l&&f===a)return;a=f,l=u,s.push({provider:f,prefix:u}),B[f]===void 0&&(B[f]=Object.create(null));const m=B[f];m[u]===void 0&&(m[u]=Object.create(null)),r[f]===void 0&&(r[f]=Object.create(null));const h=r[f];h[u]===void 0&&(h[u]=[])});const c=Date.now();return i.pending.forEach(d=>{const f=d.provider,u=d.prefix,m=d.name,h=B[f][u];h[m]===void 0&&(h[m]=c,r[f][u].push(m))}),s.forEach(d=>{const f=d.provider,u=d.prefix;r[f][u].length&&$t(f,u,r[f][u])}),t?Vt(t,i,s):je},Ae="iconify2",_="iconify",Me=_+"-count",Oe=_+"-version",_e=36e5,Pt=168,ce={local:!0,session:!0};let de=!1;const $e={local:0,session:0},Le={local:[],session:[]};let R=typeof window>"u"?{}:window;function Pe(e){const t=e+"Storage";try{if(R&&R[t]&&typeof R[t].length=="number")return R[t]}catch{}return ce[e]=!1,null}function fe(e,t,n){try{return e.setItem(Me,n.toString()),$e[t]=n,!0}catch{return!1}}function De(e){const t=e.getItem(Me);if(t){const n=parseInt(t);return n||0}return 0}function Dt(e,t){try{e.setItem(Oe,Ae)}catch{}fe(e,t,0)}function zt(e){try{const t=De(e);for(let n=0;n<t;n++)e.removeItem(_+n.toString())}catch{}}const ze=()=>{if(de)return;de=!0;const e=Math.floor(Date.now()/_e)-Pt;function t(n){const i=Pe(n);if(!i)return;const r=s=>{const a=_+s.toString(),l=i.getItem(a);if(typeof l!="string")return!1;let c=!0;try{const d=JSON.parse(l);if(typeof d!="object"||typeof d.cached!="number"||d.cached<e||typeof d.provider!="string"||typeof d.data!="object"||typeof d.data.prefix!="string")c=!1;else{const f=d.provider,u=d.data.prefix,m=N(f,u);c=Y(m,d.data).length>0}}catch{c=!1}return c||i.removeItem(a),c};try{const s=i.getItem(Oe);if(s!==Ae){s&&zt(i),Dt(i,n);return}let a=De(i);for(let l=a-1;l>=0;l--)r(l)||(l===a-1?a--:Le[n].push(l));fe(i,n,a)}catch{}}for(const n in ce)t(n)},Ft=(e,t)=>{de||ze();function n(i){if(!ce[i])return!1;const r=Pe(i);if(!r)return!1;let s=Le[i].shift();if(s===void 0&&(s=$e[i],!fe(r,i,s+1)))return!1;try{const a={cached:Math.floor(Date.now()/_e),provider:e,data:t};r.setItem(_+s.toString(),JSON.stringify(a))}catch{return!1}return!0}Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),n("local")||n("session"))},Fe=/[\s,]+/;function qt(e,t){t.split(Fe).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function Ht(e,t){t.split(Fe).forEach(n=>{const i=n.trim();switch(i){case"left":case"center":case"right":e.hAlign=i;break;case"top":case"middle":case"bottom":e.vAlign=i;break;case"slice":case"crop":e.slice=!0;break;case"meet":e.slice=!1}})}function Rt(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function i(r){for(;r<0;)r+=4;return r%4}if(n===""){const r=parseInt(e);return isNaN(r)?0:i(r)}else if(n!==e){let r=0;switch(n){case"%":r=25;break;case"deg":r=90}if(r){let s=parseFloat(e.slice(0,e.length-n.length));return isNaN(s)?0:(s=s/r,s%1===0?i(s):0)}}return t}const Ut={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"};let E={};["horizontal","vertical"].forEach(e=>{["Align","Flip"].forEach(t=>{const i={attr:e.slice(0,1)+t,boolean:t==="Flip"};E[e+"-"+t.toLowerCase()]=i,E[e.slice(0,1)+"-"+t.toLowerCase()]=i,E[e+t]=i})});const qe=(e,t)=>{const n=dt(Ce,t),i={...Ut};let r=typeof t.style=="object"&&!(t.style instanceof Array)?{...t.style}:{};for(let c in t){const d=t[c];if(d!==void 0)switch(c){case"icon":case"style":case"onLoad":break;case"inline":case"hFlip":case"vFlip":n[c]=d===!0||d==="true"||d===1;break;case"flip":typeof d=="string"&&qt(n,d);break;case"align":typeof d=="string"&&Ht(n,d);break;case"color":r.color=d;break;case"rotate":typeof d=="string"?n[c]=Rt(d):typeof d=="number"&&(n[c]=d);break;case"ariaHidden":case"aria-hidden":d!==!0&&d!=="true"&&delete i["aria-hidden"];break;default:E[c]!==void 0?E[c].boolean&&(d===!0||d==="true"||d===1)?n[E[c].attr]=!0:!E[c].boolean&&typeof d=="string"&&d!==""&&(n[E[c].attr]=d):Ce[c]===void 0&&(i[c]=d)}}const s=gt(e,n);for(let c in s.attributes)i[c]=s.attributes[c];s.inline&&r.verticalAlign===void 0&&r["vertical-align"]===void 0&&(r.verticalAlign="-0.125em");let a=0,l=t.id;return typeof l=="string"&&(l=l.replace(/-/g,"_")),i.innerHTML=bt(s.body,l?()=>l+"ID"+a++:"iconifyVue"),Object.keys(r).length>0&&(i.style=r),o.h("svg",i)};if(ke(!0),wt("",Nt),typeof document<"u"&&typeof window<"u"){ie.store=Ft,ze();const e=window;if(e.IconifyPreload!==void 0){const t=e.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(i=>{try{(typeof i!="object"||i===null||i instanceof Array||typeof i.icons!="object"||typeof i.prefix!="string"||!ct(i))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(let n in t){const i="IconifyProviders["+n+"] is invalid.";try{const r=t[n];if(typeof r!="object"||!r||r.resources===void 0)continue;xt(n,r)||console.error(i)}catch{console.error(i)}}}}const Gt=D({body:""}),p=o.defineComponent({inheritAttrs:!1,data(){return{iconMounted:!1,counter:0}},mounted(){this._name="",this._loadingIcon=null,this.iconMounted=!0},unmounted(){this.abortLoading()},methods:{abortLoading(){this._loadingIcon&&(this._loadingIcon.abort(),this._loadingIcon=null)},getIcon(e,t){if(typeof e=="object"&&e!==null&&typeof e.body=="string")return this._name="",this.abortLoading(),{data:D(e)};let n;if(typeof e!="string"||(n=z(e,!1,!0))===null)return this.abortLoading(),null;const i=at(n);if(i===null)return(!this._loadingIcon||this._loadingIcon.name!==e)&&(this.abortLoading(),this._name="",this._loadingIcon={name:e,abort:Lt([n],()=>{this.counter++})}),null;this.abortLoading(),this._name!==e&&(this._name=e,t&&t(e));const r=["iconify"];return n.prefix!==""&&r.push("iconify--"+n.prefix),n.provider!==""&&r.push("iconify--"+n.provider),{data:i,classes:r}}},render(){this.counter;const e=this.$attrs,t=this.iconMounted?this.getIcon(e.icon,e.onLoad):null;if(!t)return qe(Gt,e);let n=e;return t.classes&&(n={...e,class:(typeof e.class=="string"?e.class+" ":"")+t.classes.join(" ")}),qe(t.data,n)}}),Qt={class:"fixed z-10 inset-0 overflow-y-auto",id:"ModalBase"},Kt={class:"flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0"},Wt=o.createElementVNode("div",{class:"absolute inset-0 bg-black opacity-75"},null,-1),Yt={class:"fixed top-0 right-0 p-3"},Jt={class:"p-3 cursor-pointer rounded-full transition ease-in-out duration-150 hover:bg-gray-800"},Xt=o.createElementVNode("span",{class:"hidden sm:inline-block sm:align-middle sm:h-screen"}," ",-1),ue=o.defineComponent({__name:"ModalBase",props:{destroyed:{type:[Function,()=>{}],required:!1,default:()=>{}},innerClass:{type:String,required:!1,default:""},maxWidth:{type:String,required:!1,default:"sm:max-w-lg"}},setup(e,{expose:t}){const n=e,i=o.ref(!1);o.onMounted(()=>i.value=!0),et("Escape",s=>{s.preventDefault(),r()});async function r(){i.value=!1,setTimeout(()=>n.destroyed(),200)}return t({destroy:r}),(s,a)=>(o.openBlock(),o.createElementBlock("div",Qt,[o.createElementVNode("div",Kt,[o.createVNode(o.Transition,{"enter-active-class":"ease-out duration-300","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"ease-in duration-200","leave-class":"opacity-100","leave-to-class":"opacity-0"},{default:o.withCtx(()=>[i.value?(o.openBlock(),o.createElementBlock("div",{key:0,class:"fixed inset-0 transition-opacity",onClick:r},[Wt,o.createElementVNode("div",Yt,[o.createElementVNode("div",Jt,[o.createVNode(o.unref(p),{icon:"mdi-close",class:"w-6 h-6 text-gray-200 dark:text-gray-400"})])])])):o.createCommentVNode("",!0)]),_:1}),Xt,o.createVNode(o.Transition,{"enter-active-class":"ease-out duration-300","enter-from-class":"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95","enter-to-class":"opacity-100 translate-y-0 sm:scale-100","leave-active-class":"ease-in duration-200","leave-class":"opacity-100 translate-y-0 sm:scale-100","leave-to-class":"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"},{default:o.withCtx(()=>[i.value?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["inline-block align-bottom bg-white dark:bg-gray-800 rounded-lg px-4 pt-5 pb-4 text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:w-full sm:p-6",[e.innerClass,e.maxWidth]]),role:"dialog","aria-modal":"true","aria-labelledby":"modal-headline"},[o.renderSlot(s.$slots,"default")],2)):o.createCommentVNode("",!0)]),_:3})])]))}});function me(e){e&&e.parentNode.remove()}function S(e,t,n,i){var s;const r=document.createElement("div");return i&&i.forEach(a=>r.classList.add(a)),o.createApp(o.defineComponent(n),t).mount((s=document==null?void 0:document.getElementById(e))==null?void 0:s.appendChild(r))}const Zt={class:"sm:flex sm:items-center"},en={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left"},tn={key:0,class:"text-lg leading-6 font-medium text-gray-900 dark:text-gray-300 mb-1",id:"modal-headline"},nn=["innerHTML"],on={key:0,class:"mt-5 sm:mt-4 sm:flex sm:flex-row-reverse"},rn=o.defineComponent({__name:"GlobalModal",props:{type:{type:String,required:!1,default:"info"},title:{type:[Boolean,String],required:!1,default:!1},body:{type:[Boolean,String],required:!1,default:!1},primary:[Boolean,Object],secondary:[Boolean,Object]},setup(e){const t=e,n=o.ref(!1),i=o.ref(null),r=o.ref(null),s={success:"bg-green-100 dark:bg-green-900",info:"bg-blue-100 dark:bg-blue-900",danger:"bg-red-100 dark:bg-red-900",warning:"bg-yellow-100 dark:bg-yellow-900"};o.onMounted(()=>{n.value=!0,setTimeout(()=>{var c;t.primary&&i&&i.value&&((c=i==null?void 0:i.value)==null||c.$el.focus())},200)});async function a(c){var d;r&&((d=r==null?void 0:r.value)==null||d.destroy()),c==="primary"&&t.primary&&t.primary.action(),c==="secondary"&&t.secondary&&t.secondary.action()}async function l(){var c;n.value=!1,me((c=r==null?void 0:r.value)==null?void 0:c.$el)}return(c,d)=>(o.openBlock(),o.createBlock(ue,{ref_key:"modalBaseRef",ref:r,active:n.value,destroyed:l},{default:o.withCtx(()=>[o.createElementVNode("div",Zt,[o.createElementVNode("div",{class:o.normalizeClass([s[e.type],"mx-auto flex-shrink-0 self-start flex items-center justify-center h-12 w-12 rounded-full sm:mx-0 sm:h-10 sm:w-10"])},[e.type==="success"?(o.openBlock(),o.createBlock(o.unref(p),{key:0,icon:"mdi-check",class:"h-5 w-5 text-green-500"})):o.createCommentVNode("",!0),e.type==="info"?(o.openBlock(),o.createBlock(o.unref(p),{key:1,icon:"bi-info-lg",class:"h-5 w-5 text-blue-500"})):o.createCommentVNode("",!0),e.type==="danger"?(o.openBlock(),o.createBlock(o.unref(p),{key:2,icon:"mdi-exclamation-thick",class:"h-5 w-5 text-red-500"})):o.createCommentVNode("",!0),e.type==="warning"?(o.openBlock(),o.createBlock(o.unref(p),{key:3,icon:"mdi-exclamation-thick",class:"h-5 w-5 text-yellow-500"})):o.createCommentVNode("",!0)],2),o.createElementVNode("div",en,[e.title?(o.openBlock(),o.createElementBlock("h3",tn,o.toDisplayString(e.title),1)):o.createCommentVNode("",!0),e.body?(o.openBlock(),o.createElementBlock("p",{key:1,class:"text-sm leading-5",innerHTML:e.body},null,8,nn)):o.createCommentVNode("",!0)])]),e.primary?(o.openBlock(),o.createElementBlock("div",on,[e.primary?(o.openBlock(),o.createBlock(P,{key:0,ref_key:"primaryRef",ref:i,class:"flex w-full rounded-md shadow-sm sm:ml-3 sm:w-auto",theme:e.primary.theme,onClick:d[0]||(d[0]=f=>a("primary"))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.primary.label),1)]),_:1},8,["theme"])):o.createCommentVNode("",!0),e.secondary?(o.openBlock(),o.createBlock(P,{key:1,class:"mt-3 flex w-full rounded-md shadow-sm sm:mt-0 sm:w-auto",theme:e.secondary.theme,onClick:d[1]||(d[1]=f=>a("secondary"))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.secondary.label),1)]),_:1},8,["theme"])):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0)]),_:1},8,["active"]))}});function sn(){const e=document.createElement("div");return e.classList.add("z-30"),e.setAttribute("id","modals"),document.body.appendChild(e),{show(t){return typeof t=="string"&&(t={title:t}),S("modals",t,rn)}}}const an={key:0,class:"border-2 border-green-200 rounded-full w-6 h-6 flex items-center justify-center"},ln={key:1,class:"border-2 border-blue-200 rounded-full w-6 h-6 flex items-center justify-center"},cn={key:2,class:"border-2 border-yellow-200 rounded-full w-6 h-6 flex items-center justify-center"},dn={key:3,class:"border-2 border-red-200 rounded-full w-6 h-6 flex items-center justify-center"},fn={key:4,class:"rounded-full w-6 h-6 flex items-center justify-center"},un={key:5,class:"rounded-full w-6 h-6 flex items-center justify-center"},ge=o.defineComponent({__name:"GlobalToastIcons",props:{type:String},setup(e){const t=e;return(n,i)=>t.type==="success"?(o.openBlock(),o.createElementBlock("div",an,[o.createVNode(o.unref(p),{icon:"mdi-check",class:"h-4 w-4 text-green-400"})])):t.type==="info"?(o.openBlock(),o.createElementBlock("div",ln,[o.createVNode(o.unref(p),{icon:"bi-info-lg",class:"h-4 w-4 text-blue-400"})])):t.type==="warning"?(o.openBlock(),o.createElementBlock("div",cn,[o.createVNode(o.unref(p),{icon:"mdi-exclamation-thick",class:"h-4 w-4 text-yellow-400"})])):t.type==="danger"?(o.openBlock(),o.createElementBlock("div",dn,[o.createVNode(o.unref(p),{icon:"mdi-exclamation-thick",class:"h-4 w-4 text-red-400"})])):t.type==="denied"?(o.openBlock(),o.createElementBlock("div",fn,[o.createVNode(o.unref(p),{icon:"mdi-cancel",class:"h-4 w-4 text-red-400"})])):(o.openBlock(),o.createElementBlock("div",un,[o.createVNode(o.unref(p),{icon:e.type,class:"h-4 w-4 text-red-400"},null,8,["icon"])]))}}),mn={class:"ml-4 flex-shrink-0 flex"},gn=o.createElementVNode("span",{class:"sr-only"},"Close",-1),He=o.defineComponent({__name:"GlobalToastClose",emits:["close"],setup(e,{emit:t}){function n(){t("close")}return(i,r)=>(o.openBlock(),o.createElementBlock("div",mn,[o.createElementVNode("button",{onClick:n,class:"rounded-md inline-flex text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"},[gn,o.createVNode(o.unref(p),{icon:"mdi-close-thick",class:"w-4 h-4"})])]))}}),he=o.defineComponent({__name:"GlobalToastProgress",props:{style:String},setup(e){const t=e;return(n,i)=>(o.openBlock(),o.createElementBlock("div",{class:"absolute left-0 bottom-0 right-0 h-1 rounded bg-gray-200 dark:bg-gray-600",style:o.normalizeStyle(t.style)},null,4))}}),hn={class:"rounded-lg shadow-xs overflow-hidden z-100"},yn={class:"p-4"},pn={class:"flex items-start"},bn={key:0,class:"flex-shrink-0"},wn={class:"ml-3 w-0 flex-1 pt-0.5"},xn={key:0,class:"text-sm leading-5 font-medium"},kn=["innerHTML"],Cn={class:"ml-4 flex-shrink-0 flex mt-0.5"},En={class:"flex rounded-lg shadow-xs divide-x divide-gray-200 dark:divide-gray-600"},vn={class:"w-0 flex-1 flex items-start p-4"},Nn={key:0,class:"flex-shrink-0 mr-4"},Bn={class:"w-full"},Sn={key:0,class:"text-sm leading-5 font-medium text-gray-900 dark:text-gray-300"},In=["innerHTML"],Vn={class:"flex"},jn={class:"flex flex-col divide-y divide-gray-200 dark:divide-gray-600"},Tn={class:"h-0 flex-1 flex"},An={class:"h-0 flex-1 flex"},Mn={class:"rounded-lg shadow-xs overflow-hidden"},On={class:"p-4"},_n={class:"flex items-center"},$n={key:0,class:"flex-shrink-0 mr-4"},Ln={class:"w-0 flex-1 flex justify-between"},Pn=["innerHTML"],Dn={class:"ml-4 flex-shrink-0 flex"},Re=100,V=o.defineComponent({__name:"GlobalToast",props:{title:String,icon:{type:[Boolean,String],required:!1,default:void 0},message:{type:String},type:{type:String,required:!1,default:"info"},progress:{type:Boolean,required:!1,default:!0},timeout:{type:Number,required:!1,default:2},pauseOnHover:{type:Boolean,required:!1,default:!0},primary:Object,secondary:Object,wide:Boolean},setup(e){const t=e,n=o.ref(void 0),i=o.ref(!1),r=o.ref(!1);let s;const a=o.ref(0),l=o.getCurrentInstance(),c=o.computed(()=>typeof t.icon=="string"?t.icon:t.type),d=o.computed(()=>Math.round(a.value*100/(t.timeout*1e3)*100/100)),f=o.computed(()=>`width: ${d.value}%; transition: width 0.1s linear`);o.onMounted(()=>{i.value=!0,t.timeout>0&&(a.value=t.timeout*1e3,s=setInterval(()=>u(),Re))});function u(){(!t.pauseOnHover||!r.value)&&(a.value-=Re,a.value===0&&m())}function m(v=!1){clearInterval(s),v?(i.value=!1,setTimeout(()=>me(n==null?void 0:n.value),100),setTimeout(()=>l==null?void 0:l.appContext.app.unmount(),100)):(setTimeout(()=>i.value=!1,100),setTimeout(()=>me(n==null?void 0:n.value),200),setTimeout(()=>l==null?void 0:l.appContext.app.unmount(),200))}function h(){t.primary&&t.primary.action(),m()}function y(){t.secondary&&t.secondary.action(),m()}return(v,b)=>(o.openBlock(),o.createElementBlock("div",{ref_key:"toastRef",ref:n,onMouseenter:b[2]||(b[2]=$=>r.value=!0),onMouseleave:b[3]||(b[3]=$=>r.value=!1)},[o.createVNode(o.Transition,{"enter-active-class":"transform ease-out duration-300 transition","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":"transform ease-in duration-100 transition","leave-from-class":"translate-y-0 opacity-100 sm:translate-y-0 sm:translate-x-0","leave-to-class":"translate-y-1 opacity-0 sm:translate-y-0 sm:translate-x-1"},{default:o.withCtx(()=>[i.value&&!e.primary?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass([{"max-w-sm":!e.wide,"max-w-3xl":e.wide},"relative w-full bg-white dark:bg-gray-800 shadow-lg rounded-lg pointer-events-auto ring-1 ring-black ring-opacity-5 overflow-hidden"])},[e.progress&&e.timeout?(o.openBlock(),o.createBlock(he,{key:0,style:o.normalizeStyle(f.value)},null,8,["style"])):o.createCommentVNode("",!0),o.createElementVNode("div",hn,[o.createElementVNode("div",yn,[o.createElementVNode("div",pn,[t.icon!==!1?(o.openBlock(),o.createElementBlock("div",bn,[o.createVNode(ge,{type:c.value},null,8,["type"])])):o.createCommentVNode("",!0),o.createElementVNode("div",wn,[e.title?(o.openBlock(),o.createElementBlock("p",xn,o.toDisplayString(e.title),1)):o.createCommentVNode("",!0),o.createElementVNode("p",{class:o.normalizeClass([{"mt-1":e.title},"text-sm leading-5"]),innerHTML:e.message},null,10,kn)]),o.createElementVNode("div",Cn,[o.createVNode(He,{onClose:b[0]||(b[0]=$=>m(!0))})])])])])],2)):i.value&&e.primary&&e.secondary?(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass([{"max-w-sm":!e.wide,"max-w-3xl":e.wide},"relative w-full bg-white dark:bg-gray-800 shadow-lg rounded-lg pointer-events-auto ring-1 ring-black ring-opacity-5 overflow-hidden"])},[e.progress&&e.timeout?(o.openBlock(),o.createBlock(he,{key:0,style:o.normalizeStyle(f.value)},null,8,["style"])):o.createCommentVNode("",!0),o.createElementVNode("div",En,[o.createElementVNode("div",vn,[t.icon!==!1?(o.openBlock(),o.createElementBlock("div",Nn,[o.createVNode(ge,{type:c.value},null,8,["type"])])):o.createCommentVNode("",!0),o.createElementVNode("div",Bn,[e.title?(o.openBlock(),o.createElementBlock("p",Sn,o.toDisplayString(e.title),1)):o.createCommentVNode("",!0),o.createElementVNode("p",{class:o.normalizeClass([{"mt-1":e.title},"text-sm leading-5 text-gray-500"]),innerHTML:e.message},null,10,In)])]),o.createElementVNode("div",Vn,[o.createElementVNode("div",jn,[o.createElementVNode("div",Tn,[o.createElementVNode("button",{class:"w-full border border-transparent rounded-none rounded-tr-lg px-4 py-3 flex items-center justify-center text-sm font-medium text-gray-900 dark:text-gray-100 hover:text-gray-500 focus:outline-none focus:z-10 focus:ring-2 focus:ring-gray-500",onClick:h},o.toDisplayString(e.primary.label),1)]),o.createElementVNode("div",An,[o.createElementVNode("button",{class:"w-full border border-transparent rounded-none rounded-br-lg px-4 py-3 flex items-center justify-center text-sm font-medium text-gray-700 dark:text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-gray-500",onClick:y},o.toDisplayString(e.secondary.label),1)])])])])],2)):i.value&&e.primary&&!e.secondary?(o.openBlock(),o.createElementBlock("div",{key:2,class:o.normalizeClass([{"max-w-sm":!e.wide,"max-w-3xl":e.wide},"relative w-full bg-white dark:bg-gray-800 shadow-lg rounded-lg pointer-events-auto ring-1 ring-black ring-opacity-5 overflow-hidden"])},[e.progress&&e.timeout?(o.openBlock(),o.createBlock(he,{key:0,style:o.normalizeStyle(f.value)},null,8,["style"])):o.createCommentVNode("",!0),o.createElementVNode("div",Mn,[o.createElementVNode("div",On,[o.createElementVNode("div",_n,[t.icon!==!1?(o.openBlock(),o.createElementBlock("div",$n,[o.createVNode(ge,{type:c.value},null,8,["type"])])):o.createCommentVNode("",!0),o.createElementVNode("div",Ln,[o.createElementVNode("p",{class:"w-0 flex-1 text-sm leading-5",innerHTML:e.message},null,8,Pn),o.createElementVNode("button",{type:"button",class:"ml-3 flex-shrink-0 rounded-md text-sm font-medium text-gray-600 dark:text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500",onClick:h},o.toDisplayString(e.primary.label),1)]),o.createElementVNode("div",Dn,[o.createElementVNode("button",{class:"inline-flex text-gray-400 focus:outline-none focus:text-gray-500 transition ease-in-out duration-150",onClick:m},[o.createVNode(He,{onClose:b[1]||(b[1]=$=>m(!0))})])])])])])],2)):o.createCommentVNode("",!0)]),_:1})],544))}}),zn=["z-40","fixed","inset-0","flex","sm:items-start","px-4","py-6","pointer-events-none","sm:p-6"],Fn=["w-full","flex","flex-col-reverse","items-center","sm:items-end","sm:justify-end"],j=["w-full","max-w-sm","mt-4"];function qn(){const e=document.createElement("div");zn.forEach(n=>e.classList.add(n)),e.setAttribute("aria-live","assertive");const t=document.createElement("div");return Fn.forEach(n=>t.classList.add(n)),t.setAttribute("id","toasts"),e.appendChild(t),document.body.appendChild(e),{show(n){if(typeof n=="string"&&(n={message:n}),n!==void 0)return S("toasts",n,V,j)},success(n){return S("toasts",{type:"success",message:n},V,j)},info(n){return S("toasts",{type:"info",message:n},V,j)},danger(n){return S("toasts",{type:"danger",message:n,timeout:20},V,j)},warning(n){return S("toasts",{type:"warning",message:n,timeout:10},V,j)},denied(n){return S("toasts",{type:"denied",message:n,timeout:10},V,j)}}}const Hn=e=>{e.component("PushButton",P),e.component("ModalBase",ue)};x.ModalBase=ue,x.PushButton=P,x.install=Hn,x.useModal=sn,x.useToast=qn,Object.defineProperty(x,Symbol.toStringTag,{value:"Module"})}); // @unocss-include