//>>built
define("dojox/data/FlickrStore","dojo/_base/lang dojo/_base/declare dojo/_base/array dojo/data/util/simpleFetch dojo/io/script dojo/_base/connect dojo/date/stamp dojo/AdapterRegistry".split(" "),function(g,f,n,h,p,m,q,r){f=f("dojox.data.FlickrStore",null,{constructor:function(a){a&&a.label&&(this.label=a.label);a&&"urlPreventCache"in a&&(this.urlPreventCache=a.urlPreventCache?!0:!1)},_storeRef:"_S",label:"title",urlPreventCache:!0,_assertIsItem:function(a){if(!this.isItem(a))throw Error("dojox.data.FlickrStore: a function was passed an item argument that was not an item");
},_assertIsAttribute:function(a){if("string"!==typeof a)throw Error("dojox.data.FlickrStore: a function was passed an attribute argument that was not an attribute name string");},getFeatures:function(){return{"dojo.data.api.Read":!0}},getValue:function(a,b,c){return(a=this.getValues(a,b))&&0<a.length?a[0]:c},getAttributes:function(a){return"title description author datePublished dateTaken imageUrl imageUrlSmall imageUrlMedium tags link".split(" ")},hasAttribute:function(a,b){var c=this.getValue(a,
b);return c||""===c||!1===c?!0:!1},isItemLoaded:function(a){return this.isItem(a)},loadItem:function(a){},getLabel:function(a){return this.getValue(a,this.label)},getLabelAttributes:function(a){return[this.label]},containsValue:function(a,b,c){a=this.getValues(a,b);for(b=0;b<a.length;b++)if(a[b]===c)return!0;return!1},getValues:function(a,b){this._assertIsItem(a);this._assertIsAttribute(b);var c=g.hitch(this,"_unescapeHtml"),d=g.hitch(q,"fromISOString");switch(b){case "title":return[c(a.title)];case "author":return[c(a.author)];
case "datePublished":return[d(a.published)];case "dateTaken":return[d(a.date_taken)];case "imageUrlSmall":return[a.media.m.replace(/_m\./,"_s.")];case "imageUrl":return[a.media.m.replace(/_m\./,".")];case "imageUrlMedium":return[a.media.m];case "link":return[a.link];case "tags":return a.tags.split(" ");case "description":return[c(a.description)];default:return[]}},isItem:function(a){return a&&a[this._storeRef]===this?!0:!1},close:function(a){},_fetchItems:function(a,b,c){var d=a.query=a.query||{},
k={format:"json",tagmode:"any"};n.forEach(["tags","tagmode","lang","id","ids"],function(e){d[e]&&(k[e]=d[e])});k.id=d.id||d.userid||d.groupid;d.userids&&(k.ids=d.userids);var l=null,t={url:dojox.data.FlickrStore.urlRegistry.match(a),preventCache:this.urlPreventCache,content:k},u=g.hitch(this,function(e){l&&m.disconnect(l);b(this._processFlickrData(e),a)});l=m.connect("jsonFlickrFeed",u);p.get(t).addErrback(function(e){m.disconnect(l);c(e,a)})},_processFlickrData:function(a){var b=[];if(a.items){b=
a.items;for(var c=0;c<a.items.length;c++)a.items[c][this._storeRef]=this}return b},_unescapeHtml:function(a){return a.replace(/&amp;/gm,"\x26").replace(/&lt;/gm,"\x3c").replace(/&gt;/gm,"\x3e").replace(/&quot;/gm,'"').replace(/&#39;/gm,"'")}});g.extend(f,h);h=f.urlRegistry=new r(!0);h.register("group pool",function(a){return!!a.query.groupid},"https://api.flickr.com/services/feeds/groups_pool.gne");h.register("default",function(a){return!0},"https://api.flickr.com/services/feeds/photos_public.gne");
if(!v)var v=function(a){};return f});