"use strict";function _defineProperty(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(e,t):void 0}}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,n=new Array(t);a<t;a++)n[a]=e[a];return n}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function toggleAriaExpanded(e){var t=e.attr("aria-expanded");e.attr("aria-expanded","true"==t?"false":"true")}function isValidEmail(e){return/^.+@[0-9a-z\-]+\.[0-9a-z\-]{2,}/i.test(e)}function cleanText(e){if(e&&"string"==typeof e){var t=e;return t=(t=(t=(t=t.normalize("NFD").replace(/[\u0300-\u036f]/g,"")).replace(/[\u2018\u2019\u201A\u201B\u2032\u2035]/g,"'")).replace(/[\u201C\u201D\u201E\u201F\u2033\u2036]/g,'"')).replace(/[^\x00-\x7F\xA0]/g,"?")}}var countrySelectize,stateSelectize,addressBookSelectize,addressTypeSelectize,shippingAddressTypeSelectize,addressAutoComplete,customerAddressAutoComplete,locationLookupSearch,customerLocationLookupSearch,findlocationLookupSearch,affiliateLocationSelectize,braintreePaymentAddressAutoComplete;!function(e){var t=function(l,z){"use strict";if(z.getElementsByClassName){var R,L,O=z.documentElement,c=l.Date,o=l.HTMLPictureElement,d="addEventListener",H="getAttribute",V=l[d],U=l.setTimeout,p=l.requestAnimationFrame||U,h=l.requestIdleCallback,q=/^picture$/i,r=["load","error","lazyincluded","_lazyloaded"],n={},Y=Array.prototype.forEach,W=function e(t,a){return n[a]||(n[a]=new RegExp("(\\s|^)"+a+"(\\s|$)")),n[a].test(t[H]("class")||"")&&n[a]},Z=function e(t,a){W(t,a)||t.setAttribute("class",(t[H]("class")||"").trim()+" "+a)},j=function e(t,a){var n;(n=W(t,a))&&t.setAttribute("class",(t[H]("class")||"").replace(n," "))},G=function e(t,a,n){var o=n?d:"removeEventListener";n&&e(t,a),r.forEach(function(e){t[o](e,a)})},Q=function e(t,a,n,o,r){var i=z.createEvent("Event");return n||(n={}),n.instance=R,i.initEvent(a,!o,!r),i.detail=n,t.dispatchEvent(i),i},K=function e(t,a){var n;!o&&(n=l.picturefill||L.pf)?(a&&a.src&&!t[H]("srcset")&&t.setAttribute("srcset",a.src),n({reevaluate:!0,elements:[t]})):a&&a.src&&(t.src=a.src)},J=function e(t,a){return(getComputedStyle(t,null)||{})[a]},i=function e(t,a,n){for(n=n||t.offsetWidth;n<L.minSize&&a&&!t._lazysizesWidth;){n=a.offsetWidth,a=a.parentNode}return n},X=function(){var n,o,a=[],r=[],i=a,s=function e(){var t=i;for(i=a.length?r:a,n=!0,o=!1;t.length;){t.shift()()}n=!1},e=function e(t,a){n&&!a?t.apply(this,arguments):(i.push(t),o||(o=!0,(z.hidden?U:p)(s)))};return e._lsFlush=s,e}(),ee=function e(a,t){return t?function(){X(a)}:function(){var e=this,t=arguments;X(function(){a.apply(e,t)})}},e=function e(t){var a,n=0,o=L.throttleDelay,r=L.ricTimeout,i=function e(){a=!1,n=c.now(),t()},s=h&&r>49?function(){h(i,{timeout:r}),r!==L.ricTimeout&&(r=L.ricTimeout)}:ee(function(){U(i)},!0);return function(e){var t;(e=e===!0)&&(r=33),a||(a=!0,t=o-(c.now()-n),0>t&&(t=0),e||9>t?s():U(s,t))}},te=function e(t){var a,n,o=99,r=function e(){a=null,t()},i=function e(){var t=c.now()-n;o>t?U(e,o-t):(h||r)(r)};return function(){n=c.now(),a||(a=U(i,o))}};!function(){var e,t={lazyClass:"lazyload",loadedClass:"lazyloaded",loadingClass:"lazyloading",preloadClass:"lazypreload",errorClass:"lazyerror",autosizesClass:"lazyautosizes",srcAttr:"data-src",srcsetAttr:"data-srcset",sizesAttr:"data-sizes",minSize:40,customMedia:{},init:!0,expFactor:1.5,hFac:.8,loadMode:2,loadHidden:!0,ricTimeout:0,throttleDelay:125};L=l.lazySizesConfig||l.lazysizesConfig||{};for(e in t){e in L||(L[e]=t[e])}l.lazySizesConfig=L,U(function(){L.init&&a()})}();var t=function(){var p,h,u,m,a,g,v,$,y,f,b,C,k,S,i=/^img$/i,A=/^iframe$/i,w="onscroll"in l&&!/(gle|ing)bot/.test(navigator.userAgent),P=0,_=0,E=0,N=-1,I=function e(t){E--,t&&t.target&&G(t.target,e),(!t||0>E||!t.target)&&(E=0)},M=function e(t,a){var n,o=t,r="hidden"==J(z.body,"visibility")||"hidden"!=J(t.parentNode,"visibility")&&"hidden"!=J(t,"visibility");for($-=a,b+=a,y-=a,f+=a;r&&(o=o.offsetParent)&&o!=z.body&&o!=O;){r=(J(o,"opacity")||1)>0,r&&"visible"!=J(o,"overflow")&&(n=o.getBoundingClientRect(),r=f>n.left&&y<n.right&&b>n.top-1&&$<n.bottom+1)}return r},t=function e(){var t,a,n,o,r,i,s,l,c,d=R.elements;if((m=L.loadMode)&&8>E&&(t=d.length)){a=0,N++,null==k&&("expand"in L||(L.expand=O.clientHeight>500&&O.clientWidth>500?500:370),C=L.expand,k=C*L.expFactor),k>_&&1>E&&N>2&&m>2&&!z.hidden?(_=k,N=0):_=m>1&&N>1&&6>E?C:P;for(;t>a;a++){if(d[a]&&!d[a]._lazyRace)if(w){if((l=d[a][H]("data-expand"))&&(i=1*l)||(i=_),c!==i&&(g=innerWidth+i*S,v=innerHeight+i,s=-1*i,c=i),n=d[a].getBoundingClientRect(),(b=n.bottom)>=s&&($=n.top)<=v&&(f=n.right)>=s*S&&(y=n.left)<=g&&(b||f||y||$)&&(L.loadHidden||"hidden"!=J(d[a],"visibility"))&&(h&&3>E&&!l&&(3>m||4>N)||M(d[a],i))){if(B(d[a]),r=!0,E>9)break}else!r&&h&&!o&&4>E&&4>N&&m>2&&(p[0]||L.preloadAfterLoad)&&(p[0]||!l&&(b||f||y||$||"auto"!=d[a][H](L.sizesAttr)))&&(o=p[0]||d[a])}else B(d[a])}o&&!r&&B(o)}},n=e(t),T=function e(t){Z(t.target,L.loadedClass),j(t.target,L.loadingClass),G(t.target,D),Q(t.target,"lazyloaded")},o=ee(T),D=function e(t){o({target:t.target})},x=function e(t,a){try{t.contentWindow.location.replace(a)}catch(e){t.src=a}},F=function e(t){var a,n=t[H](L.srcsetAttr);(a=L.customMedia[t[H]("data-media")||t[H]("media")])&&t.setAttribute("media",a),n&&t.setAttribute("srcset",n)},s=ee(function(e,t,a,n,o){var r,i,s,l,c,d;(c=Q(e,"lazybeforeunveil",t)).defaultPrevented||(n&&(a?Z(e,L.autosizesClass):e.setAttribute("sizes",n)),i=e[H](L.srcsetAttr),r=e[H](L.srcAttr),o&&(s=e.parentNode,l=s&&q.test(s.nodeName||"")),d=t.firesLoad||"src"in e&&(i||r||l),c={target:e},d&&(G(e,I,!0),clearTimeout(u),u=U(I,2500),Z(e,L.loadingClass),G(e,D,!0)),l&&Y.call(s.getElementsByTagName("source"),F),i?e.setAttribute("srcset",i):r&&!l&&(A.test(e.nodeName)?x(e,r):e.src=r),o&&(i||l)&&K(e,{src:r})),e._lazyRace&&delete e._lazyRace,j(e,L.lazyClass),X(function(){(!d||e.complete&&e.naturalWidth>1)&&(d?I(c):E--,T(c))},!0)}),B=function e(t){var a,n=i.test(t.nodeName),o=n&&(t[H](L.sizesAttr)||t[H]("sizes")),r="auto"==o;(!r&&h||!n||!t[H]("src")&&!t.srcset||t.complete||W(t,L.errorClass)||!W(t,L.lazyClass))&&(a=Q(t,"lazyunveilread").detail,r&&ae.updateElem(t,!0,t.offsetWidth),t._lazyRace=!0,E++,s(t,a,r,o,n))},r=function e(){if(!h){if(c.now()-a<999)return void U(e,999);var t=te(function(){L.loadMode=3,n()});h=!0,L.loadMode=3,n(),V("scroll",function(){3==L.loadMode&&(L.loadMode=2),t()},!0)}};return{_:function e(){a=c.now(),R.elements=z.getElementsByClassName(L.lazyClass),p=z.getElementsByClassName(L.lazyClass+" "+L.preloadClass),S=L.hFac,V("scroll",n,!0),V("resize",n,!0),l.MutationObserver?new MutationObserver(n).observe(O,{childList:!0,subtree:!0,attributes:!0}):(O[d]("DOMNodeInserted",n,!0),O[d]("DOMAttrModified",n,!0),setInterval(n,999)),V("hashchange",n,!0),["focus","mouseover","click","load","transitionend","animationend","webkitAnimationEnd"].forEach(function(e){z[d](e,n,!0)}),/d$|^c/.test(z.readyState)?r():(V("load",r),z[d]("DOMContentLoaded",n),U(r,2e4)),R.elements.length?(t(),X._lsFlush()):n()},checkElems:n,unveil:B}}(),ae=function(){var n,r=ee(function(e,t,a,n){var o,r,i;if(e._lazysizesWidth=n,n+="px",e.setAttribute("sizes",n),q.test(t.nodeName||""))for(o=t.getElementsByTagName("source"),r=0,i=o.length;i>r;r++){o[r].setAttribute("sizes",n)}a.detail.dataAttr||K(e,a.detail)}),o=function e(t,a,n){var e,o=t.parentNode;o&&(n=i(t,o,n),e=Q(t,"lazybeforesizes",{width:n,dataAttr:!!a}),e.defaultPrevented||(n=e.detail.width,n&&n!==t._lazysizesWidth&&r(t,o,e,n)))},e=function e(){var t,a=n.length;if(a)for(t=0;a>t;t++){o(n[t])}},t=te(e);return{_:function e(){n=z.getElementsByClassName(L.autosizesClass),V("resize",t)},checkElems:t,updateElem:o}}(),a=function e(){e.i||(e.i=!0,ae._(),t._())};return R={cfg:L,autoSizer:ae,loader:t,init:a,uP:K,aC:Z,rC:j,hC:W,fire:Q,gW:i,rAF:X}}}(e,e.document);e.lazySizes=t,"object"==("undefined"==typeof module?"undefined":_typeof(module))&&module.exports&&(module.exports=t)}(window),$(function(){0<$("#account-login-container").length&&($("#account-login-container #password").on("keypress.login",function(e){if(13===e.which)return e.stopPropagation(),$("#account-login-password-button").trigger("click"),!1}),$("#account-login-claim-button").on("click.send",function(e){e.preventDefault();var t=$('#account-login-username input[name="username"]').val();$.get("/scripts/account-create-send-email.cfm?gfRQV="+$("#rqv").val()+"&email="+t,function(e){showMessageModal("Email has been sent")})}),$("#account-login-create-button").on("click.send",function(e){e.preventDefault();var t=$('#account-login-username input[name="username"]').val();$.get("/scripts/account-create-send-email.cfm?gfRQV="+$("#rqv").val()+"&email="+t,function(e){showMessageModal("Email has been sent")})}),$(".account-forgot-password-link").on("click.send",function(e){e.preventDefault();var t=$('#account-login-username input[name="username"]').val();$.post("/scripts/send-forgot-password-email.cfm","gfRQV="+encodeURIComponent($("#rqv").val())+"&memEmail="+encodeURIComponent(t),function(e){if(!e.SUCCESS)return e.RELOAD?showMessageModal(e.MESSAGE,"Error","Close",[],"/account/login/"):showMessageModal(e.MESSAGE),!1;showMessageModal("Email has been sent")},"json")}),$("#account-send-login-link").on("click.send",function(e){e.preventDefault();var t=$('#account-login-username input[name="username"]').val();$.post("/scripts/account-send-login-link.cfm","gfRQV="+encodeURIComponent($("#rqv").val())+"&memEmail="+encodeURIComponent(t),function(e){if(!e.SUCCESS)return showMessageModal(e.MESSAGE),!1;showMessageModal("Email has been sent")},"json")}))}),$(function(){0<$("#account-profile-form").length&&$("#account-profile-form").on("submit.validate",function(e){var t=[];if(0<$("#memNewPassword").val().length&&$("#memNewPassword").val()!==$("#memConfirmNewPassword").val()&&t.push("Password and confirm must match.\n"),0<t.length)return showFormErrors(t),!1})}),$(function(){$(".config-selects select").on("change",function(e){var a=$(this).find(":selected").val(),t=$(this).data("addid"),n=$("picture[data-addid="+t+"]").attr("hidden","true");$.each(n,function(e,t){$(t).data("optid")==a&&$("picture[data-optid="+a+"]").removeAttr("hidden")})})});var addressBookHasCart=!1;function addressbookCartRecipientCallback(e,t){var a={};t[e]&&(a.firstName=t[e].SHIFNAME,a.lastName=t[e].SHILNAME,a.addressType=t[e].SHIADDRESSTYPE,a.addressName="",a.street=t[e].SHIADDRESS1,0<t[e].SHIADDRESS2.length&&(a.street=a.street+" "+t[e].SHIADDRESS2),a.company=t[e].SHICOMPANY,a.otherInfo=t[e].SHIADDRESSOTHERINFO,a.city=t[e].SHICITY,a.state=t[e].SHISTATE,a.zip=t[e].SHIZIP,a.country=t[e].SHICOUNTRY,a.phone=t[e].SHIPHONE),setRecipientAddress(a)}function addressbookCheckoutCallback(e,t){var a={};t[e]&&(a.firstName=t[e].SHIFNAME,a.lastName=t[e].SHILNAME,a.addressType=t[e].SHIADDRESSTYPE,a.addressName="",a.street=t[e].SHIADDRESS1,a.street2=t[e].SHIADDRESS2,a.company=t[e].SHICOMPANY,a.otherInfo=t[e].SHIADDRESSOTHERINFO,a.city=t[e].SHICITY,a.state=t[e].SHISTATE,a.zip=t[e].SHIZIP,a.country=t[e].SHICOUNTRY,a.phone=t[e].SHIPHONE),setBillingAddress(a)}function addressbookPaymentCallback(e,t){var a={};t[e]&&(a.firstName=t[e].SHIFNAME,a.lastName=t[e].SHILNAME,a.addressType=t[e].SHIADDRESSTYPE,a.addressName="",a.street=t[e].SHIADDRESS1,a.street2=t[e].SHIADDRESS2,a.company=t[e].SHICOMPANY,a.otherInfo=t[e].SHIADDRESSOTHERINFO,a.city=t[e].SHICITY,a.state=t[e].SHISTATE,a.zip=t[e].SHIZIP,a.country=t[e].SHICOUNTRY,a.phone=t[e].SHIPHONE),setPaymentBillingAddress(a)}function setFindAddress(e){(e=void 0!==e?e:{}).addressType&&$("#findAddressType").html(e.addressType),e.addressName&&$("#findlocationsearch").html(e.addressName),e.street&&$("#findAddress1").html(e.street),e.company&&$("#findCompany").html(e.company),e.city&&$("#findCity").html(e.city),e.zip&&$("#findZip").html(e.zip),e.zip&&$("#zipForLocalization").val(e.zip),e.state&&$("#findState").html(e.state),$("#findAddress").show()}function setRecipientAddress(e,t){if(t&&delete e.otherInfo,(e=void 0!==e?e:{}).country){switch(e.country){case"United States":case"USA":e.country="US";break;case"Canada":e.country="CA"}0<$("#corCountry").length&&countrySelectize.getValue()!==e.country&&countrySelectize.setValue(e.country)}else countrySelectize.setValue("");e.firstName&&$("#paf1").val(e.firstName),e.lastName&&$("#paf2").val(e.lastName),e.addressType&&0<$("#corAddressType").length&&addressTypeSelectize.getValue()!==e.addressType&&addressTypeSelectize.setValue(e.addressType),e.otherInfo?$("#corAddressOtherInfo").val(e.otherInfo).trigger("change"):t||$("#corAddressOtherInfo").val("").trigger("change"),e.street&&$("#corAddress").val(e.street).trigger("change"),e.company?$("#corCompany").val(e.company).trigger("change"):$("#corCompany").val("").trigger("change"),e.city?$("#corCity").val(e.city).trigger("change"):$("#corCity").val("").trigger("change"),e.zip?$("#corZip").val(e.zip).trigger("change"):$("#corZip").val("").trigger("change"),e.phone&&0<e.phone.length&&$("#corPhone").val(e.phone).trigger("change"),e.state?0<$("#corState").length&&stateSelectize.getValue()!==e.state&&stateSelectize.setValue(e.state):0<$("#corState").length&&stateSelectize.setValue(""),e.placeID&&0<$("#corGooglePlacesID").length&&$("#corGooglePlacesID").val(e.placeID).trigger("change"),"function"==typeof processNotifications&&processNotifications()}function setBillingAddress(e){if((e=void 0!==e?e:{}).country){switch(e.country){case"United States":e.country="US";break;case"Canada":e.country="CA"}$("#carCountry").val(e.country).trigger("change")}else $("#carCountry").val("").trigger("change");e.firstName&&$("#carFName").val(e.firstName).trigger("change"),e.lastName&&$("#carLName").val(e.lastName).trigger("change"),e.street?$("#carAddress1").val(e.street).trigger("change"):$("#carAddress1").val("").trigger("change"),e.street2?$("#carAddress2").val(e.street2).trigger("change"):$("#carAddress2").val("").trigger("change"),e.company?$("#carCompany").val(e.company).trigger("change"):$("#carCompany").val("").trigger("change"),e.city?$("#carCity").val(e.city).trigger("change"):$("#carCity").val("").trigger("change"),e.zip?$("#carZip").val(e.zip).trigger("change"):$("#carZip").val("").trigger("change"),e.state?$("#carState").val(e.state).trigger("change"):$("#carState").val("").trigger("change")}function setPaymentBillingAddress(e){if(e=void 0!==e?e:{},0<$("#carBraintreePaymentCountry").length)if(e.country){switch(e.country){case"United States":e.country="US";break;case"Canada":e.country="CA"}$("#carBraintreePaymentCountry").val(e.country).trigger("change")}else $("#carBraintreePaymentCountry").val("").trigger("change");0<$("#carBraintreePaymentFName").length&&e.firstName&&$("#carBraintreePaymentFName").val(e.firstName).trigger("change"),0<$("#carBraintreePaymentLName").length&&e.lastName&&$("#carBraintreePaymentLName").val(e.lastName).trigger("change"),0<$("#carBraintreePaymentAddress1").length&&(e.street?$("#carBraintreePaymentAddress1").val(e.street).trigger("change"):$("#carBraintreePaymentAddress1").val("").trigger("change")),0<$("#carBraintreePaymentAddress2").length&&(e.street2?$("#carBraintreePaymentAddress2").val(e.street2).trigger("change"):$("#carBraintreePaymentAddress2").val("").trigger("change")),0<$("#carBraintreePaymentCompany").length&&(e.company?$("#carBraintreePaymentCompany").val(e.company).trigger("change"):$("#carBraintreePaymentCompany").val("").trigger("change")),0<$("#carBraintreePaymentCity").length&&(e.city?$("#carBraintreePaymentCity").val(e.city).trigger("change"):$("#carBraintreePaymentCity").val("").trigger("change")),0<$("#carBraintreePaymentZip").length&&(e.zip?$("#carBraintreePaymentZip").val(e.zip).trigger("change"):$("#carBraintreePaymentZip").val("").trigger("change")),0<$("#carBraintreePaymentState").length&&(e.state?$("#carBraintreePaymentState").val(e.state).trigger("change"):$("#carBraintreePaymentState").val("").trigger("change"))}function setAddressTypeFields(t){$("#corCompany").removeClass("required"),$("#corAddressOtherInfo").removeClass("required");var e=deliveryAddressTypes.find(function(e){return e.title==t});e?($("div.address-type-toggle").show(),e.info1&&0<e.info1.length?($('label[for="corCompany"]').html(e.info1),$("#company-container").val("").show(),1===e.info1Required&&$("#corCompany").addClass("required")):($("#company-container").val("").hide(),$('label[for="corCompany"]').html("N/A")),e.info2&&0<e.info2.length?($('label[for="corAddressOtherInfo"]').html(e.info2),$("#other-info-container").val("").show(),1===e.info2Required&&$("#corAddressOtherInfo").addClass("required")):($("#other-info-container").val("").hide(),$('label[for="corAddressOtherInfo"]').html("N/A")),1===e.showSearch?($("#locationsearchgroup").show(),$("#locationsearchgroup input").attr("placeholder","Search by "+e.title+" Name")):($("#locationsearch").val(""),$("#locationsearchgroup").hide()),1===e.hasDName?($("#paf3").length&&$("#paf1").length&&$("#paf3").val().length<1&&$("#paf3").val($("#paf1").val()),$("#paf4").length&&$("#paf2").length&&$("#paf4").val().length<1&&$("#paf4").val($("#paf2").val()),$("div.funeral-home-toggle").show()):($("div.funeral-home-toggle").hide().find("input").val(""),$("#paf3").length&&$("#paf3").val(""),$("#paf4").length&&$("#paf4").val(""))):($('label[for="corCompany"]').html("N/A"),$("#company-container").val("").hide(),$('label[for="corAddressOtherInfo"]').html("N/A"),$("#other-info-container").val("").hide(),$("#locationsearchgroup").show(),$("#locationsearchgroup input").attr("placeholder","Search by Location Name"),$("div.address-type-toggle").hide(),$("div.funeral-home-toggle").hide(),$("#paf3").length&&$("#paf3").val(""),$("#paf4").length&&$("#paf4").val(""))}function setShippingAddressTypeFields(e){switch($("#shiCompany").removeClass("required"),$("#shiAddressOtherInfo").removeClass("required"),e){case"Residence":$("div.address-type-toggle").show(),$('label[for="shiCompany"]').html("Neighborhood"),$("#company-container").val("").show(),$('label[for="shiAddressOtherInfo"]').html("N/A"),$("#other-info-container").val("").hide();break;case"Apartment":$("div.address-type-toggle").show(),$('label[for="shiCompany"]').html("Apt Complex"),$("#company-container").val("").show(),$('label[for="shiAddressOtherInfo"]').html("Apt Number"),$("#other-info-container").val("").show(),$("#corAddressOtherInfo").addClass("required");break;case"Business":$("div.address-type-toggle").show(),$('label[for="shiCompany"]').html("Company"),$("#company-container").val("").show(),$('label[for="shiAddressOtherInfo"]').html("Hours"),$("#other-info-container").val("").show(),$("#corCompany").addClass("required");break;case"Hospital":$("div.address-type-toggle").show(),$('label[for="shiCompany"]').html("Hospital"),$("#company-container").val("").show(),$('label[for="shiAddressOtherInfo"]').html("Room Number"),$("#other-info-container").val("").show(),$("#corCompany").addClass("required");break;case"Funeral Home":$("div.address-type-toggle").show(),$('label[for="shiCompany"]').html("Funeral Home"),$("#company-container").val("").show(),$('label[for="shiAddressOtherInfo"]').html("Visitation Time"),$("#other-info-container").val("").show(),$("#corCompany").addClass("required");break;case"Church":$("div.address-type-toggle").show(),$('label[for="shiCompany"]').html("Church"),$("#company-container").val("").show(),$('label[for="shiAddressOtherInfo"]').html("Service Time"),$("#other-info-container").val("").show(),$("#corCompany").addClass("required");break;case"School":$("div.address-type-toggle").show(),$('label[for="shiCompany"]').html("School"),$("#company-container").val("").show(),$('label[for="shiAddressOtherInfo"]').html("N/A"),$("#other-info-container").val("").hide(),$("#corCompany").addClass("required");break;case"Other":$("div.address-type-toggle").show(),$('label[for="shiCompany"]').html("Company"),$("#company-container").val("").show(),$('label[for="shiAddressOtherInfo"]').html("N/A"),$("#other-info-container").val("").hide();break;default:$('label[for="shiCompany"]').html("N/A"),$("#company-container").val("").hide(),$('label[for="shiAddressOtherInfo"]').html("N/A"),$("#other-info-container").val("").hide()}}function parseGoogleAddress(e){var t=new Object,a=new Object;if(e.name&&(a.addressName=e.name,a.company=e.name),e.place_id&&(a.placeID=e.place_id),e.formatted_phone_number?a.phone=e.formatted_phone_number:a.phone="",Array.isArray(e.address_components))for(var n=0;n<e.address_components.length;n++)switch(e.address_components[n].types[0]){case"street_number":t.street_number=e.address_components[n].short_name;break;case"route":t.route=e.address_components[n].short_name;break;case"locality":t.locality=e.address_components[n].long_name;break;case"administrative_area_level_1":t.state=e.address_components[n].short_name;break;case"administrative_area_level_2":t.administrative_area_level_2=e.address_components[n].long_name;break;case"subpremise":t.subpremise=e.address_components[n].short_name;break;case"neighborhood":t.neighborhood=e.address_components[n].long_name;break;case"country":t.country_long=e.address_components[n].long_name,t.country_short=e.address_components[n].long_name;break;case"postal_code":t.postal_code=e.address_components[n].long_name;break;case"postal_code_suffix":t.postal_code_suffix=e.address_components[n].long_name}return a.street="",t.street_number&&(a.street+=" "+t.street_number),t.route&&(a.street+=" "+t.route),t.subpremise&&(a.street+=" "+t.subpremise),t.locality?a.city=t.locality:t.neighborhood&&(a.city=t.neighborhood),a.state=t.state,t.country_short?a.country=t.country_short:a.country=siteCountry,t.postal_code&&(a.zip=t.postal_code),cleanupGooglePlacesAddress(a)}function setupCustomerLocationLookupSearch(){(customerLocationLookupSearch=new google.maps.places.Autocomplete($("#customerlocationsearch").get(0),{types:["establishment"]})).setFields(["address_components","adr_address","name","place_id","types","url","website","formatted_phone_number"]),customerLocationLookupSearch.setComponentRestrictions({country:["us","ca"]}),google.maps.event.addListener(customerLocationLookupSearch,"place_changed",function(e){setBillingAddress(parseGoogleAddress(this.getPlace()));try{gtag("event","place_changed",{event_label:"location search",event_category:"googleapi"})}catch(e){}}),$("#customerlocationsearch").off("keypress.noenter").on("keypress.noenter",function(e){13===e.which&&e.preventDefault()})}function setupCustomerAddressAutoComplete(){(customerAddressAutoComplete=new google.maps.places.Autocomplete($("#carAddress1").get(0),{types:["address"]})).setFields(["address_components","adr_address","name","place_id","types","url","website","formatted_phone_number"]),customerAddressAutoComplete.setComponentRestrictions({country:["us","ca"]}),google.maps.event.addListener(customerAddressAutoComplete,"place_changed",function(e){var t=parseGoogleAddress(this.getPlace());delete t.addressName,delete t.company,setBillingAddress(t);try{gtag("event","place_changed",{event_label:"cart address",event_category:"googleapi"})}catch(e){}}),$("#carAddress1").off("keypress.noenter").on("keypress.noenter",function(e){13===e.which&&e.preventDefault()})}function setupBraintreePaymentAddressAutoComplete(){(braintreePaymentAddressAutoComplete=new google.maps.places.Autocomplete($("#carBraintreePaymentAddress1").get(0),{types:["address"]})).setFields(["address_components","adr_address","name","place_id","types","url","website","formatted_phone_number"]),braintreePaymentAddressAutoComplete.setComponentRestrictions({country:["us","ca"]}),google.maps.event.addListener(braintreePaymentAddressAutoComplete,"place_changed",function(e){var t=parseGoogleAddress(this.getPlace());delete t.addressName,delete t.company,setPaymentBillingAddress(t);try{gtag("event","place_changed",{event_label:"payment address",event_category:"googleapi"})}catch(e){}}),$("#carBraintreePaymentAddress1").off("keypress.noenter").on("keypress.noenter",function(e){13===e.which&&e.preventDefault()})}function setupAddressAutoComplete(){(addressAutoComplete=new google.maps.places.Autocomplete($("#corAddress").get(0),{types:["address"]})).setFields(["address_components","adr_address","name","place_id","types","url","website","formatted_phone_number"]),addressAutoComplete.setComponentRestrictions({country:["us","ca"]}),google.maps.event.addListener(addressAutoComplete,"place_changed",function(e){var t=parseGoogleAddress(this.getPlace());delete t.addressName,delete t.company,delete t.otherInfo,setRecipientAddress(t,!0);try{gtag("event","place_changed",{event_label:"recipient address",event_category:"googleapi"})}catch(e){}}),$("#corAddress").on("keypress.noenter",function(e){13===e.which&&e.preventDefault()})}function setupFindLocationLookupSearch(){(findlocationLookupSearch=new google.maps.places.Autocomplete($("#findlocationsearch").get(0),{types:["establishment"]})).setFields(["address_components","adr_address","name","place_id","types","url","website","formatted_phone_number"]),findlocationLookupSearch.setComponentRestrictions({country:["us","ca"]}),google.maps.event.addListener(findlocationLookupSearch,"place_changed",function(e){setFindAddress(parseGoogleAddress(this.getPlace()));try{gtag("event","place_changed",{event_label:"find address",event_category:"googleapi"})}catch(e){}})}function setupLocationLookupSearch(){(locationLookupSearch=new google.maps.places.Autocomplete($("#locationsearch").get(0),{types:["establishment"]})).setFields(["address_components","adr_address","name","place_id","types","url","website","formatted_phone_number"]),locationLookupSearch.setComponentRestrictions({country:["us","ca"]}),google.maps.event.addListener(locationLookupSearch,"place_changed",function(e){setRecipientAddress(parseGoogleAddress(this.getPlace()),!0);try{gtag("event","place_changed",{event_label:"location search",event_category:"googleapi"})}catch(e){}}),$("#locationsearch").on("keypress.noenter",function(e){13===e.which&&e.preventDefault()})}function selectizeAddressFields(){var e,t,a;$("#corCountry").length&&(e=$("#corCountry").data("selected"),countrySelectize=$("#corCountry").selectize({create:!1,maxItems:1,valueField:"value",labelField:"label",searchField:["label"],options:countryList,onChange:function(e){var t;stateSelectize&&(t=stateSelectize.getValue(),stateSelectize.clearOptions(),"CA"===e?($('label[for="corState-selectized"], label[for="corState"]').html("Province"),stateSelectize.addOption(regionList)):($('label[for="corState-selectized"], label[for="corState"]').html("State"),stateSelectize.addOption(stateList)),stateSelectize.setValue(t))}})[0].selectize),$("#corState").length&&(t=$("#corState").data("selected"),a=stateList,"CA"===$("#corCountry").data("selected")&&(a=regionList,$('label[for="corState"]').html("Province")),stateSelectize=$("#corState").selectize({create:!1,maxItems:1,valueField:"value",labelField:"label",searchField:["label"],options:a})[0].selectize),$("#corAddressType").length&&(setAddressTypeFields($("#corAddressType").val()),addressTypeSelectize=$("#corAddressType").selectize({onChange:function(e){setAddressTypeFields(e)}})[0].selectize),$("#corCountry").length&&(e.length?countrySelectize.setValue(e):countrySelectize.trigger("change")),$("#corState").length&&(t.length?stateSelectize.setValue(t):stateSelectize.trigger("change")),$("#shiCountry").length&&(e=$("#shiCountry").data("selected"),countrySelectize=$("#shiCountry").selectize({create:!1,maxItems:1,valueField:"value",labelField:"label",searchField:["label"],options:countryList,onChange:function(e){var t;stateSelectize&&(t=stateSelectize.getValue(),stateSelectize.clearOptions(),"CA"===e?($('label[for="shiState-selectized"], label[for="shiState"]').html("Province"),stateSelectize.addOption(regionList)):($('label[for="shiState-selectized"], label[for="shiState"]').html("State"),stateSelectize.addOption(stateList)),stateSelectize.setValue(t))}})[0].selectize),$("#shiState").length&&(t=$("#shiState").data("selected"),a=stateList,"CA"===$("#shiCountry").data("selected")&&(a=regionList,$('label[for="shiState"]').html("Province")),stateSelectize=$("#shiState").selectize({create:!1,maxItems:1,valueField:"value",labelField:"label",searchField:["label"],options:a})[0].selectize),$("#shiAddressType").length&&(setShippingAddressTypeFields($("#shiAddressType").val()),shippingAddressTypeSelectize=$("#shiAddressType").selectize({onChange:function(e){setShippingAddressTypeFields(e)}})[0].selectize),$("#shiCountry").length&&(e.length?countrySelectize.setValue(e):countrySelectize.trigger("change")),$("#shiState").length&&(t.length?stateSelectize.setValue(t):stateSelectize.trigger("change"))}$(function(){var e,t=Selectize.prototype.setup;Selectize.prototype.setup=function(){t.call(this),this.$input[0].attributes.readonly&&this.$control_input.prop("readonly",!0)},$("#showaddressbook").length&&($("#showaddressbook").on("click.addressbook",function(e){var n=$("#showaddressbook").html();$("#showaddressbook").html("Loading Address Book..."),$.get("/scripts/member-addressbook.json.cfm",function(e){if(e.length<1)return 0<$("#order-cart-container").length?$("#showaddressbook").html("Address Book is Empty"):($("#showaddressbook").html(n).hide(),showMessageModal("Address Book is Empty")),!1;var t=$("#addressbook").data("callback"),a=$("#addressbook").data("selected");try{addressBookSelectize.destroy()}catch(e){}addressBookSelectize=$("#addressbook").selectize({create:!1,maxItems:1,valueField:"SHIID",labelField:"LABEL",searchField:["SHIFNAME","SHILNAME","SHICOMPANY","SHICITY","SHIADDRESS1"],options:e,optgroups:[{groupName:"cart",groupLabel:"Current Recipients"},{groupName:"addressbook",groupLabel:"Address Book"}],optgroupField:"GROUP",optgroupLabelField:"groupLabel",optgroupValueField:"groupName",render:{option:function(e,t){var a='<div class="option">';return a+='<span class="addressbook-name">'+t(e.SHIFNAME)+" "+t(e.SHILNAME)+'</span> <small class="addressbook-address">'+t(e.SHIADDRESS1)+" "+t(e.SHIADDRESS2)+"</small> </div>"}},onChange:function(e){window[t](e,this.options)}})[0].selectize,$("#showaddressbook").hide(),$("#addressbookcontainer").show(),void 0!==a&&addressBookSelectize.setValue(a)},"json").fail(function(e){$("#showaddressbook").html(n),showMessageModal("We could not load your address book, please try again")})}),!0===$("#showaddressbook").data("autoshow")&&$("#showaddressbook").trigger("click")),$("#recipient-name-save-button").length&&$("#recipient-name-save-button").on("click.setname",function(e){var t=[];if(e.preventDefault(),$("#paf1").val().length<1&&t.push("Recipient First Name"),$("#paf2").val().length<1&&t.push("Recipient Last Name"),0<t.length)return showFormErrors(t),!1;$("#paf1-display").val($("#paf1").val()).attr({disabled:!0,readonly:!0}).show(),$("#paf2-display").val($("#paf2").val()).attr({disabled:!0,readonly:!0}).show(),$("#paf1, #paf2").attr("readonly",!0),$("#recipient-name-save-div, #paf1, #paf2").hide(),$("#recipient-name-edit-div").show(),$("#recipient-location-section").removeClass("config-mask")}),$("#recipient-name-edit-link").length&&$("#recipient-name-edit-link").on("click.setname",function(e){$("#paf1-display").attr({disabled:!1,readonly:!1}).val("").hide(),$("#paf2-display").attr({disabled:!1,readonly:!1}).val("").hide(),$("#paf1, #paf2").attr("readonly",!1),$("#recipient-name-save-div, #paf1, #paf2").show(),$("#recipient-name-edit-div").hide(),$("#recipient-location-section").addClass("config-mask")}),selectizeAddressFields(),$("#account-addressbook-form").on("submit.validate",function(e){var t=[];switch(shippingAddressTypeSelectize.getValue().length<1&&t.push("Address Type\n"),$("#shiFName").val().length<1&&t.push("Recipient First Name"),$("#shiLName").val().length<1&&t.push("Recipient Last Name"),$("#shiAddress1").val().length<1&&t.push("Street Address"),$("#shiCity").val().length<1&&t.push("City"),$("#shiState_actual").val(stateSelectize.getValue()),stateSelectize.getValue().length<1&&t.push("State"),$("#shiZip").val().length<1&&t.push("Postal Code"),$("#shiCountry_actual").val(countrySelectize.getValue()),countrySelectize.getValue().length<1&&t.push("Country"),$("#shiPhone").hasClass("required")&&$("#shiPhone").val().length<1&&t.push("Phone"),shippingAddressTypeSelectize.getValue()){case"Funeral Home":$("#shiCompany").val().length<1&&t.push("Funeral Home");break;case"Apartment":$("#shiAddressOtherInfo").val().length<1&&t.push("Apartment Number");break;case"Business":$("#shiCompany").val().length<1&&t.push("Company");break;case"Hospital":$("#shiCompany").val().length<1&&t.push("Hospital")}if(0<t.length)return showFormErrors(t),!1}),$("#ealID").length&&(e=$("#ealID").data("selected"),affiliateLocationSelectize=$("#ealID").selectize({onChange:function(e){setRecipientAddress(this.options[e],!0)}})[0].selectize,0<e&&affiliateLocationSelectize.setValue(e)),$("#findlocationsearch").length&&($("#findAddress").hide(),setupFindLocationLookupSearch()),$("#corAddress").length&&$("#locationsearch").length&&setupAddressAutoComplete(),$("#carAddress1").length&&!$("#carAddress1").hasClass("nolookup")&&setupCustomerAddressAutoComplete(),0<$("#carBraintreePaymentAddress1").length&&!$("#carBraintreePaymentAddress1").hasClass("nolookup")&&setupBraintreePaymentAddressAutoComplete(),$("#locationsearch").length&&setupLocationLookupSearch(),$("#customerlocationsearch").length&&setupCustomerLocationLookupSearch()});var stateList=[{id:0,label:"Alabama",value:"AL"},{id:1,label:"Alaska",value:"AK"},{id:2,label:"Arizona",value:"AZ"},{id:3,label:"Arkansas",value:"AR"},{id:4,label:"California",value:"CA"},{id:5,label:"Colorado",value:"CO"},{id:6,label:"Connecticut",value:"CT"},{id:7,label:"Delaware",value:"DE"},{id:8,label:"District Of Columbia",value:"DC"},{id:9,label:"Florida",value:"FL"},{id:10,label:"Georgia",value:"GA"},{id:11,label:"Hawaii",value:"HI"},{id:12,label:"Idaho",value:"ID"},{id:13,label:"Illinois",value:"IL"},{id:14,label:"Indiana",value:"IN"},{id:15,label:"Iowa",value:"IA"},{id:16,label:"Kansas",value:"KS"},{id:17,label:"Kentucky",value:"KY"},{id:18,label:"Louisiana",value:"LA"},{id:19,label:"Maine",value:"ME"},{id:20,label:"Maryland",value:"MD"},{id:21,label:"Massachusetts",value:"MA"},{id:22,label:"Michigan",value:"MI"},{id:23,label:"Minnesota",value:"MN"},{id:24,label:"Mississippi",value:"MS"},{id:25,label:"Missouri",value:"MO"},{id:26,label:"Montana",value:"MT"},{id:27,label:"Nebraska",value:"NE"},{id:28,label:"Nevada",value:"NV"},{id:29,label:"New Hampshire",value:"NH"},{id:30,label:"New Jersey",value:"NJ"},{id:31,label:"New Mexico",value:"NM"},{id:32,label:"New York",value:"NY"},{id:33,label:"North Carolina",value:"NC"},{id:34,label:"North Dakota",value:"ND"},{id:35,label:"Ohio",value:"OH"},{id:36,label:"Oklahoma",value:"OK"},{id:37,label:"Oregon",value:"OR"},{id:38,label:"Pennsylvania",value:"PA"},{id:39,label:"Rhode Island",value:"RI"},{id:40,label:"South Carolina",value:"SC"},{id:41,label:"South Dakota",value:"SD"},{id:42,label:"Tennessee",value:"TN"},{id:43,label:"Texas",value:"TX"},{id:44,label:"Utah",value:"UT"},{id:45,label:"Vermont",value:"VT"},{id:46,label:"Virginia",value:"VA"},{id:47,label:"Washington",value:"WA"},{id:48,label:"West Virginia",value:"WV"},{id:49,label:"Wisconsin",value:"WI"},{id:50,label:"Wyoming",value:"WY"}],regionList=[{id:1,label:"Alberta",value:"AB"},{id:2,label:"British Columbia",value:"BC"},{id:3,label:"Manitoba",value:"MB"},{id:4,label:"New Brunswick",value:"NB"},{id:5,label:"Newfoundland",value:"NF"},{id:6,label:"Northwest Territory",value:"NT"},{id:7,label:"Nova Scotia",value:"NS"},{id:8,label:"Nunavut",value:"NU"},{id:9,label:"Ontario",value:"ON"},{id:10,label:"Prince Edward Island",value:"PE"},{id:11,label:"Quebec",value:"QC"},{id:12,label:"Saskatchewan",value:"SK"},{id:13,label:"Yukon",value:"YT"}],countryList=[{id:1,label:"United States of America",value:"US"},{id:2,label:"Canada",value:"CA"}],regionAbbreviations={Alabama:"AL",Alaska:"AK","American Samoa":"AS",Arizona:"AZ",Arkansas:"AR","Armed Forces Americas":"AA","Armed Forces Europe":"AE","Armed Forces Pacific":"AP",California:"CA",Colorado:"CO",Connecticut:"CT",Delaware:"DE","District Of Columbia":"DC",Florida:"FL",Georgia:"GA",Guam:"GU",Hawaii:"HI",Idaho:"ID",Illinois:"IL",Indiana:"IN",Iowa:"IA",Kansas:"KS",Kentucky:"KY",Louisiana:"LA",Maine:"ME","Marshall Islands":"MH",Maryland:"MD",Massachusetts:"MA",Michigan:"MI",Minnesota:"MN",Mississippi:"MS",Missouri:"MO",Montana:"MT",Nebraska:"NE",Nevada:"NV","New Hampshire":"NH","New Jersey":"NJ","New Mexico":"NM","New York":"NY","North Carolina":"NC","North Dakota":"ND","Northern Mariana Islands":"NP",Ohio:"OH",Oklahoma:"OK",Oregon:"OR",Pennsylvania:"PA","Puerto Rico":"PR","Rhode Island":"RI","South Carolina":"SC","South Dakota":"SD",Tennessee:"TN",Texas:"TX","US Virgin Islands":"VI",Utah:"UT",Vermont:"VT",Virginia:"VA",Washington:"WA","West Virginia":"WV",Wisconsin:"WI",Wyoming:"WY"};function readURL(e){var t;e.files&&e.files[0]&&((t=new FileReader).onload=function(e){$("#profile-preview").css("backgroundImage",'url("'.concat(e.target.result,'")'))},t.readAsDataURL(e.files[0]))}$("#profile-upload").change(function(){readURL(this)}),$("#remRelationship").length&&$("#remRelationship").on("change",function(e){var t=[];if(-1!==["Daughter","Mother","Parent","Step Parent","Mother-in-law","Stepmother","Sister","Brother"].indexOf(this.value)&&t.push("Valentines"),-1!==["Son","Father","Parent","Step Parent","Father-in-law","Stepfather"].indexOf(this.value)&&t.push("Fathers Day"),-1!==["Grandmother","Grandfather","Grandparent"].indexOf(this.value)&&t.push("Grandparents Day"),-1!==["Sister","Brother","Stepsister","Stepbrother","Sister-in-law","Brother-in-law","Sibling","Sibling of Parent","Step Sibling","Sibling-in-law"].indexOf(this.value)&&t.push("Siblings Day"),$(".appendreminders").html(""),t.length){$(".appendreminders").append('<div class="row"><div class="col-12"><h2 class="heading text-center"><span class="heading-text">Add Additional Reminders</span></h2><div class="row" style="flex: 1;"><fieldset class="col-12 text-center"><legend class="callout callout-border callout-events">It\'s our goal to never let you forget another important occasion as well as to make ordering and sending gifts as easy as possible. So, remind me of these occasions as well.</legend><span class="additionalreminders"></span></fieldset></div>');for(var a=0;a<t.length;++a){var n=t[a];$(".additionalreminders").after('<div class="checkbox"><input id = "remind-me-'+n+'" name = "remind-me-occasion" value = "1" type = "checkbox" ><label for="remind-me-'+n+'">'+n+"</label></div >")}}});var btipPollingTimer=null;function braintreePayPalRemove(){$("#braintree_paypal_payment_method_nonce").val(""),$("#braintree-paypal-payment-option").hide().remove(),$(".payment-reveal__paypal-payment").remove(),$("#paypal").remove(),checkoutHasPayPal=!1}function braintreeVenmoRemove(){$("#braintree_venmo_payment_method_nonce").val(""),$("#braintree-venmo-payment-option").hide().remove(),$(".payment-reveal__venmo-payment").remove(),$("#venmo").remove(),checkoutHasVenmo=!1}function braintreeApplePayRemove(){$("#braintree_applepay_payment_method_nonce").val(""),$("#braintree-applepay-payment-option").hide().remove(),$(".payment-reveal__applepay").remove(),$("#applepay").remove(),checkoutHasApplePay=!1}function braintreeHostedFieldsRemove(){0<$("#hostedfields_payment_method_nonce").length&&($("#braintree_hostedfields_payment_method_nonce").val(""),$("#braintree-hostedfields-payment-option").hide().remove(),$(".payment-reveal__credit").remove(),$("#hostedfields").remove()),checkoutHasHostedFields=!1}function setupBraintreePayPalPayment(){gfBraintreePayPalInstance=braintree.paypalCheckout.create({client:gfBraintreeClientInstance},function(e,t){e?braintreePayPalRemove():(gfBraintreePayPalInstance=t).loadPayPalSDK({intent:"capture",currency:orderCurrency,commit:!0,vault:!1},function(e){e?braintreePayPalRemove():paypal.Buttons({fundingSource:paypal.FUNDING.PAYPAL,createOrder:function(){return t.createPayment({flow:"checkout",intent:"capture",amount:orderBalance,currency:orderCurrency,displayName:braintreeFMSettings.floristName,shippingAddressEditable:!1})},onApprove:function(e){return t.tokenizePayment(e,function(e,t){var a=JSON.stringify(t);$("#paypal_payment_method_nonce").val(t.nonce),$.post("/scripts/checkout-set-payment-info.cfm",{paymentType:"braintreePayPal",paymentInfo:encodeURI(a)},function(e){$("#paypal-button").hide(),$("#braintree-paypal-success-message").show(),$("#braintree-paypal-explain-clicking").hide(),0<$("#checkout-payment-form").length&&showMessageModal("","Ready to Complete Your Order?","Complete Order",[],"click|#complete-order-button","edit billing details","click|#main-message-modal .modal-close")})})},onCancel:function(){$("#paypal_payment_method_nonce").val(""),$("#braintree-paypal-success-message").hide(),$("#braintree-paypal-explain-clicking").show()},onError:function(){$("#paypal_payment_method_nonce").val(""),$("#braintree-paypal-success-message").hide(),$("#braintree-paypal-explain-clicking").show(),$("#paypal-button").show()}}).render("#paypal-button").then(function(){$("#braintree-paypal-payment-option").show(),$("#requested-payment-form").length<1&&$("#braintree-paypal-payment-option").on("click.showbutton",function(){$("html,body").scrollTop($("#braintree-paypal-payment-option").offset().top-48)}),checkoutHasPayPal=!0})})})}function recreateBraintreePayPalPayment(){gfBraintreePayPalInstance.teardown(function(e){e?document.location.reload():setupBraintreePayPalPayment()})}function displayVenmoButton(e){venmoButton.style.display="block",venmoButton.addEventListener("click",function(){venmoButton.disabled=!0,e.tokenize(function(e,t){venmoButton.removeAttribute("disabled"),e?handleVenmoError(e):handleVenmoSuccess(t)})})}function handleVenmoError(e){"VENMO_CANCELED"===e.code?console.log("App is not available or user aborted payment flow"):"VENMO_APP_CANCELED"===e.code?console.log("User canceled payment flow"):console.error("An error occurred:",e.message)}function handleVenmoSuccess(e){console.log("Got a payment method nonce:",e.nonce),console.log("Venmo user:",e.details.username)}function setupBraintreeVenmoPayment(){gfBraintreeVenmoInstance=braintree.venmo.create({client:gfBraintreeClientInstance,displayName:braintreeFMSettings.floristName,allowDesktopWebLogin:!0,paymentMethodUsage:"single_use",totalAmount:orderBalance},function(e,t){e?braintreeVenmoRemove():(gfBraintreeVenmoInstance=t,$("#venmo-button").on("click.venmo",function(){gfBraintreeVenmoInstance.tokenize(function(e,t){var a;$("#venmo-button").hide(),e?($("#venmo_payment_method_nonce").val(""),$("#braintree-venmo-success-message").hide(),$("#braintree-venmo-explain-clicking").show(),$("#venmo-button").show()):(a=JSON.stringify(t),$("#venmo_payment_method_nonce").val(t.nonce),$.post("/scripts/checkout-set-payment-info.cfm",{paymentType:"braintreeVenmo",paymentInfo:encodeURI(a)},function(e){$("#braintree-venmo-success-message").show(),$("#braintree-venmo-success-message-username").text(t.details.username),$("#braintree-venmo-explain-clicking").hide(),0<$("#checkout-payment-form").length&&showMessageModal("","Ready to Complete Your Order?","Complete Order",[],"click|#complete-order-button","edit billing details","click|#main-message-modal .modal-close")}))})}),$("#braintree-venmo-payment-option").show(),$("#requested-payment-form").length<1&&$("#braintree-venmo-payment-option").on("click.showbutton",function(){$("html,body").scrollTop($("#braintree-venmo-payment-option").offset().top-48)}),checkoutHasVenmo=!0)})}function recreateBraintreeVenmoPayment(){gfBraintreeVenmoInstance.teardown(function(e){e?document.location.reload():setupBraintreeVenmoPayment()})}function setupBraintreeApplePayPayment(){window.ApplePaySession&&ApplePaySession.canMakePayments()?(gfBraintreeApplePayInstance=braintree.applePay.create({client:gfBraintreeClientInstance},function(e,t){e?braintreeApplePayRemove():(gfBraintreeApplePayInstance=t,ApplePaySession.canMakePaymentsWithActiveCard(t.merchantIdentifier).then(function(e){e?($("#braintree-applepay-payment-option").show(),$("#requested-payment-form").length<1&&$("#braintree-applepay-payment-option").on("click.showbutton",function(){$("html,body").scrollTop($("#braintree-applepay-payment-option").offset().top)}),checkoutHasApplePay=!0):braintreeApplePayRemove()}))}),$("#applepay-button").on("click.applepay",function(e){var t=gfBraintreeApplePayInstance.createPaymentRequest({total:{label:braintreeFMSettings.floristName,amount:orderBalance},requiredBillingContactFields:["postalAddress","name"]}),n=new ApplePaySession(2,t);n.onvalidatemerchant=function(e){gfBraintreeApplePayInstance.performValidation({validationURL:e.validationURL,displayName:braintreeFMSettings.floristName},function(e,t){e?alert("Sorry, ApplePay failed to load, please try again"):n.completeMerchantValidation(t)}),n.onpaymentauthorized=function(e){try{void 0!==e.payment.billingContact.givenName&&$("#carFName").val(e.payment.billingContact.givenName),void 0!==e.payment.billingContact.familyName&&$("#carLName").val(e.payment.billingContact.familyName),void 0!==e.payment.billingContact.addressLines&&(void 0!==e.payment.billingContact.addressLines[0]&&$("#carAddress1").val(e.payment.billingContact.addressLines[0]),void 0!==e.payment.billingContact.addressLines[1]&&$("#carAddress2").val(e.payment.billingContact.addressLines[1])),void 0!==e.payment.billingContact.postalCode&&$("#carZip").val(e.payment.billingContact.postalCode),void 0!==e.payment.billingContact.locality&&$("#carCity").val(e.payment.billingContact.locality),void 0!==e.payment.billingContact.adminstrativeArea&&$("#carState").val(e.payment.billingContact.adminstrativeArea),void 0!==e.payment.billingContact.postalCode&&$("#carZip").val(e.payment.billingContact.postalCode),void 0!==e.payment.billingContact.countryCode&&$("#carCountry").val(e.payment.billingContact.countryCode)}catch(e){}gfBraintreeApplePayInstance.tokenize({token:e.payment.token},function(e,t){if(e)return n.completePayment(ApplePaySession.STATUS_FAILURE),void alert("Unable to process ApplePay payment, please try again.");n.completePayment(ApplePaySession.STATUS_SUCCESS),$("#applepay_payment_method_nonce").val(t.nonce);var a=JSON.stringify(t);$.post("/scripts/checkout-set-payment-info.cfm",{paymentType:"braintreeApplePay",paymentInfo:encodeURI(a)},function(e){$("#applepay-button").hide(),$("#braintree-applepay-success-message").show(),$("#braintree-applepay-explain-clicking").show(),0<$("#checkout-payment-form").length&&showMessageModal("","Ready to Complete Your Order?","Complete Order",[],"click|#complete-order-button","edit billing details","click|#main-message-modal .modal-close")})})}},n.begin()})):braintreeApplePayRemove()}function setupBraintreeHostedFieldsPayment(){gfBraintreeHostedFieldsInstance=braintree.hostedFields.create({client:gfBraintreeClientInstance,styles:{input:{"font-size":".9375rem","font-weight":"500","font-family":"proxima-nova, helvetica, arial, verdana, sans-serif",color:"rgba(108,108,108,.85)"}},fields:{number:{selector:"#hostedfields_carCCNumber",placeholder:"Card Number"},cvv:{selector:"#hostedfields_carCCCVV",placeholder:"CVV"},expirationMonth:{selector:"#hostedfields_carCCExpiration_Month",placeholder:"MM"},expirationYear:{selector:"#hostedfields_carCCExpiration_Year",placeholder:"YY"}}},function(e,t){e?braintreeHostedFieldsRemove():(gfBraintreeHostedFieldsInstance=t,checkoutHasHostedFields=!0,$("#braintree-hostedfields-payment-option").show(),gfBraintreeHostedFieldsInstance.on("inputSubmitRequest",function(){$("#hostedfields_verify-card-button").click()}),$("#braintreeVaultCards").on("change.setcard",function(){var a=$("select#braintreeVaultCards option:checked").val();a.length?($("#saveCreditCard").prop("checked",!1),"none"===a?($.get("/scripts/checkout-clear-payment-nonces.cfm"),$("#hostedfields_payment_method_nonce").val(""),$(".braintree-fields, .braintree-button").hide(),$("#braintree-hostedfields-success-message").hide(),$("#braintree-save").hide()):"fm_legacy|"===a.substring(0,10)?$.post("/scripts/payment-nonce-update-legacy-id.cfm",{legacyID:a},function(e){if(0===e.length||"removed"===e||"error"===e)return $('select#braintreeVaultCards option[value="'+a+'"]').remove(),showMessageModal("The saved card is no longer valid, please choose another saved card, or enter a new card."),$.get("/scripts/checkout-clear-payment-nonces.cfm"),$("#hostedfields_payment_method_nonce").val(""),$(".braintree-fields, .braintree-button").hide(),$("#braintree-hostedfields-success-message").hide(),$("#braintree-save").hide(),!1;var t=e;$("#hostedfields_payment_method_nonce").val(t),$('select#braintreeVaultCards option[value="'+a+'"]').prop("value",t),$(".braintree-fields, .braintree-button").hide(),$("#braintree-hostedfields-success-message").show(),$("#braintree-save").hide(),0<$("#checkout-payment-form").length&&showMessageModal("","Ready to Complete Your Order?","Complete Order",[],"click|#complete-order-button","edit billing details","click|#main-message-modal .modal-close")}):($("#hostedfields_payment_method_nonce").val(a),$(".braintree-fields, .braintree-button").hide(),$("#braintree-hostedfields-success-message").show(),$("#braintree-save").hide(),0<$("#checkout-payment-form").length&&showMessageModal("","Ready to Complete Your Order?","Complete Order",[],"click|#complete-order-button","edit billing details","click|#main-message-modal .modal-close"))):($.get("/scripts/checkout-clear-payment-nonces.cfm"),$("#hostedfields_payment_method_nonce").val(""),$(".braintree-fields, .braintree-button").show(),$("#braintree-hostedfields-success-message").hide(),$("#saveCreditCard").prop("checked",!0),$("#braintree-save").show())}).trigger("change.setcard"),$("#hostedfields_verify-card-button").on("click.checkcard",function(){var e,t=gfBraintreeHostedFieldsInstance.getState(),a=[];!t.fields.number.isEmpty&&t.fields.number.isValid||(t.fields.number.isEmpty?a.push("Credit Card Number EMPTY"):a.push("INVALID Credit Card Number")),!t.fields.expirationMonth.isEmpty&&t.fields.expirationMonth.isValid||(t.fields.expirationMonth.isEmpty?a.push("Credit Card Expiration Month EMPTY"):a.push("INVALID Credit Card Expiration Month")),!t.fields.expirationYear.isEmpty&&t.fields.expirationYear.isValid||(t.fields.expirationYear.isEmpty?a.push("Credit Card Expiration Year EMPTY"):a.push("INVALID Credit Card Expiration Year")),!t.fields.cvv.isEmpty&&t.fields.cvv.isValid||(t.fields.cvv.isEmpty?a.push("Credit Card CVV EMPTY"):a.push("INVALID Credit Card CVV")),0<$("#carBraintreePaymentFName").length&&""===$("#carBraintreePaymentFName").val()&&a.push("Billing First Name"),0<$("#carBraintreePaymentLName").length&&""===$("#carBraintreePaymentLName").val()&&a.push("Billing Last Name"),0<$("#carBraintreePaymentAddress1").length&&""===$("#carBraintreePaymentAddress1").val()&&a.push("Billing Address"),0<$("#carBraintreePaymentCity").length&&""===$("#carBraintreePaymentCity").val()&&a.push("Billing City"),0<$("#carBraintreePaymentState").length&&""===$("#carBraintreePaymentState").val()&&a.push("Billing State"),0<$("#carBraintreePaymentZip").length&&""===$("#carBraintreePaymentZip").val()&&a.push("Billing Zip"),0<$("#carBraintreePaymentCountry").length&&(""===$("#carBraintreePaymentCountry").val()?a.push("Billing Country"):"UN"===$("#carBraintreePaymentCountry").val().toString().toUpperCase()||"UNITED STATES"===$("#carBraintreePaymentCountry").val().toString().toUpperCase()||"USA"===$("#carBraintreePaymentCountry").val().toString().toUpperCase()?$("#carBraintreePaymentCountry").val("US"):"CANADA"!==$("#carBraintreePaymentCountry").val().toString().toUpperCase()&&"CAN"!==$("#carBraintreePaymentCountry").val().toString().toUpperCase()||$("#carBraintreePaymentCountry").val("CA")),0<a.length?showFormErrors(a):(e={fieldsToTokenize:["number","cvv","expirationMonth","expirationYear","postalCode","cardholderName"],billingAddress:{}},0<$("#carBraintreePaymentFName").length&&(e.billingAddress.first_name=$("#carBraintreePaymentFName").val(),e.billingAddress.firstName=$("#carBraintreePaymentFName").val()),0<$("#carBraintreePaymentLName").length&&(e.billingAddress.last_name=$("#carBraintreePaymentLName").val(),e.billingAddress.lastName=$("#carBraintreePaymentLName").val(),0<$("#carBraintreePaymentFName").length?e.billingAddress.cardholderName=$("#carBraintreePaymentFName").val()+" "+$("#carBraintreePaymentLName").val():e.billingAddress.cardholderName=$("#carBraintreePaymentLName").val()),0<$("#carBraintreePaymentCompany").length&&(e.billingAddress.company=$("#carBraintreePaymentCompany").val()),0<$("#carBraintreePaymentPhone").length&&(e.billingAddress.phone_number=$("#carBraintreePaymentPhone").val().replace(/[^0-9\-\(\)]+/g,""),e.billingAddress.phone=$("#carBraintreePaymentPhone").val().replace(/[^0-9\-\(\)]+/g,""),e.billingAddress.phoneNumber=$("#carBraintreePaymentPhone").val().replace(/[^0-9\-\(\)]+/g,"")),0<$("#carBraintreePaymentAddress1").length&&(e.billingAddress.street_address=$("#carBraintreePaymentAddress1").val(),e.billingAddress.streetAddress=$("#carBraintreePaymentAddress1").val()),0<$("#carBraintreePaymentAddress2").length&&(e.billingAddress.extended_address=$("#carBraintreePaymentAddress2").val(),e.billingAddress.extendedAddress=$("#carBraintreePaymentAddress2").val()),0<$("#carBraintreePaymentCity").length&&(e.billingAddress.locality=$("#carBraintreePaymentCity").val()),0<$("#carBraintreePaymentState").length&&(e.billingAddress.region=$("#carBraintreePaymentState").val()),0<$("#carBraintreePaymentZip").length&&(e.billingAddress.postal_code=$("#carBraintreePaymentZip").val().replace(/[^0-9a-zA-Z]+/g,""),e.billingAddress.postalCode=$("#carBraintreePaymentZip").val().replace(/[^0-9a-zA-Z]+/g,"")),0<$("#carBraintreePaymentCountry").length&&(e.billingAddress.country_code_alpha2=$("#carBraintreePaymentCountry").val(),e.billingAddress.countryCodeAlpha2=$("#carBraintreePaymentCountry").val()),gfBraintreeHostedFieldsInstance.tokenize(e,function(e,t){if(e)showMessageModal("There was an error processing your credit card. Please verify the information is correct and try again.");else{$("#hostedfields_payment_method_nonce").val(t.nonce);try{JSON.stringify(t);0<$("#checkout-payment-form").length?($("#carBraintreePaymentTitle").val(t.details.cardType+" Ending "+t.details.lastFour),$("#carBraintreePaymentName").val(t.details.cardType+" "+t.details.bin+"......"+t.details.lastFour+" "+t.details.expirationMonth+"/"+t.details.expirationYear.slice(-2)),$("#carBraintreePaymentMaskedNumber").val(t.details.bin+"......"+t.details.lastFour),$("#carBraintreePaymentExpirationMonth").val(t.details.expirationMonth),$("#carBraintreePaymentExpirationYear").val(t.details.expirationYear.slice(-2)),$.post("/scripts/checkout-payment-info-save.cfm",$("#hostedfields_payment_method_nonce, #hostedfields_vault_card, #carBraintreePaymentFName, #carBraintreePaymentLName, #carBraintreePaymentCompany, #carBraintreePaymentAddress1, #carBraintreePaymentAddress2, #carBraintreePaymentCity, #carBraintreePaymentState, #carBraintreePaymentZip, #carBraintreePaymentCountry, #carBraintreePaymentPhone, #carBraintreePaymentTitle, #carBraintreePaymentName, #carBraintreePaymentMaskedNumber, #carBraintreePaymentExpirationMonth, #carBraintreePaymentExpirationYear").serialize(),function(e){e.success?($("#braintree-hostedfields-hosted-form").hide(),$("#braintree-hostedfields-success-message").show(),0<$("#checkout-payment-form").length&&showMessageModal("","Ready to Complete Your Order?","Complete Order",[],"click|#complete-order-button","edit billing details","click|#main-message-modal .modal-close")):(parent.showMessageModal("Verification failed: "+e.message),$("#order-entry-validating-credit-card").remove())},"json")):($("#braintree-hostedfields-hosted-form").hide(),$("#braintree-hostedfields-success-message").show())}catch(e){$("#braintree-hostedfields-hosted-form").hide(),$("#braintree-hostedfields-success-message").show()}}}))}),$("#carBraintreePaymentPhone").on("change.escape keyup.escape",function(){$(this).val($(this).val().replace(/[^0-9\-\(\)]+/g,""))}),$("#carBraintreePaymentZip").on("change.escape keyup.escape",function(){$(this).val($(this).val().replace(/[^0-9a-zA-Z]+/g,""))}))})}function recreateBraintreeHostedFieldsPayment(){gfBraintreeHostedFieldsInstance.teardown(function(e){e?document.location.reload():setupBraintreeHostedFieldsPayment()})}$(function(){if(0<$("#checkout-payment-form, #manual-payment-form, #requested-payment-form").length&&0<$("#paypal_payment_method_nonce, #venmo_payment_method_nonce, #applepay_payment_method_nonce, #hostedfields_payment_method_nonce").length)try{braintree.client.create({authorization:braintreeFMSettings.clientToken},function(e,t){if(e)return braintreePayPalRemove(),braintreeVenmoRemove(),braintreeApplePayRemove(),void braintreeHostedFieldsRemove();try{braintree.dataCollector.create({client:t},function(e,t){if(!e)try{gfBraintreeDeviceInfo=encodeURI(t.deviceData),$("#braintree_device_info").val(gfBraintreeDeviceInfo)}catch(e){}})}catch(e){}0<$("#paypal_payment_method_nonce").length&&(gfBraintreeClientInstance=t,setupBraintreePayPalPayment(),$("#paypal-undo-payment").on("click.undopaypal",function(){$("#braintree-paypal-success-message").append('<div id="undoing-paypal-payment-loading"><div class="loader loader-sm"><img src="/assets/img/spinner.svg" alt="" style="widht:30px;height:30px;"></div></div>'),$.get("/scripts/checkout-clear-payment-nonces.cfm",function(e){$("#paypal_payment_method_nonce").val(""),$("#paypal-button").show(),$("#braintree-paypal-success-message").hide(),$("#braintree-paypal-explain-clicking").show(),$("#undoing-paypal-payment-loading").remove()})})),0<$("#venmo_payment_method_nonce").length&&(gfBraintreeClientInstance=t,setupBraintreeVenmoPayment(),$("#venmo-undo-payment").on("click.undovenmo",function(){$("#braintree-venmo-success-message").append('<div id="undoing-venmo-payment-loading"><div class="loader loader-sm"><img src="/assets/img/spinner.svg" alt="" style="widht:30px;height:30px;"></div></div>'),$.get("/scripts/checkout-clear-payment-nonces.cfm",function(e){$("#venmo_payment_method_nonce").val(""),$("#venmo-button").show(),$("#braintree-venmo-success-message").hide(),$("#braintree-venmo-success-message-username").html(""),$("#braintree-venmo-explain-clicking").show(),$("#undoing-venmo-payment-loading").remove()})})),0<$("#applepay_payment_method_nonce").length&&(gfBraintreeClientInstance=t,setupBraintreeApplePayPayment(),$("#applepay-undo-payment").on("click.undoapplepay",function(){$("#braintree-applepay-success-message").append('<div id="undoing-applepay-payment-loading"><div class="loader loader-sm"><img src="/assets/img/spinner.svg" alt="" style="widht:30px;height:30px;"></div></div>'),$.get("/scripts/checkout-clear-payment-nonces.cfm",function(e){$("#applepay_payment_method_nonce").val(""),$("#applepay-button").show(),$("#braintree-applepay-success-message").hide(),$("#braintree-applepay-explain-clicking").show(),$("#undoing-applepay-payment-loading").remove()})})),0<$("#hostedfields_payment_method_nonce").length&&(gfBraintreeClientInstance=t,setupBraintreeHostedFieldsPayment(),$("#hostedfields-undo-payment").on("click.undohostedfields",function(){$("#braintree-hostedfields-success-message").append('<div id="undoing-hostedfields-payment-loading"><div class="loader loader-sm"><img src="/assets/img/spinner.svg" alt="" style="widht:30px;height:30px;"></div></div>'),$.get("/scripts/checkout-clear-payment-nonces.cfm",function(e){$("#hostedfields_payment_method_nonce").val(""),$(".braintree-fields, .braintree-button").hide(),$("#braintree-hostedfields-success-message").hide(),$("#undoing-hostedfields-payment-loading").remove(),$("#braintreeVaultCards").val(""),$("#braintree-save").hide()})}))})}catch(e){braintreePayPalRemove(),braintreeVenmoRemove(),braintreeApplePayRemove(),braintreeHostedFieldsRemove()}0<$("#bipp-update-status").length&&($("#bipp-update-status").on("click.updatestatus",function(e){e.preventDefault(),btipPollingTimer&&clearTimeout(btipPollingTimer),$(".bipp-update-status-spinner, .bipp-cancel-request-spinner, .bipp-resend-charge-to-reader-spinner, .bipp-convert-request-another-spinner").remove();var t=$(this).attr("href"),a=t.split("?")[1],n=t.split("?")[0];$("#bipp-update-status").append('<span class="bipp-update-status-spinner"><div class="loader loader-sm" style="margin:0px 0px 0px 10px;padding:0;"><img src="/assets/img/spinner.svg" alt="" style="width:17px;height:17px;"></div></span>'),$.post(n,a,function(e){switch(e.status){case"Complete":$("#bipp-reader-initial-error").remove(),$("#bipp-status").html(e.message),document.location.reload();break;case"Failed":case"Cancelled":$("#bipp-reader-initial-error").remove(),$("#bipp-status").html(e.message),$(".bipp-update-status-spinner").remove();break;default:$("#bipp-reader-initial-error").remove(),$("#bipp-status").html(e.message),$(".bipp-update-status-spinner").remove(),btipPollingTimer=setTimeout('$("a#bipp-update-status").trigger("click.updatestatus");',500)}},"json")}),$("#bipp-reader-initial-error").length<1&&$("a#bipp-update-status").trigger("click.updatestatus"),$("#bipp-resend-charge-to-reader").on("click.resendbipp",function(e){e.preventDefault(),btipPollingTimer&&clearTimeout(btipPollingTimer),$("#bipp-reader-initial-error, .bipp-update-status-spinner, .bipp-cancel-request-spinner, .bipp-resend-charge-to-reader-spinner, .bipp-convert-request-another-spinner").remove();var t=$(this).attr("href"),a=t.split("?")[1],n=t.split("?")[0];$(".bipp-resend-charge-to-reader-spinner").remove(),$("#bipp-resend-charge-to-reader").append('<span class="bipp-resend-charge-to-reader-spinner"><div class="loader loader-sm" style="margin:0px 0px 0px 10px;padding:0;"><img src="/assets/img/spinner.svg" alt="" style="width:17px;height:17px;"></div></span>'),$("#bipp-status").html("Resending payment request to reader..."),a+="&readerID="+$("#oeipReaderID").val(),a+="&ajaxReply=1",$.post(n,a,function(e){$(".bipp-resend-charge-to-reader-spinner").remove(),"Failed"===e.status?(btipPollingTimer&&clearTimeout(btipPollingTimer),$("#bipp-status").html(e.message)):$("a#bipp-update-status").trigger("click.updatestatus")},"json")}),$("#bipp-cancel-request").on("click.cancelbipp",function(e){e.preventDefault(),btipPollingTimer&&clearTimeout(btipPollingTimer),$(".bipp-update-status-spinner, .bipp-cancel-request-spinner, .bipp-resend-charge-to-reader-spinner, .bipp-convert-request-another-spinner").remove();var t=$(this).attr("href"),a=t.split("?")[1],n=t.split("?")[0];$("#bipp-cancel-request").append('<span class="bipp-cancel-request-spinner"><div class="loader loader-sm" style="margin:0px 0px 0px 10px;padding:0;"><img src="/assets/img/spinner.svg" alt="" style="width:17px;height:17px;"></div></span>'),$("#bipp-status").html("Cancelling payment request..."),a+="&readerID="+$("#oeipReaderID").val(),$.post(n,a,function(e){$("a#bipp-update-status").trigger("click.updatestatus")})}),$("#bipp-convert-request-another").on("click.cancelbipp",function(e){e.preventDefault(),btipPollingTimer&&clearTimeout(btipPollingTimer),$(".bipp-update-status-spinner, .bipp-cancel-request-spinner, .bipp-resend-charge-to-reader-spinner, .bipp-convert-request-another-spinner").remove();var t=$(this).attr("href"),a=t.split("?")[1],n=t.split("?")[0];$("#bipp-convert-request-another").append('<span class="bipp-convert-request-another-spinner"><div class="loader loader-sm" style="margin:0px 0px 0px 10px;padding:0;"><img src="/assets/img/spinner.svg" alt="" style="width:17px;height:17px;"></div></span>'),$("#bipp-status").html("Cancelling payment request and returning to order entry..."),a+="&readerID="+$("#oeipReaderID").val(),$.post(n,a,function(e){$("#bipp-status").html("Payment request, returning to order entry..."),btipPollingTimer&&clearTimeout(btipPollingTimer),document.location.href="/cart/checkout.cfm"})}))}),$(function(){var a,n,o,r,t,i;function s(){var e=i-a.val().length;t.html(e)}$("#corCardMessageInternational").length&&(a=$("#corCardMessageInternational"),n=$("#corCardMessageInternational").not(".allow-emoji"),o=$("#cardMessage"),r=$("#message-suggestions"),t=$("#textcounter"),i=a.attr("maxlength"),s(),$(".greeting-card-btn").on("click.showsugs",function(e){r.fadeIn().find("a:first-child").focus(),e.preventDefault()}),$(".message-scroller").on("click.setsug","a",function(e){var t=a.val();0<t.length&&(t="\n"+t),a.val($(this).text()+t).trigger("input").focus(),r.fadeOut(),e.preventDefault()}),a.on("input",function(){var e,t;s(),e=$(this),t=o,0<n.length?t.text(cleanText(e.val())):t.text(e.val())}))});var months=["January","February","March","April","May","June","July","August","September","October","November","December"],days=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function dateSuffix(e){switch(new Date(e).getDate()){case 1:case 21:case 31:return"st";case 2:case 22:return"nd";case 3:case 23:return"rd";default:return"th"}}function setDate(t){if($(t).hasClass("calendar-date__empty")||$(t).hasClass("calendar-date__selected"))return!1;if($(t).hasClass("calendar-date__unavailable")&&!$(t).hasClass("calendar-date__orderentry"))return!1;var a,n=$(t).data("delivery-date"),e=new Date(n),o=0<$("#braID").length&&0<$("#braID").val().length?1:0,r=$("#corIsGiftCard").val(),i=$("#corIsElectronicDelivery").val(),s=days[e.getDay()];if(s+=", "+months[e.getMonth()],s+=" "+e.getDate()+dateSuffix(e),a=0<$("#corHour-prefill").length?$("#corHour-prefill").val():"",$("#delivery-time-options").html(""),$("#delivery-date-info").html('<div id="checkout-calendar-loading"><h2>Verifying Date</h2><div class="loader loader-sm"><img src="/assets/img/spinner.svg" alt="" style="widht:75px;height:75px;"></div></div>').show(),$("#checkout-special-instructions-container, #instruct-alert, #delivery-info-header, #calendar-continue-button, #delivery-time-options-container").hide(),$("#corDate").val(n),$("#delivery-time-container").hide(),$("#delivery-time-header").hide(),$("#pastRollover").val(0),$("#matIsRequired").val(0),$('.calendar-offer[data-date="'+n+'"]').length){$(".calendar-offer").hide(),$('.calendar-offer[data-date="'+n+'"]').show(),$("#modal-calendar-offers").addClass("modal-open").attr("aria-hidden",!1);try{$("#modal-calendar-offers").focus()}catch(e){}}var l="/scripts/checkout-delivery-time-generate.cfm?gfRQV="+$("#rqv").val()+"&corDate="+n+"&isWillCall="+o+"&isGiftCard="+r+"&isElectronicDelivery="+i+"&prefill="+a;$.get(l,function(e){0<e.TIMEOPTIONS.length?($("#delivery-date-info").hide(),$("#no-will-times").hide(),e.TIMEOPTIONS.map(function(e){var t;999===e.VALUE?($("#delivery-time-options, #delivery-time-header").hide(),$("#no-will-times, #delivery-time-options-container").show()):(t='<label class="radio matrix-option text-center" for="corHour_'+e.VALUE+'"><input type="radio" id="corHour_'+e.VALUE+'" value="'+e.VALUE+'" name="corHour" title="'+e.COST+'" displaytime="'+e.TIMEDISPLAY+'" /><span class="matrix-option__time">'+e.DISPLAY+"</span>",0<e.COST.toString().length&&(t+='<span class="matrix-option__cost">'+e.COST+"</span>"),t+="</label>",$("#delivery-time-options").append(t).show(),$("#delivery-time-container, #delivery-time-options-container, #delivery-time-header").show())}),1===e.TIMEOPTIONS.length&&0===e.TIMEOPTIONS[0].COST&&1===e.TIMEOPTIONS[0].VALUE?($('input[name="corHour"]').attr("displaytime",""),$("#delivery-time-header,#delivery-time-options-container").hide(),$("#corHour_"+e.TIMEOPTIONS[0].VALUE.toString()).prop("checked",!0),setTimeout("$('#corHour_"+e.TIMEOPTIONS[0].VALUE.toString()+"').trigger('change');",100)):0<a.length&&($("#corHour_"+a).prop("checked",!0),setTimeout("$('#corHour_"+a+"').trigger('change');",100))):($("#delivery-time-options-container").hide(),$("#delivery-date-info").html("<h3>You selected "+s+"</h3>"),$("#checkout-special-instructions-container, #instruct-alert, #delivery-info-header, #calendar-continue-button, #delivery-date-info").show()),0==o&&e.HASTIMES&&(e.PASTROLLOVERTIME?$("#pastRollover").val(1):$("#pastRollover").val(0),e.MATISREQUIRED?$("#matIsRequired").val(1):$("#matIsRequired").val(0),$("#matID").val(e.MATID)),e.ISSEASONALDATE?($("#seasonal-price-notice").html(e.SEASONALMESSAGE).show(),$("#calendar-notes-header").show(),$("#notice-config-parent").show()):$("#seasonal-price-notice").html("").hide(),e.ISFLEXDELIVERYDATE?($(t).closest(".calendar").addClass("flex-delivery-selected").find(".calendar-date__flex").addClass("calendar-date__selected").attr("aria-selected",!0),$("#corIsFlexDelivery").val("1").prop("checked",!1),$("#flex-delivery-confirmation").show()):($(t).closest(".calendar").removeClass("flex-delivery-selected"),$("#corIsFlexDelivery").val("0").prop("checked",!1),$("#flex-delivery-confirmation").hide()),void 0!==e.FORMATTEDDATEOVERRIDE&&0<e.FORMATTEDDATEOVERRIDE.length&&(s=e.FORMATTEDDATEOVERRIDE),$(".calendar-date").removeClass("calendar-date__selected").attr("aria-selected",!1),$('.calendar-date[data-delivery-date="'+n+'"]').addClass("calendar-date__selected").attr("aria-selected",!0),0<$(".entry-calendar-days").length&&($(".entry-calendar-date-temp").remove(),$(".entry-calendar-date").show(),$(".entry-calendar-date").removeClass("calendar-date__selected").attr("aria-selected",!1),0<$('.entry-calendar-date[data-delivery-date="'+n+'"]').length?$('.entry-calendar-date[data-delivery-date="'+n+'"]').addClass("calendar-date__selected").attr("aria-selected",!0).show():($(".entry-calendar-days > .entry-calendar-date").eq(3).hide(),$(".entry-calendar-days").append('<li class="entry-calendar-date-temp entry-calendar-date calendar-date__orderentry calendar-date__selected" aria-selected="true"><span class="entry-calendar-month">'+$(t).data("month")+'</span><span class="entry-calendar-day">'+$(t).data("delivery-date").split("/")[1]+'</span><span class="entry-calendar-dotw">'+$(t).data("shortdate")+"</span></li>")),$(".entry-calendar-days").addClass("has-selected"),$("#order-entry-calendar").removeClass("entry-modal--open"))},"json").fail(function(e){showMessageModal("Unable to verify delivery date, please reload the page and try again."),$("#delivery-date-info").html("")})}function addonShowQtySetup(){$(".addon-variation-select").off("change.showqty").on("change.showqty",function(e){var t=$(this).data("upsid"),a=$(this).val();0<a.length?($(this).closest("li").find(".addon-qty, .addon-personalize, .addon-qty-container, .addon-option-select").show(),$(this).closest("li").find(".gallery-img, .addons-img").hide(),$(this).closest("div.anti-selectize").addClass("nudge-arrow"),$("#optpic"+a).length?$("#optpic"+a).show():$("#upspic"+t).show()):($(this).closest("li").find(".addon-qty, .addon-personalize, .addon-qty-container, .addon-option-select").hide(),$(this).closest("li").find(".gallery-img, .addons-img").hide(),$(this).closest("div.anti-selectize").removeClass("nudge-arrow"),$("#upspic"+t).show())}).trigger("change")}$(function(){var e;$("#checkout-calendar-container").on("click.changecalendar","a.calendar-browse-link",function(e){var t=$(this).data("date"),a=$("#checkout-calendar-container").html();$("#checkout-calendar-container").html('<div id="checkout-calendar-loading"><div class="loader-title">Loading Calendar</div><div class="loader loader-sm"><img src="/assets/img/spinner.svg" alt="" style="widht:125px;height:125px;"></div></div>'),$.get("/scripts/checkout-calendar-generate.cfm?calendarStartDate="+t,function(e){$("#checkout-calendar-container").html(e),$("#checkout-calendar-showall").trigger("click")}).fail(function(e){showMessageModal("Unable to load calendar, please reload the page and try again."),$("#checkout-calendar-container").html(a)})}),$("#checkout-calendar-container").on("click.showall","#checkout-calendar-showall",function(e){return $("#checkout-calendar-container").data("showall","true"),$("#checkout-calendar-container .calendar-date").not(".calendar-date__unavailable, .calendar-date__empty").addClass("calendar-date__mobile"),$("#checkout-calendar-container .heading-text .hidden-xs").removeClass("hidden-xs"),$("#checkout-calendar-container .visible-xs").removeClass("visible-xs").hide(),!1}),$("#checkout-calendar-container").on("click.setdate",".calendar-date",function(e){setDate($(this))}),$("#checkout-calendar-container").on("click.setdate",".calendar-offer-link",function(e){var t=$(this).attr("data-date"),a=$(this).attr("data-date3"),n=$(this).attr("data-promo"),o="Your delivery date has been changed to "+a;0<n.length&&(o+=" and your promotion will be automatically applied during checkout."),$("#modal-calendar-offers").removeClass("modal-open").attr("aria-hidden",!0),0<n.length&&$.get("/scripts/setPromoCode.cfm?promo="+n),setDate($('.calendar-date[data-delivery-date="'+t+'"]')),alert(o)}),$("#checkout-calendar-container").on("click.nothanks",".calendar-offer-no",function(e){$("#modal-calendar-offers").removeClass("modal-open").attr("aria-hidden",!0)}),$("#checkout-calendar-container  .calendar-date.calendar-date__selected").length&&((e=$("#checkout-calendar-container  .calendar-date.calendar-date__selected")).removeClass("calendar-date__selected").attr("aria-selected",!1),setDate(e)),$("#delivery-time-options-container").on("change.settime",'input[name="corHour"]',function(e){var t=$(".calendar-date__selected").data("delivery-date"),a=new Date(t),n=days[a.getDay()];n+=", "+months[a.getMonth()],n+=" "+a.getDate()+dateSuffix(a);var o=$('input[name="corHour"]:checked').attr("title"),r=$('input[name="corHour"]:checked').attr("value"),i=$('input[name="corHour"]:checked').attr("displaytime");0<o.length&&($("#corMatrixCost").val(o),0<$("#corHour-prefill").length&&$("#corHour-prefill").val(r)),$("#delivery-date-info").html("<h3>You selected "+n+" "+i+"</h3>"),$("#checkout-special-instructions-container, #instruct-alert, #delivery-info-header, #calendar-continue-button, #delivery-date-info").show()}),$("#corOrderHelperNoBlockouts").on("change.setnoblockout",function(e){$.get("/scripts/cart-set-no-blockouts.cfm?corOrderHelperNoBlockouts="+$("#corOrderHelperNoBlockouts:checked").length,function(){document.location.reload()})}),$("#checkout-choose-date-form").on("submit.validate",function(e){var t=[];if($("#corDate").val().length<1&&t.push("Delivery Date.\n"),0<$("#braID").length?0===$("#corHour").val().length&&t.push("Pickup Time.\n"):"1"!==$("#pastRollover").val()&&"1"!==$("#matIsRequired").val()||0===$("#corHour").val().length&&t.push("Delivery Time.\n"),0<$("#corNoContact").length&&$("#corNoContact").hasClass("required")&&0===$("#corNoContact:checked").length&&t.push('"No Contact" Confirmation.\n'),0<$("#corIsFlexDelivery:visible").length&&$("#corIsFlexDelivery").hasClass("required")&&0===$("#corIsFlexDelivery:checked").length&&t.push($("#flex-delivery-confirmation").attr("title")+"\n"),0<t.length)return showFormErrors(t),!1})}),$(function(){$("#occID").on("change.showmessage",function(e){var t=$("#occID").val().replace("-u",""),a=$("#occID option:selected").text();if($("#card-message-container").hide(),$("#setting-occasion-container").show(),t.length<1)return $("#reminder-desc").html(""),$("#corWantsReminder_no").prop("checked",!0),$("#setting-occasion-container").hide(),!1;$.get("/scripts/checkout-occasion-set.cfm?occID="+t,function(e){e.SUCCESS?(1===e.OFFERREMINDER?($("#reminder-desc").html(e.REMINDERBLURB),$("#corReminderText").val(e.REMINDERTEXT),$("#reminder-container").show(),$("#corWantsReminder_yes").prop("checked",!0)):($("#reminder-container").hide(),$("#reminder-desc").html(""),$("#corWantsReminder_no").prop("checked",!0)),$("#message-suggest-button").hide(),0<e.SUGGESTEDMESSAGES.length?($("#message-suggestions .message-scroller").html(""),$("#message-suggestions .message-scroller").append('<a href="#" class="message-close"></a>'),e.SUGGESTEDMESSAGES.map(function(e){$("#message-suggestions .message-scroller").append('<a href="#">'+e+"</a>")}),$("#message-suggest-button").show()):$("#message-suggestions .message-scroller").html(""),$("#card-message-container").show(),$("#cta-container").show()):(showMessageModal("There was an issue setting your occasion, please try again."),$("#occID").val("")),$("#setting-occasion-container").hide()},"json").fail(function(e){showMessageModal("There was an issue setting your occasion, please try again."),$("#occID").val("")});try{$('label[for="corWantsReminder_yes"]').data("ga-label",a),$('label[for="corWantsReminder_no"]').data("ga-label",a)}catch(e){}}).trigger("change"),$("#checkout-message-form").on("submit.validate",function(e){var t=[];if($("#occID").val().length<1&&t.push("Occasion"),0<t.length)return showFormErrors(t),!1}),$("#corCardMessageInternational").not(".allow-emoji").on("blur.strip change.strip keyup.strip keypress.strip",function(){$(this).val(cleanText($(this).val()))})}),$(function(){addonShowQtySetup(),$(".addon-personalize").not(".allow-emoji").on("blur.strip change.strip keyup.strip keypress.strip",function(){$(this).val(cleanText($(this).val()))}),$("#checkout-addons-form").on("submit.validate",function(e){var a=[];if($(".addon-variation-select").each(function(){0<$(this).val().length&&($(this).closest("li").find(".addon-qty").val().length<1&&a.push("Quantity for "+$(this).data("title")),$(this).closest("li").find(".addon-personalize").length&&$(this).closest("li").find(".addon-personalize").val().length<1&&a.push("Personalization for "+$(this).data("title")),$(this).closest("li").find(".addon-option-select select").length&&$(this).closest("li").find(".addon-option-select select").each(function(e,t){$(t).val().length<1&&a.push("Select "+$(t).attr("title"))}))}),0<a.length)return showFormErrors(a),!1})});var setTipTimer,checkoutHasPayPal=!1,checkoutHasVenmo=!1,checkoutHasApplePay=!1,checkoutHasHostedFields=!1,checkoutHasTSYS=!1,creditCardWarned=!1;function saveTip(){$.get("/scripts/checkout-set-tip.cfm?carTip="+$("#carTip").val(),function(e){document.location.reload()})}$(function(){$("#carPetalsUsed").on("change.setpoints",function(e){var t=$(this).val();t.length&&($("#reward-points-payment-container").append('<div id="reward-payment-loading"><div class="loader loader-sm"><img src="/assets/img/spinner.svg" alt="" style="widht:30px;height:30px;"></div></div>'),$.get("/scripts/checkout-reward-points-payment.cfm?points="+t,function(e){if(e.SUCCESS){if(checkoutHasPayPal||checkoutHasVenmo||checkoutHasApplePay||checkoutHasTSYS||checkoutHasHostedFields)return $.get("/scripts/checkout-clear-payment-nonces.cfm",function(e){document.location.reload()}),!1;document.location.reload()}else showMessageModal("We were unable to apply your points, please try again"),$("#carPetalsUsed").val("")},"json").fail(function(e){showMessageModal("We were unable to apply your points, please try again"),$("#carPetalsUsed").val("")}))}),$("#carPhoneType").on("change",function(e){"Mobile"===$("#carPhoneType").val()?$("#sms-optin-container").show():$("#sms-optin-container").hide()}).trigger("change"),$("#checkout-payment-form").on("submit.validate",function(e){$("#complete-order-button").hide(),$("#order-processing-button").show();var t,a,n=!1,o=[];if(0<$("#acceptOrderNotes").not(":checked").length&&o.push("Accept Notes"),0<$("#carWantsEmails_Yes").length&&0===$("#carWantsEmails_Yes:checked").length&&0===$("#carWantsEmails_No:checked").length&&o.push("Exclusive Savings?"),0===parseFloat(orderBalance)&&o.length<1)return!0;if(0<$("#applepay_payment_method_nonce").length&&0<$("#applepay_payment_method_nonce").val().length&&($("#carFName").val().length<1&&o.push("First Name"),$("#carLName").val().length<1&&o.push("Last Name"),$("#carAddress1").val().length<1&&o.push("Address"),$("#carCity").val().length<1&&o.push("City"),$("#carState").val().length<1&&o.push("State / Province"),$("#carZip").val().length<1&&o.push("Zip / Postal Code"),$("#carHomePhone").val().length<1&&o.push("Phone Number"),$("#carCountry").val().length<1&&o.push("Country"),o.length<1&&(n=!0)),0<$("#paypal_payment_method_nonce").length&&0<$("#paypal_payment_method_nonce").val().length&&($("#carFName").val().length<1&&o.push("First Name"),$("#carLName").val().length<1&&o.push("Last Name"),$("#carAddress1").val().length<1&&o.push("Address"),$("#carCity").val().length<1&&o.push("City"),$("#carState").val().length<1&&o.push("State / Province"),$("#carZip").val().length<1&&o.push("Zip / Postal Code"),$("#carHomePhone").val().length<1&&o.push("Phone Number"),$("#carCountry").val().length<1&&o.push("Country"),o.length<1&&(n=!0)),0<$("#venmo_payment_method_nonce").length&&0<$("#venmo_payment_method_nonce").val().length&&($("#carFName").val().length<1&&o.push("First Name"),$("#carLName").val().length<1&&o.push("Last Name"),$("#carAddress1").val().length<1&&o.push("Address"),$("#carCity").val().length<1&&o.push("City"),$("#carState").val().length<1&&o.push("State / Province"),$("#carZip").val().length<1&&o.push("Zip / Postal Code"),$("#carHomePhone").val().length<1&&o.push("Phone Number"),$("#carCountry").val().length<1&&o.push("Country"),o.length<1&&(n=!0)),0<$("#hostedfields_payment_method_nonce").length)if(0<$("#hostedfields_payment_method_nonce").val().length)$("#carFName").val().length<1&&o.push("First Name"),$("#carLName").val().length<1&&o.push("Last Name"),$("#carAddress1").val().length<1&&o.push("Address"),$("#carCity").val().length<1&&o.push("City"),$("#carState").val().length<1&&o.push("State / Province"),$("#carZip").val().length<1&&o.push("Zip / Postal Code"),$("#carHomePhone").val().length<1&&o.push("Phone Number"),$("#carCountry").val().length<1&&o.push("Country"),o.length<1&&(n=!0);else if(0<$("#braintree-hostedfields-payment-option > #credit-payment:checked").length)return $("#hostedfields_verify-card-button").trigger("click"),$("#order-processing-button").hide(),$("#complete-order-button").show(),!1;if(0<$("#tsys_payment_method_nonce").length&&0<$("#tsys_payment_method_nonce").val().length&&($("#carFName").val().length<1&&o.push("First Name"),$("#carLName").val().length<1&&o.push("Last Name"),$("#carAddress1").val().length<1&&o.push("Address"),$("#carCity").val().length<1&&o.push("City"),$("#carState").val().length<1&&o.push("State / Province"),$("#carZip").val().length<1&&o.push("Zip / Postal Code"),$("#carHomePhone").val().length<1&&o.push("Phone Number"),$("#carCountry").val().length<1&&o.push("Country"),o.length<1&&(n=!0)),0<$("#carCCNumber").length&&$("#carCCNumber").val().length){if($("#carCCNumber").hasClass("validate-credit-card")&&!$("#carCCNumber").validateCreditCard().valid&&!creditCardWarned)return showMessageModal('The credit card number you entered appears to be invalid. Please double check the number, if it is correct just press the "Complete Your Order" button again.'),creditCardWarned=!0,$("#order-processing-button").hide(),$("#complete-order-button").show(),!1;$("#carCCExpiration_Month").val().length<1&&o.push("Credit Card Expiration Date"),$("#carCCExpiration_Year").val().length<1&&o.push("Credit Card Expiration Year"),$("#carCCCVV").val().length<1&&o.push("Credit Card CVV Code");var r=new Date,i=r.getMonth()+1,s=r.getFullYear();($("#carCCExpiration_Year").val()<s||$("#carCCExpiration_Year").val()==s&&$("#carCCExpiration_Month").val()<i)&&o.push("Credit Card Expired"),$("#carFName").val().length<1&&o.push("First Name"),$("#carLName").val().length<1&&o.push("Last Name"),$("#carAddress1").val().length<1&&o.push("Address"),$("#carCity").val().length<1&&o.push("City"),$("#carState").val().length<1&&o.push("State / Province"),$("#carZip").val().length<1&&o.push("Zip / Postal Code"),$("#carHomePhone").val().length<1&&o.push("Phone Number"),$("#carCountry").val().length<1&&o.push("Country"),o.length<1&&(n=!0)}return 0<$("#carHouseAccount").length&&0<$("#house-payment:checked").length&&($("#carHouseAccount").val().length<1&&o.push("House Account Number"),0<$("#carCustomerPONumberRequired").length&&$("#carCustomerPONumber").val().length<1&&o.push("PO Number"),0<$("#carHouseAccountField1Required").length&&0<$("#carHouseAccountField1").length&&$("#carHouseAccountField1").val().length<1&&o.push($('label[for="carHouseAccountField1"]').text()),0<$("#carHouseAccountField2Required").length&&0<$("#carHouseAccountField2").length&&$("#carHouseAccountField2").val().length<1&&o.push($('label[for="carHouseAccountField2"]').text()),$("#carFName").val().length<1&&o.push("First Name"),$("#carLName").val().length<1&&o.push("Last Name"),$("#carAddress1").val().length<1&&o.push("Address"),$("#carCity").val().length<1&&o.push("City"),$("#carState").val().length<1&&o.push("State / Province"),$("#carZip").val().length<1&&o.push("Zip / Postal Code"),$("#carHomePhone").val().length<1&&o.push("Phone Number"),$("#carCountry").val().length<1&&o.push("Country"),o.length<1&&(n=!0)),0<$("#coupa-payment").length&&0<$("#coupa-payment:checked").length&&($("#carFName").val().length<1&&o.push("First Name"),$("#carLName").val().length<1&&o.push("Last Name"),$("#carAddress1").val().length<1&&o.push("Address"),$("#carCity").val().length<1&&o.push("City"),$("#carState").val().length<1&&o.push("State / Province"),$("#carZip").val().length<1&&o.push("Zip / Postal Code"),$("#carHomePhone").val().length<1&&o.push("Phone Number"),$("#carCountry").val().length<1&&o.push("Country"),o.length<1&&(n=!0)),0<$("#prqNotificationEmailAddress").length&&0<$("#oepr-payment:checked").length&&($("#prqNotificationEmailAddress").val().length<1&&o.push("Florist Notification Email"),$("#prqRequestEmailAddress").val().length<1&&$("#prqRequestPhone").val().length<1&&o.push("Payment Request Email/Phone"),$("#carFName").val().length<1&&o.push("First Name"),$("#carLName").val().length<1&&o.push("Last Name"),$("#carAddress1").val().length<1&&o.push("Address"),$("#carCity").val().length<1&&o.push("City"),$("#carState").val().length<1&&o.push("State / Province"),$("#carZip").val().length<1&&o.push("Zip / Postal Code"),$("#carHomePhone").val().length<1&&o.push("Phone Number"),$("#carCountry").val().length<1&&o.push("Country"),o.length<1&&(n=!0)),0<$("#carCheckAmount").length&&0<$("#check-payment:checked").length&&((t=$("#carCheckAmount").val()).length<1&&o.push("Check Amount"),t.replace("$",""),t.replace(",",""),"NaN"===(t=parseFloat(t))&&o.push("Check Amount"),t<parseFloat(orderBalance)&&o.push("Check Amount Short"),0<$("#carCheckNumber.required").length&&$("#carCheckNumber").val().length<1&&o.push("Check Number"),o.length<1&&(n=!0)),0<$("#carCashAmount").length&&0<$("#cash-payment:checked").length&&((a=$("#carCashAmount").val()).length<1&&o.push("Cash Amount"),a.replace("$",""),a.replace(",",""),"NaN"===(a=parseFloat(a))&&o.push("Cash Amount"),a<parseFloat(orderBalance)&&o.push("Cash Amount Short"),0<$("#requireCashDrawer").length&&($("#cashDrawerID").length<1||$("#cashDrawerID").val().length<1)&&o.push("Select Cash Drawer"),o.length<1&&(n=!0)),0<$("#oeipReaderID").length&&0<$("#oeip-payment:checked").length&&($("#oeipReaderID").val().length<1&&o.push("Card Reader"),o.length<1&&(n=!0)),n?void 0:(0<o.length?showFormErrors(o):showMessageModal("Please choose a payment method and fill out the necessary information."),$("#order-processing-button").hide(),$("#complete-order-button").show(),!1)}).trigger("change"),$("#manual-payment-form").on("submit.validate",function(e){$("#process-payment-button").hide(),$("#payment-processing-button").show();var t=[];if($("#carZip").val().length<1&&t.push("Zip / Postal Code"),$("#hostedfields_payment_method_nonce").val().length<1&&t.push("Credit Card Information"),0<t.length)return $("#payment-processing-button").hide(),$("#process-payment-button").show(),showFormErrors(t),!1}),$(".checkout-forgot-password-link").on("click.send",function(e){e.preventDefault();var t=$('#checkout-login-username input[name="username"]').val();$.post("/scripts/send-forgot-password-email.cfm","gfRQV="+encodeURIComponent($("#rqv").val())+"&memEmail="+encodeURIComponent(t),function(e){if(!e.SUCCESS)return e.RELOAD?showMessageModal(e.MESSAGE,"Error","Close",[],"/cart/add/step1.cfm"):showMessageModal(e.MESSAGE),!1;showMessageModal("Email has been sent")},"json")}),$("#checkout-send-login-link").on("click.send",function(e){e.preventDefault();var t=$('#checkout-login-username input[name="username"]').val();$.post("/scripts/checkout-send-login-link.cfm","gfRQV="+encodeURIComponent($("#rqv").val())+"&memEmail="+encodeURIComponent(t),function(e){if(!e.SUCCESS)return e.RELOAD?showMessageModal(e.MESSAGE,"Error","Close",[],"/cart/add/step1.cfm"):showMessageModal(e.MESSAGE,"Error"),!1;showMessageModal("Email has been sent")},"json")}),0<$("#carTip").length&&($("#carTip").on("change.settiptype",function(e){$("#setTip_99").prop("checked",!0),showMessageModal('<p>Please wait while your tip is applied to the order...</p><div id="tip-loading"><div class="loader loader-sm"><img src="/assets/img/spinner.svg" alt="" style="widht:100px;height:100px;"></div></div>',"Applying Tip","Thank You"),saveTip()}),$("#setTip_5").on("change.calctip",function(e){var t;0<$("#setTip_5:checked").length&&(t=(t=parseFloat($("#setTip_5").val())).toFixed(2),$("#carTip").val("$"+t),showMessageModal('<p>Please wait while your tip is applied to the order...</p><div id="tip-loading"><div class="loader loader-sm"><img src="/assets/img/spinner.svg" alt="" style="widht:100px;height:100px;"></div></div>',"Applying Tip","Thank You"),saveTip())}),$("#setTip_10").on("change.calctip",function(e){var t;0<$("#setTip_10:checked").length&&(t=parseFloat($("#setTip_10").val()),$("#carTip").val("$"+t),showMessageModal('<p>Please wait while your tip is applied to the order...</p><div id="tip-loading"><div class="loader loader-sm"><img src="/assets/img/spinner.svg" alt="" style="widht:100px;height:100px;"></div></div>',"Applying Tip","Thank You"),saveTip())}),$("#setTip_0").on("change.calctip",function(e){var t,a;0<$("#setTip_0:checked").length&&(a=0,t=$("#carTip").val(),a=a.toFixed(2),""!=t&&"$0.00"!=t&&($("#carTip").val("$"+a),showMessageModal('<p>Please wait while your tip is applied to the order...</p><div id="tip-loading"><div class="loader loader-sm"><img src="/assets/img/spinner.svg" alt="" style="widht:100px;height:100px;"></div></div>',"Applying Tip","Thank You"),saveTip()))})),$("#copy-sender-address-to-billing").on("click.copy",function(e){$("#carBraintreePaymentFName").val($("#carFName").val().substring(0,100)),$("#carBraintreePaymentLName").val($("#carLName").val().substring(0,100)),$("#carBraintreePaymentAddress1").val($("#carAddress1").val().substring(0,255)),$("#carBraintreePaymentAddress2").val($("#carAddress2").val().substring(0,255)),$("#carBraintreePaymentCity").val($("#carCity").val().substring(0,100)),$("#carBraintreePaymentState").val($("#carState").val().substring(0,100)),$("#carBraintreePaymentZip").val($("#carZip").val().replace(/[^0-9a-zA-Z]+/g,"").substring(0,9)),$("#carBraintreePaymentCountry").val($("#carCountry").val().substring(0,2).toUpperCase()),"UN"===$("#carBraintreePaymentCountry").val().toUpperCase()&&$("#carBraintreePaymentCountry").val("US"),$("#carBraintreePaymentPhone").val($("#carHomePhone").val().replace(/[^0-9\-\(\)]+/g,"").substring(0,14))})});var cartProductQtySetter=null;function updateCartQuantities(){var e=$("#checkout-cart-quantities").serialize();$("#cart-total-value").html('<div class="loader loader-sm"><img src="/assets/img/spinner.svg" alt="" style="width:30px;height:30px;"></div>'),$.ajax({url:"/scripts/cart-update-product-quantities.cfm",type:"POST",data:e,cache:!1,processData:!1,dataType:"json",success:function(e){e.SUCCESS&&(document.location.href="/cart/")}})}$(function(){$(".reminder-checkbox").on("change.setreminder",function(e){var t=$(this),a=t.data("corid"),n=t.filter(":checked").length,o=$('label[for="'+t.prop("id")+'"]');o.append('<div class="loader loader-sm"><img src="/assets/img/spinner.svg" alt="" style="width:15px;height:15px;"></div>'),$.get("/scripts/cart-set-reminder.cfm?corID="+a+"&corWantsReminder="+n,function(e){o.find("div.loader").remove()}).fail(function(e){o.find("div.loader").remove(),1===n?t.prop("checked",!1):t.prop("checked",!0)})}),$(".basket-promo-toggler").on("click.toggle",function(e){$(".basket-promo-toggler").hide(),$(".basket-promo").show().addClass("toggler-off"),$(".basket-promo input").focus()}),$(".basket-promo input").on("keydown",function(e){var t=e.which;13===t?$(".basket-promo button").trigger("click"):27===t&&($(".basket-promo").hide().removeClass("toggler-off"),$(".basket-promo-toggler").show().focus())}),$(".basket-promo button").on("click.setpromo",function(e){var t=escape($("#carOfferCode").val());if(!(0<t.length))return showMessageModal("Please enter a code"),$("#carOfferCode").focus(),!1;$(".basket-promo button").html('Applying <div class="loader loader-sm"><img src="/assets/img/spinner.svg" alt="" style="width:15px;height:15px;"></div>'),$.get("/scripts/cart-set-promo.cfm?carOfferCode="+t,function(e){"valid"===e?document.location.reload():($(".basket-promo button").html('Apply<span class="hidden-xs"> to Order</span>'),showMessageModal(e))})}),$(".remove-order-alert").on("click.confirm",function(e){if(!confirm("Are you sure you want to removed this entire order from your cart?"))return e.stopImmediatePropagation(),e.preventDefault(),!1}),$("input[name='carIsTaxExempt']").on("change.exempt",function(){$.get("/sharedIncludes/checkout-setTaxExempt.cfm?carIsTaxExempt="+$(this).val(),function(){document.location.reload()})}),$("input.product-qty-setter").on("change.setqty",function(e){null!==cartProductQtySetter&&clearTimeout(cartProductQtySetter),cartProductQtySetter=setTimeout("updateCartQuantities();",1e3)})}),$(function(){0<$("#checkout-payment-form, #order-entry-gift-card-payment-fields").length&&0<$("#clutch-gift-card-button").length&&$("#clutch-gift-card-button").on("click.apply",function(e){var t=$("#clutch-gift-card").val(),a=$("#clutch-pin").val();$("#clutch-payment-container").append('<div id="clutch-payment-loading"><div class="loader loader-sm"><img src="/assets/img/spinner.svg" alt="" style="widht:30px;height:30px;"></div></div>'),e.preventDefault(),$.get("/scripts/clutch-gift-card-apply.cfm?gcnum="+t+"&gcpin="+a,function(e){if(0<$("#order-entry-gift-card-payment-fields").length&&parent.loadCart(),e.SUCCESS)return $.get("/scripts/checkout-clear-payment-nonces.cfm",function(e){document.location.reload()}),!1;showMessageModal("We were unable to apply your gift card, please try again"),$("#clutch-gift-card,#clutch-pin").val(""),$("#clutch-payment-loading").remove()},"json").fail(function(e){showMessageModal("We were unable to apply your gift card, please try again"),$("#clutch-gift-card,#clutch-pin").val(""),$("#clutch-payment-loading").remove()})})}),$(function(){var t=$(".dropdown");function r(e){(0<arguments.length&&void 0!==e?e:t).each(function(){$(this).removeClass("active"),$(this).find(".dropdown-menu").attr("aria-expanded","false")})}0<t.length&&(t.each(function(){var t=$(this),e=t.find(".dropdown-toggle"),a=t.find(".dropdown-menu"),n=$(".dropdown").not(t),o=new Popper(t,a,{placement:"bottom-start",modifiers:{preventOverflow:{boundariesElement:"viewport"}}});e.on("click",function(e){e.stopPropagation(),e.preventDefault(),o.scheduleUpdate(),r(n),t.toggleClass("active"),toggleAriaExpanded(a)})}),$(".dropdown-menu").on("click",function(e){e.stopPropagation()}),$(document).on("click",function(){r()}))}),$(function(){0<$("#checkout-payment-form, #order-entry-gift-card-payment-fields").length&&0<$("#fmgc-gift-card-button").length&&$("#fmgc-gift-card-button").on("click.apply",function(e){var t=$("#fmgc-gift-card").val(),a=$("#fmgc-pin").val();$("#fmgc-payment-container").append('<div id="fmgc-payment-loading"><div class="loader loader-sm"><img src="/assets/img/spinner.svg" alt="" style="widht:30px;height:30px;"></div></div>'),e.preventDefault(),$.get("/scripts/fmgc-gift-card-apply.cfm?gcnum="+t+"&gcpin="+a,function(e){if(0<$("#order-entry-gift-card-payment-fields").length&&parent.loadCart(),e.SUCCESS)return $.get("/scripts/checkout-clear-payment-nonces.cfm",function(e){document.location.reload()}),!1;showMessageModal("We were unable to apply your gift card, please try again"),$("#fmgc-gift-card,#fmgc-pin").val(""),$("#fmgc-payment-loading").remove()},"json").fail(function(e){showMessageModal("We were unable to apply your gift card, please try again"),$("#fmgc-gift-card,#fmgc-pin").val(""),$("#fmgc-payment-loading").remove()})}),0<$("#checkout-payment-form, #order-entry-gift-card-payment-fields").length&&0<$("#mgcID").length&&$("#mgcID").on("change.setgc",function(){var e=$("#mgcID > option:selected").attr("data-cardnum"),t=$("#mgcID > option:selected").attr("data-cardpin");e.length&&t.length&&($("#fmgc-gift-card, #clutch-gift-card, #profitpoint-gift-card").val(e),$("#fmgc-pin, #clutch-pin, #profitpoint-pin").val(t),$("#fmgc-gift-card-button, #clutch-gift-card-button, #profitpoint-gift-card-button").trigger("click"))})}),$(function(){$("#funeralscene").length&&($(".funeralscene-container a").mouseover(function(e){var t,a,n;$(".funeral-panel").length||(t=$(this).data("id"),a=$(this).data("title"),n=$(this).data("pricerange"),$('<div class="funeral-panel"><a href="/product.cfm?iteID='+t+'" class="funeral-title">'+a+'</a><span class="funeral-price">'+n+'</span><a href="/product.cfm?iteID='+t+'" class="btn btn-xs funeral-btn" data-ga-category="Product Scene" data-ga-label="'+a+'">click to view</a></div>').appendTo("body"))}).mouseleave(function(e){$(".funeral-panel").length&&$(".funeral-panel").remove()}).mousemove(function(e){var t=e.pageX,a=e.pageY;$(".funeral-panel").css({top:a,left:t})}),$("div.funeralscene-arrow svg").on("click.go",function(e){location.href=$(this).data("href")}),$([document.documentElement,document.body]).animate({scrollTop:$(".product-info").offset().top},1e3))}),$(function(){$("#instant-drawing-winner-form").on("submit.validate",function(e){var t=[];if($("#winName").val().length<1&&t.push("Name"),($("#winEmail").val().length<1||$("#winEmail").val().indexOf("@")<0)&&t.push("Email Address"),$("#winPhone").val().length<1&&t.push("Phone"),0<t.length)return showFormErrors(t),!1})});var focusedElementBeforeModal,checkForMobileVariations,mediaQuery,variationphotos=[],prevphotos=[],nextphotos=[];function showFormErrors(e){showMessageModal("Before we can move on, we'll need you to go back and fix:","One Moment Please...","Make Corrections",e)}function showMessageModal(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"Notice",a=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"Close",n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:[],o=4<arguments.length&&void 0!==arguments[4]?arguments[4]:"",r=5<arguments.length&&void 0!==arguments[5]?arguments[5]:"",i=6<arguments.length&&void 0!==arguments[6]?arguments[6]:"";for(var s in focusedElementBeforeModal=$("main"),t.length<1&&(t="Notice"),a.length<1&&(a="Close"),$("#main-message-modal .modal-alt-cta").hide(),$("#main-message-modal .modal-cta").off("click.modalcta"),$("#main-message-modal .modal-alt-cta").off("click.modalcta"),$("#main-message-modal .modal-headline").html(t),0<e.length?$("#main-message-modal .modal-message").html(e).show():$("#main-message-modal .modal-message").hide(),$("#main-message-modal .modal-cta").html(a),0<o.length?6<o.length&&"click|"===o.substring(0,6)?($("#main-message-modal .modal-cta").attr("href","#"),$("#main-message-modal .modal-cta").on("click.modalcta",function(e){e.preventDefault(),$(o.substring(6)).trigger("click")})):$("#main-message-modal .modal-cta").attr("href",o):$("#main-message-modal .modal-cta").attr("href","#"),0<r.length&&($("#main-message-modal .modal-alt-cta").show(),$("#main-message-modal .modal-alt-cta").html(r),6<i.length&&"click|"===i.substring(0,6)?($("#main-message-modal .modal-alt-cta").attr("href","#"),$("#main-message-modal .modal-alt-cta").on("click.modalcta",function(e){e.preventDefault(),$(i.substring(6)).trigger("click")})):$("#main-message-modal .modal-cta").attr("href",i)),$("#main-message-modal .callout-list").html("").hide(),n)$("#main-message-modal .callout-list").show().append('<li><strong class="modal-error">'+n[s]+"</strong></li>");$("#main-message-modal.modal-alert").addClass("modal-open").attr("aria-hidden",!1).show().focus()}$(function(){$(".item-variation-previous-photo").on("click.previousphoto",function(e){var t=$(this).closest("div.product-photo-caption").data("varid"),a=$("#varpic"+t).children("picture"),n=$("#prevpic"+t).children("picture"),o=$("#nextpic"+t).children("picture");void 0===variationphotos[t]&&(variationphotos[t]={},variationphotos[t].count=a.length,variationphotos[t].current=1),a.eq(variationphotos[t].current-1).hide(),variationphotos[t].current--,variationphotos[t].current<1&&(variationphotos[t].current=variationphotos[t].count),a.eq(variationphotos[t].current-1).show(),void 0===prevphotos[t]&&(prevphotos[t]={},prevphotos[t].count=n.length,prevphotos[t].current=1),n.eq(prevphotos[t].current-1).hide(),prevphotos[t].current--,prevphotos[t].current<1&&(prevphotos[t].current=prevphotos[t].count),n.eq(prevphotos[t].current-1).show(),void 0===nextphotos[t]&&(nextphotos[t]={},nextphotos[t].count=o.length,nextphotos[t].current=1),o.eq(nextphotos[t].current-1).hide(),nextphotos[t].current--,nextphotos[t].current<1&&(nextphotos[t].current=nextphotos[t].count),o.eq(nextphotos[t].current-1).show()}),$(".item-variation-next-photo").on("click.nextphoto",function(e){var t=$(this).closest("div.product-photo-caption").data("varid"),a=$("#varpic"+t).children("picture"),n=$("#prevpic"+t).children("picture"),o=$("#nextpic"+t).children("picture");void 0===variationphotos[t]&&(variationphotos[t]={},variationphotos[t].count=a.length,variationphotos[t].current=1),a.eq(variationphotos[t].current-1).hide(),variationphotos[t].current++,variationphotos[t].current>variationphotos[t].count&&(variationphotos[t].current=1),a.eq(variationphotos[t].current-1).show(),void 0===prevphotos[t]&&(prevphotos[t]={},prevphotos[t].count=n.length,prevphotos[t].current=1),n.eq(prevphotos[t].current-1).hide(),prevphotos[t].current++,prevphotos[t].current>prevphotos[t].count&&(prevphotos[t].current=1),n.eq(prevphotos[t].current-1).show(),void 0===nextphotos[t]&&(nextphotos[t]={},nextphotos[t].count=o.length,nextphotos[t].current=1),o.eq(nextphotos[t].current-1).hide(),nextphotos[t].current++,nextphotos[t].current>nextphotos[t].count&&(nextphotos[t].current=1),o.eq(nextphotos[t].current-1).show()})}),function(i){i.ageCheck=function(e){var o=i.extend({minAge:21,redirectTo:"",redirectOnFail:"",title:"Age Verification",copy:"This Website requires you to be [21] years or older to enter. Please enter your Date of Birth in the fields below in order to continue:"},e),r={month:"",day:"",year:"",age:"",errors:Array(),setValues:function(){var e=i(".ac-container .month").val(),t=i(".ac-container .day").val();r.month=e,r.day=t.replace(/^0+/,""),r.year=i(".ac-container .year").val()},validate:function(){return!(r.errors=[])===/^([0-9]|[12]\d|3[0-1])$/.test(r.day)&&r.errors.push("Day is invalid or empty"),!1===/^(19|20)\d{2}$/.test(r.year)&&r.errors.push("Year is invalid or empty"),r.clearErrors(),r.displayErrors(),r.errors.length<1},clearErrors:function(){i(".errors").html("")},displayErrors:function(){for(var e="<ul>",t=0;t<r.errors.length;t++)e+="<li><span>x</span>"+r.errors[t]+"</li>";e+="</ul>",setTimeout(function(){i(".ac-container .errors").html(e)},200)},reCenter:function(e){e.css("top",Math.max(0,(i(window).height()-(e.outerHeight()+150))/2)+"px"),e.css("left",Math.max(0,(i(window).width()-e.outerWidth())/2)+"px")},buildHtml:function(){var e=o.copy,t=["January","February","March","April","May","June","July","August","September","October","November","December"],a="";a+='<div class="ac-overlay"></div>',a+='<div class="ac-container">',a+="<h2>"+o.title+"</h2>",a+="<p>"+e.replace("[21]","<strong>"+o.minAge+"</strong>"),a+='<div class="errors"></div>',a+='<div class="fields"><select class="month">';for(var n=0;n<t.length;n++)a+='<option value="'+n+'">'+t[n]+"</option>";a+="</select>",a+='<input class="day" maxlength="2" placeholder="dd" />',a+='<input class="year" maxlength="4" placeholder="yyyy"/>',a+="<button class='btn btn-action' style='color:#fff !important;'>Submit</button></div></div>",i("body").append(a),i(".ac-overlay").animate({opacity:.8},500,function(){r.reCenter(i(".ac-container")),i(".ac-container").css({opacity:1})}),i(".ac-container .day, .ac-container .year").focus(function(){i(this).removeAttr("placeholder")})},setAge:function(){r.age="";var e=new Date(r.year,r.month,r.day),t=Date.now()-e.getTime(),a=new Date(t);r.age=Math.abs(a.getUTCFullYear()-1970)},setSessionStorage:function(e,t){try{return sessionStorage.setItem(e,t),!0}catch(e){return!1}},handleSuccess:function(){i(".ac-container").html("<h3>Success!</h3><p>You are now being redirected back to the application...</p>"),setTimeout(function(){i(".ac-container").animate({top:"-350px"},200,function(){i(".ac-overlay").animate({opacity:"0"},500,function(){""!=o.redirectTo?window.location.replace(o.redirectTo):i(".ac-overlay, .ac-container").remove()})})},2e3)},handleUnderAge:function(){i(".ac-container").html("<h3>Sorry, one or more of the products contains alcohol and you are under age and therefore unable to view / order them...</h3>"),""!=o.redirectOnFail&&setTimeout(function(){window.location.replace(o.redirectOnFail)},2e3)}};return"true"!=sessionStorage.getItem("ageVerified")&&(r.buildHtml(),i(".ac-container button").on("click",function(){r.setValues(),!0===r.validate()&&(r.setAge(),r.age>=o.minAge?(r.setSessionStorage("ageVerified","true")||console.log("sessionStorage not supported by your browser"),r.handleSuccess()):r.handleUnderAge())}),void i(window).resize(function(){r.reCenter(i(".ac-container")),setTimeout(function(){r.reCenter(i(".ac-container"))},500)}))}}(jQuery),$(function(){$("[data-modal]").click(function(){focusedElementBeforeModal=$(":focus");var e=$(this).data("modal");$(e).addClass("modal-open").attr("aria-hidden",!1).focus()}),$(".modal-close, .modal-shade, .modal-cta").click(function(){var e=$(this).closest(".modal");$(e).removeClass("modal-open").attr("aria-hidden",!0);try{focusedElementBeforeModal.focus()}catch(e){}}),$(".modal").keyup(function(e){27===e.keyCode&&$(".modal").removeClass("modal-open").attr("aria-hidden",!0)}),$(".modal").addClass("modal-ready")}),$(function(){var e=$(".navigation-reveal"),t=$(".navbar-toggler"),a=$(".header-search-reveal"),n=$(".header-search-toggler");0<t.length&&(t.on("click.togglenav",function(){toggleAriaExpanded($(this)),e.toggleClass("open")}),n.on("click.togglesearch",function(){toggleAriaExpanded($(this)),a.toggleClass("open")}))}),0<$("#preview-date-set-button").length&&($("#preview-date-set-button").on("click.setpreviewdate",function(e){e.preventDefault(),e.stopImmediatePropagation(),$.get("/scripts/preview-date-set.cfm",$("#preview-date-setup-form").serialize(),function(e){document.location.reload()})}),$("#preview-date-clear-button").on("click.clearpreviewdate",function(e){e.preventDefault(),e.stopImmediatePropagation(),$.get("/scripts/preview-date-set.cfm",function(e){document.location.reload()})})),document.querySelectorAll("ul.variation-list li")[1]&&(checkForMobileVariations=function(e){var t,a,n;e.matches?(_toConsumableArray(document.querySelectorAll("input.variation-option")).forEach(function(e){e.removeAttribute("checked")}),_toConsumableArray(document.querySelectorAll("input.variation-option[data-preselected]")).forEach(function(e){e.setAttribute("checked","")}),document.querySelectorAll("a.variationScrollMessage").length||((t=document.createElement("a")).setAttribute("class","variationScrollMessage"),t.setAttribute("href","#variationsAnchor"),a=document.querySelectorAll("div.product-photo")[0],t.innerHTML="<strong class='variationScrollTitle'>Multiple Designs Available</strong>Tap to Choose One",a.insertBefore(t,a.firstChild))):(_toConsumableArray(document.querySelectorAll("input.variation-option[data-preselected]")).forEach(function(e){e.setAttribute("checked","")}),(n=document.querySelectorAll("a.variationScrollMessage")[0])&&n.remove())},(mediaQuery=window.matchMedia("(max-width: 767px)")).addEventListener("change",function(e){checkForMobileVariations(e)}),checkForMobileVariations(mediaQuery)),$(function(){0<$("#checkout-payment-form, #order-entry-gift-card-payment-fields").length&&0<$("#profitpoint-gift-card-button").length&&$("#profitpoint-gift-card-button").on("click.apply",function(e){var t=$("#profitpoint-gift-card").val(),a=$("#profitpoint-pin").val();$("#profitpoint-payment-container").append('<div id="profitpoint-payment-loading"><div class="loader loader-sm"><img src="/assets/img/spinner.svg" alt="" style="widht:30px;height:30px;"></div></div>'),e.preventDefault(),$.get("/scripts/profitpoint-gift-card-apply.cfm?gcnum="+t+"&gcpin="+a,function(e){if(0<$("#order-entry-gift-card-payment-fields").length&&parent.loadCart(),e.SUCCESS)return $.get("/scripts/checkout-clear-payment-nonces.cfm",function(e){document.location.reload()}),!1;showMessageModal("We were unable to apply your gift card, please try again"),$("#profitpoint-gift-card,#profitpoint-pin").val(""),$("#profitpoint-payment-loading").remove()},"json").fail(function(e){showMessageModal("We were unable to apply your gift card, please try again"),$("#profitpoint-gift-card,#profitpoint-pin").val(""),$("#profitpoint-payment-loading").remove()})})}),$(function(){0<$("#requested-payment-form").length&&$("#requested-payment-form").on("submit.validate",function(e){$("#process-payment-button").hide(),$("#payment-processing-button").show();var t=[];return 0<$("#braintree-hostedfields-payment-option > #credit-payment:checked").length&&$("#hostedfields_payment_method_nonce").val().length<1?($("#process-payment-button").show(),$("#payment-processing-button").hide(),$("#hostedfields_verify-card-button").trigger("click"),!1):(0<$("#braintree-applepay-payment-option > #applepay-payment:checked").length&&$("#applepay_payment_method_nonce").val().length<1?t.push("Please click the Apple Pay logo and finalize your payment before continuing."):0<$("#braintree-paypal-payment-option > #paypal-payment:checked").length&&$("#paypal_payment_method_nonce").val().length<1?t.push("Please click the PayPal logo and finalize your payment before continuing."):0<$("#braintree-venmo-payment-option > #venmo-payment:checked").length&&$("#venmo_payment_method_nonce").val().length<1?t.push("Please click the Venmo logo and finalize your payment before continuing."):$('input[name="payment"]:checked').length<1&&t.push("Please choose a payment type and fill out the necessary information"),0<$("#braintree-hostedfields-payment-option > #credit-payment:checked").length&&0<$("#hostedfields_payment_method_nonce").val().length&&$("#braintreeVaultCards").val().length<1&&($("#carBraintreePaymentFName").val().length<1&&t.push("First Name"),$("#carBraintreePaymentLName").val().length<1&&t.push("Last Name"),$("#carBraintreePaymentAddress1").val().length<1&&t.push("Street Address"),$("#carBraintreePaymentZip").val().length<1&&t.push("Zip / Postal Code")),0<t.length?($("#payment-processing-button").hide(),$("#process-payment-button").show(),showFormErrors(t),!1):void 0)})}),$(function(){$(".owl-carousel.reviews-page").length&&$(".owl-carousel.reviews-page").owlCarousel({loop:!1,nav:!0,dots:!1,responsive:{0:{items:2},600:{items:3},768:{items:4},992:{items:5},1200:{items:5}}})});try{$(function(){var e;0<$("#suggestivesearch").length&&$("#suggestivesearch").selectize((_defineProperty(e={valueField:"term",labelField:"term",searchField:"term",maxOptions:"10",closeAfterSelect:!1,selectOnTab:!0,options:[],create:!0,persist:!1,preload:!1,copyClassesToDropdown:!1,highlight:!1,optgroupField:"group",optgroupLabelField:"name",optgroupValueField:"id",filter:!1,nesting:!0,optgroups:[{$order:1,id:"suggestion",name:"May We Suggest"}],score:function(e){var t=this.getScoreFunction(e);return function(e){return+t(e)}}},"create",function(e){return{term:e}}),_defineProperty(e,"render",{option:function(e,t){return'\n              <div>\n                <span class="title">\n                  <span class="name">'.concat(t(e.term),"</span>\n                </span>\n              </div>\n            ")},option_create:function(e,t){return'<div class="create">Search for <strong>'+t(e.input)+"</strong>&hellip;</div>"}}),_defineProperty(e,"onType",function(e){""===e?this.close():$("#searchform button").val(e)}),_defineProperty(e,"load",function(e,t){if(this.options=this.sifter.items={},!e.length)return t();$.ajax({url:"/search/suggest.cfc?method=getSuggestions&query="+e,type:"GET",dataType:"json",error:function(){t()},success:function(e){e.results.length;t(e.results)}})}),_defineProperty(e,"onChange",function(){$("#searchform").submit()}),_defineProperty(e,"onClear",function(){}),e))})}catch(e){}$("#searchform button[type='submit']").on("click.submit",function(e){return e.preventDefault(),$(this).val()&&(location.href="/search/?keyword="+$(this).val()),!1}),$(function(){$(".rating-star-input").on("click.rate",function(e){document.location.href="thankYou.cfm?rating="+$(this).val()})}),$(function(){$(".owl-carousel").length&&$(".owl-carousel").owlCarousel({loop:!1,margin:10,nav:!0,responsive:{0:{items:2},600:{items:3},768:{items:4},992:{items:5},1200:{items:6}}})});var memSendOrderReceiptsToggleCounter=0;$(function(){$("#mmsUnsubscribeAll").on("click.setnone",function(e){0<$(this).filter(":checked").length?$("#mmsMarketingEmails,#mmsMonthlySummary,#mmsMajorHolidays,#mmsRewardStatement,#mmsSubscribeAll").prop("checked",!1):$("#mmsMarketingEmails,#mmsMonthlySummary,#mmsMajorHolidays,#mmsRewardStatement,#mmsSubscribeAll").prop("checked",!0)}),$("#mmsSubscribeAll").on("click.setall",function(e){0<$(this).filter(":checked").length&&($("#mmsMarketingEmails,#mmsMonthlySummary,#mmsMajorHolidays,#mmsRewardStatement").prop("checked",!0),$("#mmsUnsubscribeAll").prop("checked",!1))}),$("#mmsMarketingEmails,#mmsMonthlySummary,#mmsMajorHolidays,#mmsRewardStatement").on("click.change",function(e){0<$(this).filter(":checked").length?($("#mmsUnsubscribeAll").prop("checked",!1),4===$("#mmsMarketingEmails,#mmsMonthlySummary,#mmsMajorHolidays,#mmsRewardStatement").filter(":checked").length&&$("#mmsSubscribeAll").prop("checked",!0)):$("#mmsSubscribeAll").prop("checked",!1)}),$("#memSendOrderReceiptsToggle").on("click",function(e){var t=memSendOrderReceiptsToggleCounter;memSendOrderReceiptsToggleCounter++,$.get("/scripts/account-send-receipts-toggle.cfm",{memSendOrderReceiptsToggleCounter:t,memSendOrderReceipts:!$("#memSendOrderReceiptsToggle").is(":checked")})})});var tsysErrorField="";function tsysCreditCardRemove(){$("#tsys_payment_method_nonce").val(""),$("#tsys-creditcard-payment-option").hide().remove(),$(".payment-reveal__credit").remove(),$("#credit").remove(),$("#tsys-creditcard-payment-option").remove(),checkoutHasTSYS=!1}function setupTSYSCreditCardPayment(){$("#tsys-credit-payment-option").show(),checkoutHasTSYS=!0}function tsepHandler(e,t){if(checkoutHasTSYS)switch(e){case"FocusOnEvent":break;case"FocusOutEvent":t.fieldName===tsysErrorField&&$("#PaymentMethod-TSYSCreditCard-Note-Message").html("").hide();break;case"BlurEvent":break;case"FieldValidationErrorEvent":$("#tsys_payment_method_nonce").val(""),$("#PaymentMethod-TSYSCreditCard-Note").hide(),$("#PaymentMethod-TSYSCreditCard-Note-Error").hide(),$("#PaymentMethod-TSYSCreditCard-Note-Message").html(t.message).show(),$("#carPaymentInfo").val(""),tsysErrorField=t.fieldName;break;case"ErrorEvent":switch(t.responseCode){case"TSEPERR911":$("#tab1").hide(),$("#PaymentMethodTab-CreditCard").hide(),$("#tsys_payment_method_nonce").val(""),$("#carPaymentInfo").val(""),$("#paymentTabs > a:visible").eq(0).trigger("click"),checkoutHasTSYS=!1;break;default:$("#tab1").hide(),$("#PaymentMethodTab-CreditCard").hide(),$("#tsys_payment_method_nonce").val(""),$("#carPaymentInfo").val(""),$("#paymentTabs > a:visible").eq(0).trigger("click"),checkoutHasTSYS=!1}break;case"TokenEvent":checkoutHasTSYS=("PASS"===t.status?($("#tsys_payment_method_nonce").val(t.tsepToken),$("#PaymentMethod-TSYSCreditCard").hide(),$("#PaymentMethod-TSYSCreditCard-Note").show(),$("#PaymentMethod-TSYSCreditCard-Note-Error").hide(),$("#PaymentMethod-TSYSCreditCard-Note-Message").hide(),$("#carPaymentInfo").val(t.cardType+"##"+t.tsepToken+"|"+t.expirationDate.substring(0,2)+"/"+t.expirationDate.substring(5)+"| Card Type: "+t.cardType+" | Last 4: "+t.maskedCardNumber+" | Trans ID:"+t.transactionID)):($("#tsys_payment_method_nonce").val(""),$("#PaymentMethod-TSYSCreditCard").hide(),$("#PaymentMethod-TSYSCreditCard-Note").hide(),$("#PaymentMethod-TSYSCreditCard-Note-Error").show(),$("#PaymentMethod-TSYSCreditCard-Note-Message").hide(),$("#carPaymentInfo").val("")),!1)}}function zipCodeFiltered(e,t){switch(t=void 0!==t&&t,$(".zipfilter-toggle").get(0)._tippy.state.visible&&$(".zipfilter-toggle").get(0)._tippy.hide(),e.RESULT){case"Unknown Zipcode":return showMessageModal("We do not recognize that zip code, please be sure you are entering a valid zip code."),!1;case"Delivery Not Allowed":return void 0!==_typeof(e.MESSAGE)?showMessageModal(e.MESSAGE,e.TITLE,e.BUTTONTEXT,[],e.BUTTONURL):showMessageModal("Sorry we are unable to deliver to that zip code."),!1}t?document.location.href="/":document.location.reload()}0<$("#tsys_payment_method_nonce").length&&setupTSYSCreditCardPayment(),$(function(){$("body").on("click.filter","button.zip-localization-button",function(e){var t=$(this).closest("div.shopping-form").find(".zip-localization-input").val();$.get("/scripts/setupLocalization.cfm?zipForLocalization="+t,function(e){try{gtag("event","Filtered",{event_label:t,event_category:"Zip Code"})}catch(e){}zipCodeFiltered(e)},"json")}),$("body").on("click.filterwillcall","button.zip-localization-pickup-button",function(e){var t=$(this).data("zip");$.get("/scripts/setupLocalization.cfm?zipForLocalization="+t,function(e){try{gtag("event","Filtered",{event_label:t,event_category:"Zip Code"})}catch(e){}zipCodeFiltered(e)},"json")}),$("body").on("click.filterremove",".zip-localization-remove",function(e){$.get("/scripts/setupLocalization.cfm?zipForLocalization=",function(e){zipCodeFiltered(e,!0)},"json")}),$("body").on("click.closezipfilter",".zip-filter-close",function(e){$(".zipfilter-toggle").each(function(e){$(this).get(0)._tippy.state.visible&&$(this).get(0)._tippy.hide()})})});var hasTouchEvents=!1,numberCheckedOnAddress=!1,branchLocations={},autoFocusField="";function doAutoFocus(){0<autoFocusField.length&&(setTimeout("$('#"+autoFocusField+"').focus();",500),autoFocusField="")}function selectizeStandardSelects(){$("select.standard").length&&$("select.standard").not(".selectized").each(function(e,t){var a=$(this).selectize({})[0].selectize;$(this).data("selectizeapi",a)})}-1!=navigator.userAgent.indexOf("Safari")&&-1==navigator.userAgent.indexOf("Chrome")&&($("body").addClass("is-safari"),$("head").append('<link rel="stylesheet" href="/includes/old-safari.css" type="text/css" />')),$(function(){var e,t;tippy(".zipfilter-toggle",{duration:0,html:"#zip_filter",interactive:!0,maxWidth:"320px",theme:"zipfilter",trigger:"click",placement:"bottom",offset:"0, 5px",onShow:function(){$("body").addClass("zip-dimmer")},onHide:function(){$("body").removeClass("zip-dimmer")}}),tippy(".tippy-standard",{placement:"left",theme:"tooltip"}),tippy(".tippy-right",{placement:"right",theme:"tooltipR"}),$("input#credit-payment").change(function(){$("div.paymentactive").removeClass("paymentactive"),$("div#creditPayment").toggleClass("paymentactive")}),$("input#applepay-payment").change(function(){$("div.paymentactive").removeClass("paymentactive"),$("div#applepayPayment").toggleClass("paymentactive")}),$("input#paypal-payment").change(function(){$("div.paymentactive").removeClass("paymentactive"),$("div#paypalPayment").toggleClass("paymentactive")}),$("input#venmo-payment").change(function(){$("div.paymentactive").removeClass("paymentactive"),$("div#venmoPayment").toggleClass("paymentactive")}),$("input#house-payment").change(function(){$("div.paymentactive").removeClass("paymentactive"),$("div#housePayment").toggleClass("paymentactive")}),$("input#cash-payment").change(function(){$("div.paymentactive").removeClass("paymentactive"),$("div#cashPayment").toggleClass("paymentactive")}),$("input#check-payment").change(function(){$("div.paymentactive").removeClass("paymentactive"),$("div#checkPayment").toggleClass("paymentactive")}),$("input#coupa-payment").change(function(){$("div.paymentactive").removeClass("paymentactive"),$("div#coupaPayment").toggleClass("paymentactive")}),$("input#oepr-payment").change(function(){$("div.paymentactive").removeClass("paymentactive"),$("div#oeprPayment").toggleClass("paymentactive")}),$("input#oeip-payment").change(function(){$("div.paymentactive").removeClass("paymentactive"),$("div#oeipPayment").toggleClass("paymentactive")}),$("input.basket-checkbox-input").click(function(){$(this).closest("div.basket-item-sm").next().toggleClass("itemizedactive")}),$(".basket-item__stack").click(function(){$(this).toggleClass("stack-expand")}),$("input#coiPersonalizationInternational").not(".allow-emoji").on("blur.strip change.strip keyup.strip keypress.strip",function(){$(this).val(cleanText($(this).val()))}),$(".variation-switcher").on("click.swap mouseover.swap mouseout.swap touchstart.swap",function(e){var t=$(this).data("varid"),a=$(".variation-option:checked").val();a=a||$("input.variation-option[data-preselected]").val();var n,o=$(this).data("dimensions"),r=$(this).data("sku"),i=$(this).data("price"),s=$(this).data("soldout");switch(e.type){case"mouseover":hasTouchEvents||($(".product-photo-container").hide(),$("#varpic"+t).show());break;case"mouseout":hasTouchEvents||($(".product-photo-container").hide(),$("#varpic"+a).show());break;case"touchstart":hasTouchEvents=!0;case"click":1===s||"1"===s?($("#add-to-basket-button,#cart-full-button").hide(),$("#sold-out-button").show()):($("#add-to-basket-button,#cart-full-button").show(),$("#sold-out-button").hide()),$(".product-photo-container").hide(),$("#varpic"+t).show(),$("#product-dimensions").html(o),$("#product-sku").html(r),$("#product-price").html(i),0<$("#variationPromo").length&&(n=$(this).data("couponcode"),$("#variationPromo").val(n))}}),$("#product-setup-form").on("submit.validate",function(e){var n=[];if($('input[name="varID"]:checked').length<1&&n.push("Variation"),0<$("#coiAllowSubstitutions").length&&$("#coiAllowSubstitutions:checked").length<1&&n.push("Limited Availability"),0<$(".option-list").length&&$(".option-list").each(function(e,t){var a=$(this).data("type");0===$(this).find("input:checked").length&&n.push(a)}),0<$("#coiPersonalizationInternational").length&&$("#coiPersonalizationInternational").val().length<1&&n.push("Item Personalization"),0<$("#braID").length&&$("#braID > option:selected").val().length<1&&n.push("Pickup Location"),0<n.length)return showFormErrors(n),!1}),$(".all-categories").length&&$(".all-categories").on("click.all-categories",function(e){$("#nav button.navbar-toggler").trigger("click")}),$("#checkout-login-button").length?($("#checkout-login-button").on("click.login",function(e){e.preventDefault();var t=$('#checkout-login-username input[name="username"]').val();if(!isValidEmail(t))return showMessageModal("Please enter a valid email address"),!1;$.post("/scripts/checkout-login.cfm","g-recaptcha-response="+encodeURIComponent($("#g-recaptcha-response").val())+"&gfRQV="+encodeURIComponent($("#rqv").val())+"&memEmail="+encodeURIComponent(t),function(e){return e.SUCCESS?e.MEMBERFOUND?!e.MEMISACTIVE||e.MEMBERHASFRAUD?($("#recipient-name-section").hide(),$("#checkout-login-username").hide(),$("#checkout-login-invalid").show(),e.RELOAD&&(document.location.href="/cart/add/step1.cfm"),!1):e.MEMISREGISTERED?($("#member-name").html(", "+e.MEMBERNAME),$("#member-email").html(t),$("#checkout-login-username").hide(),$("#checkout-login-password").show(),$("#password").focus(),void(e.RELOAD&&(document.location.href="/cart/add/step1.cfm"))):("1"===$("#expressPickup").val()?document.location.reload():($("#recipient-name-section").removeClass("config-mask"),$("#checkout-form-method-login").addClass("inactive"),$("#checkout-login-container").hide(),$("#showaddressbook").hide(),e.RELOAD&&(document.location.href="/cart/add/step1.cfm")),!1):("1"===$("#expressPickup").val()?document.location.reload():($("#recipient-name-section").removeClass("config-mask"),$("#checkout-form-method-login").addClass("inactive"),$("#checkout-login-container").hide(),$("#showaddressbook").hide(),e.RELOAD&&(document.location.href="/cart/add/step1.cfm")),!1):(showMessageModal(e.MESSAGE),e.RELOAD&&(document.location.href="/cart/add/step1.cfm"),!1)},"json")}),$("#checkout-login-password-button").on("click.login",function(e){var t=$('#checkout-login-username input[name="username"]').val(),a=$('#checkout-login-password input[name="password"]').val(),a=btoa(unescape(encodeURIComponent(a)));return isValidEmail(t)?a.length<1?(showMessageModal("Please enter a password"),!1):void $.post("/scripts/checkout-login.cfm","g-recaptcha-response="+encodeURIComponent($("#g-recaptcha-response").val())+"&gfRQV="+encodeURIComponent($("#rqv").val())+"&memEmail="+encodeURIComponent(t)+"&memPassword="+encodeURIComponent(a),function(e){return e.SUCCESS?"1"===$("#expressPickup").val()?(showMessageModal('<p>Please wait a moment while your order is prepared...</p><div id="cart-loading"><div class="loader loader-sm"><img src="/assets/img/spinner.svg" alt="" style="widht:100px;height:100px;"></div></div>',"Preparing Order","Thank You"),document.location.reload(),!1):($("#recipient-name-section").removeClass("config-mask"),$("#showaddressbook").show(),$("#checkout-form-method-login").addClass("inactive"),$("#checkout-login-container").hide(),$("#show-login-form-link").hide(),$("#paf1").focus(),void(e.RELOAD&&(document.location.href="/cart/add/step1.cfm"))):(showMessageModal(e.MESSAGE),e.RELOAD&&(document.location.href="/cart/add/step1.cfm"),!1)},"json"):(showMessageModal("Please enter a valid email address"),!1)}),$("#checkout-as-guest-link").on("click.guest",function(e){if(e.preventDefault(),"1"===$("#expressPickup").val())return showMessageModal('<p>Please wait a moment while your order is prepared...</p><div id="cart-loading"><div class="loader loader-sm"><img src="/assets/img/spinner.svg" alt="" style="widht:100px;height:100px;"></div></div>',"Preparing Order","Thank You"),document.location.reload(),!1;$("#checkout-login-password").hide(),$("#checkout-login-username").hide(),$("#recipient-name-section").removeClass("config-mask"),$("#checkout-login-container").hide(),$("#showaddressbook").hide(),$("#show-login-form-link").show()})):$("#paf1").length&&$("#paf1").focus(),$("#use-new-order-button").on("click.newrecipient",function(e){$("#cart-addresses-container").hide(),$("#recipient-name-container").removeClass("config-mask")}),$("#in-store-pickup-button").on("click.setwillcall",function(e){$("#corIsWillCall").val("1"),$("#checkout-form-method").submit()}),$("#hand-delivery-button").on("click.setwillcall",function(e){$("#corIsWillCall").val("0"),$("#braID").length&&$("#braID").data("selectizeapi").setValue(""),$("#checkout-form-method").submit()}),$("#electronic-delivery-button").on("click.setwillcall",function(e){$("#corIsWillCall").val("0"),$("#checkout-form-method").submit()}),$("#checkout-form-method").length&&($("#corAddressType").on("change.showblurb",function(){try{var e,t=$("#corAddressType > option:selected").val();0<t.length?(void 0!==_typeof(e=deliveryAddressTypeBlurbs[t])&&0<e.length?($("#delivery-address-type-note").html(e),$("#delivery-address-type-note").removeClass("hidden")):$("#delivery-address-type-note").html(""),1===deliveryAddressRequiredPhone[t]?$("#corPhone").addClass("required"):$("#corPhone").removeClass("required")):$("#corPhone").addClass("required")}catch(e){}}).trigger("change.showblurb"),$("#braID").length&&($("#braID").children().each(function(){branchLocations[$(this).attr("value")]=$(this).data("address")}),$("#braID").on("change.showaddress",function(e){var t=branchLocations[$(this).children("option:selected").attr("value")];1<t.length?($("#branch-location-address").html(t).addClass("callout").show(),$("#corPickupFName").closest("div").show(),$("#corPickupLName").closest("div").show(),$("#corPickupFName").val().length<1&&$("#corPickupFName").val($("#paf1").val()),$("#corPickupLName").val().length<1&&$("#corPickupLName").val($("#paf2").val())):($("#branch-location-address").hide(),$("#corPickupFName").closest("div").hide(),$("#corPickupLName").closest("div").hide())}))),$("#checkout-form-method").on("submit.validate",function(e){var t=[];if($("#paf1").val().length<1&&t.push("Recipient First Name"),$("#paf2").val().length<1&&t.push("Recipient Last Name"),$("#corIsGiftCard").val())isValidEmail($("#corEmailAddressForDelivery").val())||t.push("Recipient Email Address");else if("1"===$("#corIsWillCall").val())($("#corPickupFName").val().length<1||$("#corPickupLName").val().length<1)&&t.push("Pickup Person"),$("#braID").val().length<1&&t.push("Pickup Location");else switch(addressTypeSelectize.getValue().length<1&&t.push("Address Type\n"),$("#corAddress").val().length<1&&t.push("Street Address"),$("#corCity").val().length<1&&t.push("City"),$("#corState_actual").val(stateSelectize.getValue()),stateSelectize.getValue().length<1&&t.push("State"),$("#corZip").val().length<1&&t.push("Postal Code"),$("#corCountry_actual").val(countrySelectize.getValue()),countrySelectize.getValue().length<1&&t.push("Country"),0<$("#occID").length&&0===$("#occID").data("selectizeapi").getValue().length&&t.push("Occasion"),$("#corPhone").hasClass("required")&&$("#corPhone").val().length<1&&t.push("Phone"),0<$("#corIsVirtualArrangement").length&&0<$("#corIsVirtualArrangement:checked").length&&(!($("#corEmailAddressForDelivery").val().length<1)&&isValidEmail($("#corEmailAddressForDelivery").val())||t.push("Recipient Email Address")),addressTypeSelectize.getValue()){case"Funeral Home":$("#paf3").val().length<1&&t.push("Deceased First Name"),$("#paf4").val().length<1&&t.push("Deceased Last Name"),$("#corCompany").val().length<1&&t.push("Funeral Home");break;case"Apartment":$("#corAddressOtherInfo").val().length<1&&t.push("Apartment Number");break;case"Business":$("#corCompany").val().length<1&&t.push("Company");break;case"Hospital":$("#corCompany").val().length<1&&t.push("Hospital")}if(0<t.length)return showFormErrors(t),!1;var a=/\d/;return a.test($("#paf1").val())||a.test($("#paf2").val())?(showMessageModal("Please do not enter numbers into the Recipient Name fields","One Moment Please...","Make Corrections"),!1):"1"===$("#corIsWillCall").val()||0!=$("#corIsGiftCard").length||numberCheckedOnAddress||a.test($("#corAddress").val())?void 0:(numberCheckedOnAddress=!0,showMessageModal("Please check the Street Address, there should probably be some numbers in there. If it is correct without any numbers just hit Continue again.","Make Corrections"),$("#ra1Verify").val($("#corAddress").val()),$("#ra1Fail").val("true"),!1)}),$("#paf1").on("keyup.rec",function(e){var t=e.keyCode;(47<t&&t<91||96<t&&t<123)&&$("#paf1Keypress").val($("#paf1Keypress").val()+String.fromCharCode(t))}),$("#corAddress").on("keyup.rec",function(e){var t=e.keyCode;(47<t&&t<91||96<t&&t<123)&&$("#ra1Keypress").val($("#ra1Keypress").val()+String.fromCharCode(t))}),0<$("#age-check").length&&(e=$("#age-check").data("minage"),t="/",$("#age-check").hasClass("age-check-addons")&&(t="/cart/add/finish.cfm?skippedStep4=true"),$("#age-check").hasClass("age-check-checkout")&&(t="/cart/"),$.ageCheck({minAge:e,redirectOnFail:t,title:"Age Verification",copy:"One or more of the products you are about to view contains alcohol. In order to view this content you must be "+e+" years or older. Enter your Date of Birth in the fields below in order to continue:"})),selectizeStandardSelects(),$(".product-selection").on("click.setvariation",".flex-variation-price",function(e){$(this).parentsUntil("li").prev("input").prop("checked",!0)}),$("a.gallery-image-enable").on("click.showimage",function(e){var t=$(this).data("imagenum");e.preventDefault(),$(".gallery-image").removeClass("active"),$(".gallery-alt").removeClass("active"),$(".gallery-"+t).addClass("active")}),$("a.gallery-video-enable").on("click.showvideo",function(e){var t=$(this).data("videonum");e.preventDefault(),$(".gallery-video").removeClass("active"),$(".gallery-"+t).addClass("active")}),$(".entry-sidebar").addClass("entry-sidebar--ready entry-sidebar--active"),$(".entry--header-nav").addClass("entry--header-nav--ready"),$("#order-entry-form").on("click.showmodal",".modal-toggle, #members-search-results, #recentorders",function(){$("#order-entry-member-search").toggleClass("entry-modal--open"),$("#membersLookup").focus()}),$(".modal-closer").click(function(){$(this).closest(".modal-container").removeClass("entry-modal--open")}),$("#order-entry-customer-history").on("click.showhistory",".history-toggle",function(){$("#order-history").toggleClass("entry-modal--open")}),$(".customer-note-toggle").click(function(){$("#customer-notes").toggleClass("entry-modal--open")}),$(".suggestions-toggle").click(function(){$("#suggestions").toggleClass("entry-modal--open")}),$(".calendar-modal-toggle").click(function(){$("#order-entry-calendar").toggleClass("entry-modal--open")}),$(".calendar-offer-modal-toggle").click(function(){$("#order-entry-modal-calendar-offers").toggleClass("entry-modal--open")}),$("#totals-bar").on("click.totaltoggle",".totals-toggle",function(){$("#totals").toggleClass("entry-modal--open")}),$(".sidebar-toggle").on("click.togglehide",function(){$(".entry-sidebar").toggleClass("entry-sidebar--active").hasClass("entry-sidebar--active")?document.cookie="hideSidebar=1;":document.cookie="hideSidebar=0;"}),$(".entry--edit-toggle").click(function(){$(".entry--header-edit").toggleClass("edit-active")}),$(".entry--header-user__toggle").click(function(){$(".entry--header-user__login").toggleClass("login-active")}),$(".promo-code__toggle").click(function(){$(".promo-code").toggleClass("promo-code--active")}),$("#splitPaymentToggle").click(function(){$(".split-btn").toggleClass("hidden"),$(".partial-payment").toggleClass("partial-payment--off"),$(".payment-radio:checked").prop("checked",!1),$(".paymentactive").removeClass("paymentactive"),"yes"===$("#isChangingAmount").val()?($("#isChangingAmount").val("no"),$(".payment-radio,#process-payment-button").prop("disabled",!1)):($("#isChangingAmount").val("yes"),$(".payment-radio,#process-payment-button").prop("disabled",!0))}),$("#requested-payment-amount-apply").on("click",function(){var e=$("#partialAmt").val();document.location.href="/payments/requestedPayment.cfm?prpAmount="+e}),$("#partialAmt").on("keyup.setamt",function(e){13===e.keyCode&&$("#requested-payment-amount-apply").trigger("click")}),$("#collapser-address").click(function(){$("#collapse-address").toggleClass("collapsible--open")}),$("#collapser-addons").click(function(){$("#collapse-addons").toggleClass("collapsible--open")}),$("#collapser-product").click(function(){$("#collapse-product").toggleClass("collapsible--open")}),$(".edit-totals-toggle").click(function(){$("#order-entry-totals-container").toggleClass("collapsible-totals--open")}),$(document).ready(function(){"override"==$("#corOrderEntryDeliveryTimeOverride").val()&&$("#delivery-override-time").show()}),$("#corOrderEntryDeliveryTimeOverride").change(function(){"override"==$(this).val()?$("#delivery-override-time").show():$("#delivery-override-time").hide()}),$(".entry--header-nav-toggle").click(function(){$(window).width()<992&&($(".entry--header-nav").toggleClass("mobile-nav-active"),$(".navigation-reveal").toggleClass("slide-body"))}),$(".slow-link").click(function(){var e=$(window).width(),t=$(this).attr("href");if(e<992)return setTimeout(function(){window.location=t},400),!1}),$("input:radio[id=counterOrder]").is(":checked")?($("#order-entry-sender").addClass("split-col"),$(".pickup-only").show(),$(".pickup-only.not-counter-order").hide(),$(".delivery-only").hide(),$("#order-entry-date,#order-entry-matrix,#order-entry-reminder").hide()):($("input:radio[id=pickupOrder]").is(":checked")?($("#order-entry-sender").addClass("split-col"),$(".pickup-only").show(),$(".delivery-only").hide()):($("#order-entry-sender").removeClass("split-col"),$(".pickup-only").hide(),$(".delivery-only").show()),$("#order-entry-date,#order-entry-matrix,#order-entry-reminder").show()),$(".config-toggle").click(function(){$(".config-delivery").toggleClass("hidden-sm"),$(".config-pickup").toggleClass("hidden-sm")}),$("#reveal-about, #hide-about").click(function(){$(".navbar-hidden__about").toggleClass("navbar-hidden--reveal"),$(".navbar-hidden__account").removeClass("navbar-hidden--reveal"),$(".navbar-hidden__support").removeClass("navbar-hidden--reveal")}),$("#reveal-support, #hide-support").click(function(){$(".navbar-hidden__support").toggleClass("navbar-hidden--reveal"),$(".navbar-hidden__account").removeClass("navbar-hidden--reveal"),$(".navbar-hidden__about").removeClass("navbar-hidden--reveal")}),$("#reveal-account, #hide-account").click(function(){$(".navbar-hidden__account").toggleClass("navbar-hidden--reveal"),$(".navbar-hidden__support").removeClass("navbar-hidden--reveal"),$(".navbar-hidden__about").removeClass("navbar-hidden--reveal")}),$(".header-search-reveal").addClass("header-search-ready"),$("#saveCreditCard").on("change.showname",function(){$("#saveCreditCard").prop("checked")?($("#braintree-save").addClass("braintree-ready"),$("#braintree-save").addClass("braintree-open")):($("#braintree-save").removeClass("braintree-ready"),$("#braintree-save").removeClass("braintree-open"))}),$(".reviews-more-button").click(function(){$(this).next().addClass("message-expanded"),$(this).addClass("button-hidden")}),$("body").on("keyup.submitformonenter",function(e){try{var t=$(e.target);switch(e.key){case"Enter":if(t.hasClass("zip-localization-input"))return e.preventDefault(),e.stopImmediatePropagation(),t.closest("div.shopping-form").find(".zip-localization-button").trigger("click"),!1;if(t.hasClass("checkout-username"))return e.preventDefault(),e.stopImmediatePropagation(),$("#checkout-login-button").trigger("click"),!1;if(t.hasClass("checkout-password"))return e.preventDefault(),e.stopImmediatePropagation(),$("#checkout-login-password-button").trigger("click"),!1;if(["pfa1","pfa2"].indexOf(t.id))return e.preventDefault(),e.stopImmediatePropagation(),$("#recipient-name-save-button").trigger("click"),!1;break;case"Escape":$(".zipfilter-toggle").each(function(e){$(this).get(0)._tippy.state.visible&&$(this).get(0)._tippy.hide()})}}catch(e){}}),$(".alert-bar .alert-close").on("click.close",function(e){e.preventDefault(),$(this).closest(".alert-bar").remove()}),0<$("#account-set-password-form").length&&$("#account-set-password-form").on("submit.validate",function(e){var t=[];if($("#account-set-password-form #password").val().length<1&&t.push("Password"),$("#account-set-password-form #confirmPassword").val().length<1&&t.push("Confirm Password"),$("#account-set-password-form #password").val()!==$("#account-set-password-form #confirmPassword").val()&&t.push("Confirm Password Does Not Match"),0<t.length)return showFormErrors(t),!1}),0<$("#resend-verification-email").length&&$("#resend-verification-email").on("click.sendemail",function(e){e.preventDefault(),$.get("/scripts/resend-verification-email.cfm",function(e){showMessageModal("Email has been sent")})}),$(".reminder-delete").on("click.delete",function(e){e.preventDefault();var t=$(this),a=t.data("remid");$.get("/scripts/reminder-delete.cfm?remID="+a,function(e){t.closest(".reminder-container").fadeOut().remove()})}),$(".addressbook-delete").on("click.delete",function(e){e.preventDefault();var t=$(this),a=t.data("shiid");$.get("/scripts/addressbook-delete.cfm?shiID="+a,function(e){t.closest(".addressbook-container").fadeOut().remove()})}),$("#coupon-alert-close").on("click.hideme",function(){$.get("/scripts/coupon-alert-hide.cfm")}),$("#holiday-teaser-close").on("click.hideme",function(){$.get("/scripts/holiday-teaser-hide.cfm"),$("#holiday-teaser-close").parentsUntil(".alert--holiday").hide()}),$("#affiliate-message-close").on("click.hideme",function(){$.get("/scripts/enhanced-affiliate-message-hide.cfm"),$("#affiliate-message-close").parentsUntil(".alert--holiday").hide()}),$("#something-more-alert-close").on("click.hideme",function(e){$.get("/scripts/something-more-alert-hide.cfm")}),$(".signature-show-info").on("click.showinfo",function(){var e=$(this).attr("data-blurb"),t=$(this).attr("data-title");0<e.length&&showMessageModal(e,t)}),0<$("#jumpto-customer-service-form").length&&0<$("#typID").length&&$("#typID").on("change.showcopy",function(e){var t=$("#typID").val();$("div.inquiry-info").hide(),$("#inquiry-info-"+t).show()}),$(".ga-track-event").on("click.track",function(e){try{var t=$(this).data("ga-category")?$(this).data("ga-category"):$(this).attr("data-ga-category")?$(this).attr("data-ga-category"):"Desktop",a=$(this).data("ga-action")?$(this).data("ga-action"):$(this).attr("data-ga-action")?$(this).attr("data-ga-action"):"Click",n=$(this).data("ga-label")?$(this).data("ga-label"):$(this).attr("data-ga-label")?$(this).attr("data-ga-label"):$(this).attr("title")?$(this).attr("title"):$(this).attr("alt")?$(this).attr("alt"):0<$(this).text().length?$(this).text():"Unknown";gtag("event",a,{event_label:n,event_category:t}),"function"==typeof gfExtraTrack&&gfExtraTrack("Event",{action:a,label:n,category:t})}catch(e){}}),0<$(".g-recaptcha-response").length&&$(".g-recaptcha-response").each(function(e,t){try{var a=$(this);a.closest("#cs-google-recaptch").is(":visible")&&a.closest("form").on("submit.checkcaptcha",function(){if(a.val().length<1)return showMessageModal('Please check the "I\'m not a robot" checkbox to continue.'),!1})}catch(e){}}),$("a.reward-points-faqs-show").on("click.showfaq",function(e){e.preventDefault();var t=$(this).attr("href");showMessageModal("Loading...","Reward Points Info"),$("#main-message-modal .modal-message").load(t+" div#faqs-container")}),$("a#order-entry-elevate-permissions").on("click.settempadmin",function(e){return e.preventDefault(),$("#modalElevatePermissions").addClass("modal-open"),$(".entry--header-user__login").removeClass("login-active"),$([document.documentElement,document.body]).animate({scrollTop:$("#modalElevatePermissions").offset().top-120},750),!1}),$("#elevate-permissions-login-button").on("click.settempadmin",function(e){e.preventDefault();var t=$("#elevatePermissionUsername").val(),a=$("#elevatePermissionPassword").val();return $("#elevatePermissionPassword").val(""),t.length<1?alert("Enter a username"):a.length<1?alert("Enter a password"):(t=encodeURIComponent(t),a=encodeURIComponent(a),$.post("/order/entry/scripts/elevatePermissionsLogin.cfm",{u:t,p:a},function(e){e.success?document.location.reload():alert(e.message)},"json")),!1}),$("#oeAdminUserID, #oeAdminPin").on("keypress.submit",function(e){13===e.keyCode&&$("#elevate-permissions-quick-login-button").trigger("click")}),$("a#order-entry-quick-elevate-permissions").on("click.settempadmin",function(e){return e.preventDefault(),$("#modalElevatePermissionsQuick").addClass("modal-open"),$(".entry--header-user__login").removeClass("login-active"),$([document.documentElement,document.body]).animate({scrollTop:$("#modalElevatePermissionsQuick").offset().top-120},750),setTimeout('$("#oeAdminUserID").focus();',100),!1}),$("#elevate-permissions-quick-login-button").on("click.settempadmin",function(e){e.preventDefault();var t=$("#oeAdminUserID").val(),a=$("#oeAdminPin").val();return t.length<1?alert("Enter an Admin POS ID"):(t=encodeURIComponent(t),a=encodeURIComponent(a),$.post("/order/entry/scripts/elevatePermissionsQuickLogin.cfm",{u:t,p:a},function(e){console.log(e),e.SUCCESS?document.location.reload():alert(e.MESSAGE)},"json")),!1}),$("a#order-entry-enable-temp-admin").on("click.settempadmin",function(e){return e.preventDefault(),$.get("/order/entry/scripts/enableTemporaryAdminRights.cfm",function(){document.location.reload()}),!1}),$("a#order-entry-enable-temp-admin-remove, a#order-entry-elevate-permissions-remove, a#order-entry-quick-elevate-permissions-remove").on("click.removetempadmin",function(e){return e.preventDefault(),$.get("/order/entry/scripts/removeTemporaryAdminRights.cfm",function(){document.location.reload()}),!1}),$("#oeSwitchUserPIN").on("keypress.submit",function(e){13===e.keyCode&&$("#switch-user-login-button").trigger("click")}),$("a.order-entry-switch-user").on("click.switchuser",function(e){e.preventDefault();var t=$(this).attr("data-ut");return console.log($(this)),console.log(t),$("#oedSwitchUserToken").val(t),$("#modalSwitchUser").addClass("modal-open"),$(".entry--header-user__login").removeClass("login-active"),$([document.documentElement,document.body]).animate({scrollTop:$("#modalSwitchUser").offset().top-120},750),setTimeout('$("#oeSwitchUserPIN").focus();',100),!1}),$("#switch-user-login-button").on("click.checkid",function(e){e.preventDefault();var t=$("#oedSwitchUserToken").val(),a=$("#oeSwitchUserPIN").val();return a.length<1?alert("Enter your PIN"):(a=encodeURIComponent(a),$.post("/order/entry/scripts/switchUserLookup.cfm",{u:t,p:a},function(e){console.log(e),e.SUCCESS?document.location.href=e.URL:alert(e.MESSAGE)},"json")),!1}),$("#saved-orders-list").on("click.deleteorder",".saved-orders-delete",function(e){e.stopImmediatePropagation(),e.preventDefault(),confirm("Are you sure you want to delete this entire cart?")&&($(this).closest("tr").fadeOut(),$.get("scripts/cartDelete.cfm?carID="+$(this).data("carid"),function(){}))}),$("#saved-orders-list").on("click.loadorder",".order-entry-load-order",function(){var e="loadSavedOrder.cfm?carID="+$(this).data("carid");document.location.href=e}),$(".coupa-logout").click(function(e){e.preventDefault?e.preventDefault():e.returnValue=!1,$.get("/scripts/coupa/logout/",function(){document.location.reload()})}),$("#coupa-payment").length&&$("#coupa-payment").trigger("click"),$("#coupa-order-submit").length&&$("#coupa-order-submit").click(function(e){$("#coupa-order-processing-button").show(),$("#coupa-order-submit").hide()}),$('a[href="#"]').click(function(e){e.preventDefault?e.preventDefault():e.returnValue=!1}),$('a[href^="http"]').each(function(e,t){var a=$(this).attr("href").toLowerCase();a.indexOf(sitePrimaryURL)<0&&a.indexOf(siteAlternateURL)<0&&($(this).attr("target","_blank"),$(this).attr("rel","noopener"))}),loadjs.done("zipfiltertippy");try{0<$("#autoScrollTo").val().length&&($(document).scrollTop($("#"+$("#autoScrollTo").val()).offset().top-60),setTimeout("$('#autoScrollTo').val('');",5e3))}catch(e){}0<$("#autoFocus").length&&0<$("#autoFocus").val().length&&(autoFocusField=$("#autoFocus").val(),doAutoFocus());try{console.log("javascript files loaded!")}catch(e){}$(".owl-dots").addClass("pagination"),$(".owl-dot").each(function(){$(this).addClass("pagination__page")})});