text: (function(i){var o=(typeof console==="undefined")?{log:function(){}}:console;var a=false;if(typeof require!=="undefined"){var m=require("tty");if(m.isatty&&m.isatty(0)){a=true}}var h={gray:"\033[37m",darkgray:"\033[40;30m",red:"\033[31m",green:"\033[32m",yellow:"\033[33m",lightblue:"\033[1;34m",cyan:"\033[36m",white:"\033[1;37m"},c=/input|select|textarea|option|button/i,g=/img/i,l=0,f=a?(h.green+" ✓"+h.gray):" Success",k=a?(h.red+" ✗"+h.gray):" Fail",j=function j(r,d){var q=r.toUpperCase();return function(v,u,t,w){o.log(e(),((a?(h.gray+"┌ "):"+ ")+q+" -"),"parent:",b(v)+",","element:",b(u)+",","key:",b(t)+",","value:",b(w));l+=1;if(d){var s=d(v,u,t,w);l-=1;o.log(e(),(a?"└ ":"+ ")+u+""+(s!==false?f:k));return s}l-=1;n("- OPERATION NOT FOUND: ",q)}},e=function e(){var d=l,q="";while(d--){q+=a?" │   ":" |   "}return q},n=function n(){var d=Array.prototype.slice.call(arguments);o.log(e(),d.join(" "))},b=function b(r){var q=r+"",d="undefined";if(a){if(q==="false"||q==="null"||q===""||q===d||typeof r===d||r===false){if(q===""){q="(empty string)"}return h.red+q+h.gray}else{return h.yellow+q+h.gray}}return q};i.weld=function p(y,u,D){var t={alias:{},debug:false,insert:false},s={siblings:function A(L,G,N,K){var H=[],M,F,E,I,J=L.children;cs=J.length;G.weld={parent:L,classes:G.className.split(" ")};while(cs--){M=J[cs];if(M===G){if(cs<J.length){G.weld.insertBefore=J[cs+1]}if(d){n("- REMOVE - element:",b(G),"class:",b(G.className),"id:",b(G.id))}L.removeChild(G)}else{F=M.className.split(" ");E=F.length;I=true;while(E--){if(G.weld.classes.indexOf(F[E])<0){I=false;break}}if(I){if(d){n("- REMOVE - element:",b(M),"class:",b(M.className),"id:",b(M.id))}L.removeChild(M)}}}},traverse:function w(O,G,Q,N){var L,K,H,S,E,F,P=G,R=G.parentNode;if(N.nodeType||typeof N!=="object"){s.set(O,G,Q,N)}else{if(N.length&&N[0]){if(R){s.siblings(R,P,Q,N)}else{if(P.weld&&P.weld.parent){R=P.weld.parent}}E=N.length;for(H=0;H<E;H++){if(d){n("- CLONE - element:",b(G),"class:",b(G.className),"id:",b(G.id))}K=G.cloneNode(true);K.weld={};if(G.weld){if(Object.keys){var S=Object.keys(G.weld),M=S.length,I;while(M--){I=S[M];K.weld[I]=G.weld[I]}}else{for(var I in G.weld){if(G.weld.hasOwnProperty(I)){K.weld[I]=G.weld[I]}}}}s.traverse(R,K,H,N[H]);s.insert(R,K)}}else{if(Object.keys){var S=Object.keys(N),J=S.length;while(J--){Q=S[J];F=N[Q];K=s.match(P,G,Q,F);if(K){s.traverse(P,K,Q,F)}}}else{for(Q in N){if(N.hasOwnProperty(Q)){F=N[Q];K=s.match(P,G,Q,F);if(K){s.traverse(P,K,Q,F)}}}}}}},elementType:function x(G,F,E,H){if(F){var I=F.nodeName;if(typeof I==="string"){if(c.test(I)){return"input"}if(g.test(I)){return"image"}}}},map:false,insert:function(F,E){if(E.weld&&E.weld.insertBefore){F.insertBefore(E,E.weld.insertBefore)}else{F.appendChild(E)}},set:function C(I,G,F,J){if(s.map&&s.map(I,G,F,J)===false){return false}if(d){n("- SET: value is",J.tagName)}var H=s.elementType(I,G,F,J),E=false;if(J&&J.nodeType){if(G.ownerDocument!==J.ownerDocument){J=G.ownerDocument.importNode(J,true)}else{if(J.parentNode){J.parentNode.removeChild(J)}}while(G.firstChild){G.removeChild(G.firstChild)}G.appendChild(J);E=true}else{if(H==="input"){G.setAttribute("value",J);E=true}else{if(H==="image"){G.setAttribute("src",J);E=true}else{G.textContent=J;E=true}}}return E},match:function v(J,I,H,K){if(typeof t.alias[H]!=="undefined"){if(typeof t.alias[H]==="function"){H=t.alias[H](J,I,H,K)||H}else{if(t.alias[H]===false){return false}else{H=t.alias[H]}}}if(H&&H.nodeType){return H}if(I){if(I.querySelector){return I.querySelector("."+H+",#"+H+',[name="'+H+'"]')}else{var G=I.getElementsByTagName("*"),E=G.length,L,F;for(F=0;F<E;F++){L=G[F];if(L.id===H||L.name===H||L.className.split(" ").indexOf(H)>-1){return L}}}}}},B=y.parentNode,q,r,z,d;if(D){for(r in D){if(D.hasOwnProperty(r)){t[r]=D[r]}}}d=t.debug;for(q in s){if(s.hasOwnProperty(q)){currentOp=s[q];z=t[q]||s[q];if(d){z=j(q,z)}s[q]=z}}s.traverse(null,y,null,u);if(t.debug){o.log(B.innerHTML)}}})((typeof exports==="undefined")?window:exports);