YUI.add("hermes-lang-commons_zh-hk",(function(e,l){e.Intl.add("hermes/commons","zh-HK",{FLICKR_COMMONS:[{type:0,value:"Flickr Commons"}],THE_COMMONS:[{type:0,value:"The Commons"}],FLICKR_FDN:[{type:0,value:"Flickr Foundation"}],WELCOME_TITLE:[{type:0,value:"歡迎使用 "},{type:1,value:"title"}],INTRO_PARAGRAPH:[{type:0,value:'自從我們在 2008 年與<a href="'},{type:1,value:"locURL"},{type:0,value:'">國會圖書館</a>一起推出 Flickr Commons 以來，這個社群就一直在分享全球攝影館藏中的祕寶，其目前已<a href="'},{type:1,value:"membersURL"},{type:0,value:'">擁有 100 多個成員</a>。'}],INTRO_PARAGRAPH_NO_LINKS:[{type:0,value:"自從我們在 2008 年與國會圖書館一起推出 Flickr Commons 以來，這個社群就一直在分享全球攝影館藏中的祕寶，其目前已擁有 100 多個成員。"}],ALBUMS_TITLE:[{type:0,value:"瀏覽 Commons 成員的相簿"}],UPLOADS_TITLE:[{type:0,value:"本月上傳"}],GALLERIES_TITLE:[{type:0,value:"探索由 Flickr 會員精心挑選的相片集"}],HISTORY_TITLE:[{type:0,value:"The Commons 時間軸"}],GRAPH_TITLE:[{type:0,value:"The Commons 中的年代相片"}],REGISTER_TITLE:[{type:0,value:"註冊以加入"}],REGISTRATION_PARAGRAPH:[{type:0,value:"如果您工作的單位是擁有相片收藏的文化機構，請考慮成為 Flickr Commons 的成員！"}],REGISTRATION_BUTTON:[{type:0,value:"註冊加入 The Commons"}],ABOUT_TITLE:[{type:0,value:"Flickr Commons 計劃"}],ABOUT_PARAGRAPH:[{type:0,value:"本計劃是由 Flickr Foundation 看管，其有四個主要目標："}],GOAL_1:[{type:0,value:"增加對公眾持有的相片收藏之存取"}],GOAL_2:[{type:0,value:"在成員和其他來源之間傳播最新資訊"}],GOAL_3:[{type:0,value:"提供途徑讓大眾貢獻知識和資訊"}],GOAL_4:[{type:0,value:"保護並看管這套獨特收藏的持久性"}],LEARN_MORE_BUTTON:[{type:0,value:"更多資訊請至 Flickr.org"}]})}),"@VERSION@",{requires:["intl"]});YUI.add("hermes-template-notifications-menu",(function(n,e){var t=n.Template.Handlebars.revive({1:function(n,e,t,a,i){var o,l=n.lookupProperty||function(n,e){if(Object.prototype.hasOwnProperty.call(n,e))return n[e]};return n.escapeExpression("function"==typeof(o=null!=(o=l(t,"unseenNotificationCount")||(null!=e?l(e,"unseenNotificationCount"):e))?o:n.hooks.helperMissing)?o.call(null!=e?e:n.nullContext||{},{name:"unseenNotificationCount",hash:{},data:i,loc:{start:{line:7,column:81},end:{line:7,column:108}}}):o)},compiler:[8,">= 4.3.0"],main:function(n,e,t,a,i){var o,l=null!=e?e:n.nullContext||{},s=n.lookupProperty||function(n,e){if(Object.prototype.hasOwnProperty.call(n,e))return n[e]};return'<a class="gn-title c-notifications-menu"\n\ttabindex="0"\n\taria-haspopup="true"\n\taria-expanded="false"\n\taria-label="'+n.escapeExpression((s(t,"intlMessage")||e&&s(e,"intlMessage")||n.hooks.helperMissing).call(l,{name:"intlMessage",hash:{intlName:"notifications.NOTIFICATIONS"},data:i,loc:{start:{line:5,column:13},end:{line:5,column:67}}}))+'">\n\t<span class="c-notification-icon" aria-hidden="true">\n\t\t<span class="c-notification-unseencount hidden">'+(null!=(o=s(t,"if").call(l,null!=e?s(e,"unseenNotificationCount"):e,{name:"if",hash:{},fn:n.program(1,i,0),inverse:n.noop,data:i,loc:{start:{line:7,column:50},end:{line:7,column:115}}}))?o:"")+"</span>\n\t</span>\n</a>\n"},useData:!0}),a={};n.Array.each([],(function(e){var t=n.Template.get("hermes/"+e);t&&(a[e]=t)})),n.Template.register("hermes/notifications-menu",(function(e,i){return(i=i||{}).partials=i.partials?n.merge(a,i.partials):a,t(e,i)}))}),"@VERSION@",{requires:["template-base","handlebars-base"]});YUI.add("hermes-template-notifications-panel",(function(n,t){var l=n.Template.Handlebars.revive({1:function(n,t,l,a,e){var i,s=n.lookupProperty||function(n,t){if(Object.prototype.hasOwnProperty.call(n,t))return n[t]};return"\t\twidth: "+n.escapeExpression("function"==typeof(i=null!=(i=s(l,"width")||(null!=t?s(t,"width"):t))?i:n.hooks.helperMissing)?i.call(null!=t?t:n.nullContext||{},{name:"width",hash:{},data:e,loc:{start:{line:4,column:9},end:{line:4,column:18}}}):i)+"px;\n"},3:function(n,t,l,a,e){var i,s=n.lookupProperty||function(n,t){if(Object.prototype.hasOwnProperty.call(n,t))return n[t]};return"\t\theight: "+n.escapeExpression("function"==typeof(i=null!=(i=s(l,"height")||(null!=t?s(t,"height"):t))?i:n.hooks.helperMissing)?i.call(null!=t?t:n.nullContext||{},{name:"height",hash:{},data:e,loc:{start:{line:7,column:10},end:{line:7,column:20}}}):i)+"px;\n"},5:function(n,t,l,a,e){return" hidden"},7:function(n,t,l,a,e){var i,s=null!=t?t:n.nullContext||{},o=n.escapeExpression,r=n.lookupProperty||function(n,t){if(Object.prototype.hasOwnProperty.call(n,t))return n[t]};return'\t\t\t\t<span role="button" class="tab" data-tab-id="admin">\n\t\t\t\t\t'+o((r(l,"intlMessage")||t&&r(t,"intlMessage")||n.hooks.helperMissing).call(s,{name:"intlMessage",hash:{intlName:"notifications.GROUPS_YOU_ADMIN"},data:e,loc:{start:{line:20,column:5},end:{line:20,column:63}}}))+'\n\t\t\t\t\t<span class="count-in-parens'+(null!=(i=r(l,"if").call(s,null!=(i=null!=t?r(t,"unreadCounts"):t)?r(i,"admin"):i,{name:"if",hash:{},fn:n.noop,inverse:n.program(5,e,0),data:e,loc:{start:{line:21,column:33},end:{line:21,column:73}}}))?i:"")+'">('+o(n.lambda(null!=(i=null!=t?r(t,"unreadCounts"):t)?r(i,"admin"):i,t))+")</span>\n\t\t\t\t</span>\n"},compiler:[8,">= 4.3.0"],main:function(n,t,l,a,e){var i,s=null!=t?t:n.nullContext||{},o=n.hooks.helperMissing,r=n.escapeExpression,c=n.lookupProperty||function(n,t){if(Object.prototype.hasOwnProperty.call(n,t))return n[t]};return'<div class="notifications-panel"\n\tstyle="\n'+(null!=(i=c(l,"if").call(s,null!=t?c(t,"width"):t,{name:"if",hash:{},fn:n.program(1,e,0),inverse:n.noop,data:e,loc:{start:{line:3,column:1},end:{line:5,column:8}}}))?i:"")+(null!=(i=c(l,"if").call(s,null!=t?c(t,"height"):t,{name:"if",hash:{},fn:n.program(3,e,0),inverse:n.noop,data:e,loc:{start:{line:6,column:1},end:{line:8,column:8}}}))?i:"")+'\t">\n\t<div class="nav-container">\n\t\t<div class="tabs">\n\t\t\t<span role="button" class="tab selected" data-tab-id="main">\n\t\t\t\t<span>\n\t\t\t\t\t'+r((c(l,"intlMessage")||t&&c(t,"intlMessage")||o).call(s,{name:"intlMessage",hash:{intlName:"notifications.NOTIFICATIONS"},data:e,loc:{start:{line:14,column:5},end:{line:14,column:60}}}))+'\n\t\t\t\t\t<span class="count-in-parens'+(null!=(i=c(l,"if").call(s,null!=(i=null!=t?c(t,"unreadCounts"):t)?c(i,"main"):i,{name:"if",hash:{},fn:n.noop,inverse:n.program(5,e,0),data:e,loc:{start:{line:15,column:33},end:{line:15,column:72}}}))?i:"")+'">('+r(n.lambda(null!=(i=null!=t?c(t,"unreadCounts"):t)?c(i,"main"):i,t))+")</span>\n\t\t\t\t</span>\n\t\t\t</span>\n"+(null!=(i=c(l,"if").call(s,null!=t?c(t,"showAdminTab"):t,{name:"if",hash:{},fn:n.program(7,e,0),inverse:n.noop,data:e,loc:{start:{line:18,column:3},end:{line:23,column:10}}}))?i:"")+'\t\t</div>\n\t\t<div class="actions">\n\t\t\t<a class="action settings-link" href="/account/email">\n\t\t\t\t<svg class="icon"><use xlink:href="#icon-settings"></use></svg>\n\t\t\t</a>\n\t\t</div>\n\t</div>\n\n\t<div class="list-container">\n\t\t<a role="button" class="load-top-button hidden">'+r((c(l,"intlMessage")||t&&c(t,"intlMessage")||o).call(s,{name:"intlMessage",hash:{intlName:"feed.SHOW_NEWER_ITEMS"},data:e,loc:{start:{line:33,column:50},end:{line:33,column:98}}}))+'</a>\n\t</div>\n\t<div class=\'footer\'>\n\t\t<a class="foot-link" href="/notifications">\n\t\t\t'+r((c(l,"intlMessage")||t&&c(t,"intlMessage")||o).call(s,{name:"intlMessage",hash:{intlName:"notifications.VIEW_ALL_NOTIFICATIONS"},data:e,loc:{start:{line:38,column:3},end:{line:38,column:67}}}))+"\n\t\t</a>\n\t</div>\n</div>\n"},useData:!0}),a={};n.Array.each([],(function(t){var l=n.Template.get("hermes/"+t);l&&(a[t]=l)})),n.Template.register("hermes/notifications-panel",(function(t,e){return(e=e||{}).partials=e.partials?n.merge(a,e.partials):a,l(t,e)}))}),"@VERSION@",{requires:["template-base","handlebars-base"]});YUI.add("template-lib-helper",(function(e,t){var n=require("hermes-core/flog")(t);e.TemplateLibraryHelper=function(t,r){var l=r&&r.localizeLib?r.localizeLib:e.mix({langBundles:["common"]},e.Localizable),s={getTemplate:function(r,s){var i,o,a=e.Template.get("hermes/"+r),p=l.getLangBundles();if(p.locales=t.lang||l.defaultLang,"function"!=typeof a)throw n.error("Template not found",{topic:this.name,template:r}),new Error("Template not found: "+r);return t.flipper&&(i=t.flipper),t.segments&&(o=t.segments.segments),function(e){return!(e=e||{}).flippers&&i&&(e.flippers=i.toJSON()),!e.segments&&o&&(e.segments=o),s&&(e.isMobile=s.isMobile,e.cspNonce=s.cspNonce),a(e,{data:{intl:p,flippers:e.flippers,segments:e.segments}})}}};return e.augment(s,e.EventTarget),s}}),"@VERSION@",{requires:["event-custom"],optionalRequires:["hermes-core"]});YUI.add("hermes-template-join-group-invite-form",(function(e,a){var t=e.Template.Handlebars.revive({compiler:[8,">= 4.3.0"],main:function(e,a,t,n,r){var i=e.lookupProperty||function(e,a){if(Object.prototype.hasOwnProperty.call(e,a))return e[a]};return'<div class="send-invitation">\n\t<p>'+e.escapeExpression((i(t,"intlMessage")||a&&i(a,"intlMessage")||e.hooks.helperMissing).call(null!=a?a:e.nullContext||{},{name:"intlMessage",hash:{intlName:"groups.GROUP_INVITE_ONLY_DESC"},data:r,loc:{start:{line:2,column:4},end:{line:2,column:60}}}))+'</p>\n\t<textarea class="group-invite-form"></textarea>\n</div>\n'},useData:!0}),n={};e.Array.each([],(function(a){var t=e.Template.get("hermes/"+a);t&&(n[a]=t)})),e.Template.register("hermes/join-group-invite-form",(function(a,r){return(r=r||{}).partials=r.partials?e.merge(n,r.partials):n,t(a,r)}))}),"@VERSION@",{requires:["template-base","handlebars-base"]});YUI.add("group-status-helper",(function(e,t){require("hermes-core/flog")(t);var n=e.mix({langBundles:["common","groups"]},e.Localizable);e.GroupStatusHelper=function(t,i){var o,r,s=i.groupId,a=i.view,u=new e.TemplateLibraryHelper(t,{localizeLib:n}),l={load:function(){var n=this;return YUI.Env.isServer||a.registerEventHandler(e.on("groupStatusHelper:groupStatusChanged",(function(e){e.groupId===s&&n.update()}))),i.useSearchModel?t.getModel("search-group-models",s).then((function(e){r=e,n.convertGroupInfoModel(e),n.groupRemoteMethods={join:e.registry.remote.join,leave:e.registry.remote.leave}})):t.getModel("group-info-models",s).then((function(e){return r=e,n.convertGroupInfoModel(e),n.groupRemoteMethods={join:e.registry.remote.join,leave:e.registry.remote.leave},e}))},initiateJoinGroup:function(){var i=this,r=this.getJoinStatus(),s=o.title,a=o.id;if(r.canJoin&&!r.signedIn)return this.showSignUpModal(a);if(r.canJoin&&!r.requiresRequest)return this.joinGroup(a);if(r.canJoin&&r.isInvited)return this.joinGroup(a);if(!r.hasJoined&&r.hasRequested&&r.requiresRequest){new e.Views.FluidModal({appContext:t,subview:new e.Views["confirmation-dialog-view"]({appContext:t,title:n.intlMessage({intlName:"groups.GROUP_INVITE_ONLY_HEADER",groupName:e.flutil.unescape(s)}),htmlMessage:n.intlMessage({intlName:"groups.GROUP_INVITE_PENDING",groupName:s}),showCancelButton:!1}),hasSubviewConfigRefactor:!0}).show();return e.Promise.resolve()}return r.hasJoined||r.hasRequested||!r.requiresRequest?r.hasJoined?(this.fire("groupJoined"),e.fire("groupStatusHelper:groupJoined",{groupId:a}),e.Promise.resolve()):void 0:this.promptForRules().then(e.bind((function(){this.showInviteRequestModal.call(this,a)}),this),e.bind((function(){i.fire("joinCanceled")}),this))},initiateLeaveGroup:function(){this.showLeaveGroupModal()},showLeaveGroupModal:function(){var i=this,r=o.title,s=o.id,u=null,l="";1===o.memberCount&&o.isMember?l=n.intlMessage({intlName:"groups.GROUPS_LEAVE_WARNING_LAST_MEMBER",title:r}):o.isAdmin?(l=n.intlMessage({intlName:"groups.GROUPS_LEAVE_WARNING_ADMIN",title:r}),l+=n.intlHTMLMessage({intlName:"groups.GROUPS_LEAVE_WARNING_REMOVE_PHOTOS"})):(l=n.intlMessage({intlName:"groups.GROUPS_LEAVE_WARNING",title:r}),l+=n.intlHTMLMessage({intlName:"groups.GROUPS_LEAVE_WARNING_REMOVE_PHOTOS"})),u=new e.Views.FluidModal({appContext:t,subview:new e.Views["confirmation-dialog-view"]({appContext:t,title:n.intlMessage({intlName:"groups.GROUPS_LEAVE_WARNING_TITLE",title:e.flutil.unescape(r)}),htmlMessage:l,actionButtonLabel:n.intlMessage({intlName:"groups.GROUPS_LEAVE_WARNING_LEAVE_BUTTON"}),cancelButtonLabel:n.intlMessage({intlName:"groups.GROUPS_LEAVE_WARNING_CANCEL_BUTTON"}),onConfirm:async(e,t)=>{let n=t.get("container").one("input"),i=n&&n.getDOMNode().checked;t.setLoading(!0),this.leaveGroup(s,i),await new Promise((e=>{let t=this.on("groupLeft",(()=>{a.detachRegisteredEvent(t),e()}));a.registerEventHandler(t)}))}}),hasSubviewConfigRefactor:!0}).show(),a.registerEventHandler(u.on("close",(e=>{i.fire("leaveCanceled")})))},joinGroup:function(){var i=this;return this.promptForRules().then((()=>this.groupRemoteMethods.join({groupModel:r,acceptRules:!0},t).then((function(t){return i.convertGroupInfoModel(t),i.fire("groupJoined"),e.fire("groupStatusHelper:groupJoined",{groupId:s}),e.fire("groupStatusHelper:groupStatusChanged",{groupId:s}),t}),(function(o){new e.Views.FluidModal({appContext:t,subview:new e.Views["confirmation-dialog-view"]({appContext:t,title:n.intlMessage({intlName:"common.OOPS"}),htmlMessage:n.intlMessage({intlName:"groups.GROUP_JOIN_ERROR"}),showCancelButton:!1}),hasSubviewConfigRefactor:!0}).show();i.fire("joinCanceled")}))),(e=>{i.fire("joinCanceled")}))},leaveGroup:function(i,o){var s=this;this.groupRemoteMethods.leave({groupModel:r,deletePhotos:!!o},t).then((function(t){return s.convertGroupInfoModel(t),s.fire("groupLeft"),e.fire("groupStatusHelper:groupLeft",{groupId:i}),e.fire("groupStatusHelper:groupStatusChanged",{groupId:i}),t}),(function(i){let o=new e.Views.FluidModal({appContext:t,subview:new e.Views["confirmation-dialog-view"]({appContext:t,title:n.intlMessage({intlName:"common.OOPS"}),htmlMessage:n.intlMessage({intlName:"groups.GROUP_LEAVE_ERROR"}),showCancelButton:!1}),hasSubviewConfigRefactor:!0}).show();a.registerEventHandler(o.on("close",(function(){s.fire("leaveCanceled")})))}))},showSignUpModal:function(i){var s,u=e.url("/groups/")+i,l=n.intlMessage({intlName:"groups.SIGN_IN_BEFORE_JOIN_TITLE"}),g=n.intlMessage({intlName:"groups.SIGN_UP_AND_JOIN_MESSAGE",name:o.title});s=new e.Views.SignUpModal({appContext:t,signUpHeaderClass:"avatar group big",signUpHeaderImage:void 0!==r.getValue("group")?r.getValue("group").getValue("bestIconURL"):r.getValue("bestIconURL"),signUpTitle:l,signUpMessage:g,beaconPrefix:"join"}),a.registerEventHandler(s.on("signUpClick",(function(t){e.SigninHelper.signUpPendingJoinGroup({id:i},{postLoginUrl:u})}))),a.registerEventHandler(s.on("signInClick",(function(t){e.SigninHelper.addPendingJoinGroup({id:i},{postLoginUrl:u})}))),s.show()},promptForRules:function(){return new e.Promise(((i,r)=>{var s=o.secureRules,u=null;s?(u=new e.Views.FluidModal({appContext:t,subview:new e.Views["confirmation-dialog-view"]({appContext:t,title:n.intlMessage({intlName:"groups.GROUP_JOIN_RULES_DIALOG_TITLE"}),htmlMessage:n.intlMessage({intlName:"groups.GROUP_JOIN_RULES_DIALOG_MESSAGE"})+"<br /><pre>"+s+"</pre>",confirmButtonText:n.intlMessage({intlName:"groups.GROUP_JOIN_RULES_DIALOG_ACCEPT"}),cancelButtonText:n.intlMessage({intlName:"groups.GROUP_JOIN_RULES_DIALOG_DECLINE"}),onConfirm:async(e,t)=>{t.setLoading(!0),setTimeout((()=>{i()}),500)}}),hasSubviewConfigRefactor:!0}).show(),a.registerEventHandler(u.on("close",(function(){setTimeout((()=>{r()}),500)})))):i()}))},showInviteRequestModal:function(r){var s,l=this,g=n.intlMessage({intlName:"groups.GROUP_INVITE_ONLY_SEND"}),p=n.intlMessage({intlName:"common.CANCEL"}),c=u.getTemplate("join-group-invite-form",i.viewParams);s=new e.Views.FluidModal({appContext:t,title:n.intlMessage({intlName:"groups.GROUP_INVITE_ONLY_HEADER",groupName:e.flutil.unescape(o.title)}),htmlMessage:c({groupName:o.title}),actionButtonLabel:g,cancelButtonLabel:p,overlayClassList:"over-droparound-under-modal"}),a.registerEventHandler(s.on("actionClick",(function(){var i=s.get("container").one(".group-invite-form");if(i){var u=i.get("value");if(u.length>0){var g={group_id:r,message:u,accept_rules:!0};t.callAPI("flickr.groups.joinRequest",g).then((function(t){e.config.win.location.reload()}),(function(i){var r="";r=i&&7===i.code?n.intlMessage({intlName:"groups.GROUP_INVITE_PENDING",groupName:e.Escape.html(o.title)}):"message"in i?i.message:n.intlMessage({intlName:"common.ERROR"});let s=new e.Views.FluidModal({appContext:t,subview:new e.Views["confirmation-dialog-view"]({appContext:t,title:n.intlMessage({intlName:"common.ERROR"}),htmlMessage:r,showCancelButton:!1}),hasSubviewConfigRefactor:!0}).show();a.registerEventHandler(s.on("close",(()=>{l.fire("joinCanceled")})))}))}else setTimeout((function(){let i=new e.Views.FluidModal({appContext:t,subview:new e.Views["confirmation-dialog-view"]({appContext:t,title:n.intlMessage({intlName:"common.ERROR"}),htmlMessage:n.intlMessage({intlName:"groups.GROUP_INVITE_EMPTY_MESSAGE"}),showCancelButton:!1}),hasSubviewConfigRefactor:!0}).show();a.registerEventHandler(i.on("close",(()=>{l.fire("joinCanceled")})))}),300)}}))),a.registerEventHandler(s.on("activated",(function(){var e=s.get("container"),t=e.one("textarea")||!1;e&&t&&t.focus()}))),a.registerEventHandler(s.on("cancelClick",(function(){l.fire("joinCanceled")}))),s.show()},getJoinStatus:function(){var e,n,i,r=t&&t.getViewer(),s=r&&r.signedIn;return e=o.isMember,i=o.isInvited,n=o.hasPendingRequestToJoin,{signedIn:s,canJoin:!e&&!n,hasJoined:e,hasRequested:n,isInvited:i,requiresRequest:2===o.privacy,isAdmin:o.isAdmin}},convertGroupInfoModel:function(e){var t=i.useSearchModel?e:e.getValue("group");o={title:t.getValue("title"),id:t.getValue("id"),memberCount:t.getValue("memberCount"),isMember:t.getValue("isMember"),isModerator:t.getValue("isModerator"),isAdmin:t.getValue("isAdmin"),privacy:t.getValue("privacy"),isInvited:e.getValue("isInvited"),hasPendingRequestToJoin:e.getValue("hasPendingRequestToJoin"),secureRules:e.getValue("secureRules"),muted:t.getValue("muted")}},getInfo:function(){return{groupAttrs:o,joinStatus:this.getJoinStatus()}},toggleNotificationsMute:function(n){var o=i.useSearchModel?r:r.getValue("group");return t.callAPI(n?"flickr.activity.muteObject":"flickr.activity.unmuteObject",{group_id:s}).then((function(t){o.setValue("muted",n),e.fire("groupStatusHelper:groupStatusChanged",{groupId:s})}))},toggleMuteGroup:function(t){var n={object_id:s,object_type:1,pref_type:"GroupBatch",pref_val:t?0:1};return this.insertUserPrefs(n).then((function(n){e.fire("groupStatusHelper:groupMuteToggled",{groupId:s,isMuted:t}),e.fire("groupStatusHelper:groupStatusChanged",{groupId:s})}))},insertUserPrefs:function(e){return t.callAPI("flickr.feed.preferences.insertUserPreferences",e)},update:function(){this.convertGroupInfoModel(r)},declineInvite:function(){return r.declineInvite()}};return e.augment(l,e.EventTarget),l}}),"@VERSION@",{requires:["event-custom","template-lib-helper","flutil","hermes-template-join-group-invite-form","url"],optionalRequires:["hermes-core"],langBundles:["common","groups"]});YUI.add("base-notification-item-view",(function(t,e){var i=require("hermes-core/flog")(e);t.namespace("Views")[this.name]=t.Base.create(this.name,t.FlickrView,[],{langBundles:this.details.langBundles,additionalViewClasses:function(){return["base-notification-item"]},initializer:function(e){this.params=e,this.activityItem=e.activityItem,this.notificationsHelper=new t.NotificationsHelper(this.appContext)},loadState:function(){return t.Promise.resolve()},buildContainer:function(){var t=this.notificationsHelper.getTemplateHtml(this.activityItem);this.setContainerHTML(t)},activate:function(){var e=this.get("container").one(".notification-item");return e&&(e.toggleClass("unseen",!this.activityItem.isSeen),e.toggleClass("muted",this.activityItem.isMuted),this.registerEventHandler(e.on("click",this.handleAnalyticsClicks.bind(this))),this.setupContextMenu()),t.Promise.resolve(this)},seenStatusUpdate:function(){this.activityItem.model.getValue("isSeen")||this.activityItem.model.setValue("isSeen",!0)},handleContextMenuClick:function(){var e,i,n,a=this;this.menuConfigData&&(i=(e=this.notificationsHelper.getContextMenuConfig({item:this.params.activityItem,ctxMenuItems:this.menuConfigData})).map((function(t){var e={};return e.text=t.text,e.value=t.actionId,t.wordWrap&&(e.wordWrap=t.wordWrap),e})),(n=new t.Views.FluidDroparound({appContext:this.appContext,showDropArrow:!0,observePageResize:!0,anchorOffsetVertical:0,width:250,dismissOnOverlayClick:!0,anchorElement:this.contextMenuButton,menuItems:i,positionFixed:!0,closeOnScroll:!0,classList:"over-modal notification-context-menu",overlayClassList:"over-modal"})).show(),this.registerEventHandler(n.on("selected",(function(t){var i=e.find((function(e){return e.actionId===t.menuItem.value})),o=a.get("container");t.analyticsLocation=o.ancestor(".notifications-panel-view")?"panel":"page",n.close(),i.onSelected(t)}))))},setupContextMenu:function(){var e=this,n=this.get("container"),a=this.params.activityItem;if(this.contextMenuButton=n.one(".notification-context-menu-button"),this.contextMenuButton)return this.registerEventHandler(this.contextMenuButton.on("click",this.handleContextMenuClick.bind(this))),this.notificationsHelper.loadContextMenuConfig(a,{view:this}).then((function(t){e.menuConfigData=t})).catch((function(e){return i.error({err:e}),t.Promise.resolve()}))},handleAnalyticsClicks:function(t){var e=t.target;e.ancestor(".headline-container",!0)&&"A"===e.get("tagName").toUpperCase()?this.beaconAnalytics(this.activityItem,"Headline Click"):e.ancestor(".notification-photo-thumb",!0)?this.beaconAnalytics(this.activityItem,"Photo Thumb Click"):e.ancestor(".avatar",!0)&&!e.ancestor(".photo-thumb",!0)?this.beaconAnalytics(this.activityItem,"Avatar Click"):e.ancestor(".notification-context-menu-button",!0)&&this.beaconAnalytics(this.activityItem,"Context Menu Click")},beaconAnalytics:function(e,i){this.get("container").ancestor(".notifications-panel-view");t.Analytics.sendClick("","Notification Action")}})}),"@VERSION@",{requires:["flickr-view"],optionalRequires:["hermes-core"],langBundles:["common","relative-dates","notifications"]});