!function(){"use strict";function e(e){function t(t,n){var s,h,k=t==window,y=n&&n.message!==undefined?n.message:undefined;if(!(n=e.extend({},e.blockUI.defaults,n||{})).ignoreIfBlocked||!e(t).data("blockUI.isBlocked")){if(n.overlayCSS=e.extend({},e.blockUI.defaults.overlayCSS,n.overlayCSS||{}),s=e.extend({},e.blockUI.defaults.css,n.css||{}),n.onOverlayClick&&(n.overlayCSS.cursor="pointer"),h=e.extend({},e.blockUI.defaults.themedCSS,n.themedCSS||{}),y=y===undefined?n.message:y,k&&p&&o(window,{fadeOut:0}),y&&"string"!=typeof y&&(y.parentNode||y.jquery)){var m=y.jquery?y[0]:y,g={};e(t).data("blockUI.history",g),g.el=m,g.parent=m.parentNode,g.display=m.style.display,g.position=m.style.position,g.parent&&g.parent.removeChild(m)}e(t).data("blockUI.onUnblock",n.onUnblock);var v,I,w,U,x=n.baseZ;v=e(r||n.forceIframe?'':''),I=e(n.theme?'':''),n.theme&&k?(U='"):n.theme?(U='"):U=k?'':'',w=e(U),y&&(n.theme?(w.css(h),w.addClass("ui-widget-content")):w.css(s)),n.theme||I.css(n.overlayCSS),I.css("position",k?"fixed":"absolute"),(r||n.forceIframe)&&v.css("opacity",0);var C=[v,I,w],S=e(k?"body":t);e.each(C,function(){this.appendTo(S)}),n.theme&&n.draggable&&e.fn.draggable&&w.draggable({handle:".ui-dialog-titlebar",cancel:"li"});var O=f&&(!e.support.boxModel||e("object,embed",k?null:t).length>0);if(u||O){if(k&&n.allowBodyStretch&&e.support.boxModel&&e("html,body").css("height","100%"),(u||!e.support.boxModel)&&!k)var E=a(t,"borderTopWidth"),T=a(t,"borderLeftWidth"),M=E?"(0 - "+E+")":0,B=T?"(0 - "+T+")":0;e.each(C,function(e,t){var o=t[0].style;if(o.position="absolute",e<2)k?o.setExpression("height","Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.support.boxModel?0:"+n.quirksmodeOffsetHack+') + "px"'):o.setExpression("height",'this.parentNode.offsetHeight + "px"'),k?o.setExpression("width",'jQuery.support.boxModel&&document.documentElement.clientWidth||document.body.clientWidth + "px"'):o.setExpression("width",'this.parentNode.offsetWidth + "px"'),B&&o.setExpression("left",B),M&&o.setExpression("top",M);else if(n.centerY)k&&o.setExpression("top",'(document.documentElement.clientHeight||document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah=document.documentElement.scrollTop ? document.documentElement.scrollTop:document.body.scrollTop) + "px"'),o.marginTop=0;else if(!n.centerY&&k){var i="((document.documentElement.scrollTop ? document.documentElement.scrollTop:document.body.scrollTop) + "+(n.css&&n.css.top?parseInt(n.css.top,10):0)+') + "px"';o.setExpression("top",i)}})}if(y&&(n.theme?w.find(".ui-widget-content").append(y):w.append(y),(y.jquery||y.nodeType)&&e(y).show()),(r||n.forceIframe)&&n.showOverlay&&v.show(),n.fadeIn){var j=n.onBlock?n.onBlock:c,H=n.showOverlay&&!y?j:c,z=y?j:c;n.showOverlay&&I._fadeIn(n.fadeIn,H),y&&w._fadeIn(n.fadeIn,z)}else n.showOverlay&&I.show(),y&&w.show(),n.onBlock&&n.onBlock.bind(w)();if(i(1,t,n),k?(p=w[0],b=e(n.focusableElements,p),n.focusInput&&setTimeout(l,20)):d(w[0],n.centerX,n.centerY),n.timeout){var W=setTimeout(function(){k?e.unblockUI(n):e(t).unblock(n)},n.timeout);e(t).data("blockUI.timeout",W)}}}function o(t,o){var s,l=t==window,d=e(t),a=d.data("blockUI.history"),c=d.data("blockUI.timeout");c&&(clearTimeout(c),d.removeData("blockUI.timeout")),o=e.extend({},e.blockUI.defaults,o||{}),i(0,t,o),null===o.onUnblock&&(o.onUnblock=d.data("blockUI.onUnblock"),d.removeData("blockUI.onUnblock"));var r;r=l?e(document.body).children().filter(".blockUI").add("body > .blockUI"):d.find(">.blockUI"),o.cursorReset&&(r.length>1&&(r[1].style.cursor=o.cursorReset),r.length>2&&(r[2].style.cursor=o.cursorReset)),l&&(p=b=null),o.fadeOut?(s=r.length,r.stop().fadeOut(o.fadeOut,function(){0==--s&&n(r,a,o,t)})):n(r,a,o,t)}function n(t,o,n,i){var s=e(i);if(!s.data("blockUI.isBlocked")){t.each(function(e,t){this.parentNode&&this.parentNode.removeChild(this)}),o&&o.el&&(o.el.style.display=o.display,o.el.style.position=o.position,o.el.style.cursor="default",o.parent&&o.parent.appendChild(o.el),s.removeData("blockUI.history")),s.data("blockUI.static")&&s.css("position","static"),"function"==typeof n.onUnblock&&n.onUnblock(i,n);var l=e(document.body),d=l.width(),a=l[0].style.width;l.width(d-1).width(d),l[0].style.width=a}}function i(t,o,n){var i=o==window,l=e(o);if((t||(!i||p)&&(i||l.data("blockUI.isBlocked")))&&(l.data("blockUI.isBlocked",t),i&&n.bindEvents&&(!t||n.showOverlay))){var d="mousedown mouseup keydown keypress keyup touchstart touchend touchmove";t?e(document).bind(d,n,s):e(document).unbind(d,s)}}function s(t){if("keydown"===t.type&&t.keyCode&&9==t.keyCode&&p&&t.data.constrainTabKey){var o=b,n=!t.shiftKey&&t.target===o[o.length-1],i=t.shiftKey&&t.target===o[0];if(n||i)return setTimeout(function(){l(i)},10),!1}var s=t.data,d=e(t.target);return d.hasClass("blockOverlay")&&s.onOverlayClick&&s.onOverlayClick(t),d.parents("div."+s.blockMsgClass).length>0||0===d.parents().children().filter("div.blockUI").length}function l(e){if(b){var t=b[!0===e?b.length-1:0];t&&t.focus()}}function d(e,t,o){var n=e.parentNode,i=e.style,s=(n.offsetWidth-e.offsetWidth)/2-a(n,"borderLeftWidth"),l=(n.offsetHeight-e.offsetHeight)/2-a(n,"borderTopWidth");t&&(i.left=s>0?s+"px":"0"),o&&(i.top=l>0?l+"px":"0")}function a(t,o){return parseInt(e.css(t,o),10)||0}e.fn._fadeIn=e.fn.fadeIn;var c=e.noop||function(){},r=/MSIE/.test(navigator.userAgent),u=/MSIE 6.0/.test(navigator.userAgent)&&!/MSIE 8.0/.test(navigator.userAgent),f=(document.documentMode,e.isFunction(document.createElement("div").style.setExpression));e.blockUI=function(e){t(window,e)},e.unblockUI=function(e){o(window,e)},e.growlUI=function(t,o,n,i){var s=e('
');t&&s.append("

"+t+"

"),o&&s.append("

"+o+"

"),n===undefined&&(n=3e3);var l=function(t){t=t||{},e.blockUI({message:s,fadeIn:"undefined"!=typeof t.fadeIn?t.fadeIn:700,fadeOut:"undefined"!=typeof t.fadeOut?t.fadeOut:1e3,timeout:"undefined"!=typeof t.timeout?t.timeout:n,centerY:!1,showOverlay:!1,onUnblock:i,css:e.blockUI.defaults.growlCSS})};l();s.css("opacity");s.mouseover(function(){l({fadeIn:0,timeout:3e4});var t=e(".blockMsg");t.stop(),t.fadeTo(300,1)}).mouseout(function(){e(".blockMsg").fadeOut(1e3)})},e.fn.block=function(o){if(this[0]===window)return e.blockUI(o),this;var n=e.extend({},e.blockUI.defaults,o||{});return this.each(function(){var t=e(this);n.ignoreIfBlocked&&t.data("blockUI.isBlocked")||t.unblock({fadeOut:0})}),this.each(function(){"static"==e.css(this,"position")&&(this.style.position="relative",e(this).data("blockUI.static",!0)),this.style.zoom=1,t(this,o)})},e.fn.unblock=function(t){return this[0]===window?(e.unblockUI(t),this):this.each(function(){o(this,t)})},e.blockUI.version=2.7,e.blockUI.defaults={message:"

Please wait...

",title:null,draggable:!0,theme:!1,css:{padding:0,margin:0,width:"30%",top:"40%",left:"35%",textAlign:"center",color:"#000",border:"3px solid #aaa",backgroundColor:"#fff",cursor:"wait"},themedCSS:{width:"30%",top:"40%",left:"35%"},overlayCSS:{backgroundColor:"#000",opacity:.6,cursor:"wait"},cursorReset:"default",growlCSS:{width:"350px",top:"10px",left:"",right:"10px",border:"none",padding:"5px",opacity:.6,cursor:"default",color:"#fff",backgroundColor:"#000","-webkit-border-radius":"10px","-moz-border-radius":"10px","border-radius":"10px"},iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank",forceIframe:!1,baseZ:1e3,centerX:!0,centerY:!0,allowBodyStretch:!0,bindEvents:!0,constrainTabKey:!0,fadeIn:200,fadeOut:400,timeout:0,showOverlay:!0,focusInput:!0,focusableElements:":input:enabled:visible",onBlock:null,onUnblock:null,onOverlayClick:null,quirksmodeOffsetHack:4,blockMsgClass:"blockMsg",ignoreIfBlocked:!1};var p=null,b=[]}"function"==typeof define&&define.amd&&define.amd.jQuery?define(["jquery"],e):e(jQuery)}(); jQuery(function(d){if("undefined"==typeof wc_add_to_cart_params)return!1;var t=function(){this.requests=[],this.addRequest=this.addRequest.bind(this),this.run=this.run.bind(this),d(document.body).on("click",".add_to_cart_button",{addToCartHandler:this},this.onAddToCart).on("click",".remove_from_cart_button",{addToCartHandler:this},this.onRemoveFromCart).on("added_to_cart",this.updateButton).on("ajax_request_not_sent.adding_to_cart",this.updateButton).on("added_to_cart removed_from_cart",{addToCartHandler:this},this.updateFragments)};t.prototype.addRequest=function(t){this.requests.push(t),1===this.requests.length&&this.run()},t.prototype.run=function(){var t=this,a=t.requests[0].complete;t.requests[0].complete=function(){"function"==typeof a&&a(),t.requests.shift(),0'+wc_add_to_cart_params.i18n_view_cart+""),d(document.body).trigger("wc_cart_button_updated",[r]))},t.prototype.updateFragments=function(t,a){a&&(d.each(a,function(t){d(t).addClass("updating").fadeTo("400","0.6").block({message:null,overlayCSS:{opacity:.6}})}),d.each(a,function(t,a){d(t).replaceWith(a),d(t).stop(!0).css("opacity","1").unblock()}),d(document.body).trigger("wc_fragments_loaded"))},new t}); jQuery(function(l){if("undefined"==typeof wc_single_product_params)return!1;l("body").on("init",".wc-tabs-wrapper, .woocommerce-tabs",function(){l(this).find(".wc-tab, .woocommerce-tabs .panel:not(.panel .panel)").hide();var t=window.location.hash,e=window.location.href,i=l(this).find(".wc-tabs, ul.tabs").first();0<=t.toLowerCase().indexOf("comment-")||"#reviews"===t||"#tab-reviews"===t||0\t\t\t\t\t\t\t\t\t\t\t\t\t1\t\t\t\t\t\t\t2\t\t\t\t\t\t\t3\t\t\t\t\t\t\t4\t\t\t\t\t\t\t5\t\t\t\t\t\t\t\t\t\t\t

')}).on("click","#respond p.stars a",function(){var t=l(this),e=l(this).closest("#respond").find("#rating"),i=l(this).closest(".stars");return e.val(t.text()),t.siblings("a").removeClass("active"),t.addClass("active"),i.addClass("selected"),!1}).on("click","#respond #submit",function(){var t=l(this).closest("#respond").find("#rating"),e=t.val();if(0 .woocommerce-product-gallery__image",start:function(){e.css("opacity",1)},after:function(t){i.initZoomForTarget(i.$images.eq(t.currentSlide))}},t);e.flexslider(o),l(".woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image:eq(0) .wp-post-image").one("load",function(){var i=l(this);i&&setTimeout(function(){var t=i.closest(".woocommerce-product-gallery__image").height(),e=i.closest(".flex-viewport");t&&e&&e.height(t)},100)}).each(function(){this.complete&&l(this).trigger("load")})},e.prototype.initZoom=function(){this.initZoomForTarget(this.$images.first())},e.prototype.initZoomForTarget=function(t){if(!this.zoom_enabled)return!1;var e,i=this.$target.width(),o=!1;l(t).each(function(t,e){if(l(e).find("img").data("large_image_width")>i)return!(o=!0)}),o&&(e=l.extend({touch:!1},wc_single_product_params.zoom_options),"ontouchstart"in document.documentElement&&(e.on="click"),t.trigger("zoom.destroy"),t.zoom(e),setTimeout(function(){t.find(":hover").length&&t.trigger("mouseover")},100))},e.prototype.initPhotoswipe=function(){this.zoom_enabled&&0🔍'),this.$target.on("click",".woocommerce-product-gallery__trigger",this.openPhotoswipe),this.$target.on("click",".woocommerce-product-gallery__image a",function(t){t.preventDefault()}),this.flexslider_enabled||this.$target.on("click",".woocommerce-product-gallery__image a",this.openPhotoswipe)):this.$target.on("click",".woocommerce-product-gallery__image a",this.openPhotoswipe)},e.prototype.onResetSlidePosition=function(){this.$target.flexslider(0)},e.prototype.getGalleryItems=function(){var t=this.$images,n=[];return 01){if("number"==typeof(i=e({path:"/"},t.defaults,i)).expires){var a=new Date;a.setMilliseconds(a.getMilliseconds()+864e5*i.expires),i.expires=a}i.expires=i.expires?i.expires.toUTCString():"";try{c=JSON.stringify(r),/^[\{\[]/.test(c)&&(r=c)}catch(m){}r=o.write?o.write(r,n):encodeURIComponent(String(r)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),n=(n=(n=encodeURIComponent(String(n))).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent)).replace(/[\(\)]/g,escape);var f="";for(var s in i)i[s]&&(f+="; "+s,!0!==i[s]&&(f+="="+i[s]));return document.cookie=n+"="+r+f}n||(c={});for(var p=document.cookie?document.cookie.split("; "):[],d=/(%[0-9A-Z]{2})+/g,u=0;u'),t(".woocommerce form input").filter(":password").parent("span").addClass("password-input"),t(".password-input").append(''),t(".show-password-input").click(function(){t(this).toggleClass("display-password"),t(this).hasClass("display-password")?t(this).siblings(['input[type="password"]']).prop("type","text"):t(this).siblings('input[type="text"]').prop("type","password")})}); jQuery(function(r){if("undefined"==typeof wc_cart_fragments_params)return!1;var t=!0,o=wc_cart_fragments_params.cart_hash_key;try{t="sessionStorage"in window&&null!==window.sessionStorage,window.sessionStorage.setItem("wc","test"),window.sessionStorage.removeItem("wc"),window.localStorage.setItem("wc","test"),window.localStorage.removeItem("wc")}catch(f){t=!1}function a(){t&&sessionStorage.setItem("wc_cart_created",(new Date).getTime())}function s(e){t&&(localStorage.setItem(o,e),sessionStorage.setItem(o,e))}var e={url:wc_cart_fragments_params.wc_ajax_url.toString().replace("%%endpoint%%","get_refreshed_fragments"),type:"POST",data:{time:(new Date).getTime()},timeout:wc_cart_fragments_params.request_timeout,success:function(e){e&&e.fragments&&(r.each(e.fragments,function(e,t){r(e).replaceWith(t)}),t&&(sessionStorage.setItem(wc_cart_fragments_params.fragment_name,JSON.stringify(e.fragments)),s(e.cart_hash),e.cart_hash&&a()),r(document.body).trigger("wc_fragments_refreshed"))},error:function(){r(document.body).trigger("wc_fragments_ajax_error")}};function n(){r.ajax(e)}if(t){var i=null;r(document.body).on("wc_fragment_refresh updated_wc_div",function(){n()}),r(document.body).on("added_to_cart removed_from_cart",function(e,t,r){var n=sessionStorage.getItem(o);null!==n&&n!==undefined&&""!==n||a(),sessionStorage.setItem(wc_cart_fragments_params.fragment_name,JSON.stringify(t)),s(r)}),r(document.body).on("wc_fragments_refreshed",function(){clearTimeout(i),i=setTimeout(n,864e5)}),r(window).on("storage onstorage",function(e){o===e.originalEvent.key&&localStorage.getItem(o)!==sessionStorage.getItem(o)&&n()}),r(window).on("pageshow",function(e){e.originalEvent.persisted&&(r(".widget_shopping_cart_content").empty(),r(document.body).trigger("wc_fragment_refresh"))});try{var c=r.parseJSON(sessionStorage.getItem(wc_cart_fragments_params.fragment_name)),_=sessionStorage.getItem(o),g=Cookies.get("woocommerce_cart_hash"),m=sessionStorage.getItem("wc_cart_created");if(null!==_&&_!==undefined&&""!==_||(_=""),null!==g&&g!==undefined&&""!==g||(g=""),_&&(null===m||m===undefined||""===m))throw"No cart_created";if(m){var d=+m+864e5,w=(new Date).getTime();if(d').get(0).files,S.formdata=void 0!==window.FormData;var _=!!q.fn.prop;function o(e){var t=e.data;e.isDefaultPrevented()||(e.preventDefault(),q(e.target).closest("form").ajaxSubmit(t))}function i(e){var t=e.target,r=q(t);if(!r.is("[type=submit],[type=image]")){var a=r.closest("[type=submit]");if(0===a.length)return;t=a[0]}var n,o=t.form;"image"===(o.clk=t).type&&(void 0!==e.offsetX?(o.clk_x=e.offsetX,o.clk_y=e.offsetY):"function"==typeof q.fn.offset?(n=r.offset(),o.clk_x=e.pageX-n.left,o.clk_y=e.pageY-n.top):(o.clk_x=e.pageX-t.offsetLeft,o.clk_y=e.pageY-t.offsetTop)),setTimeout(function(){o.clk=o.clk_x=o.clk_y=null},100)}function N(){var e;q.fn.ajaxSubmit.debug&&(e="[jquery.form] "+Array.prototype.join.call(arguments,""),window.console&&window.console.log?window.console.log(e):window.opera&&window.opera.postError&&window.opera.postError(e))}q.fn.attr2=function(){if(!_)return this.attr.apply(this,arguments);var e=this.prop.apply(this,arguments);return e&&e.jquery||"string"==typeof e?e:this.attr.apply(this,arguments)},q.fn.ajaxSubmit=function(M,e,t,r){if(!this.length)return N("ajaxSubmit: skipping submit process - no element selected"),this;var O,a,n,o,X=this;"function"==typeof M?M={success:M}:"string"==typeof M||!1===M&&0',s)).css({position:"absolute",top:"-1000px",left:"-1000px"}),m=d[0],p={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(e){var t="timeout"===e?"timeout":"aborted";N("aborting upload... "+t),this.aborted=1;try{m.contentWindow.document.execCommand&&m.contentWindow.document.execCommand ("Stop")}catch(e){}d.attr("src",l.iframeSrc),p.error=t,l.error&&l.error.call(l.context,p,t,e),f&&q.event.trigger("ajaxError",[p,l,t]),l.complete&&l.complete.call(l.context,p,t)}},(f=l.global)&&0==q.active++&&q.event.trigger("ajaxStart"),f&&q.event.trigger("ajaxSend",[p,l]),l.beforeSend&&!1===l.beforeSend.call(l.context,p,l))return l.global&&q.active--,g.reject(),g;if(p.aborted)return g.reject(),g;(a=i.clk)&&(n=a.name)&&!a.disabled&&(l.extraData=l.extraData||{},l.extraData[n]=a.value,"image"===a.type&&(l.extraData[n+".x"]=i.clk_x,l.extraData[n+".y"]=i.clk_y));var x=1,y=2;function b(t){var r=null;try{t.contentWindow&&(r=t.contentWindow.document)}catch(e){N("cannot get iframe.contentWindow document: "+e)}if(r)return r;try{r=t.contentDocument?t.contentDocument:t.document}catch(e){N("cannot get iframe.contentDocument: "+e),r=t.document}return r}var c=q("meta[name=csrf-token]").attr("content"),T=q("meta[name=csrf-param]").attr("content");function j(){var e=X.attr2("target"),t=X.attr2("action"),r=X.attr("enctype")||X.attr("encoding")||"multipart/form-data";i.setAttribute("target",o),O&&!/post/i.test(O)||i.setAttribute("method","POST"),t!==l.url&&i.setAttribute("action",l.url),l.skipEncodingOverride||O&&!/post/i.test(O)||X.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"}),l.timeout&&(v=setTimeout(function(){h=!0,A(x)},l.timeout));var a=[];try{if(l.extraData)for(var n in l.extraData)l.extraData.hasOwnProperty(n)&&(q.isPlainObject(l.extraData[n])&&l.extraData[n].hasOwnProperty("name")&&l.extraData[n].hasOwnProperty("value")?a.push(q('',s).val(l.extraData[n].value).appendTo(i)[0]):a.push(q('',s).val(l.extraData[n]).appendTo(i)[0]));l.iframeTarget||d.appendTo(u),m.attachEvent?m.attachEvent("onload",A):m.addEventListener("load",A,!1),setTimeout(function e(){try{var t=b(m).readyState;N("state="+t),t&&"uninitialized"===t.toLowerCase()&&setTimeout(e,50)}catch(e){N("Server abort: ",e," (",e.name,")"),A(y),v&&clearTimeout(v),v=void 0}},15);try{i.submit()}catch(e){document.createElement("form").submit.apply(i)}}finally{i.setAttribute("action",t),i.setAttribute("enctype",r),e?i.setAttribute("target",e):X.removeAttr("target"),q(a).remove()}}T&&c&&(l.extraData=l.extraData||{},l.extraData[T]=c),l.forceSync?j():setTimeout(j,10);var w,S,k,D=50;function A(e){if(!p.aborted&&!k){if((S=b(m))||(N("cannot access response document"),e=y),e===x&&p)return p.abort("timeout"),void g.reject(p,"timeout");if(e===y&&p)return p.abort("server abort"),void g.reject(p,"error","server abort");if(S&&S.location.href!==l.iframeSrc||h){m.detachEvent?m.detachEvent("onload",A):m.removeEventListener("load",A,!1);var t,r="success";try{if(h)throw"timeout";var a="xml"===l.dataType||S.XMLDocument||q.isXMLDoc(S);if(N("isXml="+a),!a&&window.opera&&(null===S.body||!S.body.innerHTML)&&--D)return N("requeing onLoad callback, DOM not available"),void setTimeout(A,250);var n=S.body?S.body:S.documentElement;p.responseText=n?n.innerHTML:null,p.responseXML=S.XMLDocument?S.XMLDocument:S,a&&(l.dataType="xml"),p.getResponseHeader=function(e){return{"content-type":l.dataType}[e.toLowerCase()]},n&&(p.status=Number(n.getAttribute("status"))||p.status,p.statusText=n.getAttribute("statusText")||p.statusText);var o,i,s,u=(l.dataType||"").toLowerCase(),c=/(json|script|text)/.test(u);c||l.textarea?(o=S.getElementsByTagName("textarea")[0])?(p.responseText=o.value,p.status=Number(o.getAttribute("status"))||p.status,p.statusText=o.getAttribute("statusText")||p.statusText):c&&(i=S.getElementsByTagName("pre")[0],s=S.getElementsByTagName("body")[0],i?p.responseText=i.textContent?i.textContent:i.innerText:s&&(p.responseText=s.textContent?s.textContent:s.innerText)):"xml"===u&&!p.responseXML&&p.responseText&&(p.responseXML=F(p.responseText));try{w=E(p,u,l)}catch(e){r="parsererror",p.error=t=e||r}}catch(e){N("error caught: ",e),r="error",p.error=t=e||r}p.aborted&&(N("upload aborted"),r=null),p.status&&(r=200<=p.status&&p.status<300||304===p.status?"success":"error"),"success"===r?(l.success&&l.success.call(l.context,w,"success",p),g.resolve(p.responseText,"success",p),f&&q.event.trigger("ajaxSuccess",[p,l])):r&&(void 0===t&&(t=p.statusText),l.error&&l.error.call(l.context,p,r,t),g.reject(p,"error",t),f&&q.event.trigger("ajaxError",[p,l,t])),f&&q.event.trigger("ajaxComplete",[p,l]),f&&!--q.active&&q.event.trigger("ajaxStop"),l.complete&&l.complete.call(l.context,p,r),k=!0,l.timeout&&clearTimeout(v),setTimeout(function(){l.iframeTarget?d.attr("src",l.iframeSrc):d.remove(),p.responseXML=null},100)}}}var F=q.parseXML||function(e,t){return window.ActiveXObject?((t=new ActiveXObject("Microsoft.XMLDOM")).async="false",t.loadXML(e)):t=(new DOMParser).parseFromString(e,"text/xml"),t&&t.documentElement&&"parsererror"!==t.documentElement.nodeName?t:null},L=q.parseJSON||function(e){return window.eval("("+e+")")},E=function(e,t,r){var a=e.getResponseHeader("content-type")||"",n=("xml"===t||!t)&&0<=a.indexOf("xml"),o=n?e.responseXML:e.responseText;return n&&"parsererror"===o.documentElement.nodeName&&q.error&&q.error("parsererror"),r&&r.dataFilter&&(o=r.dataFilter(o,t)),"string"==typeof o&&(("json"===t||!t)&&0<=a.indexOf("json")?o=L(o):("script"===t||!t)&&0<=a.indexOf("javascript")&&q.globalEval(o)),o};return g}},q.fn.ajaxForm=function(e,t,r,a){if(("string"==typeof e||!1===e&&0=f[g]?0:Math.min(f[g],n));!a&&1 button",a.$form).each(function(){var e,t,o=d(this),i=o.closest(".quform-button-submit"),r=i.data("animation"),n=1e3,s=a.options.scrollDelay;r&&(e="quform-button-animation-"+r,"two"===r&&(n=3200),o.click(function(){a.options.scrollDelay=n,i.removeClass(e),"number"==typeof t&&(clearTimeout(t),t=null),setTimeout(function(){i.addClass(e),t=setTimeout(function(){i.removeClass(e),a.options.scrollDelay=s},n)},4)}))})},h.prototype.setupInsideLabels=function(){var r=this;d.InFieldLabels?d(".quform-labels-inside > .quform-spacer > .quform-label",r.$form).each(function(){var e=d(this),t=e.parent().find(".quform-input"),o=t.find(".quform-field"),i={top:parseInt(o.css("padding-top"),10)+parseInt(o.css("border-top-width"),10)};r.options.isRtl?i.right=parseInt(o.css("padding-right"),10)+parseInt(o.css("border-right-width"),10):i.left=parseInt(o.css("padding-left"),10)+parseInt(o.css("border-left-width"),10),e.addClass("quform-label-inside").css(i).appendTo(t),new d.InFieldLabels(e[0],o[0])}):d(".quform-labels-inside > .quform-spacer > .quform-label",r.$form).show()},h.prototype.setupEnhancedSelects=function(){var r;"function"==typeof d.fn.select2&&(d(".quform-field-select-enhanced",(r=this).$form).each(function(){var e=d(this),t=e.data("options"),o={theme:"quform",language:{noResults:function(){return t.noResultsFound}}};t.search||(o.minimumResultsForSearch=Infinity),t.rtl&&(o.dir="rtl"),e.select2(o);var i="quform-"+r.options.id+"-select2";h.isNonEmptyString(r.options.theme)&&(i+=" quform-theme-"+r.options.theme),e.on("select2:opening",function(){e.data("select2").$dropdown.addClass(i)})}),d(".quform-field-multiselect-enhanced",r.$form).each(function(){var e=d(this),t=e.data("options"),o={theme:"quform",language:{noResults:function(){return t.noResultsFound}}};h.isNonEmptyString(t.placeholder)&&(o.placeholder=t.placeholder),t.rtl&&(o.dir="rtl"),e.select2(o);var i="quform-"+r.options.id+"-select2";h.isNonEmptyString(r.options.theme)&&(i+=" quform-theme-"+r.options.theme),e.on("select2:opening",function(){e.data("select2").$dropdown.addClass(i)})}))},h.prototype.setupEnhancedUploaders=function(){var s;d.isFunction(d.fn.fileupload)&&d.support.xhrFileUpload&&d.support.xhrFormDataFileUpload&&d(".quform-field-file-enhanced",(s=this).$form).each(function(){var e,t=d(this),o=t.closest(".quform-input-file"),i=t.data("config"),r=d('
').insertAfter(o).hide();i.queued=0,s.uploadElements.push(i),e="dropzone"===i.buttonType?s.createUploadButton("quform-upload-dropzone",i):s.createUploadButton("quform-upload-button",i),o.append(e.append(t));var n=t.closest(".quform-element").addClass("quform-enhanced-upload");t.fileupload({dataType:"json",paramName:i.name+"[]",dropZone:e,change:function(){n.find(".quform-error").empty().remove()},add:function(e,t){s.uploadAdd(t,i,r)},start:function(){d(".quform-upload-progress-wrap",s.$form).show()},progress:function(e,t){var o=Math.min(100,t.loaded/t.total*100);d(".quform-upload-progress-bar",s.$form).css("width",o+"%"),d(".quform-upload-filename",s.$form).text(t.files[0].name)}})})},h.prototype.createUploadButton=function(e,t){var o,i=d('
');return i.append(d('').text(t.buttonText)),h.isNonEmptyString(t.buttonIcon)&&(o=d('').append(d('')),i.addClass(e+"-icon-"+t.buttonIconPosition),"right"===t.buttonIconPosition?i.append(o):i.prepend(o)),i},h.prototype.setupDatepickers=function(){var m;d.isFunction(d.fn.kendoDatePicker)&&d(".quform-field-date",(m=this).$form).each(function(){var o=d(this).addClass("quform-field-date-enhanced"),e=o.closest(".quform-input-date"),t=e.find("> .quform-field-icon"),i=o.data("options"),r=d("",{type:"hidden",name:o.attr("name"),value:o.val()}).data("default",o.val()).addClass("quform-field-date-hidden").insertAfter(o);o.attr("name",""),i.placeholder?o.attr("placeholder",i.placeholder):o.removeAttr("placeholder");var n,s,a={start:i.start||"month",depth:i.depth||"month",culture:i.locale||"en-US"};i.format?a.format=i.format:a.format=kendo.getCulture(i.locale).calendars.standard.patterns.d,i.showFooter||(a.footer=!1),!i.min||null!==(n=kendo.parseDate(i.min,"yyyy-MM-dd"))&&(a.min=n),!i.max||null!==(s=kendo.parseDate(i.max,"yyyy-MM-dd"))&&(a.max=s),o.kendoDatePicker(a),o.removeClass("k-input").closest(".k-datepicker").removeClass().addClass("k-widget k-datepicker k-header");var u=o.data("kendoDatePicker"),c="quform-datepicker quform-"+m.options.id+"-datepicker quform-"+i.identifier+"-datepicker";h.isNonEmptyString(m.options.theme)&&(c+=" quform-theme-"+m.options.theme),u.dateView.popup.element.addClass(c),e.find(".k-select").hide(),i.autoOpen&&o.on("click focus",function(){u.open()}).blur(function(){u.close()}),t.click(function(){u.open()});var l=function(){var e,t=o.val();h.isNonEmptyString(t)?null===(e=kendo.parseDate(t,a.format,a.culture))?r.val("9999-99-99"):r.val(kendo.toString(e,"yyyy-MM-dd")):r.val("")};u.bind("change",l),o.on("blur.quformDatePicker keyup.quformDatePicker",l);var p,f=o.val();!h.isNonEmptyString(f)||null!==(p=kendo.parseDate(f,"yyyy-MM-dd"))&&(u.value(p),l())})},h.prototype.setupTimepickers=function(){var m;d.isFunction(d.fn.kendoTimePicker)&&d(".quform-field-time",(m=this).$form).each(function(){var o=d(this).addClass("quform-field-time-enhanced"),e=o.closest(".quform-input-time"),t=e.find("> .quform-field-icon"),i=o.data("options"),r=d("",{type:"hidden",name:o.attr("name"),value:o.val()}).data("default",o.val()).addClass("quform-field-time-hidden").insertAfter(o);o.attr("name",""),i.placeholder?o.attr("placeholder",i.placeholder):o.removeAttr("placeholder");var n,s,a={interval:i.interval&&d.isNumeric(i.interval)?parseInt(i.interval,10):30,culture:i.locale||"en-US"};i.format?a.format=i.format:a.format=kendo.getCulture(i.locale).calendars.standard.patterns.t,!i.min||null!==(n=kendo.parseDate(i.min,"HH:mm"))&&(a.min=n),!i.max||null!==(s=kendo.parseDate(i.max,"HH:mm"))&&(a.max=s),o.kendoTimePicker(a),o.removeClass("k-input").closest(".k-timepicker").removeClass().addClass("k-widget k-timepicker k-header");var u=o.data("kendoTimePicker"),c="quform-timepicker quform-"+m.options.id+"-timepicker quform-"+i.identifier+"-timepicker";h.isNonEmptyString(m.options.theme)&&(c+=" quform-theme-"+m.options.theme),u.timeView.popup.element.addClass(c),e.find(".k-select").hide(),i.autoOpen&&o.on("click focus",function(){u.open()}).blur(function(){u.close()}),t.click(function(){u.open()});var l=function(){var e,t=o.val();h.isNonEmptyString(t)?null===(e=kendo.parseDate(t,a.format,a.culture))?r.val("99:99"):r.val(kendo.toString(e,"HH:mm")):r.val("")};u.bind("change",l),o.on("blur.quformTimePicker keyup.quformTimePicker",l);var p,f=o.val();!h.isNonEmptyString(f)||null!==(p=kendo.parseDate(f,"HH:mm"))&&(u.value(p),l())})},h.prototype.setupTooltips=function(){var e;d.isFunction(d.fn.qtip)&&this.options.tooltipsEnabled&&(e={style:{classes:this.options.tooltipClasses},position:{my:this.options.tooltipMy,at:this.options.tooltipAt,viewport:!0,adjust:{method:"shift shift"}}},d(".quform-tooltip-hover",this.$form).qtip(d.extend({},e,{content:{text:function(){return d(this).closest(".quform-input").find("> .quform-tooltip-content").html()}}})),d(".quform-tooltip-click",this.$form).qtip(d.extend({},e,{show:{event:"focus"},hide:{event:"unfocus"},content:{text:function(){return d(this).closest(".quform-input").find("> .quform-tooltip-content").html()}}})),d(".quform-tooltip-icon-hover",this.$form).qtip(d.extend({},e,{content:{text:function(){return d(this).find(".quform-tooltip-icon-content").html()}}})),d(".quform-tooltip-icon-click",this.$form).qtip(d.extend({},e,{show:{event:"click"},hide:{event:"unfocus"},content:{text:function(){return d(this).find(".quform-tooltip-icon-content").html()}}})),d(".quform-labels-inside > .quform-spacer > .quform-inner > .quform-input > .quform-label",this.$form).hover(function(){d(this).siblings(".quform-tooltip-hover").qtip("show")},function(){d(this).siblings(".quform-tooltip-hover").qtip("hide")}))},h.prototype.setupCaptchaImages=function(){var e=this;d(".quform-captcha-image img",this.$form).hover(function(){d(this).stop().fadeTo(400,"0.3")},function(){d(this).stop().fadeTo(400,"1.0")}).click(function(){e.captchaRefreshQueue.push(d(this)),e.processCaptchaRefreshQueue()})},h.prototype.processCaptchaRefreshQueue=function(t){var o,i=this;i.captchaRefreshQueue.length?(o=i.captchaRefreshQueue.shift(),d.ajax({type:"GET",url:quformL10n.ajaxUrl,dataType:"json",data:{action:"quform_regenerate_captcha",quform_form_id:i.options.id,quform_unique_id:i.options.uniqueId,quform_element_id:o.data("element-id")}}).done(function(e){"success"===(e=h.sanitizeResponse(e)).type&&o.attr("src",e.image).animate({opacity:1}),i.captchaRefreshQueue.length?i.processCaptchaRefreshQueue(t):"function"==typeof t&&t.call(i)})):"function"==typeof t&&t.call(i)},h.prototype.applyAllLogic=function(e){this.logicCache={},this.options.logic.elementIds.length&&(this.applyLogic(this.options.logic.elementIds,e),e&&this.applyDependentLogic(this.options.logic.dependentElementIds))},h.prototype.applyLogic=function(e,t){for(var o=0,i=e.length;oparseFloat(t.value);case"lt":return"date"===o?-1===h.compareDates(e,t.value):"time"===o?-1===h.compareTimes(e,t.value):d.isNumeric(e)&&d.isNumeric(t.value)&&parseFloat(e)i.size?this.addElementError(i.identifier,i.tooBigWithFilename.replace("%filename%",s.name))[this.errorShowFunction]():(t=this.nextUploadId++,e.formData={quform_ajax_uploading:1,quform_form_id:this.options.id,quform_form_uid:this.options.uniqueId,quform_element_id:i.id,quform_element_identifier:i.identifier,quform_upload_id:t},this.uploadQueue.push(e),i.queued++,o=e.context=d('
').data("quform-upload-id",t),d('').text(s.name).appendTo(o),d('').attr("title",quformL10n.removeFile).click(function(){for(var e=d(this).closest(".quform-upload-file"),t=e.data("quform-upload-id"),o=n.uploadQueue.length;o--;)n.uploadQueue[o].formData.quform_upload_id===t&&n.uploadQueue.splice(o,1);e.data("quform-upload-uid")&&n.removedUploadUids.push(e.data("quform-upload-uid")),e.remove(),0===r.children().length&&r.hide(),i.queued--}).appendTo(o),r.append(o).show()):this.addElementError(i.identifier,i.notAllowedTypeWithFilename.replace("%filename%",s.name))[this.errorShowFunction]()},h.prototype.processUploadQueue=function(){var t=this,o=t.uploadQueue.shift();o.submit().done(function(e){"success"===(e=h.sanitizeResponse(e)).type?(o.context.addClass("quform-uploaded").prepend(d('')).data("quform-upload-uid",e.uid),t.uploadQueue.length?t.processUploadQueue():(d(".quform-upload-progress-wrap",t.$form).hide(),t.submitted=!1,t.submit())):t.uploadError(o,e.message)}).fail(function(){t.uploadError(o,quformL10n.ajaxError)})},h.prototype.uploadError=function(e,t){d(".quform-upload-progress-wrap",this.$form).hide(),this.uploadQueue.unshift(e),this.allowResubmission(),this.addElementError(e.formData.quform_element_identifier,t)[this.errorShowFunction](),this.scrollTo(d(".quform-element-"+e.formData.quform_element_identifier,this.$form))},h.prototype.submit=function(e){var t,o=this;o.submitted||(o.submitStartTime=h.timeNow(),o.submitted=!0,e="back"===e?"back":"submit",o.$form.trigger("quform:submit",[o,e]),o.$loading.fadeIn().addClass("quform-loading-triggered"),"submit"===e&&this.uploadQueue.length?o.processUploadQueue():(t={quform_ajax:1,quform_submit:e,quform_removed_upload_uids:o.removedUploadUids.join(",")},o.$form.ajaxSubmit({type:"POST",data:t,dataType:"json",iframe:!0,iframeSrc:"about:blank",url:"",success:function(e){switch(o.submitEndTime=h.timeNow(),(e=h.sanitizeResponse(e)).type){case"success":o.responseSuccess(e.confirmation);break;case"error":o.responseError(e);break;case"page":o.allowResubmission(),o.goToPage(e.page);break;case"invalid":o.responseInvalid(e)}},error:function(){o.submitEndTime=h.timeNow(),o.responseInvalid({message:quformL10n.ajaxError})}})))},h.prototype.responseSuccess=function(e){var t=this;t.$form.trigger("quform:successStart",[t,e]),t.$loading.addClass("quform-loading-success");var o=function(){switch(e.type){case"message":t.reset(e.resetForm),t.showSuccessMessage(e);break;case"message-redirect-page":case"message-redirect-url":t.showSuccessMessage(e),setTimeout(function(){window.location=e.redirectUrl},1e3*parseFloat(e.redirectDelay));break;case"redirect-page":case"redirect-url":window.location=e.redirectUrl;break;case"reload":window.location.reload()}};e.hideForm?t.$elements.quformHideSlide(function(){o()}):o()},h.prototype.showSuccessMessage=function(e){var t=this,o=d('
').hide(),i=d('
').appendTo(o);h.isNonEmptyString(e.messageIcon)&&i.addClass("quform-success-message-has-icon").append('
'),i.append(d('
').html(e.message)),o["below"===e.messagePosition?"insertAfter":"insertBefore"](t.$elements).quformShowSlide(),setTimeout(function(){t.scrollTo(o)},t.getScrollDelay());var r=1e3*parseFloat(e.messageTimeout);0 .quform-page-progress-number",this.$form).text(t+1):d(".quform-page-progress-text > .quform-page-progress-percentage",this.$form).text(i)):"tabs"===this.options.pageProgressType&&(d(".quform-page-progress-tab.quform-current-tab",this.$form).removeClass("quform-current-tab"),d(".quform-page-progress-tab",this.$form).filter(function(){return d(this).data("id")===e}).addClass("quform-current-tab")),this.$form.trigger("quform:goToPageEnd",[this,r,e,t])))},h.prototype.allowResubmission=function(){var e=this;e.$loading.removeClass("quform-loading-triggered").fadeOut(function(){e.$loading.removeClass("quform-loading-success")}),d(".quform-error-message, .quform-error, .quform-success-message-animate",e.$form).remove(),d(".quform-has-error",e.$form).removeClass("quform-has-error"),"number"==typeof e.successTimeout&&(clearTimeout(e.successTimeout),e.successTimeout=null),window.grecaptcha&&d(".quform-recaptcha",e.$form).each(function(){if("v3"!==d(this).data("config")._version)try{window.grecaptcha.reset(d(this).data("recaptcha-id"))}catch(e){}}),d(".quform-upload-progress-bar",e.$form).width(0),d(".quform-upload-filename",e.$form).text(""),e.submitted=!1},h.prototype.reset=function(e){var t=this;switch(t.$form.trigger("quform:resetStart",[t,e]),t.allowResubmission(),e){default:case"":t.$form.resetForm(),d("input.quform-field-date-enhanced",t.$form).each(function(){var e=d(this),t=e.closest(".quform-input").find(".quform-field-date-hidden").data("default"),o=e.data("kendoDatePicker"),t=h.isNonEmptyString(t)?kendo.parseDate(t,"yyyy-MM-dd"):null;o.value(t),o.trigger("change"),o.dateView.calendar&&o.dateView.calendar.navigate(null===t?new Date:t)}),d("input.quform-field-time-enhanced",t.$form).each(function(){var e=d(this),t=e.closest(".quform-input").find(".quform-field-time-hidden").data("default"),o=e.data("kendoTimePicker"),t=h.isNonEmptyString(t)?kendo.parseDate(t,"HH:mm"):null;o.value(t),o.trigger("change")}),d(".quform-field-hidden",t.$form).each(function(){var e=d(this);e.val(e.data("default")).change()});break;case"clear":t.$form.clearForm(),d("select",t.$form).each(function(){d(this).prop("selectedIndex",0)}),d("input.quform-field-date-enhanced",t.$form).each(function(){var e=d(this).data("kendoDatePicker");e.value(null),e.trigger("change"),e.dateView.calendar&&e.dateView.calendar.navigate(new Date)}),d("input.quform-field-time-enhanced",t.$form).each(function(){var e=d(this).data("kendoTimePicker");e.value(null),e.trigger("change")}),d(".quform-field-hidden",t.$form).val("").change();break;case"keep":}d(".quform-captcha-image img",t.$form).each(function(){t.captchaRefreshQueue.push(d(this))}),t.processCaptchaRefreshQueue(),d('input[type="text"], input[type="email"], textarea',t.$form).blur(),t.applyAllLogic(),d(".quform-field-select-enhanced, .quform-field-multiselect-enhanced",t.$form).trigger("change"),t.removedUploadUids=[],d(".quform-upload-files",t.$form).empty().hide();for(var o=0,i=t.uploadElements.length;o').hide(),r=d('
');"string"==typeof t&&t.length&&r.append(d('
').html(t)),r.append(d('
').html(e)).appendTo(i),o.$elements.prepend(i),i.quformShowSlide(),setTimeout(function(){o.scrollTo(i)},o.getScrollDelay())},h.prototype.addElementError=function(e,t){var o,i=d('
'),r=d('
').appendTo(i);return h.isNonEmptyString(this.options.errorsIcon)&&r.append(d('').append('')),r.append(d('').html(t)),this.$wrapper.hasClass("quform-errors-absolute")&&((o=d('').append('')).click(function(){d(this).closest(".quform-error").fadeOut()}),r.append(o)),d(".quform-element-"+e,this.$form).addClass("quform-has-error"),d(".quform-input-"+e,this.$form).after(i),i},h.prototype.scrollTo=function(e){var t;this.options.scrolling&&e&&e.length&&((t=this.getScrollElement())?t.scrollTo(e,this.options.scrollSpeed,{axis:"y",offset:this.options.scrollOffset}):h.isScrolledIntoView(e,this.options.scrollOffset)||d.scrollTo(e,this.options.scrollSpeed,{axis:"y",offset:this.options.scrollOffset}))},h.prototype.getScrollDelay=function(){return 0 div")):this.$form.closest(".mfp-wrap").length&&(this.$form.closest(".quform").hasClass("quform-max-height")?e=this.$form.closest(".quform"):d.magnificPopup&&d.magnificPopup.instance&&d.magnificPopup.instance.fixedContentPos&&(e=this.$form.closest(".mfp-wrap"))),e},h.prototype.updateFancybox=function(){var e,t;this.options.updateFancybox&&d.isFunction(d.fn.fancybox)&&d.fancybox&&("2"===(e=h.getFancyboxVersion())?(t=d(".fancybox-wrap")).length&&t.is(":visible")&&d.fancybox.update():"1"===e&&(t=d("#fancybox-wrap")).length&&t.is(":visible")&&d.fancybox.resize())},h.getFancyboxVersion=function(){return d.isFunction(d.fn.fancybox)&&d.fancybox?h.isNonEmptyString(d.fancybox.version)?d.fancybox.version.charAt(0):"1":null},h.isScrolledIntoView=function(e,t){var o=d(window).scrollTop(),i=o+d(window).height(),r=e.offset().top,n=r+e.height();return t&&(r+=t),o<=n&&r<=i&&n<=i&&o<=r},h.formatFileSize=function(e){return 1073741824<=e?e=Math.round(e/1073741824*10)/10+" GB":1048576<=e?e=Math.round(e/1048576*10)/10+" MB":1024<=e?e=Math.round(e/1024*10)/10+" KB":e+=" bytes",e},(h.preLoadImages=function(e,t){for(var o=0;o a, .page_item_has_children > a'); for(const link of links){ link.addEventListener('focus', toggleFocus, true); link.addEventListener('blur', toggleFocus, true); } for(const link of linksWithChildren){ link.addEventListener('touchstart', toggleFocus, false); } function toggleFocus(){ if(event.type==='focus'||event.type==='blur'){ let self=this; while(! self.classList.contains('nav-menu')){ if('li'===self.tagName.toLowerCase()){ self.classList.toggle('focus'); } self=self.parentNode; }} if(event.type==='touchstart'){ const menuItem=this.parentNode; event.preventDefault(); for(const link of menuItem.parentNode.children){ if(menuItem!==link){ link.classList.remove('focus'); }} menuItem.classList.toggle('focus'); }} }()); var persianNumbersPattern=[/۰/g, /۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g] var persianNumbers=['۰', '۱', '۲', '۳', '۴', '۵', '۶', '۷', '۸', '۹'] function toEn(str){ for (var i=0; i<10; i++){ str=str.replace(persianNumbersPattern[i], i); } return str; }; function toFa(str){ for (var i=0; i<10; i++){ str=str.replace(i, persianNumbers[i]); } return str; }; jQuery(function($){ jQuery('#side-navbar-close').click(function($){ jQuery('#side-navbar').animate({'right': '-300px'}); jQuery('#side-navbar-overlay').css({'opacity': '0', 'z-index': '-1'}); }); jQuery('#side-navbar-open').click(function($){ jQuery('#side-navbar').animate({'right': '0'}); jQuery('#side-navbar-overlay').css({'opacity': '1', 'z-index': '1001'}); }); jQuery('#side-navbar-overlay').click(function($){ jQuery('#side-navbar').animate({'right': '-300px'}); jQuery('#side-navbar-overlay').css({'opacity': '0', 'z-index': '-1'}); }); jQuery('#topbar-close').click(function($){ jQuery('#topbar').css({'display': 'none'}); }); jQuery(document).ready(function(){ if(jQuery(window).scrollTop() > 0){ jQuery("#support-cta-big").css({'display': 'none'}); }}); jQuery(window).scroll(function(){ var scroll=jQuery(window).scrollTop(); if(scroll > 0){ jQuery("#support-cta-big").fadeOut(); }else{ jQuery("#support-cta-big").fadeIn(); }}) }); jQuery(function($){ jQuery('#coupon-form-button').click(function($){ var couponForm=jQuery('#coupon-form') var state=couponForm.data("state"); if(state=='0'){ couponForm.data("state", 1); couponForm.fadeIn(); jQuery('#coupon-form-chevron').css({'transform':'rotate(180deg)'}); }else{ couponForm.data("state", 0); couponForm.fadeOut(); jQuery('#coupon-form-chevron').css({'transform':'rotate(0deg)'}); }}); }); function faqToggle(itemNo){ var faq=jQuery('#faq-content-'+itemNo) var chev=jQuery('#faq-chevron-'+itemNo) var state=faq.data("state"); if(state=='0'){ faq.slideDown(); faq.data("state", 1); chev.css({'transform':'rotate(180deg)'}); }else{ faq.slideUp(); faq.data("state", 0); chev.css({'transform':'rotate(0deg)'}); }} function addToCart(product_id, cart_url){ jQuery('#buy-action-overlay').fadeIn(); jQuery.ajax({ type: "POST", url: pk_ajax.siteUrl + '/wp-admin/admin-ajax.php', data: {action:'increase_item_count_in_cart','product_id':product_id}, success: function (res){ if(res){ jQuery('#buy-action-overlay').fadeOut(); jQuery('#buy-actions').remove(); jQuery('#bottom-bar').append(` `); getCartTotal() getCartCount() }} }); } function incrementInCart(product_id){ jQuery('#continue-to-buy-overlay').fadeIn(); jQuery.ajax({ type: "POST", url: pk_ajax.siteUrl + '/wp-admin/admin-ajax.php', data: {action:'increase_item_count_in_cart','product_id':product_id}, success: function (res){ if(res){ const res=(toEn(jQuery('#cart-count').text()) * 1) + 1 jQuery('#cart-count').text(toFa(res.toString())) jQuery('#continue-to-buy-overlay').fadeOut(); if(res==1){ jQuery('#cart-minus').html(''); }else{ jQuery('#cart-minus').html(''); } getCartTotal() }} }); } function decrementInCart(product_id){ jQuery('#continue-to-buy-overlay').fadeIn(); const cart=(toEn(jQuery('#cart-count').text()) * 1) if(cart > 1){ jQuery.ajax({ type: "POST", url: pk_ajax.siteUrl + '/wp-admin/admin-ajax.php', data: {action:'decrease_item_count_in_cart','product_id':product_id}, success: function (res){ if(res){ const res=(toEn(jQuery('#cart-count').text()) * 1) - 1 jQuery('#cart-count').text(toFa(res.toString())) jQuery('#continue-to-buy-overlay').fadeOut(); if(res==1){ jQuery('#cart-minus').html(''); } getCartTotal() }} }); }else if(cart==1){ jQuery.ajax({ type: "POST", url: pk_ajax.siteUrl + '/wp-admin/admin-ajax.php', data: {action:'remove_product_from_cart', 'product_id':product_id}, success: function (res){ if(res){ window.location.reload() }} }); }} function addToCartFromPCard(product_id, e){ e.preventDefault(); jQuery('#product-card-add-plus-overlay-' + product_id).fadeIn(); jQuery.ajax({ type: "POST", url: pk_ajax.siteUrl + '/wp-admin/admin-ajax.php', data: {action:'increase_item_count_in_cart','product_id':product_id}, success: function (res){ if(res){ jQuery('#product-card-add-plus-overlay-' + product_id).fadeOut(); jQuery('#add-container-' + product_id).empty(); jQuery('#add-container-' + product_id).append(`
۱
`); getCartTotal() getCartCount() function progress(){ jQuery('#added-to-cart-snackbar-timer').animate({ 'width': '0' }, 5000, 'linear', ()=> { jQuery('#added-to-cart-snackbar').fadeOut(); }); } jQuery('#added-to-cart-snackbar').fadeIn(); progress(); }} }); } function incrementInCartFromPCard(product_id, e){ e.preventDefault(); jQuery('#card-cart-buttons-overlay-' + product_id).fadeIn(); jQuery.ajax({ type: "POST", url: pk_ajax.siteUrl + '/wp-admin/admin-ajax.php', data: {action:'increase_item_count_in_cart','product_id':product_id}, success: function (res){ if(res){ const res=(toEn(jQuery('#card-cart-count-' + product_id).text()) * 1) + 1 jQuery('#card-cart-count-'+ product_id).text(toFa(res.toString())) jQuery('#card-cart-buttons-overlay-' + product_id).fadeOut(); if(res > 1){ jQuery('#card-cart-minus-' + product_id).html(''); } getCartTotal() }} }); } function decrementInCartFromPCard(product_id, e){ e.preventDefault(); jQuery('#card-cart-buttons-overlay-' + product_id).fadeIn(); const cart=(toEn(jQuery('#card-cart-count-' + product_id).text()) * 1) if(cart > 1){ jQuery.ajax({ type: "POST", url: pk_ajax.siteUrl + '/wp-admin/admin-ajax.php', data: {action:'decrease_item_count_in_cart','product_id':product_id}, success: function (res){ if(res){ const res=(toEn(jQuery('#card-cart-count-' + product_id).text()) * 1) - 1 jQuery('#card-cart-count-' + product_id).text(toFa(res.toString())) jQuery('#card-cart-buttons-overlay-' + product_id).fadeOut(); if(res==1){ jQuery('#card-cart-minus-' + product_id).html(''); } getCartTotal() }} }); }else if(cart==1){ jQuery.ajax({ type: "POST", url: pk_ajax.siteUrl + '/wp-admin/admin-ajax.php', data: {action:'remove_product_from_cart', 'product_id':product_id}, success: function (res){ if(res){ window.location.reload() }} }); }} function getCartTotal(){ jQuery.ajax({ type: "POST", url: pk_ajax.siteUrl + '/wp-admin/admin-ajax.php', data: {action:'get_cart_total_amount'}, success: function (res){ jQuery('#cart-total').html(res); }}); } function getCartCount(){ jQuery.ajax({ type: "POST", url: pk_ajax.siteUrl + '/wp-admin/admin-ajax.php', data: { action:'cart_product_items_count' }, success: function (res){ jQuery('#header-cart-badge').html(toFa(res)); }}); } jQuery('div').filter(function(){ return this.id.match(/card-cart-plus-\d{1,}/); }).click(getCartTotal); jQuery('div').filter(function(){ return this.id.match(/card-cart-minus-\d{1,}/); }).click(getCartTotal); function showNotifyMe(e){ e.preventDefault(); jQuery('#notify-me-btn').fadeToggle(); jQuery('#notify-me').fadeToggle(); jQuery('#notify-me-name').focus(); } function closeNotifyMe(){ jQuery('#notify-me-btn').fadeToggle(); jQuery('#notify-me').fadeToggle(); } function notifyMe(productID, e){ e.preventDefault(); var firstName=jQuery('#notify-me-first-name').val(); var lastName=jQuery('#notify-me-last-name').val(); var phone=toEn(jQuery('#notify-me-phone').val()); var checkFirstName=/^[\u0600-\u06FF\s]+$/.test(firstName) var checkLastName=/^[\u0600-\u06FF\s]+$/.test(lastName) var checkPhone=/^09\d{9}$/.test(phone) if(checkFirstName&&checkLastName&&checkPhone){ jQuery.ajax({ type: "POST", url: pk_ajax.siteUrl + '/wp-json/pk/v1/notify', data: { product_id: productID, first_name: firstName, last_name: lastName, phone: toEn(phone), }, success: function (res){ jQuery('#notify-me-first-name').val("") jQuery('#notify-me-last-name').val("") jQuery('#notify-me-phone').val("") jQuery('#notify-me-btn').fadeIn(); jQuery('#notify-me').fadeOut(); jQuery('#notify-me-btn').html(res); jQuery('#notify-me-btn').prop("disabled", true); }, error: function (err){ jQuery('#notify-me-first-name').val("") jQuery('#notify-me-last-name').val("") jQuery('#notify-me-phone').val("") jQuery('#notify-me-btn').fadeIn(); jQuery('#notify-me').fadeOut(); jQuery('#notify-me-btn').html(err.responseJSON); jQuery('#notify-me-btn').addClass("text-danger border-danger"); }}); }else{ if(! checkFirstName){ jQuery('#notify-me-first-name').addClass("border-danger border-2"); } if(! checkLastName){ jQuery('#notify-me-last-name').addClass("border-danger border-2"); } if(! checkPhone){ jQuery('#notify-me-phone').addClass("border-danger border-2"); }} } jQuery('#notify-me-phone').on('blur', function(){ let input=toEn(jQuery('#notify-me-phone').val()) if(/^09\d{9}$/.test(input)===false){ jQuery('#notify-me-phone').addClass("border-danger border-2"); }else{ jQuery('#notify-me-phone').removeClass("border-danger"); jQuery('#notify-me-phone').addClass("border-success"); }}); function showMethodDescription(desc){ jQuery('#payment-description').html(desc) } function seasonalNotifyMe(e){ e.preventDefault(); var type=jQuery('#notify-me-type option:selected').val(); checkType=true if(!(type=='walnut'||type=='kernel')){ checkType=false } var firstName=jQuery('#notify-me-first-name').val(); var lastName=jQuery('#notify-me-last-name').val(); var phone=toEn(jQuery('#notify-me-phone').val()); var checkFirstName=/^[\u0600-\u06FF\s]+$/.test(firstName) var checkLastName=/^[\u0600-\u06FF\s]+$/.test(lastName) var checkPhone=/^09\d{9}$/.test(phone) if(checkFirstName&&checkLastName&&checkPhone&&checkType){ jQuery.ajax({ type: "POST", url: pk_ajax.siteUrl + '/wp-json/pk/v1/seasonal-notify', data: { first_name: firstName, last_name: lastName, phone: toEn(phone), type: type, }, success: function (res){ jQuery('#notify-me-first-name').val("") jQuery('#notify-me-last-name').val("") jQuery('#notify-me-phone').val("") jQuery('#seasonal-notify-me').fadeOut(); jQuery('#notify-me-seasonal-res').fadeIn(); jQuery('#notify-me-seasonal-res').html(res); jQuery('#notify-me-seasonal-res').prop("disabled", true); }, error: function (err){ jQuery('#notify-me-first-name').val("") jQuery('#notify-me-last-name').val("") jQuery('#notify-me-phone').val("") jQuery('#seasonal-notify-me').fadeOut(); jQuery('#notify-me-seasonal-res').fadeIn(); jQuery('#notify-me-seasonal-res').html(err.responseJSON); jQuery('#notify-me-seasonal-res').addClass("text-danger border-danger"); }}); }else{ if(! checkFirstName){ jQuery('#notify-me-first-name').addClass("border-danger border-2"); } if(! checkLastName){ jQuery('#notify-me-last-name').addClass("border-danger border-2"); } if(! checkPhone){ jQuery('#notify-me-phone').addClass("border-danger border-2"); } if(!(type=='walnut'||type=='kernel')){ jQuery('#notify-me-type').addClass("border-danger border-2"); return }} } jQuery('#notify-me-type').change(function (){ var type=jQuery('#notify-me-type option:selected').val(); if(!(type=='walnut'||type=='kernel')){ jQuery('#notify-me-type').addClass("border-danger border-2"); }else{ jQuery('#notify-me-type').removeClass("border-danger border-2"); }}); function copyBacsCardNumber(cardNo){ if(window.isSecureContext&&navigator.clipboard){ navigator.clipboard.writeText(cardNo); }else{ const textArea=document.createElement("textarea"); textArea.value=cardNo; document.body.appendChild(textArea); textArea.focus(); textArea.select(); try { document.execCommand ('copy'); } catch (err){ console.error('Unable to copy to clipboard', err); } document.body.removeChild(textArea); } jQuery("#bacs-card-copy-btn").html(' کپی شد') jQuery("#bacs-card-copy-btn").css("border-color", "#2f8056"); }; jQuery(document).ready(function (){ if(isShamsiInAdmin.in_admin==1){ var in_admin=true; var base=isShamsiInAdmin.base; } if(in_admin){ if(base=='edit.php'){ wpsh_num(document.querySelector('#wpadminbar')); wpsh_num(document.querySelector('#adminmenu')); all_query('.date'); all_query('.tablenav-pages'); all_query('.subsubsub'); }else{ wpsh_num(document.body); }}else{ wpsh_num(document.body); }}); function wpsh_num(el){ persian={ 0: '۰', 1: '۱', 2: '۲', 3: '۳', 4: '۴', 5: '۵', 6: '۶', 7: '۷', 8: '۸', 9: '۹' }; elements=[ "CODE", "HEAD", "INPUT", "OPTION", "PRE", "SCRIPT", "STYLE", "TEXTAREA", "TITLE" ]; if(el.nodeType==3){ var parent=jQuery(el.parentElement).prop("tagName"); var list=el.data.match(/[0-9]/g); var english=/[a-zA-Z]/g; if(list!==null&&list.length!==0&&!english.test(el.data)){ for (var i=0; i < list.length; i++) if(jQuery.inArray(parent, elements)===-1){ el.data=el.data.replace(list[i], persian[list[i]]); }} } for (var i=0; i < el.childNodes.length; i++){ wpsh_num(el.childNodes[i]); }} function all_query(query){ var els=document.querySelectorAll(query); for (var i=0; i < els.length; ++i){ wpsh_num(els[i]); }}; function wpshIgnoreToEn(number){ if(number===undefined) return ""; var str=jQuery.trim(number.toString()); if(str==="") return ""; str=str.replace(/۰/g, "0"); str=str.replace(/۱/g, "1"); str=str.replace(/۲/g, "2"); str=str.replace(/۳/g, "3"); str=str.replace(/۴/g, "4"); str=str.replace(/۵/g, "5"); str=str.replace(/۶/g, "6"); str=str.replace(/۷/g, "7"); str=str.replace(/۸/g, "8"); str=str.replace(/۹/g, "9"); return str; } function wpshNumIgnore(exists, el, live){ if(jQuery(exists).length > 0){ if(typeof wpshNumbersPro==="undefined"){ jQuery(document).ready(function (){ jQuery(el).each(function (){ wpshWooStar=wpshIgnoreToEn(jQuery(this).html()); jQuery(this).html(wpshWooStar); }); }); }else{ if(wpshNumbersPro["live"]==1&&live==1){ jQuery(document).on("mouseover", function (){ jQuery(el).each(function (){ wpshWooStar=wpshIgnoreToEn(jQuery(this).html()); jQuery(this).html(wpshWooStar); }); }); }else{ jQuery(document).ready(function (){ jQuery(el).each(function (){ wpshWooStar=wpshIgnoreToEn(jQuery(this).html()); jQuery(this).html(wpshWooStar); }); }); }} }};