Socket
Socket
Sign inDemoInstall

inferno

Package Overview
Dependencies
Maintainers
1
Versions
334
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

inferno - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

closure/build/compiler.jar

111

build/inferno.js

@@ -81,2 +81,12 @@ "use strict";

function PrototypeComponent(props) {
this.props = props;
this.state = {};
if (this.constructor) {
this.constructor();
}
};
PrototypeComponent.prototype.forceUpdate = function () {};
Inferno.createValueNode = function (value, valueKey) {

@@ -86,2 +96,11 @@ return new ValueNode(value, valueKey);

Inferno.createClass = function (options) {
var component = new PrototypeComponent();
// PrototypeComponent.prototype.constructor = options.constructor;
for (var property in options) {
PrototypeComponent[property] = options[property];
}
return component;
};
Inferno.render = function (render, dom, listeners, component) {

@@ -111,3 +130,3 @@ var rootNode = null;

}
updateNode(dom.rootNode[0], dom.rootNode, dom, values, null, listeners, component);
updateNode(dom.rootNode[0], dom.rootNode, dom, values, listeners, component);
}

@@ -125,3 +144,3 @@ } else {

values = render();
updateNode(component._rootNode[0], component._rootNode, dom, values, 0, null, listeners, component);
updateNode(component._rootNode[0], component._rootNode, dom, values, 0, listeners, component);
}

@@ -252,5 +271,2 @@ }

if (node.component instanceof Component) {
// if(node.component.beforeRender) {
// node.component.beforeRender(node.props, values);
// }
node.component.forceUpdate();

@@ -435,3 +451,3 @@ }

function updateNode(node, parentNode, parentDom, values, index, valIndex, listeners, component) {
function updateNode(node, parentNode, parentDom, values, index, listeners, component) {
var i = 0,

@@ -442,2 +458,3 @@ s = 0,

key = "",
length = 0,
childNode = null,

@@ -449,13 +466,6 @@ endValue = null;

}
//we need to get the actual values and the templatekey
if (valIndex != null) {
endValue = values[valIndex][values[valIndex].length - 1];
if (node.templateKey && node.templateKey !== endValue.templateKey) {
//TODO, basically copy below
node.templateKey = endValue.templateKey;
}
values = values[valIndex];
} else {
if (node.templateKey != null && values instanceof Array) {
endValue = values[values.length - 1];
if (node.templateKey && node.templateKey !== endValue.templateKey) {
if (node.templateKey !== endValue.templateKey) {
//remove node

@@ -472,3 +482,3 @@ removeNode(node, parentDom);

//if this is a component
if (node.component instanceof Component) {
if (node.component != null && node.component instanceof Component) {
if (node.propsValueKeys) {

@@ -484,10 +494,8 @@ for (key in node.propsValueKeys) {

if (node.attrs != null && node.hasDynamicAttrs === true) {
for (i = 0; i < node.attrs.length; i = i + 1 | 0) if (events[node.attrs[i].name] == null) {
{
if (node.attrs[i].value instanceof ValueNode) {
val = values[node.attrs[i].value.valueKey];
if (val !== node.attrs[i].value.lastValue) {
node.attrs[i].value.lastValue = val;
handleNodeAttributes(node.tag, node.dom, node.attrs[i].name, val);
}
for (i = 0, length = node.attrs.length; i < length; i = i + 1 | 0) if (events[node.attrs[i].name] == null) {
if (node.attrs[i].value instanceof ValueNode) {
val = values[node.attrs[i].value.valueKey];
if (val !== node.attrs[i].value.lastValue) {
node.attrs[i].value.lastValue = val;
handleNodeAttributes(node.tag, node.dom, node.attrs[i].name, val);
}

@@ -500,4 +508,4 @@ }

val = values[node.valueKey];
endValue = val[val.length - 1];
if (endValue != null && endValue.templateKey != null) {
if (node.value.templateKey != null) {
endValue = val[val.length - 1];
if (node.value.templateKey !== endValue.templateKey) {

@@ -518,11 +526,11 @@ //we want to remove the DOM current node

if (node.value instanceof Array) {
for (i = 0; i < node.value.length; i = i + 1 | 0) {
if (typeof node.value[i] !== "string") {
updateNode(node.value[i], node, parentDom, val, i, i, listeners, component);
for (i = 0, length = node.value.length; i < length; i = i + 1 | 0) {
if (typeof node.value[i] !== "string" || typeof node.value[i] !== "number") {
updateNode(node.value[i], node, parentDom, val[i], i, listeners, component);
}
}
} else if (node.value.children instanceof Array) {
for (i = 0; i < node.value.children.length; i = i + 1 | 0) {
if (typeof node.value.children[i] !== "string") {
updateNode(node.value.children[i], node.value, node.value.dom, val, i, null, listeners, component);
for (i = 0, length = node.value.children.length; i < length; i = i + 1 | 0) {
if (typeof node.value.children[i] !== "string" || typeof node.value.children[i] !== "number") {
updateNode(node.value.children[i], node.value, node.value.dom, val, i, listeners, component);
}

@@ -535,3 +543,3 @@ }

if (node.children instanceof Array) {
for (i = 0; i < node.children.length; i = i + 1 | 0) {
for (i = 0, length = node.children.length; i < length; i = i + 1 | 0) {
if (node.children[i].isDynamic === true) {

@@ -551,3 +559,3 @@ if (node.children[i] instanceof ValueNode && !node.children[i].isRoot) {

} else {
updateNode(node.children[i], node, node.dom, values, i, null, listeners, component);
updateNode(node.children[i], node, node.dom, values, i, listeners, component);
}

@@ -559,4 +567,4 @@ }

val = values[node.children.valueKey];
endValue = val[val.length - 1];
if (endValue != null && endValue.templateKey != null) {
if (node.children.templateKey != null) {
endValue = val[val.length - 1];
if (node.children.templateKey !== endValue.templateKey) {

@@ -569,3 +577,3 @@ //we want to remove the DOM current node

node.children.value = t7.getTemplateFromCache(endValue.templateKey, val);
createNode(node.children.value, node.children, node.dom, val, null, i, listeners, component);
createNode(node.children.value, node.children, node.dom, val[i], null, listeners, component);
//then we want to set the new templatekey

@@ -576,6 +584,7 @@ node.children.templateKey = endValue.templateKey;

}
if (val !== node.children.lastValue) {
if (val instanceof Array) {
//check if the sizes have changed
//in this case, our new array has more items so we'll need to add more children
if (val !== node.children.lastValue && val instanceof Array) {
//check if the sizes have changed
//in this case, our new array has more items so we'll need to add more children
if (val.length !== node.children.lastValue.length) {
if (val.length > node.children.lastValue.length) {

@@ -600,6 +609,6 @@ //easiest way to add another child is to clone the node, so let's clone the first child

}
for (i = 0; i < node.children.value.length; i = i + 1 | 0) {
if (typeof node.children.value[i] !== "string") {
updateNode(node.children.value[i], node.children.value, node.dom, val, i, i, listeners, component);
}
}
for (i = 0, length = node.children.value.length; i < length; i = i + 1 | 0) {
if (typeof node.children.value[i] === "object") {
updateNode(node.children.value[i], node.children.value, node.dom, val[i], i, listeners, component);
}

@@ -611,6 +620,8 @@ }

val = values[node.children.valueKey];
endValue = val[val.length - 1];
if (endValue != null && endValue.templateKey != null) {
node.templateKey = endValue.templateKey;
val = values;
if (node.templateKey != null && val instanceof Array) {
endValue = val[val.length - 1];
if (node.templateKey !== endValue.templateKey) {
node.templateKey = endValue.templateKey;
val = values;
}
}

@@ -617,0 +628,0 @@ if (val !== node.children.lastValue) {

@@ -98,2 +98,12 @@ (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){

function PrototypeComponent(props) {
this.props = props;
this.state = {};
if (this.constructor) {
this.constructor();
}
};
PrototypeComponent.prototype.forceUpdate = function () {};
Inferno.createValueNode = function (value, valueKey) {

@@ -103,2 +113,11 @@ return new ValueNode(value, valueKey);

Inferno.createClass = function (options) {
var component = new PrototypeComponent();
// PrototypeComponent.prototype.constructor = options.constructor;
for (var property in options) {
PrototypeComponent[property] = options[property];
}
return component;
};
Inferno.render = function (render, dom, listeners, component) {

@@ -128,3 +147,3 @@ var rootNode = null;

}
updateNode(dom.rootNode[0], dom.rootNode, dom, values, null, listeners, component);
updateNode(dom.rootNode[0], dom.rootNode, dom, values, listeners, component);
}

@@ -142,3 +161,3 @@ } else {

values = render();
updateNode(component._rootNode[0], component._rootNode, dom, values, 0, null, listeners, component);
updateNode(component._rootNode[0], component._rootNode, dom, values, 0, listeners, component);
}

@@ -269,5 +288,2 @@ }

if (node.component instanceof Component) {
// if(node.component.beforeRender) {
// node.component.beforeRender(node.props, values);
// }
node.component.forceUpdate();

@@ -452,3 +468,3 @@ }

function updateNode(node, parentNode, parentDom, values, index, valIndex, listeners, component) {
function updateNode(node, parentNode, parentDom, values, index, listeners, component) {
var i = 0,

@@ -459,2 +475,3 @@ s = 0,

key = "",
length = 0,
childNode = null,

@@ -466,13 +483,6 @@ endValue = null;

}
//we need to get the actual values and the templatekey
if (valIndex != null) {
endValue = values[valIndex][values[valIndex].length - 1];
if (node.templateKey && node.templateKey !== endValue.templateKey) {
//TODO, basically copy below
node.templateKey = endValue.templateKey;
}
values = values[valIndex];
} else {
if (node.templateKey != null && values instanceof Array) {
endValue = values[values.length - 1];
if (node.templateKey && node.templateKey !== endValue.templateKey) {
if (node.templateKey !== endValue.templateKey) {
//remove node

@@ -489,3 +499,3 @@ removeNode(node, parentDom);

//if this is a component
if (node.component instanceof Component) {
if (node.component != null && node.component instanceof Component) {
if (node.propsValueKeys) {

@@ -501,10 +511,8 @@ for (key in node.propsValueKeys) {

if (node.attrs != null && node.hasDynamicAttrs === true) {
for (i = 0; i < node.attrs.length; i = i + 1 | 0) if (events[node.attrs[i].name] == null) {
{
if (node.attrs[i].value instanceof ValueNode) {
val = values[node.attrs[i].value.valueKey];
if (val !== node.attrs[i].value.lastValue) {
node.attrs[i].value.lastValue = val;
handleNodeAttributes(node.tag, node.dom, node.attrs[i].name, val);
}
for (i = 0, length = node.attrs.length; i < length; i = i + 1 | 0) if (events[node.attrs[i].name] == null) {
if (node.attrs[i].value instanceof ValueNode) {
val = values[node.attrs[i].value.valueKey];
if (val !== node.attrs[i].value.lastValue) {
node.attrs[i].value.lastValue = val;
handleNodeAttributes(node.tag, node.dom, node.attrs[i].name, val);
}

@@ -517,4 +525,4 @@ }

val = values[node.valueKey];
endValue = val[val.length - 1];
if (endValue != null && endValue.templateKey != null) {
if (node.value.templateKey != null) {
endValue = val[val.length - 1];
if (node.value.templateKey !== endValue.templateKey) {

@@ -535,11 +543,11 @@ //we want to remove the DOM current node

if (node.value instanceof Array) {
for (i = 0; i < node.value.length; i = i + 1 | 0) {
if (typeof node.value[i] !== "string") {
updateNode(node.value[i], node, parentDom, val, i, i, listeners, component);
for (i = 0, length = node.value.length; i < length; i = i + 1 | 0) {
if (typeof node.value[i] !== "string" || typeof node.value[i] !== "number") {
updateNode(node.value[i], node, parentDom, val[i], i, listeners, component);
}
}
} else if (node.value.children instanceof Array) {
for (i = 0; i < node.value.children.length; i = i + 1 | 0) {
if (typeof node.value.children[i] !== "string") {
updateNode(node.value.children[i], node.value, node.value.dom, val, i, null, listeners, component);
for (i = 0, length = node.value.children.length; i < length; i = i + 1 | 0) {
if (typeof node.value.children[i] !== "string" || typeof node.value.children[i] !== "number") {
updateNode(node.value.children[i], node.value, node.value.dom, val, i, listeners, component);
}

@@ -552,3 +560,3 @@ }

if (node.children instanceof Array) {
for (i = 0; i < node.children.length; i = i + 1 | 0) {
for (i = 0, length = node.children.length; i < length; i = i + 1 | 0) {
if (node.children[i].isDynamic === true) {

@@ -568,3 +576,3 @@ if (node.children[i] instanceof ValueNode && !node.children[i].isRoot) {

} else {
updateNode(node.children[i], node, node.dom, values, i, null, listeners, component);
updateNode(node.children[i], node, node.dom, values, i, listeners, component);
}

@@ -576,4 +584,4 @@ }

val = values[node.children.valueKey];
endValue = val[val.length - 1];
if (endValue != null && endValue.templateKey != null) {
if (node.children.templateKey != null) {
endValue = val[val.length - 1];
if (node.children.templateKey !== endValue.templateKey) {

@@ -586,3 +594,3 @@ //we want to remove the DOM current node

node.children.value = t7.getTemplateFromCache(endValue.templateKey, val);
createNode(node.children.value, node.children, node.dom, val, null, i, listeners, component);
createNode(node.children.value, node.children, node.dom, val[i], null, listeners, component);
//then we want to set the new templatekey

@@ -593,6 +601,7 @@ node.children.templateKey = endValue.templateKey;

}
if (val !== node.children.lastValue) {
if (val instanceof Array) {
//check if the sizes have changed
//in this case, our new array has more items so we'll need to add more children
if (val !== node.children.lastValue && val instanceof Array) {
//check if the sizes have changed
//in this case, our new array has more items so we'll need to add more children
if (val.length !== node.children.lastValue.length) {
if (val.length > node.children.lastValue.length) {

@@ -617,6 +626,6 @@ //easiest way to add another child is to clone the node, so let's clone the first child

}
for (i = 0; i < node.children.value.length; i = i + 1 | 0) {
if (typeof node.children.value[i] !== "string") {
updateNode(node.children.value[i], node.children.value, node.dom, val, i, i, listeners, component);
}
}
for (i = 0, length = node.children.value.length; i < length; i = i + 1 | 0) {
if (typeof node.children.value[i] === "object") {
updateNode(node.children.value[i], node.children.value, node.dom, val[i], i, listeners, component);
}

@@ -628,6 +637,8 @@ }

val = values[node.children.valueKey];
endValue = val[val.length - 1];
if (endValue != null && endValue.templateKey != null) {
node.templateKey = endValue.templateKey;
val = values;
if (node.templateKey != null && val instanceof Array) {
endValue = val[val.length - 1];
if (node.templateKey !== endValue.templateKey) {
node.templateKey = endValue.templateKey;
val = values;
}
}

@@ -667,3 +678,3 @@ if (val !== node.children.lastValue) {

var precompile = false;
var version = "0.2.8";
var version = "0.2.14";

@@ -860,3 +871,2 @@ if(isBrowser === true) {

if(root.tag != null) {
component
if(isComponentName(root.tag) === false) {

@@ -884,3 +894,2 @@ functionText.push("{tag: '" + root.tag + "'");

throw new Error("Error referencing component '" + root.tag + "'. Components can only be used when within modules. See documentation for more information on t7.module().");
return;
}

@@ -915,3 +924,2 @@ if(output === t7.Outputs.Universal) {

throw new Error("Error referencing component '" + root.tag + "'. Components can only be used when within modules. See documentation for more information on t7.module().");
return;
}

@@ -1006,3 +1014,2 @@ functionText.push("React.createElement(__$components__." + root.tag);

throw new Error("Expected corresponding t7 closing tag for '" + parent.tag + "'.");
return;
}

@@ -1229,3 +1236,4 @@ //when the childText is not empty

if(t7._cache[templateKey] != null) {
return {values: values, templateKey: templateKey, components: this};
values.push({templateKey: templateKey, components: this});
return values;
} else {

@@ -1259,3 +1267,3 @@ returnValuesButBuildTemplate = true;

templateKey: templateKey,
template: '"use strict";var __$props__ = arguments[0];var __$components__ = arguments[1];return ' + scriptCode
template: 'return ' + scriptCode
}

@@ -1275,3 +1283,4 @@ } else {

if(returnValuesButBuildTemplate === true) {
return {values: values, templateKey: templateKey, components: this};
values.push({templateKey: templateKey, components: this});
return values;
}

@@ -1310,22 +1319,17 @@ return t7._cache[templateKey](values, this);

function cleanValues(values, newValues) {
var i = 0, ii = 0;
if(values.length > 0) {
for(i = 0; i < values.length; i = i + 1 | 0) {
if(values[i] && values[i].templateKey != null) {
newValues[i] = t7.getTemplateFromCache(values[i].templateKey, values[i].values);
} else if(values[i] instanceof Array) {
var i = 0, ii = 0, val = null, endVal = null;
for(i = 0; i < values.length; i = i + 1 | 0) {
val = values[i];
if(val instanceof Array) {
endVal = val[val.length - 1];
if(endVal.templateKey != null) {
newValues[i] = t7.getTemplateFromCache(endVal.templateKey, val);
} else {
newValues[i] = [];
for(ii = 0; ii < values[i].length; ii = ii + 1 | 0) {
if(values[i][ii].templateKey != null) {
newValues[i][ii] = t7.getTemplateFromCache(values[i][ii].templateKey, values[i][ii].values);
} else {
newValues[i][ii] = values[i][ii];
}
}
} else {
newValues[i] = values[i];
cleanValues(values[i], newValues[i]);
}
} else {
newValues[i] = val;
}
}
return values;
};

@@ -1406,4 +1410,4 @@

instance.getOutput = t7.getOutput;
instance.precompile = function(precompiledObj) {
return t7.precompile(precompiledObj, components);
instance.precompile = function(values) {
return t7.precompile(values, components);
};

@@ -1414,11 +1418,12 @@

t7.precompile = function(precompiledObj, components) {
if(t7._cache[precompiledObj.templateKey] == null) {
t7._cache[precompiledObj.templateKey] = precompiledObj.template;
t7.precompile = function(values, components) {
var endVal = values[values.length - 1];
if(t7._cache[endVal.templateKey] == null) {
t7._cache[endVal.templateKey] = endVal.template;
}
if(output === t7.Outputs.Inferno) {
precompiledObj.components = components;
return precompiledObj
endVal.components = components;
return values
} else {
return t7.getTemplateFromCache(precompiledObj.templateKey, precompiledObj.values, components);
return t7.getTemplateFromCache(endVal.templateKey, values, components);
}

@@ -1425,0 +1430,0 @@ };

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

/*! InfernoJS 2015-07-19 */ !function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){"use strict";var d=a("./inferno.js"),e=a("t7");e.setOutput(e.Outputs.Inferno),"undefined"!=typeof window?(window.Inferno=d,window.t7=e):b.exports=d},{"./inferno.js":2,t7:3}],2:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function e(a,b){a&&null!=a.tag?this.isRoot=!0:a&&a instanceof Array&&(this.isRoot=!0),this.value=a,this.valueKey=b}function f(a,b){switch(a){case"input":return"value"===b||"checked"===b;case"textarea":return"value"===b;case"select":return"value"===b||"selectedIndex"===b;case"option":return"selected"===b}}function g(a,b,c){if(c===!1||null==c)a.removeAttribute(b);else{c===!0&&(c="");var d,e=b.indexOf(":");if(-1!==e){var f=b.substr(0,e);switch(f){case"xlink":d="http://www.w3.org/1999/xlink"}}a.setAttribute(b,c)}}function h(a,b,c){c&&a.firstChild?a.firstChild.nodeValue=b:r?a.textContent=b:a.innerText=b}function i(a,b,c,d){"style"===c?updateStyle(b,oldAttrValue,attrs,d):f(a,c)?b[c]!==d&&(b[c]=d):"class"===c?b.className=d:g(b,c,d)}function j(a){var b={click:[]};return a.addEventListener("click",function(a){for(var c=0;c<b.click.length;c=c+1|0)b.click[c].target===a.target&&b.click[c].callback.call(b.click[c].component,a)}),b}function k(a,b,c,d,f,g,h,l){var m=0,n=0,o=null,p=!1,q=null,r=null;if(null!=f?(r=d[f][d[f].length-1],r.templateKey&&(a.templateKey=r.templateKey),d=d[f]):(r=d[d.length-1],r.templateKey&&(a.templateKey=r.templateKey)),a.component)return"function"==typeof a.component&&(a.component=new a.component(a.props),q=j(c),a.component.forceUpdate=u.render.bind(null,a.component.render.bind(a.component),c,q,a.component),a.component.forceUpdate(),a.isDynamic=!0),a.component instanceof v&&a.component.forceUpdate(),!0;if(null!=a.tag&&(null!==t&&t[a.tag]?a.dom=t[a.tag].cloneNode(!1):a.dom=document.createElement(a.tag),g?c.insertBefore(a.dom,c.childNodes[g]):c.appendChild(a.dom)),null!=a.attrs)for(m=0;m<a.attrs.length;m=m+1|0)null!=s[a.attrs[m].name]?(a.attrs[m].value.lastValue=d[a.attrs[m].value.valueKey],h[s[a.attrs[m].name]].push({target:a.dom,callback:a.attrs[m].value.value,component:l}),a.hasDynamicAttrs=!0,a.isDynamic=!0):a.attrs[m].value instanceof e?(a.hasDynamicAttrs=!0,a.isDynamic=!0,a.attrs[m].value.lastValue=d[a.attrs[m].value.valueKey],i(a.tag,a.dom,a.attrs[m].name,a.attrs[m].value.value)):i(a.tag,a.dom,a.attrs[m].name,a.attrs[m].value);if(null!=a.children)if(a.children instanceof Array)for(m=0;m<a.children.length;m=m+1|0)if("string"==typeof a.children[m]||"number"==typeof a.children[m]||"undefined"==typeof a.children[m])o=document.createTextNode(a.children[m]),a.dom.appendChild(o);else if(a.children[m]instanceof e)if(a.children[m].lastValue=d[a.children[m].valueKey],null!=a.children[m].lastValue&&null!=a.children[m].lastValue.templateKey&&(a.children[m].templateKey=a.children[m].lastValue.templateKey,a.children[m].lastValue=a.children[m].lastValue.values),a.isDynamic=!0,a.children[m].isDynamic=!0,a.children[m].isRoot===!0)if(a.children[m].isDynamic=!0,a.children[m].value instanceof Array)if(null!=a.children[m].templateKey)for(n=0;n<a.children[m].value.length;n=n+1|0)k(a.children[m].value[n],a.children[m],a.dom,d[a.children[m].valueKey].values,n,null,h,l);else for(n=0;n<a.children[m].value.length;n=n+1|0)k(a.children[m].value[n],a.children[m],a.dom,d[a.children[m].valueKey],n,null,h,l);else k(a.children[m].value,a.children[m],a.dom,d[a.children[m].valueKey],null,null,h,l);else a.children[m]instanceof e?(a.children[m].lastValue=d[a.children[m].valueKey],o=document.createTextNode(a.children[m].lastValue),a.dom.appendChild(o)):(o=document.createTextNode(a.children[m].value),a.dom.appendChild(o));else p=k(a.children[m],a,a.dom,d,null,null,h,l),p===!0&&(a.children[m].isDynamic=!0,a.isDynamic=!0);else if("string"==typeof a.children)o=document.createTextNode(a.children),a.dom.appendChild(o);else{if(a.children instanceof e&&a.children.isRoot===!0){if(a.children.value instanceof Array)for(m=0;m<a.children.value.length;m=m+1|0)k(a.children.value[m],a,a.dom,d[a.children.valueKey],m,null,h,l);else k(a.children.value,a,a.dom,d[a.children.valueKey],null,null,h,l);return a.children.isDynamic=!0,a.children.lastValue=d[a.children.valueKey],!0}a.children instanceof e&&(a.children.lastValue=d[a.children.valueKey],("string"==typeof a.children.lastValue||"number"==typeof a.children.lastValue)&&(o=document.createTextNode(a.children.lastValue),a.dom.appendChild(o)),a.isDynamic=!0)}return a.isDynamic?!0:!1}function l(a){var b=[];return b}function m(a,b){var c=0,d=null,f={tag:a.tag,dom:a.dom.cloneNode(!1),attrs:l(a.attrs)};if(a.isDynamic===!0&&(f.isDynamic=!0),a.children instanceof e)f.children=new e(a.children.value,a.children.valueKey);else if(a.children instanceof Array)for(f.children=[],c=0;c<a.children.length;c=c+1|0)a.children[c]instanceof e?(d=document.createTextNode(a.children[c].value),f.dom.appendChild(d),f.children.push(new e(a.children[c].value,a.children[c].valueKey))):"string"==typeof a.children[c]||"number"==typeof a.children[c]?(d=document.createTextNode(a.children[c]),f.dom.appendChild(d),f.children.push(a.children[c])):f.children.push(m(a.children[c],f.dom)),a.children[c].isDynamic===!0&&(f.children[c].isDynamic=!0);else("string"==typeof a.children||"number"==typeof a.children)&&(d=document.createTextNode(a.children),f.dom.appendChild(d),f.children=a.children);return b.appendChild(f.dom),f}function n(a,b){b.removeChild(a.dom)}function o(a,b,c,d,f,g,j,l){var p=0,r=0,t="",u="",w=null,x=null;if(a.isDynamic!==!1){if(null!=g?(x=d[g][d[g].length-1],a.templateKey&&a.templateKey!==x.templateKey&&(a.templateKey=x.templateKey),d=d[g]):(x=d[d.length-1],a.templateKey&&a.templateKey!==x.templateKey&&(n(a,c),a=q.getTemplateFromCache(x.templateKey,d),k(a,b,c,d,null,null,j,l),b[f]=a,a.templateKey=x.templateKey)),a.component instanceof v){if(a.propsValueKeys)for(u in a.propsValueKeys)a.props[u]=d[a.propsValueKeys[u]];return void a.component.forceUpdate()}if(null!=a.attrs&&a.hasDynamicAttrs===!0)for(p=0;p<a.attrs.length;p=p+1|0)null==s[a.attrs[p].name]&&a.attrs[p].value instanceof e&&(t=d[a.attrs[p].value.valueKey],t!==a.attrs[p].value.lastValue&&(a.attrs[p].value.lastValue=t,i(a.tag,a.dom,a.attrs[p].name,t)));if(a instanceof e&&a.isRoot){if(t=d[a.valueKey],x=t[t.length-1],null!=x&&null!=x.templateKey&&a.value.templateKey!==x.templateKey&&(n(a.value,c),a.value=q.getTemplateFromCache(x.templateKey,t),k(a.value,a,c,t,null,f,j,l),a.value.templateKey=x.templateKey,a.lastValue=d),t!==a.lastValue){if(a.value instanceof Array)for(p=0;p<a.value.length;p=p+1|0)"string"!=typeof a.value[p]&&o(a.value[p],a,c,t,p,p,j,l);else if(a.value.children instanceof Array)for(p=0;p<a.value.children.length;p=p+1|0)"string"!=typeof a.value.children[p]&&o(a.value.children[p],a.value,a.value.dom,t,p,null,j,l);a.lastValue=t}}else if(null!=a.children)if(a.children instanceof Array)for(p=0;p<a.children.length;p=p+1|0)a.children[p].isDynamic===!0&&(a.children[p]instanceof e&&!a.children[p].isRoot?(t=d[a.children[p].valueKey],x=t[t.length-1],null!=x&&null!=x.templateKey&&(a.children[p].templateKey=x.templateKey,t=d),t!==a.children[p].lastValue&&(a.children[p].lastValue=t,h(a.dom.childNodes[p],t,!0))):o(a.children[p],a,a.dom,d,p,null,j,l));else if(a.children instanceof e&&a.children.isRoot===!0){if(t=d[a.children.valueKey],x=t[t.length-1],null!=x&&null!=x.templateKey&&a.children.templateKey!==x.templateKey&&(n(a.children.value,a.dom),a.children.value=q.getTemplateFromCache(x.templateKey,t),k(a.children.value,a.children,a.dom,t,null,p,j,l),a.children.templateKey=x.templateKey,a.children.lastValue=d),t!==a.children.lastValue){if(t instanceof Array){if(t.length>a.children.lastValue.length)for(r=0;r<t.length-a.children.lastValue.length;r=r+1|0)a.children.value.length>0?w=m(a.children.value[0],a.dom):(w=q.getTemplateFromCache(t[r].templateKey,t[r].values),k(w,a,a.dom,t,null,p,j,l)),a.children.value.push(w);else if(t.length<a.children.lastValue.length)for(r=0;r<a.children.lastValue.length-t.length;r=r+1|0)n(a.children.value[a.children.value.length-1],a.dom),a.children.value.pop();for(p=0;p<a.children.value.length;p=p+1|0)"string"!=typeof a.children.value[p]&&o(a.children.value[p],a.children.value,a.dom,t,p,p,j,l)}a.children.lastValue=t}}else a.children instanceof e&&(t=d[a.children.valueKey],x=t[t.length-1],null!=x&&null!=x.templateKey&&(a.templateKey=x.templateKey,t=d),t!==a.children.lastValue&&(a.children.lastValue=t,("string"==typeof t||"number"==typeof t||t instanceof Date)&&h(a.dom,t,!0)))}}var p=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),q=a("t7"),r="textContent"in document,s={onClick:"click"},t=null;"undefined"!=typeof window&&(t={div:document.createElement("div"),span:document.createElement("span"),a:document.createElement("a"),p:document.createElement("p"),li:document.createElement("li"),tr:document.createElement("tr"),td:document.createElement("td")});var u={},v=function(){function a(b){d(this,a),this.props=b,this.state={}}return p(a,[{key:"render",value:function(){}},{key:"forceUpdate",value:function(){}},{key:"setState",value:function(a){for(var b in a)this.state[b]=a[b];this.forceUpdate()}},{key:"replaceState",value:function(a){this.state=newSate,this.forceUpdate()}}]),a}();u.Component=v,u.createValueNode=function(a,b){return new e(a,b)},u.render=function(a,b,c,d){var e=null,f=null,g=null;null==d?null==b.rootNode?("function"==typeof a?(g=a(),f=g[g.length-1],e=q.getTemplateFromCache(f.templateKey,g,f.components)):(g=a,f=a[g.length-1],e=q.getTemplateFromCache(f.templateKey,g,f.components)),k(e,null,b,g,null,null,c,d),b.rootNode=[e]):("function"==typeof a?g=a():a.length>0&&(g=a),o(b.rootNode[0],b.rootNode,b,g,null,c,d)):null==d._rootNode?(g=a(),f=g[g.length-1],g&&(e=q.getTemplateFromCache(f.templateKey,g,f.components),k(e,null,b,g,null,null,c,d),d._rootNode=[e])):(g=a(),o(d._rootNode[0],d._rootNode,b,g,0,null,c,d))},b.exports=u},{t7:3}],3:[function(a,b,c){var d=function(){"use strict";function a(a,b,c,d){var e=[],f=0,h=0,i=null;if(null!=a.children&&a.children instanceof Array){for(f=0,h=a.children.length;h>f;f++)null!=a.children[f]&&("string"==typeof a.children[f]?(a.children[f]=a.children[f].replace(/(\r\n|\n|\r)/gm,""),i=a.children[f].match(/__\$props__\[\d*\]/g),null!==i?s===o.Outputs.Inferno?(a.children[f]=a.children[f].replace(/(__\$props__\[([0-9]*)\])/g,"Inferno.createValueNode($1,$2),"),","===a.children[f].substring(a.children[f].length-1)&&(a.children[f]=a.children[f].substring(0,a.children[f].length-1)),e.push(a.children[f])):e.push(a.children[f]):e.push("'"+a.children[f]+"'")):g(a.children[f],e,d));1===e.length?b.push((c?"children: ":"")+e):b.push((c?"children: ":"")+"["+e.join(",")+"]")}else null!=a.children&&"string"==typeof a.children&&(a.children=a.children.replace(/(\r\n|\n|\r)/gm,"").trim(),i=a.children.match(/__\$props__\[\d*\]/g),null!==i&&(s===o.Outputs.Inferno?a.children=a.children.replace(/(__\$props__\[([0-9]*)\])/g,"Inferno.createValueNode($1,$2),"):a.children=a.children.replace(/(__\$props__\[.*\])/g,"',$1,'")),",'"===a.children.substring(a.children.length-2)?(a.children=a.children.substring(0,a.children.length-2),b.push((c?"children: ":"")+"['"+a.children+"]")):b.push((c?"children: ":"")+"['"+a.children+"']"))}function b(a,b,c,d){var e=[],f=0,h=0,i=null;if(null!=a.children&&a.children instanceof Array){for(f=0,h=a.children.length;h>f;f++)null!=a.children[f]&&("string"==typeof a.children[f]?(a.children[f]=a.children[f].replace(/(\r\n|\n|\r)/gm,""),i=a.children[f].match(/__\$props__\[\d*\]/g),null!=i?(a.children[f]=a.children[f].replace(/(__\$props__\[[0-9]*\])/g,"$1"),","===a.children[f].substring(a.children[f].length-1)&&(a.children[f]=a.children[f].substring(0,a.children[f].length-1)),e.push(a.children[f])):e.push("'"+a.children[f]+"'")):g(a.children[f],e,f===a.children.length-1,d));e.length>0&&b.push(e.join(","))}else null!=a.children&&"string"==typeof a.children&&(a.children=a.children.replace(/(\r\n|\n|\r)/gm,""),b.push("'"+a.children+"'"))}function c(a,b){var c="",d=null;for(var e in a.attrs)c=a.attrs[e],d=c.match(/__\$props__\[\d*\]/g),null===d?b.push("'"+e+"':'"+c+"'"):b.push("'"+e+"':"+c)}function d(a,b){var c="",d=null;for(var e in a.attrs)c=a.attrs[e],d=c.match(/__\$props__\[\d*\]/g),null!==d&&b.push("'"+e+"':"+c.replace(/(__\$props__\[([0-9]*)\])/g,"$2"))}function e(a,b){var c="",d=null;for(var e in a.attrs)c=a.attrs[e],d=c.match(/__\$props__\[\d*\]/g),null===d?b.push("{name:'"+e+"',value:'"+c+"'}"):b.push("{name:'"+e+"',value:"+c.replace(/(__\$props__\[([0-9]*)\])/g,"Inferno.createValueNode($1,$2)")+"}")}function f(a){return a[0]===a[0].toUpperCase()?!0:!1}function g(g,h,i){var j=[],k=[],l=[];if(g instanceof Array);else if(s===o.Outputs.Universal||s===o.Outputs.Inferno||s===o.Outputs.Mithril)if(null!=g.tag)if(f(g.tag)===!1)h.push("{tag: '"+g.tag+"'"),null!=g.key&&j.push("key: "+g.key),null!=g.attrs&&(s===o.Outputs.Inferno?(e(g,k),j.push("attrs: ["+k.join(",")+"]")):(c(g,k),j.push("attrs: {"+k.join(",")+"}"))),a(g,j,!0,i),h.push(j.join(",")+"}");else{if(("undefined"!=typeof window&&i===window||null==i)&&u===!1)throw new Error("Error referencing component '"+g.tag+"'. Components can only be used when within modules. See documentation for more information on t7.module().");s===o.Outputs.Universal?(c(g,k),h.push("__$components__."+g.tag+"({"+k.join(",")+"})")):s===o.Outputs.Mithril?(c(g,k),h.push("m.component(__$components__."+g.tag+",{"+k.join(",")+"})")):s===o.Outputs.Inferno&&(c(g,k),d(g,l),h.push("{component:__$components__."+g.tag+", props: {"+k.join(",")+"}, propsValueKeys: {"+l.join(",")+"}}"))}else h.push("'"+g+"'");else if(s===o.Outputs.React)if(null!=g.tag){if(f(g.tag)===!0){if(("undefined"!=typeof window&&i===window||null==i)&&u===!1)throw new Error("Error referencing component '"+g.tag+"'. Components can only be used when within modules. See documentation for more information on t7.module().");h.push("React.createElement(__$components__."+g.tag)}else h.push("React.createElement('"+g.tag+"'");null!=g.attrs?(c(g,k),null!=g.key&&k.push("'key':"+g.key),j.push("{"+k.join(",")+"}")):j.push("null"),b(g,j,!0,i),h.push(j.join(",")+")")}else g=g.replace(/(\r\n|\n|\r)/gm,"\\n"),h.push("'"+g+"'")}function h(a,b,c){var d=0,e=a.split(/(__\$props__\[\d*\])/g);for(d=0;d<e.length;d++)""!==e[d].trim()&&b.children.push(e[d]);return a=null}function i(a){return a.indexOf("'")>-1&&(a=a.replace(/'/g,"\\'")),a}function j(a,b){for(var c=0,d=/__\$props__\[([0-9]*)\]/,e=a.match(/__\$props__\[([0-9]*)\]/g),f=0;f<e.length;f++)c=d.exec(e[f])[1],a=a.replace(e[f],b[c]);return a}function k(a,b){var c="",d="",e=0,f=0,g=null,k=!1,m="",n="",o=null,p="",q=null,r=null;for(e=0,f=a.length;f>e;e++)if(c=a[e],"<"===c)k=!0;else if(">"===c&&k===!0){if("/"===m[0]){if(m!=="/"+q.tag&&-1===t.indexOf(q.tag)&&!q.closed)throw console.error("Template error: "+j(a,b)),new Error("Expected corresponding t7 closing tag for '"+q.tag+"'.");""!==p.trim()&&(p=i(p),p=h(p,q,!0),null!==p&&0===q.children.length?q.children=p:null!=p&&q.children.push(p)),q=q.parent,q&&(q.closed=!0)}else{if(p.trim().length>0&&!(q instanceof Array)&&(p=i(p),p=h(p.replace(/(\r\n|\n|\r)/gm,""),q),q.children.push(p),p=""),-1===m.indexOf(" ")?(r={},n=m):(r=l(m),n=r.tag),o={tag:n,attrs:r&&r.attrs?r.attrs:{},children:[],closed:"/"===m[m.length-1]||t.indexOf(n)>-1?!0:!1},r&&r.key&&(o.key=r.key),null===q){if(null!==g)throw new Error("t7 templates must contain only a single root element");g=q=o}else q instanceof Array?q.push(o):q.children.push(o);-1===t.indexOf(n)&&(q===o?o.parent=null:o.parent=q,q=o)}k=!1,m="",p=""}else k===!0?(m+=c,d=c):(p+=c,d=c);return g}function l(a){var b=[],c="",d="",e=0,f=0,g=0,h=0,i="",j=!1,k=[],l={},m="";for(e=0,g=a.length;g>e;e++)c=a[e]," "===c&&j===!1?(b.push(i),i=""):"'"===c?j===!1?j=!0:(j=!1,b.push(i),i=""):'"'===c?j===!1?j=!0:(j=!1,b.push(i),i=""):i+=c;for(""!==i&&b.push(i),i="",e=1,g=b.length;g>e;e++){for(k=[],d="",i="",f=0,h=b[e].length;h>f;f++)c=b[e][f],"="===c?(k.push(i),i=""):(i+=c,d=c);if(""!=i&&k.push(i),k.length>1){var n=k[1].match(/__\$props__\[\d*\]/g);null!==n?l[k[0]]=k[1]:"key"===k[0]?m=k[1]:l[k[0]]=k[1]}}return{tag:b[0],attrs:l,key:m}}function m(a,b){var c=a+"\n//# sourceURL="+b,d=document.createElement("script");d.textContent=c,r.appendChild(d)}function n(a){var b,c,d,e=0;if(0==a.length)return a;for(b=0,d=a.length;d>b;b++)c=a.charCodeAt(b),e=(e<<5)-e+c,e|=0;return e}function o(a){for(var b=null,c=1,d=arguments.length,e=null,f=null,h="",i=null,j=a[0],l=!1,p=[].slice.call(arguments,1);d>c;c++)j+=a[c];if(i=n(j),s===o.Outputs.Inferno){if(null!=o._cache[i])return{values:p,templateKey:i,components:this};l=!0}if(null==o._cache[i]){for(b="",c=0,d=a.length;d>c;c++)b+=c===a.length-1?a[c]:a[c]+"__$props__["+c+"]";if(e=[],g(k(b,p),e,this),h=e.join(","),u===!0)return{templateKey:i,template:'"use strict";var __$props__ = arguments[0];var __$components__ = arguments[1];return '+h};q===!0?(f='t7._cache["'+i+'"]=function(__$props__, __$components__)',f+='{"use strict";return '+h+"}",m(f,i)):o._cache[i]=new Function('"use strict";var __$props__ = arguments[0];var __$components__ = arguments[1];return '+h)}return l===!0?{values:p,templateKey:i,components:this}:o._cache[i](p,this)}function p(a,b){var c=0,d=0;if(a.length>0)for(c=0;c<a.length;c=c+1|0)if(a[c]&&null!=a[c].templateKey)b[c]=o.getTemplateFromCache(a[c].templateKey,a[c].values);else if(a[c]instanceof Array)for(b[c]=[],d=0;d<a[c].length;d=d+1|0)null!=a[c][d].templateKey?b[c][d]=o.getTemplateFromCache(a[c][d].templateKey,a[c][d].values):b[c][d]=a[c][d];else b[c]=a[c];return a}var q="undefined"!=typeof window&&null!=document,r=null,s=null,t=[],u=!1,v="0.2.8";q===!0&&(r=document.getElementsByTagName("head")[0]),t=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"];return o._cache={},o.Outputs={React:1,Universal:2,Inferno:3,Mithril:4},o.getOutput=function(){return s},o.setPrecompile=function(a){u=a},o.getVersion=function(){return v},o["if"]=function(a,b){return a?{"else":function(){return b()}}:{"else":function(a){return a()}}},o.setOutput=function(a){s=a},o.clearCache=function(){o._cache={}},o.assign=function(a){throw new Error("Error assigning component '"+a+"'. You can only assign components from within a module. Please check documentation for t7.module().")},o.module=function(a){var b={},c=function(){return o.apply(b,arguments)};c.assign=function(a,c){if(2===arguments.length)b[a]=c;else for(var d in a)b[d]=a[d]},c["if"]=o["if"],c.Outputs=o.Outputs,c.clearCache=o.clearCache,c.setOutput=o.setOutput,c.getOutput=o.getOutput,c.precompile=function(a){return o.precompile(a,b)},a(c)},o.precompile=function(a,b){return null==o._cache[a.templateKey]&&(o._cache[a.templateKey]=a.template),s===o.Outputs.Inferno?(a.components=b,a):o.getTemplateFromCache(a.templateKey,a.values,b)},o.getTemplateFromCache=function(a,b,c){var d=[];return p(b,d),o._cache[a](d,c)},s="undefined"!=typeof React?o.Outputs.React:"undefined"!=typeof Inferno?o.Outputs.Inferno:o.Outputs.Universal,o}();"undefined"!=typeof b&&null!=b.exports&&(b.exports=d)},{}]},{},[1]);
/*! InfernoJS 2015-07-20 */ !function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){"use strict";var d=a("./inferno.js"),e=a("t7");e.setOutput(e.Outputs.Inferno),"undefined"!=typeof window?(window.Inferno=d,window.t7=e):b.exports=d},{"./inferno.js":2,t7:3}],2:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function e(a,b){a&&null!=a.tag?this.isRoot=!0:a&&a instanceof Array&&(this.isRoot=!0),this.value=a,this.valueKey=b}function f(a){this.props=a,this.state={},this.constructor&&this.constructor()}function g(a,b){switch(a){case"input":return"value"===b||"checked"===b;case"textarea":return"value"===b;case"select":return"value"===b||"selectedIndex"===b;case"option":return"selected"===b}}function h(a,b,c){if(c===!1||null==c)a.removeAttribute(b);else{c===!0&&(c="");var d,e=b.indexOf(":");if(-1!==e){var f=b.substr(0,e);switch(f){case"xlink":d="http://www.w3.org/1999/xlink"}}a.setAttribute(b,c)}}function i(a,b,c){c&&a.firstChild?a.firstChild.nodeValue=b:s?a.textContent=b:a.innerText=b}function j(a,b,c,d){"style"===c?updateStyle(b,oldAttrValue,attrs,d):g(a,c)?b[c]!==d&&(b[c]=d):"class"===c?b.className=d:h(b,c,d)}function k(a){var b={click:[]};return a.addEventListener("click",function(a){for(var c=0;c<b.click.length;c=c+1|0)b.click[c].target===a.target&&b.click[c].callback.call(b.click[c].component,a)}),b}function l(a,b,c,d,f,g,h,i){var m=0,n=0,o=null,p=!1,q=null,r=null;if(null!=f?(r=d[f][d[f].length-1],r.templateKey&&(a.templateKey=r.templateKey),d=d[f]):(r=d[d.length-1],r.templateKey&&(a.templateKey=r.templateKey)),a.component)return"function"==typeof a.component&&(a.component=new a.component(a.props),q=k(c),a.component.forceUpdate=v.render.bind(null,a.component.render.bind(a.component),c,q,a.component),a.component.forceUpdate(),a.isDynamic=!0),a.component instanceof w&&a.component.forceUpdate(),!0;if(null!=a.tag&&(null!==u&&u[a.tag]?a.dom=u[a.tag].cloneNode(!1):a.dom=document.createElement(a.tag),g?c.insertBefore(a.dom,c.childNodes[g]):c.appendChild(a.dom)),null!=a.attrs)for(m=0;m<a.attrs.length;m=m+1|0)null!=t[a.attrs[m].name]?(a.attrs[m].value.lastValue=d[a.attrs[m].value.valueKey],h[t[a.attrs[m].name]].push({target:a.dom,callback:a.attrs[m].value.value,component:i}),a.hasDynamicAttrs=!0,a.isDynamic=!0):a.attrs[m].value instanceof e?(a.hasDynamicAttrs=!0,a.isDynamic=!0,a.attrs[m].value.lastValue=d[a.attrs[m].value.valueKey],j(a.tag,a.dom,a.attrs[m].name,a.attrs[m].value.value)):j(a.tag,a.dom,a.attrs[m].name,a.attrs[m].value);if(null!=a.children)if(a.children instanceof Array)for(m=0;m<a.children.length;m=m+1|0)if("string"==typeof a.children[m]||"number"==typeof a.children[m]||"undefined"==typeof a.children[m])o=document.createTextNode(a.children[m]),a.dom.appendChild(o);else if(a.children[m]instanceof e)if(a.children[m].lastValue=d[a.children[m].valueKey],null!=a.children[m].lastValue&&null!=a.children[m].lastValue.templateKey&&(a.children[m].templateKey=a.children[m].lastValue.templateKey,a.children[m].lastValue=a.children[m].lastValue.values),a.isDynamic=!0,a.children[m].isDynamic=!0,a.children[m].isRoot===!0)if(a.children[m].isDynamic=!0,a.children[m].value instanceof Array)if(null!=a.children[m].templateKey)for(n=0;n<a.children[m].value.length;n=n+1|0)l(a.children[m].value[n],a.children[m],a.dom,d[a.children[m].valueKey].values,n,null,h,i);else for(n=0;n<a.children[m].value.length;n=n+1|0)l(a.children[m].value[n],a.children[m],a.dom,d[a.children[m].valueKey],n,null,h,i);else l(a.children[m].value,a.children[m],a.dom,d[a.children[m].valueKey],null,null,h,i);else a.children[m]instanceof e?(a.children[m].lastValue=d[a.children[m].valueKey],o=document.createTextNode(a.children[m].lastValue),a.dom.appendChild(o)):(o=document.createTextNode(a.children[m].value),a.dom.appendChild(o));else p=l(a.children[m],a,a.dom,d,null,null,h,i),p===!0&&(a.children[m].isDynamic=!0,a.isDynamic=!0);else if("string"==typeof a.children)o=document.createTextNode(a.children),a.dom.appendChild(o);else{if(a.children instanceof e&&a.children.isRoot===!0){if(a.children.value instanceof Array)for(m=0;m<a.children.value.length;m=m+1|0)l(a.children.value[m],a,a.dom,d[a.children.valueKey],m,null,h,i);else l(a.children.value,a,a.dom,d[a.children.valueKey],null,null,h,i);return a.children.isDynamic=!0,a.children.lastValue=d[a.children.valueKey],!0}a.children instanceof e&&(a.children.lastValue=d[a.children.valueKey],("string"==typeof a.children.lastValue||"number"==typeof a.children.lastValue)&&(o=document.createTextNode(a.children.lastValue),a.dom.appendChild(o)),a.isDynamic=!0)}return a.isDynamic?!0:!1}function m(a){var b=[];return b}function n(a,b){var c=0,d=null,f={tag:a.tag,dom:a.dom.cloneNode(!1),attrs:m(a.attrs)};if(a.isDynamic===!0&&(f.isDynamic=!0),a.children instanceof e)f.children=new e(a.children.value,a.children.valueKey);else if(a.children instanceof Array)for(f.children=[],c=0;c<a.children.length;c=c+1|0)a.children[c]instanceof e?(d=document.createTextNode(a.children[c].value),f.dom.appendChild(d),f.children.push(new e(a.children[c].value,a.children[c].valueKey))):"string"==typeof a.children[c]||"number"==typeof a.children[c]?(d=document.createTextNode(a.children[c]),f.dom.appendChild(d),f.children.push(a.children[c])):f.children.push(n(a.children[c],f.dom)),a.children[c].isDynamic===!0&&(f.children[c].isDynamic=!0);else("string"==typeof a.children||"number"==typeof a.children)&&(d=document.createTextNode(a.children),f.dom.appendChild(d),f.children=a.children);return b.appendChild(f.dom),f}function o(a,b){b.removeChild(a.dom)}function p(a,b,c,d,f,g,h){var k=0,m=0,q="",s="",u=0,v=null,x=null;if(a.isDynamic!==!1){if(null!=a.templateKey&&d instanceof Array&&(x=d[d.length-1],a.templateKey!==x.templateKey&&(o(a,c),a=r.getTemplateFromCache(x.templateKey,d),l(a,b,c,d,null,null,g,h),b[f]=a,a.templateKey=x.templateKey)),null!=a.component&&a.component instanceof w){if(a.propsValueKeys)for(s in a.propsValueKeys)a.props[s]=d[a.propsValueKeys[s]];return void a.component.forceUpdate()}if(null!=a.attrs&&a.hasDynamicAttrs===!0)for(k=0,u=a.attrs.length;u>k;k=k+1|0)null==t[a.attrs[k].name]&&a.attrs[k].value instanceof e&&(q=d[a.attrs[k].value.valueKey],q!==a.attrs[k].value.lastValue&&(a.attrs[k].value.lastValue=q,j(a.tag,a.dom,a.attrs[k].name,q)));if(a instanceof e&&a.isRoot){if(q=d[a.valueKey],null!=a.value.templateKey&&(x=q[q.length-1],a.value.templateKey!==x.templateKey&&(o(a.value,c),a.value=r.getTemplateFromCache(x.templateKey,q),l(a.value,a,c,q,null,f,g,h),a.value.templateKey=x.templateKey,a.lastValue=d)),q!==a.lastValue){if(a.value instanceof Array)for(k=0,u=a.value.length;u>k;k=k+1|0)("string"!=typeof a.value[k]||"number"!=typeof a.value[k])&&p(a.value[k],a,c,q[k],k,g,h);else if(a.value.children instanceof Array)for(k=0,u=a.value.children.length;u>k;k=k+1|0)("string"!=typeof a.value.children[k]||"number"!=typeof a.value.children[k])&&p(a.value.children[k],a.value,a.value.dom,q,k,g,h);a.lastValue=q}}else if(null!=a.children)if(a.children instanceof Array)for(k=0,u=a.children.length;u>k;k=k+1|0)a.children[k].isDynamic===!0&&(a.children[k]instanceof e&&!a.children[k].isRoot?(q=d[a.children[k].valueKey],x=q[q.length-1],null!=x&&null!=x.templateKey&&(a.children[k].templateKey=x.templateKey,q=d),q!==a.children[k].lastValue&&(a.children[k].lastValue=q,i(a.dom.childNodes[k],q,!0))):p(a.children[k],a,a.dom,d,k,g,h));else if(a.children instanceof e&&a.children.isRoot===!0){if(q=d[a.children.valueKey],null!=a.children.templateKey&&(x=q[q.length-1],a.children.templateKey!==x.templateKey&&(o(a.children.value,a.dom),a.children.value=r.getTemplateFromCache(x.templateKey,q),l(a.children.value,a.children,a.dom,q[k],null,g,h),a.children.templateKey=x.templateKey,a.children.lastValue=d)),q!==a.children.lastValue&&q instanceof Array){if(q.length!==a.children.lastValue.length)if(q.length>a.children.lastValue.length)for(m=0;m<q.length-a.children.lastValue.length;m=m+1|0)a.children.value.length>0?v=n(a.children.value[0],a.dom):(v=r.getTemplateFromCache(q[m].templateKey,q[m].values),l(v,a,a.dom,q,null,k,g,h)),a.children.value.push(v);else if(q.length<a.children.lastValue.length)for(m=0;m<a.children.lastValue.length-q.length;m=m+1|0)o(a.children.value[a.children.value.length-1],a.dom),a.children.value.pop();for(k=0,u=a.children.value.length;u>k;k=k+1|0)"object"==typeof a.children.value[k]&&p(a.children.value[k],a.children.value,a.dom,q[k],k,g,h);a.children.lastValue=q}}else a.children instanceof e&&(q=d[a.children.valueKey],null!=a.templateKey&&q instanceof Array&&(x=q[q.length-1],a.templateKey!==x.templateKey&&(a.templateKey=x.templateKey,q=d)),q!==a.children.lastValue&&(a.children.lastValue=q,("string"==typeof q||"number"==typeof q||q instanceof Date)&&i(a.dom,q,!0)))}}var q=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),r=a("t7"),s="textContent"in document,t={onClick:"click"},u=null;"undefined"!=typeof window&&(u={div:document.createElement("div"),span:document.createElement("span"),a:document.createElement("a"),p:document.createElement("p"),li:document.createElement("li"),tr:document.createElement("tr"),td:document.createElement("td")});var v={},w=function(){function a(b){d(this,a),this.props=b,this.state={}}return q(a,[{key:"render",value:function(){}},{key:"forceUpdate",value:function(){}},{key:"setState",value:function(a){for(var b in a)this.state[b]=a[b];this.forceUpdate()}},{key:"replaceState",value:function(a){this.state=newSate,this.forceUpdate()}}]),a}();v.Component=w,f.prototype.forceUpdate=function(){},v.createValueNode=function(a,b){return new e(a,b)},v.createClass=function(a){var b=new f;for(var c in a)f[c]=a[c];return b},v.render=function(a,b,c,d){var e=null,f=null,g=null;null==d?null==b.rootNode?("function"==typeof a?(g=a(),f=g[g.length-1],e=r.getTemplateFromCache(f.templateKey,g,f.components)):(g=a,f=a[g.length-1],e=r.getTemplateFromCache(f.templateKey,g,f.components)),l(e,null,b,g,null,null,c,d),b.rootNode=[e]):("function"==typeof a?g=a():a.length>0&&(g=a),p(b.rootNode[0],b.rootNode,b,g,c,d)):null==d._rootNode?(g=a(),f=g[g.length-1],g&&(e=r.getTemplateFromCache(f.templateKey,g,f.components),l(e,null,b,g,null,null,c,d),d._rootNode=[e])):(g=a(),p(d._rootNode[0],d._rootNode,b,g,0,c,d))},b.exports=v},{t7:3}],3:[function(a,b,c){var d=function(){"use strict";function a(a,b,c,d){var e=[],f=0,h=0,i=null;if(null!=a.children&&a.children instanceof Array){for(f=0,h=a.children.length;h>f;f++)null!=a.children[f]&&("string"==typeof a.children[f]?(a.children[f]=a.children[f].replace(/(\r\n|\n|\r)/gm,""),i=a.children[f].match(/__\$props__\[\d*\]/g),null!==i?s===o.Outputs.Inferno?(a.children[f]=a.children[f].replace(/(__\$props__\[([0-9]*)\])/g,"Inferno.createValueNode($1,$2),"),","===a.children[f].substring(a.children[f].length-1)&&(a.children[f]=a.children[f].substring(0,a.children[f].length-1)),e.push(a.children[f])):e.push(a.children[f]):e.push("'"+a.children[f]+"'")):g(a.children[f],e,d));1===e.length?b.push((c?"children: ":"")+e):b.push((c?"children: ":"")+"["+e.join(",")+"]")}else null!=a.children&&"string"==typeof a.children&&(a.children=a.children.replace(/(\r\n|\n|\r)/gm,"").trim(),i=a.children.match(/__\$props__\[\d*\]/g),null!==i&&(s===o.Outputs.Inferno?a.children=a.children.replace(/(__\$props__\[([0-9]*)\])/g,"Inferno.createValueNode($1,$2),"):a.children=a.children.replace(/(__\$props__\[.*\])/g,"',$1,'")),",'"===a.children.substring(a.children.length-2)?(a.children=a.children.substring(0,a.children.length-2),b.push((c?"children: ":"")+"['"+a.children+"]")):b.push((c?"children: ":"")+"['"+a.children+"']"))}function b(a,b,c,d){var e=[],f=0,h=0,i=null;if(null!=a.children&&a.children instanceof Array){for(f=0,h=a.children.length;h>f;f++)null!=a.children[f]&&("string"==typeof a.children[f]?(a.children[f]=a.children[f].replace(/(\r\n|\n|\r)/gm,""),i=a.children[f].match(/__\$props__\[\d*\]/g),null!=i?(a.children[f]=a.children[f].replace(/(__\$props__\[[0-9]*\])/g,"$1"),","===a.children[f].substring(a.children[f].length-1)&&(a.children[f]=a.children[f].substring(0,a.children[f].length-1)),e.push(a.children[f])):e.push("'"+a.children[f]+"'")):g(a.children[f],e,f===a.children.length-1,d));e.length>0&&b.push(e.join(","))}else null!=a.children&&"string"==typeof a.children&&(a.children=a.children.replace(/(\r\n|\n|\r)/gm,""),b.push("'"+a.children+"'"))}function c(a,b){var c="",d=null;for(var e in a.attrs)c=a.attrs[e],d=c.match(/__\$props__\[\d*\]/g),null===d?b.push("'"+e+"':'"+c+"'"):b.push("'"+e+"':"+c)}function d(a,b){var c="",d=null;for(var e in a.attrs)c=a.attrs[e],d=c.match(/__\$props__\[\d*\]/g),null!==d&&b.push("'"+e+"':"+c.replace(/(__\$props__\[([0-9]*)\])/g,"$2"))}function e(a,b){var c="",d=null;for(var e in a.attrs)c=a.attrs[e],d=c.match(/__\$props__\[\d*\]/g),null===d?b.push("{name:'"+e+"',value:'"+c+"'}"):b.push("{name:'"+e+"',value:"+c.replace(/(__\$props__\[([0-9]*)\])/g,"Inferno.createValueNode($1,$2)")+"}")}function f(a){return a[0]===a[0].toUpperCase()?!0:!1}function g(g,h,i){var j=[],k=[],l=[];if(g instanceof Array);else if(s===o.Outputs.Universal||s===o.Outputs.Inferno||s===o.Outputs.Mithril)if(null!=g.tag)if(f(g.tag)===!1)h.push("{tag: '"+g.tag+"'"),null!=g.key&&j.push("key: "+g.key),null!=g.attrs&&(s===o.Outputs.Inferno?(e(g,k),j.push("attrs: ["+k.join(",")+"]")):(c(g,k),j.push("attrs: {"+k.join(",")+"}"))),a(g,j,!0,i),h.push(j.join(",")+"}");else{if(("undefined"!=typeof window&&i===window||null==i)&&u===!1)throw new Error("Error referencing component '"+g.tag+"'. Components can only be used when within modules. See documentation for more information on t7.module().");s===o.Outputs.Universal?(c(g,k),h.push("__$components__."+g.tag+"({"+k.join(",")+"})")):s===o.Outputs.Mithril?(c(g,k),h.push("m.component(__$components__."+g.tag+",{"+k.join(",")+"})")):s===o.Outputs.Inferno&&(c(g,k),d(g,l),h.push("{component:__$components__."+g.tag+", props: {"+k.join(",")+"}, propsValueKeys: {"+l.join(",")+"}}"))}else h.push("'"+g+"'");else if(s===o.Outputs.React)if(null!=g.tag){if(f(g.tag)===!0){if(("undefined"!=typeof window&&i===window||null==i)&&u===!1)throw new Error("Error referencing component '"+g.tag+"'. Components can only be used when within modules. See documentation for more information on t7.module().");h.push("React.createElement(__$components__."+g.tag)}else h.push("React.createElement('"+g.tag+"'");null!=g.attrs?(c(g,k),null!=g.key&&k.push("'key':"+g.key),j.push("{"+k.join(",")+"}")):j.push("null"),b(g,j,!0,i),h.push(j.join(",")+")")}else g=g.replace(/(\r\n|\n|\r)/gm,"\\n"),h.push("'"+g+"'")}function h(a,b,c){var d=0,e=a.split(/(__\$props__\[\d*\])/g);for(d=0;d<e.length;d++)""!==e[d].trim()&&b.children.push(e[d]);return a=null}function i(a){return a.indexOf("'")>-1&&(a=a.replace(/'/g,"\\'")),a}function j(a,b){for(var c=0,d=/__\$props__\[([0-9]*)\]/,e=a.match(/__\$props__\[([0-9]*)\]/g),f=0;f<e.length;f++)c=d.exec(e[f])[1],a=a.replace(e[f],b[c]);return a}function k(a,b){var c="",d="",e=0,f=0,g=null,k=!1,m="",n="",o=null,p="",q=null,r=null;for(e=0,f=a.length;f>e;e++)if(c=a[e],"<"===c)k=!0;else if(">"===c&&k===!0){if("/"===m[0]){if(m!=="/"+q.tag&&-1===t.indexOf(q.tag)&&!q.closed)throw console.error("Template error: "+j(a,b)),new Error("Expected corresponding t7 closing tag for '"+q.tag+"'.");""!==p.trim()&&(p=i(p),p=h(p,q,!0),null!==p&&0===q.children.length?q.children=p:null!=p&&q.children.push(p)),q=q.parent,q&&(q.closed=!0)}else{if(p.trim().length>0&&!(q instanceof Array)&&(p=i(p),p=h(p.replace(/(\r\n|\n|\r)/gm,""),q),q.children.push(p),p=""),-1===m.indexOf(" ")?(r={},n=m):(r=l(m),n=r.tag),o={tag:n,attrs:r&&r.attrs?r.attrs:{},children:[],closed:"/"===m[m.length-1]||t.indexOf(n)>-1?!0:!1},r&&r.key&&(o.key=r.key),null===q){if(null!==g)throw new Error("t7 templates must contain only a single root element");g=q=o}else q instanceof Array?q.push(o):q.children.push(o);-1===t.indexOf(n)&&(q===o?o.parent=null:o.parent=q,q=o)}k=!1,m="",p=""}else k===!0?(m+=c,d=c):(p+=c,d=c);return g}function l(a){var b=[],c="",d="",e=0,f=0,g=0,h=0,i="",j=!1,k=[],l={},m="";for(e=0,g=a.length;g>e;e++)c=a[e]," "===c&&j===!1?(b.push(i),i=""):"'"===c?j===!1?j=!0:(j=!1,b.push(i),i=""):'"'===c?j===!1?j=!0:(j=!1,b.push(i),i=""):i+=c;for(""!==i&&b.push(i),i="",e=1,g=b.length;g>e;e++){for(k=[],d="",i="",f=0,h=b[e].length;h>f;f++)c=b[e][f],"="===c?(k.push(i),i=""):(i+=c,d=c);if(""!=i&&k.push(i),k.length>1){var n=k[1].match(/__\$props__\[\d*\]/g);null!==n?l[k[0]]=k[1]:"key"===k[0]?m=k[1]:l[k[0]]=k[1]}}return{tag:b[0],attrs:l,key:m}}function m(a,b){var c=a+"\n//# sourceURL="+b,d=document.createElement("script");d.textContent=c,r.appendChild(d)}function n(a){var b,c,d,e=0;if(0==a.length)return a;for(b=0,d=a.length;d>b;b++)c=a.charCodeAt(b),e=(e<<5)-e+c,e|=0;return e}function o(a){for(var b=null,c=1,d=arguments.length,e=null,f=null,h="",i=null,j=a[0],l=!1,p=[].slice.call(arguments,1);d>c;c++)j+=a[c];if(i=n(j),s===o.Outputs.Inferno){if(null!=o._cache[i])return p.push({templateKey:i,components:this}),p;l=!0}if(null==o._cache[i]){for(b="",c=0,d=a.length;d>c;c++)b+=c===a.length-1?a[c]:a[c]+"__$props__["+c+"]";if(e=[],g(k(b,p),e,this),h=e.join(","),u===!0)return{templateKey:i,template:"return "+h};q===!0?(f='t7._cache["'+i+'"]=function(__$props__, __$components__)',f+='{"use strict";return '+h+"}",m(f,i)):o._cache[i]=new Function('"use strict";var __$props__ = arguments[0];var __$components__ = arguments[1];return '+h)}return l===!0?(p.push({templateKey:i,components:this}),p):o._cache[i](p,this)}function p(a,b){var c=0,d=null,e=null;for(c=0;c<a.length;c=c+1|0)d=a[c],d instanceof Array?(e=d[d.length-1],null!=e.templateKey?b[c]=o.getTemplateFromCache(e.templateKey,d):(b[c]=[],p(a[c],b[c]))):b[c]=d}var q="undefined"!=typeof window&&null!=document,r=null,s=null,t=[],u=!1,v="0.2.14";q===!0&&(r=document.getElementsByTagName("head")[0]),t=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"];return o._cache={},o.Outputs={React:1,Universal:2,Inferno:3,Mithril:4},o.getOutput=function(){return s},o.setPrecompile=function(a){u=a},o.getVersion=function(){return v},o["if"]=function(a,b){return a?{"else":function(){return b()}}:{"else":function(a){return a()}}},o.setOutput=function(a){s=a},o.clearCache=function(){o._cache={}},o.assign=function(a){throw new Error("Error assigning component '"+a+"'. You can only assign components from within a module. Please check documentation for t7.module().")},o.module=function(a){var b={},c=function(){return o.apply(b,arguments)};c.assign=function(a,c){if(2===arguments.length)b[a]=c;else for(var d in a)b[d]=a[d]},c["if"]=o["if"],c.Outputs=o.Outputs,c.clearCache=o.clearCache,c.setOutput=o.setOutput,c.getOutput=o.getOutput,c.precompile=function(a){return o.precompile(a,b)},a(c)},o.precompile=function(a,b){var c=a[a.length-1];return null==o._cache[c.templateKey]&&(o._cache[c.templateKey]=c.template),s===o.Outputs.Inferno?(c.components=b,a):o.getTemplateFromCache(c.templateKey,a,b)},o.getTemplateFromCache=function(a,b,c){var d=[];return p(b,d),o._cache[a](d,c)},s="undefined"!=typeof React?o.Outputs.React:"undefined"!=typeof Inferno?o.Outputs.Inferno:o.Outputs.Universal,o}();"undefined"!=typeof b&&null!=b.exports&&(b.exports=d)},{}]},{},[1]);

@@ -34,2 +34,14 @@ module.exports = function(grunt) {

}
},
'closure-compiler': {
frontend: {
closurePath: 'closure',
js: 'dist/inferno.js',
jsOutputFile: 'dist/inferno.min.js',
maxBuffer: 2500,
options: {
compilation_level: 'ADVANCED_OPTIMIZATIONS',
language_in: 'ECMASCRIPT5_STRICT'
}
}
}

@@ -42,2 +54,3 @@ })

grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-closure-compiler');

@@ -47,2 +60,3 @@ grunt.registerTask('build', [

'browserify',
// 'closure-compiler'
'uglify'

@@ -49,0 +63,0 @@ ]);

{
"name": "inferno",
"version": "0.1.2",
"version": "0.1.3",
"description": "A framework for building lightning fast user interfaces",

@@ -5,0 +5,0 @@ "main": "inferno.js",

@@ -63,2 +63,12 @@ "use strict";

function PrototypeComponent(props) {
this.props = props;
this.state = {};
if(this.constructor) {
this.constructor();
}
};
PrototypeComponent.prototype.forceUpdate = function() {};
Inferno.createValueNode = function(value, valueKey) {

@@ -68,2 +78,11 @@ return new ValueNode(value, valueKey);

Inferno.createClass = function(options) {
var component = new PrototypeComponent();
// PrototypeComponent.prototype.constructor = options.constructor;
for(var property in options) {
PrototypeComponent[property] = options[property];
}
return component;
};
Inferno.render = function(render, dom, listeners, component) {

@@ -93,3 +112,3 @@ var rootNode = null;

}
updateNode(dom.rootNode[0], dom.rootNode, dom, values, null, listeners, component);
updateNode(dom.rootNode[0], dom.rootNode, dom, values, listeners, component);
}

@@ -107,3 +126,3 @@ } else {

values = render();
updateNode(component._rootNode[0], component._rootNode, dom, values, 0, null, listeners, component);
updateNode(component._rootNode[0], component._rootNode, dom, values, 0, listeners, component);
}

@@ -233,5 +252,2 @@ }

if(node.component instanceof Component) {
// if(node.component.beforeRender) {
// node.component.beforeRender(node.props, values);
// }
node.component.forceUpdate();

@@ -416,20 +432,19 @@ }

function updateNode(node, parentNode, parentDom, values, index, valIndex, listeners, component) {
var i = 0, s = 0, l = 0, val = "", key = "", childNode = null, endValue = null;
function updateNode(node, parentNode, parentDom, values, index, listeners, component) {
var i = 0,
s = 0,
l = 0,
val = "",
key = "",
length = 0,
childNode = null,
endValue = null;
if(node.isDynamic === false) {
if (node.isDynamic === false) {
return;
}
//we need to get the actual values and the templatekey
if(valIndex != null) {
endValue = values[valIndex][values[valIndex].length - 1];
if(node.templateKey && node.templateKey !== endValue.templateKey) {
//TODO, basically copy below
node.templateKey = endValue.templateKey;
}
values = values[valIndex];
} else {
if(node.templateKey != null && values instanceof Array) {
endValue = values[values.length - 1];
if(node.templateKey && node.templateKey !== endValue.templateKey) {
if (node.templateKey !== endValue.templateKey) {
//remove node

@@ -446,5 +461,5 @@ removeNode(node, parentDom);

//if this is a component
if (node.component instanceof Component) {
if(node.propsValueKeys) {
for(key in node.propsValueKeys) {
if (node.component != null && node.component instanceof Component) {
if (node.propsValueKeys) {
for (key in node.propsValueKeys) {
node.props[key] = values[node.propsValueKeys[key]];

@@ -458,10 +473,8 @@ }

if (node.attrs != null && node.hasDynamicAttrs === true) {
for (i = 0; i < node.attrs.length; i = i + 1 | 0)
if (events[node.attrs[i].name] == null) { {
if (node.attrs[i].value instanceof ValueNode) {
val = values[node.attrs[i].value.valueKey];
if (val !== node.attrs[i].value.lastValue) {
node.attrs[i].value.lastValue = val;
handleNodeAttributes(node.tag, node.dom, node.attrs[i].name, val);
}
for (i = 0, length = node.attrs.length; i < length; i = i + 1 | 0) if (events[node.attrs[i].name] == null) {
if (node.attrs[i].value instanceof ValueNode) {
val = values[node.attrs[i].value.valueKey];
if (val !== node.attrs[i].value.lastValue) {
node.attrs[i].value.lastValue = val;
handleNodeAttributes(node.tag, node.dom, node.attrs[i].name, val);
}

@@ -472,30 +485,30 @@ }

if(node instanceof ValueNode && node.isRoot) {
if (node instanceof ValueNode && node.isRoot) {
val = values[node.valueKey];
endValue = val[val.length - 1];
if(endValue != null && endValue.templateKey != null) {
if(node.value.templateKey !== endValue.templateKey) {
//we want to remove the DOM current node
//TODO for optimisation do we want to clone this? and if possible, re-use the clone rather than
//asking t7 for a fresh template??
removeNode(node.value, parentDom);
//and then we want to create the new node (we can simply get it from t7 cache)
node.value = t7.getTemplateFromCache(endValue.templateKey, val);
createNode(node.value, node, parentDom, val, null, index, listeners, component);
node.value.templateKey = endValue.templateKey;
node.lastValue = values;
}
if(node.value.templateKey != null) {
endValue = val[val.length - 1];
if (node.value.templateKey !== endValue.templateKey) {
//we want to remove the DOM current node
//TODO for optimisation do we want to clone this? and if possible, re-use the clone rather than
//asking t7 for a fresh template??
removeNode(node.value, parentDom);
//and then we want to create the new node (we can simply get it from t7 cache)
node.value = t7.getTemplateFromCache(endValue.templateKey, val);
createNode(node.value, node, parentDom, val, null, index, listeners, component);
node.value.templateKey = endValue.templateKey;
node.lastValue = values;
}
}
if(val !== node.lastValue) {
if (val !== node.lastValue) {
//array of array here
if(node.value instanceof Array) {
for(i = 0; i < node.value.length; i = i + 1 | 0) {
if(typeof node.value[i] !== "string") {
updateNode(node.value[i], node, parentDom, val, i, i, listeners, component);
if (node.value instanceof Array) {
for (i = 0, length = node.value.length; i < length; i = i + 1 | 0) {
if (typeof node.value[i] !== "string" || typeof node.value[i] !== "number") {
updateNode(node.value[i], node, parentDom, val[i], i, listeners, component);
}
}
} else if(node.value.children instanceof Array) {
for(i = 0; i < node.value.children.length; i = i + 1 | 0) {
if(typeof node.value.children[i] !== "string") {
updateNode(node.value.children[i], node.value, node.value.dom, val, i, null, listeners, component);
} else if (node.value.children instanceof Array) {
for (i = 0, length = node.value.children.length; i < length; i = i + 1 | 0) {
if (typeof node.value.children[i] !== "string" || typeof node.value.children[i] !== "number") {
updateNode(node.value.children[i], node.value, node.value.dom, val, i, listeners, component);
}

@@ -506,14 +519,14 @@ }

}
} else if(node.children != null) {
if(node.children instanceof Array) {
for(i = 0; i < node.children.length; i = i + 1 | 0) {
if(node.children[i].isDynamic === true) {
if(node.children[i] instanceof ValueNode && !node.children[i].isRoot) {
} else if (node.children != null) {
if (node.children instanceof Array) {
for (i = 0, length = node.children.length; i < length; i = i + 1 | 0) {
if (node.children[i].isDynamic === true) {
if (node.children[i] instanceof ValueNode && !node.children[i].isRoot) {
val = values[node.children[i].valueKey];
endValue = val[val.length - 1];
if(endValue != null && endValue.templateKey != null) {
if (endValue != null && endValue.templateKey != null) {
node.children[i].templateKey = endValue.templateKey;
val = values;
}
if(val !== node.children[i].lastValue) {
if (val !== node.children[i].lastValue) {
node.children[i].lastValue = val;

@@ -524,12 +537,12 @@ //update the text

} else {
updateNode(node.children[i], node, node.dom, values, i, null, listeners, component);
updateNode(node.children[i], node, node.dom, values, i, listeners, component);
}
}
}
} else if(node.children instanceof ValueNode && node.children.isRoot === true) {
} else if (node.children instanceof ValueNode && node.children.isRoot === true) {
//check if the value has changed
val = values[node.children.valueKey];
endValue = val[val.length - 1];
if(endValue != null && endValue.templateKey != null) {
if(node.children.templateKey !== endValue.templateKey) {
if(node.children.templateKey != null) {
endValue = val[val.length - 1];
if (node.children.templateKey !== endValue.templateKey) {
//we want to remove the DOM current node

@@ -541,3 +554,3 @@ //TODO for optimisation do we want to clone this? and if possible, re-use the clone rather than

node.children.value = t7.getTemplateFromCache(endValue.templateKey, val);
createNode(node.children.value, node.children, node.dom, val, null, i, listeners, component);
createNode(node.children.value, node.children, node.dom, val[i], null, listeners, component);
//then we want to set the new templatekey

@@ -548,11 +561,12 @@ node.children.templateKey = endValue.templateKey;

}
if(val !== node.children.lastValue) {
if(val instanceof Array) {
//check if the sizes have changed
//in this case, our new array has more items so we'll need to add more children
if(val.length > node.children.lastValue.length) {
if (val !== node.children.lastValue && val instanceof Array) {
//check if the sizes have changed
//in this case, our new array has more items so we'll need to add more children
if (val.length !== node.children.lastValue.length) {
if (val.length > node.children.lastValue.length) {
//easiest way to add another child is to clone the node, so let's clone the first child
//TODO check the templates coming back have the same code?
for(s = 0; s < val.length - node.children.lastValue.length; s = s + 1 | 0) {
if(node.children.value.length > 0) {
for (s = 0; s < val.length - node.children.lastValue.length; s = s + 1 | 0) {
if (node.children.value.length > 0) {
childNode = cloneNode(node.children.value[0], node.dom);

@@ -565,5 +579,5 @@ } else {

}
} else if(val.length < node.children.lastValue.length) {
} else if (val.length < node.children.lastValue.length) {
//we need to remove the last node here (unless we add in index functionality)
for(s = 0; s < node.children.lastValue.length - val.length; s = s + 1 | 0) {
for (s = 0; s < node.children.lastValue.length - val.length; s = s + 1 | 0) {
removeNode(node.children.value[node.children.value.length - 1], node.dom);

@@ -573,6 +587,6 @@ node.children.value.pop();

}
for(i = 0; i < node.children.value.length; i = i + 1 | 0) {
if(typeof node.children.value[i] !== "string") {
updateNode(node.children.value[i], node.children.value, node.dom, val, i, i, listeners, component);
}
}
for (i = 0, length = node.children.value.length; i < length; i = i + 1 | 0) {
if (typeof node.children.value[i] === "object") {
updateNode(node.children.value[i], node.children.value, node.dom, val[i], i, listeners, component);
}

@@ -582,12 +596,14 @@ }

}
} else if(node.children instanceof ValueNode) {
} else if (node.children instanceof ValueNode) {
val = values[node.children.valueKey];
endValue = val[val.length - 1];
if(endValue != null && endValue.templateKey != null) {
node.templateKey = endValue.templateKey;
val = values;
if (node.templateKey != null && val instanceof Array) {
endValue = val[val.length - 1];
if (node.templateKey !== endValue.templateKey) {
node.templateKey = endValue.templateKey;
val = values;
}
}
if(val !== node.children.lastValue) {
if (val !== node.children.lastValue) {
node.children.lastValue = val;
if(typeof val === "string" || typeof val === "number" || val instanceof Date) {
if (typeof val === "string" || typeof val === "number" || val instanceof Date) {
setTextContent(node.dom, val, true);

@@ -594,0 +610,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