function changeSubmitAvailability(){var n=$(this).is(":checked");$("#updateRatingsBtn").attr("disabled",!n)}function updateRatings(n){for(let t=0;t<n;t++)$(`#ProductsRatings_${t}__Rating`).val($(`#productRating_${t}`).children("input").attr("value"));$("#DeliveryRating").val($("#deliveryRatingStars").children("input").attr("value"))}function setRating(n,i){t={filterKey:n,value:i};$.ajax({url:"/account/rating/set",cache:!1,data:t,dataType:"html",type:"POST",success:function(){refreshAverage()}})}function refreshAverage(){$.ajax({url:"/account/rating/get",cache:!1,data:t,dataType:"html",type:"POST",success:function(n){$("#average").html(n)}})}(function(n,t){typeof define=="function"&&define.amd?define(["jquery"],t):typeof module=="object"&&module.exports?module.exports=t(require("jquery")):t(n.jQuery)})(this,function(n){"use strict";n.raty={cancelButton:!1,cancelClass:"raty-cancel",cancelHint:"Cancel this rating!",cancelOff:"cancel-off.png",cancelOn:"cancel-on.png",cancelPlace:"left",click:undefined,half:!1,halfShow:!0,hints:Resources.hints,iconRange:undefined,iconRangeSame:!1,mouseout:undefined,mouseover:undefined,noRatedMsg:"Not rated yet!",number:5,numberMax:20,path:undefined,precision:!1,readOnly:!1,round:{down:.25,full:.6,up:.76},score:undefined,scoreName:"score",single:!1,space:!0,starHalf:"star-half.png",starOff:"star-off.png",starOn:"star-on.png",starType:"img",target:undefined,targetFormat:"{score}",targetKeep:!1,targetScore:undefined,targetText:"",targetType:"hint"};n.fn.raty=function(t){return this.each(function(){var i=new n.raty.Raty(this,t);return i._create()})};n.raty.Raty=function(){var t=function(t,i){this.element=t;this.self=n(t);this.opt=n.extend(!0,{},n.raty,i,this.self.data())};return t.prototype={_create:function(){this._executeCallbacks();this._adjustNumber();this._adjustHints();this.opt.score=this._adjustedScore(this.opt.score);this.opt.starType!=="img"&&this._adjustStarName();this._setPath();this._createStars();this.opt.cancelButton&&this._createCancel();this.opt.precision&&this._adjustPrecision();this._createScore();this._apply(this.opt.score);this._setTitle(this.opt.score);this._target(this.opt.score);this.opt.readOnly?this._lock():(this.element.style.cursor="pointer",this._binds());this.self.data("raty",this)},_adjustedScore:function(n){if(n||n===0)return this._between(n,0,this.opt.number)},_adjustHints:function(){var f,t,n,i,u,r;if(this.opt.hints||(this.opt.hints=[]),this.opt.halfShow||this.opt.half)for(f=this.opt.precision?10:2,t=0;t<this.opt.number;t++)for(n=this.opt.hints[t],Object.prototype.toString.call(n)!=="[object Array]"&&(n=[n]),this.opt.hints[t]=[],i=0;i<f;i++)u=n[i],r=n[n.length-1],r===undefined&&(r=null),this.opt.hints[t][i]=u===undefined?r:u},_adjustNumber:function(){this.opt.number=this._between(this.opt.number,1,this.opt.numberMax)},_adjustPrecision:function(){this.opt.half=!0},_adjustStarName:function(){var t=["cancelOff","cancelOn","starHalf","starOff","starOn"],n;for(this.opt.path="",n=0;n<t.length;n++)this.opt[t[n]]=this.opt[t[n]].replace(".","-")},_apply:function(n){this._fill(n);n&&(n>0&&this.scoreField.val(n),this._roundStars(n))},_attributesForIndex:function(n){var i=this._nameForIndex(n),t={alt:n,src:this.opt.path+this.opt[i]};return this.opt.starType!=="img"&&(t={"data-alt":n,"class":this.opt[i]}),t.title=this._getHint(n),t},_between:function(n,t,i){return Math.min(Math.max(parseFloat(n),t),i)},_binds:function(){this.cancelButton&&(this._bindOverCancel(),this._bindClickCancel(),this._bindOutCancel());this._bindOver();this._bindClick();this._bindOut()},_bindClick:function(){var t=this;this.stars.on("click.raty",function(i){if(!t.self.data("readonly")){var u=!0,r=t.opt.half||t.opt.precision?t.self.data("score"):this.alt||n(this).data("alt");t.opt.half&&!t.opt.precision&&(r=t._roundHalfScore(r));t.opt.click&&(u=t.opt.click.call(t.element,+r,i));(u||u===undefined)&&t._apply(+r)}})},_bindClickCancel:function(){this.cancelButton.on("click.raty",function(n){this.scoreField.removeAttr("value");this.opt.click&&this.opt.click.call(this.element,null,n)}.bind(this))},_bindOut:function(){this.self.on("mouseleave.raty",function(n){var t=+this.scoreField.val()||undefined;this._apply(t);this._target(t,n);this._resetTitle();this.opt.mouseout&&this.opt.mouseout.call(this.element,t,n)}.bind(this))},_bindOutCancel:function(){var n=this;this.cancelButton.on("mouseleave.raty",function(t){var i=n.opt.cancelOff,r;n.opt.starType!=="img"&&(i=n.opt.cancelClass+" "+i);n._setIcon(this,i);n.opt.mouseout&&(r=+n.scoreField.val()||undefined,n.opt.mouseout.call(n.element,r,t))})},_bindOver:function(){var n=this,t=n.opt.half?"mousemove.raty":"mouseover.raty";this.stars.on(t,function(t){var i=n._getScoreByPosition(t,this);n._fill(i);n.opt.half&&(n._roundStars(i,t),n._setTitle(i,t),n.self.data("score",i));n._target(i,t);n.opt.mouseover&&n.opt.mouseover.call(n.element,i,t)})},_bindOverCancel:function(){var n=this;this.cancelButton.on("mouseover.raty",function(t){if(!n.self.data("readonly")){var r=n.opt.path+n.opt.starOff,i=n.opt.cancelOn;n.opt.starType==="img"?n.stars.attr("src",r):(i=n.opt.cancelClass+" "+i,n.stars.attr("class",r));n._setIcon(this,i);n._target(null,t);n.opt.mouseover&&n.opt.mouseover.call(n.element,null)}})},_buildScoreField:function(){return n("<input />",{name:this.opt.scoreName,type:"hidden"}).appendTo(this.self)},_createCancel:function(){var i=this.opt.path+this.opt.cancelOff,t=n("<"+this.opt.starType+" />",{title:this.opt.cancelHint,"class":this.opt.cancelClass});this.opt.starType==="img"?t.attr({src:i,alt:"x"}):t.attr("data-alt","x").addClass(i);this.opt.cancelPlace==="left"?this.self.prepend("&#160;").prepend(t):this.self.append("&#160;").append(t);this.cancelButton=t},_createScore:function(){var t=n(this.opt.targetScore);this.scoreField=t.length?t:this._buildScoreField()},_createStars:function(){for(var i,t=1;t<=this.opt.number;t++)i=this._attributesForIndex(t),n("<"+this.opt.starType+" />",i).appendTo(this.element),this.opt.space&&t<this.opt.number&&this.self.append("&#160;");this.stars=this.self.children(this.opt.starType)},_error:function(t){n(this).text(t);n.error(t)},_executeCallbacks:function(){for(var i,t=["number","readOnly","score","scoreName","target","path"],n=0;n<t.length;n++)typeof this.opt[t[n]]=="function"&&(i=this.opt[t[n]].call(this.element),i?this.opt[t[n]]=i:delete this.opt[t[n]])},_fill:function(n){var i=0,t,r,f,e,u;if(this.opt.iconRangeSame&&this.opt.iconRange)while(i<this.opt.iconRange.length&&this.opt.iconRange[i].range<n)i++;for(t=1;t<=this.stars.length;t++)f=this.stars[t-1],e=this._turnOn(t,n),this.opt.iconRange&&this.opt.iconRange.length>i?(u=this.opt.iconRange[i],r=this._getRangeIcon(u,e),t<=u.range&&this._setIcon(f,r),t===u.range&&i++):(r=this.opt[e?"starOn":"starOff"],this._setIcon(f,r))},_getDecimal:function(n,t){var i=n.toString().split(".")[1],r=0;return i&&(r=parseInt(i.slice(0,t),10),i.slice(1,5)==="9999"&&r++),r},_getRangeIcon:function(n,t){return t?n.on||this.opt.starOn:n.off||this.opt.starOff},_getScoreByPosition:function(t,i){var r=parseInt(i.alt||i.getAttribute("data-alt"),10),u,f;return this.opt.half&&(u=this._getWidth(),f=parseFloat((t.pageX-n(i).offset().left)/u),r=r-1+f),r},_getHint:function(n,t){if(n!==0&&!n)return this.opt.noRatedMsg;var i=this._getDecimal(n,1),e=Math.ceil(n),u=this.opt.hints[(e||1)-1],r=u,f=!t||this.isMove;return this.opt.precision?(f&&(i=i===0?9:i-1),r=u[i]):(this.opt.halfShow||this.opt.half)&&(i=f&&i===0?1:i>5?1:0,r=u[i]),r===""?"":r||n},_getWidth:function(){var n=this.stars[0].width||parseFloat(this.stars.eq(0).css("font-size"));return n||this._error("Could not get the icon width!"),n},_lock:function(){var n=this._getHint(this.scoreField.val());this.element.style.cursor="";this.element.title=n;this.scoreField.prop("readonly",!0);this.stars.prop("title",n);this.cancelButton&&this.cancelButton.hide();this.self.data("readonly",!0)},_nameForIndex:function(n){return this.opt.score&&this.opt.score>=n?"starOn":"starOff"},_resetTitle:function(){for(var n=0;n<this.opt.number;n++)this.stars[n].title=this._getHint(n+1)},_roundHalfScore:function(n){var i=parseInt(n,10),t=this._getDecimal(n,1);return t!==0&&(t=t>5?1:.5),i+t},_roundStars:function(n,t){var i=this._starName(n,t),r,u;i&&(r=this.opt[i],u=this.stars[Math.ceil(n)-1],this._setIcon(u,r))},_setIcon:function(n,t){n[this.opt.starType==="img"?"src":"className"]=this.opt.path+t},_setPath:function(){this.opt.path=this.opt.path||"";this.opt.path&&this.opt.path.slice(-1)[0]!=="/"&&(this.opt.path+="/")},_setTarget:function(n,t){t&&(t=this.opt.targetFormat.toString().replace("{score}",t));n.is(":input")?n.val(t):n.html(t)},_setTitle:function(n,t){if(n){var i=parseInt(Math.ceil(n),10),r=this.stars[i-1];r.title=this._getHint(n,t)}},_starName:function(n,t){var i=+(n%1).toFixed(2);return t||this.isMove?i>.5?"starOn":"starHalf":i<=this.opt.round.down?void 0:this.opt.halfShow&&i<this.opt.round.up?"starHalf":i<this.opt.round.full?"starOff":"starOn"},_target:function(t,i){var r,u,f;this.opt.target&&(r=n(this.opt.target),r.length||this._error("Target selector invalid or missing!"),u=i&&i.type==="mouseover",t===undefined?t=this.opt.targetText:t===null?t=u?this.opt.cancelHint:this.opt.targetText:(this.opt.targetType==="hint"?t=this._getHint(t,i):this.opt.precision&&(t=parseFloat(t).toFixed(1)),f=i&&i.type==="mousemove",u||f||this.opt.targetKeep||(t=this.opt.targetText)),this._setTarget(r,t))},_turnOn:function(n,t){return this.opt.single?n===t:n<=t},_unlock:function(){this.element.style.cursor="pointer";this.element.removeAttribute("title");this.scoreField.removeAttr("readonly");this.self.data("readonly",!1);this._resetTitle();this.cancelButton&&this.cancelButton.css("display","")},cancel:function(n){this.self.data("readonly")!==!0&&(this[n?"click":"score"].call(this,null),this.scoreField.removeAttr("value"))},click:function(t){this.self.data("readonly")!==!0&&(t=this._adjustedScore(t),this._apply(t),this.opt.click&&this.opt.click.call(this.element,t,n.Event("click")),this._target(t))},getScore:function(){var n=[],t;return t=this.scoreField.val(),n.push(t?+t:undefined),n.length>1?n:n[0]},move:function(t){var i=parseInt(t,10),r=this._getDecimal(t,1);i>=this.opt.number&&(i=this.opt.number-1,r=10);var f=this._getWidth(),e=f/10,u=n(this.stars[i]),o=u.offset().left+e*r,s=n.Event("mousemove",{pageX:o});this.isMove=!0;u.trigger(s);this.isMove=!1},readOnly:function(n){this.self.data("readonly")!==n&&(n?(this.self.off(".raty").children(this.opt.starType).off(".raty"),this._lock()):(this._binds(),this._unlock()),this.self.data("readonly",n))},score:function(){return arguments.length?this.setScore.apply(this,arguments):this.getScore()},setScore:function(n){this.self.data("readonly")!==!0&&(n=this._adjustedScore(n),this._apply(n),this._target(n))}},t}()});$(".rating-stars").each(function(){var n=$(this);n.attr("data-legacy-raty")==null&&n.raty({starType:"i",readOnly:$(this).attr("data-readonly")!="false",halfShow:!0,score:function(){return $(this).attr("data-score")}})});$("#productRating").raty({starType:"i",readOnly:$("#productRating").attr("data-readonly")!="false",halfShow:!0,score:function(){return $(this).attr("data-score")},click:function(n){setRating("product",n)}});$("#shippingRating").raty({starType:"i",readOnly:$("#shippingRating").attr("data-readonly")!="false",halfShow:!0,score:function(){return $(this).attr("data-score")},click:function(n){setRating("shipping",n)}});$("#communicationRating").raty({starType:"i",readOnly:$("#communicationRating").attr("data-readonly")!="false",halfShow:!0,score:function(){return $(this).attr("data-score")},click:function(n){setRating("communication",n)}})