(function(){var t,e;window.jdgmLeex=window.jdgmLeex||{},window.jdgmTheme=window.jdgmTheme||window.jdgmLeex,jdgmLeex._enqueuedFunctions=[],jdgmLeex.enque=function(e){return jdgmLeex._enqueuedFunctions.push(e),window.jdgm&&window.jdgm._doneSetup?t(jdgm.$):void 0},document.addEventListener("jdgm.doneSetup",function(){return t(jdgm.$)},!1),t=function(t){return jdgmLeex._enqueuedFunctions=t.grep(jdgmLeex._enqueuedFunctions,function(i){return e(t,i),!1})},e=function(t,e){var i;try{return e(t)}catch(n){return i=n,console.error(i)}}}).call(this),jdgmTheme.enque(function(t){var e=t,i=void 0;!function(e,n){"function"==typeof i&&i.amd?i("jquery-bridget/jquery-bridget",["jquery"],function(t){return n(e,t)}):"object"==typeof module&&module.exports?module.exports=n(e,require("jquery")):e.jQueryBridget=n(e,t)}(window,function(t,e){"use strict";function i(t,i,r){function a(e,i,n){var o,a="$()."+t+'("'+i+'")';return e.each(function(e,u){var h=r.data(u,t);if(!h)return void s(t+" not initialized. Cannot call methods, i.e. "+a);var d=h[i];if(!d||"_"==i.charAt(0))return void s(a+" is not a valid method");var c=d.apply(h,n);o=void 0===o?c:o}),void 0!==o?o:e}function u(e,n){e.each(function(e,o){var s=r.data(o,t);s?(s.option(n),s._init()):(s=new i(o,n),r.data(o,t,s))})}r=r||e,r&&(i.prototype.option||(i.prototype.option=function(t){r.isPlainObject(t)&&(this.options=r.extend(!0,this.options,t))}),r.fn[t]=function(t){if("string"==typeof t){var e=o.call(arguments,1);return a(this,t,e)}return u(this,t),this},n(r))}function n(t){!t||t&&t.bridget||(t.bridget=i)}var o=Array.prototype.slice,r=t.console,s="undefined"==typeof r?function(){}:function(t){r.error(t)};return n(e),i}),function(t,e){"function"==typeof i&&i.amd?i("ev-emitter/ev-emitter",e):"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}("undefined"!=typeof window?window:this,function(){function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var i=this._events=this._events||{},n=i[t]=i[t]||[];return-1==n.indexOf(e)&&n.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var i=this._onceEvents=this._onceEvents||{},n=i[t]=i[t]||{};return n[e]=!0,this}},e.off=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var n=i.indexOf(e);return-1!=n&&i.splice(n,1),this}},e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var n=0,o=i[n];e=e||[];for(var r=this._onceEvents&&this._onceEvents[t];o;){var s=r&&r[o];s&&(this.off(t,o),delete r[o]),o.apply(this,e),n+=s?0:1,o=i[n]}return this}},t}),function(t,e){"use strict";"function"==typeof i&&i.amd?i("get-size/get-size",[],function(){return e()}):"object"==typeof module&&module.exports?module.exports=e():t.getSize=e()}(window,function(){"use strict";function t(t){var e=parseFloat(t),i=-1==t.indexOf("%")&&!isNaN(e);return i&&e}function e(){}function i(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},e=0;h>e;e++){var i=u[e];t[i]=0}return t}function n(t){var e=getComputedStyle(t);return e||a("Style returned "+e+". Are you running this code in a hidden iframe on Firefox? See http://bit.ly/getsizebug1"),e}function o(){if(!d){d=!0;var e=document.createElement("div");e.style.width="200px",e.style.padding="1px 2px 3px 4px",e.style.borderStyle="solid",e.style.borderWidth="1px 2px 3px 4px",e.style.boxSizing="border-box";var i=document.body||document.documentElement;i.appendChild(e);var o=n(e);r.isBoxSizeOuter=s=200==t(o.width),i.removeChild(e)}}function r(e){if(o(),"string"==typeof e&&(e=document.querySelector(e)),e&&"object"==typeof e&&e.nodeType){var r=n(e);if("none"==r.display)return i();var a={};a.width=e.offsetWidth,a.height=e.offsetHeight;for(var d=a.isBorderBox="border-box"==r.boxSizing,c=0;h>c;c++){var m=u[c],l=r[m],f=parseFloat(l);a[m]=isNaN(f)?0:f}var g=a.paddingLeft+a.paddingRight,p=a.paddingTop+a.paddingBottom,v=a.marginLeft+a.marginRight,y=a.marginTop+a.marginBottom,_=a.borderLeftWidth+a.borderRightWidth,E=a.borderTopWidth+a.borderBottomWidth,b=d&&s,w=t(r.width);w!==!1&&(a.width=w+(b?0:g+_));var j=t(r.height);return j!==!1&&(a.height=j+(b?0:p+E)),a.innerWidth=a.width-(g+_),a.innerHeight=a.height-(p+E),a.outerWidth=a.width+v,a.outerHeight=a.height+y,a}}var s,a="undefined"==typeof console?e:function(t){console.error(t)},u=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],h=u.length,d=!1;return r}),function(t,e){"use strict";"function"==typeof i&&i.amd?i("desandro-matches-selector/matches-selector",e):"object"==typeof module&&module.exports?module.exports=e():t.matchesSelector=e()}(window,function(){"use strict";var t=function(){var t=window.Element.prototype;if(t.matches)return"matches";if(t.matchesSelector)return"matchesSelector";for(var e=["webkit","moz","ms","o"],i=0;is?"round":"floor";r=Math[a](r),this.cols=Math.max(r,1)},n.getContainerWidth=function(){var t=this._getOption("fitWidth"),i=t?this.element.parentNode:this.element,n=e(i);this.containerWidth=n&&n.innerWidth},n._getItemLayoutPosition=function(t){t.getSize();var e=t.size.outerWidth%this.columnWidth,i=e&&1>e?"round":"ceil",n=Math[i](t.size.outerWidth/this.columnWidth);n=Math.min(n,this.cols);for(var o=this.options.horizontalOrder?"_getHorizontalColPosition":"_getTopColPosition",r=this[o](n,t),s={x:this.columnWidth*r.col,y:r.y},a=r.y+t.size.outerHeight,u=n+r.col,h=r.col;u>h;h++)this.colYs[h]=a;return s},n._getTopColPosition=function(t){var e=this._getTopColGroup(t),i=Math.min.apply(Math,e);return{col:e.indexOf(i),y:i}},n._getTopColGroup=function(t){if(2>t)return this.colYs;for(var e=[],i=this.cols+1-t,n=0;i>n;n++)e[n]=this._getColGroupY(n,t);return e},n._getColGroupY=function(t,e){if(2>e)return this.colYs[t];var i=this.colYs.slice(t,t+e);return Math.max.apply(Math,i)},n._getHorizontalColPosition=function(t,e){var i=this.horizontalColIndex%this.cols,n=t>1&&i+t>this.cols;i=n?0:i;var o=e.size.outerWidth&&e.size.outerHeight;return this.horizontalColIndex=o?i+t:this.horizontalColIndex,{col:i,y:this._getColGroupY(i,t)}},n._manageStamp=function(t){var i=e(t),n=this._getElementOffset(t),o=this._getOption("originLeft"),r=o?n.left:n.right,s=r+i.outerWidth,a=Math.floor(r/this.columnWidth);a=Math.max(0,a);var u=Math.floor(s/this.columnWidth);u-=s%this.columnWidth?0:1,u=Math.min(this.cols-1,u);for(var h=this._getOption("originTop"),d=(h?n.top:n.bottom)+i.outerHeight,c=a;u>=c;c++)this.colYs[c]=Math.max(d,this.colYs[c])},n._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var t={height:this.maxY};return this._getOption("fitWidth")&&(t.width=this._getContainerFitWidth()),t},n._getContainerFitWidth=function(){for(var t=0,e=this.cols;--e&&0===this.colYs[e];)t++;return(this.cols-t)*this.columnWidth-this.gutter},n.needsResizeLayout=function(){var t=this.containerWidth;return this.getContainerWidth(),t!=this.containerWidth},i})}),jdgmTheme.enque(function(t){var e=void 0;!function(t,i){"function"==typeof e&&e.amd?e("ev-emitter/ev-emitter",i):"object"==typeof module&&module.exports?module.exports=i():t.EvEmitter=i()}(this,function(){function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var i=this._events=this._events||{},n=i[t]=i[t]||[];return-1==n.indexOf(e)&&n.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var i=this._onceEvents=this._onceEvents||{},n=i[t]=i[t]||[];return n[e]=!0,this}},e.off=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var n=i.indexOf(e);return-1!=n&&i.splice(n,1),this}},e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var n=0,o=i[n];e=e||[];for(var r=this._onceEvents&&this._onceEvents[t];o;){var s=r&&r[o];s&&(this.off(t,o),delete r[o]),o.apply(this,e),n+=s?0:1,o=i[n]}return this}},t}),function(t,i){"use strict";"function"==typeof e&&e.amd?e(["ev-emitter/ev-emitter"],function(e){return i(t,e)}):"object"==typeof module&&module.exports?module.exports=i(t,require("ev-emitter")):t.imagesLoaded=i(t,t.EvEmitter)}(window,function(e,i){function n(t,e){for(var i in e)t[i]=e[i];return t}function o(t){var e=[];if(Array.isArray(t))e=t;else if("number"==typeof t.length)for(var i=0;i0?void 0:(o(function(){var t;return getSize(e),t=new Outlayer(i),t.getItems(),t._getBoundingRect(),t.destroy()}),o(function(){return e.masonry(),e.masonry("measureColumns")}))})}.call(this),function(){jdgmTheme.enque(function(t){var e,i,n,o,r,s,a,u,h,d,c,m,l,f,g,p,v,y,_,E,b,w,j,x,I;return i="jdgm--leex-done-setup",r=".jdgm-rev-widg__reviews, .jdgm-all-reviews__body, .jdgm-revs-tab__reviews, .jdgm-shop-reviews__body",e=".jdgm-all-reviews__body, .jdgm-shop-reviews__body",o="layout-timeout",s=1500,a=10,n="",d=!1,h=!1,jdgmLeex.customizeReviews=function(t){var e;return jdgmSettings.lazyloadCardImages&&!d?(E(t),e=function(){return h?void 0:(h=!0,m(t))},jdgm.ScrollEvent.attach(e,"LeexThemeLazyLoadScroll")):m(t),d=!0},m=function(e){return jdgm.asyncEach(e,function(e){var n;return n=t(e),n.hasClass(i)?void 0:(jdgm.isVersion3?c(n):(g(n),l(n),y(n),_(n),v(n)),p(n),n.addClass(i))}),j(e.closest(r))},E=function(t){var i;if(!(t.closest(e).length<=0))return i=window.innerWidth>767&&jdgmSettings.leexDesktopPreload||jdgmSettings.leexMobilePreload,m(t.slice(0,i))},c=function(t){var e;return e=t.find(".jdgm-rev__pics"),e.length>0?e.detach().insertAfter(t.find(".jdgm-rev__header")):t.find(".jdgm-rev__vids").detach().insertAfter(t.find(".jdgm-rev__header"))},g=function(t){var e;return e=t.find(".jdgm-rev__pics"),e.detach().insertBefore(t.find(".jdgm-rev__header"))},p=function(t){var e,i,n;return t.find(".jdgm-rev__pic-link").removeClass("jdgm--loading"),e=t.find(".jdgm-rev__pic-img").first(),i=e.attr("data-src")||e.attr("src"),i?(i=i.replace("__compact.","__huge."),n=Math.min(jdgmSettings.leexPicWidth,t.innerWidth(),t.parent().innerWidth()),i=f(i,n),e.attr("src",i),e.attr("data-src",i)):void 0},f=function(e,i){var o,r;return e.indexOf(n)<0?e:(o=e.indexOf("?")<0&&"?"||"&",r=t.param({dpr:window.devicePixelRatio||1,w:i>0&&i||jdgmSettings.leexPicWidth}),e+o+r)},l=function(t){var e;return e=t.find(".jdgm-rev__author-wrapper"),e.insertBefore(t.find(".jdgm-rev__icon"))},y=function(t){var e;return e=t.find(".jdgm-rev__rating"),e.insertAfter(t.find(".jdgm-rev__timestamp"))},_=function(t){var e;return e=t.find(".jdgm-rev__buyer-badge-wrapper"),t.find(".jdgm-rev__author-wrapper").append(e)},v=function(t){var e;return e=t.find(".jdgm-rev__prod-info-wrapper"),t.append(e)},w=function(t){var e;if(!t.data(o))return e=setTimeout(function(){return t.masonry("layout"),t.data(o,null)},s),t.data(o,e)},b=function(t){return t.find(".jdgm-rev").length>a?w(t):t.masonry("layout")},I=function(t){return t.length<=0?void 0:(t.masonry({itemSelector:".jdgm-rev",columnWidth:".jdgm-rev",gutter:16,transitionDuration:"0.25s"}),t.imagesLoaded().progress(function(e,i){return b(t)}),jdgm.triggerVanillaEvent("doneSetupGrid"))},j=function(e){return jdgmSettings.widget_review_max_height&&jdgm.triggerEvent("beforeReLayoutGrids",{$reviewWrappers:e}),setTimeout(function(){return jdgm.asyncEach(e,function(e){return I(t(e))})})},x=function(){return t(".jdgm-rev").hasClass(jdgm.DONE_SETUP_CLASS); },u=function(){return x()?jdgmLeex.customizeReviews(t(".jdgm-rev")):void 0},t(document).on("jdgm.doneCustomizeReviews jdgm.doneSetupVideos",function(t,e){return jdgmLeex.customizeReviews(e.$reviews)}),t(document).on("jdgm.doneAppendMoreReviewsInAllReviewsPage",function(t,e){var i;return i=e.$reviews.closest(".jdgm-all-reviews__body, .jdgm-shop-reviews__body"),i.data("masonry")?i.masonry("appended",e.$reviews):void 0}),t(document).on("jdgm.doneAppendMoreReviews",function(t,e){var i;return i=e.$widget.find(r),i.masonry("appended",e.$reviews)}),t(document).on("jdgm.openedTabInAllReviewsPage",function(t,e){return e.$reviewsList.data("masonry")?e.$reviewsList.masonry("layout"):void 0}),t(document).on("jdgm.filteredInAllReviewsPage",function(t,e){return e.$reviewsList.data("masonry")?e.$reviewsList.masonry("layout"):void 0}),t(document).on("jdgm.doneShowReviewsTab",function(t,e){return jdgm.ScrollEvent.trigger("LeexThemeLazyLoadScroll"),setTimeout(function(){return e.$tabModal.find(".jdgm-revs-tab__reviews").masonry("layout")},0)}),t(document).on("jdgm.doneDestroyDot",function(t,e){return e.$reviewBody.closest(r).masonry("layout")}),t(document).on("jdgm.addSubmitedReview",function(t,e){var i;return i=e.$review.closest(".jdgm-rev-widg__reviews"),i.data("masonry")?i.masonry("prepended",i.find(".jdgm-rev--pending")):void 0}),t("body").addClass("jdgm--leex-script-loaded"),u(),document.addEventListener("jdgm.doneLoadingCss",u,!1)})}.call(this);