window._hzlang = window._hzlang || {};
window.hzmr = window.hzmr || [];
/************* Start jmoduleLoader.js for locale it-IT **************/
try {HZ.utils.loadJukwaaModule=function(a,b){HZ.utils.StylesheetLoader.load(a.css),a.ctx&&(HZ.ctx=$.extend(!0,{},HZ.ctx,a.ctx),HZ.ctx.rid=HZ.utils.Logger&&HZ.utils.Logger.pageRequestId?HZ.utils.Logger.pageRequestId:null),HZ.utils.ScriptLoader.load(a.js,b,!0)};

window.hzmr.push("jmoduleLoader:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End jmoduleLoader.js  **************/
/************* Start consents.js for locale it-IT **************/
try {HZ.ns("HZ.modules.Consents"),HZ.modules.Consents=new function(){var a=this;this.init=function(a){a=a||{},this.setSensitiveActionFlags(a.saf||0),this.setConsentCountryCode(a.consentCountryCode||""),this.setConsentLanguageCode(a.consentLanguageCode||""),a.showVisitorBanner&&this.fetchWebModule()},this.setConsentLanguageCode=function(a){this.consentLanguageCode=a},this.getConsentLanguageCode=function(){return this.consentLanguageCode},this.setConsentCountryCode=function(a){this.consentCountryCode=a},this.getConsentCountryCode=function(){return this.consentCountryCode},this.setSensitiveActionFlags=function(a){this.sensitiveActionFlags=a},this.getSensitiveActionFlags=function(){return this.sensitiveActionFlags},this.assertSensitiveActions=function(b){var c=[];if(b&&b.length)for(var d=0;d<b.length;d++)a.assertSensitiveAction(b[d])||c.push(b[d]);return c},this.assertSensitiveAction=function(a){return!!(parseInt(a,10)&this.getSensitiveActionFlags())},this.registerConsents=function(b){return this.handleConsentAjax("submitConsents",b).then(function(b){b&&b.sensitiveActionFlags&&a.setSensitiveActionFlags(b.sensitiveActionFlags)},function(){})},this.getConsentsForUserTypes=function(a){return this.handleConsentAjax("getConsentsForUserTypes",a)},this.getConsentsForSensitiveActions=function(a){return this.handleConsentAjax("getConsentsForSensitiveActions",a)},this.handleConsentAjax=function(a,b,c){var d={action:a,c2:1,consentsData:b};return"j"===HZ.utils.Logger.env?d._csrf=HZ.data.CSRFToken:d.__ct=HZ.data.CSRFToken,c&&c.webModuleRequest&&(d.wm=1),$.ajax({url:"/j/ajax/consents",method:"POST",data:d}).done(function(a){return a}).fail(function(b){console.error(b),HZ.utils&&HZ.utils.Logger&&HZ.utils.Logger.logCountInTSDB&&HZ.utils.Logger.logCountInTSDB("tracking","consent_ajax_error_"+a)})},this.fetchWebModule=function(){return this.handleConsentAjax(null,null,{webModuleRequest:!0}).then(function(b){HZ.utils.loadJukwaaModule(b,a.loadModule)})},this.loadModule=function(){if(HZ&&HZ.WebModule){var b=document.getElementById("hz-consents");HZ.WebModule.render("consentsWebModule",b,{isPageReloadRequired:!0});var c=HZ.WebModule.getModule("consentsWebModule");a.webModule=new c}}};

window.hzmr.push("consents:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End consents.js  **************/
/************* Start filterRenderer.js for locale it-IT **************/
try {HZ.navigation.Utils=new function(){function a(a){a.stopPropagation();var c=$(a.target).closest(".sidebar"),d=$(c).find(".sidebar-header .toggle"),e=$(c).find(".sidebar-body"),f=Math.floor(e.height()/200*300);f=Math.min(f,b),d.hasClass("more-icon")?(d.addClass("down-icon").removeClass("more-icon"),e.slideDown(f,function(){c.removeClass("state-collapsed")})):d.hasClass("down-icon")&&(d.addClass("more-icon").removeClass("down-icon"),e.slideUp(f,function(){c.addClass("state-collapsed")}))}var b=800;this.expandBox=function(a){$("#"+a+" .hidden").removeClass("hidden"),$("#"+a+"More").hide()},this.handleMetroAreaChanged=function(a){var b=document.getElementById("metroAreaSelector"),c=b.options[b.selectedIndex].value,d=a;c=""!==c?"/"+c:"",d.indexOf("/_3_")>0?d=d.replace("/_3_",c):d.indexOf("/_19_")>0?d=d.replace("/_19_",c):d+=c,document.location=d},this.handlePriceFilterChanged=function(a,b){var c;c=a?$(a.target):$(this).parents(".price-filter-form");var d=c.find(".fromPrice").val(),e=c.find(".toPrice").val();return""!=d&&!$.isNumeric(d)||""!=e&&!$.isNumeric(e)?void window.location.reload():""!=d&&""!=e&&(d=parseInt(d,10),e=parseInt(e,10),d>e)?void window.location.reload():(d=Math.max(0,d),""!=e&&(e=Math.max(0,e)),void(document.location=b.replace(/XXXXX/,d).replace(/YYYYY/,e)))},this.attachTickBudgetBox=function(){$(document).ready(function(){$(".filter-budget").on("click","li",function(a){var b=$(a.currentTarget);b.hasClass("selected")?b.removeClass("selected"):(b.addClass("selected"),b.siblings().removeClass("selected"))})})},this.attachMultiSelectionToList=function(){$(document).ready(function(){$(".multiselect").on("click","a",function(a){var b=$(a.currentTarget),c=b.parent(".sidebar-item");c.hasClass("selected")?c.removeClass("selected"):c.addClass("selected")})})},this.initSidebarToggle=function(){$(document).ready(function(){$(".sidebar-header").click(a),$(".sidebar-header .toggle").click(a),$(".sidebar-icon.info-icon").hover(function(){var a=$(this);a.tipBubble({content:a.attr("tooltip-data"),id:"sidebar-tooltip",width:100,offsetX:5,offsetY:16,borderColor:"#ccc",showCloseBtn:!1,position:"absolute",attachTo:"body",fadeDuration:0})},function(){$(this).tipBubble("hide")})})},this.init=function(){this.initSidebarToggle(),this.attachMultiSelectionToList()}};

window.hzmr.push("filterRenderer:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End filterRenderer.js  **************/
/************* Start scrollToTop.js for locale it-IT **************/
try {HZ.ns("HZ.StickyFooterActions"),HZ.StickyFooterActions=function(){},HZ.StickyFooterActions.prototype={init:function(a){this.el=document.getElementById("stickyFooterActions"),this.$el=$(this.el),this.attachEvents(),this.currentScrollPosition=$(window).scrollTop(),this.currentScrollPosition>350&&this.$el.removeClass("hide-actions")},attachEvents:function(){$(window).on("scroll.stickyFooterActions",$.throttle(250,this.handleScroll.bind(this)))},detachEvents:function(){$(window).off(".stickyFooterActions")},handleScroll:function(a){var b=$(window).scrollTop();b>this.currentScrollPosition&&b>350?this.$el.removeClass("hide-actions"):b<=350&&this.$el.addClass("hide-actions"),this.currentScrollPosition=b}},HZ.ns("HZ.modules.ScrollToTop"),HZ.modules.ScrollToTop=function(){var a,b,c=function(a){$("body,html").animate({scrollTop:0},500,"swing")},d=function(){var a=!0;if(b||0!==b.length){var c=document.body.clientHeight,d=document.body.scrollHeight;return d&&d/c<1.5?(b.hide(),a=!1):b.show(),a}};return $(document).ready(function(){if(b=$("#ScrollToTopContainer"),b.on("click",c),!b.hasClass("show-action")){d()||(a=window.setTimeout(d,2500))}}),this}();

window.hzmr.push("scrollToTop:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End scrollToTop.js  **************/
/************* Start extracting text for addToIdeabookDialog.js for locale it-IT **************/
(function(){var _hzxt={"Ready to Renovate? Find a local Pro":"Pronto a ristrutturare? Trova un professionista in zona","Ready to start a project? Click here":"Pronto a iniziare un progetto? Clicca qui","Saved! Now introduce yourself":"Salvato. Ora raccontaci qualcosa di te","Last Name ":"Cognome","First Name ":"Nome","(publicly displayed)":"(mostrato pubblicamente)","Palette Added":"\u00c8 stata aggiunta la palette","Please enter a value for your zip code.":"Inserisci il tuo codice postale","Share this ideabook with family, friends and pros.":"Condividi questo Ideabook con parenti, amici e professionisti.","Get feedback from family, friends, and pros":"Condividilo con parenti, amici e professionisti","Ideabook has been successfully shared.":"L'Ideabook \u00e8 stato condiviso con successo.","You have not selected any users to add as collaborators to this ideabook":"Non hai selezionato alcun utente con cui collaborare a questo Ideabook","Invites Sent":"Gli inviti sono stati inviati","Ready to work on your ideabooks?":"Pronto a lavorare ai tuoi Ideabook?","Select an ideabook":"Seleziona un Ideabook","Search For Ideabook":"Cerca un Ideabook","Could not find any ideabooks matching search phrase":"Non \u00e8 stato trovato alcun Ideabook corrispondente alla tua ricerca","Shared With You":"Condiviso con te","Create New":"Digita qui per crearne uno nuovo","Add notes, What do you like about this photo?":"Aggiungi un commento. Cosa ti piace di questa foto?","Invite Collaborators to {galleryName}":"Invita collaboratori a {galleryName}","Ready to work on {ideabook}?":"Pronto per lavorare a un {ideabook}?","Saved!":"Salvato!","Contact a local pro":"Contatta un professionista in zona","View More Pros":"Visualizza altri professionisti","Can you try another first name? We are sorry for the inconvenience.":"Ti invitiamo a provare con un altro nome. Ci scusiamo per l'inconveniente.","Zip Code":"CAP","The colors displayed on-screen may not match {mft} color standards":"I colori mostrati sullo schermo potrebbero differire leggermente dalle tonalit\u00e0 di {mft}","No, thanks":"No, grazie","Loading your ideabooks...":"Caricamento dei tuoi Ideabook in corso...","Last Name":"Cognome","First Name":"Nome","Email{contextEmailVerb}":"E-mail{contextEmailVerb}","Love Houzz? Write a review about us":"Ti piace Houzz? Scrivi una recensione","This palette has been added to <t1>your ideabook<\/t1>.":"Questa palette \u00e8 stata aggiunta al <t1>tuo Ideabook<\/t1>.","This palette has been added to:":"Questa palette \u00e8 stata aggiunta a:","Review Houzz":"Recensione Houzz","Email this Photo":"Invia questa foto per e-mail","Make Comment Private":"Rendi privato il commento","Create":"Crea","No Thanks":"No, grazie","Email this Product":"Invia questo prodotto per e-mail","Like this photo on Facebook!":"D\u00ec che ti piace questa foto su Facebook!","This photo has been added to <t1>your ideabook<\/t1>.":"La foto \u00e8 stata aggiunta al <t1>tuo Ideabook<\/t1>.","This photo has been added to:":"Questa foto \u00e8 stata aggiunta a:","Please select an ideabook":"Seleziona un Ideabook","Featured":"In primo piano","Create New Ideabook":"Crea nuovo Ideabook","Continue Browsing":"Continua la navigazione","Connect with Pros":"Connettiti con i professionisti","Find Products":"Trova Prodotti","Remodel your dream home from start to finish:":"Ristruttura la casa dei tuoi sogni dall'inizio alla fine:","Welcome to Houzz!":"Ti diamo il benvenuto su Houzz!","Ready to Renovate?  Find a local Pro":"Pronto a ristrutturare? Trova un professionista in zona ","Photo Added":"Foto aggiunta","1 photo":"1 foto","Share":"Condividi","Make comment private":"Rendi privato il commento","Cancel":"Annulla","Browse Photos":"Sfoglia foto","Save to Ideabook":"Salva nell'Ideabook","Done":"Fatto","Continue":"Continua","Your Ideabooks":"I tuoi Ideabook"};for(var a in _hzxt){window._hzlang[a]=_hzxt[a];}})();
/*************  End extracting text for addToIdeabookDialog.js  **************/
/************* Start addToIdeabookDialog.js for locale it-IT **************/
try {HZ.ns("HZ.spaceActions"),HZ.spaceActions.AddToIdeabookDialog=new function(){function a(a){var b="newAddToIdeabookDialog_"+a;K.children().each(function(a){this.style.display=this.id==b?"block":"none"}),L.center()}function b(){var a;if(!HZ.ui.AjaxThrobber.isInCall()){if(a=V.comboSelect("getSelectedOptionValues"),j(""),0==a.length&&!U)return j(_hgt("Please select an ideabook"));HZ.ui.AjaxThrobber.setInCall(!0),r.length<=0&&d();var b=l.checked?aa:ba,e=k.value;if(null!==A){var f=B;return $.isNumeric(C)&&(f=C),void(a.length>1?HZ.ajaz.Services.saveColorPaletteMulti(z,A,f,JSON.stringify(a),b,e,$.proxy(c,this)):1==a.length?HZ.ajaz.Services.saveColorPalette(z,A,f,a[0],e,b,null,$.proxy(c,this)):U&&HZ.ajaz.Services.saveColorPalette(z,A,f,U.id,e,b,null,$.proxy(c,this)))}a.length>1?HZ.ajaz.Services.addToGalleries(z,JSON.stringify(a),b,e,$.proxy(c,this)):1==a.length?HZ.ajaz.Services.addToGallery(z,null,a[0],b,e,$.proxy(c,this)):U&&HZ.ajaz.Services.addToGallery(z,null,U.id,b,e,$.proxy(c,this))}}function c(a){var b,c,d;if(HZ.ui.AjaxThrobber.setInCall(!1),"true"==a.success)if(!1===HZ.lb.Config.ideaBookTipAlreadyShown&&("function"==typeof showIdeaBookTip&&showIdeaBookTip(),HZ.ajaz.Services.setVisitorProperty(HZ.ajaz.Services.VISITOR_PROPERTY_IDEABOOK_TIP_PHOTO_SAVED,"true")),E=a,void 0!==a.galleryIds&&(b=a.galleryIds),void 0!==a.galleryId&&(c=a.galleryId),c&&0!=c?this.setLastGalleryId(a.galleryId):b&&b.length&&this.setLastGalleryId(b[0]),(d=$(S).filter(function(a,d){return b?-1!=$.inArray(parseInt(d.id),b):c?d.id==c:void 0}))&&1==d.length)ya.call(this,d[0],a.galleryErrors);else if(a.hasOwnProperty("localProData")&&!$.isEmptyObject(a.localProData)?(t=a.localProData,v=!0):v=!1,a.hasOwnProperty("organicContactLocalProsData")&&!$.isEmptyObject(a.organicContactLocalProsData)?(u=a.organicContactLocalProsData,w=!0):w=!1,a.proServiceSuggestionData&&(x=!0),a.showProWizardLaunchCTA&&(O=a.showProWizardLaunchCTA),s&&M)M(),HZ.ajaz.Services.setVisitorProperty(HZ.ajaz.Services.VISITOR_PROPERTY_IDEABOOK_TIP_PHOTO_SAVED,"true");else if(N){var g=e(a);f(a,g),a.galleryErrors&&j(Ba(a.galleryErrors))}else i();else j(a.houseError?a.houseError:a.galleryErrors?Ba(a.galleryErrors):a.error)}function d(){var a=[99,1],b=[m,n];r.length=0;for(var c=0,d=a.length;c<d;c++)for(var e=0;e<a[c];e++)r.push(b[c])}function e(a){var b=Math.floor(100*Math.random()),c=r[b],d=!1;switch(c){case n:(P||HZ.data.CurrentSessionUser.hasOwnProperty("trustPilotImps"))&&(d=!0)}return x?c=q:v?c=o:w?c=p:d&&(c=m),c}function f(b,c){var e,f,g,h=b.galleryTitle,k=b.galleryIds,l=b.galleryId,r=HZ.utils.Links.getGalleryLink(l),s=[],u=$("#addToIdeabookCTAMsg"),v=$("#trustPilotCTAMsg");if(k&&(s=$.map(k,function(a){return G[a]})),c==m||c==n||c==p){var w=$.map(s,function(a){return"<a class='colorLink trackMe' class='add-to-gallery-link' href='"+HZ.utils.Links.getGalleryLink(a.id)+"'>"+a.title+"</a>"}).join(", ");e=h&&A?"<b>"+_hgt("This palette has been added to:")+'</b><br/><a class="colorLink trackMe text-bold" compid="confirm_color_palette" id="addToIdeabookGalleryLink" href="'+HZ.utils.Links.getGalleryLink(l)+'">'+h+"</a><br/></br/>":h?"<b>"+_hgt("This photo has been added to:")+'</b><br/><a class="colorLink trackMe text-bold" compid="confirm_gallery_name" id="addToIdeabookGalleryLink" href="'+HZ.utils.Links.getGalleryLink(l)+'">'+h+"</a><br/></br/>":k&&A?"<b>"+_hgt("This palette has been added to:")+"</b><br/>"+w:k?"<b>"+_hgt("This photo has been added to:")+"</b><br/>"+w:A?_hgt("This palette has been added to <t1>your ideabook</t1>.",{t1:{tag:"a",attr:{href:r,class:"colorLink",id:"addToIdeabookGalleryLink"}}})+"<br/><br/>":_hgt("This photo has been added to <t1>your ideabook</t1>.",{t1:{tag:"a",attr:{href:r,class:"colorLink",id:"addToIdeabookGalleryLink"}}})+"<br/><br/>"}switch(c){case p:var x=new HZ.postSaveDialogs.LocalProsContact;x.init();var y=z?HZ.utils.Links.getSpaceImageUrl(z,80,80):HZ.utils.Links.getImageUrl(D,80,80),B=x.getLocalProsContactDialog(y,e);HZ.ui.Yamdi.switchDialog(B);break;case o:var C=new HZ.email.PostIdeabookConfirmContactProDialog;t.galleryUrl=r,t.galleryName=h,C.prepare(t),HZ.ui.Yamdi.switchDialog(C),HZ.utils.Logger.sendEventLog(ia);break;case m:if(f=$("#ideabookCompletedMsg"),f.empty().append(e),HZ.utils.Logger.sendEventLog(ea),!0===b.isProduct)u.hide(),$("#hzEmailSpace").val(_hgt("Email this Product"));else{var E="javascript:HZ.spaceActions.AddToIdeabookDialog.switchDialogToProWizard();";if("new"==O){var F=_hgt("Ready to start a project? Click here");u.addClass("new").html("<span class='hzi-font hzi-Project-Match-Toolset'></span>"+F+"<span class='more-icon'></span>").attr("href","javascript:;").attr("onclick",E).unbind("mousedown").bind("mousedown",function(){HZ.utils.Logger.sendEventLog(da)}).show()}else"current"==O?u.addClass("current").attr("href","javascript:;").attr("onclick",E).unbind("mousedown").bind("mousedown",function(){HZ.utils.Logger.sendEventLog(da)}).show():u.attr("target","_blank").unbind("mousedown").bind("mousedown",function(){HZ.utils.Logger.sendEventLog(ca)}).show();$("#hzEmailSpace").val(_hgt("Email this Photo"))}a(c),A=null;break;case q:var H=new HZ.ProServiceDialogs.QuestionnaireDialog;if(H.init(),b.proServiceSuggestionData&&b.proServiceSuggestionData.questions)try{var I=JSON.parse(b.proServiceSuggestionData.questions);I&&I.length>0&&HZ.ui.Yamdi.switchDialog(H.getDialog({questions:I,galleryLink:r,galleryName:b.galleryTitle,professionalTypeId:b.proServiceSuggestionData.professionalTypeId,serviceName:b.proServiceSuggestionData.serviceName,questionnaireId:b.proServiceSuggestionData.questionnaireId}))}catch(a){}break;case n:HZ.ui.AjaxThrobber.setInCall(!0),g=$("#trustPilotIdeabookCompletedMsg"),g.empty().append(e),HZ.utils.Logger.sendEventLog(fa),HZ.ajaz.Services.getTrustPilotUrl(HZ.TrustPilot.Settings.getTrustPilotUrl,function(c){c.hasOwnProperty("trustPilotUrl")&&(HZ.data.CurrentSessionUser.trustPilotImps=1,d(),v.attr("href",c.trustPilotUrl),$("#trustPilotReview").click(function(){$(this).attr("href",c.trustPilotUrl),HZ.ajaz.Services.setTrustPilotUserPreference(HZ.TrustPilot.Settings.setTrustPilotUserPreference,function(a){}),HZ.utils.Logger.sendEventLog(ha),i()})),v.unbind("mousedown").bind("mousedown",function(){HZ.utils.Logger.sendEventLog(ga),HZ.ajaz.Services.setTrustPilotUserPreference(HZ.TrustPilot.Settings.setTrustPilotUserPreference,function(a){})}).show(),$("#addToIdeabookGalleryLink").attr("href",r),HZ.ui.AjaxThrobber.setInCall(!1),a(n),b.galleryErrors&&j(Ba(b.galleryErrors))},{type:"GET"}),A=null}}function g(){E&&E.spaceId&&E.spaceTitle&&h(E.spaceId,E.spaceTitle,!0===E.isProduct?HZ.sendEmail.texts.DEFAULT_MESSAGE_PRODUCT:HZ.sendEmail.texts.DEFAULT_MESSAGE_SPACE)}function h(a,b,c){HZ.dialogs.EmailDialog.prepare({type:HZ.sendEmail.types.SPACE,referenceId:a,subject:b,message:c,event:HZ.sendEmail.events.ADDTOIBK}),HZ.ui.Yamdi.switchDialog(HZ.dialogs.EmailDialog)}function i(){A=null,L&&L.hide(null)}function j(a){var b=$(".addToGalleryFormError");b.empty().append(a),a?b.show():b.hide()}var k,l,m=1,n=4,o=8,p=10,q=11,r=[],s=!1,t=[],u=[],v=!1,w=!1,x=!1,y=null,z=null,A=null,B=null,C=null,D=null,E=null,F=null,G=null,H=null,I=null,J=null,K=null,L=null,M=null,N=!0,O=!1,P=!1,Q=!1,R=!1,S=[],T=[],U=null,V=null,W=!1,X=null,Y=!1,Z=_hgt("Photo Added"),_=!0,aa=1,ba=3,ca="aticfp",da="aticlpw",ea="atici",fa="atictp",ga="atitm",ha="atitb",ia="aticcp";this.init=function(a){z=a},this.setColorPalette=function(a,b,c){A=a,B=b,C=c,Z=_hgt("Palette Added")},this.setDelegate=function(a){L=a},this.setTrustPilotReview=function(a){P=a},this.setGalleries=function(a){var b;if(F=a,G={},F.recent&&F.recent.length>0)for(var c in F.recent)b=F.recent[c],G[b.id]=b;if(F.own&&F.own.length>0)for(var c in F.own)b=F.own[c],G[b.id]=b;if(F.shared&&F.shared.length>0)for(var c in F.shared)b=F.shared[c],G[b.id]=b},this.setImageId=function(a){D=a},this.getGalleries=function(){return F},this.setUserName=function(a){y=a},this.setShowIdeabookConfirm=function(a){N=a},this.setWelcomeScreen=function(a){s=a},this.setLastGalleryId=function(a){H=a,G&&G[H]&&(U=G[H])},this.setWishListIdeabookId=function(a){I=a},this.getLastGalleryId=function(){return H},this.setDefaultGalleryTitle=function(a){J=a},this.setUserId=function(a){X=a},this.setOnSuccess=function(a){M=a},this.setMultipleSelection=function(a){_=a};var ja=function(a){HZ.ui.AjaxThrobber.setInCall(!1),W=!1;var b,c=$(".create-gallery-btn"),d=$("#newGalleryInput");"true"==a.success?(b={title:a.galleryName,id:a.galleryId,isPrivate:a.isPrivate,isFeatured:a.isFeatured},ua({title:b.title,id:b.id},$("#gallerySelectComboBox .own-galleries-list"),!0,!0,!0,!0),S.push(b),F.own.push(b),G[b.id]=b):j(a.error),$("#newAddToMyGalleryForm").click(),c.hide(),d.val("")},ka=function(a){var b=null;return $.each(G,function(c,d){d.title&&d.title.toLowerCase()===a.toLowerCase()&&(b=c)}),b},la=function(a){if(j(""),W)return!1;var b=$("#newGalleryInput").val();return ma(b),!1},ma=function(a){if(""!=a){var b=ka(a);null==b?(W=!0,HZ.ui.AjaxThrobber.setInCall(!0),HZ.ajaz.Services.newGallery(a,"",!1,null,ja)):(V.comboSelect("hasOption",{value:b})&&(V.comboSelect("setHasTakenAction",{hasTakenAction:!0}),V.comboSelect("addAdditionalSelectedOptions",{value:b})),V.comboSelect("toggleDropdown"))}},na=function(a){var b=$(this),c=b.val(),d=$(".create-gallery-btn");if(""==c?d.hide():d.show(),13===a.keyCode)return a.preventDefault(),a.stopPropagation(),!1},oa=function(a){var b=$(this),c=b.val();if(13===a.keyCode)return a.preventDefault(),a.stopPropagation(),!W&&(ma(c),!1)},pa=function(){$(this).toggleClass("selected"),l.checked=!l.checked};this.handleNewGalleryNameKeyupMobile=function(a){var b=$(".new-gallery"),c=b.find(".create-gallery");""==b.find("#newGalleryInput").val()?c.hide():c.show()},this.handleNewGalleryNameKeydownMobile=function(a){var b=$(".new-gallery"),c=b.find("#newGalleryInput"),d=c.val(),e=b.find(".create-gallery");a&&13==a.keyCode&&(a.preventDefault()&&a.stopPropagation(),W||(ma(d),c.val(""),e.hide()))};var qa=function(){var a=$(".new-gallery"),b=a.find("#newGalleryInput"),c=a.find(".create-gallery");c.on("click",function(){var a=$("#newGalleryInput").val();W||(ma(a),b.val(""),c.hide())})};this.getDialogTemplate=function(){var a=$("<div id='newAddToIdeabookDialog_0' style='display:none;'><div class='modal-header'>"+_hgt("Save to Ideabook")+"</div><div class='modal-body'><form id='newAddToMyGalleryForm' name='addToMyGalleryForm' action='javascript:;'><div class='chooseGallery form-horizontal row'><div class='addImageWrapper'><img class='dialogImage' src=''></div><div class='addRightContent'><div class='hzp-comboselect' id='gallerySelectComboBox'><div class='hzp-comboselect-trigger'><button class='btn btn-default btn-block dropdown-toggle hzp-comboselect-trigger-button'>"+_hgt("Select an ideabook")+"</button>"+(HZ.utils.Config.isResponsive?"<span class='hzi-font hzi-MH-Close close-comboselect-menu'></span>":"")+"</div><div class='hzp-comboselect-combo dropdown-menu'><div class='hzp-comboselect-search'><span class='hzp-comboselect-search-icon hzi-font hzi-Search'></span><input class='hzp-comboselect-search-input' type='text' autocomplete='off' /><div class='hzp-comboselect-no-result'>"+_hgt("Could not find any ideabooks matching search phrase")+"</div></div><div class='hzp-comboselect-select'><div class='own-galleries'><div class='gallery-group-name text-s text-dt-m text-bold mbs mtm'>"+_hgt("Your Ideabooks")+"</div><ul class='own-galleries-list list-unstyled'></ul></div><div class='shared-galleries'><div class='gallery-group-name text-s text-dt-m text-bold mbs mtm'>"+_hgt("Shared With You")+"</div><ul class='shared-galleries-list list-unstyled'></ul></div></div>"+(HZ.utils.Config.isResponsive?"<li class='new-gallery'><div class='new-gallery-action'><span class='hzi-font hzi-Add-Selection'></span><input id='newGalleryInput' type='text' onkeydown ='HZ.spaceActions.AddToIdeabookDialog.handleNewGalleryNameKeydownMobile.call(this, event);' onkeyup='HZ.spaceActions.AddToIdeabookDialog.handleNewGalleryNameKeyupMobile.call(this, event);' placeholder='"+_hgt("Create New")+"'/><button class='create-gallery create-gallery-action-btn btn btn-primary text-bold' style='display: none;'>"+_hgt("Create")+"</button></div></li>":"<li class='new-gallery'><span class='hzi-font hzi-Add-Selection'></span><input id='newGalleryInput' type='text' /><button class='create-gallery-btn btn btn-primary text-bold' type='button' style='display:none;'>"+_hgt("Create")+"</button></li>")+"</div></div><div class='add-comment'><textarea class='form-control' id='gallerySpaceComments' name='gallerySpaceComments'></textarea><div class='comment-privacy hidden'><a class='comment-privacy-control' href='javascript:void(0);'><span class='add-white-box hzi-font hzi-Check-Sidenav'></span><span class='comment-privacy-text text-xs text-dt-xs'>"+_hgt("Make comment private")+"</span></a></div><label class='checkbox-inline hidden' for='gallerySpaceCommentsPrivacy'><input id='gallerySpaceCommentsPrivacy' name='gallerySpaceCommentsPrivacy' type='checkbox' />"+_hgt("Make Comment Private")+"</label></div>"+(HZ.utils.Config.isResponsive?"<div class='add-comment-placeholder'></div>":"")+"</div><div class='col-xs-12'><div class='addToGalleryFormError alert-warning'></div></div></div></form></div><div class='modal-footer'></div></div>");return a.find(".hzp-comboselect-search-input").attr("placeholder",_hgt("Search For Ideabook")),a.find("#newGalleryInput").attr("placeholder",_hgt("Create New")),a.find("#gallerySpaceComments").attr("placeholder",_hgt("Add notes, What do you like about this photo?")),a},this.getView=function(){if(!K){K=$("<div id='addToIdeabookDialog'></div>").append("<div id='newAddToIdeabookDialog_5' style='display:none;'><div class='modal-header'>"+_hgt("Save to Ideabook")+"</div><div class='modal-body'><div class='hzLoadingDlgThrobber'></div><div class='hzLoadingDlgMessage'>"+_hgt("Loading your ideabooks...")+"</div></div></div></div>").append(this.getDialogTemplate()).append("<div id='newAddToIdeabookDialog_7' style='display:none;' scopeid='share_ideabook'><div class='modal-header'>"+Z+"</div><div class='modal-body'><div class='form-horizontal row' id='collaborateSection'><div class='addImageWrapper'><img class='dialogImage' src=''></div><div class='addRightContent'><div class='header-5 text-bold top mbxl collaborate-form-header'></div><div id='collaborateBody'></div></div><div class='col-xs-12'><div class='addToGalleryFormError alert-warning'></div></div></div></div><div class='modal-footer'><a class='text-muted collaborate-cancel pull-left' href='javascript:void(0);'>"+_hgt("No, thanks")+"</a></div></div>").append("<div id='newAddToIdeabookDialog_"+m+"' style='display:none;' scopeid='new_confirm'><div class='modal-header'>"+Z+"</div><div class='modal-body'><div class='row'><div class='addImageWrapper'><img class='dialogImage'></div><div class='addRightContent'><div id='ideabookCompletedMsg' class='addToIdeabookCompletedMsg text-bold text-l mbm top'></div><div class='confirm-cta header-5'><a id='addToIdeabookCTAMsg' class='colorLink trackMe' compid='pro_banner' href='"+HZ.utils.Links.getPageUrl("professionals#")+"'><span class='hzi-font hzi-Pro-Fill'></span>"+_hgt("Ready to Renovate? Find a local Pro")+"<span class='more-icon'></span></a></div></div><div class='col-xs-12'><div class='addToGalleryFormError alert-warning'></div></div></div></div><div class='modal-footer'></div></div>").append("<div id='newAddToIdeabookDialog_"+n+"' style='display:none;'><div class='modal-header'>"+Z+"</div><div class='modal-body'><div class='row'><div id='trustPilotConfirmImage' class='addImageWrapper'><img class='dialogImage'></div><div class='addRightContent'><div id='trustPilotIdeabookCompletedMsg' class='addToIdeabookCompletedMsg text-bold text-l mbm top'></div><div class='confirm-cta header-5'><a id='trustPilotCTAMsg' class='colorLink' href='javascript:;' target='_blank'><span class='hzi-font hzi-Heart'></span>"+_hgt("Love Houzz? Write a review about us")+"<span class='more-icon'></span></a></div></div><div class='col-xs-12'><div class='addToGalleryFormError alert-warning'></div></div></div></div><div class='modal-footer'></div></div>"),$("body").append(K);var a,c;a=HZ.ui.InputButtonUtils.createSecondaryInputButton(_hgt("Cancel"),"",$.proxy(i,this)),c=HZ.ui.InputButtonUtils.createPrimaryInputButton(_hgt("Save to Ideabook"),"",$.proxy(b,this),!1,!1,"trackMe","compid=add_ideabook"),$("#newAddToIdeabookDialog_0 .modal-footer",K).append(HZ.ui.AjaxThrobber.getThrobber()).append(a).append(c);var d=HZ.ui.InputButtonUtils.createPrimaryInputButton(_hgt("Share"),"",$.proxy(za,this),!1,!1,"trackMe collaborate-send","compid=send_share_ideabook");$(".collaborate-cancel").click($.proxy(i,this)),$("#newAddToIdeabookDialog_7 .modal-footer",K).append(HZ.ui.AjaxThrobber.getThrobber()).append(d);var e=HZ.ui.InputButtonUtils.createPrimaryInputButton(_hgt("Email{contextEmailVerb}",{contextEmailVerb:""}),"hzEmailSpace",g,!1,!1,"trackMe","compid=send_email"),f=HZ.ui.InputButtonUtils.createSecondaryInputButton(_hgt("Done"),"",$.proxy(i,this),!1,!1,"trackMe","compid=cancel_old_confirm");$("#newAddToIdeabookDialog_"+m+" .modal-footer",K).append(f).append(e);var h=HZ.ui.InputButtonUtils.createSecondaryInputButton(_hgt("No Thanks"),"",$.proxy(i,this)),j=$("<a id='trustPilotReview' class='hzBtn primary' href='javascript:;' target='_blank'>"+_hgt("Review Houzz")+"</a>");$("#newAddToIdeabookDialog_"+n+" .modal-footer",K).append(h).append(j),k=$("#gallerySpaceComments")[0],l=$("#gallerySpaceCommentsPrivacy")[0],HZ.utils.Config.isResponsive?qa():($("#newGalleryInput").keydown(oa).keyup(na),$(".create-gallery-btn").click(la)),$(".comment-privacy-control").click(pa),_||K.addClass("single-selection-enabled"),ta()}s&&($("label[for='existingGalleryRadio']").innerHTML=_hgt("Create New Ideabook")+":",$("#newGalleryControl").addClass("extra-bottom-margin"));var o;o=HZ.utils.Config.isResponsive?z?HZ.utils.Links.getSpaceImageUrl(z,120,120):HZ.utils.Links.getImageUrl(D,120,120):z?HZ.utils.Links.getSpaceImageUrl(z,250,250):HZ.utils.Links.getImageUrl(D,250,250);var p=K.find(".dialogImage");if(p)if(K.find(".mftDisclaimer").remove(),A){var q=$("<div class='mftDisclaimer col-xs-12 mbs'><i>"+_hgt("The colors displayed on-screen may not match {mft} color standards",{mft:this.getPaletteManufacturer()})+"</i></div>");K.find(".chooseGallery").prepend(q),p.attr("src",this.getPaletteImgUrl())}else{p.removeAttr("src");var r=new Image;r.src=o,r.onload=function(){p.attr("src",o)}}return K},this.getPaletteImgUrl=function(){return $.isNumeric(C)?HZ.utils.Links.getGenerateColorPaletteImageLink(A,C):HZ.utils.Links.getGenerateColorPaletteImageLink(A,B)},this.getPaletteManufacturer=function(){var a=HZ.utils.ColorPicker.getPaintManufacturerDisplayName(B);if(HZ.lb.Utils){var b=HZ.lb.Utils.ColorPicker.getColorPickerAd(z),c=HZ.lb.Utils.ColorPicker.getConfig(b);c&&c.hasOwnProperty("advDisplayName")&&(a=c.advDisplayName)}return a},this.viewLoaded=function(){if(j(""),k.value="",l.checked=!1,S=[],$(".comment-privacy-control").removeClass("selected"),HZ.ui.AjaxThrobber.setInCall(!1),F)R?U&&V.comboSelect("setSelectedOptions",{value:U.id}):this.updateGalleriesComboBox(),a(0),k.focus();else{a(5);var b=this;HZ.ajaz.Services.getMyGalleries(!1,function(c){c.galleries&&(b.setGalleries(c.galleries),b.updateGalleriesComboBox(),a(0),window.setTimeout(function(){k.focus()},0))})}R=!0,$(".modal-dialog").addClass("add-collaborate-diag")},this.viewUnloaded=function(){$(".modal-dialog").removeClass("add-collaborate-diag"),$("html").off("click.dropdown.data-api")};var ra=function(){return V.comboSelect("getSelectedOptionValues")},sa=function(){0===ra().length&&U&&(V.comboSelect("hasOption",{value:U.id})?V.comboSelect("setSelectedOptions",{value:U.id}):U=null)},ta=function(){var a={clearSelectionsOnOpen:!0,multipleSelection:_},b={clearSelectionsOnOpen:!0,hasSearch:!1,multipleSelection:_};HZ.utils.Config.isResponsive?(V=$("#gallerySelectComboBox").comboSelect(b),V.on("combo-select-dropdown-open",function(){var a=$(this);a.find(".hzp-comboselect-trigger").addClass("opened"),""!=a.find("#newGalleryInput").val()?a.find(".create-gallery").show():a.find(".create-gallery").hide()}).on("combo-select-dropdown-close",function(){sa(),$(this).find(".hzp-comboselect-trigger").removeClass("opened")}).on("click",".close-comboselect-menu",function(){V.comboSelect("toggleDropdown")})):(V=$("#gallerySelectComboBox").comboSelect(a),V.on("combo-select-dropdown-open",function(){V.find("#newGalleryInput").val("").trigger("keyup")}).on("combo-select-dropdown-close",function(){sa(),K&&K.find("#gallerySpaceComments").length&&K.find("#gallerySpaceComments").focus()}));var c=V.find(".own-galleries"),d=V.find(".shared-galleries");V.on("combo-select-search",function(){0===c.find(".own-galleries-list").children().not(".hzp-comboselect-search-no-match").length?c.hide():c.show(),0===d.find(".shared-galleries-list").children().not(".hzp-comboselect-search-no-match").length?d.hide():d.show()}),V.on("combo-select-search-no-result",function(){c.hide(),d.hide()})},ua=function(a,b,c,d,e,f){var g=a.featured?" ("+_hgt("Featured")+")":"",h=U&&U.id===a.id,i=a.isPrivate?" gallery-private":"",j=$("<li class='hzp-comboselect-option "+i+"' data-value='"+a.id+"' tabindex='0'><span class='hzp-comboselect-option-check hzi-font hzi-Check-Sidenav'></span>"+a.title+g+"</li>");j.data("gallery",a),c||h?b.prepend(j):b.append(j),(h||d)&&(f?(V.comboSelect("setHasTakenAction",{hasTakenAction:!0}),V.comboSelect("addAdditionalSelectedOptions",{value:a.id})):V.comboSelect("addAdditionalSelectedOptions",{value:a.id})),e&&$("#gallerySelectComboBox .select").animate({scrollTop:0},500)};this.updateGalleriesComboBox=function(){var a=$("#gallerySelectComboBox"),b=a.find(".hzp-comboselect-trigger-button"),c=a.find(".hzp-comboselect-select"),d=c.find(".own-galleries"),e=d.find(".own-galleries-list"),f=c.find(".shared-galleries"),g=f.find(".shared-galleries-list"),h=F.recent?F.recent:[],i=F.own?F.own:[],j=F.shared?F.shared:[],k=h.concat(i).concat(j),l={};e.empty(),g.empty(),H&&G[H]?(U=G[H],b.text(U.title)):k.length?(U=k[0],b.text(U.title)):b.text(_hgt("Select an ideabook"));var m={},n={};if($.each(i,function(a,b){m[b.id]=1}),$.each(j,function(a,b){n[b.id]=1}),h.length>0){d.show(),f.show();for(var o=0;o<h.length;o++){var p=h[o],q=!0;U&&(p.id==U.id||l[p.id])||(m[p.id]?(ua(p,e,q),l[p.id]=!0):n[p.id]&&(ua(p,g,q),l[p.id]=!0))}}else d.hide(),f.hide();if(i.length>0){d.show();for(var o=0;o<i.length;o++){var p=i[o],q=U&&p.id===U.id;l[p.id]||(l[p.id]=!0,ua(p,e,q))}}else d.hide();if(j.length>0){f.show();for(var o=0;o<j.length;o++){var p=j[o],q=U&&p.id===U.id;l[p.id]||(l[p.id]=!0,ua(p,g,q))}}else f.hide()};var va=function(a){var b=$("#newAddToIdeabookDialog_7 .addImageWrapper"),c=X?HZ.utils.Links.getUserImageUrl(X,0):null;b.find(".addImageWrapper-inner").remove(),b.append("<div class='addImageWrapper-inner'><div class='collaborate-meta text-left'><div class='one-line text-bold'>"+a+"</div><div class='one-line text-m text-dt-s'>"+_hgt("1 photo")+"</div></div>"+(c?"<div class='user-image'><img src='"+c+"' class='hz-user-image user-small-thumb' /></div>":"")+"</div>")},wa=function(b,c,d){var e={hasOwnerRow:!1,hasSaveWarning:!1,hasPrivacySettings:!1,galleryId:c,isFromCreateFlow:!0},f=$(".collaborate-send"),g=$("#collaborateBody"),h=HZ.galleries.ShareGalleryComponent.getShareGalleryComponent(d,e),i=this;$(".collaborate-form-header").empty().append(_hgt("Get feedback from family, friends, and pros")),va(b),g.empty().append(h),a(7),HZ.utils.Logger.sendEventLog(HZ.shareGallery.events.POST_IDEABOOK_COLLABORATE),f.addClass("disabled"),$.each(T,function(a,b){HZ.events.unsubscribeById(b)}),T=[],T.push(HZ.events.subscribe(i,HZ.galleries.ShareGalleryComponent.publicShareGalleryEvents.ADD_NEW_COLLABORATOR_SUCCESS,function(){f.removeClass("disabled")}),HZ.events.subscribe(i,HZ.galleries.ShareGalleryComponent.publicShareGalleryEvents.SHARE_GALLERY_COMPONENT_IS_FETCHING_DATA,function(){HZ.ui.AjaxThrobber.setInCall(!0)}),HZ.events.subscribe(i,HZ.galleries.ShareGalleryComponent.publicShareGalleryEvents.SHARE_GALLERY_COMPONENT_DATA_FETCH_COMPLETE,function(){HZ.ui.AjaxThrobber.setInCall(!1)}))},xa=function(a,b){$("#collaborateBody");HZ.ui.AjaxThrobber.setInCall(!1),HZ.ajaz.Services.initShareGallery(b,function(c){"true"==c.success&&wa(a,b,c)})},ya=function(a,b){var c=a.title,d=a.id;Q||HZ&&HZ.galleries&&HZ.galleries.ShareGalleryComponent?(xa.call(this,c,d),b&&j(Ba(b))):(HZ.ui.AjaxThrobber.setInCall(!0),HZ.utils.ResourceLoader.requireCollaborateResources(function(){Q=!0,xa.call(this,c,d),b&&j(Ba(b))}.bind(this)))},za=function(){if(Y)return!1;HZ.ui.AjaxThrobber.setInCall(!0),HZ.galleries.ShareGalleryComponent.hasCollaboratorsToAdd()?(Y=!0,HZ.galleries.ShareGalleryComponent.savePermissions(Aa)):(HZ.ui.AjaxThrobber.setInCall(!1),j(_hgt("You have not selected any users to add as collaborators to this ideabook")))},Aa=function(a){HZ.ui.AjaxThrobber.setInCall(!1),Y=!1,"true"==a.success?(i(),HZ.ui.yamdi.Common.alert(_hgt("Invites Sent"),_hgt("Ideabook has been successfully shared."))):j(a.error)};this.switchDialogToProWizard=function(){var a=HZ.professionals.ProSearchWidget.getSearchDialog("save_to_ideabook",!1);HZ.ui.Yamdi.switchDialog(a)};var Ba=function(a){var b=$("<div>");return $.each(a,function(a,c){b.append($("<div class='gallery-error'>"+c+"</div>"))}),b.html()};this.showStatus=function(a){j(a)},this.hideStatus=function(){j("")}};

window.hzmr.push("addToIdeabookDialog:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End addToIdeabookDialog.js  **************/
/************* Start extracting text for saveBasicProfileDialog.js for locale it-IT **************/
(function(){var _hzxt={"Last Name ":"Cognome","First Name ":"Nome","(publicly displayed)":"(mostrato pubblicamente)","Please enter a value for your zip code.":"Inserisci il tuo codice postale","Can you try another first name? We are sorry for the inconvenience.":"Ti invitiamo a provare con un altro nome. Ci scusiamo per l'inconveniente.","Zip Code":"CAP","Last Name":"Cognome","First Name":"Nome","Continue":"Continua"};for(var a in _hzxt){window._hzlang[a]=_hzxt[a];}})();
/*************  End extracting text for saveBasicProfileDialog.js  **************/
/************* Start saveBasicProfileDialog.js for locale it-IT **************/
try {HZ.ns("HZ.dialogs"),HZ.dialogs.saveBasicProfileDialog=function(){HZ.dialogs.saveBasicProfileDialog.superclass.constructor.call(this);var a=this,b=!1,c=null;this.prepare=function(e,f,g,h,i,j){i&&(b=i),j&&(c=j);var k=$("<div id='saveBasicProfileDialog'><div class='row'><div class='col-xs-offset-2 col-xs-8 form-group basic-profile-dialog__form-group'><label for='basic-profile-dialog__first-name'>"+_hgt("First Name ")+"<small>"+_hgt("(publicly displayed)")+"</small></label><input type='text' class='form-control basic-profile-dialog__input' id='basic-profile-dialog__first-name' name='firstName' placeholder='"+_hgt("First Name")+"' value="+(f||"")+"></div></div><div class='row'><div class='col-xs-offset-2 col-xs-8 user-input form-group basic-profile-dialog__form-group'><label for='basic-profile-dialog__last-name'>"+_hgt("Last Name ")+" <small>"+_hgt("(publicly displayed)")+"</small></label><input type='text' class='form-control basic-profile-dialog__input' id='basic-profile-dialog__last-name' name='lastName' placeholder='"+_hgt("Last Name")+"' value="+(g||"")+"></div></div><div class='row'><div class='col-xs-offset-2 col-xs-8 form-group basic-profile-dialog__form-group'><label for='basic-profile-dialog__zip'>"+_hgt("Zip Code")+"</label><input type='text' class='form-control basic-profile-dialog__input' id='basic-profile-dialog__zip' name='zip' value='"+(h||"")+"'></div></div></div>"),l=HZ.ui.InputButtonUtils.createPrimaryInputButton(_hgt("Continue"),"",this.saveBasicProfileInfo),m={title:e,body:k,controls:[l],onViewLoaded:d};a.init(m)},this.saveBasicProfileInfo=function(){var a=$("#basic-profile-dialog__first-name"),d=$("#basic-profile-dialog__last-name"),f=$("#basic-profile-dialog__zip"),g=a.val(),h=d.val(),i=f.val();return g?i?(HZ.ui.AjaxThrobber.setInCall(!0),void HZ.ajaz.Services.saveBasicProfile(g,h,i,function(g){if(HZ.ui.AjaxThrobber.setInCall(!1),"true"==g.success)b?HZ.ui.Yamdi.hideAll():window.location.href=c;else if($.isEmptyObject(g.errors))HZ.ui.yamdi.Common.alert("Error!",_hgt("An unexpected error has occurred. Please refresh this page and continue."));else for(var h in g.errors)"firstName"==h?e(a,g.errors.firstName):"lastName"==h?e(d,g.errors.lastName):"zipCode"==h&&e(f,g.errors.zipCode)})):void e(f,_hgt("Please enter a value for your zip code.")):void e(a,_hgt("Can you try another first name? We are sorry for the inconvenience."))};var d=function(){var a=$("#basic-profile-dialog__first-name");a.on("focus",function(){f(a)}),$zipCode=$("#basic-profile-dialog__zip"),$zipCode.on("focus",function(){f($zipCode)})},e=function(a,b){if(b){f(a);var c=$("<div class='basic-profile-dialog__error-tip'><span class='outer-tip'></span><span class='inner-tip'></span><span class='tooltip-text'>"+b+"</span></div>"),d=a.position(),e=a.height();c.css({left:d.left,top:e+d.top+5}),a.addClass("basic-profile-dialog__input--error"),a.parents(".basic-profile-dialog__form-group").append(c)}else f(a)},f=function(a){a.parents(".basic-profile-dialog__form-group").find(".basic-profile-dialog__error-tip").remove(),a.removeClass("basic-profile-dialog__input--error")}},HZ.extend(HZ.dialogs.saveBasicProfileDialog,HZ.ui.yamdi.Dialog);

window.hzmr.push("saveBasicProfileDialog:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End saveBasicProfileDialog.js  **************/
/************* Start history.js for locale it-IT **************/
try {!function(a){if("function"==typeof define&&define.amd){var b="[history"+(new Date).getTime()+"]",c=requirejs.onError;a.toString=function(){return b},requirejs.onError=function(a){-1===a.message.indexOf(b)&&c.call(requirejs,a)},define([],a)}a()}(function(){function a(){}function b(a,c,d){var e=/(?:(\w+\:))?(?:\/\/(?:[^@]*@)?([^\/:\?#]+)(?::([0-9]+))?)?([^\?#]*)(?:(\?[^#]+)|\?)?(?:(#.*))?/;if(null==a||""===a||c)a=c?a:v.href,A&&!d||(a=a.replace(/^[^#]*/,"")||"#",a=v.protocol.replace(/:.*$|$/,":")+"//"+v.host+L.basepath+a.replace(new RegExp("^#[/]?(?:"+L.type+")?"),""));else{var f=b(),g=r.getElementsByTagName("base")[0];!d&&g&&g.getAttribute("href")&&(g.href=g.href,f=b(g.href,null,!0));var h=f._pathname,i=f._protocol;a=""+a,a=/^(?:\w+\:)?\/\//.test(a)?0===a.indexOf("/")?i+a:a:i+"//"+f._host+(0===a.indexOf("/")?a:0===a.indexOf("?")?h+a:0===a.indexOf("#")?h+f._search+a:h.replace(/[^\/]+$/g,"")+a)}N.href=a;var j=e.exec(N.href),k=j[2]+(j[3]?":"+j[3]:""),l=j[4]||"/",m=j[5]||"",n="#"===j[6]?"":j[6]||"",o=l+m+n,p=l.replace(new RegExp("^"+L.basepath,"i"),L.type)+m;return{_href:j[1]+"//"+k+o,_protocol:j[1],_host:k,_hostname:j[2],_port:j[3]||"",_pathname:l,_search:m,_hash:n,_relative:o,_nohash:p,_special:p+n}}function c(){var a;try{a=q.sessionStorage,a.setItem(M+"t","1"),a.removeItem(M+"t")}catch(b){a={getItem:function(a){var b=r.cookie.split(a+"=");return b.length>1&&b.pop().split(";").shift()||"null"},setItem:function(a,b){var c={};(c[v.href]=x.state)&&(r.cookie=a+"="+u.stringify(c))}}}try{T=u.parse(a.getItem(M))||{}}catch(a){T={}}I(E+"unload",function(){a.setItem(M,u.stringify(T))},!1)}function d(b,c,d,e){var f=0;d||(d={set:a},f=1);var g=!d.set,h=!d.get,i={configurable:!0,set:function(){g=1},get:function(){h=1}};try{C(b,c,i),b[c]=b[c],C(b,c,d)}catch(a){}if(!(g&&h||(b.__defineGetter__&&(b.__defineGetter__(c,i.get),b.__defineSetter__(c,i.set),b[c]=b[c],d.get&&b.__defineGetter__(c,d.get),d.set&&b.__defineSetter__(c,d.set)),g&&h))){if(f)return!1;if(b===q){try{var j=b[c];b[c]=null}catch(a){}if("execScript"in q)q.execScript("Public "+c,"VBScript"),q.execScript("var "+c+";","JavaScript");else try{C(b,c,{value:a})}catch(a){"onpopstate"===c&&(I("popstate",d=function(){J("popstate",d,!1);var a=b.onpopstate;b.onpopstate=null,setTimeout(function(){b.onpopstate=a},1)},!1),Q=0)}b[c]=j}else try{try{var k=t.create(b);C(t.getPrototypeOf(k)===b?k:b,c,d);for(var l in b)"function"==typeof b[l]&&(k[l]=b[l].bind(b));try{e.call(k,k,b)}catch(a){}b=k}catch(a){C(b.constructor.prototype,c,d)}}catch(a){return!1}}return b}function e(a,b,c){return c=c||{},a=a===Z?v:a,c.set=c.set||function(c){a[b]=c},c.get=c.get||function(){return a[b]},c}function f(a,b,c){a in U?U[a].push(b):arguments.length>3?I(a,b,c,arguments[3]):I(a,b,c)}function g(a,b,c){var d=U[a];if(d){for(var e=d.length;e--;)if(d[e]===b){d.splice(e,1);break}}else J(a,b,c)}function h(b,c){var e=(""+("string"==typeof b?b:b.type)).replace(/^on/,""),f=U[e];if(f){if(c="string"==typeof b?c:b,null==c.target)for(var g=["target","currentTarget","srcElement","type"];b=g.pop();)c=d(c,b,{get:"type"===b?function(){return e}:function(){return q}});Q&&(("popstate"===e?q.onpopstate:q.onhashchange)||a).call(q,c);for(var h=0,i=f.length;h<i;h++)f[h].call(q,c);return!0}return K(b,c)}function i(){var a=r.createEvent?r.createEvent("Event"):r.createEventObject();a.initEvent?a.initEvent("popstate",!1,!1):a.type="popstate",a.state=x.state,h(a)}function j(){R&&(R=!1,i())}function k(a,c,d,e){if(A)O=v.href;else{0===S&&(S=2);var f=b(c,2===S&&-1!==(""+c).indexOf("#"));f._relative!==b()._relative&&(O=e,d?v.replace("#"+f._special):v.hash=f._special)}!B&&a&&(T[v.href]=a),R=!1}function l(a){var c=O;if(O=v.href,c){P!==v.href&&i(),a=a||q.event;var d=b(c,!0),e=b();a.oldURL||(a.oldURL=d._href,a.newURL=e._href),d._hash!==e._hash&&h(a)}}function m(a){setTimeout(function(){I("popstate",function(a){P=v.href,B||(a=d(a,"state",{get:function(){return x.state}})),h(a)},!1)},0),!A&&!0!==a&&"location"in x&&(p(D.hash),j())}function n(a){for(;a;){if("A"===a.nodeName)return a;a=a.parentNode}}function o(a){var c=a||q.event,d=n(c.target||c.srcElement),e="defaultPrevented"in c?c.defaultPrevented:!1===c.returnValue;if(d&&"A"===d.nodeName&&!e){var f=b(),g=b(d.getAttribute("href",2));f._href.split("#").shift()===g._href.split("#").shift()&&g._hash&&(f._hash!==g._hash&&(D.hash=g._hash),p(g._hash),c.preventDefault?c.preventDefault():c.returnValue=!1)}}function p(a){var b=r.getElementById(a=(a||"").replace(/^#/,""));if(b&&b.id===a&&"A"===b.nodeName){var c=b.getBoundingClientRect();q.scrollTo(s.scrollLeft||0,c.top+(s.scrollTop||0)-(s.clientTop||0))}}var q=("object"==typeof window?window:this)||{};if(!q.history||"emulate"in q.history)return q.history;var r=q.document,s=r.documentElement,t=q.Object,u=q.JSON,v=q.location,w=q.history,x=w,y=w.pushState,z=w.replaceState,A=!!y,B="state"in w,C=t.defineProperty,D=d({},"t")?{}:r.createElement("a"),E="",F=q.addEventListener?"addEventListener":(E="on")&&"attachEvent",G=q.removeEventListener?"removeEventListener":"detachEvent",H=q.dispatchEvent?"dispatchEvent":"fireEvent",I=q[F],J=q[G],K=q[H],L={basepath:"/",redirect:0,type:"/",init:0},M="__historyAPI__",N=r.createElement("a"),O=v.href,P="",Q=1,R=!1,S=0,T={},U={},V=r.title,W={onhashchange:null,onpopstate:null},X=function(a,b){var c=q.history!==w;c&&(q.history=w),a.apply(w,b),c&&(q.history=x)},Y={setup:function(a,b,c){L.basepath=(""+(null==a?L.basepath:a)).replace(/(?:^|\/)[^\/]*$/,"/"),L.type=null==b?L.type:b,L.redirect=null==c?L.redirect:!!c},redirect:function(a,c){if(x.setup(c,a),c=L.basepath,q.top==q.self){var d=b(null,!1,!0)._relative,e=v.pathname+v.search;A?(e=e.replace(/([^\/])$/,"$1/"),d!=c&&new RegExp("^"+c+"$","i").test(e)&&v.replace(d)):e!=c&&(e=e.replace(/([^\/])\?/,"$1/?"),new RegExp("^"+c,"i").test(e)&&v.replace(c+"#"+e.replace(new RegExp("^"+c,"i"),L.type)+v.hash))}},pushState:function(a,b,c){var d=r.title;null!=V&&(r.title=V),y&&X(y,arguments),k(a,c),r.title=d,V=b},replaceState:function(a,b,c){var d=r.title;null!=V&&(r.title=V),delete T[v.href],z&&X(z,arguments),k(a,c,!0),r.title=d,V=b},location:{set:function(a){0===S&&(S=1),q.location=a},get:function(){return 0===S&&(S=1),A?v:D}},state:{get:function(){return T[v.href]||null}}},Z={assign:function(a){0===(""+a).indexOf("#")?k(null,a):v.assign(a)},reload:function(){v.reload()},replace:function(a){0===(""+a).indexOf("#")?k(null,a,!0):v.replace(a)},toString:function(){return this.href},href:{get:function(){return b()._href}},protocol:null,host:null,hostname:null,port:null,pathname:{get:function(){return b()._pathname}},search:{get:function(){return b()._search}},hash:{set:function(a){k(null,(""+a).replace(/^(#|)/,"#"),!1,O)},get:function(){return b()._hash}}};return function(){var a=r.getElementsByTagName("script"),f=(a[a.length-1]||{}).src||"";(-1!==f.indexOf("?")?f.split("?").pop():"").replace(/(\w+)(?:=([^&]*))?/g,function(a,b,c){L[b]=(c||"").replace(/^(0|false)$/,"")}),I(E+"hashchange",l,!1);var g=[Z,D,W,q,Y,x];B&&delete Y.state;for(var h=0;h<g.length;h+=2)for(var i in g[h])if(g[h].hasOwnProperty(i))if("function"==typeof g[h][i])g[h+1][i]=g[h][i];else{var j=e(g[h],i,g[h][i]);if(!d(g[h+1],i,j,function(a,b){b===x&&(q.history=x=g[h+1]=a)}))return J(E+"hashchange",l,!1),!1;g[h+1]===q&&(U[i]=U[i.substr(2)]=[])}return x.setup(),L.redirect&&x.redirect(),L.init&&(S=1),!B&&u&&c(),A||r[F](E+"click",o,!1),"complete"===r.readyState?m(!0):(A||b()._relative===L.basepath||(R=!0),I(E+"load",m,!1)),!0}()?(x.emulate=!A,q[F]=f,q[G]=g,q[H]=h,x):void 0});

window.hzmr.push("history:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End history.js  **************/
/************* Start jquery.easing.1.3.js for locale it-IT **************/
try {jQuery.easing.jswing=jQuery.easing.swing,jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(a,b,c,d,e){return jQuery.easing[jQuery.easing.def](a,b,c,d,e)},easeInQuad:function(a,b,c,d,e){return d*(b/=e)*b+c},easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c},easeInOutQuad:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b+c:-d/2*(--b*(b-2)-1)+c},easeInCubic:function(a,b,c,d,e){return d*(b/=e)*b*b+c},easeOutCubic:function(a,b,c,d,e){return d*((b=b/e-1)*b*b+1)+c},easeInOutCubic:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b*b+c:d/2*((b-=2)*b*b+2)+c},easeInQuart:function(a,b,c,d,e){return d*(b/=e)*b*b*b+c},easeOutQuart:function(a,b,c,d,e){return-d*((b=b/e-1)*b*b*b-1)+c},easeInOutQuart:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b*b*b+c:-d/2*((b-=2)*b*b*b-2)+c},easeInQuint:function(a,b,c,d,e){return d*(b/=e)*b*b*b*b+c},easeOutQuint:function(a,b,c,d,e){return d*((b=b/e-1)*b*b*b*b+1)+c},easeInOutQuint:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b*b*b*b+c:d/2*((b-=2)*b*b*b*b+2)+c},easeInSine:function(a,b,c,d,e){return-d*Math.cos(b/e*(Math.PI/2))+d+c},easeOutSine:function(a,b,c,d,e){return d*Math.sin(b/e*(Math.PI/2))+c},easeInOutSine:function(a,b,c,d,e){return-d/2*(Math.cos(Math.PI*b/e)-1)+c},easeInExpo:function(a,b,c,d,e){return 0==b?c:d*Math.pow(2,10*(b/e-1))+c},easeOutExpo:function(a,b,c,d,e){return b==e?c+d:d*(1-Math.pow(2,-10*b/e))+c},easeInOutExpo:function(a,b,c,d,e){return 0==b?c:b==e?c+d:(b/=e/2)<1?d/2*Math.pow(2,10*(b-1))+c:d/2*(2-Math.pow(2,-10*--b))+c},easeInCirc:function(a,b,c,d,e){return-d*(Math.sqrt(1-(b/=e)*b)-1)+c},easeOutCirc:function(a,b,c,d,e){return d*Math.sqrt(1-(b=b/e-1)*b)+c},easeInOutCirc:function(a,b,c,d,e){return(b/=e/2)<1?-d/2*(Math.sqrt(1-b*b)-1)+c:d/2*(Math.sqrt(1-(b-=2)*b)+1)+c},easeInElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(0==b)return c;if(1==(b/=e))return c+d;if(g||(g=.3*e),h<Math.abs(d)){h=d;var f=g/4}else var f=g/(2*Math.PI)*Math.asin(d/h);return-h*Math.pow(2,10*(b-=1))*Math.sin((b*e-f)*(2*Math.PI)/g)+c},easeOutElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(0==b)return c;if(1==(b/=e))return c+d;if(g||(g=.3*e),h<Math.abs(d)){h=d;var f=g/4}else var f=g/(2*Math.PI)*Math.asin(d/h);return h*Math.pow(2,-10*b)*Math.sin((b*e-f)*(2*Math.PI)/g)+d+c},easeInOutElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(0==b)return c;if(2==(b/=e/2))return c+d;if(g||(g=e*(.3*1.5)),h<Math.abs(d)){h=d;var f=g/4}else var f=g/(2*Math.PI)*Math.asin(d/h);return b<1?h*Math.pow(2,10*(b-=1))*Math.sin((b*e-f)*(2*Math.PI)/g)*-.5+c:h*Math.pow(2,-10*(b-=1))*Math.sin((b*e-f)*(2*Math.PI)/g)*.5+d+c},easeInBack:function(a,b,c,d,e,f){return void 0==f&&(f=1.70158),d*(b/=e)*b*((f+1)*b-f)+c},easeOutBack:function(a,b,c,d,e,f){return void 0==f&&(f=1.70158),d*((b=b/e-1)*b*((f+1)*b+f)+1)+c},easeInOutBack:function(a,b,c,d,e,f){return void 0==f&&(f=1.70158),(b/=e/2)<1?d/2*(b*b*((1+(f*=1.525))*b-f))+c:d/2*((b-=2)*b*((1+(f*=1.525))*b+f)+2)+c},easeInBounce:function(a,b,c,d,e){return d-jQuery.easing.easeOutBounce(a,e-b,0,d,e)+c},easeOutBounce:function(a,b,c,d,e){return(b/=e)<1/2.75?d*(7.5625*b*b)+c:b<2/2.75?d*(7.5625*(b-=1.5/2.75)*b+.75)+c:b<2.5/2.75?d*(7.5625*(b-=2.25/2.75)*b+.9375)+c:d*(7.5625*(b-=2.625/2.75)*b+.984375)+c},easeInOutBounce:function(a,b,c,d,e){return b<e/2?.5*jQuery.easing.easeInBounce(a,2*b,0,d,e)+c:.5*jQuery.easing.easeOutBounce(a,2*b-e,0,d,e)+.5*d+c}});

window.hzmr.push("jquery.easing.1.3:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End jquery.easing.1.3.js  **************/
/************* Start jquery.visible.js for locale it-IT **************/
try {!function(a){var b=a(window);a.fn.visible=function(a,c,d){if(!(this.length<1)){var e=this.length>1?this.eq(0):this,f=e.get(0),g=b.width(),h=b.height(),d=d||"both",i=!0!==c||f.offsetWidth*f.offsetHeight;if("function"==typeof f.getBoundingClientRect){var j=f.getBoundingClientRect(),k=j.top>=0&&j.top<h,l=j.bottom>0&&j.bottom<=h,m=j.left>=0&&j.left<g,n=j.right>0&&j.right<=g,o=a?k||l:k&&l,p=a?m||n:m&&n;if("both"===d)return i&&o&&p;if("vertical"===d)return i&&o;if("horizontal"===d)return i&&p}else{var q=b.scrollTop(),r=q+h,s=b.scrollLeft(),t=s+g,u=e.offset(),v=u.top,w=v+e.height(),x=u.left,y=x+e.width(),z=!0===a?w:v,A=!0===a?v:w,B=!0===a?y:x,C=!0===a?x:y;if("both"===d)return!!i&&A<=r&&z>=q&&C<=t&&B>=s;if("vertical"===d)return!!i&&A<=r&&z>=q;if("horizontal"===d)return!!i&&C<=t&&B>=s}}}}(jQuery);

window.hzmr.push("jquery.visible:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End jquery.visible.js  **************/
/************* Start md5.js for locale it-IT **************/
try {function md5cycle(a,b){var c=a[0],d=a[1],e=a[2],f=a[3];c=ff(c,d,e,f,b[0],7,-680876936),f=ff(f,c,d,e,b[1],12,-389564586),e=ff(e,f,c,d,b[2],17,606105819),d=ff(d,e,f,c,b[3],22,-1044525330),c=ff(c,d,e,f,b[4],7,-176418897),f=ff(f,c,d,e,b[5],12,1200080426),e=ff(e,f,c,d,b[6],17,-1473231341),d=ff(d,e,f,c,b[7],22,-45705983),c=ff(c,d,e,f,b[8],7,1770035416),f=ff(f,c,d,e,b[9],12,-1958414417),e=ff(e,f,c,d,b[10],17,-42063),d=ff(d,e,f,c,b[11],22,-1990404162),c=ff(c,d,e,f,b[12],7,1804603682),f=ff(f,c,d,e,b[13],12,-40341101),e=ff(e,f,c,d,b[14],17,-1502002290),d=ff(d,e,f,c,b[15],22,1236535329),c=gg(c,d,e,f,b[1],5,-165796510),f=gg(f,c,d,e,b[6],9,-1069501632),e=gg(e,f,c,d,b[11],14,643717713),d=gg(d,e,f,c,b[0],20,-373897302),c=gg(c,d,e,f,b[5],5,-701558691),f=gg(f,c,d,e,b[10],9,38016083),e=gg(e,f,c,d,b[15],14,-660478335),d=gg(d,e,f,c,b[4],20,-405537848),c=gg(c,d,e,f,b[9],5,568446438),f=gg(f,c,d,e,b[14],9,-1019803690),e=gg(e,f,c,d,b[3],14,-187363961),d=gg(d,e,f,c,b[8],20,1163531501),c=gg(c,d,e,f,b[13],5,-1444681467),f=gg(f,c,d,e,b[2],9,-51403784),e=gg(e,f,c,d,b[7],14,1735328473),d=gg(d,e,f,c,b[12],20,-1926607734),c=hh(c,d,e,f,b[5],4,-378558),f=hh(f,c,d,e,b[8],11,-2022574463),e=hh(e,f,c,d,b[11],16,1839030562),d=hh(d,e,f,c,b[14],23,-35309556),c=hh(c,d,e,f,b[1],4,-1530992060),f=hh(f,c,d,e,b[4],11,1272893353),e=hh(e,f,c,d,b[7],16,-155497632),d=hh(d,e,f,c,b[10],23,-1094730640),c=hh(c,d,e,f,b[13],4,681279174),f=hh(f,c,d,e,b[0],11,-358537222),e=hh(e,f,c,d,b[3],16,-722521979),d=hh(d,e,f,c,b[6],23,76029189),c=hh(c,d,e,f,b[9],4,-640364487),f=hh(f,c,d,e,b[12],11,-421815835),e=hh(e,f,c,d,b[15],16,530742520),d=hh(d,e,f,c,b[2],23,-995338651),c=ii(c,d,e,f,b[0],6,-198630844),f=ii(f,c,d,e,b[7],10,1126891415),e=ii(e,f,c,d,b[14],15,-1416354905),d=ii(d,e,f,c,b[5],21,-57434055),c=ii(c,d,e,f,b[12],6,1700485571),f=ii(f,c,d,e,b[3],10,-1894986606),e=ii(e,f,c,d,b[10],15,-1051523),d=ii(d,e,f,c,b[1],21,-2054922799),c=ii(c,d,e,f,b[8],6,1873313359),f=ii(f,c,d,e,b[15],10,-30611744),e=ii(e,f,c,d,b[6],15,-1560198380),d=ii(d,e,f,c,b[13],21,1309151649),c=ii(c,d,e,f,b[4],6,-145523070),f=ii(f,c,d,e,b[11],10,-1120210379),e=ii(e,f,c,d,b[2],15,718787259),d=ii(d,e,f,c,b[9],21,-343485551),a[0]=add32(c,a[0]),a[1]=add32(d,a[1]),a[2]=add32(e,a[2]),a[3]=add32(f,a[3])}function cmn(a,b,c,d,e,f){return b=add32(add32(b,a),add32(d,f)),add32(b<<e|b>>>32-e,c)}function ff(a,b,c,d,e,f,g){return cmn(b&c|~b&d,a,b,e,f,g)}function gg(a,b,c,d,e,f,g){return cmn(b&d|c&~d,a,b,e,f,g)}function hh(a,b,c,d,e,f,g){return cmn(b^c^d,a,b,e,f,g)}function ii(a,b,c,d,e,f,g){return cmn(c^(b|~d),a,b,e,f,g)}function md51(a){txt="";var b,c=a.length,d=[1732584193,-271733879,-1732584194,271733878];for(b=64;b<=a.length;b+=64)md5cycle(d,md5blk(a.substring(b-64,b)));a=a.substring(b-64);var e=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(b=0;b<a.length;b++)e[b>>2]|=a.charCodeAt(b)<<(b%4<<3);if(e[b>>2]|=128<<(b%4<<3),b>55)for(md5cycle(d,e),b=0;b<16;b++)e[b]=0;return e[14]=8*c,md5cycle(d,e),d}function md5blk(a){var b,c=[];for(b=0;b<64;b+=4)c[b>>2]=a.charCodeAt(b)+(a.charCodeAt(b+1)<<8)+(a.charCodeAt(b+2)<<16)+(a.charCodeAt(b+3)<<24);return c}function rhex(a){for(var b="",c=0;c<4;c++)b+=hex_chr[a>>8*c+4&15]+hex_chr[a>>8*c&15];return b}function hex(a){for(var b=0;b<a.length;b++)a[b]=rhex(a[b]);return a.join("")}function md5(a){return hex(md51(a))}function add32(a,b){return a+b&4294967295}function add32(a,b){var c=(65535&a)+(65535&b);return(a>>16)+(b>>16)+(c>>16)<<16|65535&c}var hex_chr="0123456789abcdef".split("");md5("hello");

window.hzmr.push("md5:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End md5.js  **************/
/************* Start extracting text for lightboxStaticConfig.js for locale it-IT **************/
(function(){var _hzxt={"ColorPicker":"Strumento di selezione dei colori","Questions, Comments and Reviews":"Domande, commenti e recensioni","More Info":"Maggiori informazioni","Overview":"Panoramica","Ideabooks":"Ideabook","Products":"Prodotti"};for(var a in _hzxt){window._hzlang[a]=_hzxt[a];}})();
/*************  End extracting text for lightboxStaticConfig.js  **************/
/************* Start lightboxStaticConfig.js for locale it-IT **************/
try {HZ.ns("HZ.lb.Config"),HZ.lb.Config.contentGroupIds={OVERVIEW:"overview",PRODUCTS:"products",INFO:"info",DISCUSSION:"discussion",COLOR_PICKER:"color-picker",IDEABOOKS:"ideabooks"},HZ.lb.Config.contentGroups=[{id:HZ.lb.Config.contentGroupIds.OVERVIEW,title:_hgt("Overview"),iconClass:"hzi-Houzz-Photo"},{id:HZ.lb.Config.contentGroupIds.PRODUCTS,title:_hgt("Products"),iconClass:"hzi-Tag"},{id:HZ.lb.Config.contentGroupIds.INFO,title:_hgt("More Info"),iconClass:"hzi-info-icon-solid"},{id:HZ.lb.Config.contentGroupIds.DISCUSSION,title:_hgt("Questions, Comments and Reviews"),iconClass:"hzi-Comments-Advice"},{id:HZ.lb.Config.contentGroupIds.COLOR_PICKER,title:_hgt("ColorPicker"),iconClass:"hzi-paint-dropper"}],HZ.lb.Config.spaceContentGroupIds=[HZ.lb.Config.contentGroupIds.OVERVIEW,HZ.lb.Config.contentGroupIds.PRODUCTS,HZ.lb.Config.contentGroupIds.DISCUSSION,HZ.lb.Config.contentGroupIds.COLOR_PICKER],HZ.lb.Config.productContentGroupIds=[HZ.lb.Config.contentGroupIds.PRODUCTS,HZ.lb.Config.contentGroupIds.INFO,HZ.lb.Config.contentGroupIds.DISCUSSION];

window.hzmr.push("lightboxStaticConfig:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End lightboxStaticConfig.js  **************/
/************* Start lightboxContext.js for locale it-IT **************/
try {HZ.lb.Context=function(a,b,c,d,e,f,g,h){var i,j=a,k=b,l=c,m=f,n=d,o=g,p=h,q=e,r={},s={};for(var t in n)r[n[t]]=!0;var u=!1;this.getName=function(){return j},this.getType=function(){return k},this.getDescriptor=function(){return l},this.getTotalSpacesCount=function(){return q},this.containsSpaceId=function(a){return r[a]},this.getCurrentSpaceId=function(){return n[m]},this.setCurrentSpaceToLast=function(){n.length&&this.setCurrentSpaceId(n[n.length-1])},this.setCurrentSpaceId=function(a){for(var b=0;b<n.length;b++)if(n[b]==a)return m=b,!0;return!1},this.getNextSpaceIds=function(a){var b,c,d,e=[];a=a||1,d=a>0?1:-1,b=m+d,c=b+a;for(var f=b;f!=c;f+=d)f<n.length&&f>=0&&e.push(n[f]);return e},this.getCursorPosition=function(){return{cursor:m,spacesCount:n.length}},this.hasNext=function(){return!u&&m>=n.length-5&&-1!=this.getNextPosition()&&this.getNextPhotoIds(),m<n.length-1},this.hasPrevious=function(){return m>0},this.next=function(){return this.hasNext()?n[++m]:null},this.previous=function(){return this.hasPrevious()?n[--m]:null},this.getNextPosition=function(){return o},this.getBasePosition=function(){return p},this.getNextPhotoIds=function(){u=!0,HZ.ajaz.Services.getNextSpaces(this.getType(),l,this.getNextPosition(),$.proxy(this.handleData,this))},this.registerOwner=function(a){i=a},this.unregisterOwner=function(){i=null},this.removeCurrentSpace=function(){var a,b=n.splice(m,1);b&&b.length&&(delete r[b[0]],o>-1&&o--,q--),this.hasNext()?a=n[m+1]:this.hasPrevious()&&(a=n[m-1]),a&&this.setCurrentSpaceId(a)},this.removeSpaceBySpaceId=function(a){this.setCurrentSpaceId(a)&&this.removeCurrentSpace()},this.stashAndReplaceCurrentSpaceId=function(a){var b=this.getCurrentSpaceId();this.containsSpaceId(b)&&(s[m]=b),n[m]=a},this.unstashSpaces=function(){for(var a in s)n[a]=s[a];s={}},this.handleData=function(a){if(HZ.lb.Utils.validateData(a),a.results.context){n=n.concat(a.results.context.spaceIds);for(var b=0;b<a.results.context.spaceIds.length;b++)r[a.results.context.spaceIds[b]]=!0;if(o=a.results.context.nextpos,HZ.data.Spaces.addAll(a.results.spaces),HZ.data.Images.addAll(a.results.images),HZ.data.Users.addAll(a.results.users),HZ.data.ProductsInfo.addAll(a.results.productInfo),a.results.photoAds)for(var c in a.results.photoAds)HZ.data.PhotoAds.put(c,a.results.photoAds[c]);if(a.results.paidProAds)for(var c in a.results.paidProAds)HZ.data.PaidProAds.put(c,a.results.paidProAds[c]);if(a.results.proListAd)for(var c in a.results.proListAd)HZ.data.ProListAds.put(c,a.results.proListAd[c]);HZ.data.HouzzClkTracking.addAll(a.results.houzzClkTracking),HZ.data.HouzzImpTracking.addAll(a.results.houzzImpTracking),u=!1,i&&i.handleContextChanged()}}};

window.hzmr.push("lightboxContext:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End lightboxContext.js  **************/
/************* Start extracting text for lightboxUtils.js for locale it-IT **************/
(function(){var _hzxt={"Browse session expired. Please refresh the page.":"Sessione di navigazione scaduta. Aggiorna la pagina."};for(var a in _hzxt){window._hzlang[a]=_hzxt[a];}})();
/*************  End extracting text for lightboxUtils.js  **************/
/************* Start lightboxUtils.js for locale it-IT **************/
try {HZ.lb.Utils={connect:function(){this.firstSpaceId=-1;var a=function(a,b){return $.grep(a,function(a){return-1!==$.inArray(a,b)})},b=function(a){var b=[];b.push(a);var c=$(a).parents().toArray();return b=b.concat(c)},c=function(a,b){var c;c=HZ.lb.Config.CONTEXT_NAME_ARBITRARY_SPACES;var d=a.length,e=new HZ.lb.Context(b,c,{},a,d,1,-1);return d>0&&e.setCurrentSpaceId(a[0]),HZ.data.Contexts.put(b,e),e},d=0,e=$("#lb-parent");if(0==e.length){var f=$("body").find("[lb-context]").toArray();f.length&&(e=$(function(c){if(!c||!c.length)return null;if(1===c.length)return c[0];for(var d,e=c[0],f=b(e),g=1;g<c.length;g++)d=b(c[g]),f=a(f,d);return f[0]}(f)))}if(e.length){if(e.data("lb-connected"))return;e.on("click","[lb-edit], [lb-edit-tag], [lb-view], [lb-sid]",function(a){if(!(a.target&&"function"==typeof a.target.getAttribute&&a.target.getAttribute("lb-bypass")||lightbox.isShowing())){var b=$(a.target),e=b.closest("[lb-sid]").attr("lb-sid"),f=b.closest("[lb-context]"),g=f.attr("lb-context"),h=null,i=HZ.data.Contexts.get(g);if(""==g){var j=f.find("[lb-sid]").map(function(){return $(this).attr("lb-sid")});g="dyn_"+d++,i=c(j,g),f.attr("lb-context",g)}if(b.closest("[lb-edit-tag]").length?h="edit-tag":b.closest("[lb-edit]").length?h="edit":b.closest("[lb-view]").length&&(h="view"),HZ.lb.Utils.firstSpaceId=e,e&&HZ.data.Spaces.get(e)&&i.containsSpaceId(e)&&h){if(a.ctrlKey||a.metaKey)return!0;if(a.preventDefault(),"edit"===h)lightbox.showSpaceEditor(e,g);else if("edit-tag"===h){var k=b.data("id");void 0===k&&(b=b.parent(),k=b.data("id")),lightbox.showSpaceTagEditor(e,g,k)}else lightbox.show(e,g);return!1}}}),e.data("lb-connected",!0)}},validateData:function(a){a&&"false"==a.success&&a.error==HZ.ajaz.Services.ERROR_VERSION_MISMATCH&&alert(_hgt("Browse session expired. Please refresh the page."))},trackedUrls:{},currentSpaceId:null,registerTrackingUrl:function(a,b){var c=!0,d=md5(a);b!=this.currentSpaceId&&(this.trackedUrls[this.currentSpaceId]={},this.currentSpaceId=b),this.trackedUrls[b]||(this.trackedUrls[b]={}),this.trackedUrls[b][d]?c=!1:this.trackedUrls[b][d]=a,c&&((new Image).src=a)},lightboxEditorLoaded:!1,notifyLightboxOnLoad:!1,enableEditTag:!1,loadLightboxEditor:function(a,b){this.lightboxEditorLoaded||this.notifyLightboxOnLoad||(a&&(this.notifyLightboxOnLoad=!0),b&&(this.enableEditTag=!0),HZ.utils.ResourceLoader.requireLightbox2EditResources($.proxy(this.setLightboxEditorLoaded,this)))},setLightboxEditorLoaded:function(){this.lightboxEditorLoaded=!0,this.notifyLightboxOnLoad&&(lightbox.setEditMode(!0),this.enableEditTag&&lightbox.setEditTagMode(this.enableEditTag),lightbox.refresh(),lightbox.handleResize())},videoResourcesLoading:!1,videoResourcesLoaded:!1,videoResourcesLoadedCallbacks:[],loadVideoResources:function(a){var b=-1!==this.videoResourcesLoadedCallbacks.indexOf(a);"function"!=typeof a||b||this.videoResourcesLoadedCallbacks.push(a),this.videoResourcesLoaded||this.videoResourcesLoading||(this.videoResourcesLoading=!0,HZ.utils.ResourceLoader.requireLightbox2VideoResources(this.handleVideoResourcesLoaded.bind(this)))},handleVideoResourcesLoaded:function(){this.videoResourcesLoading=!1,this.videoResourcesLoaded=!0,this.videoResourcesLoadedCallbacks.length>0&&this.videoResourcesLoadedCallbacks.forEach(function(a){a()})},isLoadingVideoResources:function(){return this.videoResourcesLoading},colorPickerResourcesLoading:!1,colorPickerResourcesLoaded:!1,colorPickerResourcesLoadedCallback:$.noop,loadColorPickerResources:function(a){a&&(this.colorPickerResourcesLoadedCallback=a),this.colorPickerResourcesLoaded||this.colorPickerResourcesLoading||(this.colorPickerResourcesLoading=!0,HZ.utils.ResourceLoader.requireLightboxColorPickerResources(this.handleColorPickerResourcesLoaded.bind(this)))},handleColorPickerResourcesLoaded:function(){this.colorPickerResourcesLoading=!1,this.colorPickerResourcesLoaded=!0,this.colorPickerResourcesLoadedCallback&&this.colorPickerResourcesLoadedCallback()},feedCommentsResourcesLoading:!1,feedCommentsResourcesLoaded:!1,feedCommentsResourcesLoadedCallback:$.noop,loadFeedCommentsResources:function(a){a&&(this.feedCommentsResourcesLoadedCallback=a),this.feedCommentsResourcesLoaded||this.feedCommentsResourcesLoading||(this.feedCommentsResourcesLoading=!0,HZ.utils.ResourceLoader.requireLightboxFeedCommentsResources(this.handleFeedCommentsResourcesLoaded.bind(this)))},handleFeedCommentsResourcesLoaded:function(){this.feedCommentsResourcesLoading=!1,this.feedCommentsResourcesLoaded=!0,this.feedCommentsResourcesLoadedCallback&&this.feedCommentsResourcesLoadedCallback()},returnPolicyResourcesLoading:!1,returnPolicyResourcesLoaded:!1,loadReturnPolicyResources:function(){this.returnPolicyResourcesLoaded||this.returnPolicyResourcesLoading||(this.returnPolicyResourcesLoading=!0,HZ.utils.ResourceLoader.requireReturnPolicyResources(this.handleReturnPolicyResourcesLoaded.bind(this)))},handleReturnPolicyResourcesLoaded:function(){this.returnPolicyResourcesLoaded=!0,this.returnPolicyResourcesLoading=!1},warrantyResourcesLoading:!1,warrantyResourcesLoaded:!1,loadWarrantyResources:function(){this.warrantyResourcesLoaded||this.warrantyResourcesLoading||(this.warrantyResourcesLoading=!0,HZ.utils.ResourceLoader.requireWarrantyResources(this.handleWarrantyResourcesLoaded.bind(this)))},handleWarrantyResourcesLoaded:function(){this.warrantyResourcesLoaded=!0,this.warrantyResourcesLoading=!1},loadImage:function(a,b){$("<img>").one("load",b).attr("src",a).each(function(){this.complete&&$(this).trigger("load")})},calculateThumbWidth:function(a,b,c){return Math.max(30,Math.ceil(a/b-c+c/b))}};

window.hzmr.push("lightboxUtils:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End lightboxUtils.js  **************/
/************* Start extracting text for lightbox2.2.js for locale it-IT **************/
(function(){var _hzxt={"Video is loading\u2026":"Caricamento video in corso...","Video under moderation":"Video in fase di revisione","Click here to expand":"Clicca qui per espandere","ColorPicker":"Strumento di selezione dei colori","Questions, Comments and Reviews":"Domande, commenti e recensioni","Questions Comments and Reviews":"Domande, commenti e recensioni","Before Photo":"Foto del prima","Fullscreen":"Schermo intero","More Info":"Maggiori informazioni","Exit Fullscreen":"Esci da modalit\u00e0 schermo intero","You have unsaved changes. Are you sure?":"Sono presenti modifiche non salvate. Confermi?","Browse session expired. Please refresh the page.":"Sessione di navigazione scaduta. Aggiorna la pagina.","Overview":"Panoramica","Ideabooks":"Ideabook","Products":"Prodotti"};for(var a in _hzxt){window._hzlang[a]=_hzxt[a];}})();
/*************  End extracting text for lightbox2.2.js  **************/
/************* Start lightbox2.2.js for locale it-IT **************/
try {HZ.ns("HZ.lb.Config"),HZ.ns("HZ.lb.plugins"),HZ.lb.Notifier=function(){var a=[];this.addListener=function(b){a.push(b)},this.removeListener=function(b){for(var c=0,d=a.length;c<d;c++)if(a[c]==b)return a.splice(c,1)},this.notifyListeners=function(b){for(var c=0,d=a.length;c<d;c++)b.apply(a[c])}},HZ.lb.ActionBar={ACTION_BAR_LEFT:"Left",ACTION_BAR_CENTER:"Center",ACTION_BAR_RIGHT:"Right"},HZ.lb.Lightbox=function(){this.SPACE_TYPE="space",this.PRODUCT_TYPE="product",this.VIDEO_TYPE="video";var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,_={x:0,y:0,w:0,h:0,src:""},aa={x:0,y:0,w:640,h:640},ba=0,ca=null,da=null,ea=null,fa=!0,ga=!1,ha=[];this.showVisualMatchTag=!0,this.showProPerception=!0,this.init=function(){q||(c=new HZ.lb.Notifier,m=$(window),n=$(document),o=$(document.body),q=$('<div id="lbRoot" scopeId="lightbox" style="display:none;">').prependTo(o).addClass("hidden").append('<div id="lbBg"></div><div id="lbMain" class="space"><div id="lbImageContainer"><div id="lbImage"><div id="lbActions" class="trackMe row click-through"><div id="lbActionsLeft" class="col-xs-3 click-through"></div><div id="lbActionsCenter" class="col-xs-6 text-center text-nowrap click-through"></div><div id="lbActionsRight" class="col-xs-3 text-right text-nowrap click-through"></div></div></div><div id="lbImageControls"></div><div id="lbImageLayer"></div><div id="lbNavDiv" class="click-through"><div id="lbBreadcrumbs" class="trackMe"></div><div id="lbLeft" class="lbNavigation nav-arrow trackMe" compid="navLeft"><div class="hzi-font hzi-Left-Arrow"></div></div><div id="lbRight" class="lbNavigation nav-arrow trackMe bounce" compid="navRight"><div class="hzi-font hzi-Right-Arrow"></div></div></div></div><div id="lbInfo"><div class="content-mask"><div class="content-scroll"><div class="content-body"><div class="content-footer"></div></div></div><div class="content-scroll-bar"><div class="scroll-bar"></div></div></div><div id="lbInfoTabs"></div><div class="content-fixed"></div></div><div id="lbMainControls" class="trackMe"><div id="lbClose"><a class="lbCloseButton" href="javascript:;" compid="lbCloseButton"><i class="icon icon-font icon-close"></i></a></div></div><div id="lbOverlay"></div></div>'),q.toggleClass("view-space",this.isViewSpace()),r=$("#lbBg")[0],z=$("#lbImageContainer"),A=$("#lbImage"),B=A.get(0),C=$("#lbImageLayer")[0],E=$("#lbBreadcrumbs")[0],D=$("#lbImageControls")[0],s=$("#lbMain"),t=s[0],u=$("#lbInfo"),v=u[0],F=u.find(".content-mask"),G=u.find(".content-scroll"),H=u.find(".content-body"),I=u.find(".content-footer"),K=u.find(".content-scroll-bar"),L=u.find(".scroll-bar"),J=u.find(".content-fixed"),w=$("#lbInfoTabs"),x=$("#lbMainControls"),y=$("#lbClose"),M=$("#lbOverlay"),P=G.get(0),$(r).click($.proxy(function(){this.isEditMode()||this.hide()},this)),b=new HZ.lb.PluginsController,this.addPlugin(b),A.hover(this.handleImageMouseOver.bind(this),this.handleImageMouseOut.bind(this)),y.click(this.handleCloseClick.bind(this)),H.on("mouseenter",this.showScrollbar.bind(this)),n.on("wheel","#lbImageContainer, #lbInfo .content-scroll-bar, #lbInfo .content-fixed",this.handleMouseWheel.bind(this)),n.on("mousedown","#lbInfo .content-scroll-bar",this.onScrollbarDragStart.bind(this)),q.on("contextmenu",".lbImageView",function(a){a.preventDefault(),HZ.lb.plugins.SpaceActions.handleEmbed()}),this.measureScrollbar(),this.hideNativeScrollbar(),this.measureContentBox(),f={},this.setContentGroups(HZ.lb.Config.contentGroups),R=new MutationObserver(this.handleContentMutation.bind(this)),void 0===HZ.feedComments&&HZ.lb.Utils.loadFeedCommentsResources(),HZ.ns("HZ.module"),void 0===HZ.module.ReturnPolicy&&HZ.lb.Utils.loadReturnPolicyResources(),void 0===HZ.module.Warranty&&HZ.lb.Utils.loadWarrantyResources(),HZ.lb.Config.preloadEditorResources&&HZ.lb.Utils.loadLightboxEditor(!1),HZ.lb.Config.enableColorPicker&&HZ.lb.Utils.loadColorPickerResources(),HZ.lb.Config.enableTagsRedesign&&z.addClass("lbImageContainer-with-new-tags"))},this.setExpandedMode=function(a){j=!!a,s.toggleClass("expanded",j),this.isShowing()&&(this.setTransitionMode(),this.registerTimeout("expand",function(){this.unsetTransitionMode(),this.handleResize()}.bind(this),251))},this.getExpandedMode=function(){return j},this.setContractedMode=function(a,b){$.isNumeric(b)||(b=251);var c;if(k==a&&ca)c=ca;else{var d=$.Deferred(function(c){k=!!a,s.toggleClass("contracted",k),this.setTransitionMode(),this.registerTimeout("contract",function(){this.unsetTransitionMode(),this.handleResize(),this.notifyPlugins("lightboxModeChanged"),c.resolve()}.bind(this),b)}.bind(this));c=ca=d.promise()}return c},this.setTransitionMode=function(){z.hasClass("image-container--transition")||z.addClass("image-container--transition")},this.unsetTransitionMode=function(){z.removeClass("image-container--transition")},this.getContractedMode=function(){return k},this.resetContractedMode=function(){k=!1,s.removeClass("contracted"),ca=null},this.handleContentMutation=function(a){this.registerTimeout("contentGroupsDebounce",this.calculateContentGroupPositions.bind(this),50),this.registerTimeout("scrollbarDebounce",this.resizeScrollbar.bind(this),50),this.registerTimeout("scrollPositionDebounce",this.correctScrollPositionAfterMutation.bind(this),50)},this.calculateContentGroupPositions=function(){h={},(this.isProduct()?HZ.lb.Config.productContentGroupIds:HZ.lb.Config.spaceContentGroupIds).forEach(function(a){var b=this.getNodeByContentGroupId(a);if(b&&b.length){var c=b.position().top,d=c+b.height();h[a]={top:c,bottom:d}}}.bind(this))},this.getContentGroupPositions=function(){return h},this.correctScrollPositionAfterMutation=function(){S&&(this.jumpToSelector(S),S=null)},this.resizeScrollbar=function(){var a=p.h;this.measureContentHeight();var b=Q<a;O=a/Q*a-4,L.css({height:O+"px"}).toggleClass("hidden",b)},this.repositionScrollbar=function(){var a=p.h;this.measureContentHeight();var b=this.getContentScrollTop(),c=b/Q*a+2;L.css({top:c+"px"})},this.measureScrollbar=function(){return $.isNumeric(N)||(N=HZ.ui.Utils.measureScrollbar()),N},this.measureContentHeight=function(){Q=H.outerHeight()+I.outerHeight()},this.hideNativeScrollbar=function(){0===N?G.css({width:"calc(100% + 16px)",paddingRight:"16px"}):G.css({width:"calc(100% + "+N+"px)"})},this.onScrollbarDragStart=function(a){return U=a.pageY,V=P.scrollTop,n.on("mouseup.scrollbar",this.onScrollbarDragEnd.bind(this)),n.on("mousemove.scrollbar",this.onScrollbarDragMove.bind(this)),u.disableSelection(),s.addClass("scroll-drag"),W=!0,a.preventDefault(),!1},this.onScrollbarDragMove=function(a){var b=a.pageY-U,c=p.h,d=Q-c,e=c-O;if(d>0){var f=e/d;P.scrollTop=V+b/f}clearSelection()},this.onScrollbarDragEnd=function(a){W=!1,n.off(".scrollbar"),s.removeClass("scroll-drag"),u.enableSelection(),clearSelection()},this.measureContentBox=function(){p={w:G.width(),h:G.height()}},this.setContentGroups=function(a){e=a,e.forEach(function(a,b){this.addContentGroup(a,b)}.bind(this)),g=0,this.notifyPlugins("contentGroupsChanged")},this.addContentGroup=function(a,b){var c=a.id;if(c){f[c]=a;var d=H.find(".content-group"),e=$('<div class="content-group"></div>').attr("data-group-id",c).addClass(c);b<=d.length?H.append(e):H.eq(b).before(e)}},this.getContentGroups=function(){return e},this.getContentGroupById=function(a){var b;return e&&(b=f[a]),b},this.getNodeByContentGroupId=function(a){return u.find(".content-group[data-group-id='"+a+"']")},this.setCurrentContentGroupIndex=function(a){var b=a!=g;g=a,b&&this.notifyPlugins("currentContentGroupChanged")},this.getCurrentContentGroupIndex=function(){return g},this.focusCurrentContentGroup=function(){u.find(".lbInfoBox").removeClass("scrolling scrolled");var a=this.getCurrentContentGroupId(),b=this.getContentGroupPositions()[a];if(b){var c=this.getNodeByContentGroupId(a),d=c.find(".lbInfoBox").addClass("scrolling");X=!0,this.animateScrollTo(b.top,function(){X=!1,d.removeClass("scrolling").addClass("scrolled")}.bind(this))}},this.getCurrentContentGroupId=function(){return(this.isProduct()?HZ.lb.Config.productContentGroupIds:HZ.lb.Config.spaceContentGroupIds)[g]},this.getContentFooter=function(){return I},this.handleImageMouseOver=function(a){T=!0,this.showScrollbar(),this.showSpaceActions()},this.handleImageMouseOut=function(a){T=!1,this.hideSpaceActions()},this.handleMouseWheel=function(a){var b=a.originalEvent.deltaY;a.originalEvent.deltaMode&&1==a.originalEvent.deltaMode&&(b*=20),P.scrollTop+=b},this.showSpaceActions=function(){ga||(this.unRegisterTimeout("hideSpaceActions"),$("#lbActions").removeClass("fade-out hide"),this.dimScrollbar(),this.notifyPlugins("actionsBarShown")),$("#lbActions").addClass(" lbActions-white")},this.fadeOutSpaceActions=function(){$("#lbActions").addClass("fade-out")},this.disableSpaceActions=function(){$("#lbActions").addClass("hide")},this.hideSpaceActions=function(a){fa&&this.registerTimeout("hideSpaceActions",function(){T||(this.fadeOutSpaceActions(),this.showScrollbar.bind(this),this.notifyPlugins("actionsBarHidden"))}.bind(this),750)},this.setAutoHideSpaceActionsEnabled=function(a){fa=a},this.setSpaceActionsDisabled=function(a){ga=a},this.enterColorPickerMode=function(){Y||($("#lbMain").addClass("color-picker"),Y=!0,this.notifyPlugins("lightboxModeChanged"))},this.enterColorPickerModeWithData=function(a,b,c){Z={spaceId:a,palette:b,locations:c},this.enterColorPickerMode()},this.exitColorPickerMode=function(){Y&&($("#lbMain").removeClass("color-picker"),Y=!1,this.notifyPlugins("lightboxModeChanged"))},this.isColorPicking=function(){return Y},this.getColorPickerData=function(){return Z&&Z.spaceId==this.getCurrentSpace().id?Z:null},this.handleImageDivClick=function(a){var b=this.getImageBounds();HZ.lb.Config.zoomOnImageClick?a.pageX>.9*b.w+b.x?this.next():a.pageX<.1*b.w+b.x&&this.previous():a.pageX>.2*b.w+b.x?this.next():this.previous()},this.lightboxEditorEnabled=!1,this.isSignupMode=function(){if(!HZ.data.CurrentSessionUser)return!0},this.show=function(a,b){this.resetContext(),HZ.events&&(HZ.events.subscribe(this,"search:start",this.detachKeyboardHandler.bind(this)),HZ.events.subscribe(this,"search:stop",this.attachKeyboardHandler.bind(this)),HZ.events.subscribe(this,"quantity:start",this.detachKeyboardHandler.bind(this)),HZ.events.subscribe(this,"quantity:stop",this.attachKeyboardHandler.bind(this)));var c=HZ.data.Contexts.get(b);c.setCurrentSpaceId(a),this.pushContext(c),q.removeAttr("style"),this.notifyPlugins("lightboxLoaded"),o.parent("html").addClass("lbHtml lbLockScroll"),m.on("resize.lightbox orientationchange.lightbox",$.throttle(50,this.handleResize.bind(this))),m.on("beforeunload.lightbox",$.proxy(this.handleBeforeUnload,this)),this.attachKeyboardHandler(),G.on("scroll.lightbox",$.throttle(5,this.handleScroll.bind(this))),q.removeClass("hidden"),i=!0,this.handleResize(!0),this.showScrollbar(),this.measureContentBox(),this.calculateContentGroupPositions(),R.observe(H.get(0),{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class"]}),$("#stickyFooterActions").addClass("lbView disabled"),HZ.utils.Logger.logCountInTSDB("exp","lb_view",1,"ux")},this.hide=function(){if(HZ.events&&HZ.events.unsubscribe(this),"undefined"!=typeof imageTagsObj&&this.isEditMode()){var a=this.getCurrentSpace();updateImageTags(a.id)}if(this.isEditMode())return this.exitEditMode($.proxy(this.hide,this));this.exitColorPickerMode(),d[d.length-1].unstashSpaces(),this.setSelectedListingId(null),this.resetScroll(),i=!1,q.addClass("hidden"),this.notifyPlugins("lightboxUnloaded"),m.off(".lightbox"),this.detachKeyboardHandler(),R.disconnect(),o.parent("html").removeClass("lbHtml"),HZ.message.Bus.broadcast(HZ.message.Messages.LIGHTBOX_UNLOAD),$("#stickyFooterActions").removeClass("lbView")},this.showScrollbar=function(){L.removeClass("fade-out")},this.dimScrollbar=function(){L.addClass("fade-out")},this.resetScroll=function(){g=0,P.scrollTop=0},this.handleScroll=function(a){this.repositionScrollbar(),this.showScrollbar(),this.registerTimeout("dimScrollbar",this.dimScrollbar.bind(this),750),this.notifyPlugins("lightboxScroll")},this.getContentMask=function(){return F},this.getContentScrollTop=function(){return P.scrollTop},this.getContentBox=function(){return p},this.scrollToTop=function(a){G.stop().animate({scrollTop:0},250,"easeOutSine",callback)},this.scrollToSelector=function(a,b){var c=$(a);if(c&&c.length){for(var d=c.position().top,e=c.offsetParent().get(0);e!==P;){var f=$(e);if("html"===f.prop("tagName").toLowerCase())break;f&&f.position()&&(d+=f.position().top),e=f.offsetParent().get(0)}$.isNumeric(d)&&this.animateScrollTo(d,b)}},this.animateScrollTo=function(a,b){G.stop().animate({scrollTop:a},250,"easeOutSine",b)},this.jumpToSelector=function(a){var b=$(a);if(b){S=a;var c=b.position().top+P.scrollTop;G.stop().scrollTop(c)}},this.switchType=function(a){if(a!=l){switch(s.removeClass("product space video"),HZ.lb.Config.wideProductColumnEnabled&&s.addClass("lb-main--wide-info-column"),a){case this.PRODUCT_TYPE:s.addClass("product");break;case this.VIDEO_TYPE:s.addClass("space video");break;case this.SPACE_TYPE:default:s.addClass("space")}l=a}},this.getLbType=function(){return l},this.setImageData=function(a){_=a},this.getImageData=function(){return $.extend(_,aa)},this.showSpaceTagEditor=function(a,b,c){this.setEditTagId(c),ba=4,HZ.lb.Utils.loadLightboxEditor(!0),this.setEditTagMode(!0),this.show(a,b)},this.showSpaceEditor=function(a,b){ba=2,HZ.lb.Utils.loadLightboxEditor(!0),this.setEditMode(!0),this.show(a,b)},this.isShowing=function(){return i},this.showDialog=function(a){this.detachKeyboardHandler(),HZ.ui.Yamdi.show(a,this.attachKeyboardHandler.bind(this))},this.showLoginDialog=function(a,b,c){this.detachKeyboardHandler(),a||(a=HZ.lb.Config.SIGNUP_TRACKING_OTHER),HZ.auth.Manager.signup(a,b,null,this.attachKeyboardHandler.bind(this),c)},this.invokeSignupAndThenActionDialog=function(a,b,c,d){var e=a.id,f=null;a&&a.iids&&a.iids[0]&&(f=a.iids[0]);var g=this,h=JSON.stringify({houseId:e,redirectUrl:window.location.href,imageId:f,buttonType:d});HZ.ajaz.Services.setVisitorProperty("postSignupHouseId",h,function(a){g.showLoginDialog(b,c,null)})},this.isSketch=function(){var a=this.getCurrentSpace();return a&&a.cat==HZ.lb.Config.SKETCHES_CATEGORY_ID},this.isEditMode=function(){return this.lightboxEditorEnabled&&ba>0},this.isEditTagMode=function(){return this.lightboxEditorEnabled&&ba>=3},this.getEditTagId=function(){return da},this.setEditTagId=function(a){da=a},this.setEditTagMode=function(a){if(this.lightboxEditorEnabled){ba=a?4==ba?4:3:0;var b=$(document.body.parentNode);q.add(b).toggleClass("lbEditMode",!!this.isEditMode())}},this.setEditMode=function(a){if(this.lightboxEditorEnabled){ba=a?ba||1:0;var b=$(document.body.parentNode);q.add(b).toggleClass("lbEditMode",!!this.isEditMode()),a&&this.notifyPlugins("editModeShown")}},this.finalizeBeforeSaveOrDiscard=function(){this.notifyPlugins("beforeSaveOrDiscard")},this.exitEditMode=function(a){if(a||2!=ba&&4!=ba||(a=$.proxy(this.hide,this)),this.finalizeBeforeSaveOrDiscard(),this.hasChanges())return HZ.lb.ConfirmSaveDialog.onDiscardClicked=$.proxy(function(){this.notifyPlugins("discardData"),this.setEditMode(!1),HZ.ui.Yamdi.hide(),this.handleResize(),this.refresh(),a&&a()},this),HZ.lb.ConfirmSaveDialog.onSaveClicked=$.proxy(function(){this.notifyPlugins("saveData"),this.setEditMode(!1),HZ.ui.Yamdi.hide(),this.handleResize(),this.refresh(),a&&a()},this),this.showDialog(HZ.lb.ConfirmSaveDialog);this.setEditMode(!1),this.handleResize(),this.refresh(),a&&a()},this.hasChanges=function(){return HZ.lb.plugins.EditSpaceDataManager&&HZ.lb.plugins.EditSpaceDataManager.isDirty()},this.handleBeforeUnload=function(){if(this.isEditMode()&&this.hasChanges())return _hgt("You have unsaved changes. Are you sure?")},this.attachKeyboardHandler=function(){var a=$(document);a.off("keydown.lightbox").on("keydown.lightbox",$.proxy(this.handleKeyDown,this))},this.detachKeyboardHandler=function(){$(document).off("keydown.lightbox")},this.handleKeyDown=function(a){var b=$(a.target),c=this.isEditMode(),d=a.ctrlKey;if("keydown"==a.type)switch(a.keyCode){case 27:this.isViewSpace()||(b.trigger("blur"),this.hide());break;case 221:if(d)return b.trigger("blur"),this.next(),!1;break;case 219:if(d)return b.trigger("blur"),this.previous(),!1;break;case 83:if(d)return setTimeout($.proxy(function(){this.notifyPlugins("saveData")},this),100),b.trigger("blur"),a.preventDefault(),!1;break;case 32:case 39:if(!c)return this.next(),!1;break;case 37:if(!c)return this.previous(),!1;break;case 69:if(!c&&d)return HZ.lb.plugins.SpaceActions.handleEdit(),!1}},this.handleCloseClick=function(a){return a.stopPropagation(),this.hide(),!1},this.registerTimeout=function(a,b,c){this.timeouts||(this.timeouts={}),null!=this.timeouts[a]&&(clearTimeout(this.timeouts[a]),this.timeouts[a]=null),this.timeouts[a]=setTimeout(function(){this.timeouts[a]=null,b()}.bind(this),c)},this.unRegisterTimeout=function(a){this.registerTimeout(a,$.noop,0)},this.refresh=function(a){a||this.setSelectedListingId(null),this.notifyPlugins("imageChanged")},this.reload=function(a,b){var c=this.getContext();null!=b&&b.length>=1&&b[0]!=c.getName()&&this.recreateContextStack(b),c.setCurrentSpaceId(a),this.refresh()},this.addPlugin=function(a){c.addListener(a),a.setOwner(this)},this.removePlugin=function(a){c.removeListener(a),a.setOwner(null)},this.addImageLayer=function(a){$(B).prepend(a)},this.addLbImageLayer=function(a){return $(C).append(a)},this.addBreadcrumbs=function(a){$(E).append(a)},this.addImageControl=function(a){$(D).append(a)},this.addInfoBoxToContentGroup=function(a,c,d){if(c&&d){var e=this.getNodeByContentGroupId(d);e.length||(e=$("<div class='content-group'></div>").attr("data-group-id",d).addClass(d).appendTo(H)),e.append(a),b.registerContent(c,a)}},this.addSpaceEditorBox=function(a,c){c&&($("#lbEditContent").append(a),b.registerContent(c,a))},this.addActionItem=function(a,b,c){var d=$("#lbActions"+b);if($.isNumeric(c)&&c<d.children().length)d.children().eq(c).before(a);else{var e=d.children().last();e.hasClass("keep-last")?e.before(a):d.append(a)}},this.addMoreMenuItem=function(a){var b=$("<i>").addClass(a.iconClass).addClass("lb-more-menu-item-icon"),c=$('<li class="lb-more-menu-item">').append(b).append(a.label);return void 0!==a.index&&c.attr("index",a.index),a.handler&&c.click(a.handler),a.compId&&c.attr("compId",a.compId),ha.push(c),c},this.toggleMoreMenu=function(a){if($("#lbMoreMenu:visible").length>0)return void this.hideMoreMenu;a&&a.stopPropagation();var b=$('<ul class="lb-more-menu-content list-unstyled trackMe">');0===$(".lb-more-menu-content").length&&ha.sort(function(a,b){return(void 0!==a.attr("index")?a.attr("index"):ha.length)-(void 0!==b.attr("index")?b.attr("index"):ha.length)}),ha.forEach(function(a){b.append(a)}),$("#lbMoreMenuBtn").tipBubble({content:b,id:"lbMoreMenu",width:160,offsetX:-120,offsetY:0,showCloseBtn:!1,position:"absolute",bubblePadding:0,fadeDuration:0,point:"south",attachTo:$("#lbImageContainer")}),$(document).on("click",this.hideMoreMenu.bind(this)),this.setAutoHideSpaceActionsEnabled(!1)},this.hideMoreMenu=function(){$("#lbMoreMenuBtn").tipBubble("hide"),this.setAutoHideSpaceActionsEnabled(!0)},this.addFixedContent=function(a,c){c&&(J.append(a),b.registerContent(c,a))},this.addOverlaidContent=function(a){M.append(a)},this.notifyPlugins=function(a){c.notifyListeners(function(){this[a]&&this[a]()}),this.onBeforeContentUpdate(a),b.updateContents(),c.notifyListeners(function(){this.pluginAfterShown&&this.pluginAfterShown(a)})},this.onBeforeContentUpdate=function(a){a},this.resetContext=function(){d=[]},this.recreateContextStack=function(a){this.resetContext();for(var b=0;b<a.length;b++){var c=HZ.data.Contexts.get(a[b]);c&&d.push(c)}this.notifyPlugins("contextChanged")},this.pushContext=function(a){d[0]&&d[0].unregisterOwner(),d.unshift(a),a.registerOwner(this),HZ.data.Contexts.get(a.getName())||HZ.data.Contexts.put(a.getName(),a),this.notifyPlugins("contextChanged")},this.popContext=function(){if(1!=d.length){var a=d.shift();a&&a.unregisterOwner(),d[0]&&d[0].registerOwner(this),this.notifyPlugins("contextChanged")}},this.getSpaceImage=function(a,b){var c,d=this.getContext(),e=null;return b=b||0,d&&a&&d.getCurrentSpaceId()&&(c=a.iids[b],e=HZ.data.Images.get(c)),e},this.setSelectedListingId=function(a){ea=a},this.getSelectedListingId=function(){var a=this.getCurrentSpace().id,b=HZ.data.ProductsInfo.get(a);if(HZ.lb.Config.spaceIdToVendorListingIdOverride&&HZ.lb.Config.spaceIdToVendorListingIdOverride[a]&&(ea=HZ.lb.Config.spaceIdToVendorListingIdOverride[a]),!ea&&b){for(var c=HZ.data.SpaceListingIds.get(a),d=c?c.length:0,e=0;e<d;e++){var f=c[e];if(f==b.plid){this.setSelectedListingId(f);break}}!ea&&c&&c[0]&&this.setSelectedListingId(c[0])}return ea},this.isColorPickerSavedPalette=function(){var a=this.getCurrentSpace();return a.hasOwnProperty("srcs")&&0!==parseInt(a.srcs)},this.isFullPageAd=function(){return this.isPaidProAd()||this.isPhotoAd()||this.isProListAd()},this.isBrandAdvertiser=function(){var a=this.getCurrentSpace();return!!HZ.data.Users.get(a.ow)&&!!HZ.data.Users.get(a.ow).ba},this.getContext=function(){return d?d[0]:null},this.getContextType=function(){return this.getContext().getType()},this.getContextStack=function(){return d},this.getCurrentSpace=function(){var a,b=this.getContext();return b&&(a=b.getCurrentSpaceId())?HZ.data.Spaces.get(a):null},this.isViewSpace=function(){return HZ.lb.Config.isViewSpace||!1},this.isPaidProAd=function(){var a=this.getCurrentSpace();return!!HZ.data.PaidProAds.get(a.id)},this.isPhotoAd=function(){var a=this.getCurrentSpace(),b=HZ.data.PhotoAds.get(a.id);return b&&b.products&&b.products.length},this.isProductAd=function(){var a=this.getCurrentSpace(),b=HZ.data.ProductAds.get(a.id);return!this.isPhotoAd()&&b&&b.products&&b.products.length},this.isMarketPlaceAd=function(){var a=this.getCurrentSpace(),b=HZ.data.PhotoAds.get(a.id);return this.isPhotoAd()&&b.mpAd},this.isProListAd=function(){var a=this.getCurrentSpace();return!!HZ.data.ProListAds.get(a.id)},this.isAdvertiseSpace=function(){return this.isPaidProAd()||this.isPhotoAd()||this.isProductAd()||this.isProListAd()},this.isMarketplaceProduct=function(){var a,b=this.getCurrentSpace();return b&&(a=HZ.data.ProductsInfo.get(b.id)),b&&a&&a.mp},this.isPPCProduct=function(){var a=this.getCurrentSpace(),b=a?HZ.data.PPCAds.get(a.id):{};return b&&b.isPPCProduct},this.isProduct=function(){var a=this.getCurrentSpace();return a&&a.prod},this.isFile=function(){var a=this.getCurrentSpace();return a&&a.ift},this.isGalleryContext=function(){return!!this.getCurrentSpaceGallery()&&this.getContextType()==HZ.lb.Config.CONTEXT_TYPE_IDEABOOK},this.isProjectContext=function(){return!!this.getCurrentSpaceProject()&&this.getContextType()==HZ.lb.Config.CONTEXT_TYPE_PROJECT},this.isProProjectContext=function(){var a=this.getCurrentSpace(),b=HZ.data.Users.get(a.ow);return b&&"1"==b.p&&this.isProjectContext()},this.isRecommendationsContext=function(){return this.getContextType()==HZ.lb.Config.CONTEXT_TYPE_SPACE_RECOMMENDATIONS},this.isSpotlightContext=function(){var a=this.getContext(),b=a.getDescriptor(),c=this.isGalleryContext(),d=this.getContextType()==HZ.lb.Config.CONTEXT_TYPE_IMAGE_TAGS,e=(c||d)&&b[HZ.lb.Config.DESCRIPTOR_FIELD_IS_SPOTLIGHT_GALLERY],f=this.getContextStack().length>1?this.getContextStack()[1]:null,g=!!f&&f.getDescriptor()[HZ.lb.Config.DESCRIPTOR_FIELD_IS_SPOTLIGHT_GALLERY];return e||d&&g},this.getCurrentSpaceProject=function(){var a=this.getCurrentSpace();return HZ.data.Projects.get(a.pid)},this.getCurrentSpaceGallery=function(){var a=this.getContext(),b=a.getDescriptor();return HZ.data.Galleries.get(b[HZ.lb.Config.DESCRIPTOR_FIELD_GALLERY_ID])},this.isFeaturedGalleryContext=function(){var a=this.getContext();return this.isGalleryContext&&a.getDescriptor()[HZ.lb.Config.DESCRIPTOR_FIELD_IS_GALLERY_FEATURED]},this.getSpaceDescription=function(){var a=this.getCurrentSpace(),b=a.c;if(!b){var c=HZ.data.ProductsInfo.get(a.id),d=HZ.data.ListingsInfo.get(this.getSelectedListingId());b=d?d?d.desc:"":c?c.desc:""}return b||(b=a.desc),b},this.next=function(){this.setSelectedListingId(null),this.getContext().next()&&this.handleImageChanged()},this.previous=function(){this.setSelectedListingId(null),this.getContext().previous()&&this.handleImageChanged()},this.handleImageChanged=function(){this.setTransitionMode(),this.setSpaceActionsDisabled(!1),this.resetContractedMode(),this.resetScroll(),this.showScrollbar(),this.exitColorPickerMode(),this.notifyPlugins("imageChanged"),HZ.utils.Logger.logCountInTSDB("exp","lb_view",1,"ux")},this.handleContextChanged=function(){this.notifyPlugins("contextChanged")},this.handleImageDataChanged=function(){this.notifyPlugins("imageDataUpdated")},this.handleImageIndexChanged=function(){this.notifyPlugins("imageIndexChanged")},this.handleEditDataChanged=function(){this.notifyPlugins("editDataUpdated")},this.handleResize=function(b){a=UIHelper.getScreenBounds(),this.handleContentResize(),this.notifyPlugins("imageResized"),!0===b&&this.notifyPlugins("imageChanged")},this.handleContentResize=function(){this.measureContentBox(),this.resizeScrollbar(),this.repositionScrollbar()},this.setImageBounds=function(a){aa=a},this.getImageBounds=function(){return aa},this.getImageMinVals=function(){return{w:720,h:480}},this.getImageDiv=function(){return B},this.getCurrentImageNode=function(){return A.find(".currentImage")},this.getContentTabsNode=function(){return w},this.getThumbSize=function(a){var b=HZ.data.Spaces.get(a);b.prod,this.getImageBounds().w;return 9},this.areActionsEnabled=function(){return!0},this.getLightboxElement=function(){return t},this.getInfoElement=function(){return u}},HZ.lb.PluginsController=function(){var a,b,c=["spaceInfo","spaceTitle","projectInfo","imageTagsInfo","colorPickerCTA","colorPickerCTA2","colorPicker","paletteSourcePhoto","questionsInfo","productInfo","productIdeabookComment","mpProductVariation","sponsoredSpaceDescriptionInfo","spaceAuthorInfo","comments","productSpecs","sellerShippingInfo","spaceRelatedProducts","productRelatedProducts","coBuyProducts","relatedPhotos","productsInRoom","productReviews","recommendationsSpaces","recommendationsProducts","marketplaceAds","adRelatedProducts","localProsAd","scrollToTop"];this.setOwner=function(c){a=c,b=[]},this.registerContent=function(a,c){b[a]||(b[a]={enabled:!0,divs:[]});var d=b[a];c&&($(c).addClass("lbPlugin"),d.divs.push(c))},this.imageResized=function(){},this.imageChanged=function(){var b=a.getCurrentSpace();if(b.fullyLoaded){for(var d=b.ift,e=a.isMarketplaceProduct(),f=a.isProduct(),g=c.length,h=0;h<g;h++){var i=!a.isEditMode();this.setPluginEnabled(c[h],i)}d&&(this.setPluginEnabled("comments",!1),this.setPluginEnabled("spaceAuthorInfo",!1),this.setPluginEnabled("questionsInfo",!1),this.setPluginEnabled("projectInfo",!1)),this.setPluginEnabled("spaceEditor",a.isEditMode()&&!a.isEditTagMode()),this.setPluginEnabled("spaceTagEditor",a.isEditTagMode()),e?(this.setPluginEnabled("spaceInfo",!1),this.setPluginEnabled("spaceRelatedProducts",!1),this.setPluginEnabled("spaceAuthorInfo",!1),this.setPluginEnabled("recommendationsSpaces",!1),this.setPluginEnabled("colorPickerCTA",!1),this.setPluginEnabled("colorPicker",!1),this.setPluginEnabled("paletteSourcePhoto",!1),this.setPluginEnabled("imageTagsInfo",!1)):f?(this.setPluginEnabled("mpProductVariation",!1),this.setPluginEnabled("spaceInfo",!1),this.setPluginEnabled("spaceRelatedProducts",!1),this.setPluginEnabled("coBuyProducts",!1),this.setPluginEnabled("spaceAuthorInfo",!1),this.setPluginEnabled("recommendationsSpaces",!1),this.setPluginEnabled("colorPickerCTA",!1),this.setPluginEnabled("colorPicker",!1),this.setPluginEnabled("paletteSourcePhoto",!1),this.setPluginEnabled("imageTagsInfo",!1)):(this.setPluginEnabled("productInfo",!1),this.setPluginEnabled("productIdeabookComment",!1),this.setPluginEnabled("mpProductVariation",!1),this.setPluginEnabled("productRelatedProducts",!1),this.setPluginEnabled("coBuyProducts",!1),this.setPluginEnabled("productSpecs",!1),this.setPluginEnabled("sellerShippingInfo",!1),this.setPluginEnabled("productsInRoom",!1),this.setPluginEnabled("productReviews",!1),this.setPluginEnabled("recommendationsProducts",!1)),!b.prod&&a.isPaidProAd()&&(this.setPluginEnabled("spaceAuthorInfo",!1),this.setPluginEnabled("projectInfo",!1),this.setPluginEnabled("spaceRelatedProducts",!1),this.setPluginEnabled("comments",!1)),a.isColorPickerSavedPalette()&&(this.setPluginEnabled("projectInfo",!1),this.setPluginEnabled("recommendationsSpaces",!1),this.setPluginEnabled("comments",!1),this.setPluginEnabled("spaceRelatedProducts",!1)),a.isPhotoAd()&&(a.isMarketPlaceAd()?this.setPluginEnabled("recommendationsSpaces",!1):(this.setPluginEnabled("spaceTitleInfo",!1),this.setPluginEnabled("comments",!1),this.setPluginEnabled("spaceAuthorInfo",!1),this.setPluginEnabled("spaceInfo",!1),this.setPluginEnabled("projectInfo",!1),this.setPluginEnabled("recommendationsSpaces",!1))),a.isProListAd()&&(this.setPluginEnabled("questionsInfo",!1),this.setPluginEnabled("spaceInfo",!1),this.setPluginEnabled("recommendationsSpaces",!1),this.setPluginEnabled("comments",!1))}},this.imageDataUpdated=function(){this.imageChanged()},this.setPluginEnabled=function(a,c){var d=b[a];d&&(d.enabled=c)},this.updateContents=function(){for(var a in b)if(b.hasOwnProperty(a))for(var c=b[a],d=0;d<c.divs.length;d++){var e=$(c.divs[d]),f=c.enabled&&!e.is(":empty")||e.is(".product .product-info-content");e.toggleClass("hidden",!f)}}},HZ.lb.plugins.ImagePreloader=new function(){var a,b=[],c=0,d=0;this.setOwner=function(b){a=b},this.prefetchSpacePhoto=function(d){if(!this.isImageAvailable(d)){var e,f,g=HZ.data.Spaces.get(d),h=a.getThumbSize(d),i=HZ.data.Categories.getCategoryById(g.cat),j=HZ.utils.Styles.getStyleUrl(g.s);g.bmu&&(h=HZ.lb.Config.BOOKMARKLET_UPLOAD_THUMBSIZE),e=HZ.utils.Links.getSpaceImageSeoThumbUrl(g.id,h,j,i),f=b[c]?b[c].image:new Image,f.src=e,b[c]={spaceId:d,image:f},c=(c+1)%10}},this.imageChanged=function(){var b,c;if(!(d++<1))for(c=a.getContext().getNextSpaceIds(3),b=0;b<c.length;b++)this.prefetchSpacePhoto(c[b])},this.isImageAvailable=function(a){for(var c=0;c<b.length;c++)if(b[c].spaceId==a)return!0;return!1}},HZ.lb.plugins.ImageViewer=new function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D=0,E={x:0,y:0,w:200,h:200,thumb:2},F={x:0,y:0,w:640,h:640,thumb:4},G={w:990,h:990},H={w:702,h:702};this.setOwner=function(c){a=c,b=$(a.getImageDiv()),b.on("click",".currentImage",null,this.handleImageDivClick.bind(this)).disableSelection(),d=$('<div id="lbImageViewLayer"></div>'),v=[];for(var j=0;j<3;j++){var k=$("<img>").attr("src",HZ.utils.Config.emptyGifData).addClass("lbImageView");d.append(k),v[j]=k.get(0)}d.on("load",".lbImageView",this.imageLoaded.bind(this)).on("dragstart",".lbImageView",function(){return!1}).on("mousedown",".lbImageView",function(a){preventImageDrag(a)}),$("#lbImageView, #lbImageViewLayer").disableSelection(),g=$(HZ.utils.Html.template('<div class="before-tag-large hidden"><i class="hzi-font hzi-Before-Photo"></i>%BEFORE_LABEL%</div>',{BEFORE_LABEL:_hgt("Before Photo")})).appendTo(d),w=0,x=v[0],a.addImageLayer(d.get(0)),e=d.find("img"),n=$('<a href="javascript:;" class="zoom-toggle btn med tint btn-toggle" compid="lb_prod_zoom"><i class="icon icon-font icon-magnifying_plus not-toggled"></i><i class="icon icon-font icon-magnifying_minus toggled"></i></a>'),l=$('<video controls preload="auto" id="lbVideoPlayer" class="video-js" autoplay />'),l.hide(),b.append(l);var o=_hgt("Video is loading…");m=$('<div class="video-loading-overlay"><div class="video-loading-overlay__center"><div class="video-loading-overlay__icon"><i class="hzi-font  hzi-pro_mgr_renew"></i></div><div class="video-loading-overlay__text text-xl mts">'+o+"</div></div>"),b.append(m),n.click(this.handleZoomClick.bind(this)),n.hover(this.handleZoomButtonEnter.bind(this),this.handleZoomButtonLeave.bind(this)),
a.addActionItem(n,HZ.lb.ActionBar.ACTION_BAR_RIGHT,0),f=$('<a href="javascript:;" class="expand-toggle btn med tint btn-toggle" compid="lb_space_expand"><i class="icon icon-font icon-arrows_outward not-toggled"></i><i class="icon icon-font icon-arrows_inward toggled"></i></a>'),f.attr("tooltip-data",_hgt("Click here to expand")),f.mouseover(function(){I()&&($(this).tipBubble("hide"),B=!1)}),A=new MutationObserver(function(){I()&&f.tipBubble("show")}),f.click(this.handleExpandClick.bind(this)),a.addActionItem(f,HZ.lb.ActionBar.ACTION_BAR_RIGHT);var p={iconClass:"icon icon-font icon-arrows_outward not-toggled",label:_hgt("Fullscreen"),compId:"lb_space_expand",handler:this.handleExpandClick.bind(this),index:2},q={iconClass:"icon icon-font icon-arrows_inward not-toggled",label:_hgt("Exit Fullscreen"),compId:"lb_space_unexpand",handler:this.handleExpandClick.bind(this),index:2};h=a.addMoreMenuItem(p),i=a.addMoreMenuItem(q),h.addClass("expand-btn"),i.addClass("unexpand-btn")},this.hideExpandBtn=function(){f.addClass("hidden")},this.handleExpandClick=function(b){a.setExpandedMode(!a.getExpandedMode())},this.handleZoomClick=function(a){n.prop("disabled")||this.setZoomMode(!p)},this.handleZoomButtonEnter=function(){p||this.resetTransformOrigin(),this.setFollowMouse(!1)},this.handleZoomButtonLeave=function(){this.setFollowMouse(p)},this.setZoomMode=function(a){p=a,p?(d.addClass("zoom"),b.on("mousemove.lightbox",this.handleZoomMouseMove.bind(this)),this.setFollowMouse(!0),n.addClass("active"),this.loadHiResImage()):(d.removeClass("zoom"),b.off("mousemove.lightbox"),this.setFollowMouse(!1),n.removeClass("active"))},this.loadHiResImage=function(){var b,c,d=a.getCurrentSpace(),e=a.getSpaceImage(d,D),f=e&&!!e.hr;if(f&&!u&&!t){u=!1,t=!0,b=-1!=e.hr.indexOf(14)?14:16;var g=this.getImageUrl(d,b,D);c=d.id,HZ.lb.Utils.loadImage(g,this.handleHiResImageLoadComplete.bind(this,g,c))}},this.handleHiResImageLoadComplete=function(b,c){if(!$.isNumeric(c)||$.isNumeric(c)&&c==a.getCurrentSpace().id){u=!0,t=!1,d.find(".lbImageView-hires").remove();var e=$("<img>").attr("src",HZ.utils.Config.emptyGifData).addClass("lbImageView lbImageView-hires currentImage").css("background-image","url("+b+")");d.append(e),z=x,x=e.get(0),w=(w+1)%3,this.refresh()}},this.setFollowMouse=function(a){a?(clearInterval(s),s=setInterval(this.moveZoomedImage.bind(this),20)):clearInterval(s)},this.moveZoomedImage=function(){var b=$(x),d=b.css("transform-origin").split(" "),e=parseInt(d[0]),f=parseInt(d[1]),g=a.getImageBounds(),h=g.x-100+q/c.w*(g.w+50),i=g.y-100+r/c.h*(g.h+50),j=h-e,k=i-f,l=e+j/10,m=f+k/10;b.css({"transform-origin":l+"px "+m+"px"})},this.resetTransformOrigin=function(){$(x).css({"transform-origin":"50% 50%"});var b=a.getImageBounds();q=b.x+b.w/2,r=b.y+b.h/2},this.handleZoomMouseMove=function(a){q=a.clientX,r=a.clientY},this.handleImageDivClick=function(b){HZ.lb.Config.zoomOnImageClick?o&&this.setZoomMode(!p):p?this.setZoomMode(!1):a.getContractedMode()?a.setContractedMode(!1):a.handleImageDivClick(b)},this.updateImages=function(){v&&v.length>2&&(x=v[w],y=v[(w+2)%3],z=v[(w+1)%3],$(z).css("background-image","none").data("cachedStyle",null))},this.replaceActiveImage=function(b,c){if(!$.isNumeric(c)||$.isNumeric(c)&&c==a.getCurrentSpace().id){var d="url("+b+")";$(x).css("background-image",d).data("cachedStyle",d)}},this.getDimsLimit=function(b,c){var d={thumb:a.getThumbSize(b.id)};if(b.bmu){var e=HZ.data.CurrentSessionUser,f=e?e.getUserId():-1,g=e&&e.isIdeabookCollaborator;d=f==b.au||g?F:E}return d},this.getImageUrl=function(a,b,c){var d=HZ.data.Categories.getCategoryById(a.cat),e=HZ.utils.Styles.getStyleName(a.s);return b=u?14:9,HZ.utils.Links.getSpaceImageSeoThumbUrl(a.id,b,e,d,c)},this.refresh=function(g){var j,l=a.getCurrentSpace(),m=a.getSpaceImage(l,D),p=!!a.isProduct();if(n.removeClass("unavailable"),n.toggleClass("hidden",!p),HZ.lb.Config.showSimpleVersionLightbox?(h.toggleClass("hidden",p),i.toggleClass("hidden",p)):(f.toggleClass("hidden",p),f.toggleClass("active",!!a.getExpandedMode())),this.isSpaceVideo()?a.switchType(a.VIDEO_TYPE):a.switchType(p?a.PRODUCT_TYPE:a.SPACE_TYPE),c={w:b.width(),h:b.height()},l&&l.ift&&!m&&(m={w:186,h:245,bg:1},l.prod=!0),l&&m){var q,r,s,v,A={w:parseInt(m.w,10),h:parseInt(m.h,10)},B=this.getDimsLimit(l,m),C=l.id,E=m.rotation||0,F=E%180>0;if(F&&(A={w:A.h,h:A.w}),B.w&&(A=HZ.ui.Utils.getMaxBoundRect(A,B,a.getImageMinVals(),!0)),o=A.w>c.w||A.h>c.h,n.prop("disabled",!o),o||n.addClass("unavailable"),g||null==x){a.unRegisterTimeout("hiresLoaded"),d.find(".lbImageView-hires").remove(),u=t=!1,this.setZoomMode(!1),w=(w+1)%3,this.updateImages(),$("#lbMain").attr("objId",C);var I=k&&k.isImageAvailable(C);r=$(x),s=$(y),v=$(z),e.removeClass("currentImage discardedImage previousImage unscaled landscape image-solo"),s.addClass(I?"discardedImage":"previousImage"),v.addClass("discardedImage"),s.removeClass("lbImageViewZoom"),r.addClass("currentImage").toggleClass("image-solo",1==a.getContext().getTotalSpacesCount())}else r=$(x);o&&HZ.lb.Config.zoomOnImageClick&&r.addClass("lbImageViewZoom");var J=B.thumb;j=this.getImageUrl(l,J,D),this.replaceActiveImage(j);var K=a.getImageMinVals(),L={w:r.width(),h:r.height()};r.removeClass("unscaled"),A.w>A.h?(r.addClass("landscape"),A.w<K.w&&A.h<K.h&&A.w<L.w&&A.h<L.h&&r.addClass("unscaled")):A.w<K.h&&A.h<K.w&&A.w<L.h&&A.h<L.w&&r.addClass("unscaled"),a.isColorPickerSavedPalette()&&c.w>H.w&&c.h>H.h&&r.addClass("unscaled");q=A.w/A.h>c.w/c.h?{w:c.w,h:A.h*(c.w/A.w)}:{w:A.w*(c.h/A.h),h:c.h};var M=r.css("background-size"),N=r.css("background-position");switch(M){case"contain":switch(q.x=Math.floor((c.w-q.w)/2),N){case"50% 50%":case"center":q.y=Math.floor((c.h-q.h)/2);break;default:q.y=0}break;case"auto":case"auto auto":q.w=A.w,q.h=A.h,q.x=Math.floor((c.w-q.w)/2),q.y=Math.floor((c.h-q.h)/2)}if(p){var O=parseInt(r.css("top"),10),P=parseInt(r.css("bottom"),10),Q=parseInt(r.css("left"),10),R=parseInt(r.css("right"),10);q.x+=Q,q.y+=O,q.w-=Q+R,q.h-=O+P}a.setImageData({src:j}),a.setImageBounds(q),!p&&g&&(c.w>G.w||c.h>G.h)&&this.loadHiResImage()}},this.pauseVideo=function(){var a=l[0];a&&a.pause()},this.initializeVideoPlayer=function(){C||(C=videojs("lbVideoPlayer",{fluid:!0,controlBar:{children:["playToggle","currentTimeDisplay","timeDivider","durationDisplay","progressControl","volumePanel","fullscreenToggle"]}}))},this.showHideMedia=function(){var b=a.getCurrentSpace(),c=$("#lbVideoPlayer");if(b.vlk)return void this.showVideo();m.hide(),c.hide(),d.show()}.bind(this),this.showVideo=function(){var b=a.isEditMode(),c=l[0];if(HZ.lb.Utils.loadVideoResources(this.showHideMedia),m.hide(),d.hide(),!window.videojs||HZ.lb.Utils.isLoadingVideoResources())return void m.show();this.initializeVideoPlayer();var e=a.getCurrentSpace(),f=$("#lbVideoPlayer"),g=videojs.MediaSource.supportsNativeMediaSources();f.show(),f.find("video").show(),g?(c.autoplay=!b,C.src({src:e.vlk,type:"application/x-mpegURL"}),e.vth&&C.poster(e.vth)):(f.hide(),d.show())},this.isSpaceVideo=function(){var b=a.getCurrentSpace();return b&&b.isv||!1},this.imageChanged=function(){var b=a.getCurrentSpace().id;D=0,j!=b&&a.isShowing()&&(u=t=!1,this.refresh(!0),a.showSpaceActions(),this.resetTransformOrigin(),this.invalidateBeforePhotoLabel(),this.pauseVideo(),this.showHideMedia()),j=b,J()},this.imageDataUpdated=function(){a.getCurrentSpace().fullyLoaded&&this.invalidateBeforePhotoLabel()},this.invalidateBeforePhotoLabel=function(){g.toggleClass("hidden",!a.getCurrentSpace().bt),g.css("left","calc(50% - "+g.outerWidth()/2+"px)")},this.getActiveImage=function(){return x},this.setActiveSpaceImageIndex=function(b){D=b,this.refresh(!0),a.handleImageIndexChanged()},this.getActiveSpaceImageIndex=function(){return D},this.imageResized=function(){c={w:b.width(),h:b.height()},this.refresh(!1),I()&&f.tipBubble("show")},this.imageLoaded=function(){y&&$(y).removeClass("currentImage previousImage").addClass("discardedImage")},this.lightboxLoaded=function(){j=null,I()&&A.observe($("#lbAdminMenu").get(0),{attributes:!0,attributeFilter:["class"]})},this.lightboxUnloaded=function(){this.pauseVideo(),$(x,y).css("background-image","none"),j=null,I()&&(A.disconnect(),1==getCookie("lbt")&&(B=!1))},this.setImageCache=function(a){k=a},this.editModeShown=function(){this.pauseVideo()};var I=function(){return!1},J=function(){I()&&!a.isProduct()?(f.tipBubble({content:f.attr("tooltip-data"),id:"expand-button--tooltip",width:"auto",point:"south right",position:"absolute",attachTo:"#lbActionsRight",showCloseBtn:!1,fadeDuration:0}),1!=getCookie("lbt")&&setCookie("lbt",1)):f.tipBubble("hide")}},HZ.lb.plugins.NavigationLayer=function(){var a,b,c;this.setOwner=function(d){a=d,b=$("#lbLeft").click(this.handlePrevious.bind(this)).disableSelection(),c=$("#lbRight").click(this.handleNext.bind(this)).disableSelection()},this.handleNext=function(){a.next(),c.hasClass("bounce")&&c.removeClass("bounce")},this.handlePrevious=function(){a.previous()},this.contextChanged=function(){this.imageChanged()},this.imageChanged=function(){var d=a.getContext();d&&(c.toggleClass("hidden",!d.hasNext()),b.toggleClass("hidden",!d.hasPrevious()))}},HZ.lb.plugins.SpaceDataLoader={owner:null,setOwner:function(a){this.owner=a},imageChanged:function(){var a=[this.owner.getCurrentSpace()],b=this.owner.getContext().getNextSpaceIds(1);b[0]&&a.push(HZ.data.Spaces.get(b[0]));for(var c=0;c<a.length;c++){var d=a[c];if(!d.fullyLoaded){var e=HZ.ajaz.Services.DETAIL_LEVEL_ALL_WITH_AD_SPACE_INFO;null!=HZ.data.PaidProAds.get(d.id)&&(e=HZ.ajaz.Services.DETAIL_LEVEL_BASE_SPACE_INFO);var f=-1;if(d.prod){var g=HZ.data.ProductsInfo.get(d.id);g&&g.pover&&(f=g.plid)}HZ.ajaz.Services.getSpaceData(d.id,f,e,$.proxy(this.handleData,this),'{"firstSpace":'+HZ.lb.Utils.firstSpaceId+', "showVisualMatchTag":'+this.owner.showVisualMatchTag+', "showProPerception":'+this.owner.showProPerception+"}")}}},handleData:function(a){if(HZ.lb.Utils.validateData(a),a&&a.results){var b={questions:HZ.data.Questions,imageTags:HZ.data.ImageTags,productTagRecognition:HZ.data.ProductTagRecognition,recommendations:HZ.data.Recommendations,productAds:HZ.data.ProductAds,ppcAds:HZ.data.PPCAds,featuredSales:HZ.data.FeaturedSales,bannerAds:HZ.data.BannerAds,colorPickerAd:HZ.data.ColorPickerAd,localProsAd:HZ.data.LocalProsAd,proListAd:HZ.data.ProListAds,houzzImpTracking:HZ.data.HouzzImpTracking,houzzClkTracking:HZ.data.HouzzClkTracking,productInfo:HZ.data.ProductsInfo,listingsInfo:HZ.data.ListingsInfo,spaceToListingIds:HZ.data.SpaceListingIds,colorPaletteSource:HZ.data.ColorPaletteSource,photoRelatedProducts:HZ.data.PhotoRelatedProducts,productsInRoom:HZ.data.ProductsInRoom,reloadData:HZ.data.ReloadData,productReviews:HZ.data.ProductReviews,similarSpaces:HZ.data.SimilarSpaces,coBuySpaces:HZ.data.CoBuySpaces,productCollections:HZ.data.ProductCollections,visuallySimilarSpaces:HZ.data.VisuallySimilarSpaces,recentlyViewedSpaces:HZ.data.RecentlyViewedSpaces};for(var c in b){var d=a.results[c];if(d)for(var e in d)b[c].put(e,d[e])}if(a.results.project)for(var e in a.results.project)HZ.data.Projects.get(a.results.project[e].pid)||HZ.data.Projects.put(a.results.project[e].pid,a.results.project[e]);var f=a.results.spaces;if(f)for(var g in f)HZ.data.Spaces.get(g)?HZ.data.Spaces.put(g,$.extend(!0,HZ.data.Spaces.get(g),f[g])):HZ.data.Spaces.put(g,f[g]);if(f=a.results.spaceInfo)for(var g in f){i=HZ.data.Spaces.get(g)||{};var h=f[g];i.b&&(h.b=i.b,void 0!==i.bp&&(h.bp=i.bp),void 0!==i.braw&&(h.braw=i.braw)),HZ.data.Spaces.put(g,h)}this.populateStandardCollections(a);var i=HZ.data.Spaces.get(a.results.sid);i.fullyLoaded=!0,this.owner.handleImageDataChanged()}},loadSpaceBuzz:function(){var a=this.owner.getCurrentSpace();return $.Deferred(function(b){HZ.ajaz.Services.getSpaceBuzz(a.id).then(function(a){if(HZ.lb.Utils.validateData(a),a&&a.results){var c={};if(HZ.data.Spaces.get(a.results.sid).commentsLoaded=!0,a.results.fbuzzes)for(var d in a.results.fbuzzes)c[d]=c[d]||{},c[d].fg=a.results.fbuzzes[d];if(a.results.ubuzzes)for(var d in a.results.ubuzzes)c[d]=c[d]||{},c[d].ug=a.results.ubuzzes[d];if(c)for(var d in c)HZ.data.Comments.put(d,c[d]);this.populateStandardCollections(a)}b.resolve()}.bind(this))}.bind(this)).promise()},handleBuzzData:function(a){if(HZ.lb.Utils.validateData(a),a&&a.results){var b={};if(HZ.data.Spaces.get(a.results.sid).commentsLoaded=!0,a.results.fbuzzes)for(var c in a.results.fbuzzes)b[c]=b[c]||{},b[c].fg=a.results.fbuzzes[c];if(a.results.ubuzzes)for(var c in a.results.ubuzzes)b[c]=b[c]||{},b[c].ug=a.results.ubuzzes[c];if(b)for(var c in b)HZ.data.Comments.put(c,b[c]);this.populateStandardCollections(a)}},populateStandardCollections:function(a){var b={images:HZ.data.Images,users:HZ.data.Users,productVariationInfo:HZ.data.Variations};for(var c in b)a.results[c]&&b[c].addAll(a.results[c])}};var lightbox=new HZ.lb.Lightbox;lightbox.init(),lightbox.addPlugin(HZ.lb.plugins.SpaceDataLoader),lightbox.addPlugin(HZ.lb.plugins.ImagePreloader),lightbox.addPlugin(HZ.lb.plugins.ImageViewer),HZ.lb.plugins.ImageViewer.setImageCache(HZ.lb.plugins.ImagePreloader),lightbox.addPlugin(new HZ.lb.plugins.NavigationLayer);

window.hzmr.push("lightbox2.2:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End lightbox2.2.js  **************/
/************* Start extracting text for productVariation.js for locale it-IT **************/
(function(){var _hzxt={"Select {themeLabel}":"Seleziona {themeLabel}","Out of stock":"Esaurito","{count} Colors":"{count} colori","{count} Sizes":"{count} dimensioni","{count} Configurations":"{count} configurazioni","{count} Designs":"{count} design","Configuration":"Configurazione","{variationLabel} : {optionLabel}<t1>{optionNote}<\/t1>":"{variationLabel} : {optionLabel}<t1>{optionNote}<\/t1>","Design":"Design","Color":"Colore","Out of Stock":"Esaurito","The variation selected is invalid, please refresh page and try again":"La variante selezionata non \u00e8 valida; aggiorna la pagina e riprova","Choose a {label}:":"Scegli {label}:","Error!":"Errore!","Cancel":"Annulla","":"","Size":"Dimensioni"};for(var a in _hzxt){window._hzlang[a]=_hzxt[a];}})();
/*************  End extracting text for productVariation.js  **************/
/************* Start productVariation.js for locale it-IT **************/
try {HZ.ns("HZ.productVariation"),HZ.productVariation.Manager=new function(){function a(a){var g=!1;a&&a.results&&a.results.spaceInfo&&(b(a),a&&a.results.productInfo&&a.results.productInfo[f]&&(c(a),a.results.productVariationInfo&&a.results.productVariationInfo[f]&&(d(a),i.updateView(f),h.updateView(f,l),j&&j.updateHistory(f,a),g=!0))),g||e(_hgt("Error!"),_hgt("The variation selected is invalid, please refresh page and try again"))}function b(a){f=a.results.sid,HZ.data.Spaces.addAll(a.results.spaceInfo),HZ.data.Spaces.addAll(a.results.spaces),HZ.data.Images.addAll(a.results.images),HZ.data.Users.addAll(a.results.users)}function c(a){HZ.data.ProductsInfo.addAll(a.results.productInfo),HZ.data.ListingsInfo.addAll(a.results.listingsInfo),HZ.data.SpaceListingIds.addAll(a.results.spaceToListingIds)}function d(a){HZ.data.Variations.addAll(a.results.productVariationInfo)}function e(a,b){HZ.ui.yamdi.Common.hideAllDialogs(),HZ.ui.yamdi.Common.alert(a,b)}var f,g,h,i,j,k=!1,l=!1;this.setSelector=function(a){a&&!i&&(i=a)},this.drawSelectors=function(a){return i.drawView(a)},this.setCollapseLayout=function(a){l=a},this.setRenderer=function(a){h=a},this.getRenderer=function(){return h},this.setHistoryManager=function(a){j=a,j.updateHistory(f,null,!0)},this.setSpaceId=function(a){f=a},this.setVendorListingId=function(a){g=a},this.getVendorListingId=function(){return g},this.initUI=function(){k||(i.initUI(),k=!0)},this.applyHistoryState=function(b,c){HZ.data.Spaces.get(b)?(i.updateView(b),h.updateView(b,l)):a(c)},this.fetchAvailability=function(b){var c=[],d=i.getSelectedVariations();c.push({id:b,value:d[b]});for(var e in d)e!==b&&c.push({id:e,value:d[e]});if(!g){var h=HZ.data.ProductsInfo.get(f);g=h&&h.pover?h.plid:-1}HZ.ajaz.Services.getSpaceByVariations(f,g,c,5,a)}},HZ.productVariation.ListSelector=new function(){function a(a){var c=null;if(a&&a.hasOwnProperty("curVar")&&Object.keys(a.curVar).length&&a.hasOwnProperty("availVar")&&a.availVar.length){o=a.curVar;var d=p=a.availVar,e=d.map(function(a){return b(a)}).join("");c=HZ.utils.Html.template('<ul class="list-unstyled theme-list%className%">%themeSelectors%</ul>',{themeSelectors:e,className:q?" theme-list--loading":""})}return c}function b(a){var b=o,h=a.options.sort(function(a,b){var c=0;return a.avail!==b.avail?c=1===a.avail&&0===b.avail?-1:1:a.stock!==b.stock&&(c=1===a.stock&&0===b.stock?-1:1),c}),i=a.id,j=s===i,k=h.length,l=g(i,k),m=h.filter(function(a){return a.name===b[i]})[0],n={tag:"span",attr:{class:"text-unbold"}},p=["variation-theme","variation-theme--"+i];return j&&p.push("variation-theme--active"),k>8&&p.push("variation-theme--long"),HZ.utils.Html.template('<li class="%className%">%coverOption%<div class="theme-options theme-options--enter"><div class="theme-options-header">%optionsHeader%</div><ul class="theme-options-list list-unstyled">%themeOptions%</ul></div></li>',{coverOption:e({className:" theme-option--cover",thumb:d(m),label:_hgt("{themeNameWithCount}: <t1>{selectedOptionName}</t1>",{themeNameWithCount:l,selectedOptionName:m.name,t1:n}),note:null,price:null}),optionsHeader:c(a.label),themeOptions:f(h,m),className:p.join(" ")})}function c(a){return HZ.utils.Html.template('<div class="text-bold text-center">%content%</div><span class="theme-options-cancel">%cancel%</span>',{content:_hgt("Select {themeLabel}",{themeLabel:a}),cancel:_hgt("Cancel")})}function d(a){var b=HZ.utils.Config.emptyGifData,c=!1;if(a&&a.hasOwnProperty("imageId")){c=!0;var d=a.imageId,e=HZ.data.Images.get(d);b=HZ.utils.Links.getImageUrl(d,92,92,!0,e.ts,4)}return HZ.utils.Html.template('<img src="%thumbUrl%" width="46" height="46" class="%className%"/>%thumbIcon%',{thumbUrl:b,className:"theme-option-thumb-image",thumbIcon:c?"":'<span class="theme-option-no-image text-center"><i class="hzi-font hzi-camera-chat theme-option-no-image-icon"></i></span>'})}function e(a){return HZ.utils.Html.template('<div class="theme-option%className%"><span class="theme-option-thumb">%thumb%</span><span class="theme-option-text"><p class="theme-option-label text-bold mb0">%label%</p><p class="theme-option-note text-s mb0">%note%</p></span><span class="theme-option-price text-right">%price%</span><i class="hzi-font hzi-Down-Tri theme-toggle-icon"></i></div>',a)}function f(a,b){return a.map(function(a){var c=a===b,f=null;if(0===a.avail)f=_hgt("Available in other options");else if(0===a.stock)f=_hgt("Out of stock");else{var g=a.quantity;g&&g>0&&g<x&&(f=_hgt("Only {quantity} left!",{quantity:g}))}return'<li class="theme-options-option">'+e({thumb:d(a),label:a.name,note:f,price:a.price,className:c?" theme-option--current":""})+"</li>"}).join("")}function g(a,b){var c="";switch(a){case t:c=_hgtp("","Color","{count} Colors",b,{count:b});break;case u:c=_hgtp("","Size","{count} Sizes",b,{count:b});break;case w:c=_hgtp("","Configuration","{count} Configurations",b,{count:b});break;case v:c=_hgtp("","Design","{count} Designs",b,{count:b})}return c}function h(){p.forEach(function(a){var b=a.id;n.find(".variation-theme--"+b).each(function(a,c){if($(c).visible()){var d=$(c).find(".theme-options"),e=d.get(0).getBoundingClientRect();if(e){var f=!1,g=k.height()-y,h=e.height;g>h&&e.bottom>g&&e.top>h&&(f=!0),d.toggleClass("theme-options--pull-up",f)}r[b]=e}})})}var i,j,k,l,m,n,o={},p=[],q=!1,r={},s=null,t="c",u="s",v="dn",w="cf",x=10,y=100;this.initUI=function(){k=$(window),l=$("body"),m=$("#lbInfo .content-scroll"),n=$(".variationSelectors"),this.attachMouseEvents()},this.attachMouseEvents=function(){k.off(".variations"),l.off(".variations"),m.off(".variations"),n.off("click","**");var a=$.debounce(300,h);k.on("scroll.variations resize.variations",a),m.on("scroll.variations",a),l.on("click.variations",":not(.theme-option--cover)",this.handleBodyClick.bind(this)),n.on("click",".theme-list:not(.theme-list--loading) .variation-theme:not(.variation-theme--active)",this.handleThemeClick.bind(this)),n.on("click",".theme-list:not(.theme-list--loading) .variation-theme--active",this.hideThemeOptions.bind(this)),n.on("click",".theme-list:not(.theme-list--loading) .theme-option:not(.theme-option--cover)",this.handleOptionClick.bind(this))},this.getSelectedVariations=function(){return o},this.drawView=function(b){return i!==b&&(s=null),i=b,j=HZ.data.Variations.get(b),r={},a(j)},this.updateView=function(a){q=!1,i=a,this.refresh()},this.refresh=function(){n.empty().append(this.drawView(i)),setTimeout(function(){n.find(".theme-options--enter").removeClass("theme-options--enter")},100)},this.handleOptionClick=function(a){this.hideThemeOptions();var b=$(a.currentTarget),c=b.closest(".theme-options-option").index(),d=b.closest(".variation-theme").index(),e=p[d];if(e){var f=e.id,g=e.options[c].name;o[f]!==g&&(o[f]=g,q=!0,this.refresh(),HZ.productVariation.Manager.fetchAvailability(f))}},this.handleThemeClick=function(a){var b=$(a.currentTarget),c=p[b.index()];s=c.id,this.updateView(i),setTimeout(h,1)},this.handleBodyClick=function(a){s&&(this.hideThemeOptions(a),a.stopImmediatePropagation())},this.hideThemeOptions=function(a){s=null,$(".variation-theme--active .theme-options").fadeOut(250,function(){this.attachMouseEvents(),this.refresh()}.bind(this))}},HZ.productVariation.BoxLinkSelector2=new function(){function a(a){var c,d;$("#VariationTip").hide();var h=null;if(e=HZ.data.Variations.get(a),f={},e&&(c=e.availVar,d=e.curVar,g=$.extend({},d)),$.isArray(c)&&c.length>0&&Object.keys(d).length){h=$('<div class="mp-var-box"></div>');var i=c.length<2;c.forEach(function(a){f[a.id]=a.label}),c.forEach(function(a){var c=a.id,e=a.label,f=a.options,g=b(c,e,f,d,i);h.append(g)})}return h}function b(a,b,c,d,e){var j,l,m=d[a],n=null,o=$(HZ.utils.Html.template(h,{ATTRIBUTE_TITLE:b+" :"})).data("variation-id",a),p=o.find(".variationOptions"),q=c.every(function(a){return a.hasOwnProperty("imageId")&&a.imageId.length});if(c.forEach(function(b){var c=!!b.avail,d=!!b.stock,h={isAvailable:c,isInStock:d},o=b.name,r=b.imageId||null,s=o;if(j=b.name===m,r&&q){var t=HZ.data.Images.get(r),u=HZ.utils.Links.getImageUrl(r,66,66,!0,t.ts,4);s=HZ.utils.Html.template(k,{THUMB_URL:u})}var v="";if(h.isAvailable)h.isInStock||(v=_hgt("Out of Stock"));else{var w,x=[];Object.keys(f).forEach(function(b){b!==a&&(w=g[b],x.push(w))}),v=_hgt("Not Available in {unavailableConfigurations}",{unavailableConfigurations:x.join(" - ")})}l=$(HZ.utils.Html.template(i,{CONTENT:s})).data("option-value",o).data("option-flags",h).data("option-note",v).data("option-image-id",q?r:null),j&&(n=l);var y=l.find(".btn-variation");y.toggleClass("btn-variation-selected",j),y.toggleClass("btn-variation-oos",c&&!d||!c&&q),y.toggleClass("btn-variation-thumb",q),c||e||r||y.append("<sup>*</sup>"),p.append(l)}),o.toggleClass("variation-thumbs",q),q){var r=o.find(".variation-label"),s=n.data("option-value"),t=n.data("option-note"),u={tag:"span",attr:{class:"text-unbold"}},v=_hgt("{variationLabel} : {optionLabel}<t1>{optionNote}</t1>",{variationLabel:b,optionLabel:s,optionNote:t?[" (",t,")"].join(""):"",t1:u});r.html(v).data("variation-label",v)}return o}function c(a){var b=$(a.currentTarget),c=b.closest(".variation-option");c.tipBubble("hide"),c.siblings().find(".btn-variation").removeClass("btn-variation-selected"),b.addClass("btn-variation-selected");var d=c.parents(".variation").data("variation-id");g[d]=c.data("option-value"),HZ.productVariation.Manager.fetchAvailability(d)}function d(a){var b=$(a.currentTarget),c=(b.parents(".variation"),""),d=!!b.data("option-image-id");switch(a.type){case"mouseenter":var e,f=b.data("option-flags");b.data("option-note")&&(c=b.data("option-note")),c&&(e=HZ.utils.Html.template(j,{MESSAGE:c}));var g=$.extend({content:e,offsetX:b.outerWidth()/2-105},l);f.isAvailable&&f.isInStock||d||(b.tipBubble(g),b.tipBubble("show"));break;case"mouseleave":case"wheel":b.tipBubble("hide")}}var e,f,g={},h='<div class="variation">\t\t\t\t<div class="variationDisplay">\t\t\t\t\t<p class="variation-label text-bold mb0">%ATTRIBUTE_TITLE%</p>\t\t\t\t</div>\t\t\t\t<ul class="list-unstyled list-inline variationOptions"></ul>\t\t\t</div>',i='<li class="variation-option"><button class="btn btn-variation">%CONTENT%</button></li>',j='<p class="mb0">%MESSAGE%</p>',k='<img src="%THUMB_URL%" width="66" height="66"/>',l={id:"VariationTip",borderColor:"#ccc",point:"south",position:"absolute",fadeDuration:100,attachTo:"body",offsetY:7};this.initUI=function(){var a=$(".variationSelectors");a.on("click",".btn-variation",c),a.on("mouseenter mouseleave wheel",".variation-option",d)},this.getSelectedVariations=function(){return g},this.drawView=function(b){return a(b)},this.updateView=function(b){var c=HZ.data.Variations.get(b);!1===c.exactMatch&&(c.exactMatch=!0),$(".variationSelectors").empty().append(a(b))}},HZ.productVariation.BrowserHistoryManager=function(a){var b=location&&location.search?location.search:"";window.onpopstate=function(a){var b=a.state;b&&b.spaceId&&HZ.productVariation.Manager.applyHistoryState(b.spaceId,b.data)},this.updateHistory=function(c,d,e){var f=HZ.data.Spaces.get(c),g=history.state;if(f&&(g&&g.spaceId!==f.id||!g)){var h=HZ.utils.Styles.getStyleUrl(f.s),i=HZ.data.Categories.getCategoryById(f.cat),j=HZ.data.Users.get(f.ow),k=null;null!==j&&(k=j.d);var l=HZ.utils.PageTitles.getViewSpacePageTitle(f.t,h,i?i.name:null,f.ma,k),m=HZ.utils.Links.getSpaceLink(f.id);m=m.replace(/https?:/,""),e&&(m+=b);var n={spaceId:c,data:d};switch(a){case"push":e?history.replaceState(n,l,m):history.pushState(n,l,m);break;case"replace":history.replaceState(n,l,m)}}}};

window.hzmr.push("productVariation:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End productVariation.js  **************/
/************* Start extracting text for productListingInfoRenderer.js for locale it-IT **************/
(function(){var _hzxt={"This product cannot be returned.":"Questo prodotto non pu\u00f2 essere restituito.","Visit Store":"Sito del produttore","":""};for(var a in _hzxt){window._hzlang[a]=_hzxt[a];}})();
/*************  End extracting text for productListingInfoRenderer.js  **************/
/************* Start productListingInfoRenderer.js for locale it-IT **************/
try {HZ.ns("HZ.listingInfo"),HZ.listingInfo.Renderer=new function(){var a,b,c,d,e=101===HZ.utils.Config.currentSiteId||102===HZ.utils.Config.currentSiteId,f=null,g=_hgt("Buy from this Seller"),h=(_hgt("View Return Policy"),_hgt("Visit Store")),i=_hgt("Top Seller"),j=_hgt("Show Additional Sellers"),k=null,l=["SE","DK","DE","AU","RU","US","SG","IE","IT","FR","ES","GB","JP","IN","NZ","CA"],m='<li class="listing %SELECTED_CLASS%" objid="%OBJ_ID%" posid="%POS_ID%"><p class="product-price"><span class="text-xl text-bold">%PRICE%</span></p><p class="text-bold">%VENDOR_NAME% <span class="vendor-rate mrs">%VENDOR_RATE%</span><span class="shipping text-gray-lighter text-unbold text-m">%SHIPPING_COST%</span></p>'+(e?"":'<p><a class="return-policy text-primary"vendorId="%VENDOR_ID%" hid="%SPACE_ID%" href="javascript:;">%VENDOR_POLICIES%<span class="more-icon"></span></a></p>')+'<p class="lead-time">%LEAD_TIME%</p>%SHIPPING_RESTRICTION%%IMPORT_MESSAGE%%NON_RETURNABLE%<a class="btn btn-primary buy-button" data-listing-id="%LISTING_ID%" data-space-id="%SPACE_ID%" href="javascript:;">'+g+"</a></li>",n=0,o=0,p=[],q=[],r=0,s=0,t=0;this.setMountNode=function(a){f=a},this.updateView=function(g,h,i,l,m){var u=HZ.data.ProductsInfo.get(g);k=u?u.plid:-1,n=g,o=h,p=[],q=[];var v=HZ.data.ListingsInfo.get(h),w=v&&v.mpListing;(HZ.data.SpaceListingIds.get(g)||[]).forEach(function(a){var b=HZ.data.ListingsInfo.get(a);b&&a!=h&&(b.mpListing?p.push(b):b.ppcUrl&&q.push(b))}),r=p.length,s=q.length,t=r+s;var x="header-4",y=m?'<i class="hzi-font hz-panel__toggle"></i>':"";i&&(x="sectionTitle text-m text-bold");var z,A=_hgt("Shipping and Returns"),B=r||w?A:_hgt("Seller Information");if(f){var C=$(f).empty(),D=$('<div class="curMpListing"></div>');if(w){var E=HZ.utils.Links.getPageUrl("return-policy"),F=_hgt("Houzz 30-day Return Policy"),G=$('<h2 class="'+x+'"><span class="header-content">'+B+"</span>"+y+"</h2>").appendTo(D);e&&D.append('<a target="_blank" class="text-primary return-policy-link" href="'+E+'">'+F+'<span class="more-icon"></span></a>');$('<ul class="list-unstyled listings" compid="ven_lst_cur"></ul>').appendTo(D).append(this.renderListing(v,w,0)),C.append(D),m&&G.click(function(){$(".seller-shipping-info-collapse").toggleClass("seller-shipping-info-collapse--expanded")})}if(t>0){var H=$('<div class="otherListings"></div>');if(r>0){z=_hgtp("","Also available from this seller on Houzz","Also available from these sellers on Houzz",r),a=$('<h2 class="'+x+' mpp collapsed">'+z+"</h2>").appendTo(H),b=$(this.renderListingGroup(p,!0)).appendTo(H);var I=3;if($.isNumeric(l)&&(I=l),r>I){var J=$('<button class="btn btn-secondary btn-block">'+j+"</button>");3!=I&&(J=$('<a href="javascript:;" class="colorLink text-bold moreListings">'+j+'<span class="more-icon"></span></a>')),J.appendTo(H),J.click(function(){b.removeClass("collapsed"),$(this).remove()})}}s>0&&(z=_hgtp("","Available from this External Website","Available from {numberOfWebsites} External Websites",s,{numberOfWebsites:s}),c=$('<h2 class="'+x+' ppc collapsed">'+z+'<i class="more-icon"></i></h2>'),3!=I&&(c=$('<a href="javascript:;" class="colorLink text-bold ppc collapsed">'+z+'<i class="more-icon"></i></a>')),c.appendTo(H),d=$(this.renderListingGroup(q,!1)).appendTo(H),c.click(function(){c.add(d).toggleClass("collapsed")})),C.append(H)}}},this.renderListingGroup=function(a,b){var c;return a&&(c=$('<ul class="list-unstyled listings trackMe" compid="ven_lst_grp"></ul>').addClass(b?"mpp":"ppc").addClass("collapsed"),a.forEach(function(a,d){c.append(this.renderListing(a,b,d))}.bind(this))),c},this.renderListing=function(a,b,c){var d,f=k==a.lid;if(a&&(a.avail||f)){var g,j=a.lid,p=n,q=HZ.data.Spaces.get(p),r=HZ.data.ProductsInfo.get(p),s=j==o,t=HZ.data.Users.get(a.vid),u=a.useShippingCalculator;if(b){var v=a.vfs||!1,w=a.fs,x=a.efs,y=a.ret,z=a.fsm,A="",B="",C="";u||(f?e&&(A=v&&HZ.lb.Config.isTradePro?_hgt("- Pay one shipping fee of {shippingCost} for all items from {manufacturer}.",{shippingCost:a.shpc,manufacturer:r.manuName}):w?_hgt(" - Free Shipping!"):x?_hgt("Free Shipping over {freeShippingMinimum} for <t1>eligible</t1> products",{freeShippingMinimum:z,t1:{tag:"span",attr:{class:"highlighted"}}}):_hgt("+{shippingCost} Shipping",{shippingCost:a.shpc}),(w||x)&&(B=HZ.utils.Html.template("<p>%NOTE%</p>",{NOTE:_hgt("Note: Free shipping is not available to AK, HI, PR or Canada. Some exclusions apply.")})),y||(C=HZ.utils.Html.template('<p class="text-muted">%NOTE%</p>',{NOTE:_hgt("Non-Returnable. <t1></t1>",{t1:{tag:"span",attr:{class:"listing__non-returnable hzi-font hzi-Info text-l"}}})}))):A=w?_hgt(" - Free Shipping!"):_hgt("+{shippingCost} Shipping",{shippingCost:a.shpc}));var D="";if(a.hasOwnProperty("ifcc")&&a.ifcc.length){var E=a.ifcc.toUpperCase();-1===l.indexOf(E)&&(E="other");var F=a.ifc;D=HZ.utils.Html.template('<span class="country-flag country-flag--%COUNTRY_CODE%"></span> %IMPORT_MESSAGE%',{COUNTRY_CODE:E,IMPORT_MESSAGE:_hgt("Shipped from {importCountry}",{importCountry:F})})}var G=a.dv?"":t&&t.topsell?i:"",H=HZ.utils.Links.getSoldByLink(a.vid),I=HZ.utils.Html.template('<a target="_blank" href="%LINK_URL%" title="%TITLE_ATTR%">%LINK_TEXT%</a>',{LINK_URL:H,TITLE_ATTR:"",LINK_TEXT:t?f?_hgt("Sold by {vendorName}",{vendorName:t.d}):t.d:""}),J=a.dv?"Sold by Houzz":I;g={SELECTED_CLASS:s?"current":"",PRICE:a.p,SHIPPING_COST:A,VENDOR_NAME:J,VENDOR_RATE:G,LEAD_TIME:a.ltime,VENDOR_ID:a.vid,SPACE_ID:n,VENDOR_POLICIES:_hgt("View Return Policy"),SHIPPING_RESTRICTION:B,NON_RETURNABLE:C,IMPORT_MESSAGE:D,POS_ID:c,OBJ_ID:a.vid},d=$(HZ.utils.Html.template(m,g)),d.on("click",".buy-button",{listingId:j,spaceId:p},this.handleBuyClick.bind(this)).on("click",".return-policy",HZ.module.ReturnPolicy.handleReturnPolicyClick);var K=d.find("span.highlighted");if(K.length){var L=_hgt('Most products on Houzz ship for free. To confirm whether an item has free shipping, simply look for the "Free Shipping!"');K.on("click",function(){var a=$(this);a.tipBubble({id:"eligible-free-tooltip",content:HZ.utils.Html.template('<div class="product-seller-tooltip__body"><p class="product-seller-tooltip__message mb0">%TOOLTIP_MESSAGE%</p></div>',{TOOLTIP_MESSAGE:L}),point:"north",offsetX:-Math.round(a.position().left)+(HZ.utils.Config.isResponsive?10:-44),offsetY:0,width:"278px",position:"absolute",showCloseBtn:!0,borderColor:"#ccc",fadeDuration:0})})}var M=d.find(".listing__non-returnable");M.length&&M.hover(function(){$(this).tipBubble({content:_hgt("This product cannot be returned."),point:"south",id:"sidebar-return-tooltip",width:200,offsetX:-18,offsetY:2,borderColor:"#ccc",showCloseBtn:!1,position:"absolute",fadeDuration:0,bubblePadding:"4px"})},function(){$(this).tipBubble("hide")})}else g={SELECTED_CLASS:s?"current":"",PRICE:a.p,VENDOR_NAME:t.d,VISIT_STORE_URL:a.ppcUrl?a.ppcUrl:q.tl,VISIT_MESSAGE:s?"":h,POS_ID:c,OBJ_ID:a.vid},d=$(HZ.utils.Html.template('<li class="listing %SELECTED_CLASS%" objid="%OBJ_ID%" posid="%POS_ID%"><p class="text-bold">%VENDOR_NAME%</p><p class="price"><span class="product-price text-xl text-bold">%PRICE%</span></p><a class="btn btn-primary visit-store-button" href="%VISIT_STORE_URL%" target="_blank">%VISIT_MESSAGE%</a></li>',g))}return d},this.handleBuyClick=function(a){var b=a.data;HZ.cart.Actions.addItem(b.spaceId,b.listingId,1)}};

window.hzmr.push("productListingInfoRenderer:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End productListingInfoRenderer.js  **************/
/************* Start extracting text for availabilityNotification.js for locale it-IT **************/
(function(){var _hzxt={"Check Availability":"Controlla la disponibilit\u00e0","We're sorry, but an unexpected error has occurred. Please try again later.":"Siamo spiacenti, si \u00e8 verificato un errore imprevisto. Riprova pi\u00f9 tardi."};for(var a in _hzxt){window._hzlang[a]=_hzxt[a];}})();
/*************  End extracting text for availabilityNotification.js  **************/
/************* Start availabilityNotification.js for locale it-IT **************/
try {HZ.ns("HZ.module"),HZ.module.AvailabilityNotification=new function(){function a(a){if(a&&"true"===a.success){var e={tag:"a",attr:{href:HZ.utils.Links.getGalleryLink(a.wishListGalleryId),target:"_blank",class:"colorLink"}},f=HZ.utils.Html.template(d,{TITLE:a.added?_hgt("This product has already been added to your <t1>Wish List</t1> and you'll be emailed when it's back in stock.",{t1:e}):_hgt("We'll email you when this product is back in stock!"),IMG_SRC:HZ.utils.Links.getSpaceImageUrl(a.spaceId,200,200),MESSAGE:a.added?HZ.data.Spaces.get(a.spaceId).t:_hgt("To help you keep track of {productName}, we've added it to your <t1>Wish List</t1>",{productName:HZ.data.Spaces.get(a.spaceId).t,t1:e})});HZ.ui.yamdi.Common.hideAllDialogs(),HZ.ui.yamdi.Common.alert(_hgt("We'll let you know"),f)}else HZ.ui.yamdi.Common.hideAllDialogs(),HZ.ui.yamdi.Common.alert(b,a.error?a.error:c)}var b=_hgt("Check Availability"),c=_hgt("We're sorry, but an unexpected error has occurred. Please try again later."),d="<div class='row'><div class='col-xs-12 header-6 text-center'>%TITLE%</div></div><div class='row'><div class='col-xs-12 text-center'><img src='%IMG_SRC%'></div></div><div class='row'><div class='col-xs-12 text-center'><p>%MESSAGE%</p></div></div>";this.handleAddToWishListResponse=function(b){a(b)}};

window.hzmr.push("availabilityNotification:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End availabilityNotification.js  **************/
/************* Start extracting text for qtySelector.js for locale it-IT **************/
(function(){var _hzxt={"Cancel":"Annulla","Quantity:":"Quantit\u00e0:"};for(var a in _hzxt){window._hzlang[a]=_hzxt[a];}})();
/*************  End extracting text for qtySelector.js  **************/
/************* Start qtySelector.js for locale it-IT **************/
try {HZ.ns("HZ.QtySelector"),HZ.QtySelector=function(){function a(){this.$container=null,this.$selectContainer=null,this._showMobileDialog=!0,this._changeCallbacks=[]}var b=/^0+/,c=/[^0-9]/g,d=null;return a.prototype.init=function(a,b){var c=$(a);c.is("select")?(this.$select=c,this.$select.data("defVal",this.$select.val()),this.$select.on("change.qty",this.handleSelectChange.bind(this))):c.is("input[type=text]")&&(this.$input=c,this.addInputDataAndEvents())},a.prototype.destroy=function(){this._changeCallbacks=[],this.$select&&this.$select.off(".qty"),this.$input&&this.$input.off(".qty")},a.prototype.addChangeListener=function(a){this._changeCallbacks.push(a)},a.prototype.handleSelectChange=function(a,b){this.$selectContainer||(this.$selectContainer=this.$select.parent(),this.$container=this.$selectContainer.parent());var c,d;if("10+"===this.$select.val()){var e=this.buildInput();c=document.activeElement,c.blur(),this.$selectContainer.detach(),this.$container.append(e).css("marginRight",0),this.$input[0].focus()}else this.$select.data("defVal",this.$select.val()),d=b||{type:"select"},this.callChangeCallbacks(this.$select.val(),d)},a.prototype.updateQuantity=function(a){var b;this.$selectContainer||(this.$selectContainer=this.$select.parent(),this.$container=this.$selectContainer.parent()),!this.$input&&a<10?(this.$select.val(a),this.$select.trigger("change",{type:"external"})):(this.$input||(b=this.buildInput(),this.$selectContainer.detach(),this.$container.append(b).css("marginRight",0)),this.$input.val(a),this.callChangeCallbacks(this.$input.val(),{type:"external"}))},a.prototype.callChangeCallbacks=function(a,b){for(var c=0,d=this._changeCallbacks.length;c<d;c++)this._changeCallbacks[c](a,b)},a.prototype.handleBlur=function(a){var c=this.$input.val(),d=this.$input[0].defaultValue;HZ.events&&HZ.events.publish("quantity:stop"),""===c&&(this.$input.val(d||10),this.$input.trigger("change"),c=this.$input.val()),"0"!==c&&this.$input.val(c.replace(b,"")),this.$input[0].defaultValue=this.$input.val(),this.callChangeCallbacks(this.$input.val(),{type:"input"})},a.prototype.handleFocus=function(a){var b=this.$input;if(HZ.utils.Config.isResponsive&&this._showMobileDialog){if(parseInt(b.val())<10)return this.prepareDialog(b),a.preventDefault(),!1}HZ.QtySelector.utils.highlightInput(b),HZ.events&&HZ.events.publish("quantity:start")},a.prototype.handleKeydown=function(a){var b=a.which;return a.isShift||!HZ.QtySelector.utils.isAllowedKey(b)&&!HZ.QtySelector.utils.isNumber(b)?(a.preventDefault(),!1):("0"===this.$input.val()&&9!==b&&this.$input.val(""),!0)},a.prototype.handlePaste=function(a){window.setTimeout(function(){var a=this.$input.val();this.$input.val(a.replace(c,""))}.bind(this))},a.prototype.buildInput=function(){var a=this.$selectContainer.outerWidth(),b=this.$select.attr("id"),c=this.$select.attr("class"),d=this.$select.data("defVal"),e=$("<input>").attr({type:"text",id:b}).val(d).addClass(c).css({width:a});return e[0].defaultValue=d,this.$input=e,this.addInputDataAndEvents(),e},a.prototype.disable=function(){var a=this.$input||this.$select;a&&(a.prop("disabled",!0),a===this.$select&&this.$select.parent().addClass("disabled"))},a.prototype.enable=function(){var a=this.$input||this.$select;a&&(a.prop("disabled",!1),a===this.$select&&this.$select.parent().removeClass("disabled"))},a.prototype.addInputDataAndEvents=function(){this.$input.on("keydown.qty",this.handleKeydown.bind(this)).on("paste.qty",this.handlePaste.bind(this)).on("focus.qty",this.handleFocus.bind(this)).on("blur.qty",this.handleBlur.bind(this)).attr({maxlength:4,pattern:"\\d*"}),this.$input.val()||this.$input.val(10),HZ.utils.Config.isResponsive&&this.$input.val()<10&&this.$input.addClass("fake-dd")},a.prototype.prepareDialog=function(a){var b='<label class="option"><input %CHECKED% type="radio" value="%VAL%" name="%NAME%"><span class="radio-text text-l">%DISPLAY%</span></label>',c=parseInt(a.val());if(!d){var e=[HZ.ui.InputButtonUtils.createSecondaryInputButton(_hgt("Cancel"),"hzConfirmDlgCancelBtn",function(){HZ.ui.Yamdi.hide()})];d=new HZ.ui.yamdi.Dialog,d.init({dialogClassName:"mobileQuantityDlg",controls:e,sidebarMode:"sidebar-skinny"})}for(var f="",g="",h=a.attr("id")+"-rad",i=parseInt(a.data("max-quantity"),10)||10,j=Math.min(i+1,10),k=1;k<j;k++)g=c===k?"checked":"",f+=HZ.utils.Html.template(b,{CHECKED:g,VAL:k,DISPLAY:k,NAME:h});i>=10&&(f+=HZ.utils.Html.template(b,{CHECKED:"",VAL:"10+",DISPLAY:"10+",NAME:h}));var l=function(b){var c=$(b.currentTarget).val(),d=a.data("cart-id"),e=a.data("item-id");if("10+"===c){var f=a[0].defaultValue;this._showMobileDialog=!1,a.val(f).removeClass("fake-dd").focus(),$("html,body").animate({scrollTop:a.offset().top-40}),a.trigger("change")}else a.val(c),HZ.events&&d&&e?HZ.events.publish("cart:update",d,e):a.trigger("change");HZ.ui.Yamdi.hide()},m=function(){var a=d.getBody().find("input[type=radio]");a.filter(":checked").focus(),a.on("change.qtySelector",l.bind(this))},n=function(){d.getBody().find("input[type=radio]").off(".qtySelector")};d.setTitle(_hgt("Quantity:")),d.setViewLoaded(m.bind(this)),d.setViewUnloaded(n),d.setBody(f),HZ.ui.Yamdi.show(d)},a}(),HZ.QtySelector.BoxSelector=function(){function a(a){this.cache={},this.sid=a.spaceId,this.lid=a.listingId,this.unit=a.unit,this.area=a.area,this.qtySelector=a.qtySelector,this.coverageInput=a.coverageInput,this.calculationsEl=a.calculationsEl,this.percentToggle=a.percentToggle,this.addEvents()}return a.prototype.destroy=function(){this.$input&&this.$input.off(".boxSelector")},a.prototype.addEvents=function(){var a=$(this.coverageInput);a.on("input.boxSelector",$.debounce(1e3,this.handleCoverageChange.bind(this))).on("focus.boxSelector",this.handleFocus.bind(this)).on("blur.boxSelector",this.handleBlur.bind(this)).attr({maxlength:4,pattern:"\\d*.\\d{0,2}"}),this.$input=a},a.prototype.handleCoverageChange=function(a){var b=parseFloat(this.coverageInput.value,10);!!this.percentToggle&&this.percentToggle.checked&&(b+=.1*b);var c=Math.ceil(b/this.area);this.qtySelector.updateQuantity(c)},a.prototype.handleFocus=function(){HZ.events&&HZ.events.publish("quantity:start")},a.prototype.handleBlur=function(){HZ.events&&HZ.events.publish("quantity:stop")},a.prototype.disable=function(){this.coverageInput.disabled=!0,$(this.coverageInput.parentNode).addClass("disabled"),this.qtySelector.disable()},a.prototype.enable=function(){this.coverageInput.disabled=!1,$(this.coverageInput.parentNode).removeClass("disabled"),this.qtySelector.enable()},a.prototype.calculate=function(a){if(this.cache[a])return this.render(this.cache[a]),$.Deferred().resolve(this.cache[a]);var b=this;return this.disable(),HZ.ajaz.Tile.calculate(a,this.sid,this.lid,function(c){var d=c.coverage,e=c.totalPrice,f=c.unitString,g={quantity:parseInt(a,10),coverage:d,totalPrice:e,unitString:f};return b.enable(),b.render(g),b.cache[a]=g,g})},a.prototype.render=function(a){var b="",c={quantity:a.quantity,totalArea:a.coverage,unit:this.unit,t1:{tag:"span",attr:{class:"text-bold"}}};switch(a.unitString){case"box":b=_hgtp("--","1 box, covers <t1>{totalArea} {unit}</t1>","{quantity} boxes, covers <t1>{totalArea} {unit}</t1>",a.quantity,c);break;case"sheet":b=_hgtp("--","1 sheet, covers <t1>{totalArea} {unit}</t1>","{quantity} sheets, covers <t1>{totalArea} {unit}</t1>",a.quantity,c);break;case"piece":b=_hgtp("--","1 piece, covers <t1>{totalArea} {unit}</t1>","{quantity} pieces, covers <t1>{totalArea} {unit}</t1>",a.quantity,c);break;case"roll":b=_hgtp("--","1 roll, covers <t1>{totalArea} {unit}</t1>","{quantity} roll, covers <t1>{totalArea} {unit}</t1>",a.quantity,c)}var d=_hgt("Total: {totalPrice}",{totalPrice:a.totalPrice}),e=$(this.calculationsEl).find(".coverage-string"),f=$(this.calculationsEl).find(".coverage-price");e.html(b),f.text(d)},a.prototype.updateCoverageInput=function(a){this.coverageInput.value=a},a}(),HZ.QtySelector.utils={isNumber:function(a){return a>=48&&a<=57||a>=96&&a<=105},isAllowedKey:function(a){return[8,9,37,39].indexOf(a)>-1},highlightInput:function(a,b){window.setTimeout(function(){a.select(),a[0].setSelectionRange(0,9999),b&&b()},0)}};

window.hzmr.push("qtySelector:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End qtySelector.js  **************/
/************* Start extracting text for productQuantityRenderer.js for locale it-IT **************/
(function(){var _hzxt={"Add 10% more for cuts, breaks and waste.":"Considera l'acquisto di un 10% addizionale, nel caso in cui il materiale si rompa o tu lo voglia tagliare","Sold Out":"Esauriti","Only {quantity} Left!":"Ne restano solo {quantity}!","Quantity:":"Quantit\u00e0:"};for(var a in _hzxt){window._hzlang[a]=_hzxt[a];}})();
/*************  End extracting text for productQuantityRenderer.js  **************/
/************* Start productQuantityRenderer.js for locale it-IT **************/
try {HZ.ns("HZ.productQuantity"),HZ.productQuantity.Renderer=new function(){var a,b=null,c=null,d=null,e=null,f={PRODUCT_QUANTITY:'<div class="%CONTAINER_CLASSES%"><label for="qtySelector" class="%LABEL_CLASSES%">%QUANTITY_LABEL%</label><select id="qtySelector" class="form-control">%QTY_OPTIONS%</select></div>',QUANTITY_COMMENT:'<div class="qty-comment %CLASS%">%QTY_COMMENT%</div>',QUANTITY_OPTION:'<option value="%QTY%">%QTY_LABEL%</option>',BOX_FORM:'<div class="soldByBox__form"><div class="one-line"><label for="coverageInput" class="text-bold">%COVERAGE_LABEL%</label><span class="input-container"><input id="coverageInput" class="coverage-input" type="number" min="0.01" step="0.01" max="2500" value="%COVERAGE_AREA%"/><span class="coverage-unit text-muted text-xs">%UNIT%</span></span></div><div class="one-line mtm">%QUANTITY%</div></div>',BOX_CALCULATIONS:'<div class="soldByBox__calculations" id="coverageCalculations"><p class="text-m mbs coverage-string">%COVERAGE%</p><p class="text-bold text-xl mb0 coverage-price">%PRICE%</p></div>',BOX_TEN_PERCENT:'<p class="text-s text-muted mtm coverage-ten-percent custom-cb"><input type="checkbox" id="coverageToggle" checked/><label for="coverageToggle" class="custom-cb-label mb0">%LABEL% </label> <span class="sold-by-box--tt-trigger text-primary">%WHY_LABEL%</span></p>'};this.setMountNode=function(b){a=b},this.refresh=function(){a&&this.updateView(d,e)},this.updateView=function(f,g){var h,i,j=HZ.data.ListingsInfo.get(g);d=f,e=g,a.empty(),a.append(this.getQuantityHtml(j)),b&&b.destroy(),c&&c.destroy(),HZ.QtySelector&&(i=document.getElementById("qtySelector"),i&&"SELECT"===i.nodeName.toUpperCase()&&$(i).customDropdown(),b=new HZ.QtySelector,b.init(i),j&&j.sbb&&(h={spaceId:f,listingId:j.lid,unit:j.sbbUnit,area:j.sbbCoverage,qtySelector:b,coverageInput:document.getElementById("coverageInput"),calculationsEl:document.getElementById("coverageCalculations"),percentToggle:document.getElementById("coverageToggle")},c=new HZ.QtySelector.BoxSelector(h),b.addChangeListener(function(a,b){c.calculate(a).done(function(a){"external"!==b.type&&c.updateCoverageInput(a.coverage)})})))},this.getQuantityHtml=function(a){var b,c=$("<div>"),d="",e="",g=!!a&&a.avail;if(!!a&&a.buyable)if(g){var h=parseInt(a.q,10);a.sbb?(c.append(this.getBoxQuantityNode(a)),c.append($(HZ.utils.Html.template(f.BOX_TEN_PERCENT,{LABEL:_hgt("Add 10% for waste."),WHY_LABEL:_hgt("Why?")})))):(h<10?d=_hgt("Only {quantity} Left!",{quantity:h}):HZ.lb.Config.alwaysShowQtyStr&&(d=_hgt("10 or more in stock")),b=this.getQuantityDropdownNode(h,null),b.appendTo(c))}else d=_hgt("Sold Out"),e="sold-out";return d&&c.append($(HZ.utils.Html.template(f.QUANTITY_COMMENT,{QTY_COMMENT:d,CLASS:e}))),c.html()},this.getBoxQuantityNode=function(a){var b,c=$('<div id="soldByBox"/>').addClass("soldByBox__container"),d=parseInt(a.q,10),e=a.sbbUnitStr,g=this.getQuantityDropdownNode(d,e),h=$("<div/>").append(g),i=$(HZ.utils.Html.template(f.BOX_FORM,{QUANTITY:h.html(),COVERAGE_LABEL:_hgt("Covers:"),UNIT:a.sbbUnit,COVERAGE_AREA:a.sbbCoverage})),j={coverage:a.sbbCoverage,unit:a.sbbUnit,t1:{tag:"span",attr:{class:"text-bold"}}};switch(e){case"box":b=_hgt("1 box, covers <t1>{coverage} {unit}</t1>",j);break;case"sheet":b=_hgt("1 sheet, covers <t1>{coverage} {unit}</t1>",j);break;case"piece":b=_hgt("1 piece, covers <t1>{coverage} {unit}</t1>",j);break;case"roll":b=_hgt("1 roll, covers <t1>{coverage} {unit}</t1>",j)}var k=$(HZ.utils.Html.template(f.BOX_CALCULATIONS,{COVERAGE:b,PRICE:_hgt("Total: {price}",{price:a.sbbBoxPrice})}));return c.append(i,k),c},this.getQuantityDropdownNode=function(a,b){var c,d=Math.min(a,9),e=[],g=_hgt("Quantity:"),h="",i="";null===b&&HZ.lb.Config.isMainProdBtnQuantityInline&&(b="qty");for(var j=1;j<=d;j++){switch(b){case"box":c=_hgtp("0 boxes","1 box","{quantity} boxes",j,{quantity:j});break;case"sheet":c=_hgtp("0 sheets","1 sheet","{quantity} sheets",j,{quantity:j});break;case"piece":c=_hgtp("0 pieces","1 piece","{quantity} pieces",j,{quantity:j});break;case"roll":c=_hgtp("0 rolls","1 roll","{quantity} rolls",j,{quantity:j});break;case"qty":c=_hgt("Quantity: {quantity}",{quantity:j}),g="";break;default:c=j,h="form-inline"}e.push(HZ.utils.Html.template(f.QUANTITY_OPTION,{QTY:j,QTY_LABEL:c}))}if(b&&(i="text-bold"),a>9){switch(b){case"box":c=_hgt("{maxQuantity}+ boxes",{maxQuantity:10});break;case"sheet":c=_hgt("{maxQuantity}+ sheets",{maxQuantity:10});break;case"piece":c=_hgt("{maxQuantity}+ pieces",{maxQuantity:10});break;case"roll":c=_hgt("{maxQuantity}+ rolls",{maxQuantity:10});break;default:c="10+"}e.push(HZ.utils.Html.template(f.QUANTITY_OPTION,{QTY:"10+",QTY_LABEL:c}))}return $(HZ.utils.Html.template(f.PRODUCT_QUANTITY,{CONTAINER_CLASSES:h,LABEL_CLASSES:i,QUANTITY_LABEL:g,QTY_OPTIONS:e.join("")}))}};

window.hzmr.push("productQuantityRenderer:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End productQuantityRenderer.js  **************/
/************* Start extracting text for reportProduct.js for locale it-IT **************/
(function(){var _hzxt={"Report Incorrect Info or Image":"Segnala immagine o informazioni errate","Check all that apply:":"Seleziona tutto ci\u00f2 che ritieni appropriato:","Comment (optional):":"Commento (opzionale)","Please select at least one reason":"Seleziona almeno un motivo","Report Submitted":"Segnalazione inviata","Thank you for submitting this report. We'll review this item shortly and make changes as necessary.":"Grazie per aver inviato la segnalazione. Revisioneremo in breve l'articolo interessato ed effettueremo le modifiche necessarie.","We're sorry, but an unexpected error has occurred. Please try again later.":"Siamo spiacenti, si \u00e8 verificato un errore imprevisto. Riprova pi\u00f9 tardi.","Loading...":"Caricamento in corso...","Cancel":"Annulla","Submit":"Invia"};for(var a in _hzxt){window._hzlang[a]=_hzxt[a];}})();
/*************  End extracting text for reportProduct.js  **************/
/************* Start reportProduct.js for locale it-IT **************/
try {HZ.ns("HZ.module"),HZ.module.ReportProduct=new function(){function a(a,e){if(a&&"true"==a.success){HZ.ui.yamdi.Common.hideAllDialogs();var f='<div id="reportProductAlert" class="report-product-alert text-m hidden"></div>';f+='<div class="report-product-title-check text-m">'+_hgt("Check all that apply:")+"</div>",f+=b(a.flagReasons.image,"flagReasonCheckBox"),f+=b(a.flagReasons.data,"flagReasonCheckBox"),f+=b(a.flagReasons.others,"flagReasonCheckBox"),f+=b(a.flagReasons.users,"flagReasonCheckBox"),f+=b(a.newFlagReasons,"newFlagReasonCheckBox"),f+='<div class="report-product-title-comment text-m">'+_hgt("Comment (optional):")+"</div>",f+='<textarea class="report-product-comment-box" cols=50 rows=10 id="flagReasonComments" maxlength="2000"></textarea>',g.setBody(f);var h,i;h=HZ.ui.InputButtonUtils.createSecondaryInputButton(_hgt("Cancel"),"",$.proxy(c,this)),i=HZ.ui.InputButtonUtils.createPrimaryInputButton(_hgt("Submit"),"",$.proxy(d,this));var j=$("<div id='reportProductDlgFooter'></div>").append(h).append(i);g.setFooter(j),$(document).trigger("keyboardHandlerRequired",{source:this,event:e}),HZ.ui.Yamdi.show(g,function(){$(document).trigger("keyboardHandlerReleased",{source:this,event:e})})}else HZ.ui.yamdi.Common.alert(_hgt("Error"),_hgt("We're sorry, but an unexpected error has occurred. Please try again later."))}function b(a,b){var c="";if(a)for(var d in a)c+=HZ.utils.Html.template(f,{FLAG_REASON_CLASS:b,FLAG_REASON_ID:d,FLAG_REASON_TEXT:_hgt(a[d])});return c}function c(){HZ.ui.yamdi.Common.hideAllDialogs()}function d(){var a=$(".flagReasonCheckBox"),b=$(".newFlagReasonCheckBox"),c=null,d=[];if($.each(a,function(a,b){b.checked&&(c||(c=0),c|=b.value)}),$.each(b,function(a,b){b.checked&&d.push(b.value)}),null!==c||d.length>0){var f=$("#flagReasonComments").val();HZ.ajaz.Services.ReportProduct.flagProduct(h,c,d.join(","),f,e)}else{var g=$("#reportProductAlert");g.html(_hgt("Please select at least one reason")),g.removeClass("hidden")}}function e(a){HZ.ui.yamdi.Common.hideAllDialogs(),a&&"true"==a.success?HZ.ui.yamdi.Common.alert(_hgt("Report Submitted"),_hgt("Thank you for submitting this report. We'll review this item shortly and make changes as necessary.")):HZ.ui.yamdi.Common.alert(_hgt("Error"),_hgt(a.error))}var f='<div class="report-product-item text-m"><input class="%FLAG_REASON_CLASS%" id="%FLAG_REASON_ID%" value="%FLAG_REASON_ID%" type="checkbox">&nbsp;&nbsp;<label for="%FLAG_REASON_ID%">%FLAG_REASON_TEXT%</label></div>',g=new HZ.ui.yamdi.Dialog,h=null;g.init({title:_hgt("Report Incorrect Info or Image"),dialogClassName:"reportProductDlg"}),this.handleReportProductClick=function(b){h=b,HZ.ui.yamdi.Common.loading(_hgt("Loading...")),HZ.ajaz.Services.ReportProduct.getFlagReasons(h,a)}};

window.hzmr.push("reportProduct:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End reportProduct.js  **************/
/************* Start extracting text for changeShipToLocation.js for locale it-IT **************/
(function(){var _hzxt={"Change Shipping Location":"Modifica l'indirizzo di consegna","Enter US zip or city":"Inserisci CAP o localit\u00e0","(change)":"(modifica)","Cancel":"Annulla","Update":"Aggiorna"};for(var a in _hzxt){window._hzlang[a]=_hzxt[a];}})();
/*************  End extracting text for changeShipToLocation.js  **************/
/************* Start changeShipToLocation.js for locale it-IT **************/
try {HZ.ns("HZ.module"),HZ.module.ChangeShipToLocation=new function(){var a,b,c,d,e,f,g='<div class="change-shipto-location-dialog__content"><div class="header-2 change-shipto-location-dialog__title">'+_hgt("Change Shipping Location")+'</div><div class="change-shipto-location-dialog__autocomplete-wrapper"><input type="text" class="change-shipto-location-dialog__input form-control input-lg" id="changeShipToLocationInput" value="%CURRENT_LOCATION_STRING%" placeholder="'+_hgt("Enter US zip or city")+'" spellcheck="false" autocomplete="off" autofocus/><div class="change-shipto-location-dialog__autocomplete-container" id="changeShipToLocationAutoSuggestContainer"></div><div id="changeShipToLocationAlert" class="change-shipto-location-dialog__alert text-m hidden"></div></div></div>';this.handleChangeShipToLocationResponse=function(a){if(a&&"true"==a.success){var e=a.result;e&&e.leadTimeText&&d&&this.mountLeadTimeTextAndLink(e.leadTimeText,e.shipToZip,d),HZ.ui.yamdi.Common.hideAllDialogs()}else if(a&&a.error){var f=$("#changeShipToLocationAlert");f.html(_hgt(a.error)),f.removeClass("hidden")}else this.mountLeadTimeTextAndLink(b,c,d),HZ.ui.yamdi.Common.hideAllDialogs()},this.changeShipToLocation=function(){var b=$.trim($("#changeShipToLocationInput").val());HZ.ajaz.Services.ChangeShipToLocation.getShipTransitTime(a,b,$.proxy(this.handleChangeShipToLocationResponse,this))},this.locationAutoComplete=function(a,b){HZ.ajaz.Services.autoCompleteLocation(a,function(c){b(c.autocompleteList,a)},"US")},this.registerAutoComplete=function(){void 0===e&&(e=new HZ.search.AutoSuggest,e.init({autoComplete:!0,searchInputBoxId:"changeShipToLocationInput",autoSuggestContainerId:"changeShipToLocationAutoSuggestContainer",source:$.proxy(this.locationAutoComplete,this),onEnter:$.proxy(this.changeShipToLocation,this)}))},this.prepareDialog=function(){if($(".change-shipto-location-dialog").length<=0){var a=$(HZ.utils.Html.template(g,{CURRENT_LOCATION_STRING:c})),b=$('<button type="button" class="btn btn-secondary">'+_hgt("Cancel")+"</button>").click($.proxy(this.closeDialog,this)),d=$('<button type="submit" class="btn btn-primary">'+_hgt("Update")+"</button>").click($.proxy(this.changeShipToLocation,this));f=new HZ.ui.yamdi.Dialog,f.init({dialogClassName:"change-shipto-location-dialog shareGalleryUrlInput",title:"",controls:[b,d],onViewLoaded:$.proxy(this.registerAutoComplete,this)}),f.setBody(a)}},this.closeDialog=function(){HZ.ui.yamdi.Common.hideAllDialogs()},this.showDialog=function(a){$(document).trigger("keyboardHandlerRequired",{source:this,event:a}),HZ.ui.Yamdi.show(f,function(){$(document).trigger("keyboardHandlerReleased",{source:this,event:a})});var b=$("#changeShipToLocationInput");b.focus(),b.val(""),b.attr("placeholder",HZ.data.cacheShipToZip)},this.mountLeadTimeTextAndLink=function(a,b,c){if(b){$(c).html(""),$(c).append(_hgt(a+";&nbsp;ships to&nbsp;"));var d=$('<a id="changeShipToLocationLink" class="colorLink change-shipto-location__link text-m">'+_hgt(b)+"&nbsp;"+_hgt("(change)")+"</a>").click($.proxy(this.showDialog,this));$(c).append(d),HZ.data.cacheShipToZip=b}else $(c).html(_hgt(a))},this.init=function(e){if(e.leadTimeStr&&e.attachPointSelector){b=e.leadTimeStr,d=e.attachPointSelector,a=e.listingId;var f=HZ.data.ListingsInfo.get(a);f&&f.mpListing&&(c=e.shipToZip,$(".change-shipto-location-dialog").length>0&&HZ.data.cacheShipToZip&&HZ.data.cacheShipToZip!=c?this.changeShipToLocation():(this.mountLeadTimeTextAndLink(b,c,d),this.prepareDialog()))}$(document).mouseup(function(a){var b=$("#changeShipToLocationAlert");b.is(a.target)||0!==b.has(a.target).length||b.addClass("hidden")})}};

window.hzmr.push("changeShipToLocation:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End changeShipToLocation.js  **************/
/************* Start extracting text for contactMultiplePros.js for locale it-IT **************/
(function(){var _hzxt={"Zip Code: {zipCode}":"CAP: {zipCode}","View more professionals":"Visualizza altri professionisti","Your message was sent successfully":"Il tuo messaggio \u00e8 stato inviato correttamente","Contact Professionals":"Contatta professionisti","Contact these professionals":"Contatta questi professinisti","Select the {metroArea} professionals you would like to contact":"Seleziona i professionisti nella zona di {metroArea} che desideri contattare","Contact this professional":"Contatta questo professionista","Message sent successfully to this professional":"Messaggio inviato correttamente a questo professionista","Message sent successfully to these professionals":"Messaggio inviato correttamente a questi professionisti","Please select at least 1 professional.":"Seleziona almeno 1 professionista.","Message sent successfully to these professionals:":"Messaggio inviato correttamente a questi professionisti:","Contact Name: {name}":"Nome di contatto: {name}","Phone Number: {phoneNumber}":"Numero di telefono: {phoneNumber}","Please enter your name":"Inserisci il tuo nome","Sender email: {emailAddress}":"Indirizzo e-mail del mittente: {emailAddress}","Please enter your email address":"Inserisci il tuo indirizzo e-mail","Please enter your phone number":"Inserisci il tuo numero di telefono","Please enter your zip code":"Inserisci il tuo codice postale","Please add a short description of your project":"Aggiungi una breve descrizione del tuo progetto","Please solve the captcha.":"Decifra il testo captcha.","Send message error!":"Errore nell'invio del messaggio","OK":"OK","Call":"Chiama","Houzz project inquiry":"Richiesta su un progetto Houzz","Send":"Invia","Cancel":"Annulla","Contact":"Contatta","":"","Sponsored":"Sponsorizzato"};for(var a in _hzxt){window._hzlang[a]=_hzxt[a];}})();
/*************  End extracting text for contactMultiplePros.js  **************/
/************* Start contactMultiplePros.js for locale it-IT **************/
try {HZ.ns("HZ.proPlus"),HZ.proPlus.contactMultiplePros=function(){function a(a){var b=a.proUserId,c=HZ.data.Users.get(b),d="";if(c){var e=HZ.ui.render.User.getUserImageHtml(b,!0,j.clickUrls[b],1),f=HZ.ui.render.User.getUserHtml(b,!0,""),g="";$.isNumeric(c.nr)&&parseInt(c.nr)>0&&(g=HZ.ui.render.User.getProfessionalReview(c)),d=HZ.utils.Html.template(a.template,{OBJ_ID:b,PRO_USERNAME:b,PRO_ENTRY_LABEL:"",AVATAR:e,USERNAME:c.n,AUTHOR:f,POSITION_ID:"pro_"+a.position,PRO_REVIEWS:g,PRO_REVIEW_USERNAME:j.reviewUsernames[b],PRO_REVIEW_TEXT:j.reviewTexts[b],SHOW_SEPARATOR:g?"":"hide",SHOW_REVIEW:j.reviewUsernames[b]||j.reviewTexts[b]?"":"hide",EXTRACLASS:a.extraClass,PROFILE_URL:j.clickUrls[b],REVIEW_URL:j.reviewUrls[b]})}return d}var b=["name","email","phone","zip","message"],c=_hgt("Contact Professionals"),d=_hgt("Contact"),e=_hgt("Call"),f=_hgt("View more professionals"),g=null,h=null,i=null,j={screen:"screen_select_pros",proUserIds:[],selectedProUserIds:[],title:"local professionals",subtitle:"local professionals",clickUrls:[],reviewUrls:[]},k={},l='<li class="%EXTRACLASS%" posid="%POSITION_ID%"><div class="local-pro-option"><div class="pro-avatar hzHouzzer" data-type="profile" data-id="%USERNAME%" compid="contact_local_pros_pro_avatar" >%AVATAR%</div><div class="pro-details"><div class="text-m pro-name one-line" compid="contact_local_pros_pro_name">%AUTHOR%</div><a class="text-primary" target="_blank" href="%REVIEW_URL%" compid="contact_local_pros_review">%PRO_REVIEWS%</a></div></div></li>',m='<form class=\'sponsored-pro-list-screen screen-contact-selected-pros trackMe %STATUS%\'><div class=\'text-m\'>%CONTACT_PROS_TITLE%:</div><ul id=\'selectedPros\' class=\'list-unstyled\'>%PRO_OPTIONS%</ul><div id="contactForm"><div class="row form-group"><div class="col-xs-12"><input type="text" name="name" class="form-control" placeholder="%NAME_INPUT_PLACEHOLDER%" required></div></div><div class="row form-group"><div class="col-xs-12"><input type="email" name="email" class="form-control" placeholder="%EMAIL_INPUT_PLACEHOLDER%" required></div></div><div class="row form-group"><div class="col-xs-7"><input type="tel" name="phone" class="form-control" placeholder="%PHONE_INPUT_PLACEHOLDER%" required></div><div class="col-xs-5"><input type="text" name="zip" class="form-control" placeholder="%ZIP_INPUT_PLACEHOLDER%" required></div></div><div class="row form-group"><div class="col-xs-12"><textarea class="form-control" name="message" placeholder="%DESC_INPUT_PLACEHOLDER%" required></textarea></div></div></div><div id="%RECAPTCHA_ID%" class="recaptchaDiv"></div><div class="screen-actions"><div class="text-right"><button type="button" class="btn btn-secondary btn-lg mrm" compid="cancelContactPros" id="cancelContactPros">'+_hgt("Cancel")+'</button><button type="submit" class="btn btn-primary btn-lg" compid="submitContactPros" id="submitContactPros">'+_hgt("Send")+"</button></div></div></form>";onRecaptcphaLoadedCallback=function(){if("undefined"!=typeof grecaptcha){try{"undefined"!=typeof recaptchaWidgetId&&grecaptcha.reset(recaptchaWidgetId)}catch(a){}var a="recaptchaWidget"+recaptchaId;$("#"+a).is(":empty")&&(recaptchaWidgetId=grecaptcha.render(a,{sitekey:HZ.utils.Config.recaptchaPublicKey}))}},this.render=function(){var b=null;switch(j.screen){case"screen_select_pros":var i,k="";j.proUserIds.forEach(function(b,c){i=b;var d={proUserId:b,position:c,template:j.isSingleVariant?'<li class="local-pro-option" posid="%POSITION_ID%"><div class="pro-checkbox" objid="%OBJ_ID%"><input type="checkbox" value="%PRO_USERNAME%" compid="contact_local_pros_checkbox" checked></div><div class="pro-avatar" compid="contact_local_pros_pro_avatar">%AVATAR%</div><div class="pro-details"><a class="header-3 pro-name" compid="contact_local_pros_pro_name" target="_blank" href="%PROFILE_URL%">%AUTHOR%</a><div class="separator %SHOW_SEPARATOR%"></div><a class="text-primary" target="_blank" href="%REVIEW_URL%" compid="contact_local_pros_review">%PRO_REVIEWS%</a><div class="pro-review %SHOW_REVIEW%"><span class="pro-review-user text-bold">%PRO_REVIEW_USERNAME%</span> - <a class="pro-review-text" target="_blank" href="%REVIEW_URL%" compid="contact_local_pros_review_text">"%PRO_REVIEW_TEXT%"</a></div></div></li>':'<li class="local-pro-option" posid="%POSITION_ID%"><div class="pro-checkbox" objid="%OBJ_ID%"><input type="checkbox" value="%PRO_USERNAME%" compid="contact_local_pros_checkbox" checked></div><div class="pro-avatar" compid="contact_local_pros_pro_avatar">%AVATAR%</div><div class="pro-details"><a class="text-m pro-name one-line" compid="contact_local_pros_pro_name" target="_blank" href="%PROFILE_URL%">%AUTHOR%</a><a class="text-primary" target="_blank" href="%REVIEW_URL%" compid="contact_local_pros_review">%PRO_REVIEWS%</a></div></li>',extraClass:""};k+=a(d)});var n;n=j.isSingleVariant?j.isResponsive?$(HZ.utils.Html.template("<form class=\"sponsored-single-pro-screen screen-select-pros trackMe\"><div class='location'>%LOCATION%</div><ul id='localProsSelector' class='list-unstyled mtl mbl'>%PRO_OPTIONS%</ul><div class=\"screen-actions\"><a id='phoneNumber' class='btn btn-secondary btn-lg' compid='contact_local_pros_call_button' href='tel:%PHONE_NUMBER%'><i class='hzi-font hzi-Phone-fill'></i>%CALL%</a><button id='contactProButton' compid='contact_local_pros_contact_button' type='submit' class='btn btn-primary btn-lg'><i class='hzi-font hzi-Email'></i>%CONTACT_A_PROFESSIONAL%</button><a href='%VIEW_MORE_PROS_URL%' id='viewMorePros' compid='contact_local_pros_view_more_pros_link' class='colorLink'>%VIEW_MORE_PROS%<span class='more-icon'></span></a></div></form>",{CONTACT_A_PROFESSIONAL:d,LOCATION:j.locationName,PRO_OPTIONS:k,VIEW_MORE_PROS:f,PHONE_NUMBER:j.phoneNumbers[i],CALL:e,VIEW_MORE_PROS_URL:j.categoryUrl})):$(HZ.utils.Html.template("<form class=\"sponsored-single-pro-screen screen-select-pros trackMe\"><div class='location'>%LOCATION%</div><ul id='localProsSelector' class='list-unstyled mtl mbl'>%PRO_OPTIONS%</ul><div class=\"screen-actions\"><button id='contactProButton' compid='contact_local_pros_contact_button' type='submit' class='btn btn-primary btn-lg'>%CONTACT_A_PROFESSIONAL%</button><div id='phoneNumber' class='text-m'><i class='hzi-font hzi-Phone-fill'></i>%PHONE_NUMBER%</div></div></form><a href='%VIEW_MORE_PROS_URL%' id='viewMorePros' compid='contact_local_pros_view_more_pros_link' class='colorLink'>%VIEW_MORE_PROS%<span class='more-icon'></span></a>",{CONTACT_A_PROFESSIONAL:d,LOCATION:j.locationName,PRO_OPTIONS:k,VIEW_MORE_PROS:f,PHONE_NUMBER:j.phoneNumbers[i],VIEW_MORE_PROS_URL:j.categoryUrl})):$(HZ.utils.Html.template("<form class=\"sponsored-pro-list-screen screen-select-pros trackMe\"><div class='text-l'>%SELECT_PROS_TITLE%:</div><ul id='localProsSelector' class='list-unstyled mtl mbl'>%PRO_OPTIONS%</ul><div class=\"screen-actions\"><button id='contactProButton' compid='contact_local_pros_contact_button' type='submit' class='btn btn-primary btn-block btn-lg'>%CONTACT_A_PROFESSIONAL%</button></div></form>",{SELECT_PROS_TITLE:_hgt("Select the {metroArea} professionals you would like to contact",{metroArea:j.locationName}),CONTACT_A_PROFESSIONAL:c,PRO_OPTIONS:k})),n.off("click").on("click","#contactProButton",this.handleContactProfessionalFormSubmit.bind(this)).on("click",".pro-avatar",this.handleProAvatarClick.bind(this)),b=n;break;case"screen_contact_pros":recaptchaId++;var k="",o=j.selectedProUserIds.length>1?"pro-display-compact":"pro-display-full";j.selectedProUserIds.forEach(function(b,c){k+=a({proUserId:b,position:c,template:l,extraClass:o})});var p=$(HZ.utils.Html.template(m,{CONTACT_PROS_TITLE:_hgtp("","Contact this professional","Contact these professionals",j.selectedProUserIds.length),PRO_OPTIONS:k,NAME_INPUT_PLACEHOLDER:"Name",EMAIL_INPUT_PLACEHOLDER:"Email",PHONE_INPUT_PLACEHOLDER:"Phone Number",ZIP_INPUT_PLACEHOLDER:"Zip Code",DESC_INPUT_PLACEHOLDER:"Brief description of your project",RECAPTCHA_ID:"recaptchaWidget"+recaptchaId,STATUS:HZ.data.CurrentSessionUser?"withoutCaptcha":"withCaptcha"}));p.off("submit change keydown focus blur click").on("click","#cancelContactPros",function(){j.screen="screen_select_pros",this.render()}.bind(this)).on("click","#submitContactPros",this.handleContactPros.bind(this)).on("submit",this.handleContactPros.bind(this)).on("change keydown","input, textarea",this.clearErrorState.bind(this)).on("focus","input, textarea",this.onContactFormFocus.bind(this)).on("blur","input, textarea",this.onContactFormBlur.bind(this)),b=p;break;case"screen_confirm_contact_pros":var k="";j.selectedProUserIds.forEach(function(b,c){k+=a({proUserId:b,position:c,template:l,extraClass:"mbxl"})});var q=$(HZ.utils.Html.template('<div class="sponsored-pro-list-screen screen-confirm-contact-selected-pros"><div class="screen-confirm-contact-selected-pros__text header-3 text-unbold">%CONFIRM_CONTACT_PROS_TITLE%</div><div class="screen-confirm-contact-selected-pros__check-mark-circle check-mark-circle"><span class="hzi-font hzi-Checked-Selection"></span></div></div>',{CONFIRM_CONTACT_PROS_TITLE:_hgt("Your message was sent successfully"),PRO_OPTIONS:k}));q.off("click").on("click","#confirmContactPros",function(){j.screen="screen_select_pros",this.render()}.bind(this)),b=q}var r=$('<div class="text-gray-lightest text-xxs sponsored-pro-list-sponsored">'+_hgt("Sponsored")+"</div>");h.empty().append(this.getBannerHtml(j.title,j.subtitle,j.isSingleVariant)),j.isSingleVariant&&!j.isResponsive&&(h.siblings(".photoMeta").css({top:h.height()}),$(window).resize(function(){h.siblings(".photoMeta").css({top:h.height()})})),g.empty().append(r).append(b),b.find('input[type="text"]:first').focus(),HZ.data.CurrentSessionUser||"screen_contact_pros"==j.screen&&("undefined"==typeof grecaptcha?$.getScript("https://www.google.com/recaptcha/api.js?onload=onRecaptcphaLoadedCallback&render=explicit&hl="+HZ.utils.Config.language):onRecaptcphaLoadedCallback())}.bind(this),this.onContactFormFocus=function(a){this.clearErrorState(),k.onContactFormFocus&&k.onContactFormFocus()},this.onContactFormBlur=function(a){this.clearErrorState(),k.onContactFormBlur&&k.onContactFormBlur()},this.handleProAvatarClick=function(a){if(!j.isSingleVariant){var b=$(a.currentTarget),c=b.closest("li").find('input[type="checkbox"]');c.prop("checked",!c.prop("checked"))}},this.handleContactProfessionalFormSubmit=function(a){a.preventDefault();var b=$(a.target).closest("form"),c=b.find(":checked").map(function(a,b){return $(b).val()}).get();c.length?(j.selectedProUserIds=c,j.screen="screen_contact_pros",this.render()):HZ.ui.yamdi.Common.alert(_hgt("Error"),_hgt("Please select at least 1 professional."))},this.handleContactPros=function(a){a.preventDefault();var c=$(a.target).closest("form"),d=c.get(0);if(d.checkValidity()){var e=HZ.sendEmail.types.PRO,f=$(d.name).val(),g=$(d.email).val(),h=$(d.phone).val(),i=$(d.zip).val(),k=$(d.message).val(),l=_hgt("Contact Name: {name}",{name:f})+"\n"+_hgt("Phone Number: {phoneNumber}",{phoneNumber:h})+"\n"+_hgt("Zip Code: {zipCode}",{zipCode:i})+"\n"+_hgt("Sender email: {emailAddress}",{emailAddress:g})+"\n\n"+k;if(!HZ.data.CurrentSessionUser){var m="undefined"!=typeof grecaptcha?grecaptcha.getResponse(recaptchaWidgetId):"";if(""===m)return void HZ.ui.yamdi.Common.alert("Error",_hgt("Please solve the captcha."))}c.find("[type=submit]").attr("disabled",!0),j.selectedProUserIds.forEach(function(a){var b=HZ.data.Users.get(a),c=b.n,d={};d[HZ.sendEmail.params.to]=c,d[HZ.sendEmail.params.subject]=_hgt("Houzz project inquiry"),d[HZ.sendEmail.params.message]=l,d[HZ.sendEmail.params.type]=e,HZ.data.CurrentSessionUser?HZ.ajaz.Services.sendEmail(d,!1,this.onContactFormSubmitResponse.bind(this,a)):(d[HZ.sendEmail.params.from]=g,d[HZ.sendEmail.params.captchaResponse]=m,HZ.ajaz.Services.sendGuestEmail(d,this.onContactFormSubmitResponse.bind(this,a)))}.bind(this))}else for(var n,o=b.length,p=0;p<o;p++)if(n=c.find("[name="+b[p]+"]"),!n.get(0).checkValidity()){this.handleFieldValidationError(n);break}},this.handleFieldValidationError=function(a){var b,c=a.get(0).validity;if(c.valueMissing)switch(a.attr("name")){case"name":b=_hgt("Please enter your name");break;case"email":b=_hgt("Please enter your email address");break;case"phone":b=_hgt("Please enter your phone number");break;case"zip":b=_hgt("Please enter your zip code");break;case"message":b=_hgt("Please add a short description of your project")}else c.typeMismatch&&(b=HZ.sendEmail.texts.ERROR_INVALID_FROM_EMAIL_ADDRESS);i=$(HZ.utils.Html.template('<div class="form-field-error"><span class="outer-tip"></span><span class="inner-tip"></span><span class="message">%MESSAGE%</span></div>',{MESSAGE:b})),this.clearErrorState(),this.showFieldError(a,i)},this.showFieldError=function(a,b){a.parent().addClass("has-error"),a.after(b)},this.clearErrorState=function(a){g.find(".has-error").removeClass("has-error").find(".form-field-error").remove()},this.onContactFormSubmitResponse=function(a,b){if("true"===b.success){var c=parseInt(a),d={proUserId:a,positionId:j.proUserIds.indexOf(c),emailLogId:b.emailLogId};HZ.utils.Logger.sendEventLogLightweight("contact_multiple_pros_email_sent",d),j.screen="screen_confirm_contact_pros",this.render()}else{HZ.ui.yamdi.Common.alert(_hgt("Send message error!"),b.error);$("#contactForm").closest("form").find("[type=submit]").attr("disabled",!1)}},this.getBannerHtml=function(a,b,c){var d;return c?(d=HZ.utils.Html.template('<div class="sponsored-single-pro-banner"><div class="media-body header-2"><span class="sponsored-single-pro-pro-icon hzi-font hzi-Pro-Fill"></span><span class="sponsored-single-pro-banner-title no-margin">%BANNER_TITLE%</span></div></div>',{BANNER_TITLE:a,BANNER_SUBTITLE:b}),j.locationName):d=HZ.utils.Html.template('<div class="sponsored-pro-list-banner"><div class="media-left"><span class="sponsored-pro-list-pro-icon hzi-font hzi-Pro-Fill"></span></div><div class="media-body"><div class="sponsored-pro-list-banner-title text-bold no-margin">%BANNER_TITLE%</div><div class="sponsored-pro-list-banner-subtitle text-l">%BANNER_SUBTITLE%</div></div></div>',{BANNER_TITLE:a,BANNER_SUBTITLE:b}),d},this.init=function(a){"undefined"==typeof recaptchaId&&(recaptchaId=0),j.isResponsive=a.isResponsive,j.proUserIds=a.proUserIds,j.phoneNumbers=a.phoneNumbers,j.categoryUrl=a.categoryUrl,j.title=a.title,j.subtitle=a.subtitle,j.clickUrls=a.clickUrls,j.reviewUrls=a.reviewUrls,j.reviewUsernames=a.reviewUsernames,j.reviewTexts=a.reviewTexts,j.locationName=a.locationName,j.isSingleVariant=a.isSingleVariant,g=a.container instanceof jQuery?a.container:$(a.container),h=a.bannerContainer instanceof jQuery?a.bannerContainer:$(a.bannerContainer),k=a.props,this.render()}};

window.hzmr.push("contactMultiplePros:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End contactMultiplePros.js  **************/
/************* Start extracting text for soldByBox.js for locale it-IT **************/
(function(){var _hzxt={"Got it!":"Ho capito!"};for(var a in _hzxt){window._hzlang[a]=_hzxt[a];}})();
/*************  End extracting text for soldByBox.js  **************/
/************* Start soldByBox.js for locale it-IT **************/
try {$(function(){function a(){var a=$("<div/>"),b=$('<div class="sbb-dlg__image"/>'),c=$('<p class="text-l pll prl"/>').text(_hgt("Due to cuts, breaks and other waste when installing your tile, you should multiply the square footage of your area by 10% and purchase enough tile to cover this amount."));return a.append(b,c),a}function b(){var b,d;c||(b=HZ.ui.InputButtonUtils.createPrimaryInputButton(_hgt("Got it!"),"hzSoldByBoxDlgOKBtn",HZ.ui.yamdi.Common.hideAllDialogs,!1,!1,"large"),d=[b],c=new HZ.ui.yamdi.Dialog,c.init({dialogClassName:"soldByBoxDlg",controls:d,hideDialogOnBgClick:!0}),c.setTitle(_hgt("Buy 10% More for Waste")),c.setBody(a())),HZ.ui.Yamdi.show(c)}var c=null;$("body").on("click",".sold-by-box--tt-trigger",b)});

window.hzmr.push("soldByBox:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End soldByBox.js  **************/
/************* Start lightboxColorPickerUtils.js for locale it-IT **************/
try {HZ.ns("HZ.lb.Utils.ColorPicker"),HZ.lb.Utils.ColorPicker={hasColorPickerAd:function(a){var b=HZ.data.ColorPickerAd.get(a),c=!1;return b&&b.hasOwnProperty("config")&&(c=b.config.hasOwnProperty("campaignId")),c},getColorPickerAd:function(a){var b=null;return this.hasColorPickerAd(a)&&(b=HZ.data.ColorPickerAd.get(a)),b},getConfig:function(a){var b=null;return a&&a.hasOwnProperty("config")&&(b=a.config),b},getAssets:function(a){var b=null;return a.hasOwnProperty("assets")&&(b=a.assets),b},getTrackLinks:function(a){var b=null;return a.hasOwnProperty("track")&&(b=a.track),b},getCampaignId:function(a){var b=this.getConfig(a),c=null;return b&&b.hasOwnProperty("campaignId")&&(c=b.campaignId),c},serializeColorParams:function(a){return a.map(function(a,b){var c=a.red?a.red:a.r,d=a.green?a.green:a.g,e=a.blue?a.blue:a.b;return["c"+b,HZ.utils.Color.rgbToHex(c,d,e).substring(1)].join("=")}).join("/")},serializeCoordParams:function(a){return a.map(function(a,b){var c,d;return a.hasOwnProperty("left")&&a.hasOwnProperty("top")?(c=a.left,d=a.top):(c=a.x,d=a.y),[["x"+b,c].join("="),["y"+b,d].join("=")].join("/")}).join("/")}};

window.hzmr.push("lightboxColorPickerUtils:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End lightboxColorPickerUtils.js  **************/
/************* Start extracting text for lightboxColorPicker2.js for locale it-IT **************/
(function(){var _hzxt={"Buy Sample":"Acquista un campione","Show Paint Options":"Mostra opzioni","Hide Paint Options":"Nascondi opzioni","Inspired by this Room":"Vernici ispirate a questo spazio","More Samples":"Altri campioni","Colors in this Room":"I colori in questo spazio","Share Palette":"Condividi la palette","Buy Samples":"Crea il tuo stile","Show Paint Colors":"Mostra le vernici","Hide Paint Colors":"Nascondi le vernici","Sponsored by:":"Sponsorizzato da:","This Room's Paint Colors":"I colori di questo spazio","Get this paint":"Trova questa vernice","Take a look at this {paintManufacturer} color palette I created on Houzz.":"Scopri la palette di colori {paintManufacturer} che ho creato su Houzz e fammi sapere cosa ne pensi!","Save Palette":"Salva la palette","My color palette":"Guarda la mia palette di colori!"};for(var a in _hzxt){window._hzlang[a]=_hzxt[a];}})();
/*************  End extracting text for lightboxColorPicker2.js  **************/
/************* Start lightboxColorPicker2.js for locale it-IT **************/
try {HZ.lb.plugins.ColorPickerCTA=function(){var a,b,c,d,e,f=HZ.lb.Config.contentGroupIds.OVERVIEW,g=_hgt("Show Paint Options"),h=_hgt("Hide Paint Options"),i=_hgt("Sponsored by:");this.setOwner=function(e){a=e,b=$('<section class="lbInfoBox color-picker-cta separator"></section>'),c=$('<section class="lbInfoBox color-picker-cta"></section>'),d=b.add(c),d.on("click",".js-cta",this.handleCtaClick.bind(this)),d.on("click",".js-close",this.handleCloseClick.bind(this)),a.addInfoBoxToContentGroup(b.get(0),"colorPickerCTA",f),a.addInfoBoxToContentGroup(c.get(0),"colorPickerCTA2",HZ.lb.Config.contentGroupIds.COLOR_PICKER)},this.imageChanged=function(){var b=a.getCurrentSpace(),c=HZ.lb.Utils.ColorPicker.getColorPickerAd(b.id),f=HZ.lb.Utils.ColorPicker.getConfig(c);if(d.empty().addClass("hidden"),c&&!a.isFullPageAd()&&!a.isSpotlightContext()){d.removeClass("hidden");var h="",j=HZ.lb.Utils.ColorPicker.getAssets(c);j.hasOwnProperty("logoUrl")&&(h=j.logoUrl);var k=HZ.lb.Utils.ColorPicker.getTrackLinks(c),l="javascript:;",m="_top";k.hasOwnProperty("clkTrkLink")&&(l=k.clkTrkLink,m="_blank"),d.append(HZ.utils.Html.template('<div class="row trackMe %ADV_LABEL%" objid="%SPACE_ID%"><div class="col-xs-6 btn"><button class="btn btn-default btn-block js-cta btn-color-picker-cta" compid="lb_color_picker_cta"><i class="color-picker-icon"></i><span class="color-picker-btn-label">%BUTTON_LABEL%</span></button></div><div class="col-xs-6 logo"><span class="sponsor-right-float"><p class="text-xs sponsored">%SPONSORED_LABEL%</p><a href="%LOGO_LINK%" target="%LOGO_TARGET%"><p class="color-picker-sponsor-logo" style="background-image: url(%BG_IMAGE_URL%)"></p></a></span></div></div>',{ADV_LABEL:c.config.advPaletteLabel,SPACE_ID:b.id,BUTTON_LABEL:f.advShowPaintColorMessage?f.advShowPaintColorMessage:g,SPONSORED_LABEL:i,BG_IMAGE_URL:h,LOGO_LINK:l,LOGO_TARGET:m})),k.hasOwnProperty("impTrkLink")&&HZ.lb.Utils.registerTrackingUrl(k.impTrkLink,b.id);var n=b.id,c=HZ.lb.Utils.ColorPicker.getColorPickerAd(n);if(c){var o=HZ.lb.Utils.ColorPicker.getCampaignId(c);d.find(".js-cta").attr("posid",o)}}e=d.find(".js-cta")},this.lightboxModeChanged=function(){var b=a.getCurrentSpace(),c=HZ.lb.Utils.ColorPicker.getColorPickerAd(b.id),d=HZ.lb.Utils.ColorPicker.getConfig(c),f=e.find(".color-picker-btn-label");a.isColorPicking()?(e.removeClass("js-cta").addClass("js-close"),f.text(d&&d.advHidePaintColorMessage?d.advHidePaintColorMessage:h)):(e.removeClass("js-close").addClass("js-cta"),f.text(d&&d.advShowPaintColorMessage?d.advShowPaintColorMessage:g))},this.imageDataUpdated=function(){this.imageChanged()},this.handleCtaClick=function(b){a.enterColorPickerMode(),a.setCurrentContentGroupIndex(HZ.lb.Config.spaceContentGroupIds.indexOf(HZ.lb.Config.contentGroupIds.COLOR_PICKER)),a.focusCurrentContentGroup()},this.handleCloseClick=function(b){a.exitColorPickerMode(),a.animateScrollTo(0)}},HZ.lb.plugins.ColorPicker=function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w=HZ.lb.Config.contentGroupIds.COLOR_PICKER,x='<li class="color-picker-swatch"><div class="%SWATCH_CLASS%"><div class="color-swatch" style="background-color:%HEX%;"></div></div><div class="%INFO_CLASS%"><p class="color-name">%TITLE%</p><p class="color-cta"><a class="text-primary text-nowrap color-picker-get-paint" href="javascript:;">%CTA% <i class="more-icon"></i></a></p></div>%BUY_SAMPLE_BUTTON%</li>',y=_hgt("Inspired by this Room"),z=_hgt("Sponsored by:"),A=_hgt("Buy Samples"),B=_hgt("More Samples"),C=_hgt("Buy Sample"),D=_hgt("Save Palette"),E=_hgt("Share Palette"),F=_hgt("Get this paint");this.setOwner=function(f){a=f,b=$(document),c=$('<section class="lbInfoBox color-picker-info"></section>'),a.addInfoBoxToContentGroup(c.get(0),"colorPickerInfo",w),e=a.getNodeByContentGroupId(w),d=$('<div class="color-picker-markers"></div>'),a.addLbImageLayer(d.get(0)),c.on("mouseenter mouseleave",".color-picker-swatch",this.handleSwatchHover.bind(this)).on("click",".color-picker-swatch:not(.current)",this.handleSwatchClick.bind(this)).on("click",".color-picker-swatch .color-picker-get-paint",this.handleGetPaintClick.bind(this)).on("click",".color-picker-swatch .color-picker-buy-sample",this.handleBuySampleClick.bind(this)).on("click",".color-picker-buy",this.handleBuySamplesClick.bind(this)).on("click",".color-picker-save",this.handleSaveClick.bind(this)).on("click",".color-picker-share",this.handleShareClick.bind(this)),d.on("mouseenter mouseleave",".color-picker-marker:not(.current)",this.handleSwatchHover.bind(this)).on("click",".color-picker-marker .color-picker-get-paint",this.handleGetPaintClick.bind(this)).on("click",".color-picker-swatch .color-picker-buy-sample",this.handleBuySampleClick.bind(this)),b.on("mousedown",".color-picker-marker .marker-crosshair",this.handleColorMarkerDragStart.bind(this))},this.imageChanged=function(){if("undefined"!=typeof ColorAnalyzer){g=0,n=[],o=[],q=[],e.addClass("no-content"),c.addClass("hidden"),k=k||new ColorAnalyzer(HZ.lb.Config.STATIC_URL),k.reset(),c.empty(),d.empty(),HZ.lb.Utils.ColorPicker.hasColorPickerAd(a.getCurrentSpace().id)&&(e.removeClass("no-content"),c.removeClass("hidden"),c.append('<div id="#placeholders"></div>'));var b=a.getImageBounds();v={xMin:0,xMax:b.w,yMin:0,yMax:b.h}}else HZ.lb.Utils.loadColorPickerResources(this.imageChanged.bind(this))},this.lightboxModeChanged=function(){a.isColorPicking()&&(o.length||this.analyzeCurrentImage())},this.analyzeCurrentImage=function(){var b=a.getCurrentSpace(),c=a.isFullPageAd();if(b&&!c&&!a.isSpotlightContext()&&!l&&HZ.lb.Utils.ColorPicker.hasColorPickerAd(b.id)){var d=HZ.lb.Utils.ColorPicker.getColorPickerAd(b.id),e=HZ.lb.Utils.ColorPicker.getConfig(d);e.hasOwnProperty("adHtml")&&(f=e.adHtml),e.hasOwnProperty("advPaletteLabel")&&(p=e.advPaletteLabel),m=$("<img>").attr("src",a.getImageData().src),this.calculateImageScale();var g=m.get(0);l=!0,k.getColors(g,this.colorAnalyzerGetColorsCallback.bind(this))}},this.currentContentGroupChanged=function(){o.length?a.getCurrentContentGroupId()==w?a.enterColorPickerMode():a.exitColorPickerMode():a.getCurrentContentGroupId()==w&&this.analyzeCurrentImage()},this.colorAnalyzerGetColorsCallback=function(b,c,d,e){if(l=!1,b&&c){var f=a.getColorPickerData(),g=a.getCurrentSpace();f?(n=f.palette,o=f.locations):(n=b,o=c),HZ.ajaz.Services.cacheColorPickerColors(g.id,n,o,d,e),HZ.ajaz.Services.getManufacturerColors(n,p).then(this.handleManufacturerColorsResponse.bind(this))}},this.handleManufacturerColorsResponse=function(a){a.success&&"true"==a.success&&(q=[],a.palette.forEach(function(a){q.push(a[0])}),this.calculateImageScale(),this.renderAdInfo(),this.renderImageMarkers(),this.setSelectedSwatchIndex(g))},this.renderAdInfo=function(){var b=a.getCurrentSpace(),d=HZ.lb.Utils.ColorPicker.getColorPickerAd(b.id),e=HZ.lb.Utils.ColorPicker.getConfig(d),g=HZ.lb.Utils.ColorPicker.getTrackLinks(d),h={SPACE_ID:a.getCurrentSpace().id,HEADER:this.renderHeader(),SPONSORSHIP:this.renderSponsorship(),SWATCHES:this.renderSwatchList(),BUY_LABEL:g.swatchBuyLink?B:e.advBuySamplesMessage?e.advBuySamplesMessage:A,SAVE_LABEL:D,SHARE_LABEL:E,AD_HTML:f,BUY_SAMPLES_CLASS:g.swatchBuyLink?"btn-secondary":"btn-primary"};c.find(".js-color-picker-info").remove(),c.append(HZ.utils.Html.template('<div class="trackMe js-color-picker-info" scopeid="lb_color_picker" objid="%SPACE_ID%">%AD_HTML%%HEADER%<ul class="list-unstyled row mtm">%SWATCHES%</ul><div class="row"><p class="col-xs-12 mbl"><button class="btn %BUY_SAMPLES_CLASS% text-s btn-block color-picker-buy color-picker-btn-height" compid="lb_buy_palette_samples">%BUY_LABEL%</button></p><p class="col-xs-6 mbl"><button class="btn btn-secondary text-s btn-block color-picker-save color-picker-btn-height" compid="lb_save_palette_to_ibk"><i class="icon-font icon-heart color-picker-btn-icon"></i><span> %SAVE_LABEL%</span></button></p><p class="col-xs-6 mbl"><button class="btn btn-secondary text-s btn-block color-picker-share color-picker-btn-height" compid="lb_share_palette"><i class="icon-font icon-box_up_arrow color-picker-btn-icon"></i><span> %SHARE_LABEL%</span></button></p></div></div>',h));var d=HZ.lb.Utils.ColorPicker.getColorPickerAd(a.getCurrentSpace().id);c.find(".color-picker-buy").toggleClass("hidden",!g.hasOwnProperty("samplesLink"))},this.renderHeader=function(){var b=HZ.lb.Utils.ColorPicker.getColorPickerAd(a.getCurrentSpace().id),c=HZ.lb.Utils.ColorPicker.getConfig(b),d={TITLE:y,SPONSOR:c.advDisplayName};return HZ.utils.Html.template('<div class="row mbm"><div class="col-xs-12"><p class="text-bold">%TITLE%</p></div></div>',d)},this.renderSponsorship=function(){var b="",c=HZ.data.ColorPickerAd.get(a.getCurrentSpace().id),d=HZ.lb.Utils.ColorPicker.getAssets(c);d.hasOwnProperty("logoUrl")&&(b=d.logoUrl);var e={SPONSORED_LABEL:z,BG_IMAGE_URL:b};return HZ.utils.Html.template('<div class="row ptm"><div class="color-picker-sponsorship"><div class="col-xs-3"><p class="text-xs">%SPONSORED_LABEL%</p></div><div class="col-xs-9"><p class="color-picker-sponsor-logo" style="background-image: url(%BG_IMAGE_URL%)"></p></div></div></div>',e)},this.renderSwatchList=function(){var a=[],b=this.renderSwatch.bind(this);return q.forEach(function(c){c&&a.push(b(c))}),a.join("")},this.renderSwatch=function(b){var c=a.getCurrentSpace(),d=HZ.lb.Utils.ColorPicker.getColorPickerAd(c.id),e=HZ.lb.Utils.ColorPicker.getConfig(d),f=HZ.lb.Utils.ColorPicker.getTrackLinks(d),g=b.name,h=b.code,i=HZ.utils.Color.rgbToHex(b.red,b.green,b.blue),j={HEX:i,TITLE:g+" "+h,CTA:e.advPaintCTAMessage?e.advPaintCTAMessage:F,BUY_SAMPLE_BUTTON:f.swatchBuyLink?this.renderBuySampleButton():null,SWATCH_CLASS:"col-xs-2",INFO_CLASS:f.swatchBuyLink?"col-xs-6":"col-xs-10"};return HZ.utils.Html.template(x,j)},this.renderBuySampleButton=function(){var a={BUY_SAMPLE_LABEL:config.advBuySampleMessage?config.advBuySampleMessage:C,BUY_SAMPLE_CLASS:"col-xs-4 full-height"};return HZ.utils.Html.template('<div class="%BUY_SAMPLE_CLASS%"><div class="buy-button-center "><button class="btn btn-primary btn-block text-s color-picker-buy-sample color-picker-btn-height" compid="lb_buy_palette_sample">%BUY_SAMPLE_LABEL%</button></div></div>',a)},this.renderImageMarkers=function(){d.empty();for(var a=Math.min(o.length,q.length,5),b=0;b<a;b++){var c=q[b];d.append(this.renderImageMarker(c,b))}this.positionImageMarkers()},this.renderImageMarker=function(b,c){var d=a.getCurrentSpace(),e=HZ.lb.Utils.ColorPicker.getColorPickerAd(d.id),f=HZ.lb.Utils.ColorPicker.getConfig(e),g="rgb("+[b.red,b.green,b.blue].join(",")+")",h=b.name,i=b.code,j=HZ.utils.Color.rgbToHex(b.red,b.green,b.blue),k={HEX:j,TITLE:h+" "+i,CTA:f.advPaintCTAMessage?f.advPaintCTAMessage:F,SWATCH_CLASS:"col-xs-3",INFO_CLASS:"col-xs-9"},l=HZ.utils.Html.template(x,k),m=0==c?'<div class="anim-arrows"><i class="marker-crosshair-anim"></i><i class="marker-crosshair-anim"></i><i class="marker-crosshair-anim"></i></div>':"";return HZ.utils.Html.template('<div class="color-picker-marker" dragable="false">%ARROWS%<i class="marker-crosshair" style="background-color:%BG_COLOR%;"></i><div class="marker-info-bubble"><ul class="list-unstyled text-right row">%SWATCH%</ul><div class="info-bubble-tip"></div></div></div>',{BG_COLOR:g,SWATCH:l,ARROWS:m})},this.positionImageMarkers=function(){var b=a.getImageBounds(),c=this.positionMarkerInfo.bind(this);d.css({top:b.y,left:b.x,width:b.w,height:b.h}),d.find(".color-picker-marker").each(function(a,b){var d=$(b),e=o[a];d.css({top:e.y*r,left:e.x*r}),c(d)})},this.positionMarkerInfo=function(b){var c=parseInt(b.css("top")),d=parseInt(b.css("left")),e=a.getImageBounds();b.removeClass("bubble-left bubble-right bubble-bottom"),d<160?b.addClass("bubble-right"):d>e.w-160&&b.addClass("bubble-left"),c<90&&b.addClass("bubble-bottom")},this.handleSwatchClick=function(a){this.setSelectedSwatchIndex($(a.currentTarget).index())},this.handleSwatchHover=function(a){var b=$(a.currentTarget).index();switch(a.type){case"mouseenter":this.setHighlightedSwatchIndex(b);break;case"mouseleave":this.setHighlightedSwatchIndex(null)}},this.handleColorMarkerDragStart=function(a){var c=$(a.target).closest(".color-picker-marker").addClass("dragging");d.addClass("dragging"),i=c.index(),this.setSelectedSwatchIndex(i);var e=parseInt(c.css("top")),f=parseInt(c.css("left")),g=m.get(0);return s={w:g.naturalWidth,h:g.naturalHeight},j=this.getPointRGB(f,e),u={top:e,left:f},t={x:a.pageX,y:a.pageY},b.on("mouseup.colorPicker",this.onColorMarkerDragEnd.bind(this)),b.on("mousemove.colorPicker",this.onColorMarkerDragMove.bind(this)),a.preventDefault(),!1},this.onColorMarkerDragMove=function(a){var b=a.pageX-t.x,c=a.pageY-t.y,e=Math.max(v.yMin,Math.min(v.yMax,u.top+c)),f=Math.max(v.xMin,Math.min(v.xMax,u.left+b)),g=$(d.children().get(i));g.css({top:e,left:f});var h=this.getPointRGB(f,e);return j=h,g.find(".marker-crosshair").css({backgroundColor:"rgb("+[h.r,h.g,h.b].join(",")+")"}),o[i]={x:Math.ceil(f/r),y:Math.ceil(e/r)},this.positionMarkerInfo(g),a.preventDefault(),!1},this.onColorMarkerDragEnd=function(a){b.off(".colorPicker"),d.removeClass("dragging"),$(d.children().get(i)).removeClass("dragging"),this.getManufacturerPaintForRGB(i,j),i=null,j=null},this.getPointRGB=function(a,b){var c=Math.ceil(b/r),d=Math.ceil(a/r),e=k.imageData.data,f=4*(s.w*c+d);return{r:e[f],g:e[f+1],b:e[f+2]}},this.getManufacturerPaintForRGB=function(a,b){var e=[[b.r,b.g,b.b]],f=$(d.children().get(a)),g=$(c.find(".color-picker-swatch").get(a)),h=this.renderImageMarker.bind(this),i=this.renderSwatch.bind(this);HZ.ajaz.Services.getManufacturerColors(e,p).then(function(b){if(b.success&&"true"==b.success&&b.palette&&b.palette.length){var c=b.palette[0][0];q[a]=c;var d=$(h(c)).attr("class",f.attr("class")).attr("style",f.attr("style"));f.replaceWith(d);var e=$(i(c)).attr("class",g.attr("class"));g.replaceWith(e)}})},this.handleGetPaintClick=function(a){var b=this.getClickedElementIndex(a),c=this.generateGetPaintUrl(q[b]);this.navigateToAdvertiserSite(c)},this.handleBuySampleClick=function(a){var b=this.getClickedElementIndex(a),c=this.generateBuySampleUrl(q[b]);this.navigateToAdvertiserSite(c)},this.handleBuySamplesClick=function(a){var b=this.generateSamplesUrl();this.navigateToAdvertiserSite(b)},this.getClickedElementIndex=function(a){var b;switch(a.delegateTarget){case d.get(0):b=".color-picker-marker";break;case c.get(0):b=".color-picker-swatch"}return $(a.target).closest(b).index()},this.generateGetPaintUrl=function(b){var c=HZ.lb.Utils.ColorPicker.getColorPickerAd(a.getCurrentSpace().id),d=HZ.lb.Utils.ColorPicker.getTrackLinks(c),e="",f="";if(d.hasOwnProperty("swatchLink")&&(e=d.swatchLink),d.hasOwnProperty("advParamTemplate")&&(f=d.advParamTemplate),e&&f&&(-1!=f.indexOf("[COLOR_CODE]")&&(f=f.replace("[COLOR_CODE]",b.code)),-1!=f.indexOf("[COLOR_FAMILY]")&&b.hasOwnProperty("color_family")&&(f=f.replace("[COLOR_FAMILY]",b.color_family)),-1!=f.indexOf("[COLOR_HEX_RGB]"))){var g=[HZ.utils.Color.toHex(b.red),HZ.utils.Color.toHex(b.green),HZ.utils.Color.toHex(b.blue)].join("");f=f.replace("[COLOR_HEX_RGB]",g)}return e+f},this.generateBuySampleUrl=function(b){var c=HZ.lb.Utils.ColorPicker.getColorPickerAd(a.getCurrentSpace().id),d=HZ.lb.Utils.ColorPicker.getTrackLinks(c),e="",f="";if(d.hasOwnProperty("swatchBuyLink")&&(e=d.swatchBuyLink),d.hasOwnProperty("advParamTemplate")&&(f=d.advParamTemplate),e&&f&&(-1!=f.indexOf("[COLOR_CODE]")&&(f=f.replace("[COLOR_CODE]",b.code)),-1!=f.indexOf("[COLOR_FAMILY]")&&b.hasOwnProperty("color_family")&&(f=f.replace("[COLOR_FAMILY]",b.color_family)),-1!=f.indexOf("[COLOR_HEX_RGB]"))){var g=[HZ.utils.Color.toHex(b.red),HZ.utils.Color.toHex(b.green),HZ.utils.Color.toHex(b.blue)].join("");f=f.replace("[COLOR_HEX_RGB]",g)}return e+f},this.generateSamplesUrl=function(){var b=HZ.lb.Utils.ColorPicker.getColorPickerAd(a.getCurrentSpace().id),c=HZ.lb.Utils.ColorPicker.getTrackLinks(b),d="",e="";if(c.hasOwnProperty("samplesLink")&&(d=c.samplesLink),c.hasOwnProperty("advParamTemplate")&&(e=c.advParamTemplate),d&&e&&-1!=e.indexOf("[COLOR_CODES]")){var f=[];q.forEach(function(a){f.push(a.code)}),e=e.replace("[COLOR_CODES]",f.join(","))}return d+e},this.handleSaveClick=function(b){var c=a.getCurrentSpace();if(HZ.data.CurrentSessionUser){var d=c.id,e=HZ.lb.Utils.ColorPicker.getColorPickerAd(d),f=HZ.lb.Utils.ColorPicker.getCampaignId(e);HZ.spaceActions.AddToIdeabookDialog.init(d),HZ.spaceActions.AddToIdeabookDialog.setColorPalette(q,p,f),a.showDialog(HZ.spaceActions.AddToIdeabookDialog)}else a.invokeSignupAndThenActionDialog(c,null,HZ.lb.Config.SIGNUP_MSG_ADD_TO_IDEABOOK,"ideabook")},this.handleShareClick=function(b){if(HZ.data.CurrentSessionUser){var c=a.getCurrentSpace(),d=c.id,e=HZ.lb.Utils.ColorPicker.getColorPickerAd(d),f=HZ.lb.Utils.ColorPicker.getConfig(e),g=HZ.lb.Utils.ColorPicker.getCampaignId(e),h=m.get(0),i=HZ.utils.Links.getPaletteShareLink(d,q,o,g,h.naturalWidth,h.naturalHeight),j=HZ.utils.Links.getGenerateColorPaletteImageLink(q,g),k={type:43,referenceId:d,subject:_hgt("My color palette"),message:_hgt("Take a look at this {paintManufacturer} color palette I created on Houzz.",{paintManufacturer:f.advDisplayName}),event:"scp",scopeId:"lightBoxColorPicker",allowShare:!0,mfr:p,colorPaletteShareLink:i,generateColorPaletteImageLink:j};HZ.dialogs.ShareColorPaletteDialog.prepare(k),a.showDialog(HZ.dialogs.ShareColorPaletteDialog)}else a.showLoginDialog()},this.setSelectedSwatchIndex=function(a){g=a,this.onSelectedSwatchIndexChanged()},this.onSelectedSwatchIndexChanged=function(){var a=c.find(".color-picker-swatch"),b=d.find(".color-picker-marker");a.add(b).removeClass("current"),$(a.get(g)).add(b.get(g)).addClass("current")},this.setHighlightedSwatchIndex=function(a){h=a,this.onHighlightedSwatchIndexChanged()},this.onHighlightedSwatchIndexChanged=function(){var a=c.find(".color-picker-swatch"),b=d.find(".color-picker-marker");a.add(b).removeClass("focused"),null!=h&&$(a.get(h)).add(b.get(h)).addClass("focused")},this.imageDataUpdated=function(){this.imageChanged()},this.calculateImageScale=function(){if(m){var b=m.get(0),c=b.naturalWidth,d=a.getImageBounds();r=d.w/c}else r=1},this.imageResized=function(){this.calculateImageScale(),this.positionImageMarkers()},this.navigateToAdvertiserSite=function(a){window.open(a,p)}};

window.hzmr.push("lightboxColorPicker2:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End lightboxColorPicker2.js  **************/
/************* Start extracting text for lightboxImageTags.js for locale it-IT **************/
(function(){var _hzxt={"Similar Product on Houzz":"Prodotto simile su Houzz","Edit Tag":"Modifica l'etichetta","Delete Tag":"Elimina l'etichetta","OK":"OK","More Info":"Maggiori informazioni","Are you sure you want to delete this tag?":"Eliminare questa etichetta?","Toggle Image Tags":"Attiva etichette immagine","Cancel":"Annulla","Buy on Houzz":"Acquista su Houzz"};for(var a in _hzxt){window._hzlang[a]=_hzxt[a];}})();
/*************  End extracting text for lightboxImageTags.js  **************/
/************* Start lightboxImageTags.js for locale it-IT **************/
try {HZ.lb.plugins.ImageTags=new function(){function a(){if(m){var a=$(m);d=c.getCurrentSpace();var b=!1;(d&&(d.ift||d.prod)||c.isEditMode())&&(b=!0),a.toggleClass("hidden",b),a.removeClass("active unavailable"),null==j||j&&0==j.length?a.addClass("unavailable"):u&&a.addClass("active")}}function b(){var a=c.getCurrentSpace(),b=c.getSpaceImage(a);if(b){var d=$(c.getImageDiv());s=d.width(),t=d.height();var e=d.find(".currentImage:not(.previousImage):not(.discardedImage)"),f=e.css("background-size"),l=b.w,m=b.h,o=l/m>s/t;switch(h=1,i={top:0,left:0},f){case"contain":h=o?s/l:t/m,i.top=o?Math.abs(m*h-t)/2:0,i.left=o?0:Math.abs(l*h-s)/2;break;case"cover":h=o?t/m:s/l,i.left=o?(s-l*h)/2:0;break;case"auto":default:h=o?s/l:t/m,i.left=Math.abs(l-s)/2}var p=g.find(".imageTagsTag"),r=c.isSpotlightContext();if(p.each(function(a,b){var c=$(b),d=j[c.attr("index")];if(d){var e=d.sid,f=!0,g=Math.round(h*d.x+i.left),k=Math.round(h*d.y+i.top);e!=q?(f=g>0&&k>0&&g<s&&k<t-70)&&r&&(f=d.t==v):f=!1,c.addClass("animate").css({left:g-18+"px",top:k-5+"px"}).toggleClass("hidden",!f)}}),n){var u={w:s,h:t},w=j[n];if(w){var x=Math.round(h*w.x+i.left),y=Math.round(h*w.y+i.top);k.setPosition(x,y,u.w,u.h)}}}}var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u=!0,v=2;this.setOwner=function(a){c=a,g=$("<div>").attr("id","lbImageTags");var b=$("<div>").attr("id","lbTags");b.append(g),c.addLbImageLayer(b[0]),k=new HZ.ui.DetailsBox("lbImageTagPopup","lbImageTagsPopup"),l=k.getContents(),g.append(l),$("#lbImageTagPopup").hover(this.showInfoDiv.bind(this),$.proxy(function(a){this.hideInfoDiv()},this)).click(this.handleInfoDivClicked.bind(this)),g.on("mouseenter",".imageTagsTag",null,$.proxy(function(a){$(a.target).closest(".imageTagsTag");this.showInfoDiv(a)},this)).on("mouseleave",".imageTagsTag",null,function(){r=setTimeout(function(){k.setVisible(!1,!1)},100)}),m=$('<a class="btn med tint tags-toggler" href="javascript:;" compid="toggleImageTags"><i class="icon-font icon-shopping_tag icon" title="'+_hgt("Toggle Image Tags")+'"></i></a>')[0],$(m).click($.proxy(this.handleImageTagButtonClicked,this)),c.addActionItem(m,HZ.lb.ActionBar.ACTION_BAR_CENTER)},this.handleImageTagButtonClicked=function(){u=!u,a(),u?g.show():g.hide()},this.hideTags=function(){return!!u&&(u=!1,a(),g.hide(),!0)},this.showTags=function(){u||(u=!0,a(),g.show())},this.imageResized=function(){b()},this.imageDataUpdated=function(){this.updateImageData(),b()},this.imageChanged=function(){this.updateImageData(),b()},this.lightboxModeChanged=function(){c.isColorPicking()?this.hideTags():this.showTags()},this.updateImageData=function(){this.hideInfoDiv(),d=c.getCurrentSpace();var b=d.id;if(f=c.getSpaceImage(d),j=HZ.data.ImageTags.get(b),!d||!f||!j||0==j.length)return g.find(".imageTagsTag").remove(),e=null,void a();var h=c.getContextStack();if(q=null,h.length>=2&&(q=h[1].getCurrentSpaceId()),a(),e!=b||g.find(".imageTagsTag").length!=j.length){g.find(".imageTagsTag").remove();for(var i=0;i<j.length;i++){var k=$('<span class="imageTagsTag"><i class="hzi-font hzi-Tag"></i></span>').attr({index:i});g.append(k)}e=b}},this.hideInfoDiv=function(a){k.setVisible(!1,!0),n=null},this.showInfoDiv=function(a){clearTimeout(r);var b=$(a.currentTarget).attr("index");if(!b&&n)return void k.setVisible(!0);var c=HZ.data.ImageTags.get(d.id),e=c[b],f=!1,j=Math.round(h*e.x),l=Math.round(h*e.y),m="",q="",u="",w=e.t,x=null,y=null,z=null;g.find(".imageTagsTag").each(function(a,c){var d=$(c),e=d.attr("index")==b;d.toggleClass("active",e)}),o=null,p=e;var A="";if(e.sid>0){for(var B=HZ.data.Spaces.get(e.sid),C=null,D=HZ.data.ProductsInfo.get(e.sid),E=HZ.data.SpaceListingIds.get(e.sid),F=E?E.length:0,G=0;G<F;G++){var H=E[G];if(H==D.plid){C=H;break}}!C&&E&&E[0]&&(C=E[0]);var I=HZ.data.ListingsInfo.get(C),J=!!I&&I.buyable;if(B){u=B.t,B.price&&J?(u+="<div class='imageTagPopupPrice'>"+B.price+"<i class='hzi-font hzi-Tag'></i></div><div class='imageTagPopupBuyBtn'><button type='button' class='hzBtn primary'>"+_hgt("Buy on Houzz")+"</button></div>",3==w&&(A="<div class='similar'>"+_hgt("Similar Product on Houzz")+"</div>")):u+="<div class='imageTagPopupMoreInfo'><a href='javascript:;' class='colorLink'>"+_hgt("More Info")+"<span class='more-icon'></span></a></div>";var K=B.iids,L=HZ.data.Images.get(K[0]),M=UIHelper.getImageSize({width:L.w,height:L.h},0);y=Math.round(M.w),z=Math.round(M.h),x=HZ.utils.Links.getSpaceImageThumbUrl(B.id,0),o=B,f=!0}}else u=e.v,m=UIHelper.truncate(e.c,400,UIHelper.TRUNCATE_BR,!1);var N=HZ.houseUtils.Permissions;N.hasPermission(d,N.CAN_EDIT_HOUSE)&&(w==v||3==w||"true"!=e.edit&&!0!==e.edit||(q+='<button id="editTag" class="hzBtn primary" type="button"><i class="hzi-font hzi-Edit"></i>'+_hgt("Edit Tag")+"</button>"),"true"!=e.delete&&!0!==e.delete||(q+='<button id="deleteTag" class="hzBtn secondary" type="button"><i class="hzi-font hzi-Delete-Comment"></i>'+_hgt("Delete Tag")+"</button>")),k.setIndex(b),k.setType(A),k.setTitle(u),k.setImageUrl(x,y,z),k.setBody(m),k.setActions(q),k.setClickable(f),k.setPosition(j+i.left,l+i.top,s,t),k.setVisible(!0),n=b},this.handleInfoDivClicked=function(a){var b=$(a.target);if("editTag"==b.attr("id"))c.setEditTagId(j[n].tid),0==HZ.lb.Utils.lightboxEditorLoaded?HZ.lb.Utils.loadLightboxEditor(!0,!0):(c.setEditTagMode(!0),c.refresh(!1),c.handleResize());else if("deleteTag"==b.attr("id")){b.attr("disabled","disabled");var d=_hgt("Delete Tag"),e=_hgt("Are you sure you want to delete this tag?"),f=$.proxy(function(){HZ.ajaz.Services.ImageTags.deleteImageTag(p,$.proxy(this.handleDeleteTag,this))},this),g=function(){b.removeAttr("disabled"),HZ.ui.yamdi.Common.hideAllDialogs()};HZ.ui.yamdi.Common.areYouSure(d,e,_hgt("OK"),f,_hgt("Cancel"),g)}else if(b.hasClass("moreLink"));else if(o){var h={};h[HZ.lb.Config.DESCRIPTOR_FIELD_SPACE_ID]=c.getCurrentSpace().id;var i=new HZ.lb.Context("imageTag_"+o.id,HZ.lb.Config.CONTEXT_TYPE_IMAGE_TAGS,h,[o.id],1,0,-1);i.setCurrentSpaceId(o.id),c.pushContext(i),c.refresh()}},this.handleDeleteTag=function(a){if("true"==a.success){for(var b=0;b<j.length;b++){j[b].tid==a.imageTagId&&j.splice(b,1)}HZ.data.ImageTags.put(d.id,j),c.notifyPlugins("imageDataUpdated"),HZ.ui.yamdi.Common.hideAllDialogs()}this.hideInfoDiv()},this.lightboxUnloaded=function(){e=-1,g.find(".imageTagsTag").remove()},this.lightboxLoaded=function(){setTimeout(this.imageChanged.bind(this),1)}},HZ.ui.DetailsBox=function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n=a,o=b;c=$("<div />",{id:n}).addClass("DetailsBox "+o),d=$("<div />").addClass("DetailsBoxContents "+o+"Contents"),f=$("<div />").addClass("DetailsBoxType "+o+"Type"),g=$("<div />").addClass("DetailsBoxTitle "+o+"Title"),h=$("<img />").addClass("DetailsBoxImage "+o+"Image"),i=$("<div />").addClass("DetailsBoxBody "+o+"Body"),j=$("<div />").addClass("DetailsBoxClear"),k=$("<div />").addClass("DetailsBoxSimilarLink"),l=$("<div />").addClass("DetailBoxActions "+o+"Actions"),m=$("<div />").addClass("DetailsBoxIcon");var p=$("<div />").addClass("DetailsBoxWrap");p.append(f,h,g,i,j,k),d.append(p,l),c.append(d,m),this.getContents=function(){return c[0]},this.setClickable=function(a){a?c.addClass("clickable"):c.removeClass("clickable")},this.setIndex=function(a){e=a},this.hide=function(a){e==a&&(c.hide(),this.setImageUrl(null))},this.setType=function(a){f.empty(),f.append(a)},this.setTitle=function(a){g.empty(),g.append(a)},this.setImageUrl=function(a,b,c){a?(h.attr("src",a).attr("width",b).attr("height",c),h.show()):(h.attr("src",null),h.hide())},this.setBody=function(a){i.empty(),a?(i.append(a),i.show()):i.hide()},this.setSimilarLink=function(a){k.empty(),a?(k.append(a),k.show()):k.hide()},this.setActions=function(a){l.empty(),a?(l.append(a),l.show()):l.hide()},this.setVisible=function(a,b){a?c.show():(c.hide(),b&&this.setImageUrl(null))},this.setPosition=function(a,b,d,e){var f=a<2*d/3,g=b<2*e/3,i=null==h.attr("src")?"None":f?"Left":"Right";c[0].style.left=a+"px",c[0].style.top=b+"px",c.addClass("DetailsBox"+(g?"Top":"Bottom")+(f?"Left":"Right")).removeClass("DetailsBox"+(g?"Bottom":"Top")+(f?"Left":"Right")).removeClass("DetailsBox"+(g?"Bottom":"Top")+(f?"Right":"Left")).removeClass("DetailsBox"+(g?"Top":"Bottom")+(f?"Right":"Left")).removeClass("DetailsBoxImageLeft").removeClass("DetailsBoxImageRight").removeClass("DetailsBoxImageNone").addClass("DetailsBoxImage"+i)}};

window.hzmr.push("lightboxImageTags:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End lightboxImageTags.js  **************/
/************* Start extracting text for contactDialog.js for locale it-IT **************/
(function(){var _hzxt={"Minimum 8 characters":"Minimo 8 caratteri","Passwords need to contain at least 8 characters.":"Le password devono contenere almeno 8 caratteri.","I understand that Houzz will help me coordinate with pros via phone.":"Ho capito che Houzz mi aiuter\u00e0 a mettermi in contatto telefonico con i professionisti.","Email sent successfully!":"E-mail inviata con successo!","Not Now":"Pi\u00f9 tardi","The colors displayed on-screen may not match %brandName% color standards":"I colori mostrati sullo schermo potrebbero differire leggermente dalle tonalit\u00e0 di %brandName%","By clicking \"Send\" I acknowledge and agree to the creation of an account and to the <t1>Terms of Use<\/t1> and <t2>Privacy Policy<\/t2>":"Cliccando su \"Invia\" mi dichiaro d'accordo alla creazione di un account e riconosco e accetto le <t1>Condizioni di Utilizzo<\/t1> e l'<t2>Informativa sulla Privacy<\/t2> di Houzz, compresa l'archiviazione dei miei dati negli Stati Uniti, e acconsento a ricevere comunicazioni di marketing da parte di Houzz.","Email Photo":"Invia foto","Enter your name (required)":"Inserisci il tuo nome (obbligatorio)","Please set a password:":"Crea una password:","Separate multiple emails with commas":"Separa pi\u00f9 indirizzi e-mail con una virgola","Your email address":"Il tuo indirizzo e-mail","Your name":"Il tuo nome","From (enter your email)":"Da (indica il tuo indirizzo e-mail)","Name (enter your name)":"Nome (indica il tuo nome)","Update your Yahoo contact list to lookup your recently emailed friends by name.  Houzz will not use your contact list to send any messages other than those directed by you.":"Aggiorna il tuo elenco di contatti Yahoo e cerca per nome gli amici cui hai recentemente inviato un'e-mail. Houzz acceder\u00e0 alla tua lista contatti solo quando vorrai inviare un messaggio.","Update your Outlook contact list to lookup your recently emailed friends by name.  Houzz will not use your contact list to send any messages other than those directed by you.":"Aggiorna il tuo elenco di contatti Outlook e cerca per nome gli amici cui hai recentemente inviato un'e-mail. Houzz acceder\u00e0 alla tua lista contatti solo quando vorrai inviare un messaggio.","Update my Yahoo contact list":"Aggiorna il mio elenco dei contatti Yahoo","Import my Yahoo contact list":"Importa il mio elenco dei contatti Yahoo","Update my Outlook contact list":"Aggiorna il mio elenco dei contatti Outlook","Import my Outlook contact list":"Importa il mio elenco dei contatti Outlook","Project Location: {zipCode}":"Localit\u00e0 del progetto: {zipCode}","Contact Name: {name}":"Nome di contatto: {name}","Show <t1>{idea}<\/t1> to friends and family.":"Mostra <t1>{idea}<\/t1> ad amici e parenti.","Great Choice!":"Ottima scelta!","Enter your zip code (required)":"Inserisci il tuo codice postale (obbligatorio)","Enter your contact phone number (required)":"Inserisci il tuo numero di telefono di contatto (obbligatorio)","Main Location":"Localit\u00e0 principale","Go to <t1>{galleryName}<\/t1>.":"Vai a <t1>{galleryName}<\/t1>.","Contact {pro}":"Contatta {pro}","I love this @{mft} Paint color palette! Create your own @Houzz":"Mi piace questa palette di colori di pittura @{mft}! Crea la tua su @Houzz","Saved!":"Salvato!","Send message error!":"Errore nell'invio del messaggio","Zip Code":"CAP","Enter your zip code":"Inserisci il tuo CAP","The colors displayed on-screen may not match %mft% color standards":"I colori mostrati sullo schermo potrebbero differire leggermente dalle tonalit\u00e0 di %mft%","Enter your name":"Inserisci il tuo nome","Email{contextEmailNoun}":"e-mail{contextEmailNoun}","or email this to a friend":"o invia per e-mail ad un amico","Share color palette":"Condividi la palette","Phone #":"Numero di telefono","Minimum 6 characters":"Minimo 6 caratteri","Update your Gmail contact list to lookup your recently emailed friends by name.  Houzz will not use your contact list to send any messages other than those directed by you.":"Aggiorna il tuo elenco di contatti Gmail e cerca per nome gli amici cui hai recentemente inviato un'e-mail. Houzz non user\u00e0 l'elenco dei tuoi contatti per inviare messaggi diversi da quelli inviati da te.","Ok":"Ok","Name":"Nome","Import my Gmail contact list":"Importa il mio elenco dei contatti Gmail","Update my Gmail contact list":"Aggiorna il mio elenco dei contatti Gmail","By importing your Gmail contact list, you can look up your friends by name and auto-complete their email addresses when you send them messages.  Houzz will not use your contact list to send any messages other than those directed by you.":"Importando l'elenco dei contatti Gmail, puoi cercare i tuoi amici per nome e usufruire del completamento automatico dei loro indirizzi e-mail quando invii loro dei messaggi. Houzz non user\u00e0 l'elenco dei tuoi contatti per inviare messaggi diversi da quelli inviati da te.","<t1>Import my Gmail contact list<\/t1>&nbsp;(<t2>why?<\/t2>)":"<t1>Importa il mio elenco di contatti Gmail<\/t1>&nbsp;(<t2>perch\u00e9?<\/t2>)","To (enter recipient emails, separated by commas):":"A (inserisci gli indirizzi e-mail dei destinatari separati da virgole):","Loading...":"Caricamento in corso...","{emailSubject} from {senderEmailAddress}":"{emailSubject} da {senderEmailAddress}","Enter your email":"Inserisci il tuo indirizzo e-mail","Project Location: {location}":"Localit\u00e0 del progetto: {location}","Contact Phone Number: {phoneNumber}":"Numero di telefono di contatto: {phoneNumber}","I confirm this is a personal project inquiry and not a promotional message or solicitation.":"Confermo che questa \u00e8 una richiesta inerente un progetto personale e non un messaggio o una sollecitazione a scopo promozionale.","Enter your city, state":"Inserisci la tua citt\u00e0 e la regione","Enter your contact phone number":"Inserisci il tuo numero di telefono","Enter your message here":"Inserisci qui il tuo messaggio","Enter subject":"Inserisci oggetto","Subject":"Oggetto","To (enter recipient emails, separated by commas)":"A (inserisci gli indirizzi e-mail dei destinatari separati da virgole)","Send a Message":"Invia un messaggio","Send":"Invia","Cancel":"Annulla","Location":"Localit\u00e0","Email":"E-mail","Password":"Password","Message":"Messaggio","From":"Da","To":"A","Attach Images":"Allega immagini","Submit":"Invia","Phone Number":"Numero di telefono","Passwords need to contain at least 6 characters.":"Le password devono contenere almeno 6 caratteri.","To:":"A:"};for(var a in _hzxt){window._hzlang[a]=_hzxt[a];}})();
/*************  End extracting text for contactDialog.js  **************/
/************* Start contactDialog.js for locale it-IT **************/
try {HZ.ns("HZ.email"),HZ.email.ContactDialog=function(){function a(){var a=new HZ.ui.yamdi.Dialog,b=_hgt("Please set a password:"),c=function(){HZ.ui.yamdi.Common.hideAllDialogs(),window.location.reload()},d=function(){var a=$("#pwd-dialog__pwd").val();if(!a||a.length<HZ.utils.Config.minPasswordLength){var b=$('<div class="error-tooltip"><span class="outer-tip"></span><span class="inner-tip"></span><span class="tooltip-text">'+_hgt("Passwords need to contain at least 8 characters.")+"</span></div>");$(".pwd-dialog__prompt").append(b)}else HZ.ajaz.Services.updateAutoRegisterPassword(a,function(a){"true"==a.success?window.location.href=k:a.error==HZ.utils.Config.errorPasswordResetExpired?window.location.href=HZ.utils.Config.forgotPasswordUrl:(HZ.ui.yamdi.Common.hideAllDialogs(),HZ.ui.yamdi.Common.alert(_hgt("Set password error!"),a.errorMessage))})},e=HZ.ui.InputButtonUtils.createSecondaryInputButton(_hgt("Not Now"),"pwd-dialog__btn--later",c,null,null,"trackMe mtm","compId='pwdDialogLater'"),f=HZ.ui.InputButtonUtils.createPrimaryInputButton(_hgt("Submit"),"pwd-dialog__btn--submit",d,!0,null,"trackMe","compId='pwdDialogSubmit'"),g=$("<div class='pwd-dialog'><p class='pwd-dialog__prompt'>"+b+"</p><label for='pwd-dialog__pwd'>"+_hgt("Password")+"</label><input type='password' class='pwd-dialog__input' id='pwd-dialog__pwd' name='pwd' placeholder='"+_hgt("Minimum 8 characters")+"'></div>"),h={title:_hgt("Email sent successfully!"),body:g,controls:[e,f],dialogClassName:"pwdDialog",onViewLoaded:function(){$("#pwd-dialog__pwd").focus()},onViewUnloaded:function(){}};a.init(h),HZ.ui.Yamdi.show(a)}function b(a){function b(a){var b=$(a).parents(".modal-dialog");return b.length?window.innerHeight-b.height():window.innerHeight}function c(){var a=$(this);a.css("height","auto");var c=this.scrollHeight+2;null===e&&(e=b(this)),c>this.clientHeight&&(c=Math.max(Math.min(c,e),this.clientHeight),a.css("height",c+"px"))}function d(){e=null}var e=null;a.bind("input",c),$(window).bind("resize",d)}var c,d,e,f,g,h,i,j,k,l,m=HZ.utils.Html.template,n=null;this.attachUploadInitialized=!1,this.IvyIntegration=null,this.applySettings=function(a){j=a},this.getSettings=function(){return j},this.getToFld=function(){return c},this.getNameFld=function(){return g},this.getSubjectFld=function(){return d},this.getMessageFld=function(){return e},this.getEmailFld=function(){return f},this.getSendBtn=function(){return i},this.getCancelBtn=function(){return h};var o=function(){HZ.ui.AjaxThrobber.setInCall(!1),HZ.ui.Yamdi.hide(this)};this.getConsentsForUserTypes=function(){return n=null,HZ.modules.Consents.getConsentsForUserTypes({userTypes:["CONTACT_PRO"]}).done(function(a){a&&a[0]&&(n=a[0])})},this.registerConsentsWhenNeeded=function(){return HZ.utils.Config.isConsentCheckingEnabled&&n&&n.consentTakingItems?this.registerAcceptedConsents():(new $.Deferred).resolve().promise()},this.registerAcceptedConsents=function(){var a=[],b=this.getBody().find("input.contact-dialog-consent-checkbox"),c=n.consentTakingItems;b.each(function(a,b){var d=$(b),e=parseInt(d.data("consent-id"),10),f=$.grep(c,function(a){return a.consentId===e})[0];f&&(f.isChecked=d.is(":checked"))});for(var d=0;d<c.length;d++){var e=c[d];a.push({consentId:e.consentId,consented:e.isChecked?"APPROVE":"DENY",userConsentCauseFlags:1})}return a.length?HZ.modules.Consents.registerConsents({userConsents:a}):(new $.Deferred).resolve().promise()},this.createAndUpdateContactOptionList=function(a,b){for(var c=0;c<a.length;c++){var d=a[c],e=this.getBody().find(".confirmProMessage[data-consent-id="+d.consentId+"]");e.length?d.isHidden?e.closest(".controls").remove():e.prop("checked",d.isChecked):d.isHidden||this.getBody().find(".proMessageDisclaimer").prepend($(m(b||'<div class="controls"><label class="checkbox"><input type="checkbox" class="confirmProMessage contact-dialog-consent-checkbox" %checked% data-consent-id="%consentId%"/> %optionName%</label></div>',{optionName:d.contents,consentId:d.consentId,checked:d.isChecked?"checked":""})))}};var p=function(){var a=this;HZ.utils.Logger.logCountInTSDB("tracking","contact_dialog_submit"),HZ.ui.AjaxThrobber.setInCall(!0),HZ.ui.InputButtonUtils.disableButton(i),form.trigger("beforeSubmit.email");var b=j.maxAttachmentFiles?this.getForm():null,e=j.event?j.event:"",h=j.isDealerLocationEmail,m="undefined"!=typeof grecaptcha?grecaptcha.getResponse(recaptchaWidgetId):"",n=j.type,o=c.val(),p=l.val(),s=d.val(),t=this.getMessageBody(),u=j.staticMessageData&&j.staticMessageData.s&&this.getForm().find(".hz-appendStaticMessage").prop("checked"),v=j.generateColorPaletteImageLink,w=j.colorPaletteShareLink,x={};if(x[HZ.sendEmail.params.to]=o,x[HZ.sendEmail.params.subject]=s,x[HZ.sendEmail.params.message]=t,x[HZ.sendEmail.params.isVisitor]=!HZ.data.CurrentSessionUser,x[HZ.sendEmail.params.phone]=p,x[HZ.sendEmail.params.event]=e,x[HZ.sendEmail.params.type]=n,x[HZ.sendEmail.params.captchaResponse]=m,x[HZ.sendEmail.params.referenceId]=j.referenceId,x[HZ.sendEmail.params.replyToId]=j.replyToId,x[HZ.sendEmail.params.shareLink]=w,x[HZ.sendEmail.params.shareImageUrl]=v,x[HZ.sendEmail.params.isDealerLocation]=h,x[HZ.sendEmail.params.signupSourceLink]=j.sourceLink,j.allowShare){if(r.call(this))return a.registerConsentsWhenNeeded().always(function(){HZ.ajaz.Services.sendShareEmail(x,$.proxy(q,a))}),!1}else if(f.length){if(r.call(this)){var y=f.val(),z=g.val();return x[HZ.sendEmail.params.from]=y,z||(z=""),j.signupOnSend?HZ.ajaz.Services.inlineSignup(y,!0,z,j.sourceLink,null,function(c){"true"==c.success?(c.redirectUrl&&(k=c.redirectUrl),HZ.ui.AjaxThrobber.setInCall(!0),a.registerConsentsWhenNeeded().always(function(){HZ.ajaz.Services.sendEmail(x,b,$.proxy(q,a))})):j.sourceLink==HZ.utils.Config.contactProAutoRegisterSourceLink?c.error==HZ.utils.Config.userEmailExists&&a.registerConsentsWhenNeeded().always(function(){HZ.ajaz.Services.sendGuestEmail(x,$.proxy(q,a)),HZ.utils.Logger.sendEventLogLightweight(HZ.utils.Config.eventContactproAutoRegisterEmailExists,{})}):HZ.auth.Manager.login({source:j.sourceLink,screen:"signin",email:y})}):a.registerConsentsWhenNeeded().always(function(){HZ.ajaz.Services.sendGuestEmail(x,$.proxy(q,a))}),!1}}else if(r.call(this))return u&&(n=j.staticMessageData.et),a.registerConsentsWhenNeeded().always(function(){HZ.ajaz.Services.sendEmail(x,b,$.proxy(q,a))}),!1},q=function(b){var c="",d=l.val();if(HZ.ui.AjaxThrobber.setInCall(!1),"true"===b.success){var e=j.type==HZ.sendEmail.types.PRO_REPLY;this.onSubmitSuccess&&"function"==typeof this.onSubmitSuccess&&this.onSubmitSuccess.call(this,{isSponsoredPro:!!b.isSponsoredPro}),c=j.type==HZ.sendEmail.types.PRO||e||j.type==HZ.sendEmail.types.MP||j.type==HZ.sendEmail.types.MP_SELLER||j.type==HZ.sendEmail.types.MP_BUYER||j.type==HZ.sendEmail.types.USER||j.type==HZ.sendEmail.types.USER_REPLY?HZ.sendEmail.texts.CONFIRM_MESSAGE_SENT:HZ.sendEmail.texts.CONFIRM_EMAIL_SENT,HZ.ui.yamdi.Common.hideAllDialogs(),k?a():!HZ.data.CurrentSessionUser&&HZ.utils.Config.contactProAutoRegisterEnabled&&j.sourceLink==HZ.utils.Config.contactProAutoRegisterSourceLink?HZ.ui.yamdi.Common.compel("",c,_hgt("Ok"),function(){location.reload()}):j.showEstimationUpsell&&""!==j.professionalInquiryId&&e?(this.IvyIntegration||(this.IvyIntegration=new HZ.dialogs.IvyIntegration),this.IvyIntegration.showMessageReplyEntryPoint(j.professionalInquiryId)):HZ.ui.yamdi.Common.alert("",c),j.onSuccess&&j.onSuccess(),HZ.utils.Logger.sendEventLogLightweight("pro_contact_request_sent",{phone:d}),HZ.utils.Logger.logCountInTSDB("tracking","pro_contact_request_sent")}else{if(b.error==HZ.ajaz.Services.sendEmail.ERROR_RECOVERABLE)return"function"==typeof onRecaptchaLoadCallback&&onRecaptchaLoadCallback(),void this.showError(b.errorMessage);d&&b.error==HZ.ajaz.Services.sendEmail.PHONE_VALIDATION_FAILURE?(HZ.utils.Logger.sendEventLogLightweight("pro_contact_unthenticated_phone_number",{phone:d}),HZ.utils.Logger.logCountInTSDB("tracking","pro_contact_unthenticated_phone_number"),this.showError(HZ.sendEmail.texts.ERROR_INVALID_PHONE)):(HZ.ui.yamdi.Common.hideAllDialogs(),HZ.ui.yamdi.Common.alert(_hgt("Send message error!"),b.errorMessage))}},r=function(){var a=c.val(),b=d.val(),e=this.getMessageBody();if(""==$.trim(a))return this.showError(HZ.sendEmail.texts.ERROR_EMAIL_ADDRESSES_EMPTY),!1;if(""==$.trim(b))return this.showError(HZ.sendEmail.texts.ERROR_SUBJECT_EMPTY),!1;if(""==$.trim(e))return this.showError(HZ.sendEmail.texts.ERROR_MESSAGE_EMPTY),!1;if(form.find(".zipFldGrp").is(":visible")){if(!$.trim(form.find(".zipFldGrp .controls input").val()))return this.showError(HZ.sendEmail.texts.ERROR_NO_ZIP),!1}if(form.find(".locationFldGrp").is(":visible")){if(!$.trim(form.find(".locationFldGrp .controls input").val()))return this.showError(HZ.sendEmail.texts.ERROR_TEXT_LOCATION_EMPTY),!1}if(form.find(".nameFldGrp").is(":visible")){if(!form.find(".nameFldGrp .controls input").val())return this.showError(HZ.sendEmail.texts.ERROR_NO_CONTACT_NAME),!1}if(form.find(".phoneFldGrp").is(":visible")){if(!$.trim(l.val()))return this.showError(HZ.sendEmail.texts.ERROR_NO_PHONE),!1}return!(this.validateMore&&"function"==typeof this.validateMore&&!this.validateMore.call(this))};this.resetFooter=function(){HZ.ui.AjaxThrobber.setInCall(!1),HZ.ui.InputButtonUtils.enableButton(i)},this.showError=function(a){this.showStatus(a),this.resetFooter()},function(){var a="contactDialog";this.DIALOG_CLASSNAME&&(a=this.DIALOG_CLASSNAME);var j=_hgt("Send a Message");this.DIALOG_TITLE&&(j=this.DIALOG_TITLE);var k=$(this.FORM_TEMPLATE);h=HZ.ui.InputButtonUtils.createSecondaryInputButton(_hgt("Cancel"),"hzContactDlgCancelBtn",$.proxy(o,this),null,null,"trackMe","compId='contactDlgCancel'"),i=HZ.ui.InputButtonUtils.createPrimaryInputButton(_hgt("Send"),"hzContactDlgSendBtn",null,!0,null,"trackMe","compId='contactDlgSend'");var m={title:j,body:k,controls:[HZ.ui.AjaxThrobber.getThrobber(),h,i],dialogClassName:a,onViewLoaded:$.proxy(this.onViewLoaded,this),onViewUnloaded:$.proxy(this.onViewUnloaded,this)};HZ.email.ContactDialog.superclass.constructor.call(this),this.init(m),form=this.getForm(),c=form.find(".hz-toFld"),d=form.find(".hz-subjectFld"),e=form.find(".hz-messageFld"),f=form.find(".hz-emailFld"),g=form.find(".hz-nameFld"),l=form.find(".phoneFldGrp .controls input"),form.find("[placeholder]").initPlaceHolders({saveEvent:"beforeSubmit.email"}),form.bind("submit",$.proxy(p,this)),b(e)}.call(this)},HZ.extend(HZ.email.ContactDialog,HZ.ui.yamdi.Dialog),$.extend(!0,HZ.email.ContactDialog.prototype,{DEFAULT_OPTIONS:{type:null,referenceId:null,toUserName:"",subject:"",message:"",replyToId:null,event:null,maxAttachmentFiles:0},ATTACH_BUTTON_TEMPLATE:'<a class="hzBtn noFrameButton addImageButton" href="javascript:;" title="%buttonTitle%"><span class="button-icon buttonIconAttach"></span><span class="text-m text-dt-s label colorLink">%buttonTitle%</span></a>',ATTACH_TEMPLATE:'<div class="hz-attach"><input type="file" name="attach1" accept="image/*" class="span-sm-6"/><input type="file" name="attach2" accept="image/*" class="span-sm-6"/><input type="file" name="attach3" accept="image/*" class="span-sm-6"/><input type="file" name="attach4" accept="image/*" class="span-sm-6"/></div>',FORM_TEMPLATE:'<fieldset class="row-fluid"><label>'+_hgt("To (enter recipient emails, separated by commas)")+'</label><textarea type="text" class="hz-toFld span-xs-12 form-control" rows="2"/><label>'+_hgt("Subject")+'</label><input type="text" class="hz-subjectFld span-xs-12 form-control" value="" placeholder="'+_hgt("Enter subject")+'"/><label>'+_hgt("Message")+'</label><textarea rows="5" class="hz-messageFld span-xs-12 form-control" placeholder="'+_hgt("Enter your message here")+'"/></fieldset>',validateMore:function(){return!0},getMessageBody:function(){return this.getMessageFld().val()},onSubmitSuccess:null,prepare:function(a){var b,c=this;if(this.applySettings($.extend(!0,{},this.DEFAULT_OPTIONS,a)),b=this.getSettings(),this.getToFld().val(b.toUserName),this.getSubjectFld().val(b.subject),this.getMessageFld().val(b.message),b.maxAttachmentFiles)if(this.attachUploadInitialized){if(!this.getForm().find(".addImageButton").length){var d=$(HZ.utils.Html.template(this.ATTACH_BUTTON_TEMPLATE,{buttonTitle:_hgt("Attach Images")}));d.insertAfter(this.getMessageFld()),c.enableAttachment()}}else{var d=$(HZ.utils.Html.template(this.ATTACH_BUTTON_TEMPLATE,{buttonTitle:_hgt("Attach Images")}));d.insertAfter(this.getMessageFld()),HZ.utils.ResourceLoader.requireResources([{type:HZ.utils.ResourceLoader.JS,file:"jquery.form.min"}],function(){c.enableAttachment()})}else c.disableAttachment()},enableAttachment:function(){var a=this.getForm().find(".hz-attach"),b=this;if(0===a.length){var c=this.getForm().find(".addImageButton");a=$(this.ATTACH_TEMPLATE).insertAfter(c),c.on("click",function(){a.is(":visible")||(a.show(),UIHelper.isMSIE||a.find("input:first").click(),b.recenter())})}this.attachUploadInitialized=!0},disableAttachment:function(){var a=this.getForm().find(".addImageButton, .hz-attach");a.length&&a.remove()},onViewLoaded:function(){HZ.ui.InputButtonUtils.enableButton(this.getSendBtn()),this.getForm().find("[placeholder]").initPlaceHolders("refresh")},onViewUnloaded:function(){this.resetForm(),this.getForm().find(".hz-attach").hide(),this.hideStatus()}}),HZ.email.ContactProDialog=function(){var a={type:HZ.sendEmail.types.PRO};this.DEFAULT_OPTIONS={toUserName:"",toUserDisplayName:"",subject:"",message:"",useZipCode:!1,isShortForm:!1};var b,c;b=_hgt("Enter your zip code (required)"),c=_hgt("Enter your contact phone number (required)"),this.FORM_TEMPLATE='<fieldset class="row-fluid"><div class="control-group fromDisplayEmailGrp"><label class="control-label">'+_hgt("From")+'</label><div class="controls"></div></div><div class="control-group" id="toUserNameField"><label class="control-label">'+_hgt("To")+'</label><div class="controls toDisplayName"></div><input type="hidden" class="hz-toFld" value=""/></div><div class="control-group" id="subjectField"><label class="control-label">'+_hgt("Subject")+'</label><div class="controls"><input type="text" class="hz-subjectFld span-xs-12 form-control" value="" placeholder="'+_hgt("Enter subject")+'"/></div></div><div class="control-group nameFldGrp"><label class="control-label name-label">'+_hgt("Name")+'</label><div class="controls"><input type="text" class="span-xs-12 form-control" value="" placeholder="'+_hgt("Enter your name (required)")+'"/></div></div><div class="control-group phoneFldGrp"><label class="control-label phone-label">'+_hgt("Phone Number")+'</label><div class="controls"><input type="text" class="span-xs-12 form-control" value="" placeholder="'+c+'"/></div></div><div class="control-group locationFldGrp"><label class="control-label location-label">'+_hgt("Location")+'</label><div class="controls"><input type="text" class="span-xs-12 form-control" value="" placeholder="'+_hgt("Enter your city, state")+'"/></div></div><div class="control-group zipFldGrp"><label class="control-label zip-label">'+_hgt("Zip Code")+'</label><div class="controls"><input type="text" class="span-xs-12 form-control" value="" placeholder="'+b+'"/></div></div><div class="control-group dealerFldGrp mbs"><label class="control-label dealer-label">'+_hgt("To:")+'</label><div class="controls"><select class="form-control dealer-select"></select></div></div><div class="control-group"><label class="control-label">'+_hgt("Message")+'</label><div class="controls"><textarea class="hz-messageFld span-xs-12 form-control" rows="4" value="" placeholder="'+_hgt("Enter your message here")+'"/></div></div><div id="contact-dialog-contact-options"></div><div class="proMessageDisclaimer control-group"><div class="controls"><label class="checkbox"><input type="checkbox" class="confirmProMessage confirmNonSolicitation"/>'+_hgt("I confirm this is a personal project inquiry and not a promotional message or solicitation.")+'</label></div><div class="auto-signup-consent"></div></div></fieldset>',this.prepare=function(b){var c=$.extend(!0,{},a,this.DEFAULT_OPTIONS,b),d=this.getForm();c.askForName=HZ.utils.Config.nameTestEnabled,c.useZipCode=HZ.utils.Config.zipCodeTestEnabled,HZ.email.ContactProDialog.superclass.prepare.call(this,c),$(d).attr("scopeId","ContactProDialog"),d.find(".toDisplayName").html(c.toUserDisplayName);var e="";if(HZ.data.CurrentSessionUser&&c.type!=HZ.sendEmail.types.MP&&c.type!=HZ.sendEmail.types.USER&&c.type!=HZ.sendEmail.types.USER_REPLY?(d.find(".fromDisplayEmailGrp").show(),e=HZ.data.CurrentSessionUser.getEmailAddress(),e?d.find(".fromDisplayEmailGrp").find(".controls").html(e):HZ.ajaz.Services.User.getCurrentSessionUserExtraData(function(a){if("true"==a.success){HZ.data.CurrentSessionUser.setExtra(a.userEmail,a.phoneNumber,a.zipCode),d.find(".fromDisplayEmailGrp").find(".controls").html(a.userEmail);var b=a.phoneNumber,c=a.zipCode;d.find(".phoneFldGrp").length&&b&&d.find(".phoneFldGrp").find(".controls input").val(b),d.find(".zipFldGrp").length&&c&&d.find(".zipFldGrp").find(".controls input").val(c)}})):d.find(".fromDisplayEmailGrp").hide(),c.askForName&&HZ.data.CurrentSessionUser){var f=HZ.data.CurrentSessionUser.getUserName(),g=HZ.data.CurrentSessionUser.getLoginName();f&&f!=g&&d.find(".nameFldGrp").find(".controls input").val(f)}if(HZ.data.CurrentSessionUser){var h=HZ.data.CurrentSessionUser.getPhoneNumber(),i=HZ.data.CurrentSessionUser.getZipCode();d.find(".phoneFldGrp").length&&h&&d.find(".phoneFldGrp").find(".controls input").val(h),d.find(".zipFldGrp").length&&i&&d.find(".zipFldGrp").find(".controls input").val(i)}c.type==HZ.sendEmail.types.PRO_REPLY||c.type==HZ.sendEmail.types.MP||c.type==HZ.sendEmail.types.USER||c.type==HZ.sendEmail.types.USER_REPLY?(d.find(".proMessageDisclaimer").hide(),d.find(".phoneFldGrp").hide(),d.find(".locationFldGrp").hide(),d.find(".zipFldGrp").hide(),d.find(".nameFldGrp").hide()):(d.find(".proMessageDisclaimer").show(),d.find(".phoneFldGrp").show(),c.askForName||d.find(".nameFldGrp").hide(),c.useZipCode?d.find(".locationFldGrp").hide():d.find(".zipFldGrp").hide(),c.isShortForm&&(d.find("#toUserNameField").hide(),d.find("#subjectField").hide(),d.find(".name-label").hide(),d.find(".phone-label").hide(),d.find(".location-label").hide(),d.find(".zip-label").hide(),d.find(".modal-header").html(_hgt("Contact {pro}",{pro:c.toUserDisplayName}))));var j=this;if(c.locationData&&c.locationData.length&&c.type==HZ.sendEmail.types.PRO){if($.map(c.locationData,function(a){if(a.email)return a}).length){var k=d.find(".dealer-select");k.empty(),k.append($("<option value='"+c.toUserName+"'>"+c.toUserDisplayName+" ("+_hgt("Main Location")+")</option>"));for(var l=0;l<c.locationData.length;l++){var m=c.locationData[l],n=$("<option>");m.email&&(n.attr("value",m.email),m.dealerName?n.text(m.dealerName):n.text(m.email),k.append(n),0==l&&k.val(n.val()),m.email==c.defaultEmailToPopulate&&k.val(n.val()))}var o=function(){j.getToFld().val(k.val()),k.val()==c.toUserName?delete j.getSettings().isDealerLocationEmail:j.getSettings().isDealerLocationEmail=!0};k.on("change",o),o()}else d.find(".dealerFldGrp").hide()}else d.find(".dealerFldGrp").hide()},this.validateMore=function(){var a=this.getForm(),b=a.find(".confirmProMessage.confirmNonSolicitation");return""==$.trim(this.getMessageFld().val())?(this.showError(HZ.sendEmail.texts.ERROR_MESSAGE_EMPTY),!1):!b.is(":visible")||!b.is(":not(:checked)")||(this.showError(HZ.sendEmail.texts.ERROR_PRO_CONFIRM_INQUIRY_NOT_AGREE),!1)},this.getMessageBody=function(){var a=this.getSettings(),b=this.getForm(),c="";if(b.find(".phoneFldGrp").is(":visible")){var d="[name]"+b.find(".nameFldGrp .controls input").val()+"[/name]",e=b.find(".phoneFldGrp .controls input").val(),f=b.find(".locationFldGrp .controls input").val(),g="[zip]"+b.find(".zipFldGrp .controls input").val()+"[/zip]";""!=$.trim(e)&&(c=_hgt("Contact Phone Number: {phoneNumber}",{phoneNumber:e})+"\n"),a.useZipCode?""!=$.trim(g)&&(c=c+_hgt("Project Location: {zipCode}",{zipCode:g})+"\n"):""!=$.trim(f)&&(c=c+_hgt("Project Location: {location}",{location:f})+"\n"),""!=$.trim(d)&&(c=c+_hgt("Contact Name: {name}",{name:d})+"\n"),""!=$.trim(c)&&(c+="\n")}return c+=this.getMessageFld().val()},this.onSubmitSuccess=function(a){window.ga("send","event","ContactProDialog","contactSuccess");var b=this.getSettings(),c="";c=a.isSponsoredPro?"pro_contact_plus":"pro_contact_organic";var d={hasaccount:HZ.data.CurrentSessionUser?"y":"n",pro_username:b.toUserName};HZ.utils.Gtm.pushData(c,c,d)},this.onViewLoaded=function(){var a=this;HZ.utils.Config.isConsentCheckingEnabled&&a.getConsentsForUserTypes().done(function(b){if(b&&b[0]){var c=b[0];if(a.createAndUpdateContactOptionList(c.consentTakingItems),HZ.utils.Config.isConsentCheckingEnabled&&"US"===HZ.modules.Consents.getConsentCountryCode()){a.getBody().find(".proMessageDisclaimer").find(".auto-signup-consent").text(_hgt("I understand that Houzz will help me coordinate with pros via phone."))}}}),HZ.email.ContactProDialog.superclass.onViewLoaded.call(this)},function(){HZ.email.ContactProDialog.superclass.constructor.call(this)}.call(this)},HZ.extend(HZ.email.ContactProDialog,HZ.email.ContactDialog),HZ.email.GuestContactProDialog=function(){var a={type:HZ.sendEmail.types.PRO};this.DEFAULT_OPTIONS={toUserName:"",toUserDisplayName:"",subject:"",message:"",useZipCode:!1,isShortForm:!1};var b={tag:"a",attr:{href:HZ.utils.Config.termsOfUseUrl,target:"_new",class:"colorLink"}},c={tag:"a",attr:{href:HZ.utils.Config.privacyPolicyUrl,target:"_new",class:"colorLink"}};this.FORM_TEMPLATE='<fieldset class="row-fluid condensed-layout"><input type="hidden" class="hz-toFld" value=""/><input type="hidden" class="hz-subjectFld" value="" placeholder="'+_hgt("Enter subject")+'"/><div class="control-group"><label class="control-label">'+_hgt("From")+'</label><div class="controls"><input type="text" class="hz-emailFld span-xs-12" value="" placeholder="'+_hgt("Enter your email")+'"/></div><div style="clear:both;"></div></div><div class="control-group nameFldGrp"><label class="control-label name-label">'+_hgt("Name")+'</label><div class="controls"><input type="text" class="span-xs-12" value="" placeholder="'+_hgt("Enter your name")+'"/></div><div style="clear:both;"></div></div><div class="control-group phoneFldGrp"><label class="control-label phone-label">'+_hgt("Phone #")+'</label><div class="controls"><input type="text" class="span-xs-12" value="" placeholder="'+_hgt("Enter your contact phone number")+'"/></div><div style="clear:both;"></div></div><div class="control-group locationFldGrp"><label class="control-label location-label">'+_hgt("Location")+'</label><div class="controls"><input class="span-xs-12" type="text" value="" placeholder="'+_hgt("Enter your city, state")+'"/></div><div style="clear:both;"></div></div><div class="control-group zipFldGrp"><label class="control-label zip-label">'+_hgt("Zip Code")+'</label><div class="controls"><input class="span-xs-12" type="text" value="" placeholder="'+_hgt("Enter your zip code")+'"/></div><div style="clear:both;"></div></div><div class="control-group dealerFldGrp mbs"><label class="control-label dealer-label">'+_hgt("To:")+'</label><div class="controls"><select class="form-control dealer-select"></select></div></div><div class="control-group"><label class="control-label">'+_hgt("Message")+'</label><div class="controls"><textarea rows="4" value="" class="form-control hz-messageFld span-xs-12" placeholder="'+_hgt("Enter your message here")+'"/></div><div style="clear:both;"></div></div><div id="recaptchaDiv"></div><div class="proMessageDisclaimer control-group"><div class="controls"><label class="checkbox"><input type="checkbox" class="confirmProMessage confirmNonSolicitation"/>'+_hgt("I confirm this is a personal project inquiry and not a promotional message or solicitation.")+'<span class="disclaimer">'+(HZ.utils.Config.isConsentCheckingEnabled?"":_hgt('By clicking "Send" I acknowledge and agree to the creation of an account and to the <t1>Terms of Use</t1> and <t2>Privacy Policy</t2>',{t1:b,t2:c}))+'</span></label></div><div class="auto-signup-consent"></div></div></fieldset>',this.prepare=function(b){var c=$.extend(!0,{},a,this.DEFAULT_OPTIONS,b),d=this.getForm();c.askForName=HZ.utils.Config.nameTestEnabled,c.useZipCode=HZ.utils.Config.zipCodeTestEnabled,c.signupOnSend=HZ.utils.Config.contactProAutoRegisterEnabled,c.sourceLink=HZ.utils.Config.contactProAutoRegisterSourceLink,this.applySettings(c),c.isShortForm&&(this.DIALOG_TITLE=_hgt("Contact {pro}",{pro:c.toUserDisplayName})),HZ.email.GuestContactProDialog.superclass.prepare.call(this,c),$(d).attr("scopeId","GuestContactProDialog"),d.find(".toDisplayName").html(c.toUserDisplayName),c.type==HZ.sendEmail.types.PRO_REPLY||c.type==HZ.sendEmail.types.MP?d.find(".proMessageDisclaimer").hide():d.find(".proMessageDisclaimer").show(),c.askForName||d.find(".nameFldGrp").hide(),c.useZipCode?d.find(".locationFldGrp").hide():d.find(".zipFldGrp").hide(),c.isShortForm&&(d.find(".row-fluid.condensed-layout").removeClass("condensed-layout"),d.find(".name-label").hide(),d.find(".phone-label").hide(),d.find(".location-label").hide(),d.find(".zip-label").hide(),d.find(".modal-header").html(_hgt("Contact {pro}",{pro:c.toUserDisplayName}))),c.signupOnSend||d.find(".disclaimer").hide();var e=this;if(c.type==HZ.sendEmail.types.PRO)if(c.locationData&&c.locationData.length){var f=$.map(c.locationData,function(a){if(a.email)return a}).length;if(f){var g=d.find(".dealer-select");g.empty(),g.append($("<option value='"+c.toUserName+"'>"+c.toUserDisplayName+" ("+_hgt("Main Location")+")</option>"));for(var h=0;h<c.locationData.length;h++){var i=c.locationData[h],j=$("<option>");i.email&&(j.attr("value",i.email),i.dealerName?j.text(i.dealerName):j.text(i.email),g.append(j),0==h&&g.val(j.val()),i.email==c.defaultEmailToPopulate&&g.val(j.val()))}var k=function(){e.getToFld().val(g.val()),g.val()==c.toUserName?delete e.getSettings().isDealerLocationEmail:e.getSettings().isDealerLocationEmail=!0};g.on("change",k),k()}else d.find(".dealerFldGrp").hide()}else d.find(".dealerFldGrp").hide()},onRecaptchaLoadCallback=function(){var a="recaptchaDiv";if("undefined"!=typeof grecaptcha){try{"undefined"!=typeof recaptchaWidgetId&&grecaptcha.reset(recaptchaWidgetId)}catch(a){}$("#"+a).is(":empty")&&(recaptchaWidgetId=grecaptcha.render(a,{sitekey:HZ.utils.Config.recaptchaPublicKey}))}},this.onViewLoaded=function(){var a=this;HZ.utils.Config.isConsentCheckingEnabled&&a.getConsentsForUserTypes().done(function(b){if(b&&b[0]){var c=b[0],d=a.getBody().find(".proMessageDisclaimer"),e=c.contents;d.find(".auto-signup-consent").html(e),a.createAndUpdateContactOptionList(c.consentTakingItems)}}),HZ.utils.Config.contactProAutoRegisterEnabled||HZ.data.CurrentSessionUser||("undefined"==typeof grecaptcha?$.getScript("https://www.google.com/recaptcha/api.js?onload=onRecaptchaLoadCallback&render=explicit&hl="+HZ.utils.Config.language):onRecaptchaLoadCallback())},this.onViewUnloaded=function(){this.resetForm(),this.resetFooter(),this.hideStatus(),"undefined"!=typeof grecaptcha&&grecaptcha.reset(recaptchaWidgetId)},this.validateMore=function(){var a=this.getForm(),b=a.find(".confirmProMessage.confirmNonSolicitation"),c=a.find(".hz-emailFld").val();if(""==$.trim(this.getMessageFld().val()))return this.showError(HZ.sendEmail.texts.ERROR_MESSAGE_EMPTY),!1;if(b.is(":visible")&&b.is(":not(:checked)"))return this.showError(HZ.sendEmail.texts.ERROR_PRO_CONFIRM_INQUIRY_NOT_AGREE),!1;if(!UIHelper.validateEmail(c,!0))return this.showError(HZ.sendEmail.texts.ERROR_INVALID_FROM_EMAIL_ADDRESS),!1;var d=this.getSettings();return this.getSubjectFld().val(d.subject+" from "+c),this.getSubjectFld().val(_hgt("{emailSubject} from {senderEmailAddress}",{emailSubject:d.subject,senderEmailAddress:c})),!0},this.getMessageBody=function(){var a=this.getSettings(),b=this.getForm(),c="[name]"+b.find(".nameFldGrp .controls input").val()+"[/name]",d=b.find(".phoneFldGrp .controls input").val(),e=b.find(".locationFldGrp .controls input").val(),f="[zip]"+b.find(".zipFldGrp .controls input").val()+"[/zip]",g="";return""!=$.trim(d)&&(g=_hgt("Contact Phone Number: {phoneNumber}",{phoneNumber:d})+"\n"),a.useZipCode?""!=$.trim(f)&&(g=g+_hgt("Project Location: {zipCode}",{zipCode:f})+"\n"):""!=$.trim(e)&&(g=g+_hgt("Project Location: {location}",{location:e})+"\n"),""!=$.trim(c)&&(g=g+_hgt("Contact Name: {name}",{name:c})+"\n"),""!=$.trim(g)&&(g+="\n"),g+=this.getMessageFld().val()},this.onSubmitSuccess=function(a){window.ga("send","event","GuestContactProDialog","contactSuccess");var b=this.getSettings(),c={hasaccount:HZ.data.CurrentSessionUser?"y":"n",pro_username:b.toUserName},d="";d=a.isSponsoredPro?"pro_contact_plus":"pro_contact_organic",HZ.utils.Gtm.pushData(d,d,c)},function(){HZ.email.GuestContactProDialog.superclass.constructor.call(this)}.call(this)},HZ.extend(HZ.email.GuestContactProDialog,HZ.email.ContactDialog),HZ.email.PostIdeabookConfirmContactProDialog=function(){var a={type:HZ.sendEmail.types.PRO};this.DEFAULT_OPTIONS={toUserName:"",toUserDisplayName:"",subject:"",message:"",useZipCode:!1},this.DIALOG_TITLE=_hgt("Saved!"),this.FORM_TEMPLATE="<div class='related-pros-info clearfix'><div id='proUpsellMsg' class='pro-screen-text'></div><div id='proInfo' class=''></div><div id='proContactForm' class=''><fieldset class=\"row-fluid\"><div class=\"control-group fromDisplayEmailGrp\"><label class=\"control-label\">"+_hgt("From")+'</label><div id="fromEmailField" class="controls"></div></div><div class="control-group" id="toUserNameField"><label class="control-label">'+_hgt("To")+'</label><div class="controls toDisplayName"></div><input type="hidden" class="hz-toFld" value=""/></div><div class="control-group" id="subjectField"><label class="control-label">'+_hgt("Subject")+'</label><div class="controls"><input type="text" class="hz-subjectFld span-xs-12 form-control" value="" placeholder="'+_hgt("Enter subject")+'"/></div></div><div class="control-group phoneFldGrp"><div class="controls" comp_id="phone"><input type="text" class="span-xs-12 form-control" value="" placeholder="'+_hgt("Enter your contact phone number")+'"/></div></div><div class="control-group zipFldGrp"><div class="controls" comp_id="zip"><input type="text" class="span-xs-12 form-control" value="" placeholder="'+_hgt("Enter your zip code")+'"/></div></div><div class="control-group"><label class="control-label">'+_hgt("Message")+'</label><div class="controls" comp_id="message"><textarea class="hz-messageFld span-xs-12 form-control" rows="4" value="" placeholder="'+_hgt("Enter your message here")+'"/></div></div><div class="proMessageDisclaimer"><label class="checkbox"><input type="checkbox" class="confirmProMessage confirmNonSolicitation"/>'+_hgt("I confirm this is a personal project inquiry and not a promotional message or solicitation.")+"</label></div></fieldset></div></div>",this.prepare=function(b){var c=$.extend(!0,{},a,this.DEFAULT_OPTIONS,b),d=this.getForm(),e="",f=_hgt("Go to <t1>{galleryName}</t1>.",{galleryName:c.galleryName,t1:{tag:"a",attr:{href:c.galleryUrl,class:"colorLink trackMe",compId:"ideabook"}}});d.find(".modal-footer").prepend("<span id='goToIdeabook'>"+f+"</span>"),e+="<div class='pro-content-container' compId='pro_container'><div class='top-pro-cover'><a href='' class='trackMe'><img data-no-pin-hover='true' src='"+c.coverImageUrl+"' width='250' height='230'></a></div><div class='bottom-pro-details'><div id='proThumb' itemprop='image'><img data-no-pin-hover='true' class='photo hz-user-image' src='"+c.userThumbUrl+"' width='40' height='40'/></div><div id='textDetails'><div class='pro-name'><a class='trackMe' href='"+c.userLink+"'><b>"+c.toUserDisplayName+"</b></a></div>"+c.ratingHtml+"<b>"+c.shortDescription+"</b></div></div></div>",d.find("#proInfo").append(e),d.find("#proUpsellMsg").html(c.proUpsellMsg),c.useZipCode=HZ.utils.Config.zipCodeTestEnabled,HZ.email.ContactProDialog.superclass.prepare.call(this,c),$(d).attr("scopeId","IdeabookContactProDialog"),
d.find(".toDisplayName").html(c.toUserDisplayName);var g="";HZ.data.CurrentSessionUser&&c.type!=HZ.sendEmail.types.MP&&c.type!=HZ.sendEmail.types.USER&&c.type!=HZ.sendEmail.types.USER_REPLY?(d.find(".fromDisplayEmailGrp").show(),g=HZ.data.CurrentSessionUser.getEmailAddress(),g?d.find(".fromDisplayEmailGrp").find(".controls").html(g):HZ.ajaz.Services.User.getCurrentSessionUserExtraData(function(a){"true"==a.success&&(HZ.data.CurrentSessionUser.setExtra(a.userEmail,a.phoneNumber,a.zipCode),d.find(".fromDisplayEmailGrp").find(".controls").html(a.userEmail))})):d.find(".fromDisplayEmailGrp").hide(),d.find("#toUserNameField").hide(),d.find("#subjectField").hide(),$(".modal-dialog").addClass("post-ideabook-save-pro-contact")},this.validateMore=function(){var a=this.getForm(),b=a.find(".confirmProMessage.confirmNonSolicitation");return""==$.trim(this.getMessageFld().val())?(this.showError(HZ.sendEmail.texts.ERROR_MESSAGE_EMPTY),!1):!b.is(":visible")||!b.is(":not(:checked)")||(this.showError(HZ.sendEmail.texts.ERROR_PRO_CONFIRM_INQUIRY_NOT_AGREE),!1)},this.getMessageBody=function(){var a=this.getSettings(),b=this.getForm(),c="";if(b.find(".phoneFldGrp").is(":visible")){var d=b.find(".phoneFldGrp .controls input").val(),e=b.find(".locationFldGrp .controls input").val(),f="[zip]"+b.find(".zipFldGrp .controls input").val()+"[/zip]";""!=$.trim(d)&&(c=_hgt("Contact Phone Number: {phoneNumber}",{phoneNumber:d})+"\n"),a.useZipCode?""!=$.trim(f)&&(c=c+_hgt("Project Location: {zipCode}",{zipCode:f})+"\n"):""!=$.trim(e)&&(c=c+_hgt("Project Location: {location}",{location:e})+"\n"),""!=$.trim(c)&&(c+="\n")}return c+=this.getMessageFld().val()},this.onSubmitSuccess=function(){window.ga("send","event","ContactProDialog","contactSuccess")},function(){HZ.email.PostIdeabookConfirmContactProDialog.superclass.constructor.call(this)}.call(this)},HZ.extend(HZ.email.PostIdeabookConfirmContactProDialog,HZ.email.ContactDialog),HZ.email.EmailDialog=function(){function a(){if(!i){i=new HZ.ui.yamdi.Dialog;var a={dialogClassName:"contactsLoadingDlg",controls:[]};i.init(a);var b='<div class="hzLoadingDlgThrobber"></div><div class="hzLoadingDlgMessage">'+_hgt("Loading...")+"</div>";i.setTitle(""),i.setBody(b)}}function b(b){a(),HZ.ui.Yamdi.switchDialog(i),HZ.utils.ResourceLoader.requireAddressBookResources(function(){HZ.addressBook.Contacts.load(b,function(){j=!0,n=HZ.addressBook.Contacts.getEmailProvider();var a=HZ.dialogs.EmailDialog;HZ.addressBook.Contacts.isUpsellRequired()&&(a=HZ.addressBook.Dialogs.getUpsellDialog(function(a){a?h():HZ.ui.Yamdi.switchDialog(HZ.dialogs.EmailDialog)})),HZ.ui.Yamdi.switchDialog(a)})})}function c(){var a="";switch(n){case HZ.utils.Config.appTypeYahoo:a=l?_hgt("Update your Yahoo contact list to lookup your recently emailed friends by name.  Houzz will not use your contact list to send any messages other than those directed by you."):_hgt("By importing your Yahoo contact list, you can look up your friends by name and auto-complete their email addresses when you send them messages. Houzz will not use your contact list to send any messages other than those directed by you.");break;case HZ.utils.Config.appTypeOutlook:a=l?_hgt("Update your Outlook contact list to lookup your recently emailed friends by name.  Houzz will not use your contact list to send any messages other than those directed by you."):_hgt("By importing your Outlook contact list, you can look up your friends by name and auto-complete their email addresses when you send them messages. Houzz will not use your contact list to send any messages other than those directed by you.");break;default:case HZ.utils.Config.appTypeGoogle:a=l?_hgt("Update your Gmail contact list to lookup your recently emailed friends by name.  Houzz will not use your contact list to send any messages other than those directed by you."):_hgt("By importing your Gmail contact list, you can look up your friends by name and auto-complete their email addresses when you send them messages. Houzz will not use your contact list to send any messages other than those directed by you.")}return a}function d(){var a="";switch(n){case HZ.utils.Config.appTypeYahoo:a=l?_hgt("Update my Yahoo contact list"):_hgt("Import my Yahoo contact list");break;case HZ.utils.Config.appTypeOutlook:a=l?_hgt("Update my Outlook contact list"):_hgt("Import my Outlook contact list");break;default:case HZ.utils.Config.appTypeGoogle:a=l?_hgt("Update my Gmail contact list"):_hgt("Import my Gmail contact list")}return a}function e(a){var b=a.find(".hz-emailFld"),c=a.find("#fromLabel"),d=a.find("#emailDialogEmailFromName"),e=a.find("#fromNameLabel"),f=a.find(".disclaimer");b&&(b.hide(),c.hide()),d&&(d.hide(),e.hide()),f&&f.hide()}function f(a){var b=a.find("#tradeDisclaimer");tradeDisclaimer&&b.show()}function g(a,b){k||(b.useAddressBook?($("#upsellTip").hover(function(){var a=c();$("#upsellTip").tipBubble({content:a,point:"north",width:200,position:"absolute",showCloseBtn:!1})},function(){$("#upsellTip").tipBubble("hide")}),$("#upsellLine a:first").click(function(){h()})):$("#upsellLine").css("display","none"),b.title&&a.find(".modal-header").html(b.title),b.disableTitle&&a.find(".hz-subjectFld").prop("disabled",!0),b.staticMessageData&&b.staticMessageData.s&&(a.find("#appendStaticMessage").removeClass("hidden"),a.find("#appendStaticMessage .hz-appendStaticMessage").prop("checked","checked"),a.find("#appendStaticMessage label").append(b.staticMessageData.ml),a.find("#appendStaticMessage .hz-staticMessage").html(b.staticMessageData.mc)),b.signupOnSend?(a.find(".hz-subjectFld").hide(),a.find("#subjectLabel").hide(),a.find(".hz-messageFld").hide(),a.find("#messageLabel").hide(),a.find(".modal-header").html(_hgt("Email Photo"))):e(a),b.type==HZ.sendEmail.types.TRADE_EMAIL&&f(a),k=!0)}function h(){switch(n){case HZ.utils.Config.appTypeYahoo:HZ.externalContacts.api.requestAuth(n,HZ.ajaz.Contacts.YAHOO_CONTACTS_SCOPE,function(a){b(!0)});break;case HZ.utils.Config.appTypeOutlook:HZ.externalContacts.api.requestAuth(n,HZ.ajaz.Contacts.OUTLOOK_CONTACTS_SCOPE,function(a){b(!0)});break;default:case HZ.utils.Config.appTypeGoogle:HZ.externalContacts.api.requestAuth(n,HZ.ajaz.Contacts.GOOGLE_CONTACTS_SCOPE,function(a){b(!0)})}}var i=null,j=!1,k=!1,l=!1,m=!1,n="";this.DEFAULT_OPTIONS={title:null,type:null,referenceId:null,subject:"",message:"",event:HZ.sendEmail.events.BTN,useAddressBook:!0,disableTitle:!1};var o={tag:"a",attr:{href:"javascript:;",class:"colorLink"}},p={tag:"a",attr:{id:"upsellTip",href:"javascript:;",class:"colorLink"}},q={tag:"a",attr:{href:HZ.utils.Config.termsOfUseUrl,target:"_new",class:"colorLink"}},r={tag:"a",attr:{href:HZ.utils.Config.privacyPolicyUrl,target:"_new",class:"colorLink"}};this.FORM_TEMPLATE='<fieldset class="row-fluid"><label id="toLabel">'+_hgt("To")+'</label><div id="emailDialogAddressBook"></div><textarea class="hz-toFld span-xs-12 form-control" autofocus="autofocus" rows="2" id="emailDialogEmailInput" placeholder="'+_hgt("Separate multiple emails with commas")+'" /><div id="upsellLine">'+_hgt("<t1>Import my Gmail contact list</t1>&nbsp;(<t2>why?</t2>)",{t1:o,t2:p})+'</div><label id="fromLabel">'+_hgt("From")+'</label><input id="emailDialogEmailFromInput" type="text" class="hz-emailFld span-xs-12" value="" placeholder="'+_hgt("Your email address")+'"/><label id="fromNameLabel">'+_hgt("Name")+'</label><input id="emailDialogEmailFromName" type="text" class="hz-nameFld span-xs-12" value="" placeholder="'+_hgt("Your name")+'"/><label id="subjectLabel">'+_hgt("Subject")+'</label><input type="text" class="hz-subjectFld span-xs-12" value="" placeholder="'+_hgt("Enter subject")+'"/><label id="messageLabel">'+_hgt("Message")+'</label><textarea rows="5" class="form-control hz-messageFld span-xs-12" placeholder="'+_hgt("Enter your message here")+'"/><div id="appendStaticMessage" class="hidden"><label><input class="hz-appendStaticMessage" type="checkbox" /></label><div class="hz-staticMessage"></div></div><div class="disclaimer">'+_hgt('By clicking "Send" I acknowledge and agree to the creation of an account and to the <t1>Terms of Use</t1> and <t2>Privacy Policy</t2>',{t1:q,t2:r})+'</div><div id="tradeDisclaimer" class="disclaimer-text" style="display: none;">'+_hgt("By sending this message, you confirm that you have the consent of each recipient to send the message and each recipient is a US resident.")+'</div><div id="shareRecaptchaDiv"></div></fieldset>',this.validateMore=function(){var a=this.getSettings(),b=this.getForm().find(".hz-toFld").val();if(!UIHelper.validateEmail(b,!0))return this.showError(HZ.sendEmail.texts.ERROR_INVALID_TO_EMAIL_ADDRESSES),!1;var c=this.getForm().find(".hz-emailFld").val();return!(a.signupOnSend&&!UIHelper.validateEmail(c,!1))||(this.showError(HZ.sendEmail.texts.ERROR_INVALID_FROM_EMAIL_ADDRESS),!1)},this.prepare=function(a){HZ.email.EmailDialog.superclass.prepare.call(this,a);var b=$.extend(!0,{},this.DEFAULT_OPTIONS,a);b.sourceLink=HZ.utils.Config.emailPhotoAutoRegisterSourceLink,b.useAddressBook=b.useAddressBook&&HZ.utils.Config.emailShareAbImportEnabled,this.applySettings(b)},onRecaptchaLoadCallback=function(){var a="shareRecaptchaDiv";if("undefined"!=typeof grecaptcha){try{"undefined"!=typeof recaptchaWidgetId&&grecaptcha.reset(recaptchaWidgetId)}catch(a){}$("#"+a).is(":empty")&&(recaptchaWidgetId=grecaptcha.render(a,{sitekey:HZ.utils.Config.recaptchaPublicKey}))}},this.onViewUnloaded=function(){"undefined"!=typeof grecaptcha&&grecaptcha.reset(recaptchaWidgetId),this.getSettings().useAddressBook&&j&&m&&$("#emailDialogAddressBook").clearAddressBookInput(),$("#emailDialogEmailInput").val("")},this.onViewLoaded=function(){var a=this.getSettings(),c=$("#emailDialogEmailInput"),e=$("#emailDialogEmailFromInput"),f=$("#emailDialogEmailFromName");a.signupOnSend||HZ.data.CurrentSessionUser||("undefined"==typeof grecaptcha?$.getScript("https://www.google.com/recaptcha/api.js?onload=onRecaptchaLoadCallback&render=explicit&hl="+HZ.utils.Config.language):onRecaptchaLoadCallback());if(a.useAddressBook&&!j)return void b(!1);if(g(this.getForm(),a),HZ.email.EmailDialog.superclass.onViewLoaded.call(this),a.useAddressBook){var h=HZ.addressBook.Contacts.getContacts();l=h&&h.length>0,this.getSubjectFld().val(a.subject),this.getMessageFld().val(a.message),!m&&l?(c.height("64px"),$("#emailDialogAddressBook").addressBook({input:c,showAddressBook:!1}),m=!0,$("#emailDialogEmailInput_tag").focus()):this.getToFld().focus(),$("#upsellLine a:first").text(d())}else this.getToFld().focus();c.on("blur",function(){HZ.utils.Logger.sendEventLogLightweight(HZ.utils.Config.eventToAddressEntered,{to:!!c.val()})}),e.on("blur",function(){HZ.utils.Logger.sendEventLogLightweight(HZ.utils.Config.eventFromAddressEntered,{from:!!e.val()})}),f.on("blur",function(){HZ.utils.Logger.sendEventLogLightweight(HZ.utils.Config.eventFromNameEntered,{name:!!f.val()})})},function(){HZ.email.EmailDialog.superclass.constructor.call(this)}.call(this)},HZ.extend(HZ.email.EmailDialog,HZ.email.ContactDialog),HZ.ns("HZ.dialogs"),HZ.dialogs.EmailDialog=new HZ.email.EmailDialog,HZ.email.ShareColorPaletteDialog=function(){this.DEFAULT_OPTIONS={type:null,referenceId:null,subject:"",message:"",event:HZ.sendEmail.events.SHARECP,scopeId:"",allowShare:!0,mft:"",colorPaletteShareLink:"",generateColorPaletteImageLink:""},this.DIALOG_CLASSNAME="shareColorPaletteDialog",this.DIALOG_TITLE=_hgt("Share color palette"),this.FORM_TEMPLATE="<div id='shareColorPaletteDialog' class='trackMe'><div class='mftDisclaimer'><i>"+_hgt("The colors displayed on-screen may not match %brandName% color standards")+"</i></div><div class='socialShareBtnsContainer'><a href='javascript:;' compid='fbShare' class='fb-share' onclick='HZ.dialogs.ShareColorPaletteDialog.generateFbShareEvent();'><div class='socialShareBtn facebook'></div></a><a href='javascript:;' compid='twShare' class='tw-share' onclick='HZ.dialogs.ShareColorPaletteDialog.generateTwShareEvent();'><div class='socialShareBtn twitter'></div></a><a href='javascript:;' compid='gShare' class='g-share' onclick='HZ.dialogs.ShareColorPaletteDialog.generateGShareEvent();'><div class='socialShareBtn plusone'></div></a></div><div class='sectionDivider text-bold'><span><i>"+_hgt("or email this to a friend")+"</i></span></div><form id='emailColorPaletteForm' name='emailColorPaletteForm' action='javascript:;'><textarea type='text' rows='1' class='form-control hz-toFld' id='emailDialogEmailInput' placeholder='"+_hgt("To (enter recipient emails, separated by commas)")+"'></textarea><label>"+_hgt("Subject")+"</label><input type='text' class='hz-subjectFld' id='emailDialogSubjectInput'><label>"+_hgt("Message")+"</label><textarea class='form-control hz-messageFld' id='emailDialogMessageInput' rows='5'></textarea></form></div>",this.validateMore=function(){var a=this.getForm().find("#emailDialogEmailInput").val();return!!UIHelper.validateEmail(a,!0)||(this.showError(HZ.sendEmail.texts.ERROR_INVALID_TO_EMAIL_ADDRESSES),!1)},this.prepare=function(a){HZ.email.ShareColorPaletteDialog.superclass.prepare.call(this,a);var b=this.getSettings();this.applySettings(b)},this.onViewUnloaded=function(){this.getSettings()},this.onViewLoaded=function(){var a=this.getSettings();$("#shareColorPaletteDialog").attr("objid",a.referenceId).attr("scopeid",a.scopeId);var b=$(".mftDisclaimer i").html().replace("%brandName%",this.getPaletteManufacturer());$(".mftDisclaimer i").html(b),HZ.email.ShareColorPaletteDialog.superclass.onViewLoaded.call(this),this.getToFld().focus()},this.getPaletteManufacturer=function(){var a=this.getSettings(),b=HZ.utils.ColorPicker.getPaintManufacturerDisplayName(a.mft);if(HZ.lb.Utils){var c=HZ.lb.Utils.ColorPicker.getColorPickerAd(a.referenceId),d=HZ.lb.Utils.ColorPicker.getConfig(c);d&&d.hasOwnProperty("advDisplayName")&&(b=d.advDisplayName)}return b},this.generateFbShareEvent=function(){var a=this.getSettings(),b=encodeURIComponent(a.colorPaletteShareLink),c="https://www.facebook.com/sharer/sharer.php?u="+b,d=HZ.ui.Utils.getCenteredPopupPosition(611,368);window.open(c,"fbwindow","width=611, height=368, left="+d.left+", top="+d.top+", toolbar=0, location=0, menubar=0, scrollbars=0")},this.generateTwShareEvent=function(){var a=this.getSettings(),b=_hgt("I love this @{mft} Paint color palette! Create your own @Houzz",{mft:this.getPaletteManufacturer()}),c=encodeURIComponent(b),d=encodeURIComponent(a.colorPaletteShareLink),e="https://twitter.com/share?url="+d+"&text="+c,f=HZ.ui.Utils.getCenteredPopupPosition(550,380);window.open(e,"fbwindow","width=550, height=380, left="+f.left+", top="+f.top+", toolbar=0, location=0, menubar=0, scrollbars=0")},this.generateGShareEvent=function(){var a=this.getSettings(),b=encodeURIComponent(a.colorPaletteShareLink),c="https://plus.google.com/share?url="+b,d=HZ.ui.Utils.getCenteredPopupPosition(600,600);window.open(c,"fbwindow","width=600, height=600, left="+d.left+", top="+d.top+", toolbar=0, location=0, menubar=0, scrollbars=1, resizeable=1")},function(){HZ.email.ShareColorPaletteDialog.superclass.constructor.call(this)}.call(this)},HZ.extend(HZ.email.ShareColorPaletteDialog,HZ.email.ContactDialog),HZ.ns("HZ.dialogs"),HZ.dialogs.ShareColorPaletteDialog=new HZ.email.ShareColorPaletteDialog;

window.hzmr.push("contactDialog:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End contactDialog.js  **************/
/************* Start marketplaceListingUtils.js for locale it-IT **************/
try {HZ.ns("HZ.utils.Marketplace"),HZ.utils.Marketplace.ListingUtils={PROMOTION_MODULE_DISCOUNT_THRESHOLD:.03,getSpaceVendorListing:function(a,b){var c=null;if(a){var d=a.id;if(b){var e=HZ.data.SpaceListingIds.get(d);e&&-1!==e.indexOf(b)&&(c=HZ.data.ListingsInfo.get(b))}else c=HZ.utils.Marketplace.getPreferredVendorListing(d)}return c},getSpacePreferredVendorListing:function(a){var b=null;return a&&(b=HZ.utils.Marketplace.getPreferredVendorListing(a.id)),b},isBuyableAndAvailable:function(a){return a&&a.buyable&&a.avail},isDiscountThresholdMet:function(a,b){var c=!1;return a<b&&(c=b-b*this.PROMOTION_MODULE_DISCOUNT_THRESHOLD>a),c},isTile:function(a){return a&&a.sbb}};

window.hzmr.push("marketplaceListingUtils:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End marketplaceListingUtils.js  **************/
/************* Start extracting text for productRenderer.js for locale it-IT **************/
(function(){var _hzxt={"Sale:":"Offerta:","Regular Price:":"Prezzo regolamentare:","List Price:":"Prezzo di listino:"};for(var a in _hzxt){window._hzlang[a]=_hzxt[a];}})();
/*************  End extracting text for productRenderer.js  **************/
/************* Start productRenderer.js for locale it-IT **************/
try {HZ.ns("HZ.modules"),HZ.modules.ProductRenderer=new function(){this.renderTradePriceBadge=function(a){return'<span class="text-xs text-bold trade-badge">'+a+"</span>"},this.renderProductBadge=function(a,b){var c=null,d=a&&a.hasOwnProperty("ifcc")&&a.ifcc.length,e=a&&a.hasOwnProperty("itx")&&!0===a.itx,f=a&&a.hasOwnProperty("tradeExclusiveBadge")?a.tradeExclusiveBadge:null,g=b&&b.hasOwnProperty("bstslr")&&!0===b.bstslr,h=b&&b.hasOwnProperty("excl")&&!0===b.excl;if(d){var i=a.ifcc.toUpperCase();c=HZ.modules.ProductBadge.renderFromCountryBadge(i,a.ifc)}else e?c=HZ.modules.ProductBadge.renderTradeExclusiveBadge(f):b&&(g?c=HZ.modules.ProductBadge.renderBestSellerBadge():h&&(c=HZ.modules.ProductBadge.renderExclusiveBadge()));return c},this.renderSavings=function(a){var b=a&&a.hasOwnProperty("itp")&&!0===a.itp,c=b?a.tas?a.tas:"":a&&a.pasf?a.pasf:"";return HZ.utils.Html.template('<div class="col-xs-12"><span class="text-primary">%savings%</span></div>',{savings:c})}};

window.hzmr.push("productRenderer:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End productRenderer.js  **************/
/************* Start extracting text for productPriceRenderer.js for locale it-IT **************/
(function(){var _hzxt={"Regular Price:":"Prezzo regolamentare:","List Price:":"Prezzo di listino:"};for(var a in _hzxt){window._hzlang[a]=_hzxt[a];}})();
/*************  End extracting text for productPriceRenderer.js  **************/
/************* Start productPriceRenderer.js for locale it-IT **************/
try {HZ.ns("HZ.modules"),HZ.modules.ProductPriceRenderer=new function(){var a=null,b=null,c=null,d=null,e=null;this.init=function(a){a&&(b=a.hasOwnProperty("isPhone")?!0===a.isPhone:HZ.utils.Config.isResponsive,c=a.hasOwnProperty("isDesktop")?!0===a.isDesktop:!HZ.utils.Config.isResponsive,a.hasOwnProperty("spaceId")&&(d=a.spaceId),a.hasOwnProperty("vendorListingId")&&(e=a.vendorListingId))},this.setMountNode=function(b){a=b},this.updateView=function(b,c){var d=HZ.data.Spaces.get(b),e=HZ.utils.Marketplace.ListingUtils.getSpaceVendorListing(d,c);d&&e&&a&&a.empty().append(this.renderProductPriceHtml(d,e))},this.addTooltips=function(a,b){var c=$(".hzi-Info2"),d="";a?d=_hgt('"MSRP" is the manufacturer\'s suggested retail price provided to Houzz by the vendor or seller. \t\t\t\tThe "MSRP" may not be the prevailing market price or regular retail price.'):"houzz"===b?d=_hgt("This product was listed on Houzz at this price within the last 90 days."):"competitor"===b&&(d=_hgt("We found this product on another retailer's site at this price within the last 90 days.")),c.length&&c.click(function(){var a=$("#was-price-tooltip");if(a.length&&"none"!==a.css("display")){var b=a.find(".close");b.length>0&&b[0].click()}else{$(this).outerWidth();$(this).tipBubble({content:d,point:"north right",id:"was-price-tooltip",width:240,offsetX:6,offsetY:8,borderColor:"white",showCloseBtn:!0,position:"absolute",fadeDuration:0,bubblePadding:"10px 15px",attachTo:"#lbRoot"})}})},this.renderProductPriceHtml=function(a,c,d){var e="",f=HZ.utils.Marketplace.ListingUtils.getSpacePreferredVendorListing(a);if(c&&(f=c),f){if(f.hasOwnProperty("itp")&&!0===f.itp){var g=f.hasOwnProperty("tradeBadge")?f.tradeBadge:null;e=HZ.utils.Html.template(b?'<div class="col-xs-12"><div class="row"><div class="col-xs-12 mtm mbl"><span class="pull-left mrs">%priceBadge%</span>%finalPriceHtml%</div>%comparePriceHtml%</div></div>':'<div class="col-xs-12"><div class="pull-left mbxl">%priceBadge%<div class="mtm">%finalPriceHtml%</div></div>%comparePriceHtml%</div>',{priceBadge:HZ.modules.ProductRenderer.renderTradePriceBadge(g),finalPriceHtml:this.renderProductFinalPriceHtml(a,f),comparePriceHtml:this.renderProductTradeComparePriceHtml(a,f,d)})}else{var h=HZ.lb.Config.priceRedesign,i="price_with_now"===h,j=!1;d&&(j=f.bpt),e=HZ.utils.Html.template('<div class="col-xs-12">%finalPriceHtml%%comparePriceHtml%</div>',{finalPriceHtml:this.renderProductFinalPriceHtml(a,f,i),comparePriceHtml:this.renderProductComparePriceHtml(a,f,d,j)})}}return e},this.renderProductFinalPriceHtml=function(a,b,c){if(b&&b.p){var d=HZ.utils.Html.template('<span class="header-1 no-margin" itemprop="price" content="$%finalPrice%"><span itemprop="priceCurrency" content="%currencyCode%"></span>%finalPriceString%</span>',{finalPrice:b.pn,finalPriceString:this.renderProductFinalPriceString(a,b),currencyCode:b.crncode});return c&&""!==this.renderProductComparePriceString(a,b)?HZ.utils.Html.template('<span class="header-1 no-margin">%nowText%: %priceTemplate%</span>',{nowText:_hgt("Now"),priceTemplate:d}):d}},this.renderProductComparePriceHtml=function(a,b,c,d){return this.renderComparePriceHtml(this.renderProductComparePriceString(a,b),"text-m",c,!1,d)},this.renderProductTradeComparePriceHtml=function(a,c,d){var e="",f=HZ.utils.Marketplace.ListingUtils.getSpacePreferredVendorListing(a);if(c&&(f=c),f){var g=!0;!1===f.pmd&&(g=!1);var h=HZ.utils.Marketplace.ListingUtils.isTile(f);if(g){var i=f.msrp,j=parseFloat(f.rpn),k=f.pn,l=h?f.sbbPMsrpStr:f.msrpstr,m=this.renderComparePriceHtml(this.renderProductComparePriceString(a,f),d?"":"text-l text-gray-lighter"),n=d?_hgt("MSRP:")+"%msrpPriceHtml%":_hgt("List Price:")+"%msrpPriceHtml%",o=d?this.getTooltipHtml():"",p=h?f.sbbPTradeMarkup:f.tm,q=_hgt("Potential markup: <t1>{tradeMarkup}</t1>",{tradeMarkup:p,t1:{tag:"span",attr:{class:"text-bold"}}}),r=j>k,s=i>j,t='<div class="%className%">'+(r?"<p>"+_hgt("Regular Price:")+"%comparePriceHtml%</p>":"")+(s?'<p class="%compareClassName%">%msrpComparePriceHtml%%tooltipHtml%</p><p class="product-price__trade-markup mb0">%tradeMarkupHtml%</p>':r?'<p class="%compareClassName%">&nbsp;</p><p class="product-price__trade-markup mb0">&nbsp;</p>':"")+"</div>";e=HZ.utils.Html.template(t,{className:b?"col-xs-12":"pull-left mlm plm v-line-l",comparePriceHtml:m,msrpComparePriceHtml:HZ.utils.Html.template(n,{msrpPriceHtml:this.renderComparePriceHtml(l,d?"":"text-l text-gray-lighter",!1,d)}),tradeMarkupHtml:q,tooltipHtml:o,compareClassName:d?"product-price__msrp-price":""})}}return e},this.renderProductFinalPriceString=function(a,b){var c="",d=HZ.utils.Marketplace.ListingUtils.getSpacePreferredVendorListing(a);if(b&&(d=b),d){c=HZ.utils.Marketplace.ListingUtils.isTile(d)?d.sbbPFinalStr:d.p}return c},this.renderProductComparePriceString=function(a,b){var c="",d=HZ.utils.Marketplace.ListingUtils.getSpacePreferredVendorListing(a);if(b&&(d=b),d){var e=!0===d.itp,f=HZ.utils.Marketplace.ListingUtils.isTile(d),g=!0,h=d.pn,i=d.rpn,j=d.bpn,k=e?i:j;!1===d.pmd&&(g=!1),g&&(e||HZ.utils.Marketplace.ListingUtils.isDiscountThresholdMet(h,k))&&(c=f?e?d.sbbPFinalNonTradeStr:d.sbbPBaseStr:e?d.rp:d.bp)}return c},this.renderComparePriceHtml=function(a,b,c,d,e){var f="",g="",h="";return c=c||!1,d=d||!1,e=e||!1,a&&(c?("houzz"===e?g=_hgt("Was: <del>{price}</del>",{price:a}):"competitor"===e&&(g=_hgt("At other retailer: <del>{price}</del>",{price:a})),h=this.getTooltipHtml(),f=HZ.utils.Html.template('<div class="product-price__was-price">%WAS_STRING%%TOOLTIP%</div>',{WAS_STRING:g,TOOLTIP:h})):f=d?HZ.utils.Html.template("&nbsp;<span%classAttr%>%comparePriceString%</span>",{comparePriceString:a,classAttr:b?HZ.utils.Html.template(' class="%className%"',{className:b}):""}):HZ.utils.Html.template("&nbsp;<del%classAttr%>%comparePriceString%</del>",{comparePriceString:a,classAttr:b?HZ.utils.Html.template(' class="%className%"',{className:b}):""})),f},this.getTooltipHtml=function(){return'<span class="hzi-font hzi-Info2" aria-hidden="true"></span>'}};

window.hzmr.push("productPriceRenderer:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End productPriceRenderer.js  **************/
/************* Start productDocumentRenderer.js for locale it-IT **************/
try {HZ.ns("HZ.modules"),HZ.modules.ProductDocumentRenderer=new function(){var a=null;this.setMountNode=function(b){a=b},this.updateView=function(b){b&&a&&a.empty().append(this.renderProductDocumentHtml(b))},this.renderProductDocumentHtml=function(a){var b=$('<ul class="list-unstyled  product-doc-list"></ul>');if(a&&a.productDocuments){var c=JSON.parse(a.productDocuments);for(var d in c){var e=c[d],f=$(HZ.utils.Html.template('<li><a class="text-primary product-document-link" href="%LINK%" target="_blank"><i class="product-document-icon hzi-font hzi-Document text-s"></i>&nbsp;%NAME%</a></li>',{NAME:d,LINK:e}));b.append(f)}}if(b.children().length){var g=$('<div class="productDocument"><header class="section-header"><h2 class="sectionTitle text-m text-bold">Product Documentation</h2></header></div>');g.append(b)}return g}};

window.hzmr.push("productDocumentRenderer:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End productDocumentRenderer.js  **************/
/************* Start extracting text for lightbox2.2AdPlugins.js for locale it-IT **************/
(function(){var _hzxt={"Project Location: {zipCode}":"Localit\u00e0 del progetto: {zipCode}","Ready to start your project?":"Contatta un professionista","Contact a Professional":"Contatta un professionista","Tell us about your project":"Raccontaci del tuo progetto","Select Professionals":"Seleziona professionisti","In this photo":"In questa foto","Your Phone Number":"Il tuo numero di telefono","Your Zip Code":"Il tuo CAP","Brief description of your project":"Descrivi brevemente il tuo progetto","Please select the professionals you wish to contact.":"Seleziona i professionisti che desideri contattare.","Send Message":"Invia messaggio","Featured Local Pros":"Professionisti locali in primo piano","Contact Name: {name}":"Nome di contatto: {name}","Phone Number: {phoneNumber}":"Numero di telefono: {phoneNumber}","Sender zip code: {zipCode}":"CAP del mittente: {zipCode}","Please enter your name":"Inserisci il tuo nome","Near {location}":"Vicino a {location}","{reviewsCount} Reviews":"{reviewsCount} Recensioni","Have a Project in Mind?":"Hai in mente un progetto?","Contact Professional":"Contatti","Tell us a little about your project":"Descrivi in poche parole il tuo progetto","Thanks for Submitting":"Grazie per l'invio del messaggio","Contact {proName}":"Contatta {proName}","Sender email: {emailAddress}":"Indirizzo e-mail del mittente: {emailAddress}","Please enter your email address":"Inserisci il tuo indirizzo e-mail","Please enter your phone number":"Inserisci il tuo numero di telefono","Please enter your zip code":"Inserisci il tuo codice postale","Please add a short description of your project":"Aggiungi una breve descrizione del tuo progetto","View My Portfolio":"Guarda il mio portfolio","SEE MY PROJECTS":"I MIEI PROGETTI","Send message error!":"Errore nell'invio del messaggio","Zip Code":"CAP","Enter your zip code":"Inserisci il tuo CAP","Sold Out":"Esauriti","Related products in this Photo":"Prodotti correlati in questa foto","Products in this photo:":"Prodotti in questa foto:","Learn More":"Per saperne di pi\u00f9","Save to ideabook":"Salva nell'Ideabook","Houzz project inquiry":"Richiesta su un progetto Houzz","See My Projects":"I miei progetti","Visit Store":"Sito del produttore","1 Review":"1 recensione","Contact Phone Number: {phoneNumber}":"Numero di telefono di contatto: {phoneNumber}","I confirm this is a personal project inquiry and not a promotional message or solicitation.":"Confermo che questa \u00e8 una richiesta inerente un progetto personale e non un messaggio o una sollecitazione a scopo promozionale.","Enter your contact phone number":"Inserisci il tuo numero di telefono","Cancel":"Annulla","":"","Sponsored":"Sponsorizzato","Products in this Photo:":"Prodotti in questa foto:","Email Us":"Inviaci un'e-mail","Related Products":"Prodotti correlati","Buy":"Compra","Products in this Photo":"Prodotti in questa foto","Message":"Messaggio","Your Name":"Il tuo nome","From":"Da","Phone Number":"Numero di telefono","Your Email":"La tua e-mail"};for(var a in _hzxt){window._hzlang[a]=_hzxt[a];}})();
/*************  End extracting text for lightbox2.2AdPlugins.js  **************/
/************* Start lightbox2.2AdPlugins.js for locale it-IT **************/
try {HZ.lb.plugins.ProductPPCAdInfo=function(){var a,b,c=HZ.lb.Config.contentGroupIds.INFO;this.setOwner=function(d){a=d,b=$('<section id="lbPPCAds" class="lbInfoBox ppc-ad separator"></section>')[0],a.addInfoBoxToContentGroup(b,"ppc-ad",c)},this.imageDataUpdated=function(){this.imageChanged()},this.imageChanged=function(){var c=a.getCurrentSpace();$(b).empty(),a.isProduct()&&HZ.lb.plugins.PPCAdInfoRenderer.writeContent(c,b,4,8)}},HZ.lb.plugins.SpacePPCAdInfo=function(){var a,b,c=HZ.lb.Config.contentGroupIds.PRODUCTS;this.setOwner=function(d){a=d,b=$('<section id="lbPPCAds" class="lbInfoBox ppc-ad separator"></section>')[0],a.addInfoBoxToContentGroup(b,"ppc-ad",c)},this.imageDataUpdated=function(){this.imageChanged()},this.imageChanged=function(){var c=a.getCurrentSpace();$(b).empty(),a.isProduct()||HZ.lb.plugins.PPCAdInfoRenderer.writeContent(c,b,4,8)}},HZ.lb.plugins.Gtm=new function(){function a(){var a=!1,d=[],e=c&&c.brlnk?c.brlnk:null;if(e){var f=e.crumbs;if(f&&f.forEach(function(a){d.push(a.label)}),b.isProduct()){if(HZ.data.ProductsInfo.get(c.id)){var g={hasaccount:HZ.data.CurrentSessionUser?"y":"n",ecomm_prodid:"HZ_"+c.id,ecomm_category:d,ecomm_style:HZ.utils.Styles.getStyleName(c.s),hashed_user:HZ.lb.Config.gtmIdHash.hashed_user,hashed_visitor:HZ.lb.Config.gtmIdHash.hashed_visitor,test_bucket:HZ.lb.Config.gtmTestBucket};c.amtRaw&&c.cuid&&(g.ecomm_pvalue=Math.round(100*c.amtRaw)/100,g.ecomm_currency=HZ.data.Currencies.get(c.cuid)),HZ.utils.Gtm.pushData("houzz_pageview","lightbox_view_product",g),a=!0}}else if(!b.isProduct()){var g={hasaccount:HZ.data.CurrentSessionUser?"y":"n",ecomm_prodid:"HZ_"+c.id,ecomm_category:d,ecomm_style:HZ.utils.Styles.getStyleName(c.s),hashed_user:HZ.lb.Config.gtmIdHash.hashed_user,hashed_visitor:HZ.lb.Config.gtmIdHash.hashed_visitor,test_bucket:HZ.lb.Config.gtmTestBucket};HZ.utils.Gtm.pushData("houzz_pageview","lightbox_view_photo",g),a=!0}}return a}var b,c,d;this.setOwner=function(a){b=a},this.imageDataUpdated=function(){c=b.getCurrentSpace(),c.id==d&&this.imageChanged()},this.imageChanged=function(){c=b.getCurrentSpace(),d=c.id,a()&&(d=null)}},HZ.lb.plugins.PaidProInfo=function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n=HZ.lb.Config.contentGroupIds.OVERVIEW,o=_hgt("Sponsored"),p=_hgt("View My Portfolio"),q=_hgt("See My Projects"),r=_hgt("Email Us"),s=_hgt("Contact Professional"),t=_hgt("Your Email"),u=_hgt("Enter your contact phone number"),v=_hgt("Enter your zip code"),w=_hgt("Message"),x=_hgt("Tell us a little about your project"),y=_hgt("I confirm this is a personal project inquiry and not a promotional message or solicitation."),z=_hgt("Thanks for Submitting");this.setOwner=function(e){switch(a=e,b=$("<div></div>"),c=b.get(0),a.addInfoBoxToContentGroup(c,"sponsoredSpaceDescriptionInfo",n),b.on("click",".pro-contact-cta",this.handleContactProClicked.bind(this)),m='<section class="lbInfoBox sponsoredSpaceDescription">%HEADER%<div class="row"><p class="col-xs-12 pro-long-desc">%PRO_LONG_DESC%</p>%OFFER%%PRO_CONTACT%<span class="col-xs-12 mbl"><a href="%PRO_PORTFOLIO_URL%" target="_blank" class="btn btn-primary med btn-block"><i class="hzi-font hzi-Ideas-Fill icon"></i> %PROJECTS_CTA%</a></span></div>%THUMB_GRID%</section>',j=!0,k=!1,l=!1,HZ.lb.Config.proContactForm){case"dialog":j=!1,k=!0,m='<section class="lbInfoBox sponsoredSpaceDescription">%HEADER%<div class="row"><p class="col-xs-12 pro-long-desc">%PRO_LONG_DESC%</p>%OFFER%<span class="col-xs-12 mbl"><button class="btn btn-primary med btn-block pro-contact-cta"><i class="hzi-font hzi-Pro-Fill icon"></i> %CONTACT_CTA%</button></span></div></section>';break;case"inline":j=!1,l=!0,m='<section class="lbInfoBox sponsoredSpaceDescription">%HEADER%%OFFER%<div class="inline-form-placeholder"></div></section>'}j&&(d=$(HZ.utils.Html.template(HZ.lb.Templates.IMAGE_OVERLAY_TEMPLATE,{CTA:_hgt("SEE MY PROJECTS"),COMP_ID:"paid_pro_overlay",CSS_CLASS:"hidden"})).disableSelection(),d.on("click",this.handleVisitProfileClicked.bind(this)),a.addLbImageLayer(d))},this.lightboxLoaded=function(){HZ.data.CurrentSessionUser?(HZ.dialogs.ContactProDialog||(HZ.dialogs.ContactProDialog=new HZ.email.ContactProDialog),f=HZ.dialogs.ContactProDialog,HZ.ajaz.Services.User.getCurrentSessionUserExtraData().then(this.handleGetUserExtraDataResponse.bind(this))):(HZ.dialogs.GuestContactProDialog||(HZ.dialogs.GuestContactProDialog=new HZ.email.GuestContactProDialog),f=HZ.dialogs.GuestContactProDialog)},this.handleGetUserExtraDataResponse=function(a){a&&"true"===a.success&&HZ.data.CurrentSessionUser.setExtra(a.userEmail,a.phoneNumber,a.zipCode)},this.imageDataUpdated=function(){this.imageChanged()},this.imageChanged=function(){b.empty(),g=a.getCurrentSpace(),h=g.id,i=HZ.data.PaidProAds.get(h);var c,e=g.ow,f=i;if(f&&f.proName&&f.proShortDesc&&f.proLongDesc){var n=f.proProfileLink,t=f.rating,u=f.numReviews,v=f.proShortDesc,w=f.proLongDesc,x=f.proCoverPhotos,y=f.proOffers,z=f.proOffersDisc,A=f.proPhone,B=f.showProEmail,C=f.coopInformation;f.proUserId&&(e=f.proUserId);var D=HZ.ui.render.User.getUserImageHtml(e,!0,n,1),E=HZ.ui.render.User.getUserHtml(e,!0,n),F=_hgtp("","1 Review","{reviewsCount} Reviews",u,{reviewsCount:u}),G="",H="";t>0&&(H=HZ.ui.render.Rate.getRateStars(t)),void 0!==C&&(G=this.renderCoopInfo());var I=[];if(x&&x.length)for(var J=HZ.lb.Utils.calculateThumbWidth(a.getContentBox().w-32,4,8),K=J,L=J,M=Math.min(x.length,4),N=0;N<M;N++){var O=x[N],P=HZ.utils.Links.getSpaceImageUrl(O,K,L),Q=HZ.utils.Html.template('<li><a target="_blank" href="%PRO_PORTFOLIO_URL%"><img src="%IMAGE_URL%" width="%WIDTH%" height="%HEIGHT%"></a></li>',{PRO_PORTFOLIO_URL:n,IMAGE_URL:P,WIDTH:K,HEIGHT:L});I.push(Q)}var R=HZ.utils.Html.template('<ul class="thumb-grid grid-4">%THUMBS%</ul>',{THUMBS:I.join("")});c={SPONSORED:o,PRO_AVATAR:D,PRO_NAME:E,AVATAR_CLASS:"author-avatar",NAME_CLASS:"author-details",REVIEW_RATING:H,NUM_OF_REVIEWS:F,COOP_INFO:G,PRO_SHORT_DESC:v,PRO_PORTFOLIO_URL:n,PORTFOLIO_CTA:p};var S=HZ.utils.Html.template('<header class="sectionHeader row"><p class="sponsored col-xs-12">%SPONSORED%</p><div class="col-xs-12"><div class="%AVATAR_CLASS%">%PRO_AVATAR%</div><div class="%NAME_CLASS%">%PRO_NAME% <div class="pro-rating"><div class="review-rate">%REVIEW_RATING% <span class="review-count" itemprop="ratingCount">%NUM_OF_REVIEWS%</span></div></div></div></div></header><div class="row mbm"><h2 class="header-6 sectionTitle col-xs-12">%PRO_SHORT_DESC%</h2>%COOP_INFO%<a href="%PRO_PORTFOLIO_URL%" target="_blank" class="text-primary col-xs-12">%PORTFOLIO_CTA%<span class="more-icon"></span></a></div>',c);if(y){var T;c={PHONE_CLASS:j&&A?"col-xs-6":"hidden",EMAIL_CLASS:j&&B?A?"col-xs-6":"col-xs-12":"hidden",PRO_PHONE:A||"",PRO_EMAIL_CTA:r},T=$("<div>"+HZ.utils.Html.template('<div class="col-xs-12"><div class="contact text-l text-bold row"><div class="phone-contact %PHONE_CLASS%"><span class="hzi-font hzi-Phone icon"></span>%PRO_PHONE%</div><div class="email-contact %EMAIL_CLASS%"><a href="javascript:;" class="pro-contact-cta"><span class="hzi-font hzi-Email-Small icon"></span>%PRO_EMAIL_CTA%</a></div></div></div>',c)+"</div>").html(),c={OFFER_DESC:y,OFFER_DISCLAIMER:z};var U=HZ.utils.Html.template('<div class="row pro-offer pro-offer-pro-plus"><h2 class="header-5 text-bold col-xs-12 mlm">%OFFER_DESC% <span class="disclaimer text-nowrap">%OFFER_DISCLAIMER%</span></h2></div>',c)}c={HEADER:S,PRO_LONG_DESC:w,OFFER:U,PRO_CONTACT:T,PRO_PORTFOLIO_URL:n,PROJECTS_CTA:q,THUMB_GRID:R},k?c={HEADER:S,PRO_LONG_DESC:w,OFFER:U,CONTACT_CTA:s}:l&&(c={HEADER:S,OFFER:U}),b.append(HZ.utils.Html.template(m,c)),l&&b.find(".inline-form-placeholder").replaceWith(this.prepareInlineContactForm()),HZ.lb.Utils.registerTrackingUrl(f.impTrkLink,g.id),j&&d.removeClass("hidden").find(".cta").attr("objid",e)}else j&&d.addClass("hidden")},this.renderCoopInfo=function(){var a=i.proProfileLink,b=i.coopInformation,c=$("<div>");return c.append(HZ.utils.Html.template('<div class="col-xs-12 mbl"><div class="row pro-coop"><div class="col-xs-2"><a href="%PRO_PORTFOLIO_URL%" target="_blank"><img src="%EMPTY_GIF%" style="background-image: url(%COOP_IMG_SRC%);" width="55" height="55" class="pro-coop-logo" objid="%COOP_BRAND_USER_ID%"></a></div><div class="col-xs-10"><p class="text-gray-light text-s pro-coop-rel"><a href="%PRO_PORTFOLIO_URL%" target="_blank">%COOP_LABEL%</a></p></div></div></div>',{EMPTY_GIF:HZ.utils.Config.emptyGifData,PRO_PORTFOLIO_URL:a,COOP_IMG_SRC:b.logoFileUrl,COOP_BRAND_USER_ID:b.coopBrandUserId,COOP_LABEL:b.coopText})),c.html()},this.prepareInlineContactForm=function(){var a,b=i,c=_hgt("Contact {proName}",{proName:b.proName}),d=HZ.data.CurrentSessionUser.getEmailAddress()||"",e={FORM_TITLE:c,EMAIL_FIELD_ID:"contactProEmail"+h,EMAIL_PLACEHOLDER:t,EMAIL_VALUE:d,PHONE_FIELD_ID:"contactProPhone"+h,PHONE_PLACEHOLDER:u,ZIP_FIELD_ID:"contactProZip"+h,ZIP_PLACEHOLDER:v,MESSAGE_FIELD_ID:"contactProMessage"+h,MESSAGE_LABEL:w,MESSAGE_PLACEHOLDER:x,CHECKBOX_LABEL:y,BUTTON_LABEL:s,DONE_MESSAGE:z};return a=$(HZ.utils.Html.template('<div class="row pro-contact-form"><h2 class="header-6 text-unbold col-xs-12">%FORM_TITLE%</h2> <form action="javascript:;" class="col-xs-12" scopeid="lb_contact_pro_inline" novalidate><fieldset class="row"><div class="form-group col-xs-12"><input type="email" name="email" class="form-control" id="%EMAIL_FIELD_ID%" placeholder="%EMAIL_PLACEHOLDER%" value="%EMAIL_VALUE%" required></div><div class="form-group col-xs-6"><input type="tel" name="phone" class="form-control" id="%PHONE_FIELD_ID%" placeholder="%PHONE_PLACEHOLDER%" required></div><div class="form-group col-xs-6"><input type="text" name="zip" class="form-control" id="%ZIP_FIELD_ID%" placeholder="%ZIP_PLACEHOLDER%" required></div><div class="form-group col-xs-12"><label class="control-label" for="%MESSAGE_FIELD_ID%">%MESSAGE_LABEL%</label><textarea rows="3" name="message" class="form-control" id="%MESSAGE_FIELD_ID%" placeholder="%MESSAGE_PLACEHOLDER%" required></textarea></div><div class="checkbox col-xs-12"><label><input name="disclaimer" type="checkbox" value="" required>%CHECKBOX_LABEL%</label> </div><div class="col-xs-12"><button type="submit" name="submit" compid="lb_contact_pro_inline_submit" class="btn med btn-block btn-primary trackMe"><i class="hzi-font hzi-Pro-Fill icon"></i> %BUTTON_LABEL%</button></div></fieldset></form></div><div class="row done-message"><div class="text-bold text-center col-xs-12"><i class="icon hzi-font hzi-Vote-Circle"></i> %DONE_MESSAGE%</div></div>',e)),a.off("submit change keydown focus blur").on("submit",this.onContactFormSubmit.bind(this)).on("change keydown","input, textarea",this.onContactFormChange.bind(this)).on("focus","input, textarea, button",this.onContactFormFocus.bind(this)).on("blur","input, textarea",this.onContactFormBlur.bind(this)),a},this.onContactFormChange=function(a){var b=$(a.delegateTarget);b.find(".form-field-error").remove(),b.find(".form-group").removeClass("has-error")},this.onContactFormFocus=function(b){e.remove(),a.detachKeyboardHandler()},this.onContactFormBlur=function(b){a.attachKeyboardHandler()},this.onContactFormSubmit=function(b){b.preventDefault();var c=$(b.target),d=c.get(0);if(d.checkValidity()){var e=(HZ.data.Users.get(a.getCurrentSpace().ow).id,i),f=e.proUserName,g=_hgt("Houzz project inquiry"),h=HZ.sendEmail.types.PRO,j=$(d.email).val(),k=$(d.phone).val(),l=$(d.zip).val(),m=$(d.message).val(),n=_hgt("Contact Phone Number: {phoneNumber}",{phoneNumber:k})+"\n"+_hgt("Project Location: {zipCode}",{zipCode:l})+"\n\n"+_hgt("Sender email: {emailAddress}",{emailAddress:j})+"\n\n"+m,o={};o[HZ.sendEmail.params.to]=f,o[HZ.sendEmail.params.subject]=g,o[HZ.sendEmail.params.message]=n,o[HZ.sendEmail.params.type]=h,HZ.ajaz.Services.sendEmail(o,!1,this.onContactFormSubmitResponse.bind(this)),c.find("[name=submit]").attr("disabled",!0)}else for(var p,q=["email","phone","zip","message","disclaimer"],r=q.length,s=0;s<r;s++)if(p=c.find("[name="+q[s]+"]"),!p.get(0).checkValidity()){this.handleFieldValidationError(p);break}},this.onContactFormSubmitResponse=function(a){"true"==a.success?(HZ.ui.yamdi.Common.hideAllDialogs(),b.find(".pro-contact-form").addClass("done"),window.ga("send","event","ContactProDialog","contactSuccess")):(HZ.ui.yamdi.Common.hideAllDialogs(),HZ.ui.yamdi.Common.alert(_hgt("Send message error!"),a.errorMessage),b.find(".pro-contact-form button[name=submit]").attr("disabled",!1))},this.handleFieldValidationError=function(a){var b,c=a.get(0).validity;if(c.valueMissing)switch(a.attr("name")){case"email":b=_hgt("Please enter your email address");break;case"phone":b=_hgt("Please enter your phone number");break;case"zip":b=_hgt("Please enter your zip code");break;case"message":b=_hgt("Please add a short description of your project");break;case"disclaimer":b=HZ.sendEmail.texts.ERROR_PRO_CONFIRM_INQUIRY_NOT_AGREE}else c.typeMismatch&&(b=HZ.sendEmail.texts.ERROR_INVALID_FROM_EMAIL_ADDRESS);e=$(HZ.utils.Html.template(HZ.lb.Templates.FORM_FIELD_ERROR_TEMPLATE,{MESSAGE:b})),this.showFieldError(a,e)},this.showFieldError=function(a,b){a.closest(".form-group").addClass("has-error"),a.after(b)},this.handleVisitProfileClicked=function(){var a,b=i;b&&b.proName&&b.proShortDesc&&b.proLongDesc&&(a=b.proProfileLink,window.open(a))},this.handleContactProClicked=function(){var b=i;f.prepare({toUserName:b.proUserName,toUserDisplayName:b.proName,subject:_hgt("Houzz project inquiry"),message:""}),f.getSendBtn().attr("compid","lbContactDlgSend"),a.showDialog(f)}},HZ.lb.plugins.LocalProsContact=function(){var a,b,c,d,e,f,g,h,i,j,k,l=HZ.lb.Config.contentGroupIds.OVERVIEW,m=_hgt("Ready to start your project?"),n=_hgt("Contact a Professional"),o=_hgt("Contact a Professional"),p=_hgt("Tell us about your project"),q=_hgt("Select Professionals"),r=_hgt("In this photo"),s=_hgt("Sponsored"),t=_hgt("Your Name"),u=_hgt("Your Email"),v=_hgt("Your Phone Number"),w=_hgt("Your Zip Code"),x=_hgt("Brief description of your project"),y=_hgt("Please select the professionals you wish to contact."),z=["name","email","phone","zip","message"],A='<span class="text-xs text-gray-lightest pull-right">%PRO_ENTRY_LABEL%</span><div class="checkbox" objid="%OBJ_ID%"><label><input type="checkbox" value="%PRO_USERNAME%" compid="lb_local_pros_dialog_checkbox"><div><div class="author-avatar" compid="lb_local_pros_dialog_pro_avatar">%AVATAR%</div><div class="author-details"><div class="text-m clearfix" compid="lb_local_pros_dialog_pro_name">%AUTHOR%</div><div class="pro-type text-gray-light">%PRO_TYPE%</div>%PRO_REVIEWS%<span class="pro-location-text text-nowrap"><i class="hzi-font hzi-location-pin-fill"></i>%PRO_LOCATION%</span></div></div></label></div>';this.setOwner=function(h){a=h,b=$('<section id="lbLocalProsAd" compid="lb_local_pros_ad" class="lbInfoBox separator trackMe"></section>'),a.addInfoBoxToContentGroup(b.get(0),"localProsAd",l),c=$("<div>").appendTo(b),c.append(HZ.lb.RenderUtils.renderSectionHeader(m)),c.append(HZ.utils.Html.template('<div class="row"><p class="col-xs-12"><button class="btn btn-primary med btn-block"><i class="hzi-font hzi-Pro-Fill icon"></i> %CONTACT_CTA%</button></p></div>',{CONTACT_CTA:n})),b.on("click",".btn-primary",this.handleCtaClick.bind(this)),b.addClass("hidden"),k=HZ.ui.AjaxThrobber.getThrobber(),f=$('<button type="button" class="btn btn-secondary text-s text-bold" compid="lb_local_pros_dialog_cancel">'+_hgt("Cancel")+"</button>"),g=$('<button type="submit" class="btn btn-primary text-s text-bold" compid="lb_local_pros_dialog_send">'+_hgt("Send Message")+"</button>"),d=new HZ.ui.yamdi.Dialog,d.init({dialogClassName:"lb-local-pros-dialog trackMe",formName:"lbContactLocalPros",title:o,controls:[k,f,g]}),e=$(d.getForm()),e.attr("novalidate",!0),e.attr("scopeid","lb_local_pros_dialog_form"),e.on("submit",this.handleDialogSubmit.bind(this)),e.on("change keydown focus","input, textarea",this.clearErrorState.bind(this)),e.on("click",".author-avatar",this.handleProAvatarClick.bind(this)),f.click(HZ.ui.Yamdi.hide.bind(HZ.ui.Yamdi,d))},this.imageDataUpdated=function(){this.imageChanged()},this.imageChanged=function(){var d=a.getCurrentSpace();if(c.detach(),d.fullyLoaded&&HZ.data.CurrentSessionUser){var e=d.id,f=HZ.data.LocalProsAd.get(e),g=f&&f.uids&&f.uids.length>1,h=d.ow,i=h>0&&HZ.data.Users.get(h)&&"1"==HZ.data.Users.get(h).p;g&&i&&(b.append(c),f.hasOwnProperty("proTrackingUrl")&&HZ.lb.Utils.registerTrackingUrl(f.proTrackingUrl,e),f.hasOwnProperty("impTeaserTrackingUrl")&&HZ.lb.Utils.registerTrackingUrl(f.impTeaserTrackingUrl,e),f.hasOwnProperty("proTeaserTrackingUrl")&&HZ.lb.Utils.registerTrackingUrl(f.proTeaserTrackingUrl,e))}},this.handleCtaClick=function(a){this.showLocalProsContactDialog()},this.showLocalProsContactDialog=function(){var b=a.getCurrentSpace(),c=HZ.data.LocalProsAd.get(b.id),e=HZ.data.HouzzClkTracking.get(b.id),f=a.getCurrentSpace().ow,g=HZ.data.Users.get(f);if(g){var h=e&&e[f]?e[f]:null,i=HZ.ui.render.User.getUserImageHtml(f,!0,"javascript:;",1),j=HZ.ui.render.User.getUserHtml(f,!0,h),k=$(HZ.ui.render.User.getProfessionalLocationHtml(g)).html(),l="";$.isNumeric(g.nr)&&parseInt(g.nr)>0&&(l=HZ.lb.RenderUtils.renderProReview(g));var m=$(HZ.utils.Html.template(A,{OBJ_ID:f,PRO_USERNAME:g.n,PRO_ENTRY_LABEL:r,AVATAR:i,AUTHOR:j,PRO_REVIEWS:l,PRO_TYPE:HZ.data.ProfessionalTypes.get(g.pt),PRO_LOCATION:k}));m.find(".pro-location-text").toggleClass("hidden",!(k.length>0));var n=$("<div>").append(m).html()}var o=_hgt("Near {location}",{location:c.loc}),y=$("<div>");c.uids.forEach(function(a,b){if(g=HZ.data.Users.get(a)){var d=c[a];h=d.hasOwnProperty("clkTrackingUrl")?d.clkTrackingUrl:null,i=HZ.ui.render.User.getUserImageHtml(a,!0,"javascript:;",1),j=HZ.ui.render.User.getUserHtml(a,!0,h);var e="";$.isNumeric(g.nr)&&parseInt(g.nr)>0&&(e=HZ.lb.RenderUtils.renderProReview(g)),k=o;var f=HZ.utils.Html.template(A,{OBJ_ID:a,PRO_USERNAME:g.n,PRO_ENTRY_LABEL:s,AVATAR:i,AUTHOR:j,PRO_REVIEWS:e,PRO_TYPE:HZ.data.ProfessionalTypes.get(g.pt),PRO_LOCATION:k});$("<li>").attr("posid",b+1).append(f).appendTo(y)}});var z=HZ.utils.Html.template('<div class="row form-group"><div class="col-xs-6"><input type="text" name="name" class="form-control" placeholder="%NAME_INPUT_PLACEHOLDER%" required></div><div class="col-xs-6"><input type="email" name="email" class="form-control" placeholder="%EMAIL_INPUT_PLACEHOLDER%" required></div></div><div class="row form-group"><div class="col-xs-6"><input type="tel" name="phone" class="form-control" placeholder="%PHONE_INPUT_PLACEHOLDER%" required></div><div class="col-xs-6"><input type="text" name="zip" class="form-control" placeholder="%ZIP_INPUT_PLACEHOLDER%" required></div></div><div class="row form-group"><div class="col-xs-12"><textarea class="form-control" name="message" placeholder="%DESC_INPUT_PLACEHOLDER%" required></textarea></div></div><div class="row"><div class="col-xs-12"><h2 class="header-6 mb0">%PROS_TITLE%</h2></div><div class="col-xs-12 lb-contact-local-pros--local"><ul class="list-unstyled lb-contact-local-pros--list mb0"><li posid="0">%FEATURED_PRO_ENTRY%</li>%LOCAL_PRO_ENTRIES%</ul></div></div>',{FORM_TITLE:p,PROS_TITLE:q,FEATURED_PRO_ENTRY:n,LOCAL_PRO_ENTRIES:y.html(),NAME_INPUT_PLACEHOLDER:t,EMAIL_INPUT_PLACEHOLDER:u,PHONE_INPUT_PLACEHOLDER:v,ZIP_INPUT_PLACEHOLDER:w,DESC_INPUT_PLACEHOLDER:x});d.setBody(z),a.showDialog(d),c.hasOwnProperty("impTrackingUrl")&&HZ.lb.Utils.registerTrackingUrl(c.impTrackingUrl,b.id)},this.handleProAvatarClick=function(a){var b=$(a.currentTarget),c=b.closest(".checkbox").find('input[type="checkbox"]');c.prop("checked",!c.prop("checked"))},this.handleDialogSubmit=function(a){a.preventDefault();var b=$(a.target),c=b.get(0);if(i=b.find(":checked"),c.checkValidity())if(0==i.length)d.showStatus(y);else{j=[],i.each(function(a,b){j.push($(b).val())});var e=HZ.sendEmail.types.PRO,f=$(c.name).val(),g=$(c.email).val(),h=$(c.zip).val(),k=$(c.phone).val(),l=$(c.message).val(),m=_hgt("Contact Name: {name}",{name:f})+"\n"+_hgt("Phone Number: {phoneNumber}",{phoneNumber:h})+"\n"+_hgt("Sender email: {emailAddress}",{emailAddress:g})+"\n\n"+_hgt("Sender zip code: {zipCode}",{zipCode:k})+"\n\n"+l;b.find("[type=submit]").attr("disabled",!0),HZ.ui.AjaxThrobber.setInCall(!0),j.forEach(function(a){HZ.ajaz.Services.sendEmail(null,a,"",m,e,null,null,null,null,null,null,this.onContactFormSubmitResponse.bind(this,a))}.bind(this))}else for(var n,o=z.length,p=0;p<o;p++)if(n=b.find("[name="+z[p]+"]"),!n.get(0).checkValidity()){this.handleFieldValidationError(n);break}},this.onContactFormSubmitResponse=function(a,b){"true"==b.success?(j.splice(j.indexOf(a),1),j.length||(HZ.ui.yamdi.Common.hideAllDialogs(),HZ.ui.AjaxThrobber.setInCall(!1),g.attr("disabled",!1),HZ.ui.yamdi.Common.alert("",HZ.sendEmail.texts.CONFIRM_MESSAGE_SENT)),window.ga("send","event","ContactLocalProsDialog","contactSuccess")):(HZ.ui.yamdi.Common.hideAllDialogs(),HZ.ui.yamdi.Common.alert(_hgt("Send message error!"),b.errorMessage),g.attr("disabled",!1),HZ.ui.AjaxThrobber.setInCall(!1))},this.handleFieldValidationError=function(a){var b,c=a.get(0).validity;if(c.valueMissing)switch(a.attr("name")){case"name":b=_hgt("Please enter your name");break;case"email":b=_hgt("Please enter your email address");break;case"phone":b=_hgt("Please enter your phone number");break;case"zip":b=_hgt("Please enter your zip code");break;case"message":b=_hgt("Please add a short description of your project")}else c.typeMismatch&&(b=HZ.sendEmail.texts.ERROR_INVALID_FROM_EMAIL_ADDRESS);h=$(HZ.utils.Html.template(HZ.lb.Templates.FORM_FIELD_ERROR_TEMPLATE,{MESSAGE:b})),this.showFieldError(a,h)},this.showFieldError=function(a,b){a.parent().addClass("has-error"),a.after(b)},this.clearErrorState=function(a){d.hideStatus(),e.find(".has-error").removeClass("has-error"),h&&h.length&&h.remove()}},HZ.lb.plugins.TrackClick=function(){var a;this.setOwner=function(b){a=b},this.lightboxLoaded=function(){var b,c=a.getCurrentSpace();if(c&&HZ.data.HouzzClkTracking.get(c.id)&&(b=HZ.data.HouzzClkTracking.get(c.id))){var d=b[c.id];d&&d.length>0&&HZ.lb.Utils.registerTrackingUrl(d,c.id)}}},HZ.lb.plugins.ProductAdInfo=function(){var a,b,c=HZ.lb.Config.contentGroupIds.OVERVIEW,d=_hgt("Save to ideabook"),e=_hgt("Sponsored"),f=_hgt("Products in this Photo:");this.setOwner=function(d){a=d,b=$('<section id="lbProductAds" scopeid="lightboxBrandAds" class="lbInfoBox separator productAds trackMe"></section>'),a.addInfoBoxToContentGroup(b.get(0),"productAdInfo",c)},this.imageDataUpdated=function(){this.imageChanged()},this.imageChanged=function(){b.empty();var c,g=a.getCurrentSpace(),h=!1,i=a.isSpotlightContext(),j=[];if(c=HZ.data.PhotoAds.get(g.id),g&&g.fullyLoaded&&HZ.data.ProductAds.get(g.id)&&(c||(c=HZ.data.ProductAds.get(g.id),h=!0)),c&&c.products&&c.products.length>0&&!c.mpAd){c.adHtml&&(c.adHtml="<div>"+$(c.adHtml).html()+"</div>");var k=c.buttonText?_hgt(c.buttonText):i?_hgt("Learn More"):_hgt("Visit Store"),l=c.products,m=l.length,n=Math.min(6,m),o=0;l=l.filter(function(a){return o++<n&&!!HZ.data.Spaces.get(a.sid)}),l.forEach(function(a){var b=a.sid,c=HZ.data.Spaces.get(b),e=c.t,f=HZ.utils.Links.getSpaceImageUrl(b,131,131,!1),g=a.tlink,i=a.ptlink,l="pLink_"+b,m={SAVE_MESSAGE:d,IMG_SRC:HZ.utils.Config.emptyGifData,IMG_URL:f,IMG_STYLE:"background-image:url("+f+");",SPACE_TITLE_CLASS:h?"hidden":"",SPACE_LINK:i,SPACE_TITLE:e,VISIT_STORE_URL:g,VISIT_STORE_CTA:k,LINK_ID:l},n=$(HZ.utils.Html.template('<li><div class="row"><div class="col-xs-3 thumb" title="%SAVE_MESSAGE%" compid="addToIdeabook"><img src="%IMG_SRC%" class="image" style="%IMG_STYLE%"><a href="javascript:;" class="btn tint save" compid="addToIdeabook"><i class="plus-icon hzi-font hzi-Add-Photo-Button"></i></a></div><div class="col-xs-9"><h3 class="%SPACE_TITLE_CLASS%"><a href="%SPACE_LINK%" target="_blank" rel="nofollow">%SPACE_TITLE%</a></h3><a id="%LINK_ID%" href="%VISIT_STORE_URL%" target="_blank" class="btn btn-primary med">%VISIT_STORE_CTA%<span class="more-icon"></span></a></div></div></li>',m));n.on("click",".thumb",b,this.handleProdAddToIdeabookClick.bind(this)),j.push(n)}.bind(this));var p={SPONSORED:h?"":e,BRAND_LOGO:!h&&c.adHtml?c.adHtml:"",AD_SECTION_TITLE:f,OFFER:c.brandAdOffers?HZ.utils.Html.template('<h2 class="header-5 text-bold col-xs-12 pro-offer">%OFFER_DESC%</h2>',{OFFER_DESC:c.brandAdOffers}):""};b.append(HZ.utils.Html.template('<header class="sectionHeader row"><p class="sponsored-badge col-xs-12">%SPONSORED%</p><div class="ad-brand-logo col-xs-12">%BRAND_LOGO%</div>%OFFER%<h2 class="sectionTitle text-l text-bold mbm col-xs-12">%AD_SECTION_TITLE%</h2></header><ul class="thumb-grid grid-1 clearfix"></ul>',p)),b.find(".thumb-grid").append(j),HZ.lb.Utils.registerTrackingUrl(c.impTrkLink,g.id)}},this.handleProdAddToIdeabookClick=function(b){if(a.isSignupMode())a.showLoginDialog();else{var c=b.data;HZ.spaceActions.AddToIdeabookDialog.init(c),a.showDialog(HZ.spaceActions.AddToIdeabookDialog)}},this.lightboxLoaded=function(){var b,c=a.getCurrentSpace();c&&HZ.data.PhotoAds.get(c.id)&&(b=HZ.data.PhotoAds.get(c.id),b.clkTrkLink&&HZ.lb.Utils.registerTrackingUrl(b.clkTrkLink,c.id))}},HZ.lb.plugins.MarketPlaceAds=function(){var a,b,c,d,e=HZ.lb.Config.contentGroupIds.OVERVIEW,f='<li posid="%POS_ID%" objid="%OBJ_ID%" class="%CSS_CLASS%"><div class="row"><div class="col-xs-4"><div class="img-responsive-wrapper img-responsive-square"><img class="img-responsive" src="%IMG_SRC%" width="%THUMB_WIDTH%" height="%THUMB_HEIGHT%"/></div></div><div class="col-xs-8"><p><a href="%SPACE_LINK%" target="_blank" rel="nofollow">%SPACE_TITLE%</a></p><p>%BUTTON%</p></div></div></li>',g=_hgt("Buy"),h=_hgt("Sold Out"),i=_hgt("Products in this Photo"),j=_hgt("Related products in this Photo");this.setOwner=function(c){a=c,b=$('<section id="lbProductAds" scopeid="lb_mp_ad" class="lbInfoBox separator mp-ad"></section>'),a.addInfoBoxToContentGroup(b.get(0),"productAdInfo",e),b.on("click",".mp-ad-thumb",this.handleThumbClick.bind(this))},this.imageDataUpdated=function(){this.imageChanged()},this.imageChanged=function(){if(b.empty(),c=[],d=[],a.isMarketPlaceAd()){b.append(HZ.lb.RenderUtils.renderSectionHeader(i));var e=a.getCurrentSpace(),g=HZ.data.PhotoAds.get(e.id),h=g.products,k=[];if(h.forEach(function(a,b){var d=HZ.data.Spaces.get(a.sid);c.push(d.id),k.push(this.getThumbReplacementMap(d,b,a))}.bind(this)),b.append(HZ.lb.RenderUtils.renderThumbGrid(1,k,"mp-ad-thumb",f,"lb_mp_ad_products")),g.hasOwnProperty("relatedProductList")){var l=g.relatedProductList;Array.isArray(l)&&l.length>0&&(b.append(HZ.lb.RenderUtils.renderSectionHeader(j)),k=[],l.forEach(function(a,b){var c=HZ.data.Spaces.get(a.id);d.push(c.id),k.push(this.getThumbReplacementMap(c,b))}.bind(this)),b.append(HZ.lb.RenderUtils.renderThumbGrid(1,k,"mp-ad-thumb mp-ad-thumb--related",f,"lb_mp_ad_rel_products")))}g.hasOwnProperty("impTrkLink")&&HZ.lb.Utils.registerTrackingUrl(g.impTrkLink,e.id)}},this.getThumbReplacementMap=function(a,b,c){var d=a.id,e=HZ.data.ProductsInfo.get(d),f={};if(e&&e.mp){var i,j=c&&c.hasOwnProperty("ptlink")?c.ptlink:HZ.utils.Links.getSpaceLink(d),k=e.av,l=a.t,m=HZ.utils.Links.getSpaceImageUrl(d,120,120,!1);i=k?HZ.utils.Html.template('<a compid="lb_mp_ad_buy" class="btn btn-primary med"><i class="cart-icon icon icon-font icon-shopping_cart mrs"></i> <span class="btn-label">%BUTTON_LABEL%</span></span></a>',{BUTTON_LABEL:g}):HZ.utils.Html.template('<a class="btn btn-secondary" disabled><i class="cart-icon icon-font icon-shopping_cart mrs"></i> <span class="btn-label">%BUTTON_LABEL%</span></span></a>',{BUTTON_LABEL:h}),f={POS_ID:b,OBJ_ID:d,THUMB_WIDTH:120,THUMB_HEIGHT:120,IMG_SRC:m,SPACE_LINK:j,SPACE_TITLE:l,BUTTON:i,SPACE_DESC:a}}return f},this.handleThumbClick=function(b){var e=$(b.currentTarget),f=e.is(".mp-ad-thumb--related"),g=e.data("space-desc").id,h=f?d:c,i={};i[HZ.lb.Config.DESCRIPTOR_FIELD_SPACE_ID]=g;var j=new HZ.lb.Context("marketPlaceAds_"+g,HZ.lb.Config.CONTEXT_TYPE_IMAGE_TAGS,i,h,h.length,h.indexOf(g),-1);j.setCurrentSpaceId(g),a.pushContext(j),a.refresh()}},HZ.lb.plugins.SponsoredProLists=function(){var a,b,c,d,e=HZ.lb.Config.contentGroupIds.OVERVIEW;this.setOwner=function(c){a=c,b=$('<section id="lbSponsoredProListAd" scopeid="lb_sponsored_pro_list_ad" compid="lb_sponsored_pro_list_ad" class="lbInfoBox separator trackMe"></section>'),a.addInfoBoxToContentGroup(b.get(0),"sponsoredProListAd",e),d=$('<div id="lbSponsoredProListImageOverlay"></div>'),a.addLbImageLayer(d)},this.imageDataUpdated=function(){},this.imageChanged=function(){var e=a.getCurrentSpace(),f=e.id;b.empty(),d.empty();var g=HZ.data.ProListAds.get(f);if(g){c=$('<div id="proListContent"></div>').appendTo(b);var h=new HZ.proPlus.contactMultiplePros,i={container:c,bannerContainer:d,isSingleVariant:HZ.lb.Config.proListSingleAd,props:{onContactFormFocus:this.onContactFormFocus.bind(this),onContactFormBlur:this.onContactFormBlur.bind(this)}};$.extend(!0,i,g),h.init(i),b.append(i.aTrackingPixel),b.append(i.pTrackingPixel),a.setSpaceActionsDisabled(!0),a.disableSpaceActions()}},this.onContactFormFocus=function(b){a.detachKeyboardHandler()},this.onContactFormBlur=function(b){a.attachKeyboardHandler()}};

window.hzmr.push("lightbox2.2AdPlugins:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End lightbox2.2AdPlugins.js  **************/
/************* Start extracting text for lightbox2.2Plugins.js for locale it-IT **************/
(function(){var _hzxt={"Similar Ideas":"Idee simili","Similar Idea":"Idea simile","<t1>{spaceTitle}<\/t1><t2>{spaceSubtitle}<\/t2>":"<t1>{spaceTitle}<\/t1><t2>{spaceSubtitle}<\/t2>","<t1><t2>{spaceTitle}<\/t2><t3>{spaceSubtitle}<\/t3><\/t1>":"<t1><t2>{spaceTitle}<\/t2><t3>{spaceSubtitle}<\/t3><\/t1>","Share your idea with others:":"Condividi la tua idea con altri:","by <t1>{manufacture}<\/t1>":"di <t1>{manufacture}<\/t1>","This product has {questionCount} questions":"Vi sono {questionCount} domande relative a questo prodotto","View Product":"Vai al prodotto","Add 10% more for cuts, breaks and waste.":"Considera l'acquisto di un 10% addizionale, nel caso in cui il materiale si rompa o tu lo voglia tagliare","FREE Shipping":"Spedizione GRATUITA","Edit Sketch":"Modifica sketch","Call during our regular hours: {csHours}":"Contattaci durante l'orario d'ufficio: {csHours}","Save this product for yourself":"Salva questo prodotto per te","Assembly Required":"Montaggio necessario","Recently Viewed and Recommendations":"Visualizzati di recente e raccomandazioni","Report incorrect information or image":"Segnala l'immagine o informazioni errate","Save ideas for your dream home in one place and access on any device.":"Salva le idee per la casa dei tuoi sogni in un unico posto. Trovale in tutti i tuoi dispositivi.","Create New Sketch":"Crea un nuovo sketch","*Price not verified":"*Prezzo indicato dal produttore\/rivenditore","Houzz {importCountry}":"Houzz {importCountry}","Save ideas for your dream home in<br>one place and access on any device.":"Salva le idee per la casa dei tuoi sogni in un unico posto.<br>Potrai accedervi da qualsiasi dispositivo.","Save this photo for yourself":"Salva questa foto, ti sar\u00e0 utile","Save ideas for your dream home in one place<br> that you can access on all your devices. ":"Salva le idee per la casa dei tuoi sogni in un unico posto.<br>Potrai accedervi da qualsiasi dispositivo.","This Photo was added to {ideabookCount} ideabook:":"Questa foto \u00e8 stata aggiunta a {ideabookCount} ideabook:","Houzz Exclusive":"Esclusiva Houzz","This Project{contextLightboxProject}":"questo progetto{contextLightboxProject}"," ({currentPhoto} of {totalPhotos})":"&nbsp;({currentPhoto} di {totalPhotos})","This Project":"questo progetto","Show 1 More Photo":"Mostra un'altra foto","Show {remainingPhotoCount} More Photos":"Mostra altre {remainingPhotoCount} foto","Our Houzz specialists are ready to help!":"I nostri Consulenti Houzz sono pronti ad aiutarti!","this Project":"questo progetto","Colors from this space":"Colori di questo spazio","NEW: Visual Product Search":"NOVIT\u00c0: ricerca visuale dei prodotti","See something you like? Hover your mouse over it and we'll try to find a match for you.":"Vedi qualcosa che ti piace? Passaci sopra con il mouse e proveremo a trovare il miglior prodotto corrispondente.","Share Palette":"Condividi la palette","Buy Samples":"Crea il tuo stile","{reviewsCount} Reviews":"{reviewsCount} Recensioni","by Houzz":"da Houzz","by <t1>{sellerName}<\/t1>":"da <t1>{sellerName}<\/t1>","W":"L","H":"A","D":"P","Size\/Weight":"Dimensioni\/Peso","Houzz Product Search":"Ricerca dei prodotti su Houzz","Found the perfect sofa, table, or other home product but don\u2019t know where to buy it? Try moving your mouse over a product you like and we\u2019ll do our best to find a match for you.":"Hai trovato il divano, il tavolo o un altro prodotto perfetto per la tua casa ma non sai dove acquistarlo? Prova a passare con il mouse sopra il prodotto che ti piace e noi faremo tutto il possibile per trovare il miglior prodotto corrispondente.","Other Photo in <t1>{projectTitle}<\/t1>":"Altra foto in <t1>{projectTitle}<\/t1>","Image Notes":"Note all'immagine","People who liked this also liked":"A chi \u00e8 piaciuto questo \u00e8 piaciuto anche","See Similar {productCategory} on Houzz":"Guarda {productCategory} simili su Houzz","See More {productCategory} on Houzz":"Guarda pi\u00f9 {productCategory} su Houzz","Tagged in this Photo":"Etichettato in questa foto","Show Paint Colors":"Mostra le vernici","Hide Paint Colors":"Nascondi le vernici","Sponsored by:":"Sponsorizzato da:","This Room's Paint Colors":"I colori di questo spazio","Get this paint":"Trova questa vernice","Take a look at this {paintManufacturer} color palette I created on Houzz.":"Scopri la palette di colori {paintManufacturer} che ho creato su Houzz e fammi sapere cosa ne pensi!","Similar Products on Houzz":"Prodotti simili su Houzz","This product has one question":"Vi \u00e8 una domanda relativa a questo prodotto","Recently Viewed":"Visto di recente","Sketch":"Sketch","Tagged in this photo":"Etichettato in questa foto","Already have an account? <t1>Sign in<\/t1>":"Hai gi\u00e0 un account? <t1>Accedi<\/t1>","Product questions":"Domande sul prodotto","Other Photos in <t1>{projectTitle}<\/t1>":"Altre foto in <t1>{projectTitle}<\/t1>","Browse this Category":"Esplora questa categoria","Browse this Style":"Esplora questo stile","Browse this Location":"Esplora questa localit\u00e0","Have a question about this product? Ask our community.":"Hai una domanda su questo prodotto? Rivolgiti alla nostra community.","Have a question about this photo? Ask our community.":"Hai una domanda su questa foto? Chiedila alla community.","In Your Ideabook:":"Nel tuo Ideabook:","{ideabookOwner}'s Ideabook:":"Ideabook di {ideabookOwner}:","See Related Photo ":"Guarda la foto correlata","See Related Photo":"Guarda la foto correlata","Currently not Available":"Attualmente non disponibile","HOUZZ EXCLUSIVE":"SOLO SU HOUZZ","<t1>Terms<\/t1> & <t2>Privacy<\/t2>":"<t1>Condizioni<\/t1> e <t2>Privacy<\/t2>","People also liked this photo":"Ad alcuni utenti \u00e8 anche piaciuta quest'altra foto","People also liked these photos":"Ad alcuni utenti sono anche piaciute queste altre foto","Product Specification":"Specifiche prodotto","Questions About This Photo":"Domande su questa foto","Question About This Photo":"Domanda su questa foto","Questions About This Photo ({questionCount})":"Domande su questa foto ({questionCount})","Photos with this (or similar) product:":"Foto con questo prodotto (o simile):","Related Photos":"Foto correlate","See more rooms with this product":"Guarda altre stanze con questo prodotto","Similar Product on Houzz":"Prodotto simile su Houzz","Edit Tag":"Modifica l'etichetta","Delete Tag":"Elimina l'etichetta","Visually Similar Products":"Prodotti visivamente simili","{numSaves} Save":"Salvato {numSaves} volte","<t1>{projectTitle}<\/t1>":"<t1>{projectTitle}<\/t1>","Have a question about this product? <t1>Click here<\/t1> to ask the community.":"Hai una domanda su questo prodotto? <t1>Clicca qui<\/t1> per chiedere alla community.","Have a question about this photo? <t1>Click here<\/t1> to ask the community.":"Hai una domanda su questa foto? <t1>Clicca qui<\/t1> per chiedere alla community.","This Palette was added to {ideabookCount} ideabooks, including:":"Questa palette \u00e8 stata aggiunta a {ideabookCount} Ideabook, tra cui:","This Palette was added to {ideabookCount} ideabooks.":"Questa palette \u00e8 stata aggiunta a {ideabookCount} Ideabook.","This Photo was added to {ideabookCount} ideabooks.":"Questa foto \u00e8 stata aggiunta a {ideabookCount} Ideabook.","This Product was added to {ideabookCount} ideabook:":"Questo prodotto \u00e8 stato aggiunto a {ideabookCount} Ideabook:","This Product was added to {ideabookCount} ideabooks, including:":"Questo prodotto \u00e8 stato aggiunto a {ideabookCount} Ideabook, tra cui:","This Palette was added to {ideabookCount} ideabook:":"Questa palette \u00e8 stata aggiunta a {ideabookCount} Ideabook:","This Photo was added to {ideabookCount} ideabooks, including:":"Questa foto \u00e8 stata aggiunta a {ideabookCount} Ideabook, tra cui:","This Product was added to {ideabookCount} ideabook.":"Questo prodotto \u00e8 stato aggiunto a {ideabookCount} Ideabook.","This Product was added to {ideabookCount} ideabooks.":"Questo prodotto \u00e8 stato aggiunto a {ideabookCount} Ideabook.","This Palette was added to {ideabookCount} ideabook.":"Questa palette \u00e8 stata aggiunta a {ideabookCount} Ideabook.","This Photo was added to {ideabookCount} ideabook.":"Questa foto \u00e8 stata aggiunta a {ideabookCount} Ideabook.","This Photo was added to {ideabookCount} ideabooks.:":"Questa foto \u00e8 stata aggiunta a {ideabookCount} Ideabook.","Take a look at this {mft} color palette I created on Houzz.":"Guarda questa palette di colori {mft} che ho creato su Houzz.","{numQuestions} Questions":"{numQuestions} Domande","{numQuestions} Question":"{numQuestions} Domanda","Edit Image Tags":"Modifica etichette immagine","Toggle Edit Mode":"Attiva modalit\u00e0 di modifica","Share a link on {socialPlatform}":"Condividi un link su {socialPlatform}","People who liked this product also liked ({photoCount} photos): ":"Alle persone cui \u00e8 piaciuto questo prodotto \u00e8 piaciuto anche ({photoCount} foto):","People who liked this product also liked (1 photo):":"Alle persone cui \u00e8 piaciuto questo prodotto \u00e8 piaciuto anche (1 foto):","Save Palette":"Salva la palette","No":"No","Yes":"S\u00ec","{numSaves} Saves":"Salvato {numSaves} volte","Sign up to unlock the entire Houzz":"Iscriviti per accedere all'intero sito di Houzz","Sold Out":"Esauriti","Write Review":"Scrivi una recensione","Email{contextEmailVerb}":"E-mail{contextEmailVerb}","This price has been supplied by a user of Houzz and, therefore, may not accurately reflect the current price of the product.":"Questo prezzo \u00e8 stato fornito da un utente Houzz e quindi potrebbe non riflettere accuratamente il prezzo corrente del prodotto.","OK":"OK","See More":"Vedi altro","My color palette":"Guarda la mia palette di colori!","Back":"Indietro","Website":"Sito web","Show {questionCount} more questions":"Mostra altre {questionCount} domande","Show 1 more question":"Mostra un'altra domanda","Added to <t1>{galleryTitle}<\/t1>:":"Aggiunto a <t1>{galleryTitle}<\/t1>:","Sign Up with Email":"Iscriviti con l'e-mail","cancel":"Annulla","Save To Ideabook":"Salva nell'Ideabook","Out of Stock":"Esaurito","Edit":"Modifica","More Info":"Maggiori informazioni","Ask a question":"Fai una domanda","Are you sure you want to delete this tag?":"Eliminare questa etichetta?","Toggle Image Tags":"Attiva etichette immagine","Only {quantity} Left!":"Ne restano solo {quantity}!","<b>Free Shipping<\/b>":"<b>Spedizione gratuita<\/b>","View return policy":"Vedi la politica di reso","Visit Store":"Sito del produttore","View Your Shopping Cart":"Visualizza carrello degli acquisti","Less":"Meno","Share":"Condividi","1 Review":"1 recensione","Edit Review":"Modifica recensione","private comment":"commento privato","Cancel":"Annulla","":"","Sponsored Products":"Prodotti sponsorizzati","Sponsored":"Sponsorizzato","Related Products":"Prodotti correlati","Question":"Domanda","Embed this photo on blog":"Incorpora questa foto sul blog","Product Description":"Descrizione del prodotto","Manufactured By":"Prodotto da","Add to Cart":"Visita lo shop","Free Shipping!":"Spedizione gratuita!","Sold By":"Venduto da","Print Photo":"Stampa foto","Ask a Question":"Fai una domanda","Questions":"Domande","Products in this Photo":"Prodotti in questa foto","Location":"Localit\u00e0","Style":"Stile","Download":"Scarica","Buy on Houzz":"Acquista su Houzz","Print":"Stampa","Embed":"Incorpora","Sign In with Facebook":"Accedi con Facebook","Save":"Salva","Category":"Categoria","Size":"Dimensioni","More":"Altro","Save to Ideabook":"Salva nell'Ideabook","Done":"Fatto","Quantity:":"Quantit\u00e0:","Products":"Prodotti"};for(var a in _hzxt){window._hzlang[a]=_hzxt[a];}})();
/*************  End extracting text for lightbox2.2Plugins.js  **************/
/************* Start lightbox2.2Plugins.js for locale it-IT **************/
try {HZ.lb.Templates={SECTION_HEADER:'<header class="section-header"><h2 class="text-m text-bold">%TITLE%</h2></header>',THUMB_GRID:'<ul class="clearfix thumb-grid %GRID_CLASS%" %COMP_ID_ATTR%></ul>',SIMPLE_THUMB:'<li s="%SPACE_ID%" objId="%SPACE_ID%" i="%INDEX%" class="thumb %CSS_CLASS%"><a href="%CLICK_URL%" target="_blank"><div class="img-responsive-wrapper img-responsive-square"><img class="img-responsive" src="%IMG_SRC%" width="%WIDTH%" height="%HEIGHT%"/></div></a></li>',PRODUCT_THUMB:'<li s="%SPACE_ID%" objId="%SPACE_ID%" i="%INDEX%" class="thumb %CSS_CLASS%" title="%TITLE_ATTR%"><a href="%CLICK_URL%" target="_blank" class="lb-mpp-thumb"><div class="img-responsive-wrapper img-responsive-square"><img class="img-responsive" src="%IMG_SRC%" width="%WIDTH%" height="%HEIGHT%"/></div><div class="thumb-overlay"><div class="thumb-overlay-text">%OVERLAY_TEXT%<span class="more-icon"></span></div></div></a>%THUMB_META%</li>',PRODUCT_THUMB_CARD:'<li s="%SPACE_ID%" objId="%SPACE_ID%" i="%INDEX%" class="thumb thumb-card %CSS_CLASS%"><div class="product-related-image"><a href="%CLICK_URL%" target="_blank" class="lb-mpp-thumb"><div class="img-responsive-wrapper img-responsive-square"><img class="img-responsive" src="%IMG_SRC%" width="%WIDTH%" height="%HEIGHT%"/></div></a>%THUMB_META%</div>%THUMB_HOVER_META%</li>',PPC_THUMB:'<li s="%SPACE_ID%" class="thumb %CSS_CLASS%" ><a id="ppc%SPACE_ID%" objid="%SPACE_ID%" href="%CLICK_URL%" class="lb-ppc-thumb" target="_blank" rel="nofollw"><div class="img-responsive-wrapper img-responsive-square"><img class="img-responsive" i="%INDEX%" s="%SPACE_ID%" src="%IMG_SRC%" width="%WIDTH%" height="%HEIGHT%"/></div><div class="thumb-overlay"><div class="thumb-overlay-text">%OVERLAY_TEXT%<span class="more-icon"></span></div></div></a><div class="lb-ppc-info text-bold">%PPC_INFO%</div></li>',THUMB_META_TEMPLATE:'<div class="space-meta"><div class="space-price">%PRICE%</div></div>',THUMB_META_T_TEMPLATE:'<div class="space-meta"><div class="space-title">%STITLE%</div><div class="space-price">%PRICE%</div></div>',THUMB_HOVER_META_TEMPLATE:'<div class="thumb-product-detail"><div class="thumb-product-image"><div class="img-responsive-wrapper img-responsive-square"><img class="img-responsive" src="%HOVER_IMG_SRC%" width="%HOVER_WIDTH%" height="%HOVER_HEIGHT%"/></div></div><div class="product-tag-type"><i class="hzi-font hzi-Search text-m"></i> '+_hgt("Visual Match")+'</div><div class="product-title one-line">%PRODUCT_TITLE%</div>%PRICE_LABEL%<button class="btn btn-primary btn-block med js-buy trackMe"><span class="text-m">'+_hgt("View Product")+"</span></button></div>",THUMB_HOVER_META_TEMPLATE_NEW:'<div class="thumb-product-detail"><div class="product-tag-type">'+_hgt("Visually Similar")+'</div><div class="thumb-product-image"><div class="img-responsive-wrapper img-responsive-square"><img class="img-responsive" src="%HOVER_IMG_SRC%" width="%HOVER_WIDTH%" height="%HOVER_HEIGHT%"/></div></div><div class="product-title one-line">%PRODUCT_TITLE%</div>%PRICE_LABEL%<button class="btn btn-primary btn-block med js-buy trackMe"><span class="text-m">'+_hgt("View Product")+"</span></button></div>",PRODUCT_PRICE_LABEL:'<div class="product-price"><span>%PRICE%</span><i class="hzi-font hzi-Tag text-s"></i></div>',PRODUCT_BADGE:'<span class="badge-text %CSS_CLASS% text-xs text-bold">%BADGE_TEXT%</span>',SPACE_FACET:'<li><a href="javascript:;" class="%CSS_CLASS%">%FACET_TEXT%</a></li>',PRODUCT_SALE_PROMO:'<p><span class="%SALE_BADGE_CLASS%">%SALE_BADGE_LABEL%</span><span class="header-5 sale-title">%SALE_LABEL%</span><span class="text-m">%SALE_SELLER%</span></p>',PRODUCT_PRICE:'<span class="product-price">%FINAL_PRICE%</span>&nbsp;<del class="text-m">%STRIKE_TROUGH_PRICE%</del>',SHIPPING_SELLER_INFO:'<span class="shipping-info">%FLAT_SHIPPING%%SHIPPING_COST%<a class="colorLink shipping-info-link" href="javascript:;">%SHIPPING_LINK_TEXT%<span class="more-icon"></span></a></span><div id="leadTimeText"></div>',BLANK_LINK:'<a target="_blank" href="%LINK_URL%" title="%TITLE_ATTR%">%LINK_TEXT%</a>',IMAGE_OVERLAY_TEMPLATE:'<div class="image-overlay trackMe %CSS_CLASS%" compid="%COMP_ID%"><div class="shape"></div><div class="cta header-2">%CTA%</div></div>',IDEABOOK_SPACE_COMMENT:'<div class="space-comment clearfix"><div class="col-xs-12"><div class="col-xs-1">%AUTHOR_AVATAR%</div><div class="col-xs-11"><p class="%QUOTE_CLASS% mb0">%COMMENT%</p></div></div></div>',FEATURED_SALES_THUMB:'<div class="similarGallery" objid="%SPACE_ID%"><div class="thumb"><a href="%CLICK_URL%" target="_blank" compid="img" style="display: block;"><img class="thumb" width="%WIDTH%" height="%HEIGHT%" src="%IMG_SRC%" />%SALE_PERCENT_OFF_HTML%</a></div><div class="context"><a href="%CLICK_URL%" target="_blank" compid="title" class="similarGalleryTitle header-6 top">%TITLE%</a><p class="space-description">%SUB_TITLE%</p><a href="%CLICK_URL%" target="_blank" compid="seeProducts" class="similarGalleryTitle colorLink header-6 top">See Products&nbsp;<span class="more-icon"></span></a></div></div>',PRO_REVIEW_TEMPLATE:'<div class="pro-rating"><div class="review-rate">%REVIEW_RATING% <span class="review-count" itemprop="ratingCount">%NUM_OF_REVIEWS%</span></div></div>',FORM_FIELD_ERROR_TEMPLATE:'<div class="form-field-error"><span class="outer-tip"></span><span class="inner-tip"></span><span class="message">%MESSAGE%</span></div>'},HZ.lb.RenderUtils={renderSectionHeader:function(a){return $(HZ.utils.Html.template(HZ.lb.Templates.SECTION_HEADER,{TITLE:a}))},renderThumbGrid:function(a,b,c,d,e){var f="",g=["grid-"+a];e&&(f='compid="'+e+'"',g.push("trackMe"));var h=$(HZ.utils.Html.template(HZ.lb.Templates.THUMB_GRID,{GRID_CLASS:g.join(" "),COMP_ID_ATTR:f}));if(Array.isArray(b)){var i=c||"";b.forEach(function(a,b){a.hasOwnProperty("CSS_CLASS")?a.CSS_CLASS+=i:a.CSS_CLASS=i;var c=$(HZ.utils.Html.template(d,a)).attr("posid",b);a.hasOwnProperty("SPACE_DESC")&&c.data("space-desc",a.SPACE_DESC),h.append(c)})}return h},renderIdeabookSpaceComment:function(a,b){if(a&&b){var c=$("<div>").append(a.b).html(),d=HZ.ui.render.User.getUserImageHtml(b.au),e=b.featured?"":"text-quoted";return a.b?$(HZ.utils.Html.template(HZ.lb.Templates.IDEABOOK_SPACE_COMMENT,{AUTHOR_AVATAR:d,COMMENT:UIHelper.convertLinksInString(c),QUOTE_CLASS:e})):$}},renderBrowseCategoryLink:function(a){var b=HZ.data.Categories.getCategoryById(a.cat),c=a.brlnk;if(b&&c&&c.cat){var d=a.tname?a.tname:b.name,e=HZ.utils.Html.template(HZ.lb.Templates.BLANK_LINK,{LINK_URL:c.cat,TITLE_ATTR:_hgt("Browse this Category"),LINK_TEXT:d});return $(e).addClass("text-primary")}return""},renderBrowseStyleLink:function(a){var b=HZ.utils.Styles.getStyleName(a.s),c=a.brlnk;if(b&&c&&c.s){var d=HZ.utils.Html.template(HZ.lb.Templates.BLANK_LINK,{LINK_URL:c.s,TITLE_ATTR:_hgt("Browse this Style"),LINK_TEXT:b});return $(d).addClass("text-primary")}return""},renderBrowseLocationLink:function(a){var b,c=a.brlnk;if(c&&c.ma){b=a.ma;var d=HZ.utils.Html.template(HZ.lb.Templates.BLANK_LINK,{LINK_URL:c.ma,TITLE_ATTR:_hgt("Browse this Location"),LINK_TEXT:b});return $(d).addClass("text-primary")}return a.loc},renderProReview:function(a){var b="";return $.isNumeric(a.r)&&$.isNumeric(a.nr)&&(b=HZ.utils.Html.template(HZ.lb.Templates.PRO_REVIEW_TEMPLATE,{REVIEW_RATING:HZ.ui.render.Rate.getRateStars(a.r),NUM_OF_REVIEWS:_hgtp("","1 Review","{reviewsCount} Reviews",a.nr,{reviewsCount:a.nr})})),b}},HZ.lb.plugins.ContentTabs=function(){var a,b,c,d,e,f,g,h,i;this.setOwner=function(f){a=f,c=a.getContentTabsNode(),b=a.getInfoElement(),d=HZ.lb.Config.spaceContentGroupIds,e=HZ.lb.Config.productContentGroupIds},this.lightboxLoaded=function(){this.contentGroupsChanged()},this.contentGroupsChanged=function(){var b=c.empty();b.on("click.lightbox",".content-group-tab:not(.current):not(.disabled)",this.handleTabClick.bind(this)),[{type:"space",tabs:d,compId:"space_tabs"},{type:"product",tabs:e,compId:"product_tabs"}].forEach(function(c){var d=c.type,e=c.tabs,f=c.compId;h=$("<ul class='list-unstyled content-group-tabs trackMe'></ul>").attr("compid",f).addClass(d).appendTo(b).disableSelection(),e.forEach(function(b){var c=a.getContentGroupById(b),d=c.iconClass;switch(c.iconClass){case"hzi-Houzz-Photo":d="icon-photos";break;case"hzi-Tag":d="icon-shopping_tag";break;case"hzi-Comments-Advice":d="icon-sb_question";break;case"hzi-paint-dropper":d="icon-eye_drop";break;case"hzi-info-icon-solid":d="icon-circle_i"}var e={GROUP_ID:c.id,ICON_CLASS:d,OBJ_ID:c.id+"_tab"},f=$(HZ.utils.Html.template('<li data-group-id="%GROUP_ID%" class="content-group-tab %GROUP_ID%" objid="%OBJ_ID%"><i class="icon icon-font %ICON_CLASS%"></i></li>',e));h.append(f)})}),this.activateCurrentTab()},this.imageDataUpdated=function(){this.imageChanged()},this.imageChanged=function(){var b=a.getCurrentSpace().id,d=HZ.data.ColorPickerAd.get(b),e=HZ.data.PhotoAds.get(b),f=HZ.data.ProductAds.get(b),g=!!d,h=!!e,i=!!f,j=c.find(".content-group-tab."+HZ.lb.Config.contentGroupIds.COLOR_PICKER);j.toggleClass("hidden",!g||h||i),g&&j.attr("posid",HZ.lb.Utils.ColorPicker.getCampaignId(d)),this.activateCurrentTab()},this.pluginAfterShown=function(){clearTimeout(f),f=setTimeout(this.disableEmptyTabs.bind(this),5)},this.lightboxScroll=function(){var b=a.getContentBox(),c=b.h/4,d=this.getCurrentTabIds().slice(0).reverse(),e=a.getContentGroupPositions(),f=d.length-1,h=0,j=a.getContentScrollTop();j>0&&d.forEach(function(a,b){if(e[a]){var d=e[a].top-j,g=e[a].bottom-j;(d>0&&d<c||d<0&&g>c)&&(h=Math.max(f-b,h))}}),i||a.registerTimeout("currentGroupIndexDebounce",function(){h=$.isNumeric(g)?g:h,a.setCurrentContentGroupIndex(h),g=null}.bind(this),20)},this.currentContentGroupChanged=function(){this.activateCurrentTab()},this.activateCurrentTab=function(){var b=a.getCurrentContentGroupIndex();this.getCurrentTabsNode().find(".content-group-tab").removeClass("current").eq(b).addClass("current")},this.disableEmptyTabs=function(){var b=this.getCurrentTabIds(),c=this.getCurrentTabsNode(),d=c.find(".content-group-tab").removeClass("disabled"),e=this.hasVisibleContent;b.forEach(function(b,c){var f=a.getNodeByContentGroupId(b);f.removeClass("no-content"),e(f)||($(d.get(c)).addClass("disabled"),f.addClass("no-content"))})},this.handleTabClick=function(b){var c=$(b.currentTarget).data("group-id");c==HZ.lb.Config.contentGroupIds.COLOR_PICKER&&a.enterColorPickerMode();var d=this.getCurrentTabIds();g=d.indexOf(c),a.setCurrentContentGroupIndex(g),this.focusCurrentContentGroup()},this.focusCurrentContentGroup=function(){b.find(".lbInfoBox").removeClass("scrolling scrolled");var c=a.getCurrentContentGroupIndex(),d=this.getContentGroupId(c),e=a.getContentGroupPositions()[d];if(e){var f=a.getNodeByContentGroupId(d),g=f.find(".lbInfoBox").addClass("scrolling");i=!0,a.animateScrollTo(e.top,function(){i=!1,g.removeClass("scrolling").addClass("scrolled")}.bind(this))}},this.getContentGroupId=function(a){return this.getCurrentTabIds()[a]},this.getCurrentTabIds=function(){return a.getLbType()==a.SPACE_TYPE?d:e},this.getCurrentTabsNode=function(){var b=a.getLbType();return c.find("."+b)},this.hasVisibleContent=function(a){var b=a.children(),c=!1;return b.each(function(){var a=$(this),b=a.hasClass("hidden");if(!a.is(":empty")&&!b)return c=!0,!1;c=!1}),c}},HZ.lb.plugins.SpaceAuthorInfo=function(){var a,b,c,d=HZ.lb.Config.contentGroupIds.OVERVIEW;this.setOwner=function(b){a=b,c=$('<section class="space-owner"></section>'),a.addInfoBoxToContentGroup(c.get(0),"spaceAuthorInfo",d)},this.imageDataUpdated=function(){this.imageChanged()},this.imageChanged=function(){if(c.empty(),!a.isProListAd()){b=a.getCurrentSpace();var d,e=b.ow,f=HZ.data.Users.get(e);if(f){d=$('<div compid="photoOwner" class="row"></div>');var g=HZ.data.HouzzClkTracking.get(b.id),h=g&&g[e]?g[e]:null,i=HZ.ui.render.User.getUserImageHtml(e,!0,h,1),j=HZ.ui.render.User.getUserHtml(e,!0,h),k=!!parseInt(f.nr,10),l="",m="";k?l=HZ.lb.RenderUtils.renderProReview(f):m=HZ.ui.render.User.getProfessionalLocationHtml(f);var n={AVATAR:$("<div>").append($(i).addClass("trackMe")).html(),AUTHOR:$("<div>").append($(j).addClass("trackMe")).html(),LOCATION:m,PRO_REVIEWS:l};d.append($(HZ.utils.Html.template('<div class="col-xs-11"><div class="author-avatar">%AVATAR%</div><div class="author-details">%AUTHOR% %PRO_REVIEWS%%LOCATION%</div></div>',n)))}d&&c.append(d)}}},HZ.lb.plugins.SpaceInfo=function(){function a(a,b){return $.each(b,function(b,c){var d=$("<li>").append(c);a.append(d)}),a}var b,c,d=HZ.lb.Config.contentGroupIds.OVERVIEW;this.setOwner=function(a){b=a,c=$('<section class="lbInfoBox space-info trackMe" compid="lb_space_info"></section>'),b.addInfoBoxToContentGroup(c.get(0),"spaceInfo",d)},this.imageChanged=function(){if(c.empty(),!(b.isProduct()||b.isFullPageAd()||b.isSpotlightContext())){var d=b.getCurrentSpace(),e=b.getContext(),f=e.getType(),g=e.getDescriptor(),h=h?h.empty():$('<ul class="space-facets"></ul>'),i={tag:"a",attr:{href:HZ.utils.Links.getSpaceLink(d.id),target:"_blank",class:"hz-space"}},j=HZ.data.Galleries.get(g[HZ.lb.Config.DESCRIPTOR_FIELD_GALLERY_ID]),k=HZ.data.Projects.get(d.pid),l=j&&f==HZ.lb.Config.CONTEXT_TYPE_IDEABOOK,m=k&&f==HZ.lb.Config.CONTEXT_TYPE_PROJECT;c.toggleClass("space-info--project",m);var n=d.t?d.t:m?k.t:l?j.t:"";if(m){var o=e.getCursorPosition();n+=_hgt(" ({currentPhoto} of {totalPhotos})",{currentPhoto:o.cursor+1,totalPhotos:o.spacesCount})}var p=null;if(!b.isProduct()&&HZ.lb.Config.isViewPhotoH1SubtitleEnabled&&d.hasOwnProperty("stt")){var q=HZ.houseUtils.Permissions;p=!!q.hasPermission(d,q.CAN_EDIT_HOUSE)?_hgt("<t1><t2>{spaceTitle}</t2><t3>{spaceSubtitle}</t3></t1>",{t1:l?{}:i,t2:{tag:"span",attr:{class:"space-title--line"}},t3:{tag:"span",attr:{class:"space-title--line space-title--subtitle"}},spaceTitle:n,spaceSubtitle:d.stt}):_hgt("<t1>{spaceTitle}</t1><t2>{spaceSubtitle}</t2>",{t1:{tag:"span",attr:{class:"space-title--line"}},t2:{tag:"span",attr:{class:"space-title--line space-title--subtitle"}},spaceTitle:n,spaceSubtitle:d.stt})}else p=_hgt("<t1>{spaceTitle}</t1>",{t1:l?{}:i,spaceTitle:n});var r=HZ.utils.Html.template('<header>\t\t\t\t\t\t\t<h2 class="header-5 mbs">%TITLE%</h2>\t\t\t\t\t\t</header>',{TITLE:p});c.append(r);var s,t=[],u=HZ.lb.RenderUtils.renderBrowseStyleLink(d);u&&t.push(u);var v=HZ.lb.RenderUtils.renderBrowseLocationLink(d);if(v&&t.push(v),d.l&&d.tl){var w=_hgt("Website"),x=HZ.utils.Html.template('<a class="pro-ext-link text-primary" target="blank" href="%WEBSITE_URL%">%LINK_TEXT%<span class="more-icon"></span></a>',{WEBSITE_URL:d.tl,LINK_TEXT:w});t.push(x)}t.length&&(s=a(h,t),c.append(s));var y=b.getSpaceDescription();if(y){var z=$("<div>").append(UIHelper.convertLinksInString(y)).html(),A=$("<p class='space-description'></p>").append(z);c.append(A),A.peekable()}l&&c.append(HZ.lb.RenderUtils.renderIdeabookSpaceComment(d,j))}},this.imageDataUpdated=function(){this.imageChanged()}},HZ.lb.plugins.SpaceActions=new function(){var a,b,c,d,e,f;this.setOwner=function(g){function h(){var c=HZ.lb.Config.enableSaveBtnHeartIcon?'<button class="btn btn-primary med save" title="%TITLE_ATTR%"  compId="addToIdeabook"><i class="icon icon-font icon-heart"></i>%LABEL%</button>':'<button class="btn btn-primary med save" title="%TITLE_ATTR%"  compId="addToIdeabook"><i class="icon icon-font icon-plus"></i>%LABEL%</button>';b=$(HZ.utils.Html.template(c,{TITLE_ATTR:_hgt("Save To Ideabook"),LABEL:_hgt("Save")})),b.click(this.handleAddToIdeabook.bind(this)),e=b.find(".buzz-count");var d=b.get(0);a.addActionItem(d,HZ.lb.ActionBar.ACTION_BAR_CENTER)}function i(){var b=_hgt("Email{contextEmailVerb}",{contextEmailVerb:""}),c=$(HZ.utils.Html.template('<button class="btn med tint email" title="%TITLE_ATTR%" compId="sendEmail"><i class="icon icon-font icon-paper_plane"></i> %LABEL%</button>',{TITLE_ATTR:b,LABEL:b}));c.click(this.handleEmail.bind(this));var d=c.get(0);a.addActionItem(d,HZ.lb.ActionBar.ACTION_BAR_CENTER)}a=g,f=$(HZ.utils.Html.template('<button class="btn med tint download-file" title="%TITLE_ATTR%" compId="download_file"><i class="icon hzi-font hzi-Download-Lightbox"></i> %LABEL%</button>',{TITLE_ATTR:_hgt("Download this file"),LABEL:_hgt("Download")})),f.click(this.handleDownload.bind(this));var j=f.get(0);if(a.addActionItem(j,HZ.lb.ActionBar.ACTION_BAR_LEFT),HZ.lb.Config.sketchForWebEnabled)if(HZ.lb.Config.showSimpleVersionLightbox){var k={iconClass:"icon icon-font icon-pencil_drawing",label:_hgt("Edit Sketch"),compId:"editSketch",index:1,handler:this.handleEditSketch.bind(this)};d=a.addMoreMenuItem(k)}else{d=$(HZ.utils.Html.template('<button class="btn med tint edit-sketch" title="%TITLE_ATTR%" compId="editSketch"><i class="icon icon-font icon-pencil_drawing"></i> %LABEL%</button>',{LABEL:_hgt("Edit"),TITLE_ATTR:_hgt("Edit Sketch")})),d.click(this.handleEditSketch.bind(this));var l=d.get(0);a.addActionItem(l,HZ.lb.ActionBar.ACTION_BAR_CENTER)}if(i.call(this),h.call(this),HZ.lb.Config.sketchForWebEnabled)if(HZ.lb.Config.showSimpleVersionLightbox){var m={iconClass:"icon icon-font icon-pencil_drawing",label:_hgt("Sketch"),compId:"newSketch",index:1,handler:this.handleNewSketch.bind(this)};c=a.addMoreMenuItem(m)}else{c=$(HZ.utils.Html.template('<button class="btn med tint sketch keep-last" title="%TITLE_ATTR%" compId="newSketch"><i class="icon icon-font icon-pencil_drawing"></i> </button>',{TITLE_ATTR:_hgt("Create New Sketch")})),c.click(this.handleNewSketch.bind(this));var n=c.get(0);a.addActionItem(n,HZ.lb.ActionBar.ACTION_BAR_CENTER)}},this.imageChanged=function(){setTimeout(a.hideSpaceActions.bind(a),2500);var e=a.getCurrentSpace(),g=e&&e.ift;f.toggleClass("hidden",!g);var h=a.isSketch(),i=!h&&!a.isProduct();if(b.toggleClass("hidden",h),HZ.lb.Config.sketchForWebEnabled)if(c.toggleClass("hidden",!i),h){var j=HZ.data.CurrentSessionUser,k=j?j.getUserId():-1,l=j&&j.isIdeabookCollaborator,m=HZ.houseUtils.Permissions,n=!!m.hasPermission(e,m.CAN_EDIT_HOUSE),o=n||k==e.au||!!l;d.toggleClass("hidden",!o)}else d.toggleClass("hidden",!h)},this.handleAddToIdeabook=function(){var b=a.getCurrentSpace();if(a.isSignupMode())a.invokeSignupAndThenActionDialog(b,HZ.lb.Config.SOURCE_TRACKING_LB_ADDTOIBK,b.prod?HZ.lb.Config.SIGNUP_MSG_ADD_TO_IDEABOOK:HZ.lb.Config.SIGNUP_MSG_ADD_TO_IDEABOOK_PHOTO,"ideabook");else{var c=b.id;HZ.spaceActions.isUniversalGalleryEnabled||HZ.ctx&&HZ.ctx.config&&HZ.ctx.config.GALLERY_ITEMS_ENABLED?HZ.spaceActions.showAddToIdeabookDialog(c):(HZ.spaceActions.AddToIdeabookDialog.init(c),a.showDialog(HZ.spaceActions.AddToIdeabookDialog))}},this.handleEmail=function(){var b=a.getCurrentSpace();a.isSignupMode()&&HZ.lb.Config.emailShareAfterSignup?a.invokeSignupAndThenActionDialog(b,HZ.lb.Config.SOURCE_LINK_SPACEACTIONS_EMAIL,HZ.lb.Config.SIGNUP_MSG_SPACE_ACTIONS_EMAIL,"email"):(HZ.dialogs.EmailDialog.prepare({type:HZ.sendEmail.types.SPACE,referenceId:b.id,subject:b.t,message:b.prod?HZ.sendEmail.texts.DEFAULT_MESSAGE_PRODUCT:HZ.sendEmail.texts.DEFAULT_MESSAGE_SPACE,staticMessageData:!(!b.prod||!HZ.lb.Config.tradeUser)&&HZ.lb.Config.tradeUser,signupOnSend:!HZ.lb.Config.emailShareAfterSignup}),HZ.dialogs.EmailDialog.setVerticallyCentered(!0),a.showDialog(HZ.dialogs.EmailDialog))},this.handleNewSketch=function(){var b=a.getCurrentSpace(),c=HZ.utils.Config.sketchUrl+"?canvasId="+b.id,d=JSON.stringify({houseId:b.id,redirectUrl:c,buttonType:"newSketch"});a.isSignupMode()?HZ.ajaz.Services.setVisitorProperty("postSignupHouseId",d,function(b){a.showLoginDialog(HZ.lb.Config.SIGNUP_TRACKING_OTHER,HZ.lb.Config.MESSAGE_ID_DEFAULT,null)}):window.open(c)},this.handleEditSketch=function(){var b=a.getCurrentSpace();window.open(HZ.utils.Config.sketchUrl+"/"+b.id)},this.handleEmbed=function(){var b=a.getCurrentSpace();HZ.spaceActions.EmbedDialog.setSpaceId(b.id),a.showDialog(HZ.spaceActions.EmbedDialog)},this.handleEdit=function(){var b=a.getCurrentSpace();if(b)if(a.lightboxEditorEnabled){var c=HZ.houseUtils.Permissions,d=c.hasPermission(b,c.CAN_EDIT_HOUSE);if(!d)return!1;0==HZ.lb.Utils.lightboxEditorLoaded?HZ.lb.Utils.loadLightboxEditor(!0,!1):(a.setEditMode(!0),a.refresh(!1),a.handleResize())}else{var e=HZ.utils.Links.getEditSpaceLink(b.id);window.open(e)}},this.handleImageTag=function(){var b=a.getCurrentSpace();if(b)if(a.lightboxEditorEnabled){var c=HZ.houseUtils.Permissions,d=c.hasPermission(b,c.CAN_EDIT_HOUSE);if(!d)return!1;0==HZ.lb.Utils.lightboxEditorLoaded?HZ.lb.Utils.loadLightboxEditor(!0,!0):(a.setEditTagMode(!0),a.refresh(!1),a.handleResize())}else{var e=HZ.utils.Links.getEditSpaceLink(b.id);window.open(e)}},this.handlePrint=function(){if(a.isSignupMode())a.showLoginDialog();else{var b=a.getCurrentSpace(),c=UIHelper.isMSIE;HZ.utils.Print.printSpace(b.id,c)}},this.handleDownload=function(){var b=a.getCurrentSpace();b&&b.ift&&HZ.ajaz.Services.getDownloadUrl(b.id,function(a){window.location.href=a.dl})},this.handleAddToCart=function(){var b=a.getCurrentSpace(),c=HZ.data.ListingsInfo.get(a.getSelectedListingId()),d=c.lid,e=$("#qtySelector").val()||1;HZ.cart.Actions.addItem(b.id,d,e)},this.handleAddSampleToCart=function(b){var c=$(b.currentTarget),d=a.getCurrentSpace(),e=c.data("vlid");e&&HZ.cart.Actions.addItem(d.id,e,1)},this.handleVisitStoreClicked=function(){var b=a.getCurrentSpace(),c=b.tl,d=HZ.utils.Links.getSpaceLink(b.id),e=HZ.data.PPCAds.get(b.id),f=HZ.lb.Config.SIGNUP_TRACKING_LB_VISIT_STORE;e&&e.isPPCProduct&&e.ppcProductUrl?(c=e.ppcProductUrl,window.open(c)):c&&(a.isSignupMode()?HZ.auth.Manager.signup(f,HZ.lb.Config.SIGNUP_MSG_PRODUCT_INFO,d,null,{rvent:HZ.lb.Config.SIGNUP_TRACKING_VISIT_STORE_CLICKS}):window.open(c))}},HZ.lb.plugins.ProjectInfo=function(){var a,b,c,d,e,f=HZ.lb.Config.contentGroupIds.OVERVIEW;this.setOwner=function(c){a=c,b=$('<section compid="lbProjectPhotos" class="lbInfoBox photosInProject separator"></section>'),a.addInfoBoxToContentGroup(b.get(0),"projectInfo",f),b.on("click",".project-thumb",this.handleProjectThumbClick.bind(this)),b.on("click",".btn-expand",this.handleExpandClick.bind(this))},this.imageDataUpdated=function(){this.imageChanged()},this.imageChanged=function(){e!=a.getCurrentSpaceProject()&&(e=a.getCurrentSpaceProject(),d=!1);var f=a.getCurrentSpace(),g=e?e.count:0,h=g?g-1:0,i=!(a.isRecommendationsContext()||a.isFullPageAd()||a.isEditMode()||a.isSpotlightContext()),j=a.isProjectContext();if(b.empty(),i&&e&&e.sids&&e.sids.length){var k,l=HZ.lb.Utils.calculateThumbWidth(a.getContentBox().w-32,5,8),m=l,n=l,o=[],p=e.sids,q=!1,r=0;if(j)k=p.slice(0,d?p.length:25),r=e.count-25,q=!d&&r>0;else{var s={tag:"a",attr:{href:e.link,class:"text-primary",target:"_blank"}},t=e.t==f.t?_hgt("This Project{contextLightboxProject}",{contextLightboxProject:""}):e.t,u=_hgtp("<t1>{projectTitle}</t1>","Other Photo in <t1>{projectTitle}</t1>","Other Photos in <t1>{projectTitle}</t1>",h,{t1:s,projectTitle:t,photoCount:g-1});k=p.filter(function(a){return a!=f.id}),k=k.slice(0,5);var v=$(HZ.lb.RenderUtils.renderSectionHeader(u)).removeClass("section-header").addClass("mbm");b.append(v)}var w=-1;k.forEach(function(a,b){var c=HZ.data.Spaces.get(a);if(c){var d=HZ.utils.Links.getSpaceImageUrl(a,m,n,c.bg),e=HZ.utils.Links.getSpaceLink(a),g={SPACE_ID:a,SPACE_DESC:c,INDEX:"",IMG_SRC:d,WIDTH:m,HEIGHT:n,CLICK_URL:e};j&&a==f.id&&(w=b),o.push(g)}});var x=$(HZ.lb.RenderUtils.renderThumbGrid(5,o,"project-thumb",HZ.lb.Templates.SIMPLE_THUMB,"lb_project_spaces"));b.append(x),q&&(c=$(HZ.utils.Html.template('<button class="btn btn-block btn-expand mtl mbs text-m">%LABEL%<span class="more-icon"></span></button>',{LABEL:_hgtp("","Show 1 More Photo","Show {remainingPhotoCount} More Photos",r,{remainingPhotoCount:r})})),b.append(c)),w>=0&&x.children().eq(w).addClass("project-thumb--current")}},this.handleProjectThumbClick=function(b){if(!b.ctrlKey&&!b.metaKey){b.preventDefault();var c=$(b.currentTarget),d=c.data("space-desc"),f=d.id,g=e.pid,h=e.sids,i=Math.max(h.indexOf(f),0);if(a.isProjectContext())a.getContext().setCurrentSpaceId(f);else{var j={};j[HZ.lb.Config.DESCRIPTOR_FIELD_PROJECT_ID]=g,j[HZ.lb.Config.DESCRIPTOR_FIELD_CATEGORY]=a.getCurrentSpace().cat;var k=new HZ.lb.Context("project_"+g,HZ.lb.Config.CONTEXT_TYPE_PROJECT,j,h,e.count,i+1,h.length);k.setCurrentSpaceId(f),a.pushContext(k)}a.refresh()}},this.handleExpandClick=function(a){d=!0,c.addClass("hidden"),this.imageChanged()}},HZ.lb.plugins.ProductsInRoom=function(){var a,b,c,d,e=HZ.lb.Config.contentGroupIds.INFO,f=_hgt("Photos with this (or similar) product:");this.setOwner=function(d){a=d,b=$('<section compId="lbProductsInRoom" class="trackMe lbInfoBox productsInRoom separator"></section>'),c=b.get(0),a.addInfoBoxToContentGroup(c,"productsInRoom",e),$(c).click(this.handleProductsInRoomDivClicked)},this.imageDataUpdated=function(){this.imageChanged()},this.imageChanged=function(){var c=a.getCurrentSpace(),e=a.isRecommendationsContext()||a.isFullPageAd()||a.isSpotlightContext();if(d=HZ.data.ProductsInRoom.get(c.id),b.empty(),a.isProduct()&&!e){var g=a.getContextStack(),h=null;g.length>=2&&(h=g[1].getCurrentSpaceId());var i=0;if(d&&d.count>1){for(var j=HZ.lb.Utils.calculateThumbWidth(a.getContentBox().w-32,5,8),k=j,l=j,m=[],n=d.sids,o=n.length,p=0;p<o;p++)if(i<5){var q=n[p];if(q!=h){var r=HZ.utils.Links.getSpaceImageUrl(q,k,l),s=HZ.utils.Links.getSpaceLink(q);m.push({SPACE_ID:q,INDEX:i,IMG_SRC:r,WIDTH:k,HEIGHT:l,CLICK_URL:s}),i++}}i&&(b.append(HZ.lb.RenderUtils.renderSectionHeader(f)),b.append(HZ.lb.RenderUtils.renderThumbGrid(5,m,"products-in-room",HZ.lb.Templates.SIMPLE_THUMB)))}}},this.handleProductsInRoomDivClicked=function(b){if(!(b.ctrlKey||b.metaKey||HZ.lb.Config.isViewSpace)){b.preventDefault();var c=a.getCurrentSpace(),e=$(b.target);if(e.attr("s")||(e=e.closest("li")),e.attr("s")&&d.count>1){var f=parseInt(e.attr("s")),g=parseInt(e.attr("i")),h={};h[HZ.lb.Config.DESCRIPTOR_FIELD_SPACE_ID]=c.id;var i=new HZ.lb.Context("productsInRoom_"+c.id,HZ.lb.Config.CONTEXT_TYPE_PRODUCTS_IN_ROOM,h,d.sids,d.count,g+1,-1);i.setCurrentSpaceId(f),a.pushContext(i),a.refresh()}}}},HZ.lb.plugins.ProductRelatedProducts=function(){var a,b,c,d=HZ.lb.Config.contentGroupIds.INFO;this.setOwner=function(e){a=e,b=$('<section class="lbInfoBox product-rel-prod separator trackMe" compId="lbProductRelatedProducts"></section>'),c=b.get(0),a.addInfoBoxToContentGroup(c,"productRelatedProducts",d),b.click(HZ.lb.plugins.PhotoRelatedProducts.handleClick)},this.imageDataUpdated=function(){this.imageChanged()},this.imageChanged=function(){b.empty(),a.isMarketplaceProduct()&&!(a.isRecommendationsContext()||a.isFullPageAd()||a.isSpotlightContext())&&(HZ.lb.plugins.PhotoRelatedProducts.setPhotoData(),this.renderContent())},this.renderContent=function(){HZ.lb.plugins.PhotoRelatedProducts.canRender()&&b.append(HZ.lb.plugins.PhotoRelatedProducts.generateContent(4,16,!0))}},HZ.lb.plugins.PPCProductRelatedProducts=function(){var a,b,c,d=HZ.lb.Config.contentGroupIds.PRODUCTS;this.setOwner=function(e){a=e,b=$('<section class="lbInfoBox product-rel-prod separator trackMe" compId="lbProductRelatedProducts"></section>'),c=b.get(0),a.addInfoBoxToContentGroup(c,"productRelatedProducts",d),b.click(HZ.lb.plugins.PhotoRelatedProducts.handleClick)},this.imageDataUpdated=function(){this.imageChanged()},this.imageChanged=function(){b.empty(),a.getCurrentSpace().fullyLoaded&&a.isProduct()&&!a.isMarketplaceProduct()&&!(a.isRecommendationsContext()||a.isFullPageAd()||a.isSpotlightContext())&&(HZ.lb.plugins.PhotoRelatedProducts.setPhotoData(),this.renderContent())},this.renderContent=function(){HZ.lb.plugins.PhotoRelatedProducts.canRender()&&b.append(HZ.lb.plugins.PhotoRelatedProducts.generateContent(4,16,!0))}},HZ.lb.plugins.SpaceRelatedProducts=function(){var a,b,c,d=HZ.lb.Config.isViewSpace?HZ.lb.Config.contentGroupIds.OVERVIEW:HZ.lb.Config.contentGroupIds.PRODUCTS;this.setOwner=function(e){a=e,b=$('<section class="lbInfoBox space-rel-prod separator trackMe" compId="lbSpaceRelatedProducts"></section>'),c=b.get(0),a.addInfoBoxToContentGroup(c,"spaceRelatedProducts",d),b.click(HZ.lb.plugins.PhotoRelatedProducts.handleClick)},this.imageDataUpdated=function(){this.imageChanged()},this.imageChanged=function(){b.empty();var c=!(a.isRecommendationsContext()||a.isFullPageAd()||a.isColorPickerSavedPalette()||a.isProductAd()||a.isSpotlightContext());!a.isProduct()&&c&&(HZ.lb.plugins.PhotoRelatedProducts.setPhotoData(),this.renderContent())},this.renderContent=function(){HZ.lb.plugins.PhotoRelatedProducts.canRender()&&b.append(HZ.lb.plugins.PhotoRelatedProducts.generateContent(4,8,!0))}},HZ.lb.plugins.PhotoRelatedProducts=new function(){var a,b,c,d=!1;this.setOwner=function(b){a=b},this.setPhotoData=function(){b=a.getCurrentSpace(),c=HZ.data.PhotoRelatedProducts.get(b.id),d=!1},this.isDataLoaded=function(){return c&&c.count>1},this.canRender=function(){return this.isDataLoaded()&&!this.isRendered()},this.isRendered=function(){return d},this.generateContent=function(b,e,f,g){var h=$("<div></div>");if(g=g||{},this.isDataLoaded()){var i=HZ.lb.Utils.calculateThumbWidth(a.getContentBox().w-32,b,8),j=i,k=i,l=g.headerText?g.headerText:_hgt("Related Products");h.append(HZ.lb.RenderUtils.renderSectionHeader(l));for(var m=[],n=g.spaceIds?g.spaceIds:c.sids,o=Math.min(n.length,e),p=0;p<o;p++){var q=n[p],r=HZ.data.Spaces.get(q),s=r.stl,t=r.price,u=s?HZ.lb.Templates.THUMB_META_T_TEMPLATE:HZ.lb.Templates.THUMB_META_TEMPLATE,v=HZ.utils.Links.getSpaceImageUrl(q,j,k),w=HZ.utils.Links.getSpaceLink(q),x=f?HZ.utils.Html.template(u,{PRICE:t,STITLE:s}):"";m.push({SPACE_ID:q,INDEX:0,IMG_SRC:v,WIDTH:j,HEIGHT:k,CLICK_URL:w,THUMB_META:x,OVERLAY_TEXT:_hgt("Shop Houzz")})}h.append(HZ.lb.RenderUtils.renderThumbGrid(b,m,"related-product",HZ.lb.Templates.PRODUCT_THUMB)),d=!0}return h.html()},this.handleClick=function(d){if(!(d.ctrlKey||d.metaKey||HZ.lb.Config.isViewSpace)){d.preventDefault();var e=$(d.target);if(e.attr("s")||(e=e.closest("li")),e.attr("s")&&c.count>1){var f=parseInt(e.attr("s")),g=parseInt(e.attr("i")),h={};h[HZ.lb.Config.DESCRIPTOR_FIELD_SPACE_ID]=b.id;var i=new HZ.lb.Context("photoRelatedProducts_"+b.id,HZ.lb.Config.CONTEXT_TYPE_PHOTO_RELATED_PRODUCTS,h,c.sids,c.count,g+1,-1);i.setCurrentSpaceId(f),a.pushContext(i),a.refresh()}}}},HZ.lb.plugins.CoBuyProducts=function(){var a,b,c,d,e=HZ.lb.Config.contentGroupIds.INFO;this.setOwner=function(d){a=d,b=$('<section class="lbInfoBox cobuy-prod separator trackMe" compId="lbCoBuyProducts"></section>'),c=$(HZ.lb.RenderUtils.renderSectionHeader(_hgt("Frequently Bought Together"))),a.addInfoBoxToContentGroup(b.get(0),"coBuyProducts",e),b.on("click",".thumb",this.handleThumbClick.bind(this))},this.imageDataUpdated=function(){this.imageChanged()},this.imageChanged=function(){d={},b.empty();var c=a.isMarketplaceProduct()&&!(a.isRecommendationsContext()||a.isFullPageAd()||a.isSpotlightContext()||a.isColorPickerSavedPalette()||a.isProductAd()),e=HZ.data.CoBuySpaces.get(a.getCurrentSpace().id);e&&e.length&&c&&this.renderContent()},this.renderContent=function(){b.empty().append(c);var e=HZ.lb.Utils.calculateThumbWidth(a.getContentBox().w-32,4,8),f=e,g=e,h=[];this.iterateCoBuySpaces(function(a,b){var c=HZ.data.Spaces.get(a);if(c){d[a]=b;var e=c.stl,i=e?HZ.lb.Templates.THUMB_META_T_TEMPLATE:HZ.lb.Templates.THUMB_META_TEMPLATE,j=HZ.utils.Links.getSpaceImageUrl(a,f,g),k=HZ.utils.Links.getSpaceLink(a),l=$(HZ.utils.Html.template(i,{PRICE:c.price||"&nbsp;",STITLE:e})),m=$(HZ.lb.RenderUtils.renderBrowseCategoryLink(c)).addClass("space-cat-link"),n=$('<div class="space-cat"></div>');n.append(m),l.append(n);var o=$("<div></div>").append(l).html();h.push({SPACE_ID:a,INDEX:b,IMG_SRC:j,WIDTH:f,HEIGHT:g,CLICK_URL:k,THUMB_META:o,OVERLAY_TEXT:_hgt("Shop Houzz"),SPACE_DESC:c})}}),b.append(HZ.lb.RenderUtils.renderThumbGrid(4,h,"related-product related-product-cobuy",HZ.lb.Templates.PRODUCT_THUMB))},this.iterateCoBuySpaces=function(b){var c=HZ.data.CoBuySpaces.get(a.getCurrentSpace().id);c=c.slice(0,4),c.forEach(b)},this.handleThumbClick=function(b){if(!(b.ctrlKey||b.metaKey||$(b.target).is(".space-cat-link")||HZ.lb.Config.isViewSpace)){b.preventDefault()
;var c=HZ.data.CoBuySpaces.get(a.getCurrentSpace().id),e=$(b.currentTarget),f=e.data("space-desc"),g=f.id,h=d[g],i={};i[HZ.lb.Config.DESCRIPTOR_FIELD_SPACE_ID]=g;var j=new HZ.lb.Context("photoRelatedProducts_"+g,HZ.lb.Config.CONTEXT_TYPE_PHOTO_RELATED_PRODUCTS,i,c,c.length,h+1,-1);j.setCurrentSpaceId(g),a.pushContext(j),a.refresh()}}},HZ.lb.plugins.VisuallySimilarProducts=function(){var a,b,c,d,e=HZ.lb.Config.contentGroupIds.INFO;this.setOwner=function(c){a=c,b=$('<section class="lbInfoBox visually-similar-prod separator trackMe" compId="lbVisuallySimilarProducts"></section>'),a.addInfoBoxToContentGroup(b.get(0),"visuallySimilarProducts",e),b.click(this.handleClick)},this.imageDataUpdated=function(){this.imageChanged()},this.imageChanged=function(){d={},b.empty();var e=a.isMarketplaceProduct()&&!(a.isRecommendationsContext()||a.isFullPageAd()||a.isSpotlightContext()||a.isColorPickerSavedPalette()||a.isProductAd());(c=HZ.data.VisuallySimilarSpaces.get(a.getCurrentSpace().id))&&c.length&&e&&(HZ.lb.plugins.PhotoRelatedProducts.setPhotoData(),this.renderContent(c))},this.renderContent=function(a){HZ.lb.plugins.PhotoRelatedProducts.canRender()&&b.append(HZ.lb.plugins.PhotoRelatedProducts.generateContent(4,4,!0,{headerText:_hgt("Visually Similar Products"),spaceIds:a}))},this.handleClick=function(b){if(!(b.ctrlKey||b.metaKey||HZ.lb.Config.isViewSpace)){b.preventDefault();var d=$(b.target),e=a.getCurrentSpace();if(d.attr("s")||(d=d.closest("li")),d.attr("s")&&c.length>1){var f=parseInt(d.attr("s")),g=parseInt(d.attr("i")),h={};h[HZ.lb.Config.DESCRIPTOR_FIELD_SPACE_ID]=e.id;var i=new HZ.lb.Context("photoRelatedProducts_"+e.id,HZ.lb.Config.CONTEXT_TYPE_PHOTO_RELATED_PRODUCTS,h,c,c.length,g+1,-1);i.setCurrentSpaceId(f),a.pushContext(i),a.refresh()}}}},HZ.lb.plugins.RecentlyViewedProducts=function(){var a,b,c,d,e=HZ.lb.Config.contentGroupIds.DISCUSSION;this.setOwner=function(c){a=c,b=$('<section class="lbInfoBox recently-viewed-prod separator trackMe" compId="lbRecentlyViewedProducts"></section>'),a.addInfoBoxToContentGroup(b.get(0),"recentlyViewedProducts",e),b.click(this.handleClick)},this.imageDataUpdated=function(){this.imageChanged()},this.imageChanged=function(){d={},b.empty();var e=a.isMarketplaceProduct()&&!(a.isRecommendationsContext()||a.isFullPageAd()||a.isSpotlightContext()||a.isColorPickerSavedPalette()||a.isProductAd());(c=HZ.data.RecentlyViewedSpaces.get(a.getCurrentSpace().id))&&c.length&&e&&(HZ.lb.plugins.PhotoRelatedProducts.setPhotoData(),this.renderContent(c))},this.renderContent=function(a){var c=HZ.lb.Config.recommendForRecentlyViewed?_hgt("Recently Viewed and Recommendations"):_hgt("Recently Viewed");HZ.lb.plugins.PhotoRelatedProducts.canRender()&&b.append(HZ.lb.plugins.PhotoRelatedProducts.generateContent(4,16,!0,{headerText:c,spaceIds:a}))},this.handleClick=function(b){if(!(b.ctrlKey||b.metaKey||HZ.lb.Config.isViewSpace)){b.preventDefault();var d=$(b.target),e=a.getCurrentSpace();if(d.attr("s")||(d=d.closest("li")),d.attr("s")&&c.length>1){var f=parseInt(d.attr("s")),g=parseInt(d.attr("i")),h={};h[HZ.lb.Config.DESCRIPTOR_FIELD_SPACE_ID]=e.id;var i=new HZ.lb.Context("photoRelatedProducts_"+e.id,HZ.lb.Config.CONTEXT_TYPE_PHOTO_RELATED_PRODUCTS,h,c,c.length,g+1,-1);i.setCurrentSpaceId(f),a.pushContext(i),a.refresh()}}}},HZ.lb.plugins.ProductCollections=function(){var a,b,c,d,e,f,g=HZ.lb.Config.contentGroupIds.INFO;this.setOwner=function(c){a=c,b=$('<section class="lbInfoBox product-collections separator trackMe" compId="lbProductCollections"></section>'),a.addInfoBoxToContentGroup(b.get(0),"productCollections",g),b.on("click",".thumb",this.handleThumbClick.bind(this))},this.imageDataUpdated=function(){this.imageChanged()},this.imageChanged=function(){b.empty(),d={},this.renderContent()},this.renderContent=function(){b.empty();var g=a.getCurrentSpace(),h=HZ.data.ProductCollections.get(g.id);if(h&&h.collectionSpaceIds){var i=h.collectionSpaceIds,j=HZ.lb.Utils.calculateThumbWidth(a.getContentBox().w-32,4,8);e=j,f=j;var k={tag:"a",attr:{href:h.viewCollectionUrl,class:"colorLink"}};c=$(HZ.lb.RenderUtils.renderSectionHeader(_hgt("More from the <t1>{collection} Collection</t1> by {curator}",{t1:k,collection:h.collectionName,curator:h.collectionCurator})));var l=[];i.slice(0,8).forEach(function(a,b){var c=HZ.data.Spaces.get(a);if(c){d[a]=b;var g=HZ.data.ProductsInfo.get(a),h=HZ.utils.Links.getSpaceImageUrl(a,e,f),i=HZ.utils.Links.getSpaceLink(a),j=c.price?c.price:g&&g.p?g.p:"&nbsp;",k=$(HZ.utils.Html.template(HZ.lb.Templates.THUMB_META_TEMPLATE,{PRICE:j})),m=$("<div></div>").append(k).html();l.push({SPACE_ID:a,INDEX:b,IMG_SRC:h,WIDTH:e,HEIGHT:f,CLICK_URL:i,THUMB_META:m,OVERLAY_TEXT:_hgt("Shop Houzz"),SPACE_DESC:c})}}),l&&l.length>0&&(b.append(c),b.append(HZ.lb.RenderUtils.renderThumbGrid(4,l,"production-collections-product",HZ.lb.Templates.PRODUCT_THUMB)))}},this.handleThumbClick=function(b){if(!(b.ctrlKey||b.metaKey||HZ.lb.Config.isViewSpace)){b.preventDefault();var c=a.getCurrentSpace(),e=HZ.data.ProductCollections.get(c.id);if(!e)return;var f=e.collectionSpaceIds,g=$(b.currentTarget),h=g.data("space-desc"),i=h.id,j=d[i],k={};k[HZ.lb.Config.DESCRIPTOR_FIELD_SPACE_ID]=i;var l=new HZ.lb.Context("productCollections_"+i,HZ.lb.Config.CONTEXT_TYPE_PRODUCT_COLLECTIONS,k,f,f.length,j+1,-1);l.setCurrentSpaceId(i),a.pushContext(l),a.refresh()}}},HZ.lb.plugins.SpaceRecommendations=function(){var a,b,c,d=HZ.lb.Config.contentGroupIds.OVERVIEW,e=HZ.lb.Config.enableCombinedRecommendPhotos?10:5;this.setOwner=function(e){a=e,b=$('<section class="lbInfoBox recommendations-spaces separator trackMe" compId="lbSpaceRecommendations"></section>'),c=b.get(0),a.addInfoBoxToContentGroup(c,"recommendationsSpaces",d),b.click(this.handleClick)},this.handleClick=function(a){HZ.lb.plugins.PhotoRecommendations.setDataCollection(HZ.data.Recommendations),HZ.lb.plugins.PhotoRecommendations.handleClick.call(HZ.lb.plugins.PhotoRecommendations,a)},this.imageDataUpdated=function(){this.imageChanged()},this.imageChanged=function(){b.empty();var c=a.isRecommendationsContext()||a.isSpotlightContext()||a.isProjectContext()||a.getContextType()==HZ.lb.Config.CONTEXT_TYPE_IMAGE_TAGS;a.isProduct()||c||(HZ.lb.plugins.PhotoRecommendations.setDataCollection(HZ.data.Recommendations),HZ.lb.plugins.PhotoRecommendations.setPhotoData(),this.renderContent())},this.renderContent=function(){HZ.lb.plugins.PhotoRecommendations.canRender()&&b.append(HZ.lb.plugins.PhotoRecommendations.generateContent(5,e,"photo"))}},HZ.lb.plugins.ProductRecommendations=function(){var a,b,c,d=HZ.lb.Config.contentGroupIds.OVERVIEW;this.setOwner=function(e){a=e,b=$('<section class="lbInfoBox recommendations-products separator trackMe" compId="lbProductRecommendations"></section>'),c=b.get(0),a.addInfoBoxToContentGroup(c,"recommendationsProducts",d),b.click(this.handleClick)},this.handleClick=function(a){HZ.lb.plugins.PhotoRecommendations.setDataCollection(HZ.data.Recommendations),HZ.lb.plugins.PhotoRecommendations.handleClick.call(HZ.lb.plugins.PhotoRecommendations,a)},this.imageDataUpdated=function(){this.imageChanged()},this.imageChanged=function(){b.empty();var c=a.isRecommendationsContext()||a.getContextType()==HZ.lb.Config.CONTEXT_TYPE_IMAGE_TAGS;a.isProduct()&&!c&&(HZ.lb.plugins.PhotoRecommendations.setDataCollection(HZ.data.Recommendations),HZ.lb.plugins.PhotoRecommendations.setPhotoData(),this.renderContent())},this.renderContent=function(){HZ.lb.plugins.PhotoRecommendations.canRender()&&b.append(HZ.lb.plugins.PhotoRecommendations.generateContent(5,5,"product"))}},HZ.lb.plugins.ProductRecommendedProducts=function(){var a,b,c,d=HZ.lb.Config.contentGroupIds.INFO;this.setOwner=function(e){a=e,b=$('<section class="lbInfoBox product-rel-prod separator trackMe" compId="lbProductRecommendationsProduct"></section>'),c=b.get(0),a.addInfoBoxToContentGroup(c,"productRelatedProducts",d),b.click(this.handleClick)},this.handleClick=function(a){HZ.lb.plugins.PhotoRecommendations.setDataCollection(HZ.data.Recommendations),HZ.lb.plugins.PhotoRecommendations.handleClick.call(HZ.lb.plugins.PhotoRecommendations,a)},this.imageDataUpdated=function(){this.imageChanged()},this.imageChanged=function(){b.empty();var c=a.isRecommendationsContext()||a.isFullPageAd()||a.isSpotlightContext();a.isProduct()&&!c&&(HZ.lb.plugins.PhotoRecommendations.setDataCollection(HZ.data.Recommendations),HZ.lb.plugins.PhotoRecommendations.setPhotoData(),this.renderContent())},this.renderContent=function(){HZ.lb.plugins.PhotoRecommendations.canRender()&&b.append(HZ.lb.plugins.PhotoRecommendations.generateContent(4,8,"product"))}},HZ.lb.plugins.RelatedPhotos=function(){var a,b,c,d=HZ.lb.Config.showRelSpacesBelowSponsProd?HZ.lb.Config.contentGroupIds.PRODUCTS:HZ.lb.Config.contentGroupIds.OVERVIEW;this.setOwner=function(e){a=e,b=$('<section class="lbInfoBox similar-spaces separator trackMe" compId="lbSimilarSpaces"></section>'),c=b.get(0),a.addInfoBoxToContentGroup(c,"relatedPhotos",d),$(c).click(this.handleClick)},this.handleClick=function(a){HZ.lb.plugins.PhotoRecommendations.setDataCollection(HZ.data.SimilarSpaces),HZ.lb.plugins.PhotoRecommendations.handleClick.call(HZ.lb.plugins.PhotoRecommendations,a)},this.imageDataUpdated=function(){this.imageChanged()},this.imageChanged=function(){b.empty();var c=a.isFullPageAd()||a.isRecommendationsContext()||a.isSpotlightContext()||a.isProjectContext()||a.getContextType()==HZ.lb.Config.CONTEXT_TYPE_IMAGE_TAGS;a.isProduct()||c||(HZ.lb.plugins.PhotoRecommendations.setDataCollection(HZ.data.SimilarSpaces),HZ.lb.plugins.PhotoRecommendations.setPhotoData(),this.renderContent())},this.renderContent=function(){HZ.lb.plugins.PhotoRecommendations.canRender()&&b.append(HZ.lb.plugins.PhotoRecommendations.generateContent(5,5,"photo"))}},HZ.lb.plugins.PhotoRecommendations=new function(){var a,b,c=!1;this.setOwner=function(b){a=b},this.setDataCollection=function(a){this.dataCollection=a},this.setPhotoData=function(){b=a.getCurrentSpace(),this.recommendations=this.dataCollection?this.dataCollection.get(b.id):{sids:[],count:0},c=!1},this.isDataLoaded=function(){return this.recommendations&&this.recommendations.sids.length>1},this.canRender=function(){return this.isDataLoaded()&&!this.isRendered()},this.isRendered=function(){return c},this.generateContent=function(b,d,e){var f=0,g=$("<div></div>");if(this.itemType=e,this.isDataLoaded()){var h,i="",j=this.recommendations.sids,k=j.length;switch(e){case"photo":switch(this.dataCollection){case HZ.data.Recommendations:h=HZ.lb.Config.enableCombinedRecommendPhotos?_hgtp("","Similar Idea","Similar Ideas",k):_hgtp("","People also liked this photo","People also liked these photos",k);break;case HZ.data.SimilarSpaces:h=_hgt("Related Photos")}i="recommended-space";break;case"product":h=_hgt("People who liked this also liked"),i="related-product"}g.append(HZ.lb.RenderUtils.renderSectionHeader(h));for(var l=HZ.lb.Utils.calculateThumbWidth(a.getContentBox().w-32,b,8),m=l,n=l,o=[],p=Math.min(d,k),q=0;q<p;q++){var r=j[q],s=HZ.data.Spaces.get(r),t=HZ.utils.Links.getSpaceLink(r),u=HZ.utils.Links.getSpaceImageUrl(r,m,n,s.bg);if("photo"==e)o.push({SPACE_ID:r,INDEX:f,IMG_SRC:u,WIDTH:m,HEIGHT:n,CLICK_URL:t});else if("product"==e){var v=s.price,w=s.stl,x=w?HZ.lb.Templates.THUMB_META_T_TEMPLATE:HZ.lb.Templates.THUMB_META_TEMPLATE,y=HZ.utils.Html.template(x,{PRICE:v,STITLE:w});o.push({SPACE_ID:r,INDEX:f,IMG_SRC:u,WIDTH:m,HEIGHT:n,CLICK_URL:t,THUMB_META:y,OVERLAY_TEXT:_hgt("Shop Houzz")})}f++}"photo"==e?g.append(HZ.lb.RenderUtils.renderThumbGrid(b,o,i,HZ.lb.Templates.SIMPLE_THUMB)):"product"==e&&g.append(HZ.lb.RenderUtils.renderThumbGrid(b,o,i,HZ.lb.Templates.PRODUCT_THUMB)),c=!0}return g.html()},this.handleClick=function(c){if(!(c.ctrlKey||c.metaKey||HZ.lb.Config.isViewSpace)){c.preventDefault();var d=$(c.target);if(d.attr("s")||(d=d.closest("li")),this.recommendations=this.dataCollection?this.dataCollection.get(b.id):{sids:[],count:0},d.attr("s")&&this.recommendations.count>1){var e=parseInt(d.attr("s")),f=parseInt(d.attr("i")),g={};if(g[HZ.lb.Config.DESCRIPTOR_FIELD_SPACE_ID]=b.id,"photo"==this.itemType)var h=new HZ.lb.Context("recommendations_"+b.id,HZ.lb.Config.CONTEXT_TYPE_SPACE_RECOMMENDATIONS,g,this.recommendations.sids,this.recommendations.count,f+1,-1);else if("product"==this.itemType)var h=new HZ.lb.Context("recommendations_"+b.id,HZ.lb.Config.CONTEXT_TYPE_PHOTO_RELATED_PRODUCTS,g,this.recommendations.sids,this.recommendations.count,f+1,-1);h.setCurrentSpaceId(e),a.pushContext(h),a.refresh()}}}},HZ.lb.plugins.ProductReviews=function(){var a,b,c,d,e,f,g,h,i,j,k=HZ.lb.Config.contentGroupIds.DISCUSSION;this.setOwner=function(b){a=b,c=$('<section class="lbInfoBox product-reviews separator"></section>'),d=c.get(0),a.addInfoBoxToContentGroup(d,"productReviews",k),h=$.proxy(this.onResourcesLoaded,this)},this.imageDataUpdated=function(){this.renderReviews()},this.imageChanged=function(){b=a.getCurrentSpace(),e=HZ.data.ProductReviews.get(b.id),e&&e.reviewHtml&&c.show(),c.empty();var d=a.isRecommendationsContext()||a.isFullPageAd()||a.isSpotlightContext();a.isProduct()&&!d&&this.renderReviews()},this.renderReviews=function(){if(f||g){if(f&&(b=a.getCurrentSpace(),(e=HZ.data.ProductReviews.get(b.id))&&e.reviewsHtml)){var d,k,l,m,n,o,p,q,r,s,t,u,v,w=HZ.ui.AjaxThrobber.getThrobber(),x=i;d=$(e.reviewsHtml),d.find("header h2").removeClass("text-l mbm").addClass("text-m text-bold"),k=d.find("form#reviewForm").clone(),c.empty().append(d.html()),x.initExpandButton(),x.setLoadMoreElement($("#moreReviews")),l=k.find("input.rating[type=number]"),m=l.val()>0,l.rating(),j.initRatingLables(k.find(".rating-input"),k.find(".rate-desc"),HZ.reviews.RateStarsLabels.RATING_LABELS),n=x.deleteButton=k.find("#deleteReviewButton"),o=x.cancelButton=k.find("#cancelReviewButton"),p=k.find("#editReviewButton"),q=$("#submitReviewButton"),n.click($.proxy(x.onDeleteClick,x)).detach(),o.click($.proxy(x.onCancelClick,x)).detach(),p.click($.proxy(x.onEditClick,x)),r=[n,w,o,q],k.find(".header-5, .controls.main").remove(),s=k.find(".form-ui").detach(),q.detach(),m&&n.removeClass("hidden"),t=m?_hgt("Edit Review"):_hgt("Write Review"),u={title:t,formName:"reviewForm",body:s,controls:r},v=x.dialog=new HZ.ui.yamdi.Dialog,v.init(u),k.remove(),x.setFormNode(v.getForm()),x.initReviewVote(),x.initReviewImages(),x.addTooltips();var y=$.proxy(x.onExpandClick,x);$("#noReviewsCta, .review-actions > .edit").click(y)}}else this.loadResources(h)},this.onReviewsUpdate=function(c,d){if(b=a.getCurrentSpace(),(e=HZ.data.ProductReviews.get(b.id))&&e.reviewsHtml){var f=e.reviewsHtml,g=$(f);g.find(".reviews").replaceWith(d.newValue),g=$("<div></div>").append(g),e.reviewsHtml=g.html()}},this.loadResources=function(a){f?a():(g=!0,HZ.utils.ResourceLoader.requireLightboxProductReviewResources(a))},this.onResourcesLoaded=function(){f=!0,g=!1,i=HZ.reviews.ProductReviewsUIManager.getInstance(),i.setDisplayMode(HZ.reviews.ProductReviewsUIManager.DISPLAY_MODE_NEWPAGE),$(".product-reviews").on("update.reviews",$.proxy(this.onReviewsUpdate,this)),j=HZ.reviews.RateStarsLabels.getInstance(),this.renderReviews()}},HZ.lb.plugins.ProductInfo=function(){function a(){var a=D,b=$(a);b.addClass("scrolling"),f.scrollToSelector(a,function(){b.removeClass("scrolling").addClass("scrolled")})}function b(){var a=HZ.data.Users.get(parseInt(k.preferredVendorIdForRating));if(a&&a.n){var b=a.n;if(b){var c=HZ.utils.Links.normalizeUserNameForUrl(b);window.open(HZ.utils.Links.getBrowseReviewsLink(c),"_blank")}}}function c(){f.scrollToSelector(".lbInfoBox.product-reviews")}function d(){f.scrollToSelector(".lbInfoBox.questions")}function e(){$(".loadComments").click(),f.scrollToSelector("#lbComments")}var f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C=HZ.lb.Config.contentGroupIds.PRODUCTS,D=".lbInfoBox.seller-shipping-info",E=_hgt("Visit Store"),F=_hgt("SALE"),G=_hgt("Your product is being sold by multiple sellers. The title, description, and other metadata you provided for your product listing may not appear here.");this.setOwner=function(k){f=k,g=$('<section class="lbInfoBox product-info-content"></section>'),HZ.lb.Config.isMainProdBtnQuantityInline&&g.addClass("separator"),h=g.get(0),f.addInfoBoxToContentGroup(h,"productInfo",C),g.on("click",".shipping-info-link",a).on("click",".review-stars-stats",c).on("click",".review-vendor-ratings",b).on("click",".questions-stats",d).on("click",".save-stats",e).on("click",".btn-visit-store",HZ.lb.plugins.SpaceActions.handleVisitStoreClicked),$(document).on("keyboardHandlerRequired.lightbox",function(a,b){var c=b.event.target;$(c).closest(h)&&f.detachKeyboardHandler()}).on("keyboardHandlerReleased.lightbox",function(a,b){var c=b.event.target;$(c).closest(h)&&f.attachKeyboardHandler()}),i=$(HZ.utils.Html.template(HZ.lb.Templates.IMAGE_OVERLAY_TEMPLATE,{CTA:E,COMP_ID:"visit_store_overlay"})).addClass("hidden").disableSelection(),i.on("click",HZ.lb.plugins.SpaceActions.handleVisitStoreClicked),f.addLbImageLayer(i),j=$(HZ.utils.Html.template('<div class="banner-listing-owner text-center text-l text-bold hidden"><div class="banner-listing-owner-close-x"><i class="hzi-font hzi-CloseX"></i></div><div class="banner-listing-owner-content">%CONTENT%</div></div>',{CONTENT:G})),j.on("click",".banner-listing-owner-close-x",this.handleListingOwnerBannerCloseClick.bind(this)),f.addLbImageLayer(j)},this.imageChanged=function(){if(g.empty().removeClass("product-info-content--ppc"),j.addClass("hidden"),$("#was-price-tooltip").hide(),k=f.getCurrentSpace(),l=HZ.utils.User.isHiddenUser(k.ow),r="",s="",t="",u="",v="",w="",x="",z="",A="",B="",f.isProduct()){m=HZ.data.ProductsInfo.get(k.id);var a=HZ.data.ListingsInfo.get(f.getSelectedListingId()),b=!!a&&a.avail,c=!!a&&a.buyable,d=!!a&&a.activeMPListing;if(i.toggleClass("hidden",!f.isPPCProduct()),r=this.getBreadcrumbsHtml(k),t=this.getProductTitleHtml(k),u=this.getProductStatsHtml(k),m||a){if(f.isMarketplaceProduct()&&a){var e=!a.itx||a.isut,h=null,n=!1;HZ.data.CurrentSessionUser&&(h=HZ.data.CurrentSessionUser.getUserId()),h&&(n=!!HZ.data.Users.get(h).p);var o=a.hasOwnProperty("itp")&&!0===a.itp,p=!1;if(o){HZ.lb.Config.tradePriceRedesign&&(p=!0)}else{HZ.lb.Config.priceRedesign;HZ.lb.Config.isStrikethroughTreatment&&(p=!0)}if(e&&d&&(s=this.getProductBadgeHtml(m),HZ.lb.Config.replaceSaleBadgeWithLabel&&!o||(v=this.getSalePromoHtml(a)),w=HZ.modules.ProductPriceRenderer.renderProductPriceHtml(k,a,p),x=HZ.modules.ProductRenderer.renderSavings(a),y=a.hasOwnProperty("ntdcm")?a.ntdcm:"",z=this.getShippingHtml(m,a)),a.itx&&(B=this.getProductSubTitleHtml(m,a,n)),A=this.getTradePromoNoteHtml(a,n),g.append(HZ.utils.Html.template('<div class="row"><div class="col-xs-12">%BREADCRUMBS%</div></div><div class="row"><div class="col-xs-12 mbm">%BADGE%</div></div><div class="row"><h1 class="col-xs-12 header-5 mt0 mb0 product-title">%TITLE%</h1></div>%SUBTITLE%<div class="row product-reviews mts"><ul class="col-xs-12 list-inline list-unstyled product-stats">%STATS%</ul></div><div class="row"><div class="col-xs-12">%SALE_PROMO%</div></div><div class="row">%PRICE%</div><div class="row">%SALE_PROMO_SAVINGS%</div><div class="row"><div class="col-xs-12">%NON_TRADE_DISCOUNT%</div></div>%TRADE_PROMO_NOTE%<div class="row"><div class="col-xs-12">%UNAVAILABLE%</div></div><div class="row"><div class="col-xs-12 mtm mbl">%SHIPPING%</div></div>',{BREADCRUMBS:r,BADGE:s,TITLE:t,SUBTITLE:B,STATS:u,SALE_PROMO:v,PRICE:w,SALE_PROMO_SAVINGS:x,NON_TRADE_DISCOUNT:y,TRADE_PROMO_NOTE:A,SHIPPING:z,UNAVAILABLE:d?"":_hgt("Currently not available")})),a&&c&&b&&a.dtime){var q=f.getSelectedListingId();HZ.module.ChangeShipToLocation.init({listingId:q,leadTimeStr:a.dtime,shipToZip:a.shipToZip,attachPointSelector:"#leadTimeText"})}a&&m&&this.addFlatShippingTooltip(m,a),p&&HZ.modules.ProductPriceRenderer.addTooltips(o,a.bpt)}else if(k.fullyLoaded){var C=a?a.discon:!!m&&!m.av,D=C?"":a?a.p:k.price,E=m&&m.puv&&!!D,F=_hgt("*Price not verified"),G=_hgt("This price has been supplied by a user of Houzz and, therefore, may not accurately reflect the current price of the product."),H=E?F:"",I=E?G:"";w=HZ.utils.Html.template('<span class="product-price">%FINAL_PRICE%</span>',{FINAL_PRICE:D}),g.append(HZ.utils.Html.template('<div class="row"><div class="col-xs-12">%BREADCRUMBS%</div></div><div class="row"><h1 class="col-xs-12 header-5 mt0 mb0 product-title">%TITLE%</h1></div><div class="row product-reviews mts"><ul class="col-xs-12 list-inline list-unstyled product-stats">%STATS%</ul></div><div class="row"><div class="col-xs-12 header-1 mt0 mbm">%PRICE% </div><span title="%PRICE_COMMENT_TITLE_ATTR%">&nbsp;%PRICE_COMMENT%</span></div>',{BREADCRUMBS:r,TITLE:t,STATS:u,PRICE:w,PRICE_COMMENT_TITLE_ATTR:I,PRICE_COMMENT:H}))}if(m&&a){var J=HZ.data.CurrentSessionUser,K=J?J.getUserId():-1,L=HZ.data.SpaceListingIds.get(k.id),M=!1;L&&$.isArray(L)&&L.forEach(function(a){var b=HZ.data.ListingsInfo.get(a);b&&b.vid===K&&b.lid!==m.plid&&(M=!0)}),M&&j.removeClass("hidden")}}}g.css("display","block")},this.imageDataUpdated=function(){this.imageChanged()},this.getBreadcrumbsHtml=function(a){var b=a&&a.brlnk?a.brlnk:null,c=$("<div>");if(b){var d=b.crumbs;if(d){var e=$('<ul class="list-unstyled list-inline text-primary breadcrumbs"></ul>').appendTo(c);d.forEach(function(a){$('<li class="breadcrumbs-crumb"></li>').toggleClass("breadcrumbs-crumb--highlight text-xs",a.highlight).appendTo(e).append(HZ.utils.Html.template(HZ.lb.Templates.BLANK_LINK,{LINK_URL:a.url,LINK_TEXT:a.label}))})}}return c.html()},this.getProductBadgeHtml=function(a){var b=$("<div>");if(a&&a.plid){var c=HZ.data.ListingsInfo.get(a.plid);b.append(HZ.modules.ProductRenderer.renderProductBadge(c,a))}return b.html()},this.getProductTitleHtml=function(a){var b=$("<div>");return a&&a.sht?b.append(HZ.utils.Html.template(HZ.lb.Templates.BLANK_LINK,{LINK_URL:HZ.utils.Links.getSpaceLink(a.id),TITLE_ATTR:a.sht,LINK_TEXT:a.sht})):a&&a.t&&b.append(HZ.utils.Html.template(HZ.lb.Templates.BLANK_LINK,{LINK_URL:HZ.utils.Links.getSpaceLink(a.id),TITLE_ATTR:a.t,LINK_TEXT:a.t})),b.html()},this.getProductSubTitleHtml=function(a,b,c){var d=$("<div>");if(a&&b){var e=a.manuLink,f=a.manuName;if(f&&b.itx){var g={tag:"span",attr:{class:"highlighted text-bold"}},h={tag:"a",attr:{target:"_blank",href:e,class:"highlighted text-bold"}},i=_hgt("by <t1>{manufacture}</t1>",{t1:c&&e?h:g,manufacture:f});d.append(HZ.utils.Html.template('<div class="row"><h1 class="sectionTitle text-m col-xs-12 mts product-subtitle">%SUBTITLE%</h1></div>',{SUBTITLE:i}))}}return d.html()},this.getProductStatsHtml=function(a){n=!!a.ratingHtml,q=!!a.preferredVendorIdForRating,o=!!a.nques,p=!!a.bc;var b=[];if(n&&(q?b.push(HZ.utils.Html.template(HZ.lb.Templates.SPACE_FACET,{CSS_CLASS:"review-vendor-ratings",FACET_TEXT:a.ratingHtml})):b.push(HZ.utils.Html.template(HZ.lb.Templates.SPACE_FACET,{CSS_CLASS:"review-stars-stats",FACET_TEXT:a.ratingHtml}))),o){var c=_hgtp("","{numQuestions} Question","{numQuestions} Questions",a.nques,{numQuestions:a.nques});b.push(HZ.utils.Html.template(HZ.lb.Templates.SPACE_FACET,{CSS_CLASS:"questions-stats",FACET_TEXT:c}))}if(p){var d=_hgtp("","{numSaves} Save","{numSaves} Saves",a.bc,{numSaves:a.bcf});b.push(HZ.utils.Html.template(HZ.lb.Templates.SPACE_FACET,{CSS_CLASS:"save-stats",FACET_TEXT:d}))}return b.join("")},this.getSalePromoHtml=function(a){var b=$("<div>");if(a&&a.pl){var c,d=HZ.utils.Links.getSoldByLink(a.vid),e=HZ.data.Users.get(a.vid).d;if(a&&a.dv)c=_hgt("by Houzz");else if(d){var f={tag:"a",attr:{target:"_blank",href:d}};c=_hgt("by <t1>{sellerName}</t1>",{sellerName:e,t1:f})}else c=e;var g=HZ.utils.Html.template(HZ.lb.Templates.BLANK_LINK,{LINK_URL:a.plink,LINK_TEXT:a.pl});b.append(HZ.utils.Html.template(HZ.lb.Templates.PRODUCT_SALE_PROMO,{SALE_BADGE_LABEL:F,SALE_BADGE_CLASS:"sale-badge",SALE_LABEL:g,SALE_SELLER:c}))}return b.html()},this.getTradePromoNoteHtml=function(a,b){var c=$("<div>");if(!a)return c.html();var d='<div class="trade-promo-note"><span class="%className%">%TRADE_PROMO_NOTE%</span></div>',e=a.hasOwnProperty("hvtp")&&!0===a.hvtp;if(!a.itx||a.isut)HZ.lb.Config.isTradePromoNoteEnabled&&e&&c.append(HZ.utils.Html.template(d,{TRADE_PROMO_NOTE:_hgt("Unlock Trade Pricing - <t1>Join the Houzz Trade Program<t2></t2></t1>",{t1:{tag:"a",attr:{target:"_blank",href:HZ.utils.Links.getPageUrl("trade-program"),class:"highlighted"}},t2:{tag:"span",attr:{class:"more-icon"}}}),className:"text-bold trade-promo-note__normal"}));else{var f=null,g=null,h=null;b?(h="This item is only available to members of the Houzz Trade Program. <t1>Apply Now</t1> for exclusive access to trade brands.",f=HZ.utils.Links.getPageUrl("trade-program"),g="text-bold highlighted"):(h="This item is only available for purchase through an interior designer. <t1>Find a local interior designer</t1> to help with your project.",f=HZ.utils.Links.getPageUrl("professionals/interior-designer#"),g="text-bold colorLink"),c.append(HZ.utils.Html.template(d,{TRADE_PROMO_NOTE:_hgt(h,{t1:{tag:"a",attr:{target:"_blank",href:f,class:g}}}),className:"trade-promo-note__exclusive--pro"}))}return c.html()},this.getShippingHtml=function(a,b){var c=$("<div>"),d=_hgt("Shipping & Seller Information"),e="",f="";if(b){var g=b.fs;if((b.vfs||!1)&&HZ.lb.Config.isTradePro){f='<div id="tradeFlatShipping" class="trade-flat-shipping">'+_hgt("<t1>{shippingCost} FLAT RATE SHIPPING</t1> from {manufacturer}",{shippingCost:b.shpc,manufacturer:a?a.manuName:"",t1:{tag:"span",attr:{class:"highlighted text-bold text-primary"}}})+"</div>"}else g&&(e='<span class="text-bold mrs">'+_hgt("Free Shipping!")+"</span>");c.append(HZ.utils.Html.template(HZ.lb.Templates.SHIPPING_SELLER_INFO,{FLAT_SHIPPING:f,SHIPPING_COST:e,SHIPPING_LINK_TEXT:d}))}return c.html()},this.addFlatShippingTooltip=function(a,b){var c=$("#tradeFlatShipping"),d=c.find("span.highlighted"),e=null;if(e=a&&a.manuLink?{tag:"a",attr:{class:"highlighted text-bold text-primary"},href:a.manuLink,target:"_blank"}:{tag:"span",attr:{class:"highlighted text-bold text-primary"}},d.length){var f=_hgt("Pay one flat shipping fee of {shippingCost} for all items you add from <t1>{manufacturer}</t1>.",{shippingCost:b.shpc,manufacturer:a.manuName,t1:e});d.on("click",function(){$(this).tipBubble({id:"flat-shipping-tooltip",content:HZ.utils.Html.template('<div class="flat-shipping-tooltip__body"><p class="flat-shipping-tooltip__message mb0">%TOOLTIP_MESSAGE%</p></div>',{TOOLTIP_MESSAGE:f}),point:"south",offsetX:0,offsetY:0,width:"270px",position:"absolute",showCloseBtn:!0,borderColor:"#ccc",fadeDuration:0})})}},this.handleListingOwnerBannerCloseClick=function(a){j.addClass("hidden")}},HZ.lb.plugins.MainButton=function(){var a,b,c,d,e,f,g,h,i,j,k,l=HZ.lb.Config.contentGroupIds.PRODUCTS,m=_hgt("Visit Store"),n=HZ.lb.Config.isMainProdBtnQuantityInline;this.setOwner=function(e){a=e,b=$('<section class="lbInfoBox product-main-button separator"></section>'),c=b.get(0),a.addInfoBoxToContentGroup(c,"productInfo",l),$(document).on("keyboardHandlerRequired.lightbox",function(b,d){var e=d.event.target;$(e).closest(c)&&a.detachKeyboardHandler()}).on("keyboardHandlerReleased.lightbox",function(b,d){var e=d.event.target;$(e).closest(c)&&a.attachKeyboardHandler()}),d=$(HZ.utils.Html.template(HZ.lb.Templates.IMAGE_OVERLAY_TEMPLATE,{CTA:m,COMP_ID:"visit_store_overlay"})).addClass("hidden").disableSelection(),d.on("click",HZ.lb.plugins.SpaceActions.handleVisitStoreClicked),a.addLbImageLayer(d),HZ.lb.Config.isCheckoutEnabled&&HZ.cart&&HZ.cart.Actions.subscribeCartUpdate("lightbox",function(a,c){"add"===c.operation&&c.message&&c.message.q&&b.find("#qtySelector").val(c.message.q)})},this.imageChanged=function(){if(b.empty().removeClass("product-main-button--ppc").addClass("separator"),e=a.getCurrentSpace(),f=HZ.utils.User.isHiddenUser(e.ow),a.isProduct()){g=HZ.data.ProductsInfo.get(e.id);var c=HZ.data.ListingsInfo.get(a.getSelectedListingId());if(d.toggleClass("hidden",!a.isPPCProduct()),g||c){var l=!1,m=!1;if(c?(i=c.avail,j=c.buyable,m=c.sbb,k=c.activeMPListing):i=g.av,a.isMarketplaceProduct()){var o=c&&(!c.itx||c.isut),p=n&&i&&!m&&o?'<div class="row mtm mbm"><div class="col-xs-12 qty-comment--standalone">%QTY_COMMENT%</div><div class="col-xs-4 mpQtyBox--padded" id="lbQtySelector"></div><div class="col-xs-8 product-main-button-mount"></div></div>':'<div class="row mtm"><div class="col-xs-12" id="lbQtySelector"></div></div><div class="row mbm"><div class="col-xs-12 product-main-button-mount"></div></div>',q="",r=null,s=!1;if(HZ.data.CurrentSessionUser&&(r=HZ.data.CurrentSessionUser.getUserId()),r&&(s=!!HZ.data.Users.get(r).p),l=c&&c.itx&&!s,o&&k&&c&&j&&i){var t=parseInt(c.q,10);t<10?q=_hgt("Only {quantity} Left!",{quantity:t}):HZ.lb.Config.alwaysShowQtyStr&&(q=_hgt("10 or more in stock"))}c&&!l&&k&&(b.append(HZ.utils.Html.template(p,{QTY_COMMENT:"<p>"+q+"</p>"})),HZ.productQuantity.Renderer.setMountNode($("#lbQtySelector")),HZ.productQuantity.Renderer.updateView(e.id,c.lid),HZ.modules.ProductMainButton.setMountNode(b.find(".product-main-button-mount")),HZ.modules.ProductMainButton.updateView(e.id))}else e.fullyLoaded&&(h=c?c.discon:!!g&&!g.av,b.append('<div class="row"><div class="col-xs-12 product-main-button-mount"></div></div>'),b.addClass("product-info-content--ppc").toggleClass("separator",!!a.isPPCProduct()),HZ.modules.ProductMainButton.setMountNode(b.find(".product-main-button-mount")),HZ.modules.ProductMainButton.updateView(e.id))}}b.css("display","block")},this.imageDataUpdated=function(){this.imageChanged()},this.pluginAfterShown=function(a){var b,c=document.getElementById("qtySelector"),d=$(c);"imageDataUpdated"===a&&c&&"SELECT"===c.nodeName.toUpperCase()&&(b=$(c).parent(".dropdown-wrapper-2"),b.length&&d.outerWidth()>b.outerWidth()&&b.css("width",d.outerWidth()))}},HZ.lb.plugins.ProductIdeabookComment=function(){var a,b,c=HZ.lb.Config.contentGroupIds.PRODUCTS;this.setOwner=function(d){a=d,b=$('<section class="lbInfoBox variationSelectors separator"></section>'),a.addInfoBoxToContentGroup(b[0],"productIdeabookComment",c)},this.imageChanged=function(){if(b.empty(),a.isGalleryContext()){var c=HZ.lb.RenderUtils.renderIdeabookSpaceComment(a.getCurrentSpace(),a.getCurrentSpaceGallery());b.append(c)}},this.imageDataUpdated=function(){this.imageChanged()}},HZ.lb.plugins.MPProductVariation=function(){function a(a){}var b,c,d=-1,e="openLB",f=null,g=HZ.lb.Config.contentGroupIds.PRODUCTS;this.setOwner=function(a){b=a,f=HZ.productVariation.BoxLinkSelector2.updateView,c=$('<section class="lbInfoBox variationSelectors separator"></section>'),b.addInfoBoxToContentGroup(c[0],"mpProductVariation",g),HZ.productVariation.Manager.setSelector(HZ.lb.Config.useDropdownVariations?HZ.productVariation.ListSelector:HZ.productVariation.BoxLinkSelector2),HZ.productVariation.Manager.setRenderer(this),HZ.productVariation.Manager.initUI()},this.lightboxLoaded=function(){HZ.productVariation.BoxLinkSelector2.updateView=a,d=-1,e="openLB"},this.lightboxUnloaded=function(){HZ.productVariation.BoxLinkSelector2.updateView=f},this.imageChanged=function(){var a=b.getCurrentSpace(),f=a.id;c.empty();var g,i=b.getContext().getCursorPosition(),j=HZ.data.Variations.get(f);if(i&&(i.cursor!==d?(e=-1===d?"openLB":"navigateNext",d=i.cursor):j?!1===j.exactMatch?(e="changeVarNoMatch",j.exactMatch=!0):e="changeVar":e="navigateNext"),j){if(null===(g=j.availVar)||0===g.length)return null;h()}},this.imageDataUpdated=function(){c.is(":empty")&&h()};var h=function(){var a=b.getCurrentSpace();HZ.productVariation.Manager.setSpaceId(a.id),c.empty();var d=HZ.data.ListingsInfo.get(b.getSelectedListingId());if(d&&(!d.itx||d.isut)){var e=HZ.productVariation.Manager.drawSelectors(a.id);null!==e&&(c.append(e),c.removeClass("hidden"))}};this.updateView=function(a){b.getContext().stashAndReplaceCurrentSpaceId(a),b.refresh()}},HZ.lb.plugins.PreSalesPhone=function(){
var a,b,c=HZ.lb.Config.contentGroupIds.INFO,d=HZ.lb.Config.preSalesPhoneNumber,e='<header class="phone-header row">            <h2 class="sectionTitle text-m text-bold col-xs-12">%TITLE%</h2>        </header>        <div class="row">            <p class="col-xs-12">%MESSAGE%</p>        </div>        <div class="row phone-row">            <span class="icon phone-img icon-font icon-phone mrs"></span><span class="phone">%PHONE%</span>        </div>';this.setOwner=function(d){a=d,b=$('<section class="lbInfoBox pre-sales-phone separator"></section>'),a.addInfoBoxToContentGroup(b[0],"preSalesPhone",c)},this.imageChanged=function(){var c=$(b).empty(),f=a.getCurrentSpace(),g=HZ.data.ProductsInfo.get(f.id);if(g){var h=HZ.data.ListingsInfo.get(g.plid);if(null!==h&&h.showPhone){var i=h.csHours,j=_hgt("Have questions about this product (ID#: {id})?",{id:f.id}),k=_hgt("Our Houzz specialists are ready to help!"),l=_hgt("Call during our regular hours: {csHours}",{csHours:i});if(null!==HZ.lb.Config.tradeUser&&HZ.lb.Config.tradeUser)var m=$(HZ.utils.Html.template(e,{TITLE:j,MESSAGE:l,PHONE:d}));else if(HZ.utils.RegularHour.isRegularHour())var m=$(HZ.utils.Html.template(e,{TITLE:j,MESSAGE:k,PHONE:d}));else var m=$(HZ.utils.Html.template(e,{TITLE:j,MESSAGE:l,PHONE:d}));c.append(m)}}},this.imageDataUpdated=function(){this.imageChanged()}},HZ.lb.plugins.ProductDescription=function(){var a,b,c,d=HZ.lb.Config.contentGroupIds.INFO;this.setOwner=function(c){a=c,b=$('<section class="lbInfoBox product-description separator"></section>'),a.addInfoBoxToContentGroup(b.get(0),"productDescription",d)},this.imageChanged=function(){var d=a.getCurrentSpace(),e="";if(d.fullyLoaded&&c!=d.id&&(b.empty(),c=d.id,!a.isFullPageAd()&&!a.isSpotlightContext())){if(a.isMarketplaceProduct()){var f=HZ.data.ProductsInfo.get(d.id);f&&f.desc&&(e=f.desc)}else if(a.isProduct()){var g=a.getSpaceDescription();if(g){var h=g;d.f&&d.au&&d.au!=d.ow&&d.cau&&(h+=" &mdash; <span class='userName'>"+HZ.ui.render.User.getUsersHtml(d.au,!0)+"</span>"),e=h}}if(""!=e){$('<header class="section-header row"></header>').appendTo(b).append('<h2 class="sectionTitle text-m text-bold col-xs-12">'+_hgt("Product Description")+"</h2>");var i=$('<div class="row invisible"></div>').appendTo(b),j=$('<p class="description-text col-xs-12"></p>').appendTo(i),k=$("<div>").append(e);j.append(k),a.registerTimeout("prodDescPeek",function(){i.removeClass("invisible"),j.peekable()},0)}}},this.imageDataUpdated=function(){this.imageChanged()}},HZ.lb.plugins.CommonSpecificationRenderer=new function(){function a(){var a=b.getCurrentSpace(),c="";if(!a.ow||7==a.ow||b.isFullPageAd()||b.isSpotlightContext())c="<div class='space-owner'></div>";else{if(HZ.data.Users.get(a.ow)){var d=null,e=HZ.data.HouzzClkTracking.get(a.id);e&&e[a.ow]&&(d=e[a.ow]),c=HZ.ui.render.User.getUserHtml(a.ow,!0,d)}}return c}var b,c=!1;this.setOwner=function(a){b=a},this.imageChanged=function(){},this.renderEditorialDescription=function(a){var c,d=b.getCurrentSpace(),e=b.getSpaceDescription();e&&(c=e,d.f&&d.au&&d.au!=d.ow&&d.cau&&(c+=" &mdash; <span class='userName'>"+HZ.ui.render.User.getUsersHtml(d.au,!0)+"</span>")),a.empty();var f=$("<div class='description-text'></div>").appendTo(a);c?f.peekable("show").peekable("setContent",c):f.peekable("hide")},this.renderSpecification=function(){var d,e,f,g=b.getCurrentSpace(),h=HZ.data.PPCAds.get(g.id),i=$("<div></div>"),j=!!HZ.data.CurrentSessionUser;b.isMarketplaceProduct()||h&&h.isPPCProduct||(c=!j);var k,l,m,n=HZ.data.ProductsInfo.get(g.id),o=HZ.data.ListingsInfo.get(b.getSelectedListingId()),p=$('<dl class="product-attributes horizontal-list horizontal-list--multi-line text-m"></dl>'),q='<dt class="key">%LABEL%</dt><dd class="value">%VALUE%&nbsp;</dd>',r=0,s=a();if(g.prod&&s){var t=!HZ.data.SpaceListingIds.get(g.id)||1===HZ.data.SpaceListingIds.get(g.id).length;d=_hgt("Sold By"),e="";var u=HZ.data.Users.get(g.ow).mpv;k=!!g.tl;var v=parseInt(g.srct,10);if(l=u&&(2===v||8===v),m=!o&&n&&n.av||o&&!o.discon,j&&k&&m&&!l&&s&&(e=s+' | <a href="javascript:;" class="visitStore icon-wrap">'+_hgt("Visit Store")+'<span class="more-icon"></span></a>'),e&&t){var w=$(HZ.utils.Html.template(q,{LABEL:d,VALUE:e}));p.append(w),r++}}if(n&&o){d=n.swlabel,e=n.swvalue;if(d&&e&&(f=HZ.utils.Html.template(q,{LABEL:d,VALUE:e}),p.append(f),r++),HZ.data.ProductAttributes.forEach(function(a){var b=a.unit,c=a.key;"dimensions"!==b&&"weight"!==b&&"s"!==c&&(d=a.label,(e=n[c])&&e.length&&(f=HZ.utils.Html.template(q,{LABEL:d,VALUE:e}),p.append(f),r++))}),n.manuName){var x=n.manuLink,y=n.manuName;d=o&&o.mll?o.mll:_hgt("Manufactured By"),e=x?'<a target="_blank" href="'+x+'" class="colorLink">'+y+"</a>":y,f=HZ.utils.Html.template(q,{LABEL:d,VALUE:e}),p.prepend(f)}void 0!==n.assembly&&(f=HZ.utils.Html.template(q,{LABEL:_hgt("Assembly Required"),VALUE:n.assembly?_hgt("Yes"):_hgt("No")}),p.append(f)),o.hasOwnProperty("cg")&&!0===o.cg&&(f=HZ.utils.Html.template(q,{LABEL:_hgt("Commercial-grade"),VALUE:_hgt("Yes")}),p.append(f))}if(!g.prod){var z=HZ.lb.RenderUtils.renderBrowseLocationLink(g);z&&p.append(HZ.utils.Html.template(q,{LABEL:_hgt("Location"),VALUE:$("<div>").append(z).html()}))}var A;if(n){if(n.external&&n.external.length&&n.showExternal)for(var B=0,C=n.external.length;B<C;B++)A=n.external[B],d=A.key,(e=A.value)&&e.length&&(f=HZ.utils.Html.template(q,{LABEL:d,VALUE:e}),p.append(f));!0===n.p65d&&(d=_hgt("California Residents"),e=_hgt("<t1>Click here for Proposition 65 warning</t1>",{t1:{tag:"a",attr:{href:"javascript:;",class:"colorLink p65d"}}}),f=HZ.utils.Html.template(q,{LABEL:d,VALUE:e}),p.append(f))}if(p.children().length&&g.prod){var D="";if(D+='<header class="section-header">',D+='<h2 class="sectionTitle text-m text-bold">'+_hgt("Product Specification")+"</h2>",D+="</header>",i.append(D),i.append(p),b.isMarketplaceProduct()&&HZ.lb.Config.isReportProductLinkEnabled){var E='<a class="report-product-link" href="javascript:;">'+_hgt("Report incorrect information or image")+"</a>";i.append(E)}}return i.html()},this.renderReturnPolicy=function(a){var b=_hgt("Returns Policy"),c=HZ.utils.Links.getPageUrl("returnPolicy"),d=_hgt(" Return Policy");a.append(HZ.utils.Html.template('<header class="section-header text-m text-bold">%RETURN_POLICY_TITLE%</header><div class="return-policy-content"><a class="text-primary" href="%URL%">%COMPANY%%RETURN_POLICY_TEXT%<span class="more-icon"></span></a></div>',{RETURN_POLICY_TITLE:b,URL:c,COMPANY:"Houzz 30-day",RETURN_POLICY_TEXT:d}))},this.imageDataUpdated=function(){}},HZ.lb.plugins.ProductSpecification=function(){var a,b,c,d=HZ.lb.Config.contentGroupIds.INFO;this.setOwner=function(c){a=c,b=$('<section class="lbInfoBox product-spec separator trackMe"></section>')[0],a.addInfoBoxToContentGroup(b,"productSpecs",d),$(b).on("click",".p65d",$.proxy(this.onP65DClick,this)).on("click",".visitStore",HZ.lb.plugins.SpaceActions.handleVisitStoreClicked).on("click",".report-product-link",$.proxy(this.handleReportProductClick,this)).on("mouseenter mouseleave",".report-product-link",$.proxy(this.hoverReportProductFlag,this)),$(document).on("keyboardHandlerRequired.lightbox",function(c,d){var e=d.event.target;$(e).closest(b)&&a.detachKeyboardHandler()}).on("keyboardHandlerReleased.lightbox",function(c,d){var e=d.event.target;$(e).closest(b)&&a.attachKeyboardHandler()})},this.imageChanged=function(){$(b).empty(),c=a.getCurrentSpace(),c.prod&&($(b).append(HZ.lb.plugins.CommonSpecificationRenderer.renderSpecification()),a.registerTimeout("prodSpecPeek",function(){var a=$(b).find(".product-attributes"),d=c&&c.id||"";a.peekable({moreHtml:'<a class="hzPeekLink text-bold" href="javascript:;" scopeid="attr-peek-lb" compid="attr-expand" objid="'+d+'">'+_hgt("See More")+'<span class="down-icon"></span></a>',lessHtml:'<a class="hzPeekLink text-bold" href="javascript:;" scopeid="attr-peek-lb" compid="attr-collapse" objid="'+d+'">'+_hgt("Less")+'<span class="up-icon"></span></a>'})},0))},this.imageDataUpdated=function(){this.imageChanged()},this.onP65DClick=function(a){HZ.ui.yamdi.Common.alert(_hgt("WARNING"),_hgt("This product contains a chemical known to the State of California to cause cancer, birth defects, or other reproductive harm."))},this.handleReportProductClick=function(){a.isSignupMode()?a.showLoginDialog():HZ.module.ReportProduct.handleReportProductClick(c.id)},this.hoverReportProductFlag=function(a){var b=$(".report-product-flag");switch(a.type){case"mouseenter":b.addClass("report-product-flag-hover");break;case"mouseleave":b.removeClass("report-product-flag-hover")}}},HZ.lb.plugins.ProductDocuments=function(){var a,b,c,d,e=HZ.lb.Config.contentGroupIds.INFO;this.setOwner=function(c){a=c,b=$('<section class="lbInfoBox product-documents separator"></section>'),a.addInfoBoxToContentGroup(b.get(0),"productDocuments",e)},this.imageChanged=function(){if(c=a.getCurrentSpace(),b.empty(),c.prod){d=HZ.data.ProductsInfo.get(c.id),HZ.modules.ProductDocumentRenderer.setMountNode(b),HZ.modules.ProductDocumentRenderer.updateView(d);var e=b.find(".product-doc-list"),f=c&&c.id||"";e.peekable({moreHtml:'<a class="hzPeekLink text-bold" href="javascript:;" scopeid="document-peek-lb" compid="document-expand" objid="'+f+'">'+_hgt("See More")+'<span class="down-icon"></span></a>',lessHtml:'<a class="hzPeekLink text-bold" href="javascript:;" scopeid="document-peek-lb" compid="document-collapse" objid="'+f+'">'+_hgt("Less")+'<span class="up-icon"></span></a>'})}},this.imageDataUpdated=function(){this.imageChanged()}},HZ.lb.plugins.SpaceSpecification=function(){var a,b,c,d=HZ.lb.Config.contentGroupIds.OVERVIEW;this.setOwner=function(c){a=c,b=$('<section class="lbInfoBox space-spec separator"></section>')[0],a.addInfoBoxToContentGroup(b,"space-spec",d)},this.imageChanged=function(){$(b).empty(),c=a.getCurrentSpace(),a.isFullPageAd()||a.isProduct()||a.isSpotlightContext()||$(b).append(HZ.lb.plugins.CommonSpecificationRenderer.renderSpecification())},this.imageDataUpdated=function(){this.imageChanged()}},HZ.lb.plugins.ProductListingsInfo=function(){var a,b,c,d,e=HZ.lb.Config.contentGroupIds.INFO;this.setOwner=function(f){a=f,b=$('<section class="lbInfoBox seller-shipping-info separator"></section>'),c=b.get(0),a.addInfoBoxToContentGroup(c,"shipping-info",e),d=HZ.listingInfo.Renderer,d.setMountNode(c)},this.imageChanged=function(){b.empty();var c=a.getCurrentSpace();if(c.fullyLoaded&&HZ.lb.Config.isCheckoutEnabled){var e=c.id,f=a.getSelectedListingId(),g=HZ.data.ListingsInfo.get(f);g&&(!g.itx||g.isut)&&d.updateView(e,f,!0)}},this.imageDataUpdated=function(){this.imageChanged()}},HZ.lb.plugins.QuestionsInfo=new function(){var a,b,c,d,e,f,g,h,i=HZ.lb.Config.contentGroupIds.DISCUSSION,j=null;this.setOwner=function(d){a=d,b=$('<section id="lbQuestions" class="lbInfoBox separator questions"></section>'),c=b.get(0),a.addInfoBoxToContentGroup(c,"questionsInfo",i),b.click($.proxy(this.handleDivClicked,this)).on("mousedown",".lbQuestionFeedDiv a",function(){0==this.href.indexOf("http://")&&(this.target="_blank")}).on("click","#askQuestionButton, #lbQuestionsFeedCTALink",$.proxy(this.handleAskAQuestion,this)),this.initFeedComments(),$(document).on("keyboardHandlerRequired.lightbox",function(b,d){var e=d.event.target;$(e).closest(c)&&a.detachKeyboardHandler()}).on("keyboardHandlerReleased.lightbox",function(b,d){var e=d.event.target;$(e).closest(c)&&a.attachKeyboardHandler()})},this.initFeedComments=function(){void 0!==HZ.feedComments?HZ.feedComments.init({source:"lightbox",feedContainer:c}):HZ.lb.Utils.loadFeedCommentsResources(this.initFeedComments.bind(this))},this.lightboxScroll=function(){this.loadIfVisible()},this.loadIfVisible=function(){setTimeout(function(){$("#lbQuestions .section-header").visible()&&a.getCurrentSpace().fullyLoaded&&k.apply(this)}.bind(this),500)};var k=function(){var b=a.getCurrentSpace();e||HZ.data.Questions.get(b.id)||(e=!0,HZ.ajaz.Services.getQuestionsData(b.id,$.proxy(l,this)))},l=function(a){HZ.lb.Utils.validateData(a);var b,c=a.results.questions;if(a&&a.results)for(b in c)HZ.data.Questions.put(b,c[b]);e=!1,this.renderQuestions(),f.removeClass("hidden"),g.removeClass("hidden")};this.imageDataUpdated=function(){this.renderQuestions(),$(".askButton",c).removeClass("hidden"),f.removeClass("hidden"),g.removeClass("hidden")},this.imageChanged=function(){j?(HZ.data.Questions.deleteObj(j),j=a.getCurrentSpace().id):j=a.getCurrentSpace().id,g?g.empty():$.noop()},this.renderQuestions=function(){var c,e,h,i=a.getCurrentSpace(),j=[],k=[],l=0;if(i&&(c=HZ.data.Questions.get(i.id)),b.find(".edit-comment-rte").each(function(a,b){var c=$(b),d=c.find(".temp");c.removeClass("active").find(".rich-text-editor-wrapper").remove(),c.find("#cancel-edit-comment").remove(),c.children(".commentForm").hide().appendTo(d.find(".editCommentDiv")),c.find("input[name=isHtml]").remove(),d.children().appendTo(c),d.remove()}),b.find(".add-comment-rte").each(function(a,b){var c=$(b);c.removeClass("active").find(".rich-text-editor-wrapper").remove(),c.find(".addCommentExtra").hide(),c.find(".commentBody").show(),c.find(".hzProIndicator").hide(),c.find("input[name=isHtml]").remove()}),this.storeQuestionData(),d=!0,c&&c.length>0){for(var m=0;m<c.length;m++){var n=c[m],o=(n.body,"");n.processedFeedHtml?o="<div class='lbQuestionFeedDiv' sid='"+i.id+"' qid='"+m+"'>"+n.processedFeedHtml+"</div>":n.feedHtml&&(o="<div class='lbQuestionFeedDiv' sid='"+i.id+"' qid='"+m+"'>"+n.feedHtml+"</div>"),l<2&&n.count>0?(k.push(o),l++):j.push(o)}for(;k.length<2&&j.length>0;)k.push(j.shift())}else{var p=a.isProduct()?_hgt("Have a question about this product? Ask our community."):_hgt("Have a question about this photo? Ask our community.");k.push("<div class='lbQuestionFeedCTA'>"+p+"</div>")}var q,r=a.isProduct(),s=r?i.nques:i.qc;h=_hgt("Ask a Question"),q=r?_hgtp("Product questions","This product has one question","This product has {questionCount} questions",s,{questionCount:s}):_hgtp("Questions About This Photo","Question About This Photo","Questions About This Photo ({questionCount})",s,{questionCount:i.qcf}),b.empty().append('<header class="section-header row hidden"><h2 class="questionsHeader title text-m text-bold col-xs-12">'+q+'</h2><span class="col-xs-12"><button id="askQuestionButton" class="btn btn-secondary btn-block" compId="lbAsk">'+h+"</button></span></header>").append('<div id="questionsContainer" class="hidden">'+k.join("")+"</div>"),f=b.find("header.section-header"),g=$("#questionsContainer");var t=j.length;if(t>0){var u=_hgtp("","Show 1 more question","Show {questionCount} more questions",t,{questionCount:t})+"<span class='more-icon'></span>";b.append("<button class='lbQuestionsMore btn btn-block btn-expand'>"+u+"</button><div class='lbQuestionsListUnansweredDiv text-s'>"+j.join("")+"</div>")}e=$("#askQuestionButton"),e.toggleClass("hidden",a.isEditMode()),b.find(".attachment-previews").empty(),b.find("textarea.commentBody").initPlaceHolders(),HZ.clipping.Clip.init({})},this.storeQuestionData=function(){$(c).find(".feedAttach .feed-question-body").peekable("destroy"),$(".lbQuestionFeedDiv",c).each(function(a,b){var c=$(b),d=c.attr("sid"),a=c.attr("qid"),e=HZ.data.Questions.get(d);e&&e[a]&&e[a].feedHtml&&(e[a].processedFeedHtml=c.html())})},this.handleDivClicked=function(a){var b=a.target;if(b&&b.className.indexOf("lbQuestionsMore")>=0){b.style.display="none";var c=$(".lbQuestionsListUnansweredDiv");c[0].style.display="block",c.find(".feed-question-body").peekable()}},this.pluginAfterShown=function(a){clearTimeout(h),h=setTimeout(function(){if(d){var a=$(c).find(".feedAttach .feed-question-body");a.length>0&&(a.peekable(),d=!1)}this.loadIfVisible()}.bind(this),30)},this.imageResized=function(){this.loadIfVisible()},this.handleAskAQuestion=function(){if(a.isSignupMode())a.showLoginDialog();else{var b=a.getContext().getCurrentSpaceId(),c=a.getCurrentSpace(),d=HZ.data.Users.get(c.ow),e=d?d.p:0;HZ.spaceActions.QuestionDialog.init(b,e),HZ.spaceActions.QuestionDialog.setShowLinkOnNewWindow(!0),HZ.spaceActions.QuestionDialog.setQuestionTopic(c.prod?HZ.spaceActions.QuestionDialog.PRODUCT_TOPIC:HZ.spaceActions.QuestionDialog.SPACE_TOPIC),a.showDialog(HZ.spaceActions.QuestionDialog)}}},HZ.lb.plugins.ContextBreadcrumbs=new function(){var a,b,c;this.setOwner=function(d){a=d,b=$('<div id="lbContextBreadcrumbs"></div>'),c=b.get(0),a.addBreadcrumbs(c),$("#lbContextBreadcrumbs").click($.proxy(this.handleBreadcrumbClick,this))},this.contextChanged=function(){var c=a.getContextStack(),d=c.length>1;if(b.empty(),d){var e=c[1].getCurrentSpaceId();e&&b.append(HZ.utils.Html.template('<div class="crumb"><div class="crumbArrow"><span class="hzi-font hzi-Left-Arrow backArrow"></span><span class="backText">%CTA%</span></div><div class="crumbImage"><img src="%IMG_SRC%"></div></div>',{CTA:_hgt("Back"),IMG_SRC:HZ.utils.Links.getSpaceImageUrl(e,39,39)})),this.showBreadcrumbs()}else this.hideBreadcrumbs()},this.handleBreadcrumbClick=function(){a.popContext(),a.refresh()},this.hideBreadcrumbs=function(){b.addClass("hidden")},this.showBreadcrumbs=function(){b.removeClass("hidden")}},HZ.lb.plugins.GalleryComment=function(){var a,b;this.setOwner=function(c){a=c,b=$('<section class="lbInfoBox separator"></section>'),a.addInfoBoxToContentGroup(b[0],"galleryComment","")},this.imageChanged=function(){var c=a.getCurrentSpace(),d=a.getContext(),e="";d.getType()!=HZ.lb.Config.CONTEXT_TYPE_IDEABOOK||a.isFullPageAd()||a.isSpotlightContext()||(b.show(),c.b&&(e='<div class="gallery-comment text-s">'+c.b+"</div>")),b.html(e)}},HZ.lb.SocialShareButtons={map:{facebook:{className:"uiButtonFacebook",fontClass:"hzi-Facebook",name:"Facebook",platform:HZ.utils.Config.socialSharePlatforms.facebook,compId:"shareOnFacebook"},twitter:{className:"uiButtonTwitter",fontClass:"hzi-Twitter",name:"Twitter",platform:HZ.utils.Config.socialSharePlatforms.twitter,compId:"shareOnTwitter"},googlePlus:{className:"uiButtonGooglePlus",fontClass:"hzi-Google",name:"Google+",platform:HZ.utils.Config.socialSharePlatforms.googlePlus,compId:"shareOnGooglePlus"},vkontakte:{className:"uiButtonVkontakte",fontClass:"hzi-Vkontakte",name:"Vkontakte",platform:HZ.utils.Config.socialSharePlatforms.vkontakte,compId:"shareOnVkontakte"},odnoklassniki:{className:"uiButtonOdnoklassniki",fontClass:"hzi-Odnoklassniki",name:"Odnoklassniki",platform:HZ.utils.Config.socialSharePlatforms.odnoklassniki,compId:"shareOnOdnoklassniki"},line:{className:"uiButtonLine",fontClass:"hzi-Line",name:"line",platform:HZ.utils.Config.socialSharePlatforms.line,compId:"shareOnLine"}},shareLink:function(a,b){HZ.spaceActions.Share.openShareWindowForSpace(b,a)}},HZ.lb.plugins.SpaceShareButtons=function(){var a,b,c;this.setOwner=function(c){a=c,b=$("<span>"),a.addActionItem(b.get(0),HZ.lb.ActionBar.ACTION_BAR_CENTER)},this.showShareDialog=function(){a.showDialog(shareDialog)},this.imageChanged=function(){if(!c){var a=HZ.utils.Html.escapeHtmlEntities(_hgt("Embed this photo on blog")),d=HZ.utils.Html.escapeHtmlEntities(_hgt("Print Photo"));b.append(HZ.utils.Html.template('<span class="hzBtn med tint expand">\t\t\t\t\t\t\t\t\t\t<ul class="shelf unstyled" data-items="5">\t\t\t\t\t\t\t\t\t\t\t<li class="item">\t\t\t\t\t\t\t\t\t\t\t\t<a class="hzi-font hzi-Embed icon" compid="embed" title="%EMBED_TITLE%" href="javascript:;"></a>\t\t\t\t\t\t\t\t\t\t\t</li>\t\t\t\t\t\t\t\t\t\t\t<li class="item">\t\t\t\t\t\t\t\t\t\t\t\t<a class="hzi-font hzi-Print icon" compid="print" title="%PRINT_TITLE%" href="javascript:;"></a>\t\t\t\t\t\t\t\t\t\t\t</li>\t\t\t\t\t\t\t\t\t\t</ul> \t\t\t\t\t\t\t\t\t\t<i class="icon-font icon-box_up_arrow icon"></i>\t\t\t\t\t\t\t\t\t</span>',{EMBED_TITLE:a,PRINT_TITLE:d})),b.on("click",".hzi-Embed",HZ.lb.plugins.SpaceActions.handleEmbed),b.on("click",".hzi-Print",HZ.lb.plugins.SpaceActions.handlePrint);var e=HZ.lb.Config.socialListConfig||[],f=HZ.lb.SocialShareButtons.map,g=b.find(".shelf");e.forEach(function(a){var b=f[a];if(b){var c=b.fontClass,d=b.compId,e=b.name,h=HZ.utils.Html.escapeHtmlEntities(_hgt("Share a link on {socialPlatform}",{socialPlatform:e}));$(HZ.utils.Html.template('<li class="item">\t\t\t\t\t\t\t\t\t<a class="hzi-font icon %CSS_CLASS%" compid="%COMP_ID" title="%TITLE_ATTR%" href="javascript:;"></a>\t\t\t\t\t\t\t\t</li>',{CSS_CLASS:c,COMP_ID:d,TITLE_ATTR:h})).appendTo(g).click(this.handleShareButtonClick.bind(this,b.platform))}}.bind(this)),c=!0}},this.handleShareButtonClick=function(b,c){var d=a.getCurrentSpace();HZ.spaceActions.Share.openShareWindowForSpace(b,d.id),c.stopPropagation()}},HZ.lb.plugins.SpaceShareDialog=function(){var a,b,c,d,e='<li class="lb-share-dialog__list-item">\t\t\t\t\t\t\t\t\t<a compid="%COMP_ID%" title="%TITLE_ATTR%" href="javascript:;">\t\t\t\t\t\t\t\t\t\t<i class="hzi-font %CSS_CLASS% icon lb-share-dialog__list-item-icon"></i>\t\t\t\t\t\t\t\t\t\t<span class"lb-share-dialog__list-item-label">%LABEL%</span>\t\t\t\t\t\t\t\t\t</a>\t\t\t\t\t\t\t\t</li>';this.setOwner=function(b){a=b;var f={iconClass:"icon-font icon-box_up_arrow icon",compId:"lb_share",label:_hgt("Share"),index:0,handler:this.showShareDialog.bind(this)};a.addMoreMenuItem(f);var g={SHARE_TITLE:HZ.utils.Html.escapeHtmlEntities(_hgt("Share your idea with others:")),EMBED_TITLE:HZ.utils.Html.escapeHtmlEntities(_hgt("Embed")),PRINT_TITLE:HZ.utils.Html.escapeHtmlEntities(_hgt("Print"))},h=$(HZ.utils.Html.template('<div class="lb-share-dialog trackMe">\t\t\t\t\t\t\t\t\t<div class="lb-share-dialog__title">%SHARE_TITLE%</div>\t\t\t\t\t\t\t\t\t<ul class="lb-share-dialog__list unstyled">\t\t\t\t\t\t\t\t\t\t<li class="lb-share-dialog__list-item">\t\t\t\t\t\t\t\t\t\t\t<a class="embed-btn" compid="embed" title="%EMBED_TITLE%" href="javascript:;">\t\t\t\t\t\t\t\t\t\t\t\t<i class="icon-font icon-left_slash_right icon lb-share-dialog__list-item-icon"></i>\t\t\t\t\t\t\t\t\t\t\t\t<span class"lb-share-dialog__list-item-label">%EMBED_TITLE%</span>\t\t\t\t\t\t\t\t\t\t\t</a>\t\t\t\t\t\t\t\t\t\t</li>\t\t\t\t\t\t\t\t\t\t<li class="lb-share-dialog__list-item">\t\t\t\t\t\t\t\t\t\t\t<a class="print-btn" compid="print" title="%PRINT_TITLE%" href="javascript:;">\t\t\t\t\t\t\t\t\t\t\t\t<i class="icon-font icon-printer icon lb-share-dialog__list-item-icon"></i>\t\t\t\t\t\t\t\t\t\t\t\t<span class"lb-share-dialog__list-item-label">%PRINT_TITLE%</span>\t\t\t\t\t\t\t\t\t\t\t</a>\t\t\t\t\t\t\t\t\t\t</li>\t\t\t\t\t\t\t\t\t</ul> \t\t\t\t\t\t\t\t</div>',g)),i=HZ.lb.Config.socialListConfig||[],j=HZ.lb.SocialShareButtons.map,k=h.find(".lb-share-dialog__list");i.reverse().forEach(function(a){var b=j[a];if(b){var c={CSS_CLASS:b.fontClass,COMP_ID:b.compId,LABEL:b.name,TITLE_ATTR:HZ.utils.Html.escapeHtmlEntities(_hgt("Share a link on {socialPlatform}",{socialPlatform:b.name}))},d=$(HZ.utils.Html.template(e,c));k.prepend(d),d.click(this.handleShareButtonClick.bind(this,b.platform))}}.bind(this)),d=new HZ.ui.yamdi.Dialog;var l=HZ.ui.InputButtonUtils.createPrimaryInputButton(_hgt("Done"),_hgt("cancel"),function(){HZ.ui.Yamdi.hide()});d.init({dialogClassName:"lb-share-dialog",title:_hgt("Share"),body:h.get(0),controls:[l],hideDialogOnBgClick:!0,hideDialogOnEsc:!0,preferredWidth:350}),d.setVerticallyCentered(!0),h.on("click",".embed-btn",function(){HZ.ui.yamdi.Common.hideAllDialogs(),HZ.lb.plugins.SpaceActions.handleEmbed()}),h.on("click",".print-btn",function(){HZ.ui.yamdi.Common.hideAllDialogs(),HZ.lb.plugins.SpaceActions.handlePrint()}),c=!0},this.showShareDialog=function(){a.showDialog(d)},this.imageChanged=function(){if(!c){b.on("click",".hzi-Embed",HZ.lb.plugins.SpaceActions.handleEmbed),b.on("click",".hzi-Print",HZ.lb.plugins.SpaceActions.handlePrint);var a=HZ.lb.Config.socialListConfig||[],d=HZ.lb.SocialShareButtons.map,f=b.find(".shelf");a.forEach(function(a){var b=d[a];if(b){var c=b.fontClass,g=b.compId,h=b.name,i=HZ.utils.Html.escapeHtmlEntities(_hgt("Share a link on {socialPlatform}",{socialPlatform:h}));$(HZ.utils.Html.template(e,{CSS_CLASS:c,COMP_ID:g,TITLE_ATTR:i})).appendTo(f).click(this.handleShareButtonClick.bind(this,b.platform))}}.bind(this)),c=!0}},this.handleShareButtonClick=function(b,c){var d=a.getCurrentSpace();HZ.spaceActions.Share.openShareWindowForSpace(b,d.id),c.stopPropagation()}},HZ.lb.plugins.AdminMenu=function(){var a,b,c,d,e,f=HZ.houseUtils.Permissions,g=HZ.lb.plugins.SpaceActions,h=HZ.utils.Html.escapeHtmlEntities(_hgt("Edit Image Tags")),i=HZ.utils.Html.escapeHtmlEntities(_hgt("Toggle Edit Mode")),j='<div id="lbAdminMenu">\t\t\t\t\t\t\t\t\t<a class="btn med tint tag" title="'+h+'" href="javascript:;">\t\t\t\t\t\t\t\t\t\t<i class="hzi-font hzi-Add-Tag icon"></i>\t\t\t\t\t\t\t\t\t</a>\t\t\t\t\t\t\t\t\t<a id="lbEditButton" class="btn med tint edit" compid="lbEditButton" title="'+i+'" href="javascript:;">\t\t\t\t\t\t\t\t\t\t<i class="hzi-font hzi-Edit icon"></i>\t\t\t\t\t\t\t\t\t</a>\t\t\t\t\t\t\t\t</div>';this.setOwner=function(d){a=d;var e=$(j);c=e,e.find("#lbEditButton").click($.proxy(g.handleEdit,g)),e.find(".hzi-Add-Tag").parent().click($.proxy(g.handleImageTag,g)),b=e.get(0),a.addActionItem(b,HZ.lb.ActionBar.ACTION_BAR_RIGHT)},this.imageChanged=function(){this.updateDisplay()},this.imageDataUpdated=function(){this.updateDisplay()},this.updateDisplay=function(){var b=a.getCurrentSpace();b&&(d=!!f.hasPermission(b,f.CAN_EDIT_HOUSE)&&!a.isSketch(),e=!!f.hasPermission(b,f.CAN_EDIT_IMAGE_TAGS)&&!a.isSketch()&&!b.isv),c.toggleClass("can-edit",d),c.toggleClass("can-tag",e)}},HZ.lb.plugins.BrowserHistoryManager=new function(){var a,b,c,d=!0,e=!1,f=!0;this.setOwner=function(c){a=c,b=window.history.location||window.location},this.setEnabled=function(a){d=a},this.updateHistory=function(){var c,d=a.getCurrentSpace(),e=history.state;if(f||e&&e.spaceId!==d.id){for(var g=a.getContextStack(),h=[],i=0;i<g.length;i++)h.push(g[i].getName());var j=HZ.utils.Styles.getStyleUrl(d.s),k=HZ.data.Categories.getCategoryById(d.cat),l=HZ.data.Users.get(d.ow),m=null;null!==l&&(m=l.d);var n=HZ.utils.PageTitles.getViewSpacePageTitle(d.t,j,k?k.name:null,d.ma,m),o=HZ.utils.Links.getSpaceLink(d.id);o=b&&0===b.protocol.indexOf("https")?o.replace("http://","https://"):o.replace("https://","http://"),a.isEditMode()&&(o+="#lb-edit"),c={spaceId:d.id,contextName:h},f?(a.isViewSpace()?history.replaceState(c,n,o):history.pushState(c,n,o),f=!1):history.replaceState(c,n,o)}},this.imageChanged=function(){d&&this.updateHistory()},this.lightboxLoaded=function(){d&&(c=b.href,e=!0,$(window).on("popstate",function(d){var f=d.state;e&&(b.href===c?a.hide():f&&f.spaceId!==a.getCurrentSpace().id&&a.reload(f.spaceId,f.contextName))}))},this.lightboxUnloaded=function(){d&&(e=!1,f=!0,b.href!==c&&history.back())}},HZ.lb.plugins.TrackingManager=function(){var a,b,c;this.setOwner=function(c){a=c,b=document.createElement("div"),b.id="lbTrackingIframe",a.addImageLayer(b)},this.imageChanged=function(){var b=!0;switch(HZ.lb.Config.TRACK_IMPRESSIONS){case!1:b=!1;break;case"CONTEXT_ONLY":b=a.getContextStack().length>1}b&&!a.isEditMode()&&this.sendImpressionReport()},this.sendImpressionReport=function(){c&&(c.stop&&c.stop(),b.removeChild(c));var d=a.getCurrentSpace(),e=(HZ.utils.Styles.getStyleUrl(d.s),HZ.data.Categories.getCategoryById(d.cat),HZ.utils.Links.getSpaceLink(d.id));window.location&&0==window.location.protocol.indexOf("https")&&(e=e.replace("http://","https://")),e+="?lightbox=on",c=document.createElement("iframe"),c.src=e,b.appendChild(c);var f;if(d&&HZ.data.HouzzImpTracking.get(d.id)&&(f=HZ.data.HouzzImpTracking.get(d.id))&&f.length>0)for(var g=0;g<f.length;g++){var h=f[g];h&&h.length>0&&HZ.lb.Utils.registerTrackingUrl(h,d.id)}}},HZ.lb.plugins.AlternativeImages=new function(){var a,b,c;this.setOwner=function(d){a=d,b=$('<div class="alt-images">'),c=b.get(0),a.addImageControl(c),b.click(this.handleThumbClicked.bind(this))},this.imageDataUpdated=function(){this.imageChanged()},this.imageChanged=function(){if(!a.isEditMode()){var c,d,e=a.getCurrentSpace(),f=e.id,g=e.iids,h="",i=g.length,j=i>0,k=1==i;if(j){h="";for(var l=0;l<i;l++){d=HZ.utils.Links.getSpaceImageUrl(f,60,60,null,null,l),c=0==l?"selected":"",k&&(c+=" hide");var m={SPACE_ID:f,INDEX:l,WIDTH:60,HEIGHT:60,CSS_CLASS:c,SRC:d};h+=HZ.utils.Html.template('<img s="%SPACE_ID%" width="%WIDTH%" height="%HEIGHT%" class="%CSS_CLASS%" src="%SRC%" />',m)}}b.html(h),b.css("top",-b.parent().height()/2+"px")}},this.handleThumbClicked=function(a){var c=$(a.target),d=c.index();$.isNumeric(d)&&(b.find("img").removeClass("selected"),c.addClass("selected"),HZ.lb.plugins.ImageViewer.setActiveSpaceImageIndex(d))}},HZ.lb.plugins.Comments=function(){var a,b,c,d=HZ.lb.Config.contentGroupIds.DISCUSSION;this.setOwner=function(e){a=e,b=$('<section id="lbComments" class="lbInfoBox separator trackMe"></section>'),c=b.get(0),a.addInfoBoxToContentGroup(c,"comments",d),b.click($.proxy(this.handleDivClicked,this))},this.imageDataUpdated=function(){this.imageChanged()},this.imageChanged=function(){this.updateContents()},this.updateContents=function(){var b,d,e="",f="",g=a.getCurrentSpace(),h=g.bc;if(g&&g.fullyLoaded&&h>0){var i=g.bcf,j=a.isColorPickerSavedPalette();if(g.commentsLoaded)if(d=HZ.data.Comments.get(g.id)){for(var k in d){b=d[k];for(var l=0;b&&l<b.length;l++){var m=b[l],n=m.c,o=HZ.utils.Links.getGalleryLink(m.gid),p=m.title,q={tag:"a",attr:{href:o,target:"_blank"}};f+="<div class='commentsItem'>",f+="<div class='commentsItemUser'>"+HZ.ui.render.User.getUserImageHtml(m.uid,!0)+"</div>",f+="<div class='commentsItemText text-s'><small class='text-xs' scopeid='idbk_view'>"+_hgt("Added to <t1>{galleryTitle}</t1>:",{t1:q,galleryTitle:p})+'</small><br>"'+n+'"</div>',f+="</div>"}}f&&(e="<div class='title text-m text-bold'>",g.prod?e+=_hgtp("","This Product was added to {ideabookCount} ideabook:","This Product was added to {ideabookCount} ideabooks, including:",h,{ideabookCount:i}):e+=j?_hgtp("","This Palette was added to {ideabookCount} ideabook:","This Palette was added to {ideabookCount} ideabooks, including:",h,{ideabookCount:i}):_hgtp("","This Photo was added to {ideabookCount} ideabook:","This Photo was added to {ideabookCount} ideabooks, including:",h,{ideabookCount:i}),e+="</div>",e+="<div class='commentsList'>"+f+"</div>")}else e+="<div class='title text-m text-bold'>",g.prod?e+=_hgtp("","This Product was added to {ideabookCount} ideabook.","This Product was added to {ideabookCount} ideabooks.",h,{ideabookCount:i}):e+=j?_hgtp("","This Palette was added to {ideabookCount} ideabook.","This Palette was added to {ideabookCount} ideabooks.",h,{ideabookCount:i}):_hgtp("","This Photo was added to {ideabookCount} ideabook.","This Photo was added to {ideabookCount} ideabooks.:",h,{ideabookCount:i}),e+="</div>";else e+="<div class='title text-m text-bold'>",g.prod?e+=_hgtp("","This Product was added to {ideabookCount} ideabook.","This Product was added to {ideabookCount} ideabooks.",h,{ideabookCount:i}):e+=j?_hgtp("","This Palette was added to {ideabookCount} ideabook.","This Palette was added to {ideabookCount} ideabooks.",h,{ideabookCount:i}):_hgtp("","This Photo was added to {ideabookCount} ideabook.","This Photo was added to {ideabookCount} ideabooks.",h,{ideabookCount:i}),e+=" <a href='javascript:;' class='loadComments text-bold text-s icon-wrap'>"+_hgt("More")+"<span class='more-icon'></span></a>",e+="</div>"}c.innerHTML=e},this.handleDivClicked=function(b){a.getCurrentSpace().commentsLoaded?this.updateAndFocus():this.loadComments()},this.loadComments=function(){HZ.lb.plugins.SpaceDataLoader.loadSpaceBuzz().then(function(){this.updateAndFocus()}.bind(this))},this.updateAndFocus=function(){this.updateContents(),a.scrollToSelector("#lbComments")}},HZ.lb.plugins.PaletteSourcePhoto=function(){var a,b,c,d=HZ.lb.Config.contentGroupIds.OVERVIEW;this.setOwner=function(c){a=c,b=$('<section id="lbPaletteSourcePhoto" class="lbInfoBox separator"></section>')[0],a.addInfoBoxToContentGroup(b,"paletteSourcePhoto",d),$(b).click(this.handleDivClicked)},this.imageChanged=function(){var d,e=a.getCurrentSpace();if(a.isColorPickerSavedPalette()){if($(b).closest(".column").addClass("o-visible"),c&&(d=c.id),(c=HZ.data.ColorPaletteSource.get(e.id))&&c.id>0&&c.id!=d){
var f="",g=HZ.utils.Links.getSpaceImageUrl(c.id,142,142);f+="<div class='sourcePhotoContainer'>",f+="<div class='title text-s text-bold mbm'>",f+="<a class='sourcePhoto' target='_blank' href='"+c.u+"'>",f+=_hgt("Colors from this space"),f+="<span class='more-icon'></span>",f+="</a>",f+="</div>",f+="<div id='spaceImage'>",f+="<img width='142' height='142' s='"+c.id+"' i='0' class='rowFirst' src='"+g+"'>",f+="<div class='title' s='"+c.id+"' i='0'>"+c.t+"</div>",f+="</div>",f+="</div>",b.innerHTML=f}}else c=null,b.innerHTML=""},this.imageDataUpdated=function(){this.imageChanged()},this.handleDivClicked=function(b){var d=$(b.target),e=a.getCurrentSpace();if(d.attr("s")||(d=d.parent("div")),d.attr("s")){var f=d.attr("s"),g=d.attr("i");if(c){var h={};h[HZ.lb.Config.DESCRIPTOR_FIELD_SPACE_ID]=c.id;var i=new HZ.lb.Context("palette_source_photo_"+e.id,HZ.lb.Config.CONTEXT_TYPE_PALETTE_SOURCE_PHOTO,h,[c.id],1,g+1,-1);i.setCurrentSpaceId(f),a.pushContext(i),a.refresh()}}}},HZ.lb.plugins.ShoppingCart=function(){var a,b,c,d,e,f,g,h,i,j;this.setOwner=function(b){a=b},this.lightboxLoaded=function(){if(b=HZ.lb.Config.isCheckoutEnabled){j=HZ.data.cachedCartCount;var i=this.formatCartCount(j),k={TITLE_ATTR:_hgt("View Your Shopping Cart"),CART_URL:HZ.utils.Config.viewShoppingCartUrl,CART_COUNT:i};c=$("#lbCart").length?$("#lbCart"):$(HZ.utils.Html.template('<div id="lbCart" class="hidden"><a class="cart-info" title="%TITLE_ATTR%" href="%CART_URL%" target="_blank"><i class="cart-icon icon-font icon-shopping_cart"></i><span class="cart-count">%CART_COUNT%</span></a></div>',k)).appendTo($("#lbMainControls")),d=c.find(".cart-count"),e=$('<div class="cart-preview-pos hidden"><div class="cart-preview-scroll"><div class="cart-preview"><div class="cart-loading"></div></div></div></div>'),f=e.find(".cart-preview-scroll"),g=e.find(".cart-preview"),h=g.find(".cart-loading"),a.addOverlaidContent(e),HZ.cart.Actions.subscribeCartUpdate("lightbox",this.onCartUpdate.bind(this)),this.updateCartDisplay(j),c.hover(this.showCartPreview.bind(this)),e.on("mouseleave",this.showCartPreview.bind(this))}},this.showCartPreview=function(a){switch(g.is(".loading, .loaded")?this.updateCartStickyButton():(g.addClass("loading"),HZ.ajaz.Services.Cart.getCartDetails(this.handleCartDetailsResponse.bind(this))),a.type){case"mouseenter":e.removeClass("hidden"),c.addClass("lb-cart--active");break;case"mouseleave":a.relatedTarget!=e.get(0)&&(e.addClass("hidden"),c.removeClass("lb-cart--active"))}},this.handleCartDetailsResponse=function(a){a&&this.updateCartPreviewDisplay(a.cartHeaderHTML),g.removeClass("loading").addClass("loaded")},this.onCartUpdate=function(a,b){void 0!==b.cartCount&&(HZ.data.cachedCartCount=b.cartCount,this.updateCartDisplay(b.cartCount,b.cartHeaderHTML))},this.updateCartDisplay=function(a,e){$.isNumeric(a)&&b?(d.html(this.formatCartCount(a)),e&&this.updateCartPreviewDisplay(e),c.removeClass("hidden")):c.addClass("hidden")},this.updateCartPreviewDisplay=function(a){g.empty().append(a),i=g.find(".viewCart").clone().addClass("view-cart--sticky").appendTo(e),this.updateCartStickyButton()},this.formatCartCount=function(a){return a>9?"9+":a},this.imageResized=function(){this.updateCartStickyButton()},this.updateCartStickyButton=function(){if(b){var a=f.get(0),c=a.offsetHeight<a.scrollHeight;i&&i.toggleClass("hidden",!c)}}},HZ.lb.plugins.PPCAdInfoRenderer=new function(){var a;this.setOwner=function(b){a=b},this.imageChanged=function(){},this.imageDataUpdated=function(){},this.writeContent=function(b,c,d,e){var f,g=$(c);if(!a.isEditMode()&&(b&&(f=HZ.data.PPCAds.get(b.id)),f&&!(a.isFeaturedGalleryContext()||a.isFullPageAd()||a.isSpotlightContext()||a.isProductAd()||a.isColorPickerSavedPalette()))){if(f.products&&f.products.length>0){for(var h=HZ.lb.Utils.calculateThumbWidth(a.getContentBox().w-32,d,8),i=h,j=h,k=[],l=Math.min(f.products.length,e),m=0;m<l;m++){var n=f.products[m],o=n.sid,p=HZ.utils.Links.getSpaceImageUrl(o,i,j,1),q=n.tlink,r=n.p;HZ.utils.Html.template(HZ.lb.Templates.THUMB_META_TEMPLATE,{PRICE:r});k.push({SPACE_ID:o,CLICK_URL:q,INDEX:m,IMG_SRC:p,WIDTH:i,HEIGHT:j,OVERLAY_TEXT:n.mp?_hgt("Shop Houzz"):_hgt("Visit Store"),PPC_INFO:r})}g.append(HZ.lb.RenderUtils.renderSectionHeader(_hgt("Sponsored Products"))),g.append(HZ.lb.RenderUtils.renderThumbGrid(d,k,"",HZ.lb.Templates.PPC_THUMB,"lb_ppc_products"))}f.impTrkLink&&HZ.lb.Utils.registerTrackingUrl(f.impTrkLink,b.id)}}},HZ.lb.plugins.FeaturedSalesRenderer=new function(){var a,b,c=HZ.lb.Config.contentGroupIds.PRODUCTS;this.setOwner=function(d){a=d,b=$('<section id="lbFeaturedSales" class="lbInfoBox featured-sales separator"></section>')[0],a.addInfoBoxToContentGroup(b,"featured-sales",c)},this.imageChanged=function(){var c=a.getCurrentSpace();$(b).empty(),HZ.lb.plugins.FeaturedSalesRenderer.writeContent(c,b,1,2)},this.imageDataUpdated=function(){this.imageChanged()},this.writeContent=function(b,c,d,e){var f,g=$(c);if(!a.isEditMode()&&(b&&(f=HZ.data.FeaturedSales.get(b.id)),f&&!(a.isFeaturedGalleryContext()||a.isFullPageAd()||a.isSpotlightContext()||a.isProductAd()||a.isColorPickerSavedPalette())&&f.galleries&&f.galleries.length>0)){for(var h=[],i=Math.min(f.galleries.length,e),j=0;j<i;j++){var k=f.galleries[j],l=k.galleryId,m=k.imgSpaceId,n=HZ.utils.Links.getSpaceImageUrl(m,128,128),o=k.url,p=k.title,q=k.subTitle,r=k.salePercentOffHtml;h.push({TITLE:p,SUB_TITLE:q,SPACE_ID:l,CLICK_URL:o,INDEX:j,IMG_SRC:n,WIDTH:128,HEIGHT:128,SALE_PERCENT_OFF_HTML:r,OVERLAY_TEXT:_hgt("Shop Houzz")})}g.append(HZ.lb.RenderUtils.renderSectionHeader(_hgt("Shop Houzz"))),g.append(HZ.lb.RenderUtils.renderThumbGrid(d,h,"featured-sale",HZ.lb.Templates.FEATURED_SALES_THUMB,"lb_featured_sales"))}}},HZ.lb.plugins.FooterPromo=function(){var a,b,c=null,d={TRADE_SIGNUP:{TYPE:"trade",template:'<div id="footerTradePromo" class="trade-promo trade-promo--footer" scopeId="trade_promo" compid="footer_card"><div class="trade-promo__body"><div class="trade-promo__img"><img src="%IMG_URL%"/></div><p class="trade-promo__message mtm mbm ms300">%BODY%</p><a target="_blank" class="trade-promo__link btn btn-primary btn-lg" href="%URL%">%CTA%</a><button class="trade-promo__dismiss btn btn-link text-s"><span class="text-s text-gray-lightest icon-font icon-close"></span></button></div>'}};this.setOwner=function(c){b=c,a=$('<div id="lbFooterPromo"/>'),b.addLbImageLayer(a),$("#lbFooterPromo").on("click",".trade-promo__dismiss",this.onDismissTradePromo)},this.imageChanged=function(){var a=b.isProduct(),e=null;e=HZ.lb.Config.isTradePromoEnabled&&a?d.TRADE_SIGNUP.TYPE:null,e!==c?(c=e,this.updatePromo(this.getPromoHTML(e))):e||(c=null,this.hidePromo())},this.getPromoHTML=function(a){var b="";switch(a){case d.TRADE_SIGNUP.TYPE:b=this.writeTradePromo(),HZ.utils.Logger.sendEventLogLightweight("tp_promo_footer",{page:"lb"})}return b},this.writeTradePromo=function(){var a=_hgt("Unlock trade pricing on millions of products with the <t1>Houzz Trade Program</t1>",{t1:{tag:"span",attr:{class:"highlighted"}}});return $(HZ.utils.Html.template(d.TRADE_SIGNUP.template,{BODY:a,CTA:_hgt("Join Now"),IMG_URL:HZ.utils.Links.getPicUrl("trade_promo_furniture_bw.svg"),URL:HZ.utils.Links.getPageUrl("trade-program")}))},this.updatePromo=function(b){a.html(b)},this.hidePromo=function(){a.empty()},this.onDismissTradePromo=function(){HZ.TradePromo&&HZ.TradePromo.dismiss&&HZ.TradePromo.dismiss()}},HZ.lb.plugins.ContentFooter=function(){var a,b={},c=["termsOfUse","privacyPolicy","copyrightNotice"];this.setOwner=function(b){a=b},this.getFooterItemHtml=function(a){var b;if(a.hasOwnProperty("htmlLiteral"))b=a.htmlLiteral;else{var c=a.hasOwnProperty("url")?a.url:"",d=a.hasOwnProperty("compactLabel")?a.compactLabel:a.hasOwnProperty("label")?a.label:"",e=a.hasOwnProperty("compId")?a.compId:"",f="";e.length&&(f=HZ.utils.Html.template('compid="lb_%COMP_ID%"',{COMP_ID:e}));var g=a.hasOwnProperty("titleAttr")?a.titleAttr:"",h=a.hasOwnProperty("targetAttr")?a.targetAttr:"",i=a.hasOwnProperty("relAttr")?a.relAttr:"",j=a.hasOwnProperty("classAttr")?a.classAttr:"";b=HZ.utils.Html.template('<a href="%URL%" %COMP_ID_ATTR% %TITLE_ATTR% %TARGET_ATTR% %REL_ATTR% %CLASS_ATTR%>%LABEL%</a>',{URL:c,COMP_ID_ATTR:f,TITLE_ATTR:g,TARGET_ATTR:h,REL_ATTR:i,CLASS_ATTR:j,LABEL:d})}return b},this.lightboxLoaded=function(){var d=a.getContentFooter(),e=a.isViewSpace();if(d.is(":empty")&&e&&"false"!==e){var f=[],g=$.extend(!0,{},HZ.lb.Config.footerData);c.forEach(function(a){b[a]=HZ.lb.Config.footerData[a],delete g[a]}),Object.keys(g).forEach(function(a){var b=g[a],c=$("<li>").append(this.getFooterItemHtml(b)).addClass("text-xs");f.push($("<div>").append(c).html())}.bind(this));var h=$("<li>");h.append(b.copyrightNotice.label),f.push($("<div>").append(h).html()),d.append(HZ.utils.Html.template('<div class="row trackMe text-center"><div class="col-xs-10 col-xs-offset-1"><ul class="list-unstyled list-inline">%FOOTER_ITEMS%</ul></div></div>',{FOOTER_ITEMS:f.join("")}))}}},HZ.lb.plugins.Analytics=function(){var a,b,c,d;this.setOwner=function(b){a=b,this.reset()},this.reset=function(){c={scroll:{}},b=null,d=0},this.imageChanged=function(){var c=a.getCurrentSpace(),d=c.id,e=!0;if(b!=d){switch(HZ.lb.Config.TRACK_IMPRESSIONS){case!1:e=!1;break;case"CONTEXT_ONLY":e=a.getContextStack().length>1}e&&!a.isEditMode()&&this.sendImpressionReport()}b=d},this.sendImpressionReport=function(){var c=a.getContextStack(),d=c.length>1,e=a.getContext(),f={isChild:d};$.extend(!0,f,e.getDescriptor()),f.bd&&!$.isPlainObject(f.bd)&&(f.bd=JSON.parse(f.bd));var g=e.getCursorPosition(),h={spaceId:a.getCurrentSpace().id,lbType:a.isProduct()?"product":"photo",ctx:f,idx:g};b?h.previousSpaceId=b:h.isFirstLightbox=!0,HZ.utils.Logger.sendEventLogLightweight("lb_impression",h)},this.imageDataUpdated=function(){},this.lightboxScroll=function(){var b=a.getContentScrollTop();if(b>d&&b>30){var e=a.getCurrentSpace().id;c.scroll[e]||(c.scroll[e]=this.sendScrollReport())}else d=b},this.sendScrollReport=function(){var b={spaceId:a.getCurrentSpace().id,type:a.isProduct()?"product":"space"};return HZ.utils.Logger.sendEventLogLightweight("lb_scroll",b)},this.lightboxLoaded=function(){this.reset()},this.lightboxUnloaded=function(){this.reset()}},HZ.lb.plugins.LightBoxTips={owner:null,targetSelector:"#lbActionsCenter .save",bubbleWidth:420,offsetX:null,setOwner:function(a){this.owner=a,HZ.lb.Config.showSavePhotoTip&&$(".btn.save").one("click.lightBoxTip",function(){$("#savePhotoTip .close").click()})},getContent:function(){return"<i class='homepageTipIcon hzi-font hzi-Photos-Heart'></i><div class='homepageTipContent'><div class='homepageTipTitle text-l'><p></p></div><div class='homepageTipMsg text-m'><p>"+_hgt("Save ideas for your dream home in one place and access on any device.")+"</p></div></div>"},calculateOffsetX:function(){var a=$(this.targetSelector);return a?(targetPaddingLeft=parseInt(a.css("padding-left")),targetMarginLeft=parseInt(a.css("margin-left")),targetBorder=parseInt(a.css("borderLeftWidth")),targetWidth=a.width(),targetWidth/2+targetBorder+targetMarginLeft+targetPaddingLeft-this.bubbleWidth/2):0},getOffsetX:function(){return null===this.offsetX&&(this.offsetX=this.calculateOffsetX()),this.offsetX},setTitle:function(){var a=$("#lbActionsCenter .homepageTipTitle > p");this.owner.isProduct()?a.html(_hgt("Save this product for yourself")):a.html(_hgt("Save this photo for yourself"))},lightboxLoaded:function(){var a=$(this.targetSelector);a&&(this.owner.setAutoHideSpaceActionsEnabled(!1),HZ.utils.Logger.sendEventLogLightweight("lightBoxTipShown",{}),a.tipBubble({content:this.getContent(),point:"south",width:this.bubbleWidth,position:"absolute",showCloseBtn:!0,id:"savePhotoTip",offsetX:this.calculateOffsetX(),borderColor:"#d6d6d6",fadeDuration:0,onHide:$.proxy(function(){HZ.lb.Config.showSavePhotoTip=!1,this.owner.setAutoHideSpaceActionsEnabled(!0),this.owner.removePlugin(HZ.lb.plugins.LightBoxTips),HZ.ajaz.Services.setVisitorProperty(HZ.ajaz.Services.VISITOR_PROPERTY_SHOW_SAVE_PHOTO_TIP,HZ.ajaz.Services.VISITOR_PROPERTY_SHOW_SAVE_PHOTO_TIP_OFF)},this)}),this.setTitle())},imageResized:function(){var a=$(this.targetSelector);a&&(a.tipBubble("show",{offsetX:this.calculateOffsetX()}),this.setTitle())},imageChanged:function(){var a=$(this.targetSelector);a&&(a.tipBubble("show",{offsetX:this.calculateOffsetX()}),this.setTitle())}},HZ.lb.plugins.SaveToUniversalGallery=function(){var a;this.setOwner=function(b){a=b,$(document).on("dialogOpened.saveToUniversalGallery",function(){a.isShowing()&&a.detachKeyboardHandler()}).on("dialogClosed.saveToUniversalGallery",function(){a.isShowing()&&a.attachKeyboardHandler()})}},HZ.lb.plugins.ProPerceptionBanner=function(){var a,b=!1;this.setOwner=function(b){a=b},this.imageChanged=function(){var c=$("#lbImageContainer"),d=a.getCurrentSpace(),e=HZ.modules.ProPerceptionBanner;e&&0!==c.length&&(d.spp?(b||(b=!0,e.init(c)),e.show(d)):e.hide())},this.imageDataUpdated=function(){this.imageChanged()}},HZ.lb.plugins.VisualMatchRightRail=new function(){var a,b,c=!1;this.setOwner=function(b){a=b},this.imageChanged=function(){var a=$("#lbMain");b=HZ.modules.VisualMatchRightRail,!c&&b?(c=!0,b.init(a)):c&&this.hide()},this.showNote=function(a){var c=a.tag,d={selectedTag:{tagId:c.tid,vendorName:c.v,comments:c.c,type:c.t},onClose:a.onClose||this.hide};b&&b.show(d)},this.show=function(a){var c=a.tag,d=a.recognitionData,e=c.sid,f=HZ.data.Spaces.get(c.sid),g={selectedTag:{targetSpaceId:e,tagId:c.tid,type:c.t},isOutOfStock:a.isOutOfStock,onBestMatchClick:a.onBestMatchClick,onRelatedClick:a.onRelatedClick,onClose:a.onClose||this.hide};f&&(g.targetSpace={title:f.t,imageId:this.getSpaceImageId(e),price:f.price}),d&&(d.sids&&(g.relatedProudcts=d.sids.map(function(a){var b=HZ.data.Spaces.get(a);return{spaceId:a,title:b.t,imageId:this.getSpaceImageId(a),price:b.price}},this)),g.relatedLinks=d.labels),b&&b.show(g)},this.hide=function(){b&&b.hide()},this.getSpaceImageId=function(a,b){var c=null,b=b||0,d=HZ.data.Spaces.get(a);return d?(d.iids&&d.iids[b]?c=d.iids[b]:d.ift&&(c=HZ.utils.Image.getPlaceHolderImageId(d.ft)),c):c}},HZ.lb.plugins.JukwaaDialogController=function(){var a;this.setOwner=function(b){a=b,$(document).on("dialogOpened.JukwaaDialogController",function(){a&&a.isShowing()&&a.detachKeyboardHandler()}).on("dialogClosed.JukwaaDialogController",function(){a&&a.isShowing()&&a.attachKeyboardHandler()})}},HZ.lb.plugins.ActionBarMoreMenu=function(){var a;this.setOwner=function(b){a=b,HZ.lb.plugins.ImageViewer.hideExpandBtn();var c=$('<a id="lbMoreMenuBtn" href="javascript:;" class="btn med tint" compid="lb_more_menu"><i class="icon icon-font icon-ellipsis"></i></a>');a.addActionItem(c,HZ.lb.ActionBar.ACTION_BAR_RIGHT),c.click(a.toggleMoreMenu.bind(a))},this.imageChanged=function(){a.hideMoreMenu()},this.actionsBarHidden=function(){a.hideMoreMenu()}},HZ.lb.Lightbox.initPlugins=function(){if(!HZ.lb.Lightbox.pluginsInitialized){var a=HZ.lb.Config.enableTagBoundingBox,b=HZ.lb.Config.enableTagsRedesign,c=HZ.lb.Config.isViewSpace,d=HZ.lb.Config.isCheckoutEnabled,e=HZ.lb.Config.enableCombinedRecommendPhotos;lightbox.addPlugin(new HZ.lb.plugins.Analytics),lightbox.addPlugin(HZ.lb.plugins.PhotoRelatedProducts),lightbox.addPlugin(HZ.lb.plugins.PhotoRecommendations),lightbox.addPlugin(HZ.lb.plugins.PPCAdInfoRenderer),lightbox.addPlugin(HZ.lb.plugins.CommonSpecificationRenderer),lightbox.addPlugin(HZ.lb.plugins.SpaceActions),lightbox.addPlugin(new HZ.lb.plugins.ProductInfo),lightbox.addPlugin(new HZ.lb.plugins.MainButton),lightbox.addPlugin(new HZ.lb.plugins.PPCProductRelatedProducts),lightbox.addPlugin(new HZ.lb.plugins.MPProductVariation),lightbox.addPlugin(new HZ.lb.plugins.ProductIdeabookComment),lightbox.addPlugin(new HZ.lb.plugins.PreSalesPhone),lightbox.addPlugin(new HZ.lb.plugins.ProductDescription),lightbox.addPlugin(new HZ.lb.plugins.ProductSpecification),HZ.lb.Config.isProductDocumentUIEnabled&&lightbox.addPlugin(new HZ.lb.plugins.ProductDocuments),d&&(HZ.lb.Config.enableProductCollections&&lightbox.addPlugin(new HZ.lb.plugins.ProductCollections),lightbox.addPlugin(new HZ.lb.plugins.ProductRelatedProducts),lightbox.addPlugin(new HZ.lb.plugins.ProductRecommendedProducts),lightbox.addPlugin(new HZ.lb.plugins.VisuallySimilarProducts),lightbox.addPlugin(new HZ.lb.plugins.CoBuyProducts),lightbox.addPlugin(new HZ.lb.plugins.RecentlyViewedProducts)),lightbox.addPlugin(new HZ.lb.plugins.ProductsInRoom),lightbox.addPlugin(new HZ.lb.plugins.ProductReviews),lightbox.addPlugin(new HZ.lb.plugins.ProductListingsInfo),HZ.lb.Config.showSimpleVersionLightbox?(lightbox.addPlugin(new HZ.lb.plugins.ActionBarMoreMenu),lightbox.addPlugin(new HZ.lb.plugins.SpaceShareDialog)):lightbox.addPlugin(new HZ.lb.plugins.SpaceShareButtons),lightbox.addPlugin(new HZ.lb.plugins.SpaceAuthorInfo),lightbox.addPlugin(new HZ.lb.plugins.SpaceInfo),lightbox.addPlugin(new HZ.lb.plugins.ProjectInfo),lightbox.addPlugin(new HZ.lb.plugins.FooterPromo),lightbox.addPlugin(new HZ.lb.plugins.LocalProsContact),lightbox.addPlugin(new HZ.lb.plugins.SponsoredProLists),lightbox.addPlugin(new HZ.lb.plugins.ProductAdInfo),d&&c&&lightbox.addPlugin(new HZ.lb.plugins.SpaceRelatedProducts),lightbox.addPlugin(new HZ.lb.plugins.ColorPickerCTA),d&&(c||lightbox.addPlugin(new HZ.lb.plugins.SpaceRelatedProducts),lightbox.addPlugin(new HZ.lb.plugins.SpacePPCAdInfo),lightbox.addPlugin(HZ.lb.plugins.FeaturedSalesRenderer)),lightbox.addPlugin(new HZ.lb.plugins.SpaceRecommendations),e||lightbox.addPlugin(new HZ.lb.plugins.RelatedPhotos),lightbox.addPlugin(new HZ.lb.plugins.PaidProInfo),lightbox.addPlugin(new HZ.lb.plugins.MarketPlaceAds),lightbox.addPlugin(HZ.lb.plugins.Gtm),lightbox.addPlugin(new HZ.lb.plugins.AdminMenu),a?b?lightbox.addPlugin(new HZ.lb.plugins.ImageTags3):lightbox.addPlugin(new HZ.lb.plugins.ImageTags2):lightbox.addPlugin(HZ.lb.plugins.ImageTags),lightbox.addPlugin(new HZ.lb.plugins.ProductRecommendations),lightbox.addPlugin(new HZ.lb.plugins.PaletteSourcePhoto),lightbox.addPlugin(new HZ.lb.plugins.SpaceSpecification),lightbox.addPlugin(HZ.lb.plugins.QuestionsInfo),lightbox.addPlugin(new HZ.lb.plugins.Comments),lightbox.addPlugin(HZ.lb.plugins.AlternativeImages),lightbox.addPlugin(HZ.lb.plugins.ContextBreadcrumbs),lightbox.addPlugin(HZ.lb.plugins.BrowserHistoryManager),lightbox.addPlugin(new HZ.lb.plugins.ColorPicker),lightbox.addPlugin(new HZ.lb.plugins.ShoppingCart),lightbox.addPlugin(new HZ.lb.plugins.ContentTabs),lightbox.addPlugin(new HZ.lb.plugins.ContentFooter),lightbox.addPlugin(new HZ.lb.plugins.TrackClick),lightbox.addPlugin(new HZ.lb.plugins.TrackingManager),lightbox.addPlugin(new HZ.lb.plugins.SaveToUniversalGallery),lightbox.addPlugin(new HZ.lb.plugins.JukwaaDialogController),lightbox.addPlugin(new HZ.lb.plugins.ProPerceptionBanner),lightbox.addPlugin(HZ.lb.plugins.VisualMatchRightRail),HZ.lb.Lightbox.pluginsInitialized=!0,HZ.lb.Config.showSavePhotoTip&&lightbox.addPlugin(HZ.lb.plugins.LightBoxTips),b&&$("#lbImageContainer").addClass("lbImageContainer-with-new-tags")}},HZ.lb.Config.loadPluginsNow&&HZ.lb.Lightbox.initPlugins();

window.hzmr.push("lightbox2.2Plugins:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End lightbox2.2Plugins.js  **************/
/************* Start jQ-AjaxFileUpload.js for locale it-IT **************/
try {!function(a){a.fn.ajaxfileupload=function(b){var c={params:{},action:"",onStart:function(){console.log("starting upload"),console.log(this)},onComplete:function(a){console.log("got response: "),console.log(a),console.log(this)},onCancel:function(){console.log("cancelling: "),console.log(this)},valid_extensions:["gif","png","jpg","jpeg","tif","tiff"],submit_button:null},d=!1;return b&&a.extend(c,b),HZ&&HZ.data&&HZ.data.CSRFToken&&(c.params.__ct=HZ.data.CSRFToken,c.params._csrf=HZ.data.CSRFToken),this.each(function(){var b=a(this);if(!0!==b.data("ajaxUploader-setup")){b.change(function(){d=!1,null==c.submit_button&&e()}),null==c.submit_button||c.submit_button.click(function(){d||e()});var e=function(){if(""==b.val())return c.onCancel.apply(b,[c.params]);var e=b.val().split(".").pop().toLowerCase();if("1"!=c.params.supportAllFiles&&-1==a.inArray(e,c.valid_extensions))c.onComplete.apply(b,[{status:!1,message:"The select file type is invalid. File must be "+c.valid_extensions.join(", ")+"."},c.params]);else{d=!0,g(b);!1!==c.onStart.apply(b)&&b.parent("form").submit()}};b.data("ajaxUploader-setup",!0);var f=function(b,e){var f,g=a(b).contents().find("body").text();try{f=a.parseJSON(a.trim(g))}catch(a){f=g}e.siblings().remove(),e.unwrap(),d=!1,c.onComplete.apply(e,[f,c.params])},g=function(b){var d="ajaxUploader-iframe-"+Math.round((new Date).getTime()/1e3);a("body").append('<iframe width="0" height="0" style="display:none;" name="'+d+'" id="'+d+'"/>'),a("#"+d).load(function(){f(this,b)}),b.wrap(function(){return'<form action="'+c.action+'" method="POST" enctype="multipart/form-data" target="'+d+'" />'}).after(function(){var a,b="";for(a in c.params)b+='<input type="hidden" name="'+a+'" value="'+c.params[a]+'" />';return b})}}})}}(jQuery);

window.hzmr.push("jQ-AjaxFileUpload:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End jQ-AjaxFileUpload.js  **************/
/************* Start summernote.js for locale it-IT **************/
try {!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a(window.jQuery)}(function(a){"function"!=typeof Array.prototype.reduce&&(Array.prototype.reduce=function(a,b){var c,d,e=this.length>>>0,f=!1;for(1<arguments.length&&(d=b,f=!0),c=0;e>c;++c)this.hasOwnProperty(c)&&(f?d=a(d,this[c],c,this):(d=this[c],f=!0));if(!f)throw new TypeError("Reduce of empty array with no initial value");return d}),"function"!=typeof Array.prototype.filter&&(Array.prototype.filter=function(a){if(void 0===this||null===this)throw new TypeError;var b=Object(this),c=b.length>>>0;if("function"!=typeof a)throw new TypeError;for(var d=[],e=arguments.length>=2?arguments[1]:void 0,f=0;f<c;f++)if(f in b){var g=b[f];a.call(e,g,f,b)&&d.push(g)}return d});var b,c="function"==typeof define&&define.amd,d=function(b){var c="Comic Sans MS"===b?"Courier New":"Comic Sans MS",d=a("<div>").css({position:"absolute",left:"-9999px",top:"-9999px",fontSize:"200px"}).text("mmmmmmmmmwwwwwww").appendTo(document.body),e=d.css("fontFamily",c).width(),f=d.css("fontFamily",b+","+c).width();return d.remove(),e!==f},e={isMac:navigator.appVersion.indexOf("Mac")>-1,isMSIE:navigator.userAgent.indexOf("MSIE")>-1||navigator.userAgent.indexOf("Trident")>-1,isFF:navigator.userAgent.indexOf("Firefox")>-1,jqueryVersion:parseFloat(a.fn.jquery),isSupportAmd:c,hasCodeMirror:c?require.specified("CodeMirror"):!!window.CodeMirror,isFontInstalled:d,isW3CRangeSupport:!!document.createRange},f=function(){var b=function(a){return function(b){return a===b}},c=function(a,b){return a===b},d=function(a){return function(b,c){return b[a]===c[a]}},e=function(){return!0},f=function(){return!1},g=function(a){return function(){return!a.apply(a,arguments)}},h=function(a,b){return function(c){return a(c)&&b(c)}},i=0;return{eq:b,eq2:c,peq2:d,ok:e,fail:f,self:function(a){return a},not:g,and:h,uniqueId:function(a){var b=++i+"";return a?a+b:b},rect2bnd:function(b){var c=a(document);return{top:b.top+c.scrollTop(),left:b.left+c.scrollLeft(),width:b.right-b.left,height:b.bottom-b.top}},invertObject:function(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[a[c]]=c);return b}}}(),g=function(){var b=function(a){return a[0]},c=function(a){return a[a.length-1]},d=function(a){return a.slice(0,a.length-1)},e=function(a){return a.slice(1)},g=function(a,b){for(var c=0,d=a.length;c<d;c++){var e=a[c];if(b(e))return e}},h=function(a,b){for(var c=0,d=a.length;c<d;c++)if(!b(a[c]))return!1;return!0},i=function(b,c){return-1!==a.inArray(c,b)},j=function(a,b){return b=b||f.self,a.reduce(function(a,c){return a+b(c)},0)},k=function(a){for(var b=[],c=-1,d=a.length;++c<d;)b[c]=a[c];return b},l=function(a,d){return a.length?e(a).reduce(function(a,b){var e=c(a);return d(c(e),b)?e[e.length]=b:a[a.length]=[b],a},[[b(a)]]):[]},m=function(a){for(var b=[],c=0,d=a.length;c<d;c++)a[c]&&b.push(a[c]);return b},n=function(a){for(var b=[],c=0,d=a.length;c<d;c++)i(b,a[c])||b.push(a[c]);return b},o=function(a,b){var c=a.indexOf(b);return-1===c?null:a[c+1]};return{head:b,last:c,initial:d,tail:e,prev:function(a,b){var c=a.indexOf(b);return-1===c?null:a[c-1]},next:o,find:g,contains:i,all:h,sum:j,from:k,clusterBy:l,compact:m,unique:n}}(),h=String.fromCharCode(160),i=function(){var b=function(b){return b&&a(b).hasClass("note-editable")},c=function(b){return b&&a(b).hasClass("note-control-sizing")},d=function(b){var c;if(b.hasClass("note-air-editor")){var d=g.last(b.attr("id").split("-"));return c=function(b){return function(){return a(b+d)}},{editor:function(){return b},editable:function(){return b},popover:c("#note-popover-"),handle:c("#note-handle-"),dialog:c("#note-dialog-")}}return c=function(a){return function(){return b.find(a)}},{editor:function(){return b},dropzone:c(".note-dropzone"),toolbar:c(".note-toolbar"),editable:c(".note-editable"),codable:c(".note-codable"),statusbar:c(".note-statusbar"),popover:c(".note-popover"),handle:c(".note-handle"),dialog:c(".note-dialog")}},j=function(a){return a=a.toUpperCase(),function(b){return b&&b.nodeName.toUpperCase()===a}},k=function(a){return a&&3===a.nodeType},l=function(a){return a&&/^BR|^IMG|^HR/.test(a.nodeName.toUpperCase())},m=function(a){return!b(a)&&(a&&/^DIV|^P|^LI|^H[1-7]/.test(a.nodeName.toUpperCase()))},n=j("LI"),o=function(a){return m(a)&&!n(a)},p=function(a){return!t(a)&&!q(a)&&!m(a)},q=function(a){return a&&/^UL|^OL/.test(a.nodeName.toUpperCase())},r=function(a){return a&&/^TD|^TH/.test(a.nodeName.toUpperCase())},s=j("BLOCKQUOTE"),t=function(a){return r(a)||s(a)||b(a)},u=j("A"),v=function(a){return p(a)&&!!C(a,m)},w=function(a){return p(a)&&!C(a,m)},x=j("BODY"),y=e.isMSIE?"&nbsp;":"<br>",z=function(a){return k(a)?a.nodeValue.length:a.childNodes.length},A=function(a){var b=z(a);return 0===b||!i.isText(a)&&1===b&&a.innerHTML===y},B=function(a){l(a)||z(a)||(a.innerHTML=y)},C=function(a,c){for(;a;){if(c(a))return a;if(b(a))break;a=a.parentNode}return null},D=function(a,c){c=c||f.fail;var d=[];return C(a,function(a){return b(a)||d.push(a),c(a)}),d},E=function(a,b){var c=D(a);return g.last(c.filter(b))},F=function(b,c){for(var d=D(b),e=c;e;e=e.parentNode)if(a.inArray(e,d)>-1)return e;return null},G=function(a,b){b=b||f.fail;for(var c=[];a&&!b(a);)c.push(a),a=a.previousSibling;return c},H=function(a,b){b=b||f.fail;for(var c=[];a&&!b(a);)c.push(a),a=a.nextSibling;return c},I=function(a,b){var c=[];return b=b||f.ok,function d(e){a!==e&&b(e)&&c.push(e);for(var f=0,g=e.childNodes.length;f<g;f++)d(e.childNodes[f])}(a),c},J=function(b,c){var d=b.parentNode,e=a("<"+c+">")[0];return d.insertBefore(e,b),e.appendChild(b),e},K=function(a,b){var c=b.nextSibling,d=b.parentNode;return c?d.insertBefore(a,c):d.appendChild(a),a},L=function(b,c){return a.each(c,function(a,c){b.appendChild(c)}),b},M=function(a){return 0===a.offset},N=function(a){return a.offset===z(a.node)},O=function(a){return M(a)||N(a)},P=function(a,b){for(;a&&a!==b;){if(0!==R(a))return!1;a=a.parentNode}return!0},Q=function(a,b){for(;a&&a!==b;){if(R(a)!==z(a.parentNode)-1)return!1;a=a.parentNode}return!0},R=function(a){for(var b=0;a=a.previousSibling;)b+=1;return b},S=function(a){return!!(a&&a.childNodes&&a.childNodes.length)},T=function(a,c){var d,e;if(0===a.offset){if(b(a.node))return null;d=a.node.parentNode,e=R(a.node)}else S(a.node)?(d=a.node.childNodes[a.offset-1],e=z(d)):(d=a.node,e=c?0:a.offset-1);return{node:d,offset:e}},U=function(a,c){var d,e;if(z(a.node)===a.offset){if(b(a.node))return null;d=a.node.parentNode,e=R(a.node)+1}else S(a.node)?(d=a.node.childNodes[a.offset],e=0):(d=a.node,e=c?z(a.node):a.offset+1);return{node:d,offset:e}},V=function(a,b){return a.node===b.node&&a.offset===b.offset},W=function(a){if(k(a.node)||!S(a.node)||A(a.node))return!0;var b=a.node.childNodes[a.offset-1],c=a.node.childNodes[a.offset];return!(b&&!l(b)||c&&!l(c))},X=function(a,b){for(;a;){if(b(a))return a;a=T(a)}return null},Y=function(a,b){for(;a;){if(b(a))return a;a=U(a)}return null},Z=function(a,b,c,d){for(var e=a;e&&(c(e),!V(e,b));){var f=d&&a.node!==e.node&&b.node!==e.node;e=U(e,f)}},$=function(b,c){var d=D(c,f.eq(b));return a.map(d,R).reverse()},_=function(a,b){for(var c=a,d=0,e=b.length;d<e;d++)c=c.childNodes.length<=b[d]?c.childNodes[c.childNodes.length-1]:c.childNodes[b[d]];return c},aa=function(a,b){if(k(a.node))return M(a)?a.node:N(a)?a.node.nextSibling:a.node.splitText(a.offset);var c=a.node.childNodes[a.offset],d=K(a.node.cloneNode(!1),a.node);return L(d,H(c)),b||(B(a.node),B(d)),d},ba=function(a,b,c){var d=D(b.node,f.eq(a));return d.length?1===d.length?aa(b,c):d.reduce(function(a,d){var e=K(d.cloneNode(!1),d);return a===b.node&&(a=aa(b,c)),L(e,H(a)),c||(B(d),B(e)),e}):null},ca=function(a){return document.createElement(a)},da=function(a){return document.createTextNode(a)},ea=function(a,b){if(a&&a.parentNode){if(a.removeNode)return a.removeNode(b);var c=a.parentNode;if(!b){var d,e,f=[];for(d=0,e=a.childNodes.length;d<e;d++)f.push(a.childNodes[d]);for(d=0,e=f.length;d<e;d++)c.insertBefore(f[d],a)}c.removeChild(a)}},fa=function(a,c){for(;a&&!b(a)&&c(a);){var d=a.parentNode;ea(a),a=d}},ga=function(a,b){if(a.nodeName.toUpperCase()===b.toUpperCase())return a;var c=ca(b);return a.style.cssText&&(c.style.cssText=a.style.cssText),L(c,g.from(a.childNodes)),K(c,a),ea(a),c},ha=j("TEXTAREA"),ia=function(b,c){var d=ha(b[0])?b.val():b.html();if(c){var e=/<(\/?)(\b(?!!)[^>\s]*)(.*?)(\s*\/?>)/g;d=d.replace(e,function(a,b,c){c=c.toUpperCase();var d=/^DIV|^TD|^TH|^P|^LI|^H[1-7]/.test(c)&&!!b,e=/^BLOCKQUOTE|^TABLE|^TBODY|^TR|^HR|^UL|^OL/.test(c);return a+(d||e?"\n":"")}),d=a.trim(d)}return d},ja=function(a){return a.val().replace(/[\n\r]/g,"")};return{NBSP_CHAR:h,ZERO_WIDTH_NBSP_CHAR:"\ufeff",blank:y,emptyPara:"<p>"+y+"</p>",isEditable:b,isControlSizing:c,buildLayoutInfo:d,isText:k,isPara:m,isPurePara:o,isInline:p,isBodyInline:w,isBody:x,isParaInline:v,isList:q,isTable:j("TABLE"),isCell:r,isBlockquote:s,isBodyContainer:t,isAnchor:u,isDiv:j("DIV"),isLi:n,isSpan:j("SPAN"),isB:j("B"),isU:j("U"),isS:j("S"),isI:j("I"),isImg:j("IMG"),isTextarea:ha,isEmpty:A,isEmptyAnchor:f.and(u,A),nodeLength:z,isLeftEdgePoint:M,isRightEdgePoint:N,isEdgePoint:O,isLeftEdgeOf:P,isRightEdgeOf:Q,prevPoint:T,nextPoint:U,isSamePoint:V,isVisiblePoint:W,prevPointUntil:X,nextPointUntil:Y,walkPoint:Z,ancestor:C,listAncestor:D,lastAncestor:E,listNext:H,listPrev:G,listDescendant:I,commonAncestor:F,wrap:J,insertAfter:K,appendChildNodes:L,position:R,hasChildren:S,makeOffsetPath:$,fromOffsetPath:_,splitTree:ba,create:ca,createText:da,remove:ea,removeWhile:fa,replace:ga,html:ia,value:ja}}(),j={version:"0.5.10",options:{width:null,height:null,minHeight:null,maxHeight:null,focus:!1,tabsize:4,styleWithSpan:!0,disableLinkTarget:!1,disableDragAndDrop:!1,disableResizeEditor:!1,codemirror:{mode:"text/html",htmlMode:!0,lineNumbers:!0},lang:"en-US",direction:null,toolbar:[["style",["style"]],["font",["bold","italic","underline","superscript","subscript","strikethrough","clear"]],["fontname",["fontname"]],["color",["color"]],["para",["ul","ol","paragraph"]],["height",["height"]],["table",["table"]],["insert",["link","picture","video","hr"]],["view",["fullscreen","codeview"]],["help",["help"]]],airMode:!1,airPopover:[["color",["color"]],["font",["bold","underline","clear"]],["para",["ul","paragraph"]],["table",["table"]],["insert",["link","picture"]]],styleTags:["p","blockquote","pre","h1","h2","h3","h4","h5","h6"],defaultFontName:"Helvetica Neue",fontNames:["Arial","Arial Black","Comic Sans MS","Courier New","Helvetica Neue","Impact","Lucida Grande","Tahoma","Times New Roman","Verdana"],colors:[["#000000","#424242","#636363","#9C9C94","#CEC6CE","#EFEFEF","#F7F7F7","#FFFFFF"],["#FF0000","#FF9C00","#FFFF00","#00FF00","#00FFFF","#0000FF","#9C00FF","#FF00FF"],["#F7C6CE","#FFE7CE","#FFEFC6","#D6EFD6","#CEDEE7","#CEE7F7","#D6D6E7","#E7D6DE"],["#E79C9C","#FFC69C","#FFE79C","#B5D6A5","#A5C6CE","#9CC6EF","#B5A5D6","#D6A5BD"],["#E76363","#F7AD6B","#FFD663","#94BD7B","#73A5AD","#6BADDE","#8C7BC6","#C67BA5"],["#CE0000","#E79439","#EFC631","#6BA54A","#4A7B8C","#3984C6","#634AA5","#A54A7B"],["#9C0000","#B56308","#BD9400","#397B21","#104A5A","#085294","#311873","#731842"],["#630000","#7B3900","#846300","#295218","#083139","#003163","#21104A","#4A1031"]],fontSizes:["8","9","10","11","12","14","18","24","36"],lineHeights:["1.0","1.2","1.4","1.5","1.6","1.8","2.0","3.0"],insertTableMaxSize:{col:10,row:10},oninit:null,onfocus:null,onblur:null,onenter:null,onkeyup:null,onkeydown:null,onImageUpload:null,onImageUploadError:null,onToolbarClick:null,onCreateLink:function(a){return-1!==a.indexOf("@")&&-1===a.indexOf(":")?a="mailto:"+a:-1===a.indexOf("://")&&(a="http://"+a),a},keyMap:{pc:{ENTER:"insertParagraph","CTRL+Z":"undo","CTRL+Y":"redo",TAB:"tab","SHIFT+TAB":"untab","CTRL+B":"bold","CTRL+I":"italic","CTRL+U":"underline","CTRL+SHIFT+S":"strikethrough","CTRL+BACKSLASH":"removeFormat","CTRL+SHIFT+L":"justifyLeft","CTRL+SHIFT+E":"justifyCenter","CTRL+SHIFT+R":"justifyRight","CTRL+SHIFT+J":"justifyFull","CTRL+SHIFT+NUM7":"insertUnorderedList","CTRL+SHIFT+NUM8":"insertOrderedList","CTRL+LEFTBRACKET":"outdent","CTRL+RIGHTBRACKET":"indent","CTRL+NUM0":"formatPara","CTRL+NUM1":"formatH1","CTRL+NUM2":"formatH2","CTRL+NUM3":"formatH3","CTRL+NUM4":"formatH4","CTRL+NUM5":"formatH5","CTRL+NUM6":"formatH6","CTRL+ENTER":"insertHorizontalRule","CTRL+K":"showLinkDialog"},mac:{ENTER:"insertParagraph","CMD+Z":"undo","CMD+SHIFT+Z":"redo",TAB:"tab","SHIFT+TAB":"untab","CMD+B":"bold","CMD+I":"italic","CMD+U":"underline","CMD+SHIFT+S":"strikethrough","CMD+BACKSLASH":"removeFormat","CMD+SHIFT+L":"justifyLeft","CMD+SHIFT+E":"justifyCenter","CMD+SHIFT+R":"justifyRight","CMD+SHIFT+J":"justifyFull","CMD+SHIFT+NUM7":"insertUnorderedList","CMD+SHIFT+NUM8":"insertOrderedList","CMD+LEFTBRACKET":"outdent","CMD+RIGHTBRACKET":"indent","CMD+NUM0":"formatPara","CMD+NUM1":"formatH1","CMD+NUM2":"formatH2","CMD+NUM3":"formatH3","CMD+NUM4":"formatH4","CMD+NUM5":"formatH5","CMD+NUM6":"formatH6","CMD+ENTER":"insertHorizontalRule","CMD+K":"showLinkDialog"}}},lang:{"en-US":{font:{bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",subscript:"Subscript",superscript:"Superscript",clear:"Remove Font Style",height:"Line Height",name:"Font Family",size:"Font Size"},image:{image:"Picture",insert:"Insert Image",resizeFull:"Resize Full",resizeHalf:"Resize Half",resizeQuarter:"Resize Quarter",floatLeft:"Float Left",floatRight:"Float Right",floatNone:"Float None",shapeRounded:"Shape: Rounded",shapeCircle:"Shape: Circle",shapeThumbnail:"Shape: Thumbnail",shapeNone:"Shape: None",dragImageHere:"Drag an image here",selectFromFiles:"Select from files",remove:"Remove Image"},link:{link:"Link",insert:"Insert Link",unlink:"Unlink",edit:"Edit",openInNewWindow:"Open in new window"},video:{video:"Video",videoLink:"Video Link",insert:"Insert Video"},table:{table:"Table"},hr:{insert:"Insert Horizontal Rule"},style:{style:"Style",normal:"Normal",blockquote:"Quote",pre:"Code",h1:"Header 1",h2:"Header 2",h3:"Header 3",h4:"Header 4",h5:"Header 5",h6:"Header 6"},lists:{unordered:"Unordered list",ordered:"Ordered list"},options:{help:"Help",fullscreen:"Full Screen",codeview:"Code View"},paragraph:{paragraph:"Paragraph",outdent:"Outdent",indent:"Indent",left:"Align left",center:"Align center",right:"Align right",justify:"Justify full"},color:{recent:"Recent Color",more:"More Color",background:"Background Color",foreground:"Foreground Color",transparent:"Transparent",setTransparent:"Set transparent",reset:"Reset",resetToDefault:"Reset to default"},shortcut:{shortcuts:"Keyboard shortcuts",close:"Close",textFormatting:"Text formatting",action:"Action",paragraphFormatting:"Paragraph formatting",documentStyle:"Document Style"},history:{undo:"Undo",redo:"Redo"}}}},k=function(){return{readFileAsDataURL:function(b){return a.Deferred(function(c){a.extend(new FileReader,{onload:function(a){var b=a.target.result;c.resolve(b)},onerror:function(){c.reject(this)}}).readAsDataURL(b)}).promise()},createImage:function(b,c){return a.Deferred(function(d){a("<img>").one("load",function(){d.resolve(a(this))}).one("error abort",function(){d.reject(a(this))}).css({display:"none"}).appendTo(document.body).attr("src",b).attr("data-filename",c)}).promise()}}}(),l={isEdit:function(a){return g.contains([8,9,13,32],a)},nameFromCode:{8:"BACKSPACE",9:"TAB",13:"ENTER",32:"SPACE",48:"NUM0",49:"NUM1",50:"NUM2",51:"NUM3",52:"NUM4",53:"NUM5",54:"NUM6",55:"NUM7",56:"NUM8",66:"B",69:"E",73:"I",74:"J",75:"K",76:"L",82:"R",83:"S",85:"U",89:"Y",90:"Z",191:"SLASH",219:"LEFTBRACKET",220:"BACKSLASH",221:"RIGHTBRACKET"}},m=function(){var b=function(b,c){if(e.jqueryVersion<1.9){var d={};return a.each(c,function(a,c){d[c]=b.css(c)}),d}return b.css.call(b,c)};this.stylePara=function(b,c){a.each(b.nodes(i.isPara,{includeAncestor:!0}),function(b,d){a(d).css(c)})},this.current=function(c,d){var e=a(i.isText(c.sc)?c.sc.parentNode:c.sc),f=["font-family","font-size","text-align","list-style-type","line-height"],g=b(e,f)||{};if(g["font-size"]=parseInt(g["font-size"],10),g["font-bold"]=document.queryCommandState("bold")?"bold":"normal",g["font-italic"]=document.queryCommandState("italic")?"italic":"normal",g["font-underline"]=document.queryCommandState("underline")?"underline":"normal",g["font-strikethrough"]=document.queryCommandState("strikeThrough")?"strikethrough":"normal",g["font-superscript"]=document.queryCommandState("superscript")?"superscript":"normal",g["font-subscript"]=document.queryCommandState("subscript")?"subscript":"normal",c.isOnList()){var h=["circle","disc","disc-leading-zero","square"],j=a.inArray(g["list-style-type"],h)>-1;g["list-style"]=j?"unordered":"ordered"}else g["list-style"]="none";var k=i.ancestor(c.sc,i.isPara);if(k&&k.style["line-height"])g["line-height"]=k.style.lineHeight;else{var l=parseInt(g["line-height"],10)/parseInt(g["font-size"],10);g["line-height"]=l.toFixed(1)}return g.image=i.isImg(d)&&d,g.anchor=c.isOnAnchor()&&i.ancestor(c.sc,i.isAnchor),g.ancestors=i.listAncestor(c.sc,i.isEditable),g.range=c,g}},n=function(){var b=function(a,b){var c,d,e=a.parentElement(),f=document.body.createTextRange(),h=g.from(e.childNodes);for(c=0;c<h.length;c++)if(!i.isText(h[c])){if(f.moveToElementText(h[c]),f.compareEndPoints("StartToStart",a)>=0)break;d=h[c]}if(0!==c&&i.isText(h[c-1])){var j=document.body.createTextRange(),k=null;j.moveToElementText(d||e),j.collapse(!d),k=d?d.nextSibling:e.firstChild;var l=a.duplicate();l.setEndPoint("StartToStart",j);for(var m=l.text.replace(/[\r\n]/g,"").length;m>k.nodeValue.length&&k.nextSibling;)m-=k.nodeValue.length,k=k.nextSibling;k.nodeValue;b&&k.nextSibling&&i.isText(k.nextSibling)&&m===k.nodeValue.length&&(m-=k.nodeValue.length,k=k.nextSibling),e=k,c=m}return{cont:e,offset:c}},c=function(a){var b=function(a,c){var d,e;if(i.isText(a)){var h=i.listPrev(a,f.not(i.isText)),j=g.last(h).previousSibling;d=j||a.parentNode,c+=g.sum(g.tail(h),i.nodeLength),e=!j}else{if(d=a.childNodes[c]||a,i.isText(d))return b(d,0);c=0,e=!1}return{node:d,collapseToStart:e,offset:c}},c=document.body.createTextRange(),d=b(a.node,a.offset);return c.moveToElementText(d.node),c.collapse(d.collapseToStart),c.moveStart("character",d.offset),c},d=function(b,h,j,k){this.sc=b,this.so=h,this.ec=j,this.eo=k;var l=function(){if(e.isW3CRangeSupport){var a=document.createRange();return a.setStart(b,h),a.setEnd(j,k),a}var d=c({node:b,offset:h});return d.setEndPoint("EndToEnd",c({node:j,offset:k})),d};this.getPoints=function(){return{sc:b,so:h,ec:j,eo:k}},this.getStartPoint=function(){return{node:b,offset:h}},this.getEndPoint=function(){return{node:j,offset:k}},this.select=function(){var a=l();if(e.isW3CRangeSupport){var b=document.getSelection();b.rangeCount>0&&b.removeAllRanges(),b.addRange(a)}else a.select()},this.normalize=function(){var a=function(a){return i.isVisiblePoint(a)||(i.isLeftEdgePoint(a)?a=i.nextPointUntil(a,i.isVisiblePoint):i.isRightEdgePoint(a)&&(a=i.prevPointUntil(a,i.isVisiblePoint))),a},b=a(this.getStartPoint()),c=a(this.getStartPoint());return new d(b.node,b.offset,c.node,c.offset)},this.nodes=function(a,b){a=a||f.ok;var c=b&&b.includeAncestor,d=b&&b.fullyContains,e=this.getStartPoint(),h=this.getEndPoint(),j=[],k=[];return i.walkPoint(e,h,function(b){if(!i.isEditable(b.node)){var e;d?(i.isLeftEdgePoint(b)&&k.push(b.node),i.isRightEdgePoint(b)&&g.contains(k,b.node)&&(e=b.node)):e=c?i.ancestor(b.node,a):b.node,e&&a(e)&&j.push(e)}},!0),g.unique(j)},this.commonAncestor=function(){return i.commonAncestor(b,j)},this.expand=function(a){var c=i.ancestor(b,a),e=i.ancestor(j,a);if(!c&&!e)return new d(b,h,j,k);var f=this.getPoints();return c&&(f.sc=c,f.so=0),e&&(f.ec=e,f.eo=i.nodeLength(e)),new d(f.sc,f.so,f.ec,f.eo)},this.collapse=function(a){return a?new d(b,h,b,h):new d(j,k,j,k)},this.splitText=function(){var a=b===j,c=this.getPoints();return i.isText(j)&&!i.isEdgePoint(this.getEndPoint())&&j.splitText(k),i.isText(b)&&!i.isEdgePoint(this.getStartPoint())&&(c.sc=b.splitText(h),c.so=0,a&&(c.ec=c.sc,c.eo=k-h)),new d(c.sc,c.so,c.ec,c.eo)},this.deleteContents=function(){if(this.isCollapsed())return this;var b=this.splitText(),c=b.nodes(null,{fullyContains:!0}),e=i.prevPointUntil(b.getStartPoint(),function(a){return!g.contains(c,a.node)}),f=[];return a.each(c,function(a,b){var c=b.parentNode;e.node!==c&&1===i.nodeLength(c)&&f.push(c),i.remove(b,!1)}),a.each(f,function(a,b){i.remove(b,!1)}),new d(e.node,e.offset,e.node,e.offset)};var m=function(a){return function(){var c=i.ancestor(b,a);return!!c&&c===i.ancestor(j,a)}};this.isOnEditable=m(i.isEditable),this.isOnList=m(i.isList),this.isOnAnchor=m(i.isAnchor),this.isOnCell=m(i.isCell),this.isLeftEdgeOf=function(a){if(!i.isLeftEdgePoint(this.getStartPoint()))return!1;var b=i.ancestor(this.sc,a);return b&&i.isLeftEdgeOf(this.sc,b)},this.isCollapsed=function(){return b===j&&h===k},this.wrapBodyInlineWithPara=function(){if(i.isBodyContainer(b)&&i.isEmpty(b))return b.innerHTML=i.emptyPara,new d(b.firstChild,0,b.firstChild,0);if(!i.isInline(b)||i.isParaInline(b))return this;var a=i.listAncestor(b,f.not(i.isInline)),c=g.last(a);i.isInline(c)||(c=a[a.length-2]||b.childNodes[h]);var e=i.listPrev(c,i.isParaInline).reverse();if(e=e.concat(i.listNext(c.nextSibling,i.isParaInline)),e.length){var j=i.wrap(g.head(e),"p");i.appendChildNodes(j,g.tail(e))}return this},this.insertNode=function(a,b){var c,d,e,f=this.wrapBodyInlineWithPara(),h=f.getStartPoint();if(b)d=i.isPara(h.node)?h.node:h.node.parentNode,e=i.isPara(h.node)?h.node.childNodes[h.offset]:i.splitTree(h.node,h);else{var j=i.listAncestor(h.node,i.isBodyContainer),k=g.last(j)||h.node;i.isBodyContainer(k)?(c=j[j.length-2],d=k):(c=k,d=c.parentNode),e=c&&i.splitTree(c,h)}return e?e.parentNode.insertBefore(a,e):d.appendChild(a),a},this.toString=function(){var a=l();return e.isW3CRangeSupport?a.toString():a.text},this.bookmark=function(a){return{s:{path:i.makeOffsetPath(a,b),offset:h},e:{path:i.makeOffsetPath(a,j),offset:k}}},this.getClientRects=function(){return l().getClientRects()}};return{create:function(a,c,f,g){if(arguments.length)2===arguments.length&&(f=a,g=c);else if(e.isW3CRangeSupport){var h=document.getSelection();if(0===h.rangeCount)return null;if(i.isBody(h.anchorNode))return null;var j=h.getRangeAt(0);a=j.startContainer,c=j.startOffset,f=j.endContainer,g=j.endOffset}else{var k=document.selection.createRange(),l=k.duplicate();l.collapse(!1);var m=k;m.collapse(!0);var n=b(m,!0),o=b(l,!1);i.isText(n.node)&&i.isLeftEdgePoint(n)&&i.isTextNode(o.node)&&i.isRightEdgePoint(o)&&o.node.nextSibling===n.node&&(n=o),a=n.cont,c=n.offset,f=o.cont,g=o.offset}return new d(a,c,f,g)},createFromNode:function(a){return this.create(a,0,a,1)},createFromBookmark:function(a,b){var c=i.fromOffsetPath(a,b.s.path),e=b.s.offset,f=i.fromOffsetPath(a,b.e.path),g=b.e.offset;return new d(c,e,f,g)}}}(),o=function(){this.insertTab=function(a,b,c){var d=i.createText(new Array(c+1).join(i.NBSP_CHAR));b=b.deleteContents(),b.insertNode(d,!0),b=n.create(d,c),b.select()},this.insertParagraph=function(){var b=n.create();b=b.deleteContents(),b=b.wrapBodyInlineWithPara();var c,d=i.ancestor(b.sc,i.isPara);if(d){c=i.splitTree(d,b.getStartPoint());var e=i.listDescendant(d,i.isEmptyAnchor);e=e.concat(i.listDescendant(c,i.isEmptyAnchor)),a.each(e,function(a,b){i.remove(b)})}else{var f=b.sc.childNodes[b.so];c=a(i.emptyPara)[0],f?b.sc.insertBefore(c,f):b.sc.appendChild(c)}n.create(c,0).normalize().select()}},p=function(){this.tab=function(a,b){var c=i.ancestor(a.commonAncestor(),i.isCell),d=i.ancestor(c,i.isTable),e=i.listDescendant(d,i.isCell),f=g[b?"prev":"next"](e,c);f&&n.create(f,0).select()},this.createTable=function(b,c){for(var d,e=[],f=0;f<b;f++)e.push("<td>"+i.blank+"</td>");d=e.join("");for(var g,h=[],j=0;j<c;j++)h.push("<tr>"+d+"</tr>");return g=h.join(""),a('<table class="table table-bordered">'+g+"</table>")[0]}},q=function(){this.insertOrderedList=function(){this.toggleList("OL")},this.insertUnorderedList=function(){this.toggleList("UL")},this.indent=function(){var b=this,c=n.create().wrapBodyInlineWithPara(),d=c.nodes(i.isPara,{includeAncestor:!0}),e=g.clusterBy(d,f.peq2("parentNode"));a.each(e,function(c,d){var e=g.head(d);i.isLi(e)?b.wrapList(d,e.parentNode.nodeName):a.each(d,function(b,c){a(c).css("marginLeft",function(a,b){return(parseInt(b,10)||0)+25})})}),c.select()},this.outdent=function(){var b=this,c=n.create().wrapBodyInlineWithPara(),d=c.nodes(i.isPara,{includeAncestor:!0}),e=g.clusterBy(d,f.peq2("parentNode"));a.each(e,function(c,d){var e=g.head(d);i.isLi(e)?b.releaseList([d]):a.each(d,function(b,c){a(c).css("marginLeft",function(a,b){return b=parseInt(b,10)||0,b>25?b-25:""})})}),c.select()},this.toggleList=function(b){var c=this,d=n.create().wrapBodyInlineWithPara(),e=d.nodes(i.isPara,{includeAncestor:!0}),h=g.clusterBy(e,f.peq2("parentNode"));if(g.find(e,i.isPurePara))a.each(h,function(a,d){c.wrapList(d,b)});else{var j=d.nodes(i.isList,{includeAncestor:!0}).filter(function(c){return!a.nodeName(c,b)});j.length?a.each(j,function(a,c){i.replace(c,b)}):this.releaseList(h,!0)}d.select()},this.wrapList=function(b,c){var d=g.head(b),e=g.last(b),f=i.isList(d.previousSibling)&&d.previousSibling,h=i.isList(e.nextSibling)&&e.nextSibling,j=f||i.insertAfter(i.create(c||"UL"),e);b=a.map(b,function(a){return i.isPurePara(a)?i.replace(a,"LI"):a}),i.appendChildNodes(j,b),h&&(i.appendChildNodes(j,g.from(h.childNodes)),i.remove(h))},this.releaseList=function(b,c){var d=[];return a.each(b,function(b,e){var f=g.head(e),h=g.last(e),j=c?i.lastAncestor(f,i.isList):f.parentNode,k=j.childNodes.length>1?i.splitTree(j,{node:h.parentNode,offset:i.position(h)+1},!0):null,l=i.splitTree(j,{node:f.parentNode,offset:i.position(f)},!0);e=c?i.listDescendant(l,i.isLi):g.from(l.childNodes).filter(i.isLi),!c&&i.isList(j.parentNode)||(e=a.map(e,function(a){return i.replace(a,"P")})),a.each(g.from(e).reverse(),function(a,b){i.insertAfter(b,j)});var m=g.compact([j,l,k]);a.each(m,function(b,c){var d=[c].concat(i.listDescendant(c,i.isList));a.each(d.reverse(),function(a,b){i.nodeLength(b)||i.remove(b,!0)})}),d=d.concat(e)}),d}},r=function(){var b=new m,c=new p,d=new o,f=new q;this.saveRange=function(a,b){a.focus(),a.data("range",n.create()),b&&n.create().collapse().select()},this.restoreRange=function(a){var b=a.data("range");b&&(b.select(),a.focus())},this.currentStyle=function(a){var c=n.create();return!!c&&(c.isOnEditable()&&b.current(c,a))};var h=this.triggerOnChange=function(a){var b=a.data("callbacks").onChange;b&&b(a.html(),a)};this.undo=function(a){a.data("NoteHistory").undo(),h(a)},this.redo=function(a){a.data("NoteHistory").redo(),h(a)};for(var j=this.afterCommand=function(a){a.data("NoteHistory").recordUndo(),h(a)},l=["bold","italic","underline","strikethrough","superscript","subscript","justifyLeft","justifyCenter","justifyRight","justifyFull","formatBlock","removeFormat","backColor","foreColor","insertHorizontalRule","fontName"],r=0,s=l.length;r<s;r++)this[l[r]]=function(a){return function(b,c){document.execCommand(a,!1,c),j(b)}}(l[r]);this.tab=function(a,b){var e=n.create();e.isCollapsed()&&e.isOnCell()?c.tab(e):(d.insertTab(a,e,b.tabsize),j(a))},this.untab=function(){var a=n.create();a.isCollapsed()&&a.isOnCell()&&c.tab(a,!0)},this.insertParagraph=function(a){d.insertParagraph(a),j(a)},this.insertOrderedList=function(a){f.insertOrderedList(a),j(a)},this.insertUnorderedList=function(a){f.insertUnorderedList(a),j(a)},this.indent=function(a){f.indent(a),j(a)},this.outdent=function(a){f.outdent(a),j(a)},this.insertImage=function(a,b,c){k.createImage(b,c).then(function(b){b.css({display:""}),n.create().insertNode(b[0]),j(a)}).fail(function(){var b=a.data("callbacks");b.onImageUploadError&&b.onImageUploadError()})},this.insertVideo=function(a,b){var c,d=/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/,e=b.match(d),f=/\/\/(player.)?vimeo.com\/([a-z]*\/)*([0-9]{6,11})[?]?.*/,g=b.match(f);if(e&&11===e[2].length){c={src:"//www.youtube.com/embed/"+e[2],width:"100%",height:"360"}}else g&&g[3].length&&(c={webkitallowfullscreen:"",mozallowfullscreen:"",allowfullscreen:"",src:"//player.vimeo.com/video/"+g[3],width:"100%",height:"360"});c&&this.insertIframe(a,null,null,null,c)},this.insertIframedImage=function(b,c,d,e,f,g){function h(b,c,d){d||(d=c);var e=a('<img oncontextmenu="return false;" data-pin-no-hover="true" class="hide-context"  src="'+c+'">').attr("data-hzurl",d),f=n.create();f||(f=b.data("range")),f.insertNode(e[0]),j(b);var g=e.next();g.length||(g=a("<p><br></p>").insertAfter(e)),HZ.textEditor.InsertPhoto.InsertPhotoDialog.$richTextEditor.selectNode(g,!0)}function i(b,c,d,e,f){var g=HZ.utils.Links.getSpaceLink(c),i=(d<b.width()?d:b.width())+"px";a('<img width="'+i+'" src="'+f+'">').attr("data-hzurl",g);h(b,f,g)}f?h(b,g):i.apply(this,[b,c,d,e,g])},this.insertIframe=function(b,c,d,e,f){var g=a('<p class="iframe-throbber"></p>'),h=a('<p class="iframe-wrapper"></p>').addClass("loading"),i=a("<iframe/>");i.attr({scrolling:"no",frameborder:0}),i.hide().on("load",function(c){var f;e&&d?(f=e/(d<b.width()?b.width():d),f+=0):f=.56,g.hide(),h.css("border","").css("padding-bottom",100*f+"%").height(0).removeClass("loading"),a(this).show()}),n.create().insertNode(h[0]),h.append(g).append(i),c&&i[0].contentWindow.document.body.appendChild(c),f&&i.attr(f),j(b);var k=h.next();k.length||(k=a("<p><br></p>").insertAfter($image)),HZ.textEditor.InsertVideo.InsertVideoDialog.$richTextEditor.selectNode(k,!0)},this.formatBlock=function(a,b){b=e.isMSIE?"<"+b+">":b,document.execCommand("FormatBlock",!1,b),j(a)},this.formatPara=function(a){this.formatBlock(a,"P"),j(a)};for(var r=1;r<=6;r++)this["formatH"+r]=function(a){return function(b){this.formatBlock(b,"H"+a)}}(r);this.fontSize=function(a,b){document.execCommand("fontSize",!1,3),e.isFF?a.find("font[size=3]").removeAttr("size").css("font-size",b+"px"):a.find("span").filter(function(){return"medium"===this.style.fontSize}).css("font-size",b+"px"),j(a)},this.lineHeight=function(a,c){b.stylePara(n.create(),{lineHeight:c}),j(a)},this.unlink=function(a){var b=n.create();if(b.isOnAnchor()){var c=i.ancestor(b.sc,i.isAnchor);b=n.createFromNode(c),b.select(),document.execCommand("unlink"),j(a)}},this.createLink=function(b,c,d){var e=c.url,f=c.text,g=(c.newWindow,c.range);d.onCreateLink&&(e=d.onCreateLink(e)),g=g.deleteContents();var h=g.insertNode(a("<A>"+f+"</A>")[0],!0);a(h).attr({href:e,target:"_blank"}),n.createFromNode(h).select(),j(b)},this.getLinkInfo=function(b){b.focus();var c=n.create().expand(i.isAnchor),d=a(g.head(c.nodes(i.isAnchor)));return{range:c,text:c.toString(),isNewWindow:!d.length||"_blank"===d.attr("target"),url:d.length?d.attr("href"):""}},this.getVideoInfo=function(a){a.focus();var b=n.create();if(b.isOnAnchor()){var c=i.ancestor(b.sc,i.isAnchor);b=n.createFromNode(c)}return{text:b.toString()}},this.color=function(a,b){var c=JSON.parse(b),d=c.foreColor,e=c.backColor;d&&document.execCommand("foreColor",!1,d),e&&document.execCommand("backColor",!1,e),j(a)},this.insertTable=function(a,b){var d=b.split("x"),e=n.create();e=e.deleteContents(),e.insertNode(c.createTable(d[0],d[1])),j(a)},this.floatMe=function(a,b,c){c.css("float",b),j(a)},this.imageShape=function(a,b,c){c.removeClass("img-rounded img-circle img-thumbnail"),b&&c.addClass(b),j(a)},this.resize=function(a,b,c){c.css({width:100*b+"%",height:""}),j(a)},this.resizeTo=function(a,b,c){var d;if(c){var e=a.y/a.x,f=b.data("ratio");d={width:f>e?a.x:a.y/f,height:f>e?a.x*f:a.y}}else d={width:a.x,height:a.y};b.css(d)},this.removeMedia=function(a,b,c){c.detach(),j(a)}},s=function(a){var b=[],c=-1,d=a[0],e=function(){var b=n.create(),c={s:{path:[0],offset:0},e:{path:[0],offset:0}};return{contents:a.html(),bookmark:b?b.bookmark(d):c}},f=function(b){null!==b.contents&&a.html(b.contents),null!==b.bookmark&&n.createFromBookmark(d,b.bookmark).select()};this.undo=function(){0<c&&(c--,f(b[c]))},this.redo=function(){b.length-1>c&&(c++,f(b[c]))},this.recordUndo=function(){c++,b.length>c&&(b=b.slice(0,c)),b.push(e())},this.recordUndo()},t=function(){this.update=function(b,c){var d=function(b,c){
b.find(".dropdown-menu li a").each(function(){var b=a(this).data("value")+""==c+"";this.className=b?"checked":""})},e=function(a,c){b.find(a).toggleClass("active",c())},f=b.find(".note-fontname");if(f.length){var h=c["font-family"];h&&(h=g.head(h.split(",")),h=h.replace(/\'/g,""),f.find(".note-current-fontname").text(h),d(f,h))}var i=b.find(".note-fontsize");i.find(".note-current-fontsize").text(c["font-size"]),d(i,parseFloat(c["font-size"])),d(b.find(".note-height"),parseFloat(c["line-height"])),e('button[data-event="bold"]',function(){return"bold"===c["font-bold"]}),e('button[data-event="italic"]',function(){return"italic"===c["font-italic"]}),e('button[data-event="underline"]',function(){return"underline"===c["font-underline"]}),e('button[data-event="strikethrough"]',function(){return"strikethrough"===c["font-strikethrough"]}),e('button[data-event="superscript"]',function(){return"superscript"===c["font-superscript"]}),e('button[data-event="subscript"]',function(){return"subscript"===c["font-subscript"]}),e('button[data-event="justifyLeft"]',function(){return"left"===c["text-align"]||"start"===c["text-align"]}),e('button[data-event="justifyCenter"]',function(){return"center"===c["text-align"]}),e('button[data-event="justifyRight"]',function(){return"right"===c["text-align"]}),e('button[data-event="justifyFull"]',function(){return"justify"===c["text-align"]}),e('button[data-event="insertUnorderedList"]',function(){return"unordered"===c["list-style"]}),e('button[data-event="insertOrderedList"]',function(){return"ordered"===c["list-style"]})},this.updateRecentColor=function(b,c,d){var e=a(b).closest(".note-color"),f=e.find(".note-recent-color"),g=JSON.parse(f.attr("data-value"));g[c]=d,f.attr("data-value",JSON.stringify(g));var h="backColor"===c?"background-color":"color";f.find("i").css(h,d)}},u=function(){var a=new t;this.update=function(b,c){a.update(b,c)},this.updateRecentColor=function(b,c,d){a.updateRecentColor(b,c,d)},this.activate=function(a){a.find("button").not('button[data-event="codeview"]').removeClass("disabled")},this.deactivate=function(a){a.find("button").not('button[data-event="codeview"]').addClass("disabled")},this.updateFullscreen=function(a,b){a.find('button[data-event="fullscreen"]').toggleClass("active",b)},this.updateCodeview=function(a,b){a.find('button[data-event="codeview"]').toggleClass("active",b)}},v=function(){var b=new t,c=function(b,c){var d=a(b),e=c?d.offset():d.position(),f=d.outerHeight(!0),g=d.position().top-d.offsetParent().parent().scrollTop();return{left:e.left,top:g+f}},d=function(a,b){a.css({display:"block",left:b.left,top:b.top})};this.update=function(e,h,i){b.update(e,h);var j=e.find(".note-link-popover");if(h.anchor){var k=j.find("a"),l=a(h.anchor).attr("href");k.attr("href",l).html(l),d(j,c(h.anchor,i))}else j.hide();var m=e.find(".note-image-popover");h.image?d(m,c(h.image,i)):m.hide();var n=e.find(".note-air-popover");if(i&&!h.range.isCollapsed()){var o=f.rect2bnd(g.last(h.range.getClientRects()));d(n,{left:Math.max(o.left+o.width/2-20,0),top:o.top+o.height})}else n.hide()},this.updateRecentColor=function(a,b,c){a.updateRecentColor(a,b,c)},this.hide=function(a){a.children().hide()}},w=function(){this.update=function(b,c,d){var e=b.find(".note-control-selection");if(c.image){var f=a(c.image),g=d?f.offset():f.position(),h={w:f.outerWidth(!0),h:f.outerHeight(!0)};e.css({display:"block",left:g.left,top:g.top,width:h.w,height:h.h}).data("target",c.image);var i=h.w+"x"+h.h;e.find(".note-control-selection-info").text(i)}else e.hide()},this.hide=function(a){a.children().hide()}},x=function(){var b=function(a,b){a.toggleClass("disabled",!b),a.attr("disabled",!b)};this.showImageDialog=function(c,d){return a.Deferred(function(a){var c=d.find(".note-image-dialog"),e=d.find(".note-image-input"),f=d.find(".note-image-url"),g=d.find(".note-image-btn");c.one("shown.bs.modal",function(){e.replaceWith(e.clone().on("change",function(){a.resolve(this.files),c.modal("hide")}).val("")),g.click(function(b){b.preventDefault(),a.resolve(f.val()),c.modal("hide")}),f.on("keyup paste",function(a){var c;c="paste"===a.type?a.originalEvent.clipboardData.getData("text"):f.val(),b(g,c)}).val("").trigger("focus")}).one("hidden.bs.modal",function(){e.off("change"),f.off("keyup paste"),g.off("click"),"pending"===a.state()&&a.reject()}).modal("show")})},this.showVideoDialog=function(c,d,e){return a.Deferred(function(a){var c=d.find(".note-video-dialog"),f=c.find(".note-video-url"),g=c.find(".note-video-btn");c.one("shown.bs.modal",function(){f.val(e.text).keyup(function(){b(g,f.val())}).trigger("keyup").trigger("focus"),g.click(function(b){b.preventDefault(),a.resolve(f.val()),c.modal("hide")})}).one("hidden.bs.modal",function(){f.off("keyup"),g.off("click"),"pending"===a.state()&&a.reject()}).modal("show")})},this.showLinkDialog=function(c,d,e){return a.Deferred(function(a){var c=d.find(".note-link-dialog"),f=c.find(".note-link-text"),g=c.find(".note-link-url"),h=c.find(".note-link-btn"),i=c.find("input[type=checkbox]");c.one("shown.bs.modal",function(){f.val(e.text),f.keyup(function(){e.text=f.val()}),e.url||(e.url=e.text,b(h,e.text)),g.keyup(function(){b(h,g.val()),e.text||f.val(g.val())}).val(e.url).trigger("focus").trigger("select"),i.prop("checked",e.newWindow),h.one("click",function(b){b.preventDefault(),a.resolve({range:e.range,url:g.val(),text:f.val(),newWindow:i.is(":checked")}),c.modal("hide")})}).one("hidden.bs.modal",function(){f.off("keyup"),g.off("keyup"),h.off("click"),"pending"===a.state()&&a.reject()}).modal("show")}).promise()},this.showHelpDialog=function(b,c){return a.Deferred(function(a){c.find(".note-help-dialog").one("hidden.bs.modal",function(){a.resolve()}).modal("show")}).promise()}};e.hasCodeMirror&&(e.isSupportAmd?require(["CodeMirror"],function(a){b=a}):b=window.CodeMirror);var y=function(){var c=a(window),d=a(document),f=a("html, body"),h=new r,j=new u,m=new v,n=new w,o=new x,p=function(b){var c=a(b).closest(".note-editor, .note-air-editor, .note-air-layout");if(!c.length)return null;var d;return d=c.is(".note-editor, .note-air-editor")?c:a("#note-editor-"+g.last(c.attr("id").split("-"))),i.buildLayoutInfo(d)},q=function(b,c){var d=b.data("callbacks");d.onImageUpload?d.onImageUpload(c,h,b):a.each(c,function(a,c){var e=c.name;k.readFileAsDataURL(c).then(function(a){h.insertImage(b,a,e)}).fail(function(){d.onImageUploadError&&d.onImageUploadError()})})},t={showLinkDialog:function(b){var c=d=HZ.textEditor.InsertLink.InsertLinkDialog.$richTextEditor,d=c.getSelection(),e=a(d.anchorNode);if(e.hasClass("note-editable")||!e.closest(".note-editable").length){var f=c.$editor.children().first();f.length||(f=a("<p><br></p>").appendTo(c.$editor)),c.selectNode(f,!0)}var g=b.editable(),i=b.editor(),j=i.data("options"),k=h.getLinkInfo(g);h.saveRange(g),HZ.textEditor.InsertLink.InsertLinkDialog.onInsertLinkCallback=function(a){h.restoreRange(g);var b=a.find(".text-input").val(),c=a.find(".url-input").val();""!==b&&""!==c&&h.createLink(g,{range:k.range,text:b,url:c,isNewWindow:!0},j)},HZ.textEditor.InsertLink.InsertLinkDialog.onViewLoadedCallback=function(a){a.find(".text-input").val(k.text),a.find(".url-input").val(k.url)},"undefined"!=typeof lightbox&&lightbox.isShowing()?(lightbox.detachKeyboardHandler(),HZ.ui.Yamdi.show(HZ.textEditor.InsertLink.InsertLinkDialog)):HZ.textEditor.InsertLink.showDialog()},showImageDialog:function(b){var c=b.editable();h.saveRange(c),HZ.textEditor.InsertPhoto.InsertPhotoDialog.onInsertPhotoCallback=function(b){h.restoreRange(c);var d=b.find(".space-preview-thumb");h.insertIframedImage(c,d.data("spaceid"),d.data("width"),d.data("height"),d.data("isupload"),d.attr("src")),setTimeout(a.proxy(function(){this.$richTextEditor.limitImages()},this),250)},"undefined"!=typeof lightbox&&lightbox.isShowing()?(lightbox.detachKeyboardHandler(),HZ.ui.Yamdi.show(HZ.textEditor.InsertPhoto.InsertPhotoDialog)):HZ.textEditor.InsertPhoto.showDialog()},showVideoDialog:function(a){var b=a.editable();h.saveRange(b),HZ.textEditor.InsertVideo.InsertVideoDialog.onInsertVideoCallback=function(a){h.restoreRange(b),h.insertVideo(b,a.find(".video-input").val())},"undefined"!=typeof lightbox&&lightbox.isShowing()?(lightbox.detachKeyboardHandler(),HZ.ui.Yamdi.show(HZ.textEditor.InsertVideo.InsertVideoDialog)):HZ.textEditor.InsertVideo.showDialog()},showHelpDialog:function(a){var b=a.dialog(),c=a.editable();h.saveRange(c,!0),o.showHelpDialog(c,b).then(function(){h.restoreRange(c)})},fullscreen:function(a){var b=a.editor(),d=a.toolbar(),e=a.editable(),g=a.codable(),h=b.data("options"),i=function(a){b.css("width",a.w),e.css("height",a.h),g.css("height",a.h),g.data("cmeditor")&&g.data("cmeditor").setsize(null,a.h)};b.toggleClass("fullscreen");var k=b.hasClass("fullscreen");k?(e.data("orgheight",e.css("height")),c.on("resize",function(){i({w:c.width(),h:c.height()-d.outerHeight()})}).trigger("resize"),f.css("overflow","hidden")):(c.off("resize"),i({w:h.width||"",h:e.data("orgheight")}),f.css("overflow","visible")),j.updateFullscreen(d,k)},codeview:function(a){var c,d,f=a.editor(),g=a.toolbar(),h=a.editable(),k=a.codable(),l=a.popover(),n=f.data("options");f.toggleClass("codeview");var o=f.hasClass("codeview");o?(k.val(i.html(h,!0)),k.height(h.height()),j.deactivate(g),m.hide(l),k.focus(),e.hasCodeMirror&&(c=b.fromTextArea(k[0],n.codemirror),n.codemirror.tern&&(d=new b.TernServer(n.codemirror.tern),c.ternServer=d,c.on("cursorActivity",function(a){d.updateArgHints(a)})),c.setSize(null,h.outerHeight()),k.data("cmEditor",c))):(e.hasCodeMirror&&(c=k.data("cmEditor"),k.val(c.getValue()),c.toTextArea()),h.html(i.value(k)||i.emptyPara),h.height(n.height?k.height():"auto"),j.activate(g),h.focus()),j.updateCodeview(a.toolbar(),o)}},y=function(a){i.isImg(a.target)&&a.preventDefault()},z=function(a){setTimeout(function(){var b=p(a.currentTarget||a.target),c=h.currentStyle(a.target);if(c){var d=b.editor().data("options").airMode;d||j.update(b.toolbar(),c),m.update(b.popover(),c,d),n.update(b.handle(),c,d)}},0)},A=function(a){var b=p(a.currentTarget||a.target);m.hide(b.popover()),n.hide(b.handle())},B=function(a){var b=a.originalEvent.clipboardData;if(b&&b.items&&b.items.length){var c=p(a.currentTarget||a.target),d=c.editable(),e=g.head(b.items);"file"===e.kind&&-1!==e.type.indexOf("image/")&&q(d,[e.getAsFile()]),h.afterCommand(d)}},C=function(b){if(i.isControlSizing(b.target)){b.preventDefault(),b.stopPropagation();var c=p(b.target),e=c.handle(),f=c.popover(),g=c.editable(),j=c.editor(),k=e.find(".note-control-selection").data("target"),l=a(k),o=l.offset(),q=d.scrollTop(),r=j.data("options").airMode;d.on("mousemove",function(a){h.resizeTo({x:a.clientX-o.left,y:a.clientY-(o.top-q)},l,!a.shiftKey),n.update(e,{image:k},r),m.update(f,{image:k},r)}).one("mouseup",function(){d.off("mousemove"),h.afterCommand(g)}),l.data("ratio")||l.data("ratio",l.height()/l.width())}},D=function(b){a(b.target).closest("[data-event]").length&&b.preventDefault()},E=function(b){var c=a(b.target).closest("[data-event]");if(c.length){var d=c.attr("data-event"),e=c.attr("data-value"),f=c.attr("data-hide"),i=p(b.target);b.preventDefault();var k;if(-1!==a.inArray(d,["resize","floatMe","removeMedia","imageShape"])){var l=i.handle().find(".note-control-selection");k=a(l.data("target"))}if(f&&c.parents(".popover").hide(),h[d]){var n=i.editable();n.trigger("focus"),h[d](n,e,k)}else t[d]&&t[d].call(this,i);if(-1!==a.inArray(d,["backColor","foreColor"])){var o=i.editor().data("options",o);(o.airMode?m:j).updateRecentColor(g.head(c),d,e)}z(b)}},F=function(a){a.preventDefault(),a.stopPropagation();var b=p(a.target).editable(),c=b.offset().top-d.scrollTop(),e=p(a.currentTarget||a.target),f=e.editor().data("options");d.on("mousemove",function(a){var d=a.clientY-(c+24);d=f.minHeight>0?Math.max(d,f.minHeight):d,d=f.maxHeight>0?Math.min(d,f.maxHeight):d,b.height(d)}).one("mouseup",function(){d.off("mousemove")})},G=function(b,c){var d,e=a(b.target.parentNode),f=e.next(),g=e.find(".note-dimension-picker-mousecatcher"),h=e.find(".note-dimension-picker-highlighted"),i=e.find(".note-dimension-picker-unhighlighted");if(void 0===b.offsetX){var j=a(b.target).offset();d={x:b.pageX-j.left,y:b.pageY-j.top}}else d={x:b.offsetX,y:b.offsetY};var k={c:Math.ceil(d.x/18)||1,r:Math.ceil(d.y/18)||1};h.css({width:k.c+"em",height:k.r+"em"}),g.attr("data-value",k.c+"x"+k.r),3<k.c&&k.c<c.insertTableMaxSize.col&&i.css({width:k.c+1+"em"}),3<k.r&&k.r<c.insertTableMaxSize.row&&i.css({height:k.r+1+"em"}),f.html(k.c+" x "+k.r)},H=function(a,b){b?d.on("drop",function(a){a.preventDefault()}):I(a)},I=function(b){var c=a(),e=b.dropzone,f=b.dropzone.find(".note-dropzone-message");d.on("dragenter",function(a){b.editor.hasClass("codeview")||c.length||(b.editor.addClass("dragover"),e.width(b.editor.width()),e.height(b.editor.height()),f.text("Drag Image Here")),c=c.add(a.target)}).on("dragleave",function(a){c=c.not(a.target),c.length||b.editor.removeClass("dragover")}).on("drop",function(){c=a(),b.editor.removeClass("dragover")}),e.on("dragenter",function(){e.addClass("hover"),f.text("Drop Image")}).on("dragleave",function(){e.removeClass("hover"),f.text("Drag Image Here")}),e.on("drop",function(a){a.preventDefault();var b=a.originalEvent.dataTransfer;if(b&&b.files){var c=p(a.currentTarget||a.target);c.editable().focus(),q(c.editable(),b.files)}}).on("dragover",!1)};this.bindKeyMap=function(a,b){var c=a.editor,d=a.editable;a=p(d),d.on("keydown",function(e){var f=[];e.metaKey&&f.push("CMD"),e.ctrlKey&&!e.altKey&&f.push("CTRL"),e.shiftKey&&f.push("SHIFT");var g=l.nameFromCode[e.keyCode];g&&f.push(g);var i=b[f.join("+")];i?(e.preventDefault(),h[i]?h[i](d,c.data("options")):t[i]&&t[i].call(this,a)):l.isEdit(e.keyCode)&&h.afterCommand(d)})},this.attach=function(a,b){this.bindKeyMap(a,b.keyMap[e.isMac?"mac":"pc"]),a.editable.on("mousedown",y),a.editable.on("keyup mouseup",z),a.editable.on("scroll",A),a.editable.on("paste",B),a.handle.on("mousedown",C),a.popover.on("click",E),a.popover.on("mousedown",D),b.airMode||(H(a,b.disableDragAndDrop),a.toolbar.on("click",E),a.toolbar.on("mousedown",D),b.disableResizeEditor||a.statusbar.on("mousedown",F)),(b.airMode?a.popover:a.toolbar).find(".note-dimension-picker-mousecatcher").css({width:b.insertTableMaxSize.col+"em",height:b.insertTableMaxSize.row+"em"}).on("mousemove",function(a){G(a,b)}),a.editor.data("options",b),b.styleWithSpan&&!e.isMSIE&&setTimeout(function(){document.execCommand("styleWithCSS",0,!0)},0);var c=new s(a.editable);if(a.editable.data("NoteHistory",c),b.onenter&&a.editable.keypress(function(a){13===a.keyCode&&b.onenter(a)}),b.onfocus&&a.editable.focus(b.onfocus),b.onblur&&a.editable.blur(b.onblur),b.onkeyup&&a.editable.keyup(b.onkeyup),b.onkeydown&&a.editable.keydown(b.onkeydown),b.onpaste&&a.editable.on("paste",b.onpaste),b.onToolbarClick&&a.toolbar.click(b.onToolbarClick),b.onChange){var d=function(){h.triggerOnChange(a.editable)};if(e.isMSIE){a.editable.on("DOMCharacterDataModified DOMSubtreeModified DOMNodeInserted",d)}else a.editable.on("input",d)}a.editable.data("callbacks",{onChange:b.onChange,onAutoSave:b.onAutoSave,onImageUpload:b.onImageUpload,onImageUploadError:b.onImageUploadError,onFileUpload:b.onFileUpload,onFileUploadError:b.onFileUpload})},this.dettach=function(a,b){a.editable.off(),a.popover.off(),a.handle.off(),a.dialog.off(),b.airMode||(a.dropzone.off(),a.toolbar.off(),a.statusbar.off())}},z=function(){var b=function(a,b){var c=b.event,d=b.value,e=b.title,f=b.className,g=b.dropdown,h=b.hide;return'<button type="button" class="btn btn-default btn-sm btn-small'+(f?" "+f:"")+(g?" dropdown-toggle":"")+'"'+(g?' data-toggle="dropdown"':"")+(e?' title="'+e+'"':"")+(c?' data-event="'+c+'"':"")+(d?" data-value='"+d+"'":"")+(h?" data-hide='"+h+"'":"")+' tabindex="-1">'+a+(g?' <span class="caret"></span>':"")+"</button>"+(g||"")},c=function(a,c){return b('<i class="'+a+'"></i>',c)},d=function(a,b){return'<div class="'+a+' popover bottom in" style="display: none;"><div class="arrow"></div><div class="popover-content">'+b+"</div></div>"},g=function(a,b,c,d){return'<div class="'+a+' modal" aria-hidden="false"><div class="modal-dialog"><div class="modal-content">'+(b?'<div class="modal-header"><button type="button" class="close" aria-hidden="true" tabindex="-1">&times;</button><h4 class="modal-title">'+b+"</h4></div>":"")+'<form class="note-modal-form"><div class="modal-body"><div class="row-fluid">'+c+"</div></div>"+(d?'<div class="modal-footer">'+d+"</div>":"")+"</form></div></div></div>"},h={picture:function(a){return c("fa fa-picture-o icon-picture",{event:"showImageDialog",title:a.image.image,hide:!0})},link:function(a){return c("fa fa-link icon-link",{event:"showLinkDialog",title:a.link.link,hide:!0})},video:function(a){return c("fa fa-youtube-play icon-play",{event:"showVideoDialog",title:a.video.video,hide:!0})},table:function(a){return c("fa fa-table icon-table",{title:a.table.table,dropdown:'<ul class="note-table dropdown-menu"><div class="note-dimension-picker"><div class="note-dimension-picker-mousecatcher" data-event="insertTable" data-value="1x1"></div><div class="note-dimension-picker-highlighted"></div><div class="note-dimension-picker-unhighlighted"></div></div><div class="note-dimension-display"> 1 x 1 </div></ul>'})},style:function(a,b){var d=b.styleTags.reduce(function(b,c){var d=a.style["p"===c?"normal":c];return b+'<li><a data-event="formatBlock" href="#" data-value="'+c+'">'+("p"===c||"pre"===c?d:"<"+c+">"+d+"</"+c+">")+"</a></li>"},"");return c("fa fa-magic icon-magic",{title:a.style.style,dropdown:'<ul class="dropdown-menu">'+d+"</ul>"})},fontname:function(a,c){var d=c.fontNames.reduce(function(a,b){return e.isFontInstalled(b)?a+'<li><a data-event="fontName" href="#" data-value="'+b+'"><i class="fa fa-check icon-ok"></i> '+b+"</a></li>":a},""),f='<span class="note-current-fontname">'+c.defaultFontName+"</span>";return b(f,{title:a.font.name,dropdown:'<ul class="dropdown-menu">'+d+"</ul>"})},fontsize:function(a,c){var d=c.fontSizes.reduce(function(a,b){return a+'<li><a data-event="fontSize" href="#" data-value="'+b+'"><i class="fa fa-check icon-ok"></i> '+b+"</a></li>"},"");return b('<span class="note-current-fontsize">11</span>',{title:a.font.size,dropdown:'<ul class="dropdown-menu">'+d+"</ul>"})},color:function(a){var c=b('<i class="fa fa-font icon-font" style="color:black;background-color:yellow;"></i>',{className:"note-recent-color",title:a.color.recent,event:"color",value:'{"backColor":"yellow"}'}),d='<ul class="dropdown-menu"><li><div class="btn-group"><div class="note-palette-title">'+a.color.background+'</div><div class="note-color-reset" data-event="backColor" data-value="inherit" title="'+a.color.transparent+'">'+a.color.setTransparent+'</div><div class="note-color-palette" data-target-event="backColor"></div></div><div class="btn-group"><div class="note-palette-title">'+a.color.foreground+'</div><div class="note-color-reset" data-event="foreColor" data-value="inherit" title="'+a.color.reset+'">'+a.color.resetToDefault+'</div><div class="note-color-palette" data-target-event="foreColor"></div></div></li></ul>';return c+b("",{title:a.color.more,dropdown:d})},bold:function(a){return c("fa fa-bold icon-bold",{event:"bold",title:a.font.bold})},italic:function(a){return c("fa fa-italic icon-italic",{event:"italic",title:a.font.italic})},underline:function(a){return c("fa fa-underline icon-underline",{event:"underline",title:a.font.underline})},strikethrough:function(a){return c("fa fa-strikethrough icon-strikethrough",{event:"strikethrough",title:a.font.strikethrough})},superscript:function(a){return c("fa fa-superscript icon-superscript",{event:"superscript",title:a.font.superscript})},subscript:function(a){return c("fa fa-subscript icon-subscript",{event:"subscript",title:a.font.subscript})},clear:function(a){return c("fa fa-eraser icon-eraser",{event:"removeFormat",title:a.font.clear})},ul:function(a){return c("fa fa-list-ul icon-list-ul",{event:"insertUnorderedList",title:a.lists.unordered})},ol:function(a){return c("fa fa-list-ol icon-list-ol",{event:"insertOrderedList",title:a.lists.ordered})},paragraph:function(a){var b=c("fa fa-align-left icon-align-left",{title:a.paragraph.left,event:"justifyLeft"}),d=c("fa fa-align-center icon-align-center",{title:a.paragraph.center,event:"justifyCenter"}),e=c("fa fa-align-right icon-align-right",{title:a.paragraph.right,event:"justifyRight"}),f=c("fa fa-align-justify icon-align-justify",{title:a.paragraph.justify,event:"justifyFull"}),g=c("fa fa-outdent icon-indent-left",{title:a.paragraph.outdent,event:"outdent"}),h=c("fa fa-indent icon-indent-right",{title:a.paragraph.indent,event:"indent"}),i='<div class="dropdown-menu"><div class="note-align btn-group">'+b+d+e+f+'</div><div class="note-list btn-group">'+h+g+"</div></div>";return c("fa fa-align-left icon-align-left",{title:a.paragraph.paragraph,dropdown:i})},height:function(a,b){var d=b.lineHeights.reduce(function(a,b){return a+'<li><a data-event="lineHeight" href="#" data-value="'+parseFloat(b)+'"><i class="fa fa-check icon-ok"></i> '+b+"</a></li>"},"");return c("fa fa-text-height icon-text-height",{title:a.font.height,dropdown:'<ul class="dropdown-menu">'+d+"</ul>"})},help:function(a){return c("fa fa-question icon-question",{event:"showHelpDialog",title:a.options.help,hide:!0})},fullscreen:function(a){return c("fa fa-arrows-alt icon-fullscreen",{event:"fullscreen",title:a.options.fullscreen})},codeview:function(a){return c("fa fa-code icon-code",{event:"codeview",title:a.options.codeview})},undo:function(a){return c("fa fa-undo icon-undo",{event:"undo",title:a.history.undo})},redo:function(a){return c("fa fa-repeat icon-repeat",{event:"redo",title:a.history.redo})},hr:function(a){return c("fa fa-minus icon-hr",{event:"insertHorizontalRule",title:a.hr.insert})}},j=function(a,e){return'<div class="note-popover">'+function(){var b=c("fa fa-edit icon-edit",{title:a.link.edit,event:"showLinkDialog",hide:!0}),e=c("fa fa-unlink icon-unlink",{title:a.link.unlink,event:"unlink"});return d("note-link-popover",'<a href="http://www.google.com" target="_blank">www.google.com</a>&nbsp;&nbsp;<div class="note-insert btn-group">'+b+e+"</div>")}()+function(){var e=b('<span class="note-fontsize-10">100%</span>',{title:a.image.resizeFull,event:"resize",value:"1"}),f=b('<span class="note-fontsize-10">50%</span>',{title:a.image.resizeHalf,event:"resize",value:"0.5"}),g=b('<span class="note-fontsize-10">25%</span>',{title:a.image.resizeQuarter,event:"resize",value:"0.25"}),h=c("fa fa-align-left icon-align-left",{title:a.image.floatLeft,event:"floatMe",value:"left"}),i=c("fa fa-align-right icon-align-right",{title:a.image.floatRight,event:"floatMe",value:"right"}),j=c("fa fa-align-justify icon-align-justify",{title:a.image.floatNone,event:"floatMe",value:"none"}),k=c("fa fa-square icon-unchecked",{title:a.image.shapeRounded,event:"imageShape",value:"img-rounded"}),l=c("fa fa-circle-o icon-circle-blank",{title:a.image.shapeCircle,event:"imageShape",value:"img-circle"}),m=c("fa fa-picture-o icon-picture",{title:a.image.shapeThumbnail,event:"imageShape",value:"img-thumbnail"}),n=c("fa fa-times icon-times",{title:a.image.shapeNone,event:"imageShape",value:""}),o=c("fa fa-trash-o icon-trash",{title:a.image.remove,event:"removeMedia",value:"none"});return d("note-image-popover",'<div class="btn-group">'+e+f+g+'</div><div class="btn-group">'+h+i+j+'</div><div class="btn-group">'+k+l+m+n+'</div><div class="btn-group">'+o+"</div>")}()+(e.airMode?function(){for(var b="",c=0,f=e.airPopover.length;c<f;c++){var g=e.airPopover[c];b+='<div class="note-'+g[0]+' btn-group">';for(var i=0,j=g[1].length;i<j;i++)b+=h[g[1][i]](a,e);b+="</div>"}return d("note-air-popover",b)}():"")+"</div>"},k=function(a,b){return'<table class="note-shortcut"><thead><tr><th></th><th>'+a+"</th></tr></thead><tbody>"+b+"</tbody></table>"},l=function(a){var b="<tr><td>⌘ + B</td><td>"+a.font.bold+"</td></tr><tr><td>⌘ + I</td><td>"+a.font.italic+"</td></tr><tr><td>⌘ + U</td><td>"+a.font.underline+"</td></tr><tr><td>⌘ + ⇧ + S</td><td>"+a.font.strikethrough+"</td></tr><tr><td>⌘ + \\</td><td>"+a.font.clear+"</td></tr>";return k(a.shortcut.textFormatting,b)},m=function(a){var b="<tr><td>⌘ + Z</td><td>"+a.history.undo+"</td></tr><tr><td>⌘ + ⇧ + Z</td><td>"+a.history.redo+"</td></tr><tr><td>⌘ + ]</td><td>"+a.paragraph.indent+"</td></tr><tr><td>⌘ + [</td><td>"+a.paragraph.outdent+"</td></tr><tr><td>⌘ + ENTER</td><td>"+a.hr.insert+"</td></tr>";return k(a.shortcut.action,b)},n=function(a){var b="<tr><td>⌘ + ⇧ + L</td><td>"+a.paragraph.left+"</td></tr><tr><td>⌘ + ⇧ + E</td><td>"+a.paragraph.center+"</td></tr><tr><td>⌘ + ⇧ + R</td><td>"+a.paragraph.right+"</td></tr><tr><td>⌘ + ⇧ + J</td><td>"+a.paragraph.justify+"</td></tr><tr><td>⌘ + ⇧ + NUM7</td><td>"+a.lists.ordered+"</td></tr><tr><td>⌘ + ⇧ + NUM8</td><td>"+a.lists.unordered+"</td></tr>";return k(a.shortcut.paragraphFormatting,b)},o=function(a){var b="<tr><td>⌘ + NUM0</td><td>"+a.style.normal+"</td></tr><tr><td>⌘ + NUM1</td><td>"+a.style.h1+"</td></tr><tr><td>⌘ + NUM2</td><td>"+a.style.h2+"</td></tr><tr><td>⌘ + NUM3</td><td>"+a.style.h3+"</td></tr><tr><td>⌘ + NUM4</td><td>"+a.style.h4+"</td></tr><tr><td>⌘ + NUM5</td><td>"+a.style.h5+"</td></tr><tr><td>⌘ + NUM6</td><td>"+a.style.h6+"</td></tr>";return k(a.shortcut.documentStyle,b)},p=function(a,b){var c=b.extraKeys,d="";for(var e in c)c.hasOwnProperty(e)&&(d+="<tr><td>"+e+"</td><td>"+c[e]+"</td></tr>");return k(a.shortcut.extraKeys,d)},q=function(a,b){var c='<table class="note-shortcut-layout"><tbody><tr><td>'+m(a)+"</td><td>"+l(a)+"</td></tr><tr><td>"+o(a)+"</td><td>"+n(a)+"</td></tr>";return b.extraKeys&&(c+='<tr><td colspan="2">'+p(a,b)+"</td></tr>"),c+="</tbody></table>"},r=function(a){return a.replace(/⌘/g,"Ctrl").replace(/⇧/g,"Shift")},s=function(a,b){return'<div class="note-dialog">'+function(){var b='<div class="note-group-select-from-files"><h5>'+a.image.selectFromFiles+'</h5><input class="note-image-input" type="file" name="files" accept="image/*" /></div><h5>'+a.image.url+'</h5><input class="note-image-url form-control span12" type="text" />',c='<button href="#" class="btn btn-primary note-image-btn disabled" disabled>'+a.image.insert+"</button>";return g("note-image-dialog",a.image.insert,b,c)}()+function(){var b='<div class="form-group"><label>'+a.link.textToDisplay+'</label><input class="note-link-text form-control span12" type="text" /></div><div class="form-group"><label>'+a.link.url+'</label><input class="note-link-url form-control span12" type="text" /></div>',c='<button href="#" class="btn btn-primary note-link-btn disabled " disabled>'+a.link.insert+"</button>";return g("note-link-dialog",a.link.insert,b,c)}()+function(){var b='<div class="form-group"><label>'+a.video.url+'</label>&nbsp;<small class="text-muted">'+a.video.providers+'</small><input class="note-video-url form-control span12" type="text" /></div>',c='<button href="#" class="btn btn-primary note-video-btn disabled" disabled>'+a.video.insert+"</button>";return g("note-video-dialog",a.video.insert,b,c)}()+function(){var c='<a class="modal-close pull-right" aria-hidden="true" tabindex="-1">'+a.shortcut.close+'</a><div class="title">'+a.shortcut.shortcuts+"</div>"+(e.isMac?q(a,b):r(q(a,b)))+'<p class="text-center"><a href="//hackerwins.github.io/summernote/" target="_blank">Summernote 0.5.10</a> · <a href="//github.com/HackerWins/summernote" target="_blank">Project</a> · <a href="//github.com/HackerWins/summernote/issues" target="_blank">Issues</a></p>';return g("note-help-dialog","",c,"")}()+"</div>"},t=function(b,c){var d=c.colors;b.find(".note-color-palette").each(function(){for(var b=a(this),c=b.attr("data-target-event"),e=[],f=0,g=d.length;f<g;f++){for(var h=d[f],i=[],j=0,k=h.length;j<k;j++){var l=h[j];i.push(['<button type="button" class="note-color-btn" style="background-color:',l,';" data-event="',c,'" data-value="',l,'" title="',l,'" data-toggle="button" tabindex="-1"></button>'].join(""))}e.push('<div class="note-color-row">'+i.join("")+"</div>")}b.html(e.join(""))})};this.createLayoutByAirMode=function(b,c){var d=(c.keyMap[e.isMac?"mac":"pc"],a.extend(a.summernote.lang["en-US"],a.summernote.lang[c.lang])),g=f.uniqueId();b.addClass("note-air-editor note-editable"),b.attr({id:"note-editor-"+g,contentEditable:!0});var h=document.body,i=a(j(d,c));i.addClass("note-air-layout"),i.attr("id","note-popover-"+g),i.appendTo(h),t(i,c);var k=a('<div class="note-handle"><div class="note-control-selection"><div class="note-control-selection-bg"></div><div class="note-control-holder note-control-nw"></div><div class="note-control-holder note-control-ne"></div><div class="note-control-holder note-control-sw"></div><div class="note-control-sizing note-control-se"></div><div class="note-control-selection-info"></div></div></div>');k.addClass("note-air-layout"),k.attr("id","note-handle-"+g),k.appendTo(h);var l=a(s(d,c));l.addClass("note-air-layout"),l.attr("id","note-dialog-"+g),l.find("button.close, a.modal-close").click(function(){a(this).closest(".modal").modal("hide")}),l.appendTo(h)},this.createLayoutByFrame=function(b,c){var d=a('<div class="note-editor"></div>');c.width&&d.width(c.width),c.height>0&&a('<div class="note-statusbar">'+(c.disableResizeEditor?"":'<div class="note-resizebar"><div class="note-icon-bar"></div><div class="note-icon-bar"></div><div class="note-icon-bar"></div></div>')+"</div>").prependTo(d);var f=!b.is(":disabled"),g=a('<div class="note-editable" contentEditable="'+f+'"></div>').prependTo(d);c.height&&g.height(c.height),c.direction&&g.attr("dir",c.direction),g.html(i.html(b)||i.emptyPara),a('<textarea class="note-codable"></textarea>').prependTo(d);for(var k=a.extend(a.summernote.lang["en-US"],a.summernote.lang[c.lang]),l="",m=0,n=c.toolbar.length;m<n;m++){var o=c.toolbar[m][0],p=c.toolbar[m][1];l+='<div class="note-'+o+' btn-group">';for(var q=0,r=p.length;q<r;q++)a.isFunction(h[p[q]])&&(l+=h[p[q]](k,c));l+="</div>"}l='<div class="note-toolbar btn-toolbar">'+l+"</div>";var u=a(l).prependTo(d);c.keyMap[e.isMac?"mac":"pc"];t(u,c);var v=a(j(k,c)).prependTo(d);t(v,c),a('<div class="note-handle"><div class="note-control-selection"><div class="note-control-selection-bg"></div><div class="note-control-holder note-control-nw"></div><div class="note-control-holder note-control-ne"></div><div class="note-control-holder note-control-sw"></div><div class="note-control-sizing note-control-se"></div><div class="note-control-selection-info"></div></div></div>').prependTo(d),a(s(k,c)).prependTo(d).find("button.close, a.modal-close").click(function(){a(this).closest(".modal").modal("hide")}),a('<div class="note-dropzone"><div class="note-dropzone-message"></div></div>').prependTo(d),d.insertAfter(b),b.hide()},this.noteEditorFromHolder=function(b){return b.hasClass("note-air-editor")?b:b.next().hasClass("note-editor")?b.next():a()},this.createLayout=function(a,b){this.noteEditorFromHolder(a).length||(b.airMode?this.createLayoutByAirMode(a,b):this.createLayoutByFrame(a,b))},this.layoutInfoFromHolder=function(a){var b=this.noteEditorFromHolder(a);if(b.length){var c=i.buildLayoutInfo(b);for(var d in c)c.hasOwnProperty(d)&&(c[d]=c[d].call());return c}},this.removeLayout=function(a,b,c){c.airMode?(a.removeClass("note-air-editor note-editable").removeAttr("id contentEditable"),b.popover.remove(),b.handle.remove(),b.dialog.remove()):(a.html(b.editable.html()),b.editor.remove(),a.show())}};a.summernote=a.summernote||{},a.extend(a.summernote,j);var A=new z,B=new y;a.fn.extend({summernote:function(b){if(b=a.extend({},a.summernote.options,b),this.each(function(c,d){var e=a(d);A.createLayout(e,b);var f=A.layoutInfoFromHolder(e);B.attach(f,b),i.isTextarea(e[0])&&e.closest("form").submit(function(){e.val(e.code())})}),this.first().length&&b.focus){A.layoutInfoFromHolder(this.first()).editable.focus()}return this.length&&b.oninit&&b.oninit(),this},code:function(b){if(void 0===b){var c=this.first();if(!c.length)return;var d=A.layoutInfoFromHolder(c);if(d&&d.editable){
var f=d.editor.hasClass("codeview");return f&&e.hasCodeMirror&&d.codable.data("cmEditor").save(),f?d.codable.val():d.editable.html()}return i.isTextarea(c[0])?c.val():c.html()}return this.each(function(c,d){var e=A.layoutInfoFromHolder(a(d));e&&e.editable&&e.editable.html(b)}),this},destroy:function(){return this.each(function(b,c){var d=a(c),e=A.layoutInfoFromHolder(d);if(e&&e.editable){var f=e.editor.data("options");B.dettach(e,f),A.removeLayout(d,e,f)}}),this}})});

window.hzmr.push("summernote:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End summernote.js  **************/
/************* Start jquery.htmlClean.js for locale it-IT **************/
try {!function(a){function b(a,b,c,d){if(a.tag.format&&c.length>0){c.push("\n");for(var e=0;e<d;e++)c.push("\t")}}function c(d,e){var f=[],g=0==d.attributes.length,h=0;if(d.tag.isComment)e.allowComments&&(f.push("\x3c!--"),f.push(d.tag.rawAttributes),f.push(">"),e.format&&b(d,e,f,h-1));else{var i=d.tag.render&&(0==e.allowedTags.length||a.inArray(d.tag.name,e.allowedTags)>-1)&&(0==e.removeTags.length||-1==a.inArray(d.tag.name,e.removeTags));if(!d.isRoot&&i&&(f.push("<"),f.push(d.tag.name),a.each(d.attributes,function(){if(-1==a.inArray(this.name,e.removeAttrs)){var b=RegExp(/^(['"]?)(.*?)['"]?$/).exec(this.value),c=b[2],g=b[1]||"'";"class"==this.name&&e.allowedClasses.length>0&&(c=a.grep(c.split(" "),function(b){return a.grep(e.allowedClasses,function(c){return c==b||c[0]==b&&(1==c.length||a.inArray(d.tag.name,c[1])>-1)}).length>0}).join(" ")),null!=c&&(c.length>0||a.inArray(this.name,d.tag.requiredAttributes)>-1)&&(f.push(" "),f.push(this.name),f.push("="),f.push(g),f.push(c),f.push(g))}})),d.tag.isSelfClosing)i&&f.push(" />"),g=!1;else if(d.tag.isNonClosing)g=!1;else{if(!d.isRoot&&i&&f.push(">"),h=e.formatIndent++,d.tag.toProtect)n=a.htmlClean.trim(d.children.join("")).replace(/<br>/gi,"\n"),f.push(n),g=0==n.length;else{for(var n=[],p=0;p<d.children.length;p++){var q=d.children[p],r=a.htmlClean.trim(o(l(q)?q:q.childrenToString()));m(q)&&p>0&&r.length>0&&(j(q)||k(d.children[p-1]))&&n.push(" "),l(q)?r.length>0&&n.push(r):p==d.children.length-1&&"br"==q.tag.name||(e.format&&b(q,e,n,h),n=n.concat(c(q,e)))}e.formatIndent--,n.length>0&&(e.format&&"\n"!=n[0]&&b(d,e,f,h),f=f.concat(n),g=!1)}!d.isRoot&&i&&(e.format&&b(d,e,f,h-1),f.push("</"),f.push(d.tag.name),f.push(">"))}if(!d.tag.allowEmpty&&g)return[]}return f}function d(b,c){return f(b,function(b){return a.inArray(b.tag.nameOriginal,c)>-1})}function e(a){return f(a,function(a){return a.isRoot||!a.tag.isInline})}function f(a,b,c){return c=c||1,!!b(a[a.length-c])||!!(a.length-c>0&&f(a,b,c+1))&&(a.pop(),!0)}function g(a){return a?(this.tag=a,this.isRoot=!1):(this.tag=new i("root"),this.isRoot=!0),this.attributes=[],this.children=[],this.hasAttribute=function(a){for(var b=0;b<this.attributes.length;b++)if(this.attributes[b].name==a)return!0;return!1},this.childrenToString=function(){return this.children.join("")},this}function h(a,b){return this.name=a,this.value=b,this}function i(b,c,d,e){return this.name=b.toLowerCase(),this.nameOriginal=this.name,this.render=!0,this.init=function(){if("--"==this.name?(this.isComment=!0,this.isSelfClosing=!0,this.format=!0):(this.isComment=!1,this.isSelfClosing=a.inArray(this.name,v)>-1,this.isNonClosing=a.inArray(this.name,w)>-1,this.isClosing=void 0!=c&&c.length>0,this.isInline=a.inArray(this.name,p)>-1,this.disallowNest=a.inArray(this.name,r)>-1,this.requiredParent=t[a.inArray(this.name,t)+1],this.allowEmpty=e&&a.inArray(this.name,e.allowEmpty)>-1,this.toProtect=a.inArray(this.name,u)>-1,this.format=a.inArray(this.name,q)>-1||!this.isInline),this.rawAttributes=d,this.requiredAttributes=y[a.inArray(this.name,y)+1],e){if(e.tagAttributesCache||(e.tagAttributesCache=[]),-1==a.inArray(this.name,e.tagAttributesCache)){for(var b=x[a.inArray(this.name,x)+1].slice(0),f=0;f<e.allowedAttributes.length;f++){var g=e.allowedAttributes[f][0];(1==e.allowedAttributes[f].length||a.inArray(this.name,e.allowedAttributes[f][1])>-1)&&-1==a.inArray(g,b)&&b.push(g)}e.tagAttributesCache.push(this.name),e.tagAttributesCache.push(b)}this.allowedAttributes=e.tagAttributesCache[a.inArray(this.name,e.tagAttributesCache)+1]}},this.init(),this.rename=function(a){this.name=a,this.init()},this}function j(b){for(;n(b)&&b.children.length>0;)b=b.children[0];if(!l(b))return!1;var c=o(b);return c.length>0&&a.htmlClean.isWhitespace(c.charAt(0))}function k(b){for(;n(b)&&b.children.length>0;)b=b.children[b.children.length-1];if(!l(b))return!1;var c=o(b);return c.length>0&&a.htmlClean.isWhitespace(c.charAt(c.length-1))}function l(a){return a.constructor==String}function m(a){return l(a)||a.tag.isInline}function n(a){return a.constructor==g}function o(a){return a.replace(/&nbsp;|\n/g," ").replace(/\s\s+/g," ")}a.fn.htmlClean=function(b){return this.each(function(){this.value?this.value=a.htmlClean(this.value,b):this.innerHTML=a.htmlClean(this.innerHTML,b)})},a.htmlClean=function(b,f){f=a.extend({},a.htmlClean.defaults,f),f.allowEmpty=s.concat(f.allowEmpty);var j,k=/(<(\/)?(\w+:)?([\w]+)([^>]*)>)|<!--(.*?--)>/gi,m=/([\w\-]+)\s*=\s*(".*?"|'.*?'|[^\s>\/]*)/gi,n=new g,o=[n],p=n;f.bodyOnly&&(j=/<body[^>]*>((\n|.)*)<\/body>/i.exec(b))&&(b=j[1]),b=b.concat("<xxx>");for(var q;j=k.exec(b);){var r=j[6]?new i("--",null,j[6],f):new i(j[4],j[2],j[5],f),t=b.substring(q,j.index);if(t.length>0){var u=p.children[p.children.length-1];p.children.length>0&&l(u=p.children[p.children.length-1])?p.children[p.children.length-1]=u.concat(t):p.children.push(t)}if(q=k.lastIndex,r.isClosing)d(o,[r.name])&&(o.pop(),p=o[o.length-1]);else{for(var v,w=new g(r);v=m.exec(r.rawAttributes);){if("style"==v[1].toLowerCase()&&f.replaceStyles)for(var x=!r.isInline,y=0;y<f.replaceStyles.length;y++)f.replaceStyles[y][0].test(v[2])&&(x||(r.render=!1,x=!0),p.children.push(w),o.push(w),p=w,r=new i(f.replaceStyles[y][1],"","",f),w=new g(r));null!=r.allowedAttributes&&(0==r.allowedAttributes.length||a.inArray(v[1],r.allowedAttributes)>-1)&&w.attributes.push(new h(v[1],v[2]))}a.each(r.requiredAttributes,function(){var a=this.toString();w.hasAttribute(a)||w.attributes.push(new h(a,""))});for(var z=0;z<f.replace.length;z++)for(var A=0;A<f.replace[z][0].length;A++){var B="string"==typeof f.replace[z][0][A];if(B&&f.replace[z][0][A]==r.name||!B&&f.replace[z][0][A].test(j)){r.rename(f.replace[z][1]),z=f.replace.length;break}}var C=!0;if(p.isRoot||(p.tag.isInline&&!r.isInline?(C=e(o))&&(p=o[o.length-1]):p.tag.disallowNest&&r.disallowNest&&!r.requiredParent?C=!1:r.requiredParent&&(C=d(o,r.requiredParent))&&(p=o[o.length-1])),C)if(p.children.push(w),r.toProtect)for(var D;D=k.exec(b);){var E=new i(D[4],D[1],D[5],f);if(E.isClosing&&E.name==r.name){w.children.push(RegExp.leftContext.substring(q)),q=k.lastIndex;break}}else r.isSelfClosing||r.isNonClosing||(o.push(w),p=w)}}return a.htmlClean.trim(c(n,f).join(""))},a.htmlClean.defaults={bodyOnly:!0,allowedTags:[],removeTags:["basefont","center","dir","font","frame","frameset","isindex","menu","noframes","s","strike","u"],allowedAttributes:[],removeAttrs:[],allowedClasses:[],format:!1,formatIndent:0,replace:[[["b","big"],"strong"],[["i"],"em"]],replaceStyles:[[/font-weight:\s*bold/i,"strong"],[/font-style:\s*italic/i,"em"],[/vertical-align:\s*super/i,"sup"],[/vertical-align:\s*sub/i,"sub"]],allowComments:!1,allowEmpty:[]},a.htmlClean.trim=function(b){return a.htmlClean.trimStart(a.htmlClean.trimEnd(b))},a.htmlClean.trimStart=function(b){return b.substring(a.htmlClean.trimStartIndex(b))},a.htmlClean.trimStartIndex=function(b){for(var c=0;c<b.length-1&&a.htmlClean.isWhitespace(b.charAt(c));c++);return c},a.htmlClean.trimEnd=function(b){return b.substring(0,a.htmlClean.trimEndIndex(b))},a.htmlClean.trimEndIndex=function(b){for(var c=b.length-1;c>=0&&a.htmlClean.isWhitespace(b.charAt(c));c--);return c+1},a.htmlClean.isWhitespace=function(b){return-1!=a.inArray(b,z)};var p=["a","abbr","acronym","address","b","big","br","button","caption","cite","code","del","em","font","hr","i","input","img","ins","label","legend","map","q","s","samp","select","option","param","small","span","strike","strong","sub","sup","tt","u","var"],q=["address","button","caption","code","input","label","legend","select","option","param"],r=["h1","h2","h3","h4","h5","h6","p","th","td","object"],s=["th","td"],t=[null,"li",["ul","ol"],"dt",["dl"],"dd",["dl"],"td",["tr"],"th",["tr"],"tr",["table","thead","tbody","tfoot"],"thead",["table"],"tbody",["table"],"tfoot",["table"],"param",["object"]],u=["script","style","pre","code"],v=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],w=["!doctype","?xml"],x=[["class"],"?xml",[],"!doctype",[],"a",["accesskey","class","href","name","title","rel","rev","type","tabindex"],"abbr",["class","title"],"acronym",["class","title"],"blockquote",["cite","class"],"button",["class","disabled","name","type","value"],"del",["cite","class","datetime"],"form",["accept","action","class","enctype","method","name"],"iframe",["class","height","name","sandbox","seamless","src","srcdoc","width"],"input",["accept","accesskey","alt","checked","class","disabled","ismap","maxlength","name","size","readonly","src","tabindex","type","usemap","value"],"img",["alt","class","height","src","width"],"ins",["cite","class","datetime"],"label",["accesskey","class","for"],"legend",["accesskey","class"],"link",["href","rel","type"],"meta",["content","http-equiv","name","scheme","charset"],"map",["name"],"optgroup",["class","disabled","label"],"option",["class","disabled","label","selected","value"],"q",["class","cite"],"script",["src","type"],"select",["class","disabled","multiple","name","size","tabindex"],"style",["type"],"table",["class","summary"],"th",["class","colspan","rowspan"],"td",["class","colspan","rowspan"],"textarea",["accesskey","class","cols","disabled","name","readonly","rows","tabindex"],"param",["name","value"],"embed",["height","src","type","width"]],y=[[],"img",["alt"]],z=[" "," ","\t","\n","\r","\f"]}(jQuery);

window.hzmr.push("jquery.htmlClean:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End jquery.htmlClean.js  **************/
/************* Start extracting text for richTextEditor.js for locale it-IT **************/
(function(){var _hzxt={"Show off your work: upload your project photos":"Mostra i tuoi lavori: carica le foto dei tuoi progetti","Houzz URL":"Link di Houzz","Paste a URL here":"Incolla l'indirizzo URL qui","Insert a photo you found on Houzz":"Inserisci una foto che hai trovato su Houzz","Choose or Upload a Photo":"Scegli o carica una foto","Upload Photo":"Carica foto","Click or drag & drop a photo here to upload":"Clicca o trascina qui una foto da caricare (s\u00ec: JPEG e PNG. No: Pdf)","Insert Photo":"Allega foto","Insert":"Inserisci","Web Address (URL)":"Link (URL)","Text to Display":"Testo da mostrare","Insert Link":"Inserisci link","Fullscreen":"Schermo intero","Ordered List":"Elenco numerato","Unordered List":"Elenco puntato","Italic":"Corsivo","Bold":"Grassetto","Show More Photos":"Mostra altre foto","Video":"Video","Click 'Browse' to select an image file from your hard drive, then click 'Upload'":"Clicca su \"Sfoglia\" per selezionare un'immagine dal tuo disco rigido, poi clicca su \"Carica\"","Houzz Photo":"Foto Houzz","Remove file":"Rimuovi file","Are you sure you want to cancel this upload?":"Sei sicuro di voler annullare questo caricamento?","Cancel upload":"Annulla caricamento","Server responded with {statusCode} code.":"Il server ha risposto con il codice {statusCode}.","File is too big ({size}MB). Max filesize: {max}MB.":"Il file \u00e8 troppo grande ({size} MB). Massima dimensione del file:  {max} MB.","Loading Projects...":"Caricamento progetti in corso...","Link":"Link","Photo":"Foto","Cancel":"Annulla","":"","Projects":"Progetti","Remove":"Rimuovi","Change":"Cambia","Browse":"Sfoglia","Ideabooks":"Ideabook"};for(var a in _hzxt){window._hzlang[a]=_hzxt[a];}})();
/*************  End extracting text for richTextEditor.js  **************/
/************* Start richTextEditor.js for locale it-IT **************/
try {HZ.ns("HZ.textEditor"),HZ.textEditor.RichTextEditor=HZ.textEditor.RichTextEditor||{},$.fn.RichTextEditor=function(a){this.imageLimit=10,this.inactiveHeight=102,this.textArea=null;var b=null;this.activeHeight=102,this.shortFormMaxHeight=102,this.longFormMaxHeight=320,this.styleWithSpan=!1,this.toolbar=[["style",["bold","italic"]],["list",["ul","ol"]],["picture",["picture"]],["video",["video"]],["link",["link"]]],this.allowedTags=["p","br","a","img","iframe","b","i","ul","ol","li"],this.allowedAttributes=[["target",["a"]],["frameborder",["iframe"]],["class",["p"]],["style",["p"]],["data-hzurl",["img"]],["onContextMenu",["img"]],["onmousedown",["img"]],["ondragstart",["img"]],["onselectstart",["img"]],["width",["img"]],["height",["img"]]],this.removeTags=[],this.removeAttributes=[],this.allowEmpty=[],this.replaceTags=[[["div"],"p"]],this.allowedHotKeyFunctions=["italic","bold"],this.supportsDirectUpload=!(UIHelper.isIE6||UIHelper.isIE7||UIHelper.isIE8||UIHelper.isIE9),this.onEnter=function(a){},this.onKeyUp=function(a){},this.onKeyDown=function(a){this.disableControlCommands(a)},this.onFocus=function(a){},this.onBlur=function(a){this.$editor.find("div").length},this.onPaste=function(a){setTimeout($.proxy(function(){this.limitImages()},this),0)},this.setDirty=function(){if(this.$editorWrapper&&this.$editorWrapper.parents("form"))return this.$editorWrapper.closest("form").addClass("dirty")},this.setClean=function(){return this.$editorWrapper.closest("form").removeClass("dirty")},this.isDirty=function(){return this.$editorWrapper.closest("form").hasClass("dirty")},this.contentHasChanged=function(){if(!this.isDirty())return!1;var a=this.$editor.code();return b&&b.length?b!=a:!this.isEmpty()},this.onChange=function(a,b){this.setDirty(),this.limitImages()},this.onInit=function(){this.initObjectReferences(),this.initOnEditorClick(),this.initOnIframeWrapperClick(),this.initOnWindowResize(),this.prepareDialogs(),this.repositionToolbar(),this.styleToolbarButtons(),this.supportsDirectUpload&&this.initUploadPhotoButton(),this.resizeToolbarButtons(),this.stylePopovers(),this.showEditor(),this.translateText(),this.setClean(),$(window).on("beforeunload",$.proxy(function(){if(this.contentHasChanged())return _hgt("You haven't finished your post yet. Do you want to leave without posting?")},this))},this.initObjectReferences=function(){this.$editor=this.$wrapper.find(".note-editable"),this.$toolbar=this.$wrapper.find(".note-toolbar"),this.$linkPopover=this.$wrapper.find(".note-link-popover"),this.$editor.wrap('<div class="note-editable-wrapper"></div>'),this.$editorWrapper=this.$editor.parent(".note-editable-wrapper").css("min-height",this.inactiveHeight),(b=this.textArea&&this.textArea.length>0?this.textArea.val():null)&&this.textArea.attr("placeholder")&&b==this.textArea.attr("placeholder")&&(b=null)},this.focusEditor=function(a){return this.$editor.focus(),a&&this.selectNode(this.$editor,!0),this},this.blurEditor=function(){return this.$editor.blur(),this.clearSelection(),this},this.wrapWithParagraph=function(){var a=this.getSelection(),b=$(a.anchorNode);return a.anchorNode&&3===a.anchorNode.nodeType&&b.parent().hasClass("note-editable")&&(b.wrap("<p></p>"),this.selectNode(b.parent(),!1)),this},this.limitImages=function(){var a=this.$editor.find("img");a.length>=this.imageLimit?(a.slice(this.imageLimit).remove(),this.$toolbar.find(".note-picture button").prop("disabled",!0).attr("data-event",""),this.$toolbar.find(".note-upload button").prop("disabled",!0)):(this.$toolbar.find(".note-picture button").prop("disabled",!1).attr("data-event","showImageDialog"),this.$toolbar.find(".note-upload button").prop("disabled",!1))},this.clearSelection=function(){return window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():document.selection&&document.selection.empty(),this},this.isEmpty=function(){return""==$.trim(this.$editor.text())&&!this.$editor.find("img, iframe").length},this.resizeToolbarButtons=function(){return this.$toolbar.find("button span").toggle(this.$editor.width()>460),this},this.initUploadPhotoButton=function(){return this.$uploadPhotoFileInput=$('<input name="file" type="file">').appendTo("body").hide(),this.$uploadPhotoButton=$('<button type="button" class="btn btn-default btn-sm btn-small" title="'+_hgt("Upload Photo")+'" data-hide="true" tabindex="-1"><i class="fa-link hzi-font hzi-Add_Photo"></i><span>'+_hgt("Photo")+"</span></button>").on("click",$.proxy(function(){this.$uploadPhotoFileInput.click()},this)),this.$uploadPhotoFileInput.ajaxfileupload({action:"/createTempPhoto",params:{type:-1,minHeight:0,minWidth:0},submit_button:null,onStart:$.proxy(function(){this.insertThrobber()},this),onComplete:$.proxy(function(a){!1===a.status&&void 0!==a.message||a.error||a.tempImageUrl&&this.insertUploadedPhoto(a.tempImageUrl)},this)}),this.$uploadPhotoButton.insertBefore(this.$toolbar.find(".note-picture")),this.$uploadPhotoButton.wrap('<div class="note-upload btn-group"></div>'),this},this.insertThrobber=function(){this.focusEditor();var a=document.selection;if(a){var b=a.createRange();document.execCommand("insertImage",!1,HZ.utils.Links.getPicUrl("greenThrobber.gif")),b.collapse(!1),b.select()}else document.execCommand("insertImage",!1,HZ.utils.Links.getPicUrl("greenThrobber.gif"));this.$imageThrobber=this.$editor.find('img[src="'+HZ.utils.Links.getPicUrl("greenThrobber.gif")+'"]'),this.selectNode(this.$imageThrobber,!1)},this.insertUploadedPhoto=function(a){if(this.$imageThrobber.length){var b=$('<img oncontextmenu="return false;" data-pin-no-hover="true" class="hide-context"  data-hzurl="'+a+'" src="'+a+'">').on("load",$.proxy(function(a){},this));this.$imageThrobber.replaceWith(b);var c=b.next();c.length||(c=$("<p><br></p>").insertAfter(b),this.selectNode(c,!0))}},this.showEditor=function(){return this.$toolbar.show(),this},this.disableControlCommands=function(a){if(a.ctrlKey||a.metaKey)switch(a.keyCode){case 66:case 98:this.preventDefault(a);break;case 73:case 105:break;case 85:case 117:this.preventDefault(a)}},this.interceptPastedFiles=function(a){for(var b=a.originalEvent.clipboardData,c=new RegExp("^data:"),d=0;d<b.types.length;d++)"Files"===b.types[d]&&(setTimeout($.proxy(function(){this.$editor.find("img").each(function(a,b){var d=$(b);d.attr("src").match(c)&&d.remove()})},this),250),this.preventDefault(a));return this},this.preventDefault=function(a){return a.preventDefault?a.preventDefault():a.returnValue=!1,this},this.interceptPastedHtml=function(a){var b=HZ.utils.Links.getPageUrl("previewHouzzObject"),c=new RegExp("\\/\\/(player.)?vimeo.com\\/([a-z]*\\/)*([0-9]{6,11})[?]?.*"),d=a.originalEvent.clipboardData.getData("text/html"),e=new RegExp("https?://st.(houzz2?|stghouzz).com/([sf]imgs|simgstmp)/"),f=new RegExp(b),g=new RegExp("^.*(youtu.be\\/|v\\/|u\\/\\w\\/|embed\\/|watch\\?v=|\\&v=)([^#\\&\\?]*).*"),h=new RegExp(c);return d.length&&setTimeout($.proxy(function(){this.$editor.find("img").each(function(a,b){var c=$(b);c.attr("src")&&!c.attr("src").match(e)&&c.remove()}),this.$editor.find("iframe").each(function(a,b){var c=$(b);!c.attr("src")||c.attr("src").match(f)||c.attr("src").match(g)||c.attr("src").match(h)||c.remove()}),this.$editor.find("p:not(.iframe-wrapper):not(.iframe-throbber), a").each(function(a,b){$(b).attr("class","").attr("style","")})},this),250),this},this.interceptPastedText=function(a){for(var b=0;b<a.originalEvent.clipboardData.types.length;b++)if("text/html"===a.originalEvent.clipboardData.types[b])return this;var c=a.originalEvent.clipboardData.getData("text/plain");return c.length&&this.convertUrlsToLinks(a,c),this};return this.interceptKeyDown=function(a){var b=a.which,c=this.getSelection(),d=$(c.anchorNode),e=b>47&&b<58,f=b>64&&b<91,g=b>95&&b<112,h=b>185&&b<193||b>218&&b<223;if(32===b||e||f||g||h){if(d.closest(".iframe-wrapper").length){var i=this.onEnterKey(d);this.selectNode(i,!0)}}else if(37===b||38===b){if(d.closest(".iframe-wrapper").length){var j=d.prev();j.length||(j=$("<p><br></p>"),d.before(j)),this.selectNode(j,!1),this.preventDefault(a)}}else if(39===b||40===b){if(d.closest(".iframe-wrapper").length){var i=d.next();i.length||(i=$("<p><br></p>"),d.after(i)),this.selectNode(i,!0),this.preventDefault(a)}}else if(8===b){var k=d.closest(".iframe-wrapper");if(k.length){var j=this.onBackspaceKey(k);this.selectNode(j,!1),this.preventDefault(a)}}else if(13===b){var k=d.closest(".iframe-wrapper");if(k.length){var i=this.onEnterKey(d);this.selectNode(i,!0),this.preventDefault(a)}}return this},this.onEnterKey=function(a){var b=$("<p><br></p>");return a.after(b).remove(),b},this.onBackspaceKey=function(a){var b=a.prev();return b.length||(b=$("<p><br></p>"),a.before(b)),a.remove(),b},this.selectNode=function(a,b){if(window.getSelection&&document.createRange){var c=document.createRange(),d=window.getSelection();void 0!=b||null!=b?(c.selectNodeContents(a[0]),c.collapse(b)):c.selectNode(a[0]),d.removeAllRanges(),d.addRange(c)}else if(document.selection&&document.body.createTextRange){var e=document.body.createTextRange();e.moveToElementText(a[0]),e.collapse(b),e.select()}return this},this.selectIframeWrapper=function(){var a=this.getSelection(),b=$(a.anchorNode),c=b.closest(".iframe-wrapper");if(c.length)if(c.hasClass("loading")){var d=c.prev();d.length||(d=$("<p><br></p>"),c.before(d)),this.selectNode(d,!1)}else this.selectNode(c),c.addClass("selected");else this.$wrapper.find(".iframe-wrapper.selected").removeClass("selected");return this},this.getSelection=function(){return window.getSelection?window.getSelection():document.selection.createRange?document.selection.createRange():void 0},this.scrollToCursor=function(a){if(a&&"keyup"==a.type){var b=a.keyCode;if($.inArray(b,[8,9,16,17,18,19,20,27,33,34,35,36,37,38,39,40,46,91,93,144,145])>=0)return this}var c=this.getSelection();if("None"!==c.type&&c.anchorNode){this.$cursorSpan=this.$cursorSpan||$('<span class="cursor-span"></span>');c.getRangeAt(0).insertNode(this.$cursorSpan[0]);var d=this.$cursorSpan.offset().top,e=this.$editorWrapper.offset().top,f=this.$editorWrapper.offset().top+this.$editorWrapper.height();(d<e-10||d>f+10)&&this.$editorWrapper.scrollTop(this.$cursorSpan.position().top)}return this},this.editSummernoteHotkeys=function(a){return this.editKeyMap($.summernote.options.keyMap.pc,a),this.editKeyMap($.summernote.options.keyMap.mac,a),this},this.editKeyMap=function(a,b){for(var c in a){var d=a[c];-1==$.inArray(d,b)&&delete a[c]}return this},this.repositionToolbar=function(){return this.$wrapper.find(".note-editor").append(this.$toolbar.hide().detach()),this},this.stylePopovers=function(){var a=this.$linkPopover.find("button[data-event=showLinkDialog]"),b=this.$linkPopover.find("button[data-event=unlink]");return a.before("|&nbsp;").after("&nbsp;|&nbsp;"),a.replaceWith('<span data-event="showLinkDialog">'+_hgt("Change")+"</span>"),b.replaceWith('<span data-event="unlink">'+_hgt("Remove")+"</span>"),this},this.prepareDialogs=function(){return HZ.textEditor.InsertPhoto.prepare(),HZ.textEditor.InsertLink.prepare(),HZ.textEditor.InsertVideo.prepare(),HZ.textEditor.InsertPhoto.InsertPhotoDialog.$richTextEditor=this,HZ.textEditor.InsertLink.InsertLinkDialog.$richTextEditor=this,HZ.textEditor.InsertVideo.InsertVideoDialog.$richTextEditor=this,this},this.resizeEditor=function(){return this},this.styleToolbarButtons=function(){var a=this.$toolbar;return a.find(".note-style").addClass("hidden-xs"),a.find(".note-list").addClass("hidden-xs"),a.find(".note-video").addClass("hidden-xs"),a.find(".note-link").addClass("hidden-xs"),a.find(".fa.icon-bold").removeClass("fa fa-bold icon-bold").addClass("hzi-font hzi-Bold"),a.find(".fa.icon-italic").removeClass("fa fa-italic icon-italic").addClass("hzi-font hzi-Italics"),a.find(".fa.icon-list-ol").removeClass("fa fa-list-ol icon-list-ol").addClass("hzi-font hzi-Ordered-List"),a.find(".fa.icon-list-ul").removeClass("fa fa-list-ul icon-list-ul").addClass("hzi-font hzi-Unordered-List"),a.find(".fa.icon-picture").removeClass("fa fa-picture-o icon-picture").addClass("hzi-font hzi-Houzz-Photo").after("<span>"+(this.supportsDirectUpload?_hgt("Houzz Photo"):_hgt("Photo"))+"</span>"),a.find(".note-picture button").attr("title",_hgt("Choose or Upload a Photo")),a.find(".fa.icon-play").removeClass("fa fa-youtube-play icon-play").addClass("hzi-font hzi-Video").after("<span>"+_hgt("Video")+"</span>"),a.find(".fa.icon-link").removeClass("fa fa-link-o icon-link").addClass("hzi-font hzi-Link").after("<span>"+_hgt("Link")+"</span>"),this},this.translateText=function(){this.$toolbar.find("button[title=Bold]").attr("title",_hgt("Bold")),this.$toolbar.find("button[title=Italic]").attr("title",_hgt("Italic")),this.$toolbar.find('button[title="Unordered list"]').attr("title",_hgt("Unordered List")),this.$toolbar.find('button[title="Ordered list"]').attr("title",_hgt("Ordered List")),this.$toolbar.find('button[title="Upload Photo"]').attr("title",_hgt("Upload Photo")),this.$toolbar.find('button[title="Choose or Upload a Photo"]').attr("title",_hgt("Choose or Upload a Photo")),this.$toolbar.find("button[title=Video]").attr("title",_hgt("Video")),this.$toolbar.find("button[title=Link]").attr("title",_hgt("Link")),this.$toolbar.find("button[title=Fullscreen]").attr("title",_hgt("Fullscreen"))},this.initOnIframeWrapperClick=function(){return this.$editor.on("click",".iframe-wrapper",$.proxy(function(a){this.$editor.find(".iframe-wrapper.selected").removeClass("selected"),this.selectNode(a.currentTarget);var b=this.getSelection(),c=document.createRange();c.selectNode(a.currentTarget),b.removeAllRanges(),b.addRange(c),$(a.currentTarget).addClass("selected")},this)),this},this.initOnEditorClick=function(){return this.$editorWrapper.on("click",$.proxy(function(a){$(a.target).hasClass("note-editable-wrapper")&&this.focusEditor(),$(a.target).closest(".iframe-wrapper").length||this.$editor.find(".iframe-wrapper.selected").removeClass("selected")},this)),this},this.initOnToolbarButtonClick=function(){return this.$toolbar.find("button").on("click",$.proxy(function(a){this.$editor.off("blur")},this)),this},this.initOnWindowResize=function(){var a=this.$editor.width();return $(window).resize($.throttle(250,$.proxy(function(){this.$editor.width()!=a&&(a=this.$editor.width(),this.resizeIframeWrappers(),this.resizeToolbarButtons())},this))),this},this.resizeIframeWrappers=function(){var a=this.$editor.find(".iframe-wrapper");return a.length&&a.each(function(a,b){var c,d=$(b),e=new RegExp("height=(:?[0-9]+)"),f=new RegExp("width=(:?[0-9]+)"),g=d.find("iframe").attr("src"),h=e.exec(g),i=f.exec(g),j=h&&h.length>1?parseInt(h[1]):null,k=i&&i.length>1?parseInt(i[1]):null;c=j&&k?j/(k>this.$editor.width()?k:this.$editor.width()):.56,d.css("padding-bottom",100*c+5+"%")}),this},this.cleanHtml=function(){var a=$.htmlClean(this.$editor.code(),{allowedTags:this.allowedTags,allowedAttributes:this.allowedAttributes,removeAttrs:this.removeAttributes,removeTags:this.removeTags,replace:this.replaceTags,allowEmpty:this.allowEmpty});return this.$editor.html(a),this.$editor.contents().each(function(a,b){3===b.nodeType&&$(b).wrap("<p></p>")}),this},this.positionCaretAtEnd=function(){return this.selectNode(this.$editor,!1),this},this.prepare=function(){return this.$wrapper=this.closest(".rich-text-editor-wrapper"),this.editSummernoteHotkeys(this.allowedHotKeyFunctions),this},this.init=function(){return this.summernote({styleWithSpan:this.styleWithSpan,toolbar:this.toolbar,onkeyup:$.proxy(function(a){this.onKeyUp(a)},this),onkeydown:$.proxy(function(a){return this.onKeyDown(a)},this),onenter:$.proxy(function(a){this.onEnter(a)},this),onfocus:$.proxy(function(a){this.onFocus(a)},this),onblur:$.proxy(function(a){this.onBlur(a)},this),onpaste:$.proxy(function(a){this.onPaste(a)},this),onChange:$.proxy(function(a,b){this.onChange(a,b)},this),oninit:$.proxy(function(){this.onInit()},this)}),this},this.convertUrlsToLinks=function(a,b){var c=new RegExp("https?://*"),d=b.match(c),e=new RegExp("https?://(?:www\\.)?(?:mytest|houzztest|houzz2?|stghouzz)\\.[A-Za-z\\./]*/("+HZ.utils.Config.spaceCommand+"|"+HZ.utils.Config.galleryCommand+"|projects)/(\\d+)(?=(?:\\D|$))[/\\?=&\\+%\\w-#]*");b.match(e);d&&d[0].length&&(-1===b.indexOf("://")&&(b="http://"+b),document.execCommand("insertHTML",!0,'<a href="'+b+'" target="_blank">'+b+"</a>"),a.preventDefault())},$.extend(this,a||{}),this},HZ.textEditor.InsertPhotoDialog=function(){HZ.textEditor.InsertPhotoDialog.superclass.constructor.call(this),this.initVariables=function(){return this.allSpaces={},this.isUploadedImage=!1,this.areIdeabooksLoaded=!1,this.ideabooks={},this.ideabookSpaces={},this.areProjectsLoaded=!1,this.projects={},this.projectSpaces={},this},this.createDialogBody=function(){var a='<ul class="nav nav-tabs"><li class="active"><div>'+_hgt("Ideabooks")+"</div></li><li><div>"+_hgt("Projects")+"</div></li><li><div>"+_hgt("Houzz URL")+"</div></li></ul>",b='<div class="tab-view ideabooks-view"><select class="ideabook-list form-control"></select><div class="no-ideabooks-message">'+_hgt("Give your ideas a home: create an ideabook for each thing you’re working on")+'</div><div class="ideabook-spaces-wrapper"><div class="ideabook-spaces-list">&nbsp;</div><div class="load-more-ideabook-spaces-throbber"></div><a class="load-more-ideabook-spaces-button">'+_hgt("Show More Photos")+"</a></div></div>",c='<div class="tab-view projects-view"><select class="project-list form-control"></select><div class="no-projects-message">'+_hgt("Show off your work: upload your project photos")+'</div><div class="project-spaces-wrapper"><div class="project-spaces-list">&nbsp;</div><div class="load-more-project-spaces-throbber"></div><a class="load-more-project-spaces-button">'+_hgt("Show More Photos")+"</a></div></div>",d='<div class="tab-view houzz-view"><div class="url-label">'+_hgt("Insert a photo you found on Houzz")+'</div><input class="url-input" type="text" placeholder="'+_hgt("Paste a URL here")+'"><div class="url-caption mtm">'+_hgt("e.g. http://www.houzz.com/photos/5/Amazing-Kitchen")+"</div></div>",e='<div class="insert-photo-wrapper row"><div class="left-container col-md-6"><div class="ajax-throbber"></div>'+a+b+c+d+'</div><div class="right-container col-md-6"><div class="preview-view"><div class="preview-wrapper"></div><form action="javascript:;" class="dropzone hz-dropzone"></form><div class="dropzone-messages"></div></div></div></div>';return this.$body=$(e),this},this.defineViewObjects=function(){return this.$leftContainer=this.$body.find(".left-container"),this.$tabControls=this.$body.find(".nav-tabs"),this.$tabViews=this.$body.find(".tab-view"),this.$ideabooksView=this.$body.find(".ideabooks-view"),this.$projectsView=this.$body.find(".projects-view"),this.$houzzView=this.$body.find(".houzz-view"),this.$previewView=this.$body.find(".preview-view"),this},this.addEventListeners=function(){return this.$tabControls.find("li").on("click",$.proxy(function(a){this.viewTabAtIndex($(a.target).closest("li").index())},this)),this.$previewView.on("click",".delete-preview-icon",$.proxy(function(){this.deselectSpace(),this.getBody().find(".url-input").val("")},this)),this.$houzzView.find(".url-input").on("paste",$.proxy(function(a){setTimeout($.proxy(function(){this.previewSpaceByUrl($(a.target).val())},this),0)},this)).on("focus",$.proxy(function(a){this.previewSpaceByUrl($(a.target).val())},this)).on("focus",function(a){$(this).select()}),this.$ideabooksView.find(".ideabook-list").change($.proxy(function(a){this.loadSpacesFromIdeabook($(a.target).val())},this)),this.$projectsView.find(".project-list").change($.proxy(function(a){this.loadSpacesFromProject($(a.target).val())},this)),this},this.initDropzoneSettings=function(){var a=this;return this.dropzoneSettings={autoProcessQueue:!0,url:"/createTempPhoto",forceFallback:!1,paramName:"file",parallelUploads:1,createImageThumbnails:!0,addRemoveLinks:!1,thumbnailWidth:340,thumbnailHeight:360,maxFilesize:30,maxFiles:1,uploadMultiple:!1,previewsContainer:".dropzone-messages",previewTemplate:"<div class='dz-preview dz-file-preview'><div class='dz-details'><div class='dz-filename hide'><span data-dz-name></span></div><div class='dz-size hide' data-dz-size></div> <img class='hide' data-dz-thumbnail /></div><div class='dz-progress hide'><span class='dz-upload' data-dz-uploadprogress></span></div><div class='dz-success-mark hide'><span>✔</span></div><div class='dz-error-mark hide'><span>✘</span></div><div class='dz-error-message'><span data-dz-errormessage></span></div></div>",acceptedFiles:".jpg,.jpeg,.gif,.png,.tif,.tiff",dictDefaultMessage:"<i></i>"+_hgt("Click or drag & drop a photo here to upload"),dictFallbackMessage:_hgt(""),dictFallbackText:_hgt("Click 'Browse' to select an image file from your hard drive, then click 'Upload'"),dictFileTooBig:_hgt("File is too big ({size}MB). Max filesize: {max}MB.",{"size:":"{{filesize}}",max:"{{maxFilesize}}"}),dictInvalidFileType:_hgt("You can't upload files of this type"),dictResponseError:_hgt("Server responded with {statusCode} code.",{statusCode:"{{statusCode}}"}),dictCancelUpload:_hgt("Cancel upload"),dictCancelUploadConfirmation:_hgt("Are you sure you want to cancel this upload?"),dictRemoveFile:_hgt("Remove file"),dictRemoveFileConfirmation:null,init:function(){var b=$(this.element).find(".dz-default.dz-message");b.find("i").remove(),b.find("span").append('<button class="hzBtn secondary"><i class="hzi-font hzi-Search"></i><span>'+_hgt("Browse")+"</span></button>"),this.on("sending",function(a,b,c){c.append("type",-1),c.append("minWidth",0),c.append("minHeight",0)}).on("complete",function(a){}).on("success",function(b,c){this.removeFile(b),"string"==typeof c&&(c=JSON.parse(c)),c&&"false"===c.success?(a.displayMessages(_hgt("Error uploading photo")),a.isUploadedImage=!1):c&&c.tempImageUrl&&(a.selectedSpaceImageUrl=c.tempImageUrl,a.isUploadedImage=!0,a.previewSpace())}).on("maxfilesexceeded",function(a){a&&this.removeFile(a)}).on("error",function(a,b,c){a&&this.removeFile(a)})}},this},this.prepareDialogSettings=function(){return this.dialogSettings={title:_hgt("Insert Photo"),body:this.$body,formName:"insert-photo-form",dialogClassName:"insert-photo-dialog",dialogSize:"modal-lg",controls:[HZ.ui.AjaxThrobber.getThrobber(),HZ.ui.InputButtonUtils.createSecondaryInputButton(_hgt("Cancel"),"",$.proxy(this.onCancel,this)),HZ.ui.InputButtonUtils.createPrimaryInputButton(_hgt("Insert"),"",$.proxy(this.onInsertPhoto,this),!1)],onViewLoaded:$.proxy(function(){this.$richTextEditor.blurEditor(),this.resetDialog(),this.loadIdeabooks(),this.loadProjects(),this.initDropzone()},this),onViewUnloaded:$.proxy(function(){var a=this.$richTextEditor.getSelection();$(a.anchorNode).closest(".note-editable").length||this.$richTextEditor.focusEditor()},this)},this},this.resetDialog=function(){return this.$ideabooksView.find(".load-more-ideabook-spaces-throbber").hide(),this.$ideabooksView.find(".load-more-ideabook-spaces-button").hide(),this.$projectsView.find(".load-more-project-spaces-throbber").hide(),this.$projectsView.find(".load-more-project-spaces-button").hide(),this.$houzzView.find(".url-input").val(""),this.areIdeabooksLoaded&&this.areProjectsLoaded||this.$leftContainer.addClass("loading-spaces"),this.deselectSpace(),this},this.initDropzone=function(){return this.dropzone||(this.dropzone=new Dropzone(".hz-dropzone",this.dropzoneSettings),this.initAjaxFileUpload()),this},this.previewSpaceByUrl=function(a){var b=new RegExp("https?://(?:www\\.)?(?:mytest|houzztest|houzz2?|stghouzz)\\.[A-Za-z\\./]*/("+HZ.utils.Config.spaceCommand+"|"+HZ.utils.Config.photoCommand+"|"+HZ.utils.Config.productCommand+"|"+HZ.utils.Config.galleryCommand+"|projects)/(\\d+)(?=(?:\\D|$))[/\\?=&\\+%\\w-#]*","g"),c=a.match(b);return c&&c.length&&HZ.ajaz.Services.getMinimalSpaceData(c[0],$.proxy(function(a){if(a&&"true"===a.success&&a.spaces&&a.images){var b,c,d,e=HZ.data.Spaces.getCollection(),f=HZ.data.Images.getCollection();if(Object.keys)b=a.urlToId[Object.keys(a.urlToId)[0]];else for(var g in a.urlToId){b=a.urlToId[g];break}$.extend(!0,e,a.spaces),$.extend(!0,f,a.images),HZ.data.Spaces.addAll(e),HZ.data.Images.addAll(f),c=HZ.data.Spaces.get(b),d=c.iids[0],this.selectedSpaceImageUrl=HZ.utils.Links.C.baseStaticImageUrl+d+"_4-0000/home-design.jpg",this.selectedSpaceId=b,this.selectedSpaceWidth=c.w,this.selectedSpaceHeight=c.h,this.limitWidthWithinBounds(550),this.previewSpace()}},this)),this},this.initAjaxFileUpload=function(){var a=this.$previewView.find(".hz-dropzone .dz-fallback");return a.find('input[type="file"]').ajaxfileupload({action:"/createTempPhoto",params:{type:-1},submit_button:a.find("button[type=submit]"),onStart:function(){},onComplete:$.proxy(function(a){!1===a.status&&void 0!==a.message?(this.isUploadedImage=!1,this.displayMessages(a.message)):a.error?(this.isUploadedImage=!1,this.displayMessages(a.errorMessage||"")):a.tempImageUrl&&(this.selectedSpaceImageUrl=a.tempImageUrl,this.isUploadedImage=!0,this.previewSpace())},this)}),this},this.displayMessages=function(a){return this.$previewView.find(".dropzone-messages").html(a).show().delay(3e3).fadeOut(300),this},this.onInsertPhoto=function(){return this.onInsertPhotoCallback&&this.onInsertPhotoCallback.apply(this,[$(this.getBody())]),HZ.ui.Yamdi.hide(this),this},this.onCancel=function(){return HZ.ui.Yamdi.hide(this),this},this.viewTabAtIndex=function(a){return this.$tabControls.find("li").removeClass("active").eq(a).addClass("active"),this.$tabViews.hide().eq(a).show(),2===a&&this.$tabViews.eq(a).find(".url-input").focus(),this},this.infiniteScroll=function(a,b,c){return-1*(a.height()-(b.height()-a.position().top))>-90&&c(),this},this.loadIdeabooks=function(){return this.areIdeabooksLoaded||(HZ.ajaz.Services.getMyGalleries($.proxy(this.populateIdeabooks,this)),this.$ideabooksView.find(".ideabooks-list").empty().append('<option value="-1">'+_hgt("Loading Ideabooks...")+"</option>").attr("disabled","disabled")),this},this.loadProjects=function(){return this.areProjectsLoaded||(HZ.ajaz.Services.getProfessionalProjects(null,$.proxy(this.populateProjects,this)),this.$projectsView.find(".project-list").empty().append('<option value="-1">'+_hgt("Loading Projects...")+"</option>").attr("disabled","disabled")),this},this.populateIdeabooks=function(a){var b=this.$ideabooksView.find(".ideabook-list").removeAttr("disabled").empty();if(this.areIdeabooksLoaded=!0,!a.success||"true"!=a.success)return this.$ideabooksView.find(".ideabook-spaces-wrapper").hide(),this.$ideabooksView.find(".no-ideabooks-message").show(),void b.prop("disabled",!0);for(var c,d=0;d<a.galleries.own.length;d++){var e=a.galleries.own[d];c=e.id,this.ideabooks[c]=e,this.ideabooks[c].ajaxFromItem=0,this.ideabooks[c].ajaxItemsPerPage=1e3,this.ideabooks[c].fromItem=0,this.ideabooks[c].itemsPerPage=50,b.append('<option value="'+c+'">'+e.title+"</option>")}b.customDropdown();var f;if(Object.keys)f=Object.keys(this.ideabooks).length;else{f=0;for(var g in this.ideabooks)f++}return f?this.loadSpacesFromIdeabook(a.galleries.own[0].id):(this.$ideabooksView.find(".no-ideabooks-message").show(),b.parent(".dropdown-wrapper-2").hide()),this.areProjectsLoaded&&this.areIdeabooksLoaded&&this.initTabViews(),this},this.populateProjects=function(a){var b=this.$projectsView.find(".project-list").removeAttr("disabled").empty();if(this.areProjectsLoaded=!0,!a.success||"true"!=a.success)return this.$projectsView.find(".project-spaces-wrapper").hide(),this.$projectsView.find(".no-projects-wrapper").show(),void b.prop("disabled",!0);for(var c,d=0;d<a.projects.length;d++){var e=a.projects[d];c=e.id,this.projects[c]=e,this.projects[c].ajaxFromItem=0,this.projects[c].ajaxItemsPerPage=1e3,this.projects[c].fromItem=0,this.projects[c].itemsPerPage=50,b.append('<option value="'+c+'">'+e.title+"</option>")}b.customDropdown();var f;if(Object.keys)f=Object.keys(this.projects).length;else{f=0;for(var g in this.projects)f++}return f?this.loadSpacesFromProject(a.projects[0].id):(this.$projectsView.find(".no-projects-message").show(),b.parent(".dropdown-wrapper-2").hide()),this.areProjectsLoaded&&this.areIdeabooksLoaded&&this.initTabViews(),this},this.loadSpacesFromIdeabook=function(a){if(a!=this.currentIdeabookId)if(this.currentIdeabookId=a,this.$ideabooksView.find(".ideabook-spaces-list").empty(),a in this.ideabookSpaces){var b=this.ideabooks[a].fromItem;this.ideabooks[a].fromItem=0,this.populateIdeabookPhotos(a,b)}else this.getSpacesForIdeabook(a);return this},this.loadSpacesFromProject=function(a){if(a!=this.currentProjectId)if(this.currentProjectId=a,this.$projectsView.find(".project-spaces-list").empty(),a in this.projectSpaces){var b=this.projects[a].fromItem;this.projects[a].fromItem=0,this.populateProjectPhotos(a,b)}else this.getSpacesForProject(a);return this},this.getSpacesForIdeabook=function(a){var b=this.$ideabooksView.find(".load-more-ideabook-spaces-throbber").show();return HZ.ajaz.Services.getHousesByGallery(a,this.ideabooks[a].ajaxFromItem,this.ideabooks[a].ajaxItemsPerPage,$.proxy(function(c){this.ideabookSpaces[a]=this.ideabookSpaces[a]||[],c.houses=c.houses||[],$.merge(this.ideabookSpaces[a],c.houses);for(var d in c.houses)this.allSpaces[c.houses[d].i]=c.houses[d];c.hasMore?(this.ideabooks[a].ajaxFromItem+=this.ideabooks[a].ajaxItemsPerPage,this.getSpacesForIdeabook(a)):(b.hide(),this.populateIdeabookPhotos(a))},this)),this},this.getSpacesForProject=function(a){var b=this.$projectsView.find(".load-more-project-spaces-throbber").show();return HZ.ajaz.Services.getProfessionalProjectPhotosPaginated(a,null,this.projects[a].ajaxFromItem,this.projects[a].ajaxItemsPerPage,$.proxy(function(c){this.projectSpaces[a]=this.projectSpaces[a]||[];var d=[];for(var e in c.spaces)d.push(c.spaces[e]);$.merge(this.projectSpaces[a],d);for(var f,e=0;e<d.length;e++)f=d[e],this.allSpaces[f.id]=f;c.hasMore?(this.projects[a].ajaxFromItem+=this.projects[a].ajaxItemsPerPage,this.getSpacesForProject(a)):(b.hide(),this.populateProjectPhotos(a))},this)),this},this.populateIdeabookPhotos=function(a,b){for(var c,d,e=this.ideabookSpaces[a],f=b||this.ideabooks[a].fromItem+this.ideabooks[a].itemsPerPage,g=this.$ideabooksView.find(".ideabook-spaces-list"),h=this.ideabooks[a].fromItem;h<f&&h<e.length;h++){var i=e[h];d=$('<img src="'+i.thumb+'">').hide(),c=$('<div id="thumb-'+i.i+'" class="picker-thumb"></div>').attr("data-spaceid",i.i).css("background-image","url("+i.thumb+")").append('<div class="selectedcheck"></div>').append(d).on("click",$.proxy(function(a){this.selectSpace($(a.target).data("spaceid"))},this)),g.append(c)}return d&&d.one("load",$.proxy(function(c){var d=this.$ideabooksView.find(".ideabook-spaces-wrapper");if(e.length-(b||this.ideabooks[a].fromItem)>0){var f=$.proxy(function(){this.populateIdeabookPhotos(a)},this);d.on("scroll",$.throttle(250,$.proxy(function(){this.infiniteScroll(g,d,f)},this)))}else d.off("scroll")},this)).each(function(){this.complete&&$(this).load()}),this.ideabooks[a].fromItem=h,this},this.populateProjectPhotos=function(a,b){for(var c,d,e=this.projectSpaces[a],f=b||this.projects[a].fromItem+this.projects[a].itemsPerPage,g=this.$projectsView.find(".project-spaces-list"),h=this.projects[a].fromItem;h<f&&h<e.length;h++){var i=e[h];d=$('<img src="'+i.thumb+'">').hide(),c=$('<div id="thumb-'+i.id+'" class="picker-thumb"></div>').attr("data-spaceid",i.id).css("background-image","url("+i.thumb+")").append('<div class="selectedcheck"></div>').append(d).on("click",$.proxy(function(a){this.selectSpace($(a.target).data("spaceid"))},this)),g.append(c)}return d&&d.one("load",$.proxy(function(c){var d=this.$projectsView.find(".project-spaces-wrapper");if(e.length-(b||this.projects[a].fromItem)>0){var f=function(){this.populateProjectPhotos(a)};d.on("scroll",$.throttle(250,function(){this.infiniteScroll(g,d,f)}))}else d.off("scroll")},this)).each(function(){this.complete&&$(this).load()}),this.projects[a].fromItem=h,this},this.initTabViews=function(){
var a=this.$projectsView.find(".project-list option").length,b=this.$ideabooksView.find(".ideabook-list option").length;return this.$leftContainer.removeClass("loading-spaces"),a?this.viewTabAtIndex(1):b?this.viewTabAtIndex(0):this.viewTabAtIndex(2),this},this.selectSpace=function(a){return this.selectedSpaceId=a,this.selectedSpaceImageUrl=this.allSpaces[a].img,this.selectedSpaceWidth=this.allSpaces[a].originalWidth,this.selectedSpaceHeight=this.allSpaces[a].originalHeight,this.limitWidthWithinBounds(550),this.previewSpace(),this.$leftContainer.find("#thumb-"+a).addClass("selected"),this},this.limitWidthWithinBounds=function(a){var b=this.selectedSpaceWidth/this.selectedSpaceHeight;return this.selectedSpaceWidth>a&&(this.selectedSpaceWidth=a,this.selectedSpaceHeight=this.selectedSpaceWidth/b),this},this.previewSpace=function(){this.deselectSpace(),this.$previewView.find(".hz-dropzone").hide();var a=$('<div class="ajax-throbber"></div>'),b=$('<i class="delete-preview-icon"></i>'),c=$('<img class="space-preview-thumb">').hide().attr("src",this.selectedSpaceImageUrl).attr("data-spaceid",this.selectedSpaceId).attr("data-width",this.selectedSpaceWidth).attr("data-height",this.selectedSpaceHeight).attr("data-isupload",this.isUploadedImage).on("load",function(){a.hide(),$(this).show(),b.show()}),d=$('<span class="space-preview"></span>').append(c).append(b);return this.$previewView.find(".preview-wrapper").empty().append(a).append(d).show(),this.isUploadedImage=!1,this.getControls().find("input[type=submit]").attr("disabled",!1),this},this.deselectSpace=function(){return this.$leftContainer.find(".picker-thumb.selected").removeClass("selected"),this.$previewView.find(".preview-wrapper").empty().hide(),this.$previewView.find(".hz-dropzone").show(),this.getControls().find("input[type=submit]").attr("disabled",!0),this},this.prepare=function(){return this.initVariables(),this.createDialogBody(),this.defineViewObjects(),this.addEventListeners(),this.prepareDialogSettings(),this.initDropzoneSettings(),this.init(this.dialogSettings),this},this.showDialog=function(){return HZ.ui.Yamdi.show(this),this}},HZ.extend(HZ.textEditor.InsertPhotoDialog,HZ.ui.yamdi.Dialog),HZ.textEditor.InsertPhoto=new function(){this.prepare=function(){return this.InsertPhotoDialog||(this.InsertPhotoDialog=new HZ.textEditor.InsertPhotoDialog,this.InsertPhotoDialog.prepare()),this},this.showDialog=function(){return this.InsertPhotoDialog.showDialog(),this}},HZ.textEditor.InsertVideoDialog=function(){HZ.textEditor.InsertVideoDialog.superclass.constructor.call(this),this.onInsertVideoCallback=null,this.prepare=function(){return this.init({title:_hgt("Insert Video"),body:'<div class="video-label">'+_hgt("Video URL")+'</div><div class="video-caption">'+_hgt("(Youtube and Vimeo supported)")+'</div><input class="video-input" type="text">',formName:"insert-video-form",dialogClassName:"insert-video-dialog",controls:[HZ.ui.AjaxThrobber.getThrobber(),HZ.ui.InputButtonUtils.createSecondaryInputButton(_hgt("Cancel"),"",$.proxy(this.onCancel,this)),HZ.ui.InputButtonUtils.createPrimaryInputButton(_hgt("Insert"),"",$.proxy(this.onInsertVideo,this),!1)],onViewLoaded:function(){this.getBody().find(".video-input").val("").focus()},onViewUnloaded:function(){var a=this.$richTextEditor.getSelection();$(a.anchorNode).closest(".note-editable").length||this.$richTextEditor.focusEditor()}}),this},this.showDialog=function(){return HZ.ui.Yamdi.show(this),this},this.onCancel=function(){return HZ.ui.Yamdi.hide(this),this},this.onInsertVideo=function(){return this.onInsertVideoCallback&&this.onInsertVideoCallback($(this.getBody())),HZ.ui.Yamdi.hide(this),this}},HZ.extend(HZ.textEditor.InsertVideoDialog,HZ.ui.yamdi.Dialog),HZ.textEditor.InsertVideo=new function(){this.prepare=function(){return this.InsertVideoDialog||(this.InsertVideoDialog=new HZ.textEditor.InsertVideoDialog,this.InsertVideoDialog.prepare()),this},this.showDialog=function(){return this.InsertVideoDialog.showDialog(),this}},HZ.textEditor.InsertLinkDialog=function(){HZ.textEditor.InsertLinkDialog.superclass.constructor.call(this),this.onInsertLinkCallback=null,this.prepare=function(){this.init({title:_hgt("Insert Link"),body:'<div class="form-group"><label class="text-label control-label">'+_hgt("Text to Display")+'</label><input class="text-input form-control" type="text"></div><div class="form-group"><label class="url-label control-label">'+_hgt("Web Address (URL)")+'</label><input class="url-input form-control" type="text"></div>',formName:"insert-link-form",dialogClassName:"insert-link-dialog",controls:[HZ.ui.AjaxThrobber.getThrobber(),HZ.ui.InputButtonUtils.createSecondaryInputButton(_hgt("Cancel"),"",$.proxy(this.onCancel,this)),HZ.ui.InputButtonUtils.createPrimaryInputButton(_hgt("Insert"),"",$.proxy(this.onInsertLink,this),!1)],onViewLoaded:function(){this.onViewLoadedCallback&&this.onViewLoadedCallback($(this.getBody())),this.getBody().find(".url-input").focus()},onViewUnloaded:function(){var a=this.$richTextEditor.getSelection();$(a.anchorNode).closest(".note-editable").length||this.$richTextEditor.focusEditor()}});var a=this.getBody().find(".text-input");return this.getBody().find(".url-input").on("keyup paste",function(){var b=a.val(),c=$(this);setTimeout(function(){(""==b||b.length<c.val().length&&b==c.val().substring(0,b.length)||c.val().length>0&&c.val()==b.substring(0,c.val().length))&&a.val(c.val())},100)}),this},this.showDialog=function(){return HZ.ui.Yamdi.show(this),this},this.onCancel=function(){return HZ.ui.Yamdi.hide(this),this},this.onInsertLink=function(){return this.onInsertLinkCallback&&this.onInsertLinkCallback($(this.getBody())),HZ.ui.Yamdi.hide(this),this}},HZ.extend(HZ.textEditor.InsertLinkDialog,HZ.ui.yamdi.Dialog),HZ.textEditor.InsertLink=new function(){this.prepare=function(){return this.InsertLinkDialog||(this.InsertLinkDialog=new HZ.textEditor.InsertLinkDialog,this.InsertLinkDialog.prepare()),this},this.showDialog=function(){return this.InsertLinkDialog.showDialog(),this}};

window.hzmr.push("richTextEditor:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End richTextEditor.js  **************/
/************* Start extracting text for questionRichTextEditor.js for locale it-IT **************/
(function(){var _hzxt={"Choose File":"Scegli file","No file chosen":"Nessun file selezionato","Back":"Indietro","Cancel":"Annulla","Add":"Aggiungi","What are you working on?":"Stai lavorando ad un progetto?"};for(var a in _hzxt){window._hzlang[a]=_hzxt[a];}})();
/*************  End extracting text for questionRichTextEditor.js  **************/
/************* Start questionRichTextEditor.js for locale it-IT **************/
try {$.fn.PostQuestionEditor=function(){return this.onSubmit=function(){var a=this.$richTextEditor.isEmpty()?"":this.$richTextEditor.code();return this.$textarea.val(a),this},this.overrideResizeEditorFn=function(){return this.previousResizeEditorFn=this.$richTextEditor.resizeEditor,this.$richTextEditor.resizeEditor=function(){return this},this},this.restoreResizeEditorFn=function(){return this.$richTextEditor.resizeEditor=this.previousResizeEditorFn,this.previousResizeEditorFn=null,this},this.setDefaultValue=function(){var a=this.$textarea.attr("placeholder"),b=this.$textarea.val();return""!=b&&b!=a&&(this.$richTextEditor.code(this.$textarea.val()),this.$richTextEditor.$editor.find("iframe.js-iframe-hz").each(function(a){var b=$(this),c=b.data("content"),d=b[0].contentWindow.document;d.write(c),d.close(),b.removeAttr("data-content")}),this.$richTextEditor.$editor.find("img, iframe").css("display","block"),this.$richTextEditor.$editor.find("iframe").css("width","100%"),this.$richTextEditor.resizeIframeWrappers(),this.$richTextEditor.resizeEditor()),this},this.prepareFullscreen=function(){return this.$enterFullscreenButton=$('<div class="note-link btn-group hidden-xs"><button type="button" class="btn btn-default btn-sm btn-small" title="Fullscreen"><i class="hzi-font hzi-Full-screen"></i></button></div>').css("float","right").on("click",$.proxy(this.enterFullscreen,this)).appendTo(this.$richTextEditor.$toolbar),this.$cancelFullscreenButton=HZ.ui.InputButtonUtils.createSecondaryInputButton(_hgt("Cancel"),"",$.proxy(this.exitFullscreen,this)).hide().css({float:"right","margin-right":"13px"}).insertAfter(this.$submitButton),this.$titleInputWrapper=this.find(".bubble--post"),this.$formTitle=$('<div class="form-title">'+_hgt("What are you working on?")+"</div>").hide().insertBefore(this.$titleInputWrapper),this.$exitFullscreenButton=$('<div class="exit-fullscreen-wrapper"><i class="hzi-font hzi-Exit-full-screen"></i><span>'+_hgt("Back")+"</span></div>").hide().on("click",$.proxy(this.exitFullscreen,this)).insertBefore(this.$titleInputWrapper),this.$clearFix=$('<div class="clearfix"></div>').hide().insertBefore(this.$titleInputWrapper),this},this.togglePollDialogButton=function(){var a=18===parseInt(this.$questionTopicSelect.val());return this.$showPollDialogButton.toggle(a),this},this.enterFullscreen=function(){return this.$cancelFullscreenButton.show(),this.$addChoicesWrapper.hide(),this.togglePollDialogButton(),this.$questionTopicSelect.on("change",$.proxy(this.togglePollDialogButton,this)),this.$formTitle.show(),this.$clearFix.show(),this.$enterFullscreenButton.hide(),this.$exitFullscreenButton.show(),this.wrap('<p class="full-screen-wrapper">').addClass("full-screen"),this.$richTextEditor.$toolbar.find("button span").show(),HZ.textEditor.AddPollOptions.AddPollOptionsDialog.setButtonLabel(),this.height("auto"),this.overrideResizeEditorFn(),this.$richTextEditor.resizeIframeWrappers(),this.resizeEditor(),this.$richTextEditor.resizeToolbarButtons(),$(window).on("resize",this.throttledResize),this},this.exitFullscreen=function(){return this.$cancelFullscreenButton.hide(),this.$showPollDialogButton.hide(),this.$addChoicesWrapper.show(),this.$questionTopicSelect.off("change",this.togglePollDialogButton),this.$formTitle.hide(),this.$clearFix.hide(),this.$exitFullscreenButton.hide(),this.$enterFullscreenButton.show(),this.unwrap().removeClass("full-screen"),this.$richTextEditor.$toolbar.find("button span").css("display",""),this.height(""),this.restoreResizeEditorFn(),$(window).off("resize",this.throttledResize),this.find(".note-editable-wrapper").css("height","").css("max-height",""),this.$richTextEditor.resizeIframeWrappers(),this.$richTextEditor.resizeToolbarButtons(),this.$richTextEditor.resizeEditor(),this},this.resizeEditor=function(){var a=$(window).height()-320;return this.$richTextEditor.$editorWrapper.css("height",a).css("max-height",a),this},this.preparePollOptionsDialog=function(){return this.$showPollDialogButton=$(HZ.ui.ButtonFactory.createBaseIconButton(_hgt("Add Poll Options"),"add-poll-options-button","","","hzi-Add-Photo-Button")).insertAfter(".editQuestionTopic").hide().on("click",$.proxy(HZ.textEditor.AddPollOptions.showDialog,HZ.textEditor.AddPollOptions)),HZ.textEditor.AddPollOptions.prepare({$formWrapper:this.$addChoicesWrapper,$button:this.$showPollDialogButton}),this},this.initCustomFileInputs=function(){return this.$fileInputs.each(function(a,b){new CustomFileInput($(b)).prepare().init()}),this},this.onFocus=function(a){var b=$(a.target).closest(".choiceLine"),c=b.next();if(c.length&&!c.find(".custom-file-input-wrapper").length){var d=c.find(".optionFileInput");new CustomFileInput(d).prepare().init()}},this.initAddChoiceOnFocus=function(){return this.find("#editQuestionAddChoicesContainer").on("focus",".optionInput",$.proxy(this.onFocus,this)),this},this.initRichTextEditor=function(){return this.$textarea.hide(),this.$richTextEditor.init(),this.$addPhotoButton.hide(),this},this.prepare=function(){return this.$rteWrapper=$('<div class="rich-text-editor-wrapper"><div class="rich-text-editor"></div></div>'),this.$textarea=this.find("#editQuestionBody").after('<input type="hidden" name="isHtml" value="1"/>').after(this.$rteWrapper),this.$addPhotoButton=this.find("#expandFileInputs"),this.$submitButton=this.find("#editQuestionSubmitBtn"),this.$fileInputs=this.find(".optionFileInput"),this.$questionTopicSelect=this.find("#editQuestionTopicBox"),this.$addChoicesWrapper=this.find(".edit-question-add-choices-wrapper"),this.$richTextEditor=this.$rteWrapper.find(".rich-text-editor").RichTextEditor({inactiveHeight:127,activeHeight:127,shortFormMaxHeight:127,longFormMaxHeight:320,textArea:this.$textarea}).prepare(),this.throttledResize=$.throttle(250,$.proxy(function(){this.resizeEditor()},this)),this},this.init=function(){return this.initRichTextEditor(),this.prepareFullscreen(),this.preparePollOptionsDialog(),this.initCustomFileInputs(),this.initAddChoiceOnFocus(),this.setDefaultValue(),this.$submitButton.on("click",$.proxy(this.onSubmit,this)),this},this},HZ.textEditor.AddPollOptionsDialog=function(){HZ.textEditor.AddPollOptionsDialog.superclass.constructor.call(this),this.positionDialog=function(){return this.getForm().closest("#yamdiContainer").css({top:200,"margin-top":0}),this},this.onCancel=function(){return HZ.ui.Yamdi.hide(this),this},this.onAddPollOptions=function(){return HZ.ui.Yamdi.hide(this),this},this.onViewLoaded=function(){return this.$formWrapper.show(),this.$form.appendTo(this.getBody()),this.getBody().on("focus",".optionInput",$.proxy(this.onFocus,this)),this},this.onViewUnloaded=function(){return this.$form.appendTo(this.$formWrapper),this.$formWrapper.hide(),this.getBody().off("focus"),this.setButtonLabel(),this},this.setButtonLabel=function(){this.calcNumPollOptions(),this.$buttonLabel.text(_hgt("Add Poll Options")+" ( "+this.numPollOptions+" )")},this.calcNumPollOptions=function(){return this.numPollOptions=0,this.$form.find(".optionInput").each($.proxy(function(a,b){var c=$(b).val(),d=$(b).attr("placeholder");$(b).val().length&&c!=d&&this.numPollOptions++},this)),this},this.onFocus=function(a){var b=$(a.target).closest(".choiceLine");return b.index()===b.siblings(".choiceLine").length-1&&this.getBody().scrollTop(this.$form.height()),this},this.prepare=function(a){return this.$formWrapper=a.$formWrapper,this.$button=a.$button,this.$form=this.$formWrapper.find("#editQuestionAddChoicesContainer"),this.$buttonLabel=this.$button.find(".button-label"),this.init({title:_hgt("Add Poll Options"),body:"",formName:"add-poll-options-form",dialogClassName:"add-poll-options-dialog",controls:[HZ.ui.AjaxThrobber.getThrobber(),HZ.ui.InputButtonUtils.createSecondaryInputButton(_hgt("Cancel"),"",$.proxy(this.onCancel,this)),HZ.ui.InputButtonUtils.createPrimaryInputButton(_hgt("Add"),"",$.proxy(this.onAddPollOptions,this),!0)],onViewLoaded:$.proxy(this.onViewLoaded,this),onViewUnloaded:$.proxy(this.onViewUnloaded,this)}),this},this.showDialog=function(){return HZ.ui.Yamdi.show(this),this.positionDialog(),this}},HZ.extend(HZ.textEditor.AddPollOptionsDialog,HZ.ui.yamdi.Dialog),HZ.textEditor.AddPollOptions=new function(){this.prepare=function(a){this.AddPollOptionsDialog||(this.AddPollOptionsDialog=new HZ.textEditor.AddPollOptionsDialog,this.AddPollOptionsDialog.prepare(a))},this.showDialog=function(){this.AddPollOptionsDialog.showDialog()}};var CustomFileInput=function(a){this.initCustomInput=function(){return this.$input.wrap(this.$wrapper),this.$wrapper=this.$input.parent(),this.$wrapper.append(this.$button).append(this.$label),this},this.addEventListeners=function(){return this.$button.on("click",$.proxy(function(a){this.$input.click()},this)),this.$input.on("change",$.proxy(function(a){var b=$(a.currentTarget).val().split(/(\\|\/)/g).pop();this.$label.text(b.length?b:"No file chosen")},this)),this},this.show=function(){return this.$input.hide(),this.$button.show(),this.$label.show(),this},this.hide=function(){return this.$input.show(),this.$button.hide(),this.$label.hide(),this},this.prepare=function(){return this.$input=a,this.$wrapper=$('<div class="custom-file-input-wrapper"></div>'),this.$button=$('<a class="hzBtn secondary">'+_hgt("Choose File")+"</a>"),this.$label=$("<span>"+_hgt("No file chosen")+"</span>"),this},this.init=function(){return this.initCustomInput(),this.addEventListeners(),this.show(),this}};

window.hzmr.push("questionRichTextEditor:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End questionRichTextEditor.js  **************/
/************* Start extracting text for commentRichTextEditor.js for locale it-IT **************/
(function(){var _hzxt={"Please enter your comment.":"Inserisci il tuo commento.","Cancel":"Annulla","":""};for(var a in _hzxt){window._hzlang[a]=_hzxt[a];}})();
/*************  End extracting text for commentRichTextEditor.js  **************/
/************* Start commentRichTextEditor.js for locale it-IT **************/
try {$.fn.AddCommentEditor=function(){return this.prepare=function(){return this.$textarea=this.find(".commentBody").after('<input type="hidden" name="isHtml" value="1"/>').after('<div class="rich-text-editor-wrapper"><div class="rich-text-editor"></div></div>'),this.$errorMsgDiv=this.find(".commentError"),this.$richTextEditor=this.find(".rich-text-editor").RichTextEditor({inactiveHeight:50,activeHeight:50,shortFormMaxHeight:50,longFormMaxHeight:250,textArea:this.$textarea}).prepare(),this.$submitButton=this.find(".submitAddComment"),this},this.init=function(){return this.$textarea.hide(),this.find(".addCommentExtra").show(),this.$richTextEditor.init(),this.$richTextEditor.$editor.focus(),this.$submitButton.on("click",$.proxy(this.onClick,this)),this.addClass("active"),this},this.onClick=function(a){var b=this.$richTextEditor.isEmpty()?"":this.$richTextEditor.code();return this.$textarea.val(b),this},this},$.fn.EditCommentEditor=function(a){a=a||{};var b=!1;return this.onShow=function(){return this},this.onHide=function(){return this},this.submit=function(a){if(!b){b=!0,this.$cancelButton.prop("disabled",!0),this.$submitButton.prop("disabled",!0);var c,d=this.$form.find('[name="objectType"]').val(),e=this.$form.find('[name="objectId"]').val(),f=this.$form.find('[name="commentId"]').val(),g=this.$form.find("textarea"),h=this.$form.find(".commentError"),i=this.$richTextEditor.isEmpty()?"":this.$richTextEditor.code(),j=this.$form.find('[name="isHtml"]').val(),k=this.$form.find('[name="privacy"]').val();if(i.length){var l=parseInt(g.attr("maxlength"),10)||1e4,m=i.length;if(m>l&&(c=_hgt("Your post is {numOfCharsToDelete} too long, posts can be up to {lengthLimit} characters. Please make it a little shorter and try again.",{lengthLimit:l,numOfCharsToDelete:_hgtp("","1 character","{n} characters",m-l,{n:m-l})})),c)return b=!1,this.$cancelButton.prop("disabled",!1),this.$submitButton.prop("disabled",!1),h.text(c).slideDown(),void a.stopPropagation();HZ.ajaz.Services.updateComment(d,e,f,i,k,"",j,$.proxy(this.onSuccess,this))}else if(c=_hgt("Please enter your comment."),b=!1,this.$cancelButton.prop("disabled",!1),this.$submitButton.prop("disabled",!1),c)return h.text(c).slideDown(),void a.stopPropagation()}},this.onSuccess=function(a){"true"===a.success&&a.comments&&(this.$form.find(".editCommentError").hide(),this.replaceWith($(a.comments)),b=!1,this.$cancelButton.prop("disabled",!1),this.$submitButton.prop("disabled",!1),this.$form.removeClass("dirty"))},this.hideEditor=function(){return this.onHide(),this.find(".error").hide(),this.removeClass("active"),this.$form.removeClass("dirty"),this.$form.hide().appendTo(this.$tempWrapper.find(".editCommentDiv")),this.append(this.$tempWrapper.children()),this.$submitButton.off("click",$.proxy(this.submit,this)),this.$cancelButton.remove(),this.$richTextEditor.closest(".rich-text-editor-wrapper").remove(),this},this.showEditor=function(){return this.onShow(),this.addClass("active"),this.$tempWrapper=$("<div></div>").addClass("temp").hide(),this.children().appendTo(this.$tempWrapper),this.append(this.$tempWrapper),this.append(this.$form.show().detach()),this.$form.find(".addCommentExtra").show(),this.$richTextEditor.code(this.$textarea.val()),this.$richTextEditor.resizeEditor(),this.$richTextEditor.resizeToolbarButtons(),this.$richTextEditor.focusEditor(),this},this.prepare=function(){return $.extend(this,a),this.$form=this.find(".commentForm"),this.$textarea=this.find(".user-text-input").after('<input type="hidden" name="isHtml" value="1"/>'),this.$rteWrapper=$('<div class="rich-text-editor-wrapper"><div class="rich-text-editor"></div></div>').insertAfter(this.$textarea),this.$richTextEditor=this.$rteWrapper.find(".rich-text-editor").RichTextEditor({inactiveHeight:50,activeHeight:50,shortFormMaxHeight:50,longFormMaxHeight:250,textArea:this.$textarea}).prepare(),this.$submitButton=this.find(".submitAddComment"),this},this.init=function(){return this.$textarea.hide(),this.$richTextEditor.init(),this.$submitButton.on("click",$.proxy(this.submit,this)),this.$cancelButton=HZ.ui.InputButtonUtils.createSecondaryInputButton(_hgt("Cancel"),"cancel-edit-comment",$.proxy(this.hideEditor,this)).insertAfter(this.$submitButton),this.find(".error").hide(),this},this};

window.hzmr.push("commentRichTextEditor:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End commentRichTextEditor.js  **************/
/************* Start extracting text for productMainButton.js for locale it-IT **************/
(function(){var _hzxt={"Buy Sample - {samplePrice}":"Acquista un campione - {samplePrice}","Check Availability":"Controlla la disponibilit\u00e0","Visit Store":"Sito del produttore","Add to Cart":"Visita lo shop"};for(var a in _hzxt){window._hzlang[a]=_hzxt[a];}})();
/*************  End extracting text for productMainButton.js  **************/
/************* Start productMainButton.js for locale it-IT **************/
try {HZ.ns("HZ.modules"),HZ.modules.ProductMainButton=new function(){var a=null,b=null,c=null,d=null,e=null,f=null,g=null,h=null,i=!1;this.init=function(a){a&&(b=a.hasOwnProperty("isPhone")?!0===a.isPhone:HZ.utils.Config.isResponsive,c=a.hasOwnProperty("isDesktop")?!0===a.isDesktop:!HZ.utils.Config.isResponsive,a.hasOwnProperty("scopeId")&&(d=a.scopeId),a.hasOwnProperty("spaceId")&&(e=a.spaceId),a.hasOwnProperty("vendorListingId")&&(f=a.vendorListingId),a.hasOwnProperty("sampleVendorListingId")&&(g=a.sampleVendorListingId),a.hasOwnProperty("signUpSourceLinks")&&(h=a.signUpSourceLinks),a.hasOwnProperty("isInlineWithQuantity")&&(i=a.isInlineWithQuantity))},this.setMountNode=function(b){a=b,a.on("click",".btn-add-to-cart",this.handleAddToCartClick.bind(this)),a.on("click",".btn-add-sample-to-cart",this.handleAddSampleToCartClick.bind(this)),a.on("click",".btn-check-availability",this.handleCheckAvailabilityClick.bind(this)),a.on("click",".btn-visit-store",this.handleVisitStoreClick.bind(this))},this.updateView=function(b,c){var d=HZ.data.Spaces.get(b),h=HZ.utils.Marketplace.ListingUtils.getSpaceVendorListing(d,c);if(d){e=d.id;var i=HZ.data.ProductsInfo.get(e),j=null;h&&(f=h.lid,j=HZ.data.Users.get(h.vid),h.hasOwnProperty("sbbSampleVlid")&&(g=h.sbbSampleVlid)),a&&a.empty().append(this.renderMainProductButton(d,i,h,j))}},this.renderMainProductButton=function(a,b,c,d){var e=null;return a&&a.prod&&(b||(b=HZ.data.ProductsInfo.get(a.id)),c||b&&b.mp&&(c=HZ.data.ListingsInfo.get(b.plid)),(b||c)&&(b&&b.mp||c&&c.mpListing?(c&&!d&&(d=HZ.data.Users.get(c.vid)),e=this.renderMarketplaceProductButton(c,d)):e=this.renderExternalProductButton(a,b,c,d))),e},this.renderMarketplaceProductButton=function(a){var b=null;if(a){var c=a.buyable,d=a.avail,e=a.activeMPListing,f=!0,g=a.itx,h=null,i=!1;HZ.data.CurrentSessionUser&&(h=HZ.data.CurrentSessionUser.getUserId()),h&&(i=!!HZ.data.Users.get(h).p);var j=a.isut;if(d&&e)if(g&&!j&&i)b=this.renderJoinTradeButton();else{var k=a.pending;c&&!k||(f=!1),b=this.renderAddToCartButton(f)}else b=this.renderAddToWishListButton();a.hasOwnProperty("sbbSamplePrice")&&(b+=this.renderBuySampleButton(a.sbbSamplePrice))}return b},this.renderJoinTradeButton=function(){return HZ.utils.Html.template('<a target="_blank" href="%linkUrl%" compid="joinTradeButton" class="btn btn-primary btn-lg btn-block header-3 ptl pbm mb0 btn-join-trade %className%"%scopeIdAttr%>%label%</a>',{linkUrl:HZ.utils.Links.getPageUrl("trade-program"),scopeIdAttr:this.renderScopeIdAttr(),label:_hgt("Join the Houzz Trade Program"),className:this.getMarketPlaceButtonExtraClassNames()})},this.renderBuySampleButton=function(a){var b=_hgt("Buy Sample - {samplePrice}",{samplePrice:a});return HZ.utils.Html.template('<button compid="addSampleToCart" class="btn btn-lg btn-block btn-primary-outline btn-add-sample-to-cart mts"%scopeId%>%label%</button>',{label:b,scopeId:this.renderScopeIdAttr()})},this.renderAddToCartButton=function(a){var b=a?"":" disabled";return HZ.utils.Html.template('<button compid="addToCart" class="btn btn-primary btn-lg btn-block btn-add-to-cart%className%"%disabledAttr%%scopeIdAttr%><i class="icon icon-font icon-shopping_cart mrs"></i> <span class="btn-label">%label%</span></button>',{disabledAttr:b,scopeIdAttr:this.renderScopeIdAttr(),label:_hgt("Add to Cart"),className:this.getMarketPlaceButtonExtraClassNames()})},this.renderAddToWishListButton=function(){return HZ.utils.Html.template('<button compid="availabilityNotification" class="btn btn-primary btn-lg btn-block btn-check-availability%className%"%scopeIdAttr%>%label%</button>',{scopeIdAttr:this.renderScopeIdAttr(),label:_hgt("Check Availability"),className:this.getMarketPlaceButtonExtraClassNames()})},this.getMarketPlaceButtonExtraClassNames=function(){var a="";return!c&&HZ.utils.Config.isResponsive||(a=i||HZ.lb.Config.isMainProdBtnQuantityInline?" header-5 ptm pbm mt0 mb0":" header-3 ptl pbm mb0"),a},this.renderExternalProductButton=function(a,b,c,d){var e=null;if(a){var f=HZ.data.SpaceListingIds.get(a.id),g=!f||1===f.length,h=a.hasOwnProperty("tl"),i=HZ.data.PPCAds.get(a.id),j=i&&i.isPPCProduct,k=c?!c.discon:!!b&&b.av,l=d||HZ.data.Users.get(a.ow),m=!!l&&l.mpv;if(j||h&&g)if(k){var n=a.srct,o=m&&(2===n||8===n);if(k&&!o){var p=!HZ.data.CurrentSessionUser,q=HZ.utils.User.isHiddenUser(l),r=_hgt("Visit Store"),s=null;s=p&&!q?"btn btn-primary btn-lg btn-block header-3 ptl pbm mb0 btn-visit-store btn-visit-store--visitor":"btn btn-primary btn-lg btn-visit-store",e=HZ.utils.Html.template('<button compid="visitStore" class="%className%"%scopeIdAttr%>%label%</button>',{label:r,className:s,scopeIdAttr:this.renderScopeIdAttr()})}}else e=_hgt("Currently not available");else e=""}return e},this.renderScopeIdAttr=function(){return d?HZ.utils.Html.template(' scopeid="%scopeId%"',{scopeId:d}):""},this.handleAddToCartClick=function(a){var b=$("#qtySelector").val()||1;b&&e&&f&&HZ.cart.Actions.addItem(e,f,b)},this.handleAddSampleToCartClick=function(a){e&&g&&HZ.cart.Actions.addItem(e,g,1)},this.handleCheckAvailabilityClick=function(a){if(HZ.data.CurrentSessionUser)HZ.ui.yamdi.Common.loading(_hgt("Loading")),HZ.ajaz.Services.Cart.addToWishList(e,HZ.module.AvailabilityNotification.handleAddToWishListResponse);else{var b=null;b=h&&h.hasOwnProperty("checkAvailability")?h.checkAvailability.sourceLink:75,HZ.auth.Manager.signup(b)}},this.handleVisitStoreClick=function(a){var b=HZ.data.Spaces.get(e),c=HZ.data.PPCAds.get(e);if(c&&c.isPPCProduct&&c.ppcProductUrl)window.open(c.ppcProductUrl);else if(HZ.data.CurrentSessionUser){var d=b.tl;d&&window.open(d)}else{var f=null,g=null,i=HZ.utils.Links.getSpaceLink(e),j=null;if(h&&h.hasOwnProperty("visitStore")){var k=h.visitStore;f=k.sourceLink,g=k.messageId,j=k.options}else f=68,g=6,j={rtEvent:"visitstore_lb_click"};HZ.auth.Manager.signup(f,g,i,null,j)}}};

window.hzmr.push("productMainButton:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End productMainButton.js  **************/
/************* Start extracting text for productBadge.js for locale it-IT **************/
(function(){var _hzxt={"Houzz Europe":"Houzz Europa","Houzz {importCountry}":"Houzz {importCountry}","Houzz Exclusive":"Esclusiva Houzz"};for(var a in _hzxt){window._hzlang[a]=_hzxt[a];}})();
/*************  End extracting text for productBadge.js  **************/
/************* Start productBadge.js for locale it-IT **************/
try {HZ.ns("HZ.modules.ProductBadge"),HZ.modules.ProductBadge=new function(){this.config={},this.addConfig=function(a,b){this.config[a]=b},this.renderBadge=function(a){var b=["product-badge-label","text-xs","text-bold"];b.push(a.className);var c=a.label;return'<div class="product-badge"><span class="'+b.join(" ")+'">'+c+"</span></div>"},this.renderFromCountryBadge=function(a,b){var c=[],d=[],e=[];Array.isArray(this.config.supportedCountryFlags)&&(c=this.config.supportedCountryFlags),Array.isArray(this.config.europeanCountryCodes)&&(d=this.config.europeanCountryCodes),Array.isArray(this.config.countryNameWhiteList)&&(e=this.config.countryNameWhiteList);var f="";if(Array.isArray(d)&&-1!==d.indexOf(a)){var g=a;Array.isArray(c)&&-1===c.indexOf(a)&&(g="other");var h=_hgt("Houzz {importCountry}",{importCountry:b});Array.isArray(e)&&-1===e.indexOf(a)&&(h=_hgt("Houzz Europe"),g="EU");var i=["country-flag","country-flag--"+g],j='<i class="'+i.join(" ")+'"></i>&nbsp;'+h;f=HZ.modules.ProductBadge.renderBadge({label:j,className:"product-badge-label--imported"})}return f},this.renderTradeExclusiveBadge=function(a){return this.renderBadge({label:a,className:"product-badge-label--trade"})},this.renderExclusiveBadge=function(){return this.renderBadge({label:_hgt("Houzz Exclusive"),className:"product-badge-label--exclusive"})},this.renderBestSellerBadge=function(){return this.renderBadge({label:_hgt("Best Seller"),className:"product-badge-label--bestseller"})}};

window.hzmr.push("productBadge:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End productBadge.js  **************/
/************* Start extracting text for newPostSignup.js for locale it-IT **************/
(function(){var _hzxt={"I offer home improvement services or sell home products.":"Offro servizi legati alla casa o vendo prodotti di arredamento","Professional":"Professionista","I am a homeowner or interested in home design.":"Sono interessato a nuove idee per la mia casa","Homeowner":"Utente","Which describes you best?":"Seleziona una categoria"};for(var a in _hzxt){window._hzlang[a]=_hzxt[a];}})();
/*************  End extracting text for newPostSignup.js  **************/
/************* Start newPostSignup.js for locale it-IT **************/
try {HZ.ns("HZ.signup"),HZ.signup.newPostSignup=new function(){this.init=function(a,b){var c=$("<div/>",{id:"signup-success",class:"dialog",scopeId:"signup-success"}),d="<div id='header'><h1 class='header-2'>"+_hgt("Which describes you best?")+"</h1></div><div id='body'><div class='row'><div id='homeowner' class='col-sm-6' compId='homeowner'><div class='wrapper'><div class='icon'></div><div class='title header-5'>"+_hgt("Homeowner")+"</div><div class='description'>"+_hgt("I am a homeowner or interested in home design.")+"</div></div></div><div id='pro' class='col-sm-6' compId='pro'><div class='wrapper'><div class='icon'></div><div class='title header-5'>"+_hgt("Professional")+"</div><div class='description'>"+_hgt("I offer home improvement services or sell home products.")+"</div></div></div></div></div>";return c.html(d),c.find("#homeowner").on("click",function(){a()}),c.find("#pro").on("click",function(){b()}),c}};

window.hzmr.push("newPostSignup:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End newPostSignup.js  **************/
/************* Start extracting text for hoverCard.js for locale it-IT **************/
(function(){var _hzxt={"Comment{context_comment_as_a_noun}":"Commento{context_comment_as_a_noun}","Follower":"Follower","Followers":"Follower","Review":"Recensione","Follow":"Segui","Following":"Segui gi\u00e0","Reviews":"Recensioni","Projects":"Progetti","Comments":"Commenti","Ideabook":"Ideabook","Project":"Progetto","Comment":"Commento","Ideabooks":"Ideabook"};for(var a in _hzxt){window._hzlang[a]=_hzxt[a];}})();
/*************  End extracting text for hoverCard.js  **************/
/************* Start hoverCard.js for locale it-IT **************/
try {HZ.ns("HZ.utils"),HZ.utils.HoverCard=new function(){function a(a){return HZ.utils.Html.escapeHtmlEntities(a).replace(/'/g,"&apos;")}var b,c,d={},e={useWiderFollowCell:0,cardContentWidth:414,statCardWidth:86,reviewCardWidth:86,ajazTimeout:300,dropDownTimeout:500},f=function(a,b,c){var e,f={},g=$(this);c&&"true"==c.success&&(e=c.userDetail,f[a]={},f[a][b]=e,d=$.extend(!0,d,f),i(e,g,a,b))},g=function(d,e,f,g){var h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A="",B="profLink",C="",D="",E="",F="",G="",H="",I="",J="",K="",L="",M="",N="",O=!0,P=!0,Q="",R="",S="",T="";if(h=d.isPro,i=d.uname,j=d.name,k=d.pic,l=d.link,m=d.loc,n=d.allowFollow,o=d.isFollower,p=d.galCount,q=d.projCount,r=d.cmtCount,t=d.reviewRating,u=d.numReview,v=d.reviewLink,z=d.proType,w=d.galLink,x=d.prjLink,O=d.publicGallery,P=d.publicProject,c=b.cardContentWidth,g.pTrk&&g.pTrkParam&&(l="#",A="rel='nofollow'",C=g.pTrk,B=g.pTrkParam),g.gTrk&&g.gTrkParam&&(w="#",Q="onmousedown='"+g.gTrk+"' id='"+g.gTrkParam+"'"),g.prjTrk&&g.prjTrkParam&&(x="#",R="onmousedown='"+g.prjTrk+"' id='"+g.prjTrkParam+"'"),1==n){if(b.useWiderFollowCell&&(c+=30,T="wider-card"),1==o)var U="hzBtn followBtn--hoverCard following",V=_hgt("Following");else if(0==o)var U="hzBtn followBtn--hoverCard",V=_hgt("Follow");if(HZ.data.CurrentSessionUser)var W='HZ.actions.Follow.updateFollow(this,{u: "'+i+'"}); HZ.utils.HoverCard.toggleFollowStatus("'+e+'", "'+f+'"); return false;';else if(HZ.auth)var W="HZ.auth.Manager.signup(10, null, window.location.href); return false;";else var W='window.location.href="'+b.followRedirectLink+'"; return false;';E="<input id='followButton_"+i+"' type='button' class='"+U+"' value='"+a(V)+"' onclick='"+W+"'/>",F="<div class='hzFollowBtnWrapper'>"+E+"</div>",s=d.followersCount,y=d.followersLink,s>0&&(G="<div class='statCard'><a target='_blank' href='"+y+"'><div class='counter'>"+s+"</div><div class='itemName'>"+_hgtp("Followers","Follower","Followers",s)+"</div></a></div>")}""==G&&(c-=b.statCardWidth),F="<div class='statCard followStatCard "+T+"'>"+F+"</div>",K="<div class='statCard'></div>",O&&(H="<div class='statCard'><a target='_blank' href='"+w+"' "+Q+"><div class='counter'>"+p+"</div><div class='itemName'>"+_hgtp("Ideabooks","Ideabook","Ideabooks",p)+"</div></a></div>"),q>0&&P?I="<div class='statCard'><a target='_blank' href='"+x+"' "+R+"><div class='counter'>"+q+"</div><div class='itemName'>"+_hgtp("Projects","Project","Projects",q)+"</div></a></div>":c-=b.statCardWidth,J="<div class='statCard'><div class='counter'>"+r+"</div><div class='itemName'>"+_hgtp("Comments","Comment{context_comment_as_a_noun}","Comments",r,{context_comment_as_a_noun:""})+"</div></div>",1==h?(z&&"Not specified"!=z&&(D=z),m&&(D.length>0&&(D+=" | "),D+=m),D&&(D="<div class='hzHoverCardLoc'>"+a(D)+"</div>"),M="<div class='counter'>"+u+"</div><div class='itemName'>"+_hgtp("Reviews","Review","Reviews",u)+"</div>",g.rTrk&&g.rTrkParam&&(v="#",S="onmousedown='"+g.rTrk+"' id='"+g.rTrkParam+"'"),M="<div class='statCard reviewCard'><a target='_blank' href='"+v+"' "+S+">"+M+"</a></div>",u>0&&(L="<div class='classification counter'><div class='cover'></div><div class='progress' style='width: "+2*t+"%'></div></div>"),N=HZ.utils.Html.template("<div class='hzHoverCard hbs'>\n\t\t<div class='hzHoverCardContent'>\n\t\t\t<div class='upper'>\n\t\t\t\t<a target='_blank' href='%PROFILELINK%' %REL% id='%ID%' class='user-thumb-link' onmousedown='%MOUSEDOWN%'><img class='hzHoverCardUserThumb hz-user-image' src='%USERTHUMB%'/></a>\n\t\t\t\t<div class='basic-info'>\n\t\t\t\t\t<div class='hzHoverCardUserName'>\n\t\t\t\t\t\t<a target='_blank' class='nameLink hz-username' href='%PROFILELINK%' %REL% id='%ID%' onmousedown='%MOUSEDOWN%'>%USERNAME%</a>\n\t\t\t\t\t</div>\n\t\t\t\t\t%REVIEW_STARS%\n\t\t\t\t\t%PRODESC%\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t%FOLLOW%\n\t\t\t%FOLLOWERS%\n\t\t\t%PROCARD%\n\t\t\t%IDEABOOK%\n\t\t\t%PROJECT%\n\t\t\t%COMMENT%\n\t\t\t<div class='hzHCClearFix'></div>\n\t\t</div>\n\t\t</div>",{USERNAME:j,PROFILELINK:l,REL:A,MOUSEDOWN:C,ID:B,USERTHUMB:k,PRODESC:D,REVIEW_STARS:L,FOLLOW:F,FOLLOWERS:G,PROJECT:I,COMMENT:J,PROCARD:M})):(m&&(D+=m),D&&(D="<div class='hzHoverCardLoc'>"+D+"</div>"),N=HZ.utils.Html.template("<div class='hzHoverCard hbs'>\n\t\t<div class='hzHoverCardContent'>\n\t\t\t<div class='upper'>\n\t\t\t\t<a target='_blank' href='%PROFILELINK%' %REL% id='%ID%' class='user-thumb-link' onmousedown='%MOUSEDOWN%'><img class='hzHoverCardUserThumb hz-user-image' src='%USERTHUMB%'/></a>\n\t\t\t\t<div class='basic-info'>\n\t\t\t\t\t<div class='hzHoverCardUserName'>\n\t\t\t\t\t\t<a target='_blank' class='nameLink hz-username' href='%PROFILELINK%' %REL% id='%ID%' onmousedown='%MOUSEDOWN%'>%USERNAME%</a>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\t\t\t</div>\n\t\t\t%FOLLOW%\n\t\t\t%FOLLOWERS%\n\t\t\t%IDEABOOK%\n\t\t\t%PROJECT%\n\t\t\t%COMMENT%\n\t\t\t%NO_PUBLIC_GALLERY%\n\t\t\t<div class='hzHCClearFix'></div>\n\t\t</div>\n\t\t</div>",{USERNAME:j,PROFILELINK:l,USERTHUMB:k,USERDESC:D,FOLLOW:F,FOLLOWERS:G,IDEABOOK:H,PROJECT:I,COMMENT:J,NO_PUBLIC_GALLERY:"%NO_PUBLIC_GALLERY%"}),N=HZ.utils.Html.template(N,{NO_PUBLIC_GALLERY:O?"":K}));var X=$(N);return X.find(".statCard").last().addClass("lastCard"),X},h=function(a){return{pTrk:a.attr("ptrk"),pTrkParam:a.attr("ptrk-param"),gTrk:a.attr("gtrk"),gTrkParam:a.attr("gtrk-param"),prjTrk:a.attr("prjtrk"),prjTrkParam:a.attr("prjtrk-param"),rTrk:a.attr("rtrk"),rTrkParam:a.attr("rtrk-param")}},i=function(a,b,d,e){var f,i,j,k,l,m,n=g(a,d,e,h(b)),o=$(".houzz-header"),p=$(".houzz-header-secondary"),q=80;(o.length||p.length)&&(q=o.height()+p.height()),k=b.offset().top-$(document).scrollTop(),j=$(window).height()-k-b.height(),l=b.offset().left-$(document).scrollLeft(),m=$(window).width()-l-b.outerWidth(),f=k>110+q||k>=j?"south":"north",f+=l>m?" right":"",i=$(n),i.css("width",c),i.data("srcElement",b),b.closest("body").length>0&&b.tipBubble({content:i,borderColor:"#CCC",point:f,attachTo:"body",id:"hzHoverCardContainer",showCloseBtn:!1,width:c,fadeDuration:1})},j=function(){$("#hzHoverCardContainer:visible").hide()},k=function(a){var c,e=this,g=$(e);if("mouseenter"==a.type){var h=$("#hzHoverCardContainer").data("dropDownTimer");clearTimeout(h),$("#hzHoverCardContainer").removeData("dropDownTimer"),c=setTimeout(function(){var a=g.attr("data-type"),b=g.attr("data-id");a&&b&&(d&&d[a]&&d[a][b]?i(d[a][b],g,a,b):HZ.ajaz.Services.getHoverCardData(a,b,$.proxy(f,g,a,b))),$("#hzHoverCardContainer").removeData("ajazTimer")},b.ajazTimeout),$("#hzHoverCardContainer").data("ajazTimer",c)}else"mouseleave"==a.type&&(clearTimeout($("#hzHoverCardContainer").data("ajazTimer")),$("#hzHoverCardContainer").data("dropDownTimer",setTimeout(function(){$("#hzHoverCardContainer").removeData("dropDownTimer"),j()},b.dropDownTimeout)))};this.toggleFollowStatus=function(a,b){d&&d[a]&&d[a][b]&&(d[a][b].isFollower=1-d[a][b].isFollower)},this.init=function(a){b=$.extend({},e,a||{}),HZ.data.CurrentSessionUser,$("body").on("mouseenter mouseleave",".hzHouzzer",k),$("body").on("mouseenter","#hzHoverCardContainer",function(){clearTimeout($("#hzHoverCardContainer").data("dropDownTimer"))}).on("mouseleave","#hzHoverCardContainer",function(){$(this).data("dropDownTimer",setTimeout(function(){j()},b.dropDownTimeout))}),$("#lbImage, #lbInfoScroller").on("mousewheel DOMMouseScroll",function(){clearTimeout($("#hzHoverCardContainer").data("ajazTimer")),clearTimeout($("#hzHoverCardContainer").data("dropDownTimer")),j()})}};

window.hzmr.push("hoverCard:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End hoverCard.js  **************/
/************* Start extracting text for followButton.js for locale it-IT **************/
(function(){var _hzxt={"Unfollow":"Non seguire pi\u00f9","To follow other people, you need to allow others to follow you. You can update your privacy settings on Edit Profile page.":"Per seguire altre persone, \u00e8 necessario permettere agli altri di seguirti. Puoi aggiornare le tue impostazioni sulla privacy dalla pagina Modifica profilo.","The user you are trying to follow has disabled this feature.":"L'utente che stai tentando di seguire ha disabilitato questa funzione.","Follow operation failed.":"Impossibile seguire l'operazione.","Follow":"Segui","Following":"Segui gi\u00e0"};for(var a in _hzxt){window._hzlang[a]=_hzxt[a];}})();
/*************  End extracting text for followButton.js  **************/
/************* Start followButton.js for locale it-IT **************/
try {HZ.ns("HZ.actions.Follow"),HZ.actions.Follow=new function(){var a=this,b=function(a,b){var c=a.find("i");if((b=$.trim(b))==_hgt("Follow"))a.removeClass("following unfollow"),c.removeClass("hzi-Following2 hzi-Unfollow").addClass("hzi-Follow");else if(b==_hgt("Unfollow"))a.removeClass("following").addClass("unfollow"),c.removeClass("hzi-Follow hzi-Following2").addClass("hzi-Unfollow");else{if(b!=_hgt("Following"))return;a.removeClass("unfollow").addClass("following"),c.removeClass("hzi-Follow hzi-Unfollow").addClass("hzi-Following2")}a.is("input")?a.attr("value",b):(a.contents().last().replaceWith(b),a.attr("title",b))},c=function(a,c,d){if("true"==a.success)"f"==c?b(d,_hgt("Following")):b(d,_hgt("Follow"));else if(2==a.error)HZ.auth.Manager.signup(10,30);else{var e=_hgt("Follow operation failed.");1==a.error&&(e=_hgt("The user you are trying to follow has disabled this feature.")),4==a.error&&(e=_hgt("To follow other people, you need to allow others to follow you. You can update your privacy settings on Edit Profile page.")),alert(e)}};this.updateFollow=function(a,b){var a=$(a);if(b){var d=a.hasClass("following")||a.hasClass("unfollow")?"u":"f";if(b.u)var e=b.u}d&&e&&HZ.ajaz.Services.updateFollow(d,e,function(b){c(b,d,a)})},this.updateFollowBtn=function(a,c){(a.hasClass("following")||a.hasClass("unfollow"))&&(c?b(a,_hgt("Unfollow")):b(a,_hgt("Following")))},this.handleSignup=function(a){HZ.ajaz.Services.setVisitorProperty("postSignupFollowedUsername",a.followedUsername,function(){HZ.auth.Manager.signup(10,a.messageId,window.location.href,null,{sourceUser:a.followedUsername})})},$("body").on("mouseenter",".followBtn",function(){a.updateFollowBtn($(this),!0)}).on("mouseleave",".followBtn",function(){a.updateFollowBtn($(this),!1)})};

window.hzmr.push("followButton:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End followButton.js  **************/
/************* Start fontSmoothing.js for locale it-IT **************/
try {var TypeHelpers=new function(){var a=this;a.hasSmoothing=function(){if(void 0!==screen.fontSmoothingEnabled)return screen.fontSmoothingEnabled;try{var a=document.createElement("canvas");a.width="35",a.height="35",a.style.display="none",document.body.appendChild(a);var b=a.getContext("2d");b.textBaseline="top",b.font="32px Arial",b.fillStyle="black",b.strokeStyle="black",b.fillText("O",0,0);for(var c=8;c<=32;c++)for(var d=1;d<=32;d++){var e=b.getImageData(d,c,1,1).data,f=e[3];if(255!=f&&0!=f)return!0}return!1}catch(a){return null}},a.insertClasses=function(){var b=a.hasSmoothing(),c=document.getElementsByTagName("html")[0];c.className+=1==b?" hasFontSmoothing-true":0==b?" hasFontSmoothing-false":" hasFontSmoothing-unknown"}};

window.hzmr.push("fontSmoothing:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End fontSmoothing.js  **************/
/************* Start bufferedLoader.js for locale it-IT **************/
try {HZ.ns("HZ.BufferedLoader"),HZ.BufferedLoader=function(a,b){var c={bufferedContentSelector:".bufferedContent",numItemsPerPage:10,loadMoreAjaxItems:null,showNewItemsFromBuffer:null,extraBlockAttr:null},d=!1,e=$.extend(c,a),f=[],g=!1,h=!0;this.loadMore=function(a,b){var c=j();b&&(c.empty(),h=!0),a&&f.push(a),c.children().length<e.numItemsPerPage&&h?(g=!0,i()):k()};var i=function(){return!d&&(d=!0,e.loadMoreAjaxItems(function(a){d=!1;var b=j();null==a||0==a.length?h=!1:b.append(a),g&&(g=!1,k())}),!0)},j=function(){var a=$(b).find(e.bufferedContentSelector).first();return 0==a.length&&(a=$("<div class='"+e.bufferedContentSelector.substr(1)+"'></div>"),$(b).append(a)),a},k=function(){var a=j(),b=a.children(),c=Math.min(e.numItemsPerPage,b.length),d=b.slice(0,c),g=null;d.length>0&&(g=$("<div "+(e.extraBlockAttr?e.extraBlockAttr:"")+"></div>").append(d).css("display","none")),e.showNewItemsFromBuffer(g),b.length-c<e.numItemsPerPage&&h&&i(),f.length>0&&($.each(f,function(){this.call(this)}),f=[])}},function(a){a.fn.bufferedLoader=function(b){return this.each(function(){null==a(this).data("bufferedLoader")&&a(this).data("bufferedLoader",new HZ.BufferedLoader(b,this))})}}(jQuery);

window.hzmr.push("bufferedLoader:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End bufferedLoader.js  **************/
/************* Start extracting text for unifiedStories.js for locale it-IT **************/
(function(){var _hzxt={"Discover more topics":"Trova nuove ispirazioni"};for(var a in _hzxt){window._hzlang[a]=_hzxt[a];}})();
/*************  End extracting text for unifiedStories.js  **************/
/************* Start unifiedStories.js for locale it-IT **************/
try {HZ.UnifiedStories=new function(){var a=null,b={mosaicSelector:".mosaicImages",fromTimestamp:null,moreSelector:".moreStories",numItemsPerPage:15,todayTabId:"today-tab",galleriesTabId:"galleries-tab",adviceTabId:"advice-tab",tabContainerSelector:"#unified-tab-container",tabContentSelector:"#unified-tab-content",pagesToAutoLoad:2,discoverUrl:null,openInNewTab:!0,minUpdateIntervalSec:30},c=null,d=null,e=!1,f=-1,g=0,h=0,i=!1,j=0,k=null,l=!1,m=0,n=null,o=!1,p=!0,q=function(a){var b,c=$(".hp-side-components").children(),d=a.children();if(c.length&&d.length){null==k&&(k=$(".preloaded-feed").children().not(".hp-side-component, .hp-side-components").length);for(var e=0;e<d.length;e++)b=c.filter("[data-idx='"+k+"']"),k+=1,b.length&&(d.eq(e).after(b.clone()),b.remove())}},r=function(a){a.success&&"true"===a.success&&"true"==a.hasNewItems&&(o=!0)},s=null,t=null,u=function(a){t||(s=null,t=!0,HZ.ajaz.Services.UnifiedStories.hasNewItems(null,function(){t=!1,a.apply(this,arguments)}))},v=function(b){null==b&&(b=a.minUpdateIntervalSec),null!=b&&(o||(null!=s&&clearTimeout(s),s=setTimeout(function(){u(r)},1e3*b)))},w=function(a){var b=a.find(".ppb__dropdown");b.customDropdown(),a.find(".feed-description").attr("objid",a.find(".ppb__dropdown-cta").attr("objid")),b.off("change.hpProBlock").on("change.hpProBlock",function(b){var c=$(b.currentTarget),d=c.find("option:selected"),e=c.val(),f=d.attr("clurl"),g=d.attr("topicid");a.find(".ppb__dropdown-cta").attr("href",e).attr("objid",g),f&&a.find(".ppb__loc-change").attr("href",f).attr("objid",g)})},x=function(a){a&&0!==a.length&&HZ.modules.HZPhotoCarousel.init({time:1100})},y=function(a){var b=a.find(".ppb__carousel-body"),c={animatingSpeed:350,hasBottomToggleLeftRight:!0},d=null,e=!0;$.extend(c,{autoPlay:!0,autoPlayIntervalTime:4e3}),b.simpleCarousel(c),b.on("mouseenter.hppros",function(){b.simpleCarousel("stopAutoPlay"),d=setTimeout(function(){e=!1},500)}),b.on("mouseleave.hppros",function(){clearTimeout(d),e?b.simpleCarousel("enableAutoPlay"):(b.off("mouseenter.hppros"),b.off("mouseleave.hppros"))})},z=function(a,b){a&&0!==a.length&&(b?y(a):w(a))},A=function(a,b){a&&0!==a.length&&b&&("default"===b?B(a):"single"===b?C(a):"fisheye"===b?D(a):"stack"===b&&B(a))},B=function(a){function b(a){var b=f.get(a),c=d.get(a);b&&c&&(f.removeClass("active"),$(b).addClass("active"),d.removeClass("current"),$(c).addClass("current"),g=a)}if(a&&0!==a.length){var c=a.find(".shop-stories-carousel-wrapper"),d=c.find(".shop-stories-carousel-slide"),e=d.length,f=c.find(".shop-stories-carousel-nav-bullet"),g=0,h=!1;f.on("click",function(a){h=!0;var c=$(this).data("nav-to");b(parseInt(c))}),setInterval(function(){c&&c.length>0&&(h||(g=(g+1)%e,b(g)),h=!1)},5e3)}},C=function(a){function b(a){if(!h){var b=$(d.get(f)),c=f+a,g=b.width();if(a>0){c>=e&&(c=0);var j=$(d.get(c));b.css({left:0}).animate({left:-g},i,function(){$(this).hide(),h=!1}),j.css({left:g}).show().animate({left:0},i,function(){h=!1})}else if(a<0){c<0&&(c=e-1);var j=$(d.get(c));b.css({left:0}).animate({left:g},i,function(){$(this).hide(),h=!1}),j.css({left:-g}).show().animate({left:0},i,function(){h=!1})}f=c,h=!0}}if(a&&0!==a.length){var c=a.find(".shop-stories-carousel-single"),d=c.find(".shop-stories-carousel-single-slide"),e=d.length,f=0,g=!1,h=!1,i=500;setInterval(function(){c&&c.length>0&&(g||b(1),g=!1)},5e3),a.find(".shop-stories-carousel-single-next").on("click",function(){g=!0,b(1)}),a.find(".shop-stories-carousel-single-pre").on("click",function(){g=!0,b(-1)})}},D=function(a){function b(){var a=e.find(".current"),b=a.data("index"),c=$(f.get(E(E(b,k),k))),d=$(f.get(F(F(b,k),k)));c.addClass("next-next next-next-tr"),d.addClass("prev-prev prev-prev-tr")}function c(){var a=e.find(".current"),b=a.data("title"),c=a.data("url");i.attr("href",c).text(b),j.attr("href",c)}function d(a){var d=e.find(".current"),g=d.data("index"),h=$(f.get(E(g,k))),i=$(f.get(F(g,k))),j=$(f.get(E(E(g,k),k))),l=$(f.get(F(F(g,k),k)));h.add(i).add(j).add(l).removeClass("next-next-tr next-next prev-prev prev-prev-tr"),a>0?(d.removeClass("current").addClass("prev"),h.removeClass("next").addClass("current"),i.removeClass("prev"),j.addClass("next")):(d.removeClass("current").addClass("next"),i.removeClass("prev").addClass("current"),h.removeClass("next"),l.addClass("prev")),c(),b()}var e=a.find(".shop-stories-carousel-fisheye");if(e.length){var f=e.find(".shop-stories-carousel-fisheye-slide"),g=e.find(".shop-stories-carousel-fisheye-inner"),h=e.find(".shop-stories-carousel-fisheye-title"),i=e.find(".shop-stories-carousel-fisheye-title-link"),j=e.find(".shop-stories-carousel-fisheye-see-products"),k=f.length,l=null,m=!1;l=setInterval(function(){m?clearInterval(l):d(1)},5e3),a.find(".shop-stories-carousel-single-next").on("click.shopfisheye",function(){m=!0,d(1)}),a.find(".shop-stories-carousel-single-pre").on("click.shopfisheye",function(){m=!0,d(-1)}),g.on("mouseenter.shopfisheye",".shop-stories-carousel-fisheye-slide",function(a){var b=$(a.currentTarget);b.hasClass("current")&&(h.addClass("shop-stories-carousel-fisheye-title--hover"),b.one("mouseleave.shopfisheye",function(){h.removeClass("shop-stories-carousel-fisheye-title--hover")}))}),b()}},E=function(a,b){return(a+1)%b},F=function(a,b){return 0===a?b-1:a-1},G=function(){return $("#unified-tab-content").offset().top-$("#navContainer").outerHeight(!0)-65};this.init=function(d){a=$.extend(b,d),c=$(a.moreSelector).first(),i=!!a.isSignedIn;var h=$(a.tabContentSelector);$(a.mosaicSelector).mosaic(),$(a.tabContainerSelector).on("click","a",S),a.openInNewTab&&h.on("click","a",R),v();var k=$("#homepage-refresh");k.on("click",function(){k.hide(),o=!1,HZ.UnifiedStories.reload()});var m=$(".feedItem.promoted-pro-block");z(m,a.isProIconsEnabled);var n=$(".feedItem.prowizard-feed-block");x(n);var r=$(".feedItem.shop-stories-feed-block");A(r,a.shopStoryType),$("#homepage-feed-title").on("click",function(){k.hide(),o=!1,HZ.UnifiedStories.reload()}),$(window).on("scroll",$.throttle(250,O)),h.bufferedLoader({extraBlockAttr:null,numItemsPerPage:a.numItemsPerPage,loadMoreAjaxItems:function(b){if(!e){var c=function(c){var d=null;if(c.success&&"true"===c.success){var f=c.html;a.fromTimestamp=c.fromTimestamp;d=$("<div class='feedItemGroup'></div>").append(f).children();var g=$("#unified-tab-content[lb-context]").attr("lb-context");if(null!==g){var h=HZ.data.Contexts.get(g);if(null!==h){var i=[],j={};d.find("[lb-sid]").each(function(){var a=$(this).attr("lb-sid");h.containsSpaceId(a)||j[a]||(i.push(a),j[a]=!0)});var k=c.coreData;k.context={spaceIds:i,nextpos:JSON.stringify(c.fromTimestamp)};var l={results:k};h.handleData(l)}}}else c.error;e=!1,b(d)};e=!0,HZ.ajaz.Services.UnifiedStories.getUnifiedStories(a.fromTimestamp,f,c,null,j++)}},showNewItemsFromBuffer:function(b){if(null===b||0==b.length)K();else{l&&I(),q(b),b.find(a.mosaicSelector).mosaic();var d=function(a,b){var c=$(a).find("img");if(0==c.length)b.call(a);else{var d=c.length,e=0;c.each(function(){var c=$(this),f=c.attr("src");c.attr("src","").one("load",function(){++e==d&&b.call(a)}).attr("src",f)})}},e=b.find(".feedItem");J(e),b.find(".feedItem").addClass("feedItemLoading"),b.show(),c.before(b),c.detach().insertAfter(b),Q().hide();var f=b.find(".feedItem.shop-stories-feed-block");A(f,a.shopStoryType);var g=b.find(".feedItem.promoted-pro-block");z(g,a.isProIconsEnabled);var h=$(".feedItem.prowizard-feed-block");x(h),b.find(".feedItemLoading").each(function(){d(this,function(){$(this).removeClass("feedItemLoading")})});setTimeout(function(){var a=b.find(".feedItemLoading");a.length>0&&a.removeClass("feedItemLoading")},1500);HZ.events.publish("unifiedStories:newItems")}}}),c.click(function(){g=0,P()});var s=h.find(".feedItem"),t=s.filter(function(){return $(this).hasClass("placeholder")});(0==s.length||t.length>0)&&P(),J($(".feedItem").not(".placeholder")),p=!0};var H=function(){if(l=!0,HZ.lb&&HZ.lb.Context){var a=$("#unified-tab-content[lb-context]").attr("lb-context");if(null!==a){var b=new HZ.lb.Context(a,20,[],[],0,0,null,0);HZ.data.Contexts.put(a,b)}}c.show(),null!=d&&d.hide(),p=!0},I=function(){l=!1,$("body,html").stop(!0,!0);var b=G();window.scrollY>b&&window.scrollTo(0,b);Q();$(a.tabContentSelector).children().not(".feedStoryPlaceholders, .bufferedContent, .discoverMoreTopics, "+a.moreSelector).remove(),g=0,h=0,j=0};this.equalizeHeights=function(a){$.each(a,function(a,b){for(var c=$(b).find(".feedItem.square"),d=0;a++<=c.size()/3;)c.slice(d,d+3).equalizeHeights(),d+=3})};var J=function(a){if(a.length>0)for(var b=0;b<a.length;b++){var c=$(a[b]);void 0===c.attr("posid")&&c.attr("posid",h++)}},K=function(){if(a.discoverUrl){var b=_hgt("Discover more topics");null==d&&(d=i?$('<div class="discoverMoreTopics" compid="discover_more_topics" posid="bottom"><a class="loadMoreBtn open-topics-diag trackMe" onclick=\'HZ.modules.UserFollowTopics.main.showTopicsDialog();\' href="'+a.discoverUrl+'">'+b+"</a></div>"):$('<div class="discoverMoreTopics" compid="discover_more_topics" posid="bottom"><a class="loadMoreBtn open-topics-diag trackMe" onclick=\'HZ.auth.Manager.signup();\' href=\'javascript:void(0);\'>'+b+"</a></div>"),d.insertAfter(c)),c.hide(),d.show(),v(0)}else c.hide();p=!1},L=!1,M=null,N=!1,O=function(){if(p&&g<a.pagesToAutoLoad){var b=$(window).height();c&&c.offset()&&c.offset().top-b<$(window).scrollTop()+b&&P()&&g++}var d=$("#homepage-refresh");d.length&&(n=window.scrollY,window.scrollY+60>$("#unified-stories").offset().top?d.addClass("floating"):d.hasClass("floating")&&d.removeClass("floating"),n<m?(N=!1,!d.is(":visible")&&o?L||(L=!0,window.setTimeout(function(){d.stop().fadeIn(400,function(){L=!1})},499)):d.is(":visible")&&(M&&window.clearTimeout(M),M=window.setTimeout(function(){N=!0},888))):d.is(":visible")&&!L&&N&&d.hide(),m=n)},P=function(b){return $(window).trigger("resize"),!(!c.is(":visible")||c.hasClass("loading"))&&(c.addClass("loading"),$(a.tabContentSelector).data("bufferedLoader").loadMore(function(){c.removeClass("loading")},b),!0)},Q=function(){var b=$(".feedStoryPlaceholders");return 0==b.length&&(b=$(".feedItem.placeholder").first().parentsUntil(a.tabContentSelector).last().addClass("feedStoryPlaceholders"),void 0!==HZ.modules.QuickLinks&&HZ.modules.QuickLinks.injectProCarousel()),b},R=function(a){var b=$(this),c=b.attr("href");"string"==typeof b.attr("lb-view")||"_blank"==b.attr("target")||!c||0!=c.indexOf("http")&&0!=c.indexOf("/")||b.hasClass("loadMoreBtn")||b.attr("target","_blank")},S=function(b){var d=$(a.tabContentSelector),g=$(b.currentTarget);if(!g.hasClass("selected")&&!e){switch(e=!0,g.attr("id")){case a.todayTabId:f=-1,$(".postToFollowers").show();break;case a.galleriesTabId:f=1,$(".postToFollowers").hide();break;case a.adviceTabId:f=2,$(".postToFollowers").hide()}g.siblings().removeClass("selected"),g.addClass("selected"),d.css("opacity",.4),a.fromTimestamp=null,HZ.ajaz.Services.UnifiedStories.getUnifiedStories(a.fromTimestamp,f,function(a){c.siblings().remove(),d.css("opacity",""),T(a)})}},T=function(b){if(b.success&&"true"===b.success){var d=b.html;a.fromTimestamp=b.fromTimestamp;var f=$("<div class='feedItemGroup'></div>").append(d);f.find(".feedContainer").children().length,f.find(a.mosaicSelector).mosaic(),f.hide(),c.before(f),f.fadeIn(400,function(){void 0!==HZ.feedComments&&void 0!==HZ.feedComments.Peekable&&void 0!==HZ.feedComments.Peekable.peekableHandler&&f.find(".commentBodyContent.comment-peekable").each(HZ.feedComments.Peekable.peekableHandler),f.find("textarea.commentBody").initPlaceHolders()})}else b.error;e=!1};this.getConfig=function(){return a},this.reloadAfterClosingTopicsDialog=function(){$("#homepage-refresh").hide(),o=!1,this.reload()},this.reload=function(b,c){var d=G();window.scrollY>d&&$("body,html").animate({scrollTop:d},500,"swing"),a.fromTimestamp={},c&&(a.fromTimestamp.p=-2),H(),P(!0),v()}};

window.hzmr.push("unifiedStories:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End unifiedStories.js  **************/
/************* Start coreDataAjaxHandler.js for locale it-IT **************/
try {HZ.ns("HZ.activityFeed"),HZ.activityFeed.NewDataHandler=function(a){return function(b,c,d){if(b.coreData){var e=b.coreData,f={images:HZ.data.Images,spaces:HZ.data.Spaces,users:HZ.data.Users};for(var g in f)e[g]&&f[g].addAll(e[g])}a&&a(b,c,d)}};

window.hzmr.push("coreDataAjaxHandler:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End coreDataAjaxHandler.js  **************/
/************* Start jquery-ui-1.10.3.custom.widget-only.js for locale it-IT **************/
try {!function(a,b){var c=0,d=Array.prototype.slice,e=a.cleanData;a.cleanData=function(b){for(var c,d=0;null!=(c=b[d]);d++)try{a(c).triggerHandler("remove")}catch(a){}e(b)},a.widget=function(c,d,e){var f,g,h,i,j={},k=c.split(".")[0];c=c.split(".")[1],f=k+"-"+c,e||(e=d,d=a.Widget),a.expr[":"][f.toLowerCase()]=function(b){return!!a.data(b,f)},a[k]=a[k]||{},g=a[k][c],h=a[k][c]=function(a,c){return this._createWidget?(arguments.length&&this._createWidget(a,c),b):new h(a,c)},a.extend(h,g,{version:e.version,_proto:a.extend({},e),_childConstructors:[]}),i=new d,i.options=a.widget.extend({},i.options),a.each(e,function(c,e){return a.isFunction(e)?(j[c]=function(){var a=function(){return d.prototype[c].apply(this,arguments)},b=function(a){return d.prototype[c].apply(this,a)};return function(){var c,d=this._super,f=this._superApply;return this._super=a,this._superApply=b,c=e.apply(this,arguments),this._super=d,this._superApply=f,c}}(),b):(j[c]=e,b)}),h.prototype=a.widget.extend(i,{widgetEventPrefix:g?i.widgetEventPrefix:c},j,{constructor:h,namespace:k,widgetName:c,widgetFullName:f}),g?(a.each(g._childConstructors,function(b,c){var d=c.prototype;a.widget(d.namespace+"."+d.widgetName,h,c._proto)}),delete g._childConstructors):d._childConstructors.push(h),a.widget.bridge(c,h)},a.widget.extend=function(c){for(var e,f,g=d.call(arguments,1),h=0,i=g.length;i>h;h++)for(e in g[h])f=g[h][e],g[h].hasOwnProperty(e)&&f!==b&&(c[e]=a.isPlainObject(f)?a.isPlainObject(c[e])?a.widget.extend({},c[e],f):a.widget.extend({},f):f);return c},a.widget.bridge=function(c,e){var f=e.prototype.widgetFullName||c;a.fn[c]=function(g){var h="string"==typeof g,i=d.call(arguments,1),j=this;return g=!h&&i.length?a.widget.extend.apply(null,[g].concat(i)):g,h?this.each(function(){var d,e=a.data(this,f);return e?a.isFunction(e[g])&&"_"!==g.charAt(0)?(d=e[g].apply(e,i),d!==e&&d!==b?(j=d&&d.jquery?j.pushStack(d.get()):d,!1):b):a.error("no such method '"+g+"' for "+c+" widget instance"):a.error("cannot call methods on "+c+" prior to initialization; attempted to call method '"+g+"'")}):this.each(function(){var b=a.data(this,f);b?b.option(g||{})._init():a.data(this,f,new e(g,this))}),j}},a.Widget=function(){},a.Widget._childConstructors=[],a.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(b,d){d=a(d||this.defaultElement||this)[0],this.element=a(d),this.uuid=c++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=a.widget.extend({},this.options,this._getCreateOptions(),b),this.bindings=a(),this.hoverable=a(),this.focusable=a(),d!==this&&(a.data(d,this.widgetFullName,this),this._on(!0,this.element,{remove:function(a){a.target===d&&this.destroy()}}),this.document=a(d.style?d.ownerDocument:d.document||d),this.window=a(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:a.noop,_getCreateEventData:a.noop,_create:a.noop,_init:a.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(a.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:a.noop,widget:function(){return this.element},option:function(c,d){var e,f,g,h=c;if(0===arguments.length)return a.widget.extend({},this.options);if("string"==typeof c)if(h={},e=c.split("."),c=e.shift(),e.length){for(f=h[c]=a.widget.extend({},this.options[c]),g=0;e.length-1>g;g++)f[e[g]]=f[e[g]]||{},f=f[e[g]];if(c=e.pop(),d===b)return f[c]===b?null:f[c];f[c]=d}else{if(d===b)return this.options[c]===b?null:this.options[c];h[c]=d}return this._setOptions(h),this},_setOptions:function(a){var b;for(b in a)this._setOption(b,a[b]);return this},_setOption:function(a,b){return this.options[a]=b,"disabled"===a&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!b).attr("aria-disabled",b),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(c,d,e){var f,g=this;"boolean"!=typeof c&&(e=d,d=c,c=!1),e?(d=f=a(d),this.bindings=this.bindings.add(d)):(e=d,d=this.element,f=this.widget()),a.each(e,function(e,h){function i(){return c||!0!==g.options.disabled&&!a(this).hasClass("ui-state-disabled")?("string"==typeof h?g[h]:h).apply(g,arguments):b}"string"!=typeof h&&(i.guid=h.guid=h.guid||i.guid||a.guid++);var j=e.match(/^(\w+)\s*(.*)$/),k=j[1]+g.eventNamespace,l=j[2];l?f.delegate(l,k,i):d.bind(k,i)})},_off:function(a,b){b=(b||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,a.unbind(b).undelegate(b)},_delay:function(a,b){function c(){return("string"==typeof a?d[a]:a).apply(d,arguments)}var d=this;return setTimeout(c,b||0)},_hoverable:function(b){this.hoverable=this.hoverable.add(b),this._on(b,{mouseenter:function(b){a(b.currentTarget).addClass("ui-state-hover")},mouseleave:function(b){a(b.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(b){this.focusable=this.focusable.add(b),this._on(b,{focusin:function(b){a(b.currentTarget).addClass("ui-state-focus")},focusout:function(b){a(b.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(b,c,d){var e,f,g=this.options[b];if(d=d||{},c=a.Event(c),c.type=(b===this.widgetEventPrefix?b:this.widgetEventPrefix+b).toLowerCase(),c.target=this.element[0],f=c.originalEvent)for(e in f)e in c||(c[e]=f[e]);return this.element.trigger(c,d),!(a.isFunction(g)&&!1===g.apply(this.element[0],[c].concat(d))||c.isDefaultPrevented())}},a.each({show:"fadeIn",hide:"fadeOut"},function(b,c){a.Widget.prototype["_"+b]=function(d,e,f){"string"==typeof e&&(e={effect:e});var g,h=e?!0===e||"number"==typeof e?c:e.effect||c:b;e=e||{},"number"==typeof e&&(e={duration:e}),g=!a.isEmptyObject(e),e.complete=f,e.delay&&d.delay(e.delay),g&&a.effects&&a.effects.effect[h]?d[b](e):h!==b&&d[h]?d[h](e.duration,e.easing,f):d.queue(function(c){a(this)[b](),f&&f.call(d[0]),c()})}})}(jQuery);

window.hzmr.push("jquery-ui-1.10.3.custom.widget-only:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End jquery-ui-1.10.3.custom.widget-only.js  **************/
/************* Start mosaic.js for locale it-IT **************/
try {HZ.ns("HZ.mosaic"),HZ.mosaic=new function(){var a={1:{x:509,y:320},2:{x:249,y:320},3:{x:249,y:155}},b={1:{x:643,y:400},2:{x:316,y:400},3:{x:316,y:195}},c={1:[1],2:[2,2],3:[2,3,3]},d=function(b,d,e,f,g){var h=Math.max(1,Math.min(b.length,3)),i=c[h],j=$.proxy(d?HZ.utils.Links.getSpaceImageUrl:HZ.utils.Links.getImageUrl,HZ.utils.Links),k=d?$.proxy(HZ.utils.Links.getSpaceLink,HZ.utils.Links):function(){return"javascript:;"};return HZ.utils.Html.template("<div class='spaceBoxes %EMPTY_CLASS%'>                                    %CONTENT_HTML%                                </div>",{EMPTY_CLASS:1!=h||b[0]?"":"empty",CONTENT_HTML:function(){for(var c,d,f,g,l=Math.min(3,h),m="",n=0;n<l;n++)if(c=b[n],f=a[i[n]].x,g=a[i[n]].y,d="spaceBox"+i[n],c){if(1===h){var o=HZ.data.Spaces.get(c);if(null!=o){var p=HZ.data.Users.get(o.ow);if(null!=p){var q=p.n,r=p.d,s=HZ.utils.Links.getUserLink(q);m+=HZ.utils.Html.template("<div class='mosaic-photo-credit text-xxs'>                                    <a class='hz-credit' href='%CREDIT_LINK%'>%USER_NAME%<span class='hzi-font hzi-Info'></span></a>                                </div>",{CREDIT_LINK:s,USER_NAME:r})}}}m+=e?HZ.utils.Html.template("<a href='%IMAGE_LINK%' oncontextmenu='return false;' class='img-responsive-wrapper spaceBox %SPACE_BOX_CLASS%'>                                            <img src='%IMAGE_SRC%' class='img-responsive'>                                        </a>",{IMAGE_SRC:j(c,f,g,!1),SPACE_BOX_CLASS:d,IMAGE_LINK:k(c)}):HZ.utils.Html.template("<div oncontextmenu='return false;' class='img-responsive-wrapper spaceBox %SPACE_BOX_CLASS%'>                                        <img src='%IMAGE_SRC%' class='img-responsive'>                                    </div>",{IMAGE_SRC:j(c,f,g,!1),SPACE_BOX_CLASS:d})}else m+=HZ.utils.Html.template("<div class='filler img-responsive-wrapper spaceBox %SPACE_BOX_CLASS%'>                                            <img src='%IMAGE_SRC' class='img-responsive grayFiller'>                                        </div>",{IMAGE_SRC:HZ.utils.Config.emptyGifData,SPACE_BOX_CLASS:d});return m}()})},e=function(d,e,f,g,h,i,j){var k,l="",m=Math.max(1,Math.min(d.length,3)),n=i?"reloadMe":"",o=i?"reloadable":"",p=246,q=$.proxy(e?HZ.utils.Links.getSpaceImageUrl:HZ.utils.Links.getImageUrl,HZ.utils.Links),r=e?$.proxy(HZ.utils.Links.getSpaceLink,HZ.utils.Links):function(){return"javascript:;"};k=c[m],g&&(l+="<a href='"+g+"'>"),1!==m||d[0]?l+="<div class='spaceBoxes'>":l+="<div class='spaceBoxes empty'>";var s,t,u=window.innerWidth,v=Math.min(3,m);for(t=0;t<v;t++){s=d[t];var w=!1,x=k[t],y="spaceBox spaceBox"+x,p=a[x].x,z=a[x].y,A=b[x].x,B=b[x].y,C="";if(s){s.i&&(w=2===s.w,s=s.i);var D="",E="oncontextmenu='return false;' data-pin-no-hover='true' compid='img"+(t+1)+"-"+v+"'";if(HZ.lb&&HZ.lb.Lightbox&&(E+=" lb-mag lb-view",e&&(D="lb-sid='"+s+"'")),1===m){var F=HZ.data.Spaces.get(s);if(null!=F){var G=HZ.data.Users.get(F.ow);if(null!=G){var H=G.n,I=G.d;l+="<div class='mosaic-photo-credit text-xs'><a class='hz-credit' href='"+HZ.utils.Links.getUserLink(H)+"'>"+I+"<span class='hzi-font hzi-Info'></span></a></div>"}}}u>=1280&&i?(C=q(s,A,B,w),l+=f?"<a "+E+" href='"+r(s)+"' class='"+n+" "+y+"' data-stnd='"+p+","+z+"' data-full='"+A+","+B+"'><img "+D+" src='"+C+"' class='"+o+"' width='"+A+"' height='"+B+"'/></a>":"<div "+E+" class='"+n+" "+y+"' data-stnd='"+p+","+z+"' data-full='"+A+","+B+"'><img "+D+" src='"+C+"' class='"+o+"' width='"+A+"' height='"+B+"'/></div>"):(C=q(s,p,z,w),l+=f?"<a "+E+" href='"+r(s)+"' class='"+n+" "+y+"' data-stnd='"+p+","+z+"' data-full='"+A+","+B+"'><img "+D+" src='"+C+"' class='"+o+"' width='"+p+"' height='"+z+"'/></a>":"<div "+E+" class='"+n+" "+y+"' data-stnd='"+p+","+z+"' data-full='"+A+","+B+"'><img "+D+" src='"+C+"' class='"+o+"' width='"+p+"' height='"+z+"'/></div>")}else u>1280&&i?(C=q(s,A,B,w),l+="<div class='filler "+n+" "+y+"' data-stnd='"+p+","+z+"' data-full='"+A+","+B+"'><img src='"+HZ.utils.Config.emptyGifData+"' class='grayFiller "+y+" "+o+"' width='"+A+"' height='"+B+"'></div>"):(C=q(s,p,z,w),l+="<div class='filler "+n+" "+y+"' data-stnd='"+p+","+z+"' data-full='"+A+","+B+"'><img src='"+HZ.utils.Config.emptyGifData+"' class='grayFiller "+y+" "+o+"' width='"+p+"' height='"+z+"'></div>")}for(t=m;t<d.length;t++)s=d[t],l+="<div class='hidden' lb-sid='"+s+"'></div>";return l+="</div>",g&&(l+="</a>"),l};this.getMosaicHtmlForSpaceIds=function(a,b,c,f,g){return HZ.utils.Config.isResponsive?d(a,!0,b):e(a,!0,b,c,0,g)},this.getMosaicHtmlForImageIds=function(a,b,c,f,g){return HZ.utils.Config.isResponsive?d(a,!1,b):e(a,!1,b,c,0,g)}},function(a){a.widget("hz.mosaic",{options:{dataName:"hz"},_getAndValidateData:function(a,b,c){var d=a.data(b);if(void 0===d)throw"incompatible element, no data";for(var e in c){var f=c[e];if(f instanceof Array){var g=!1;for(var h in f)if(void 0!==d[f[h]]){g=!0;break}if(!g)throw"incompatible element, required attribute not found"}else if(void 0===d[f])throw"incompatible element, required attribute not found: "+f}return d},_create:function(){var b=this._getAndValidateData(this.element,this.options.dataName,["includeLinks","groupLink","mosaicGroup"]);this.includeLinks=b.includeLinks,this.groupLink=b.groupLink,this.mosaicGroup=b.mosaicGroup;var c="";void 0!==b.spaceIds?(this.spaceIds=b.spaceIds,c=HZ.mosaic.getMosaicHtmlForSpaceIds(this.spaceIds,this.includeLinks,this.groupLink,this.mosaicGroup,!0)):(this.imageIds=b.imageIds,c=HZ.mosaic.getMosaicHtmlForImageIds(this.imageIds,this.includeLinks,this.groupLink,this.mosaicGroup,!0)),this.element.append(a(c))}})}(jQuery);

window.hzmr.push("mosaic:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End mosaic.js  **************/
/************* Start extracting text for flagContent.js for locale it-IT **************/
(function(){var _hzxt={"Miscategorized":"Categoria errata","Why are you reporting this post?":"Perch\u00e9 stai segnalando questo post?","Please select one of the options.":"Seleziona una delle opzioni.","I just don't like it":"Non mi piace","Inappropriate or abusive":"Inappropriato o offensivo","Spam":"Spam","Why are you reporting this comment?":"Perch\u00e9 stai segnalando questo commento?","Report Comment":"Segnala il commento","Report Post":"Segnala post","Cancel":"Annulla","Submit":"Invia"};for(var a in _hzxt){window._hzlang[a]=_hzxt[a];}})();
/*************  End extracting text for flagContent.js  **************/
/************* Start flagContent.js for locale it-IT **************/
try {HZ.ns("HZ.flag"),HZ.flag.flagDialogInstance=null,HZ.flag.FlagDialog=function(){HZ.flag.FlagDialog.superclass.constructor.call(this);var a=this;this.prepare=function(){var c,d,e,f,g,h,i;c=_hgt("Report Comment"),d=_hgt("Why are you reporting this comment?"),h=$('<div id="report-dialog"><form action="javascript:;"><div class="why-report text-bold mbm">'+d+'</div>\n\t\t\t\t\t<ul id="report-type-list" class="list-unstyled">\n\t\t\t\t\t\t<li class="report-type-item radio"><label><input type="radio" name="report-type" class="report-type" value="spam" id="report-spam"/>'+_hgt("Spam")+'</label></li>\n\t\t\t\t\t\t<li class="report-type-item radio"><label><input type="radio" name="report-type" class="report-type" value="abuse" id="report-abuse"/>'+_hgt("Inappropriate or abusive")+'</label></li>\n\t\t\t\t\t\t<li class="report-type-item report-type-item--question-only radio"><label><input type="radio" name="report-type" class="report-type" value="miscategorized" id="report-miscategorized"/>'+_hgt("Miscategorized")+'</label></li>\n\t\t\t\t\t\t<li class="report-type-item radio"><label><input type="radio" name="report-type" class="report-type" value="dislike" id="report-dislike"/>'+_hgt("I just don't like it")+"</label></li>\n\t\t\t\t\t</ul>\n\t\t\t\t\t</form></div>"),e=HZ.ui.InputButtonUtils.createSecondaryInputButton(_hgt("Cancel"),"flagCancelBtn"),f=HZ.ui.InputButtonUtils.createPrimaryInputButton(_hgt("Submit"),"flagConfirmBtn"),g=[HZ.ui.AjaxThrobber.getThrobber(),e,f],i={title:c,body:h,controls:g,onViewLoaded:b},a.init(i),a.hideStatus()};var b=function(){HZ.ui.AjaxThrobber.setInCall(!1),$(".report-type").prop("checked",!1),a.hideStatus()};this.bindButtonHandler=function(b){var c=$("#flagConfirmBtn"),d=$("#flagCancelBtn");c.unbind("click").bind("click",function(c){if(a.hideStatus(),b){HZ.ui.AjaxThrobber.setInCall(!0);var d=$(".report-type:checked").val();void 0===d?(a.showStatus(_hgt("Please select one of the options.")),HZ.ui.AjaxThrobber.setInCall(!1)):b(c,d)}else HZ.ui.yamdi.Common.hideAllDialogs()}),d.unbind("click").one("click",function(a){HZ.ui.yamdi.Common.hideAllDialogs()})}},HZ.extend(HZ.flag.FlagDialog,HZ.ui.yamdi.Dialog),HZ.flag.ShowFlagDialog=function(a){var b=void 0===a||void 0===a.isComment||a.isComment,c=void 0!==a&&void 0!==a.okCallback?a.okCallback:null;null===HZ.flag.flagDialogInstance&&(HZ.flag.flagDialogInstance=new HZ.flag.FlagDialog,HZ.flag.flagDialogInstance.prepare()),b?(HZ.flag.flagDialogInstance.setTitle(_hgt("Report Comment")),HZ.flag.flagDialogInstance.getBody().find(".why-report").text(_hgt("Why are you reporting this comment?")),HZ.flag.flagDialogInstance.getBody().find(".report-type-item--question-only").css("display","none")):(HZ.flag.flagDialogInstance.setTitle(_hgt("Report Post")),HZ.flag.flagDialogInstance.getBody().find(".why-report").text(_hgt("Why are you reporting this post?")),HZ.flag.flagDialogInstance.getBody().find(".report-type-item--question-only").css("display","block")),HZ.ui.Yamdi.show(HZ.flag.flagDialogInstance),HZ.flag.flagDialogInstance.bindButtonHandler(c)};

window.hzmr.push("flagContent:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End flagContent.js  **************/
/************* Start extracting text for feedComments.js for locale it-IT **************/
(function(){var _hzxt={"This pro has a complete profile.":"Questo professionista ha un profilo completo.","Unable to add comment.  Please reload the page and try again.":"Impossibile aggiungere commento. Ricarica la pagina e riprova.","Unable to add comment":"Impossibile aggiungere commento","Please enter your comment.":"Inserisci il tuo commento.","Show comments":"Mostra commenti","Pending":"In attesa","Are you sure you want to delete this comment?":"Sei sicuro di voler eliminare questo commento?","Delete a comment":"Elimina un commento","Hide comments":"Nascondi i commenti","Rejected":"Rifiutato","Edit comment":"Modifica commento","Delete Comment":"Elimina commento","":"","Submit":"Invia"};for(var a in _hzxt){window._hzlang[a]=_hzxt[a];}})();
/*************  End extracting text for feedComments.js  **************/
/************* Start feedComments.js for locale it-IT **************/
try {!function(a){a.widget("hz.feedComments",{objectId:null,objectType:null,commentCount:null,fbShareable:null,clearRecentCommentsOnFirstLoad:!1,isProductQuestion:!1,isGetCommentsCalled:!1,$cachedMoreComments:a(),cachedCommentCount:null,options:{source:null,dataName:"hz",loaderClass:"loader",loaderHideClass:"loaderHide",commentsToggleClass:"commentsToggle",editCommentSelector:".editCommentDiv",commentBodyInput:"textarea.commentBody",slideDuration:400,selectors:{commentable:".feedComments",comment:".comment",moreComments:".moreComments",loadedCount:".moreComments .loadedCount",remainingCount:".moreComments .remainingCount",commentCount:".moreComments .commentCount",addCommentForm:".addComment form",lastCommentInput:".addComment form input[name='lastCommentId']",bodyInput:".addComment form textarea[name='body']",seeMoreComments:"a.seeMoreComments",commentsContainer:".commentsContainer",addComment:".addComment",submitButton:".addComment form .submitAddComment",addCommentExtra:".addComment .addCommentExtra",fileInputs:".fileInputs",editErrorMessage:".editCommentDiv .commentError",errorMessage:".addComment .commentError"}},_findObject:function(a){var b=this.element.find(a);return b.length>0?b:null},_initElements:function(){this.elements=new Object;for(var a in this.options.selectors){var b=this.options.selectors[a];this.elements[a]=this._findObject(b)}},_create:function(){this.objectId=null,this.objectType=null,this.topCommentId=null,this.lastCommentId=0,this.commentCount=null,this.numCommentsLoaded=null,this.executing=!1;var a=this._getAndValidateData(this.element,this.options.dataName,["id","type","cc","crc","ipq"]);this.objectId=a.id,this.objectType=a.type,this.commentCount=a.cc,this.fbShareable=a.fbs,this.clearRecentCommentsOnFirstLoad=a.crc,this.isProductQuestion=a.ipq,this._initElements(),null!=this.elements.bodyInput&&(this.elements.bodyInput.css("resize","none").css("height","1em").autosize(),void 0!==HZ.modules&&void 0!==HZ.modules.SpacePreview&&HZ.modules.SpacePreview.init(this.elements.bodyInput)),this._updateCommentsEvent()},_showLoader:function(b){this.$loadRestoreElement=a(b),this.$loadRestoreElement.addClass(this.options.loaderHideClass).after(a("<div class='"+this.options.loaderClass+"'></div>"))},_hideLoader:function(){this.$loadRestoreElement.siblings("."+this.options.loaderClass).hide().remove(),this.$loadRestoreElement.removeClass(this.options.loaderHideClass)},_initCommentsToggle:function(){this.elements.seeMoreComments.addClass(this.options.commentsToggleClass).text(_hgt("Hide comments"))},_updateCommentsEvent:function(a){if(void 0!==a&&null!=a&&(this.commentCount=a),void 0===this.elements&&this._initElements(),this.elements.comments=this._findObject(this.options.selectors.comment),this.numCommentsLoaded=null!=this.elements.comments?this.elements.comments.length:0,this.numCommentsRemaining=this.commentCount-this.numCommentsLoaded,this.numCommentsLoaded>0){var b=this.elements.comments.first(),c=this._getAndValidateData(b,this.options.dataName,["id"]);this.topCommentId=c.id;var d=this.elements.comments.last();c=this._getAndValidateData(d,this.options.dataName,["id"]),this.lastCommentId=c.id}null!=this.elements.moreComments&&this.numCommentsLoaded>=this.commentCount&&this._initCommentsToggle(),null!=this.elements.loadedCount&&this.elements.loadedCount.html(this.numCommentsLoaded),null!=this.elements.remainingCount&&this.elements.remainingCount.text(this.numCommentsRemaining)},_getAndValidateData:function(a,b,c){var d=a.data(b);if(void 0===d)throw"incompatible element, no data";for(var e in c)if(c.hasOwnProperty(e)){var f=c[e];if(f instanceof Array){var g=!1;for(var h in f)if(void 0!==d[f[h]]){g=!0;break}if(!g)throw"incompatible element, required attribute not found"}else if(void 0===d[f])throw"incompatible element, required attribute not found: "+f}return d},deleteClick:function(b){HZ.ui.yamdi.Common.confirm(_hgt("Delete a comment"),_hgt("Are you sure you want to delete this comment?"),_hgt("Delete Comment"),a.proxy(function(){if(!this.executing){this.executing=!0,this.$commentToDelete=a(b.target).closest(this.options.selectors.comment);var c=this.$commentToDelete.data("hz").id;HZ.ajaz.Services.deleteComment(this.objectType,this.objectId,c,a.proxy(this._deleteAjaxHandler,this))}},this),null,null,function(){a(document).trigger("keyboardHandlerRequired",{source:this,event:b})},function(){a(document).trigger("keyboardHandlerReleased",{source:this,event:b})})},_deleteAjaxHandler:function(b){"true"==b.success&&this.$commentToDelete.slideUp(this.options.slideDuration,a.proxy(function(){var a=b.commentCount;if(this.$commentToDelete.remove(),this._updateCommentsEvent(a),HZ.globalComments){var c=this.$commentToDelete.data("hz"),d={commentId:c.id,translation:null,language:c.lang};HZ.globalComments.removeComments([d])}},this)),HZ.ui.yamdi.Common.hideAllDialogs(),this.executing=!1,this._notifyObservers()},editClick:function(b){var c=a(b.target).closest(this.options.selectors.comment).find(this.options.editCommentSelector).first(),d=c.clone();this.$commentToUpdate=a(b.target).closest(this.options.selectors.comment),HZ.ui.yamdi.Common.confirm(_hgt("Edit comment"),d,_hgt("Submit"),a.proxy(function(){if(!this.executing){this.executing=!0;var b=d.find("form [name='objectType']").val(),c=d.find("form [name='objectId']").val(),e=d.find("form [name='commentId']").val(),f=a.trim(d.find("form [name='body']").val()),g=d.find("form [name='privacy']"),h=a(g).prop("checked")?a(g).val():null,i=d.find("form [name='isHtml']").val();d.find(this.options.commentBodyInput).attr("disabled","true"),HZ.ajaz.Services.updateComment(b,c,e,f,h,this.options.source,i,a.proxy(this._editCommentAjaxHandler,this))}},this),null,null,function(){a(document).trigger("keyboardHandlerRequired",{source:this,event:b})},function(){a(document).trigger("keyboardHandlerReleased",{source:this,event:b})})},flagClick:function(b){var c,d,e=a(b.currentTarget),f=e.closest(this.options.selectors.comment),g=e.closest(this.options.selectors.commentable),d=f.data("hz").id,h=g.data("hz").type;g.data("hz").ipq;c=h===HZ.ajaz.ContentFlag.COMMENTABLE_GALLERY?HZ.ajaz.ContentFlag.COMMENT:HZ.ajaz.ContentFlag.ANSWER;var i=this;if(f.hasClass("flaggedComment"))this._showLoader(e.parents(".flag-message")),HZ.ajaz.ContentFlag.removeFlag(c,d,function(a){if("true"==a.success){var b=function(){f.removeClass("flaggedComment"),i._hideLoader()};if(UIHelper.isIE8||UIHelper.isIE7||UIHelper.isIE6?(f.css({"max-height":"10000px"}),b()):f.animate({"max-height":"10000px"},"slow",b),void 0!==a.as){var c=a.as,d=f.find(".admin-controls"),e=f.find(".hz-spam-control");0===c?(f.removeClass("isolated rejected"),d.removeClass("active"),e.text("")):1===c?(f.removeClass("rejected").addClass("isolated"),d.addClass("active"),e.text("("+_hgt("Pending")+")")):2===c?(f.removeClass("isolated rejected"),d.removeClass("active"),e.text("")):4===c&&(f.addClass("isolated rejected"),d.addClass("active"),e.text("("+_hgt("Rejected")+")"))}}else i._hideLoader()});else{var j=function(a,b){HZ.ajaz.ContentFlag.addFlag(c,d,b,void 0,function(a){if(HZ.ui.AjaxThrobber.setInCall(!1),"true"===a.success){HZ.ui.yamdi.Common.hideAllDialogs();!function(){f.addClass("flaggedComment")}()}else HZ.flag.flagDialogInstance.showStatus(a.error)})};HZ.flag.ShowFlagDialog({okCallback:j,isComment:!0})}},_editCommentAjaxHandler:function(b){if("true"==b.success&&b.comments){var c=a(b.comments);c.hide(),this.$commentToUpdate.replaceWith(c),c.fadeIn()}HZ.ui.yamdi.Common.hideAllDialogs(),this.executing=!1,this._notifyObservers()},_toggleCommentsContainer:function(){this.elements.commentsContainer.is(":visible")?(this.elements.commentsContainer.slideUp(this.options.slideDuration),this.elements.seeMoreComments.text(_hgt("Show comments"))):this._showCommentsContainer(),this._notifyObservers()},_showCommentsContainer:function(){this.elements.commentsContainer.is(":visible")||(this.elements.commentsContainer.slideDown(this.options.slideDuration),this.elements.seeMoreComments.text(_hgt("Hide comments")))},showMoreClick:function(b){if(a(b.target).hasClass(this.options.commentsToggleClass))this._toggleCommentsContainer();else{if(this.executing)return;if(this.executing=!0,this.isGetCommentsCalled)this._showCachedMoreComments();else{this._showLoader(b.currentTarget),this.clearRecentCommentsOnFirstLoad&&this._clearRecentCommentsPreAjax();var c=this.topCommentId,d=[],e=null,f=this.element.closest(".feedItem").length;HZ.globalComments&&(d=HZ.globalComments.getSelectedLanguages(),e=this.numCommentsRemaining),HZ.ajaz.Services.getComments(this.objectType,this.objectId,e,c,null,this.options.source,d,f,a.proxy(this._showMoreAjaxHandler,this))}}},cachedCommentsExist:function(){return this.isGetCommentsCalled},getComments:function(){this.executing||(this.executing=!0,this.isGetCommentsCalled=!0,HZ.ajaz.Services.getComments(this.objectType,this.objectId,this.numCommentsRemaining,this.topCommentId,null,this.options.source,HZ.globalComments?HZ.globalComments.getSelectedLanguages():[],this.element.closest(".feedItem").length,a.proxy(this._onGetComments,this)))},_onGetComments:function(b){if(b.comments){var c=a(a("<div>").html(b.comments).text()).hide().prependTo(this.elements.commentsContainer);if(this.$cachedMoreComments=c,this.cachedCommentCount=b.commentCount,HZ.globalComments){var d=a.map(c,function(b,c){var d=a(b).data("hz");return{commentId:d.id,translation:null,language:d.lang}});HZ.globalComments.setComments(d,!1),HZ.globalComments.toggleTranslateAllButton(),this.elements.seeMoreComments[0].dispatchEvent(new Event("gc-showMoreComments"))}this.executing=!1}else this.executing=!1},_showCachedMoreComments:function(){this._showLoader(this.elements.seeMoreComments),this.clearRecentCommentsOnFirstLoad&&this._clearRecentCommentsPreAjax(),this.$cachedMoreComments.length?(this._updateCommentsEvent(this.cachedCommentCount),this.$cachedMoreComments.slideDown(this.options.slideDuration,a.proxy(function(){void 0!==HZ.feedComments&&void 0!==HZ.feedComments.Peekable&&void 0!==HZ.feedComments.Peekable.peekableHandler&&this.$cachedMoreComments.find(".commentBodyContent.comment-peekable").each(HZ.feedComments.Peekable.peekableHandler),this._hideLoader(),this.executing=!1},this)),HZ.globalComments&&HZ.globalComments.toggleTranslateAllButton()):(this._updateCommentsEvent(0),this._hideLoader(),this.executing=!1),HZ.globalComments&&(HZ.globalComments.enableSelectAllLanguagesView(),this.elements.moreComments.hide()),this.isGetCommentsCalled=!1},_clearRecentCommentsPreAjax:function(){this.topCommentId=4294967295},_clearRecentCommentsPostAjax:function(){this.elements.commentsContainer.empty(),this.clearRecentCommentsOnFirstLoad=!1},_showMoreAjaxHandler:function(b){if(b.comments){this.clearRecentCommentsOnFirstLoad&&this._clearRecentCommentsPostAjax();var c=a(a("<div>").html(b.comments).text());c.hide(),this.elements.commentsContainer.prepend(c);var d=b.commentCount;if(this._updateCommentsEvent(d),c.slideDown(this.options.slideDuration,a.proxy(function(){void 0!==HZ.feedComments&&void 0!==HZ.feedComments.Peekable&&void 0!==HZ.feedComments.Peekable.peekableHandler&&c.find(".commentBodyContent.comment-peekable").each(HZ.feedComments.Peekable.peekableHandler),this._hideLoader(),this.executing=!1},this)),HZ.globalComments){var e=a.map(c,function(b,c){var d=a(b).data("hz");return{commentId:d.id,translation:null,language:d.lang}});HZ.globalComments.setComments(e,!1),HZ.globalComments.toggleTranslateAllButton(),this.elements.seeMoreComments[0].dispatchEvent(new Event("gc-showMoreComments"))}}else this._updateCommentsEvent(0),this._hideLoader(),this.executing=!1;HZ.globalComments&&(HZ.globalComments.enableSelectAllLanguagesView(),this.elements.moreComments.hide())},_addCommentKeypress:function(a){13!=(a.keyCode?a.keyCode:a.which)||a.shiftKey||(a.preventDefault(),this.submitAddComment(a))},validateAddComment:function(){return!this.executing&&(""!=a.trim(this.elements.bodyInput.val())&&(this.executing=!0,this.elements.bodyInput.attr("disabled","true"),!0))},updateLastCommentFormInput:function(){null!=this.lastCommentId&&this.elements.lastCommentInput.val(this.lastCommentId)},submitAddComment:function(b){if(HZ.feedComments.requireLoggedIn(69)&&!this.executing){var c=this.elements.bodyInput.attr("placeholder"),d=a.trim(this.elements.bodyInput.val()),e=parseInt(this.elements.bodyInput.attr("maxlength"),10)||1e4;if(""==d||d===c)return void this.elements.errorMessage.text(_hgt("Please enter your comment.")).slideDown(this.options.slideDuration);var f=d.length;if(f>e){var g=_hgt("Your post is {numOfCharsToDelete} too long, posts can be up to {lengthLimit} characters. Please make it a little shorter and try again.",{lengthLimit:e,numOfCharsToDelete:_hgtp("","1 character","{n} characters",f-e,{n:f-e})});return void this.elements.errorMessage.text(g).slideDown(this.options.slideDuration)}if(this.options.source){var h=this.elements.addCommentForm.find("input[name='source']");if(0==h.length){var h=a("<input type='hidden' name='source' value='"+this.options.source+"'/>");this.elements.addCommentForm.append(h)}}a.proxy(function(){this.executing=!0,this.updateLastCommentFormInput();var b={success:a.proxy(function(b,c,d,e){var f=a.parseJSON(a(b).text());this._addCommentAjaxHandler(f);var g=this.elements.addComment.find("textarea.add-comment-rte");g.data("hz-addCommentRte")&&g.addCommentRte("destroy")},this),error:a.proxy(function(a,b,c){this._addCommentAjaxHandler(c)},this)};if(HZ.globalComments){var c=HZ.globalComments.getSelectedLanguages(),d=this.elements.addCommentForm.find("input[name=preferredLanguages]");-1==a.inArray("other",c)&&c.push("other"),d.length?d.val(c.join(",")):(d=a('<input type="hidden" name="preferredLanguages" value="'+c.join(",")+'">'),this.elements.addCommentForm.append(d));var e=this.elements.addCommentForm.find("input[name=lastCommentId]");if(e.length){for(var f,g=0;g<c.length;g++){var h=c[g],i=HZ.globalComments.getLastCommentIdByLanguage(h);i=parseInt(i)||null,(!f||i>f)&&(f=i)}e.val(f||e.val())}}var j=this.elements.addCommentForm.find("input[name=isReferrerGalleryFeed]");j.length?j.val(1):a('<input type="hidden" name="isReferrerGalleryFeed">').val(1).appendTo(this.elements.addCommentForm),this.elements.addCommentForm.ajaxSubmit(b),this.elements.addCommentForm.find("input, textarea, button, select").attr("readonly","true"),this._showLoader(this.elements.submitButton),this._showCommentsContainer()},this)()}},_addCommentAjaxHandler:function(b){if(b&&"true"==b.success){var c=a(b.comments);c.hide(),this.elements.commentsContainer.append(c),this.elements.addCommentForm.get(0).reset(),this.elements.addCommentExtra.hide(),this.elements.addComment.find(".hzProIndicator").hide(),null!=this.elements.fileInputs&&(this.elements.fileInputs[0].innerHTML=this.elements.fileInputs[0].innerHTML,this.elements.fileInputs.hide().find("input").hide().first().show()),this.elements.addCommentForm.find(".attachment-previews").empty(),void 0!==HZ.modules&&void 0!==HZ.modules.SpacePreview&&HZ.modules.SpacePreview&&HZ.modules.SpacePreview.clearCache&&HZ.modules.SpacePreview.clearCache(this.elements.bodyInput),this.elements.bodyInput.trigger("autosize"),this.elements.bodyInput.trigger("reset"),this.elements.errorMessage.hide();var d=b.commentCount;if(this._updateCommentsEvent(d),c.fadeIn((this.options.slideDuration,a.proxy(function(){void 0!==HZ.feedComments&&void 0!==HZ.feedComments.Peekable&&void 0!==HZ.feedComments.Peekable.peekableHandler&&c.find(".commentBodyContent.comment-peekable").each(HZ.feedComments.Peekable.peekableHandler)},this))),HZ.globalComments){var e=a.map(c,function(b,c){var d=a(b).data("hz");return{commentId:d.id,translation:null,language:d.lang}});HZ.globalComments.setComments(e,!0)}}else HZ.ui.yamdi.Common.alert(_hgt("Unable to add comment"),_hgt("Unable to add comment.  Please reload the page and try again."));this.executing=!1,this.elements.addCommentForm.find("input, textarea, button, select").removeAttr("readonly"),this._hideLoader(),this._notifyObservers()},_notifyObservers:function(){this.options.contentChangedHandler&&this.options.contentChangedHandler()}})}(jQuery),HZ.ns("HZ.feedComments"),HZ.feedComments=new function(){var a={source:null,feedContainer:".feedContainer",feedInfo:".feedInfo",feedActions:".feedActions"},b={feedComments:".feedComments",commentButton:"span.commentButton",addCommentInput:".addComment form textarea[name='body']",addComment:".addComment",fileInputs:".fileInputs",addCommentExtra:".addCommentExtra",submitButton:".submitAddComment",seeMoreComments:".moreComments a",deleteComment:".comment .deleteComment",editComment:".comment .editComment",attachFiles:".addComment .link--addPhoto",attachFilesInput:".addComment .addCommentFileInput",proIndicator:".hzProIndicator.hzProfileCompleted.hzProView",flagComment:".comment .flagComment, .comment .unflag"};this.init=function(d){var e=!1,f=function(){$(".add-comment-rte").each(function(a,b){$(b).data("hz-addCommentRte")&&$(b).addCommentRte("destroy")}),$(".edit-comment-rte").each(function(a,b){$(b).data("hz-editCommentRte")&&$(b).editCommentRte("destroy")})};if(!d.source)throw"source attribute required";config={},$.extend(config,a,d),null==$(config.feedContainer).data("feedCommentsConfig")&&($(config.feedContainer).data("feedCommentsConfig",config),$(b.addCommentInput).initPlaceHolders(),$(config.feedContainer).on("mouseover",b.proIndicator,function(a){$(this).tipBubble({id:"proIndicatorHelp",content:_hgt("This pro has a complete profile."),point:"north",width:"auto",offsetY:4,position:"absolute",attachTo:"body",showCloseBtn:!1})}).on("mouseout",b.proIndicator,function(){$(this).tipBubble("hide")}),$(config.feedContainer).on("click",b.commentButton,function(a){var c=$(this).closest(config.feedInfo),d=c.parents(".feedItem").find(b.feedComments);HZ.feedComments.requireLoggedIn(69)&&0!=c.length&&0!=d.length&&(d.show(),void 0!==HZ.feedComments&&void 0!==HZ.feedComments.Peekable&&void 0!==HZ.feedComments.Peekable.peekableHandler&&d.find(".commentBodyContent.comment-peekable").each(HZ.feedComments.Peekable.peekableHandler),d.find(b.addCommentInput).focus())}),$(config.feedContainer).on("focus",b.addCommentInput,function(a){$(document).trigger("keyboardHandlerRequired",{source:this,event:a});var d=(c(this,config),$(this).parents(b.feedComments).find(b.addCommentExtra));d.is(":visible")||d.show(),$(this).parents(b.addComment).find(".hzProIndicator").show(),f(),$(this).prop("disabled",!0).closest(".addComment").find(".link--addPhoto").hide(),e?$(this).addCommentRte({onFocus:function(){$(document).trigger("keyboardHandlerRequired",{source:this,event:a})},onBlur:function(){HZ.ui.Yamdi.isShowing()||$(document).trigger("keyboardHandlerReleased",{source:this,event:a})}}).prop("disabled",!1):HZ.utils.ResourceLoader.requireCommentRichTextEditorResources($.proxy(function(){$(this).addCommentRte({onFocus:function(){$(document).trigger("keyboardHandlerRequired",{source:this,event:a})},onBlur:function(){HZ.ui.Yamdi.isShowing()||$(document).trigger("keyboardHandlerReleased",{source:this,event:a})}}).prop("disabled",!1),e=!0},this))}),$(config.feedContainer).on("blur",b.addCommentInput,function(a){$(document).trigger("keyboardHandlerReleased",{source:this,event:a})}),$(config.feedContainer).on("click",b.submitButton,function(a){c(this,config).submitAddComment(a)}),$(config.feedContainer).on("click",b.seeMoreComments,function(a){c(this,config).showMoreClick(a)}),$(config.feedContainer).on("click",b.deleteComment,function(a){a.preventDefault(),c(this,config).deleteClick(a)}),$(config.feedContainer).on("click",b.editComment,function(a){f();var b=$(this).closest(".comment").find("textarea.edit-comment-rte");if(b.length)e?b.editCommentRte({onFocus:function(){$(document).trigger("keyboardHandlerRequired",{source:this,event:a})},onBlur:function(){HZ.ui.Yamdi.isShowing()||$(document).trigger("keyboardHandlerReleased",{source:this,event:a})}}):HZ.utils.ResourceLoader.requireCommentRichTextEditorResources(function(){b.editCommentRte({onFocus:function(){$(document).trigger("keyboardHandlerRequired",{source:this,event:a})},onBlur:function(){HZ.ui.Yamdi.isShowing()||$(document).trigger("keyboardHandlerReleased",{source:this,event:a})}}),e=!0});else{c(this,config).editClick(a)}}),$(config.feedContainer).on("click",b.flagComment,function(a){a.preventDefault(),c(this,config).flagClick(a)}),$(config.feedContainer).on("click",b.attachFiles,function(a){if(HZ.feedComments.requireLoggedIn(69)){var c=$(a.currentTarget).parents(b.addComment).find(b.fileInputs);c.is(":visible")||(c.show(),UIHelper.isMSIE||c.find("input.addCommentFileInput").first().click())}}),$(config.feedContainer).on("change",b.attachFilesInput,function(a){$(this).next("input.addCommentFileInput").css("display","block")}))},this.requireLoggedIn=function(a){return null!=HZ.data.CurrentSessionUser||(HZ.auth.Manager.signup(a),!1)},this.getFeedCommentsWidget=function(a){return c(a,config)};var c=function(a,c){var d=null,e=$(a).closest(b.feedComments);return d=e.data("hz-feedComments"),null==d&&(d=e.feedComments({source:c.source}).data("hz-feedComments")),d}};

window.hzmr.push("feedComments:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End feedComments.js  **************/
/************* Start jquery.form.min.js for locale it-IT **************/
try {!function(a){"use strict";function b(b){var c=b.data;b.isDefaultPrevented()||(b.preventDefault(),a(this).ajaxSubmit(c))}function c(b){var c=b.target,d=a(c);if(!d.is("[type=submit],[type=image]")){var e=d.closest("[type=submit]");if(0===e.length)return;c=e[0]}var f=this;if(f.clk=c,"image"==c.type)if(void 0!==b.offsetX)f.clk_x=b.offsetX,f.clk_y=b.offsetY;else if("function"==typeof a.fn.offset){var g=d.offset();f.clk_x=b.pageX-g.left,f.clk_y=b.pageY-g.top}else f.clk_x=b.pageX-c.offsetLeft,f.clk_y=b.pageY-c.offsetTop;setTimeout(function(){f.clk=f.clk_x=f.clk_y=null},100)}function d(){if(a.fn.ajaxSubmit.debug){var b="[jquery.form] "+Array.prototype.join.call(arguments,"");window.console&&window.console.log?window.console.log(b):window.opera&&window.opera.postError&&window.opera.postError(b)}}var e={};e.fileapi=void 0!==a("<input type='file'/>").get(0).files,e.formdata=void 0!==window.FormData,a.fn.ajaxSubmit=function(b){function c(b){var c,d,e=a.param(b).split("&"),f=e.length,g=[];for(c=0;c<f;c++)e[c]=e[c].replace(/\+/g," "),d=e[c].split("="),g.push([decodeURIComponent(d[0]),decodeURIComponent(d[1])]);return g}function f(c){function e(a){return a.contentWindow?a.contentWindow.document:a.contentDocument?a.contentDocument:a.document}function f(){function b(){try{var a=e(q).readyState;d("state = "+a),a&&"uninitialized"==a.toLowerCase()&&setTimeout(b,50)}catch(a){d("Server abort: ",a," (",a.name,")"),h(A),v&&clearTimeout(v),v=void 0}}var c=j.attr("target"),f=j.attr("action");w.setAttribute("target",o),g||w.setAttribute("method","POST"),f!=l.url&&w.setAttribute("action",l.url),l.skipEncodingOverride||g&&!/post/i.test(g)||j.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"}),l.timeout&&(v=setTimeout(function(){u=!0,h(z)},l.timeout));var i=[];try{if(l.extraData)for(var k in l.extraData)l.extraData.hasOwnProperty(k)&&(a.isPlainObject(l.extraData[k])&&l.extraData[k].hasOwnProperty("name")&&l.extraData[k].hasOwnProperty("value")?i.push(a('<input type="hidden" name="'+l.extraData[k].name+'">').val(l.extraData[k].value).appendTo(w)[0]):i.push(a('<input type="hidden" name="'+k+'">').val(l.extraData[k]).appendTo(w)[0]));l.iframeTarget||(p.appendTo("body"),q.attachEvent?q.attachEvent("onload",h):q.addEventListener("load",h,!1)),setTimeout(b,15);try{w.submit()}catch(a){var m=document.createElement("form").submit;m.apply(w)}}finally{w.setAttribute("action",f),c?w.setAttribute("target",c):j.removeAttr("target"),a(i).remove()}}function h(b){if(!r.aborted&&!F){try{E=e(q)}catch(a){d("cannot access response document: ",a),b=A}if(b===z&&r)return r.abort("timeout"),void y.reject(r,"timeout");if(b==A&&r)return r.abort("server abort"),void y.reject(r,"error","server abort");if(E&&E.location.href!=l.iframeSrc||u){q.detachEvent?q.detachEvent("onload",h):q.removeEventListener("load",h,!1);var c,f="success";try{if(u)throw"timeout";var g="xml"==l.dataType||E.XMLDocument||a.isXMLDoc(E);if(d("isXml="+g),!g&&window.opera&&(null===E.body||!E.body.innerHTML)&&--G)return d("requeing onLoad callback, DOM not available"),void setTimeout(h,250);var i=E.body?E.body:E.documentElement;r.responseText=i?i.innerHTML:null,r.responseXML=E.XMLDocument?E.XMLDocument:E,g&&(l.dataType="xml"),r.getResponseHeader=function(a){return{"content-type":l.dataType}[a]},i&&(r.status=Number(i.getAttribute("status"))||r.status,r.statusText=i.getAttribute("statusText")||r.statusText);var j=(l.dataType||"").toLowerCase(),k=/(json|script|text)/.test(j);if(k||l.textarea){var n=E.getElementsByTagName("textarea")[0];if(n)r.responseText=n.value,r.status=Number(n.getAttribute("status"))||r.status,r.statusText=n.getAttribute("statusText")||r.statusText;else if(k){var o=E.getElementsByTagName("pre")[0],s=E.getElementsByTagName("body")[0];o?r.responseText=o.textContent?o.textContent:o.innerText:s&&(r.responseText=s.textContent?s.textContent:s.innerText)}}else"xml"==j&&!r.responseXML&&r.responseText&&(r.responseXML=H(r.responseText));try{D=J(r,j,l)}catch(a){f="parsererror",r.error=c=a||f}}catch(a){d("error caught: ",a),f="error",r.error=c=a||f}r.aborted&&(d("upload aborted"),f=null),r.status&&(f=r.status>=200&&r.status<300||304===r.status?"success":"error"),"success"===f?(l.success&&l.success.call(l.context,D,"success",r),y.resolve(r.responseText,"success",r),m&&a.event.trigger("ajaxSuccess",[r,l])):f&&(void 0===c&&(c=r.statusText),l.error&&l.error.call(l.context,r,f,c),y.reject(r,"error",c),m&&a.event.trigger("ajaxError",[r,l,c])),m&&a.event.trigger("ajaxComplete",[r,l]),m&&!--a.active&&a.event.trigger("ajaxStop"),l.complete&&l.complete.call(l.context,r,f),F=!0,l.timeout&&clearTimeout(v),setTimeout(function(){l.iframeTarget||p.remove(),r.responseXML=null},100)}}}var i,k,l,m,o,p,q,r,s,t,u,v,w=j[0],x=!!a.fn.prop,y=a.Deferred();if(c)for(k=0;k<n.length;k++)i=a(n[k]),x?i.prop("disabled",!1):i.removeAttr("disabled");if(l=a.extend(!0,{},a.ajaxSettings,b),l.context=l.context||l,o="jqFormIO"+(new Date).getTime(),l.iframeTarget?(p=a(l.iframeTarget),t=p.attr("name"),t?o=t:p.attr("name",o)):(p=a('<iframe name="'+o+'" src="'+l.iframeSrc+'" />'),p.css({position:"absolute",top:"-1000px",left:"-1000px"})),q=p[0],r={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(b){var c="timeout"===b?"timeout":"aborted";d("aborting upload... "+c),this.aborted=1;try{q.contentWindow.document.execCommand&&q.contentWindow.document.execCommand("Stop")}catch(a){}p.attr("src",l.iframeSrc),r.error=c,l.error&&l.error.call(l.context,r,c,b),m&&a.event.trigger("ajaxError",[r,l,c]),l.complete&&l.complete.call(l.context,r,c)}},m=l.global,m&&0==a.active++&&a.event.trigger("ajaxStart"),m&&a.event.trigger("ajaxSend",[r,l]),l.beforeSend&&!1===l.beforeSend.call(l.context,r,l))return l.global&&a.active--,y.reject(),y;if(r.aborted)return y.reject(),y;(s=w.clk)&&(t=s.name)&&!s.disabled&&(l.extraData=l.extraData||{},l.extraData[t]=s.value,"image"==s.type&&(l.extraData[t+".x"]=w.clk_x,l.extraData[t+".y"]=w.clk_y));var z=1,A=2,B=a("meta[name=csrf-token]").attr("content"),C=a("meta[name=csrf-param]").attr("content");C&&B&&(l.extraData=l.extraData||{},l.extraData[C]=B),l.forceSync?f():setTimeout(f,10);var D,E,F,G=50,H=a.parseXML||function(a,b){return window.ActiveXObject?(b=new ActiveXObject("Microsoft.XMLDOM"),b.async="false",b.loadXML(a)):b=(new DOMParser).parseFromString(a,"text/xml"),b&&b.documentElement&&"parsererror"!=b.documentElement.nodeName?b:null},I=a.parseJSON||function(a){return window.eval("("+a+")")},J=function(b,c,d){var e=b.getResponseHeader("content-type")||"",f="xml"===c||!c&&e.indexOf("xml")>=0,g=f?b.responseXML:b.responseText;return f&&"parsererror"===g.documentElement.nodeName&&a.error&&a.error("parsererror"),d&&d.dataFilter&&(g=d.dataFilter(g,c)),"string"==typeof g&&("json"===c||!c&&e.indexOf("json")>=0?g=I(g):("script"===c||!c&&e.indexOf("javascript")>=0)&&a.globalEval(g)),g};return y}if(!this.length)return d("ajaxSubmit: skipping submit process - no element selected"),this;var g,h,i,j=this;"function"==typeof b&&(b={success:b}),g=this.attr("method"),h=this.attr("action"),i="string"==typeof h?a.trim(h):"",i=i||window.location.href||"",i&&(i=(i.match(/^([^#]+)/)||[])[1]),b=a.extend(!0,{url:i,success:a.ajaxSettings.success,type:g||"GET",iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},b);var k={};if(this.trigger("form-pre-serialize",[this,b,k]),k.veto)return d("ajaxSubmit: submit vetoed via form-pre-serialize trigger"),this;if(b.beforeSerialize&&!1===b.beforeSerialize(this,b))return d("ajaxSubmit: submit aborted via beforeSerialize callback"),this;var l=b.traditional;void 0===l&&(l=a.ajaxSettings.traditional);var m,n=[],o=this.formToArray(b.semantic,n);if(b.data&&(b.extraData=b.data,m=a.param(b.data,l)),b.beforeSubmit&&!1===b.beforeSubmit(o,this,b))return d("ajaxSubmit: submit aborted via beforeSubmit callback"),this;if(this.trigger("form-submit-validate",[o,this,b,k]),k.veto)return d("ajaxSubmit: submit vetoed via form-submit-validate trigger"),this;var p=a.param(o,l);m&&(p=p?p+"&"+m:m),"GET"==b.type.toUpperCase()?(b.url+=(b.url.indexOf("?")>=0?"&":"?")+p,b.data=null):b.data=p;var q=[];if(b.resetForm&&q.push(function(){j.resetForm()}),b.clearForm&&q.push(function(){j.clearForm(b.includeHidden)}),!b.dataType&&b.target){var r=b.success||function(){};q.push(function(c){var d=b.replaceTarget?"replaceWith":"html";a(b.target)[d](c).each(r,arguments)})}else b.success&&q.push(b.success);b.success=function(a,c,d){for(var e=b.context||this,f=0,g=q.length;f<g;f++)q[f].apply(e,[a,c,d||j,j])};var s=a('input[type=file]:enabled[value!=""]',this),t=s.length>0,u="multipart/form-data",v=j.attr("enctype")==u||j.attr("encoding")==u,w=e.fileapi&&e.formdata;d("fileAPI :"+w);var x,y=(t||v)&&!w;!1!==b.iframe&&(b.iframe||y)?b.closeKeepAlive?a.get(b.closeKeepAlive,function(){x=f(o)}):x=f(o):x=(t||v)&&w?function(d){for(var e=new FormData,f=0;f<d.length;f++)e.append(d[f].name,d[f].value);if(b.extraData){var h=c(b.extraData);for(f=0;f<h.length;f++)h[f]&&e.append(h[f][0],h[f][1])}b.data=null;var i=a.extend(!0,{},a.ajaxSettings,b,{contentType:!1,processData:!1,cache:!1,type:g||"POST"});b.uploadProgress&&(i.xhr=function(){var a=jQuery.ajaxSettings.xhr();return a.upload&&a.upload.addEventListener("progress",function(a){var c=0,d=a.loaded||a.position,e=a.total;a.lengthComputable&&(c=Math.ceil(d/e*100)),b.uploadProgress(a,d,e,c)},!1),a}),i.data=null;var j=i.beforeSend;return i.beforeSend=function(a,b){b.data=e,j&&j.call(this,a,b)},a.ajax(i)}(o):a.ajax(b),j.removeData("jqxhr").data("jqxhr",x);for(var z=0;z<n.length;z++)n[z]=null;return this.trigger("form-submit-notify",[this,b]),this},a.fn.ajaxForm=function(e){if(e=e||{},e.delegation=e.delegation&&a.isFunction(a.fn.on),!e.delegation&&0===this.length){var f={s:this.selector,c:this.context};return!a.isReady&&f.s?(d("DOM not ready, queuing ajaxForm"),a(function(){a(f.s,f.c).ajaxForm(e)}),this):(d("terminating; zero elements found by selector"+(a.isReady?"":" (DOM not ready)")),this)}return e.delegation?(a(document).off("submit.form-plugin",this.selector,b).off("click.form-plugin",this.selector,c).on("submit.form-plugin",this.selector,e,b).on("click.form-plugin",this.selector,e,c),this):this.ajaxFormUnbind().bind("submit.form-plugin",e,b).bind("click.form-plugin",e,c)},a.fn.ajaxFormUnbind=function(){return this.unbind("submit.form-plugin click.form-plugin")},a.fn.formToArray=function(b,c){var d=[];if(0===this.length)return d;var f=this[0],g=b?f.getElementsByTagName("*"):f.elements;if(!g)return d;var h,i,j,k,l,m,n;for(h=0,m=g.length;h<m;h++)if(l=g[h],j=l.name)if(b&&f.clk&&"image"==l.type)l.disabled||f.clk!=l||(d.push({name:j,value:a(l).val(),type:l.type}),d.push({name:j+".x",value:f.clk_x},{name:j+".y",value:f.clk_y}));else if((k=a.fieldValue(l,!0))&&k.constructor==Array)for(c&&c.push(l),i=0,n=k.length;i<n;i++)d.push({name:j,value:k[i]});else if(e.fileapi&&"file"==l.type&&!l.disabled){c&&c.push(l);var o=l.files;if(o.length)for(i=0;i<o.length;i++)d.push({name:j,value:o[i],type:l.type});else d.push({name:j,value:"",type:l.type})}else null!==k&&void 0!==k&&(c&&c.push(l),d.push({name:j,value:k,type:l.type,required:l.required}));if(!b&&f.clk){var p=a(f.clk),q=p[0];j=q.name,j&&!q.disabled&&"image"==q.type&&(d.push({name:j,value:p.val()}),d.push({name:j+".x",value:f.clk_x},{name:j+".y",value:f.clk_y}))}return d},a.fn.formSerialize=function(b){return a.param(this.formToArray(b))},a.fn.fieldSerialize=function(b){var c=[];return this.each(function(){var d=this.name;if(d){var e=a.fieldValue(this,b);if(e&&e.constructor==Array)for(var f=0,g=e.length;f<g;f++)c.push({name:d,value:e[f]});else null!==e&&void 0!==e&&c.push({name:this.name,value:e})}}),a.param(c)},a.fn.fieldValue=function(b){for(var c=[],d=0,e=this.length;d<e;d++){var f=this[d],g=a.fieldValue(f,b);null===g||void 0===g||g.constructor==Array&&!g.length||(g.constructor==Array?a.merge(c,g):c.push(g))}return c},a.fieldValue=function(b,c){var d=b.name,e=b.type,f=b.tagName.toLowerCase();if(void 0===c&&(c=!0),c&&(!d||b.disabled||"reset"==e||"button"==e||("checkbox"==e||"radio"==e)&&!b.checked||("submit"==e||"image"==e)&&b.form&&b.form.clk!=b||"select"==f&&-1==b.selectedIndex))return null;if("select"==f){var g=b.selectedIndex;if(g<0)return null;for(var h=[],i=b.options,j="select-one"==e,k=j?g+1:i.length,l=j?g:0;l<k;l++){var m=i[l];if(m.selected){var n=m.value;if(n||(n=m.attributes&&m.attributes.value&&!m.attributes.value.specified?m.text:m.value),j)return n;h.push(n)}}return h}return a(b).val()},a.fn.clearForm=function(b){return this.each(function(){a("input,select,textarea",this).clearFields(b)})},a.fn.clearFields=a.fn.clearInputs=function(b){var c=/^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;return this.each(function(){var d=this.type,e=this.tagName.toLowerCase();c.test(d)||"textarea"==e?this.value="":"checkbox"==d||"radio"==d?this.checked=!1:"select"==e?this.selectedIndex=-1:"file"==d?/MSIE/.test(navigator.userAgent)?a(this).replaceWith(a(this).clone()):a(this).val(""):b&&(!0===b&&/hidden/.test(d)||"string"==typeof b&&a(this).is(b))&&(this.value="")})},a.fn.resetForm=function(){return this.each(function(){("function"==typeof this.reset||"object"==typeof this.reset&&!this.reset.nodeType)&&this.reset()})},a.fn.enable=function(a){return void 0===a&&(a=!0),this.each(function(){this.disabled=!a})},a.fn.selected=function(b){return void 0===b&&(b=!0),this.each(function(){var c=this.type;if("checkbox"==c||"radio"==c)this.checked=b;else if("option"==this.tagName.toLowerCase()){var d=a(this).parent("select");b&&d[0]&&"select-one"==d[0].type&&d.find("option").selected(!1),this.selected=b}})},a.fn.ajaxSubmit.debug=!1}(jQuery);

window.hzmr.push("jquery.form.min:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End jquery.form.min.js  **************/
/************* Start spacePreview.js for locale it-IT **************/
try {HZ.ns("HZ.modules"),HZ.modules.SpacePreview=new function(){var a=new RegExp("https?://(?:www\\.)?(?:mytest|houzztest|houzz2?|stghouzz)\\.[A-Za-z\\./]*/("+HZ.utils.Config.spaceCommand+"|"+HZ.utils.Config.photoCommand+"|"+HZ.utils.Config.productCommand+"|"+HZ.utils.Config.galleryCommand+"|projects)/(\\d+)(?=(?:\\D|$))[/\\?=&\\+%\\w-#]*","g");this.init=function(a){if(void 0!==a&&a.length){var c;c=a.parents(".bubble--post").length?$('<div class="generatedPhotoCtn clearfix"></div>').insertAfter(a.parents(".bubble--post")):$('<div class="generatedPhotoCtn clearfix"></div>').insertAfter(a),c.data("urlToId",{}),a.data("preview",{analyzing:!1}),""!==a.val()&&b(a,c);var d=function(){var d=$(this).data("preview");!(!d||!d.analyzing)&&d.analyzing||b(a,c)};a.bind("keyup.linkConverter",$.debounce(700,d)).bind("change.linkConverter",d).bind("paste.linkConverter",function(){setTimeout(d,0)}).bind("reset",d),c.on("click",".removeThumb",function(b){e($(this),a,c)})}};var b=function(b,e){var f,g,h,i,j,k=[],l=[],m=[];g=b.data("preview"),g&&(g.analyzing=!0),b.data("preview",g),f=b.val(),h=e.data("urlToId"),k=f.match(a),null===k&&(k=[]),j=k.length;for(var n=0;n<j;n++){var i=k[n];void 0===h[i]&&l.push(i)}for(var i in h)h.hasOwnProperty(i)&&-1===$.inArray(i,k)&&m.push(i);m.length&&d(e,m),l.length?c(k,b,e):b.data("preview",{analyzing:!1})},c=function(a,b,c){var d,e,f,g,h=0,i=a.join(" "),j=$("#questionsGuidelines"),k=function(a){var b="";for(var i in a)if(a.hasOwnProperty(i)&&(e=a[i],(d=HZ.data.Spaces.get(e))&&d.iids&&d.iids[0])){g=d.iids[0],f=HZ.data.Images.get(g),f&&(h=f.ts),h=h||"0000";var k=HZ.utils.Links.getStaticImageUrlHost()+g+"_5-"+h+"/home-design.jpg";b+='<div class="houseThumbnail" data-id="'+e+'"><img width="75px" height="55px" src="'+k+'"/><a href="javascript:;" class="removeThumb"></a></div>'}b?c.html(b).show():c.html("").hide(),b&&j.length>0&&j.hide()};i?HZ.ajaz.Services.getMinimalSpaceData(i,function(a){if(a&&"true"===a.success&&a.spaces&&a.images){var d=HZ.data.Spaces.getCollection(),e=HZ.data.Images.getCollection();$.extend(!0,d,a.spaces),$.extend(!0,e,a.images),HZ.data.Spaces.addAll(d),HZ.data.Images.addAll(e),k(a.urlToId),c.data("urlToId",a.urlToId),b.data("preview",{analyzing:!1})}else b.data("preview",{analyzing:!1})}):b.data("preview",{analyzing:!1})},d=function(a,b){for(var c=a.data("urlToId"),d=b.length,e=0;e<d;e++){var f=b[e],g=c[f];a.find("[data-id="+g+"]").remove(),delete c[f]}""==a.html()&&a.hide(),a.data("urlToId",c)},e=function(a,b,c){var d,e,f,g,h=c.data("urlToId");d=a.closest(".houseThumbnail"),e=d.attr("data-id");for(var i in h)h.hasOwnProperty(i)&&h[i]===e&&(d.hide().remove(),f=b.val(),g=f.replace(i,""),b.val(g),delete h[i]);""==c.html()&&c.hide(),c.data("urlToId",h)}};

window.hzmr.push("spacePreview:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End spacePreview.js  **************/
/************* Start extracting text for zoomable.js for locale it-IT **************/
(function(){var _hzxt={"Visit Page":"Visita la pagina"};for(var a in _hzxt){window._hzlang[a]=_hzxt[a];}})();
/*************  End extracting text for zoomable.js  **************/
/************* Start zoomable.js for locale it-IT **************/
try {HZ.ns("HZ.modules.Zoomable"),HZ.modules.Zoomable=new function(){var a,b;this.init=function(){$("body").off("click.photoViewer",".js-enlarge").on("click.photoViewer",".js-enlarge",a)},a=function(a){void 0===b&&(b=new HZ.dialogs.PhotoViewer,b.prepare()),b.showImage(this),a.preventDefault()}},HZ.ns("HZ.dialogs.PhotoViewer"),HZ.dialogs.PhotoViewer=function(){HZ.dialogs.PhotoViewer.superclass.constructor.call(this);var $body,$imgThumbDiv,shouldShowImgInfo,imageObj,zoomCallback,zoomIndex,imageArr,imgNatureWidth,imgNatureHeight,DIALOG_FRAME_PADDING=15,IMAGE_INFO_DIV_HEIGHT=30,PHOTO_VIEWER_MARGIN=.025,IMAGE_DIV_MIN_HEIGHT=190;this.prepare=function(){var a,b;$body=$('<div id="photoViewer"><div class="hzLoadingDlgThrobber"></div><div class="photo-viewer__img-thumb text-center"></div><div class="photo-viewer__img-info text-l text-right hidden"></div><div id="photoViewerClose"><a id="photoViewerCloseBtn" href="javascript:;"><i class="hzi-font hzi-CloseX"></i></a></div><div id="imgAlt"></div></div>'),$imgThumbDiv=$body.find(".photo-viewer__img-thumb"),a=this,b={title:"",body:$body,controls:[],hideDialogOnBgClick:!0,dialogClassName:"dialogFrame-equalPadding dialogFrame-bodyOnly",onViewUnloaded:onViewUnloaded},this.init(b),this.getView().find("#photoViewerCloseBtn").unbind("click.photoViewer").bind("click.photoViewer",function(){a.getDelegate().hide(a)}),this.getView().find(".photo-viewer__img-thumb").unbind("click.photoViewer").bind("click.photoViewer",function(){a.getDelegate().hide(a)}),this.getView().find("#imgAlt").bind("click",function(b){var c=$(b.target),d=c.attr("data-index"),e=$(imageArr[d]).attr("data-zoomsrc");a.showImage(imageObj,e),c.parent().find(".selected").removeClass("selected").end(),c.addClass("selected")})},this.showImage=function(a,b){var c,d,e,f=this,g=b||getSrc(a),h=$(a).attr("data-pin-no-hover"),i=$(a).attr("onmousedown"),j=$(a).attr("ondragstart"),k=$(a).attr("onselectstart"),l=$(a).attr("oncontextmenu");if(g&&(shouldShowImgInfo=!1,c=$(a).parent(),c.is("a")&&(d=c.attr("href"))&&/^(https?|ftp):\/\/[^\s\/$.?#].[^\s]*$/.test(d)&&(shouldShowImgInfo=!0,e=/(houzz|gardenweb)/i.test(d)),window.lightbox&&window.lightbox.isShowing()?window.lightbox.showDialog(this):HZ.ui.Yamdi.show(this),showThrobber(),imageObj=new Image,imageObj.onload=function(){hideThrobber(),imgNatureWidth=imageObj.width,imgNatureHeight=imageObj.height,$imgThumbDiv.empty().append(imageObj),shouldShowImgInfo&&$body.find(".photo-viewer__img-info").empty().append('<a href="'+d+'" class="colorLink one-line" target="_blank">'+(e?_hgt("Visit Page")+'<span class="more-icon"></span>':d)+"</a>").removeClass("hidden"),f.handleResize(),$(window).on("resize.photoViewer",$.throttle(250,$.proxy(f.handleResize,f)))},imageObj.src=g,void 0!==h&&imageObj.setAttribute("data-pin-no-hover",h),void 0!==i&&imageObj.setAttribute("onmousedown",i),void 0!==j&&imageObj.setAttribute("ondragstart",j),void 0!==k&&imageObj.setAttribute("onselectstart",k),void 0!==l&&imageObj.setAttribute("oncontextmenu","event.preventDefault();return false;"),!$body.closest(".modal").hasClass("altZoom")&&imageArr&&imageArr.length)){if(imageArr.length>1){for(var m="",n=0;n<imageArr.length;n++){m+="<img class='"+(n==zoomIndex?"selected":"")+"' data-index='"+n+"' src='"+$(imageArr[n]).attr("src")+"' />"}$body.find("#imgAlt").append(m),f.handleResize()}$body.closest(".modal").addClass("altZoom")}};var showThrobber=function(){$body.find(".hzLoadingDlgThrobber").removeClass("hidden")},hideThrobber=function(){$body.find(".hzLoadingDlgThrobber").addClass("hidden")},getSrc=function(a){var b=$(a),c=b.attr("src");if(!1===b.hasClass("img-external")){var d=/_[0-9]{1,2}((?:-(?:\S)+)?.jpg)/,e=/-w(\d+)-h(\d+)-/;if(b.attr("data-callback")&&(zoomCallback=b.attr("data-callback")),b.attr("data-zoomindex")){zoomIndex=b.attr("data-zoomindex"),imageArr=b.siblings();c=$(imageArr[zoomIndex]).attr("data-zoomsrc")}else b.data("imgurl")?(c=b.data("imgurl"),b.data("alt-target")&&(imageArr=$(b.data("alt-target")))):c=d.test(c)?c.replace(d,"_9$1"):c.replace(e,function(a,b,c){var d,e,f;return d=parseInt(b,10),e=parseInt(c,10),f=d/e,Math.max(d,e)==d?(d=630,e=parseInt(630/f,10)):(e=630,d=parseInt(630*f,10)),"-w"+d+"-h"+e+"-"})}return c},onViewUnloaded=function(){imageObj=null,imgNatureWidth=null,imgNatureHeight=null,$imgThumbDiv.empty().css({width:"auto",height:"auto"}),$body.find(".photo-viewer__img-info").empty().addClass("hidden"),$body.find("#imgAlt").empty(),$body.closest(".modal").removeClass("altZoom"),$(window).off("resize.photoViewer"),zoomCallback&&eval(zoomCallback)(),$(".hbs .modal-dialog").css({"margin-top":"","margin-bottom":"",width:""})};this.handleResize=function(){if(void 0!==imageObj){var a=UIHelper.getScreenBounds(),b=Math.floor(a.w*(1-2*PHOTO_VIEWER_MARGIN)-2*DIALOG_FRAME_PADDING-2),c=Math.floor(a.h*(1-2*PHOTO_VIEWER_MARGIN)-2*DIALOG_FRAME_PADDING-2);shouldShowImgInfo&&(c-=IMAGE_INFO_DIV_HEIGHT);var d=imgNatureWidth/imgNatureHeight,e=Math.min(b,imgNatureWidth),f=Math.floor(e/d);f>c&&(f=Math.min(c,imgNatureHeight),e=Math.floor(f*d)),UIHelper.setBounds(imageObj,{x:"auto",y:"auto",w:e,h:f}),UIHelper.setBounds($imgThumbDiv[0],{x:"auto",y:"auto",w:Math.max(e,Math.min(b,Math.floor(d*IMAGE_DIV_MIN_HEIGHT))),h:Math.max(f,IMAGE_DIV_MIN_HEIGHT)}),$(imageObj).css({position:"relative",top:f<IMAGE_DIV_MIN_HEIGHT?"50%":0,"margin-top":f<IMAGE_DIV_MIN_HEIGHT?-Math.floor(f/2):0}),HZ.ui.Yamdi.center(),$(".hbs .modal-dialog").css({"margin-top":"0","margin-bottom":"0",width:Math.max(e,Math.min(b,Math.floor(d*IMAGE_DIV_MIN_HEIGHT)))+30})}}},HZ.extend(HZ.dialogs.PhotoViewer,HZ.ui.yamdi.Dialog),$(document).ready(function(){HZ.modules.Zoomable.init()});

window.hzmr.push("zoomable:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End zoomable.js  **************/
/************* Start bootstrap-dropdown.js for locale it-IT **************/
try {!function(a){"use strict";function b(){a(d).each(function(){c(a(this)).removeClass("open")})}function c(b){var c,d=b.attr("data-target");return d||(d=b.attr("href"),d=d&&/#/.test(d)&&d.replace(/.*(?=#[^\s]*$)/,"")),c=d&&a(d),c&&c.length||(c=b.parent()),c}var d="[data-toggle=dropdown]",e=function(b){var c=a(b).on("click.dropdown.data-api",this.toggle);a("html").on("click.dropdown.data-api",function(){c.parent().removeClass("open")})};e.prototype={constructor:e,toggle:function(d){var e,f,g=a(this);if(!g.is(".disabled, :disabled"))return e=c(g),f=e.hasClass("open"),b(),f||e.toggleClass("open"),g.focus(),!1},keydown:function(b){var e,f,g,h,i;if(/(38|40|27)/.test(b.keyCode)&&(e=a(this),b.preventDefault(),b.stopPropagation(),!e.is(".disabled, :disabled"))){if(g=c(e),!(h=g.hasClass("open"))||h&&27==b.keyCode)return 27==b.which&&g.find(d).focus(),e.click();f=a("[role=menu] li:not(.divider):visible a",g),f.length&&(i=f.index(f.filter(":focus")),38==b.keyCode&&i>0&&i--,40==b.keyCode&&i<f.length-1&&i++,~i||(i=0),f.eq(i).focus())}}};var f=a.fn.dropdown;a.fn.dropdown=function(b){return this.each(function(){var c=a(this),d=c.data("dropdown");d||c.data("dropdown",d=new e(this)),"string"==typeof b&&d[b].call(c)})},a.fn.dropdown.Constructor=e,a.fn.dropdown.noConflict=function(){return a.fn.dropdown=f,this},a(document).on("click.dropdown.data-api",b).on("click.dropdown.data-api",".dropdown form",function(a){a.stopPropagation()}).on("click.dropdown-menu",function(a){a.stopPropagation()}).on("click.dropdown.data-api",d,e.prototype.toggle).on("keydown.dropdown.data-api",d+", [role=menu]",e.prototype.keydown)}(jQuery);

window.hzmr.push("bootstrap-dropdown:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End bootstrap-dropdown.js  **************/
/************* Start extracting text for questions.js for locale it-IT **************/
(function(){var _hzxt={"Please enter at least 2 options for your poll":"Inserisci almeno due opzioni per il tuo sondaggio","Please enter details for your post":"Inserisci i dettagli relativi al tuo post","OPTION {optionNum}":"OPZIONE {optionNum}","Share this poll":"Condividi questo sondaggio","I voted for \"{option}.\"":"Ho votato per \"{option}\".","Example title: \"Best practices with new clients on Houzz?\"":"Esempio di titolo: best practice con i nuovi clienti su Houzz?","You voted for this option.":"Hai votato questa opzione.","Tell us the details here, share photos if you have them.":"Descrivi qui i dettagli e condividi le foto, se ne hai.","Example title: \"Dining Benches - Yes or No?\" or \"Favorite Fall Decor\"":"Esempio di titolo: \"Panche per la zona pranzo: s\u00ec o no?\" o \"Arredo preferito per l'autunno\"","Example title: \"Our new kitchen!\"":"Esempio di titolo: \"La nostra nuova cucina!\"","Example title: \"Need help for my kitchen\"":"Esempio di titolo: \"Ho bisogno di aiuto per la cucina\"","{total} Votes":"{total} Voti","1 Vote":"1 Voto","0 Votes":"0 Voti","Submitting your vote...":"Invio del tuo voto in corso...","Tell us the details here. \"Using Houzz\" is a place to get technical support for the site and apps.":"Inserisci qui i dettagli. \"Usare Houzz\" \u00e8 una pagina per ottenere assistenza tecnica per il sito e le applicazioni.","Example title: \"How do I add a collaborator to my ideabook\"":"Esempio di titolo: \"Come faccio ad aggiungere un collaboratore al mio Ideabook?\"","Add option: enter text or paste a Houzz link.":"Aggiungi un'opzione: inserisci il testo o incolla un link di Houzz.","Characters Left":"Caratteri rimanenti","No thanks":"No, grazie","":"","Email":"E-mail","Title":"Titolo","What are you working on?":"Stai lavorando ad un progetto?"};for(var a in _hzxt){window._hzlang[a]=_hzxt[a];}})();
/*************  End extracting text for questions.js  **************/
/************* Start questions.js for locale it-IT **************/
try {HZ.ns("HZ.questions"),HZ.questions.CreateQuestionForm={choiceTpl:'<div class="choiceLine form-group"><div class="col-xs-12 text-xxs choice-header">'+_hgt("OPTION {optionNum}",{optionNum:"__TOKEN__"})+'</div><div class="col-xs-6 prs"><input type="text" class="optionInput" name="newOption__TOKEN__" placeholder="'+_hgt("Add option: enter text or paste a Houzz link.")+'"/></div><div class="col-xs-6 pls"><input type="file" class="optionFileInput" name="newOptionImage__TOKEN__"/><input type="hidden" class="optionHouseIdInput" name="newOptionHouseId__TOKEN__"/><div class="houseThumb empty"><img width="30" height="30"/><a href="javascript:;" class="removeThumb"></a></div></div></div>',maxChoices:25,isPostToFollowersContext:!1,postToFollowersPlaceholder:null,designDilemmaPlaceholder:null,beforeAfterPlaceholder:null,pollPlaceholder:null,usingHouzzPlaceholder:null,defaultPlaceholder:null,TOPIC_ID_NOT_SPECIFIED:-1,TOPIC_ID_DESIGN_DILEMMA:5,TOPIC_ID_BEFORE_AFTER:15,TOPIC_ID_PRO_TO_PRO:13,TOPIC_ID_POST:16,TOPIC_ID_POLL:18,TOPIC_ID_USING_HOUZZ:11,init:function(a){var b=this;void 0!==a&&void 0!==a.isPostToFollowersContext&&(b.isPostToFollowersContext=a.isPostToFollowersContext),$("#editQuestion [placeholder]").initPlaceHolders(),$("#expandFileInputs").click(function(){var a=$("#editQuestionAddPhotoButtonBox").show();return UIHelper.isMSIE||a.find(".editQuestionFileInput").first().click(),$(this).unbind("click"),$(this).addClass("afterExpandFileInputs"),!1}),$(".editQuestionFileInput").bind("change",function(){$(this).next("input").show()}),$(".editQuestionTopic .dropdown-label").length&&($(".editQuestionTopic .dropdown-label").dropdown(),$(".editQuestionTopic .dropdown-label").on("click.dropdown",b.repositionDropdown),$(".editQuestionTopic .dropdown-menu").on("click",".dropdown-menuItem",function(){var a=$(this),b=parseInt(a.parent().data("topic"),10);$(".editQuestionTopic .dropdown-menu li").removeClass("selected"),a.parent().addClass("selected"),$("#editQuestionTopicBox option[value="+b+"]").prop("selected",!0).change(),$(".editQuestionTopic .dropdown-label").html(a.find(".dropdown-itemName").text()+"<i></i>")})),$("#editQuestionTopicBox").bind("change",function(){var a=$("#editQuestionTitle"),c=$("#editQuestionBody"),d=parseInt($("#editQuestionTopicBox option:selected").val(),10);if(d==b.TOPIC_ID_POLL?$("#editQuestionAddChoicesContainer").show():$("#editQuestionAddChoicesContainer").hide(),d!=b.TOPIC_ID_NOT_SPECIFIED&&d!=b.TOPIC_ID_POST||!b.isPostToFollowersContext)if(a.show(),a.val()==a.attr("placeholder")&&a.val(""),c.val()==c.attr("placeholder")&&c.val(""),HZ.utils.Config.isResponsive)switch(a.attr("placeholder",_hgt("Title")),d){case b.TOPIC_ID_BEFORE_AFTER:case b.TOPIC_ID_POLL:c.attr("placeholder",_hgt("Tell us the details here, share photos if you have them."));break;case b.TOPIC_ID_USING_HOUZZ:c.attr("placeholder",_hgt('Tell us the details here. "Using Houzz" is a place to get technical support for the site and apps.'));break;case b.TOPIC_ID_PRO_TO_PRO:c.attr("placeholder",_hgt("Tell us the details here, share photos if you have them."));break;case b.TOPIC_ID_NOT_SPECIFIED:case b.TOPIC_ID_DESIGN_DILEMMA:default:c.attr("placeholder",_hgt("Tell us the details here, share photos if you have them."))}else switch(d){case b.TOPIC_ID_BEFORE_AFTER:a.attr("placeholder",_hgt('Example title: "Our new kitchen!"')),c.attr("placeholder",_hgt("Tell us the details here, share photos if you have them."));break;case b.TOPIC_ID_POLL:a.attr("placeholder",_hgt('Example title: "Dining Benches - Yes or No?" or "Favorite Fall Decor"')),c.attr("placeholder",_hgt("Tell us the details here, share photos if you have them."));break;case b.TOPIC_ID_USING_HOUZZ:a.attr("placeholder",_hgt('Example title: "How do I add a collaborator to my ideabook"')),c.attr("placeholder",_hgt('Tell us the details here. "Using Houzz" is a place to get technical support for the site and apps.'));break;case b.TOPIC_ID_PRO_TO_PRO:a.attr("placeholder",_hgt('Example title: "Best practices with new clients on Houzz?"')),c.attr("placeholder",_hgt("Tell us the details here, share photos if you have them."));break;case b.TOPIC_ID_NOT_SPECIFIED:case b.TOPIC_ID_DESIGN_DILEMMA:default:a.attr("placeholder",_hgt('Example title: "Need help for my kitchen"')),c.attr("placeholder",_hgt("Tell us the details here, share photos if you have them."))}else a.hide(),c.val()==c.attr("placeholder")&&c.val(""),c.attr("placeholder",_hgt("What are you working on?"));$("#editQuestion [placeholder]").initPlaceHolders("refresh")}),b.isPostToFollowersContext||$("#editQuestionTitle").charCount({css:"counter text-xs hidden-xs pull-right",counterElement:"div",allowed:70,prewarning:20,warning:10,counterText:_hgt("Characters Left")+" "}),$("#editQuestionAddChoicesContainer").on("focus",".optionInput:last",function(a){b.addChoiceLine(a),$(this).focus()}),$(".optionInput").bind("paste change",function(a){var c=$(this);setTimeout(function(){b.extractUrl(c)},0)}),$("#editQuestionAddChoicesContainer").on("click",".removeThumb",function(){var a=$(this).parents(".choiceLine");a.find(".custom-file-input-wrapper").length?a.find(".custom-file-input-wrapper").show():a.find(".optionFileInput").show(),a.find(".optionHouseIdInput").val(""),a.find(".houseThumb").addClass("empty")}),$("#editQuestionBody").parents(".postToFollowers").length||$("#editQuestionBody").autosize()},repositionDropdown:function(){var a,b,c=$(".ask-form .dropdown-label"),d=c.height(),e=$(".ask-form .dropdown-menu"),f=e.height();b=c.offset().top-$(document).scrollTop(),a=$(window).height()-b-d,a<f&&b>a?e.addClass("north"):e.removeClass("north")},extractUrl:function(a){var b=a.val(),c=b.replace(HZ.utils.Links.spaceUrlRegex,function(b){return function(b,c,d,e,f){var g=b,h=a.parents(".choiceLine");h.find(".optionHouseIdInput").val(d);var i=b;return HZ.ajaz.Services.getSpaceData(d,-1,1,function(a){if(a&&"true"==a.success&&a.results&&a.results.spaceInfo){HZ.data.Spaces.addAll(a.results.spaceInfo),a.results.images&&HZ.data.Images.addAll(a.results.images);var b=a.results.spaceInfo[d];i=b.t,h.find(".custom-file-input-wrapper").length?h.find(".custom-file-input-wrapper").hide():h.find(".optionFileInput").hide(),h.find(".houseThumb").find("img").attr("src",HZ.utils.Links.getSpaceImageUrl(d,30,30,!1)),h.find(".houseThumb").removeClass("empty")}g=i},{async:!1}),g}}());a.val(c)},addChoiceLine:function(a){var b=this,c=$(".choiceLine"),d=c.length+1;if(!(d>b.maxChoices)){var e;e=this.choiceTpl.replace(/__TOKEN__/gi,d);var f=$(e);f.insertAfter(c.last()),f.find("[placeholder]").blur(),f.find(".optionInput").bind("paste",function(a){var c=$(this);setTimeout(function(){b.extractUrl(c)},0)})}},validate:function(){HZ.ui.InputButtonUtils.disableButton($("#editQuestionSubmitBtn"));var a,b,c,d=!1,e=!0,f="",g=!1,h=$("#editQuestionBody"),i=$.trim(h.initPlaceHolders("getValue"));if($("input[name=topic]").length?a=$("input[name=topic]").val():$("#editQuestionTopicBox").length&&(a=$("#editQuestionTopicBox option:selected").val()),g=18==a,(a==this.TOPIC_ID_POST||this.isPostToFollowersContext&&a==this.TOPIC_ID_NOT_SPECIFIED)&&(e=!1),$("#editQuestionTopicBox").length>0&&a==this.TOPIC_ID_NOT_SPECIFIED&&!this.isPostToFollowersContext)d=!0,f=_hgt("Please select a topic");else if(e&&""==$.trim($("#editQuestionTitle").initPlaceHolders("getValue")))d=!0,f=_hgt("Please enter a title for your post");else if(""==i)d=!0,f=_hgt("Please enter details for your post");else if(b=parseInt(h.attr("maxlength"),10)||3e3,(c=i.length)>b)d=!0,f=_hgt("Your post is {numOfCharsToDelete} too long, posts can be up to {lengthLimit} characters. Please make it a little shorter and try again.",{lengthLimit:b,numOfCharsToDelete:_hgtp("","1 character","{n} characters",c-b,{n:c-b})});else if(g){var j=0;$(".optionInput").each(function(){$(this).initPlaceHolders("getValue").length>0&&j++}),j<2&&(d=!0,f=_hgt("Please enter at least 2 options for your poll"))}return d?(HZ.ui.InputButtonUtils.enableButton($("#editQuestionSubmitBtn")),$("#editQuestionMainDiv .alert-error").html(f).show(),this.isPostToFollowersContext&&$(".ask-form").addClass("push-down"),!1):($("#editQuestionMainDiv .alert-error").html("").hide(),this.isPostToFollowersContext&&$(".ask-form").removeClass("push-down"),!0)}},HZ.questions.CreatePostToFollowersForm=new function(){this.init=function(a){a.isPostToFollowersContext=!0,HZ.questions.CreateQuestionForm.init(a);var b,c=$("#editQuestionBody");void 0!==HZ.modules&&void 0!==HZ.modules.SpacePreview&&HZ.modules.SpacePreview.init(c),c.click(function(){b=$(this).closest("form"),b.hasClass("expanded")||(b.addClass("expanded"),c.css("height","4em"),c.css("max-height","40em"),c.autosize({animateDuration:100,extraSpace:20,minHeight:48}))})}},HZ.questions.VotePolls={settings:{allowVoteFromVisitors:1},self:null,$pollEntry:null,$pollDisplays:null,pollShareDialog:null,init:function(a){self=this,a&&(self.settings=$.extend({},self.settings,a)),$(".voteMe").click(function(a){if(a.stopPropagation(),self.settings.allowVoteFromVisitors||HZ.data.CurrentSessionUser){var b=$(this),c=b.attr("for"),d=b.parents(".pollContainer").attr("qid");self.$pollEntry=b.parents(".pollEntry"),self.$pollEntry.find(".voteMe").hide(),self.$pollDisplays=self.$pollEntry.find(".optionVote"),self.$pollDisplays.html(_hgt("Submitting your vote...")),HZ.ajaz.Services.createPollVote(d,c,$.proxy(self.oncomplete,this))}else HZ.auth.Manager.signup(self.settings.signUpSourceLink?self.settings.signUpSourceLink:null)}),self.pollShareDialog=new HZ.questions.PollShareDialog,self.pollShareDialog.prepare()},oncomplete:function(a){function b(){h||(0==c.length?(c=$('<a class="hzBtn button-baseIcon whitebutton button-noFrame button-voteCount" href="javascript:;" title="'+i+'">\n\t\t\t\t\t\t<span class="button-icon hzi-font hzi-Vote"></span>\n\t\t\t\t\t\t<span class="button-label">'+d+"</span>\n\t\t\t\t\t</a>"),$(".userActionsRow").append(c)):(c.attr("title",i),c.find(".button-label").text(d)),self.pollShareDialog.updateShareLinks(self.settings.shareConfig,k),HZ.ui.Yamdi.show(self.pollShareDialog),h=!0)}var c=self.$pollEntry.parents("#questionCard").find(".button-voteCount");if(void 0===a.error)for(var d=a.results.total,e=a.results.options,f=a.results.optionId,g=(a.pollUrl,e.length),h=!1,i=_hgtp("0 Votes","1 Vote","{total} Votes",d,{total:d}),j=$.grep(e,function(a,b){return parseInt(a.id,10)===f}),k=$("<div>"+(j.length?j[0].body:null)+"</div>").text(),l=0;l<g;l++){var m=e[l].id,n=e[l].count,o=Math.floor(n/d*100),p=self.$pollEntry.find("#optionVote"+m),q='<div class="voteCount">'+_hgtp("0 Votes","1 Vote","{total} Votes",n,{total:n})+"</div>";q+='<div class="barGph"><div class="barGphBar" style="width:0%"/></div>',p.html(q),p.find(".barGphBar").animate({width:o+"%"},2e3,b),m===j[0].id&&self.$pollEntry.find("#optionVote"+m).prev(".optionText").after('<a class="voteIcon" href="javascript:;" title="'+_hgt("You voted for this option.")+'"><span class="hzi-font hzi-Vote"></span></a>')}else self.$pollDisplays.html(a.error)}},HZ.questions.showSendPollShareEmail=function(a,b){HZ.dialogs.EmailDialog.prepare({type:HZ.questions.POLL_EMAIL_TYPE,referenceId:HZ.questions.POLL_EMAIL_REF_ID,subject:a,message:b}),HZ.ui.Yamdi.show(HZ.dialogs.EmailDialog)},HZ.questions.PollShareDialog=function(){HZ.questions.PollShareDialog.superclass.constructor.call(this);var a=null,b=null,c=null,d=null;this.prepare=function(){var a,b,c,d;a='<a compid="poll-fb-share" href="javascript:" class="poll-fb-share"><div class="facebook-btn poll-share-btn"><span class="poll-share-logo hzi-font hzi-Facebook"></span></div></a>',b='<a compid="poll-tw-share" href="javascript:" class="poll-tw-share"><div class="twitter-btn poll-share-btn"><span class="poll-share-logo hzi-font hzi-Twitter"></span></div></a>',c='<a compid="poll-google-share" href="javascript:" class="poll-google-share"><div class="google-btn poll-share-btn"><span class="poll-share-logo hzi-font hzi-Google"></span></div></a>',d='<a compid="poll-email-share" href="javascript:" class="poll-email-share"><div class="email-btn poll-share-btn"><div class="poll-share-logo"></div><span class="text-m text-dt-s">'+_hgt("Email")+"</span></div></a>";var e=$('<div id="poll-share-dialog" scopeid="poll-share-dialog" class="trackMe">\n\t\t\t\t<div class="poll-calltoaction mbl"><div class="poll-title mbm">%POLLTITLE%</div><div class="poll-vote">%POLLVOTE%</div></div>\n\t\t\t\t<div class="poll-share-bar clearfix">'+a+b+c+d+"</div>\n\t\t\t</div>\n\t\t\t</div>"),f=HZ.ui.InputButtonUtils.createSecondaryInputButton(_hgt("No thanks"),"cancelBtn",null,!1,!1,"trackMe",' scopeid="poll-share-dialog" compid="cancel"'),g={title:_hgt("Share this poll"),body:e,controls:[f]};this.init(g),this.getControls().find("#cancelBtn").click(function(){HZ.ui.yamdi.Common.hideAllDialogs()})},this.updateShareLinks=function(e,f){a=e.pollTitle?e.pollTitle:"Poll on Houzz.com",b=e.twUserName,c=e.fbAppId,d=e.fbRedirectUri;var g=HZ.utils.Html.template(this.getBody().html(),{POLLTITLE:a,POLLVOTE:f});this.setBody(g);var h=this.getBody(),i=_hgt('I voted for "{option}."',{option:f}),j="link="+e.shareUrl+"&name="+encodeURIComponent(i)+"&description="+encodeURIComponent(a+" >> Vote now!");h.find(".poll-fb-share").click(function(a){var b=HZ.ui.Utils.getCenteredPopupPosition(368,611),e="width=611, height=368, left="+b.left+", top="+b.top+", status=1",f="https://www.facebook.com/dialog/feed?display=popup&app_id="+c+"&redirect_uri="+d+"&"+j;window.open(f,"fb-share",e)});var k="url="+e.shareUrl+"&text="+encodeURIComponent(a+" "+i);h.find(".poll-tw-share").click(function(a){var c=HZ.ui.Utils.getCenteredPopupPosition(380,575),d="width=575, height=380, left="+c.left+", top="+c.top+", status=1",e="https://twitter.com/share?via="+b+"&"+k;window.open(e,"tw-share",d)}),h.find(".poll-google-share").click(function(a){var b=HZ.ui.Utils.getCenteredPopupPosition(600,600),c="width=600, height=600, left="+b.left+", top="+b.top+", status=1",d="https://plus.google.com/share?url="+e.shareUrl;window.open(d,"g-share",c)}),h.find(".poll-email-share").click(function(b){HZ.ui.yamdi.Common.hideAllDialogs(),HZ.questions.showSendPollShareEmail(a,i)})}},HZ.extend(HZ.questions.PollShareDialog,HZ.ui.yamdi.Dialog);

window.hzmr.push("questions:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End questions.js  **************/
/************* Start extracting text for like.js for locale it-IT **************/
(function(){var _hzxt={"Unlike this comment":"Non mi piace pi\u00f9","No likes yet":"Nessun Mi piace","{numOfLikes} Likes":"{numOfLikes} Mi piace","1 Like":"1 Mi piace","Stop liking this item":"Non ti piace pi\u00f9 questo articolo","Stop liking this review":"Non ti piace pi\u00f9 questa recensione","Stop liking this comment":"Non ti piace pi\u00f9 questo commento","Like this item":"Ti piace questo articolo","Like this review":"Ti piace questa recensione","Like this comment":"Ti piace questo commento","Internal Error":"Errore interno","Cannot get the list of people who like this.<br\/>{error}<br\/>Please try it later.":"Impossibile trovare l'elenco delle persone cui piace questo. <br\/>{error}<br\/>Riprova pi\u00f9 tardi.","{countOfLikes} people like this.":"Piace a {countOfLikes} persone.","You and {countOfOtherLikes} people like this.":"Piace a te e a altri {countOfOtherLikes}.","Unlike":"Non mi piace pi\u00f9","People who like this":"Persone a cui \u00e8 piaciuto questo contenuto","":"","Like this discussion":"Mi piace questa discussione","Stop liking this discussion":"Questa discussione non mi piace pi\u00f9","Like this ideabook":"Mi piace questo Ideabook","Stop liking this ideabook":"Non mi piace pi\u00f9 questo Ideabook","Like":"Mi piace","Liked":"Ti piace","1 person likes this.":"Piace a una persona.","You and 1 person like this.":"Piace a te e a un'altra persona.","You like this.":"Ti piace"};for(var a in _hzxt){window._hzlang[a]=_hzxt[a];}})();
/*************  End extracting text for like.js  **************/
/************* Start like.js for locale it-IT **************/
try {HZ.ns("HZ.like"),HZ.like.LikeDialog=function(){HZ.like.LikeDialog.superclass.constructor.call(this);var a,b=this;this.prepare=function(){var d=$('<div id="hzlikeListContainer"><ul></ul></div>');a=d.find("ul");var e={title:_hgt("People who like this"),body:d,onViewLoaded:c};b.init(e)},this.appendToLikeList=function(b){a.append(b)};var c=function(){a.empty()}},HZ.extend(HZ.like.LikeDialog,HZ.ui.yamdi.Dialog),HZ.like.Like=new function(){function a(a,d){var e=$(d),f=e.attr("data-object-type"),g=e.attr("data-object-id"),h=e.attr("data-action-only");f&&g||(f=e.parents(".hzBtn").attr("loty"),g=e.parents(".hzBtn").attr("loid"));parseInt(e.attr("data-self"),10);a==c.showlikeAction&&HZ.ui.Yamdi.show(b),HZ.ajaz.Like.like(a,g,f,function(d){var i=e.parents(".likeContainer");if(d&&"true"==d.success){var j=d.numberOfLikes,k=i.find(".hz-showlike"),l="",m=d.userList;if(a==c.likeAction)e.addClass("unlike").removeClass("like").attr("title",_hgt("Unlike")).find(".hz-likeAction").remove(),e.find(".hz-like").attr("aria-label",_hgt("Unlike this comment")),e.find(".hz-like").addClass("hz-liked icon-thumb_solid").removeClass("hz-like icon-thumb_outline"),"0"===h&&(l=_hgtp("You like this.","You and 1 person like this.","You and {countOfOtherLikes} people like this.",j-1,{countOfOtherLikes:j-1}),0==k.length&&(k=$('<a class="hz-showlike" data-object-type="'+f+'" data-object-id="'+g+'" title="'+l+'" href="#"></a>'),i.append(k)),k.html(_hgtp("","1 Like","{numOfLikes} Likes",j,{numOfLikes:j})));else if(a==c.unlikeAction)e.addClass("like").removeClass("unlike").attr("title",_hgt("Like")),e.find(".hz-liked").attr("aria-label",_hgt("Like this comment")),e.find(".hz-liked").addClass("hz-like icon-thumb_outline").removeClass("hz-liked icon-thumb_solid"),0==j||"1"===h?(k.remove(),e.append('<span class="like-btn-label hz-likeAction" aria-label="'+_hgt("No likes yet")+'">'+_hgt("Like")+"</span>")):j>0&&(l=_hgtp("","1 person likes this.","{countOfLikes} people like this.",j,{countOfLikes:j}),k.attr("title",l),k.html(_hgtp("","1 Like","{numOfLikes} Likes",j,{numOfLikes:j})));else if(a==c.showlikeAction)for(var n,o,p,q,r,s=m.length,t=0;t<s;t++){var u=$("<li></li>"),v=m[t];n=v.link,o=v.userName,p=v.userImage,q=$("<a class='likeUserImg hz-user-image' href='"+n+"'><img width='40' height='40' src='"+p+"'/></a>"),r=$("<div class='likeUserTextInfo'><a class='colorLink' href='"+n+"'>"+o+"</a></div><div style='clear:both'></div>"),u.append(q).append(r),t==s-1&&u.addClass("last-like"),b.appendToLikeList(u),HZ.ui.Yamdi.center()}}else if(a==c.showlikeAction){HZ.ui.Yamdi.hide(b);var w=_hgt("Cannot get the list of people who like this.<br/>{error}<br/>Please try it later.",{error:d.error});HZ.ui.yamdi.Common.alert(_hgt("Internal Error"),w)}})}var b,c,d,e=this;d={typeQuestion:5,typeIbk:1,typeAnswer:6,typeComment:9,typeReview:20,isCobrand:!1,likeAction:"like",unlikeAction:"unlike",showlikeAction:"showlikes",likeButtonLabel:_hgt("Like"),likeButtonIngLabel:_hgt("Liked"),likeIconClass:"icon-thumb_solid",unlikeIconClass:"icon-close",likeIconIngClass:"icon-thumb_solid button-icon-liked"};var f=function(a){switch(parseInt(a,10)){case c.typeQuestion:return _hgt("Like this discussion");case c.typeIbk:return _hgt("Like this ideabook");case c.typeAnswer:case c.typeComment:return _hgt("Like this comment");case c.typeReview:return _hgt("Like this review");default:return _hgt("Like this item")}},g=function(a){switch(parseInt(a,10)){case c.typeQuestion:return _hgt("Stop liking this discussion");case c.typeIbk:return _hgt("Stop liking this ideabook");case c.typeAnswer:case c.typeComment:return _hgt("Stop liking this comment");case c.typeReview:return _hgt("Stop liking this review");default:return _hgt("Stop liking this item")}};this.init=function(f){f&&(c=$.extend({},d,f)),HZ.data.CurrentSessionUser?($(document).on("click","span.like",function(b){var d=this;a(c.likeAction,d),b.preventDefault()}),$(document).on("click","span.unlike",function(b){var d=this;a(c.unlikeAction,d),b.preventDefault()})):$(document).on("click","span.like,span.unlike",function(a){HZ.auth?HZ.auth.Manager.signup(HZ.ajaz.Like.SOURCE_LINK_LIKE,null,window.location.href):window.location.href=c.likeRedirectLink,a.preventDefault()}),b=new HZ.like.LikeDialog,b.prepare();var g=$(".button-like");$(document).on("click","a.hz-showlike",function(b){var d=this;b.preventDefault(),!HZ.data.CurrentSessionUser&&c.isCobrand?HZ.auth?HZ.auth.Manager.signup(HZ.ajaz.Like.SOURCE_LINK_LIKE,null,window.location.href):window.location.href=c.likeRedirectLink:a(c.showlikeAction,d)}),g.length&&($(document).on("click",".button-like .counter-bubble",function(b){b.stopImmediatePropagation(),b.preventDefault();var d=this;!HZ.data.CurrentSessionUser&&c.isCobrand?HZ.auth?HZ.auth.Manager.signup(HZ.ajaz.Like.SOURCE_LINK_LIKE,null,window.location.href):window.location.href=c.likeRedirectLink:a(c.showlikeAction,d)}),$(document).on("click",".button-like",function(a){HZ.data.CurrentSessionUser?e.updateLikes(".button-like"):(HZ.auth?HZ.auth.Manager.signup(HZ.ajaz.Like.SOURCE_LINK_LIKE,null,window.location.href):window.location.href=c.likeRedirectLink,a.preventDefault())}),$(document).on("mouseover",".button-like",function(){"unlike"==$(this).attr("lop")&&HZ.like.Like.updateLikeBtn($(this),!0)}).on("mouseout",".button-like",function(){"unlike"==$(this).attr("lop")&&e.updateLikeBtn($(this),!1)}),$(document).on("mouseover",".button-like .counter-bubble",function(a){var b=$(this).parents(".button-like");"unlike"==b.attr("lop")&&(e.updateLikeBtn(b,!1),a.stopImmediatePropagation())}).on("mouseout",".button-like .counter-bubble",function(){var a=$(this).parents(".button-like");"unlike"==a.attr("lop")&&e.updateLikeBtn(a,!0)}))},this.updateLikes=function(a){var b=$(a),d=b.attr("lop"),e=b.attr("loty"),h=b.attr("loid");HZ.ajaz.Like.like(d,h,e,function(a){if(a&&"true"==a.success){var h=b.find(".button-icon"),i=b.find(".button-label"),j=b.find(".counter-bubble");if(d==c.likeAction){if(b.addClass("hz-liked"),i.text(c.likeButtonIngLabel),b.attr("title",g(e)),b.attr("lop",c.unlikeAction),j.length>0){j.text(a.formattedLikeCount?a.formattedLikeCount:parseInt(j[0].innerHTML,10)+1);var k=_hgtp("","You and 1 person like this.","You and {countOfOtherLikes} people like this.",a.numberOfLikes-1,{countOfOtherLikes:a.numberOfLikes-1});j.attr("title",k)}else j=$('<span title="'+_hgt("You like this.")+'" class="counter-bubble">1</span>'),b.append(j);h.removeClass(c.likeIconClass).addClass(c.likeIconIngClass)}else if(d==c.unlikeAction){if(b.removeClass("hz-liked"),i.text(c.likeButtonLabel),b.attr("title",f(e)),b.attr("lop",c.likeAction),j.length>0){var l=a.formattedLikeCount?a.formattedLikeCount:parseInt(j[0].innerHTML,10)-1;if(l<1)j.remove();else{j.text(l);var k=_hgtp("","1 person likes this.","{countOfLikes} people like this.",a.numberOfLikes,{countOfLikes:a.numberOfLikes});j.attr("title",k)}}h.removeClass(c.likeIconIngClass).removeClass(c.unlikeIconClass).addClass(c.likeIconClass)}}})},this.updateLikeBtn=function(a,b){var d=$(a),e=d.find(".button-icon");b?e.removeClass(c.likeIconIngClass).addClass(c.unlikeIconClass):e.removeClass(c.unlikeIconClass).addClass(c.likeIconIngClass)}};

window.hzmr.push("like:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End like.js  **************/
/************* Start extracting text for clipping.js for locale it-IT **************/
(function(){var _hzxt={"Bookmark":"Preferito","Bookmarked":"Salvato tra i preferiti"};for(var a in _hzxt){window._hzlang[a]=_hzxt[a];}})();
/*************  End extracting text for clipping.js  **************/
/************* Start clipping.js for locale it-IT **************/
try {HZ.ns("HZ.clipping"),void 0===HZ.clipping.Clip&&(HZ.clipping.Clip=new function(){function a(a,c){var d=$(c),e=d.attr("data-object-type"),f=d.attr("data-object-id");e&&f||(e=d.parents(".hzBtn").attr("loty"),f=d.parents(".hzBtn").attr("loid")),HZ.ajaz.Clipping.clip(a,f,e,function(c){var e=d.parents(".clipContainer");c&&"true"==c.success&&(a==b.clipAction?(d.addClass("unclip").removeClass("clip").attr("title",_hgt("Bookmarked")),d.find(".hz-clip").addClass("hz-unclip hzi-Bookmarked-Circle").removeClass("hz-clip hzi-Bookmark-Circle"),e.find(".hz-clips").text(_hgt("Bookmarked"))):a==b.unclipAction&&(d.addClass("clip").removeClass("unclip").attr("title",_hgt("Bookmark")),d.find(".hz-unclip").addClass("hz-clip hzi-Bookmark-Circle").removeClass("hz-unclip hzi-Bookmarked-Circle"),e.find(".hz-clips").text(_hgt("Bookmark"))))})}var b,c;c={typeAnswer:6,typeComment:9,clipAction:"clip",unclipAction:"unclip",clipTitle:"Bookmark",unclipTitle:"Bookmarked"},this.init=function(a){a&&(b=$.extend({},c,a))},this.executeClip=function(c){if(HZ.data.CurrentSessionUser){$(c).parents(".clipContainer").find(".hz-clips").text()==b.unclipTitle?a(b.unclipAction,c):a(b.clipAction,c)}else HZ.auth?HZ.auth.Manager.signup(HZ.ajaz.Clipping.SOURCE_LINK_CLIPPING,null,window.location.href):window.location.href=b.clipRedirectLink}});

window.hzmr.push("clipping:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End clipping.js  **************/
/************* Start saveToUniversalGallery.js for locale it-IT **************/
try {HZ.ns("HZ.modules.SaveToUniversalGallery"),HZ.modules.SaveToUniversalGallery=new function(){var a={GALLERY:1,USER:2,SPACE:3,QUESTION:5,ANSWER:6,PRODUCT:13,FILE:14,SKETCH:80},b=this;this.isModuleLoaded=!1,this.isInitialized=!1,this.init=function(){b.isInitialized=!0,HZ.data.CurrentSessionUser&&$.ajax({url:"/j/saveToUniversalGalleryModule",method:"POST",data:{__ct:HZ.data.CSRFToken}}).done(function(a){HZ.utils.loadJukwaaModule(a,b.loadModule)}).fail(function(a){})},this.loadModule=function(){if(HZ&&HZ.WebModule){b.isModuleLoaded=!0;var a=document.getElementById("save-to-universal-gallery-module");HZ.WebModule.render("saveToUniversalGalleryModule",a),$(document).trigger("saveToUniversalGalleryModule")}},this.save=function(a,c){if(!HZ.data.CurrentSessionUser)return void HZ.auth.Manager.signup(HZ.modules.SaveToUniversalGallery.signupSource,HZ.modules.SaveToUniversalGallery.signUpMessageId,window.location.href);"number"!=typeof a&&(a=Number(a)),$(document).trigger("dialogOpened.saveToUniversalGallery"),b.isModuleLoaded||!b.isInitialized?this.openSaveDialog(a,c):$(document).bind("saveToUniversalGalleryModule",function(){this.openSaveDialog(a,c)}.bind(this))},this.openSaveDialog=function(a,b){var c={objectId:a,objectType:b};$(document).trigger("JUKWAA_OPEN_SAVE_TO_UNIVERSAL_GALLERY_DIALOG",c)},this.onClose=function(){$(document).trigger("dialogClosed.saveToUniversalGallery")},this.saveSpace=function(b){this.save(b,a.SPACE)},this.saveProduct=function(b){this.save(b,a.PRODUCT)},this.saveGallery=function(b){this.save(b,a.GALLERY)},this.saveProfessional=function(b){this.save(b,a.USER)},this.saveDiscussion=function(b){this.save(b,a.QUESTION)},this.saveComment=function(b){this.save(b,a.ANSWER)}};

window.hzmr.push("saveToUniversalGallery:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End saveToUniversalGallery.js  **************/
/************* Start homeSlideShow.js for locale it-IT **************/
try {HZ.ns("HZ.homeSlideShow"),HZ.homeSlideShow=new function(a){var b=this,c={fadeTime:400},d={thumbSize:null,width:null,height:null,isVisitor:!0},e={left:null,right:null},f={trackingIframe:null,trackingOffset:0},g=null,h=null,i=[],j=!1,k=null,l=null,m={credit:null,moreInfo:null},n=0,o=null,p={forward:1,backward:-1},q=!0,r=null,s=null,t=!1,u=!1,v=3e3,w=function(a){var b="",c="";return a&&a.professionalName&&null!=a.professionalName&&""!==a.professionalName?(b=a.professionalName,c=HZ.utils.Links.getProfessionalLink(a.authorName)):a&&a.authorName&&"sususu"!=a.authorName&&(b=a.authorDisplayName,c=HZ.utils.Links.getUserLink(a.authorName)),{title:b,url:c}},x=function(){$(h).animate({height:d.height}),y(o)},y=function(a){var b,c,d,e,f;if((b=a.data("data"))&&b.height&&b.width&&!(h.width()<=0))if(c=HZ.utils.Config.isResponsive?h.width():h.width()<1600?1600:h.width(),d=h.height(),(f=Math.floor(b.height*(c/b.width)))<d){f=d,e=Math.floor(b.width*(d/b.height));var g=Math.floor((c-e)/2);a.find(".l-photo").css({left:g,width:e,height:f})}else{e=c;var i=Math.floor((d-f)/2),g=Math.floor((h.width()-e)/2);a.find(".l-photo").css({top:i,left:g,width:e,height:f})}},z=function(a){switch(a.keyCode){case 39:return b.navigateForward(),!1;case 37:return b.navigateBackward(),!1}},A=function(a){f.trackingIframe.src="getSlideshowSpaces/offset="+a},B=function(){q=!0},C=function(){q=!1},D=function(a,b){FeaturedSpacesAjaxController.getFeaturedSpaces2(a,d.thumbSize,function(a){if(a.results){for(var c=0;c<a.results.length;c++){var d=a.results[c];if(i[0]&&d.spaceId==i[0].spaceId){j=!0;break}i.push(d)}a.spaces&&HZ.data.Spaces.addAll(a.spaces),a.images&&HZ.data.Images.addAll(a.images),b&&b()}},d.width)},E=function(a){if(C(),e.left.fadeIn(c.fadeTime),e.right.fadeIn(c.fadeTime),j||i[n+5]||D(r+i.length),0==t&&0==n&&(F(i[1]),F(i[2]),t=!0),n+=a,n>=i.length&&(n=i.length-1),n<0&&(n=0),0==n?(e.left.fadeOut(c.fadeTime),B()):n>=i.length-1&&(n=i.length-1,e.right.fadeOut(c.fadeTime),B()),i[n]){var b=i[n+2*a];b&&F(b),G(i[n],null,function(){var b=n-3*a;if(b>=0&&b<i.length){var c=i[b].spaceId;l.find("#frame"+c).remove()}})}else B()},F=function(a){if(a){var b=a?a.spaceId:null,c=UIHelper.isMSIE?k.clone().hide():k.clone().addClass("o");$("<img>").attr("src",a.imageUrl);l.find("#frame"+b).length>0||(c.data("data",a),c.attr("id","frame"+a.spaceId),c.find(".l-photo").attr("src",a.imageUrl),l.append(c))}},G=function(a,b,d){if(0==l.find("#frame"+a.spaceId).length)return void B();var e=b||c.fadeTime,f=w(a),g=l.find("#frame"+a.spaceId);m.credit.attr("href",f.url).html(f.title),m.moreInfo.attr("href",HZ.utils.Links.getSpaceLink(a.spaceId)).attr("target","_blank"),y(g),$("#homeSlideShow").attr("objId",a.spaceId),UIHelper.isMSIE?(o.fadeOut(e,function(){this.style.removeAttribute("filter"),o=g,B()}),g.show(),d&&d()):(o.removeClass("current"),g.addClass("current"),setTimeout(function(){B(),o=g},e),d&&d()),$("#homeSlideShow").attr("current-screen",n)},H=function(a){a.stopPropagation()};this.addToIdeabook=function(){var a=o.data("data");HZ.spaceActions.showAddToIdeabookDialog(a.spaceId)},this.emailPhoto=function(){var a=o.data("data");HZ.spaceActions.showEmailDialog(a.spaceId,!0)},this.navigateForward=function(a){b.navigate(p.forward)},this.navigateBackward=function(a){n>0&&b.navigate(p.backward)},this.navigate=function(a){h.focus(),1==q&&(E(a),f.trackingOffset%10==0&&A(f.trackingOffset),f.trackingOffset++)},this.loadImagesForAutoplay=function(){D(0,$.proxy(function(){i.length&&this.autoplayImages()},this))},this.autoplayImages=function(){var a=0,b=i.length;b?(F(i[a]),F(i[(a+1)%b]),o=l.find(".sliceShowFrame"),G(i[a],0),A(f.trackingOffset),window.setInterval(function(){var c;a=(a+1)%b,c=(a+1)%b,F(i[c]),G(i[a],0)},v)):this.loadImagesForAutoplay()},this.init=function(a){g=$("#"+a.rootContainer),h=$("#"+a.container),r=a.startingIndex,d.thumbSize=a.thumbSize,d.width=a.width,d.height=a.height,d.isVisitor=a.isVisitor,e.left=g.find("#navigateLeft").hide(),e.right=g.find("#navigateRight"),l=g.find("#frames"),f.trackingIframe=g.find("#trackingIframe")[0],k=g.find("#frame").attr("id","").remove(),s=g.find("#homeSlideShowActionBar"),m.credit=$("#by"),m.moreInfo=$("#moreInfo"),u=a.autoplay,v=a.autoplayInterval,$.merge(i,a.data?a.data:{}),u?this.autoplayImages():(F(i[0]),o=l.find(".slideShowFrame"),G(i[0],0),h.bind("keydown",z)),1==d.isVisitor?h.addClass("visitor"):(g.find("#homeSlideShowActionBar").bind("click",function(a){b.navigateForward()}),g.find("#homeSlideShowActionBar, .graybutton, .white-bar").bind("click",H)),$(document).ready(function(){setTimeout(function(){e.right.animate({right:"2%"},500,function(){$(this).animate({right:"0%"},500)})},2e3),$(".promo-banner-container").on("click",".hzi-CloseX",function(){var a=$(this).closest(".promo-banner-container"),b=$(a).attr("data-tip-id");a.remove(),HZ.ajaz.Services.tipBox(b)})}),$(window).resize(x)},this.onContextMenu=function(a){var b=o.data("data").spaceId;return PhotoContextMenu.show(a,b),!1}};

window.hzmr.push("homeSlideShow:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End homeSlideShow.js  **************/
/************* Start tipBox.js for locale it-IT **************/
try {HZ.ns("HZ.tipBox"),HZ.tipBox.TipBox=new function(){function a(a,b,c){a&&a.length&&!b.hasClass("tipBoxAbsolute")&&c.css("margin-left",a.offset().left+a.outerWidth()/2-b.offset().left-c.outerWidth()/2)}function b(b){$(".hzTipBox").each(function(b){var c,d=$(this),e=d.attr("data-tip-id"),f=d.attr("data-name"),g=".hzTipBox[data-name="+f+"] ",h=$(g+".tipBoxArrow");if(h&&h.length>0&&d&&d.length>0){var i=h.data("point-to");c=$(i),d.hasClass("tipBoxAbsolute")&&(c.prepend(d),d.hover(function(a){a.stopPropagation()})),a(c,d,h),h.fadeTo(1e3,1),$(window).resize(function(){a(c,d,h),h.fadeTo(1e3,1)})}d&&d.length>0&&d.removeClass("invisibleBox"),$(".hzCloseTip").click(function(a){d.slideUp("fast",function(){HZ.ajaz.Services.tipBox(e)})})})}var c=!1;this.init=function(a){c||(b(a),c=!0)}};

window.hzmr.push("tipBox:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End tipBox.js  **************/
/************* Start footerMenu.js for locale it-IT **************/
try {HZ.ns("HZ.footerMenu"),HZ.footerMenu=new function(){var a=!1,b=null,c=0,d=this;this.hideBottomFooter=function(){b.css("height","0px"),b.addClass("hide-footer"),a=!1,$("#stickyFooterActions").css("cssText",""),HZ.footerMenu.openLightBoxTipBannerEnabled&&$("#openLightBoxTip").css("bottom",c+20+"px")},this.showBottomFooter=function(){a=!0,b.removeClass("hide-footer");var d=60+c+16;$("#stickyFooterActions").css("cssText","bottom:"+d+"px !important;"),b.css("height",60+c+"px"),HZ.footerMenu.openLightBoxTipBannerEnabled&&$("#openLightBoxTip").css("bottom",d+"px")},$(document).ready(function(){if(b=$("#footer-menu"),b.length){var e=null,f=function(){clearTimeout(e)},g=function(){clearTimeout(e),e=setTimeout(function(){d.hideBottomFooter()},3e3)},h=function(b){var c=$(window).scrollTop();c>350?(a||d.showBottomFooter(),g()):a&&c<=350&&d.hideBottomFooter()};$(window).on("scroll",$.throttle(250,h)),b.on("mouseenter",f).on("mouseleave",g).on("click",function(a){a.stopPropagation()}),$("#mainContent").click(function(){d.hideBottomFooter()});var i=$("#cookieBanner");i.length&&(c=i.height(),$("#cookieBanner a.cookie-banner-accept").click(function(){c=0,a&&d.showBottomFooter()}))}$(window).resize(function(){var b=$("#cookieBanner");b.length&&0!==c&&(c=b.height(),a&&d.showBottomFooter())});var j=$("#footerMenuSiteSelector");j.length&&j.on("change",function(){var a=$(this).find(":selected"),b=a.attr("objid"),c=a.text(),d={scopeId:"site-redirection-footer",compId:"menu-footer",objId:b,currentSiteId:HZ.utils.Config.currentSiteId,anchorText:c};HZ.utils.Logger.sendEventLogLightweight(HZ.utils.Logger.EVENT_TYPE_USER_CLICK,d)})})};

window.hzmr.push("footerMenu:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End footerMenu.js  **************/
/************* Start extracting text for dropzone.js for locale it-IT **************/
(function(){var _hzxt={"You can not upload videos longer than 600 seconds":"Non \u00e8 possibile caricare video di durata superiore a 600 secondi.","You can not upload videos shorter than 15 seconds":"Non \u00e8 possibile caricare video di durata inferiore a 15 secondi.","You can not upload videos longer than 300 seconds":"Non puoi caricare video pi\u00f9 lunghi di 300 secondi.","You can only upload {maxFilesAllowed} files.":"Puoi caricare solo {maxFilesAllowed} file simultaneamente.","Remove file":"Rimuovi file","Are you sure you want to cancel this upload?":"Sei sicuro di voler annullare questo caricamento?","Cancel upload":"Annulla caricamento","Server responded with {statusCode} code.":"Il server ha risposto con il codice {statusCode}.","You can't upload files of this type.":"Non \u00e8 possibile caricare file di questo tipo.","File is too big ({size}MB). Max filesize: {max}MB.":"Il file \u00e8 troppo grande ({size} MB). Massima dimensione del file:  {max} MB.","Please use the fallback form below to upload your files like in the olden days.":"Utilizza il modulo qui sotto per caricare i file, come in passato.","Your browser does not support drag'n'drop file uploads.":"Il tuo browser non supporta il caricamento dei file con il sistema trascina e rilascia."};for(var a in _hzxt){window._hzlang[a]=_hzxt[a];}})();
/*************  End extracting text for dropzone.js  **************/
/************* Start dropzone.js for locale it-IT **************/
try {!function(){function a(b,c,d){var e=a.resolve(b);if(null==e){d=d||b,c=c||"root";var f=new Error('Failed to require "'+d+'" from "'+c+'"');throw f.path=d,f.parent=c,f.require=!0,f}var g=a.modules[e];return g.exports||(g.exports={},g.client=g.component=!0,g.call(this,g.exports,a.relative(e),g)),g.exports}a.modules={},a.aliases={},a.resolve=function(b){"/"===b.charAt(0)&&(b=b.slice(1));for(var c=[b,b+".js",b+".json",b+"/index.js",b+"/index.json"],d=0;d<c.length;d++){var b=c[d];if(a.modules.hasOwnProperty(b))return b;if(a.aliases.hasOwnProperty(b))return a.aliases[b]}},a.normalize=function(a,b){var c=[];if("."!=b.charAt(0))return b;a=a.split("/"),b=b.split("/");for(var d=0;d<b.length;++d)".."==b[d]?a.pop():"."!=b[d]&&""!=b[d]&&c.push(b[d]);return a.concat(c).join("/")},a.register=function(b,c){a.modules[b]=c},a.alias=function(b,c){if(!a.modules.hasOwnProperty(b))throw new Error('Failed to alias "'+b+'", it does not exist');a.aliases[c]=b},a.relative=function(b){function c(a,b){for(var c=a.length;c--;)if(a[c]===b)return c;return-1}function d(c){return a(d.resolve(c),b,c)}var e=a.normalize(b,"..");return d.resolve=function(d){var f=d.charAt(0);if("/"==f)return d.slice(1);if("."==f)return a.normalize(e,d);var g=b.split("/"),h=c(g,"deps")+1;return h||(h=0),d=g.slice(0,h+1).join("/")+"/deps/"+d},d.exists=function(b){return a.modules.hasOwnProperty(d.resolve(b))},d},a.register("component-emitter/index.js",function(a,b,c){function d(a){if(a)return e(a)}function e(a){for(var b in d.prototype)a[b]=d.prototype[b];return a}c.exports=d,d.prototype.on=function(a,b){return this._callbacks=this._callbacks||{},(this._callbacks[a]=this._callbacks[a]||[]).push(b),this},d.prototype.once=function(a,b){function c(){d.off(a,c),b.apply(this,arguments)}var d=this;return this._callbacks=this._callbacks||{},b._off=c,this.on(a,c),this},d.prototype.off=d.prototype.removeListener=d.prototype.removeAllListeners=function(a,b){this._callbacks=this._callbacks||{};var c=this._callbacks[a];if(!c)return this;if(1==arguments.length)return delete this._callbacks[a],this;var d=c.indexOf(b._off||b);return~d&&c.splice(d,1),this},d.prototype.emit=function(a){this._callbacks=this._callbacks||{};var b=[].slice.call(arguments,1),c=this._callbacks[a];if(c){c=c.slice(0);for(var d=0,e=c.length;d<e;++d)c[d].apply(this,b)}return this},d.prototype.listeners=function(a){return this._callbacks=this._callbacks||{},this._callbacks[a]||[]},d.prototype.hasListeners=function(a){return!!this.listeners(a).length}}),a.register("dropzone/index.js",function(a,b,c){c.exports=b("./lib/dropzone.js")}),a.register("dropzone/lib/dropzone.js",function(a,b,c){(function(){var a,d,e,f,g,h,i={}.hasOwnProperty,j=function(a,b){function c(){this.constructor=a}for(var d in b)i.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},k=[].slice;d="undefined"!=typeof Emitter&&null!==Emitter?Emitter:b("emitter"),g=function(){},a=function(a){function b(a,d){var e,f,g;if(this.element=a,this.version=b.version,this.defaultOptions.previewTemplate=this.defaultOptions.previewTemplate.replace(/\n*/g,""),this.clickableElements=[],this.listeners=[],this.files=[],"string"==typeof this.element&&(this.element=document.querySelector(this.element)),!this.element||null==this.element.nodeType)throw new Error("Invalid dropzone element.");if(this.element.dropzone)throw new Error("Dropzone already attached.");if(b.instances.push(this),a.dropzone=this,e=null!=(g=b.optionsForElement(this.element))?g:{},this.options=c({},this.defaultOptions,e,null!=d?d:{}),this.options.forceFallback||!b.isBrowserSupported())return this.options.fallback.call(this);if(null==this.options.url&&(this.options.url=this.element.getAttribute("action")),!this.options.url)throw new Error("No URL provided.");if(this.options.acceptedFiles&&this.options.acceptedMimeTypes)throw new Error("You can't provide both 'acceptedFiles' and 'acceptedMimeTypes'. 'acceptedMimeTypes' is deprecated.");this.options.acceptedMimeTypes&&(this.options.acceptedFiles=this.options.acceptedMimeTypes,delete this.options.acceptedMimeTypes),this.options.method=this.options.method.toUpperCase(),(f=this.getExistingFallback())&&f.parentNode&&f.parentNode.removeChild(f),this.options.previewsContainer?this.previewsContainer=b.getElement(this.options.previewsContainer,"previewsContainer"):this.previewsContainer=this.element,this.options.clickable&&(!0===this.options.clickable?this.clickableElements=[this.element]:this.clickableElements=b.getElements(this.options.clickable,"clickable")),this.init()}var c;j(b,a),b.prototype.events=["drop","dragstart","dragend","dragenter","dragover","dragleave","selectedfiles","addedfile","removedfile","thumbnail","storeVideoThumbnail","error","errormultiple","processing","processingmultiple","uploadprogress","totaluploadprogress","sending","sendingmultiple","success","successmultiple","canceled","canceledmultiple","complete","completemultiple","reset","maxfilesexceeded"];var d=0;return b.prototype.defaultOptions={url:null,method:"post",withCredentials:!1,parallelUploads:2,uploadMultiple:!1,maxFilesize:256,paramName:"file",createImageThumbnails:!0,maxThumbnailFilesize:10,maxVideoFileSize:5e4,thumbnailWidth:100,thumbnailHeight:100,maxFiles:null,params:{},clickable:!0,ignoreHiddenFiles:!0,acceptedFiles:null,acceptedMimeTypes:null,autoProcessQueue:!0,addRemoveLinks:!1,previewsContainer:null,dictDefaultMessage:_hgt("Drop files here to upload"),dictFallbackMessage:_hgt("Your browser does not support drag'n'drop file uploads."),dictFallbackText:_hgt("Please use the fallback form below to upload your files like in the olden days."),dictFileTooBig:_hgt("File is too big ({size}MB). Max filesize: {max}MB.",{"size:":"{{filesize}}",max:"{{maxFilesize}}"}),dictInvalidFileType:_hgt("You can't upload files of this type."),dictResponseError:_hgt("Server responded with {statusCode} code.",{statusCode:"{{statusCode}}"}),dictCancelUpload:_hgt("Cancel upload"),dictCancelUploadConfirmation:_hgt("Are you sure you want to cancel this upload?"),dictRemoveFile:_hgt("Remove file"),dictRemoveFileConfirmation:null,dictMaxFilesExceeded:_hgt("You can only upload {maxFilesAllowed} files.",{maxFilesAllowed:"{{maxFiles}}"}),dictVideoTooLong:_hgt("You can not upload videos longer than 600 seconds"),dictVideoTooShort:_hgt("You can not upload videos shorter than 15 seconds"),accept:function(a,b){return b()},init:function(){return g},forceFallback:!1,fallback:function(){var a,c,d,e,f,g;for(this.element.className=this.element.className+" dz-browser-not-supported",g=this.element.getElementsByTagName("div"),e=0,f=g.length;e<f;e++)a=g[e],/(^| )dz-message($| )/.test(a.className)&&(c=a,a.className="dz-message");return c||(c=b.createElement('<div class="dz-message"><span></span></div>'),this.element.appendChild(c)),d=c.getElementsByTagName("span")[0],d&&(d.textContent=this.options.dictFallbackMessage),this.element.appendChild(this.getFallbackForm())},resize:function(a){var b,c,d;return b={srcX:0,srcY:0,srcWidth:a.width,srcHeight:a.height},c=a.width/a.height,d=this.options.thumbnailWidth/this.options.thumbnailHeight,a.height<this.options.thumbnailHeight||a.width<this.options.thumbnailWidth?(b.trgHeight=b.srcHeight,b.trgWidth=b.srcWidth):c>d?(b.srcHeight=a.height,b.srcWidth=b.srcHeight*d):(b.srcWidth=a.width,b.srcHeight=b.srcWidth/d),b.srcX=(a.width-b.srcWidth)/2,b.srcY=(a.height-b.srcHeight)/2,b},drop:function(a){return d=0,this.element.classList.remove("dz-drag-hover")},dragstart:g,dragend:function(a){return this.element.classList.remove("dz-drag-hover")},dragenter:function(a){return a.preventDefault(),d++,this.element.classList.add("dz-drag-hover")},dragover:function(a){return this.element.classList.add("dz-drag-hover")},dragleave:function(a){if(0==--d)return this.element.classList.remove("dz-drag-hover")},selectedfiles:function(a){if(this.element===this.previewsContainer)return this.element.classList.add("dz-started")},reset:function(){return this.element.classList.remove("dz-started")},addedfile:function(a){var c=this;return a.previewElement=b.createElement(this.options.previewTemplate),a.previewTemplate=a.previewElement,this.previewsContainer.appendChild(a.previewElement),a.previewElement.querySelector("[data-dz-name]").textContent=a.name,a.previewElement.querySelector("[data-dz-size]").innerHTML=this.filesize(a.size),this.options.addRemoveLinks&&(a._removeLink=b.createElement('<a class="dz-remove" href="javascript:undefined;">'+this.options.dictRemoveFile+"</a>"),a._removeLink.addEventListener("click",function(d){return d.preventDefault(),d.stopPropagation(),a.status===b.UPLOADING?b.confirm(c.options.dictCancelUploadConfirmation,function(){return c.removeFile(a)}):c.options.dictRemoveFileConfirmation?b.confirm(c.options.dictRemoveFileConfirmation,function(){return c.removeFile(a)}):c.removeFile(a)}),a.previewElement.appendChild(a._removeLink)),this._updateMaxFilesReachedClass()},removedfile:function(a){var b;return null!=(b=a.previewElement)&&b.parentNode.removeChild(a.previewElement),this._updateMaxFilesReachedClass()},thumbnail:function(a,b){var c;return a.previewElement.classList.remove("dz-file-preview"),a.previewElement.classList.add("dz-image-preview"),c=a.previewElement.querySelector("[data-dz-thumbnail]"),c.alt=a.name,c.src=b},storeVideoThumbnail:function(a){window.sessionStorage&&this.videoThumbnail&&window.sessionStorage.setItem("hzVideoThumb-"+a,this.videoThumbnail)},error:function(a,b){return a.previewElement.classList.add("dz-error"),a.previewElement.querySelector("[data-dz-errormessage]").textContent=b},errormultiple:g,processing:function(a){if(a.previewElement.classList.add("dz-processing"),a._removeLink)return a._removeLink.textContent=this.options.dictCancelUpload},processingmultiple:g,uploadprogress:function(a,b,c){return a.previewElement.querySelector("[data-dz-uploadprogress]").style.width=b+"%"},totaluploadprogress:g,sending:g,sendingmultiple:g,success:function(a,b){return a.type.match("video")&&this.emit("storeVideoThumbnail",b.finalizeId),a.previewElement.classList.add("dz-success")},successmultiple:g,canceled:function(a){return this.emit("error",a,"Upload canceled.")},canceledmultiple:g,complete:function(a){if(a._removeLink)return a._removeLink.textContent=this.options.dictRemoveFile},completemultiple:g,maxfilesexceeded:g,previewTemplate:'<div class="dz-preview dz-file-preview">\n  <div class="dz-details">\n    <div class="dz-filename"><span data-dz-name></span></div>\n    <div class="dz-size" data-dz-size></div>\n    <img data-dz-thumbnail />\n  </div>\n  <div class="dz-progress"><span class="dz-upload" data-dz-uploadprogress></span></div>\n  <div class="dz-success-mark"><span>✔</span></div>\n  <div class="dz-error-mark"><span>✘</span></div>\n  <div class="dz-error-message"><span data-dz-errormessage></span></div>\n</div>'},c=function(){var a,b,c,d,e,f,g;for(d=arguments[0],c=2<=arguments.length?k.call(arguments,1):[],f=0,g=c.length;f<g;f++){b=c[f];for(a in b)e=b[a],d[a]=e}return d},b.prototype.getAcceptedFiles=function(){var a,b,c,d,e;for(d=this.files,e=[],b=0,c=d.length;b<c;b++)a=d[b],a.accepted&&e.push(a);return e},b.prototype.getRejectedFiles=function(){var a,b,c,d,e;for(d=this.files,e=[],b=0,c=d.length;b<c;b++)a=d[b],a.accepted||e.push(a);return e},b.prototype.getQueuedFiles=function(){var a,c,d,e,f;for(e=this.files,f=[],c=0,d=e.length;c<d;c++)a=e[c],a.status===b.QUEUED&&f.push(a);return f},b.prototype.getUploadingFiles=function(){var a,c,d,e,f;for(e=this.files,f=[],c=0,d=e.length;c<d;c++)a=e[c],a.status===b.UPLOADING&&f.push(a);return f},b.prototype.init=function(){var a,c,d,e,f,g,h,i=this;for("form"===this.element.tagName&&this.element.setAttribute("enctype","multipart/form-data"),this.element.classList.contains("dropzone")&&!this.element.querySelector(".dz-message")&&this.element.appendChild(b.createElement('<div class="dz-default dz-message"><span class="dz-message-text">'+this.options.dictDefaultMessage+"</span></div>")),this.clickableElements.length&&(d=function(){return i.hiddenFileInput&&document.body.removeChild(i.hiddenFileInput),i.hiddenFileInput=document.createElement("input"),i.hiddenFileInput.setAttribute("type","file"),i.hiddenFileInput.setAttribute("multiple","multiple"),null!=i.options.acceptedFiles&&i.hiddenFileInput.setAttribute("accept",i.options.acceptedFiles),i.hiddenFileInput.style.visibility="hidden",i.hiddenFileInput.style.position="absolute",i.hiddenFileInput.style.top="0",i.hiddenFileInput.style.left="0",i.hiddenFileInput.style.height="0",i.hiddenFileInput.style.width="0",document.body.appendChild(i.hiddenFileInput),i.hiddenFileInput.addEventListener("change",function(){var a;return a=i.hiddenFileInput.files,a.length&&(i.emit("selectedfiles",a),i.handleFiles(a)),d()})}),this.URL=null!=(g=window.URL)?g:window.webkitURL,h=this.events,e=0,f=h.length;e<f;e++)a=h[e],this.on(a,this.options[a]);return this.on("uploadprogress",function(){return i.updateTotalUploadProgress()}),this.on("removedfile",function(){return i.updateTotalUploadProgress()}),this.on("canceled",function(a){return i.emit("complete",a)}),c=function(a){return a.stopPropagation(),a.preventDefault?a.preventDefault():a.returnValue=!1},this.listeners=[{element:this.element,events:{dragstart:function(a){return i.emit("dragstart",a)},dragenter:function(a){return c(a),i.emit("dragenter",a)},dragover:function(a){return c(a),i.emit("dragover",a)},dragleave:function(a){return i.emit("dragleave",a)},drop:function(a){return c(a),i.drop(a)},dragend:function(a){return i.emit("dragend",a)}}}],this.clickableElements.forEach(function(a){return i.listeners.push({element:a,events:{click:function(c){if(a!==i.element||c.target===i.element||b.elementInside(c.target,i.element.querySelector(".dz-message")))return d(),i.hiddenFileInput.click()}}})}),this.enable(),this.options.init.call(this)},b.prototype.destroy=function(){var a;return this.disable(),this.removeAllFiles(!0),(null!=(a=this.hiddenFileInput)?a.parentNode:void 0)&&(this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput),this.hiddenFileInput=null),delete this.element.dropzone},b.prototype.updateTotalUploadProgress=function(){var a,b,c,d,e,f,g,h;if(d=0,c=0,a=this.getAcceptedFiles(),a.length){for(h=this.getAcceptedFiles(),f=0,g=h.length;f<g;f++)b=h[f],d+=b.upload.bytesSent,c+=b.upload.total;e=100*d/c}else e=100;return this.emit("totaluploadprogress",e,c,d)},b.prototype.getFallbackForm=function(){var a,c,d,e;return(a=this.getExistingFallback())?a:(d='<div class="dz-fallback">',this.options.dictFallbackText&&(d+="<p>"+this.options.dictFallbackText+"</p>"),d+='<input type="file" name="'+this.options.paramName+(this.options.uploadMultiple?"[]":"")+'" '+(this.options.uploadMultiple?'multiple="multiple"':void 0)+' /><button type="submit">Upload!</button></div>',c=b.createElement(d),"FORM"!==this.element.tagName?(e=b.createElement('<form action="'+this.options.url+'" enctype="multipart/form-data" method="'+this.options.method+'"></form>'),e.appendChild(c)):(this.element.setAttribute("enctype","multipart/form-data"),this.element.setAttribute("method",this.options.method)),null!=e?e:c)},b.prototype.getExistingFallback=function(){var a,b,c,d,e,f;for(b=function(a){var b,c,d;for(c=0,d=a.length;c<d;c++)if(b=a[c],/(^| )fallback($| )/.test(b.className))return b},f=["div","form"],d=0,e=f.length;d<e;d++)if(c=f[d],a=b(this.element.getElementsByTagName(c)))return a},b.prototype.setupEventListeners=function(){var a,b,c,d,e,f,g;for(f=this.listeners,g=[],d=0,e=f.length;d<e;d++)a=f[d],g.push(function(){var d,e;d=a.events,e=[];for(b in d)c=d[b],e.push(a.element.addEventListener(b,c,!1));return e}());return g},b.prototype.removeEventListeners=function(){var a,b,c,d,e,f,g;for(f=this.listeners,g=[],d=0,e=f.length;d<e;d++)a=f[d],g.push(function(){var d,e;d=a.events,e=[];for(b in d)c=d[b],e.push(a.element.removeEventListener(b,c,!1));return e}());return g},b.prototype.disable=function(){var a,b,c,d,e;for(this.clickableElements.forEach(function(a){return a.classList.remove("dz-clickable")}),this.removeEventListeners(),d=this.files,e=[],b=0,c=d.length;b<c;b++)a=d[b],e.push(this.cancelUpload(a));return e},b.prototype.enable=function(){return this.clickableElements.forEach(function(a){return a.classList.add("dz-clickable")}),this.setupEventListeners()},b.prototype.filesize=function(a){var b;return a>=1e11?(a/=1e11,b="TB"):a>=1e8?(a/=1e8,b="GB"):a>=1e5?(a/=1e5,b="MB"):a>=100?(a/=100,b="KB"):(a*=10,b="b"),"<strong>"+Math.round(a)/10+"</strong> "+b},b.prototype._updateMaxFilesReachedClass=function(){return this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?this.element.classList.add("dz-max-files-reached"):this.element.classList.remove("dz-max-files-reached")},b.prototype.drop=function(a){var b,c;a.dataTransfer&&(this.emit("drop",a),b=a.dataTransfer.files,this.emit("selectedfiles",b),b.length&&(c=a.dataTransfer.items,c&&c.length&&(null!=c[0].webkitGetAsEntry||null!=c[0].getAsEntry)?this.handleItems(c):this.handleFiles(b)))},b.prototype.handleFiles=function(a){var b,c,d,e;for(e=[],c=0,d=a.length;c<d;c++)b=a[c],e.push(this.addFile(b));return e},b.prototype.handleItems=function(a){var b,c,d,e;for(d=0,e=a.length;d<e;d++)c=a[d],null!=c.webkitGetAsEntry?(b=c.webkitGetAsEntry(),b.isFile?this.addFile(c.getAsFile()):b.isDirectory&&this.addDirectory(b,b.name)):this.addFile(c.getAsFile())},b.prototype.accept=function(a,c){return!a.type.match(/video.*/)&&a.size>1024*this.options.maxFilesize*1024?c(this.options.dictFileTooBig.replace("{{filesize}}",Math.round(a.size/1024/10.24)/100).replace("{{maxFilesize}}",this.options.maxFilesize)):a.type.match(/video.*/)&&a.size>1024*this.options.maxVideoFileSize*1024?c(this.options.dictFileTooBig.replace("{{filesize}}",Math.round(a.size/1024/10.24)/100).replace("{{maxFilesize}}",this.options.maxVideoFileSize)):b.isValidFile(a,this.options.acceptedFiles)?this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(c(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}",this.options.maxFiles)),this.emit("maxfilesexceeded",a)):this.options.accept.call(this,a,c):c(this.options.dictInvalidFileType)},b.prototype.addFile=function(a){var c=this;return a.upload={progress:0,total:a.size,bytesSent:0},this.files.push(a),a.status=b.ADDED,this.emit("addedfile",a),this.options.createImageThumbnails&&(a.type.match(/image.*/)&&a.size<=1024*this.options.maxThumbnailFilesize*1024||a.type.match(/video.*/)&&a.size<=1024*this.options.maxVideoFileSize*1024)&&this.createThumbnail(a),this.accept(a,function(b){return b?(a.accepted=!1,c._errorProcessing([a],b)):c.enqueueFile(a)})},b.prototype.enqueueFiles=function(a){var b,c,d;for(c=0,d=a.length;c<d;c++)b=a[c],this.enqueueFile(b);return null},b.prototype.enqueueFile=function(a){var c=this;if(a.accepted=!0,a.status!==b.ADDED)throw new Error("This file can't be queued because it has already been processed or was rejected.");if(a.status=b.QUEUED,this.options.autoProcessQueue)return setTimeout(function(){return c.processQueue()},1)},b.prototype.addDirectory=function(a,b){var c,d,e=this;return c=a.createReader(),d=function(c){var d,f;for(d=0,f=c.length;d<f;d++)a=c[d],a.isFile?a.file(function(a){if(!e.options.ignoreHiddenFiles||"."!==a.name.substring(0,1))return a.fullPath=b+"/"+a.name,e.addFile(a)}):a.isDirectory&&e.addDirectory(a,b+"/"+a.name)},c.readEntries(d,function(a){return"undefined"!=typeof console&&null!==console&&"function"==typeof console.log?console.log(a):void 0})},b.prototype.removeFile=function(a){if(a.status===b.UPLOADING&&this.cancelUpload(a),this.files=h(this.files,a),this.emit("removedfile",a),0===this.files.length)return this.emit("reset")},b.prototype.removeAllFiles=function(a){var c,d,e,f;for(null==a&&(a=!1),f=this.files.slice(),d=0,e=f.length;d<e;d++)c=f[d],(c.status!==b.UPLOADING||a)&&this.removeFile(c);return null},b.prototype.createThumbnail=function(a){var b,c=this;return b=new FileReader,b.onload=function(){var d;if(d=new Image,d.onload=function(){var b,e,f,g,h,i,j,k;return a.width=d.width,a.height=d.height,f=c.options.resize.call(c,a),null==f.trgWidth&&(f.trgWidth=c.options.thumbnailWidth),null==f.trgHeight&&(f.trgHeight=c.options.thumbnailHeight),b=document.createElement("canvas"),e=b.getContext("2d"),b.width=f.trgWidth,b.height=f.trgHeight,e.drawImage(d,null!=(h=f.srcX)?h:0,null!=(i=f.srcY)?i:0,f.srcWidth,f.srcHeight,null!=(j=f.trgX)?j:0,null!=(k=f.trgY)?k:0,f.trgWidth,f.trgHeight),g=b.toDataURL("image/png"),a.type.match("video")&&(c.videoThumbnail=g),c.emit("thumbnail",a,g)},!a.type.match("video"))return d.src=b.result;var e=new Blob([b.result],{type:a.type}),f=URL.createObjectURL(e),g=document.createElement("video"),h=function(){a.duration=g.duration,g.duration<15?(c.emit("error",a,c.options.dictVideoTooShort),g.removeEventListener("timeupdate",h),g.pause()):g.duration>600?(c.emit("error",a,c.options.dictVideoTooLong),g.removeEventListener("timeupdate",h),g.pause()):i()&&(g.removeEventListener("timeupdate",h),g.pause())};g.addEventListener("loadeddata",function(){a.duration=g.duration,g.duration<15?(c.emit("error",a,c.options.dictVideoTooShort),g.removeEventListener("timeupdate",h)):g.duration>600?(c.emit("error",a,c.options.dictVideoTooLong),g.removeEventListener("timeupdate",h)):i()&&g.removeEventListener("timeupdate",h)});var i=function(){var a=document.createElement("canvas");a.width=g.videoWidth,a.height=g.videoHeight,a.getContext("2d").drawImage(g,0,0,a.width,a.height);var b=a.toDataURL(),c=b.length>1e5;return c&&(d.src=b),c};g.addEventListener("timeupdate",h),g.preload="metadata",g.src=f,g.muted=!0,g.playsInline=!0,g.play()},a.type.match("image")?b.readAsDataURL(a):a.type.match("video")?b.readAsArrayBuffer(a):void 0},b.prototype.processQueue=function(){var a,b,c,d;if(b=this.options.parallelUploads,c=this.getUploadingFiles().length,a=c,!(c>=b)&&(d=this.getQueuedFiles(),d.length>0)){if(this.options.uploadMultiple)return this.processFiles(d.slice(0,b-c));for(;a<b;){if(!d.length)return;this.processFile(d.shift()),a++}}},b.prototype.processFile=function(a){return this.processFiles([a])},b.prototype.processFiles=function(a){var c,d,e;for(d=0,e=a.length;d<e;d++)c=a[d],c.processing=!0,c.status=b.UPLOADING,this.emit("processing",c);return this.options.uploadMultiple&&this.emit("processingmultiple",a),this.uploadFiles(a)},b.prototype._getFilesWithXhr=function(a){var b;return function(){var c,d,e,f;for(e=this.files,f=[],c=0,d=e.length;c<d;c++)b=e[c],b.xhr===a&&f.push(b);return f}.call(this)},b.prototype.cancelUpload=function(a){var c,d,e,f,g,h,i;if(a.status===b.UPLOADING){for(d=this._getFilesWithXhr(a.xhr),e=0,g=d.length;e<g;e++)c=d[e],c.status=b.CANCELED;for(a.xhr.abort(),f=0,h=d.length;f<h;f++)c=d[f],this.emit("canceled",c);this.options.uploadMultiple&&this.emit("canceledmultiple",d)}else(i=a.status)!==b.ADDED&&i!==b.QUEUED||(a.status=b.CANCELED,this.emit("canceled",a),this.options.uploadMultiple&&this.emit("canceledmultiple",[a]));if(this.options.autoProcessQueue)return this.processQueue()},b.prototype.uploadFile=function(a){return this.uploadFiles([a])},b.prototype.uploadFiles=function(a){var d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E=this;for(r=new XMLHttpRequest,s=0,w=a.length;s<w;s++)d=a[s],d.xhr=r;r.open(this.options.method,this.options.url,!0),r.withCredentials=!!this.options.withCredentials,o=null,f=function(){var b,c,e;for(e=[],b=0,c=a.length;b<c;b++)d=a[b],e.push(E._errorProcessing(a,o||E.options.dictResponseError.replace("{{statusCode}}",r.status),r));return e},p=function(b){var c,e,f,g,h,i,j,k,l;if(null!=b)for(e=100*b.loaded/b.total,f=0,i=a.length;f<i;f++)d=a[f],d.upload={progress:e,total:b.total,bytesSent:b.loaded};else{for(c=!0,e=100,g=0,j=a.length;g<j;g++)d=a[g],100===d.upload.progress&&d.upload.bytesSent===d.upload.total||(c=!1),d.upload.progress=e,d.upload.bytesSent=d.upload.total;if(c)return}for(l=[],h=0,k=a.length;h<k;h++)d=a[h],l.push(E.emit("uploadprogress",d,e,d.upload.bytesSent));return l},r.onload=function(c){var e;if(a[0].status!==b.CANCELED&&4===r.readyState){if(o=r.responseText,r.getResponseHeader("content-type")&&~r.getResponseHeader("content-type").indexOf("application/json"))try{o=JSON.parse(o)}catch(a){c=a,o="Invalid JSON response from server."}if(!o.reqUrl)return p(),200<=(e=r.status)&&e<300?E._finished(a,o,c):f();E.subjectId=o.projectId,E.viewSpaceUrl=o.viewSpaceUrl,HZ.uploadVideo&&HZ.uploadVideo.uploader&&HZ.uploadVideo.uploader.uploadVideoChunks(d,o,E._finished.bind(E),p)}},r.onerror=function(){if(a[0].status!==b.CANCELED)return f()},n=null!=(A=r.upload)?A:r,n.onprogress=p,i={Accept:"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"},this.options.headers&&c(i,this.options.headers);for(g in i)h=i[g],r.setRequestHeader(g,h);if(e=new FormData,this.options.params){B=this.options.params;for(m in B)q=B[m],e.append(m,q)}for(t=0,x=a.length;t<x;t++)d=a[t],this.emit("sending",d,r,e);if(this.options.uploadMultiple&&this.emit("sendingmultiple",a,r,e),"FORM"===this.element.tagName)for(C=this.element.querySelectorAll("input, textarea, select, button"),u=0,y=C.length;u<y;u++)j=C[u],k=j.getAttribute("name"),(!(l=j.getAttribute("type"))||"checkbox"!==(D=l.toLowerCase())&&"radio"!==D||j.checked)&&e.append(k,j.value);for(v=0,z=a.length;v<z;v++)d=a[v],d.type.match(/video.*/)?e.append(this.options.paramName+(this.options.uploadMultiple?"[]":""),new Blob,d.name.replace(/\.[^\/.]+$/,"")):e.append(this.options.paramName+(this.options.uploadMultiple?"[]":""),d,d.name);return HZ&&HZ.data&&HZ.data.CSRFToken&&(e.append("__ct",HZ.data.CSRFToken),e.append("_csrf",HZ.data.CSRFToken)),1===a.length&&(e.append("fileType",d.type),e.append("fileName",d.name),e.append("fileSize",d.size),d.type.match(/video.*/)&&(e.append("duration",d.duration),e.append("returnResult",1))),r.send(e)},b.prototype._finished=function(a,c,d){var e,f,g;for(f=0,g=a.length;f<g;f++)e=a[f],e.status=b.SUCCESS,this.emit("success",e,c,d),this.emit("complete",e);if(this.options.uploadMultiple&&(this.emit("successmultiple",a,c,d),this.emit("completemultiple",a)),this.options.autoProcessQueue)return this.processQueue()},b.prototype._errorProcessing=function(a,c,d){var e,f,g;for(f=0,g=a.length;f<g;f++)e=a[f],e.status=b.ERROR,this.emit("error",e,c,d),this.emit("complete",e);if(this.options.uploadMultiple&&(this.emit("errormultiple",a,c,d),this.emit("completemultiple",a)),this.options.autoProcessQueue)return this.processQueue()},b}(d),a.version="3.7.1",a.options={},a.optionsForElement=function(b){return b.id?a.options[e(b.id)]:void 0},a.instances=[],a.forElement=function(a){if("string"==typeof a&&(a=document.querySelector(a)),null==(null!=a?a.dropzone:void 0))throw new Error("No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone.");return a.dropzone},a.autoDiscover=!0,a.discover=function(){var b,c,d,e,f,g;for(document.querySelectorAll?d=document.querySelectorAll(".dropzone"):(d=[],b=function(a){var b,c,e,f;for(f=[],c=0,e=a.length;c<e;c++)b=a[c],/(^| )dropzone($| )/.test(b.className)?f.push(d.push(b)):f.push(void 0);return f},b(document.getElementsByTagName("div")),b(document.getElementsByTagName("form"))),g=[],e=0,f=d.length;e<f;e++)c=d[e],!1!==a.optionsForElement(c)?g.push(new a(c)):g.push(void 0);return g},a.blacklistedBrowsers=[/opera.*Macintosh.*version\/12/i],a.isBrowserSupported=function(){var b,c,d,e,f;if(b=!0,window.File&&window.FileReader&&window.FileList&&window.Blob&&window.FormData&&document.querySelector)if("classList"in document.createElement("a"))for(f=a.blacklistedBrowsers,d=0,e=f.length;d<e;d++)c=f[d],c.test(navigator.userAgent)&&(b=!1);else b=!1;else b=!1;return b},h=function(a,b){var c,d,e,f;for(f=[],d=0,e=a.length;d<e;d++)(c=a[d])!==b&&f.push(c);return f},e=function(a){return a.replace(/[\-_](\w)/g,function(a){return a.charAt(1).toUpperCase()})},a.createElement=function(a){var b;return b=document.createElement("div"),b.innerHTML=a,b.childNodes[0]},a.elementInside=function(a,b){if(a===b)return!0;for(;a=a.parentNode;)if(a===b)return!0;return!1},a.getElement=function(a,b){var c;if("string"==typeof a?c=document.querySelector(a):null!=a.nodeType&&(c=a),null==c)throw new Error("Invalid `"+b+"` option provided. Please provide a CSS selector or a plain HTML element.");return c},a.getElements=function(a,b){var c,d,e,f,g,h,i;if(a instanceof Array){d=[];try{for(e=0,g=a.length;e<g;e++)c=a[e],d.push(this.getElement(c,b))}catch(a){a,d=null}}else if("string"==typeof a)for(d=[],i=document.querySelectorAll(a),f=0,h=i.length;f<h;f++)c=i[f],d.push(c);else null!=a.nodeType&&(d=[a]);if(null==d||!d.length)throw new Error("Invalid `"+b+"` option provided. Please provide a CSS selector, a plain HTML element or a list of those.");return d},a.confirm=function(a,b,c){return window.confirm(a)?b():null!=c?c():void 0},a.isValidFile=function(a,b){var c,d,e,f,g,h;if(!b)return!0;for(b=b.split(","),d=a.type,c=d.replace(/\/.*$/,""),f=a.name.toLowerCase(),g=0,h=b.length;g<h;g++)if(e=b[g],e=e.trim(),"."===e.charAt(0)){if(-1!==f.indexOf(e,a.name.length-e.length))return!0}else if(/\/\*$/.test(e)){if(c===e.replace(/\/.*$/,""))return!0}else if(d===e)return!0;return!1},"undefined"!=typeof jQuery&&null!==jQuery&&(jQuery.fn.dropzone=function(b){return this.each(function(){return new a(this,b)})}),void 0!==c&&null!==c?c.exports=a:window.Dropzone=a,a.ADDED="added",a.QUEUED="queued",a.ACCEPTED=a.QUEUED,a.UPLOADING="uploading",a.PROCESSING=a.UPLOADING,a.CANCELED="canceled",a.ERROR="error",a.SUCCESS="success",f=function(a,b){var c,d,e,f,g,h,i,j,k;if(e=!1,k=!0,d=a.document,j=d.documentElement,c=d.addEventListener?"addEventListener":"attachEvent",i=d.addEventListener?"removeEventListener":"detachEvent",h=d.addEventListener?"":"on",f=function(c){if("readystatechange"!==c.type||"complete"===d.readyState)return("load"===c.type?a:d)[i](h+c.type,f,!1),!e&&(e=!0)?b.call(a,c.type||c):void 0},g=function(){try{j.doScroll("left")}catch(a){return a,void setTimeout(g,50)}return f("poll")},"complete"!==d.readyState){if(d.createEventObject&&j.doScroll){try{k=!a.frameElement}catch(a){}k&&g()}return d[c](h+"DOMContentLoaded",f,!1),d[c](h+"readystatechange",f,!1),a[c](h+"load",f,!1)}},a._autoDiscoverFunction=function(){if(a.autoDiscover)return a.discover()},f(window,a._autoDiscoverFunction)}).call(this)}),a.alias("component-emitter/index.js","dropzone/deps/emitter/index.js"),a.alias("component-emitter/index.js","emitter/index.js"),"object"==typeof exports?module.exports=a("dropzone"):"function"==typeof define&&define.amd?define(function(){return a("dropzone")}):this.Dropzone=a("dropzone")}();

window.hzmr.push("dropzone:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End dropzone.js  **************/
/************* Start home.js for locale it-IT **************/
try {HZ.ns("HZ.home"),HZ.home.Page=new function(){this.followSuggestedUser=function(a,b,c){var a=$(a),d=a.hasClass("following")?"u":"f";HZ.actions.Follow.updateFollow(d,b,null,function(b){b&&"true"==b.success&&(a.hasClass("following")?(a.text("Follow"),a.removeClass("following")):(a.addClass("following"),a.text("Following"))),"function"==typeof c&&c(b)})},this.dismissIntlBanner=function(a){setCookie(a,!0),$("#"+a).addClass("hidden")};var a=function(){$nextItem=$(".hp-follow .blockRow.hide").eq(0),$nextItem.fadeIn(),$nextItem.removeClass("hide")},b=function(){0==$(".hp-follow .blockRow").length&&$(".hp-follow").slideToggle()},c=function(c){c&&(c.slideToggle(function(){$(this).remove(),a(),b()}),HZ.ajaz.Suggestions.dismissSuggestions(c.data("id"),"user",function(a){a.success}))};$(".hp-follow").on("click",".pi-cross",function(a){a.preventDefault(),a.stopPropagation(),c($(this).parent())}),$(".feedContainer").on("click",".promote, .touch-promote, .save-button, .email-button",function(){HZ.spaceActions.handleButtonClick($(this),{isCobrand:!1,emailShareAfterSignup:HZ.home.emailShareAfterSignup})}),HZ.data.CurrentSessionUser||$(window).scroll(function(){var a=$("#unified-stories");a&&a.offset()&&$(window).scrollTop()>a.offset().top&&$("#openLightBoxTip").show()})};

window.hzmr.push("home:4069");
} catch (err) {HZ.utils.Logger.sendJsExceptionStackTrace(err)}

/*************  End home.js  **************/
