(function(){var e=function(e){var t=this;e.require().script("mvc/model.service").done(function(){var n=function(){e.Model.service.yql=e.Model.service({select:"*",from:"flickr.photos.search",convert:function(t,n){return e.each(n,function(n){var r=RegExp("#{"+n+"}","g"),i=e.trim(this);t=t.replace(r,i)}),t},findAll:function(t,n,r){t=e.extend({},this._service,t);var i=["SELECT",t.select,"FROM",t.from];t.where&&i.push("WHERE",typeof t.where=="string"||this._service.convert(t.where[0],t.where[1]));var s=this,o={url:"http://query.yahooapis.com/v1/public/yql",dataType:"jsonp",data:{q:i.join(" "),format:"json",env:"store://datatables.org/alltableswithkeys",callback:"?"}};r&&(o.error=r),this.wrapMany?o.success=function(e){var t=e.query.results;if(t)for(var r in t){n(s.wrapMany(e.query.results[r]));break}else n([])}:o.success=n,e.ajax(o)}})};n(),t.resolveWith(n)})};dispatch("mvc/model.service.yql").containing(e).to("Foundry/2.1 Modules")})();