define("domplate/domplate",[],function(){Domplate={};(function(){function DomplateTag(tagName) {this.tagName=tagName;} this.DomplateTag=DomplateTag;function DomplateEmbed() {} function DomplateLoop() {} var womb=null;var domplate=function() {var lastSubject;for(var i=0;i":return">";case"&":return"&";case"'":return"'";case'"':return""";} return"?";};return String(value).replace(/[<>&"']/g,replaceChars);} function __loop__(iter,outputs,fn) {var iterOuts=[];outputs.push(iterOuts);if(iter instanceof Array) iter=new ArrayIterator(iter);try {while(1) {var value=iter.next();var itemOuts=[0,0];iterOuts.push(itemOuts);fn.apply(this,[value,itemOuts]);}} catch(exc) {if(exc!=StopIteration) throw exc;}} var js=fnBlock.join("");this.renderMarkup=eval(js);},getVarNames:function(args) {if(this.vars) args.push.apply(args,this.vars);for(var i=0;i"');this.generateChildMarkup(topBlock,topOuts,blocks,info);topBlock.push(',""');},generateChildMarkup:function(topBlock,topOuts,blocks,info) {for(var i=0;i=array.length) throw StopIteration;return array[index];};} function StopIteration(){} this.$break=function() {throw StopIteration;};var Renderer={renderHTML:function(args,outputs,self) {var code=[];var markupArgs=[code,this.tag.context,args,outputs];markupArgs.push.apply(markupArgs,this.tag.markupArgs);this.tag.renderMarkup.apply(self?self:this.tag.subject,markupArgs);return code.join("");},insertRows:function(args,before,self) {this.tag.compile();var outputs=[];var html=this.renderHTML(args,outputs,self);var doc=before.ownerDocument;var tableParent=doc.createElement("div");tableParent.innerHTML=""+html+"
";var tbody=tableParent.firstChild.firstChild;var parent=before.tagName.toLowerCase()=="tr"?before.parentNode:before;var after=before.tagName.toLowerCase()=="tr"?before.nextSibling:null;var firstRow=tbody.firstChild,lastRow;while(tbody.firstChild) {lastRow=tbody.firstChild;if(after) parent.insertBefore(lastRow,after);else parent.appendChild(lastRow);} var offset=0;if(this.tag.isLoop) {var node=firstRow.parentNode.firstChild;for(;node&&node!=firstRow;node=node.nextSibling) ++offset;} var domArgs=[firstRow,this.tag.context,offset];domArgs.push.apply(domArgs,this.tag.domArgs);domArgs.push.apply(domArgs,outputs);this.tag.renderDOM.apply(self?self:this.tag.subject,domArgs);return[firstRow,lastRow];},insertAfter:function(args,before,self) {this.tag.compile();var outputs=[];var html=this.renderHTML(args,outputs,self);var doc=before.ownerDocument;var range=doc.createRange();range.selectNode(doc.body);var frag=range.createContextualFragment(html);var root=frag.firstChild;if(before.nextSibling) before.parentNode.insertBefore(frag,before.nextSibling);else before.parentNode.appendChild(frag);var domArgs=[root,this.tag.context,0];domArgs.push.apply(domArgs,this.tag.domArgs);domArgs.push.apply(domArgs,outputs);this.tag.renderDOM.apply(self?self:(this.tag.subject?this.tag.subject:null),domArgs);return root;},replace:function(args,parent,self) {this.tag.compile();var outputs=[];var html=this.renderHTML(args,outputs,self);var root;if(parent.nodeType==1) {parent.innerHTML=html;root=parent.firstChild;} else {if(!parent||parent.nodeType!=9) parent=document;if(!womb||womb.ownerDocument!=parent) womb=parent.createElement("div");womb.innerHTML=html;root=womb.firstChild;} var domArgs=[root,this.tag.context,0];domArgs.push.apply(domArgs,this.tag.domArgs);domArgs.push.apply(domArgs,outputs);this.tag.renderDOM.apply(self?self:this.tag.subject,domArgs);return root;},append:function(args,parent,self) {this.tag.compile();var outputs=[];var html=this.renderHTML(args,outputs,self);if(!womb||womb.ownerDocument!=parent.ownerDocument) womb=parent.ownerDocument.createElement("div");womb.innerHTML=html;var root=womb.firstChild;while(womb.firstChild) parent.appendChild(womb.firstChild);var domArgs=[root,this.tag.context,0];domArgs.push.apply(domArgs,this.tag.domArgs);domArgs.push.apply(domArgs,outputs);this.tag.renderDOM.apply(self?self:this.tag.subject,domArgs);return root;},insertCols:function(args,parent,self) {this.tag.compile();var outputs=[];var html=this.renderHTML(args,outputs,self);var womb=parent.ownerDocument.createElement("div");womb.innerHTML=""+html+"
";womb=womb.firstChild.firstChild.firstChild;var firstCol=womb.firstChild;if(!firstCol) return null;while(womb.firstChild) parent.appendChild(womb.firstChild);var offset=0;if(this.tag.isLoop) {var node=firstCol.parentNode.firstChild;for(;node&&node!=firstCol;node=node.nextSibling) ++offset;} var domArgs=[firstCol,this.tag.context,offset];domArgs.push.apply(domArgs,this.tag.domArgs);domArgs.push.apply(domArgs,outputs);this.tag.renderDOM.apply(self?self:this.tag.subject,domArgs);return firstCol;}};function defineTags() {for(var i=0;i