//>>built
define("dojox/dtl/tag/loader",["dojo/_base/lang","../_base","dojo/_base/array","dojo/_base/connect"],function(h,k,m,l){var g=h.getObject("tag.loader",!0,k);g.BlockNode=h.extend(function(c,a){this.name=c;this.nodelist=a},{"super":function(){if(this.parent){var c=this.parent.nodelist.dummyRender(this.context,null,!0);"string"==typeof c&&(c=new String(c));c.safe=!0;return c}return""},render:function(c,a){var b=this.name,d=this.nodelist;a.blocks&&(b=a.blocks[b])&&(d=b.nodelist,b.used=!0);this.rendered=
d;this.context=c=c.push();this.parent=null;d!=this.nodelist&&(this.parent=this);c.block=this;if(a.getParent)var e=a.getParent(),f=l.connect(a,"onSetParent",function(b,c,d){c&&d&&a.setParent(e)});a=d.render(c,a,this);f&&l.disconnect(f);c=c.pop();return a},unrender:function(c,a){return this.rendered.unrender(c,a)},clone:function(c){return new this.constructor(this.name,this.nodelist.clone(c))},toString:function(){return"dojox.dtl.tag.loader.BlockNode"}});g.ExtendsNode=h.extend(function(c,a,b,d,e){this.getTemplate=
c;this.nodelist=a;this.shared=b;this.parent=d;this.key=e},{parents:{},getParent:function(c){var a=this.parent;if(!a){var b,a=this.parent=c.get(this.key,!1);if(!a)throw Error("extends tag used a variable that did not resolve");"object"==typeof a&&(c=a.url||a.templatePath,a.shared&&(this.shared=!0),c?a=this.parent=c.toString():a.templateString?(b=a.templateString,a=this.parent=" "):a=this.parent=this.parent.toString());a&&0===a.indexOf("shared:")&&(this.shared=!0,a=this.parent=a.substring(7,a.length))}if(!a)throw Error("Invalid template name in 'extends' tag.");
if(a.render)return a;if(this.parents[a])return this.parents[a];this.parent=this.getTemplate(b||dojox.dtl.text.getTemplateString(a));this.shared&&(this.parents[a]=this.parent);return this.parent},render:function(c,a){var b=this.getParent(c);b.blocks=b.blocks||{};a.blocks=a.blocks||{};for(var d=0,e;e=this.nodelist.contents[d];d++)if(e instanceof dojox.dtl.tag.loader.BlockNode){var f=b.blocks[e.name];f&&f.nodelist!=e.nodelist&&(a=f.nodelist.unrender(c,a));b.blocks[e.name]=a.blocks[e.name]={shared:this.shared,
nodelist:e.nodelist,used:!1}}this.rendered=b;return b.nodelist.render(c,a,this)},unrender:function(c,a){return this.rendered.unrender(c,a,this)},toString:function(){return"dojox.dtl.block.ExtendsNode"}});g.IncludeNode=h.extend(function(c,a,b,d,e){this._path=c;this.path=(this.constant=a)?c:new k._Filter(c);this.getTemplate=b;this.text=d;this.parsed=5==arguments.length?e:!0},{_cache:[{},{}],render:function(c,a){var b=(this.constant?this.path:this.path.resolve(c)).toString(),d=Number(this.parsed),e=
!1;b!=this.last&&(e=!0,this.last&&(a=this.unrender(c,a)),this.last=b);var f=this._cache[d];if(d)return f[b]||(f[b]=k.text._resolveTemplateArg(b,!0)),e&&(this.rendered=this.getTemplate(f[b]).nodelist),this.rendered.render(c,a,this);if(this.text instanceof k._TextNode)return e&&(this.rendered=this.text,this.rendered.set(k.text._resolveTemplateArg(b,!0))),this.rendered.render(c,a);if(!f[b]){var d=[],g=document.createElement("div");g.innerHTML=k.text._resolveTemplateArg(b,!0);for(var h=g.childNodes;h.length;){var l=
g.removeChild(h[0]);d.push(l)}f[b]=d}if(e)for(this.nodelist=[],e=0;d=f[b][e];e++)this.nodelist.push(d.cloneNode(!0));for(e=0;b=this.nodelist[e];e++)a=a.concat(b);return a},unrender:function(c,a){this.rendered&&(a=this.rendered.unrender(c,a));if(this.nodelist)for(var b=0,d;d=this.nodelist[b];b++)a=a.remove(d);return a},clone:function(c){return new this.constructor(this._path,this.constant,this.getTemplate,this.text.clone(c),this.parsed)}});h.mixin(g,{block:function(c,a){var b=a.contents.split()[1];
c._blocks=c._blocks||{};c._blocks[b]=c._blocks[b]||[];c._blocks[b].push(b);var d=c.parse(["endblock","endblock "+b]).rtrim();c.next_token();return new dojox.dtl.tag.loader.BlockNode(b,d)},extends_:function(c,a){var b=a.contents.split(),d=!1,e=null,f=null;'"'==b[1].charAt(0)||"'"==b[1].charAt(0)?e=b[1].substring(1,b[1].length-1):f=b[1];e&&0==e.indexOf("shared:")&&(d=!0,e=e.substring(7,e.length));b=c.parse();return new dojox.dtl.tag.loader.ExtendsNode(c.getTemplate,b,d,e,f)},include:function(c,a){var b=
a.contents.split();if(2!=b.length)throw Error(b[0]+" tag takes one argument: the name of the template to be included");var b=b[1],d=!1;'"'!=b.charAt(0)&&"'"!=b.slice(-1)||b.charAt(0)!=b.slice(-1)||(b=b.slice(1,-1),d=!0);return new g.IncludeNode(b,d,c.getTemplate,c.create_text_node())},ssi:function(c,a){var b=a.contents.split(),d=!1;if(3==b.length&&(d="parsed"==b.pop(),!d))throw Error("Second (optional) argument to ssi tag must be 'parsed'");b=g.include(c,new k.Token(a.token_type,b.join(" ")));b.parsed=
d;return b}});return g});