gotty/js/dist/gotty-bundle.js

3 lines
604 KiB
JavaScript
Raw Normal View History

2022-02-26 20:08:53 -05:00
/*! For license information please see gotty-bundle.js.LICENSE.txt */
2023-11-10 14:25:24 -05:00
(()=>{var e={276:e=>{"use strict";if(void 0!==t)throw new Error('Global "lib" object already exists.');var t={runtimeDependencies_:{},initCallbacks_:[],rtdep:function(e){var i;try{throw new Error}catch(e){var r=e.stack.split("\n");i=r.length>=3?r[2].replace(/^\s*at\s+/,""):r[1].replace(/^\s*global code@/,"")}for(var s=0;s<arguments.length;s++){var o=arguments[s];if(o instanceof Array)t.rtdep.apply(t,o);else{var n=this.runtimeDependencies_[o];n||(n=this.runtimeDependencies_[o]=[]),n.push(i)}}},ensureRuntimeDependencies_:function(){var e=!0;for(var i in t.runtimeDependencies_)for(var r=t.runtimeDependencies_[i],s=i.split("."),o=window||self,n=0;n<s.length;n++){if(!(s[n]in o)){console.warn('Missing "'+i+'" is needed by',r),e=!1;break}o=o[s[n]]}if(!e)throw new Error("Failed runtime dependency check")},registerInit:function(e,i){return t.initCallbacks_.push([e,i]),i},init:function(e,i){var r=t.initCallbacks_,s=function(){if(r.length){var o=r.shift();i&&i("init: "+o[0]),o[1](t.f.alarm(s))}else e()};if("function"!=typeof e)throw new Error("Missing or invalid argument: onInit");t.ensureRuntimeDependencies_(),setTimeout(s,0)}};String.prototype.padStart||(String.prototype.padStart=function(e,t){return(e-=this.length)<=0?String(this):(void 0===t&&(t=" "),e>t.length&&(t=t.repeat(e/t.length+1)),t.slice(0,e)+String(this))}),String.prototype.padEnd||(String.prototype.padEnd=function(e,t){return(e-=this.length)<=0?String(this):(void 0===t&&(t=" "),e>t.length&&(t=t.repeat(e/t.length+1)),String(this)+t.slice(0,e))}),t.colors={},t.colors.re_={hex16:/#([a-f0-9])([a-f0-9])([a-f0-9])/i,hex24:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/i,rgb:new RegExp("^/s*rgb/s*/(/s*(/d{1,3})/s*,/s*(/d{1,3})/s*,/s*(/d{1,3})/s*/)/s*$".replace(/\//g,"\\"),"i"),rgba:new RegExp("^/s*rgba/s*/(/s*(/d{1,3})/s*,/s*(/d{1,3})/s*,/s*(/d{1,3})/s*(?:,/s*(/d+(?:/./d+)?)/s*)/)/s*$".replace(/\//g,"\\"),"i"),rgbx:new RegExp("^/s*rgba?/s*/(/s*(/d{1,3})/s*,/s*(/d{1,3})/s*,/s*(/d{1,3})/s*(?:,/s*(/d+(?:/./d+)?)/s*)?/)/s*$".replace(/\//g,"\\"),"i"),x11rgb:/^\s*rgb:([a-f0-9]{1,4})\/([a-f0-9]{1,4})\/([a-f0-9]{1,4})\s*$/i,name:/[a-z][a-z0-9\s]+/},t.colors.rgbToX11=function(e){function i(e){return e=(257*Math.min(e,255)).toString(16),t.f.zpad(e,4)}var r=e.match(t.colors.re_.rgbx);return r?"rgb:"+i(r[1])+"/"+i(r[2])+"/"+i(r[3]):null},t.colors.x11HexToCSS=function(e){if(!e.startsWith("#"))return null;if(e=e.substr(1),-1==[3,6,9,12].indexOf(e.length))return null;if(e.match(/[^a-f0-9]/i))return null;var i=e.length/3,r=e.substr(0,i),s=e.substr(i,i),o=e.substr(i+i,i);return t.colors.arrayToRGBA([r,s,o].map((function(e){return e=parseInt(e,16),2==i?e:1==i?e<<4:e>>4*(i-2)})))},t.colors.x11ToCSS=function(e){var i=e.match(t.colors.re_.x11rgb);return i?(i.splice(0,1),t.colors.arrayToRGBA(i.map((function(e){return 1==e.length?parseInt(e+e,16):2==e.length?parseInt(e,16):(3==e.length&&(e+=e.substr(2)),Math.round(parseInt(e,16)/257))})))):e.startsWith("#")?t.colors.x11HexToCSS(e):t.colors.nameToRGB(e)},t.colors.hexToRGB=function(e){var i=t.colors.re_.hex16,r=t.colors.re_.hex24;function s(e){4==e.length&&(e=e.replace(i,(function(e,t,i,r){return"#"+t+t+i+i+r+r})));var t=e.match(r);return t?"rgb("+parseInt(t[1],16)+", "+parseInt(t[2],16)+", "+parseInt(t[3],16)+")":null}if(e instanceof Array)for(var o=0;o<e.length;o++)e[o]=s(e[o]);else e=s(e);return e},t.colors.rgbToHex=function(e){function i(e){var i=t.colors.crackRGB(e);return i?"#"+t.f.zpad((parseInt(i[0])<<16|parseInt(i[1])<<8|parseInt(i[2])<<0).toString(16),6):null}if(e instanceof Array)for(var r=0;r<e.length;r++)e[r]=i(e[r]);else e=i(e);return e},t.colors.normalizeCSS=function(e){return e.startsWith("#")?t.colors.hexToRGB(e):t.colors.re_.rgbx.test(e)?e:t.colors.nameToRGB(e)},t.colors.arrayToRGBA=function(e){var t=e.length>3?e[3]:1;return"rgba("+e[0]+", "+e[1]+", "+e[2]+", "+t+")"},t.colors.setAlpha=function(e,i){var r=t.colors.crackRGB(e);return r[3]=i,t.colors.arrayToRGBA(r)},t.colors.mix=function(e,i,r){for(var s=t.colors.crackRGB(e),o=t.colors.crackRGB(i),n=0;n<4;++n){var a=o[n]-s[n];s[n]=Math.round(parseInt(s[n])+a*r)}return t.colors.arrayToRG
2022-02-26 20:08:53 -05:00
//# sourceMappingURL=gotty-bundle.js.map