YUI.add("client-transport",(function(e){"use strict";var t,r,i=e.betterCache,s=e.config.flickr.transport.default_timeout,o=/"id":"([0-9]+)"/g,a=/"nsid":"([0-9]+@N[0-9]+)"/g,n={photos:{},users:{}},c=new RegExp(e.config.flickr.api.write_api_method_regex),f={"flickr.sharing.getServiceTypes":!0},l={"flickr.sharing.getServices":!0,"flickr.sharing.canShare":!0,"flickr.sharing.getAuthorizeUrl":!0,"flickr.products.orders.getOrder":!0,"flickr.cameraroll.getMap":!0,"flickr.cameraroll.getMapVersion":!0,"flickr.cameraroll.getPhotosByOffset":!0,"flickr.cameraroll.tags.getPhotoIds":!0,"flickr.photos.getPhotos":!0,"flickr.photos.getFavorites":!0,"flickr.photos.upload.checkTickets":!0,"flickr.photos.recentlyDeleted":!0,"flickr.photos.recentlyUploaded":!0,"flickr.photos.recentlyUpdated":!0,"flickr.photosets.getList":!0,"flickr.people.getPhotos":!0,"flickr.activity.getNotificationsCount":!0,"flickr.feed.getFeed":!0,"flickr.activity.recentByType":!0,"flickr.feed.preferences.getUserPreferences":!0,"flickr.groups.invite.photo.invite":!0,"flickr.feed.preferences.muteObject":!0,"flickr.feed.preferences.unmuteObject":!0,"flickr.feed.preferences.muteEventType":!0,"flickr.subscriptions.validateCoupon":!0,"flickr.galleries.getList":!0,"flickr.galleries.getPhotos":!0,"flickr.galleries.getContext":!0,"flickr.galleries.getInfo":!0,"flickr.people.getGroupsWithStatus":!0,"flickr.groups.pools.getPhotos":!0,"flickr.groups.pools.getGroups":!0,"flickr.groups.admin.getPendingPhotos":!0,"flickr.prefs.setPrefs":!0,"flickr.prefs.getPrefs":!0,"flickr.prefs.setActivityFilter":!0,"flickr.account.getAuthorizedServices":!0,"flickr.galleries.comments.getList":!0,"flickr.payments.getUserGiftList":!0,"flickr.payments.updateUserGiftStatus":!0,"flickr.payments.getUserGiftListGiven":!0,"flickr.photos.licenses.getLicenseHistory":!0,"flickr.commons.getRecentAlbums":!0,"flickr.tags.getListUser":!0},d=require("xhr");function u(e){var t;if(e.data.photo_id&&n.photos[e.data.photo_id]){for(t in n.photos[e.data.photo_id])i.unset(t);delete n.photos[e.data.photo_id]}if(e.data.user_id&&n.users[e.data.user_id]){for(t in n.users[e.data.user_id])i.unset(t);delete n.users[e.data.user_id]}}function p(t,r,i){var s,o=this;return(s=function(){return o.keys.siteKey.isExpired()?o.keys.siteKey.fetch().then(s):o.keys.csrf.isExpired()?o.keys.csrf.fetch().then(s):i?(h.call(o,t,r,i,p),i):new e.Promise((function(e,i){this.resolve=e,this.reject=i,h.call(o,t,r,this,p)}))})()}function h(t,s,p,h){var k,y,v,w,T,S,_,E,I,b,P,R=this;if(w=e.config.flickr.request?e.config.flickr.request.id:window.reqId,(s=s||{}).data=s.data||{},s.data.csrf=this.keys.csrf.getKey(),s.data.api_key=this.keys.siteKey.getKey(),!s.data.api_key){var x="Invalid API key.",O=new Error(x);return g(x,{}),O.fatal=!0,O.panda=!0,void p.reject(O)}if(s.method=s.method||"GET",s.data.format="json",s.data.hermes=1,s.data.hermesClient=1,s.data.reqId=w,v=(k=t)+JSON.stringify(s.data),s.data.method&&s.data.method.match(c)&&(s.method="POST",u(s)),y=i.get(v))return e.Promise.resolve(y).then(p.resolve);s.data.nojsoncallback=1,this._authRetry=this._authRetry||0,this._authRetry++,T=(new Date).getTime(),S=s.data.method,_=s.data,E={method:s.method,data:s.data,xdr:{use:"native",credentials:!0,dataType:"application/json"},on:{complete:function(c,d){var k,y,I={},x=!0===l[s.data.method],O=!1!==f[s.data.method],C=(new Date).getTime(),N=0;r&&(k=c,d=d.rawRequest);try{N=d.status}catch(e){}if(I.reqId=w,404===N)return p.resolve({status:404}),I.apiMethod=S,void e.fire("client-transport:apiError",I);if(503===N)return p.reject({status:503}),I.apiMethod=S,void e.fire("client-transport:apiError",I);if(0===N&&d&&4!==d.readyState)return setTimeout((function(){e.ClientTransport.unloading||((y={status:0,resp:d,message:"XHR aborted:"+d.readyState}).total=C-T,y.apiMethod=S,r&&k&&(y.message+=": "+k.message),y.total>E.timeout&&(y.timeout=!0,y.clientTimeout=!0,y.message="XHR Timeout"),p.reject(y),I.apiMethod=S,e.fire("client-transport:apiError",I))}),10),void m(P,"abort",b);if(0===N){(y={status:0,resp:d,message:"XHR error"}).total=C-T,y.apiMethod=S,r&&k&&(y.message+=": "+k.message),y.total>E.timeout&&(y.timeout=!0,y.clientTimeout=!0,y.message="XHR Timeout");try{var U=new Image;U.addEventListener("error",(function(){g("XHR maybe dns issue",{})}),!1),U.src=e.config.flickr.api.hostname+"/services/spaceout.gif"}catch(e){}return p.reject(y),I.apiMethod=S,e.fire("client-transport:apiError",I),void m(P,"error",b)}try{I=JSON.parse(d.responseText)||{}}catch(t){return p.reject({status:0,message:"invalid JSON in response",resp:d}),I.apiMethod=S,void e.fire("client-transport:apiError",I)}if("ok"!==I.stat)return I.code=Number(I.code),h&&[98,99,100].indexOf(I.code)>=0&&R._authRetry<10?(98===I.code&&R.keys.csrf.invalidate(T),R.keys.siteKey.invalidate(T),void h.call(R,t,s,p)):(I.apiMethod=S,e.fire("client-transport:apiError",I),"flickr.site.getCsrf"===S?p.reject(I):p.resolve(I));e.soon((function(){e.fire("client-transport:apiTime",{start:T,end:C,method:_.method})})),R._authRetry=0,p.resolve(I),"GET"===s.method&&O&&!x&&(!(function(e,t){for(var r;r=o.exec(t);)n.photos[r[1]]||(n.photos[r[1]]={}),n.photos[r[1]][e]=e;for(;r=a.exec(t);)n.users[r[1]]||(n.users[r[1]]={}),n.users[r[1]][e]=e})(v,d.responseText),i.set(v,I),setTimeout((function(){u(s)}),12e4))},start:function(){},end:function(){},failure:function(){}}};try{P=k+"?"+e.QueryString.stringify(E.data)}catch(e){}I=(new Date).getTime();var C={useXDR:!0,method:s.method,withCredentials:"true"};if(r&&("POST"===s.method?(C.url=k,C.body=e.QueryString.stringify(E.data),C.headers={"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}):C.url=P),"complete"!==window.document.readyState){var N=window.document.onreadystatechange;window.document.onreadystatechange=function(){"complete"===window.document.readyState&&(N&&"function"==typeof N&&N(),r?d(C,E.on.complete):e.io(k,E),b=(new Date).getTime()-I)}}else r?d(C,E.on.complete):e.io(k,E),b=(new Date).getTime()-I}function m(t,r,i){var s,o={},a=e.config.win;try{t&&a.performance&&a.performance.getEntriesByName&&(s=a.performance.getEntriesByName(t))&&s.length>0&&s[0]&&(s=s[s.length-1],o={dns:parseInt(s.domainLookupEnd-s.domainLookupStart),tcp:parseInt(s.connectEnd-s.connectStart),ttfb:parseInt(s.responseStart-s.startTime),transfer:parseInt(s.responseEnd-s.responseStart),total:parseInt(s.responseEnd-s.startTime),connectTime:i}),i&&(o.connectTime=i),Object.keys(o).length>0&&!YUI.Env.isServer&&e.config.win.beaconError&&e.config.win.beaconError("[FlickrAPI] XHR "+r+":",e.config.win.location.href,o)}catch(e){}}function g(t,r){var i=e.config.win;try{!YUI.Env.isServer&&e.config.win.beaconError&&r&&i.beaconError("[FlickrAPI] "+t+":",i.location.href,r)}catch(e){}}YUI.F=YUI.F||{},YUI.F.jsonCallbacks={},e.ClientTransport=t=function(e){this.keys=t._keys,r=e["enable-xhr-lib-for-client-xhrs"]},t._keys={csrf:null,siteKey:null},t.authorize=function(r){t._keys.siteKey=new e.SiteKey(r.flickrAPI),t._keys.siteKey.scheduleFutureFetch(),t._keys.csrf=new e.CsrfUpdater(r.flickrAPI),t._keys.csrf.scheduleFutureFetch()},e.ClientTransport.prototype={makeRequest:function(e,t){return p.call(this,e,t)},makeSiteKeyRequest:function(){var t="/hermes_error_beacon.gne";return new e.Promise((function(i,o){r?d({uri:t},(function(e,t,r){var s;t=t.rawRequest;try{s=JSON.parse(t.responseText)||{}}catch(e){return o({status:0,message:"invalid JSON in response",resp:t})}if(!s.site_key)return o({status:0,message:"invalid JSON content, no site_key found",resp:t});i(s)})):e.io(t,{method:"GET",timeout:s,on:{complete:function(e,t){var r;try{r=JSON.parse(t.responseText)||{}}catch(e){return o({status:0,message:"invalid JSON in response",resp:t})}if(!r.site_key)return o({status:0,message:"invalid JSON content, no site_key found",resp:t});i(r)}}})}))},makeCsrfRequest:function(t){e.ClientApp&&e.ClientApp.disableClientNav()}}}),"@VERSION@",{requires:["querystring-stringify","better-cache","io-xdr","site-key","csrf-updater","flickr-promise","client-app"],optionalRequires:["hermes-core"],affinity:"client"});YUI.add("node-pluginhost",function(e,t){e.Node.plug=function(){var t=e.Array(arguments);return t.unshift(e.Node),e.Plugin.Host.plug.apply(e.Base,t),e.Node},e.Node.unplug=function(){var t=e.Array(arguments);return t.unshift(e.Node),e.Plugin.Host.unplug.apply(e.Base,t),e.Node},e.mix(e.Node,e.Plugin.Host,!1,null,1),e.Object.each(e.Node._instances,function(t){e.Plugin.Host.apply(t)}),e.NodeList.prototype.plug=function(){var t=arguments;return e.NodeList.each(this,function(n){e.Node.prototype.plug.apply(e.one(n),t)}),this},e.NodeList.prototype.unplug=function(){var t=arguments;return e.NodeList.each(this,function(n){e.Node.prototype.unplug.apply(e.one(n),t)}),this}},"3.16.0",{requires:["node-base","pluginhost"]}); YUI.add("dom-screen",function(e,t){(function(e){var t="documentElement",n="compatMode",r="position",i="fixed",s="relative",o="left",u="top",a="BackCompat",f="medium",l="borderLeftWidth",c="borderTopWidth",h="getBoundingClientRect",p="getComputedStyle",d=e.DOM,v=/^t(?:able|d|h)$/i,m;e.UA.ie&&(e.config.doc[n]!=="BackCompat"?m=t:m="body"),e.mix(d,{winHeight:function(e){var t=d._getWinSize(e).height;return t},winWidth:function(e){var t=d._getWinSize(e).width;return t},docHeight:function(e){var t=d._getDocSize(e).height;return Math.max(t,d._getWinSize(e).height)},docWidth:function(e){var t=d._getDocSize(e).width;return Math.max(t,d._getWinSize(e).width)},docScrollX:function(n,r){r=r||n?d._getDoc(n):e.config.doc;var i=r.defaultView,s=i?i.pageXOffset:0;return Math.max(r[t].scrollLeft,r.body.scrollLeft,s)},docScrollY:function(n,r){r=r||n?d._getDoc(n):e.config.doc;var i=r.defaultView,s=i?i.pageYOffset:0;return Math.max(r[t].scrollTop,r.body.scrollTop,s)},getXY:function(){return e.config.doc[t][h]?function(r){var i=null,s,o,u,f,l,c,p,v,g,y;if(r&&r.tagName){p=r.ownerDocument,u=p[n],u!==a?y=p[t]:y=p.body,y.contains?g=y.contains(r):g=e.DOM.contains(y,r);if(g){v=p.defaultView,v&&"pageXOffset"in v?(s=v.pageXOffset,o=v.pageYOffset):(s=m?p[m].scrollLeft:d.docScrollX(r,p),o=m?p[m].scrollTop:d.docScrollY(r,p)),e.UA.ie&&(!p.documentMode||p.documentMode<8||u===a)&&(l=y.clientLeft,c=y.clientTop),f=r[h](),i=[f.left,f.top];if(l||c)i[0]-=l,i[1]-=c;if(o||s)if(!e.UA.ios||e.UA.ios>=4.2)i[0]+=s,i[1]+=o}else i=d._getOffset(r)}return i}:function(t){var n=null,s,o,u,a,f;if(t)if(d.inDoc(t)){n=[t.offsetLeft,t.offsetTop],s=t.ownerDocument,o=t,u=e.UA.gecko||e.UA.webkit>519?!0:!1;while(o=o.offsetParent)n[0]+=o.offsetLeft,n[1]+=o.offsetTop,u&&(n=d._calcBorders(o,n));if(d.getStyle(t,r)!=i){o=t;while(o=o.parentNode){a=o.scrollTop,f=o.scrollLeft,e.UA.gecko&&d.getStyle(o,"overflow")!=="visible"&&(n=d._calcBorders(o,n));if(a||f)n[0]-=f,n[1]-=a}n[0]+=d.docScrollX(t,s),n[1]+=d.docScrollY(t,s)}else n[0]+=d.docScrollX(t,s),n[1]+=d.docScrollY(t,s)}else n=d._getOffset(t);return n}}(),getScrollbarWidth:e.cached(function(){var t=e.config.doc,n=t.createElement("div"),r=t.getElementsByTagName("body")[0],i=.1;return r&&(n.style.cssText="position:absolute;visibility:hidden;overflow:scroll;width:20px;",n.appendChild(t.createElement("p")).style.height="1px",r.insertBefore(n,r.firstChild),i=n.offsetWidth-n.clientWidth,r.removeChild(n)),i},null,.1),getX:function(e){return d.getXY(e)[0]},getY:function(e){return d.getXY(e)[1]},setXY:function(e,t,n){var i=d.setStyle,a,f,l,c;e&&t&&(a=d.getStyle(e,r),f=d._getOffset(e),a=="static"&&(a=s,i(e,r,a)),c=d.getXY(e),t[0]!==null&&i(e,o,t[0]-c[0]+f[0]+"px"),t[1]!==null&&i(e,u,t[1]-c[1]+f[1]+"px"),n||(l=d.getXY(e),(l[0]!==t[0]||l[1]!==t[1])&&d.setXY(e,t,!0)))},setX:function(e,t){return d.setXY(e,[t,null])},setY:function(e,t){return d.setXY(e,[null,t])},swapXY:function(e,t){var n=d.getXY(e);d.setXY(e,d.getXY(t)),d.setXY(t,n)},_calcBorders:function(t,n){var r=parseInt(d[p](t,c),10)||0,i=parseInt(d[p](t,l),10)||0;return e.UA.gecko&&v.test(t.tagName)&&(r=0,i=0),n[0]+=i,n[1]+=r,n},_getWinSize:function(r,i){i=i||r?d._getDoc(r):e.config.doc;var s=i.defaultView||i.parentWindow,o=i[n],u=s.innerHeight,a=s.innerWidth,f=i[t];return o&&!e.UA.opera&&(o!="CSS1Compat"&&(f=i.body),u=f.clientHeight,a=f.clientWidth),{height:u,width:a}},_getDocSize:function(r){var i=r?d._getDoc(r):e.config.doc,s=i[t];return i[n]!="CSS1Compat"&&(s=i.body),{height:s.scrollHeight,width:s.scrollWidth}}})})(e),function(e){var t="top",n="right",r="bottom",i="left",s=function(e,s){var o=Math.max(e[t],s[t]),u=Math.min(e[n],s[n]),a=Math.min(e[r],s[r]),f=Math.max(e[i],s[i]),l={};return l[t]=o,l[n]=u,l[r]=a,l[i]=f,l},o=e.DOM;e.mix(o,{region:function(e){var t=o.getXY(e),n=!1;return e&&t&&(n=o._getRegion(t[1],t[0]+e.offsetWidth,t[1]+e.offsetHeight,t[0])),n},intersect:function(u,a,f){var l=f||o.region(u),c={},h=a,p;if(h.tagName)c=o.region(h);else{if(!e.Lang.isObject(a))return!1;c=a}return p=s(c,l),{top:p[t],right:p[n],bottom:p[r],left:p[i],area:(p[r]-p[t])*(p[n]-p[i]),yoff:p[r]-p[t],xoff:p[n]-p[i],inRegion:o.inRegion(u,a,!1,f)}},inRegion:function(u,a,f,l){var c={},h=l||o.region(u),p=a,d;if(p.tagName)c=o.region(p);else{if(!e.Lang.isObject(a))return!1;c=a}return f?h[i]>=c[i]&&h[n]<=c[n]&&h[t]>=c[t]&&h[r]<=c[r]:(d=s(c,h),d[r]>=d[t]&&d[n]>=d[i]?!0:!1)},inViewportRegion:function(e,t,n){return o.inRegion(e,o.viewportRegion(e),t,n)},_getRegion:function(e,s,o,u){var a={};return a[t]=a[1]=e,a[i]=a[0]=u,a[r]=o,a[n]=s,a.width=a[n]-a[i],a.height=a[r]-a[t],a},viewportRegion:function(t){t=t||e.config.doc.documentElement;var n=!1,r,i;return t&&(r=o.docScrollX(t),i=o.docScrollY(t),n=o._getRegion(i,o.winWidth(t)+r,i+o.winHeight(t),r)),n}})}(e)},"3.16.0",{requires:["dom-base","dom-style"]}); YUI.add("node-screen",function(e,t){e.each(["winWidth","winHeight","docWidth","docHeight","docScrollX","docScrollY"],function(t){e.Node.ATTRS[t]={getter:function(){var n=Array.prototype.slice.call(arguments);return n.unshift(e.Node.getDOMNode(this)),e.DOM[t].apply(this,n)}}}),e.Node.ATTRS.scrollLeft={getter:function(){var t=e.Node.getDOMNode(this);return"scrollLeft"in t?t.scrollLeft:e.DOM.docScrollX(t)},setter:function(t){var n=e.Node.getDOMNode(this);n&&("scrollLeft"in n?n.scrollLeft=t:(n.document||n.nodeType===9)&&e.DOM._getWin(n).scrollTo(t,e.DOM.docScrollY(n)))}},e.Node.ATTRS.scrollTop={getter:function(){var t=e.Node.getDOMNode(this);return"scrollTop"in t?t.scrollTop:e.DOM.docScrollY(t)},setter:function(t){var n=e.Node.getDOMNode(this);n&&("scrollTop"in n?n.scrollTop=t:(n.document||n.nodeType===9)&&e.DOM._getWin(n).scrollTo(e.DOM.docScrollX(n),t))}},e.Node.importMethod(e.DOM,["getXY","setXY","getX","setX","getY","setY","swapXY"]),e.Node.ATTRS.region={getter:function(){var t=this.getDOMNode(),n;return t&&!t.tagName&&t.nodeType===9&&(t=t.documentElement),e.DOM.isWindow(t)?n=e.DOM.viewportRegion(t):n=e.DOM.region(t),n}},e.Node.ATTRS.viewportRegion={getter:function(){return e.DOM.viewportRegion(e.Node.getDOMNode(this))}},e.Node.importMethod(e.DOM,"inViewportRegion"),e.Node.prototype.intersect=function(t,n){var r=e.Node.getDOMNode(this);return e.instanceOf(t,e.Node)&&(t=e.Node.getDOMNode(t)),e.DOM.intersect(r,t,n)},e.Node.prototype.inRegion=function(t,n,r){var i=e.Node.getDOMNode(this);return e.instanceOf(t,e.Node)&&(t=e.Node.getDOMNode(t)),e.DOM.inRegion(i,t,n,r)}},"3.16.0",{requires:["dom-screen","node-base"]}); YUI.add("node-style",function(e,t){(function(e){e.mix(e.Node.prototype,{setStyle:function(t,n){return e.DOM.setStyle(this._node,t,n),this},setStyles:function(t){return e.DOM.setStyles(this._node,t),this},getStyle:function(t){return e.DOM.getStyle(this._node,t)},getComputedStyle:function(t){return e.DOM.getComputedStyle(this._node,t)}}),e.NodeList.importMethod(e.Node.prototype,["getStyle","getComputedStyle","setStyle","setStyles"])})(e);var n=e.Node;e.mix(n.prototype,{show:function(e){return e=arguments[arguments.length-1],this.toggleView(!0,e),this},_show:function(){this.removeAttribute("hidden"),this.setStyle("display","")},_isHidden:function(){return this.hasAttribute("hidden")||e.DOM.getComputedStyle(this._node,"display")==="none"},toggleView:function(e,t){return this._toggleView.apply(this,arguments),this},_toggleView:function(e,t){return t=arguments[arguments.length-1],typeof e!="boolean"&&(e=this._isHidden()?1:0),e?this._show():this._hide(),typeof t=="function"&&t.call(this),this},hide:function(e){return e=arguments[arguments.length-1],this.toggleView(!1,e),this},_hide:function(){this.setAttribute("hidden","hidden"),this.setStyle("display","none")}}),e.NodeList.importMethod(e.Node.prototype,["show","hide","toggleView"])},"3.16.0",{requires:["dom-style","node-base"]}); YUI.add("loader-bar",(function(e){var t,n,o,a,i,l=0,s=!1,r=null,d=function(e){a&&e.addClass(i)};function h(){s=!0,l=(l=100*Math.random())>20?l:20,o=e.one("html").getAttribute("class").match(/is-([-\w]+)-day/),a=o&&o.length>1,i=a?o[1]+"-day-background":"",r?(e.one(".global-nav-shim")&&r.setStyle("top",e.one(".global-nav-shim").get("offsetHeight")+"px"),d(r),r.setStyle("display","block")):(r=e.Node.create('