@glyph-cat/swiss-army-knife
Version:
GlyphCat's set of common utilities.
1 lines • 54.5 kB
JavaScript
import{Dimensions as t}from"react-native";import{SimpleStateManager as r}from"cotton-box";import e from"autoprefixer";import n from"postcss";class o{constructor(t){this.internalAppIdentifier=t,this.createStorageKey=this.createStorageKey.bind(this),this.clearStorage=this.clearStorage.bind(this),this.clearLocalStorage=this.clearLocalStorage.bind(this),this.clearSessionStorage=this.clearSessionStorage.bind(this),this.clearAllStorage=this.clearAllStorage.bind(this)}createStorageKey(t){return`${this.internalAppIdentifier}/${t}`}clearStorage(t){for(let r=0;r<t.length;r++){const e=t.key(r);(null==e?void 0:e.startsWith(this.internalAppIdentifier))&&t.removeItem(e)}}clearLocalStorage(){this.clearStorage(localStorage)}clearSessionStorage(){this.clearStorage(sessionStorage)}clearAllStorage(){this.clearLocalStorage(),this.clearSessionStorage()}}function i(t){if("undefined"!=typeof window)return t()}function s(){return(new Date).toISOString().replace(/[^a-z0-9]/gi,"")}const a="production"!==process.env.NODE_ENV;var u;!function(t){t.CJS="CJS",t.ES="ES",t.MJS="MJS",t.RN="RN",t.UMD="UMD",t.UMD_MIN="UMD_MIN"}(u||(u={}));const c="RN",l="cfe443b08bce5094a0331628ac57af0c7db931fc",f=a||"RN"===u.RN||"undefined"!=typeof window,h="0.0.0-experimental.83";var d;!function(t){t[t.NO=0]="NO",t[t.YES=1]="YES"}(d||(d={}));const p=s();function g(t,r,e){const n=[...e,...r],o=Math.max(0,n.length-t);return o>0&&n.splice(0,o),n}function m(t,r,e,n={}){const o=(null==n?void 0:n.harshJoin)?[...r,...e]:[...[...r].reverse(),...e],i=Math.max(0,o.length-t);return i>0&&o.splice(t,i),o}function b(t,r=0){return t[Math.max(0,t.length-1-r)]}function E(t,r){for(let e=t.length-1;e>=0;e--)if(r(t[e],e))return t[e];return null}function v(t){return[...new Set(t)]}function T(t,r){const e=[...t],n=[];for(let t=0;t<r;t++)n.push(e.pop());return[e,...n]}function w(t,r){const e=r-t;return t+Math.floor(Math.random()*e)}function C(t,r=!1){const e=[...t];do{let t=e.length;for(;t;){const r=w(0,t--),n=e[t];e[t]=e[r],e[r]=n}}while(r&&S(t,e));return e}function S(t,r){if(t.length!==r.length)return!1;for(let e=0;e<t.length;e++)if(!Object.is(t[e],r[e]))return!1;return!0}function y(t){const r=Math.floor(t.length/2),e={value:t[r]},n=t.slice(0,r),o=t.slice(r+1,t.length);return n.length>0&&(e.left=y(n)),o.length>0&&(e.right=y(o)),e}function O(t,r){let e=[];const n=[];for(let o=0;o<t.length;o++){const i=t[o];e.push(i);e.length>=r&&(n.push(e),e=[])}return e.length>0&&(n.push(e),e=[]),n}function A(t){return t[w(0,t.length)]}const N=["lorem","ipsum","dolor","sit","amet","consectetur","adipiscing","elit","sed","do","eiusmod","tempor","incididunt","ut","labore","et","dolore","magna","aliqua","enim","ad","minim","veniam","quis","nostrud","exercitation","ullamco","laboris","nisi","aliquip","ex","ea","commodo","consequat","duis","aute","irure","in","reprehenderit","voluptate","velit","esse","cillum","eu","fugiat","nulla","pariatur","excepteur","sint","occaecat","cupidatat","non","proident","sunt","culpa","qui","officia","deserunt","mollit","anim","id","est","laborum"];function R(t){const r=[];for(;r.length<t;)r.push(A(N));return r.join(" ")}var I,$;function L(t){return"boolean"==typeof t}function M(t){return"function"==typeof t}function D(t){return Object.is(t,NaN)}function _(t){return"number"==typeof t}function x(t){return"number"==typeof t&&!D(t)}function k(t){return"object"==typeof t}function F(t){return"object"==typeof t&&!H(t)}function B(t){return"string"==typeof t}function P(t){return"symbol"==typeof t}function U(t){return M(null==t?void 0:t.then)}function X(t){return void 0===t}function H(t){return Object.is(t,null)}function G(t){return H(t)||X(t)}function j(t){return X(t)||H(t)}function V(t,...r){a&&console[t](...r)}function z(...t){V("info",...t)}function Y(...t){V("warn",...t)}function q(...t){V("error",...t)}function Q(t){return t.length<=0?"[]":`['${t.join("', '")}']`}function W(t){const r=[];for(const e of t)r.push(B(e)?`'${e}'`:String(e));return`[${r.join(", ")}]`}function J(t){let r="";for(const e of t)r+=e.match(/^[a-z]/i)?`.${e}`:`['${e}']`;return r.match(/^\./)&&(r=r.replace(/^\./,"")),`\`${r}\``}function K(t){const r=t.toString(),e=r[r.length-1];return"1"!==e||r.match(/11$/)?"2"!==e||r.match(/12$/)?"3"!==e||r.match(/13$/)?`${t}th`:`${t}rd`:`${t}nd`:`${t}st`}function Z(t,r){return!!t&&Object.prototype.hasOwnProperty.call(t,r)}function tt(t,r){if(f&&r.length<1&&q("Expected there to be at least one property name but got none"),!t)return!1;for(const e of r)if(Object.prototype.hasOwnProperty.call(t,e))return!0;return!1}function rt(t,r){if(f&&r.length<1&&q("Expected there to be at least one property name but got none"),!t)return!1;for(const e of r)if(!Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}function et(t){const r=(t=t.replace(/[.\]]([\d][\da-z_-]*)/gi,'["$1"]').replace(/[\]?]/g,"").replace(/\.?\[/g,".")).split(/\.\[?/g),e=[];for(let t=0;t<r.length;t++)r[t].length<=0||(/^\d+$/.test(r[t])?e.push(Number(r[t])):e.push(r[t].replace(/^["'`]/,"").replace(/["'`]$/,"")));return e}function nt(t,r){return st(t,r)[1]}function ot(t,r){if(f&&r.length<1&&q("Expected there to be at least one property path but got none"),!t)return!1;for(const e of r)if(st(t,e)[1])return!0;return!1}function it(t,r){if(f&&r.length<1&&q("Expected there to be at least one property path but got none"),!t)return!1;for(const e of r)if(!st(t,e)[1])return!1;return!0}function st(t,r){if(!t)return[void 0,!1];let e=t;Array.isArray(r)||(r=et(r)),f&&r.length<=0&&q("Expected there to be at least one path segment but got none");for(let t=0;t<r.length;t++){const n=r[t];if(!Object.prototype.hasOwnProperty.call(e,n))return[void 0,!1];e=e[n]}return[e,!0]}function at(t,r,e){let n=t;Array.isArray(r)||(r=et(r));const o=r.length-1;for(let t=0;t<=o;t++){const i=r[t];t===o?n[i]=e:(Object.prototype.hasOwnProperty.call(n,i)||(n[i]=x(r[t+1])?[]:{}),n=n[i])}}function ut(t,r,e){return Array.isArray(r)||(r=et(r)),ct(t,!0,r,e)}function ct(t,r,e,n){var o;const[i,...s]=e;if(Array.isArray(t)||!r&&x(i)){const r=[...null!==(o=t)&&void 0!==o?o:[]];return r[i]=s.length>0?ct(r[i],Z(r,i),s,n):n,r}return{...t,[i]:s.length>0?ct(null==t?void 0:t[i],Z(t,i),s,n):n}}function lt(t,r,e){return Array.isArray(r)||(r=et(r)),ft(t,r,e,!0)}function ft(t,r,e,n){const[o,...i]=r,s=!!n&&Object.prototype.hasOwnProperty.call(t,o);if(Array.isArray(t)||!n&&x(o)){const r=[...n?t:[]];return r[o]=i.length>0?ft(r[o],i,e,s):e(null==t?void 0:t[o],s),r}return{...t,[o]:i.length>0?ft(null==t?void 0:t[o],i,e,s):e(null==t?void 0:t[o],s)}}function ht(t,r,e){return Array.isArray(r)||(r=et(r)),dt(t,r,e)[0]}function dt(t,r,e){if(G(t))return[t,!1];const[n,...o]=r;if(!Object.prototype.hasOwnProperty.call(t,n))return[t,!1];if(Array.isArray(t)){const r=[...t],[i]=r.splice(n,1);if(o.length>0){const[t,s]=dt(i,o,e);return(null==e?void 0:e.clean)&&!s||r.splice(n,0,t),[r,!(null==e?void 0:e.clean)||r.length>0]}return[r,!(null==e?void 0:e.clean)||r.length>0]}{const r={...t},i=r[n];if(o.length>0){const[t,s]=dt(i,o,e);return(null==e?void 0:e.clean)&&!s?delete r[n]:r[n]=t,[r,!(null==e?void 0:e.clean)||Object.keys(r).length>0]}{const{[n]:r,...o}=t;return[o,!(null==e?void 0:e.clean)||Object.keys(o).length>0]}}}function pt(t){const r=Object.keys(t);for(const e of r)t[t[e]]=e}function gt(t){const r={};for(const e in t){const n=t[e];r[e]=n,r[n]=e}return Object.freeze(r),r}function mt(t){return r=>{var e;return String(null!==(e=t[r])&&void 0!==e?e:r)}}!function(t){t.ARRAY=[],t.OBJECT={},t.FUNCTION=()=>{},t.PROMISE=Promise.resolve(),t.STRING="",t.DOUBLE_QUOTE='""',t.SINGLE_QUOTE="''",t.BACKTICK_QUOTE="``"}(I||(I={}));class bt{constructor(t={}){this.t={};for(const r in t){const e=t[r];this.t[r]=e,this.t[e]=r}}add(t,r){const e=this.clone();return e.t[t]=r,e.t[r]=t,e}remove(t){const r=this.clone(),e=r.t[t];return delete r.t[t],delete r.t[e],r}get(t){return this.t[t]}toJSON(){return{...this.t}}has(t){return Z(this.t,t)}clone(){const t=new bt;return t.t=this.toJSON(),t}}function Et(t){const r={};for(const e of t)r[e]=!0;return r}function vt(t){return Object.freeze(Et(t))}function Tt(t){return JSON.parse(JSON.stringify(t))}function wt(t,r){return JSON.stringify(t)===JSON.stringify(r)}function Ct(t){try{return JSON.stringify(t)}catch(r){return String(t)}}function St(t,r){if(!B(t))return null;try{return JSON.parse(t,r)}catch(t){return null}}class yt{constructor(t){this.factory=t,this.o=!1}get isInitialized(){return this.o}get value(){return this.o||(this.u=this.factory(),this.o=!0),this.u}}function Ot(t,r){if(t.length!==r.length)return!1;for(let e=0;e<t.length;e++)if(!Object.is(t[e],r[e]))return!1;return!0}function At(t){let r,e;return(...n)=>{if(X(r)||!Ot(r,n)){const o=t(...n);e=o,r=n}return e}}function Nt(t,r=2,e){let n=[];return(...e)=>{for(let t=0;t<n.length;t++){const[r,o]=n[t];if(Ot(r,e))return o}const o=t(...e);return n=m(r,[[e,o]],n),o}}function Rt(t){return X(t)?null:t}function It(t,r){if(!t)return;let e=1;for(const n in t){if(e===r)return n;e+=1}}function $t(t,r){if(t)return t[It(t,r)]}function Lt(t){return It(t,1)}function Mt(t){return $t(t,1)}function Dt(t){if(!t)return!0;for(const r in t)return!1;return!0}function _t(t){if(!t)return!1;for(const r in t)return!0;return!1}function xt(t,r){const e={};let n=0;for(const o in t)r(t[o],o,n,t)&&(e[o]=t[o]),n+=1;return e}function kt(t){const r={};for(const e in t)if(Z(t,e))if(k(t[e])){const n=kt(t[e]);for(const t in n)Z(n,t)&&(r[e+"."+t]=n[t])}else r[e]=t[e];return r}function Ft(t,r){let e=0;const n=[];for(const o in t)n.push(r(t[o],o,e,t)),e+=1;return n}function Bt(t,r){let e=t;for(const t of r){if(!Z(e,t))continue;const{[t]:r,...n}=e;e=n}return e}function Pt(t,r){const e={};for(const n of r)Z(t,n)&&(e[n]=t[n]);return e}function Ut(t,r,e){let n=0;for(const o in t)e=r(e,t[o],o,n,t),n+=1;return e}function Xt(t,r){const e=Object.keys(t);e.sort(((e,n)=>r({key:e,value:t[e]},{key:n,value:t[n]})));const n={};for(const r of e)n[r]=t[r];return n}function Ht(t,...r){let e=t;for(const n of r)for(const r in t)Z(n,r)&&(e={...e,[r]:n[r]});return e}function Gt(t){return{current:t}}class jt{constructor(t){const r=new Map;for(const e of t){const[t,n]=e;for(const e of t)r.set(e,n)}this.expandedData=r}resolve(t){return this.expandedData.get(t)}}class Vt{constructor(t){const r=new Map;for(const e of t){const[t,n]=e;for(const e of n)r.set(e,t)}this.reversedData=r,this.resolve=this.resolve.bind(this)}resolve(t){return this.reversedData.get(t)}}function zt(t){return t.replace(/^[\s\n\t]+/,"").replace(/[\s\n\t]+$/,"")}function Yt(t){const r=[],e=t.split(/\n/g);for(const t of e)r.push(zt(t));return zt(r.join("\n"))}function qt(t,r,e){return Math.min(Math.max(r,t),e)}!function(t){t.toBoolean=function(t){return/^(t(rue)?|y(es)?|1)$/i.test(t)},t.toString=function(t){return k(t)?JSON.stringify(t):zt(String(t))}}($||($={}));const Qt=Math.PI/180,Wt=180/Math.PI;function Jt(t){return t*Qt}function Kt(t){return t*Wt}function Zt(t,r){const e=[t,r];return e.q=t,e.r=r,e}function tr(t){return t%2==0}function rr(t){return t%2!=0}function er(t,r){return r%t==0}function nr(t){return r=>r%t==0}function or(t,r){const e=Math.abs(r-t);return r>t?t+2*e:t-2*e}function ir(t,r,e,n){return Math.hypot(e-t,n-r)}function sr(t,r){return ir(t.x,t.y,r.x,r.y)}function ar(t,r){let e=Math.atan2(t.x*r.y-t.y*r.x,t.x*r.x+t.y*r.y);return e<0&&(e*=-1),e}function ur(t,r,e,n){return ar({x:r.x-t.x,y:r.y-t.y},{x:n.x-e.x,y:n.y-e.y})}function cr(t,r,e,n,o,i){return Math.sqrt(Math.pow(n-t,2)+Math.pow(o-r,2)+Math.pow(i-e,2))}function lr(t,r){return cr(t.x,t.y,t.z,r.x,r.y,r.z)}function fr(t,r){const e=t.x*r.x+t.y*r.y+t.z*r.z,n=Math.pow(t.x,2)+Math.pow(t.y,2)+Math.pow(t.z,2),o=Math.pow(r.x,2)+Math.pow(r.y,2)+Math.pow(r.z,2);return Math.acos(e/Math.sqrt(n*o))}function hr(t,r,e,n){return fr({x:r.x-t.x,y:r.y-t.y,z:r.z-t.z},{x:n.x-e.x,y:n.y-e.y,z:n.z-e.z})}function dr(t,r,e){const n=r-e*t;return t=>e*t+n}function pr(t,r,e,n){return e*n+(r-e*t)}function gr(t,r,e,n){const o=(n-r)/(e-t),i=r-o*t;return t=>o*t+i}function mr(t,r,e,n,o){const i=(n-r)/(e-t);return i*o+(r-i*t)}function br(t,r,e){return(t-r)/(e-r)}class Er{constructor(t){this.decimals=t,f&&(t<0?Y(`Expected \`decimal\` to be >=1 but got ${t}`):0===t&&Y(`${Er.name} is unnecessary when decimals is 0`)),this.decimals=Math.max(t,0),this.offset=Math.pow(10,this.decimals)}add(t,...r){const e=Math.pow(10,this.decimals);let n=t*e;for(const t of r)n+=t*e;return parseFloat((n/e).toFixed(this.decimals))}subtract(t,...r){const e=Math.pow(10,this.decimals);let n=t*e;for(const t of r)n-=t*e;return parseFloat((n/e).toFixed(this.decimals))}multiply(t,...r){let e=t*this.offset;for(const t of r)e*=t*this.offset,e/=this.offset;return parseFloat((e/this.offset).toFixed(this.decimals))}divide(t,...r){let e=t;for(const t of r)e=e*this.offset/(t*this.offset);return parseFloat(e.toFixed(this.decimals))}}function vr(t,r,e){return t>=r&&t<=e}function Tr(t,r,e){return t<r||t>e}function wr(t){return 0===t}function Cr(t){return t<0}function Sr(t){return t<=0}function yr(t){return t>0}function Or(t){return t>=0}function Ar(t,r=0){return parseFloat(t.toFixed(r))}class Nr{constructor(t,r){this.values=t,this.options=r}get size(){return this.values.length}get sum(){if(X(this.p)){this.p=0;for(let t=0;t<this.values.length;t++)this.p+=this.values[t]}return this.p}get mean(){return X(this.v)&&(this.v=this.sum/this.values.length),this.v}get median(){if(X(this.T))if(this.values.length%2!=0)this.T=this.values[Math.floor(this.values.length/2)];else{const t=this.values.length/2;this.T=(this.values[t-1]+this.values[t])/2}return this.T}get variance(){var t;if(X(this.O)){let r=0;for(let t=0;t<this.values.length;t++)r+=Math.pow(this.values[t]-this.mean,2);this.O=r/(this.values.length-((null===(t=this.options)||void 0===t?void 0:t.forPopulation)?0:1))}return this.O}get stddev(){return X(this.N)&&(this.N=Math.sqrt(this.variance)),this.N}}var Rr;!function(t){t.RGB="RGB",t.RGBA="RGBA",t.HSL="HSL",t.HSLA="HSLA",t.FFF="FFF",t.FFFF="FFFF",t.FFFFFF="FFFFFF",t.FFFFFFFF="FFFFFFFF"}(Rr||(Rr={}));const Ir=new yt((()=>{const t="black,000000;silver,c0c0c0;gray,808080;white,ffffff;maroon,800000;red,ff0000;purple,800080;fuchsia,ff00ff;green,008000;lime,00ff00;olive,808000;yellow,ffff00;navy,000080;blue,0000ff;teal,008080;aqua,00ffff;aliceblue,f0f8ff;antiquewhite,faebd7;aqua,00ffff;aquamarine,7fffd4;azure,f0ffff;beige,f5f5dc;bisque,ffe4c4;black,000000;blanchedalmond,ffebcd;blue,0000ff;blueviolet,8a2be2;brown,a52a2a;burlywood,deb887;cadetblue,5f9ea0;chartreuse,7fff00;chocolate,d2691e;coral,ff7f50;cornflowerblue,6495ed;cornsilk,fff8dc;crimson,dc143c;cyan,00ffff;darkblue,00008b;darkcyan,008b8b;darkgoldenrod,b8860b;darkgray,a9a9a9;darkgreen,006400;darkgrey,a9a9a9;darkkhaki,bdb76b;darkmagenta,8b008b;darkolivegreen,556b2f;darkorange,ff8c00;darkorchid,9932cc;darkred,8b0000;darksalmon,e9967a;darkseagreen,8fbc8f;darkslateblue,483d8b;darkslategray,2f4f4f;darkslategrey,2f4f4f;darkturquoise,00ced1;darkviolet,9400d3;deeppink,ff1493;deepskyblue,00bfff;dimgray,696969;dimgrey,696969;dodgerblue,1e90ff;firebrick,b22222;floralwhite,fffaf0;forestgreen,228b22;fuchsia,ff00ff;gainsboro,dcdcdc;ghostwhite,f8f8ff;gold,ffd700;goldenrod,daa520;gray,808080;green,008000;greenyellow,adff2f;grey,808080;honeydew,f0fff0;hotpink,ff69b4;indianred,cd5c5c;indigo,4b0082;ivory,fffff0;khaki,f0e68c;lavender,e6e6fa;lavenderblush,fff0f5;lawngreen,7cfc00;lemonchiffon,fffacd;lightblue,add8e6;lightcoral,f08080;lightcyan,e0ffff;lightgoldenrodyellow,fafad2;lightgray,d3d3d3;lightgreen,90ee90;lightgrey,d3d3d3;lightpink,ffb6c1;lightsalmon,ffa07a;lightseagreen,20b2aa;lightskyblue,87cefa;lightslategray,778899;lightslategrey,778899;lightsteelblue,b0c4de;lightyellow,ffffe0;lime,00ff00;limegreen,32cd32;linen,faf0e6;magenta,ff00ff;maroon,800000;mediumaquamarine,66cdaa;mediumblue,0000cd;mediumorchid,ba55d3;mediumpurple,9370db;mediumseagreen,3cb371;mediumslateblue,7b68ee;mediumspringgreen,00fa9a;mediumturquoise,48d1cc;mediumvioletred,c71585;midnightblue,191970;mintcream,f5fffa;mistyrose,ffe4e1;moccasin,ffe4b5;navajowhite,ffdead;navy,000080;oldlace,fdf5e6;olive,808000;olivedrab,6b8e23;orange,ffa500;orangered,ff4500;orchid,da70d6;palegoldenrod,eee8aa;palegreen,98fb98;paleturquoise,afeeee;palevioletred,db7093;papayawhip,ffefd5;peachpuff,ffdab9;peru,cd853f;pink,ffc0cb;plum,dda0dd;powderblue,b0e0e6;purple,800080;red,ff0000;rosybrown,bc8f8f;royalblue,4169e1;saddlebrown,8b4513;salmon,fa8072;sandybrown,f4a460;seagreen,2e8b57;seashell,fff5ee;sienna,a0522d;silver,c0c0c0;skyblue,87ceeb;slateblue,6a5acd;slategray,708090;slategrey,708090;snow,fffafa;springgreen,00ff7f;steelblue,4682b4;tan,d2b48c;teal,008080;thistle,d8bfd8;tomato,ff6347;turquoise,40e0d0;violet,ee82ee;wheat,f5deb3;white,ffffff;whitesmoke,f5f5f5;yellow,ffff00;yellowgreen,9acd32".split(/;/g),r={};for(const e of t){const[t,n]=e.split(",");r[t]=n,r[n]=t}return r}));function $r(t,r,e,n,o){"alpha"===t&&B(o)&&/%/.test(o)&&(e=100),Tr(n,r,e)&&q(`Expected ${t} value to be equal to or between ${r} and ${e} but got: ${B(o)?`"${o}"`:`\`${o}\``}`)}const Lr="red",Mr="green",Dr="blue",_r="alpha",xr="hue",kr="saturation",Fr="lightness";var Br;!function(t){t.fromHSLToRGB=function(t,r,e){e/=100;const n=r=>(r+t/30)%12,o=(r/=100)*Math.min(e,1-e),i=t=>e-o*Math.max(-1,Math.min(n(t)-3,Math.min(9-n(t),1)));return[Math.round(255*i(0)),Math.round(255*i(8)),Math.round(255*i(4))]},t.fromRGBToHSL=function(t,r,e){const n=t/Pr.MAX_RGB_VALUE,o=r/Pr.MAX_RGB_VALUE,i=e/Pr.MAX_RGB_VALUE,s=Math.max(n,o,i),a=Math.min(n,o,i),u=new Nr([s,a]).mean,c=s-a,l=s===a?0:u<=.5?c/(s+a):c/(2-s-a),f=0===c?1:c,h=n===s?(o-i)/f:o===s?2+(i-n)/f:4+(n-o)/f;return[Math.round(60*(h<0?h+Pr.MAX_HUE_VALUE:h)%360),Math.round(l*Pr.MAX_SATURATION_VALUE),Math.round(u*Pr.MAX_LIGHTNESS_VALUE)]},t.getLuminance=function(t,r,e){return.21*t+.72*r+.07*e},t.createContrastingValue=function({light:t,dark:r,threshold:e=127}){return n=>{B(n)&&(n=Pr.fromString(n));const o=qt(e,Pr.MIN_RGB_VALUE,Pr.MAX_RGB_VALUE);return n.luminance>=o?t:r}}}(Br||(Br={}));class Pr{static fromRGB(t,r,e,n){if(x(t))return Pr.fromRGBValues(t,r,e,n);if(B(t))return Pr.fromRGBString(t);if(k(t))return Pr.fromRGBObject(t);throw f&&q(["Invalid RGB parameter.","","Usage:",` - Values, example: ${Pr.fromRGB.name}(255, 255, 255)`,` - String, example: ${Pr.fromRGB.name}('rgb(255,255,255)')`,` - Object, example: ${Pr.fromRGB.name}({ red: 255, green: 255, blue: 255 })`].join("\n")),new Error("Invalid RGB parameter")}static fromRGBString(t){const[r,e,n,o,i,s,a,u]=function(t){if(!/^rgba?\(\s*\d{1,3}\s+\d{1,3}\s+\d{1,3}(\s+(\d+%|[\d.]+))?\s*\)$/i.test(t.replace(/[,/]/g," ")))throw new Error(`Invalid RGB string '${t}'`);t=t.replace(/[,/]/g," ");const[r,e,n,o]=t.match(/\d{1,3}\s+\d{1,3}\s+\d{1,3}(\s+(\d+%|[\d.]+))?/i)[0].split(/\s+/g);return[Number(r),r,Number(e),e,Number(n),n,o?Number(o.match(/[\d.]+/)[0]):null,null!=o?o:null]}(t);$r(Lr,...Ur.red,r,e),$r(Mr,...Ur.green,n,o),$r(Dr,...Ur.blue,i,s),u&&$r(_r,...Ur.alpha,a,u);const c=new Pr;return c.R={...c.R,red:r,green:n,blue:i,...G(u)?{}:{alpha:/%/.test(u)?a/100:a}},c}static fromRGBObject(t){const{red:r,green:e,blue:n,alpha:o}=t;return Pr.fromRGBValues(r,e,n,o)}static fromRGBValues(t,r,e,n){$r(Lr,...Ur.red,t,t),$r(Mr,...Ur.green,r,r),$r(Dr,...Ur.blue,e,e),n&&$r(_r,...Ur.alpha,n,n);const o=new Pr;return o.R={...o.R,red:t,green:r,blue:e,...G(n)?{}:{alpha:n}},o}static fromHSL(t,r,e,n){if(x(t))return Pr.fromHSLValues(t,r,e,n);if(B(t))return Pr.fromHSLString(t);if(k(t))return Pr.fromHSLObject(t);throw f&&q(["Invalid HSL parameter.","","Usage:",` - Values, example: ${Pr.fromHSL.name}(255, 100, 100)`,` - String, example: ${Pr.fromHSL.name}('hsl(0,100%,100%)')`,` - Object, example: ${Pr.fromHSL.name}({ hue: 255, saturation: 100, lightness: 100 })`].join("\n")),new Error("Invalid HSL parameter")}static fromHSLString(t){const[r,e,n,o,i,s,a,u]=function(t){if(t=t.replace(/[,/]/g," "),!/^hsla?\(\s*([\d.]+(deg|rad)?|none)\s+[\d.]+%?\s+[\d.]+%?(\s+[\d.]+%?)?\s*\)$/i.test(t))throw new Error(`Invalid HSL string '${t}'`);const[r,e,n,o]=t.match(/([\d.]+(deg|rad)?|none)\s+[\d.]+%?\s+[\d.]+%?(\s+[\d.]+%?)?/i)[0].split(/\s+/g),i=r.match(/[\d.]+/);return[(null==i?void 0:i[0])?Number(i[0]):0,r,Number(e.match(/[\d.]+/)[0]),e,Number(n.match(/[\d.]+/)[0]),n,o?Number(o.match(/[\d.]+/)[0]):null,null!=o?o:null]}(t);$r(xr,...Ur.hue,r,e),$r(kr,...Ur.saturation,n,o),$r(Fr,...Ur.lightness,i,s),u&&$r(_r,...Ur.alpha,a,u);const c=new Pr;return c.R={...c.R,hue:r,saturation:n,lightness:i,...G(u)?{}:{alpha:/%/.test(u)?a/100:a}},c}static fromHSLObject(t){const{hue:r,saturation:e,lightness:n,alpha:o}=t;return Pr.fromHSLValues(r,e,n,o)}static fromHSLValues(t,r,e,n){$r(xr,...Ur.hue,t,t),$r(kr,...Ur.saturation,r,r),$r(Fr,...Ur.lightness,e,e),n&&$r(_r,...Ur.alpha,n,n);const o=new Pr;return o.R={...o.R,hue:t,saturation:r,lightness:e,...G(n)?{}:{alpha:n}},o}static fromHex(t){const[r,e,n,o,i,s,a,u]=function(t){if(!/^#([\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/i.test(t))throw new Error(`Invalid hex code '${t}'`);if((t=t.match(/[\da-f]+/i)[0]).length<=4){const[r,e,n,o]=t;return[parseInt(`${r}${r}`,16),r,parseInt(`${e}${e}`,16),e,parseInt(`${n}${n}`,16),n,o?parseInt(`${o}${o}`,16)/255:null,null!=o?o:null]}{const[r,e,n,o,i,s,a,u]=t,c=`${r}${e}`,l=`${n}${o}`,f=`${i}${s}`,h=`${a}${u}`;return[parseInt(c,16),c,parseInt(l,16),l,parseInt(f,16),f,u?parseInt(h,16)/255:null,u?h:null]}}(t);$r(Lr,...Ur.red,r,e),$r(Mr,...Ur.green,n,o),$r(Dr,...Ur.blue,i,s),u&&$r("alpha",...Ur.alpha,a,u);const c=new Pr;return c.R={...c.R,red:r,green:n,blue:i,...G(u)?{}:{alpha:a}},c}static fromString(t){if(/^#/.test(t))return Pr.fromHex(t);if(/^rgb/i.test(t))return Pr.fromRGBString(t);if(/^hsl/i.test(t))return Pr.fromHSLString(t);throw new Error(`Invalid color syntax '${t}'`)}static fromJSON(t){if(Z(t,Lr))return Pr.fromRGBObject(t);if(Z(t,xr))return Pr.fromHSLObject(t);throw new Error(`Invalid object: ${Ct(t)}`)}constructor(){this.R={...Pr.$},this._=()=>{const[t,r,e]=Br.fromHSLToRGB(this.R.hue,this.R.saturation,this.R.lightness);this.R.red=t,this.R.green=r,this.R.blue=e},this.P=()=>{const[t,r,e]=Br.fromRGBToHSL(this.R.red,this.R.green,this.R.blue);this.R.hue=t,this.R.saturation=r,this.R.lightness=e},this.U=()=>"#"+this.red.toString(16).padStart(2,"0")+this.green.toString(16).padStart(2,"0")+this.blue.toString(16).padStart(2,"0"),this.X=()=>this.U()+Math.round(this.alpha*Pr.MAX_RGB_VALUE).toString(16).padStart(2,"0"),this.V=(t,r,e)=>{const n=[this.red,this.green,this.blue];return r&&n.push(parseFloat(this.alpha.toFixed(e))),`rgb${t?"a":""}(${n.join(", ")})`},this.Y=(t,r,e)=>{const n=[`${this.hue}deg`,`${this.saturation}%`,`${this.lightness}%`];return r&&n.push(parseFloat(this.alpha.toFixed(e))),`hsl${t?"a":""}(${n.join(", ")})`}}get isInvalid(){if(H(this.R.red)){if(!H(this.R.hue)&&(Tr(this.R.hue,...Ur.hue)||Tr(this.R.saturation,...Ur.saturation)||Tr(this.R.lightness,...Ur.lightness)))return!0}else if(Tr(this.R.red,...Ur.red)||Tr(this.R.blue,...Ur.blue)||Tr(this.R.green,...Ur.green))return!0;return!!Tr(this.R.alpha,...Ur.alpha)}get red(){return H(this.R.red)&&this._(),this.R.red}get green(){return H(this.R.green)&&this._(),this.R.green}get blue(){return H(this.R.blue)&&this._(),this.R.blue}get alpha(){return this.R.alpha}get hue(){return H(this.R.hue)&&this.P(),this.R.hue}get saturation(){return H(this.R.saturation)&&this.P(),this.R.saturation}get lightness(){return H(this.R.lightness)&&this.P(),this.R.lightness}get luminance(){return Br.getLuminance(this.red,this.green,this.blue)}toJSON(){return{red:this.red,green:this.green,blue:this.blue,alpha:this.alpha,hue:this.hue,saturation:this.saturation,lightness:this.lightness,luminance:this.luminance}}toString(t=Rr.FFFFFF,r){var e;if(this.isInvalid)return"#InvalidColor";const n=null==r?void 0:r.suppressAlphaInShortFormats;if(t===Rr.FFFFFF){if(this.alpha===Pr.MAX_ALPHA_VALUE||n)return this.U();t=Rr.FFFFFFFF}if(t===Rr.FFFFFFFF)return this.X();if(t===Rr.FFF){if(this.alpha===Pr.MAX_ALPHA_VALUE||n){let t;const r=this.U();return t=r[1]===r[2]&&r[3]===r[4]&&r[5]===r[6]?"#"+r[1]+r[3]+r[5]:r,t}t=Rr.FFFF}if(t===Rr.FFFF){let t;const r=this.X();return t=r[1]===r[2]&&r[3]===r[4]&&r[5]===r[6]&&r[7]===r[8]?"#"+r[1]+r[3]+r[5]+r[7]:r,t}const o=null!==(e=null==r?void 0:r.truncateDecimals)&&void 0!==e?e:3;if(t===Rr.RGB)return this.V(0,this.alpha===Pr.MAX_ALPHA_VALUE||n?0:1,o);if(t===Rr.RGBA)return this.V(1,1,o);if(t===Rr.HSL)return this.Y(0,this.alpha===Pr.MAX_ALPHA_VALUE||n?0:1,o);if(t===Rr.HSLA)return this.Y(1,1,o);throw new Error(`Invalid format '${t}'`)}valueOf(){return this.toString()}}Pr.MIN_ALPHA_VALUE=0,Pr.MAX_ALPHA_VALUE=1,Pr.MIN_RGB_VALUE=0,Pr.MAX_RGB_VALUE=255,Pr.MIN_HUE_VALUE=0,Pr.MAX_HUE_VALUE=360,Pr.MIN_SATURATION_VALUE=0,Pr.MAX_SATURATION_VALUE=100,Pr.MIN_LIGHTNESS_VALUE=0,Pr.MAX_LIGHTNESS_VALUE=100,Pr.$={red:null,green:null,blue:null,alpha:Pr.MAX_ALPHA_VALUE,hue:null,saturation:null,lightness:null};const Ur={red:[Pr.MIN_RGB_VALUE,Pr.MAX_RGB_VALUE],green:[Pr.MIN_RGB_VALUE,Pr.MAX_RGB_VALUE],blue:[Pr.MIN_RGB_VALUE,Pr.MAX_RGB_VALUE],alpha:[Pr.MIN_ALPHA_VALUE,Pr.MAX_ALPHA_VALUE],hue:[Pr.MIN_HUE_VALUE,Pr.MAX_HUE_VALUE],saturation:[Pr.MIN_SATURATION_VALUE,Pr.MAX_SATURATION_VALUE],lightness:[Pr.MIN_LIGHTNESS_VALUE,Pr.MAX_LIGHTNESS_VALUE]};var Xr;!function(t){t.fromCSSName=function(t){return t=t.toLowerCase(),Ir.value[t]?Pr.fromHex(`#${Ir.value[t]}`):null},t.toCSSName=function(t){var r;let e;return e=B(t)?/^#([\da-f]{6,})$/i.test(t)?t.replace("#","").substring(0,6):Pr.fromString(t).toString(Rr.FFFFFF):t.toString(Rr.FFFFFF),e&&null!==(r=Ir.value[e.replace("#","")])&&void 0!==r?r:null}}(Xr||(Xr={}));class Hr{constructor(t){t.Timestamp&&(this.Timestamp=t.Timestamp),t.DateTime&&(this.DateTime=t.DateTime),this.DateTimeToHTMLInputString=this.DateTimeToHTMLInputString.bind(this),this.DateTimeToSQLString=this.DateTimeToSQLString.bind(this),this.DateTimeToTimestamp=this.DateTimeToTimestamp.bind(this),this.HTMLInputStringToDateTime=this.HTMLInputStringToDateTime.bind(this),this.SQLStringToDateTime=this.SQLStringToDateTime.bind(this),this.TimestampToDateTime=this.TimestampToDateTime.bind(this)}DateTimeToHTMLInputString(t){return t.toFormat("yyyy-LL-dd")+"T"+t.toFormat("HH:mm")}DateTimeToSQLString(t){return t?t.toSQL():null}DateTimeToTimestamp(t){return t?this.Timestamp.fromMillis(t.toMillis()):null}HTMLInputStringToDateTime(t){return this.DateTime.fromISO(t)}SQLStringToDateTime(t){return t?this.DateTime.fromSQL(t):null}TimestampToDateTime(t){return t?this.DateTime.fromMillis(t.toMillis()):null}}class Gr{constructor(t=Gr.MINIMUM_CACHE_SIZE){this.cacheSize=t,this.W=[],this.Z=!1,t<Gr.MINIMUM_CACHE_SIZE&&q(`Expected \`cacheSize\` to be at least ${Gr.MINIMUM_CACHE_SIZE}but got ${t}. Automatically setting to ${Gr.MINIMUM_CACHE_SIZE}.`),this.cacheSize=Math.max(t,Gr.MINIMUM_CACHE_SIZE)}mark(t){t!==Gr.MAX_PROGRESS?this.W=g(this.cacheSize,[[qt(t,Gr.MIN_PROGRESS,Gr.MAX_PROGRESS),Date.now()]],this.W):this.Z=!0}getEstimation(){if(this.Z)return 0;if(this.W.length<Gr.MINIMUM_CACHE_SIZE)return 1/0;let t=0;for(let r=1;r<this.W.length;r++){const[e,n]=this.W[r-1],[o,i]=this.W[r];t+=(o-e)/(i-n)}const r=t/(this.W.length-1);if(r<=0)return 1/0;const[e]=this.W[this.W.length-1],n=(Gr.MAX_PROGRESS-e)/r;return Math.round(n)}reset(){this.Z=!1,this.W=[]}}Gr.MIN_PROGRESS=0,Gr.MAX_PROGRESS=100,Gr.MINIMUM_CACHE_SIZE=2;const jr={height:0,width:0};function Vr(){const r=t.get("screen");return{height:r.height,width:r.width}}function zr(){const r=t.get("window");return{height:r.height,width:r.width}}class Yr{constructor(t){this.element=t}observe(t){let r=null;const e=()=>{const e=this.element.getBoundingClientRect(),n={height:e.height,left:e.left,top:e.top,width:e.width};wt(r,n)||(r=n,t(n))};let n=0;const o=setInterval((()=>{e(),n++>9&&clearInterval(o)}),10),i=setInterval(e,100);return()=>{clearInterval(o),clearInterval(i)}}}var qr,Qr;function Wr(t){return t.readyState>=qr.HAVE_ENOUGH_DATA?Promise.resolve():new Promise((r=>{const e=()=>{t.removeEventListener("loadeddata",e),r()};t.addEventListener("loadeddata",e)}))}function Jr(t){return t.readyState>=qr.HAVE_ENOUGH_DATA&&!t.paused&&!t.ended}function Kr(t){return Jr(t)?Promise.resolve():new Promise((r=>{const e=()=>{t.removeEventListener("play",e),r()};t.addEventListener("play",e)}))}!function(t){t[t.HAVE_NOTHING=0]="HAVE_NOTHING",t[t.HAVE_METADATA=1]="HAVE_METADATA",t[t.HAVE_CURRENT_DATA=2]="HAVE_CURRENT_DATA",t[t.HAVE_FUTURE_DATA=3]="HAVE_FUTURE_DATA",t[t.HAVE_ENOUGH_DATA=4]="HAVE_ENOUGH_DATA"}(qr||(qr={})),function(t){t.ASCII="ascii",t.UTF_8="utf-8",t.UTF_16LE="utf-16le",t.UCS_2="ucs-2",t.BASE_64="base64",t.LATIN_1="latin1",t.BINARY="binary",t.HEX="hex"}(Qr||(Qr={}));class Zr extends Error{}class te extends Error{}function re(t,r){let e;return(...n)=>{clearTimeout(e),e=setTimeout((()=>{t(...n)}),r)}}function ee(t,r){let e;return(...n)=>(clearTimeout(e),new Promise((o=>{e=setTimeout((()=>{o(t(...n))}),r)})))}function ne(t){return new Promise((r=>{setTimeout((()=>{r()}),t)}))}function oe(t){return t<=0?Promise.resolve():new Promise((r=>{let e=0;const n=()=>{e++>=t?r():requestAnimationFrame(n)};requestAnimationFrame(n)}))}class ie{constructor(t){this.time=t}now(){return new Promise((t=>{this.tt=t,this.rt=setTimeout((()=>{t()}),this.time)}))}add(t){}cancel(){clearTimeout(this.rt),this.tt()}}class se{constructor(t){this.callback=t}start(t){this.stop(),this.et=setInterval(this.callback,t)}stop(){clearInterval(this.et)}}class ae{constructor(t,r){this.nt=()=>{if(x(this.ot))return this.ot;if(M(this.ot)){const t=this.ot();if(!x(t))throw new Error(`Generated interval is invalid: ${String(t)}`);return t}throw new Error(`Invalid interval: ${String(this.ot)}`)},this.it=async()=>{for(;this.st;){const t=this.ut(),r=ne(this.nt());await Promise.all([t,r])}},this.ut=t,this.ot=r,this.start=this.start.bind(this),this.stop=this.stop.bind(this)}async start(){this.st?q(`${ae.name} is already running.`):(this.st=!0,await this.it())}stop(){this.st=!1}}class ue{constructor(t){this.generator=t,this.ct=new Set,this.create=this.create.bind(this),this.untrack=this.untrack.bind(this),this.reset=this.reset.bind(this),this.track=this.track.bind(this)}create(...t){let r,e=0;for(r=this.generator(e,...t);this.has(r);)r=this.generator(++e,...t);return this.track(r),r}untrack(t){this.ct.delete(t)}get history(){return[...this.ct.values()]}reset(){this.ct.clear()}track(...t){for(const r of t)this.ct.add(r)}has(t){return this.ct.has(t)}}const ce={DEFAULT:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",NUMERIC:"0123456789",HEX_LOWER:"0123456789abcdef",HEX_UPPER:"0123456789ABCDEF",ALPHABET_LOWER:"abcdefghijklmnopqrstuvwxyz",ALPHABET_UPPER:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",ALPHANUMERIC_LOWER:"abcdefghijklmnopqrstuvwxyz0123456789",ALPHANUMERIC_UPPER:"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"};function le(...t){return v(t.join("").split("")).join("")}const fe=ce.ALPHABET_LOWER,he=ce.DEFAULT;class de extends ue{static create(t){let r=A(fe);for(;r.length<t;)r+=A(he);return r}constructor(t,r=.8){super(((t,e)=>{const n=Math.pow(he.length,e),o=t/n>=r;return de.create(e+(o?Math.ceil(t/n):0))})),this.minimumLength=t,this.bumpThreshold=r,this.minimumLength=Math.max(0,t)}create(t){return super.create(t||this.minimumLength)}}const pe=new de(6);class ge extends ue{static create(t,r=ce.DEFAULT){let e="";for(;e.length<t;)e+=A(r);return e}constructor(t,r,e=.8){super(((t,r,n)=>{const o=Math.pow(n.length,r),i=t/o>=e;return ge.create(r+(i?Math.ceil(t/o):0),n)})),this.minimumLength=t,this.charset=r,this.bumpThreshold=e,this.charset=r||ce.DEFAULT,this.minimumLength=Math.max(0,t)}create(t,r){return super.create(t||this.minimumLength,r||this.charset)}}class me extends ue{static create(){return[ge.create(8,ce.HEX_LOWER),ge.create(4,ce.HEX_LOWER),ge.create(4,ce.HEX_LOWER),ge.create(4,ce.HEX_LOWER),ge.create(12,ce.HEX_LOWER)].join("-")}constructor(){super(me.create)}create(){return super.create()}}class be{constructor(t,e){this.lt=new me,this.ft=new Set,this.isOccupied=new r(!1),this.activationKey=null!=t?t:be.DEFAULT_ACTIVATION_KEY,a&&1!==this.activationKey.length&&Y(`Expected chordActivationKey to be precisely 1 letter but received "${this.activationKey}" (${this.activationKey.length} letters)`),this.timeout=null!=e?e:be.DEFAULT_TIMEOUT,a&&Cr(this.timeout)&&Y(`Expected timeout to be greater than 0 but got ${this.timeout}`),this.occupyKeyChord=this.occupyKeyChord.bind(this),this.dispose=this.dispose.bind(this)}occupyKeyChord(){const t=this.lt.create();return this.ft.add(t),this.ht(),()=>{this.ft.delete(t),this.ht(),this.lt.untrack(t)}}dispose(){this.isOccupied.dispose()}ht(){this.isOccupied.set(this.ft.size>0)}}var Ee;be.DEFAULT_ACTIVATION_KEY="k",be.DEFAULT_TIMEOUT=3e3,function(t){t.Alt="Alt",t.ArrowDown="ArrowDown",t.ArrowLeft="ArrowLeft",t.ArrowRight="ArrowRight",t.ArrowUp="ArrowUp",t.Backspace="Backspace",t.Control="Control",t.CapsLock="CapsLock",t.Enter="Enter",t.Escape="Escape",t.F1="F1",t.F2="F2",t.F3="F3",t.F4="F4",t.F5="F5",t.F6="F6",t.F7="F7",t.F8="F8",t.F9="F9",t.F10="F10",t.F11="F11",t.F12="F12",t.Meta="Meta",t.Shift="Shift",t.Space=" ",t.Tab="Tab"}(Ee||(Ee={}));class ve{constructor(t,r){this.callback=t,this.triggerTime=r,this.dt=!1}run(){const t=Math.max(0,this.triggerTime.getTime()-(new Date).getTime());this.gt=setTimeout((()=>{this.callback(),this.dt=!0}),t)}cancel(){clearTimeout(this.gt),this.dt=!0}flush(){this.cancel(),this.dt||this.callback()}}class Te{constructor(){this.bt=[],this.Et=!1,this.start=this.start.bind(this),this.stop=this.stop.bind(this),this.now=this.now.bind(this)}get isRunning(){return this.Et}start(){this.Et?a&&q(`Attempted to start a ${Te.name} that has already been started`):(this.bt.push([performance.now(),null]),this.Et=!0)}stop(){if(!this.Et)return void(a&&q(`Attempted to stop a ${Te.name} that has already been stopped`));const[t]=this.bt[this.bt.length-1];this.bt[this.bt.length-1]=[t,performance.now()],this.Et=!1}now(){let t=0;for(const[r,e]of this.bt)t+=(null!=e?e:performance.now())-r;return t}}class we{constructor(){this.vt={},this.Tt=0,this.wt=0,this.Ct=0}watch(t){const r=++this.Ct;this.vt[r]=t,this.Tt+=1;return()=>{this.vt[r]&&(delete this.vt[r],this.wt+=1)}}unwatchAll(){const t=Object.keys(this.vt).length;this.vt={},this.wt+=t}refresh(...t){const r=Object.values(this.vt);for(let e=0;e<r.length;e++)r[e](...t)}get stats(){return{count:{active:this.Tt,expired:this.wt}}}}class Ce extends we{constructor(t){super(),this.watchers=[],this.unwatchList=[],this.watchers=t,this.St=this.refresh,this.refresh=()=>{throw new Error("AggregateWatcher does not allow triggering refreshes externally")};for(const t of this.watchers){const r=t.watch(((...t)=>{this.St(...t)}));this.unwatchList.push(r)}}unwatchAll(){for(const t of this.unwatchList)t();super.unwatchAll()}}class Se{static now(){throw new Zr}static fromDate(t){throw new Zr}static fromMillis(t){throw new Zr}constructor(t,r){throw new Zr}toDate(){throw new Zr}toMillis(){throw new Zr}isEqual(t){throw new Zr}toString(){return""}valueOf(){throw new Zr}}function ye(t){try{const r=t();if(U(r))return new Promise((t=>{r.then((()=>{t()}))}))}catch(t){}}const Oe=new Set("a,abbr,acronym,address,applet,area,article,aside,audio,b,base,basefont,bdi,bdo,big,blockquote,body,br,button,canvas,caption,center,cite,code,col,colgroup,data,datalist,dd,del,details,dfn,dialog,dir,div,dl,dt,em,embed,fieldset,figcaption,figure,font,footer,form,frame,frameset,h1> to <h6,head,header,hgroup,hr,html,i,iframe,img,input,ins,kbd,label,legend,li,link,main,map,mark,menu,meta,meter,nav,noframes,noscript,object,ol,optgroup,option,output,p,param,picture,pre,progress,q,rp,rt,ruby,s,samp,script,search,section,select,small,source,span,strike,strong,style,sub,summary,sup,svg,table,tbody,td,template,textarea,tfoot,th,thead,time,title,tr,track,tt,u,ul,var,video,wbr".split(","));var Ae,Ne;!function(t){t.CONNECT="CONNECT",t.DELETE="DELETE",t.GET="GET",t.HEAD="HEAD",t.OPTIONS="OPTIONS",t.PATCH="PATCH",t.POST="POST",t.PUT="PUT",t.TRACE="TRACE"}(Ae||(Ae={})),function(t){t[t.CONTINUE=100]="CONTINUE",t[t.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",t[t.PROCESSING=102]="PROCESSING",t[t.EARLY_HINTS=103]="EARLY_HINTS",t[t.OK=200]="OK",t[t.CREATED=201]="CREATED",t[t.ACCEPTED=202]="ACCEPTED",t[t.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",t[t.NO_CONTENT=204]="NO_CONTENT",t[t.RESET_CONTENT=205]="RESET_CONTENT",t[t.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",t[t.MULTI_STATUS=207]="MULTI_STATUS",t[t.ALREADY_REPORTED=208]="ALREADY_REPORTED",t[t.IM_USED=226]="IM_USED",t[t.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",t[t.FOUND=302]="FOUND",t[t.SEE_OTHER=303]="SEE_OTHER",t[t.NOT_MODIFIED=304]="NOT_MODIFIED",t[t.USE_PROXY_DEPRECATED=305]="USE_PROXY_DEPRECATED",t[t.UNUSED=306]="UNUSED",t[t.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",t[t.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",t[t.BAD_REQUEST=400]="BAD_REQUEST",t[t.UNAUTHORIZED=401]="UNAUTHORIZED",t[t.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",t[t.FORBIDDEN=403]="FORBIDDEN",t[t.NOT_FOUND=404]="NOT_FOUND",t[t.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",t[t.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",t[t.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",t[t.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",t[t.CONFLICT=409]="CONFLICT",t[t.GONE=410]="GONE",t[t.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",t[t.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",t[t.PAYLOAD_TOO_LARGE=413]="PAYLOAD_TOO_LARGE",t[t.URI_TOO_LONG=414]="URI_TOO_LONG",t[t.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",t[t.RANGE_NOT_SATISFIABLE=416]="RANGE_NOT_SATISFIABLE",t[t.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",t[t.I_AM_A_TEAPOT=418]="I_AM_A_TEAPOT",t[t.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST",t[t.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",t[t.LOCKED=423]="LOCKED",t[t.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",t[t.TOO_EARLY_EXPERIMENTAL=425]="TOO_EARLY_EXPERIMENTAL",t[t.UPGRADE_REQUIRED=426]="UPGRADE_REQUIRED",t[t.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",t[t.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",t[t.REQUEST_HEADER_FIELDS_TOO_LARGE=431]="REQUEST_HEADER_FIELDS_TOO_LARGE",t[t.UNAVAILABLE_FOR_LEGAL_REASONS=451]="UNAVAILABLE_FOR_LEGAL_REASONS",t[t.INTERNAL_ERROR=500]="INTERNAL_ERROR",t[t.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",t[t.BAD_GATEWAY=502]="BAD_GATEWAY",t[t.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",t[t.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",t[t.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",t[t.VARIANT_ALSO_NEGOTIATES=506]="VARIANT_ALSO_NEGOTIATES",t[t.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",t[t.LOOP_DETECTED=508]="LOOP_DETECTED",t[t.NOT_EXTENDED=510]="NOT_EXTENDED",t[t.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED"}(Ne||(Ne={}));class Re{constructor(){throw new te}}!function(t){var r;(r=t.State||(t.State={}))[r.CREATED=0]="CREATED",r[r.STARTING=1]="STARTING",r[r.DENIED=2]="DENIED",r[r.STARTED=3]="STARTED",r[r.RESTARTING=4]="RESTARTING",r[r.STOPPED=5]="STOPPED",r[r.DISPOSED=6]="DISPOSED"}(Re||(Re={}));const Ie=new r(!1);function $e(){throw new te}function Le(){throw new te}function Me(t,r){if(!r){let r=!1;return t.then((()=>{r=!0})),new Promise((t=>{ne(0).then((()=>{t(r)}))}))}t.then((()=>{r.current=!0}))}var De;!function(t){t.LOW="L",t.MEDIUM="M",t.QUARTILE="Q",t.HIGH="H"}(De||(De={}));const _e="// DO NOT MODIFY - THIS FILE IS AUTOMATICALLY GENERATED";class xe{createTable(t,r){return`CREATE TABLE ${t}(${r.join(",")})`}createTableIfNotExists(t,r){return`CREATE TABLE IF NOT EXISTS ${t}(${r.join(",")})`}insertInto(t,r){return`INSERT INTO ${t}(${r.join(",")})VALUES(@${r.join(",@")})`}}function ke(t){return!B(t)||t===t.toLowerCase()}function Fe(t){return!B(t)||t===t.toUpperCase()}class Be{static getWords(t){const r=t.split(/[\s_-]/g),e=[];for(const t of r)e.push(...t.split(/(\d+)/g));const n=[];for(const t of e)n.push(...t.split(/([A-Z][a-z]+)/g));return n.filter((t=>!!t))}static capitalizeFirstLetter(t,r=!1){if(!t)return"";const[e,...n]=t;let o=n.join("");return r&&(o=o.toLowerCase()),`${e.toUpperCase()}${o}`}constructor(t){this.value=t,this.words=[],this.isWordOriginatedFromMacroCase=t=>t===this.value||(new RegExp(`${t}_`).test(this.value)||new RegExp(`_${t}`).test(this.value)),this.words=Be.getWords(t)}toPascalCase(){let t="";for(let r=0;r<this.words.length;r++)t+=Be.capitalizeFirstLetter(this.words[r],this.isWordOriginatedFromMacroCase(this.words[r]));return t}toCamelCase(){var t,r;const e=this.toPascalCase();return(null!==(r=null===(t=e[0])||void 0===t?void 0:t.toLowerCase())&&void 0!==r?r:"")+e.substring(1,e.length)}toMacroCase(){return this.words.join("_").toUpperCase()}toSnakeCase(){return this.words.join("_").toLowerCase()}toKebabCase(){return this.words.join("-").toLowerCase()}toTitleCase(){const t=[];for(let r=0;r<this.words.length;r++)t.push(Be.capitalizeFirstLetter(this.words[r]));return t.join(" ")}toSpongeCase(t={}){const r=(null==t?void 0:t.useOriginalString)?this.value:this.words.join(" ");let e="";for(let n=0;n<r.length;n++)e+=((null==t?void 0:t.startWithUpperCase)?n%2!=0:n%2==0)?r[n].toLowerCase():r[n].toUpperCase();return e}}function Pe(t){return H(t)||""===t}function Ue(t){return H(t)||""===t.trim()}function Xe(t,r=2){const[e]=O(t.split(/\s/g),r);return e.map((t=>t[0])).join("")}function He(t){let r="";for(let e=0;e<t.length;e++){const n=Ge.value[t[e]];r+=X(n)?t[e]:n}return r}const Ge=new yt((()=>gt({a:"n",b:"o",c:"p",d:"q",e:"r",f:"s",g:"t",h:"u",i:"v",j:"w",k:"x",l:"y",m:"z",A:"N",B:"O",C:"P",D:"Q",E:"R",F:"S",G:"T",H:"U",I:"V",J:"W",K:"X",L:"Y",M:"Z"})));function je(t){return t.replace(/[lr]/g,"w").replace(/[LR]/g,"W")}var Ve;function ze(t,r,e){throw new te}function Ye(t){return t}!function(t){t[t.INTERNAL=-1]="INTERNAL",t[t.LOW=1]="LOW",t[t.HIGH=2]="HIGH"}(Ve||(Ve={}));const qe=/^--/,Qe=/^O/,We=/^(moz|ms|o|webkit)(?=-)/;function Je(t){if(qe.test(t))return t;Qe.test(t)&&(t=t.replace(Qe,"o-"));let r=t.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase();return r.match(We)&&(r=`-${r}`),r}function Ke(t){return x(t)?`${t}px`:t}const Ze=/(gap|height|margin|padding|position|radius|size|spacing|width)/i;function tn(t,r){return Ze.test(t)?Ke(r):String(r)}function rn(t){return/^[a-z]/.test(t)?`.${t}`:t}const en=Gt(null),nn=Gt(null);function on(t){if(!a)return!0;if(/^(\.|#)/.test(t)||Oe.has(t)||nn.current.has(t))return!0;for(const r of en.current)if(r.test(t))return!0;return!1}function sn(...t){if(a)for(const r of t)B(r)?nn.current.add(r):en.current.push(r)}function an(t){const r={};for(const e in t){const n=t[e],o=Je(e);r[o]=tn(o,n)}return r}a&&(en.current=[],nn.current=new Set),sn.displayName="ignoreWhenCompilingStyles";const un=n([e({grid:"autoplace",overrideBrowserslist:"production"===process.env.NODE_ENV?[">0.5%","not dead","not op_mini all"]:["last 3 chrome version","last 3 firefox version","last 5 safari version"]})]);function cn(t){const r=[];for(const e in t){const n=t[e],o=Je(e);r.push(`${o}:${tn(o,n)}`)}return un.process(r.join(";")).css}const ln=a?new Set:null;function fn(t,r){if(a&&!nn.current.has("*")){const r=t.split(/\s*[\s>+~,]\s*/g);for(const t of r){const r=t.replace(/:.+$/,"");ln.has(r)||(on(r)||Y(`Found unrecognized element "${r}" when compiling styles. If this was intentional or if it is a valid web component, you can suppress this warning by calling ${e=sn,n=void 0,null!==(n=e.displayName)&&void 0!==n?n:e.name}(['${r}'])`),ln.add(r))}}var e,n;return`${t}{${cn(r)}}`}function hn(t,r){const e=[];for(const r in t){const n=t[r];e.push(`--${r}:${tn(r,n)}`)}const n=e.join(";");return r?`${rn(r)}{${n}}`:n}function dn(...t){return t.filter((t=>!!t)).join(" ").trim().replace(/\s+/g," ")}const pn=dn,gn={VERY_SHORT:50,SHORT:100,MEDIUM:200,LONG:300,VERY_LONG:500,EXTRA_LONG:750,QUARTER_SECOND:750,ONE_SECOND:1e3},mn={None:0,XXS:2,XS:3,S:5,M:10,L:15,XL:20,XXL:40,XXXL:60},bn={TOP:"env(safe-area-inset-top)",LEFT:"env(safe-area-inset-left)",RIGHT:"env(safe-area-inset-right)",BOTTOM:"env(safe-area-inset-bottom)"};function En(t){return t+"px"}function vn(t){return t+"pt"}function Tn(t){return t+"em"}function wn(t){return t+"rem"}function Cn(t){return t+"fr"}function Sn(t){return t+"vh"}function yn(t){return t+"vw"}function On(t){return t+"vmin"}function An(t){return t+"vmax"}function Nn(t){return t+"%"}function Rn(){throw new te}function In(){throw new te}function $n(t,r){const e=t.querySelectorAll(r);return e.item(e.length-1)}class Ln extends Map{compile(){const t=[];return this.forEach(((r,e)=>{t.push(fn(e,r))})),t.join("")}}class Mn extends Ln{constructor(t=[],r){throw super(),this.precedenceLevel=r,new te}set(t,r){throw new te}delete(t){throw new te}clear(){throw new te}dispose(){throw new te}}const Dn={hidden:"hidden",noScroll:"noScroll",a:"a"};var _n,xn;i((()=>{ze(new Ln([[`.${Dn.hidden}`,{left:0,opacity:0,pointerEvents:"none",position:"fixed",top:0,zIndex:-9999}],[`.${Dn.noScroll}`,{overflow:"hidden"}]]).compile(),Ve.INTERNAL)})),function(t){t.dark="dark",t.light="light"}(_n||(_n={})),function(t){t.dark="dark",t.light="light",t.auto="auto"}(xn||(xn={}));const kn={spacingNone:"var(--spacingNone)",spacingXXXS:"var(--spacingXXXS)",spacingXXS:"var(--spacingXXS)",spacingXS:"var(--spacingXS)",spacingS:"var(--spacingS)",spacingM:"var(--spacingM)",spacingL:"var(--spacingL)",spacingXL:"var(--spacingXL)",spacingXXL:"var(--spacingXXL)",spacingXXXL:"var(--spacingXXXL)",durationVeryShort:"var(--durationVeryShort)",durationShort:"var(--durationShort)",durationMedium:"var(--durationMedium)",durationLong:"var(--durationLong)",durationVeryLong:"var(--durationVeryLong)",durationExtraLong:"var(--durationExtraLong)",primaryColor:"var(--primaryColor)",primaryColorLighter:"var(--primaryColorLighter)",primaryColorDarker:"var(--primaryColorDarker)",primaryColor20:"var(--primaryColor20)",primaryColor40:"var(--primaryColor40)",primaryColor60:"var(--primaryColor60)",primaryColor80:"var(--primaryColor80)",primaryTextColor:"var(--primaryTextColor)",primaryTextColorLighter:"var(--primaryTextColorLighter)",primaryTextColorDarker:"var(--primaryTextColorDarker)",appBgColor:"var(--appBgColor)",appBgColor2:"var(--appBgColor2)",appBgColor3:"var(--appBgColor3)",appBgColor4:"var(--appBgColor4)",appTextColor:"var(--appTextColor)",appTextColor2:"var(--appTextColor2)",appTextColor3:"var(--appTextColor3)",appTextColor4:"var(--appTextColor4)",appTextColorStrong:"var(--appTextColorStrong)",separatorColor:"var(--separatorColor)",separatorColor2:"var(--separatorColor2)",separatorColor3:"var(--separatorColor3)",separatorColor4:"var(--separatorColor4)",neutralColor:"var(--neutralColor)",infoColor:"var(--infoColor)",successColor:"var(--successColor)",warnColor:"var(--warnColor)",errorColor:"var(--errorColor)",dangerColor:"var(--dangerColor)",inputElementBorderRadius:"var(--inputElementBorderRadius)",inputElementBorderSize:"var(--inputElementBorderSize)",interactionAnimationDuration:"var(--interactionAnimationDuration)",interactiveEnabledCursor:"var(--interactiveEnabledCursor)",interactiveDisabledCursor:"var(--interactiveDisabledCursor)"},Fn={busyShadeA:"var(--busyShadeA)",busyShadeB:"var(--busyShadeB)",inputBorderColor:"var(--inputBorderColor)",progressBg:"var(--progressBg)",switchBackground:"var(--switchBackground)",switchBorderColor:"var(--switchBorderColor)",switchDisabledBackground:"var(--switchDisabledBackground)",switchThumbStretchSize:"var(--switchThumbStretchSize)",thumbColor:"var(--thumbColor)",buttonDisabledColor:"var(--buttonDisabledColor)"},Bn="#2b80ff",Pn=Pr.fromHex(Bn);class Un{constructor(t,r,e={}){this.colorScheme=t,this.customValues=e,this.internalValues={};const n=t===_n.light,o={...n?Un.DEFAULT_LIGHT_BASE_PALETTE:Un.DEFAULT_DARK_BASE_PALETTE,...null==r?void 0:r.basePalette},{primaryColor:i,appBgColor:s,appTextColor:a,separatorColor:u}=o,c=Pr.fromString(i),l=Xn(c,1.1).toString(),f=Xn(c,.9).toString(),h=Pr.fromString(s),d=Pr.fromString(a),p=Pr.fromString(u);this.palette={...o,primaryColorLighter:l,primaryColorDarker:f,primaryColor20:`${i}20`,primaryColor40:`${i}40`,primaryColor60:`${i}60`,primaryColor80:`${i}80`,primaryTextColor:i,primaryTextColorLighter:l,primaryTextColorDarker:f,appBgColor2:Xn(h,n?.9:1.1).toString(),appBgColor3:Xn(h,n?.8:1.2).toString(),appBgColor4:Xn(h,n?.7:1.3).toString(),appTextColor2:Xn(d,n?1.1:.9).toString(),appTextColor3:Xn(d,n?1.2:.8).toString(),appTextColor4:Xn(d,n?1.3:.7).toString(),appTextColorStrong:n?"#000000":"#ffffff",separatorColor2:Xn(p,n?1.1:.9).toString(),separatorColor3:Xn(p,n?1.2:.8).toString(),separatorColor4:Xn(p,n?1.3:.7).toString()},this.spacing={...Un.DEFAULT_SPACING,...null==r?void 0:r.spacing},this.duration={...Un.DEFAULT_DURATION,...null==r?void 0:r.duration},this.componentParameters={...Un.DEFAULT_COMPONENT_PARAMETERS,...null==r?void 0:r.componentParameters};const g="#808080";this.internalValues={busyShadeA:"#80808040",busyShadeB:"#808080"+(n?"00":"20"),inputBorderColor:g,progressBg:"#000000"+(n?"10":"40"),switchBackground:n?"#4b4b4b40":"#00000000",switchBorderColor:n?"#80808040":g,switchDisabledBackground:n?"#80808020":"#00000000",switchThumbStretchSize:"5px",thumbColor:n?"#ffffff":"#eeeeee",buttonDisabledColor:n?"#b5b5b5":"#4b4b4b"}}}function Xn(t,r){return Pr.fromHSL({hue:t.hue,saturation:t.saturation,lightness:t.lightness*r})}Un.DEFAULT_LIGHT_BASE_PALETTE={primaryColor:Bn,appBgColor:"#eeeeee",appTextColor:"#4b4b4b",separatorColor:"#808080",neutralColor:Pr.fromHSL({hue:Pn.hue,saturation:.15*Pn.saturation,lightness:Math.min(1.2*Pn.lightness,100)}).toString(),infoColor:"#00cccc",successColor:"#008000",warnColor:"#ee6600",errorColor:"#ff3333",dangerColor:"#ff4a4a"},Un.DEFAULT_DARK_BASE_PALETTE={primaryColor:Bn,appBgColor:"#111111",appTextColor:"#b5b5b5",separatorColor:"#808080",neutralColor:Pr.fromHSL({hue:Pn.hue,saturation:.15*Pn.saturation,lightness:.4*Pn.lightness}).toString(),infoColor:"#00cccc",successColor:"#00aa00",warnColor:"#ff8000",errorColor:"#ff4b4b",dangerColor:"#ff6666"},Un.DEFAULT_SPACING={None:0,XXXS:1,XXS:2,XS:3,S:5,M:10,L:15,XL:20,XXL:40,XXXL:60},Un.DEFAULT_DURATION={VERY_SHORT:50,SHORT:100,MEDIUM:200,LONG:300,VERY_LONG:500,EXTRA_LONG:750},Un.DEFAULT_COMPONENT_PARAMETERS={inputElementBorderRadius:5,inputElementBorderSize:2,interactionAnimationDuration:"150ms",interactiveEnabledCursor:"pointer",interactiveDisabledCurso