YUI.add("hermes-template-photo-selector-photo-list-photo-interaction",(function(e,l){var t=e.Template.Handlebars.revive({1:function(e,l,t,n,a){var o,r=e.escapeExpression,i=e.lookupProperty||function(e,l){if(Object.prototype.hasOwnProperty.call(e,l))return e[l]};return'<a href="'+r(e.lambda(null!=(o=null!=(o=null!=l?i(l,"photo"):l)?i(o,"owner"):o)?i(o,"url"):o,l))+'" class="attribution">'+r((i(t,"intlMessage")||l&&i(l,"intlMessage")||e.hooks.helperMissing).call(null!=l?l:e.nullContext||{},{name:"intlMessage",hash:{user:null!=(o=null!=(o=null!=l?i(l,"photo"):l)?i(o,"owner"):o)?i(o,"displayname"):o,intlName:"common.BY_USER"},data:a,loc:{start:{line:7,column:84},end:{line:7,column:154}}}))+"</a>"},compiler:[8,">= 4.3.0"],main:function(e,l,t,n,a){var o,r,i=null!=l?l:e.nullContext||{},s=e.escapeExpression,p=e.lookupProperty||function(e,l){if(Object.prototype.hasOwnProperty.call(e,l))return e[l]};return'<div class="photo-list-photo-interaction">\n\t<div class="square"></div>\n\t<div class="interaction-bar">\n\t\t<div class="text">\n\t\t\t<a href="'+s("function"==typeof(r=null!=(r=p(t,"photoPageUrl")||(null!=l?p(l,"photoPageUrl"):l))?r:e.hooks.helperMissing)?r.call(i,{name:"photoPageUrl",hash:{},data:a,loc:{start:{line:6,column:12},end:{line:6,column:28}}}):r)+'" class="title">'+s(e.lambda(null!=(o=null!=l?p(l,"photo"):l)?p(o,"title"):o,l))+"</a>\n\t\t\t"+(null!=(o=p(t,"if").call(i,null!=(o=null!=(o=null!=l?p(l,"photo"):l)?p(o,"owner"):o)?p(o,"displayname"):o,{name:"if",hash:{},fn:e.program(1,a,0),inverse:e.noop,data:a,loc:{start:{line:7,column:3},end:{line:7,column:165}}}))?o:"")+'\n\t\t</div>\n\t</div>\n</div>\n<div class="disabled-overlay"></div>\n'},useData:!0}),n={};e.Array.each([],(function(l){var t=e.Template.get("hermes/"+l);t&&(n[l]=t)})),e.Template.register("hermes/photo-selector-photo-list-photo-interaction",(function(l,a){return(a=a||{}).partials=a.partials?e.merge(n,a.partials):n,t(l,a)}))}),"@VERSION@",{requires:["template-base","handlebars-base"]});YUI.add("photo-selector-photolist-interaction-view",(function(t){var e=require("hermes-core/type-validator");t.namespace("Views")[this.name]=t.Base.create(this.name,t.FlickrView,[],{langBundles:this.details.langBundles,initializer:function(t){return""===this.get("container").get("innerHTML")&&this.setContainerHTML(""),this.hasMultiSelect=t.primaryPhotoListConfig&&t.primaryPhotoListConfig.hasMultiSelect,this.multiSelectLimit=void 0===t.primaryPhotoListConfig.multiSelectLimit?1:t.primaryPhotoListConfig.multiSelectLimit,this.listType=t.primaryPhotoListConfig.type,this.galleryId=t.primaryPhotoListConfig.galleryId,this.isDisabled=!1,this.isDisabledSelected=!1,this},loadState:function(){var e=this,i=[];return"galleryFaves"===this.listType&&this.galleryId&&(i.push(this.appContext.getModelRegistry("gallery-photo-association-models").then((function(t){t.exists(e.galleryId+"-"+e.get("id"))&&(e.isDisabled=!0,e.isDisabledSelected=!0)}))),i.push(this.appContext.getModel("gallery-faves-models",this.appContext.getViewer().nsid+"-"+e.galleryId).then((function(t){var i=t.getValue("nonGalleryAddablePhotos").getList(),s=!1;i&&(s=i.some((function(t){return t.id===e.get("model").id}))),s&&(e.isDisabled=!0)})))),i.push(this.appContext.getModel("profile-selected-photos-models",this.appContext.getViewer().nsid).then(function(t){t.getValue("photos").getFromListByID(this.get("model").getValue("id"))&&this.set("isActive",!0)}.bind(this))),t.Promise.all(i)},buildContainer:function(){var t=this.get("model");return this.setContainerWithTemplate("photo-selector-photo-list-photo-interaction",{photo:t.toJSON(),photoPageUrl:this.get("photoPageUrl")}),this},activate:function(){var e,i,s=this.get("container"),o=s.one(".disabled-overlay");return this.galleryId&&(e=this.intlMessage({intlName:"gallery.PHOTO_CANT_ADD_TO_GALLERY",mediaType:this.get("model").getValue("mediaType")}),i=this.intlMessage({intlName:"gallery.PHOTO_ALREADY_IN_GALLERY",mediaType:this.get("model").getValue("mediaType")})),this.registerEventHandler(s.on("click",this.selectPhoto.bind(this))),this.hasMultiSelect||this.registerEventHandler(t.on("photoSelector:subviewEvent",this.handleOtherPhotoSelected,this)),this.get("isActive")?this.get("isActive")&&s.addClass("active"):s.removeClass("active"),this.isDisabled&&(s.addClass("disabled"),o.setAttribute("title",e)),this.isDisabledSelected&&(s.addClass("disabled-selected"),o.setAttribute("title",i)),this},selectPhoto:function(e){if(e.halt(),!this.isDisabled)if(this.get("isActive")&&this.hasMultiSelect)this.set("isActive",!1),this.get("container").removeClass("active"),t.fire("photoSelector:subviewEvent",{eventName:"unselectPhotoFromPhotoList",id:this.get("id")});else{if(this.hasMultiSelect)return this.appContext.getModel("profile-selected-photos-models",this.appContext.getViewer().nsid).then(function(e){e.getValue("photos").size()+1<=this.multiSelectLimit&&(this.set("isActive",!0),this.get("container").addClass("active"),t.fire("photoSelector:subviewEvent",{eventName:"selectPhotoFromPhotoList",id:this.get("id")}))}.bind(this));this.set("isActive",!0),this.get("container").addClass("active"),t.fire("photoSelector:subviewEvent",{eventName:"selectPhotoFromPhotoList",id:this.get("id")})}},handleOtherPhotoSelected:function(t){if("selectPhotoFromPhotoList"===t.eventName&&this.get("isActive")){if(t.id===this.get("id"))return;this.set("isActive",!1),this.get("container")._node&&this.get("container").removeClass("active")}}},{ATTRS:{id:{writeOnce:"initOnly",validator:function(t,i){return e.photoId(t)}},model:{writeOnce:"initOnly"},photoPageUrl:{writeOnce:"initOnly"}}})}),"@VERSION@",{requires:["flickr-view","hermes-template-photo-selector-photo-list-photo-interaction","attribute-helpers"],optionalRequires:["fluid","hermes-core"],langBundles:["common","gallery"]});YUI.add("hermes-template-photo-selector-sets-photolist-set-interaction",(function(t,e){var l=t.Template.Handlebars.revive({1:function(t,e,l,n,a){var o,s=t.lookupProperty||function(t,e){if(Object.prototype.hasOwnProperty.call(t,e))return t[e]};return'\t\t\t\t<span class="album-photo-count">'+t.escapeExpression((s(l,"intlMessage")||e&&s(e,"intlMessage")||t.hooks.helperMissing).call(null!=e?e:t.nullContext||{},{name:"intlMessage",hash:{selectedCount:null!=(o=null!=e?s(e,"album"):e)?s(o,"publicPhotosCount"):o,intlName:"album-page.PUBLIC_ITEMS_COUNT"},data:a,loc:{start:{line:6,column:36},end:{line:6,column:130}}}))+"</span>\n"},3:function(t,e,l,n,a){var o,s=t.lookupProperty||function(t,e){if(Object.prototype.hasOwnProperty.call(t,e))return t[e]};return'\t\t\t<span class="album-photo-count">'+t.escapeExpression((s(l,"intlMessage")||e&&s(e,"intlMessage")||t.hooks.helperMissing).call(null!=e?e:t.nullContext||{},{name:"intlMessage",hash:{selectedCount:null!=(o=null!=e?s(e,"album"):e)?s(o,"totalCount"):o,intlName:"album-page.PHOTOS_COUNT"},data:a,loc:{start:{line:8,column:35},end:{line:8,column:116}}}))+"</span>\n"},compiler:[8,">= 4.3.0"],main:function(t,e,l,n,a){var o,s=t.lookupProperty||function(t,e){if(Object.prototype.hasOwnProperty.call(t,e))return t[e]};return'<div class="photo-list-album-interaction photo-selector-album dark">\n\t<div class="interaction-bar">\n\t\t<h4 class="album-title">'+t.escapeExpression(t.lambda(null!=(o=null!=e?s(e,"album"):e)?s(o,"title"):o,e))+"</h4>\n"+(null!=(o=s(l,"if").call(null!=e?e:t.nullContext||{},null!=e?s(e,"publicOnlyPhotos"):e,{name:"if",hash:{},fn:t.program(1,a,0),inverse:t.program(3,a,0),data:a,loc:{start:{line:5,column:2},end:{line:9,column:9}}}))?o:"")+"\t</div>\n</div>\n"},useData:!0}),n={};t.Array.each([],(function(e){var l=t.Template.get("hermes/"+e);l&&(n[e]=l)})),t.Template.register("hermes/photo-selector-sets-photolist-set-interaction",(function(e,a){return(a=a||{}).partials=a.partials?t.merge(n,a.partials):n,l(e,a)}))}),"@VERSION@",{requires:["template-base","handlebars-base"]});YUI.add("photo-selector-sets-photolist-interaction-view",(function(t){var e=require("hermes-core/type-validator");t.namespace("Views")[this.name]=t.Base.create(this.name,t.FlickrView,[],{langBundles:this.details.langBundles,initializer:function(t){return""===this.get("container").get("innerHTML")&&this.setContainerHTML(""),this.publicOnlyPhotos=t.publicOnlyPhotos,this},loadState:function(){return this.appContext.getModel(this.get("engagementModelName"),this.get("id")).then(function(t){this.set("engagement",t)}.bind(this))},buildContainer:function(){return this.setContainerWithTemplate("photo-selector-sets-photolist-set-interaction",{album:this.get("model").toJSON(),publicOnlyPhotos:this.publicOnlyPhotos,albumPageUrl:this.get("albumPageUrl")}),this},activate:function(){return this.registerEventHandler(this.get("container").on("click",this.selectSet.bind(this))),this},selectSet:function(e){e.halt(),t.fire("photoSelector:subviewEvent",{eventName:"selectSetFromPhotoList",id:this.get("id"),title:this.get("model").getValue("title")})},destructor:function(){}},{ATTRS:{id:{writeOnce:"initOnly",validator:function(t,i){return e.photoId(t)}},model:{writeOnce:"initOnly"},albumPageUrl:{writeOnce:"initOnly"},engagement:{value:null},engagementModelName:{writeOnce:"initOnly",value:null,validator:function(e,i){return t.AttributeHelpers.validateString(e)}}}})}),"@VERSION@",{requires:["flickr-view","hermes-template-photo-selector-sets-photolist-set-interaction","attribute-helpers"],optionalRequires:["fluid","hermes-core"],langBundles:["album-page"]});YUI.add("hermes-lang-album-page_zh-hk",(function(e,t){e.Intl.add("hermes/album-page","zh-HK",{PHOTOS_COUNT:[{type:6,value:"selectedCount",options:{one:{value:[{type:7},{type:0,value:" 張相片"}]},other:{value:[{type:7},{type:0,value:" 張相片"}]}},offset:0,pluralType:"cardinal"}],PUBLIC_PHOTOS_COUNT:[{type:6,value:"selectedCount",options:{one:{value:[{type:7},{type:0,value:" 公開相片"}]},other:{value:[{type:7},{type:0,value:" 公開相片"}]}},offset:0,pluralType:"cardinal"}],PUBLIC_ITEMS_COUNT:[{type:6,value:"selectedCount",options:{one:{value:[{type:7},{type:0,value:" 公開項目"}]},other:{value:[{type:7},{type:0,value:" 公開項目"}]}},offset:0,pluralType:"cardinal"}],VIDEOS_COUNT:[{type:6,value:"selectedCount",options:{one:{value:[{type:7},{type:0,value:" 個影片"}]},other:{value:[{type:7},{type:0,value:" 個影片"}]}},offset:0,pluralType:"cardinal"}],VIEWS_COUNT:[{type:6,value:"selectedCount",options:{one:{value:[{type:7},{type:0,value:" 次檢視"}]},other:{value:[{type:7},{type:0,value:" 次檢視"}]}},offset:0,pluralType:"cardinal"}],BACK_TO_ALBUMS:[{type:0,value:"返回相簿清單"}],EDIT_IN_ORGANIZR:[{type:0,value:"在 Organizr 中編輯"}],EDIT_COVER:[{type:0,value:"編輯封面"}],SELECT_COVER_PHOTO:[{type:0,value:"選擇封面相片"}],SELECT:[{type:0,value:"選擇"}],ERROR_COVER_PHOTO:[{type:0,value:"嘗試設定你的封面相片時發生問題。 請再試一次。"}],ERROR_UPDATING_ALBUM_TITLE_DESCRIPTION:[{type:0,value:"更新相簿標題和說明時發生錯誤。"}],ALBUM_ADD_DESCRIPTION:[{type:0,value:"按一下這裡為此相簿輸入說明"}],ERROR_CREATING_PHOTOBOOK_FROM_ALBUM:[{type:0,value:"為這本相簿建立實體相簿時發生問題。 請稍後再試。"}],ALBUM_DESCRIPTION:[{type:0,value:"相簿描述"}],CREATE_BOOK_FROM_ALBUM:[{type:0,value:"使用此相簿製作畫冊"}],DOWNLOAD_PHOTOS_AND_VIDEO:[{type:0,value:"下載 "},{type:6,value:"photoCount",options:{one:{value:[{type:7},{type:0,value:" 張相片"}]},other:{value:[{type:7},{type:0,value:" 張相片"}]}},offset:0,pluralType:"cardinal"},{type:0,value:"和 "},{type:6,value:"videoCount",options:{one:{value:[{type:7},{type:0,value:" 個影片"}]},other:{value:[{type:7},{type:0,value:" 個影片"}]}},offset:0,pluralType:"cardinal"}],DOWNLOAD_PHOTOS:[{type:0,value:"下載 "},{type:6,value:"photoCount",options:{one:{value:[{type:7},{type:0,value:" 張相片"}]},other:{value:[{type:7},{type:0,value:" 張相片"}]}},offset:0,pluralType:"cardinal"}],DOWNLOAD_VIDEOS:[{type:0,value:"下載 "},{type:6,value:"videoCount",options:{one:{value:[{type:7},{type:0,value:" 個影片"}]},other:{value:[{type:7},{type:0,value:" 個影片"}]}},offset:0,pluralType:"cardinal"}],DOWNLOAD_ZIP:[{type:0,value:"下載 zip 檔案"}],DOWNLOAD_ZIP_PART:[{type:0,value:"下載 zip 檔案的第 "},{type:1,value:"partSequence"},{type:0,value:" 部分"}],ALOT_OF_PHOTOS:[{type:0,value:"嘩，好多相片！ 按一下將逐批相片下載為 zip 檔案。"}],DOWNLOAD_ALBUM_NOT_AVAILABLE_ERROR:[{type:0,value:"這個相簿內沒有可供下載的相片或影片。"}],DOWNLOAD_ALBUM_DISABLED_ERROR:[{type:0,value:"目前無法下載相簿。 請在一分鐘後再試一次。"}],DOWNLOAD_ALBUM_GENERIC_ERROR:[{type:0,value:"下載這個相簿時發生錯誤。 請再試一次。"}],DOWNLOAD_ALBUM_LICENSE_MESSAGE:[{type:0,value:"這些相片可能有一種或多種使用許可。下載此相簿前，請先瀏覽個別相片頁面了解使用許可詳情。"}],DOWNLOAD_ALBUM_LICENSE_MESSAGE_ALT:[{type:0,value:"這些相片可能有一種或多種使用許可。下載此相簿前，請先瀏覽個別相片頁面，以了解每張相片的指定許可類型"}],DOWNLOAD_ALBUM_LICENSE_MESSAGE_ALT_2:[{type:0,value:"這些相片可能有一種或多種使用許可，或版權所有。下載此相簿前，請先瀏覽個別相片頁面，以了解每張相片的指定許可類型。"}],DOWNLOAD_ALBUM_LEARN_MORE:[{type:0,value:'瀏覽 <a href="https://www.flickr.com/creativecommons" target="_blank">Creative Commons</a> 以了解詳情'}],CONFIRM_ALBUM_DELETE_NO_CONTENTS_DELETED:[{type:0,value:"你確定要刪除此相簿嗎？ (別擔心，我們不會刪除任何內容。)"}],DELETE_THIS_ALBUM:[{type:0,value:"刪除此相簿"}],SHARE_THIS_ALBUM:[{type:0,value:"分享此相簿"}],CREATE_NEW_ALBUM:[{type:0,value:"建立新相簿"}],NEW_ALBUM:[{type:0,value:"新相簿"}],NEW_COLLECTION:[{type:0,value:"新的珍藏集"}],VIEW_COLLECTIONS:[{type:0,value:"查看珍藏集"}],VIEW_MY_COLLECTIONS:[{type:0,value:"查看我的珍藏集"}],SORT:[{type:0,value:"排列"}],SORT_DATE_TAKEN_OLDEST:[{type:0,value:"按拍攝日期排序 (由最舊開始)"}],SORT_DATE_TAKEN_NEWEST:[{type:0,value:"按拍攝日期排序 (由最新開始)"}],SORT_DATE_UPLOADED_OLDEST:[{type:0,value:"按上傳日期排序 (由最舊開始)"}],SORT_DATE_UPLOADED_NEWEST:[{type:0,value:"按上傳日期排序 (由最新開始)"}],SORT_ALPHABETICALLY:[{type:0,value:"按英文字母順序"}],SORT_RANDOMLY:[{type:0,value:"隨機"}],SORT_REVERSE:[{type:0,value:"倒轉目前的次序"}],SORT_ALMOST_DONE:[{type:0,value:"即將完成..."}],TIMEOUT_FAILURE:[{type:0,value:"我們目前無法顯示此相簿，請再試一次。"}],OPENGRAPH_DESCRIPTION:[{type:0,value:"在 Flickr 上發掘這本由 "},{type:1,value:"owner"},{type:0,value:" 發佈的相簿！"}]})}),"@VERSION@",{requires:["intl"]});