purplefox-tools
Advanced tools
Comparing version 1.3.14 to 1.3.15
@@ -1,1 +0,1 @@ | ||
var Kn=Object.defineProperty,Qn=Object.defineProperties;var Yn=Object.getOwnPropertyDescriptors;var Ke=Object.getOwnPropertySymbols;var Gn=Object.prototype.hasOwnProperty,Wn=Object.prototype.propertyIsEnumerable;var Qe=(p,a,b)=>a in p?Kn(p,a,{enumerable:!0,configurable:!0,writable:!0,value:b}):p[a]=b,I=(p,a)=>{for(var b in a||(a={}))Gn.call(a,b)&&Qe(p,b,a[b]);if(Ke)for(var b of Ke(a))Wn.call(a,b)&&Qe(p,b,a[b]);return p},he=(p,a)=>Qn(p,Yn(a));(function(p,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):(p=typeof globalThis!="undefined"?globalThis:p||self,a(p.PurplefoxTools={},p.Vue,p.vueRouter))})(this,function(p,a,b){"use strict";var L,Ye=new Uint8Array(16);function Ge(){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(Ye)}var We=/^(?:[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 Je(e){return typeof e=="string"&&We.test(e)}for(var m=[],z=0;z<256;++z)m.push((z+256).toString(16).substr(1));function Xe(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(!Je(n))throw TypeError("Stringified UUID is invalid");return n}function Ze(e,t,n){e=e||{};var r=e.random||(e.rng||Ge)();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 Xe(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(),l={provider:i.length>0?i[0]:r,prefix:f,name:s};return t&&!A(l)?null:l}const o=i[0],c=o.split("-");if(c.length>1){const s={provider:r,prefix:c.shift(),name:c.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 et(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,c){var s,f,l,d;if(e.icons[o]!==void 0)return Object.assign({},e.icons[o]);if(c>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,c+1);return h&&et(h,u)}return c===0&&((l=e.chars)==null?void 0:l[o])!==void 0?r((d=e.chars)==null?void 0:d[o],c+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 tt=/^[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 nt(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 c=i[o];if(typeof c!="object"||c===null||typeof c.body!="string"){if(n){delete i[o];return}throw new Error(`Invalid icon: "${o}"`)}const s=typeof c.parent=="string"?"parent":ge(c,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(l,d){if(s.has(l))return!f.has(l);const u=c[l];if(d>5||typeof u!="object"||u===null||typeof u.parent!="string"||!l.match(j)){if(n)return delete c[l],f.add(l),!1;throw new Error(`Invalid icon alias: "${l}"`)}const h=u.parent;if(r.icons[h]===void 0&&(c[h]===void 0||!o(h,d+1))){if(n)return delete c[l],f.add(l),!1;throw new Error(`Missing parent icon for alias "${l}`)}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 c[l],f.add(l),!1;throw new Error(`Invalid property "${y}" in alias "${l}"`)}return s.add(l),!0};const c=r.aliases,s=new Set,f=new Set;Object.keys(c).forEach(l=>{o(l,0)}),n&&!Object.keys(r.aliases).length&&delete r.aliases}if(Object.keys(T).forEach(o=>{const c=typeof T[o],s=typeof r[o];if(s!=="undefined"&&s!==c)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(c=>{var s;if(!c.match(tt)||typeof o[c]!="string"){if(n){delete o[c];return}throw new Error(`Invalid character "${c}"`)}const f=o[c];if(r.icons[f]===void 0&&((s=r.aliases)==null?void 0:s[f])===void 0){if(n){delete o[c];return}throw new Error(`Character "${c}" points to missing icon "${f}"`)}}),n&&!Object.keys(r.chars).length&&delete r.chars}return r}function rt(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{nt(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 c=n.aliases||"all";if(c!=="none"&&typeof e.aliases=="object"){const s=e.aliases;Object.keys(s).forEach(f=>{if(c==="variations"&&rt(s[f]))return;const l=pe(e,f,!0);l&&(t(f,l),r.push(f))})}return r}var K=Object.create(null);function ot(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]=ot(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 it(e,t,n){try{if(typeof n.body=="string")return e.icons[t]=Object.freeze(H(n)),!0}catch{}return!1}function st(e,t){const n=e.icons[t];return n===void 0?null:n}var O=!1;function me(e){return typeof e=="boolean"&&(O=e),O}function at(e){const t=typeof e=="string"?M(e,!0,O):e;return t?st($(t.provider,t.prefix),t.name):null}function ct(e,t){const n=M(e,!0,O);if(!n)return!1;const r=$(n.provider,n.prefix);return it(r,n.name,t)}function lt(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=typeof e.provider=="string"?e.provider:""),O&&t===""&&(typeof e.prefix!="string"||e.prefix==="")){let r=!1;return ye(e,(i,o)=>{o&&ct(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 ft(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 ut=/(-?[0-9.]*[0-9]+[0-9.]*)/g,dt=/^-?[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(ut);if(r===null||!r.length)return e;const i=[];let o=r.shift(),c=dt.test(o);for(;;){if(c){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("");c=!c}}function ht(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 pt(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=[],l=s.hFlip,d=s.vFlip;let u=s.rotate;l?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 c={attributes:{width:i,height:o,preserveAspectRatio:ht(t),viewBox:n.left+" "+n.top+" "+n.width+" "+n.height},body:r};return t.inline&&(c.inline=!0),c}var gt=/\sid="(\S+)"/g,yt="IconifyId-"+Date.now().toString(16)+"-"+(Math.random()*16777216|0).toString(16)+"-",mt=0;function bt(e,t=yt){const n=[];let r;for(;r=gt.exec(e);)n.push(r[1]);return n.length&&n.forEach(i=>{const o=typeof t=="function"?t(i):t+mt++,c=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+c+')([")]|\\.[a-z])',"g"),"$1"+o+"$3")}),e}var G=Object.create(null);function vt(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),V=["https://api.simplesvg.com","https://api.unisvg.com"],B=[];V.length>0;)V.length===1||Math.random()>.5?B.push(V.shift()):B.push(V.pop());X[""]=J({resources:["https://api.iconify.design"].concat(B)});function wt(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 c;try{c=i(t[o])}catch{return}n+=(r?"&":"?")+encodeURIComponent(o)+"="+c,r=!0}),n},we=Object.create(null),D=Object.create(null),_t=()=>{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=_t();function It(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 c=ve(t+".json",{icons:""});r=n.maxURL-o-n.path.length-c.length}const i=e+":"+t;return D[e]=n.path,we[i]=r,r}var xt=(e,t,n)=>{const r=[];let i=we[t];i===void 0&&(i=It(e,t));const o="icons";let c={type:o,provider:e,prefix:t,icons:[]},s=0;return n.forEach((f,l)=>{s+=f.length+1,s>=i&&l>0&&(r.push(c),c={type:o,provider:e,prefix:t,icons:[]},s=f.length),c.icons.push(f)}),r.push(c),r};function Et(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 kt=(e,t,n)=>{if(!_e){n.done(void 0,424);return}let r=Et(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)})},jt={prepare:xt,send:kt};function $t(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,c=i.prefix,s=i.name;n[o]===void 0&&(n[o]=Object.create(null));const f=n[o];f[c]===void 0&&(f[c]=$(o,c));const l=f[c];let d;l.icons[s]!==void 0?d=t.loaded:c===""||l.missing[s]!==void 0?d=t.missing:d=t.pending;const u={provider:o,prefix:c,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,c=i[o];c&&(i[o]=c.filter(s=>s.id!==t))})}function Pt(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(c=>{const s=c.icons,f=s.pending.length;s.pending=s.pending.filter(l=>{if(l.prefix!==t)return!0;const d=l.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}],c.id),c.callback(s.loaded.slice(0),s.missing.slice(0),s.pending.slice(0),c.abort))})}))}var Ct=0;function St(e,t,n){const r=Ct++,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(c=>{const s=c.provider,f=c.prefix;x[s]===void 0&&(x[s]=Object.create(null));const l=x[s];l[f]===void 0&&(l[f]=[]),l[f].push(o)}),i}function Tt(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 Nt(e,t,n,r,i){const o=e.resources.length,c=e.random?Math.floor(Math.random()*o):e.index;let s;if(e.random){let g=e.resources.slice(0);for(s=[];g.length>1;){const w=Math.floor(Math.random()*g.length);s.push(g[w]),g=g.slice(0,w).concat(g.slice(w+1))}s=s.concat(g)}else s=e.resources.slice(c).concat(e.resources.slice(0,c));const f=Date.now();let l="pending",d=0,u,h=null,y=[],v=[];typeof r=="function"&&v.push(r);function k(){h&&(clearTimeout(h),h=null)}function fe(){l==="pending"&&(l="aborted"),k(),y.forEach(g=>{g.abort&&g.abort(),g.status==="pending"&&(g.status="aborted")}),y=[]}function zn(g,w){w&&(v=[]),typeof g=="function"&&v.push(g)}function ze(){return{startTime:f,payload:t,status:l,queriesSent:d,queriesPending:y.length,subscribe:zn,abort:fe}}function ue(){l="failed",v.forEach(g=>{g(void 0,u)})}function He(){y=y.filter(g=>(g.status==="pending"&&(g.status="aborted"),g.abort&&g.abort(),!1))}function Hn(g,w,U){const S=w===void 0;switch(y=y.filter(_=>_!==g),l){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(),He(),i&&!e.random){const _=e.resources.indexOf(g.resource);_!==-1&&_!==e.index&&i(_)}l="completed",v.forEach(_=>{_(w)})}function de(){if(l!=="pending")return;k();const g=s.shift();if(g===void 0){if(y.length){const S=typeof e.timeout=="function"?e.timeout(f):e.timeout;if(S){h=setTimeout(()=>{k(),l==="pending"&&(He(),ue())},S);return}}ue();return}const w={getQueryStatus:ze,status:"pending",resource:g,done:(S,_)=>{Hn(w,S,_)}};y.push(w),d++;const U=typeof e.rotate=="function"?e.rotate(d,f):e.rotate;h=setTimeout(de,U),n(g,t,w)}return setTimeout(de),ze}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 xe)e[n]!==void 0?t[n]=e[n]:t[n]=xe[n];return t}function Ee(e){const t=At(e);let n=[];function r(){n=n.filter(s=>s().status==="pending")}function i(s,f,l){const d=Nt(t,s,f,(u,h)=>{r(),l&&l(u,h)},u=>{t.index=u});return n.push(d),d}function o(s){const f=n.find(l=>s(l));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 Ot(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 Vt(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 c=Ot(e);c&&(r=c.redundancy)}else{const o=J(e);if(o){r=Ee(o);const c=e.resources?e.resources[0]:"",s=W(c);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 Rt(e,t){oe[e]===void 0&&(oe[e]=Object.create(null));const n=oe[e];n[t]||(n[t]=!0,setTimeout(()=>{n[t]=!1,Pt(e,t)}))}var $e=Object.create(null);function Ft(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 c=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=>{Vt(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=c[t];v.forEach(fe=>{delete k[fe]}),ne.store&&ne.store(e,u)}catch(v){console.error(v)}Rt(e,t)})})}))}var Lt=(e,t)=>{const n=Tt(e,!0,me()),r=$t(n);if(!r.pending.length){let l=!0;return t&&setTimeout(()=>{l&&t(r.loaded,r.missing,r.pending,je)}),()=>{l=!1}}const i=Object.create(null),o=[];let c,s;r.pending.forEach(l=>{const d=l.provider,u=l.prefix;if(u===s&&d===c)return;c=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(l=>{const d=l.provider,u=l.prefix,h=l.name,y=P[d][u];y[h]===void 0&&(y[h]=f,i[d][u].push(h))}),o.forEach(l=>{const d=l.provider,u=l.prefix;i[d][u].length&&Ft(d,u,i[d][u])}),t?St(t,r,o):je},Pe="iconify2",R="iconify",Ce=R+"-count",Se=R+"-version",Te=36e5,Mt=168,se={local:!0,session:!0},ae=!1,Ne={local:0,session:0},Ae={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 ce(e,t,n){try{return e.setItem(Ce,n+""),Ne[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 Bt(e,t){try{e.setItem(Se,Pe)}catch{}ce(e,t,0)}function Dt(e){try{const t=Ve(e);for(let n=0;n<t;n++)e.removeItem(R+n)}catch{}}var Re=()=>{if(ae)return;ae=!0;const e=Math.floor(Date.now()/Te)-Mt;function t(n){const r=Oe(n);if(!r)return;const i=o=>{const c=R+o,s=r.getItem(c);if(typeof s!="string")return!1;let f=!0;try{const l=JSON.parse(s);if(typeof l!="object"||typeof l.cached!="number"||l.cached<e||typeof l.provider!="string"||typeof l.data!="object"||typeof l.data.prefix!="string")f=!1;else{const d=l.provider,u=l.data.prefix,h=$(d,u);f=Q(h,l.data).length>0}}catch{f=!1}return f||r.removeItem(c),f};try{const o=r.getItem(Se);if(o!==Pe){o&&Dt(r),Bt(r,n);return}let c=Ve(r);for(let s=c-1;s>=0;s--)i(s)||(s===c-1?c--:Ae[n].push(s));ce(r,n,c)}catch{}}for(const n in se)t(n)},qt=(e,t)=>{ae||Re();function n(r){if(!se[r])return!1;const i=Oe(r);if(!i)return!1;let o=Ae[r].shift();if(o===void 0&&(o=Ne[r],!ce(i,r,o+1)))return!1;try{const c={cached:Math.floor(Date.now()/Te),provider:e,data:t};i.setItem(R+o,JSON.stringify(c))}catch{return!1}return!0}n("local")||n("session")},Fe=/[\s,]+/;function Ut(e,t){t.split(Fe).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function zt(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 Ht(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 Kt={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=ft(be,t),r=I({},Kt);let i=typeof t.style=="object"&&!(t.style instanceof Array)?I({},t.style):{};for(let f in t){const l=t[f];if(l!==void 0)switch(f){case"icon":case"style":case"onLoad":break;case"inline":case"hFlip":case"vFlip":n[f]=l===!0||l==="true"||l===1;break;case"flip":typeof l=="string"&&Ut(n,l);break;case"align":typeof l=="string"&&zt(n,l);break;case"color":i.color=l;break;case"rotate":typeof l=="string"?n[f]=Ht(l):typeof l=="number"&&(n[f]=l);break;case"ariaHidden":case"aria-hidden":l!==!0&&l!=="true"&&delete r["aria-hidden"];break;default:E[f]!==void 0?E[f].boolean&&(l===!0||l==="true"||l===1)?n[E[f].attr]=!0:!E[f].boolean&&typeof l=="string"&&l!==""&&(n[E[f].attr]=l):be[f]===void 0&&(r[f]=l)}}const o=pt(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 c=0;const s=t.id;return r.innerHTML=bt(o.body,s?()=>s+"-"+c++:"iconify-vue-"),Object.keys(i).length>0&&(r.style=i),a.h("svg",r)};if(me(!0),vt("",jt),typeof document!="undefined"&&typeof window!="undefined"){ne.store=qt,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"||!lt(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;wt(n,i)||console.error(r)}catch{console.error(r)}}}}const le=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=at(n);if(r===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 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 Yt={components:{Icon:le},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"}}}},Gt={class:"ml-4 leading-tight"};function Wt(e,t,n,r,i,o){const c=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(c,{class:a.normalizeClass([r.colors[s.type],"text-xl"]),icon:r.icons[s.type],inline:""},null,8,["class","icon"]),a.createElementVNode("p",Gt,a.toDisplayString(s.message),1)]))),128))]),_:1})])}var Jt=C(Yt,[["render",Wt]]);const F=a.ref([]),Le=a.readonly(F);function N(e,t,n){const r=Ze();F.value=[...F.value,{type:e,message:t,actions:n,id:r}],setTimeout(()=>{F.value=F.value.filter(i=>i.id!==r)},2e3)}function Me(...e){N("error",...e)}function Be(...e){N("warn",...e)}function De(...e){N("info",...e)}function qe(...e){N("success",...e)}function Xt(e){e.config.globalProperties.$notif=a.reactive({list:Le,push:N,error:Me,warn:Be,info:De,success:qe}),e.component("Pf_TheNotifications",Jt)}function Zt(){return a.reactive({list:Le,push:N,error:Me,warn:Be,info:De,success:qe})}var Jn="";const en={components:{Icon:le},props:{title:{type:String,default:null}},emits:["close"]},tn={class:"flex items-start"},nn={class:"flex-1 overflow-hidden title overflow-ellipsis"},rn={class:"overflow-auto content"},on={class:"py-2"};function sn(e,t,n,r,i,o){const c=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",tn,[a.createElementVNode("div",nn,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(c,{icon:"mdi:close",class:"text-purple"})])]),a.createElementVNode("div",rn,[a.renderSlot(e.$slots,"default")]),a.createElementVNode("div",on,[a.renderSlot(e.$slots,"footer")])])])])}var an=C(en,[["render",sn]]);function cn(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(c=>{const s=a.watch(r,f=>{f||(c(),s())})}),o=I({},t.query);return delete o[e],n.replace({query:o}),i}}}function ln(e){e.component("Pf_Dialog",an)}const fn=a.reactive({});function un(e){e.config.globalProperties.$responsive=a.reactive({breakpoints:fn})}const dn={components:{Icon:le},inheritAttrs:!1},hn={class:"flex items-center justify-center"};function pn(e,t,n,r,i,o){const c=a.resolveComponent("Icon",!0);return a.openBlock(),a.createElementBlock("span",hn,[a.createVNode(c,a.normalizeProps(a.guardReactiveProps(e.$attrs)),null,16)])}var gn=C(dn,[["render",pn]]);function yn(e){e.component("Pf_Icon",gn)}class mn{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 Ue=Symbol("Authentification");function bn(e,{supabase:t,router:n,loginRouteName:r="login",defaultRouteName:i="home",roleContextKeyName:o,devRedirectTo:c}={}){const s=new mn({supabase:t,roleContextKeyName:o,devRedirectTo:c}),f=a.readonly(s._user),l=a.readonly(s._roles);s.synchroUserWithSupabase(t.auth.session()),t.auth.onAuthStateChange((u,h)=>{s.synchroUserWithSupabase(h)});const d=a.reactive({user:f,roles:l,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(Ue,d)}function vn(){const e=a.inject(Ue,{}),t=a.toRef(e,"user"),n=a.toRef(e,"roles");return{user:t,roles:n,synchronizeRoles:e.synchronizeRoles,setProfile:e.synchronizeProfile}}const wn={},_n={class:"animate-spin rounded-full border-t-2 border-b-2 border-purple"};function In(e,t){return a.openBlock(),a.createElementBlock("div",_n)}var xn=C(wn,[["render",In]]);const En={components:{Spinner:xn},inheritAttrs:!1,props:{disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},computed:{internalDisabled(){return this.loading&&this.disabled}}},kn=["disabled"],jn={key:0,name:"loading",class:"absolute inset-0 bg-white flex items-center justify-center"};function $n(e,t,n,r,i,o){const c=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",jn,[a.createVNode(c,{class:"h-4 w-4"})])):a.createCommentVNode("",!0)],16,kn)}var Pn=C(En,[["render",$n]]);const Cn={},Sn={class:"px-1 py-2 text-xs text-center text-gray-700"},Tn=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),Nn={class:"flex justify-center gap-4"},An={class:"flex items-center pf-link",href:"https://bit.ly/3yLzyAb"},On=a.createTextVNode("Twitter"),Vn={class:"flex items-center pf-link",href:"https://bit.ly/3sfmS3p"},Rn=a.createTextVNode("GitHub "),Fn={class:"flex items-center pf-link",href:"https://bit.ly/3rim6R5"},Ln=a.createTextVNode("Discord");function Mn(e,t){const n=a.resolveComponent("Pf_Icon");return a.openBlock(),a.createElementBlock("footer",Sn,[Tn,a.createElementVNode("nav",null,[a.createElementVNode("ul",Nn,[a.createElementVNode("li",null,[a.createElementVNode("a",An,[a.createVNode(n,{inline:"",icon:"mdi:twitter",class:"mr-1"}),On])]),a.createElementVNode("li",null,[a.createElementVNode("a",Vn,[a.createVNode(n,{inline:"",icon:"mdi:github",class:"mr-1"}),Rn])]),a.createElementVNode("li",null,[a.createElementVNode("a",Fn,[a.createVNode(n,{inline:"",icon:"mdi:discord",class:"mr-1"}),Ln])])])])])}var Bn=C(Cn,[["render",Mn]]);const Dn={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 qn(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 Un=C(Dn,[["render",qn]]),Xn="";p.AuthPlugin=bn,p.IconPlugin=yn,p.ModalPlugin=ln,p.NotificationsPlugin=Xt,p.Pf_ExpandTransition=Un,p.Pf_Footer=Bn,p.Pf_SubmitButton=Pn,p.ResponsivePlugin=un,p.useAuth=vn,p.useModal=cn,p.useNotification=Zt,Object.defineProperty(p,"__esModule",{value:!0}),p[Symbol.toStringTag]="Module"}); | ||
var Kn=Object.defineProperty,Qn=Object.defineProperties;var Yn=Object.getOwnPropertyDescriptors;var Ke=Object.getOwnPropertySymbols;var Gn=Object.prototype.hasOwnProperty,Wn=Object.prototype.propertyIsEnumerable;var Qe=(p,a,b)=>a in p?Kn(p,a,{enumerable:!0,configurable:!0,writable:!0,value:b}):p[a]=b,I=(p,a)=>{for(var b in a||(a={}))Gn.call(a,b)&&Qe(p,b,a[b]);if(Ke)for(var b of Ke(a))Wn.call(a,b)&&Qe(p,b,a[b]);return p},he=(p,a)=>Qn(p,Yn(a));(function(p,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):(p=typeof globalThis!="undefined"?globalThis:p||self,a(p.PurplefoxTools={},p.Vue,p.vueRouter))})(this,function(p,a,b){"use strict";var L,Ye=new Uint8Array(16);function Ge(){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(Ye)}var We=/^(?:[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 Je(e){return typeof e=="string"&&We.test(e)}for(var m=[],z=0;z<256;++z)m.push((z+256).toString(16).substr(1));function Xe(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(!Je(n))throw TypeError("Stringified UUID is invalid");return n}function Ze(e,t,n){e=e||{};var r=e.random||(e.rng||Ge)();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 Xe(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(),l={provider:i.length>0?i[0]:r,prefix:f,name:s};return t&&!A(l)?null:l}const o=i[0],c=o.split("-");if(c.length>1){const s={provider:r,prefix:c.shift(),name:c.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 et(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,c){var s,f,l,d;if(e.icons[o]!==void 0)return Object.assign({},e.icons[o]);if(c>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,c+1);return h&&et(h,u)}return c===0&&((l=e.chars)==null?void 0:l[o])!==void 0?r((d=e.chars)==null?void 0:d[o],c+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 tt=/^[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 nt(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 c=i[o];if(typeof c!="object"||c===null||typeof c.body!="string"){if(n){delete i[o];return}throw new Error(`Invalid icon: "${o}"`)}const s=typeof c.parent=="string"?"parent":ge(c,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(l,d){if(s.has(l))return!f.has(l);const u=c[l];if(d>5||typeof u!="object"||u===null||typeof u.parent!="string"||!l.match(j)){if(n)return delete c[l],f.add(l),!1;throw new Error(`Invalid icon alias: "${l}"`)}const h=u.parent;if(r.icons[h]===void 0&&(c[h]===void 0||!o(h,d+1))){if(n)return delete c[l],f.add(l),!1;throw new Error(`Missing parent icon for alias "${l}`)}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 c[l],f.add(l),!1;throw new Error(`Invalid property "${y}" in alias "${l}"`)}return s.add(l),!0};const c=r.aliases,s=new Set,f=new Set;Object.keys(c).forEach(l=>{o(l,0)}),n&&!Object.keys(r.aliases).length&&delete r.aliases}if(Object.keys(T).forEach(o=>{const c=typeof T[o],s=typeof r[o];if(s!=="undefined"&&s!==c)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(c=>{var s;if(!c.match(tt)||typeof o[c]!="string"){if(n){delete o[c];return}throw new Error(`Invalid character "${c}"`)}const f=o[c];if(r.icons[f]===void 0&&((s=r.aliases)==null?void 0:s[f])===void 0){if(n){delete o[c];return}throw new Error(`Character "${c}" points to missing icon "${f}"`)}}),n&&!Object.keys(r.chars).length&&delete r.chars}return r}function rt(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{nt(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 c=n.aliases||"all";if(c!=="none"&&typeof e.aliases=="object"){const s=e.aliases;Object.keys(s).forEach(f=>{if(c==="variations"&&rt(s[f]))return;const l=pe(e,f,!0);l&&(t(f,l),r.push(f))})}return r}var K=Object.create(null);function ot(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]=ot(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 it(e,t,n){try{if(typeof n.body=="string")return e.icons[t]=Object.freeze(H(n)),!0}catch{}return!1}function st(e,t){const n=e.icons[t];return n===void 0?null:n}var O=!1;function me(e){return typeof e=="boolean"&&(O=e),O}function at(e){const t=typeof e=="string"?M(e,!0,O):e;return t?st($(t.provider,t.prefix),t.name):null}function ct(e,t){const n=M(e,!0,O);if(!n)return!1;const r=$(n.provider,n.prefix);return it(r,n.name,t)}function lt(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=typeof e.provider=="string"?e.provider:""),O&&t===""&&(typeof e.prefix!="string"||e.prefix==="")){let r=!1;return ye(e,(i,o)=>{o&&ct(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 ft(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 ut=/(-?[0-9.]*[0-9]+[0-9.]*)/g,dt=/^-?[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(ut);if(r===null||!r.length)return e;const i=[];let o=r.shift(),c=dt.test(o);for(;;){if(c){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("");c=!c}}function ht(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 pt(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=[],l=s.hFlip,d=s.vFlip;let u=s.rotate;l?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 c={attributes:{width:i,height:o,preserveAspectRatio:ht(t),viewBox:n.left+" "+n.top+" "+n.width+" "+n.height},body:r};return t.inline&&(c.inline=!0),c}var gt=/\sid="(\S+)"/g,yt="IconifyId-"+Date.now().toString(16)+"-"+(Math.random()*16777216|0).toString(16)+"-",mt=0;function bt(e,t=yt){const n=[];let r;for(;r=gt.exec(e);)n.push(r[1]);return n.length&&n.forEach(i=>{const o=typeof t=="function"?t(i):t+mt++,c=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+c+')([")]|\\.[a-z])',"g"),"$1"+o+"$3")}),e}var G=Object.create(null);function vt(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),V=["https://api.simplesvg.com","https://api.unisvg.com"],B=[];V.length>0;)V.length===1||Math.random()>.5?B.push(V.shift()):B.push(V.pop());X[""]=J({resources:["https://api.iconify.design"].concat(B)});function wt(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 c;try{c=i(t[o])}catch{return}n+=(r?"&":"?")+encodeURIComponent(o)+"="+c,r=!0}),n},we=Object.create(null),D=Object.create(null),_t=()=>{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=_t();function It(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 c=ve(t+".json",{icons:""});r=n.maxURL-o-n.path.length-c.length}const i=e+":"+t;return D[e]=n.path,we[i]=r,r}var xt=(e,t,n)=>{const r=[];let i=we[t];i===void 0&&(i=It(e,t));const o="icons";let c={type:o,provider:e,prefix:t,icons:[]},s=0;return n.forEach((f,l)=>{s+=f.length+1,s>=i&&l>0&&(r.push(c),c={type:o,provider:e,prefix:t,icons:[]},s=f.length),c.icons.push(f)}),r.push(c),r};function Et(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 kt=(e,t,n)=>{if(!_e){n.done(void 0,424);return}let r=Et(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)})},jt={prepare:xt,send:kt};function $t(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,c=i.prefix,s=i.name;n[o]===void 0&&(n[o]=Object.create(null));const f=n[o];f[c]===void 0&&(f[c]=$(o,c));const l=f[c];let d;l.icons[s]!==void 0?d=t.loaded:c===""||l.missing[s]!==void 0?d=t.missing:d=t.pending;const u={provider:o,prefix:c,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,c=i[o];c&&(i[o]=c.filter(s=>s.id!==t))})}function Pt(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(c=>{const s=c.icons,f=s.pending.length;s.pending=s.pending.filter(l=>{if(l.prefix!==t)return!0;const d=l.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}],c.id),c.callback(s.loaded.slice(0),s.missing.slice(0),s.pending.slice(0),c.abort))})}))}var Ct=0;function St(e,t,n){const r=Ct++,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(c=>{const s=c.provider,f=c.prefix;x[s]===void 0&&(x[s]=Object.create(null));const l=x[s];l[f]===void 0&&(l[f]=[]),l[f].push(o)}),i}function Tt(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 Nt(e,t,n,r,i){const o=e.resources.length,c=e.random?Math.floor(Math.random()*o):e.index;let s;if(e.random){let g=e.resources.slice(0);for(s=[];g.length>1;){const w=Math.floor(Math.random()*g.length);s.push(g[w]),g=g.slice(0,w).concat(g.slice(w+1))}s=s.concat(g)}else s=e.resources.slice(c).concat(e.resources.slice(0,c));const f=Date.now();let l="pending",d=0,u,h=null,y=[],v=[];typeof r=="function"&&v.push(r);function k(){h&&(clearTimeout(h),h=null)}function fe(){l==="pending"&&(l="aborted"),k(),y.forEach(g=>{g.abort&&g.abort(),g.status==="pending"&&(g.status="aborted")}),y=[]}function zn(g,w){w&&(v=[]),typeof g=="function"&&v.push(g)}function ze(){return{startTime:f,payload:t,status:l,queriesSent:d,queriesPending:y.length,subscribe:zn,abort:fe}}function ue(){l="failed",v.forEach(g=>{g(void 0,u)})}function He(){y=y.filter(g=>(g.status==="pending"&&(g.status="aborted"),g.abort&&g.abort(),!1))}function Hn(g,w,U){const S=w===void 0;switch(y=y.filter(_=>_!==g),l){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(),He(),i&&!e.random){const _=e.resources.indexOf(g.resource);_!==-1&&_!==e.index&&i(_)}l="completed",v.forEach(_=>{_(w)})}function de(){if(l!=="pending")return;k();const g=s.shift();if(g===void 0){if(y.length){const S=typeof e.timeout=="function"?e.timeout(f):e.timeout;if(S){h=setTimeout(()=>{k(),l==="pending"&&(He(),ue())},S);return}}ue();return}const w={getQueryStatus:ze,status:"pending",resource:g,done:(S,_)=>{Hn(w,S,_)}};y.push(w),d++;const U=typeof e.rotate=="function"?e.rotate(d,f):e.rotate;h=setTimeout(de,U),n(g,t,w)}return setTimeout(de),ze}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 xe)e[n]!==void 0?t[n]=e[n]:t[n]=xe[n];return t}function Ee(e){const t=At(e);let n=[];function r(){n=n.filter(s=>s().status==="pending")}function i(s,f,l){const d=Nt(t,s,f,(u,h)=>{r(),l&&l(u,h)},u=>{t.index=u});return n.push(d),d}function o(s){const f=n.find(l=>s(l));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 Ot(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 Vt(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 c=Ot(e);c&&(r=c.redundancy)}else{const o=J(e);if(o){r=Ee(o);const c=e.resources?e.resources[0]:"",s=W(c);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 Rt(e,t){oe[e]===void 0&&(oe[e]=Object.create(null));const n=oe[e];n[t]||(n[t]=!0,setTimeout(()=>{n[t]=!1,Pt(e,t)}))}var $e=Object.create(null);function Ft(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 c=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=>{Vt(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=c[t];v.forEach(fe=>{delete k[fe]}),ne.store&&ne.store(e,u)}catch(v){console.error(v)}Rt(e,t)})})}))}var Lt=(e,t)=>{const n=Tt(e,!0,me()),r=$t(n);if(!r.pending.length){let l=!0;return t&&setTimeout(()=>{l&&t(r.loaded,r.missing,r.pending,je)}),()=>{l=!1}}const i=Object.create(null),o=[];let c,s;r.pending.forEach(l=>{const d=l.provider,u=l.prefix;if(u===s&&d===c)return;c=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(l=>{const d=l.provider,u=l.prefix,h=l.name,y=P[d][u];y[h]===void 0&&(y[h]=f,i[d][u].push(h))}),o.forEach(l=>{const d=l.provider,u=l.prefix;i[d][u].length&&Ft(d,u,i[d][u])}),t?St(t,r,o):je},Pe="iconify2",R="iconify",Ce=R+"-count",Se=R+"-version",Te=36e5,Mt=168,se={local:!0,session:!0},ae=!1,Ne={local:0,session:0},Ae={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 ce(e,t,n){try{return e.setItem(Ce,n+""),Ne[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 Bt(e,t){try{e.setItem(Se,Pe)}catch{}ce(e,t,0)}function Dt(e){try{const t=Ve(e);for(let n=0;n<t;n++)e.removeItem(R+n)}catch{}}var Re=()=>{if(ae)return;ae=!0;const e=Math.floor(Date.now()/Te)-Mt;function t(n){const r=Oe(n);if(!r)return;const i=o=>{const c=R+o,s=r.getItem(c);if(typeof s!="string")return!1;let f=!0;try{const l=JSON.parse(s);if(typeof l!="object"||typeof l.cached!="number"||l.cached<e||typeof l.provider!="string"||typeof l.data!="object"||typeof l.data.prefix!="string")f=!1;else{const d=l.provider,u=l.data.prefix,h=$(d,u);f=Q(h,l.data).length>0}}catch{f=!1}return f||r.removeItem(c),f};try{const o=r.getItem(Se);if(o!==Pe){o&&Dt(r),Bt(r,n);return}let c=Ve(r);for(let s=c-1;s>=0;s--)i(s)||(s===c-1?c--:Ae[n].push(s));ce(r,n,c)}catch{}}for(const n in se)t(n)},qt=(e,t)=>{ae||Re();function n(r){if(!se[r])return!1;const i=Oe(r);if(!i)return!1;let o=Ae[r].shift();if(o===void 0&&(o=Ne[r],!ce(i,r,o+1)))return!1;try{const c={cached:Math.floor(Date.now()/Te),provider:e,data:t};i.setItem(R+o,JSON.stringify(c))}catch{return!1}return!0}n("local")||n("session")},Fe=/[\s,]+/;function Ut(e,t){t.split(Fe).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function zt(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 Ht(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 Kt={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=ft(be,t),r=I({},Kt);let i=typeof t.style=="object"&&!(t.style instanceof Array)?I({},t.style):{};for(let f in t){const l=t[f];if(l!==void 0)switch(f){case"icon":case"style":case"onLoad":break;case"inline":case"hFlip":case"vFlip":n[f]=l===!0||l==="true"||l===1;break;case"flip":typeof l=="string"&&Ut(n,l);break;case"align":typeof l=="string"&&zt(n,l);break;case"color":i.color=l;break;case"rotate":typeof l=="string"?n[f]=Ht(l):typeof l=="number"&&(n[f]=l);break;case"ariaHidden":case"aria-hidden":l!==!0&&l!=="true"&&delete r["aria-hidden"];break;default:E[f]!==void 0?E[f].boolean&&(l===!0||l==="true"||l===1)?n[E[f].attr]=!0:!E[f].boolean&&typeof l=="string"&&l!==""&&(n[E[f].attr]=l):be[f]===void 0&&(r[f]=l)}}const o=pt(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 c=0;const s=t.id;return r.innerHTML=bt(o.body,s?()=>s+"-"+c++:"iconify-vue-"),Object.keys(i).length>0&&(r.style=i),a.h("svg",r)};if(me(!0),vt("",jt),typeof document!="undefined"&&typeof window!="undefined"){ne.store=qt,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"||!lt(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;wt(n,i)||console.error(r)}catch{console.error(r)}}}}const le=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=at(n);if(r===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 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 Yt={components:{Icon:le},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"}}}},Gt={class:"ml-4 leading-tight"};function Wt(e,t,n,r,i,o){const c=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(c,{class:a.normalizeClass([r.colors[s.type],"text-xl"]),icon:r.icons[s.type],inline:""},null,8,["class","icon"]),a.createElementVNode("p",Gt,a.toDisplayString(s.message),1)]))),128))]),_:1})])}var Jt=C(Yt,[["render",Wt]]);const F=a.ref([]),Le=a.readonly(F);function N(e,t,n){const r=Ze();F.value=[...F.value,{type:e,message:t,actions:n,id:r}],setTimeout(()=>{F.value=F.value.filter(i=>i.id!==r)},2e3)}function Me(...e){N("error",...e)}function Be(...e){N("warn",...e)}function De(...e){N("info",...e)}function qe(...e){N("success",...e)}function Xt(e){e.config.globalProperties.$notif=a.reactive({list:Le,push:N,error:Me,warn:Be,info:De,success:qe}),e.component("Pf_TheNotifications",Jt)}function Zt(){return a.reactive({list:Le,push:N,error:Me,warn:Be,info:De,success:qe})}var Jn="";const en={components:{Icon:le},props:{title:{type:String,default:null}},emits:["close"]},tn={class:"flex items-start"},nn={class:"flex-1 overflow-hidden title overflow-ellipsis"},rn={class:"overflow-auto content"},on={class:"py-2"};function sn(e,t,n,r,i,o){const c=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",tn,[a.createElementVNode("div",nn,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(c,{icon:"mdi:close",class:"text-purple"})])]),a.createElementVNode("div",rn,[a.renderSlot(e.$slots,"default")]),a.createElementVNode("div",on,[a.renderSlot(e.$slots,"footer")])])])])}var an=C(en,[["render",sn]]);function cn(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(c=>{const s=a.watch(r,f=>{f||(c(),s())})}),o=I({},t.query);return delete o[e],n.replace({query:o}),i}}}function ln(e){e.component("Pf_Dialog",an)}const fn=a.reactive({});function un(e){e.config.globalProperties.$responsive=a.reactive({breakpoints:fn})}const dn={components:{Icon:le},inject:{pfNoPrerender:{default:!1}},inheritAttrs:!1},hn={key:0,class:"flex items-center justify-center"};function pn(e,t,n,r,i,o){const c=a.resolveComponent("Icon",!0);return e.noPrerender?(a.openBlock(),a.createBlock(c,a.normalizeProps(a.mergeProps({key:1},e.$attrs)),null,16)):(a.openBlock(),a.createElementBlock("span",hn,[a.createVNode(c,a.normalizeProps(a.guardReactiveProps(e.$attrs)),null,16)]))}var gn=C(dn,[["render",pn]]);function yn(e){e.component("Pf_Icon",gn)}class mn{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 Ue=Symbol("Authentification");function bn(e,{supabase:t,router:n,loginRouteName:r="login",defaultRouteName:i="home",roleContextKeyName:o,devRedirectTo:c}={}){const s=new mn({supabase:t,roleContextKeyName:o,devRedirectTo:c}),f=a.readonly(s._user),l=a.readonly(s._roles);s.synchroUserWithSupabase(t.auth.session()),t.auth.onAuthStateChange((u,h)=>{s.synchroUserWithSupabase(h)});const d=a.reactive({user:f,roles:l,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(Ue,d)}function vn(){const e=a.inject(Ue,{}),t=a.toRef(e,"user"),n=a.toRef(e,"roles");return{user:t,roles:n,synchronizeRoles:e.synchronizeRoles,setProfile:e.synchronizeProfile}}const wn={},_n={class:"animate-spin rounded-full border-t-2 border-b-2 border-purple"};function In(e,t){return a.openBlock(),a.createElementBlock("div",_n)}var xn=C(wn,[["render",In]]);const En={components:{Spinner:xn},inheritAttrs:!1,props:{disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},computed:{internalDisabled(){return this.loading&&this.disabled}}},kn=["disabled"],jn={key:0,name:"loading",class:"absolute inset-0 bg-white flex items-center justify-center"};function $n(e,t,n,r,i,o){const c=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",jn,[a.createVNode(c,{class:"h-4 w-4"})])):a.createCommentVNode("",!0)],16,kn)}var Pn=C(En,[["render",$n]]);const Cn={},Sn={class:"px-1 py-2 text-xs text-center text-gray-700"},Tn=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),Nn={class:"flex justify-center gap-4"},An={class:"flex items-center pf-link",href:"https://bit.ly/3yLzyAb"},On=a.createTextVNode("Twitter"),Vn={class:"flex items-center pf-link",href:"https://bit.ly/3sfmS3p"},Rn=a.createTextVNode("GitHub "),Fn={class:"flex items-center pf-link",href:"https://bit.ly/3rim6R5"},Ln=a.createTextVNode("Discord");function Mn(e,t){const n=a.resolveComponent("Pf_Icon");return a.openBlock(),a.createElementBlock("footer",Sn,[Tn,a.createElementVNode("nav",null,[a.createElementVNode("ul",Nn,[a.createElementVNode("li",null,[a.createElementVNode("a",An,[a.createVNode(n,{inline:"",icon:"mdi:twitter",class:"mr-1"}),On])]),a.createElementVNode("li",null,[a.createElementVNode("a",Vn,[a.createVNode(n,{inline:"",icon:"mdi:github",class:"mr-1"}),Rn])]),a.createElementVNode("li",null,[a.createElementVNode("a",Fn,[a.createVNode(n,{inline:"",icon:"mdi:discord",class:"mr-1"}),Ln])])])])])}var Bn=C(Cn,[["render",Mn]]);const Dn={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 qn(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 Un=C(Dn,[["render",qn]]),Xn="";p.AuthPlugin=bn,p.IconPlugin=yn,p.ModalPlugin=ln,p.NotificationsPlugin=Xt,p.Pf_ExpandTransition=Un,p.Pf_Footer=Bn,p.Pf_SubmitButton=Pn,p.ResponsivePlugin=un,p.useAuth=vn,p.useModal=cn,p.useNotification=Zt,Object.defineProperty(p,"__esModule",{value:!0}),p[Symbol.toStringTag]="Module"}); |
@@ -7,3 +7,3 @@ { | ||
], | ||
"version": "1.3.14", | ||
"version": "1.3.15", | ||
"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
120058
2766