//>>built
define("dojox/mobile/dh/JsonContentHandler","dojo/_base/kernel dojo/_base/array dojo/_base/declare dojo/_base/lang dojo/_base/Deferred dojo/json dojo/dom-construct".split(" "),function(t,r,w,n,u,v,x){return w("dojox.mobile.dh.JsonContentHandler",null,{parse:function(a,g,b){var d,c=x.create("DIV");g.insertBefore(c,b);this._ws=[];this._req=[];var k=v.parse(a);return u.when(this._loadPrereqs(k),n.hitch(this,function(){d=this._instantiate(k,c);d.style.visibility="hidden";r.forEach(this._ws,function(p){!p._started&&
p.startup&&p.startup()});this._ws=null;return d.id}))},_loadPrereqs:function(a){var g=new u;a=this._collectRequires(a);if(0===a.length)return!0;if(t.require)return r.forEach(a,function(b){t.require(b)}),!0;a=r.map(a,function(b){return b.replace(/\./g,"/")});require(a,function(){g.resolve(!0)});return g},_collectRequires:function(a){var g=a["class"],b;for(b in a)if("@"!=b.charAt(0)&&"children"!==b){var d=g||b.replace(/:.*/,"");this._req.push(d);if(d){d=g?[a]:n.isArray(a[b])?a[b]:[a[b]];for(var c=0;c<
d.length;c++)if(!g)this._collectRequires(d[c]);else if(d[c].children)for(var k=0;k<d[c].children.length;k++)this._collectRequires(d[c].children[k])}}return this._req},_instantiate:function(a,g,b){var d=a["class"],c;for(c in a)if("@"!=c.charAt(0)&&"children"!==c){var k=n.getObject(d||c.replace(/:.*/,""));if(k)for(var p=k.prototype,m=d?[a]:n.isArray(a[c])?a[c]:[a[c]],l=0;l<m.length;l++){var e={};for(var f in m[l])if("@"==f.charAt(0)){var h=m[l][f];f=f.substring(1);var q=typeof p[f];n.isArray(p[f])?
e[f]=h.split(/\s*,\s*/):"string"===q?e[f]=h:"number"===q?e[f]=h-0:"boolean"===q?e[f]="false"!==h:"object"===q?e[f]=v.parse(h):"function"===q&&(e[f]=n.getObject(h,!1)||new Function(h))}e=new k(e,g);g&&this._ws.push(e);b&&e.placeAt(b.containerNode||b.domNode);if(!d)this._instantiate(m[l],null,e);else if(m[l].children)for(h=0;h<m[l].children.length;h++)this._instantiate(m[l].children[h],null,e)}}return e&&e.domNode}})});