purplefox-tools
Advanced tools
Comparing version 1.3.2 to 1.3.4
@@ -1,1 +0,1 @@ | ||
var Dn=Object.defineProperty,qn=Object.defineProperties;var Un=Object.getOwnPropertyDescriptors;var De=Object.getOwnPropertySymbols;var zn=Object.prototype.hasOwnProperty,Hn=Object.prototype.propertyIsEnumerable;var qe=(g,l,b)=>l in g?Dn(g,l,{enumerable:!0,configurable:!0,writable:!0,value:b}):g[l]=b,I=(g,l)=>{for(var b in l||(l={}))zn.call(l,b)&&qe(g,b,l[b]);if(De)for(var b of De(l))Hn.call(l,b)&&qe(g,b,l[b]);return g},he=(g,l)=>qn(g,Un(l));(function(g,l){typeof exports=="object"&&typeof module!="undefined"?l(exports,require("vue"),require("vue-router")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router"],l):(g=typeof globalThis!="undefined"?globalThis:g||self,l(g.PurplefoxTools={},g.Vue,g.vueRouter))})(this,function(g,l,b){"use strict";var L,Ue=new Uint8Array(16);function ze(){if(!L&&(L=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!L))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return L(Ue)}var He=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function Ke(e){return typeof e=="string"&&He.test(e)}for(var m=[],z=0;z<256;++z)m.push((z+256).toString(16).substr(1));function Qe(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=(m[e[t+0]]+m[e[t+1]]+m[e[t+2]]+m[e[t+3]]+"-"+m[e[t+4]]+m[e[t+5]]+"-"+m[e[t+6]]+m[e[t+7]]+"-"+m[e[t+8]]+m[e[t+9]]+"-"+m[e[t+10]]+m[e[t+11]]+m[e[t+12]]+m[e[t+13]]+m[e[t+14]]+m[e[t+15]]).toLowerCase();if(!Ke(n))throw TypeError("Stringified UUID is invalid");return n}function Ye(e,t,n){e=e||{};var r=e.random||(e.rng||ze)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(var i=0;i<16;++i)t[n+i]=r[i];return t}return Qe(r)}var j=/^[a-z0-9]+(-[a-z0-9]+)*$/,S=Object.freeze({left:0,top:0,width:16,height:16,rotate:0,vFlip:!1,hFlip:!1});function H(e){return I(I({},S),e)}var M=(e,t,n,r="")=>{const i=e.split(":");if(e.slice(0,1)==="@"){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){const s=i.pop(),f=i.pop(),c={provider:i.length>0?i[0]:r,prefix:f,name:s};return t&&!A(c)?null:c}const o=i[0],a=o.split("-");if(a.length>1){const s={provider:r,prefix:a.shift(),name:a.join("-")};return t&&!A(s)?null:s}if(n&&r===""){const s={provider:r,prefix:"",name:o};return t&&!A(s,n)?null:s}return null},A=(e,t)=>e?!!((e.provider===""||e.provider.match(j))&&(t&&e.prefix===""||e.prefix.match(j))&&e.name.match(j)):!1;function Ge(e,t){const n=I({},e);for(const r in S){const i=r;if(t[i]!==void 0){const o=t[i];if(n[i]===void 0){n[i]=o;continue}switch(i){case"rotate":n[i]=(n[i]+o)%4;break;case"hFlip":case"vFlip":n[i]=o!==n[i];break;default:n[i]=o}}}return n}function pe(e,t,n=!1){function r(o,a){var s,f,c,d;if(e.icons[o]!==void 0)return Object.assign({},e.icons[o]);if(a>5)return null;if(((s=e.aliases)==null?void 0:s[o])!==void 0){const u=(f=e.aliases)==null?void 0:f[o],h=r(u.parent,a+1);return h&&Ge(h,u)}return a===0&&((c=e.chars)==null?void 0:c[o])!==void 0?r((d=e.chars)==null?void 0:d[o],a+1):null}const i=r(t,0);if(i)for(const o in S)i[o]===void 0&&e[o]!==void 0&&(i[o]=e[o]);return i&&n?H(i):i}var We=/^[a-f0-9]+(-[a-f0-9]+)*$/;function ge(e,t){for(const n in e){const r=n,o=typeof e[r];if(o==="undefined"){delete e[r];continue}switch(n){case"body":case"parent":if(o!=="string")return n;break;case"hFlip":case"vFlip":case"hidden":if(o!=="boolean")if(t)delete e[r];else return n;break;case"width":case"height":case"left":case"top":case"rotate":case"inlineHeight":case"inlineTop":case"verticalAlign":if(o!=="number")if(t)delete e[r];else return n;break;default:if(o==="object")if(t)delete e[r];else return n}}return null}function Je(e,t){const n=!!(t==null?void 0:t.fix);if(typeof e!="object"||e===null||typeof e.icons!="object"||!e.icons)throw new Error("Bad icon set");const r=e;if(typeof(t==null?void 0:t.prefix)=="string")r.prefix=t.prefix;else if(typeof r.prefix!="string"||!r.prefix.match(j))throw new Error("Invalid prefix");if(typeof(t==null?void 0:t.provider)=="string")r.provider=t.provider;else if(r.provider!==void 0){const o=r.provider;if(typeof o!="string"||o!==""&&!o.match(j))if(n)delete r.provider;else throw new Error("Invalid provider")}const i=r.icons;if(Object.keys(i).forEach(o=>{if(!o.match(j)){if(n){delete i[o];return}throw new Error(`Invalid icon name: "${o}"`)}const a=i[o];if(typeof a!="object"||a===null||typeof a.body!="string"){if(n){delete i[o];return}throw new Error(`Invalid icon: "${o}"`)}const s=typeof a.parent=="string"?"parent":ge(a,n);if(s!==null){if(n){delete i[o];return}throw new Error(`Invalid property "${s}" in icon "${o}"`)}}),!Object.keys(r.icons).length)throw new Error("Icon set is empty");if(r.aliases!==void 0&&(typeof r.aliases!="object"||r.aliases===null))if(n)delete r.aliases;else throw new Error("Invalid aliases list");if(typeof r.aliases=="object"){let o=function(c,d){if(s.has(c))return!f.has(c);const u=a[c];if(d>5||typeof u!="object"||u===null||typeof u.parent!="string"||!c.match(j)){if(n)return delete a[c],f.add(c),!1;throw new Error(`Invalid icon alias: "${c}"`)}const h=u.parent;if(r.icons[h]===void 0&&(a[h]===void 0||!o(h,d+1))){if(n)return delete a[c],f.add(c),!1;throw new Error(`Missing parent icon for alias "${c}`)}n&&u.body!==void 0&&delete u.body;const y=u.body!==void 0?"body":ge(u,n);if(y!==null){if(n)return delete a[c],f.add(c),!1;throw new Error(`Invalid property "${y}" in alias "${c}"`)}return s.add(c),!0};const a=r.aliases,s=new Set,f=new Set;Object.keys(a).forEach(c=>{o(c,0)}),n&&!Object.keys(r.aliases).length&&delete r.aliases}if(Object.keys(S).forEach(o=>{const a=typeof S[o],s=typeof r[o];if(s!=="undefined"&&s!==a)throw new Error(`Invalid value type for "${o}"`)}),r.chars!==void 0&&(typeof r.chars!="object"||r.chars===null))if(n)delete r.chars;else throw new Error("Invalid characters map");if(typeof r.chars=="object"){const o=r.chars;Object.keys(o).forEach(a=>{var s;if(!a.match(We)||typeof o[a]!="string"){if(n){delete o[a];return}throw new Error(`Invalid character "${a}"`)}const f=o[a];if(r.icons[f]===void 0&&((s=r.aliases)==null?void 0:s[f])===void 0){if(n){delete o[a];return}throw new Error(`Character "${a}" points to missing icon "${f}"`)}}),n&&!Object.keys(r.chars).length&&delete r.chars}return r}function Xe(e){for(const t in S)if(e[t]!==void 0)return!0;return!1}function ye(e,t,n){n=n||{};const r=[];if(typeof e!="object"||typeof e.icons!="object")return r;const i=n.validate;if(i!==!1)try{Je(e,typeof i=="object"?i:{fix:!0})}catch{return r}e.not_found instanceof Array&&e.not_found.forEach(s=>{t(s,null),r.push(s)});const o=e.icons;Object.keys(o).forEach(s=>{const f=pe(e,s,!0);f&&(t(s,f),r.push(s))});const a=n.aliases||"all";if(a!=="none"&&typeof e.aliases=="object"){const s=e.aliases;Object.keys(s).forEach(f=>{if(a==="variations"&&Xe(s[f]))return;const c=pe(e,f,!0);c&&(t(f,c),r.push(f))})}return r}var K=Object.create(null);function Ze(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:Object.create(null)}}function $(e,t){K[e]===void 0&&(K[e]=Object.create(null));const n=K[e];return n[t]===void 0&&(n[t]=Ze(e,t)),n[t]}function Q(e,t){const n=Date.now();return ye(t,(r,i)=>{i?e.icons[r]=i:e.missing[r]=n})}function et(e,t,n){try{if(typeof n.body=="string")return e.icons[t]=Object.freeze(H(n)),!0}catch{}return!1}function tt(e,t){const n=e.icons[t];return n===void 0?null:n}var N=!1;function me(e){return typeof e=="boolean"&&(N=e),N}function nt(e){const t=typeof e=="string"?M(e,!0,N):e;return t?tt($(t.provider,t.prefix),t.name):null}function rt(e,t){const n=M(e,!0,N);if(!n)return!1;const r=$(n.provider,n.prefix);return et(r,n.name,t)}function ot(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=typeof e.provider=="string"?e.provider:""),N&&t===""&&(typeof e.prefix!="string"||e.prefix==="")){let r=!1;return ye(e,(i,o)=>{o&&rt(i,o)&&(r=!0)},{validate:{fix:!0,prefix:""}}),r}if(typeof e.prefix!="string"||!A({provider:t,prefix:e.prefix,name:"a"}))return!1;const n=$(t,e.prefix);return!!Q(n,e)}var be=Object.freeze({inline:!1,width:null,height:null,hAlign:"center",vAlign:"middle",slice:!1,hFlip:!1,vFlip:!1,rotate:0});function it(e,t){const n={};for(const r in e){const i=r;if(n[i]=e[i],t[i]===void 0)continue;const o=t[i];switch(i){case"inline":case"slice":typeof o=="boolean"&&(n[i]=o);break;case"hFlip":case"vFlip":o===!0&&(n[i]=!n[i]);break;case"hAlign":case"vAlign":typeof o=="string"&&o!==""&&(n[i]=o);break;case"width":case"height":(typeof o=="string"&&o!==""||typeof o=="number"&&o||o===null)&&(n[i]=o);break;case"rotate":typeof o=="number"&&(n[i]+=o);break}}return n}var st=/(-?[0-9.]*[0-9]+[0-9.]*)/g,at=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Y(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 r=e.split(st);if(r===null||!r.length)return e;const i=[];let o=r.shift(),a=at.test(o);for(;;){if(a){const s=parseFloat(o);isNaN(s)?i.push(o):i.push(Math.ceil(s*t*n)/n)}else i.push(o);if(o=r.shift(),o===void 0)return i.join("");a=!a}}function lt(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 ct(e,t){const n={left:e.left,top:e.top,width:e.width,height:e.height};let r=e.body;[e,t].forEach(s=>{const f=[],c=s.hFlip,d=s.vFlip;let u=s.rotate;c?d?u+=2:(f.push("translate("+(n.width+n.left)+" "+(0-n.top)+")"),f.push("scale(-1 1)"),n.top=n.left=0):d&&(f.push("translate("+(0-n.left)+" "+(n.height+n.top)+")"),f.push("scale(1 -1)"),n.top=n.left=0);let h;switch(u<0&&(u-=Math.floor(u/4)*4),u=u%4,u){case 1:h=n.height/2+n.top,f.unshift("rotate(90 "+h+" "+h+")");break;case 2:f.unshift("rotate(180 "+(n.width/2+n.left)+" "+(n.height/2+n.top)+")");break;case 3:h=n.width/2+n.left,f.unshift("rotate(-90 "+h+" "+h+")");break}u%2==1&&((n.left!==0||n.top!==0)&&(h=n.left,n.left=n.top,n.top=h),n.width!==n.height&&(h=n.width,n.width=n.height,n.height=h)),f.length&&(r='<g transform="'+f.join(" ")+'">'+r+"</g>")});let i,o;t.width===null&&t.height===null?(o="1em",i=Y(o,n.width/n.height)):t.width!==null&&t.height!==null?(i=t.width,o=t.height):t.height!==null?(o=t.height,i=Y(o,n.width/n.height)):(i=t.width,o=Y(i,n.height/n.width)),i==="auto"&&(i=n.width),o==="auto"&&(o=n.height),i=typeof i=="string"?i:i+"",o=typeof o=="string"?o:o+"";const a={attributes:{width:i,height:o,preserveAspectRatio:lt(t),viewBox:n.left+" "+n.top+" "+n.width+" "+n.height},body:r};return t.inline&&(a.inline=!0),a}var ft=/\sid="(\S+)"/g,ut="IconifyId-"+Date.now().toString(16)+"-"+(Math.random()*16777216|0).toString(16)+"-",dt=0;function ht(e,t=ut){const n=[];let r;for(;r=ft.exec(e);)n.push(r[1]);return n.length&&n.forEach(i=>{const o=typeof t=="function"?t(i):t+dt++,a=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+o+"$3")}),e}var G=Object.create(null);function pt(e,t){G[e]=t}function W(e){return G[e]||G[""]}function J(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}}for(var X=Object.create(null),O=["https://api.simplesvg.com","https://api.unisvg.com"],B=[];O.length>0;)O.length===1||Math.random()>.5?B.push(O.shift()):B.push(O.pop());X[""]=J({resources:["https://api.iconify.design"].concat(B)});function gt(e,t){const n=J(t);return n===null?!1:(X[e]=n,!0)}function Z(e){return X[e]}var ve=(e,t)=>{let n=e,r=n.indexOf("?")!==-1;function i(o){switch(typeof o){case"boolean":return o?"true":"false";case"number":return encodeURIComponent(o);case"string":return encodeURIComponent(o);default:throw new Error("Invalid parameter")}}return Object.keys(t).forEach(o=>{let a;try{a=i(t[o])}catch{return}n+=(r?"&":"?")+encodeURIComponent(o)+"="+a,r=!0}),n},we=Object.create(null),D=Object.create(null),yt=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}try{const t=String.fromCharCode(114)+String.fromCharCode(101);if(e=global[t+"qui"+t]("cross-fetch"),typeof e=="function")return e}catch{}return null},_e=yt();function mt(e,t){const n=Z(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let o=0;n.resources.forEach(s=>{o=Math.max(o,s.length)});const a=ve(t+".json",{icons:""});r=n.maxURL-o-n.path.length-a.length}const i=e+":"+t;return D[e]=n.path,we[i]=r,r}var bt=(e,t,n)=>{const r=[];let i=we[t];i===void 0&&(i=mt(e,t));const o="icons";let a={type:o,provider:e,prefix:t,icons:[]},s=0;return n.forEach((f,c)=>{s+=f.length+1,s>=i&&c>0&&(r.push(a),a={type:o,provider:e,prefix:t,icons:[]},s=f.length),a.icons.push(f)}),r.push(a),r};function vt(e){if(typeof e=="string"){if(D[e]===void 0){const t=Z(e);if(!t)return"/";D[e]=t.path}return D[e]}return"/"}var wt=(e,t,n)=>{if(!_e){n.done(void 0,424);return}let r=vt(t.provider);switch(t.type){case"icons":{const o=t.prefix,s=t.icons.join(",");r+=ve(o+".json",{icons:s});break}case"custom":{const o=t.uri;r+=o.slice(0,1)==="/"?o.slice(1):o;break}default:n.done(void 0,400);return}let i=503;_e(e+r).then(o=>{if(o.status!==200){setTimeout(()=>{n.done(void 0,o.status)});return}return i=501,o.json()}).then(o=>{if(typeof o!="object"||o===null){setTimeout(()=>{n.done(void 0,i)});return}setTimeout(()=>{n.done(o)})}).catch(()=>{n.done(void 0,i)})},_t={prepare:bt,send:wt};function It(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((i,o)=>i.provider!==o.provider?i.provider.localeCompare(o.provider):i.prefix!==o.prefix?i.prefix.localeCompare(o.prefix):i.name.localeCompare(o.name));let r={provider:"",prefix:"",name:""};return e.forEach(i=>{if(r.name===i.name&&r.prefix===i.prefix&&r.provider===i.provider)return;r=i;const o=i.provider,a=i.prefix,s=i.name;n[o]===void 0&&(n[o]=Object.create(null));const f=n[o];f[a]===void 0&&(f[a]=$(o,a));const c=f[a];let d;c.icons[s]!==void 0?d=t.loaded:a===""||c.missing[s]!==void 0?d=t.missing:d=t.pending;const u={provider:o,prefix:a,name:s};d.push(u)}),t}var x=Object.create(null),ee=Object.create(null);function Ie(e,t){e.forEach(n=>{const r=n.provider;if(x[r]===void 0)return;const i=x[r],o=n.prefix,a=i[o];a&&(i[o]=a.filter(s=>s.id!==t))})}function xt(e,t){ee[e]===void 0&&(ee[e]=Object.create(null));const n=ee[e];n[t]||(n[t]=!0,setTimeout(()=>{if(n[t]=!1,x[e]===void 0||x[e][t]===void 0)return;const r=x[e][t].slice(0);if(!r.length)return;const i=$(e,t);let o=!1;r.forEach(a=>{const s=a.icons,f=s.pending.length;s.pending=s.pending.filter(c=>{if(c.prefix!==t)return!0;const d=c.name;if(i.icons[d]!==void 0)s.loaded.push({provider:e,prefix:t,name:d});else if(i.missing[d]!==void 0)s.missing.push({provider:e,prefix:t,name:d});else return o=!0,!0;return!1}),s.pending.length!==f&&(o||Ie([{provider:e,prefix:t}],a.id),a.callback(s.loaded.slice(0),s.missing.slice(0),s.pending.slice(0),a.abort))})}))}var Et=0;function kt(e,t,n){const r=Et++,i=Ie.bind(null,n,r);if(!t.pending.length)return i;const o={id:r,icons:t,callback:e,abort:i};return n.forEach(a=>{const s=a.provider,f=a.prefix;x[s]===void 0&&(x[s]=Object.create(null));const c=x[s];c[f]===void 0&&(c[f]=[]),c[f].push(o)}),i}function jt(e,t=!0,n=!1){const r=[];return e.forEach(i=>{const o=typeof i=="string"?M(i,!1,n):i;(!t||A(o,n))&&r.push({provider:o.provider,prefix:o.prefix,name:o.name})}),r}var xe={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function $t(e,t,n,r,i){const o=e.resources.length,a=e.random?Math.floor(Math.random()*o):e.index;let s;if(e.random){let p=e.resources.slice(0);for(s=[];p.length>1;){const w=Math.floor(Math.random()*p.length);s.push(p[w]),p=p.slice(0,w).concat(p.slice(w+1))}s=s.concat(p)}else s=e.resources.slice(a).concat(e.resources.slice(0,a));const f=Date.now();let c="pending",d=0,u,h=null,y=[],v=[];typeof r=="function"&&v.push(r);function k(){h&&(clearTimeout(h),h=null)}function fe(){c==="pending"&&(c="aborted"),k(),y.forEach(p=>{p.abort&&p.abort(),p.status==="pending"&&(p.status="aborted")}),y=[]}function Mn(p,w){w&&(v=[]),typeof p=="function"&&v.push(p)}function Me(){return{startTime:f,payload:t,status:c,queriesSent:d,queriesPending:y.length,subscribe:Mn,abort:fe}}function ue(){c="failed",v.forEach(p=>{p(void 0,u)})}function Be(){y=y.filter(p=>(p.status==="pending"&&(p.status="aborted"),p.abort&&p.abort(),!1))}function Bn(p,w,U){const P=w===void 0;switch(y=y.filter(_=>_!==p),c){case"pending":break;case"failed":if(P||!e.dataAfterTimeout)return;break;default:return}if(P){U!==void 0&&(u=U),y.length||(s.length?de():ue());return}if(k(),Be(),i&&!e.random){const _=e.resources.indexOf(p.resource);_!==-1&&_!==e.index&&i(_)}c="completed",v.forEach(_=>{_(w)})}function de(){if(c!=="pending")return;k();const p=s.shift();if(p===void 0){if(y.length){const P=typeof e.timeout=="function"?e.timeout(f):e.timeout;if(P){h=setTimeout(()=>{k(),c==="pending"&&(Be(),ue())},P);return}}ue();return}const w={getQueryStatus:Me,status:"pending",resource:p,done:(P,_)=>{Bn(w,P,_)}};y.push(w),d++;const U=typeof e.rotate=="function"?e.rotate(d,f):e.rotate;h=setTimeout(de,U),n(p,t,w)}return setTimeout(de),Me}function Ct(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 xe)e[n]!==void 0?t[n]=e[n]:t[n]=xe[n];return t}function Ee(e){const t=Ct(e);let n=[];function r(){n=n.filter(s=>s().status==="pending")}function i(s,f,c){const d=$t(t,s,f,(u,h)=>{r(),c&&c(u,h)},u=>{t.index=u});return n.push(d),d}function o(s){const f=n.find(c=>s(c));return f!==void 0?f:null}return{query:i,find:o,setIndex:s=>{t.index=s},getIndex:()=>t.index,cleanup:r}}function ke(){}var te=Object.create(null);function Pt(e){if(te[e]===void 0){const t=Z(e);if(!t)return;const n=Ee(t),r={config:t,redundancy:n};te[e]=r}return te[e]}function St(e,t,n){let r,i;if(typeof e=="string"){const o=W(e);if(!o)return n(void 0,424),ke;i=o.send;const a=Pt(e);a&&(r=a.redundancy)}else{const o=J(e);if(o){r=Ee(o);const a=e.resources?e.resources[0]:"",s=W(a);s&&(i=s.send)}}return!r||!i?(n(void 0,424),ke):r.query(t,i,n)().abort}var ne={};function je(){}var C=Object.create(null),re=Object.create(null),oe=Object.create(null),ie=Object.create(null);function Tt(e,t){oe[e]===void 0&&(oe[e]=Object.create(null));const n=oe[e];n[t]||(n[t]=!0,setTimeout(()=>{n[t]=!1,xt(e,t)}))}var $e=Object.create(null);function At(e,t,n){function r(){const s=(e===""?"":"@"+e+":")+t,f=Math.floor(Date.now()/6e4);$e[s]<f&&($e[s]=f,console.error('Unable to retrieve icons for "'+s+'" because API is not configured properly.'))}re[e]===void 0&&(re[e]=Object.create(null));const i=re[e];ie[e]===void 0&&(ie[e]=Object.create(null));const o=ie[e];C[e]===void 0&&(C[e]=Object.create(null));const a=C[e];i[t]===void 0?i[t]=n:i[t]=i[t].concat(n).sort(),o[t]||(o[t]=!0,setTimeout(()=>{o[t]=!1;const s=i[t];delete i[t];const f=W(e);if(!f){r();return}f.prepare(e,t,s).forEach(d=>{St(e,d,(u,h)=>{const y=$(e,t);if(typeof u!="object"){if(h!==404)return;const v=Date.now();d.icons.forEach(k=>{y.missing[k]=v})}else try{const v=Q(y,u);if(!v.length)return;const k=a[t];v.forEach(fe=>{delete k[fe]}),ne.store&&ne.store(e,u)}catch(v){console.error(v)}Tt(e,t)})})}))}var Nt=(e,t)=>{const n=jt(e,!0,me()),r=It(n);if(!r.pending.length){let c=!0;return t&&setTimeout(()=>{c&&t(r.loaded,r.missing,r.pending,je)}),()=>{c=!1}}const i=Object.create(null),o=[];let a,s;r.pending.forEach(c=>{const d=c.provider,u=c.prefix;if(u===s&&d===a)return;a=d,s=u,o.push({provider:d,prefix:u}),C[d]===void 0&&(C[d]=Object.create(null));const h=C[d];h[u]===void 0&&(h[u]=Object.create(null)),i[d]===void 0&&(i[d]=Object.create(null));const y=i[d];y[u]===void 0&&(y[u]=[])});const f=Date.now();return r.pending.forEach(c=>{const d=c.provider,u=c.prefix,h=c.name,y=C[d][u];y[h]===void 0&&(y[h]=f,i[d][u].push(h))}),o.forEach(c=>{const d=c.provider,u=c.prefix;i[d][u].length&&At(d,u,i[d][u])}),t?kt(t,r,o):je},Ce="iconify2",V="iconify",Pe=V+"-count",Se=V+"-version",Te=36e5,Ot=168,se={local:!0,session:!0},ae=!1,Ae={local:0,session:0},Ne={local:[],session:[]},q=typeof window=="undefined"?{}:window;function Oe(e){const t=e+"Storage";try{if(q&&q[t]&&typeof q[t].length=="number")return q[t]}catch{}return se[e]=!1,null}function le(e,t,n){try{return e.setItem(Pe,n+""),Ae[t]=n,!0}catch{return!1}}function Ve(e){const t=e.getItem(Pe);if(t){const n=parseInt(t);return n||0}return 0}function Vt(e,t){try{e.setItem(Se,Ce)}catch{}le(e,t,0)}function Rt(e){try{const t=Ve(e);for(let n=0;n<t;n++)e.removeItem(V+n)}catch{}}var Re=()=>{if(ae)return;ae=!0;const e=Math.floor(Date.now()/Te)-Ot;function t(n){const r=Oe(n);if(!r)return;const i=o=>{const a=V+o,s=r.getItem(a);if(typeof s!="string")return!1;let f=!0;try{const c=JSON.parse(s);if(typeof c!="object"||typeof c.cached!="number"||c.cached<e||typeof c.provider!="string"||typeof c.data!="object"||typeof c.data.prefix!="string")f=!1;else{const d=c.provider,u=c.data.prefix,h=$(d,u);f=Q(h,c.data).length>0}}catch{f=!1}return f||r.removeItem(a),f};try{const o=r.getItem(Se);if(o!==Ce){o&&Rt(r),Vt(r,n);return}let a=Ve(r);for(let s=a-1;s>=0;s--)i(s)||(s===a-1?a--:Ne[n].push(s));le(r,n,a)}catch{}}for(const n in se)t(n)},Ft=(e,t)=>{ae||Re();function n(r){if(!se[r])return!1;const i=Oe(r);if(!i)return!1;let o=Ne[r].shift();if(o===void 0&&(o=Ae[r],!le(i,r,o+1)))return!1;try{const a={cached:Math.floor(Date.now()/Te),provider:e,data:t};i.setItem(V+o,JSON.stringify(a))}catch{return!1}return!0}n("local")||n("session")},Fe=/[\s,]+/;function Lt(e,t){t.split(Fe).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function Mt(e,t){t.split(Fe).forEach(n=>{const r=n.trim();switch(r){case"left":case"center":case"right":e.hAlign=r;break;case"top":case"middle":case"bottom":e.vAlign=r;break;case"slice":case"crop":e.slice=!0;break;case"meet":e.slice=!1}})}function Bt(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function r(i){for(;i<0;)i+=4;return i%4}if(n===""){const i=parseInt(e);return isNaN(i)?0:r(i)}else if(n!==e){let i=0;switch(n){case"%":i=25;break;case"deg":i=90}if(i){let o=parseFloat(e.slice(0,e.length-n.length));return isNaN(o)?0:(o=o/i,o%1==0?r(o):0)}}return t}const Dt={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 r={attr:e.slice(0,1)+t,boolean:t==="Flip"};E[e+"-"+t.toLowerCase()]=r,E[e.slice(0,1)+"-"+t.toLowerCase()]=r,E[e+t]=r})});const qt=(e,t)=>{const n=it(be,t),r=I({},Dt);let i=typeof t.style=="object"&&!(t.style instanceof Array)?I({},t.style):{};for(let f in t){const c=t[f];if(c!==void 0)switch(f){case"icon":case"style":case"onLoad":break;case"inline":case"hFlip":case"vFlip":n[f]=c===!0||c==="true"||c===1;break;case"flip":typeof c=="string"&&Lt(n,c);break;case"align":typeof c=="string"&&Mt(n,c);break;case"color":i.color=c;break;case"rotate":typeof c=="string"?n[f]=Bt(c):typeof c=="number"&&(n[f]=c);break;case"ariaHidden":case"aria-hidden":c!==!0&&c!=="true"&&delete r["aria-hidden"];break;default:E[f]!==void 0?E[f].boolean&&(c===!0||c==="true"||c===1)?n[E[f].attr]=!0:!E[f].boolean&&typeof c=="string"&&c!==""&&(n[E[f].attr]=c):be[f]===void 0&&(r[f]=c)}}const o=ct(e,n);for(let f in o.attributes)r[f]=o.attributes[f];o.inline&&i.verticalAlign===void 0&&i["vertical-align"]===void 0&&(i.verticalAlign="-0.125em");let a=0;const s=t.id;return r.innerHTML=ht(o.body,s?()=>s+"-"+a++:"iconify-vue-"),Object.keys(i).length>0&&(r.style=i),l.h("svg",r)};if(me(!0),pt("",_t),typeof document!="undefined"&&typeof window!="undefined"){ne.store=Ft,Re();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(r=>{try{(typeof r!="object"||r===null||r instanceof Array||typeof r.icons!="object"||typeof r.prefix!="string"||!ot(r))&&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 r="IconifyProviders["+n+"] is invalid.";try{const i=t[n];if(typeof i!="object"||!i||i.resources===void 0)continue;gt(n,i)||console.error(r)}catch{console.error(r)}}}}const ce=l.defineComponent({inheritAttrs:!1,data(){return{mounted:!1,counter:0}},beforeMount(){this._name="",this._loadingIcon=null,this.mounted=!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:H(e)};let n;if(typeof e!="string"||(n=M(e,!1,!0))===null)return this.abortLoading(),null;const r=nt(n);if(r===null)return(!this._loadingIcon||this._loadingIcon.name!==e)&&(this.abortLoading(),this._name="",this._loadingIcon={name:e,abort:Nt([n],()=>{this.counter++})}),null;this.abortLoading(),this._name!==e&&(this._name=e,t&&t(e));const i=["iconify"];return n.prefix!==""&&i.push("iconify--"+n.prefix),n.provider!==""&&i.push("iconify--"+n.provider),{data:r,classes:i}}},render(){if(!this.mounted)return this.$slots.default?this.$slots.default():null;this.counter;const e=this.$attrs,t=this.getIcon(e.icon,e.onLoad);if(!t)return this.$slots.default?this.$slots.default():null;let n=e;return t.classes&&(n=he(I({},e),{class:(typeof e.class=="string"?e.class+" ":"")+t.classes.join(" ")})),qt(t.data,n)}});var T=(e,t)=>{for(const[n,r]of t)e[n]=r;return e};const Ut={components:{Icon:ce},setup(){return{icons:{error:"mdi:alert",warning:"mdi:alert-circle",info:"mdi:information",success:"mdi:check-bold"},colors:{error:"text-red",warning:"text-orange",info:"text-purple",success:"text-green"}}}},zt={class:"ml-4 leading-tight"};function Ht(e,t,n,r,i,o){const a=l.resolveComponent("Icon");return l.openBlock(),l.createBlock(l.Teleport,{to:"body"},[l.createVNode(l.TransitionGroup,{tag:"div",name:"pf-list",class:"fixed w-2/3 space-y-2 transition-all sm:w-1/4 bottom-2 left-2"},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(e.$notif.list,s=>(l.openBlock(),l.createElementBlock("div",{key:s.id,class:"flex items-center p-4 transition bg-white rounded shadow-sm"},[l.createVNode(a,{class:l.normalizeClass([r.colors[s.type],"text-xl"]),icon:r.icons[s.type],inline:""},null,8,["class","icon"]),l.createElementVNode("p",zt,l.toDisplayString(s.message),1)]))),128))]),_:1})])}var Kt=T(Ut,[["render",Ht]]);const R=l.ref([]),Qt=l.readonly(R);function F(e,t,n){const r=Ye();R.value=[...R.value,{type:e,message:t,actions:n,id:r}],setTimeout(()=>{R.value=R.value.filter(i=>i.id!==r)},2e3)}function Yt(...e){F("error",...e)}function Gt(...e){F("warn",...e)}function Wt(...e){F("info",...e)}function Jt(...e){F("success",...e)}function Xt(e){e.config.globalProperties.$notif=l.reactive({list:Qt,push:F,error:Yt,warn:Gt,info:Wt,success:Jt}),e.component("Pf_TheNotifications",Kt)}var Kn="";const Zt={components:{Icon:ce},props:{title:{type:String,default:null}},emits:["close"]},en={class:"flex items-start"},tn={class:"flex-1 overflow-hidden title overflow-ellipsis"},nn={class:"overflow-auto content"},rn={class:"py-2"};function on(e,t,n,r,i,o){const a=l.resolveComponent("Icon");return l.openBlock(),l.createBlock(l.Teleport,{to:"body"},[l.createElementVNode("div",{class:"fixed inset-0 bg-gray-200",onClick:t[2]||(t[2]=s=>e.$emit("close"))},[l.createElementVNode("div",{class:"p-2 m-auto mt-2 bg-white rounded-md shadow-md sm:mt-4 top-2 pf-dialog",onClick:t[1]||(t[1]=l.withModifiers(()=>{},["stop"]))},[l.createElementVNode("div",en,[l.createElementVNode("div",tn,l.toDisplayString(n.title),1),l.createElementVNode("button",{class:"ml-2 pf-icon-btn",onClick:t[0]||(t[0]=s=>e.$emit("close"))},[l.createVNode(a,{icon:"mdi:close",class:"text-purple"})])]),l.createElementVNode("div",nn,[l.renderSlot(e.$slots,"default")]),l.createElementVNode("div",rn,[l.renderSlot(e.$slots,"footer")])])])])}var sn=T(Zt,[["render",on]]);function an(e){const t=b.useRoute(),n=b.useRouter(),r=l.computed(()=>!!t.query[e]);return l.watch(r,i=>{i?document.body.classList.add("overflow-hidden"):document.body.classList.remove("overflow-hidden")},{immediate:!0}),{isOpen:r,open(){const i=he(I({},t.query),{[e]:"open"});n.push({query:i})},async close(){const i=new Promise(a=>{const s=l.watch(r,f=>{f||(a(),s())})}),o=I({},t.query);return delete o[e],n.replace({query:o}),i}}}function ln(e){e.component("Pf_Dialog",sn)}const cn=l.reactive({});function fn(e){e.config.globalProperties.$responsive=l.reactive({breakpoints:cn})}function un(e){e.component("Pf_Icon",ce)}class dn{constructor({supabase:t,roleContextKeyName:n,devRedirectTo:r}){this.supabase=t,this.roleContextKeyName=n,this.devRedirectTo=r,this._user=l.ref(void 0),this._roles=l.ref(void 0)}async getUserProfile(t){const{data:n,error:r}=await this.supabase.from("profiles").select().match({id:t});return r||n.length===0?null:n[0]}async synchroUserWithSupabase(t){if(t){const n=t.user.id,{firstname:r,lastname:i}=await this.getUserProfile(n)||{};this._user.value={id:n,avatar:t.user.user_metadata.avatar_url,firstname:r,lastname:i}}else this._user.value=null;this._roles.value=void 0,await this.synchronizeRoles()}async synchronizeRoles(t){if(!this._user.value){this._roles.value=[];return}let n,r;t?{data:n,error:r}=await this.supabase.from("roles").select().match({user_id:this._user.value.id}).or(`${this.roleContextKeyName}.eq.${t},${this.roleContextKeyName}.is.null`):{data:n,error:r}=await this.supabase.from("roles").select().match({user_id:this._user.value.id}).is(`${this.roleContextKeyName}`,null),r?this._roles.value=[]:this._roles.value=n.map(({name:i})=>i)}async synchronizeProfile(){return await this.synchroUserWithSupabase(this.supabase.auth.session())}async login(){this.devRedirectTo?await this.supabase.auth.signIn({provider:"discord"},{redirectTo:this.devRedirectTo}):await this.supabase.auth.signIn({provider:"discord"})}async logout(){await this.supabase.auth.signOut()}async setProfile(t){if(!this._user.value)return;const{error:n}=await this.supabase.from("profiles").update(t).match({id:this._user.value.id});if(n)return Promise.reject(n);await this.synchronizeProfile()}async getIsAuthenticated(){return this._user.value!==void 0?Promise.resolve(!!this._user.value):new Promise(t=>{const n=l.watch(this._user,r=>{r!==void 0&&(t(r!==null),n())})})}async getHasRoles(t){return this._roles.value!==void 0?Promise.resolve(t.some(n=>this._roles.value.includes(n))):new Promise(n=>{const r=l.watch(this._roles,i=>{i!==void 0&&(n(t.some(o=>this._roles.value.includes(o))),r())})})}}const Le=Symbol("Authentification");function hn(e,{supabase:t,router:n,loginRouteName:r="login",defaultRouteName:i="home",roleContextKeyName:o,devRedirectTo:a}={}){const s=new dn({supabase:t,roleContextKeyName:o,devRedirectTo:a}),f=l.readonly(s._user),c=l.readonly(s._roles);s.synchroUserWithSupabase(t.auth.session()),t.auth.onAuthStateChange((u,h)=>{s.synchroUserWithSupabase(h)});const d=l.reactive({user:f,roles:c,login:s.login.bind(s),logout:s.login.bind(s),setProfile:s.setProfile.bind(s),synchronizeRoles:s.synchronizeRoles.bind(s)});e.config.globalProperties.$auth=d,n.beforeEach(async u=>{if(u.meta.auth||u.meta.roles){if(!await s.getIsAuthenticated())return{name:r,query:{redirect_uri:u.fullPath}};if(u.meta.roles&&!await s.getHasRoles(u.meta.roles))return{name:i}}}),e.provide(Le,d)}function pn(){const e=l.inject(Le,{}),t=l.toRef(e,"user"),n=l.toRef(e,"roles");return{user:t,roles:n,synchronizeRoles:e.synchronizeRoles,setProfile:e.synchronizeProfile}}const gn={},yn={class:"animate-spin rounded-full border-t-2 border-b-2 border-purple"};function mn(e,t){return l.openBlock(),l.createElementBlock("div",yn)}var bn=T(gn,[["render",mn]]);const vn={components:{Spinner:bn},inheritAttrs:!1,props:{disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},computed:{internalDisabled(){return this.loading&&this.disabled}}},wn=["disabled"],_n={key:0,name:"loading",class:"absolute inset-0 bg-white flex items-center justify-center"};function In(e,t,n,r,i,o){const a=l.resolveComponent("Spinner");return l.openBlock(),l.createElementBlock("button",l.mergeProps({class:"pf-btn -primary flex relative",type:"submit"},e.$attrs,{disabled:o.internalDisabled}),[l.renderSlot(e.$slots,"default"),n.loading?(l.openBlock(),l.createElementBlock("div",_n,[l.createVNode(a,{class:"h-4 w-4"})])):l.createCommentVNode("",!0)],16,wn)}var xn=T(vn,[["render",In]]);const En={},kn={class:"px-1 py-2 text-xs text-center text-gray-700"},jn=l.createElementVNode("p",null,[l.createTextVNode(" This is a "),l.createElementVNode("a",{class:"pf-link",href:"https://purple-fox.fr/"},"PurpleFox"),l.createTextVNode(" tool, developed by PurpleOrwel aka Aur\xE9lie VIOLETTE. ")],-1),$n={class:"flex justify-center gap-4"},Cn={class:"flex items-center pf-link",href:"https://bit.ly/3yLzyAb"},Pn=l.createTextVNode("Twitter"),Sn={class:"flex items-center pf-link",href:"https://bit.ly/3sfmS3p"},Tn=l.createTextVNode("GitHub "),An={class:"flex items-center pf-link",href:"https://bit.ly/3rim6R5"},Nn=l.createTextVNode("Discord");function On(e,t){const n=l.resolveComponent("Pf_Icon");return l.openBlock(),l.createElementBlock("footer",kn,[jn,l.createElementVNode("nav",null,[l.createElementVNode("ul",$n,[l.createElementVNode("li",null,[l.createElementVNode("a",Cn,[l.createVNode(n,{inline:"",icon:"mdi:twitter",class:"mr-1"}),Pn])]),l.createElementVNode("li",null,[l.createElementVNode("a",Sn,[l.createVNode(n,{inline:"",icon:"mdi:github",class:"mr-1"}),Tn])]),l.createElementVNode("li",null,[l.createElementVNode("a",An,[l.createVNode(n,{inline:"",icon:"mdi:discord",class:"mr-1"}),Nn])])])])])}var Vn=T(En,[["render",On]]);const Rn={props:{minHeight:{type:Number,required:!1,default:null}},methods:{beforeEnter(e){e.style.overflowY="hidden"},enter(e){const{width:t}=window.getComputedStyle(e),n=e.style.width;e.style.width=t,e.style.position="absolute",e.style.visibility="hidden",e.style.height="auto";const{height:r}=window.getComputedStyle(e);e.style.width=n,e.style.position="",e.style.visibility="",e.style.height=this.minHeight||0,window.getComputedStyle(e).height,setTimeout(()=>{e.style.height=r})},afterEnter(e){e.style.height="auto",e.style.overflowY="unset"},leave(e){const{height:t}=window.getComputedStyle(e);e.style.height=t,e.style.overflowY="hidden",window.getComputedStyle(e).height,setTimeout(()=>{e.style.height=this.minHeight||0})}}};function Fn(e,t,n,r,i,o){return l.openBlock(),l.createBlock(l.Transition,{name:"pf-expand",onBeforeEnter:o.beforeEnter,onEnter:o.enter,onLeave:o.leave,onAfterEnter:o.afterEnter},{default:l.withCtx(()=>[l.renderSlot(e.$slots,"default")]),_:3},8,["onBeforeEnter","onEnter","onLeave","onAfterEnter"])}var Ln=T(Rn,[["render",Fn]]),Qn="";g.AuthPlugin=hn,g.IconPlugin=un,g.ModalPlugin=ln,g.NotificationsPlugin=Xt,g.Pf_ExpandTransition=Ln,g.Pf_Footer=Vn,g.Pf_SubmitButton=xn,g.ResponsivePlugin=fn,g.useAuth=pn,g.useModal=an,Object.defineProperty(g,"__esModule",{value:!0}),g[Symbol.toStringTag]="Module"}); | ||
var zn=Object.defineProperty,Hn=Object.defineProperties;var Kn=Object.getOwnPropertyDescriptors;var De=Object.getOwnPropertySymbols;var Qn=Object.prototype.hasOwnProperty,Yn=Object.prototype.propertyIsEnumerable;var qe=(g,a,b)=>a in g?zn(g,a,{enumerable:!0,configurable:!0,writable:!0,value:b}):g[a]=b,I=(g,a)=>{for(var b in a||(a={}))Qn.call(a,b)&&qe(g,b,a[b]);if(De)for(var b of De(a))Yn.call(a,b)&&qe(g,b,a[b]);return g},he=(g,a)=>Hn(g,Kn(a));(function(g,a){typeof exports=="object"&&typeof module!="undefined"?a(exports,require("vue"),require("vue-router")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router"],a):(g=typeof globalThis!="undefined"?globalThis:g||self,a(g.PurplefoxTools={},g.Vue,g.vueRouter))})(this,function(g,a,b){"use strict";var L,Ue=new Uint8Array(16);function ze(){if(!L&&(L=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!L))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return L(Ue)}var He=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function Ke(e){return typeof e=="string"&&He.test(e)}for(var m=[],z=0;z<256;++z)m.push((z+256).toString(16).substr(1));function Qe(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=(m[e[t+0]]+m[e[t+1]]+m[e[t+2]]+m[e[t+3]]+"-"+m[e[t+4]]+m[e[t+5]]+"-"+m[e[t+6]]+m[e[t+7]]+"-"+m[e[t+8]]+m[e[t+9]]+"-"+m[e[t+10]]+m[e[t+11]]+m[e[t+12]]+m[e[t+13]]+m[e[t+14]]+m[e[t+15]]).toLowerCase();if(!Ke(n))throw TypeError("Stringified UUID is invalid");return n}function Ye(e,t,n){e=e||{};var r=e.random||(e.rng||ze)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(var i=0;i<16;++i)t[n+i]=r[i];return t}return Qe(r)}var j=/^[a-z0-9]+(-[a-z0-9]+)*$/,T=Object.freeze({left:0,top:0,width:16,height:16,rotate:0,vFlip:!1,hFlip:!1});function H(e){return I(I({},T),e)}var M=(e,t,n,r="")=>{const i=e.split(":");if(e.slice(0,1)==="@"){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){const s=i.pop(),f=i.pop(),c={provider:i.length>0?i[0]:r,prefix:f,name:s};return t&&!A(c)?null:c}const o=i[0],l=o.split("-");if(l.length>1){const s={provider:r,prefix:l.shift(),name:l.join("-")};return t&&!A(s)?null:s}if(n&&r===""){const s={provider:r,prefix:"",name:o};return t&&!A(s,n)?null:s}return null},A=(e,t)=>e?!!((e.provider===""||e.provider.match(j))&&(t&&e.prefix===""||e.prefix.match(j))&&e.name.match(j)):!1;function Ge(e,t){const n=I({},e);for(const r in T){const i=r;if(t[i]!==void 0){const o=t[i];if(n[i]===void 0){n[i]=o;continue}switch(i){case"rotate":n[i]=(n[i]+o)%4;break;case"hFlip":case"vFlip":n[i]=o!==n[i];break;default:n[i]=o}}}return n}function pe(e,t,n=!1){function r(o,l){var s,f,c,d;if(e.icons[o]!==void 0)return Object.assign({},e.icons[o]);if(l>5)return null;if(((s=e.aliases)==null?void 0:s[o])!==void 0){const u=(f=e.aliases)==null?void 0:f[o],h=r(u.parent,l+1);return h&&Ge(h,u)}return l===0&&((c=e.chars)==null?void 0:c[o])!==void 0?r((d=e.chars)==null?void 0:d[o],l+1):null}const i=r(t,0);if(i)for(const o in T)i[o]===void 0&&e[o]!==void 0&&(i[o]=e[o]);return i&&n?H(i):i}var We=/^[a-f0-9]+(-[a-f0-9]+)*$/;function ge(e,t){for(const n in e){const r=n,o=typeof e[r];if(o==="undefined"){delete e[r];continue}switch(n){case"body":case"parent":if(o!=="string")return n;break;case"hFlip":case"vFlip":case"hidden":if(o!=="boolean")if(t)delete e[r];else return n;break;case"width":case"height":case"left":case"top":case"rotate":case"inlineHeight":case"inlineTop":case"verticalAlign":if(o!=="number")if(t)delete e[r];else return n;break;default:if(o==="object")if(t)delete e[r];else return n}}return null}function Je(e,t){const n=!!(t==null?void 0:t.fix);if(typeof e!="object"||e===null||typeof e.icons!="object"||!e.icons)throw new Error("Bad icon set");const r=e;if(typeof(t==null?void 0:t.prefix)=="string")r.prefix=t.prefix;else if(typeof r.prefix!="string"||!r.prefix.match(j))throw new Error("Invalid prefix");if(typeof(t==null?void 0:t.provider)=="string")r.provider=t.provider;else if(r.provider!==void 0){const o=r.provider;if(typeof o!="string"||o!==""&&!o.match(j))if(n)delete r.provider;else throw new Error("Invalid provider")}const i=r.icons;if(Object.keys(i).forEach(o=>{if(!o.match(j)){if(n){delete i[o];return}throw new Error(`Invalid icon name: "${o}"`)}const l=i[o];if(typeof l!="object"||l===null||typeof l.body!="string"){if(n){delete i[o];return}throw new Error(`Invalid icon: "${o}"`)}const s=typeof l.parent=="string"?"parent":ge(l,n);if(s!==null){if(n){delete i[o];return}throw new Error(`Invalid property "${s}" in icon "${o}"`)}}),!Object.keys(r.icons).length)throw new Error("Icon set is empty");if(r.aliases!==void 0&&(typeof r.aliases!="object"||r.aliases===null))if(n)delete r.aliases;else throw new Error("Invalid aliases list");if(typeof r.aliases=="object"){let o=function(c,d){if(s.has(c))return!f.has(c);const u=l[c];if(d>5||typeof u!="object"||u===null||typeof u.parent!="string"||!c.match(j)){if(n)return delete l[c],f.add(c),!1;throw new Error(`Invalid icon alias: "${c}"`)}const h=u.parent;if(r.icons[h]===void 0&&(l[h]===void 0||!o(h,d+1))){if(n)return delete l[c],f.add(c),!1;throw new Error(`Missing parent icon for alias "${c}`)}n&&u.body!==void 0&&delete u.body;const y=u.body!==void 0?"body":ge(u,n);if(y!==null){if(n)return delete l[c],f.add(c),!1;throw new Error(`Invalid property "${y}" in alias "${c}"`)}return s.add(c),!0};const l=r.aliases,s=new Set,f=new Set;Object.keys(l).forEach(c=>{o(c,0)}),n&&!Object.keys(r.aliases).length&&delete r.aliases}if(Object.keys(T).forEach(o=>{const l=typeof T[o],s=typeof r[o];if(s!=="undefined"&&s!==l)throw new Error(`Invalid value type for "${o}"`)}),r.chars!==void 0&&(typeof r.chars!="object"||r.chars===null))if(n)delete r.chars;else throw new Error("Invalid characters map");if(typeof r.chars=="object"){const o=r.chars;Object.keys(o).forEach(l=>{var s;if(!l.match(We)||typeof o[l]!="string"){if(n){delete o[l];return}throw new Error(`Invalid character "${l}"`)}const f=o[l];if(r.icons[f]===void 0&&((s=r.aliases)==null?void 0:s[f])===void 0){if(n){delete o[l];return}throw new Error(`Character "${l}" points to missing icon "${f}"`)}}),n&&!Object.keys(r.chars).length&&delete r.chars}return r}function Xe(e){for(const t in T)if(e[t]!==void 0)return!0;return!1}function ye(e,t,n){n=n||{};const r=[];if(typeof e!="object"||typeof e.icons!="object")return r;const i=n.validate;if(i!==!1)try{Je(e,typeof i=="object"?i:{fix:!0})}catch{return r}e.not_found instanceof Array&&e.not_found.forEach(s=>{t(s,null),r.push(s)});const o=e.icons;Object.keys(o).forEach(s=>{const f=pe(e,s,!0);f&&(t(s,f),r.push(s))});const l=n.aliases||"all";if(l!=="none"&&typeof e.aliases=="object"){const s=e.aliases;Object.keys(s).forEach(f=>{if(l==="variations"&&Xe(s[f]))return;const c=pe(e,f,!0);c&&(t(f,c),r.push(f))})}return r}var K=Object.create(null);function Ze(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:Object.create(null)}}function $(e,t){K[e]===void 0&&(K[e]=Object.create(null));const n=K[e];return n[t]===void 0&&(n[t]=Ze(e,t)),n[t]}function Q(e,t){const n=Date.now();return ye(t,(r,i)=>{i?e.icons[r]=i:e.missing[r]=n})}function et(e,t,n){try{if(typeof n.body=="string")return e.icons[t]=Object.freeze(H(n)),!0}catch{}return!1}function tt(e,t){const n=e.icons[t];return n===void 0?null:n}var N=!1;function me(e){return typeof e=="boolean"&&(N=e),N}function nt(e){const t=typeof e=="string"?M(e,!0,N):e;return t?tt($(t.provider,t.prefix),t.name):null}function rt(e,t){const n=M(e,!0,N);if(!n)return!1;const r=$(n.provider,n.prefix);return et(r,n.name,t)}function ot(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=typeof e.provider=="string"?e.provider:""),N&&t===""&&(typeof e.prefix!="string"||e.prefix==="")){let r=!1;return ye(e,(i,o)=>{o&&rt(i,o)&&(r=!0)},{validate:{fix:!0,prefix:""}}),r}if(typeof e.prefix!="string"||!A({provider:t,prefix:e.prefix,name:"a"}))return!1;const n=$(t,e.prefix);return!!Q(n,e)}var be=Object.freeze({inline:!1,width:null,height:null,hAlign:"center",vAlign:"middle",slice:!1,hFlip:!1,vFlip:!1,rotate:0});function it(e,t){const n={};for(const r in e){const i=r;if(n[i]=e[i],t[i]===void 0)continue;const o=t[i];switch(i){case"inline":case"slice":typeof o=="boolean"&&(n[i]=o);break;case"hFlip":case"vFlip":o===!0&&(n[i]=!n[i]);break;case"hAlign":case"vAlign":typeof o=="string"&&o!==""&&(n[i]=o);break;case"width":case"height":(typeof o=="string"&&o!==""||typeof o=="number"&&o||o===null)&&(n[i]=o);break;case"rotate":typeof o=="number"&&(n[i]+=o);break}}return n}var st=/(-?[0-9.]*[0-9]+[0-9.]*)/g,at=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Y(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 r=e.split(st);if(r===null||!r.length)return e;const i=[];let o=r.shift(),l=at.test(o);for(;;){if(l){const s=parseFloat(o);isNaN(s)?i.push(o):i.push(Math.ceil(s*t*n)/n)}else i.push(o);if(o=r.shift(),o===void 0)return i.join("");l=!l}}function lt(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 ct(e,t){const n={left:e.left,top:e.top,width:e.width,height:e.height};let r=e.body;[e,t].forEach(s=>{const f=[],c=s.hFlip,d=s.vFlip;let u=s.rotate;c?d?u+=2:(f.push("translate("+(n.width+n.left)+" "+(0-n.top)+")"),f.push("scale(-1 1)"),n.top=n.left=0):d&&(f.push("translate("+(0-n.left)+" "+(n.height+n.top)+")"),f.push("scale(1 -1)"),n.top=n.left=0);let h;switch(u<0&&(u-=Math.floor(u/4)*4),u=u%4,u){case 1:h=n.height/2+n.top,f.unshift("rotate(90 "+h+" "+h+")");break;case 2:f.unshift("rotate(180 "+(n.width/2+n.left)+" "+(n.height/2+n.top)+")");break;case 3:h=n.width/2+n.left,f.unshift("rotate(-90 "+h+" "+h+")");break}u%2==1&&((n.left!==0||n.top!==0)&&(h=n.left,n.left=n.top,n.top=h),n.width!==n.height&&(h=n.width,n.width=n.height,n.height=h)),f.length&&(r='<g transform="'+f.join(" ")+'">'+r+"</g>")});let i,o;t.width===null&&t.height===null?(o="1em",i=Y(o,n.width/n.height)):t.width!==null&&t.height!==null?(i=t.width,o=t.height):t.height!==null?(o=t.height,i=Y(o,n.width/n.height)):(i=t.width,o=Y(i,n.height/n.width)),i==="auto"&&(i=n.width),o==="auto"&&(o=n.height),i=typeof i=="string"?i:i+"",o=typeof o=="string"?o:o+"";const l={attributes:{width:i,height:o,preserveAspectRatio:lt(t),viewBox:n.left+" "+n.top+" "+n.width+" "+n.height},body:r};return t.inline&&(l.inline=!0),l}var ft=/\sid="(\S+)"/g,ut="IconifyId-"+Date.now().toString(16)+"-"+(Math.random()*16777216|0).toString(16)+"-",dt=0;function ht(e,t=ut){const n=[];let r;for(;r=ft.exec(e);)n.push(r[1]);return n.length&&n.forEach(i=>{const o=typeof t=="function"?t(i):t+dt++,l=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+l+')([")]|\\.[a-z])',"g"),"$1"+o+"$3")}),e}var G=Object.create(null);function pt(e,t){G[e]=t}function W(e){return G[e]||G[""]}function J(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}}for(var X=Object.create(null),O=["https://api.simplesvg.com","https://api.unisvg.com"],B=[];O.length>0;)O.length===1||Math.random()>.5?B.push(O.shift()):B.push(O.pop());X[""]=J({resources:["https://api.iconify.design"].concat(B)});function gt(e,t){const n=J(t);return n===null?!1:(X[e]=n,!0)}function Z(e){return X[e]}var ve=(e,t)=>{let n=e,r=n.indexOf("?")!==-1;function i(o){switch(typeof o){case"boolean":return o?"true":"false";case"number":return encodeURIComponent(o);case"string":return encodeURIComponent(o);default:throw new Error("Invalid parameter")}}return Object.keys(t).forEach(o=>{let l;try{l=i(t[o])}catch{return}n+=(r?"&":"?")+encodeURIComponent(o)+"="+l,r=!0}),n},we=Object.create(null),D=Object.create(null),yt=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}try{const t=String.fromCharCode(114)+String.fromCharCode(101);if(e=global[t+"qui"+t]("cross-fetch"),typeof e=="function")return e}catch{}return null},_e=yt();function mt(e,t){const n=Z(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let o=0;n.resources.forEach(s=>{o=Math.max(o,s.length)});const l=ve(t+".json",{icons:""});r=n.maxURL-o-n.path.length-l.length}const i=e+":"+t;return D[e]=n.path,we[i]=r,r}var bt=(e,t,n)=>{const r=[];let i=we[t];i===void 0&&(i=mt(e,t));const o="icons";let l={type:o,provider:e,prefix:t,icons:[]},s=0;return n.forEach((f,c)=>{s+=f.length+1,s>=i&&c>0&&(r.push(l),l={type:o,provider:e,prefix:t,icons:[]},s=f.length),l.icons.push(f)}),r.push(l),r};function vt(e){if(typeof e=="string"){if(D[e]===void 0){const t=Z(e);if(!t)return"/";D[e]=t.path}return D[e]}return"/"}var wt=(e,t,n)=>{if(!_e){n.done(void 0,424);return}let r=vt(t.provider);switch(t.type){case"icons":{const o=t.prefix,s=t.icons.join(",");r+=ve(o+".json",{icons:s});break}case"custom":{const o=t.uri;r+=o.slice(0,1)==="/"?o.slice(1):o;break}default:n.done(void 0,400);return}let i=503;_e(e+r).then(o=>{if(o.status!==200){setTimeout(()=>{n.done(void 0,o.status)});return}return i=501,o.json()}).then(o=>{if(typeof o!="object"||o===null){setTimeout(()=>{n.done(void 0,i)});return}setTimeout(()=>{n.done(o)})}).catch(()=>{n.done(void 0,i)})},_t={prepare:bt,send:wt};function It(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((i,o)=>i.provider!==o.provider?i.provider.localeCompare(o.provider):i.prefix!==o.prefix?i.prefix.localeCompare(o.prefix):i.name.localeCompare(o.name));let r={provider:"",prefix:"",name:""};return e.forEach(i=>{if(r.name===i.name&&r.prefix===i.prefix&&r.provider===i.provider)return;r=i;const o=i.provider,l=i.prefix,s=i.name;n[o]===void 0&&(n[o]=Object.create(null));const f=n[o];f[l]===void 0&&(f[l]=$(o,l));const c=f[l];let d;c.icons[s]!==void 0?d=t.loaded:l===""||c.missing[s]!==void 0?d=t.missing:d=t.pending;const u={provider:o,prefix:l,name:s};d.push(u)}),t}var x=Object.create(null),ee=Object.create(null);function Ie(e,t){e.forEach(n=>{const r=n.provider;if(x[r]===void 0)return;const i=x[r],o=n.prefix,l=i[o];l&&(i[o]=l.filter(s=>s.id!==t))})}function xt(e,t){ee[e]===void 0&&(ee[e]=Object.create(null));const n=ee[e];n[t]||(n[t]=!0,setTimeout(()=>{if(n[t]=!1,x[e]===void 0||x[e][t]===void 0)return;const r=x[e][t].slice(0);if(!r.length)return;const i=$(e,t);let o=!1;r.forEach(l=>{const s=l.icons,f=s.pending.length;s.pending=s.pending.filter(c=>{if(c.prefix!==t)return!0;const d=c.name;if(i.icons[d]!==void 0)s.loaded.push({provider:e,prefix:t,name:d});else if(i.missing[d]!==void 0)s.missing.push({provider:e,prefix:t,name:d});else return o=!0,!0;return!1}),s.pending.length!==f&&(o||Ie([{provider:e,prefix:t}],l.id),l.callback(s.loaded.slice(0),s.missing.slice(0),s.pending.slice(0),l.abort))})}))}var Et=0;function kt(e,t,n){const r=Et++,i=Ie.bind(null,n,r);if(!t.pending.length)return i;const o={id:r,icons:t,callback:e,abort:i};return n.forEach(l=>{const s=l.provider,f=l.prefix;x[s]===void 0&&(x[s]=Object.create(null));const c=x[s];c[f]===void 0&&(c[f]=[]),c[f].push(o)}),i}function jt(e,t=!0,n=!1){const r=[];return e.forEach(i=>{const o=typeof i=="string"?M(i,!1,n):i;(!t||A(o,n))&&r.push({provider:o.provider,prefix:o.prefix,name:o.name})}),r}var xe={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function $t(e,t,n,r,i){const o=e.resources.length,l=e.random?Math.floor(Math.random()*o):e.index;let s;if(e.random){let p=e.resources.slice(0);for(s=[];p.length>1;){const w=Math.floor(Math.random()*p.length);s.push(p[w]),p=p.slice(0,w).concat(p.slice(w+1))}s=s.concat(p)}else s=e.resources.slice(l).concat(e.resources.slice(0,l));const f=Date.now();let c="pending",d=0,u,h=null,y=[],v=[];typeof r=="function"&&v.push(r);function k(){h&&(clearTimeout(h),h=null)}function fe(){c==="pending"&&(c="aborted"),k(),y.forEach(p=>{p.abort&&p.abort(),p.status==="pending"&&(p.status="aborted")}),y=[]}function qn(p,w){w&&(v=[]),typeof p=="function"&&v.push(p)}function Me(){return{startTime:f,payload:t,status:c,queriesSent:d,queriesPending:y.length,subscribe:qn,abort:fe}}function ue(){c="failed",v.forEach(p=>{p(void 0,u)})}function Be(){y=y.filter(p=>(p.status==="pending"&&(p.status="aborted"),p.abort&&p.abort(),!1))}function Un(p,w,U){const S=w===void 0;switch(y=y.filter(_=>_!==p),c){case"pending":break;case"failed":if(S||!e.dataAfterTimeout)return;break;default:return}if(S){U!==void 0&&(u=U),y.length||(s.length?de():ue());return}if(k(),Be(),i&&!e.random){const _=e.resources.indexOf(p.resource);_!==-1&&_!==e.index&&i(_)}c="completed",v.forEach(_=>{_(w)})}function de(){if(c!=="pending")return;k();const p=s.shift();if(p===void 0){if(y.length){const S=typeof e.timeout=="function"?e.timeout(f):e.timeout;if(S){h=setTimeout(()=>{k(),c==="pending"&&(Be(),ue())},S);return}}ue();return}const w={getQueryStatus:Me,status:"pending",resource:p,done:(S,_)=>{Un(w,S,_)}};y.push(w),d++;const U=typeof e.rotate=="function"?e.rotate(d,f):e.rotate;h=setTimeout(de,U),n(p,t,w)}return setTimeout(de),Me}function Pt(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 xe)e[n]!==void 0?t[n]=e[n]:t[n]=xe[n];return t}function Ee(e){const t=Pt(e);let n=[];function r(){n=n.filter(s=>s().status==="pending")}function i(s,f,c){const d=$t(t,s,f,(u,h)=>{r(),c&&c(u,h)},u=>{t.index=u});return n.push(d),d}function o(s){const f=n.find(c=>s(c));return f!==void 0?f:null}return{query:i,find:o,setIndex:s=>{t.index=s},getIndex:()=>t.index,cleanup:r}}function ke(){}var te=Object.create(null);function Ct(e){if(te[e]===void 0){const t=Z(e);if(!t)return;const n=Ee(t),r={config:t,redundancy:n};te[e]=r}return te[e]}function St(e,t,n){let r,i;if(typeof e=="string"){const o=W(e);if(!o)return n(void 0,424),ke;i=o.send;const l=Ct(e);l&&(r=l.redundancy)}else{const o=J(e);if(o){r=Ee(o);const l=e.resources?e.resources[0]:"",s=W(l);s&&(i=s.send)}}return!r||!i?(n(void 0,424),ke):r.query(t,i,n)().abort}var ne={};function je(){}var P=Object.create(null),re=Object.create(null),oe=Object.create(null),ie=Object.create(null);function Tt(e,t){oe[e]===void 0&&(oe[e]=Object.create(null));const n=oe[e];n[t]||(n[t]=!0,setTimeout(()=>{n[t]=!1,xt(e,t)}))}var $e=Object.create(null);function At(e,t,n){function r(){const s=(e===""?"":"@"+e+":")+t,f=Math.floor(Date.now()/6e4);$e[s]<f&&($e[s]=f,console.error('Unable to retrieve icons for "'+s+'" because API is not configured properly.'))}re[e]===void 0&&(re[e]=Object.create(null));const i=re[e];ie[e]===void 0&&(ie[e]=Object.create(null));const o=ie[e];P[e]===void 0&&(P[e]=Object.create(null));const l=P[e];i[t]===void 0?i[t]=n:i[t]=i[t].concat(n).sort(),o[t]||(o[t]=!0,setTimeout(()=>{o[t]=!1;const s=i[t];delete i[t];const f=W(e);if(!f){r();return}f.prepare(e,t,s).forEach(d=>{St(e,d,(u,h)=>{const y=$(e,t);if(typeof u!="object"){if(h!==404)return;const v=Date.now();d.icons.forEach(k=>{y.missing[k]=v})}else try{const v=Q(y,u);if(!v.length)return;const k=l[t];v.forEach(fe=>{delete k[fe]}),ne.store&&ne.store(e,u)}catch(v){console.error(v)}Tt(e,t)})})}))}var Nt=(e,t)=>{const n=jt(e,!0,me()),r=It(n);if(!r.pending.length){let c=!0;return t&&setTimeout(()=>{c&&t(r.loaded,r.missing,r.pending,je)}),()=>{c=!1}}const i=Object.create(null),o=[];let l,s;r.pending.forEach(c=>{const d=c.provider,u=c.prefix;if(u===s&&d===l)return;l=d,s=u,o.push({provider:d,prefix:u}),P[d]===void 0&&(P[d]=Object.create(null));const h=P[d];h[u]===void 0&&(h[u]=Object.create(null)),i[d]===void 0&&(i[d]=Object.create(null));const y=i[d];y[u]===void 0&&(y[u]=[])});const f=Date.now();return r.pending.forEach(c=>{const d=c.provider,u=c.prefix,h=c.name,y=P[d][u];y[h]===void 0&&(y[h]=f,i[d][u].push(h))}),o.forEach(c=>{const d=c.provider,u=c.prefix;i[d][u].length&&At(d,u,i[d][u])}),t?kt(t,r,o):je},Pe="iconify2",V="iconify",Ce=V+"-count",Se=V+"-version",Te=36e5,Ot=168,se={local:!0,session:!0},ae=!1,Ae={local:0,session:0},Ne={local:[],session:[]},q=typeof window=="undefined"?{}:window;function Oe(e){const t=e+"Storage";try{if(q&&q[t]&&typeof q[t].length=="number")return q[t]}catch{}return se[e]=!1,null}function le(e,t,n){try{return e.setItem(Ce,n+""),Ae[t]=n,!0}catch{return!1}}function Ve(e){const t=e.getItem(Ce);if(t){const n=parseInt(t);return n||0}return 0}function Vt(e,t){try{e.setItem(Se,Pe)}catch{}le(e,t,0)}function Rt(e){try{const t=Ve(e);for(let n=0;n<t;n++)e.removeItem(V+n)}catch{}}var Re=()=>{if(ae)return;ae=!0;const e=Math.floor(Date.now()/Te)-Ot;function t(n){const r=Oe(n);if(!r)return;const i=o=>{const l=V+o,s=r.getItem(l);if(typeof s!="string")return!1;let f=!0;try{const c=JSON.parse(s);if(typeof c!="object"||typeof c.cached!="number"||c.cached<e||typeof c.provider!="string"||typeof c.data!="object"||typeof c.data.prefix!="string")f=!1;else{const d=c.provider,u=c.data.prefix,h=$(d,u);f=Q(h,c.data).length>0}}catch{f=!1}return f||r.removeItem(l),f};try{const o=r.getItem(Se);if(o!==Pe){o&&Rt(r),Vt(r,n);return}let l=Ve(r);for(let s=l-1;s>=0;s--)i(s)||(s===l-1?l--:Ne[n].push(s));le(r,n,l)}catch{}}for(const n in se)t(n)},Ft=(e,t)=>{ae||Re();function n(r){if(!se[r])return!1;const i=Oe(r);if(!i)return!1;let o=Ne[r].shift();if(o===void 0&&(o=Ae[r],!le(i,r,o+1)))return!1;try{const l={cached:Math.floor(Date.now()/Te),provider:e,data:t};i.setItem(V+o,JSON.stringify(l))}catch{return!1}return!0}n("local")||n("session")},Fe=/[\s,]+/;function Lt(e,t){t.split(Fe).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function Mt(e,t){t.split(Fe).forEach(n=>{const r=n.trim();switch(r){case"left":case"center":case"right":e.hAlign=r;break;case"top":case"middle":case"bottom":e.vAlign=r;break;case"slice":case"crop":e.slice=!0;break;case"meet":e.slice=!1}})}function Bt(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function r(i){for(;i<0;)i+=4;return i%4}if(n===""){const i=parseInt(e);return isNaN(i)?0:r(i)}else if(n!==e){let i=0;switch(n){case"%":i=25;break;case"deg":i=90}if(i){let o=parseFloat(e.slice(0,e.length-n.length));return isNaN(o)?0:(o=o/i,o%1==0?r(o):0)}}return t}const Dt={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 r={attr:e.slice(0,1)+t,boolean:t==="Flip"};E[e+"-"+t.toLowerCase()]=r,E[e.slice(0,1)+"-"+t.toLowerCase()]=r,E[e+t]=r})});const qt=(e,t)=>{const n=it(be,t),r=I({},Dt);let i=typeof t.style=="object"&&!(t.style instanceof Array)?I({},t.style):{};for(let f in t){const c=t[f];if(c!==void 0)switch(f){case"icon":case"style":case"onLoad":break;case"inline":case"hFlip":case"vFlip":n[f]=c===!0||c==="true"||c===1;break;case"flip":typeof c=="string"&&Lt(n,c);break;case"align":typeof c=="string"&&Mt(n,c);break;case"color":i.color=c;break;case"rotate":typeof c=="string"?n[f]=Bt(c):typeof c=="number"&&(n[f]=c);break;case"ariaHidden":case"aria-hidden":c!==!0&&c!=="true"&&delete r["aria-hidden"];break;default:E[f]!==void 0?E[f].boolean&&(c===!0||c==="true"||c===1)?n[E[f].attr]=!0:!E[f].boolean&&typeof c=="string"&&c!==""&&(n[E[f].attr]=c):be[f]===void 0&&(r[f]=c)}}const o=ct(e,n);for(let f in o.attributes)r[f]=o.attributes[f];o.inline&&i.verticalAlign===void 0&&i["vertical-align"]===void 0&&(i.verticalAlign="-0.125em");let l=0;const s=t.id;return r.innerHTML=ht(o.body,s?()=>s+"-"+l++:"iconify-vue-"),Object.keys(i).length>0&&(r.style=i),a.h("svg",r)};if(me(!0),pt("",_t),typeof document!="undefined"&&typeof window!="undefined"){ne.store=Ft,Re();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(r=>{try{(typeof r!="object"||r===null||r instanceof Array||typeof r.icons!="object"||typeof r.prefix!="string"||!ot(r))&&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 r="IconifyProviders["+n+"] is invalid.";try{const i=t[n];if(typeof i!="object"||!i||i.resources===void 0)continue;gt(n,i)||console.error(r)}catch{console.error(r)}}}}const ce=a.defineComponent({inheritAttrs:!1,data(){return{mounted:!1,counter:0}},beforeMount(){this._name="",this._loadingIcon=null,this.mounted=!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:H(e)};let n;if(typeof e!="string"||(n=M(e,!1,!0))===null)return this.abortLoading(),null;const r=nt(n);if(r===null)return(!this._loadingIcon||this._loadingIcon.name!==e)&&(this.abortLoading(),this._name="",this._loadingIcon={name:e,abort:Nt([n],()=>{this.counter++})}),null;this.abortLoading(),this._name!==e&&(this._name=e,t&&t(e));const i=["iconify"];return n.prefix!==""&&i.push("iconify--"+n.prefix),n.provider!==""&&i.push("iconify--"+n.provider),{data:r,classes:i}}},render(){if(!this.mounted)return this.$slots.default?this.$slots.default():null;this.counter;const e=this.$attrs,t=this.getIcon(e.icon,e.onLoad);if(!t)return this.$slots.default?this.$slots.default():null;let n=e;return t.classes&&(n=he(I({},e),{class:(typeof e.class=="string"?e.class+" ":"")+t.classes.join(" ")})),qt(t.data,n)}});var C=(e,t)=>{for(const[n,r]of t)e[n]=r;return e};const Ut={components:{Icon:ce},setup(){return{icons:{error:"mdi:alert",warning:"mdi:alert-circle",info:"mdi:information",success:"mdi:check-bold"},colors:{error:"text-red",warning:"text-orange",info:"text-purple",success:"text-green"}}}},zt={class:"ml-4 leading-tight"};function Ht(e,t,n,r,i,o){const l=a.resolveComponent("Icon");return a.openBlock(),a.createBlock(a.Teleport,{to:"body"},[a.createVNode(a.TransitionGroup,{tag:"div",name:"pf-list",class:"fixed w-2/3 space-y-2 transition-all sm:w-1/4 bottom-2 left-2"},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.$notif.list,s=>(a.openBlock(),a.createElementBlock("div",{key:s.id,class:"flex items-center p-4 transition bg-white rounded shadow-sm"},[a.createVNode(l,{class:a.normalizeClass([r.colors[s.type],"text-xl"]),icon:r.icons[s.type],inline:""},null,8,["class","icon"]),a.createElementVNode("p",zt,a.toDisplayString(s.message),1)]))),128))]),_:1})])}var Kt=C(Ut,[["render",Ht]]);const R=a.ref([]),Qt=a.readonly(R);function F(e,t,n){const r=Ye();R.value=[...R.value,{type:e,message:t,actions:n,id:r}],setTimeout(()=>{R.value=R.value.filter(i=>i.id!==r)},2e3)}function Yt(...e){F("error",...e)}function Gt(...e){F("warn",...e)}function Wt(...e){F("info",...e)}function Jt(...e){F("success",...e)}function Xt(e){e.config.globalProperties.$notif=a.reactive({list:Qt,push:F,error:Yt,warn:Gt,info:Wt,success:Jt}),e.component("Pf_TheNotifications",Kt)}var Gn="";const Zt={components:{Icon:ce},props:{title:{type:String,default:null}},emits:["close"]},en={class:"flex items-start"},tn={class:"flex-1 overflow-hidden title overflow-ellipsis"},nn={class:"overflow-auto content"},rn={class:"py-2"};function on(e,t,n,r,i,o){const l=a.resolveComponent("Icon");return a.openBlock(),a.createBlock(a.Teleport,{to:"body"},[a.createElementVNode("div",{class:"fixed inset-0 bg-gray-200",onClick:t[2]||(t[2]=s=>e.$emit("close"))},[a.createElementVNode("div",{class:"p-2 m-auto mt-2 bg-white rounded-md shadow-md sm:mt-4 top-2 pf-dialog",onClick:t[1]||(t[1]=a.withModifiers(()=>{},["stop"]))},[a.createElementVNode("div",en,[a.createElementVNode("div",tn,a.toDisplayString(n.title),1),a.createElementVNode("button",{class:"ml-2 pf-icon-btn",onClick:t[0]||(t[0]=s=>e.$emit("close"))},[a.createVNode(l,{icon:"mdi:close",class:"text-purple"})])]),a.createElementVNode("div",nn,[a.renderSlot(e.$slots,"default")]),a.createElementVNode("div",rn,[a.renderSlot(e.$slots,"footer")])])])])}var sn=C(Zt,[["render",on]]);function an(e){const t=b.useRoute(),n=b.useRouter(),r=a.computed(()=>!!t.query[e]);return a.watch(r,i=>{i?document.body.classList.add("overflow-hidden"):document.body.classList.remove("overflow-hidden")},{immediate:!0}),{isOpen:r,open(){const i=he(I({},t.query),{[e]:"open"});n.push({query:i})},async close(){const i=new Promise(l=>{const s=a.watch(r,f=>{f||(l(),s())})}),o=I({},t.query);return delete o[e],n.replace({query:o}),i}}}function ln(e){e.component("Pf_Dialog",sn)}const cn=a.reactive({});function fn(e){e.config.globalProperties.$responsive=a.reactive({breakpoints:cn})}const un={components:{Icon:ce},inheritAttrs:!1};function dn(e,t,n,r,i,o){const l=a.resolveComponent("Icon",!0);return a.openBlock(),a.createElementBlock("span",null,[a.createVNode(l,a.normalizeProps(a.guardReactiveProps(e.$attrs)),null,16)])}var hn=C(un,[["render",dn]]);function pn(e){e.component("Pf_Icon",hn)}class gn{constructor({supabase:t,roleContextKeyName:n,devRedirectTo:r}){this.supabase=t,this.roleContextKeyName=n,this.devRedirectTo=r,this._user=a.ref(void 0),this._roles=a.ref(void 0)}async getUserProfile(t){const{data:n,error:r}=await this.supabase.from("profiles").select().match({id:t});return r||n.length===0?null:n[0]}async synchroUserWithSupabase(t){if(t){const n=t.user.id,{firstname:r,lastname:i}=await this.getUserProfile(n)||{};this._user.value={id:n,avatar:t.user.user_metadata.avatar_url,firstname:r,lastname:i}}else this._user.value=null;this._roles.value=void 0,await this.synchronizeRoles()}async synchronizeRoles(t){if(!this._user.value){this._roles.value=[];return}let n,r;t?{data:n,error:r}=await this.supabase.from("roles").select().match({user_id:this._user.value.id}).or(`${this.roleContextKeyName}.eq.${t},${this.roleContextKeyName}.is.null`):{data:n,error:r}=await this.supabase.from("roles").select().match({user_id:this._user.value.id}).is(`${this.roleContextKeyName}`,null),r?this._roles.value=[]:this._roles.value=n.map(({name:i})=>i)}async synchronizeProfile(){return await this.synchroUserWithSupabase(this.supabase.auth.session())}async login(){this.devRedirectTo?await this.supabase.auth.signIn({provider:"discord"},{redirectTo:this.devRedirectTo}):await this.supabase.auth.signIn({provider:"discord"})}async logout(){await this.supabase.auth.signOut()}async setProfile(t){if(!this._user.value)return;const{error:n}=await this.supabase.from("profiles").update(t).match({id:this._user.value.id});if(n)return Promise.reject(n);await this.synchronizeProfile()}async getIsAuthenticated(){return this._user.value!==void 0?Promise.resolve(!!this._user.value):new Promise(t=>{const n=a.watch(this._user,r=>{r!==void 0&&(t(r!==null),n())})})}async getHasRoles(t){return this._roles.value!==void 0?Promise.resolve(t.some(n=>this._roles.value.includes(n))):new Promise(n=>{const r=a.watch(this._roles,i=>{i!==void 0&&(n(t.some(o=>this._roles.value.includes(o))),r())})})}}const Le=Symbol("Authentification");function yn(e,{supabase:t,router:n,loginRouteName:r="login",defaultRouteName:i="home",roleContextKeyName:o,devRedirectTo:l}={}){const s=new gn({supabase:t,roleContextKeyName:o,devRedirectTo:l}),f=a.readonly(s._user),c=a.readonly(s._roles);s.synchroUserWithSupabase(t.auth.session()),t.auth.onAuthStateChange((u,h)=>{s.synchroUserWithSupabase(h)});const d=a.reactive({user:f,roles:c,login:s.login.bind(s),logout:s.login.bind(s),setProfile:s.setProfile.bind(s),synchronizeRoles:s.synchronizeRoles.bind(s)});e.config.globalProperties.$auth=d,n.beforeEach(async u=>{if(u.meta.auth||u.meta.roles){if(!await s.getIsAuthenticated())return{name:r,query:{redirect_uri:u.fullPath}};if(u.meta.roles&&!await s.getHasRoles(u.meta.roles))return{name:i}}}),e.provide(Le,d)}function mn(){const e=a.inject(Le,{}),t=a.toRef(e,"user"),n=a.toRef(e,"roles");return{user:t,roles:n,synchronizeRoles:e.synchronizeRoles,setProfile:e.synchronizeProfile}}const bn={},vn={class:"animate-spin rounded-full border-t-2 border-b-2 border-purple"};function wn(e,t){return a.openBlock(),a.createElementBlock("div",vn)}var _n=C(bn,[["render",wn]]);const In={components:{Spinner:_n},inheritAttrs:!1,props:{disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},computed:{internalDisabled(){return this.loading&&this.disabled}}},xn=["disabled"],En={key:0,name:"loading",class:"absolute inset-0 bg-white flex items-center justify-center"};function kn(e,t,n,r,i,o){const l=a.resolveComponent("Spinner");return a.openBlock(),a.createElementBlock("button",a.mergeProps({class:"pf-btn -primary flex relative",type:"submit"},e.$attrs,{disabled:o.internalDisabled}),[a.renderSlot(e.$slots,"default"),n.loading?(a.openBlock(),a.createElementBlock("div",En,[a.createVNode(l,{class:"h-4 w-4"})])):a.createCommentVNode("",!0)],16,xn)}var jn=C(In,[["render",kn]]);const $n={},Pn={class:"px-1 py-2 text-xs text-center text-gray-700"},Cn=a.createElementVNode("p",null,[a.createTextVNode(" This is a "),a.createElementVNode("a",{class:"pf-link",href:"https://purple-fox.fr/"},"PurpleFox"),a.createTextVNode(" tool, developed by PurpleOrwel aka Aur\xE9lie VIOLETTE. ")],-1),Sn={class:"flex justify-center gap-4"},Tn={class:"flex items-center pf-link",href:"https://bit.ly/3yLzyAb"},An=a.createTextVNode("Twitter"),Nn={class:"flex items-center pf-link",href:"https://bit.ly/3sfmS3p"},On=a.createTextVNode("GitHub "),Vn={class:"flex items-center pf-link",href:"https://bit.ly/3rim6R5"},Rn=a.createTextVNode("Discord");function Fn(e,t){const n=a.resolveComponent("Pf_Icon");return a.openBlock(),a.createElementBlock("footer",Pn,[Cn,a.createElementVNode("nav",null,[a.createElementVNode("ul",Sn,[a.createElementVNode("li",null,[a.createElementVNode("a",Tn,[a.createVNode(n,{inline:"",icon:"mdi:twitter",class:"mr-1"}),An])]),a.createElementVNode("li",null,[a.createElementVNode("a",Nn,[a.createVNode(n,{inline:"",icon:"mdi:github",class:"mr-1"}),On])]),a.createElementVNode("li",null,[a.createElementVNode("a",Vn,[a.createVNode(n,{inline:"",icon:"mdi:discord",class:"mr-1"}),Rn])])])])])}var Ln=C($n,[["render",Fn]]);const Mn={props:{minHeight:{type:Number,required:!1,default:null}},methods:{beforeEnter(e){e.style.overflowY="hidden"},enter(e){const{width:t}=window.getComputedStyle(e),n=e.style.width;e.style.width=t,e.style.position="absolute",e.style.visibility="hidden",e.style.height="auto";const{height:r}=window.getComputedStyle(e);e.style.width=n,e.style.position="",e.style.visibility="",e.style.height=this.minHeight||0,window.getComputedStyle(e).height,setTimeout(()=>{e.style.height=r})},afterEnter(e){e.style.height="auto",e.style.overflowY="unset"},leave(e){const{height:t}=window.getComputedStyle(e);e.style.height=t,e.style.overflowY="hidden",window.getComputedStyle(e).height,setTimeout(()=>{e.style.height=this.minHeight||0})}}};function Bn(e,t,n,r,i,o){return a.openBlock(),a.createBlock(a.Transition,{name:"pf-expand",onBeforeEnter:o.beforeEnter,onEnter:o.enter,onLeave:o.leave,onAfterEnter:o.afterEnter},{default:a.withCtx(()=>[a.renderSlot(e.$slots,"default")]),_:3},8,["onBeforeEnter","onEnter","onLeave","onAfterEnter"])}var Dn=C(Mn,[["render",Bn]]),Wn="";g.AuthPlugin=yn,g.IconPlugin=pn,g.ModalPlugin=ln,g.NotificationsPlugin=Xt,g.Pf_ExpandTransition=Dn,g.Pf_Footer=Ln,g.Pf_SubmitButton=jn,g.ResponsivePlugin=fn,g.useAuth=mn,g.useModal=an,Object.defineProperty(g,"__esModule",{value:!0}),g[Symbol.toStringTag]="Module"}); |
@@ -7,3 +7,3 @@ { | ||
], | ||
"version": "1.3.2", | ||
"version": "1.3.4", | ||
"main": "./dist/purplefox-tools.umd.js", | ||
@@ -10,0 +10,0 @@ "module": "./dist/purplefox-tools.es.js", |
Sorry, the diff of this file is too big to display
118769
2748