/*
    MIT License
*/
!function(u,k,D){function f(a,b,c){var d,g={};a=a.replace(E,function(a,b,c,d,e,f){g["."==b?(g[b="class"]&&(c=g[b]+" "+c),b):"#"==b?"id":c]=f?e.slice(1,-1):e||c;return""})||"div";d=(r[a]||(r[a]=k.createElement(a))).cloneNode(!0).set(g);return c?(n[a]&&d.setAttribute("data-call",a),d):n[a]&&n[a].call(d,b)||d.set(b)}function p(a,b){var c,d=0,g=typeof a;if(a){if("string"==g||"number"==g)a=f.text(a);else if(!("nodeType"in a)&&"length"in a){g=a.length;for(c=k.createDocumentFragment();d<g;)p.call(c,a[d++]);
a=c}a.nodeType&&this.insertBefore(a,(!0===b?this.firstChild:"number"==typeof b?this.childNodes[0>b?this.childNodes.length-b-2:b]:b)||null);a.appendHook&&a.appendHook()}return this}function v(a){return-1<(" "+this.className+" ").indexOf(" "+a+" ")}function w(a){this.className+=this.className?v.call(this,a)?"":" "+a:a;return this}function F(a){this.className=(" "+this.className+" ").replace(" "+a+" "," ").trim();return this}function G(a,b){1==arguments.length&&(b=!v.call(this,a));return(b?w:F).call(this,
a),b}function H(){this.parentNode&&this.parentNode.removeChild(this);Event.removeAll&&Event.removeAll(this);this.killHook&&this.killHook();this.empty&&this.empty();return this}function x(a,b){var c=this;if(1==arguments.length){if(a&&a.constructor===Object){Object.each(a,function(a,b){x.call(c,b,a)});return}return c.getAttribute(a)}c.setAttribute(a,b)}function y(a,b){var c,d=this;if(c=!b&&d.getAttribute("data-call"))d.removeAttribute("data-call"),n[c].call(d);if(c=!b&&d.getAttribute("data-bind"))if(d.getAttribute("lang"),
"{"==c.charAt(0)&&(c='txt:"'+c.replace(/"/g,'\\"')+'"'),c="n d p r->d&&("+c.replace(M,"(p['$1']?(r=p['$1'](n,d,$2)||r):(n['$1']=$2.format(d))),")+"r)",Fn(c)(d,a,N))return d;for(d=d.firstChild;d;d=d.nextSibling)1==d.nodeType&&y.call(d,a);return this}function O(a){var b=["_"];(a=a.replace(E,function(a,d,g,e,f,h,l){h&&(f=f.slice(1,-1));f&&(l=f.length,f=f.replace(/'/g,"\\'"));b.push("."==d?"(' '+_.className+' ').indexOf(' "+g+" ')>-1":"#"==d?"_.id=='"+g+"'":":"==d&&P[g]||"(a=_.getAttribute('"+g+"'))"+
(!e&&f?"=='"+f+"'":""));e&&b.push("^"==e?"a.slice(0,"+l+")=='"+f+"'":"|"==e?"a.split('-')[0]=='"+f+"'":"$"==e?"a.slice(-"+l+")=='"+f+"'":"~"==e?"(' '+a+' ').indexOf(' "+f+" ')>-1":"a.indexOf('"+f+"')>-1");return""}))&&"*"!=a&&b.unshift("_.nodeName=='"+a.toUpperCase()+"'");return b.join("&&")}function Q(a){return I[a]||(I[a]=Function("_,a","return "+a))}function z(a){this._nodes=a}function A(a,b,c){r[a]="string"==typeof b?f(b):b;c&&(n[a]=c)}function t(a){function b(a,c,h,l,m,k){for(m=c.length;m<=e[0];)e.shift(),
d=d.plugin?d.plugin.done():d.parentNode;h?t.plugins[l]?(d=(new t.plugins[l](d,k)).el,e.unshift(m)):d.append(f.text("text"==l?k:a)):(l&&(d=f(l,0,1).to(d),e.unshift(m)),k&&(m=k.charAt(0),">"==m?(c+" "+k.slice(1)).replace(J,b):"="==m?d.set({"data-bind":k.slice(1)}):d.append(k.replace(/\\([=>:])/g,"$1"))))}var c=k.createDocumentFragment(),d=c,e=[-1];a.replace(J,b);c=c.childNodes;if(1==c.length)return c[0];e=[];for(d=c.length;d--;)e[d]=c[d];return e}function B(a,b){this.name=b;this.parent=a;this.el=f("div");
this.el.plugin=this;return this}function h(a,b){return h[b?C(b):q][a]||a}function C(a){if(!a)return q;a=(a||"").toLowerCase();return h[a]?a:(a=a.split("-")[0],h[a])?a:q}function K(a,b){Object.merge(h[a]||(h[a]={}),b)}var q,L="textContent"in k.body?"textContent":"innerText",r={},n={},e=(u.HTMLElement||u.Element||f)[D],I={},E=/([.#:[])([-\w]+)(?:([~^$*|]?)=((["'\/])(?:\\?.)*?\5|[-\w]+)])?]?/g,R=/(\s*[>+]?\s*)((["'\/])(?:\\?.)*?\2|[^\s+>])+$/,P={empty:"!_.hasChildNodes()","first-child":"_.parentNode&&_.parentNode.firstChild==_",
"last-child":"_.parentNode&&_.parentNode.lastChild==_",link:"_.nodeName=='A'&&_.getAttribute('href')"},J=/^([ \t]*)(@?)((?:(["'\/])(?:\\?.)*?\4|[-\w\:.#\[\]=])+)[ \t]*(.*)$/gm,M=/[;\s]*(\w+)(?:\s*\:((?:(["'\/])(?:\\?.)*?\3|[-,\s\w])*))?/g,N=f.bindings={"class":function(a,b,c,d){G.call(a,c,d.fn("_")(b))},html:function(a,b,c){a.innerHTML=c.format(b)},txt:function(a,b,c){a.txt(c.format(b))},val:function(a,b,c){a.val(c.format(b))}};u.El=f;e.append=p;e.after=function(a,b){p.call(a.parentNode,this,b?a:
a.nextSibling);return this};e.to=function(a,b){p.call(a,this,b);return this};e.hasClass=v;e.addClass=w;e.rmClass=F;e.toggleClass=G;e.empty=function(){for(var a;a=this.firstChild;)H.call(a);return this};e.kill=H;e.on=function(a,b){Event.add(this,a,b);return this};e.non=function(a,b){Event.remove(this,a,b);return this};e.attr=x;e.set=function(a,b,c){if(a)if("object"==typeof a)for(b in a)c=a[b],"class"==b?w.call(this,c):"string"==typeof c?x.call(this,b,c):c||this.removeAttribute(b);else p.call(this,
a);return this};e.render=y;e.txt=function(a){return arguments.length?this[L]=a:this[L]};e.val=function(a){var b=this,c=b.type,d=b.options;if(arguments.length)return b.value=a;if("select-multiple"==c){a=[];for(c=0;b=d[c++];)!b.selected||b.disabled||b.parentNode.disabled||a.push(b.value);return a}return"checkbox"!=c&&"radio"!=c||b.checked?b.value||options&&options[b.selectedIndex].value||"on":""};e.matches=e.matches||function(a){var b,c,d=a.replace(R,function(a,d,e,f,g){c=g+d.length;b=d.trim();return""}),
e="+"==b?this.previousSibling:this.parentNode;return Q(O(a.slice(c)))(this)?d?b?e&&e.matches&&e.matches(d)||!1:!!(e&&e.closest&&e.closest(d)):!0:!1};e.closest=e.closest||function(a){for(var b=this;b;b=b.parentNode)if(b.matches&&b.matches(a))return b;return null};e.find=e.querySelector;e.findAll=function(a){return new z(this.querySelectorAll(a))};f.wrap=z;z.prototype=Object.keys(e).reduce(function(a,b){a[b]=function(){for(var a=this._nodes,d=0,f=a.length;d<f;)e[b].apply(a[d++],arguments);return this};
return a},{});f[D]=e;f.get=function(a){"string"==typeof a&&(a=k.getElementById(a));return a};A._el=r;A._fn=n;f.cache=A;f.text=function(a){return k.createTextNode(a)};B.prototype.done=function(){f.cache(this.name,this.el.removeChild(this.el.firstChild),y);this.el.plugin=null;return this.parent};t.plugins={template:B};f.create=f.tpl=function(a){return t(a).render()};f.include=function(a,b,c){b=f.get(a);(new B(null,a)).el.append(f.tpl(b.innerHTML)).plugin.done();b.kill()};f.i18n=h;h.get=C;h.use=function(a){a=
C(a);q!=(q=a)&&(h[a]=h[a]||{});return k.documentElement.lang=a};h.add=K;h.def=function(a){Object.each(a,function(b,c){K(c,a)})}}(window,document,"prototype");
