YUI.add("hermes-template-infobar-photolist-photo",function(n,t){var l=n.Template.Handlebars.revive({1:function(n,t,l,a,e){return" info-bar-on-hover"},3:function(n,t,l,a,e){return" restricted-image"},5:function(n,t,l,a,e){return" is-video"},7:function(n,t,l,a,e){return" has-descriptions"},9:function(n,t,l,a,e){var o;return null!=(o=n.invokePartial(a["photo-card-overlay-icon"],t,{name:"photo-card-overlay-icon",hash:{type:"video"},data:e,indent:"\t\t\t",helpers:l,partials:a,decorators:n.decorators}))?o:""},11:function(n,t,l,a,e){var o;return null!=(o=l.if.call(null!=t?t:{},null!=(o=null!=(o=null!=(o=null!=t?t.photo:t)?o.owner:o)?o.buddyicon:o)?o.default:o,{name:"if",hash:{},fn:n.program(12,e,0),inverse:n.program(14,e,0),data:e}))?o:""},12:function(n,t,l,a,e){var o,r=n.lambda,s=n.escapeExpression;return'\t\t\t\n'},14:function(n,t,l,a,e){var o,r=n.lambda,s=n.escapeExpression;return'\t\t\t\n'},16:function(n,t,l,a,e){var o,r,s=null!=t?t:{},i=n.escapeExpression;return'\t\t\t\t\n\t\t\t\t\t'+i(n.lambda(null!=(o=null!=t?t.photo:t)?o.title:o,t))+"\n\t\t\t\t \n"},17:function(n,t,l,a,e){var o;return n.escapeExpression(n.lambda(null!=(o=null!=t?t.photo:t)?o.title:o,t))},19:function(n,t,l,a,e){return n.escapeExpression((l.intlMessage||t&&t.intlMessage||l.helperMissing).call(null!=t?t:{},{name:"intlMessage",hash:{intlName:"common.UNTITLED"},data:e}))},21:function(n,t,l,a,e){var o;return'\t\t\t\t\n'+(null!=(o=(l.photoAttribution||t&&t.photoAttribution||l.helperMissing).call(null!=t?t:{},null!=t?t.photo:t,null!=t?t.flippers:t,{name:"photoAttribution",hash:{},fn:n.program(22,e,0),inverse:n.noop,data:e}))?o:"")+"\t\t\t\t \n"},22:function(n,t,l,a,e){var o;return null!=(o=l.if.call(null!=t?t:{},null!=t?t.intlName:t,{name:"if",hash:{},fn:n.program(23,e,0),inverse:n.program(25,e,0),data:e}))?o:""},23:function(n,t,l,a,e){return"\t\t\t\t\t\t\t"+n.escapeExpression((l.intlMessage||t&&t.intlMessage||l.helperMissing).call(null!=t?t:{},{name:"intlMessage",hash:{user:null!=t?t.user:t,intlName:null!=t?t.intlName:t},data:e}))+"\n"},25:function(n,t,l,a,e){var o;return"\t\t\t\t\t\t\t"+n.escapeExpression("function"==typeof(o=null!=(o=l.user||(null!=t?t.user:t))?o:l.helperMissing)?o.call(null!=t?t:{},{name:"user",hash:{},data:e}):o)+"\n"},27:function(n,t,l,a,e){return" faved"},29:function(n,t,l,a,e){return" can-not-fave"},31:function(n,t,l,a,e){return" hidden"},33:function(n,t,l,a,e){var o;return n.escapeExpression((l.formatNumber||t&&t.formatNumber||l.helperMissing).call(null!=t?t:{},null!=(o=null!=(o=null!=t?t.photo:t)?o.engagement:o)?o.faveCount:o,{name:"formatNumber",hash:{},data:e}))},35:function(n,t,l,a,e){var o;return n.escapeExpression((l.formatNumber||t&&t.formatNumber||l.helperMissing).call(null!=t?t:{},null!=(o=null!=(o=null!=t?t.photo:t)?o.engagement:o)?o.commentCount:o,{name:"formatNumber",hash:{},data:e}))},37:function(n,t,l,a,e){var o,r=null!=t?t:{};return'\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t\t\n\t\t\t\t\t\t'+(null!=(o=l.if.call(r,null!=(o=null!=(o=null!=t?t.photo:t)?o.engagement:o)?o.viewCount:o,{name:"if",hash:{},fn:n.program(38,e,0),inverse:n.noop,data:e}))?o:"")+"\n\t\t\t\t\t \n\t\t\t\t \n"},38:function(n,t,l,a,e){var o;return n.escapeExpression((l.formatNumber||t&&t.formatNumber||l.helperMissing).call(null!=t?t:{},null!=(o=null!=(o=null!=t?t.photo:t)?o.engagement:o)?o.viewCount:o,{name:"formatNumber",hash:{},data:e}))},40:function(n,t,l,a,e){return'\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t \n'},compiler:[7,">= 4.0.0"],main:function(n,t,l,a,e){var o,r,s=null!=t?t:{},i=n.escapeExpression;return'
\n\t
\n\t\t
\n\t\t
\n'+(null!=(o=l.if.call(s,null!=(o=null!=t?t.photo:t)?o.isVideo:o,{name:"if",hash:{},fn:n.program(9,e,0),inverse:n.noop,data:e}))?o:"")+'\t
\n\t\n\t
\n\t\t
\n'+(null!=(o=l.if.call(s,null!=t?t.showOwnerIcon:t,{name:"if",hash:{},fn:n.program(11,e,0),inverse:n.noop,data:e}))?o:"")+'\t\t\t
\n'+(null!=(o=l.if.call(s,null!=(o=null!=t?t.photo:t)?o.title:o,{name:"if",hash:{},fn:n.program(16,e,0),inverse:n.noop,data:e}))?o:"")+"\n"+(null!=(o=l.if.call(s,null!=(o=null!=(o=null!=t?t.photo:t)?o.owner:o)?o.displayname:o,{name:"if",hash:{},fn:n.program(21,e,0),inverse:n.noop,data:e}))?o:"")+'\t\t\t
\n\t\t
\n\n\t\t
\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t \n\t\t\t\t\n\t\t\t\t\t'+(null!=(o=l.if.call(s,null!=(o=null!=(o=null!=t?t.photo:t)?o.engagement:o)?o.faveCount:o,{name:"if",hash:{},fn:n.program(33,e,0),inverse:n.noop,data:e}))?o:"")+'\n\t\t\t\t \n\t\t\t \n\t\t\t\n"+(null!=(o=l.if.call(s,null!=t?t.displayViews:t,{name:"if",hash:{},fn:n.program(37,e,0),inverse:n.noop,data:e}))?o:"")+(null!=(o=l.if.call(s,null!=t?t.displayCurate:t,{name:"if",hash:{},fn:n.program(40,e,0),inverse:n.noop,data:e}))?o:"")+"\t\t
\n\n\t
\n
\n"},usePartial:!0,useData:!0}),a={};n.Array.each(["photo-card-overlay-icon"],function(t){var l=n.Template.get("hermes/"+t);l&&(a[t]=l)}),n.Template.register("hermes/infobar-photolist-photo",function(t,e){return e=e||{},e.partials=e.partials?n.merge(a,e.partials):a,l(t,e)})},"@VERSION@",{requires:["template-base","handlebars-base","hermes-template-photo-card-overlay-icon"]});YUI.add("infobar-photolist-photo-view",function(e,t){var i=require("hermes-core/flog")(t);e.namespace("Views")[this.name]=e.Base.create(this.name,e.PhotoListSubview,[],{langBundles:this.details.langBundles,initializer:function(e){this.params=e,this.photoModel=e.model,this.signedIn=this.appContext.getViewer().signedIn,this.set("isActiveViewAgnostic",!0),this.hideCommentCount=e.hideCommentCount||!1,this.hideFaveCount=e.hideFaveCount||!1,this.params.displayCurate=void 0===this.params.displayCurate||this.params.displayCurate},loadState:function(){return e.Promise.all([this.appContext.getModel("photo-engagement-models",this.get("id")).then(function(e){this.engagementModel=e}.bind(this)),this.appContext.getModel("photo-models",this.get("id")).then(function(e){this.photoModel=e,this.get("model")||this.set("model",this.photoModel)}.bind(this))])},buildContainer:function(){var t,i=e.URLHelper.getPhotoPage({photoId:this.get("model").getValue("id"),pathAlias:this.get("model").getValue("owner").getValue("pathAlias"),contextSuffix:this.params.contextSuffix}),a=this.get("model"),n=a.getValue("owner"),o=a.getValue("engagement"),s={title:a.getValue("title"),isVideo:a.getValue("isVideo"),needsInterstitial:a.getValue("needsInterstitial"),mediaType:a.getValue("mediaType"),owner:{buddyicon:n.getValue("buddyicon"),pathAlias:n.getValue("pathAlias"),displayname:n.getValue("displayname"),url:n.getValue("url")},engagement:{isFaved:o.getValue("isFaved"),faveCount:this.hideFaveCount?0:o.getValue("faveCount"),commentCount:this.hideCommentCount?0:o.getValue("commentCount"),canFave:o.getValue("canFave"),viewCount:o.getValue("viewCount")}};this.get("container");t={photoPageUrl:i,photoUrl:this.get("photoUrl"),photo:s,infoBarOnHover:this.params.infoBarOnHover,showOwnerIcon:this.params.showOwnerIcon,canFave:this.signedIn&&s.engagement.canFave,displayViews:this.params.displayViews,displayCurate:this.params.displayCurate&&this.appContext.flipper.isFlipped("enable-megadroparound")&&this.signedIn},this.setContainerWithTemplate("infobar-photolist-photo",t),this.updateGeometry()},activate:function(){var t=this.get("container");this.mainContainer=t.one(".photo-list-photo-container"),this.photoContainer=t.one(".photo-container"),this.infoBar=t.one(".sub-photo-info-bar"),this.infoBarEngagement=this.infoBar.one(".engagement"),this.faveNode=this.infoBar.one(".engagement-item.fave"),this.commentNode=this.infoBar.one(".engagement-item.comment"),this.detailsNode=this.infoBar.one(".details-container"),this.avatar=this.detailsNode.one(".avatar"),this.appContext.flipper.isFlipped("enable-megadroparound")&&(this.curateNode=this.infoBar.one(".engagement-item.curate"),this.curateNode&&this.registerEventHandler(this.curateNode.on(["click","keydown"],this.handleCurateClick.bind(this)))),this.faveNode&&(this.faveCountNode=this.faveNode.one(".engagement-count")),this.faveNode&&this.registerEventHandler(this.faveNode.on(["click","key"],this.handleFaveClick.bind(this),"down:13")),this.commentNode&&(this.commentIcon=this.commentNode.one(".engagement-icon"),this.commentTextNode=this.commentNode.one(".engagement-count"),this.registerEventHandler(this.commentNode.on(["click","key"],this.handleCommentClick.bind(this),"down:13"))),this.registerEventHandler(this.engagementModel.on("valuesChanged",this.handleEngagementModelValuesChanged.bind(this))),this.downloadCacheAndSetImage(),e.UA.ie||this.appContext.getUA().isEdge?this.updateEdgeBreakpoints():(this.updateBreakpoints(),this.registerEventHandler(e.on("resize",e.betterThrottle(this.updateBreakpoints.bind(this),500,this,!0)))),this.mainContainer.removeClass("loading")},handleFaveClick:function(t){var a,n=t.currentTarget,o=n.one(".engagement-count");this.faveNode.hasClass("can-not-fave")?this.signedIn||this.showSignUpAndFaveModal(this.get("model").getValue("id"),e.config.win.location.href):this.isFaving||(this.isFaving=!0,this.engagementModel.toggleFave(),a=this.engagementModel.getValue("faveCount"),n.toggleClass("faved",this.engagementModel.getValue("isFaved")),o.toggleClass("empty",0===a),o&&a>0?o.set("text",a):o.set("text",""),this.engagementModel.remoteUpdate().then(function(){this.isFaving=!1}.bind(this),function(e){3!==e.code&&(this.engagementModel.toggleFave(),n.toggleClass("faved",this.engagementModel.getValue("isFaved")),o&&(o.set("text",a),o.toggleClass("empty",0===a))),i.error("Error faving photo",{err:e}),this.isFaving=!1}.bind(this)))},handleCommentClick:function(){var t,i=this,a=new e.Views["photo-comments-view"]({appContext:this.appContext,photoId:this.get("model").getValue("id"),isScrollable:!0,addCommentText:this.intlMessage({intlName:"comments.ADD_PHOTO_COMMENT",mediaType:this.get("model").getValue("mediaType")})});t=new e.Views.FluidDroparound({appContext:this.appContext,dismissOnOverlayClick:!0,showDropArrow:!0,preferTop:!0,width:400,height:400,newReposition:!0,autoSizeToContent:!0,anchorOffsetVertical:0,anchorOffsetHorizontal:12,classList:"infobar-photo-remark",anchorElement:this.commentIcon,keyboardAnchorElement:this.commentNode,subview:a,contentPadding:0,preventPageScrollOnScroll:!0,useDefaultKeyboardNavigation:!1}),i.registerEventHandler(e.on("addComment:showingSignupModal",function(){t.close()})),t.on("closeDroparound",function(){i.commentNode.removeClass("active"),i.infoBar.removeClass("active")}),t.show(),this.commentNode.addClass("active"),this.infoBar.addClass("active")},handleCurateClick:function(e){"click"!==e.type&&13!==e.keyCode&&32!==e.keyCode||(e.halt(),this.showAddToCuration())},showAddToCuration:function(){var t=this.get("model").getValue("isOwner"),i=new e.Views["add-to-stuff-view"]({photoId:this.get("id"),initialTab:t?"album":"gallery",showAlbums:t,showGalleries:!t,inlineGroupCreation:!1,dismissOnSelect:!0,dismissOnCreate:!0});this.curateDroparound=new e.Views.FluidDroparound({appContext:this.appContext,subview:i,dismissOnOverlayClick:!0,showDropArrow:!0,preferTop:!0,width:400,newReposition:!0,autoSizeToContent:!0,anchorOffsetVertical:0,anchorOffsetHorizontal:12,anchorElement:this.curateNode,keyboardAnchorElement:this.curateNode,contentPadding:0,preventPageScrollOnScroll:!0,useDefaultKeyboardNavigation:!1}),this.curateDroparound.show(),this.fire("curateOpened"),this.registerEventHandler(e.on("addToStuff:close",function(e){this.curateDroparound.close(e)}.bind(this))),this.registerEventHandler(this.curateDroparound.on("closeDroparound",function(e){this.fire("curateClosed")}.bind(this)))},handleEngagementModelValuesChanged:function(t){var i;t.commentCount&&(i=t.commentCount.newVal,this.commentTextNode.set("text",e.IntlNumber.format(i,this.appContext.lang,1)),this.commentTextNode.toggleClass("hidden",0===i))},updateBreakpoints:function(){var e=0;this.infoBar.addClass("invisible"),this.infoBar.removeClass("narrow"),this.photoContainer.removeClass("narrow"),this.detailsNode.removeClass("hidden"),this.commentNode.removeClass("hidden"),this.curateNode&&this.curateNode.removeClass("hidden"),this.faveNode&&(this.faveNode.removeClass("hidden"),this.faveNode.removeClass("last"),this.faveCountNode.removeClass("hidden")),this.avatar&&this.avatar.removeClass("hidden"),this.removeButtonContainer&&this.removeButtonContainer.addClass("invisible"),this.avatar&&this.detailsNode.get("clientWidth")<80&&this.avatar.addClass("hidden"),this.detailsNode.get("clientWidth")<=10&&(this.infoBar.addClass("narrow"),this.detailsNode.addClass("hidden")),this.infoBar.get("clientWidth")e&&(o=(a=e)/n),this.firstImageCard.setStyle("height",o+70),this.firstImageCard.setStyle("width",a),this.photoCardView.updateGeometry({aspectRatio:n,geometry:{width:a,height:o+70,top:0,left:0},isAwake:!0}),this.photoCardView.updateBreakpoints()},renderImageCard:function(){var t=this;return this.photoCardView=new e.Views["infobar-photolist-photo-view"]({appContext:this.appContext,id:this.photoModel.getValue("id"),layoutItem:{aspectRatio:this.photoModel.getValue("oWidth")/this.photoModel.getValue("oHeight"),geometry:{width:this.photoModel.getValue("oWidth"),height:this.photoModel.getValue("oHeight"),top:0,left:0},isAwake:!0},displayViews:!0,displayCurate:!1}),this.photoCardView.initialize().then(function(){return t.firstImageCard.append(t.photoCardView.get("container")),t.photoCardView.activate()})},getFetchParams:function(){return{perPage:1,page:1,userId:this.appContext.getViewer().nsid,orderBy:"date-posted-asc"}},show:function(){var t,o=this,a=this.get("container"),n=Math.min(500,o.appContext.viewportData.getWidth()),s=e.config.flickr.account.photo_limit,r=e.UserLimitsHelper.getARRCount(this.profileModel);t=Math.max(r-s,0).toLocaleString(this.appContext.lang,{maximumFractionDigits:0}),this.messageContainer.append(this.templates("mega-limit-overlay-message")({overLimitCountString:t,rulesUrl:"https://blog.flickr.net/en/2018/12/17/important-service-updates-and-dates-to-remember/",acceptUrl:"/account/upgrade/pro?select",username:this.userModel.getValue("username")})),this.acceptButton=this.contentContainer.one(".accept-button"),this.declineButton=this.contentContainer.one(".decline-button"),a.addClass("displayed"),setTimeout(function(){a.addClass("active"),e.one("body").addClass("locked-for-overlay-scroll")},50),o.resizeImage(n),o.registerEventHandler(e.globalEvents.subscribe("window:resize",e.betterThrottle(function(e){var t=Math.min(500,o.appContext.viewportData.getWidth());o.resizeImage(t)},20,null,!0))),o.registerEventHandler(this.acceptButton.on("click",function(e){o.handleAcceptClick(e)})),o.registerEventHandler(this.declineButton.on("click",function(e){o.handleDeclineClick(e)})),i&&i.tl(!0,"o","Photo Limit Takeover: Show")},hide:function(){var t=this.get("container");e.one("body").removeClass("locked-for-overlay-scroll"),t.removeClass("active"),setTimeout(function(){t.removeClass("displayed")},1e3)},handleAcceptClick:function(t){this.hide(),i&&i.tl(e.one(t.target).getDOMNode(),"o","Photo Limit Takeover: Accept",null,"navigate")},handleDeclineClick:function(t){var o=new Date;o.setTime(o.getTime()+36e10),this.appContext.setCookie({cookieName:this.dismissCookieName,cookieValue:1,expires:o,path:"/"}),this.appContext.setCookie({cookieName:e.config.flickr.upload_blocking.dismiss_over_upload_limit_message_cookie_name,cookieValue:1,expires:o,path:"/"}),i&&i.tl(!0,"o","Photo Limit Takeover: Decline"),this.hide()}})},"@VERSION@",{requires:["flickr-view","hermes-template-mega-limit-overlay","hermes-template-mega-limit-overlay-message","person-public-profile-models","intl-number","user-limits-helper","string-helper","api-helper","infobar-photolist-photo-view"],langBundles:["common","upload-blocking"]});YUI.add("banner-view",function(i,e){var n=require("hermes-core/flog")(e);i.FlickrView.create(this.name,i.FlickrView,[],{langBundles:this.details.langBundles,initializer:function(i){this.params=i,this.subview=this.params.subview},loadState:function(){return i.Promise.resolve()},buildContainer:function(){},activate:function(){var i=this,e=this.get("container");if(this.subviewParent=e,this.subview)return this.subview.on("dismiss",function(e){i.dismiss()}),this.setupSubview()},setupSubview:function(){var i=this;return this.subview.initialize().then(function(){var e=i.subview.get("container");{if("canShowBanner"in i.subview)return i.subview.canShowBanner()?(i.subviewParent.empty(),i.subviewParent.appendChild(e),i.subview.activate()):void i.dismiss();n.warn("Banners should implement method canShowBanner")}}).then(function(){i.fire("subviewActivated")})},dismiss:function(){this.get("container").remove(),this.fire("dismissed"),this.destroy()}})},"@VERSION@",{requires:["flickr-view"],langBundles:["common"]});YUI.add("hermes-template-basic-banner",function(e,a){var n=e.Template.Handlebars.revive({compiler:[7,">= 4.0.0"],main:function(e,a,n,t,s){var r,i=null!=a?a:{},l=n.helperMissing,d=e.escapeExpression;return'\n\t
\n\t\t
\n\t\t\t'+d((n.renderTrustedMarkup||a&&a.renderTrustedMarkup||l).call(i,null!=a?a.message:a,{name:"renderTrustedMarkup",hash:{},data:s}))+'\n\t\t
\n\t\t
\n\t
\n
\n'},useData:!0}),t={};e.Array.each([],function(a){var n=e.Template.get("hermes/"+a);n&&(t[a]=n)}),e.Template.register("hermes/basic-banner",function(a,s){return s=s||{},s.partials=s.partials?e.merge(t,s.partials):t,n(a,s)})},"@VERSION@",{requires:["template-base","handlebars-base"]});YUI.add("login-migration-banner-view",function(e,i){require("hermes-core/flog")(i);e.FlickrView.create(this.name,e.FlickrView,[],{langBundles:this.details.langBundles,initializer:function(e){this.params=e},loadState:function(){var i=this.appContext.getViewer(),t=[];return i.signedIn?(this.set("isCognitoUser",i.isCognitoUser),t.push(this.appContext.getModel("person-models",i.nsid).then(function(e){this.set("hasInvalidEmail",e.getValue("hasInvalidEmail")),this.set("isPro",e.getValue("isPro"))}.bind(this))),t.push(this.appContext.getModel("person-profile-models",i.nsid).then(function(e){this.set("profileModel",e)}.bind(this))),e.Promise.all(t)):(this.set("isCognitoUser",0),e.Promise.resolve())},buildContainer:function(){var i=""+this.intlMessage({intlName:"featured-banner.CHANGES_ARE_COMING"}),t=e.config.flickr.cognito.root+e.config.flickr.cognito["migration-url"];return this.get("hasInvalidEmail")?i+=' '+this.intlMessage({intlName:"featured-banner.UPDATE_YOUR_EMAIL"})+" ":i+=' '+this.intlMessage({intlName:"featured-banner.UPDATE_YOUR_LOGIN"})+" ",i+="
",this.setContainerWithTemplate("basic-banner",{message:i,additionalClasses:"head-banner-style"}),this},activate:function(){var e=this.get("container");this.registerEventHandler(e.one(".button.dismiss").on("click",this.dismissBanner.bind(this))),this.fire("activated")},dismissBanner:function(i){var t=new Date;t.setTime(t.getTime()+828e5),this.appContext.setCookie({cookieName:e.config.flickr.cognito["migration-banner-cookie-name"],cookieValue:1,expires:t,path:"/"}),this.fire("dismiss")},canShowBanner:function(){var i=!1;return!this.appContext.getViewer().signedIn||this.get("isCognitoUser")||this.appContext.getCookie(e.config.flickr.cognito["migration-banner-cookie-name"])||this.isABlacklistedView()||(i=!0),i},isABlacklistedView:function(){var e=this.appContext.flapp.get("activeView").name;return!!(e&&["products-pro-2018-view"].indexOf(e)>-1)}})},"@VERSION@",{requires:["flickr-view","hermes-template-basic-banner","user-limits-helper","person-models","person-profile-models"],langBundles:["featured-banner"]});YUI.add("hermes-lang-featured-banner",function(e,a){e.Intl.add("hermes/featured-banner","en-US",{CHANGES_ARE_COMING:["Changes are coming to the way you log into Flickr!"],UPDATE_YOUR_EMAIL:["Update your email address to get started"],UPDATE_YOUR_LOGIN:["Update your login now"],WE_HAD_TROUBLE_PAYMENT:["We had trouble processing your credit card."],PLEASE_UPDATE_PAYMENT_PAST_DUE:["Please update your payment method to avoid losing Pro."]})},"@VERSION@",{requires:["intl"]});