New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

absurd

Package Overview
Dependencies
Maintainers
1
Versions
150
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

absurd - npm Package Compare versions

Comparing version 0.2.70 to 0.2.71

client-side/lib/01.common/common.js

36

client-side/build/absurd.js

@@ -207,2 +207,3 @@ /* version: 0.2.70 */

}
return this;
}

@@ -292,2 +293,3 @@ var HTMLSource = false;

}
return this;
};

@@ -301,2 +303,3 @@ var appended = false

next();
return this;
}

@@ -331,2 +334,3 @@ var cache = { events: {} };

next();
return this;
}

@@ -373,3 +377,4 @@ var async = { funcs: {}, index: 0 };

next();
}
}
return this;
}

@@ -397,2 +402,3 @@ api.async = function() {

absurd.components.events.on(event, this[event] || function() {}, this);
return this;
};

@@ -418,15 +424,19 @@ api.populate = function(options) {

], this);
return api;
return this;
};
api.utils = {
str2DOMElement: str2DOMElement,
addEventListener: addEventListener,
queue: queue,
compileHTML: function(HTML, data, callback) {
absurd.flush().morph("html").add(HTML).compile(callback, data);
},
compileCSS: function(CSS, data, callback) {
absurd.flush().add(CSS).compile(callback, data);
}
}
api.str2DOMElement = str2DOMElement;
api.addEventListener = addEventListener;
api.queue = queue;
api.compileHTML = function(HTML, callback, data) {
absurd.flush().morph("html").add(HTML).compile(callback, data);
};
api.compileCSS = function(CSS, callback, options) {
absurd.flush().add(CSS).compile(callback, options);
};
api.qs = function(selector, parent) {
return (parent || this.el || document).querySelector(selector);
};
api.qsa = function(selector, parent) {
return (parent || this.el || document).querySelectorAll(selector);
};
return api;

@@ -433,0 +443,0 @@ };

@@ -1,1 +0,1 @@

var Absurd=function(){var b={api:{},helpers:{},plugins:{},processors:{css:{plugins:{}},html:{plugins:{},helpers:{}},component:{plugins:{}}}},d=function(a){return a.indexOf("css/CSS.js")>0||"/../CSS.js"==a?b.processors.css.CSS:a.indexOf("html/HTML.js")>0?b.processors.html.HTML:a.indexOf("component/Component.js")>0?b.processors.component.Component:"js-beautify"==a?{html:function(a){return a}}:"./helpers/PropAnalyzer"==a?b.processors.html.helpers.PropAnalyzer:"../../helpers/TransformUppercase"==a?b.helpers.TransformUppercase:"./helpers/TemplateEngine"==a?b.processors.html.helpers.TemplateEngine:"../helpers/Extend"==a?b.helpers.Extend:"../helpers/Clone"==a?b.helpers.Clone:"../helpers/Prefixes"==a||"/../../../helpers/Prefixes"==a?b.helpers.Prefixes:function(){}},e="",f=function(a,b){!function c(){a.length>0&&a.shift().apply(b||{},[c].concat(Array.prototype.slice.call(arguments,0)))}()},g=function(a,b){var c;try{c=(b||document).querySelectorAll(a)}catch(d){c=document.querySelectorAll(a)}return c},h=function(a){var b={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[1,"<div>","</div>"]};b.optgroup=b.option,b.tbody=b.tfoot=b.colgroup=b.caption=b.thead,b.th=b.td;var c=document.createElement("div"),d=/<\s*\w.*?>/g.exec(a);if(null!=d){var c,e=d[0].replace(/</g,"").replace(/>/g,""),f=b[e]||b._default;a=f[1]+a+f[2],c.innerHTML=a;for(var g=f[0]+1;g--;)c=c.lastChild}else c.innerHTML=a,c=c.lastChild;return c},i=function(a,b,c){return a.addEventListener?(a.addEventListener(b,c,!1),!0):a.attachEvent?a.attachEvent("on"+b,c):void 0},j=function(a){for(var b,c=a.childNodes,d=c.length,e=0,f=/^\s*$/;d>e;e++)b=c[e],3==b.nodeType&&f.test(b.nodeValue)&&(a.removeChild(b),e--,d--);return a},k=function(b,c,d){for(var e=document.createElement(b),f=0;f<c.length,a=c[f];f++)e.setAttribute(a.name,a.value);return e.innerHTML=d,e},l=function(a,c,d,e){var l=b.helpers.Extend({__name:a},e),m=b.helpers.Extend,n=[];l.listeners=n,l.on=function(a,b,c){return n[a]||(n[a]=[]),n[a].push({callback:b,scope:c}),this},l.off=function(a,b){return n[a]?(b||(n[a]=[]),this):this},l.dispatch=function(a,b,c){if(!b||"object"!=typeof b||b instanceof Array||(b.target=this),n[a])for(var e=0;e<n[a].length;e++){var f=n[a][e].callback;f.apply(c||n[a][e].scope||{},[b])}return this[a]&&"function"==typeof this[a]&&this[a](b),d&&d.dispatch(a,b),this};var o={};l.set=function(a,b){return o[a]=b,this},l.get=function(a){return o[a]};var p=!1;l.__handleCSS=function(b){this.css?c.flush().add(this.css).compile(function(c,d){if(p)p.raw!==d&&(p.raw=d,p.element.innerHTML=d);else{var e=k("style",[{name:"id",value:a+"-css"},{name:"type",value:"text/css"}],d);(g("head")||g("body"))[0].appendChild(e),p={raw:d,element:e}}b()}):b()};var q=!1;l.__mergeDOMElements=function(a,b){if(j(a),j(b),"undefined"!=typeof a&&"undefined"!=typeof b&&!a.isEqualNode(b)){if(a.nodeName!==b.nodeName)return a.parentNode&&a.parentNode.replaceChild(b,a),void 0;if(a.nodeValue!==b.nodeValue&&(a.nodeValue=b.nodeValue),a.attributes){for(var c,d,e=a.attributes,f=b.attributes,g={},h=0;h<e.length,c=e[h];h++){for(var i=0;i<f.length,d=f[i];i++)c.name===d.name&&(a.setAttribute(c.name,d.value),g[c.name]=!0);g[c.name]||a.removeAttribute(c.name)}for(var h=0;h<f.length,d=f[h];h++)g[d.name]||a.setAttribute(d.name,d.value)}var k=[];if(a.childNodes.length>=b.childNodes.length)for(var h=0;h<a.childNodes.length;h++)b.childNodes[h]||b.appendChild(document.createTextNode("")),k.push([a.childNodes[h],b.childNodes[h]]);else for(var h=0;h<b.childNodes.length;h++)a.appendChild(document.createTextNode("")),k.push([a.childNodes[h],b.childNodes[h]]);for(var h=0;h<k.length;h++)l.__mergeDOMElements(k[h][0],k[h][1])}},l.__handleHTML=function(a){var b=this,d=function(){c.flush().morph("html").add(q).compile(function(c,d){b.el?l.__mergeDOMElements(b.el,h(d)):b.el=h(d),a()},b)};if(this.html)if("string"==typeof this.html){if(!this.el){var e=g(this.html);this.el=e[0],q={"":this.el.outerHTML.replace(/&lt;/g,"<").replace(/&gt;/g,">")}}d()}else"object"==typeof this.html?(q=m({},this.html),d()):a();else a()};var r=!1;l.__append=function(a){!r&&this.el&&this.get("parent")&&(r=!0,this.get("parent").appendChild(this.el)),a()};var s={events:{}};l.__handleEvents=function(a){if(this.el){var b=this,c=function(a){var c=a.getAttribute("data-absurd-event");c=c.split(":"),c.length>=2&&(!s.events[c[0]]||s.events[c[0]].indexOf(a)<0)&&(s.events[c[0]]||(s.events[c[0]]=[]),s.events[c[0]].push(a),i(a,c[0],function(a){"function"==typeof b[c[1]]&&b[c[1]](a)}))};this.el.hasAttribute&&this.el.hasAttribute("data-absurd-event")&&c(this.el);for(var d=this.el.querySelectorAll?this.el.querySelectorAll("[data-absurd-event]"):[],e=0;e<d.length;e++)c(d[e])}a()};var t={funcs:{},index:0};return l.__handleAsyncFunctions=function(a){if(this.el){var b=[];if(this.el.hasAttribute&&this.el.hasAttribute("data-absurd-async"))b.push(this.el);else for(var c=this.el.querySelectorAll?this.el.querySelectorAll("[data-absurd-async]"):[],d=0;d<c.length;d++)b.push(c[d]);if(0===b.length)a();else{var e=this;!function f(){if(0===b.length)a();else{var c=b.shift(),d=c.getAttribute("data-absurd-async"),g=function(a){"string"==typeof a?c.parentNode.replaceChild(h(a),c):c.parentNode.replaceChild(a,c),f()};"function"==typeof e[t.funcs[d].name]?e[t.funcs[d].name].apply(e,[g].concat(t.funcs[d].args)):"function"==typeof t.funcs[d].func&&t.funcs[d].func.apply(e,[g].concat(t.funcs[d].args))}}()}}else a()},l.async=function(){var a=Array.prototype.slice.call(arguments,0),b=a.shift(),c="_"+t.index++;return t.funcs[c]={args:a,name:b},'<script data-absurd-async="'+c+'"></script>'},l.child=function(){var a=Array.prototype.slice.call(arguments,0),b=this.get("children"),c=b&&b[a.shift()],d="_"+t.index++;return t.funcs[d]={args:a,func:function(a){c.populate({callback:function(b){a(b.html.element)}})}},'<script data-absurd-async="'+d+'"></script>'},l.wire=function(a){c.components.events.on(a,this[a]||function(){},this)},l.populate=function(a){return f([l.__handleCSS,l.__handleHTML,l.__append,l.__handleEvents,l.__handleAsyncFunctions,function(){t={funcs:{},index:0};var b={css:p,html:{element:this.el}};this.dispatch("populated",b),a&&"function"==typeof a.callback&&a.callback(b)}],this),l},l.utils={str2DOMElement:h,addEventListener:i,queue:f,compileHTML:function(a,b,d){c.flush().morph("html").add(a).compile(d,b)},compileCSS:function(a,b,d){c.flush().add(a).compile(d,b)}},l},m=function(){return function(a){var d=function(a,b){for(var c in b)hasOwnProperty.call(b,c)&&(a[c]=b[c]);return a},e={defaultProcessor:b.processors.css.CSS()},f={},g={},h={},i={};e.getRules=function(a){return"undefined"==typeof a?f:("undefined"==typeof f[a]&&(f[a]=[]),f[a])},e.getPlugins=function(){return h},e.getStorage=function(){return g},e.flush=function(){return f={},g=[],i={},e.defaultProcessor=b.processors.css.CSS(),e},e.import=function(){return e.callHooks("import",arguments)?e:e},e.addHook=function(a,b){i[a]||(i[a]=[]);for(var d=!1,e=0;c=i[a][e];e++)c===b&&(d=!0);d===!1?i[a].push(b):null},e.callHooks=function(a,b){if(i[a])for(var d=0;c=i[a][d];d++)if(c.apply(e,b)===!0)return!0;return!1},e.numOfAddedRules=0,e.components=function(a){var c=b.helpers.Extend,d=b.helpers.Clone,e={},f=[],g=c({},l());return{events:g,register:function(b,h){return e[b]=function(){var e=c({},l(b,a,g,d(h)));return a.di.resolveObject(e),f.push(e),"function"==typeof e.constructor&&e.constructor.apply(e,Array.prototype.slice.call(arguments,0)),e}},get:function(a){if(e[a])return e[a];throw new Error("There is no component with name '"+a+"'.")},remove:function(a){return e[a]?(delete e[a],!0):!1},list:function(){var a=[];for(var b in e)a.push(b);return a},flush:function(){return e={},f=[],this},broadcast:function(a,b){for(var c=0;c<f.length,instance=f[c];c++)"function"==typeof instance[a]&&instance[a](b);return this}}}(e),e.component=function(a){return function(b,c){return"undefined"==typeof c?a.components.get(b):a.components.register(b,c)}}(e),e.di=b.DI(e),e.compile=function(a,b){if(e.callHooks("compile",arguments))return e;var c={combineSelectors:!0,minify:!1,processor:e.defaultProcessor,keepCamelCase:!1,api:e};b=d(c,b||{}),b.processor(e.getRules(),a||function(){},b),e.flush()};for(var j in b.api)"compile"!==j&&(e[j]=b.api[j](e),e[j]=function(a){return function(){var c=b.api[a](e);return e.callHooks(a,arguments)?e:c.apply(e,arguments)}}(j));for(var k in b.processors.css.plugins)e.plugin(k,b.processors.css.plugins[k]());return"function"==typeof a&&a(e),"undefined"!=typeof Organic&&Organic.init(e),e}};b.DI=function(){var a={dependencies:{},register:function(a,b){return this.dependencies[a]=b,this},resolve:function(){var a,b,c,d=this,e=!1;"string"==typeof arguments[0]?(a=arguments[1],b=arguments[0].replace(/ /g,"").split(","),c=arguments[2]||{}):(a=arguments[0],b=a.toString().match(/^function\s*[^\(]*\(\s*([^\)]*)\)/m)[1].replace(/ /g,"").split(","),c=arguments[1]||{});for(var f=0;f<b.length;f++)"undefined"!=typeof this.dependencies[b[f]]&&(e=!0);return e?function(){for(var e=[],f=Array.prototype.slice.call(arguments,0),g=0;g<b.length;g++){var h=b[g];e.push(d.dependencies[h]&&""!=h?d.dependencies[h]:f.shift())}return a.apply(c,e)}:a},resolveObject:function(a){if("object"==typeof a)for(var b in a)"function"==typeof a[b]?a[b]=this.resolve(a[b],a):a[b]instanceof Array&&2==a[b].length&&"string"==typeof a[b][0]&&"function"==typeof a[b][1]&&(a[b]=this.resolve(a[b][0],a[b][1],a));return this},flush:function(){return this.dependencies={},this}};return a},b.api.add=function(a){var b=(d("../helpers/Extend"),d("../helpers/Prefixes")),c=[],e=function(c,d,e,g,h){var i=b.nonPrefixProp(d),j=a.getPlugins()[i.prop];if("undefined"!=typeof j){var k=j(a,e,i.prefix);return k&&f(c,k,g,h),!0}return!1},f=function(a,d,g,h){if(g=g||"mainstream",/, ?/g.test(a))for(var i=a.replace(/, /g,",").split(","),j=0;j<i.length,p=i[j];j++)f(p,d,g,h);else if("undefined"==typeof d.length||"object"!=typeof d){if(!e(null,a,d,g,h)){var k={},l=a,m={},n={};for(var o in d){var q=typeof d[o];"object"!==q&&"function"!==q?e(a,o,d[o],g,h)===!1&&(l="undefined"!=typeof h?h+" "+a:a,k[o]=d[o],b.addPrefixes(o,k)):"object"===q?m[o]=d[o]:"function"===q&&(n[o]=d[o])}c.push({selector:l,props:k,stylesheet:g});for(var o in m)if(":"===o.charAt(0))f(a+o,m[o],g,h);else if(/&/g.test(o))if(/, ?/g.test(o))for(var i=o.replace(/, /g,",").split(","),j=0;j<i.length,p=i[j];j++)p.indexOf("&")>=0?f(p.replace(/&/g,a),m[o],g,h):f(p,m[o],g,"undefined"!=typeof h?h+" "+a:a);else f(o.replace(/&/g,a),m[o],g,h);else 0===o.indexOf("@media")||0===o.indexOf("@supports")?f(a,m[o],o,h):0===a.indexOf("@media")||0===o.indexOf("@supports")?f(o,m[o],a,h):e(a,o,m[o],g,h)===!1&&f(o,m[o],g,(h?h+" ":"")+a);for(var o in n){var r={};r[o]=n[o](),f(a,r,g,h)}}}else for(var j=0;j<d.length,o=d[j];j++)f(a,o,g,h)},g=function(b,d){c=[],a.numOfAddedRules+=1;var e=a.defaultProcessor.type;for(var g in b)f(g,b[g],d||"mainstream");for(var h=0;h<c.length;h++){var d=c[h].stylesheet,g=c[h].selector,i=c[h].props,j=a.getRules(d),k=j[g]||{};for(var l in i){var m=i[l];"object"!=typeof m&&(k[l]="css"==e?"+"===m.toString().charAt(0)?k&&k[l]?k[l]+", "+m.substr(1,m.length-1):m.substr(1,m.length-1):">"===m.toString().charAt(0)?k&&k[l]?k[l]+" "+m.substr(1,m.length-1):m.substr(1,m.length-1):m:m)}j[g]=k}return a};return g};var n=d("../helpers/Extend");b.api.compile=function(a){return function(){for(var b=null,c=null,d=null,e=0;e<arguments.length;e++)switch(typeof arguments[e]){case"function":c=arguments[e];break;case"string":b=arguments[e];break;case"object":d=arguments[e]}var f={combineSelectors:!0,minify:!1,keepCamelCase:!1,processor:a.defaultProcessor,api:a};d=n(f,d||{}),d.processor(a.getRules(),function(d,e){if(null!=b)try{s.writeFile(b,e,function(a){c(a,e)})}catch(d){c.apply({},arguments)}else c.apply({},arguments);a.flush()},d)}},b.api.compileFile=function(a){return a.compile};var q=function(a,b){a=String(a).replace(/[^0-9a-f]/gi,""),a.length<6&&(a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),b=b||0;var c,d,e="#";for(d=0;3>d;d++)c=parseInt(a.substr(2*d,2),16),c=Math.round(Math.min(Math.max(0,c+c*b),255)).toString(16),e+=("00"+c).substr(c.length);return e};b.api.darken=function(){return function(a,b){return q(a,-(b/100))}},b.api.define=function(a){return function(b,c){return a.getStorage().__defined||(a.getStorage().__defined={}),a.getStorage().__defined[b]=c,a}},b.api.hook=function(a){return function(b,c){return a.addHook(b,c),a}};var q=function(a,b){a=String(a).replace(/[^0-9a-f]/gi,""),a.length<6&&(a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),b=b||0;var c,d,e="#";for(d=0;3>d;d++)c=parseInt(a.substr(2*d,2),16),c=Math.round(Math.min(Math.max(0,c+c*b),255)).toString(16),e+=("00"+c).substr(c.length);return e};b.api.lighten=function(){return function(a,b){return q(a,b/100)}};var r={html:function(a){a.defaultProcessor=d(e+"/../processors/html/HTML.js")(),a.hook("add",function(b,c){return a.getRules(c||"mainstream").push(b),!0})},component:function(a){a.defaultProcessor=d(e+"/../processors/component/Component.js")(),a.hook("add",function(b){b instanceof Array||(b=[b]);for(var d=0;d<b.length,c=b[d];d++)a.getRules("mainstream").push(c);return!0})}};b.api.morph=function(a){return function(b){return r[b]&&(a.flush(),r[b](a)),a}},b.api.plugin=function(a){var b=function(b,c){return a.getPlugins()[b]=c,a};return b},b.api.raw=function(a){return function(b){var c={},d={},e="____raw_"+a.numOfAddedRules;return d[e]=b,c[e]=d,a.add(c),a}};{var s=d("fs");d("path")}b.api.rawImport=function(a){var b=function(b){var c=s.readFileSync(b,{encoding:"utf8"});a.raw(c)};return function(c){var d,e,f;if("string"==typeof c)b(c);else for(e=0,f=c.length;f>e;e++)d=c[e],b(d);return a}},b.api.register=function(a){return function(b,c){return a[b]=c,a}},b.api.storage=function(a){var b=a.getStorage(),c=function(d,e){if("undefined"!=typeof e)b[d]=e;else{if("object"!=typeof d){if(b[d])return b[d];throw new Error("There is no data in the storage associated with '"+d+"'")}for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&c(f,d[f])}return a};return c},b.helpers.Clone=function M(a){if(!a)return a;var b,c=[Number,String,Boolean];if(c.forEach(function(c){a instanceof c&&(b=c(a))}),"undefined"==typeof b)if("[object Array]"===Object.prototype.toString.call(a))b=[],a.forEach(function(a,c){b[c]=M(a)});else if("object"==typeof a)if(a.nodeType&&"function"==typeof a.cloneNode)var b=a.cloneNode(!0);else if(a.prototype)b=a;else if(a instanceof Date)b=new Date(a);else{b={};for(var d in a)b[d]=M(a[d])}else b=a;return b},b.helpers.ColorLuminance=function(a,b){a=String(a).replace(/[^0-9a-f]/gi,""),a.length<6&&(a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),b=b||0;var c,d,e="#";for(d=0;3>d;d++)c=parseInt(a.substr(2*d,2),16),c=Math.round(Math.min(Math.max(0,c+c*b),255)).toString(16),e+=("00"+c).substr(c.length);return e},b.helpers.Extend=function(){for(var a=function(a,b){for(var c in b)hasOwnProperty.call(b,c)&&(a[c]=b[c]);return a},b=arguments[0],c=1;c<arguments.length;c++)b=a(b,arguments[c]);return b};var t=function(a){var b,c;return(c=a.match(/^\-(w|m|s|o)+\-/)||"-"===a.charAt(0))?null!==c&&c[0]?(b={prefix:c[0].replace(/-/g,"")},b.prop=a.replace(c[0],"")):(b={prefix:""},b.prop=a.substr(1,a.length)):b={prefix:!1,prop:a},b};b.helpers.Prefixes={addPrefixes:function(a,b){var c=a,d=t(a),e=b[a];d.prefix!==!1&&(delete b[c],b[d.prop]=e,(""===d.prefix||d.prefix.indexOf("w")>=0)&&(b["-webkit-"+d.prop]=e),(""===d.prefix||d.prefix.indexOf("m")>=0)&&(b["-moz-"+d.prop]=e),(""===d.prefix||d.prefix.indexOf("s")>=0)&&(b["-ms-"+d.prop]=e),(""===d.prefix||d.prefix.indexOf("o")>=0)&&(b["-o-"+d.prop]=e))},nonPrefixProp:function(a){var b=t(a);return b.prefix!==!1&&(b.prefix=""==b.prefix?"-":"-"+b.prefix+"-"),b}},b.helpers.RequireUncached=function(a){return delete d.cache[d.resolve(a)],d(a)},b.helpers.TransformUppercase=function(a){for(var b="",d=0;c=a.charAt(d);d++)b+=c===c.toUpperCase()&&c.toLowerCase()!==c.toUpperCase()?"-"+c.toLowerCase():c;return b};var u=function(a,b,f){var g="",h="",i=[],j=f.api;cssPreprocessor=d(e+"/../css/CSS.js")(),htmlPreprocessor=d(e+"/../html/HTML.js")();for(var k=function(a){for(var b=0;b<i.length,component=i[b];b++)"function"==typeof component&&(component=component()),j.add(component.css?component.css:{});cssPreprocessor(j.getRules(),function(b,c){g+=c,a(b)},f)},l=function(b){var c=0,d=null,e=function(){if(c>a.length-1)return b(d),void 0;var g=a[c];"function"==typeof g&&(g=g()),j.morph("html").add(g.html?g.html:{}),htmlPreprocessor(j.getRules(),function(a,b){h+=b,c+=1,d=a,e()},f)};e()},m=function(a){for(var b in a)if("_include"===b)if(a[b]instanceof Array)for(var d=0;d<a[b].length,c=a[b][d];d++)"function"==typeof c&&(c=c()),i.push(c),m(c);else"function"==typeof a[b]&&(a[b]=a[b]()),i.push(a[b]),m(a[b]);else"object"==typeof a[b]&&m(a[b])},n=0;n<a.length,c=a[n];n++)"function"==typeof c&&(c=c()),i.push(c),m(c);j.flush(),k(function(a){j.morph("html"),l(function(c){b(a||c?{error:{css:a,html:c}}:null,g,h)})})};b.processors.component.Component=function(){var a=function(a,b,c){u(a.mainstream,b,c)};return a.type="component",a};var w="\n",x={combineSelectors:!0,minify:!1,keepCamelCase:!1},y=d("../../helpers/TransformUppercase"),z=function(a,b){var c="";for(var d in a)if(0===d.indexOf("____raw"))c+=a[d][d]+w;else{var e=d+" {"+w;for(var f in a[d]){var g=a[d][f];""===g&&(g='""'),e+=b&&b.keepCamelCase===!0?" "+f+": "+g+";"+w:" "+y(f)+": "+g+";"+w}e+="}"+w,c+=e}return c},A=function(a){var b={},c={};for(var d in a){var e=a[d];for(var f in e){var g=e[f];b[f]||(b[f]={}),b[f][g]||(b[f][g]=[]),b[f][g].push(d)}}for(var f in b){var h=b[f];for(var g in h){var i=h[g];c[i.join(", ")]||(c[i.join(", ")]={});var d=c[i.join(", ")];d[f]=g}}return c},B=function(a){return a=a.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g,""),a=a.replace(/ {2,}/g," "),a=a.replace(/ ([{:}]) /g,"$1"),a=a.replace(/([;,]) /g,"$1"),a=a.replace(/ !/g,"!")},C=function(a,b){if(b&&b.api&&b.api.getStorage().__defined){var c=b.api.getStorage().__defined;for(var d in c){var e=new RegExp("<%( )?"+d+"( )?%>","g");a="function"!=typeof c[d]?a.replace(e,c[d]):a.replace(e,c[d]())}}return a};b.processors.css.CSS=function(){var a=function(a,b,c){c=c||x;var d="";for(var e in a){var f=a[e];f=c.combineSelectors?A(f):f,d+="mainstream"===e?z(f,c):e+" {"+w+z(f,c)+"}"+w}return d=C(d,c),c.minify?(d=B(d),b&&b(null,d)):b&&b(null,d),d};return a.type="css",a},b.processors.css.plugins.charset=function(){return function(a,b){"string"==typeof b?a.raw('@charset: "'+b+'";'):"object"==typeof b&&(b=b.charset.replace(/:/g,"").replace(/'/g,"").replace(/"/g,"").replace(/ /g,""),a.raw('@charset: "'+b+'";'))}},b.processors.css.plugins.document=function(){return function(a,b){if("object"==typeof b){var c="";if(c+="@"+b.vendor+"document",c+=" "+b.document,b.rules&&b.rules.length)for(var d=0;rule=b.rules[d];d++)a.handlecssrule(rule,c);else"undefined"!=typeof b.styles&&a.add(b.styles,c)}}},b.processors.css.plugins.keyframes=function(){return function(a,b){var c=d(e+"/../CSS.js")(),f=d(e+"/../../../helpers/Prefixes");if("object"==typeof b)if("undefined"!=typeof b.frames){for(var g in b.frames)for(var h in b.frames[g])f.addPrefixes(h,b.frames[g]);var i="@keyframes "+b.name+" {\n";i+=c({mainstream:b.frames}),i+="}",a.raw(i+"\n"+i.replace("@keyframes","@-webkit-keyframes"))}else if("undefined"!=typeof b.keyframes){for(var i="@keyframes "+b.name+" {\n",j={},k=0;rule=b.keyframes[k];k++)if("keyframe"===rule.type)for(var l=j[rule.values]={},m=0;declaration=rule.declarations[m];m++)"declaration"===declaration.type&&(l[declaration.property]=declaration.value);i+=c({mainstream:j}),i+="}",a.raw(i+"\n"+i.replace("@keyframes","@-webkit-keyframes"))}}},b.processors.css.plugins.media=function(){return function(a,b){var c=d(e+"/../CSS.js")();if("object"==typeof b){for(var f="@media "+b.media+" {\n",g={},h=0;rule=b.rules[h];h++){var i=g[rule.selectors.toString()]={};if("rule"===rule.type)for(var j=0;declaration=rule.declarations[j];j++)"declaration"===declaration.type&&(i[declaration.property]=declaration.value)}f+=c({mainstream:g}),f+="}",a.raw(f)}}},b.processors.css.plugins.namespace=function(){return function(a,b){"string"==typeof b?a.raw('@namespace: "'+b+'";'):"object"==typeof b&&(b=b.namespace.replace(/: /g,"").replace(/'/g,"").replace(/"/g,"").replace(/ /g,"").replace(/:h/g,"h"),a.raw('@namespace: "'+b+'";'))}},b.processors.css.plugins.page=function(){return function(a,b){if("object"==typeof b){var c="";c+=b.selectors.length>0?"@page "+b.selectors.join(", ")+" {\n":"@page {\n";for(var d=0;declaration=b.declarations[d];d++)"declaration"==declaration.type&&(c+=" "+declaration.property+": "+declaration.value+";\n");c+="}",a.raw(c)}}},b.processors.css.plugins.supports=function(){return function(a,b){var c=d(e+"/../CSS.js")();if("object"==typeof b){for(var f="@supports "+b.supports+" {\n",g={},h=0;rule=b.rules[h];h++){var i=g[rule.selectors.toString()]={};if("rule"===rule.type)for(var j=0;declaration=rule.declarations[j];j++)"declaration"===declaration.type&&(i[declaration.property]=declaration.value)}f+=c({mainstream:g}),f+="}",a.raw(f)}}};var D=null,w="\n",x={},E=d("js-beautify").html,F=d("../../helpers/TransformUppercase"),G={},H=function(a){var b="";for(var c in D)if(c==a)for(var d=D[c].length,e=0;d>e;e++)b+=J("",D[c][e]);return b},I=function(a,b){return b&&b.keepCamelCase===!0?a:F(a,b)},J=function(a,b){var c="",e="",f="",g=d("./helpers/PropAnalyzer")(a);if(a=g.tag,""!=g.attrs&&(e+=" "+g.attrs),"string"==typeof b)return K(a,e,b);var h=function(a){""!=f&&(f+=w),f+=a};for(var i in b){var j=b[i];switch(i){case"_attrs":for(var k in j)e+="function"==typeof j[k]?" "+I(k,G)+'="'+j[k]()+'"':" "+I(k,G)+'="'+j[k]+'"';break;case"_":h(j);break;case"_tpl":if("string"==typeof j)h(H(j));else if(j instanceof Array){for(var l="",m=0;tpl=j[m];m++)l+=H(tpl),m<j.length-1&&(l+=w);h(l)}break;case"_include":var l="",n=function(a){"function"==typeof a&&(a=a()),a.css&&a.html&&(a=a.html),l+=J("",a)};if(j instanceof Array)for(var m=0;m<j.length,o=j[m];m++)n(o);else"object"==typeof j&&n(j);h(l);break;default:switch(typeof j){case"string":h(J(i,j));break;case"object":if(j.length&&j.length>0){for(var l="",m=0;v=j[m];m++)l+=J("","function"==typeof v?v():v),m<j.length-1&&(l+=w);h(J(i,l))}else h(J(i,j));break;case"function":h(J(i,j()))}}}return c+=""!=a?K(a,e,f):f},K=function(a,b,c){var d="";return""==a&&""==b&&""!=c?c:(a=""==a?"div":a,d+=""!==c?"<"+I(a,G)+b+">"+w+c+w+"</"+I(a,G)+">":"<"+I(a,G)+b+"/>")},L=function(a){return a=d("./helpers/TemplateEngine")(a.replace(/[\r\t\n]/g,""),G),G.minify?a:E(a,{indent_size:G.indentSize||4})};return b.processors.html.HTML=function(){var a=function(a,b,c){D=a,b=b||function(){},c=G=c||x;var d=L(H("mainstream"));return b(null,d),d};return a.type="html",a},b.processors.html.helpers.PropAnalyzer=function(a){var b={tag:"",attrs:""},d=(a.length,""),e=!1,f=[],g="",h=!1,i="",j=!1;if(/(#|\.|\[|\])/gi.test(a)===!1)return{tag:a,attrs:""};for(var k=0;k<a.length,c=a[k];k++)"["!==c||j?j?"]"!=c?i+=c:(j=!1,k-=1):"."!==c||e?e?"."!=c&&"#"!=c&&"["!=c&&"]"!=c?d+=c:(f.push(d),e=!1,d="",k-=1):"#"!==c||h?h?"."!=c&&"#"!=c&&"["!=c&&"]"!=c?g+=c:(h=!1,k-=1):"."!=c&&"#"!=c&&"["!=c&&"]"!=c&&(b.tag+=c):h=!0:e=!0:j=!0;""!=d&&f.push(d);for(var l="",k=0;cls=f[k];k++)l+=""===l?cls:" "+cls;return b.attrs+=""!=l?'class="'+l+'"':"",""!=g&&(b.attrs+=(""!=b.attrs?" ":"")+'id="'+g+'"'),""===b.tag&&""!=b.attrs&&(b.tag="div"),""!=i&&(b.attrs+=(""!=b.attrs?" ":"")+i),b},b.processors.html.helpers.TemplateEngine=function(a,b){for(var c,d=/<%(.+?)%>/g,e=/(^( )?(if|for|else|switch|case|break|{|}|;))(.*)?/g,f="var r=[];\n",g=0,h=function(a,b){return f+=b?a.match(e)?a+"\n":"r.push("+a+");\n":""!=a?'r.push("'+a.replace(/"/g,'\\"')+'");\n':"",h};match=d.exec(a);)h(a.slice(g,match.index))(match[1],!0),g=match.index+match[0].length;h(a.substr(g,a.length-g)),f=(f+'return r.join("");').replace(/[\r\t\n]/g,"");try{c=new Function(f).apply(b)}catch(i){console.error("'"+i.message+"'"," in \n\nCode:\n",f,"\n")}return c},m()}(window);
var Absurd=function(){var b={api:{},helpers:{},plugins:{},processors:{css:{plugins:{}},html:{plugins:{},helpers:{}},component:{plugins:{}}}},d=function(a){return a.indexOf("css/CSS.js")>0||"/../CSS.js"==a?b.processors.css.CSS:a.indexOf("html/HTML.js")>0?b.processors.html.HTML:a.indexOf("component/Component.js")>0?b.processors.component.Component:"js-beautify"==a?{html:function(a){return a}}:"./helpers/PropAnalyzer"==a?b.processors.html.helpers.PropAnalyzer:"../../helpers/TransformUppercase"==a?b.helpers.TransformUppercase:"./helpers/TemplateEngine"==a?b.processors.html.helpers.TemplateEngine:"../helpers/Extend"==a?b.helpers.Extend:"../helpers/Clone"==a?b.helpers.Clone:"../helpers/Prefixes"==a||"/../../../helpers/Prefixes"==a?b.helpers.Prefixes:function(){}},e="",f=function(a,b){!function c(){a.length>0&&a.shift().apply(b||{},[c].concat(Array.prototype.slice.call(arguments,0)))}()},g=function(a,b){var c;try{c=(b||document).querySelectorAll(a)}catch(d){c=document.querySelectorAll(a)}return c},h=function(a){var b={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[1,"<div>","</div>"]};b.optgroup=b.option,b.tbody=b.tfoot=b.colgroup=b.caption=b.thead,b.th=b.td;var c=document.createElement("div"),d=/<\s*\w.*?>/g.exec(a);if(null!=d){var c,e=d[0].replace(/</g,"").replace(/>/g,""),f=b[e]||b._default;a=f[1]+a+f[2],c.innerHTML=a;for(var g=f[0]+1;g--;)c=c.lastChild}else c.innerHTML=a,c=c.lastChild;return c},i=function(a,b,c){return a.addEventListener?(a.addEventListener(b,c,!1),!0):a.attachEvent?a.attachEvent("on"+b,c):void 0},j=function(a){for(var b,c=a.childNodes,d=c.length,e=0,f=/^\s*$/;d>e;e++)b=c[e],3==b.nodeType&&f.test(b.nodeValue)&&(a.removeChild(b),e--,d--);return a},k=function(b,c,d){for(var e=document.createElement(b),f=0;f<c.length,a=c[f];f++)e.setAttribute(a.name,a.value);return e.innerHTML=d,e},l=function(a,c,d,e){var l=b.helpers.Extend({__name:a},e),m=b.helpers.Extend,n=[];l.listeners=n,l.on=function(a,b,c){return n[a]||(n[a]=[]),n[a].push({callback:b,scope:c}),this},l.off=function(a,b){return n[a]?(b||(n[a]=[]),this):this},l.dispatch=function(a,b,c){if(!b||"object"!=typeof b||b instanceof Array||(b.target=this),n[a])for(var e=0;e<n[a].length;e++){var f=n[a][e].callback;f.apply(c||n[a][e].scope||{},[b])}return this[a]&&"function"==typeof this[a]&&this[a](b),d&&d.dispatch(a,b),this};var o={};l.set=function(a,b){return o[a]=b,this},l.get=function(a){return o[a]};var p=!1;l.__handleCSS=function(b){return this.css?c.flush().add(this.css).compile(function(c,d){if(p)p.raw!==d&&(p.raw=d,p.element.innerHTML=d);else{var e=k("style",[{name:"id",value:a+"-css"},{name:"type",value:"text/css"}],d);(g("head")||g("body"))[0].appendChild(e),p={raw:d,element:e}}b()}):b(),this};var q=!1;l.__mergeDOMElements=function(a,b){if(j(a),j(b),"undefined"!=typeof a&&"undefined"!=typeof b&&!a.isEqualNode(b)){if(a.nodeName!==b.nodeName)return a.parentNode&&a.parentNode.replaceChild(b,a),void 0;if(a.nodeValue!==b.nodeValue&&(a.nodeValue=b.nodeValue),a.attributes){for(var c,d,e=a.attributes,f=b.attributes,g={},h=0;h<e.length,c=e[h];h++){for(var i=0;i<f.length,d=f[i];i++)c.name===d.name&&(a.setAttribute(c.name,d.value),g[c.name]=!0);g[c.name]||a.removeAttribute(c.name)}for(var h=0;h<f.length,d=f[h];h++)g[d.name]||a.setAttribute(d.name,d.value)}var k=[];if(a.childNodes.length>=b.childNodes.length)for(var h=0;h<a.childNodes.length;h++)b.childNodes[h]||b.appendChild(document.createTextNode("")),k.push([a.childNodes[h],b.childNodes[h]]);else for(var h=0;h<b.childNodes.length;h++)a.appendChild(document.createTextNode("")),k.push([a.childNodes[h],b.childNodes[h]]);for(var h=0;h<k.length;h++)l.__mergeDOMElements(k[h][0],k[h][1])}},l.__handleHTML=function(a){var b=this,d=function(){c.flush().morph("html").add(q).compile(function(c,d){b.el?l.__mergeDOMElements(b.el,h(d)):b.el=h(d),a()},b)};if(this.html)if("string"==typeof this.html){if(!this.el){var e=g(this.html);this.el=e[0],q={"":this.el.outerHTML.replace(/&lt;/g,"<").replace(/&gt;/g,">")}}d()}else"object"==typeof this.html?(q=m({},this.html),d()):a();else a();return this};var r=!1;l.__append=function(a){return!r&&this.el&&this.get("parent")&&(r=!0,this.get("parent").appendChild(this.el)),a(),this};var s={events:{}};l.__handleEvents=function(a){if(this.el){var b=this,c=function(a){var c=a.getAttribute("data-absurd-event");c=c.split(":"),c.length>=2&&(!s.events[c[0]]||s.events[c[0]].indexOf(a)<0)&&(s.events[c[0]]||(s.events[c[0]]=[]),s.events[c[0]].push(a),i(a,c[0],function(a){"function"==typeof b[c[1]]&&b[c[1]](a)}))};this.el.hasAttribute&&this.el.hasAttribute("data-absurd-event")&&c(this.el);for(var d=this.el.querySelectorAll?this.el.querySelectorAll("[data-absurd-event]"):[],e=0;e<d.length;e++)c(d[e])}return a(),this};var t={funcs:{},index:0};return l.__handleAsyncFunctions=function(a){if(this.el){var b=[];if(this.el.hasAttribute&&this.el.hasAttribute("data-absurd-async"))b.push(this.el);else for(var c=this.el.querySelectorAll?this.el.querySelectorAll("[data-absurd-async]"):[],d=0;d<c.length;d++)b.push(c[d]);if(0===b.length)a();else{var e=this;!function f(){if(0===b.length)a();else{var c=b.shift(),d=c.getAttribute("data-absurd-async"),g=function(a){"string"==typeof a?c.parentNode.replaceChild(h(a),c):c.parentNode.replaceChild(a,c),f()};"function"==typeof e[t.funcs[d].name]?e[t.funcs[d].name].apply(e,[g].concat(t.funcs[d].args)):"function"==typeof t.funcs[d].func&&t.funcs[d].func.apply(e,[g].concat(t.funcs[d].args))}}()}}else a();return this},l.async=function(){var a=Array.prototype.slice.call(arguments,0),b=a.shift(),c="_"+t.index++;return t.funcs[c]={args:a,name:b},'<script data-absurd-async="'+c+'"></script>'},l.child=function(){var a=Array.prototype.slice.call(arguments,0),b=this.get("children"),c=b&&b[a.shift()],d="_"+t.index++;return t.funcs[d]={args:a,func:function(a){c.populate({callback:function(b){a(b.html.element)}})}},'<script data-absurd-async="'+d+'"></script>'},l.wire=function(a){return c.components.events.on(a,this[a]||function(){},this),this},l.populate=function(a){return f([l.__handleCSS,l.__handleHTML,l.__append,l.__handleEvents,l.__handleAsyncFunctions,function(){t={funcs:{},index:0};var b={css:p,html:{element:this.el}};this.dispatch("populated",b),a&&"function"==typeof a.callback&&a.callback(b)}],this),this},l.str2DOMElement=h,l.addEventListener=i,l.queue=f,l.compileHTML=function(a,b,d){c.flush().morph("html").add(a).compile(b,d)},l.compileCSS=function(a,b,d){c.flush().add(a).compile(b,d)},l.qs=function(a,b){return(b||this.el||document).querySelector(a)},l.qsa=function(a,b){return(b||this.el||document).querySelectorAll(a)},l},m=function(){return function(a){var d=function(a,b){for(var c in b)hasOwnProperty.call(b,c)&&(a[c]=b[c]);return a},e={defaultProcessor:b.processors.css.CSS()},f={},g={},h={},i={};e.getRules=function(a){return"undefined"==typeof a?f:("undefined"==typeof f[a]&&(f[a]=[]),f[a])},e.getPlugins=function(){return h},e.getStorage=function(){return g},e.flush=function(){return f={},g=[],i={},e.defaultProcessor=b.processors.css.CSS(),e},e.import=function(){return e.callHooks("import",arguments)?e:e},e.addHook=function(a,b){i[a]||(i[a]=[]);for(var d=!1,e=0;c=i[a][e];e++)c===b&&(d=!0);d===!1?i[a].push(b):null},e.callHooks=function(a,b){if(i[a])for(var d=0;c=i[a][d];d++)if(c.apply(e,b)===!0)return!0;return!1},e.numOfAddedRules=0,e.components=function(a){var c=b.helpers.Extend,d=b.helpers.Clone,e={},f=[],g=c({},l());return{events:g,register:function(b,h){return e[b]=function(){var e=c({},l(b,a,g,d(h)));return a.di.resolveObject(e),f.push(e),"function"==typeof e.constructor&&e.constructor.apply(e,Array.prototype.slice.call(arguments,0)),e}},get:function(a){if(e[a])return e[a];throw new Error("There is no component with name '"+a+"'.")},remove:function(a){return e[a]?(delete e[a],!0):!1},list:function(){var a=[];for(var b in e)a.push(b);return a},flush:function(){return e={},f=[],this},broadcast:function(a,b){for(var c=0;c<f.length,instance=f[c];c++)"function"==typeof instance[a]&&instance[a](b);return this}}}(e),e.component=function(a){return function(b,c){return"undefined"==typeof c?a.components.get(b):a.components.register(b,c)}}(e),e.di=b.DI(e),e.compile=function(a,b){if(e.callHooks("compile",arguments))return e;var c={combineSelectors:!0,minify:!1,processor:e.defaultProcessor,keepCamelCase:!1,api:e};b=d(c,b||{}),b.processor(e.getRules(),a||function(){},b),e.flush()};for(var j in b.api)"compile"!==j&&(e[j]=b.api[j](e),e[j]=function(a){return function(){var c=b.api[a](e);return e.callHooks(a,arguments)?e:c.apply(e,arguments)}}(j));for(var k in b.processors.css.plugins)e.plugin(k,b.processors.css.plugins[k]());return"function"==typeof a&&a(e),"undefined"!=typeof Organic&&Organic.init(e),e}};b.DI=function(){var a={dependencies:{},register:function(a,b){return this.dependencies[a]=b,this},resolve:function(){var a,b,c,d=this,e=!1;"string"==typeof arguments[0]?(a=arguments[1],b=arguments[0].replace(/ /g,"").split(","),c=arguments[2]||{}):(a=arguments[0],b=a.toString().match(/^function\s*[^\(]*\(\s*([^\)]*)\)/m)[1].replace(/ /g,"").split(","),c=arguments[1]||{});for(var f=0;f<b.length;f++)"undefined"!=typeof this.dependencies[b[f]]&&(e=!0);return e?function(){for(var e=[],f=Array.prototype.slice.call(arguments,0),g=0;g<b.length;g++){var h=b[g];e.push(d.dependencies[h]&&""!=h?d.dependencies[h]:f.shift())}return a.apply(c,e)}:a},resolveObject:function(a){if("object"==typeof a)for(var b in a)"function"==typeof a[b]?a[b]=this.resolve(a[b],a):a[b]instanceof Array&&2==a[b].length&&"string"==typeof a[b][0]&&"function"==typeof a[b][1]&&(a[b]=this.resolve(a[b][0],a[b][1],a));return this},flush:function(){return this.dependencies={},this}};return a},b.api.add=function(a){var b=(d("../helpers/Extend"),d("../helpers/Prefixes")),c=[],e=function(c,d,e,g,h){var i=b.nonPrefixProp(d),j=a.getPlugins()[i.prop];if("undefined"!=typeof j){var k=j(a,e,i.prefix);return k&&f(c,k,g,h),!0}return!1},f=function(a,d,g,h){if(g=g||"mainstream",/, ?/g.test(a))for(var i=a.replace(/, /g,",").split(","),j=0;j<i.length,p=i[j];j++)f(p,d,g,h);else if("undefined"==typeof d.length||"object"!=typeof d){if(!e(null,a,d,g,h)){var k={},l=a,m={},n={};for(var o in d){var q=typeof d[o];"object"!==q&&"function"!==q?e(a,o,d[o],g,h)===!1&&(l="undefined"!=typeof h?h+" "+a:a,k[o]=d[o],b.addPrefixes(o,k)):"object"===q?m[o]=d[o]:"function"===q&&(n[o]=d[o])}c.push({selector:l,props:k,stylesheet:g});for(var o in m)if(":"===o.charAt(0))f(a+o,m[o],g,h);else if(/&/g.test(o))if(/, ?/g.test(o))for(var i=o.replace(/, /g,",").split(","),j=0;j<i.length,p=i[j];j++)p.indexOf("&")>=0?f(p.replace(/&/g,a),m[o],g,h):f(p,m[o],g,"undefined"!=typeof h?h+" "+a:a);else f(o.replace(/&/g,a),m[o],g,h);else 0===o.indexOf("@media")||0===o.indexOf("@supports")?f(a,m[o],o,h):0===a.indexOf("@media")||0===o.indexOf("@supports")?f(o,m[o],a,h):e(a,o,m[o],g,h)===!1&&f(o,m[o],g,(h?h+" ":"")+a);for(var o in n){var r={};r[o]=n[o](),f(a,r,g,h)}}}else for(var j=0;j<d.length,o=d[j];j++)f(a,o,g,h)},g=function(b,d){c=[],a.numOfAddedRules+=1;var e=a.defaultProcessor.type;for(var g in b)f(g,b[g],d||"mainstream");for(var h=0;h<c.length;h++){var d=c[h].stylesheet,g=c[h].selector,i=c[h].props,j=a.getRules(d),k=j[g]||{};for(var l in i){var m=i[l];"object"!=typeof m&&(k[l]="css"==e?"+"===m.toString().charAt(0)?k&&k[l]?k[l]+", "+m.substr(1,m.length-1):m.substr(1,m.length-1):">"===m.toString().charAt(0)?k&&k[l]?k[l]+" "+m.substr(1,m.length-1):m.substr(1,m.length-1):m:m)}j[g]=k}return a};return g};var n=d("../helpers/Extend");b.api.compile=function(a){return function(){for(var b=null,c=null,d=null,e=0;e<arguments.length;e++)switch(typeof arguments[e]){case"function":c=arguments[e];break;case"string":b=arguments[e];break;case"object":d=arguments[e]}var f={combineSelectors:!0,minify:!1,keepCamelCase:!1,processor:a.defaultProcessor,api:a};d=n(f,d||{}),d.processor(a.getRules(),function(d,e){if(null!=b)try{s.writeFile(b,e,function(a){c(a,e)})}catch(d){c.apply({},arguments)}else c.apply({},arguments);a.flush()},d)}},b.api.compileFile=function(a){return a.compile};var q=function(a,b){a=String(a).replace(/[^0-9a-f]/gi,""),a.length<6&&(a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),b=b||0;var c,d,e="#";for(d=0;3>d;d++)c=parseInt(a.substr(2*d,2),16),c=Math.round(Math.min(Math.max(0,c+c*b),255)).toString(16),e+=("00"+c).substr(c.length);return e};b.api.darken=function(){return function(a,b){return q(a,-(b/100))}},b.api.define=function(a){return function(b,c){return a.getStorage().__defined||(a.getStorage().__defined={}),a.getStorage().__defined[b]=c,a}},b.api.hook=function(a){return function(b,c){return a.addHook(b,c),a}};var q=function(a,b){a=String(a).replace(/[^0-9a-f]/gi,""),a.length<6&&(a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),b=b||0;var c,d,e="#";for(d=0;3>d;d++)c=parseInt(a.substr(2*d,2),16),c=Math.round(Math.min(Math.max(0,c+c*b),255)).toString(16),e+=("00"+c).substr(c.length);return e};b.api.lighten=function(){return function(a,b){return q(a,b/100)}};var r={html:function(a){a.defaultProcessor=d(e+"/../processors/html/HTML.js")(),a.hook("add",function(b,c){return a.getRules(c||"mainstream").push(b),!0})},component:function(a){a.defaultProcessor=d(e+"/../processors/component/Component.js")(),a.hook("add",function(b){b instanceof Array||(b=[b]);for(var d=0;d<b.length,c=b[d];d++)a.getRules("mainstream").push(c);return!0})}};b.api.morph=function(a){return function(b){return r[b]&&(a.flush(),r[b](a)),a}},b.api.plugin=function(a){var b=function(b,c){return a.getPlugins()[b]=c,a};return b},b.api.raw=function(a){return function(b){var c={},d={},e="____raw_"+a.numOfAddedRules;return d[e]=b,c[e]=d,a.add(c),a}};{var s=d("fs");d("path")}b.api.rawImport=function(a){var b=function(b){var c=s.readFileSync(b,{encoding:"utf8"});a.raw(c)};return function(c){var d,e,f;if("string"==typeof c)b(c);else for(e=0,f=c.length;f>e;e++)d=c[e],b(d);return a}},b.api.register=function(a){return function(b,c){return a[b]=c,a}},b.api.storage=function(a){var b=a.getStorage(),c=function(d,e){if("undefined"!=typeof e)b[d]=e;else{if("object"!=typeof d){if(b[d])return b[d];throw new Error("There is no data in the storage associated with '"+d+"'")}for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&c(f,d[f])}return a};return c},b.helpers.Clone=function M(a){if(!a)return a;var b,c=[Number,String,Boolean];if(c.forEach(function(c){a instanceof c&&(b=c(a))}),"undefined"==typeof b)if("[object Array]"===Object.prototype.toString.call(a))b=[],a.forEach(function(a,c){b[c]=M(a)});else if("object"==typeof a)if(a.nodeType&&"function"==typeof a.cloneNode)var b=a.cloneNode(!0);else if(a.prototype)b=a;else if(a instanceof Date)b=new Date(a);else{b={};for(var d in a)b[d]=M(a[d])}else b=a;return b},b.helpers.ColorLuminance=function(a,b){a=String(a).replace(/[^0-9a-f]/gi,""),a.length<6&&(a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),b=b||0;var c,d,e="#";for(d=0;3>d;d++)c=parseInt(a.substr(2*d,2),16),c=Math.round(Math.min(Math.max(0,c+c*b),255)).toString(16),e+=("00"+c).substr(c.length);return e},b.helpers.Extend=function(){for(var a=function(a,b){for(var c in b)hasOwnProperty.call(b,c)&&(a[c]=b[c]);return a},b=arguments[0],c=1;c<arguments.length;c++)b=a(b,arguments[c]);return b};var t=function(a){var b,c;return(c=a.match(/^\-(w|m|s|o)+\-/)||"-"===a.charAt(0))?null!==c&&c[0]?(b={prefix:c[0].replace(/-/g,"")},b.prop=a.replace(c[0],"")):(b={prefix:""},b.prop=a.substr(1,a.length)):b={prefix:!1,prop:a},b};b.helpers.Prefixes={addPrefixes:function(a,b){var c=a,d=t(a),e=b[a];d.prefix!==!1&&(delete b[c],b[d.prop]=e,(""===d.prefix||d.prefix.indexOf("w")>=0)&&(b["-webkit-"+d.prop]=e),(""===d.prefix||d.prefix.indexOf("m")>=0)&&(b["-moz-"+d.prop]=e),(""===d.prefix||d.prefix.indexOf("s")>=0)&&(b["-ms-"+d.prop]=e),(""===d.prefix||d.prefix.indexOf("o")>=0)&&(b["-o-"+d.prop]=e))},nonPrefixProp:function(a){var b=t(a);return b.prefix!==!1&&(b.prefix=""==b.prefix?"-":"-"+b.prefix+"-"),b}},b.helpers.RequireUncached=function(a){return delete d.cache[d.resolve(a)],d(a)},b.helpers.TransformUppercase=function(a){for(var b="",d=0;c=a.charAt(d);d++)b+=c===c.toUpperCase()&&c.toLowerCase()!==c.toUpperCase()?"-"+c.toLowerCase():c;return b};var u=function(a,b,f){var g="",h="",i=[],j=f.api;cssPreprocessor=d(e+"/../css/CSS.js")(),htmlPreprocessor=d(e+"/../html/HTML.js")();for(var k=function(a){for(var b=0;b<i.length,component=i[b];b++)"function"==typeof component&&(component=component()),j.add(component.css?component.css:{});cssPreprocessor(j.getRules(),function(b,c){g+=c,a(b)},f)},l=function(b){var c=0,d=null,e=function(){if(c>a.length-1)return b(d),void 0;var g=a[c];"function"==typeof g&&(g=g()),j.morph("html").add(g.html?g.html:{}),htmlPreprocessor(j.getRules(),function(a,b){h+=b,c+=1,d=a,e()},f)};e()},m=function(a){for(var b in a)if("_include"===b)if(a[b]instanceof Array)for(var d=0;d<a[b].length,c=a[b][d];d++)"function"==typeof c&&(c=c()),i.push(c),m(c);else"function"==typeof a[b]&&(a[b]=a[b]()),i.push(a[b]),m(a[b]);else"object"==typeof a[b]&&m(a[b])},n=0;n<a.length,c=a[n];n++)"function"==typeof c&&(c=c()),i.push(c),m(c);j.flush(),k(function(a){j.morph("html"),l(function(c){b(a||c?{error:{css:a,html:c}}:null,g,h)})})};b.processors.component.Component=function(){var a=function(a,b,c){u(a.mainstream,b,c)};return a.type="component",a};var w="\n",x={combineSelectors:!0,minify:!1,keepCamelCase:!1},y=d("../../helpers/TransformUppercase"),z=function(a,b){var c="";for(var d in a)if(0===d.indexOf("____raw"))c+=a[d][d]+w;else{var e=d+" {"+w;for(var f in a[d]){var g=a[d][f];""===g&&(g='""'),e+=b&&b.keepCamelCase===!0?" "+f+": "+g+";"+w:" "+y(f)+": "+g+";"+w}e+="}"+w,c+=e}return c},A=function(a){var b={},c={};for(var d in a){var e=a[d];for(var f in e){var g=e[f];b[f]||(b[f]={}),b[f][g]||(b[f][g]=[]),b[f][g].push(d)}}for(var f in b){var h=b[f];for(var g in h){var i=h[g];c[i.join(", ")]||(c[i.join(", ")]={});var d=c[i.join(", ")];d[f]=g}}return c},B=function(a){return a=a.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g,""),a=a.replace(/ {2,}/g," "),a=a.replace(/ ([{:}]) /g,"$1"),a=a.replace(/([;,]) /g,"$1"),a=a.replace(/ !/g,"!")},C=function(a,b){if(b&&b.api&&b.api.getStorage().__defined){var c=b.api.getStorage().__defined;for(var d in c){var e=new RegExp("<%( )?"+d+"( )?%>","g");a="function"!=typeof c[d]?a.replace(e,c[d]):a.replace(e,c[d]())}}return a};b.processors.css.CSS=function(){var a=function(a,b,c){c=c||x;var d="";for(var e in a){var f=a[e];f=c.combineSelectors?A(f):f,d+="mainstream"===e?z(f,c):e+" {"+w+z(f,c)+"}"+w}return d=C(d,c),c.minify?(d=B(d),b&&b(null,d)):b&&b(null,d),d};return a.type="css",a},b.processors.css.plugins.charset=function(){return function(a,b){"string"==typeof b?a.raw('@charset: "'+b+'";'):"object"==typeof b&&(b=b.charset.replace(/:/g,"").replace(/'/g,"").replace(/"/g,"").replace(/ /g,""),a.raw('@charset: "'+b+'";'))}},b.processors.css.plugins.document=function(){return function(a,b){if("object"==typeof b){var c="";if(c+="@"+b.vendor+"document",c+=" "+b.document,b.rules&&b.rules.length)for(var d=0;rule=b.rules[d];d++)a.handlecssrule(rule,c);else"undefined"!=typeof b.styles&&a.add(b.styles,c)}}},b.processors.css.plugins.keyframes=function(){return function(a,b){var c=d(e+"/../CSS.js")(),f=d(e+"/../../../helpers/Prefixes");if("object"==typeof b)if("undefined"!=typeof b.frames){for(var g in b.frames)for(var h in b.frames[g])f.addPrefixes(h,b.frames[g]);var i="@keyframes "+b.name+" {\n";i+=c({mainstream:b.frames}),i+="}",a.raw(i+"\n"+i.replace("@keyframes","@-webkit-keyframes"))}else if("undefined"!=typeof b.keyframes){for(var i="@keyframes "+b.name+" {\n",j={},k=0;rule=b.keyframes[k];k++)if("keyframe"===rule.type)for(var l=j[rule.values]={},m=0;declaration=rule.declarations[m];m++)"declaration"===declaration.type&&(l[declaration.property]=declaration.value);i+=c({mainstream:j}),i+="}",a.raw(i+"\n"+i.replace("@keyframes","@-webkit-keyframes"))}}},b.processors.css.plugins.media=function(){return function(a,b){var c=d(e+"/../CSS.js")();if("object"==typeof b){for(var f="@media "+b.media+" {\n",g={},h=0;rule=b.rules[h];h++){var i=g[rule.selectors.toString()]={};if("rule"===rule.type)for(var j=0;declaration=rule.declarations[j];j++)"declaration"===declaration.type&&(i[declaration.property]=declaration.value)}f+=c({mainstream:g}),f+="}",a.raw(f)}}},b.processors.css.plugins.namespace=function(){return function(a,b){"string"==typeof b?a.raw('@namespace: "'+b+'";'):"object"==typeof b&&(b=b.namespace.replace(/: /g,"").replace(/'/g,"").replace(/"/g,"").replace(/ /g,"").replace(/:h/g,"h"),a.raw('@namespace: "'+b+'";'))}},b.processors.css.plugins.page=function(){return function(a,b){if("object"==typeof b){var c="";c+=b.selectors.length>0?"@page "+b.selectors.join(", ")+" {\n":"@page {\n";for(var d=0;declaration=b.declarations[d];d++)"declaration"==declaration.type&&(c+=" "+declaration.property+": "+declaration.value+";\n");c+="}",a.raw(c)}}},b.processors.css.plugins.supports=function(){return function(a,b){var c=d(e+"/../CSS.js")();if("object"==typeof b){for(var f="@supports "+b.supports+" {\n",g={},h=0;rule=b.rules[h];h++){var i=g[rule.selectors.toString()]={};if("rule"===rule.type)for(var j=0;declaration=rule.declarations[j];j++)"declaration"===declaration.type&&(i[declaration.property]=declaration.value)}f+=c({mainstream:g}),f+="}",a.raw(f)}}};var D=null,w="\n",x={},E=d("js-beautify").html,F=d("../../helpers/TransformUppercase"),G={},H=function(a){var b="";for(var c in D)if(c==a)for(var d=D[c].length,e=0;d>e;e++)b+=J("",D[c][e]);return b},I=function(a,b){return b&&b.keepCamelCase===!0?a:F(a,b)},J=function(a,b){var c="",e="",f="",g=d("./helpers/PropAnalyzer")(a);if(a=g.tag,""!=g.attrs&&(e+=" "+g.attrs),"string"==typeof b)return K(a,e,b);var h=function(a){""!=f&&(f+=w),f+=a};for(var i in b){var j=b[i];switch(i){case"_attrs":for(var k in j)e+="function"==typeof j[k]?" "+I(k,G)+'="'+j[k]()+'"':" "+I(k,G)+'="'+j[k]+'"';break;case"_":h(j);break;case"_tpl":if("string"==typeof j)h(H(j));else if(j instanceof Array){for(var l="",m=0;tpl=j[m];m++)l+=H(tpl),m<j.length-1&&(l+=w);h(l)}break;case"_include":var l="",n=function(a){"function"==typeof a&&(a=a()),a.css&&a.html&&(a=a.html),l+=J("",a)};if(j instanceof Array)for(var m=0;m<j.length,o=j[m];m++)n(o);else"object"==typeof j&&n(j);h(l);break;default:switch(typeof j){case"string":h(J(i,j));break;case"object":if(j.length&&j.length>0){for(var l="",m=0;v=j[m];m++)l+=J("","function"==typeof v?v():v),m<j.length-1&&(l+=w);h(J(i,l))}else h(J(i,j));break;case"function":h(J(i,j()))}}}return c+=""!=a?K(a,e,f):f},K=function(a,b,c){var d="";return""==a&&""==b&&""!=c?c:(a=""==a?"div":a,d+=""!==c?"<"+I(a,G)+b+">"+w+c+w+"</"+I(a,G)+">":"<"+I(a,G)+b+"/>")},L=function(a){return a=d("./helpers/TemplateEngine")(a.replace(/[\r\t\n]/g,""),G),G.minify?a:E(a,{indent_size:G.indentSize||4})};return b.processors.html.HTML=function(){var a=function(a,b,c){D=a,b=b||function(){},c=G=c||x;var d=L(H("mainstream"));return b(null,d),d};return a.type="html",a},b.processors.html.helpers.PropAnalyzer=function(a){var b={tag:"",attrs:""},d=(a.length,""),e=!1,f=[],g="",h=!1,i="",j=!1;if(/(#|\.|\[|\])/gi.test(a)===!1)return{tag:a,attrs:""};for(var k=0;k<a.length,c=a[k];k++)"["!==c||j?j?"]"!=c?i+=c:(j=!1,k-=1):"."!==c||e?e?"."!=c&&"#"!=c&&"["!=c&&"]"!=c?d+=c:(f.push(d),e=!1,d="",k-=1):"#"!==c||h?h?"."!=c&&"#"!=c&&"["!=c&&"]"!=c?g+=c:(h=!1,k-=1):"."!=c&&"#"!=c&&"["!=c&&"]"!=c&&(b.tag+=c):h=!0:e=!0:j=!0;""!=d&&f.push(d);for(var l="",k=0;cls=f[k];k++)l+=""===l?cls:" "+cls;return b.attrs+=""!=l?'class="'+l+'"':"",""!=g&&(b.attrs+=(""!=b.attrs?" ":"")+'id="'+g+'"'),""===b.tag&&""!=b.attrs&&(b.tag="div"),""!=i&&(b.attrs+=(""!=b.attrs?" ":"")+i),b},b.processors.html.helpers.TemplateEngine=function(a,b){for(var c,d=/<%(.+?)%>/g,e=/(^( )?(if|for|else|switch|case|break|{|}|;))(.*)?/g,f="var r=[];\n",g=0,h=function(a,b){return f+=b?a.match(e)?a+"\n":"r.push("+a+");\n":""!=a?'r.push("'+a.replace(/"/g,'\\"')+'");\n':"",h};match=d.exec(a);)h(a.slice(g,match.index))(match[1],!0),g=match.index+match[0].length;h(a.substr(g,a.length-g)),f=(f+'return r.join("");').replace(/[\r\t\n]/g,"");try{c=new Function(f).apply(b)}catch(i){console.error("'"+i.message+"'"," in \n\nCode:\n",f,"\n")}return c},m()}(window);

@@ -24,2 +24,3 @@ var CSS = false;

}
return this;
}

@@ -84,2 +84,3 @@ var HTMLSource = false;

}
return this;
};

@@ -8,2 +8,3 @@ var appended = false

next();
return this;
}

@@ -29,2 +29,3 @@ var cache = { events: {} };

next();
return this;
}

@@ -41,3 +41,4 @@ var async = { funcs: {}, index: 0 };

next();
}
}
return this;
}

@@ -44,0 +45,0 @@ api.async = function() {

api.wire = function(event) {
absurd.components.events.on(event, this[event] || function() {}, this);
return this;
};

@@ -20,3 +20,3 @@ api.populate = function(options) {

], this);
return api;
return this;
};

@@ -1,11 +0,15 @@

api.utils = {
str2DOMElement: str2DOMElement,
addEventListener: addEventListener,
queue: queue,
compileHTML: function(HTML, data, callback) {
absurd.flush().morph("html").add(HTML).compile(callback, data);
},
compileCSS: function(CSS, data, callback) {
absurd.flush().add(CSS).compile(callback, data);
}
}
api.str2DOMElement = str2DOMElement;
api.addEventListener = addEventListener;
api.queue = queue;
api.compileHTML = function(HTML, callback, data) {
absurd.flush().morph("html").add(HTML).compile(callback, data);
};
api.compileCSS = function(CSS, callback, options) {
absurd.flush().add(CSS).compile(callback, options);
};
api.qs = function(selector, parent) {
return (parent || this.el || document).querySelector(selector);
};
api.qsa = function(selector, parent) {
return (parent || this.el || document).querySelectorAll(selector);
};
{
"name": "absurd",
"version": "0.2.70",
"version": "0.2.71",
"homepage": "http://krasimir.github.io/absurd",

@@ -5,0 +5,0 @@ "description": "CSS/HTML preprocessor. Check out krasimirtsonev.com/blog/article/AbsurdJS-fundamentals",

@@ -205,2 +205,3 @@ var lib = {

}
return this;
}

@@ -290,2 +291,3 @@ var HTMLSource = false;

}
return this;
};

@@ -299,2 +301,3 @@ var appended = false

next();
return this;
}

@@ -329,2 +332,3 @@ var cache = { events: {} };

next();
return this;
}

@@ -371,3 +375,4 @@ var async = { funcs: {}, index: 0 };

next();
}
}
return this;
}

@@ -395,2 +400,3 @@ api.async = function() {

absurd.components.events.on(event, this[event] || function() {}, this);
return this;
};

@@ -416,15 +422,19 @@ api.populate = function(options) {

], this);
return api;
return this;
};
api.utils = {
str2DOMElement: str2DOMElement,
addEventListener: addEventListener,
queue: queue,
compileHTML: function(HTML, data, callback) {
absurd.flush().morph("html").add(HTML).compile(callback, data);
},
compileCSS: function(CSS, data, callback) {
absurd.flush().add(CSS).compile(callback, data);
}
}
api.str2DOMElement = str2DOMElement;
api.addEventListener = addEventListener;
api.queue = queue;
api.compileHTML = function(HTML, callback, data) {
absurd.flush().morph("html").add(HTML).compile(callback, data);
};
api.compileCSS = function(CSS, callback, options) {
absurd.flush().add(CSS).compile(callback, options);
};
api.qs = function(selector, parent) {
return (parent || this.el || document).querySelector(selector);
};
api.qsa = function(selector, parent) {
return (parent || this.el || document).querySelectorAll(selector);
};
return api;

@@ -431,0 +441,0 @@ };

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc