"},usePartial:!0,useData:!0}),n={};a.Array.each(["flickr-balls"],function(t){var e=a.Template.get("hermes/"+t);e&&(n[t]=e)}),a.Template.register("hermes/prepare-print-modal",function(t,s){return s=s||{},s.partials=s.partials?a.merge(n,s.partials):n,e(t,s)})},"@VERSION@",{requires:["template-base","handlebars-base","hermes-template-flickr-balls"]});YUI.add("prepare-print-modal-view",function(e,r){require("hermes-core/flog")(r);e.FlickrView.create(this.name,e.FlickrView,[],{langBundles:this.details.langBundles,initializer:function(e){},buildContainer:function(){this.setContainerWithTemplate("prepare-print-modal")},activate:function(){var e=this,r=this.get("container");this.contentContainer=r.one(".prepare-print-modal-container"),this.loadingContainer=r.one(".loading-container"),this.errorContainer=r.one(".error-container"),this.errorTextContainer=this.errorContainer.one(".error-message"),this.errorRetryButton=this.errorContainer.one("button.retry-button"),this.errorCancelButton=this.errorContainer.one("button.cancel-button"),this.registerEventHandler(this.errorRetryButton.on("click",function(){e.fire("retryClicked")})),this.registerEventHandler(this.errorCancelButton.on("click",function(){e.fire("closeClicked")}))},showError:function(e){this.contentContainer.removeClass("loading"),this.contentContainer.addClass("error"),e&&this.errorTextContainer.set("text",e)},showLoading:function(){this.contentContainer.addClass("loading"),this.contentContainer.removeClass("error")}})},"@VERSION@",{requires:["flickr-view","hermes-template-prepare-print-modal"],langBundles:["common","prints"]});YUI.add("hermes-lang-prints",function(o,e){o.Intl.add("hermes/prints","en-US",{PRINTS:["Prints"],SIGNUP_MODAL_TITLE:["Get amazing prints!"],SIGNUP_MODAL_MESSAGE:["Join Flickr to gain access to our amazing print labs for all of your photos."],GET_STARTED:["Get started"],PRINTS_AND_GIFTS:["Prints & Wall Art"],VIEW_CART:["View Cart"],VIEW_CART_WITH_COUNT:["View Cart (","${count}",")"],BUY_PRINTS:["Buy prints"],PHOTO_BOOKS_MENU_TEXT:["Photo Books"],CHOOSE_PHOTO_TO_GET_PRINTS:["Choose a photo to get prints and wall art."],BUY_PRINTS_MENU_TEXT:["Buy Prints"],CHOOSE_YOUR_PHOTO_TO_GET_PRINTS:["Choose one of your photos to get prints and wall art."],LEARN_MORE_THEN_FEEDBACK:['Learn more then tell us what you think!'],GET_PRINTS:["Get prints"],THANKS_FOR_YOUR_ORDER:["Thanks for your order!"],YOUR_ORDER_NUMBER_IS:['Your order number is ',"${orderNum}","."],YOULL_RECEIVE_ORDER_EMAIL:['You’ll receive an email with your order details at ',"${email}","."],HAVE_QUESTIONS_LINE:['Have questions? Check out our Help Center.'],WE_WELCOME_FEEDBACK_HERE:['We welcome your feedback here.'],PRINT_TOOLTIP_TEXT:["You can now get prints and wall art of your own photos. (This is only available to you for your photos)"],PRINT_TOOLTIP_TEXT_1:["You can now get prints and wall art of your own photos."],PRINT_TOOLTIP_TEXT_2:["This service is only available to you for your photos."],GET_PRINTS_WALL_ART_TITLE:["Get prints and wall art of your photos"],GET_PRINTS_WALL_ART_DESCRIPTION:["Choose from metal, canvas, or paper prints in many sizes and styles."],SELECT_FROM_YOUR_PHOTOS:["Select from your photos"],ENGLISH_LANGUAGE_AHEAD:["English language ahead!"],ORDERING_IS_ENGLISH_ONLY:["Our ordering process is English-only at the moment. Please proceed if you’re comfortable reading English."],CONTINUE_IN_ENGLISH:["Continue in English"],PRINTS_AND_WALL_ART:["Prints & Wall Art"],GET_STUNNING_WALL_ART:["Get stunning wall art and high-quality prints of your photos"],CHOOSE_PHOTOS:["Choose photos"],METAL_PRINTS:["Metal prints"],METAL_PRINTS_DESCRIPTION:["Metal prints deliver unparalleled color and vibrance to produce a depth and clarity unlike any other photographic wall art. If you want a print as bold as your most epic photos, look no further than metal prints."],PAPER_PRINTS:["Paper prints"],PAPER_PRINTS_DESCRIPTION:["Paper prints are a time-honored way to show off and share your favorite photos. From stacks of 4x6s to frameable statement pieces, you'll be able to find the perfect size and paper finish for any photo."],CANVAS_PRINTS:["Canvas prints"],CANVAS_PRINTS_DESCRIPTION:["Add a little class to your home, office, or whatever other space needs a classic canvas print. With shapes and sizes perfect for wherever you want to hang your photos, your images will look outstanding."],WHO_CAN_PRINT_PHOTOS_QUESTION:["Who can print my photos?"],WHO_CAN_PRINT_PHOTOS_ANSWER:["Only you can print your photos through Flickr. Visitors to your account will not see the option to buy prints of your photos."],WHO_MAKES_PRINTS_QUESTION:["Who makes the prints and wall art?"],WHO_MAKES_PRINTS_ANSWER:["Flickr Prints benefit from years of experience that SmugMug has in printing beautiful imagery. Depending on your location, your prints will come from Bay Photo, White House Custom Colour, or Loxley Colour. All the labs we use have excellent color reproduction and fantastic reputations."],HOW_LONG_SHIP_QUESTION:["How long does shipping take?"],HOW_LONG_SHIP_ANSWER:["We ship all over the world, including more than 160 countries. No matter where you are, we'll get your prints to you as fast as we can. Expedited shipping is available to get your prints even faster."],WHAT_IF_WRONG_ORDER_QUESTION:["What if something is wrong with my order?"],WHAT_IF_WRONG_ORDER_ANSWER:['If you\'re ever unhappy with your prints or wall art, Flickr will make it right. Simply send us an email within 30 days of receiving your order and we\'ll help you out. If you have any issues, reach out to our Support Heroes.'],WHERE_PHOTO_BOOK_QUESTION:["Where can I make a photo book?"],WHERE_PHOTO_BOOK_ANSWER:["We partner with Blurb and Chatbooks for both hard-cover and soft-cover photo books. Your Flickr photo stream and albums are seamlessly integrated into the book-making process. Check out photo books."],WHERE_PHOTO_BOOK_ANSWER_WITH_LINKS:['We partner with Blurb and Chatbooks for both hard-cover and soft-cover photo books. Your Flickr photo stream and albums are seamlessly integrated into the book-making process. Check out photo books.'],MORE_QUESTIONS_QUESTION:["More questions?"],MORE_QUESTIONS_ANSWER:['Please visit the Flickr Help Center for more information or to connect with a Support Hero.'],PREPARING_YOUR_PHOTO:["Preparing your photo..."],SOMETHING_WRONG_PREPARING_PRINT:["Something went wrong while preparing your photo for prints."],MID_PAGE_PHOTO_ATTRIBUTION:["Photo by ","${photoOwner}","."],UNSUPPORTED_FILE_TYPE_PLEASE_JPG:["This is an unsupported file type. Please use JPG files for prints."],PRINT_PHOTOS_WITH_EASE:["Print your favorite photos from the best labs with ease."]})},"@VERSION@",{requires:["intl"]});YUI.add("photo-prints-helper",function(e,r){var t=require("url-parse"),i=require("hermes-core/flog")(r),n=require("superagent"),s=e.mix({langBundles:["prints"]},e.Localizable),o={default:"prints.SOMETHING_WRONG_PREPARING_PRINT",4:"prints.UNSUPPORTED_FILE_TYPE_PLEASE_JPG"};e.PhotoPrintsHelper=function(r){var a=e.config.flickr.flickrprints.devBaseUrl,l=e.config.flickr.flickrprints.baseUrl,c=e.config.flickr.flickrprints.cartPath,p=e.config.flickr.flickrprints.devApiKey,u=e.config.flickr.flickrprints.apiKey,d=e.config.flickr.flickrprints.dismiss_prints_new_badge_cookie_name;return{isPrintsEnabled:function(){return r.flipper.isFlipped("enable-photo-prints")&&r.getViewer().signedIn},canPrintPhoto:function(e){return this.isPrintsEnabled()&&e.getValue("isOwner")&&!e.getValue("isVideo")},registerPrint:function(t,i){var n=this;return r.callAPI("flickr.printservice.getRedirectURL",{user_id:t.getValue("owner").getValue("id"),photo_id:t.getValue("id"),return_url:i}).then(function(r){return n.isPrintUrlSafe(r.redirectURL)?{redirectURL:r.redirectURL}:e.Promise.reject({message:n.getRegisterPrintErrorCodeMessage()})}).catch(function(e){throw{message:n.getRegisterPrintErrorCodeMessage(e.code)}})},isPrintUrlSafe:function(e){var r=new t(e);return"https:"===r.protocol&&"https://"+r.hostname===this.getBaseUrl()},getBaseUrl:function(){return r.flipper.isFlipped("enable-photo-prints-prod-url")?l:a},getApiKey:function(){return r.flipper.isFlipped("enable-photo-prints-prod-url")?u:p},getCartUrl:function(){return this.getBaseUrl()+c},fetchCartCount:function(){var e=this.getBaseUrl()+"/api/v2/cart?APIKey="+this.getApiKey();return n.get(e).withCredentials().set("Accept","application/json").then(function(e){return{count:e&&e.body.Response.Cart?e.body.Response.Cart.ItemCount:0}}).catch(function(e){throw i.error("Error fetching cart count",{err:e}),e})},fetchOrder:function(e){var r=this.getBaseUrl()+"/api/v2/order/"+e+"?_expand=OrderBillingAddress&APIKey="+this.getApiKey();return n.get(r).withCredentials().set("Accept","application/json").then(function(r){var t="/api/v2/order/"+e+"!billingaddress",i=r.body.Response.Order,n=r.body.Expansions[t];return{orderId:i.OrderID,orderUrl:i.WebUri,email:n.OrderBillingAddress.Email}})},getRegisterPrintErrorCodeMessage:function(e){var r=e?e.toString():"";return o.hasOwnProperty(r)?s.intlMessage({intlName:o[r]}):s.intlMessage({intlName:o.default})},shouldShowNewBadge:function(){return!r.getCookie(d)},setDismissNewBadge:function(){var e=new Date;e.setTime(e.getTime()+36e10),r.setCookie({cookieName:d,cookieValue:1,expires:e,path:"/"})}}}},"@VERSION@",{requires:[]});YUI.add("print-button-view",function(t,i){require("hermes-core/flog")(i);t.FlickrView.create(this.name,t.FlickrView,[],{langBundles:this.details.langBundles,initializer:function(i){this.params=i,this.disableClicks=i.disableClicks,this.showNewLabel=void 0===i.showNewLabel||i.showNewLabel,this.iconSize=void 0!==i.iconSize?i.iconSize:"normal",this.photoPrintsHelper=new t.PhotoPrintsHelper(this.appContext),this.selectors={printButton:".print-button-container .print-button",newLabel:".print-button-container .label-beta"},this.showNewLabel=!!this.photoPrintsHelper.shouldShowNewBadge()&&this.showNewLabel},loadState:function(){var t=this;return this.appContext.getModel("photo-models",this.params.photoId).then(function(i){t.photoModel=i})},buildContainer:function(){this.setContainerWithTemplate("print-button",{iconSize:this.iconSize,showNewLabel:this.showNewLabel})},activate:function(){var t=this.get("container");this.printButtonNode=t.one(this.selectors.printButton),this.printNewLabelNode=t.one(this.selectors.newLabel),this.disableClicks||(this.printButtonNode&&this.registerEventHandler(this.printButtonNode.on("click",this.handlePrintClick.bind(this))),this.printNewLabelNode&&this.registerEventHandler(this.printNewLabelNode.on("click",this.showPrintTooltip.bind(this))))},handlePrintClick:function(){this.photoPrintsHelper.setDismissNewBadge(),"en-us"===this.appContext.lang.toLowerCase()?this.preparePrint():this.showEnglishWarningModal()},preparePrint:function(){var i=this;this.showPreparingPrintModal(),this.photoPrintsHelper.registerPrint(this.photoModel,t.config.win.location.href).then(function(i){t.config.win.location.href=i.redirectURL}).catch(function(t){i.preparePrintModalSubview.showError(t.message||i.intlMessage({intlName:"prints.SOMETHING_WRONG_PREPARING_PRINT"}))})},showEnglishWarningModal:function(i){var e=this;this.englishWarningModal=new t.Views.FluidModal({appContext:this.appContext,dismissOnOverlayClick:!1,showActionButton:!0,actionButtonLabel:this.intlMessage({intlName:"prints.CONTINUE_IN_ENGLISH"}),showCancelButton:!0,cancelButtonLabel:"en-us"===this.appContext.lang.toLowerCase()?this.intlMessage({intlName:"common.GO_BACK_BUTTON"}):this.intlMessage({intlName:"common.CANCEL"}),showCancelX:!1,showHeader:!0,showFooter:!0,title:this.intlMessage({intlName:"prints.ENGLISH_LANGUAGE_AHEAD"}),message:this.intlMessage({intlName:"prints.ORDERING_IS_ENGLISH_ONLY"}),hideModalOverlay:!1}),this.englishWarningModal.show(),this.englishWarningModal.on("actionClick",function(){e.englishWarningModal.close(),setTimeout(function(){e.preparePrint()},0)})},showPreparingPrintModal:function(){var i=this;this.preparePrintModalSubview=new t.Views["prepare-print-modal-view"]({appContext:this.appContext}),this.preparingPrintModal=new t.Views.FluidModal({appContext:this.appContext,dismissOnOverlayClick:!1,showActionButton:!1,showCancelButton:!1,showCancelX:!1,showHeader:!1,showFooter:!1,subview:this.preparePrintModalSubview,hideModalOverlay:!1,contentPadding:0}),this.preparingPrintModal.show(),this.preparePrintModalSubview.on("retryClicked",function(){i.preparingPrintModal.close(),setTimeout(function(){i.preparePrint()},0)}),this.preparePrintModalSubview.on("closeClicked",function(){i.preparingPrintModal.close()})},showPrintTooltip:function(){var i,e=this,n=this.printButtonNode;n&&(this.tooltip=new t.Views.FluidDroparound({appContext:this.appContext,htmlMessage:this.templates("print-icon-tooltip")({}),showDropArrow:!0,dismissOnOverlayClick:!0,observePageResize:!0,anchorElement:n,keyboardAnchorElement:n,minVerticalSpace:400,width:300,positionFixed:!0,preferLeft:!0,closeOnScroll:!0,anchorOffsetHorizontal:2,anchorOffsetVertical:0}),i=this.tooltip.get("container"),this.registerEventHandler(i.delegate("click",function(t){e.tooltip.close()},".close-x-button")),this.tooltip.show())}})},"@VERSION@",{requires:["flickr-view","hermes-template-print-button","hermes-template-print-icon-tooltip","prepare-print-modal-view","photo-prints-helper"],optional:["photo-models"],langBundles:["common","prints"]});