text: (function(){var G="undefined"!==typeof module&&module.exports?"node":"browser",e={ENV:G},w=function(a){var b=Object.prototype.toString,c=typeof a;if("object"===c){if(a){if(-1!==b.call(a).indexOf("HTML")&&-1!==b.call(a).indexOf("Element"))return"element";if(a instanceof Array||!(a instanceof Object)&&"[object Array]"===b.call(a)||"number"===typeof a.length&&"undefined"!==typeof a.splice&&"undefined"!==typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if(!(a instanceof Object||
  "[object Function]"!==b.call(a)&&("undefined"===typeof a.call||"undefined"===typeof a.propertyIsEnumerable||a.propertyIsEnumerable("call"))))return"function"}return"object"}return"function"===c&&"undefined"===typeof a.call?"object":c},E=function(a){return"undefined"!==w(a)},y=function(a){return null===w(a)||null===a},k=function(a){return!y(a)&&"string"===w(a)},z=function(a){return""!==a&&!y(a)&&E(a)&&!isNaN(a)&&"number"===w(a)},O=function(a){return z(a)&&isFinite(a)&&Math.floor(a)===a},n=function(a){return!y(a)&&
  "array"===w(a)},q=function(a){return!y(a)&&"object"===w(a)},H=function(a){return a instanceof Date&&!isNaN(a.valueOf())},P=function(a){return a&&"node"===G&&a._root?!0:!y(a)&&"element"===w(a)},I=function(a){return!E(a)||y(a)||k(a)&&""===a||n(a)&&"[]"===JSON.stringify(a)||q(a)&&"{}"===JSON.stringify(a)},p=function(a,b){if(!a||!b)return!1;var c=!0;E(a[b])||(c=b in a);return c},J=function(a,b){var c=!0;if(I(a)&&I(b))return!0;if(H(a)&&H(b))return a.getTime()===b.getTime();if(z(a)&&z(b)||k(a)&&k(b))return a===
  b;if(n(a)&&n(b)){if(a.length!==b.length)return!1;if(0<a.length)for(var d=0,f=a.length;d<f;d++)if(!J(a[d],b[d])){c=!1;break}}else if(q(a)&&q(b)){var d=[],f=[],g;for(g in a)p(a,g)&&d.push(g);for(var l in b)p(b,l)&&f.push(l);if(d.length!==f.length)return!1;for(var r in a)if(!p(b,r)||!J(a[r],b[r])){c=!1;break}}return c};e.isDef=E;e.isNull=y;e.isString=k;e.isNumber=z;e.isInteger=O;e.isBoolean=function(a){return!0===a||!1===a};e.isArray=n;e.isObject=q;e.isDate=H;e.isFunction=function(a){return!y(a)&&"function"===
  w(a)};e.isElement=P;e.isEmpty=I;e.isLetter=function(a){var b=/^[a-z]+$/i;return k(a)&&b.test(a)};e.isEmail=function(a){var b=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;return k(a)&&b.test(a)};e.isGeneratedKey=function(a){var b=/^[A-Z0-9]+$/i;return k(a)&&b.test(a)};e.hasProperty=p;e.equals=J;var C=function(a,b){if(!k(a))return"";var c=a?a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,""):a||"";return c&&b?c.replace(/\r?\n|\r/g," ").replace(/\s\s+|\r/g," "):c},Q=function(a){return k(a)?
  a.toLowerCase():""},R=function(a){if(!k(a))return"";if(1===a.length)return a.toUpperCase();a=a.toLowerCase();return a.charAt(0).toUpperCase()+a.slice(1)},S=function(a,b,c){a=String(a);b=b||2;return a.length>=b?a:Array(b-a.length+1).join(c||"0")+a};e.encode=function(a){return k(a)?encodeURIComponent(a):""};e.decode=function(a){return k(a)?decodeURIComponent(a.replace(/\+/g," ")):""};e.trim=C;e.truncate=function(a,b){a=C(a);if(!a)return a;var c=b||140;if(a.length<=c)return a;var d=a.substring(0,c),
  f=d.split(" "),g="";1<f.length?(f.pop(),g+=f.join(" "),g.length<a.length&&(g+="...")):(d=d.substring(0,c-3),g=d+"...");return g};e.stripTags=function(a){if(!k(a))return"";(a=a.replace(/<.*?>/gi," "))&&(a=C(a.replace(/\s\s+/g," ")));return a};e.escapeHTML=function(a){return k(a)?a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"):""};e.unescapeHTML=function(a){return k(a)?a.replace(/&quot;/g,'"').replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&"):""};
  e.strtolower=Q;e.strtoupper=function(a){return k(a)?a.toUpperCase():""};e.ucfirst=R;e.ucwords=function(a){if(!k(a))return"";var b=[];a.split(" ").forEach(function(a){b.push(R(a))});return b.join(" ")};e.leftPad=S;e.rightPad=function(a,b,c){a=String(a);b=b||2;return a.length>=b?a:a+Array(b-a.length+1).join(c||"0")};e.repeat=function(a,b){if(!a||!k(a))return"";if(!O(b)||1>b)return a;for(var c=[];c.length<b;)c.push(a);return c.join("")};var K=function(a,b){for(var c=[];10>c.length;)c.push(Math.random().toString(36).slice(2));
  for(var c=c.join(""),d=c.length,f=b||"",g=Math.max(a||32,f.length);f.length<g;)f+=c.charAt(Math.floor(Math.random()*d))||"";return f},L=function(a,b){if(!a||0>a)a=0;b||(b=9007199254740991);if(a===b)return b;a>b&&(a=Math.min(a,b),b=Math.max(a,b));return Math.floor(Math.random()*(b-a+1))+a},T=function(a,b,c){if(n(a))for(var d=0;d<a.length;d++){var f=a[d];if(c&&f[c]===b[c]||f===b)return!0}else{if(q(a)&&k(b))return p(a,b);if(k(a)&&k(b))return a.includes(b)}return!1},M=function(a,b){for(var c=-1,d=0;d<
  a.length;d++)if(a[d]===b){c=d;break}return c},B=function(a){if(!(a instanceof Object))return a;var b;b=a.constructor;switch(b){case RegExp:b=new b(a);break;case Date:b=new b(a.getTime());break;default:b=new b}for(var c in a)b[c]=B(a[c]);return b},U=function(a,b,c,d){c=c||!1;d=d||[];for(var f in a)if(!(0<d.length&&T(d,f))&&(!c||c&&b.hasOwnProperty(f))){var g=a[f],l=b[f];q(l)&&q(g)||n(l)&&n(g)?b[f]=U(g,b[f],c,d):b[f]=B(g)}return b},V=function(a,b,c){var d;return function(){var f=c&&!d;clearTimeout(d);
  d=setTimeout(function(){d=null;c||a()},b||200);f&&a()}};e.id=K();e.createId=K;e.random=L;e.min=function(a){return n(a)?Math.min.apply({},a):a};e.max=function(a){return n(a)?Math.max.apply({},a):a};e.unique=function(a){if(n(a)){for(var b=[],c=0;c<a.length;c++)-1===b.indexOf(a[c])&&b.push(a[c]);return b}return a||[]};e.contains=T;e.first=function(a){return a[0]};e.last=function(a){return a[a.length-1]};e.getIndex=M;e.getLastIndex=function(a,b){for(var c=-1,d=a.length-1;0<=d;d--)if(a[d]===b){c=d;break}return c};
  e.sort=function(a,b){var c=[],d={},f=b||1;if(n(a)&&0<a.length)if(c=B(a),d=c[0],1===f||-1===f)c.sort(function(a,b){return a>b?f:a<b?-1*f:0});else if(k(f)&&p(d,f))c.sort(function(a,b){return a[f]>b[f]?1:a[f]<b[f]?-1:0});else if(q(f)){var g={},l;for(l in f)g.key=l,p(d,g.key)&&(g.order=-1===f[g.key]?-1:1,c.sort(function(a){return function(b,c){return b[a.key]>c[a.key]?a.order:b[a.key]<c[a.key]?-1*a.order:0}}(g))),g={key:g.key,order:g.order}}return c};e.shuffle=function(a){a=B(a);var b,c,d;for(d=a.length-
  1;0<=d;d--)b=Math.floor(Math.random()*d),c=a[d-1],a[d-1]=a[b],a[b]=c;return a};e.pick=function(a,b){var c=b?Math.min(b,a.length):1;1>c&&(c=1);if(c>=a.length)return a;if(1===c)return c=L(0,a.length-1),a[c];for(var d=[],f=B(a);d.length<c;){var g=L(0,f.length-1);d.push(f[g]);f.splice(g,1)}return d};e.empty=function(a){if(n(a)){for(var b=a.length-1;0<=b;b--)a[b]=null,delete a[b];a.length=0}else if(q(a))for(b in a)e.hasProperty(a,b)&&(a[b]=null,delete a[b]);else k(a)?a="":P(a)&&(a.innerHTML="");return a};
  e.copies=U;e.clone=B;e.debounce=V;e.throttle=function(a,b){return V(a,b,!0)};e.md5=function(){for(var a=[],b=0;64>b;)a[b]=0|4294967296*Math.abs(Math.sin(++b));return function(b){var d,f,g,l,e=[];b=unescape(encodeURI(b));for(var h=b.length,t=[d=1732584193,f=-271733879,~d,~f],x=0;x<=h;)e[x>>2]|=(b.charCodeAt(x)||128)<<8*(x++%4);e[b=16*(h+8>>6)+14]=8*h;for(x=0;x<b;x+=16){h=t;for(l=0;64>l;)h=[g=h[3],(d=h[1]|0)+((g=h[0]+[d&(f=h[2])|~d&g,g&d|~g&f,d^f^g,f^(d|~g)][h=l>>4]+(a[l]+(e[[l,5*l+1,3*l+5,7*l][h]%
  16+x]|0)))<<(h=[7,12,17,22,5,9,14,20,4,11,16,23,6,10,15,21][4*h+l++%4])|g>>>32-h),d,f];for(l=4;l;)t[--l]=t[l]+h[l]}for(b="";32>l;)b+=(t[l>>3]>>4*(1^l++&7)&15).toString(16);return b}}();var D=function(a,b,c){z(a)&&(a=String(a));if(!a||!k(a))return"";z(b)&&(b=String(b));z(c)&&(c=String(c));if(k(b)&&k(c))a=a.split(b).join(c);else if(n(b)&&k(c))b.forEach(function(b){a=D(a,b,c)});else if(n(b)&&n(c)&&b.length===c.length){var d=b.length;if(0<d)for(var f=0;f<d;f++)a=D(a,b[f],c[f])}return a},W=function(a){if(z(a))return String(a);
  if(!k(a))return"";var b={a:"\u00e1|\u00e0|\u1ea3|\u00e3|\u1ea1|\u0103|\u1eaf|\u1eb7|\u1eb1|\u1eb3|\u1eb5|\u00e2|\u1ea5|\u1ea7|\u1ea9|\u1eab|\u1ead|\u00e4",A:"\u00c1|\u00c0|\u1ea2|\u00c3|\u1ea0|\u0102|\u1eae|\u1eb6|\u1eb0|\u1eb2|\u1eb4|\u00c2|\u1ea4|\u1ea6|\u1ea8|\u1eaa|\u1eac|\u00c4",c:"\u00e7",C:"\u00c7",d:"\u0111",D:"\u0110",e:"\u00e9|\u00e8|\u1ebb|\u1ebd|\u1eb9|\u00ea|\u1ebf|\u1ec1|\u1ec3|\u1ec5|\u1ec7|\u00eb",E:"\u00c9|\u00c8|\u1eba|\u1ebc|\u1eb8|\u00ca|\u1ebe|\u1ec0|\u1ec2|\u1ec4|\u1ec6|\u00cb",
  i:"\u00ed|\u00ec|\u1ec9|\u0129|\u1ecb|\u00ef|\u00ee",I:"\u00cd|\u00cc|\u1ec8|\u0128|\u1eca|\u00cf|\u00ce",o:"\u00f3|\u00f2|\u1ecf|\u00f5|\u1ecd|\u00f4|\u1ed1|\u1ed3|\u1ed5|\u1ed7|\u1ed9|\u01a1|\u1edb|\u1edd|\u1edf|\u1ee1|\u1ee3|\u00f6",O:"\u00d3|\u00d2|\u1ece|\u00d5|\u1ecc|\u00d4|\u1ed0|\u1ed2|\u1ed4|\u00d4|\u1ed8|\u01a0|\u1eda|\u1edc|\u1ede|\u1ee0|\u1ee2|\u00d6",u:"\u00fa|\u00f9|\u1ee7|\u0169|\u1ee5|\u01b0|\u1ee9|\u1eeb|\u1eed|\u1eef|\u1ef1|\u00fb",U:"\u00da|\u00d9|\u1ee6|\u0168|\u1ee4|\u01af|\u1ee8|\u1eea|\u1eec|\u1eee|\u1ef0|\u00db",
  y:"\u00fd|\u1ef3|\u1ef7|\u1ef9|\u1ef5",Y:"\u00dd|\u1ef2|\u1ef6|\u1ef8|\u1ef4"},c;for(c in b)if(p(b,c))for(var d=b[c].split("|"),f=0;f<d.length;f++)a=D(a,d[f],c);return a};e.replaceAll=D;e.stripAccent=W;e.createAlias=function(a,b){a=String(a);var c=W(a);if(c)var d=b||"-",c=Q(c),c=C(c),c=c.replace(/\W+/g," "),c=c.replace(/\s+/g," "),c=c.replace(/\s/g,d);return c};e.template=function(a,b){var c=[],d=function(a,b,l){l&&c.push(l);l=[];for(var e in b)if(p(b,e)){var h=b[e];if(q(h)||n(h))l.push({key:e,data:h});
  else if(k(h)){var h=D(h,["{","}"],["&#123;","&#125;"]),t=c.concat([e]),t=new RegExp("{"+t.join(".")+"}","gi");a=a.replace(t,h)}}0<l.length&&l.forEach(function(b){a=d(a,b.data,b.key)});return C(a,!0)};return b&&(k(b)||q(b)||n(b))?d(a,b):a};var N=function(){return new Date},A=function(){return N().getTime()};(function(){var a="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),b="January February March April May June July August September October November December".split(" "),c=function(){var a=
  (new Date).getTimezoneOffset();return["GMT",0>a?"+":"-",S(Math.abs(a/60),4)].join("")}(),d=function(f,d){var e=!1,r,h;d=d?(new Date(d)).getTime():A();f&&k(f)||(f="D, M d, Y  h:i:s A");f.match(/(\.*)a{1}(\.*)*/i)&&(e=!0);var t=function(a){return String(10>a?"0"+a:a)};r=d instanceof Date?d:new Date(d);if(isNaN(r.getTime()))if(/^(\d+-\d+-\d+)\s(\d+:\d+:\d+)$/i.test(d))r=new Date(d.replace(" ","T"));else return d+" !";h={Y:function(){return r.getFullYear()},y:function(){return(h.Y()+"").slice(-2)},F:function(){return b[h.n()-
  1]},M:function(){return(h.F()+"").slice(0,3)},m:function(){return t(h.n())},n:function(){return r.getMonth()+1},S:function(){var a=h.j()+" ",a=a.charAt(a.length-2);return"1"===a?"st":"2"===a?"nd":"3"===a?"rd":"th"},j:function(){return r.getDate()},d:function(){return t(h.j())},t:function(){return(new Date(h.Y(),h.n(),0)).getDate()},w:function(){return r.getDay()},l:function(){return a[h.w()]},D:function(){return(h.l()+"").slice(0,3)},G:function(){return r.getHours()},g:function(){return h.G()%12||
  12},h:function(){return t(e?h.g():h.G())},i:function(){return t(r.getMinutes())},s:function(){return t(r.getSeconds())},a:function(){return 11<h.G()?"pm":"am"},A:function(){return h.a().toUpperCase()},O:function(){return c}};return f.replace(/\.*\\?([a-z])/gi,function(a,b){return h[a]?h[a]():b})};e.now=N;e.time=A;e.date={utc:function(a){return(new Date(a||N())).toUTCString()},local:function(a){return d("D, j M Y h:i:s O",a)},strtotime:function(a){return(new Date(a)).getTime()},format:d,relativize:function(a){var b=
  a instanceof Date?a:new Date(a);a=new Date-b;b=parseInt(b,10);isNaN(b)&&(b=0);if(a<=b)return"Just now";var b=null,c={millisecond:1,second:1E3,minute:60,hour:60,day:24,month:30,year:12},d;for(d in c)if(a<c[d])break;else b=d,a/=c[d];a=Math.floor(a);1!==a&&(b+="s");return[a,b].join(" ")+" ago"}}})();(function(){var a=new Map,b,c=function(a,b){var c=a.match(/^(\d+)\s?(d|h|m|s)+$/i);if(c){var d=c,c=0,e=A()-b;if(d){var f=parseInt(d[1],10),d=d[2];"s"===d?c=1E3:"m"===d?c=6E4:"h"===d?c=36E5:"d"===d&&(c=864E5);
  c=c*f-e}else c=-1;return c}if(c=a.match(/^(sun|mon|tue|wed|thu|fri|sat)+\w*\s+(\d+)(:\d+)?(:\d+)?$/i)){var g=c,f="sun mon tue wed thu fri sat".split(" "),c=new Date,e=c.getDay(),e=M(f[e],f),d=g[1].toLowerCase(),k=M(d,f),n=d=f=0;g[2]&&(f=parseInt(g[2],10));g[3]&&(d=parseInt(g[3].replace(/\D/gi,""),10));g[4]&&(n=parseInt(g[4].replace(/\D/gi,""),10));c.setHours(f);c.setMinutes(d);c.setSeconds(n);var q=c.getTime(),g=A(),p=c;if(k<e||g>q)c=new Date(c),c.setDate(c.getDate()+e+7-c.getDay()%7),p=c;p.setHours(f);
  p.setMinutes(d);p.setSeconds(n);return p.getTime()-g}if(c=a.match(/^(\*|\d+)\s+(\*|\d+)\s+(\*|\d+)\s+(\*|\d+)\s+(\*|\d+)\s+(\d+)$/i)){var g=c,c="*"===g[1]?"*":parseInt(g[1],10),e="*"===g[2]?"*":parseInt(g[2],10),f="*"===g[3]?"*":parseInt(g[3],10),d="*"===g[4]?"*":parseInt(g[4],10),n="*"===g[5]?"*":parseInt(g[5],10),v="*"===g[6]?"*":parseInt(g[6],10),u=new Date,m=u.getFullYear();if("*"!==c&&c<m)c=-1;else{var g=c,k=e,q=f,p=d,w=n;"*"===c&&(g=m);m=u.getMonth()+1;"*"===e&&(k=m);m=u.getDate();"*"===f&&
  (q=m);m=u.getHours();"*"===d&&(p=m);u=u.getMinutes();"*"===n&&(w=u);v=new Date(g,k-1,q,p,w,v);m=v.getTime();u=A();m-=u;0>m&&"*"===n&&(v.setMinutes(w+1),m=v.getTime(),m-=u);0>m&&"*"===d&&(v.setHours(p+1),m=v.getTime(),m-=u);0>m&&"*"===f&&(v.setDate(q+1),m=v.getTime(),m-=u);0>m&&"*"===e&&(v.setMonth(k),m=v.getTime(),m-=u);0>m&&"*"===c&&(v.setFullYear(g+1),m=v.getTime(),m-=u);c=m}return c}return-1},d=function(b){b.fn();var c=b.id;if(!b.repeat)return a["delete"](c);var d=A();b.lastTick=d;a.set(c,b);return!0},
  f=function(){if(0<a.size){var e=2147483647,g=[];a.forEach(function(b){var d=b.id,f=c(b.time,b.lastTick);0>f?a["delete"](d):0===f?(b.delay=0,g.push(b)):(b.delay=f,a.set(d,b),f<=e&&(e=f,d=[],d=g.concat(b),g=d.filter(function(a){return a.delay<=e})))});b&&clearTimeout(b);g.length&&(b=setTimeout(function(){g.map(d);setTimeout(f,1)},e))}},g=function(b,c,d){d=d?0:1;var e=A(),g=K(32);a.set(g,{id:g,fn:c,time:b,repeat:d,createdAt:e,lastTick:e,delay:0});f()};e.scheduler={yearly:function(a,b){g("* "+a,b)},monthly:function(a,
  b){g("* * "+a,b)},daily:function(a,b){g("* * * "+a,b)},hourly:function(a,b){return g("* * * * "+a,b)},every:function(a,b){return g(a,b)},once:function(a,b){return g(a,b,1)}}})();if("node"===G)module.exports=e;else{var F=window||{};F.define&&F.define.amd&&F.define(function(){return e});F.Bella=e}})();