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 年與國會圖書館一起推出 Flickr Commons 以來,這個社群就一直在分享全球攝影館藏中的祕寶,其目前已擁有 100 多個成員。'}],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'\n\t\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 \n\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('+o(n.lambda(null!=(i=null!=t?r(t,"unreadCounts"):t)?r(i,"admin"):i,t))+")\n\t\t\t\t\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'
'+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}}}))+'
\n\t\n"+s+"",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"]});