!function(){"use strict";var e,t,n,r,o,i={1295:function(e,t,n){n.d(t,{Ro:function(){return u}});var r=n(1873),o=n(7113),i=n(5798),a=function(){function e(t){(0,r.A)(this,e),this.currency=t}return(0,o.A)(e,[{key:"toNumber",value:function(t){return e.isNumeric(t)?parseFloat(t):e.cleanNumber(t,this.currency.symbol_right,this.currency.symbol_left,this.currency.decimal_separator)}},{key:"toMoney",value:function(t){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]||(t=e.cleanNumber(t,this.currency.symbol_right,this.currency.symbol_left,this.currency.decimal_separator)),!1===t)return"";var n="";"-"===(t+="")[0]&&(t=parseFloat(t.substr(1)),n="-");var r=this.numberFormat(t,this.currency.decimals,this.currency.decimal_separator,this.currency.thousand_separator);"0.00"===r&&(n="");var o=this.currency.symbol_left?this.currency.symbol_left+this.currency.symbol_padding:"",i=this.currency.symbol_right?this.currency.symbol_padding+this.currency.symbol_right:"";return r=n+e.htmlDecode(o)+r+e.htmlDecode(i)}},{key:"getCode",value:function(){return"code"in this.currency&&""!==this.currency.code&&this.currency.code}},{key:"numberFormat",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:",",o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];e=(e+"").replace(",","").replace(" ","");var i,a,c,u=isFinite(+e)?+e:0,s=isFinite(+t)?Math.abs(t):0,f="";return 0===parseInt(t)?(u+=1e-10,f=(""+Math.round(u)).split(".")):f=-1===parseInt(t)?(""+u).split("."):(i=u+=1e-10,a=s,c=Math.pow(10,a),""+Math.round(i*c)/c).split("."),f[0].length>3&&(f[0]=f[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,r)),o&&(f[1]||"").length<s&&(f[1]=f[1]||"",f[1]+=new Array(s-f[1].length+1).join("0")),f.join(n)}}],[{key:"cleanNumber",value:function(t,n,r,o){var i="",a="",c="",u=!1;t=(t=(t=(t+=" ").replace(/&.*?;/g,"")).replace(n,"")).replace(r,"");for(var s=0;s<t.length;s++)c=t.substr(s,1),parseInt(c,10)>=0&&parseInt(c,10)<=9||c===o?i+=c:"-"===c&&(u=!0);for(var f=0;f<i.length;f++)(c=i.substr(f,1))>="0"&&c<="9"?a+=c:c===o&&(a+=".");return u&&(a="-"+a),!!e.isNumeric(a)&&parseFloat(a)}},{key:"isNumeric",value:function(e){return(0,i.isNumber)(e)}},{key:"getDecimalSeparator",value:function(e){var t;switch(e){case"currency":t=window.gf_global.gf_currency_config.decimal_separator;break;case"decimal_comma":t=",";break;default:t="."}return t}},{key:"htmlDecode",value:function(e){var t,n,r=e,o=r.match(/&#[0-9]{1,5};/g);if(null!=o)for(var i=0;i<o.length;i++)r=(t=(n=o[i]).substring(2,n.length-1))>=-32768&&t<=65535?r.replace(n,String.fromCharCode(t)):r.replace(n,"");return r}}])}(),c=null,u=function(e){return(c=c||new a(window.gf_global.gf_currency_config)).toNumber(e)};t.Ay=a,window.gform=window.gform||{},window.gform.Currency=a},1162:function(e,t,n){n.d(t,{Nl:function(){return m},ts:function(){return g},zj:function(){return f}});var r=n(527),o=n(455),i=n(9280),a=n.n(i),c=n(270);function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach(function(t){(0,r.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var f=function(){var e=(0,o.A)(a().mark(function e(t,n){var r,o;return a().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=g(t)){e.next=3;break}return e.abrupt("return",null);case 3:if(void 0!==(r=m(t))){e.next=9;break}return e.next=7,d(t,n);case 7:o=e.sent,r=l(t,o);case 9:return e.abrupt("return",r);case 10:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}(),d=function(){var e=(0,o.A)(a().mark(function e(t,n){var r,o;return a().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return(r=new FormData).append("gform_ajax_nonce",window.gform_theme_config.config_nonce),r.append("action","gform_get_config"),r.append("args",JSON.stringify(n)),r.append("config_path",t),r.append("query_string",window.location.search.substring(1)),e.next=8,(0,c.A)(r);case 8:if((o=e.sent).success){e.next=12;break}return console.error(o.data),e.abrupt("return",null);case 12:return e.abrupt("return",o.data);case 13:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}(),m=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window;return e.split("/").reduce(function(e,t){return e&&e[t]},t)},l=function(e,t){var n=e.split("/").slice(1).join("/"),r=m(n,t),o=e.split("/"),i=window;o.slice(0,-1).forEach(function(e){i[e]||(i[e]={}),i=i[e]});var a=o[o.length-1];return i[a]=r,i[a]},g=function(e){return p(e)?(e.startsWith("/")&&(e=e.substring(1)),e.endsWith("/")&&(e=e.substring(0,e.length-1)),e):(console.error('Invalid config path format. The path must be in the format of "config_name/path/to/config/item" (i.e. "gform_theme_config/common/form/product_meta").'),!1)},p=function(e){return"string"==typeof e&&e.match(/^[a-z0-9_\-/]+$/)};window.gform.config=window.gform.config||{},window.gform.config=s(s({},window.gform.config),{getConfig:f,updateConfig:l,cleanPath:g,getConfigViaAjax:d})},2557:function(e,t,n){n.d(t,{x:function(){return c}});var r=n(455),o=n(9280),i=n.n(o),a=n(1162),c=function(){var e=(0,r.A)(i().mark(function e(t,n){return i().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=t.endsWith("/")?t+n:t+"/"+n,e.abrupt("return",(0,a.zj)(t,{form_ids:[n]}));case 2:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}();window.gform.config=window.gform.config||{},window.gform.config.getFormConfig=c},270:function(e,t,n){var r=n(8140),o=n(455),i=n(9280),a=n.n(i),c=n(6443),u=n.n(c),s=function(){var e=(0,o.A)(a().mark(function e(t){var n,o,i,c,s,f,d,m,l;return a().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n={},o={},i=new URL(u().common.form.ajax.ajaxurl),c=i.pathname+i.search,e.prev=4,e.next=7,fetch(c,{method:"POST",body:t});case 7:if(!(o=e.sent).ok){e.next=17;break}return e.next=11,o.text();case 11:s=e.sent,f=s.split("\x3c!-- gf:json_start --\x3e"),d=f[1].split("\x3c!-- gf:json_end --\x3e"),m=(0,r.A)(d,1),l=m[0],n=JSON.parse(l.trim()),e.next=19;break;case 17:n.success=!1,403===o.status&&(n.data={message:u().common.form.ajax.i18n.error_403,response:o});case 19:e.next=24;break;case 21:e.prev=21,e.t0=e.catch(4),n.success=!1;case 24:return n.success||(n.data=n.data||{message:u().common.form.ajax.i18n.unknown_error,response:o}),e.abrupt("return",n);case 26:case"end":return e.stop()}},e,null,[[4,21]])}));return function(t){return e.apply(this,arguments)}}();t.A=s},2590:function(e,t,n){var r=n(5798),o=function(e,t){window.jQuery(document).trigger("gform_post_render",[e,t]),(0,r.trigger)({event:"gform/postRender",native:!1,data:{formId:e,currentPage:t}}),(0,r.trigger)({event:"gform/post_render",native:!1,data:{formId:e,currentPage:t}})};t.A=o,window.gform.core=window.gform.core||{},window.gform.core.triggerPostRenderEvents=o},8773:function(e,t,n){n.r(t),n.d(t,{getFieldId:function(){return v},getFieldLabel:function(){return d},getFormId:function(){return p},getOptionFields:function(){return c},getProductFields:function(){return a},getProductMeta:function(){return s},getProductQuantity:function(){return f},getShippingField:function(){return u},parseChoiceValue:function(){return l}});var r=n(8134),o=n(5798),i=n(1295),a=function(e){return(0,o.getNodes)(".gfield--type-product",!0,e,!0)},c=function(e,t){var n=v(t);return(0,o.getNodes)(".gfield_option_".concat(e.dataset.formid,"_").concat(n),!0,e,!0)},u=function(e){return(0,o.getNode)(".gfield--type-shipping",e,!0)},s=function(e,t){if(!t)return[];if(m(t))return[];var n=[],r="",a="",c=null,u=null,s=null,f=v(t);switch(g(t)){case"select":u=(0,o.getNode)("select",t,!0),c=l(u.value),n.push({id:f,name:c.name,price:c.price});break;case"radio":(s=(0,o.getNodes)("input",!0,t,!0).find(function(e){return e.checked}))&&(c=l(s.value),n.push({id:f,name:c.name,price:c.price}));break;case"checkbox":(0,o.getNodes)('input[type="checkbox"]:checked',!0,t,!0).forEach(function(e){c=l(e.value),n.push({id:f,name:c.name,price:c.price})});break;case"hiddenproduct":case"calculation":case"singleproduct":r=(0,o.getNode)('input[name="input_'.concat(f,'.1"]'),t,!0).value,a=(0,i.Ro)((0,o.getNode)('input[name="input_'.concat(f,'.2"]'),t,!0).value),n.push({id:f,name:r,price:a});break;case"singleshipping":case"price":a=(0,i.Ro)((0,o.getNode)('input[name="input_'.concat(f,'"]'),t,!0).value||"0"),r=d(t),n.push({id:f,name:r,price:a})}return n},f=function(e,t){var n=v(t),r=(0,o.getNode)(".gfield_quantity_".concat(e.dataset.formid,"_").concat(n),e,!0),i=r?(0,o.getNode)("input, select",r,!0):(0,o.getNode)(".ginput_quantity, #ginput_quantity_".concat(e.dataset.formid,"_").concat(n),t,!0);return i?i.value?parseFloat(i.value):0:1},d=function(e){var t=(0,o.getNode)(".gfield_label",e,!0);return t?t.innerText:""},m=function(e){if("hidden"===e.dataset.conditionalLogic)return!0;var t=e.closest(".gform_page");return!(!t||"hidden"!==t.dataset.conditionalLogic)},l=function(e){if(!e)return{name:null,price:null};var t=e.lastIndexOf("|");return-1===t?{name:e,price:null}:{name:e.slice(0,t),price:(0,i.Ro)(e.slice(t+1))}},g=function(e){var t="gfield--input-type-",n=(0,r.A)(e.classList).find(function(e){return e.startsWith(t)});return n?n.replace(t,""):""},p=function(e){return e.closest(".gform_wrapper form").dataset.formid},v=function(e){return e.id.split("_")[2]}},2:function(e,t,n){var r=n(455),o=n(9280),i=n.n(o),a=n(5798),c=n(1295),u=n(8773),s=function(e){var t=e.cloneNode(!0);return t.querySelectorAll("span").forEach(function(e){return e.remove()}),t},f=function(e,t){var n=(0,u.parseChoiceValue)(e),r=n.name,o=!0;switch(null===n.price||"price"!==t&&"currency"!==t||(r=n.price||0,o=!1),t){case"price":o&&(r=d(r)),r=!1===r?"":r;break;case"currency":r=!1===(r=m(r,!1))?"":r;break;case"numeric":return o&&(r=d(r)),!1===r?0:r;default:r=r?r.trim():""}return r},d=function(e){return new c.Ay(window.gf_global.gf_currency_config).toNumber(e)},m=function(e,t){return window.gf_global.gf_currency_config?new c.Ay(window.gf_global.gf_currency_config).toMoney(e,t):e};function l(e){if("SELECT"===e.tagName){var t=Array.from(e.options).filter(function(e){return e.selected}).map(function(e){return e.value});return e.multiple?t:t[0]||""}if("checkbox"===e.type){var n=document.querySelectorAll('input[name="'+e.name+'"]:checked');return n.length>1?Array.from(n).map(function(e){return e.value}):e.checked?e.value:""}if("radio"===e.type){var r=document.querySelector('input[name="'+e.name+'"]:checked');return r?r.value:""}return e.value||""}var g=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(r||(r=p(e,t,n)),!1===r)return"";var o=r.input;if(!r.isVisible)return"";var i,a="";switch(r.modifier){case"label":var c=r.field.querySelector(".gfield_label").cloneNode(!0);return c.querySelectorAll(".screen-reader-text").forEach(function(e){return e.remove()}),c.textContent;case"qty":if(r.field.classList.contains("gfield_price"))return!1===(i=window.gformGetProductQuantity(e,r.fieldId))||""===i?0:i}if(o.length>0&&("checkbox"===o[0].type||"radio"===o[0].type)&&(o=Array.from(o).filter(function(e){return e.checked})),1===o.length){var u=o[0];if("SELECT"!==u.tagName&&"radio"!==u.type&&"checkbox"!==u.type||""!==r.modifier)void 0===i&&(i=l(u));else{if("SELECT"===u.tagName)i=Array.from(u.options).filter(function(e){return e.selected});else if("radio"===u.type&&u.parentElement.classList.contains("gchoice_button")){var d=u.parentElement,m=Array.from(d.parentElement.children).filter(function(e){return e.classList.contains("gchoice_label")}),g=m.length>0?m[0].querySelector("label"):null;i=g?[s(g)]:[]}else{for(var v=u.nextElementSibling;v&&"LABEL"!==v.tagName;)v=v.nextElementSibling;i=v?[s(v)]:[]}if(1===i.length)i=i[0].textContent||i[0];else if(i.length>1){for(var b=[],_=0;_<i.length;_++)b[_]=i[_].textContent||i[_];i=b}}a=Array.isArray(i)?i.join(", "):"string"==typeof i?f(i,r.modifier):""}else if(o.length>1){i=[];for(var w=0;w<o.length;w++)if("checkbox"===o[0].type&&""===r.modifier){for(var h=o[w].nextElementSibling;h&&"LABEL"!==h.tagName;)h=h.nextElementSibling;if(h){var y=s(h);i[w]=f(y.textContent,r.modifier)}else i[w]=""}else i[w]=f(l(o[w]),r.modifier);a=i.join(", ")}return a},p=function(e,t,n){var r=parseInt(t,10),o=document.getElementById("input_".concat(e,"_").concat(r,"_copy_values_activated"));if(o&&o.checked){var i=o.dataset.source_field_id;t=t.toString()===r.toString()?i:t.toString().replace(r+".",i+"."),r=i}var a=document.getElementById("field_".concat(e,"_").concat(r));if(!a)return!1;var c=function(e,t,n){var r=t.toString()===n.toString()?'input[name^="input_'.concat(t,'"]'):'input[name="input_'.concat(n,'"]'),o="".concat(r,', select[name^="input_').concat(n,'"], textarea[name="input_').concat(n,'"]');return e.querySelectorAll(o)}(a,r,t),u=a.querySelector(".ginput_container_email");return u&&u.classList.contains("ginput_complex")&&(c=[c[0]]),void 0===n&&(n=""),n=n.replace(":",""),{fieldId:r,field:a,input:c,isVisible:!window.gf_check_field_rule||"show"===window.gf_check_field_rule(e,r,!0,""),modifier:n}},v=function(e,t){void 0===t&&(t=/{[^{]*?:(\d+(\.\d+)?)(:(.*?))?}/i);for(var n=[];t.test(e);){var r=n.length;n[r]=t.exec(e),e=e.replace(""+n[r][0],"")}return n};window.gform=window.gform||{},window.gform.mergeTags={getFieldValue:g,replaceMergeTags:function(e,t){var n=v(t);for(var r in n)if(Object.hasOwn(n,r)){var o=n[r][1],i=void 0===n[r][3]?"":n[r][3].replace(":",""),a=g(e,o,i);t=t.replace(n[r][0],a)}return t},formatValue:f,parseMergeTags:v,getMergeTagInfo:p};var b=function(){(0,a.consoleInfo)("Gravity Forms Common: Initialized all javascript that targeted document ready.")},_=function(){(0,a.ready)(b)},w=function(){_()},h=n(2888),y=n(527),x=n(3953),k=window.gform_theme_config,S={init:performance.now(),formRerender:{}},A=function(e){var t=!!(0,a.getNode)('input[name="version_hash"]',e,!0);if(!N()&&!t){var n='<input type="hidden" name="version_hash" value="'.concat(k.common.form.honeypot.version_hash,'" />');e.insertAdjacentHTML("beforeend",n)}},N=function(){return window._phantom||window.callPhantom||window.__phantomas||window.Buffer||window.emit||window.spawn||window.webdriver||window._selenium||window._Selenium_IDE_Recorder||window.callSelenium||window.__nightmare||window.domAutomation||window.domAutomationController||window.document.__webdriver_evaluate||window.document.__selenium_evaluate||window.document.__webdriver_script_function||window.document.__webdriver_script_func||window.document.__webdriver_script_fn||window.document.__fxdriver_evaluate||window.document.__driver_unwrapped||window.document.__webdriver_unwrapped||window.document.__driver_evaluate||window.document.__selenium_unwrapped||window.document.__fxdriver_unwrapped||window.document.documentElement.getAttribute("selenium")||window.document.documentElement.getAttribute("webdriver")||window.document.documentElement.getAttribute("driver")},j=function(e){var t,n=performance.now(),r=parseInt(e.dataset.formid,10),o=r in S.formRerender?S.formRerender[r]:S.init,i=Math.max(0,Math.round(n-o)),c=(0,a.getNode)('input[name="gform_submission_speeds"]',e,!0),u=(0,a.getNode)("#gform_source_page_number_".concat(r),e,!0),s=u?parseInt(u.value,10):1;if(!c){var f=document.createElement("input");return f.type="hidden",f.name="gform_submission_speeds",f.value=JSON.stringify({pages:(0,y.A)({},s,[i])}),void e.appendChild(f)}try{t=JSON.parse(c.value.trim())}catch(e){t={}}"object"!==(0,h.A)(t)||null===t?t={pages:[]}:"object"!==(0,h.A)(t.pages)||null===t.pages?t.pages[s]=[]:Array.isArray(t.pages[s])||(t.pages[s]=[]),t.pages[s].push(i),c.value=JSON.stringify(t)},O=function(){var e;e=[],document.addEventListener("gform/post_render",function(t){var n=parseInt(t.detail.formId,10);e.includes(n)&&(S.formRerender[n]=performance.now())}),(0,a.addFilter)("gform/submission/pre_submission",function(t){if(t.abort)return t;t.submissionType!==x.z2&&t.submissionType!==x.s7||A(t.form);var n=parseInt(t.form.dataset.formid,10);return e.includes(n)||e.push(n),j(t.form),t}),(0,a.consoleInfo)("Gravity Forms Honeypot: Initialized.")},E=n(6201),I=(n(9143),n(3771),n(1162)),T=(n(2557),function(){var e=(0,r.A)(i().mark(function e(t){var n,r,o,a;return i().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=(0,I.ts)(t),n=t?(0,I.Nl)(t):null){e.next=5;break}return console.error("Unable to validate config. Config not found."),e.abrupt("return",!1);case 5:return(r=new FormData).append("gform_ajax_nonce",window.gform_theme_config.config_nonce),r.append("action","gform_validate_config"),r.append("config",JSON.stringify(n)),e.next=11,fetch(window.gform_theme_config.common.form.ajax.ajaxurl,{method:"POST",body:r});case 11:return o=e.sent,e.prev=12,e.next=15,o.json();case 15:o=e.sent,e.next=21;break;case 18:e.prev=18,e.t0=e.catch(12),o={success:!1,data:"There was an unknown error processing your request. Product config could not be validated. Please try again."};case 21:if(o.success){e.next=25;break}return a=o.data?o.data:"There was an unknown error processing your request. Product config could not be validated. Please try again.",console.error(a),e.abrupt("return",!1);case 25:return e.abrupt("return",!0);case 26:case"end":return e.stop()}},e,null,[[12,18]])}));return function(t){return e.apply(this,arguments)}}());window.gform.config=window.gform.config||{},window.gform.config.isValid=T;n(2590);var P=[],M=function(e){var t=e.querySelector('input[name="js_log"]');t||((t=document.createElement("input")).type="hidden",t.name="js_log",e.appendChild(t)),t.value=P.length>0?P.join("\n"):""},C=function(){P.length=0},F=function(e){if(q()){var t=new Date,n=t.getFullYear(),r=String(t.getMonth()+1).padStart(2,"0"),o=String(t.getDate()).padStart(2,"0"),i=String(t.getHours()).padStart(2,"0"),a=String(t.getMinutes()).padStart(2,"0"),c=String(t.getSeconds()).padStart(2,"0"),u=String(t.getMilliseconds()).padStart(3,"0");P.push("".concat(n,"-").concat(r,"-").concat(o," ").concat(i,":").concat(a,":").concat(c,".").concat(u," --\x3e ").concat(e))}},q=function(){var e;return null===(e=window.gform_theme_config)||void 0===e||null===(e=e.common)||void 0===e||null===(e=e.form)||void 0===e||null===(e=e.logging)||void 0===e?void 0:e.is_enabled},L=function(){q()&&(0,a.addAsyncFilter)("gform/submission/submission_started",function(e){var t;if(!e.abort){F("gform/submission/submission_started: Submitting form #".concat(e.form.dataset.formid," via ").concat(e.submissionMethod,". Submission type: ").concat(e.submissionType,". State data:"));var n=null!==(t=window.gform)&&void 0!==t&&null!==(t=t.state)&&void 0!==t&&t.data?window.gform.state.data[e.form.dataset.formid]:{};F(JSON.stringify(n)),M(e.form),C()}},9999)};window.gform.logger=window.gform.logger||{},window.gform.logger.log=F;var D=function(){L(),w(),O(),document.addEventListener("gform/post_render",function(e){R(e.detail.formId,e.detail.currentPage)}),(0,a.trigger)({event:"gform/theme/scripts_loaded"}),(0,a.consoleInfo)("Gravity Forms Theme: Initialized all javascript that targeted document ready.")},R=function(){var e=(0,r.A)(i().mark(function e(t,r){var o,c,u,s,f,d;return i().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if((0,E.vw)(),!document.querySelector("#gform_".concat(t,' .gfield--type-fileupload input[type="file"], #gform_').concat(t,' .gfield--input-type-fileupload input[type="file"], #gform_').concat(t,' .gfield--type-post_image input[type="file"]'))){e.next=9;break}return e.next=5,n.e(290).then(n.bind(n,6051));case 5:o=e.sent,c=o.default,(0,a.runOnce)(c)();case 9:if(!document.querySelector("#gform_".concat(t," .gfield--type-product"))){e.next=16;break}return e.next=13,n.e(157).then(n.bind(n,9845));case 13:u=e.sent,(0,u.default)(t);case 16:if(!document.querySelector("#gform_".concat(t," .gfield--type-image_choice"))){e.next=24;break}return e.next=20,n.e(952).then(n.bind(n,8398));case 20:s=e.sent,f=s.default,(0,a.runOnce)(f)();case 24:if(!document.querySelector("#gform_".concat(t," .gform_page"))){e.next=31;break}return e.next=28,n.e(145).then(n.bind(n,7943));case 28:d=e.sent,(0,d.default)(t);case 31:(0,x.Ay)(t),(0,a.consoleInfo)("Gravity Forms Theme: Initialized all `gform/post_render` form initialization based javascript."),(0,a.trigger)({event:"gform/post_init",native:!1,data:{formId:t}});case 34:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}(),B=function(){(0,a.ready)(D)},U=n(6443),H=n.n(U);n.p=H().public_path,B()},3771:function(e,t,n){n.d(t,{Jt:function(){return o},hZ:function(){return i},wB:function(){return a}});var r=n(5798),o=function(e,t){return f(e),(0,r.cloneDeep)(window.gform.state.data[e][t])},i=function(e,t,n){f(e);var o=window.gform.state.data[e][t];(0,r.isEqual)(o,n)||(window.gform.state.data[e][t]=(0,r.cloneDeep)(n),u(e,t,o))},a=function(e,t,n){d(e),window.gform.state.callbacks[e]=window.gform.state.callbacks[e]||[],c(e,t,n)||window.gform.state.callbacks[e].push({keys:t,callback:n})},c=function(e,t,n){return window.gform.state.callbacks[e].some(function(e){return(0,r.isEqual)(e.keys,t)&&e.callback===n})},u=function(e,t,n){d(e),window.gform.state.callbacks[e].forEach(function(r){if(r.keys.includes(t)){var o=s(e,r.keys,t,n);r.callback(e,t,o)}})},s=function(e,t,n,o){var i={};return t.forEach(function(t){var a=(0,r.cloneDeep)(window.gform.state.data[e][t]),c=n===t?(0,r.cloneDeep)(o):a;i[t]={prev:c,value:a}}),i},f=function(e){window.gform.state=window.gform.state||{},window.gform.state.data=window.gform.state.data||{},window.gform.state.data[e]=window.gform.state.data[e]||{}},d=function(e){window.gform.state=window.gform.state||{},window.gform.state.callbacks=window.gform.state.callbacks||{},window.gform.state.callbacks[e]=window.gform.state.callbacks[e]||[]};window.gform.state=window.gform.state||{get:o,set:i,watch:a}},6201:function(e,t,n){n.d(t,{Ui:function(){return o},g_:function(){return u},lt:function(){return f},rF:function(){return s},vw:function(){return i}});var r=n(5798),o=function(e){var t=(0,r.getNode)("#gform_confirmation_wrapper_".concat(e),document,!0);if(t){var n=t.innerText;t.setAttribute("tabindex","-1"),t.focus(),t.removeAttribute("tabindex","-1"),(0,r.speak)(n,"polite")}},i=function(){var e=(0,r.getNode)(".gform_validation_errors",document,!0);!function(){var e=(0,r.getNode)(".gform_validation_errors",document,!0);if(e){var t=(0,r.getNode)("gform-focus-validation-error");t&&(t.setAttribute("tabindex","-1"),setTimeout(function(){t.focus()},0));var n=e.innerText.replaceAll(/\./g,",");(0,r.speak)(n,"assertive")}}(),e&&a(e)},a=function(e){e.querySelectorAll(".gform_validation_error_link").forEach(function(e){e.addEventListener("click",function(t){var n=e.getAttribute("href"),o=(0,r.getNode)(n,document,!0);if(o){t.preventDefault(),history.replaceState(null,"",n),o.scrollIntoView({behavior:"auto",block:"start"});var i=o.querySelector('input:not([type="hidden"]), select, textarea, button, [title="reCAPTCHA"]');i?i.focus():(o.setAttribute("tabindex","-1"),o.focus())}})})},c=function(e){if("Tab"===e.key){e.preventDefault(),document.removeEventListener("keydown",c);var t=(0,r.getNode)('.gform_wrapper form[data-active-form="true"]',document,!0);if(t){var n=t.getAttribute("data-formid"),o=(0,r.getNode)("#gform_wrapper_".concat(n),document,!0);if(!o.contains(document.activeElement)){var i=o,a=o.querySelector('.gform_page[style="display: block;"]');a&&(i=a);var u=i.querySelector('input:not([type="hidden"]), select, textarea');u?u.focus():(o.setAttribute("tabindex","-1"),o.setAttribute("role","presentation"),o.setAttribute("aria-hidden","true"),o.focus(),o.removeAttribute("aria-hidden"),o.removeAttribute("role"),o.removeAttribute("tabindex"))}}}},u=function(){(0,r.speak)("")},s=function(){document.addEventListener("keydown",c)},f=function(e){var t=e.getAttribute("data-formid"),n=document.querySelectorAll(".gform_wrapper form");n&&n.forEach(function(e){e.removeAttribute("data-active-form"),e.getAttribute("data-formid")===t&&e.setAttribute("data-active-form","true")})}},9143:function(e,t,n){n.d(t,{pn:function(){return x},rV:function(){return l}});var r=n(455),o=n(9280),i=n.n(o),a=n(5798),c=n(3953),u=n(6201),s=n(2590),f=n(270),d=n(6443),m=n.n(d),l=function(){var e=(0,r.A)(i().mark(function e(t){var n,r,o,c,f,d,m,l,b=arguments;return i().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=!(b.length>1&&void 0!==b[1])||b[1],(0,u.g_)(),window.tinymce&&window.tinymce.editors.length>0&&window.tinymce.triggerSave(),r=(0,a.getNode)("#gform_".concat(t),document,!0)){e.next=7;break}return console.error("Form "+t+" not found."),e.abrupt("return",{success:!1,data:"Form "+t+" not found."});case 7:return e.next=9,p(t,r,"gform_submit_form");case 9:if((o=e.sent).success){e.next=15;break}return(0,u.rF)(),_(t,o),g(t),e.abrupt("return",o);case 15:return c=!(!n||!o.data.confirmation_redirect&&!o.data.confirmation_markup),e.next=18,(0,a.filter)({event:"gform/ajax/post_submission_request",data:{form:r,submissionResult:o}});case 18:return f=e.sent,o=f.submissionResult,d=!1,o.data.page_markup?(w(t,r,o.data.page_number,o.data.page_markup),o.data.uploaded_files&&((0,a.getNode)("#gform_uploaded_files_".concat(t),r,!0).value=JSON.stringify(o.data.uploaded_files),(m=(0,a.getNodes)('input[type="file"]',!0,r,!0))&&m.forEach(function(e){return e.value=""})),o.data.form_unique_id&&((0,a.getNode)('input[name="gform_unique_id"]',r,!0).value=o.data.form_unique_id),o.data.page_number>0&&o.data.page_number!==o.data.source_page_number&&h(t,r,o.data.page_number),(0,u.vw)(),d=!0):o.data.form_markup?((0,a.getNode)("#gform_wrapper_".concat(t),document,!0).outerHTML=o.data.form_markup,(0,u.vw)(),d=!0):c&&(v(t,o),d=!0),e.next=24,(0,a.filter)({event:"gform/ajax/post_ajax_submission",data:{form:r,submissionResult:o}});case 24:return l=e.sent,o=l.submissionResult,g(t),d&&(0,s.A)(t,o.data.page_number),e.abrupt("return",o);case 29:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),g=function(e){window["gf_submitting_".concat(e)]=!1;var t=(0,a.getNode)("#gform_".concat(e),document,!0);t&&(0,c.Ec)(t)},p=function(){var e=(0,r.A)(i().mark(function e(t,n,r){return i().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,f.A)(y(t,n,r));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},e)}));return function(t,n,r){return e.apply(this,arguments)}}(),v=function(){var e=(0,r.A)(i().mark(function e(t,n){var r,o,c,s,f,d;return i().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if((r=n.data).confirmation_redirect||r.confirmation_markup){e.next=3;break}return e.abrupt("return");case 3:if("redirect"!==r.confirmation_type){e.next=6;break}return window.location=r.confirmation_redirect,e.abrupt("return");case 6:return e.next=8,(0,a.filter)({event:"gform/ajax/pre_display_confirmation",data:{formId:t,submissionResult:n,abort:!1}});case 8:if(!(o=e.sent).abort){e.next=11;break}return e.abrupt("return");case 11:return n=o.submissionResult,r=n.data,c=(0,a.getNode)("#gform_wrapper_".concat(t),document,!0),s=c.getAttribute("class"),f=c.getAttribute("data-form-theme"),(d=(0,a.getNode)("#gform_".concat(t),c,!0))&&d.reset(),e.next=20,x(r.confirmation_markup);case 20:c.outerHTML=e.sent,(c=(0,a.getNode)("#gform_wrapper_".concat(t),document,!0))&&(c.setAttribute("class",s),c.setAttribute("data-form-theme",f)),b(t),(0,u.Ui)(t);case 25:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}(),b=function(e){var t=(0,a.getNode)("#gform_send_resume_link_button_".concat(e),document,!0);t&&(t.onclick=function(){return(0,c.d2)(t)})},_=function(){var e=(0,r.A)(i().mark(function e(t,n){var r,o,c,s,f,d,l;return i().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r="string"==typeof n.data?n.data:n.data.message,e.next=3,(0,a.filter)({event:"gform/ajax/pre_display_error",data:{error:r,formId:t,submissionResult:n}});case 3:return o=e.sent,r=o.error||m().common.form.ajax.i18n.unknown_error,c=document.createElement("div"),s='<div class="gform_validation_errors" id="gform_'.concat(t,'_validation_container" data-js="gform-focus-validation-error"><h2 class="gform_submission_error hide_summary"><span class="gform-icon gform-icon--circle-error"></span>').concat(r,"</h2></div>"),e.next=9,x(s);case 9:c.innerHTML=e.sent,f=(0,a.getNode)("#gform_wrapper_".concat(t),document,!0),(d=(0,a.getNode)(".gform_validation_errors",f,!0))&&d.remove(),l=(0,a.getNode)(".gform_heading",f,!0),f.insertBefore(c.firstChild,l),(0,u.vw)();case 16:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}(),w=function(e,t,n,r){var o=(0,a.getNode)("#gform_page_".concat(e,"_").concat(n),t,!0);o&&(!function(e){var t=(0,a.getNode)("#gform_".concat(e,"_validation_container"),document,!0);t&&t.remove()}(e),o.outerHTML=r)},h=function(){var e=(0,r.A)(i().mark(function e(t,n,r){var o,c,s,f;return i().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if((o=(0,a.getNodes)(".gform_page",!0,n,!0))&&0!==o.length){e.next=3;break}return e.abrupt("return");case 3:o.forEach(function(e,t){e.style.display=t+1===r?"block":"none"}),c=(0,a.getNode)("#gform_source_page_number_".concat(t),n,!0),s=(0,a.getNode)("#gform_target_page_number_".concat(t),n,!0),f=r>=o.length?0:r+1,c&&s&&(c.value=r,s.value=f),(0,u.rF)(),k(n,r,o),(0,a.trigger)({event:"gform/ajax/post_page_change",native:!1,data:{formId:t,pageNumber:r}});case 11:case"end":return e.stop()}},e)}));return function(t,n,r){return e.apply(this,arguments)}}(),y=function(e,t,n){var r=new FormData(t);r.append("gform_ajax_nonce",window.gform_theme_config.common.form.ajax.ajax_submission_nonce),r.append("action",n),r.append("form_id",e),r.append("current_page_url",encodeURIComponent(window.location.href)),r.append("ajax_referer",encodeURIComponent(document.referrer));var o=(0,a.getNode)("#gform_wrapper_".concat(e," .gform_heading"),document,!0);return o&&(r.append("display_title",(0,a.getNode)(".gform_title",o,!0)?1:0),r.append("display_description",(0,a.getNode)(".gform_description",o,!0)?1:0)),r},x=function(){var e=(0,r.A)(i().mark(function e(t){var r,o;return i().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.e(567).then(n.t.bind(n,6308,23));case 2:return r=e.sent,o=r.default,e.abrupt("return",o.sanitize(t));case 5:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),k=function(e,t,n){if(n&&0!==n.length){var r=n[n.length-1],o=(0,a.getNode)("[data-submission-type='previous'],.gform_previous_button",r,!0);o&&"image"!==o.type&&(o.type=t<n.length?"submit":"button")}};window.gform.submission=window.gform.submission||{},window.gform.submission.ajax={submitFormAjax:l,sanitizeHtml:x,resetSubmission:g,displayConfirmation:v}},3953:function(e,t,n){n.d(t,{Ec:function(){return C},d2:function(){return A},mj:function(){return h},s7:function(){return b},z2:function(){return w}});var r=n(8140),o=n(527),i=n(455),a=n(9280),c=n.n(a),u=n(5798),s=n(6201),f=n(428),d=n.n(f),m=n(9143);function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach(function(t){(0,o.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function p(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return v(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?v(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){c=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw i}}}}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var b="save-continue",_="send-link",w="submit",h="next",y="previous",x="ajax",k="iframe",S="postback",A=function(){var e=(0,i.A)(c().mark(function e(t){var n;return c().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(event&&event.preventDefault(),n=t.closest("form")){e.next=5;break}return console.error("Gravity Forms: Aborting submission. Button is not connected to a form. Please review the settings of your form fields in the form editor for invalid HTML. The most common location is in the Content setting of a HTML type field."),e.abrupt("return");case 5:if((0,s.lt)(n),t=I(t,n)){e.next=10;break}return console.error("Gravity Forms: Aborting submission. Active button not found for form #".concat(n.dataset.formid,".")),e.abrupt("return");case 10:if(F(n)){e.next=13;break}return console.error("Gravity Forms: Aborting submission. Another submission is already in progress for form #".concat(n.dataset.formid,".")),e.abrupt("return");case 13:return e.next=15,j(n,E(t),R(n));case 15:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),N=function(e){var t=(0,u.getNode)("#gform_".concat(e),document,!0);t&&t.addEventListener("submit",function(t){console.error("Gravity Forms: Warning. Unsupported submission flow detected for form #".concat(e,". This is usually caused by a customized form submit button. Please ensure the submit button has an onclick event that calls the window.gform.submission.handleButtonClick() method.")),t.preventDefault();var n=t.submitter||t.target.querySelector(".gform_button")||t.target.querySelector("input[type=submit]")||t.target.querySelector("button")||t.target;A(n)})},j=function(){var e=(0,i.A)(c().mark(function e(t){var n,r,o,i,a=arguments;return c().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>1&&void 0!==a[1]?a[1]:w,r=a.length>2&&void 0!==a[2]?a[2]:S,e.next=4,(0,u.filter)({event:"gform/submission/pre_submission",data:{form:t,submissionType:n,submissionMethod:r,displayConfirmation:!0,abort:!1}});case 4:if(!(o=e.sent).abort){e.next=8;break}return M(t),e.abrupt("return");case 8:i=o.displayConfirmation,o.submissionMethod!==r&&(r=D(t,o.submissionMethod)?o.submissionMethod:r),e.t0=n,e.next=e.t0===y?13:e.t0===b?15:18;break;case 13:return L(t),e.abrupt("break",18);case 15:return(0,u.getNode)("#gform_save_".concat(t.dataset.formid),t,!0).value="1",(0,u.speak)(window.gf_global.strings.formSaved),e.abrupt("break",18);case 18:return e.next=20,(0,u.filter)({event:"gform/submission/submission_started",data:{form:t,submissionType:n,submissionMethod:r}});case 20:(0,u.consoleInfo)("Gravity Forms: Performing ".concat(n," type submission for form #").concat(t.dataset.formid," via ").concat(r,".")),e.t1=r,e.next=e.t1===x?24:27;break;case 24:return e.next=26,(0,m.rV)(t.dataset.formid,i);case 26:return e.abrupt("return",e.sent);case 27:return O(t),e.abrupt("break",29);case 29:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),O=function(e){d()(e).trigger("submit",[!0])},E=function(e){var t=(0,o.A)((0,o.A)((0,o.A)((0,o.A)((0,o.A)({},b,"gform_save_link"),_,""),h,"gform_next_button"),y,"gform_previous_button"),w,""),n=e.dataset.submissionType;if(n&&Object.keys(t).includes(n))return n;if("gform_send_resume_link_button"===e.name)return _;for(var i=e.classList,a=0,c=Object.entries(t);a<c.length;a++){var u=(0,r.A)(c[a],2),s=u[0],f=u[1];if(f&&i.contains(f))return s}return w},I=function(e,t){if(T(e))return e;var n,r=p((0,u.getNodes)("[data-submission-type='next'],.gform_next_button",!0,t,!0));try{for(r.s();!(n=r.n()).done;){var o=n.value;if(T(o))return o}}catch(e){r.e(e)}finally{r.f()}return!1},T=function(e){var t=e.closest(".gform_page");return(!t||P(t))&&P(e)&&!e.disabled},P=function(e){return"none"!==window.getComputedStyle(e).display},M=function(e){q(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0),(0,u.trigger)({event:"gform/submission/submission_aborted",data:{form:e},native:!1})},C=function(e){window.gformRemoveSpinner();var t=(0,u.getNodes)("#gform_ajax_spinner_".concat(e.dataset.formid),!0,document,!0);t&&t.forEach(function(e){e.remove()})},F=function(e){return!window["gf_submitting_".concat(e.dataset.formid)]&&(window["gf_submitting_".concat(e.dataset.formid)]=!0,!0)},q=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;0===t?window["gf_submitting_".concat(e.dataset.formid)]=!1:setTimeout(function(){window["gf_submitting_".concat(e.dataset.formid)]=!1},t)},L=function(e){var t=document.getElementById("gform_source_page_number_".concat(e.dataset.formid));document.getElementById("gform_target_page_number_".concat(e.dataset.formid)).value=parseInt(t.value)-1},D=function(e,t){if(t===k)return console.error("Gravity Forms: The iframe submission method cannot be enabled via gform/submission/pre_submission. It must be set via the gform_form_args PHP filter."),!1;(0,u.getNode)("gform_submission_method_".concat(e.dataset.formid),e).value=t,e.removeAttribute("target");var n=(0,u.getNode)("[name=gform_ajax]",e,!0);return n&&n.remove(),!0},R=function(e){var t=(0,u.getNode)("gform_submission_method_".concat(e.dataset.formid),e);return t?t.value:S};t.Ay=function(e){N(e)},window.gform.submission=g(g({},window.gform.submission||{}),{},{handleButtonClick:A,submitForm:j,getSubmissionMethod:R,removeSpinner:C,lockSubmission:F,unlockSubmission:q,SUBMISSION_TYPE_SUBMIT:w,SUBMISSION_TYPE_NEXT:h,SUBMISSION_TYPE_PREVIOUS:y,SUBMISSION_TYPE_SAVE_AND_CONTINUE:b,SUBMISSION_TYPE_SEND_LINK:_,SUBMISSION_METHOD_IFRAME:k,SUBMISSION_METHOD_POSTBACK:S,SUBMISSION_METHOD_AJAX:x})},6443:function(e){e.exports=gform_theme_config},428:function(e){e.exports=window.jQuery},9280:function(e){e.exports=window.regeneratorRuntime},5798:function(e){e.exports=window.gform.utils}},a={};function c(e){var t=a[e];if(void 0!==t)return t.exports;var n=a[e]={exports:{}};return i[e].call(n.exports,n,n.exports,c),n.exports}c.m=i,e=[],c.O=function(t,n,r,o){if(!n){var i=1/0;for(f=0;f<e.length;f++){n=e[f][0],r=e[f][1],o=e[f][2];for(var a=!0,u=0;u<n.length;u++)(!1&o||i>=o)&&Object.keys(c.O).every(function(e){return c.O[e](n[u])})?n.splice(u--,1):(a=!1,o<i&&(i=o));if(a){e.splice(f--,1);var s=r();void 0!==s&&(t=s)}}return t}o=o||0;for(var f=e.length;f>0&&e[f-1][2]>o;f--)e[f]=e[f-1];e[f]=[n,r,o]},c.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return c.d(t,{a:t}),t},n=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},c.t=function(e,r){if(1&r&&(e=this(e)),8&r)return e;if("object"==typeof e&&e){if(4&r&&e.__esModule)return e;if(16&r&&"function"==typeof e.then)return e}var o=Object.create(null);c.r(o);var i={};t=t||[null,n({}),n([]),n(n)];for(var a=2&r&&e;("object"==typeof a||"function"==typeof a)&&!~t.indexOf(a);a=n(a))Object.getOwnPropertyNames(a).forEach(function(t){i[t]=function(){return e[t]}});return i.default=function(){return e},c.d(o,i),o},c.d=function(e,t){for(var n in t)c.o(t,n)&&!c.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},c.f={},c.e=function(e){return Promise.all(Object.keys(c.f).reduce(function(t,n){return c.f[n](e,t),t},[]))},c.u=function(e){return{145:"gform-pagination",157:"gform-products",290:"gform-files",567:"vendor-theme-dompurify",952:"gform-image-choice"}[e]+"."+{145:"95306b883f1af691a920",157:"5e9be8e3f97ac40bee14",290:"60184f01718b267bbd44",567:"59871c0f4844fcbb001c",952:"ccce09e653b5dd0e4849"}[e]+".min.js"},c.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r={},o="gravityforms:",c.l=function(e,t,n,i){if(r[e])r[e].push(t);else{var a,u;if(void 0!==n)for(var s=document.getElementsByTagName("script"),f=0;f<s.length;f++){var d=s[f];if(d.getAttribute("src")==e||d.getAttribute("data-webpack")==o+n){a=d;break}}a||(u=!0,(a=document.createElement("script")).charset="utf-8",c.nc&&a.setAttribute("nonce",c.nc),a.setAttribute("data-webpack",o+n),a.src=e),r[e]=[t];var m=function(t,n){a.onerror=a.onload=null,clearTimeout(l);var o=r[e];if(delete r[e],a.parentNode&&a.parentNode.removeChild(a),o&&o.forEach(function(e){return e(n)}),t)return t(n)},l=setTimeout(m.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=m.bind(null,a.onerror),a.onload=m.bind(null,a.onload),u&&document.head.appendChild(a)}},c.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){var e;c.g.importScripts&&(e=c.g.location+"");var t=c.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var r=n.length-1;r>-1&&(!e||!/^http(s?):/.test(e));)e=n[r--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),c.p=e}(),function(){var e={593:0};c.f.j=function(t,n){var r=c.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var o=new Promise(function(n,o){r=e[t]=[n,o]});n.push(r[2]=o);var i=c.p+c.u(t),a=new Error;c.l(i,function(n){if(c.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var o=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;a.message="Loading chunk "+t+" failed.\n("+o+": "+i+")",a.name="ChunkLoadError",a.type=o,a.request=i,r[1](a)}},"chunk-"+t,t)}},c.O.j=function(t){return 0===e[t]};var t=function(t,n){var r,o,i=n[0],a=n[1],u=n[2],s=0;if(i.some(function(t){return 0!==e[t]})){for(r in a)c.o(a,r)&&(c.m[r]=a[r]);if(u)var f=u(c)}for(t&&t(n);s<i.length;s++)o=i[s],c.o(e,o)&&e[o]&&e[o][0](),e[o]=0;return c.O(f)},n=self.webpackChunkgravityforms=self.webpackChunkgravityforms||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))}(),c.O(void 0,[721],function(){return c(7920)});var u=c.O(void 0,[721],function(){return c(2)});u=c.O(u)}();
!function(i){"use strict";"function"==typeof define&&define.amd?define(["jquery"],i):"undefined"!=typeof exports?module.exports=i(require("jquery")):i(jQuery)}(function(i){"use strict";var e=window.Slick||{};(e=function(){var e=0;return function(t,o){var s,n=this;n.defaults={accessibility:!0,adaptiveHeight:!1,appendArrows:i(t),appendDots:i(t),arrows:!0,asNavFor:null,prevArrow:'<button class="slick-prev" aria-label="Previous" type="button">Previous</button>',nextArrow:'<button class="slick-next" aria-label="Next" type="button">Next</button>',autoplay:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:"50px",cssEase:"ease",customPaging:function(e,t){return i('<button type="button" />').text(t+1)},dots:!1,dotsClass:"slick-dots",draggable:!0,easing:"linear",edgeFriction:.35,fade:!1,focusOnSelect:!1,focusOnChange:!1,infinite:!0,initialSlide:0,lazyLoad:"ondemand",mobileFirst:!1,pauseOnHover:!0,pauseOnFocus:!0,pauseOnDotsHover:!1,respondTo:"window",responsive:null,rows:1,rtl:!1,slide:"",slidesPerRow:1,slidesToShow:1,slidesToScroll:1,speed:500,swipe:!0,swipeToSlide:!1,touchMove:!0,touchThreshold:5,useCSS:!0,useTransform:!0,variableWidth:!1,vertical:!1,verticalSwiping:!1,waitForAnimate:!0,zIndex:1e3},n.initials={animating:!1,dragging:!1,autoPlayTimer:null,currentDirection:0,currentLeft:null,currentSlide:0,direction:1,$dots:null,listWidth:null,listHeight:null,loadIndex:0,$nextArrow:null,$prevArrow:null,scrolling:!1,slideCount:null,slideWidth:null,$slideTrack:null,$slides:null,sliding:!1,slideOffset:0,swipeLeft:null,swiping:!1,$list:null,touchObject:{},transformsEnabled:!1,unslicked:!1},i.extend(n,n.initials),n.activeBreakpoint=null,n.animType=null,n.animProp=null,n.breakpoints=[],n.breakpointSettings=[],n.cssTransitions=!1,n.focussed=!1,n.interrupted=!1,n.hidden="hidden",n.paused=!0,n.positionProp=null,n.respondTo=null,n.rowCount=1,n.shouldClick=!0,n.$slider=i(t),n.$slidesCache=null,n.transformType=null,n.transitionType=null,n.visibilityChange="visibilitychange",n.windowWidth=0,n.windowTimer=null,s=i(t).data("slick")||{},n.options=i.extend({},n.defaults,o,s),n.currentSlide=n.options.initialSlide,n.originalSettings=n.options,void 0!==document.mozHidden?(n.hidden="mozHidden",n.visibilityChange="mozvisibilitychange"):void 0!==document.webkitHidden&&(n.hidden="webkitHidden",n.visibilityChange="webkitvisibilitychange"),n.autoPlay=i.proxy(n.autoPlay,n),n.autoPlayClear=i.proxy(n.autoPlayClear,n),n.autoPlayIterator=i.proxy(n.autoPlayIterator,n),n.changeSlide=i.proxy(n.changeSlide,n),n.clickHandler=i.proxy(n.clickHandler,n),n.selectHandler=i.proxy(n.selectHandler,n),n.setPosition=i.proxy(n.setPosition,n),n.swipeHandler=i.proxy(n.swipeHandler,n),n.dragHandler=i.proxy(n.dragHandler,n),n.keyHandler=i.proxy(n.keyHandler,n),n.instanceUid=e++,n.htmlExpr=/^(?:\s*(<[\w\W]+>)[^>]*)$/,n.registerBreakpoints(),n.init(!0)}}()).prototype.activateADA=function(){this.$slideTrack.find(".slick-active").attr({"aria-hidden":"false"}).find("a, input, button, select").attr({tabindex:"0"})},e.prototype.addSlide=e.prototype.slickAdd=function(e,t,o){var s=this;if("boolean"==typeof t)o=t,t=null;else if(t<0||t>=s.slideCount)return!1;s.unload(),"number"==typeof t?0===t&&0===s.$slides.length?i(e).appendTo(s.$slideTrack):o?i(e).insertBefore(s.$slides.eq(t)):i(e).insertAfter(s.$slides.eq(t)):!0===o?i(e).prependTo(s.$slideTrack):i(e).appendTo(s.$slideTrack),s.$slides=s.$slideTrack.children(this.options.slide),s.$slideTrack.children(this.options.slide).detach(),s.$slideTrack.append(s.$slides),s.$slides.each(function(e,t){i(t).attr("data-slick-index",e)}),s.$slidesCache=s.$slides,s.reinit()},e.prototype.animateHeight=function(){var i=this;if(1===i.options.slidesToShow&&!0===i.options.adaptiveHeight&&!1===i.options.vertical){var e=i.$slides.eq(i.currentSlide).outerHeight(!0);i.$list.animate({height:e},i.options.speed)}},e.prototype.animateSlide=function(e,t){var o={},s=this;s.animateHeight(),!0===s.options.rtl&&!1===s.options.vertical&&(e=-e),!1===s.transformsEnabled?!1===s.options.vertical?s.$slideTrack.animate({left:e},s.options.speed,s.options.easing,t):s.$slideTrack.animate({top:e},s.options.speed,s.options.easing,t):!1===s.cssTransitions?(!0===s.options.rtl&&(s.currentLeft=-s.currentLeft),i({animStart:s.currentLeft}).animate({animStart:e},{duration:s.options.speed,easing:s.options.easing,step:function(i){i=Math.ceil(i),!1===s.options.vertical?(o[s.animType]="translate("+i+"px, 0px)",s.$slideTrack.css(o)):(o[s.animType]="translate(0px,"+i+"px)",s.$slideTrack.css(o))},complete:function(){t&&t.call()}})):(s.applyTransition(),e=Math.ceil(e),!1===s.options.vertical?o[s.animType]="translate3d("+e+"px, 0px, 0px)":o[s.animType]="translate3d(0px,"+e+"px, 0px)",s.$slideTrack.css(o),t&&setTimeout(function(){s.disableTransition(),t.call()},s.options.speed))},e.prototype.getNavTarget=function(){var e=this,t=e.options.asNavFor;return t&&null!==t&&(t=i(t).not(e.$slider)),t},e.prototype.asNavFor=function(e){var t=this.getNavTarget();null!==t&&"object"==typeof t&&t.each(function(){var t=i(this).slick("getSlick");t.unslicked||t.slideHandler(e,!0)})},e.prototype.applyTransition=function(i){var e=this,t={};!1===e.options.fade?t[e.transitionType]=e.transformType+" "+e.options.speed+"ms "+e.options.cssEase:t[e.transitionType]="opacity "+e.options.speed+"ms "+e.options.cssEase,!1===e.options.fade?e.$slideTrack.css(t):e.$slides.eq(i).css(t)},e.prototype.autoPlay=function(){var i=this;i.autoPlayClear(),i.slideCount>i.options.slidesToShow&&(i.autoPlayTimer=setInterval(i.autoPlayIterator,i.options.autoplaySpeed))},e.prototype.autoPlayClear=function(){var i=this;i.autoPlayTimer&&clearInterval(i.autoPlayTimer)},e.prototype.autoPlayIterator=function(){var i=this,e=i.currentSlide+i.options.slidesToScroll;i.paused||i.interrupted||i.focussed||(!1===i.options.infinite&&(1===i.direction&&i.currentSlide+1===i.slideCount-1?i.direction=0:0===i.direction&&(e=i.currentSlide-i.options.slidesToScroll,i.currentSlide-1==0&&(i.direction=1))),i.slideHandler(e))},e.prototype.buildArrows=function(){var e=this;!0===e.options.arrows&&(e.$prevArrow=i(e.options.prevArrow).addClass("slick-arrow"),e.$nextArrow=i(e.options.nextArrow).addClass("slick-arrow"),e.slideCount>e.options.slidesToShow?(e.$prevArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),e.$nextArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),e.htmlExpr.test(e.options.prevArrow)&&e.$prevArrow.prependTo(e.options.appendArrows),e.htmlExpr.test(e.options.nextArrow)&&e.$nextArrow.appendTo(e.options.appendArrows),!0!==e.options.infinite&&e.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true")):e.$prevArrow.add(e.$nextArrow).addClass("slick-hidden").attr({"aria-disabled":"true",tabindex:"-1"}))},e.prototype.buildDots=function(){var e,t,o=this;if(!0===o.options.dots){for(o.$slider.addClass("slick-dotted"),t=i("<ul />").addClass(o.options.dotsClass),e=0;e<=o.getDotCount();e+=1)t.append(i("<li />").append(o.options.customPaging.call(this,o,e)));o.$dots=t.appendTo(o.options.appendDots),o.$dots.find("li").first().addClass("slick-active")}},e.prototype.buildOut=function(){var e=this;e.$slides=e.$slider.children(e.options.slide+":not(.slick-cloned)").addClass("slick-slide"),e.slideCount=e.$slides.length,e.$slides.each(function(e,t){i(t).attr("data-slick-index",e).data("originalStyling",i(t).attr("style")||"")}),e.$slider.addClass("slick-slider"),e.$slideTrack=0===e.slideCount?i('<div class="slick-track"/>').appendTo(e.$slider):e.$slides.wrapAll('<div class="slick-track"/>').parent(),e.$list=e.$slideTrack.wrap('<div class="slick-list"/>').parent(),e.$slideTrack.css("opacity",0),!0!==e.options.centerMode&&!0!==e.options.swipeToSlide||(e.options.slidesToScroll=1),i("img[data-lazy]",e.$slider).not("[src]").addClass("slick-loading"),e.setupInfinite(),e.buildArrows(),e.buildDots(),e.updateDots(),e.setSlideClasses("number"==typeof e.currentSlide?e.currentSlide:0),!0===e.options.draggable&&e.$list.addClass("draggable")},e.prototype.buildRows=function(){var i,e,t,o,s,n,r,l=this;if(o=document.createDocumentFragment(),n=l.$slider.children(),l.options.rows>1){for(r=l.options.slidesPerRow*l.options.rows,s=Math.ceil(n.length/r),i=0;i<s;i++){var d=document.createElement("div");for(e=0;e<l.options.rows;e++){var a=document.createElement("div");for(t=0;t<l.options.slidesPerRow;t++){var c=i*r+(e*l.options.slidesPerRow+t);n.get(c)&&a.appendChild(n.get(c))}d.appendChild(a)}o.appendChild(d)}l.$slider.empty().append(o),l.$slider.children().children().children().css({width:100/l.options.slidesPerRow+"%",display:"inline-block"})}},e.prototype.checkResponsive=function(e,t){var o,s,n,r=this,l=!1,d=r.$slider.width(),a=window.innerWidth||i(window).width();if("window"===r.respondTo?n=a:"slider"===r.respondTo?n=d:"min"===r.respondTo&&(n=Math.min(a,d)),r.options.responsive&&r.options.responsive.length&&null!==r.options.responsive){s=null;for(o in r.breakpoints)r.breakpoints.hasOwnProperty(o)&&(!1===r.originalSettings.mobileFirst?n<r.breakpoints[o]&&(s=r.breakpoints[o]):n>r.breakpoints[o]&&(s=r.breakpoints[o]));null!==s?null!==r.activeBreakpoint?(s!==r.activeBreakpoint||t)&&(r.activeBreakpoint=s,"unslick"===r.breakpointSettings[s]?r.unslick(s):(r.options=i.extend({},r.originalSettings,r.breakpointSettings[s]),!0===e&&(r.currentSlide=r.options.initialSlide),r.refresh(e)),l=s):(r.activeBreakpoint=s,"unslick"===r.breakpointSettings[s]?r.unslick(s):(r.options=i.extend({},r.originalSettings,r.breakpointSettings[s]),!0===e&&(r.currentSlide=r.options.initialSlide),r.refresh(e)),l=s):null!==r.activeBreakpoint&&(r.activeBreakpoint=null,r.options=r.originalSettings,!0===e&&(r.currentSlide=r.options.initialSlide),r.refresh(e),l=s),e||!1===l||r.$slider.trigger("breakpoint",[r,l])}},e.prototype.changeSlide=function(e,t){var o,s,n,r=this,l=i(e.currentTarget);switch(l.is("a")&&e.preventDefault(),l.is("li")||(l=l.closest("li")),n=r.slideCount%r.options.slidesToScroll!=0,o=n?0:(r.slideCount-r.currentSlide)%r.options.slidesToScroll,e.data.message){case"previous":s=0===o?r.options.slidesToScroll:r.options.slidesToShow-o,r.slideCount>r.options.slidesToShow&&r.slideHandler(r.currentSlide-s,!1,t);break;case"next":s=0===o?r.options.slidesToScroll:o,r.slideCount>r.options.slidesToShow&&r.slideHandler(r.currentSlide+s,!1,t);break;case"index":var d=0===e.data.index?0:e.data.index||l.index()*r.options.slidesToScroll;r.slideHandler(r.checkNavigable(d),!1,t),l.children().trigger("focus");break;default:return}},e.prototype.checkNavigable=function(i){var e,t;if(e=this.getNavigableIndexes(),t=0,i>e[e.length-1])i=e[e.length-1];else for(var o in e){if(i<e[o]){i=t;break}t=e[o]}return i},e.prototype.cleanUpEvents=function(){var e=this;e.options.dots&&null!==e.$dots&&(i("li",e.$dots).off("click.slick",e.changeSlide).off("mouseenter.slick",i.proxy(e.interrupt,e,!0)).off("mouseleave.slick",i.proxy(e.interrupt,e,!1)),!0===e.options.accessibility&&e.$dots.off("keydown.slick",e.keyHandler)),e.$slider.off("focus.slick blur.slick"),!0===e.options.arrows&&e.slideCount>e.options.slidesToShow&&(e.$prevArrow&&e.$prevArrow.off("click.slick",e.changeSlide),e.$nextArrow&&e.$nextArrow.off("click.slick",e.changeSlide),!0===e.options.accessibility&&(e.$prevArrow&&e.$prevArrow.off("keydown.slick",e.keyHandler),e.$nextArrow&&e.$nextArrow.off("keydown.slick",e.keyHandler))),e.$list.off("touchstart.slick mousedown.slick",e.swipeHandler),e.$list.off("touchmove.slick mousemove.slick",e.swipeHandler),e.$list.off("touchend.slick mouseup.slick",e.swipeHandler),e.$list.off("touchcancel.slick mouseleave.slick",e.swipeHandler),e.$list.off("click.slick",e.clickHandler),i(document).off(e.visibilityChange,e.visibility),e.cleanUpSlideEvents(),!0===e.options.accessibility&&e.$list.off("keydown.slick",e.keyHandler),!0===e.options.focusOnSelect&&i(e.$slideTrack).children().off("click.slick",e.selectHandler),i(window).off("orientationchange.slick.slick-"+e.instanceUid,e.orientationChange),i(window).off("resize.slick.slick-"+e.instanceUid,e.resize),i("[draggable!=true]",e.$slideTrack).off("dragstart",e.preventDefault),i(window).off("load.slick.slick-"+e.instanceUid,e.setPosition)},e.prototype.cleanUpSlideEvents=function(){var e=this;e.$list.off("mouseenter.slick",i.proxy(e.interrupt,e,!0)),e.$list.off("mouseleave.slick",i.proxy(e.interrupt,e,!1))},e.prototype.cleanUpRows=function(){var i,e=this;e.options.rows>1&&((i=e.$slides.children().children()).removeAttr("style"),e.$slider.empty().append(i))},e.prototype.clickHandler=function(i){!1===this.shouldClick&&(i.stopImmediatePropagation(),i.stopPropagation(),i.preventDefault())},e.prototype.destroy=function(e){var t=this;t.autoPlayClear(),t.touchObject={},t.cleanUpEvents(),i(".slick-cloned",t.$slider).detach(),t.$dots&&t.$dots.remove(),t.$prevArrow&&t.$prevArrow.length&&(t.$prevArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),t.htmlExpr.test(t.options.prevArrow)&&t.$prevArrow.remove()),t.$nextArrow&&t.$nextArrow.length&&(t.$nextArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),t.htmlExpr.test(t.options.nextArrow)&&t.$nextArrow.remove()),t.$slides&&(t.$slides.removeClass("slick-slide slick-active slick-center slick-visible slick-current").removeAttr("aria-hidden").removeAttr("data-slick-index").each(function(){i(this).attr("style",i(this).data("originalStyling"))}),t.$slideTrack.children(this.options.slide).detach(),t.$slideTrack.detach(),t.$list.detach(),t.$slider.append(t.$slides)),t.cleanUpRows(),t.$slider.removeClass("slick-slider"),t.$slider.removeClass("slick-initialized"),t.$slider.removeClass("slick-dotted"),t.unslicked=!0,e||t.$slider.trigger("destroy",[t])},e.prototype.disableTransition=function(i){var e=this,t={};t[e.transitionType]="",!1===e.options.fade?e.$slideTrack.css(t):e.$slides.eq(i).css(t)},e.prototype.fadeSlide=function(i,e){var t=this;!1===t.cssTransitions?(t.$slides.eq(i).css({zIndex:t.options.zIndex}),t.$slides.eq(i).animate({opacity:1},t.options.speed,t.options.easing,e)):(t.applyTransition(i),t.$slides.eq(i).css({opacity:1,zIndex:t.options.zIndex}),e&&setTimeout(function(){t.disableTransition(i),e.call()},t.options.speed))},e.prototype.fadeSlideOut=function(i){var e=this;!1===e.cssTransitions?e.$slides.eq(i).animate({opacity:0,zIndex:e.options.zIndex-2},e.options.speed,e.options.easing):(e.applyTransition(i),e.$slides.eq(i).css({opacity:0,zIndex:e.options.zIndex-2}))},e.prototype.filterSlides=e.prototype.slickFilter=function(i){var e=this;null!==i&&(e.$slidesCache=e.$slides,e.unload(),e.$slideTrack.children(this.options.slide).detach(),e.$slidesCache.filter(i).appendTo(e.$slideTrack),e.reinit())},e.prototype.focusHandler=function(){var e=this;e.$slider.off("focus.slick blur.slick").on("focus.slick blur.slick","*",function(t){t.stopImmediatePropagation();var o=i(this);setTimeout(function(){e.options.pauseOnFocus&&(e.focussed=o.is(":focus"),e.autoPlay())},0)})},e.prototype.getCurrent=e.prototype.slickCurrentSlide=function(){return this.currentSlide},e.prototype.getDotCount=function(){var i=this,e=0,t=0,o=0;if(!0===i.options.infinite)if(i.slideCount<=i.options.slidesToShow)++o;else for(;e<i.slideCount;)++o,e=t+i.options.slidesToScroll,t+=i.options.slidesToScroll<=i.options.slidesToShow?i.options.slidesToScroll:i.options.slidesToShow;else if(!0===i.options.centerMode)o=i.slideCount;else if(i.options.asNavFor)for(;e<i.slideCount;)++o,e=t+i.options.slidesToScroll,t+=i.options.slidesToScroll<=i.options.slidesToShow?i.options.slidesToScroll:i.options.slidesToShow;else o=1+Math.ceil((i.slideCount-i.options.slidesToShow)/i.options.slidesToScroll);return o-1},e.prototype.getLeft=function(i){var e,t,o,s,n=this,r=0;return n.slideOffset=0,t=n.$slides.first().outerHeight(!0),!0===n.options.infinite?(n.slideCount>n.options.slidesToShow&&(n.slideOffset=n.slideWidth*n.options.slidesToShow*-1,s=-1,!0===n.options.vertical&&!0===n.options.centerMode&&(2===n.options.slidesToShow?s=-1.5:1===n.options.slidesToShow&&(s=-2)),r=t*n.options.slidesToShow*s),n.slideCount%n.options.slidesToScroll!=0&&i+n.options.slidesToScroll>n.slideCount&&n.slideCount>n.options.slidesToShow&&(i>n.slideCount?(n.slideOffset=(n.options.slidesToShow-(i-n.slideCount))*n.slideWidth*-1,r=(n.options.slidesToShow-(i-n.slideCount))*t*-1):(n.slideOffset=n.slideCount%n.options.slidesToScroll*n.slideWidth*-1,r=n.slideCount%n.options.slidesToScroll*t*-1))):i+n.options.slidesToShow>n.slideCount&&(n.slideOffset=(i+n.options.slidesToShow-n.slideCount)*n.slideWidth,r=(i+n.options.slidesToShow-n.slideCount)*t),n.slideCount<=n.options.slidesToShow&&(n.slideOffset=0,r=0),!0===n.options.centerMode&&n.slideCount<=n.options.slidesToShow?n.slideOffset=n.slideWidth*Math.floor(n.options.slidesToShow)/2-n.slideWidth*n.slideCount/2:!0===n.options.centerMode&&!0===n.options.infinite?n.slideOffset+=n.slideWidth*Math.floor(n.options.slidesToShow/2)-n.slideWidth:!0===n.options.centerMode&&(n.slideOffset=0,n.slideOffset+=n.slideWidth*Math.floor(n.options.slidesToShow/2)),e=!1===n.options.vertical?i*n.slideWidth*-1+n.slideOffset:i*t*-1+r,!0===n.options.variableWidth&&(o=n.slideCount<=n.options.slidesToShow||!1===n.options.infinite?n.$slideTrack.children(".slick-slide").eq(i):n.$slideTrack.children(".slick-slide").eq(i+n.options.slidesToShow),e=!0===n.options.rtl?o[0]?-1*(n.$slideTrack.width()-o[0].offsetLeft-o.width()):0:o[0]?-1*o[0].offsetLeft:0,!0===n.options.centerMode&&(o=n.slideCount<=n.options.slidesToShow||!1===n.options.infinite?n.$slideTrack.children(".slick-slide").eq(i):n.$slideTrack.children(".slick-slide").eq(i+n.options.slidesToShow+1),e=!0===n.options.rtl?o[0]?-1*(n.$slideTrack.width()-o[0].offsetLeft-o.width()):0:o[0]?-1*o[0].offsetLeft:0,e+=(n.$list.width()-o.outerWidth())/2)),e},e.prototype.getOption=e.prototype.slickGetOption=function(i){return this.options[i]},e.prototype.getNavigableIndexes=function(){var i,e=this,t=0,o=0,s=[];for(!1===e.options.infinite?i=e.slideCount:(t=-1*e.options.slidesToScroll,o=-1*e.options.slidesToScroll,i=2*e.slideCount);t<i;)s.push(t),t=o+e.options.slidesToScroll,o+=e.options.slidesToScroll<=e.options.slidesToShow?e.options.slidesToScroll:e.options.slidesToShow;return s},e.prototype.getSlick=function(){return this},e.prototype.getSlideCount=function(){var e,t,o=this;return t=!0===o.options.centerMode?o.slideWidth*Math.floor(o.options.slidesToShow/2):0,!0===o.options.swipeToSlide?(o.$slideTrack.find(".slick-slide").each(function(s,n){if(n.offsetLeft-t+i(n).outerWidth()/2>-1*o.swipeLeft)return e=n,!1}),Math.abs(i(e).attr("data-slick-index")-o.currentSlide)||1):o.options.slidesToScroll},e.prototype.goTo=e.prototype.slickGoTo=function(i,e){this.changeSlide({data:{message:"index",index:parseInt(i)}},e)},e.prototype.init=function(e){var t=this;i(t.$slider).hasClass("slick-initialized")||(i(t.$slider).addClass("slick-initialized"),t.buildRows(),t.buildOut(),t.setProps(),t.startLoad(),t.loadSlider(),t.initializeEvents(),t.updateArrows(),t.updateDots(),t.checkResponsive(!0),t.focusHandler()),e&&t.$slider.trigger("init",[t]),!0===t.options.accessibility&&t.initADA(),t.options.autoplay&&(t.paused=!1,t.autoPlay())},e.prototype.initADA=function(){var e=this,t=Math.ceil(e.slideCount/e.options.slidesToShow),o=e.getNavigableIndexes().filter(function(i){return i>=0&&i<e.slideCount});e.$slides.add(e.$slideTrack.find(".slick-cloned")).attr({"aria-hidden":"true",tabindex:"-1"}).find("a, input, button, select").attr({tabindex:"-1"}),null!==e.$dots&&(e.$slides.not(e.$slideTrack.find(".slick-cloned")).each(function(t){var s=o.indexOf(t);i(this).attr({role:"tabpanel",id:"slick-slide"+e.instanceUid+t,tabindex:-1}),-1!==s&&i(this).attr({"aria-describedby":"slick-slide-control"+e.instanceUid+s})}),e.$dots.attr("role","tablist").find("li").each(function(s){var n=o[s];i(this).attr({role:"presentation"}),i(this).find("button").first().attr({role:"tab",id:"slick-slide-control"+e.instanceUid+s,"aria-controls":"slick-slide"+e.instanceUid+n,"aria-label":s+1+" of "+t,"aria-selected":null,tabindex:"-1"})}).eq(e.currentSlide).find("button").attr({"aria-selected":"true",tabindex:"0"}).end());for(var s=e.currentSlide,n=s+e.options.slidesToShow;s<n;s++)e.$slides.eq(s).attr("tabindex",0);e.activateADA()},e.prototype.initArrowEvents=function(){var i=this;!0===i.options.arrows&&i.slideCount>i.options.slidesToShow&&(i.$prevArrow.off("click.slick").on("click.slick",{message:"previous"},i.changeSlide),i.$nextArrow.off("click.slick").on("click.slick",{message:"next"},i.changeSlide),!0===i.options.accessibility&&(i.$prevArrow.on("keydown.slick",i.keyHandler),i.$nextArrow.on("keydown.slick",i.keyHandler)))},e.prototype.initDotEvents=function(){var e=this;!0===e.options.dots&&(i("li",e.$dots).on("click.slick",{message:"index"},e.changeSlide),!0===e.options.accessibility&&e.$dots.on("keydown.slick",e.keyHandler)),!0===e.options.dots&&!0===e.options.pauseOnDotsHover&&i("li",e.$dots).on("mouseenter.slick",i.proxy(e.interrupt,e,!0)).on("mouseleave.slick",i.proxy(e.interrupt,e,!1))},e.prototype.initSlideEvents=function(){var e=this;e.options.pauseOnHover&&(e.$list.on("mouseenter.slick",i.proxy(e.interrupt,e,!0)),e.$list.on("mouseleave.slick",i.proxy(e.interrupt,e,!1)))},e.prototype.initializeEvents=function(){var e=this;e.initArrowEvents(),e.initDotEvents(),e.initSlideEvents(),e.$list.on("touchstart.slick mousedown.slick",{action:"start"},e.swipeHandler),e.$list.on("touchmove.slick mousemove.slick",{action:"move"},e.swipeHandler),e.$list.on("touchend.slick mouseup.slick",{action:"end"},e.swipeHandler),e.$list.on("touchcancel.slick mouseleave.slick",{action:"end"},e.swipeHandler),e.$list.on("click.slick",e.clickHandler),i(document).on(e.visibilityChange,i.proxy(e.visibility,e)),!0===e.options.accessibility&&e.$list.on("keydown.slick",e.keyHandler),!0===e.options.focusOnSelect&&i(e.$slideTrack).children().on("click.slick",e.selectHandler),i(window).on("orientationchange.slick.slick-"+e.instanceUid,i.proxy(e.orientationChange,e)),i(window).on("resize.slick.slick-"+e.instanceUid,i.proxy(e.resize,e)),i("[draggable!=true]",e.$slideTrack).on("dragstart",e.preventDefault),i(window).on("load.slick.slick-"+e.instanceUid,e.setPosition),i(e.setPosition)},e.prototype.initUI=function(){var i=this;!0===i.options.arrows&&i.slideCount>i.options.slidesToShow&&(i.$prevArrow.show(),i.$nextArrow.show()),!0===i.options.dots&&i.slideCount>i.options.slidesToShow&&i.$dots.show()},e.prototype.keyHandler=function(i){var e=this;i.target.tagName.match("TEXTAREA|INPUT|SELECT")||(37===i.keyCode&&!0===e.options.accessibility?e.changeSlide({data:{message:!0===e.options.rtl?"next":"previous"}}):39===i.keyCode&&!0===e.options.accessibility&&e.changeSlide({data:{message:!0===e.options.rtl?"previous":"next"}}))},e.prototype.lazyLoad=function(){function e(e){i("img[data-lazy]",e).each(function(){var e=i(this),t=i(this).attr("data-lazy"),o=i(this).attr("data-srcset"),s=i(this).attr("data-sizes")||n.$slider.attr("data-sizes"),r=document.createElement("img");r.onload=function(){e.animate({opacity:0},100,function(){o&&(e.attr("srcset",o),s&&e.attr("sizes",s)),e.attr("src",t).animate({opacity:1},200,function(){e.removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading")}),n.$slider.trigger("lazyLoaded",[n,e,t])})},r.onerror=function(){e.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"),n.$slider.trigger("lazyLoadError",[n,e,t])},r.src=t})}var t,o,s,n=this;if(!0===n.options.centerMode?!0===n.options.infinite?s=(o=n.currentSlide+(n.options.slidesToShow/2+1))+n.options.slidesToShow+2:(o=Math.max(0,n.currentSlide-(n.options.slidesToShow/2+1)),s=n.options.slidesToShow/2+1+2+n.currentSlide):(o=n.options.infinite?n.options.slidesToShow+n.currentSlide:n.currentSlide,s=Math.ceil(o+n.options.slidesToShow),!0===n.options.fade&&(o>0&&o--,s<=n.slideCount&&s++)),t=n.$slider.find(".slick-slide").slice(o,s),"anticipated"===n.options.lazyLoad)for(var r=o-1,l=s,d=n.$slider.find(".slick-slide"),a=0;a<n.options.slidesToScroll;a++)r<0&&(r=n.slideCount-1),t=(t=t.add(d.eq(r))).add(d.eq(l)),r--,l++;e(t),n.slideCount<=n.options.slidesToShow?e(n.$slider.find(".slick-slide")):n.currentSlide>=n.slideCount-n.options.slidesToShow?e(n.$slider.find(".slick-cloned").slice(0,n.options.slidesToShow)):0===n.currentSlide&&e(n.$slider.find(".slick-cloned").slice(-1*n.options.slidesToShow))},e.prototype.loadSlider=function(){var i=this;i.setPosition(),i.$slideTrack.css({opacity:1}),i.$slider.removeClass("slick-loading"),i.initUI(),"progressive"===i.options.lazyLoad&&i.progressiveLazyLoad()},e.prototype.next=e.prototype.slickNext=function(){this.changeSlide({data:{message:"next"}})},e.prototype.orientationChange=function(){var i=this;i.checkResponsive(),i.setPosition()},e.prototype.pause=e.prototype.slickPause=function(){var i=this;i.autoPlayClear(),i.paused=!0},e.prototype.play=e.prototype.slickPlay=function(){var i=this;i.autoPlay(),i.options.autoplay=!0,i.paused=!1,i.focussed=!1,i.interrupted=!1},e.prototype.postSlide=function(e){var t=this;t.unslicked||(t.$slider.trigger("afterChange",[t,e]),t.animating=!1,t.slideCount>t.options.slidesToShow&&t.setPosition(),t.swipeLeft=null,t.options.autoplay&&t.autoPlay(),!0===t.options.accessibility&&(t.initADA(),t.options.focusOnChange&&i(t.$slides.get(t.currentSlide)).attr("tabindex",0).focus()))},e.prototype.prev=e.prototype.slickPrev=function(){this.changeSlide({data:{message:"previous"}})},e.prototype.preventDefault=function(i){i.preventDefault()},e.prototype.progressiveLazyLoad=function(e){e=e||1;var t,o,s,n,r,l=this,d=i("img[data-lazy]",l.$slider);d.length?(t=d.first(),o=t.attr("data-lazy"),s=t.attr("data-srcset"),n=t.attr("data-sizes")||l.$slider.attr("data-sizes"),(r=document.createElement("img")).onload=function(){s&&(t.attr("srcset",s),n&&t.attr("sizes",n)),t.attr("src",o).removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading"),!0===l.options.adaptiveHeight&&l.setPosition(),l.$slider.trigger("lazyLoaded",[l,t,o]),l.progressiveLazyLoad()},r.onerror=function(){e<3?setTimeout(function(){l.progressiveLazyLoad(e+1)},500):(t.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"),l.$slider.trigger("lazyLoadError",[l,t,o]),l.progressiveLazyLoad())},r.src=o):l.$slider.trigger("allImagesLoaded",[l])},e.prototype.refresh=function(e){var t,o,s=this;o=s.slideCount-s.options.slidesToShow,!s.options.infinite&&s.currentSlide>o&&(s.currentSlide=o),s.slideCount<=s.options.slidesToShow&&(s.currentSlide=0),t=s.currentSlide,s.destroy(!0),i.extend(s,s.initials,{currentSlide:t}),s.init(),e||s.changeSlide({data:{message:"index",index:t}},!1)},e.prototype.registerBreakpoints=function(){var e,t,o,s=this,n=s.options.responsive||null;if("array"===i.type(n)&&n.length){s.respondTo=s.options.respondTo||"window";for(e in n)if(o=s.breakpoints.length-1,n.hasOwnProperty(e)){for(t=n[e].breakpoint;o>=0;)s.breakpoints[o]&&s.breakpoints[o]===t&&s.breakpoints.splice(o,1),o--;s.breakpoints.push(t),s.breakpointSettings[t]=n[e].settings}s.breakpoints.sort(function(i,e){return s.options.mobileFirst?i-e:e-i})}},e.prototype.reinit=function(){var e=this;e.$slides=e.$slideTrack.children(e.options.slide).addClass("slick-slide"),e.slideCount=e.$slides.length,e.currentSlide>=e.slideCount&&0!==e.currentSlide&&(e.currentSlide=e.currentSlide-e.options.slidesToScroll),e.slideCount<=e.options.slidesToShow&&(e.currentSlide=0),e.registerBreakpoints(),e.setProps(),e.setupInfinite(),e.buildArrows(),e.updateArrows(),e.initArrowEvents(),e.buildDots(),e.updateDots(),e.initDotEvents(),e.cleanUpSlideEvents(),e.initSlideEvents(),e.checkResponsive(!1,!0),!0===e.options.focusOnSelect&&i(e.$slideTrack).children().on("click.slick",e.selectHandler),e.setSlideClasses("number"==typeof e.currentSlide?e.currentSlide:0),e.setPosition(),e.focusHandler(),e.paused=!e.options.autoplay,e.autoPlay(),e.$slider.trigger("reInit",[e])},e.prototype.resize=function(){var e=this;i(window).width()!==e.windowWidth&&(clearTimeout(e.windowDelay),e.windowDelay=window.setTimeout(function(){e.windowWidth=i(window).width(),e.checkResponsive(),e.unslicked||e.setPosition()},50))},e.prototype.removeSlide=e.prototype.slickRemove=function(i,e,t){var o=this;if(i="boolean"==typeof i?!0===(e=i)?0:o.slideCount-1:!0===e?--i:i,o.slideCount<1||i<0||i>o.slideCount-1)return!1;o.unload(),!0===t?o.$slideTrack.children().remove():o.$slideTrack.children(this.options.slide).eq(i).remove(),o.$slides=o.$slideTrack.children(this.options.slide),o.$slideTrack.children(this.options.slide).detach(),o.$slideTrack.append(o.$slides),o.$slidesCache=o.$slides,o.reinit()},e.prototype.setCSS=function(i){var e,t,o=this,s={};!0===o.options.rtl&&(i=-i),e="left"==o.positionProp?Math.ceil(i)+"px":"0px",t="top"==o.positionProp?Math.ceil(i)+"px":"0px",s[o.positionProp]=i,!1===o.transformsEnabled?o.$slideTrack.css(s):(s={},!1===o.cssTransitions?(s[o.animType]="translate("+e+", "+t+")",o.$slideTrack.css(s)):(s[o.animType]="translate3d("+e+", "+t+", 0px)",o.$slideTrack.css(s)))},e.prototype.setDimensions=function(){var i=this;!1===i.options.vertical?!0===i.options.centerMode&&i.$list.css({padding:"0px "+i.options.centerPadding}):(i.$list.height(i.$slides.first().outerHeight(!0)*i.options.slidesToShow),!0===i.options.centerMode&&i.$list.css({padding:i.options.centerPadding+" 0px"})),i.listWidth=i.$list.width(),i.listHeight=i.$list.height(),!1===i.options.vertical&&!1===i.options.variableWidth?(i.slideWidth=Math.ceil(i.listWidth/i.options.slidesToShow),i.$slideTrack.width(Math.ceil(i.slideWidth*i.$slideTrack.children(".slick-slide").length))):!0===i.options.variableWidth?i.$slideTrack.width(5e3*i.slideCount):(i.slideWidth=Math.ceil(i.listWidth),i.$slideTrack.height(Math.ceil(i.$slides.first().outerHeight(!0)*i.$slideTrack.children(".slick-slide").length)));var e=i.$slides.first().outerWidth(!0)-i.$slides.first().width();!1===i.options.variableWidth&&i.$slideTrack.children(".slick-slide").width(i.slideWidth-e)},e.prototype.setFade=function(){var e,t=this;t.$slides.each(function(o,s){e=t.slideWidth*o*-1,!0===t.options.rtl?i(s).css({position:"relative",right:e,top:0,zIndex:t.options.zIndex-2,opacity:0}):i(s).css({position:"relative",left:e,top:0,zIndex:t.options.zIndex-2,opacity:0})}),t.$slides.eq(t.currentSlide).css({zIndex:t.options.zIndex-1,opacity:1})},e.prototype.setHeight=function(){var i=this;if(1===i.options.slidesToShow&&!0===i.options.adaptiveHeight&&!1===i.options.vertical){var e=i.$slides.eq(i.currentSlide).outerHeight(!0);i.$list.css("height",e)}},e.prototype.setOption=e.prototype.slickSetOption=function(){var e,t,o,s,n,r=this,l=!1;if("object"===i.type(arguments[0])?(o=arguments[0],l=arguments[1],n="multiple"):"string"===i.type(arguments[0])&&(o=arguments[0],s=arguments[1],l=arguments[2],"responsive"===arguments[0]&&"array"===i.type(arguments[1])?n="responsive":void 0!==arguments[1]&&(n="single")),"single"===n)r.options[o]=s;else if("multiple"===n)i.each(o,function(i,e){r.options[i]=e});else if("responsive"===n)for(t in s)if("array"!==i.type(r.options.responsive))r.options.responsive=[s[t]];else{for(e=r.options.responsive.length-1;e>=0;)r.options.responsive[e].breakpoint===s[t].breakpoint&&r.options.responsive.splice(e,1),e--;r.options.responsive.push(s[t])}l&&(r.unload(),r.reinit())},e.prototype.setPosition=function(){var i=this;i.setDimensions(),i.setHeight(),!1===i.options.fade?i.setCSS(i.getLeft(i.currentSlide)):i.setFade(),i.$slider.trigger("setPosition",[i])},e.prototype.setProps=function(){var i=this,e=document.body.style;i.positionProp=!0===i.options.vertical?"top":"left","top"===i.positionProp?i.$slider.addClass("slick-vertical"):i.$slider.removeClass("slick-vertical"),void 0===e.WebkitTransition&&void 0===e.MozTransition&&void 0===e.msTransition||!0===i.options.useCSS&&(i.cssTransitions=!0),i.options.fade&&("number"==typeof i.options.zIndex?i.options.zIndex<3&&(i.options.zIndex=3):i.options.zIndex=i.defaults.zIndex),void 0!==e.OTransform&&(i.animType="OTransform",i.transformType="-o-transform",i.transitionType="OTransition",void 0===e.perspectiveProperty&&void 0===e.webkitPerspective&&(i.animType=!1)),void 0!==e.MozTransform&&(i.animType="MozTransform",i.transformType="-moz-transform",i.transitionType="MozTransition",void 0===e.perspectiveProperty&&void 0===e.MozPerspective&&(i.animType=!1)),void 0!==e.webkitTransform&&(i.animType="webkitTransform",i.transformType="-webkit-transform",i.transitionType="webkitTransition",void 0===e.perspectiveProperty&&void 0===e.webkitPerspective&&(i.animType=!1)),void 0!==e.msTransform&&(i.animType="msTransform",i.transformType="-ms-transform",i.transitionType="msTransition",void 0===e.msTransform&&(i.animType=!1)),void 0!==e.transform&&!1!==i.animType&&(i.animType="transform",i.transformType="transform",i.transitionType="transition"),i.transformsEnabled=i.options.useTransform&&null!==i.animType&&!1!==i.animType},e.prototype.setSlideClasses=function(i){var e,t,o,s,n=this;if(t=n.$slider.find(".slick-slide").removeClass("slick-active slick-center slick-current").attr("aria-hidden","true"),n.$slides.eq(i).addClass("slick-current"),!0===n.options.centerMode){var r=n.options.slidesToShow%2==0?1:0;e=Math.floor(n.options.slidesToShow/2),!0===n.options.infinite&&(i>=e&&i<=n.slideCount-1-e?n.$slides.slice(i-e+r,i+e+1).addClass("slick-active").attr("aria-hidden","false"):(o=n.options.slidesToShow+i,t.slice(o-e+1+r,o+e+2).addClass("slick-active").attr("aria-hidden","false")),0===i?t.eq(t.length-1-n.options.slidesToShow).addClass("slick-center"):i===n.slideCount-1&&t.eq(n.options.slidesToShow).addClass("slick-center")),n.$slides.eq(i).addClass("slick-center")}else i>=0&&i<=n.slideCount-n.options.slidesToShow?n.$slides.slice(i,i+n.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"):t.length<=n.options.slidesToShow?t.addClass("slick-active").attr("aria-hidden","false"):(s=n.slideCount%n.options.slidesToShow,o=!0===n.options.infinite?n.options.slidesToShow+i:i,n.options.slidesToShow==n.options.slidesToScroll&&n.slideCount-i<n.options.slidesToShow?t.slice(o-(n.options.slidesToShow-s),o+s).addClass("slick-active").attr("aria-hidden","false"):t.slice(o,o+n.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"));"ondemand"!==n.options.lazyLoad&&"anticipated"!==n.options.lazyLoad||n.lazyLoad()},e.prototype.setupInfinite=function(){var e,t,o,s=this;if(!0===s.options.fade&&(s.options.centerMode=!1),!0===s.options.infinite&&!1===s.options.fade&&(t=null,s.slideCount>s.options.slidesToShow)){for(o=!0===s.options.centerMode?s.options.slidesToShow+1:s.options.slidesToShow,e=s.slideCount;e>s.slideCount-o;e-=1)t=e-1,i(s.$slides[t]).clone(!0).attr("id","").attr("data-slick-index",t-s.slideCount).prependTo(s.$slideTrack).addClass("slick-cloned");for(e=0;e<o+s.slideCount;e+=1)t=e,i(s.$slides[t]).clone(!0).attr("id","").attr("data-slick-index",t+s.slideCount).appendTo(s.$slideTrack).addClass("slick-cloned");s.$slideTrack.find(".slick-cloned").find("[id]").each(function(){i(this).attr("id","")})}},e.prototype.interrupt=function(i){var e=this;i||e.autoPlay(),e.interrupted=i},e.prototype.selectHandler=function(e){var t=this,o=i(e.target).is(".slick-slide")?i(e.target):i(e.target).parents(".slick-slide"),s=parseInt(o.attr("data-slick-index"));s||(s=0),t.slideCount<=t.options.slidesToShow?t.slideHandler(s,!1,!0):t.slideHandler(s)},e.prototype.slideHandler=function(i,e,t){var o,s,n,r,l,d=null,a=this;if(e=e||!1,!(!0===a.animating&&!0===a.options.waitForAnimate||!0===a.options.fade&&a.currentSlide===i))if(!1===e&&a.asNavFor(i),o=i,d=a.getLeft(o),r=a.getLeft(a.currentSlide),a.currentLeft=null===a.swipeLeft?r:a.swipeLeft,!1===a.options.infinite&&!1===a.options.centerMode&&(i<0||i>a.getDotCount()*a.options.slidesToScroll))!1===a.options.fade&&(o=a.currentSlide,!0!==t?a.animateSlide(r,function(){a.postSlide(o)}):a.postSlide(o));else if(!1===a.options.infinite&&!0===a.options.centerMode&&(i<0||i>a.slideCount-a.options.slidesToScroll))!1===a.options.fade&&(o=a.currentSlide,!0!==t?a.animateSlide(r,function(){a.postSlide(o)}):a.postSlide(o));else{if(a.options.autoplay&&clearInterval(a.autoPlayTimer),s=o<0?a.slideCount%a.options.slidesToScroll!=0?a.slideCount-a.slideCount%a.options.slidesToScroll:a.slideCount+o:o>=a.slideCount?a.slideCount%a.options.slidesToScroll!=0?0:o-a.slideCount:o,a.animating=!0,a.$slider.trigger("beforeChange",[a,a.currentSlide,s]),n=a.currentSlide,a.currentSlide=s,a.setSlideClasses(a.currentSlide),a.options.asNavFor&&(l=(l=a.getNavTarget()).slick("getSlick")).slideCount<=l.options.slidesToShow&&l.setSlideClasses(a.currentSlide),a.updateDots(),a.updateArrows(),!0===a.options.fade)return!0!==t?(a.fadeSlideOut(n),a.fadeSlide(s,function(){a.postSlide(s)})):a.postSlide(s),void a.animateHeight();!0!==t?a.animateSlide(d,function(){a.postSlide(s)}):a.postSlide(s)}},e.prototype.startLoad=function(){var i=this;!0===i.options.arrows&&i.slideCount>i.options.slidesToShow&&(i.$prevArrow.hide(),i.$nextArrow.hide()),!0===i.options.dots&&i.slideCount>i.options.slidesToShow&&i.$dots.hide(),i.$slider.addClass("slick-loading")},e.prototype.swipeDirection=function(){var i,e,t,o,s=this;return i=s.touchObject.startX-s.touchObject.curX,e=s.touchObject.startY-s.touchObject.curY,t=Math.atan2(e,i),(o=Math.round(180*t/Math.PI))<0&&(o=360-Math.abs(o)),o<=45&&o>=0?!1===s.options.rtl?"left":"right":o<=360&&o>=315?!1===s.options.rtl?"left":"right":o>=135&&o<=225?!1===s.options.rtl?"right":"left":!0===s.options.verticalSwiping?o>=35&&o<=135?"down":"up":"vertical"},e.prototype.swipeEnd=function(i){var e,t,o=this;if(o.dragging=!1,o.swiping=!1,o.scrolling)return o.scrolling=!1,!1;if(o.interrupted=!1,o.shouldClick=!(o.touchObject.swipeLength>10),void 0===o.touchObject.curX)return!1;if(!0===o.touchObject.edgeHit&&o.$slider.trigger("edge",[o,o.swipeDirection()]),o.touchObject.swipeLength>=o.touchObject.minSwipe){switch(t=o.swipeDirection()){case"left":case"down":e=o.options.swipeToSlide?o.checkNavigable(o.currentSlide+o.getSlideCount()):o.currentSlide+o.getSlideCount(),o.currentDirection=0;break;case"right":case"up":e=o.options.swipeToSlide?o.checkNavigable(o.currentSlide-o.getSlideCount()):o.currentSlide-o.getSlideCount(),o.currentDirection=1}"vertical"!=t&&(o.slideHandler(e),o.touchObject={},o.$slider.trigger("swipe",[o,t]))}else o.touchObject.startX!==o.touchObject.curX&&(o.slideHandler(o.currentSlide),o.touchObject={})},e.prototype.swipeHandler=function(i){var e=this;if(!(!1===e.options.swipe||"ontouchend"in document&&!1===e.options.swipe||!1===e.options.draggable&&-1!==i.type.indexOf("mouse")))switch(e.touchObject.fingerCount=i.originalEvent&&void 0!==i.originalEvent.touches?i.originalEvent.touches.length:1,e.touchObject.minSwipe=e.listWidth/e.options.touchThreshold,!0===e.options.verticalSwiping&&(e.touchObject.minSwipe=e.listHeight/e.options.touchThreshold),i.data.action){case"start":e.swipeStart(i);break;case"move":e.swipeMove(i);break;case"end":e.swipeEnd(i)}},e.prototype.swipeMove=function(i){var e,t,o,s,n,r,l=this;return n=void 0!==i.originalEvent?i.originalEvent.touches:null,!(!l.dragging||l.scrolling||n&&1!==n.length)&&(e=l.getLeft(l.currentSlide),l.touchObject.curX=void 0!==n?n[0].pageX:i.clientX,l.touchObject.curY=void 0!==n?n[0].pageY:i.clientY,l.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(l.touchObject.curX-l.touchObject.startX,2))),r=Math.round(Math.sqrt(Math.pow(l.touchObject.curY-l.touchObject.startY,2))),!l.options.verticalSwiping&&!l.swiping&&r>4?(l.scrolling=!0,!1):(!0===l.options.verticalSwiping&&(l.touchObject.swipeLength=r),t=l.swipeDirection(),void 0!==i.originalEvent&&l.touchObject.swipeLength>4&&(l.swiping=!0,i.preventDefault()),s=(!1===l.options.rtl?1:-1)*(l.touchObject.curX>l.touchObject.startX?1:-1),!0===l.options.verticalSwiping&&(s=l.touchObject.curY>l.touchObject.startY?1:-1),o=l.touchObject.swipeLength,l.touchObject.edgeHit=!1,!1===l.options.infinite&&(0===l.currentSlide&&"right"===t||l.currentSlide>=l.getDotCount()&&"left"===t)&&(o=l.touchObject.swipeLength*l.options.edgeFriction,l.touchObject.edgeHit=!0),!1===l.options.vertical?l.swipeLeft=e+o*s:l.swipeLeft=e+o*(l.$list.height()/l.listWidth)*s,!0===l.options.verticalSwiping&&(l.swipeLeft=e+o*s),!0!==l.options.fade&&!1!==l.options.touchMove&&(!0===l.animating?(l.swipeLeft=null,!1):void l.setCSS(l.swipeLeft))))},e.prototype.swipeStart=function(i){var e,t=this;if(t.interrupted=!0,1!==t.touchObject.fingerCount||t.slideCount<=t.options.slidesToShow)return t.touchObject={},!1;void 0!==i.originalEvent&&void 0!==i.originalEvent.touches&&(e=i.originalEvent.touches[0]),t.touchObject.startX=t.touchObject.curX=void 0!==e?e.pageX:i.clientX,t.touchObject.startY=t.touchObject.curY=void 0!==e?e.pageY:i.clientY,t.dragging=!0},e.prototype.unfilterSlides=e.prototype.slickUnfilter=function(){var i=this;null!==i.$slidesCache&&(i.unload(),i.$slideTrack.children(this.options.slide).detach(),i.$slidesCache.appendTo(i.$slideTrack),i.reinit())},e.prototype.unload=function(){var e=this;i(".slick-cloned",e.$slider).remove(),e.$dots&&e.$dots.remove(),e.$prevArrow&&e.htmlExpr.test(e.options.prevArrow)&&e.$prevArrow.remove(),e.$nextArrow&&e.htmlExpr.test(e.options.nextArrow)&&e.$nextArrow.remove(),e.$slides.removeClass("slick-slide slick-active slick-visible slick-current").attr("aria-hidden","true").css("width","")},e.prototype.unslick=function(i){var e=this;e.$slider.trigger("unslick",[e,i]),e.destroy()},e.prototype.updateArrows=function(){var i=this;Math.floor(i.options.slidesToShow/2),!0===i.options.arrows&&i.slideCount>i.options.slidesToShow&&!i.options.infinite&&(i.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false"),i.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false"),0===i.currentSlide?(i.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true"),i.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false")):i.currentSlide>=i.slideCount-i.options.slidesToShow&&!1===i.options.centerMode?(i.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),i.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")):i.currentSlide>=i.slideCount-1&&!0===i.options.centerMode&&(i.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),i.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")))},e.prototype.updateDots=function(){var i=this;null!==i.$dots&&(i.$dots.find("li").removeClass("slick-active").end(),i.$dots.find("li").eq(Math.floor(i.currentSlide/i.options.slidesToScroll)).addClass("slick-active"))},e.prototype.visibility=function(){var i=this;i.options.autoplay&&(document[i.hidden]?i.interrupted=!0:i.interrupted=!1)},i.fn.slick=function(){var i,t,o=this,s=arguments[0],n=Array.prototype.slice.call(arguments,1),r=o.length;for(i=0;i<r;i++)if("object"==typeof s||void 0===s?o[i].slick=new e(o[i],s):t=o[i].slick[s].apply(o[i].slick,n),void 0!==t)return t;return o}});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).noUiSlider={})}(this,function(ut){"use strict";function n(t){return"object"==typeof t&&"function"==typeof t.to}function ct(t){t.parentElement.removeChild(t)}function pt(t){return null!=t}function ft(t){t.preventDefault()}function i(t){return"number"==typeof t&&!isNaN(t)&&isFinite(t)}function dt(t,e,r){0<r&&(gt(t,e),setTimeout(function(){vt(t,e)},r))}function ht(t){return Math.max(Math.min(t,100),0)}function mt(t){return Array.isArray(t)?t:[t]}function e(t){t=(t=String(t)).split(".");return 1<t.length?t[1].length:0}function gt(t,e){t.classList&&!/\s/.test(e)?t.classList.add(e):t.className+=" "+e}function vt(t,e){t.classList&&!/\s/.test(e)?t.classList.remove(e):t.className=t.className.replace(new RegExp("(^|\\b)"+e.split(" ").join("|")+"(\\b|$)","gi")," ")}function bt(t){var e=void 0!==window.pageXOffset,r="CSS1Compat"===(t.compatMode||"");return{x:e?window.pageXOffset:(r?t.documentElement:t.body).scrollLeft,y:e?window.pageYOffset:(r?t.documentElement:t.body).scrollTop}}function s(t,e){return 100/(e-t)}function a(t,e,r){return 100*e/(t[r+1]-t[r])}function l(t,e){for(var r=1;t>=e[r];)r+=1;return r}function r(t,e,r){if(r>=t.slice(-1)[0])return 100;var n=l(r,t),i=t[n-1],o=t[n],t=e[n-1],n=e[n];return t+(r=r,a(o=[i,o],o[0]<0?r+Math.abs(o[0]):r-o[0],0)/s(t,n))}function o(t,e,r,n){if(100===n)return n;var i=l(n,t),o=t[i-1],s=t[i];return r?(s-o)/2<n-o?s:o:e[i-1]?t[i-1]+(t=n-t[i-1],i=e[i-1],Math.round(t/i)*i):n}ut.PipsMode=void 0,(z=ut.PipsMode||(ut.PipsMode={})).Range="range",z.Steps="steps",z.Positions="positions",z.Count="count",z.Values="values",ut.PipsType=void 0,(z=ut.PipsType||(ut.PipsType={}))[z.None=-1]="None",z[z.NoValue=0]="NoValue",z[z.LargeValue=1]="LargeValue",z[z.SmallValue=2]="SmallValue";var u=(t.prototype.getDistance=function(t){for(var e=[],r=0;r<this.xNumSteps.length-1;r++)e[r]=a(this.xVal,t,r);return e},t.prototype.getAbsoluteDistance=function(t,e,r){var n=0;if(t<this.xPct[this.xPct.length-1])for(;t>this.xPct[n+1];)n++;else t===this.xPct[this.xPct.length-1]&&(n=this.xPct.length-2);r||t!==this.xPct[n+1]||n++;for(var i,o=1,s=(e=null===e?[]:e)[n],a=0,l=0,u=0,c=r?(t-this.xPct[n])/(this.xPct[n+1]-this.xPct[n]):(this.xPct[n+1]-t)/(this.xPct[n+1]-this.xPct[n]);0<s;)i=this.xPct[n+1+u]-this.xPct[n+u],100<e[n+u]*o+100-100*c?(a=i*c,o=(s-100*c)/e[n+u],c=1):(a=e[n+u]*i/100*o,o=0),r?(l-=a,1<=this.xPct.length+u&&u--):(l+=a,1<=this.xPct.length-u&&u++),s=e[n+u]*o;return t+l},t.prototype.toStepping=function(t){return t=r(this.xVal,this.xPct,t)},t.prototype.fromStepping=function(t){return function(t,e,r){if(100<=r)return t.slice(-1)[0];var n=l(r,e),i=t[n-1],o=t[n],t=e[n-1],n=e[n];return(r-t)*s(t,n)*((o=[i,o])[1]-o[0])/100+o[0]}(this.xVal,this.xPct,t)},t.prototype.getStep=function(t){return t=o(this.xPct,this.xSteps,this.snap,t)},t.prototype.getDefaultStep=function(t,e,r){var n=l(t,this.xPct);return(100===t||e&&t===this.xPct[n-1])&&(n=Math.max(n-1,1)),(this.xVal[n]-this.xVal[n-1])/r},t.prototype.getNearbySteps=function(t){t=l(t,this.xPct);return{stepBefore:{startValue:this.xVal[t-2],step:this.xNumSteps[t-2],highestStep:this.xHighestCompleteStep[t-2]},thisStep:{startValue:this.xVal[t-1],step:this.xNumSteps[t-1],highestStep:this.xHighestCompleteStep[t-1]},stepAfter:{startValue:this.xVal[t],step:this.xNumSteps[t],highestStep:this.xHighestCompleteStep[t]}}},t.prototype.countStepDecimals=function(){var t=this.xNumSteps.map(e);return Math.max.apply(null,t)},t.prototype.hasNoSize=function(){return this.xVal[0]===this.xVal[this.xVal.length-1]},t.prototype.convert=function(t){return this.getStep(this.toStepping(t))},t.prototype.handleEntryPoint=function(t,e){t="min"===t?0:"max"===t?100:parseFloat(t);if(!i(t)||!i(e[0]))throw new Error("noUiSlider: 'range' value isn't numeric.");this.xPct.push(t),this.xVal.push(e[0]);e=Number(e[1]);t?this.xSteps.push(!isNaN(e)&&e):isNaN(e)||(this.xSteps[0]=e),this.xHighestCompleteStep.push(0)},t.prototype.handleStepPoint=function(t,e){e&&(this.xVal[t]!==this.xVal[t+1]?(this.xSteps[t]=a([this.xVal[t],this.xVal[t+1]],e,0)/s(this.xPct[t],this.xPct[t+1]),e=(this.xVal[t+1]-this.xVal[t])/this.xNumSteps[t],e=Math.ceil(Number(e.toFixed(3))-1),e=this.xVal[t]+this.xNumSteps[t]*e,this.xHighestCompleteStep[t]=e):this.xSteps[t]=this.xHighestCompleteStep[t]=this.xVal[t])},t);function t(e,t,r){var n;this.xPct=[],this.xVal=[],this.xSteps=[],this.xNumSteps=[],this.xHighestCompleteStep=[],this.xSteps=[r||!1],this.xNumSteps=[!1],this.snap=t;var i=[];for(Object.keys(e).forEach(function(t){i.push([mt(e[t]),t])}),i.sort(function(t,e){return t[0][0]-e[0][0]}),n=0;n<i.length;n++)this.handleEntryPoint(i[n][1],i[n][0]);for(this.xNumSteps=this.xSteps.slice(0),n=0;n<this.xNumSteps.length;n++)this.handleStepPoint(n,this.xNumSteps[n])}var c={to:function(t){return void 0===t?"":t.toFixed(2)},from:Number},p={target:"target",base:"base",origin:"origin",handle:"handle",handleLower:"handle-lower",handleUpper:"handle-upper",touchArea:"touch-area",horizontal:"horizontal",vertical:"vertical",background:"background",connect:"connect",connects:"connects",ltr:"ltr",rtl:"rtl",textDirectionLtr:"txt-dir-ltr",textDirectionRtl:"txt-dir-rtl",draggable:"draggable",drag:"state-drag",tap:"state-tap",active:"active",tooltip:"tooltip",pips:"pips",pipsHorizontal:"pips-horizontal",pipsVertical:"pips-vertical",marker:"marker",markerHorizontal:"marker-horizontal",markerVertical:"marker-vertical",markerNormal:"marker-normal",markerLarge:"marker-large",markerSub:"marker-sub",value:"value",valueHorizontal:"value-horizontal",valueVertical:"value-vertical",valueNormal:"value-normal",valueLarge:"value-large",valueSub:"value-sub"},St={tooltips:".__tooltips",aria:".__aria"};function f(t,e){if(!i(e))throw new Error("noUiSlider: 'step' is not numeric.");t.singleStep=e}function d(t,e){if(!i(e))throw new Error("noUiSlider: 'keyboardPageMultiplier' is not numeric.");t.keyboardPageMultiplier=e}function h(t,e){if(!i(e))throw new Error("noUiSlider: 'keyboardMultiplier' is not numeric.");t.keyboardMultiplier=e}function m(t,e){if(!i(e))throw new Error("noUiSlider: 'keyboardDefaultStep' is not numeric.");t.keyboardDefaultStep=e}function g(t,e){if("object"!=typeof e||Array.isArray(e))throw new Error("noUiSlider: 'range' is not an object.");if(void 0===e.min||void 0===e.max)throw new Error("noUiSlider: Missing 'min' or 'max' in 'range'.");t.spectrum=new u(e,t.snap||!1,t.singleStep)}function v(t,e){if(e=mt(e),!Array.isArray(e)||!e.length)throw new Error("noUiSlider: 'start' option is incorrect.");t.handles=e.length,t.start=e}function b(t,e){if("boolean"!=typeof e)throw new Error("noUiSlider: 'snap' option must be a boolean.");t.snap=e}function S(t,e){if("boolean"!=typeof e)throw new Error("noUiSlider: 'animate' option must be a boolean.");t.animate=e}function x(t,e){if("number"!=typeof e)throw new Error("noUiSlider: 'animationDuration' option must be a number.");t.animationDuration=e}function xt(t,e){var r,n=[!1];if("lower"===e?e=[!0,!1]:"upper"===e&&(e=[!1,!0]),!0===e||!1===e){for(r=1;r<t.handles;r++)n.push(e);n.push(!1)}else{if(!Array.isArray(e)||!e.length||e.length!==t.handles+1)throw new Error("noUiSlider: 'connect' option doesn't match handle count.");n=e}t.connect=n}function y(t,e){switch(e){case"horizontal":t.ort=0;break;case"vertical":t.ort=1;break;default:throw new Error("noUiSlider: 'orientation' option is invalid.")}}function w(t,e){if(!i(e))throw new Error("noUiSlider: 'margin' option must be numeric.");0!==e&&(t.margin=t.spectrum.getDistance(e))}function E(t,e){if(!i(e))throw new Error("noUiSlider: 'limit' option must be numeric.");if(t.limit=t.spectrum.getDistance(e),!t.limit||t.handles<2)throw new Error("noUiSlider: 'limit' option is only supported on linear sliders with 2 or more handles.")}function P(t,e){var r;if(!i(e)&&!Array.isArray(e))throw new Error("noUiSlider: 'padding' option must be numeric or array of exactly 2 numbers.");if(Array.isArray(e)&&2!==e.length&&!i(e[0])&&!i(e[1]))throw new Error("noUiSlider: 'padding' option must be numeric or array of exactly 2 numbers.");if(0!==e){for(Array.isArray(e)||(e=[e,e]),t.padding=[t.spectrum.getDistance(e[0]),t.spectrum.getDistance(e[1])],r=0;r<t.spectrum.xNumSteps.length-1;r++)if(t.padding[0][r]<0||t.padding[1][r]<0)throw new Error("noUiSlider: 'padding' option must be a positive number(s).");var n=e[0]+e[1],e=t.spectrum.xVal[0];if(1<n/(t.spectrum.xVal[t.spectrum.xVal.length-1]-e))throw new Error("noUiSlider: 'padding' option must not exceed 100% of the range.")}}function C(t,e){switch(e){case"ltr":t.dir=0;break;case"rtl":t.dir=1;break;default:throw new Error("noUiSlider: 'direction' option was not recognized.")}}function N(t,e){if("string"!=typeof e)throw new Error("noUiSlider: 'behaviour' must be a string containing options.");var r=0<=e.indexOf("tap"),n=0<=e.indexOf("drag"),i=0<=e.indexOf("fixed"),o=0<=e.indexOf("snap"),s=0<=e.indexOf("hover"),a=0<=e.indexOf("unconstrained"),l=0<=e.indexOf("invert-connects"),u=0<=e.indexOf("drag-all"),e=0<=e.indexOf("smooth-steps");if(i){if(2!==t.handles)throw new Error("noUiSlider: 'fixed' behaviour must be used with 2 handles");w(t,t.start[1]-t.start[0])}if(l&&2!==t.handles)throw new Error("noUiSlider: 'invert-connects' behaviour must be used with 2 handles");if(a&&(t.margin||t.limit))throw new Error("noUiSlider: 'unconstrained' behaviour cannot be used with margin or limit");t.events={tap:r||o,drag:n,dragAll:u,smoothSteps:e,fixed:i,snap:o,hover:s,unconstrained:a,invertConnects:l}}function V(t,e){if(!1!==e)if(!0===e||n(e)){t.tooltips=[];for(var r=0;r<t.handles;r++)t.tooltips.push(e)}else{if((e=mt(e)).length!==t.handles)throw new Error("noUiSlider: must pass a formatter for all handles.");e.forEach(function(t){if("boolean"!=typeof t&&!n(t))throw new Error("noUiSlider: 'tooltips' must be passed a formatter or 'false'.")}),t.tooltips=e}}function A(t,e){if(e.length!==t.handles)throw new Error("noUiSlider: must pass a attributes for all handles.");t.handleAttributes=e}function k(t,e){if(!n(e))throw new Error("noUiSlider: 'ariaFormat' requires 'to' method.");t.ariaFormat=e}function M(t,e){if(!n(r=e)||"function"!=typeof r.from)throw new Error("noUiSlider: 'format' requires 'to' and 'from' methods.");var r;t.format=e}function U(t,e){if("boolean"!=typeof e)throw new Error("noUiSlider: 'keyboardSupport' option must be a boolean.");t.keyboardSupport=e}function D(t,e){t.documentElement=e}function O(t,e){if("string"!=typeof e&&!1!==e)throw new Error("noUiSlider: 'cssPrefix' must be a string or `false`.");t.cssPrefix=e}function L(e,r){if("object"!=typeof r)throw new Error("noUiSlider: 'cssClasses' must be an object.");"string"==typeof e.cssPrefix?(e.cssClasses={},Object.keys(r).forEach(function(t){e.cssClasses[t]=e.cssPrefix+r[t]})):e.cssClasses=r}function yt(e){var r={margin:null,limit:null,padding:null,animate:!0,animationDuration:300,ariaFormat:c,format:c},n={step:{r:!1,t:f},keyboardPageMultiplier:{r:!1,t:d},keyboardMultiplier:{r:!1,t:h},keyboardDefaultStep:{r:!1,t:m},start:{r:!0,t:v},connect:{r:!0,t:xt},direction:{r:!0,t:C},snap:{r:!1,t:b},animate:{r:!1,t:S},animationDuration:{r:!1,t:x},range:{r:!0,t:g},orientation:{r:!1,t:y},margin:{r:!1,t:w},limit:{r:!1,t:E},padding:{r:!1,t:P},behaviour:{r:!0,t:N},ariaFormat:{r:!1,t:k},format:{r:!1,t:M},tooltips:{r:!1,t:V},keyboardSupport:{r:!0,t:U},documentElement:{r:!1,t:D},cssPrefix:{r:!0,t:O},cssClasses:{r:!0,t:L},handleAttributes:{r:!1,t:A}},i={connect:!1,direction:"ltr",behaviour:"tap",orientation:"horizontal",keyboardSupport:!0,cssPrefix:"noUi-",cssClasses:p,keyboardPageMultiplier:5,keyboardMultiplier:1,keyboardDefaultStep:10};e.format&&!e.ariaFormat&&(e.ariaFormat=e.format),Object.keys(n).forEach(function(t){if(pt(e[t])||void 0!==i[t])n[t].t(r,(pt(e[t])?e:i)[t]);else if(n[t].r)throw new Error("noUiSlider: '"+t+"' is required.")}),r.pips=e.pips;var t=document.createElement("div"),o=void 0!==t.style.msTransform,t=void 0!==t.style.transform;r.transformRule=t?"transform":o?"msTransform":"webkitTransform";return r.style=[["left","top"],["right","bottom"]][r.dir][r.ort],r}function T(t,f,o){var i,n,l,u,s,a,c=window.navigator.pointerEnabled?{start:"pointerdown",move:"pointermove",end:"pointerup"}:window.navigator.msPointerEnabled?{start:"MSPointerDown",move:"MSPointerMove",end:"MSPointerUp"}:{start:"mousedown touchstart",move:"mousemove touchmove",end:"mouseup touchend"},p=window.CSS&&CSS.supports&&CSS.supports("touch-action","none")&&function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("test",null,e)}catch(t){}return t}(),d=t,S=f.spectrum,h=[],m=[],g=[],v=0,b={},x=!1,y=t.ownerDocument,w=f.documentElement||y.documentElement,E=y.body,r="rtl"===y.dir||1===f.ort?0:100;function P(t,e){var r=y.createElement("div");return e&&gt(r,e),t.appendChild(r),r}function C(t,e){var r,t=P(t,f.cssClasses.origin),n=P(t,f.cssClasses.handle);return P(n,f.cssClasses.touchArea),n.setAttribute("data-handle",String(e)),f.keyboardSupport&&(n.setAttribute("tabindex","0"),n.addEventListener("keydown",function(t){return function(t,e){if(V()||A(e))return!1;var r=["Left","Right"],n=["Down","Up"],i=["PageDown","PageUp"],o=["Home","End"];f.dir&&!f.ort?r.reverse():f.ort&&!f.dir&&(n.reverse(),i.reverse());var s=t.key.replace("Arrow",""),a=s===i[0],l=s===i[1],i=s===n[0]||s===r[0]||a,n=s===n[1]||s===r[1]||l,r=s===o[0],o=s===o[1];if(!(i||n||r||o))return!0;if(t.preventDefault(),n||i){var u=i?0:1,u=st(e)[u];if(null===u)return!1;!1===u&&(u=S.getDefaultStep(m[e],i,f.keyboardDefaultStep)),u*=l||a?f.keyboardPageMultiplier:f.keyboardMultiplier,u=Math.max(u,1e-7),u*=i?-1:1,u=h[e]+u}else u=o?f.spectrum.xVal[f.spectrum.xVal.length-1]:f.spectrum.xVal[0];return et(e,S.toStepping(u),!0,!0),$("slide",e),$("update",e),$("change",e),$("set",e),!1}(t,e)})),void 0!==f.handleAttributes&&(r=f.handleAttributes[e],Object.keys(r).forEach(function(t){n.setAttribute(t,r[t])})),n.setAttribute("role","slider"),n.setAttribute("aria-orientation",f.ort?"vertical":"horizontal"),0===e?gt(n,f.cssClasses.handleLower):e===f.handles-1&&gt(n,f.cssClasses.handleUpper),t.handle=n,t}function N(t,e){return!!e&&P(t,f.cssClasses.connect)}function e(t,e){return!(!f.tooltips||!f.tooltips[e])&&P(t.firstChild,f.cssClasses.tooltip)}function V(){return d.hasAttribute("disabled")}function A(t){return l[t].hasAttribute("disabled")}function k(){a&&(W("update"+St.tooltips),a.forEach(function(t){t&&ct(t)}),a=null)}function M(){k(),a=l.map(e),I("update"+St.tooltips,function(t,e,r){a&&f.tooltips&&!1!==a[e]&&(t=t[e],!0!==f.tooltips[e]&&(t=f.tooltips[e].to(r[e])),a[e].innerHTML=t)})}function U(t,e){return t.map(function(t){return S.fromStepping(e?S.getStep(t):t)})}function D(d){var h=function(t){if(t.mode===ut.PipsMode.Range||t.mode===ut.PipsMode.Steps)return S.xVal;if(t.mode!==ut.PipsMode.Count)return t.mode===ut.PipsMode.Positions?U(t.values,t.stepped):t.mode===ut.PipsMode.Values?t.stepped?t.values.map(function(t){return S.fromStepping(S.getStep(S.toStepping(t)))}):t.values:[];if(t.values<2)throw new Error("noUiSlider: 'values' (>=2) required for mode 'count'.");for(var e=t.values-1,r=100/e,n=[];e--;)n[e]=e*r;return n.push(100),U(n,t.stepped)}(d),m={},t=S.xVal[0],e=S.xVal[S.xVal.length-1],g=!1,v=!1,b=0;return(h=h.slice().sort(function(t,e){return t-e}).filter(function(t){return!this[t]&&(this[t]=!0)},{}))[0]!==t&&(h.unshift(t),g=!0),h[h.length-1]!==e&&(h.push(e),v=!0),h.forEach(function(t,e){var r,n,i,o,s,a,l,u,t=t,c=h[e+1],p=d.mode===ut.PipsMode.Steps,f=(f=p?S.xNumSteps[e]:f)||c-t;for(void 0===c&&(c=t),f=Math.max(f,1e-7),r=t;r<=c;r=Number((r+f).toFixed(7))){for(a=(o=(i=S.toStepping(r))-b)/(d.density||1),u=o/(l=Math.round(a)),n=1;n<=l;n+=1)m[(s=b+n*u).toFixed(5)]=[S.fromStepping(s),0];a=-1<h.indexOf(r)?ut.PipsType.LargeValue:p?ut.PipsType.SmallValue:ut.PipsType.NoValue,!e&&g&&r!==c&&(a=0),r===c&&v||(m[i.toFixed(5)]=[r,a]),b=i}}),m}function O(i,o,s){var t,a=y.createElement("div"),n=((t={})[ut.PipsType.None]="",t[ut.PipsType.NoValue]=f.cssClasses.valueNormal,t[ut.PipsType.LargeValue]=f.cssClasses.valueLarge,t[ut.PipsType.SmallValue]=f.cssClasses.valueSub,t),l=((t={})[ut.PipsType.None]="",t[ut.PipsType.NoValue]=f.cssClasses.markerNormal,t[ut.PipsType.LargeValue]=f.cssClasses.markerLarge,t[ut.PipsType.SmallValue]=f.cssClasses.markerSub,t),u=[f.cssClasses.valueHorizontal,f.cssClasses.valueVertical],c=[f.cssClasses.markerHorizontal,f.cssClasses.markerVertical];function p(t,e){var r=e===f.cssClasses.value;return e+" "+(r?u:c)[f.ort]+" "+(r?n:l)[t]}return gt(a,f.cssClasses.pips),gt(a,0===f.ort?f.cssClasses.pipsHorizontal:f.cssClasses.pipsVertical),Object.keys(i).forEach(function(t){var e,r,n;r=i[e=t][0],n=i[t][1],(n=o?o(r,n):n)!==ut.PipsType.None&&((t=P(a,!1)).className=p(n,f.cssClasses.marker),t.style[f.style]=e+"%",n>ut.PipsType.NoValue&&((t=P(a,!1)).className=p(n,f.cssClasses.value),t.setAttribute("data-value",String(r)),t.style[f.style]=e+"%",t.innerHTML=String(s.to(r))))}),a}function L(){s&&(ct(s),s=null)}function T(t){L();var e=D(t),r=t.filter,t=t.format||{to:function(t){return String(Math.round(t))}};return s=d.appendChild(O(e,r,t))}function j(){var t=i.getBoundingClientRect(),e="offset"+["Width","Height"][f.ort];return 0===f.ort?t.width||i[e]:t.height||i[e]}function z(n,i,o,s){function e(t){var e,r=function(e,t,r){var n=0===e.type.indexOf("touch"),i=0===e.type.indexOf("mouse"),o=0===e.type.indexOf("pointer"),s=0,a=0;0===e.type.indexOf("MSPointer")&&(o=!0);if("mousedown"===e.type&&!e.buttons&&!e.touches)return!1;if(n){var l=function(t){t=t.target;return t===r||r.contains(t)||e.composed&&e.composedPath().shift()===r};if("touchstart"===e.type){n=Array.prototype.filter.call(e.touches,l);if(1<n.length)return!1;s=n[0].pageX,a=n[0].pageY}else{l=Array.prototype.find.call(e.changedTouches,l);if(!l)return!1;s=l.pageX,a=l.pageY}}t=t||bt(y),(i||o)&&(s=e.clientX+t.x,a=e.clientY+t.y);return e.pageOffset=t,e.points=[s,a],e.cursor=i||o,e}(t,s.pageOffset,s.target||i);return!!r&&(!(V()&&!s.doNotReject)&&(e=d,t=f.cssClasses.tap,!((e.classList?e.classList.contains(t):new RegExp("\\b"+t+"\\b").test(e.className))&&!s.doNotReject)&&(!(n===c.start&&void 0!==r.buttons&&1<r.buttons)&&((!s.hover||!r.buttons)&&(p||r.preventDefault(),r.calcPoint=r.points[f.ort],void o(r,s))))))}var r=[];return n.split(" ").forEach(function(t){i.addEventListener(t,e,!!p&&{passive:!0}),r.push([t,e])}),r}function H(t){var e,r,n=ht(n=100*(t-(n=i,e=f.ort,r=n.getBoundingClientRect(),n=(t=n.ownerDocument).documentElement,t=bt(t),/webkit.*Chrome.*Mobile/i.test(navigator.userAgent)&&(t.x=0),e?r.top+t.y-n.clientTop:r.left+t.x-n.clientLeft))/j());return f.dir?100-n:n}function F(t,e){"mouseout"===t.type&&"HTML"===t.target.nodeName&&null===t.relatedTarget&&_(t,e)}function R(t,e){if(-1===navigator.appVersion.indexOf("MSIE 9")&&0===t.buttons&&0!==e.buttonsProperty)return _(t,e);t=(f.dir?-1:1)*(t.calcPoint-e.startCalcPoint);K(0<t,100*t/e.baseSize,e.locations,e.handleNumbers,e.connect)}function _(t,e){e.handle&&(vt(e.handle,f.cssClasses.active),--v),e.listeners.forEach(function(t){w.removeEventListener(t[0],t[1])}),0===v&&(vt(d,f.cssClasses.drag),tt(),t.cursor&&(E.style.cursor="",E.removeEventListener("selectstart",ft))),f.events.smoothSteps&&(e.handleNumbers.forEach(function(t){et(t,m[t],!0,!0,!1,!1)}),e.handleNumbers.forEach(function(t){$("update",t)})),e.handleNumbers.forEach(function(t){$("change",t),$("set",t),$("end",t)})}function B(t,e){var r,n,i,o;e.handleNumbers.some(A)||(1===e.handleNumbers.length&&(o=l[e.handleNumbers[0]].children[0],v+=1,gt(o,f.cssClasses.active)),t.stopPropagation(),n=z(c.move,w,R,{target:t.target,handle:o,connect:e.connect,listeners:r=[],startCalcPoint:t.calcPoint,baseSize:j(),pageOffset:t.pageOffset,handleNumbers:e.handleNumbers,buttonsProperty:t.buttons,locations:m.slice()}),i=z(c.end,w,_,{target:t.target,handle:o,listeners:r,doNotReject:!0,handleNumbers:e.handleNumbers}),o=z("mouseout",w,F,{target:t.target,handle:o,listeners:r,doNotReject:!0,handleNumbers:e.handleNumbers}),r.push.apply(r,n.concat(i,o)),t.cursor&&(E.style.cursor=getComputedStyle(t.target).cursor,1<l.length&&gt(d,f.cssClasses.drag),E.addEventListener("selectstart",ft,!1)),e.handleNumbers.forEach(function(t){$("start",t)}))}function q(t){t.stopPropagation();var i,o,s,e=H(t.calcPoint),r=(i=e,s=!(o=100),l.forEach(function(t,e){var r,n;A(e)||(r=m[e],((n=Math.abs(r-i))<o||n<=o&&r<i||100===n&&100===o)&&(s=e,o=n))}),s);!1!==r&&(f.events.snap||dt(d,f.cssClasses.tap,f.animationDuration),et(r,e,!0,!0),tt(),$("slide",r,!0),$("update",r,!0),f.events.snap?B(t,{handleNumbers:[r]}):($("change",r,!0),$("set",r,!0)))}function X(t){var t=H(t.calcPoint),t=S.getStep(t),e=S.fromStepping(t);Object.keys(b).forEach(function(t){"hover"===t.split(".")[0]&&b[t].forEach(function(t){t.call(lt,e)})})}function Y(a){a.fixed||l.forEach(function(t,e){z(c.start,t.children[0],B,{handleNumbers:[e]})}),a.tap&&z(c.start,i,q,{}),a.hover&&z(c.move,i,X,{hover:!0}),a.drag&&u.forEach(function(e,t){var r,n,i,o,s;!1!==e&&0!==t&&t!==u.length-1&&(r=l[t-1],n=l[t],i=[e],o=[r,n],s=[t-1,t],gt(e,f.cssClasses.draggable),a.fixed&&(i.push(r.children[0]),i.push(n.children[0])),a.dragAll&&(o=l,s=g),i.forEach(function(t){z(c.start,t,B,{handles:o,handleNumbers:s,connect:e})}))})}function I(t,e){b[t]=b[t]||[],b[t].push(e),"update"===t.split(".")[0]&&l.forEach(function(t,e){$("update",e)})}function W(t){var n=t&&t.split(".")[0],i=n?t.substring(n.length):t;Object.keys(b).forEach(function(t){var e=t.split(".")[0],r=t.substring(e.length);n&&n!==e||i&&i!==r||((e=r)!==St.aria&&e!==St.tooltips||i===r)&&delete b[t]})}function $(r,n,i){Object.keys(b).forEach(function(t){var e=t.split(".")[0];r===e&&b[t].forEach(function(t){t.call(lt,h.map(f.format.to),n,h.slice(),i||!1,m.slice(),lt)})})}function G(t,e,r,n,i,o,s){var a;return 1<l.length&&!f.events.unconstrained&&(n&&0<e&&(a=S.getAbsoluteDistance(t[e-1],f.margin,!1),r=Math.max(r,a)),i&&e<l.length-1&&(a=S.getAbsoluteDistance(t[e+1],f.margin,!0),r=Math.min(r,a))),1<l.length&&f.limit&&(n&&0<e&&(a=S.getAbsoluteDistance(t[e-1],f.limit,!1),r=Math.min(r,a)),i&&e<l.length-1&&(a=S.getAbsoluteDistance(t[e+1],f.limit,!0),r=Math.max(r,a))),f.padding&&(0===e&&(a=S.getAbsoluteDistance(0,f.padding[0],!1),r=Math.max(r,a)),e===l.length-1&&(a=S.getAbsoluteDistance(100,f.padding[1],!0),r=Math.min(r,a))),!((r=ht(r=!s?S.getStep(r):r))===t[e]&&!o)&&r}function J(t,e){var r=f.ort;return(r?e:t)+", "+(r?t:e)}function K(t,r,n,e,i){var o=n.slice(),s=e[0],a=f.events.smoothSteps,l=[!t,t],u=[t,!t];e=e.slice(),t&&e.reverse(),1<e.length?e.forEach(function(t,e){e=G(o,t,o[t]+r,l[e],u[e],!1,a);!1===e?r=0:(r=e-o[t],o[t]=e)}):l=u=[!0];var c=!1;e.forEach(function(t,e){c=et(t,n[t]+r,l[e],u[e],!1,a)||c}),c&&(e.forEach(function(t){$("update",t),$("slide",t)}),null!=i&&$("drag",s))}function Q(t,e){return f.dir?100-t-e:t}function Z(t,e){m[t]=e,h[t]=S.fromStepping(e);e="translate("+J(Q(e,0)-r+"%","0")+")";if(l[t].style[f.transformRule]=e,f.events.invertConnects&&1<m.length){e=m.every(function(t,e,r){return 0===e||t>=r[e-1]});if(x!==!e)return x=!x,xt(f,f.connect.map(function(t){return!t})),void at()}rt(t),rt(t+1),x&&(rt(t-1),rt(t+2))}function tt(){g.forEach(function(t){var e=50<m[t]?-1:1,e=3+(l.length+e*t);l[t].style.zIndex=String(e)})}function et(t,e,r,n,i,o){return!1!==(e=i?e:G(m,t,e,r,n,!1,o))&&(Z(t,e),!0)}function rt(t){var e,r,n;u[t]&&(e=m.slice(),x&&e.sort(function(t,e){return t-e}),n=100,r="translate("+J(Q(r=(r=0)!==t?e[t-1]:r,n=(n=t!==u.length-1?e[t]:n)-r)+"%","0")+")",n="scale("+J(n/100,"1")+")",u[t].style[f.transformRule]=r+" "+n)}function nt(t,e){return null===t||!1===t||void 0===t?m[e]:("number"==typeof t&&(t=String(t)),!1===(t=!1!==(t=f.format.from(t))?S.toStepping(t):t)||isNaN(t)?m[e]:t)}function it(t,e,r){var n=mt(t),t=void 0===m[0];e=void 0===e||e,f.animate&&!t&&dt(d,f.cssClasses.tap,f.animationDuration),g.forEach(function(t){et(t,nt(n[t],t),!0,!1,r)});var i,o=1===g.length?0:1;for(t&&S.hasNoSize()&&(r=!0,m[0]=0,1<g.length&&(i=100/(g.length-1),g.forEach(function(t){m[t]=t*i})));o<g.length;++o)g.forEach(function(t){et(t,m[t],!0,!0,r)});tt(),g.forEach(function(t){$("update",t),null!==n[t]&&e&&$("set",t)})}function ot(t){if(t=void 0===t?!1:t)return 1===h.length?h[0]:h.slice(0);t=h.map(f.format.to);return 1===t.length?t[0]:t}function st(t){var e=m[t],r=S.getNearbySteps(e),n=h[t],i=r.thisStep.step,t=null;if(f.snap)return[n-r.stepBefore.startValue||null,r.stepAfter.startValue-n||null];!1!==i&&n+i>r.stepAfter.startValue&&(i=r.stepAfter.startValue-n),t=n>r.thisStep.startValue?r.thisStep.step:!1!==r.stepBefore.step&&n-r.stepBefore.highestStep,100===e?i=null:0===e&&(t=null);e=S.countStepDecimals();return null!==i&&!1!==i&&(i=Number(i.toFixed(e))),[t=null!==t&&!1!==t?Number(t.toFixed(e)):t,i]}function at(){for(;n.firstChild;)n.removeChild(n.firstChild);for(var t=0;t<=f.handles;t++)u[t]=N(n,f.connect[t]),rt(t);Y({drag:f.events.drag,fixed:!0})}gt(t=d,f.cssClasses.target),0===f.dir?gt(t,f.cssClasses.ltr):gt(t,f.cssClasses.rtl),0===f.ort?gt(t,f.cssClasses.horizontal):gt(t,f.cssClasses.vertical),gt(t,"rtl"===getComputedStyle(t).direction?f.cssClasses.textDirectionRtl:f.cssClasses.textDirectionLtr),i=P(t,f.cssClasses.base),function(t,e){n=P(e,f.cssClasses.connects),l=[],(u=[]).push(N(n,t[0]));for(var r=0;r<f.handles;r++)l.push(C(e,r)),g[r]=r,u.push(N(n,t[r+1]))}(f.connect,i),Y(f.events),it(f.start),f.pips&&T(f.pips),f.tooltips&&M(),W("update"+St.aria),I("update"+St.aria,function(t,e,o,r,s){g.forEach(function(t){var e=l[t],r=G(m,t,0,!0,!0,!0),n=G(m,t,100,!0,!0,!0),i=s[t],t=String(f.ariaFormat.to(o[t])),r=S.fromStepping(r).toFixed(1),n=S.fromStepping(n).toFixed(1),i=S.fromStepping(i).toFixed(1);e.children[0].setAttribute("aria-valuemin",r),e.children[0].setAttribute("aria-valuemax",n),e.children[0].setAttribute("aria-valuenow",i),e.children[0].setAttribute("aria-valuetext",t)})});var lt={destroy:function(){for(W(St.aria),W(St.tooltips),Object.keys(f.cssClasses).forEach(function(t){vt(d,f.cssClasses[t])});d.firstChild;)d.removeChild(d.firstChild);delete d.noUiSlider},steps:function(){return g.map(st)},on:I,off:W,get:ot,set:it,setHandle:function(t,e,r,n){if(!(0<=(t=Number(t))&&t<g.length))throw new Error("noUiSlider: invalid handle number, got: "+t);et(t,nt(e,t),!0,!0,n),$("update",t),r&&$("set",t)},reset:function(t){it(f.start,t)},disable:function(t){null!=t?(l[t].setAttribute("disabled",""),l[t].handle.removeAttribute("tabindex")):(d.setAttribute("disabled",""),l.forEach(function(t){t.handle.removeAttribute("tabindex")}))},enable:function(t){null!=t?(l[t].removeAttribute("disabled"),l[t].handle.setAttribute("tabindex","0")):(d.removeAttribute("disabled"),l.forEach(function(t){t.removeAttribute("disabled"),t.handle.setAttribute("tabindex","0")}))},__moveHandles:function(t,e,r){K(t,e,m,r)},options:o,updateOptions:function(e,t){var r=ot(),n=["margin","limit","padding","range","animate","snap","step","format","pips","tooltips","connect"];n.forEach(function(t){void 0!==e[t]&&(o[t]=e[t])});var i=yt(o);n.forEach(function(t){void 0!==e[t]&&(f[t]=i[t])}),S=i.spectrum,f.margin=i.margin,f.limit=i.limit,f.padding=i.padding,f.pips?T(f.pips):L(),(f.tooltips?M:k)(),m=[],it(pt(e.start)?e.start:r,t),e.connect&&at()},target:d,removePips:L,removeTooltips:k,getPositions:function(){return m.slice()},getTooltips:function(){return a},getOrigins:function(){return l},pips:T};return lt}function j(t,e){if(!t||!t.nodeName)throw new Error("noUiSlider: create requires a single element, got: "+t);if(t.noUiSlider)throw new Error("noUiSlider: Slider was already initialized.");e=T(t,yt(e),e);return t.noUiSlider=e}var z={__spectrum:u,cssClasses:p,create:j};ut.create=j,ut.cssClasses=p,ut.default=z,Object.defineProperty(ut,"__esModule",{value:!0})});
(function($){
$.fn.wpcsselect=function(options){
var defaults={
onRefresh: function(){},
onSelect: function(){},
handle_selector: '.wpcs_select_handle',
loading_selector: '.wpcs_select_loading',
clear_selector: '.wpcs_select_delete',
arrow_selector: '.wpcs_select_arrow',
value_selector: null,
list_selector: '#wpcs_select_list',
target: null,
};
var settings=$.extend({}, defaults, options);
if(settings.target!==null){
settings.value_selector=settings.target;
}else{
settings.value_selector=".wpcs_select_value";
}
function _create(select){
let element=$(select);
if(element.data('wpcsselect-init')){
return element;
}
element.data('wpcsselect-init', true);
let ul;
ul=$('ul' + settings.list_selector);
if(ul.length < 1){
ul=$('<ul id="wpcs_select_list"><li class="wpcs_search_li"><input type="text" class="wpcs_select_search" /></li></ul>');
$('body').append(ul);
}
_initSearch(element);
_initialize(element);
_initClear(element);
return element;
}
function _initClear(element){
$(settings.clear_selector, element).click(function(){
_unset_value(element);
});
}
function _initSearch(element){
$(settings.list_selector + ' li input.wpcs_select_search').keyup(function(){
let text=$(this).val().toLowerCase();
$(settings.list_selector + ' li.wpcs_select_option').each(function(){
let dataValue=$(this).data("value").toString().toLowerCase();
if(!dataValue||!dataValue.includes(text)){
$(this).hide();
}else{
$(this).show();
}});
});
}
function _initialize(element){
$(settings.handle_selector + ', ' + settings.arrow_selector, element)
.click(function(){
if($(element).hasClass('open')){
_close(element);
}else{
_close($('div.wpcsselect.open'));
_open(element);
}})
.keydown(function(e){
if(e.key==='Enter'||e.key===' '){
e.preventDefault();
$(this).trigger('click');
}})
;
}
function _init_options(element){
let multiple=element.data('multiple');
$(settings.list_selector + ' li')
.click(function(){
if($(this).data('optgroup')){
let group=$(this).data('value');
let li=$(settings.list_selector + ' li[data-group="'+group+'"]');
let set_active=true;
li.each(function(){
if($(this).hasClass('active')){
$(this).removeClass('active');
set_active=false;
}});
if(set_active) li.addClass('active');
_set_multiple_value(element);
}
else if(multiple > 0&&$(this).hasClass('wpcs_select_option')){
$(this).toggleClass('active');
_set_multiple_value(element);
}
else if($(this).hasClass('wpcs_select_option')){
_set_value(element, $(this).attr('data-index'));
_close(element);
}
settings.onSelect.call();
})
.keydown(function(e){
if(e.key==="Tab"){
if(parseInt($(this).data('index'))===$(settings.list_selector + ' li.wpcs_select_option').length - 1){
_close(element);
$('.wpcs_select_arrow',element).trigger('focus');
}}
if(e.key==="Enter"||e.key===" "){
$(this).trigger('click');
}})
;
}
function _open_now(element){
let multiple=parseInt($(element).data('multiple'));
$(element).addClass('open');
_calculate_position();
let ul=$('ul' + settings.list_selector);
ul.addClass('open');
let search=$('.wpcs_search_li', ul);
$('.wpcs_select_search', search).val("");
let hasSearch=element.data('search')||0;
if(hasSearch < 1) search.hide();
else search.show();
if(multiple > 0) ul.addClass('multiple');
else ul.removeClass('multiple');
}
function _open(element){
if(settings.ajax){ _createListFromAjax(element); }else{ _createListFromDataDiv(element); }
window.setTimeout(function(){
$(document).bind('click', _close_current);
$(window).bind('resize', _calculate_position);
}, 10);
}
function _calculate_position(){
let element=$('div.wpcsselect.open');
let handle=$(settings.handle_selector, element);
let handlePos=$(settings.handle_selector, element).offset();
let ul=$('ul' + settings.list_selector);
ul.css({
top: handlePos.top + handle.height(),
left: handlePos.left,
width: handle.outerWidth()
});
}
function _close_current(e){
if(!$(e.target).hasClass('wpcs_select_option') &&
!$(e.target).hasClass('wpcs_select_search') &&
!$(e.target).hasClass('wpcs_select_handle') &&
!$(e.target).hasClass('wpcs_select_arrow') &&
!$(e.target).hasClass('wpcs_select_multiple_checkbox')){
_close($('div.wpcsselect.open'));
}}
function _close(element){
$(element).removeClass('open');
$('ul' + settings.list_selector).removeClass('open');
$(document).unbind('click', _close_current);
$(window).unbind('resize', _calculate_position);
$('.wpcs_select_arrow',element).trigger('focus');
}
function _refresh(element, list, sel){
_open_now(element);
let selected=sel||null;
let selected_value;
let multiple=element.data('multiple');
if(selected!==null) selected_value=selected;
else selected_value=$(settings.value_selector, element).val()||'';
if(multiple > 0){
selected_value=selected_value.split(",");
if(!Array.isArray(selected_value)) selected_value=[];
}
let ul=$('ul' + settings.list_selector);
let selected_index="";
$('li.wpcs_select_option', ul).remove();
let i=0;
for (let [index, obj] of list){
if(obj.value=="#"&&multiple > 0&&list.size!=1) continue;
let active_class='';
if(multiple > 0&&obj.value!="#"){
let active=selected_value.some(function(array_element){
return array_element==obj.value;
});
active_class=active > 0 ? 'active':'';
}
let elementHtml='<li class="wpcs_select_option ' + active_class + '" ' +
'data-value="' + obj.value + '" ' +
'data-label="' + obj.label + '" ' +
'data-optgroup="' + obj.is_group + '" ' +
'data-group="' + obj.group + '" ' +
'data-index="' + obj.index + '"' +
'tabindex="0"' +
'role="button"' +
'>';
elementHtml +=obj.label;
elementHtml +='</li>';
let option=$(elementHtml);
if(selected_value==obj.value){
selected_index=i;
}
ul.append(option);
i++;
}
_init_options(element);
if(multiple > 0) _set_multiple_value(element);
else _set_value(element, selected_index);
settings.onRefresh.call();
}
function _unset_value(element){
$(settings.list_selector + ' li.selected').removeClass('selected');
$(settings.handle_selector, element).html(element.data('nothing-selected'));
$(settings.value_selector, element).val("");
$(settings.clear_selector, element).hide();
settings.onSelect.call();
}
function _set_value(element, index){
if(index==="") return;
let li=$(settings.list_selector + ' li.wpcs_select_option').eq(index);
let value=li.data('value')
let label=li.data('label');
$(settings.list_selector + ' li.selected').removeClass('selected');
li.addClass('selected');
$(settings.handle_selector, element).html(label);
$(settings.value_selector, element).val(value).trigger('change');
$(settings.clear_selector,element).show();
}
function _set_multiple_value(element){
let value='';
let count=0;
let labelValue='';
let labelTmp='';
let valueTmp='';
$(settings.list_selector + ' li').each(function(){
if($(this).hasClass('active')){
labelTmp=$(this).data('label');
valueTmp=$(this).data('value');
if(value!="") value +=',';
value +=valueTmp;
labelValue=labelTmp;
count++;
}});
let label='';
if(count==0) label=$(element).data('nothing-selected');
else if(count==1) label=labelValue;
else if(count > 1) label=count + ' ausgewählt';
$(settings.handle_selector, element).html(label);
$(settings.value_selector, element).val(value).trigger('change');
if(count==0) $(settings.clear_selector,element).hide();
else $(settings.clear_selector,element).show();
}
function _createListFromDataDiv(element){
let list=new Map();
$('.data div', element).each(function(i){
let value=$(this).attr('data-value');
let label=$(this).html();
let is_group=$(this).data('is-group') ?? false;
let group=$(this).data('group') ?? null;
list.set(i, { value: value, label: label, is_group:is_group, group:group, index: i });
});
_refresh(element, list);
}
function _createListFromAjax(element){
if(!settings.ajax) return;
let ajax=Object.assign({}, settings.ajax);
ajax.data=settings.ajax.data();
let multiple=parseInt(element.data('multiple'));
$(settings.loading_selector, element).show();
$(settings.arrow_selector, element).hide();
$.ajax(ajax).done(function(data){
let list=new Map();
let z=0;
for (let index in data){
let value=data[index]['id'];
let label=data[index]['text'];
let is_group=data[index]['is_group'] ?? false;
let group=data[index]['group'] ?? null;
list.set(z, { value: value, label: label, is_group:is_group, group:group, index: z });
z++;
}
$(settings.loading_selector, element).hide();
$(settings.arrow_selector, element).show();
_refresh(element, list);
});
}
return this.each(function(){
select=this;
_create(select);
});
};})(jQuery);
var wpcs_lightbox=null;
var wpcs_form=null;
var wpcs_orderbar=null;
var wpcs_contact_form=null;
var wpcs_compare=null;
var wpcs_park=null;
var wpcs_search_request=null;
var wpcs_infinite_scroll=null;
var wpcs_textsearch=null;
var wpcs_form_elements=null;
var wpcs_2slides=null;
(function($){
$(function(){
wpcs_form=new WPCSForm();
if($('.dxim_ff_order_bar').length > 0) wpcs_orderbar=new WPCSOrderbar();
if($('.wpcs_contact_form').length > 0) wpcs_contact_form=new WPCSContactForm();
wpcs_compare=new WPCSCompare();
wpcs_2slides=new WPCS2Slides();
wpcs_search_request=new WPCSSearchRequest();
wpcs_lightbox=new WPCSLightbox();
wpcsInitLightbox();
wpcs_park=new WPCSPark();
wpcs_infinite_scroll=new WPCSInfiniteScroll();
wpcs_form_elements=new WPCSFormElements();
$('.wpcs_sticky').each(function(){
new WPCSSticky(this);
});
$('.wpcs_scroller').each(function(){
new WPCSScroller(this);
});
new WPCSFilterSet();
$('.dxim_vehicle_carousel').each(function(){
let carousel=this;
let title=0;
let data=0;
$('.vehicle-on-archive', carousel).each(function(){
if($('.dxim_archive_specifics', this).height() > data) data=$('.dxim_archive_specifics', this).height();
if($('.title', this).height() > title) title=$('.title', this).height();
});
$('.vehicle-on-archive .title', carousel).css('height', title);
$('.vehicle-on-archive .dxim_archive_specifics', carousel).css('height', data);
});
$('a.wpcs_toggle')
.click(function(e){
e.preventDefault();
let selector=$(this).data('div');
$(selector).toggleClass('wpcs_hidden');
});
$('a.wpcs_toggle_visibility')
.click(function(e){
e.preventDefault();
let a=$(this);
let selector=a.data('div');
a.toggleClass('active');
if($(selector).hasClass('wpcs_not_visible_mobile')){
$(selector).removeClass('wpcs_not_visible_mobile');
if($('body').hasClass('wpcs_mobile')) $(selector).addClass('wpcs_not_visible');
}
$(selector).toggleClass('wpcs_not_visible');
});
$('.wpcs_textsearch').each(function(){
new WPCSTextSearch(this);
});
$('[data-wpcs-bind]').each(function(){
let selector=$(this).data('wpcs-bind');
let amount=parseInt($(selector).data('amount'));
if(amount > 0){
$(this)
.html(amount + " ")
.removeClass('wpcs_hidden');
}});
add_body_classes()
});
function WPCS2Slides(){
this.__construct=function(){
$('.wpcs_2slides_container').each(function(){
let area_selector=$(this).data('area-selector');
$(area_selector, this).hide();
});
$(document).on('click', '.wpcs_2slides_activate', function(e){
e.preventDefault();
let area=$(this).data('area');
let slider=$(this).closest('.wpcs_2slides_container');
let area_selector=slider.data('area-selector');
slider.addClass('active');
$(area_selector + '[data-area="' + area + '"]', slider).show();
});
$(document).on('click', '.wpcs_2slides_disable', function(e){
e.preventDefault();
let slider=$(this).closest('.wpcs_2slides_container');
let area_selector=slider.data('area-selector');
slider.removeClass('active');
$(area_selector, slider).hide();
});
}
this.initItem=function(item){
let area_selector=$(item).data('area-selector');
$(area_selector, item).hide();
}
this.__construct();
}
function WPCSFormElements(){
var that=this;
this._construct=function(){
this.initWPCSSelect();
}
this.initWPCSSelect=function(){
$('.wpcsselect.custom').each(function(){
let select=$(this);
select.wpcsselect({});
});
}
this._construct();
}
function WPCSTextSearch(textsearch){
var that=this;
this.textsearch=$(textsearch);
this.timeout=null;
this.loader=$('.wpcs_ajax_loader', this.textsearch);
this.textinput=$('.searchInput', this.textsearch);
this.close_btn=$('.wpcs_textsearch_reset_btn', this.textsearch);
this.results_div=null;
this._construct=function(){
let h=this.loader.height();
this.loader.css('margin-top', Math.round(h / 2) * -1);
let h2=this.close_btn.height();
this.close_btn.css('margin-top', Math.round(h2 / 2) * -1);
let target=that.textsearch.data('target');
this.results_div=$('.' + target, that.textsearch);
if(this.results_div.length < 1) this.results_div=$('#' + target);
$(that.textinput).keyup(function(){
if(that.timeout!==null) window.clearTimeout(that.timeout);
let val=$(this).val();
if(val.length < 3) return;
that.setCloseBtnState();
that.timeout=window.setTimeout(that._doSearch, 700, val);
});
this.close_btn.click(function(e){
e.preventDefault();
that.emptyList();
that.textinput.val("");
that.setCloseBtnState();
});
}
this._doSearch=function(val){
that.loader.show();
that.close_btn.hide();
let action=that.textsearch.data('type');
let args=that.textsearch.data('params');
$.ajax({
method: 'POST',
url: wpcs_ajax_url,
data: { action: action, searchstring: val, args: args },
success: function(data){
that.loader.hide();
that.setCloseBtnState();
if(data.status=="1"){
console.log(that.results_div);
that.results_div.html(data.html).fadeIn(100);
}else if(data.status=="0"){
that.emptyList();
}}
});
}
this.emptyList=function(){
that.results_div.html(null).fadeOut(150);
}
this.setCloseBtnState=function(){
let val=that.textinput.val();
if(val!="") that.close_btn.show();
else that.close_btn.hide();
}
this._construct();
}
function WPCSInfiniteScroll(){
var that=this;
this.__construct=function(){
that._initButton();
that._initInfiniteLoader();
$(document).on("wpcs_ajax_form_submitted", that._checkButtonVisibility);
}
this._checkButtonVisibility=function(){
if($('#wpcs_pagination_button').length < 1) return;
if(that._canLoadMore()) $('#wpcs_pagination_button').show();
else $('#wpcs_pagination_button').hide();
}
this._canLoadMore=function(){
let current_page=parseInt($('#wpcs_hidden_wpcsp').val());
if(current_page >=vehicle_list_properties.max_pages) return false;
else return true;
}
this._initButton=function(){
$('#wpcs_pagination_button').click(function(e){
e.preventDefault();
that._loadVehicles();
});
}
this._initInfiniteLoader=function(){
if($('#wpcs_vehicle_archive').data('infinite')!="1") return;
let timeout=null;
$(window).on("scroll", function(){
if(timeout!=null) window.clearTimeout(timeout);
timeout=window.setTimeout(function(){
if($('#wpcs_vehicle_archive .vehicle-on-archive').length < 1) return;
let element_pos=parseInt($('#wpcs_vehicle_archive .vehicle-on-archive').last().offset().top);
if(wpcs_form.is_loading||!that._canLoadMore()) return;
var scrollHeight=$(document).height();
var scrollPos=$(window).height() + $(window).scrollTop();
if(scrollPos >=element_pos) that._loadVehicles();
}, 400);
});
}
this._loadVehicles=function(){
let current_page=parseInt($('#wpcs_hidden_wpcsp').val());
let new_page=current_page + 1;
$('#wpcs_hidden_wpcsp').val(new_page);
wpcs_form.submitAjax(1);
}
this.__construct();
}
function WPCSSearchRequest(){
var that=this;
this.loader=$('.wpcs_ajax_loader[data-category=searchRequest]');
this.__construct=function(){
this._initSaveSearch();
this._initList();
}
this._initSearch=function(sid){
let wrapper=$('.wpcs_save_search_request_wrapper[data-sid="' + sid + '"]');
$('.wpcs_save_search_request_btn', wrapper).click(function(e){
e.preventDefault();
var btn=$(this);
var spinner=$('.wpcs_icon_spinner', btn);
spinner.css('display', 'inline-block');
let email=$('.wpcs_sr_email_input', wrapper);
let email_val=email.val();
let privacy=$('input[name=wpcs_sr_privacy]', wrapper).is(':checked') ? 1:0;
$.ajax({
method: 'POST',
url: wpcs_ajax_url,
data: { action: 'wpcs_search_request', todo: 'addSearchRequest', email: email_val, privacy: privacy, formData: wpcs_form.serialize() },
success: function(data){
spinner.hide();
if(data.error=="1"){
$('.status', wrapper).addClass('error').removeClass('success').html(data.msg);
}else{
$('.status', wrapper).addClass('success').removeClass('error').html(data.msg);
email.val('');
}}
});
});
$('.privacy_btn', wrapper).click(function(e){
e.preventDefault();
$('.wpcs_vsr_privacy_text', wrapper).slideToggle();
})
}
this._initSaveSearch=function(){
$('.wpcs_save_search_request_wrapper').each(function(){
let wrapper=this;
let sid=$(wrapper).data('sid');
that._initSearch(sid);
});
}
this._initList=function(){
$('#wpcs_vsq_list .wpcs_search_request').each(function(){
let wrapper=this;
$('.delete_btn', wrapper).click(function(e){
e.preventDefault();
let button=this;
let hash=$('#wpcs_vsq_list').data('hash');
let time=$(wrapper).data('time');
var spinner=$('.wpcs_icon_spinner', button);
if(spinner.length) spinner.css('display', 'inline-block');
else that.loader.show();
$('.delete_icon', button).hide();
$.ajax({
method: 'POST',
url: wpcs_ajax_url,
data: { action: 'wpcs_search_request', todo: 'removeSearchRequest', hash: hash, time: time },
success: function(data){
if(spinner.length) spinner.hide();
else that.loader.hide();
$('.delete_icon', button).show();
if(data.error=="1"){
alert(data.msg);
}else{
$(wrapper).remove();
}}
});
});
});
}
this.__construct();
}
function WPCSPark(){
var that=this;
this.vehicles_list_html=null;
this.vehicle_count=0;
this.__construct=function(){
this._initToggleButtons()
this._initList();
}
this._initList=function(){
$('#wpcs_vehicle_parked .vehicle').each(function(){
let vehicle=this;
let vehicle_id=$(this).attr('data-vehicle-id');
$('.wpcs_park_remove_btn', vehicle).click(function(e){
e.preventDefault();
$('.wpcs_ajax_loader', vehicle).show();
$.ajax({
method: 'POST',
url: wpcs_ajax_url,
data: { action: 'wpcs_park', todo: 'removeFromList', vehicle_id: vehicle_id },
success: function(data){
if(!data.error){
that.vehicles_list_html=data.list;
that.vehicle_count=data.count;
that._setList();
}}
});
});
});
}
this._initToggleButtons=function(){
$('.wpcs_park_toggle_btn').click(function(e){
e.preventDefault();
var btn=$(this);
var todo=$(this).hasClass('wpcs_is_parked') ? 'removeFromList':'addToList';
var vehicle_id=$(this).attr('data-vehicle-id');
var spinner=$('.wpcs_icon_spinner', btn);
spinner.css('display', 'inline-block');
$.ajax({
method: 'POST',
url: wpcs_ajax_url,
data: { action: 'wpcs_park', todo: todo, vehicle_id: vehicle_id },
success: function(data){
spinner.hide();
if(!data.error){
btn.toggleClass('wpcs_is_parked');
that.vehicles_list_html=data.list;
that.vehicle_count=data.count;
that._setList();
}}
});
});
}
this._setList=function(){
if(that.vehicles_list_html!==null){
$('#wpcs_vehicle_parked .vehicles_wrapper').html(that.vehicles_list_html);
}
that._setButtonState();
that._refreshCounter();
that._initList();
}
this._refreshCounter=function(){
let element=$('.wpcs_count_vehicles_parked');
element.html(that.vehicle_count);
element.each(function(){
this.classList.remove("wpcs_animated");
this.offsetWidth;
this.classList.add('wpcs_animated');
});
}
this._setButtonState=function(){
if($('#wpcs_vehicle_parked').length < 1) return;
$('.wpcs_park_toggle_btn').each(function(){
$(this).removeClass('wpcs_is_parked');
});
$('#wpcs_vehicle_parked .vehicle').each(function(){
let id=$(this).data('vehicle-id');
$('.wpcs_park_toggle_btn[data-vehicle-id=' + id + ']').addClass('wpcs_is_parked');
});
}
this._removeFromList=function(vehicle_id){
$('#wpcs_vehicle_parked .vehicle[data-vehicle-id=' + vehicle_id + ']').remove();
}
this.__construct();
}
function WPCSLightbox(){
var that=this;
this.gallery=$('#wpcs_vehicle_images_wrapper');
this.current=0;
this.lightbox=null;
this.__construct=function(){
if($('#wpcs_vehicle_images_wrapper.wpcs_lightbox_enabled').length < 1) return;
$('#wpcs_vehicle_single_image_wrapper a.lightbox_opener').click(function(e){
e.preventDefault();
e.stopPropagation();
that._open($('#wpcs_vehicle_single_image').attr('src'));
});
};
this._create=function(){
var html='';
html +='<div id="wpcs_lightbox">';
html +='<div class="close"><span class="wpcs_icon dashicons dashicons-no-alt"></span></div>';
html +='<div class="image_wrapper">';
html +='<div class="arrow arrow_left"><span class="wpcs_icon dashicons dashicons-arrow-left-alt2"></span></div>';
html +='<img id="wpcs_lightbox_image" alt="' + wpcs_lightbox_alt + '" src="" />';
html +='<div class="arrow arrow_right"><span class="wpcs_icon dashicons dashicons-arrow-right-alt2"></span></div>';
html +='</div>';
html +='</div>';
this.lightbox=$(html);
$('body').prepend(this.lightbox);
$('.arrow_right', this.lightbox).click(function(){ that._next(); });
$('.arrow_left', this.lightbox).click(function(){ that._prev(); });
$('.close', this.lightbox).click(function(){ that._close(); });
};
this._next=function(){
this.current++;
if(this.current > wpcs_lightbox_sources.length - 1) this.current=0;
this._change(wpcs_lightbox_sources[this.current]);
};
this._prev=function(){
this.current--;
if(this.current < 0) this.current=wpcs_lightbox_sources.length - 1;
this._change(wpcs_lightbox_sources[this.current]);
};
this._change=function(src){
$('#wpcs_lightbox_image', this.lightbox).attr('src', src);
};
this._open=function(src){
if(this.lightbox==null) this._create();
this._change(src);
this.lightbox.fadeIn();
};
this._close=function(){
this.lightbox.fadeOut();
};
if(this.gallery.length > 0)
this.__construct();
}
function wpcsInitLightbox(){
var overlay=null;
var lbImg, lbClose, lbPrev, lbNext, lbCounter;
var currentImgs=[];
var lbIndex=0;
var syncGallery=false;
function ensureOverlay(){
if(document.getElementById('wpcs-lightbox')){
overlay=document.getElementById('wpcs-lightbox');
}else{
overlay=document.createElement('div');
overlay.id='wpcs-lightbox';
overlay.className='wpcs-lightbox';
overlay.innerHTML =
'<div class="wpcs-lightbox__inner">' +
'<button class="wpcs-lightbox__close" aria-label="Schließen">✕</button>' +
'<img class="wpcs-lightbox__img" src="" alt="">' +
'<button class="wpcs-lightbox__nav wpcs-lightbox__nav--prev" aria-label="Vorheriges Bild">' +
'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="15 18 9 12 15 6"/></svg>' +
'</button>' +
'<button class="wpcs-lightbox__nav wpcs-lightbox__nav--next" aria-label="Nächstes Bild">' +
'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="9 18 15 12 9 6"/></svg>' +
'</button>' +
'<div class="wpcs-lightbox__counter">1 / 1</div>' +
'</div>';
document.body.appendChild(overlay);
}
lbImg=overlay.querySelector('.wpcs-lightbox__img');
lbClose=overlay.querySelector('.wpcs-lightbox__close');
lbPrev=overlay.querySelector('.wpcs-lightbox__nav--prev');
lbNext=overlay.querySelector('.wpcs-lightbox__nav--next');
lbCounter=overlay.querySelector('.wpcs-lightbox__counter');
}
function updateImg(){
if(!currentImgs.length) return;
var el=currentImgs[lbIndex];
lbImg.setAttribute('src', el.dataset.lightboxSrc||el.getAttribute('src'));
if(lbCounter) lbCounter.textContent=(lbIndex + 1) + ' / ' + currentImgs.length;
}
function openLightbox(imgs, index, sync){
ensureOverlay();
currentImgs=imgs;
lbIndex=index||0;
syncGallery = !!sync;
updateImg();
overlay.classList.add('open');
document.body.style.overflow='hidden';
lbClose.onclick=closeLightbox;
lbPrev.onclick=function(){ goTo(lbIndex - 1); };
lbNext.onclick=function(){ goTo(lbIndex + 1); };
overlay.onclick=function(e){ if(e.target===overlay) closeLightbox(); };}
function closeLightbox(){
if(overlay) overlay.classList.remove('open');
document.body.style.overflow='';
}
function goTo(index){
lbIndex=(index + currentImgs.length) % currentImgs.length;
updateImg();
if(syncGallery&&window._wpcsGallery) window._wpcsGallery.goTo(lbIndex);
}
document.addEventListener('click', function(e){
var trigger=e.target.closest('[data-lightbox-source]');
if(!trigger) return;
e.preventDefault();
var imgs=Array.from(document.querySelectorAll(trigger.dataset.lightboxSource));
if(!imgs.length) return;
var sync=trigger.dataset.lightboxSync==='gallery';
var index=sync&&window._wpcsGallery
? window._wpcsGallery.getCurrent()
: parseInt(trigger.dataset.lightboxIndex||'0', 10);
openLightbox(imgs, index, sync);
});
document.addEventListener('keydown', function(e){
if(!overlay||!overlay.classList.contains('open')) return;
if(e.key==='Escape')     closeLightbox();
if(e.key==='ArrowLeft')  goTo(lbIndex - 1);
if(e.key==='ArrowRight') goTo(lbIndex + 1);
});
}
function WPCSCompare(){
var that=this;
var table=null;
this.__construct=function(){
this.table=$('#wpcs_compare_table');
this.vehicle_count=null;
if(this.table.length > 0){
this.initSectionLinks();
this.initRemoveBtn();
}
this._init_compare_buttons();
};
this._init_compare_buttons=function(collection){
$('.wpcs_compare_toggle_btn', collection).click(function(e){
e.preventDefault();
var btn=$(this);
var todo=$(this).hasClass('wpcs_in_comparison') ? 'removeFromList':'addToList';
var vehicle_id=$(this).attr('data-vehicle-id');
var spinner=$('.wpcs_icon_spinner', btn);
spinner.css('display', 'inline-block');
$.ajax({
method: 'POST',
url: wpcs_ajax_url,
data: { action: 'wpcs_compare', todo: todo, vehicle_id: vehicle_id },
success: function(data){
spinner.hide();
if(!data.error){
btn.toggleClass('wpcs_in_comparison');
that.vehicle_count=data.count;
that._refreshCounter();
}}
});
});
}
this._refreshCounter=function(){
let element=$('.wpcs_count_vehicles_compared');
element.html(that.vehicle_count);
element.each(function(){
this.classList.remove("wpcs_animated");
this.offsetWidth;
this.classList.add('wpcs_animated');
});
}
this.initSectionLinks=function(){
$('a.section_link', that.table).click(function(e){
e.preventDefault();
var rel=$(this).attr('rel');
$('tr[rel=' + rel + ']').toggleClass('wpcs_hidden');
$(this).toggleClass('closed');
});
};
this.initRemoveBtn=function(){
$('.wpcs_compare_table_remove_btn').click(function(e){
e.preventDefault();
var vehicle_id=$(this).attr('data-vehicle-id');
var btn=this;
var spinner=$('.wpcs_icon_spinner', btn);
spinner.css('display', 'inline-block');
$.ajax({
method: 'POST',
url: wpcs_ajax_url,
data: { action: 'wpcs_compare', todo: 'removeFromList', vehicle_id: vehicle_id },
success: function(data){
spinner.hide();
if(!data.error){
that._removeFromTable(vehicle_id);
}}
});
});
};
this._setWidth=function(){
var count=this._countCars() + 1;
var percent=100 / count;
$('td', this.table).not('.header').css('width', percent + '%');
};
this._removeFromTable=function(vehicle_id){
jQuery('td[data-vehicle-id=' + vehicle_id + ']', this.table).remove();
var count=this._countCars();
$('td.header', this.table).attr('colspan', count);
if(count==1){
$('#wpcs_vehicle_compare').html('<h3>Keine Fahrzeuge zum Vergleichen ausgewählt.</h3>');
}};
this._countCars=function(){
var cars=$('td.header', this.table).first().attr('colspan') - 1;
return cars;
};
this.__construct();
}
function WPCSOrderbar(){
var that=this;
this.__construct=function(){
this.initOrderBar();
};
this.initOrderBar=function(){
$('.dxim_ff_order_bar a.dxim_set_order').click(function(e){
e.preventDefault();
var orderby=$(this).attr('data-orderby');
var order=$('.dxim_ff_order_bar').attr('data-order');
var new_order=(order=='asc') ? 'desc':'asc';
$('#dxim_orderby_hidden').val(orderby);
$('#dxim_order_hidden').val(new_order);
that.refresh(new_order, orderby);
wpcs_form.submit();
});
};
this.refresh=function(order, orderby){
$('.dxim_ff_order_bar').each(function(){
let bar=$(this);
bar.attr('data-order', order);
$('a.dxim_set_order', bar).each(function(){
var tmp_orderby=$(this).attr('data-orderby');
if(tmp_orderby==orderby) $(this).addClass('current');
else $(this).removeClass('current');
});
});
}
this.__construct();
}
function animateValue(obj, start, end, duration){
let startTimestamp=null;
const step=(timestamp)=> {
if(!startTimestamp) startTimestamp=timestamp;
const progress=Math.min((timestamp - startTimestamp) / duration, 1);
let value=Math.floor(progress * (end - start) + start);
$(obj).attr('data-value', value);
obj.innerHTML=value.toLocaleString('de-DE');
if(progress < 1){
window.requestAnimationFrame(step);
}};
window.requestAnimationFrame(step);
}
function WPCSForm(){
var that=this;
var ajax=false;
this.is_loading=false;
this.isResetting=false;
this.preFilterTimeout=null;
this.scrollTopAfterSubmit=false;
this.keyUpDelay=null;
this.serialize=function(){
that._serializeMultipleCheckbox();
let formdata=$('.dxim_filter :input').serialize();
return formdata;
}
this.__construct=function(){
if($('#wpcs_vehicle_archive[data-ajax="1"]').length > 0) this.ajax=1;
this.initWpcsSelect();
this.initCheckboxes();
this.initSlider();
this.initActiveFilters();
this.initRange();
this.initSubmit();
this.initColorSelect();
this.initPagination();
this.initMultipleCheckbox();
this.initTextField();
this.initLayoutSelector();
$(document).on('wpcs_ajax_form_submitted', this.scrollTop);
$(document).on('wpcs_reset_all_filters', function(){ that.resetAllFilters(); });
$(document).on('click', '.wpcs_reset_all_filters_btn', function(e){ e.preventDefault(); that.resetAllFilters(); });
};
this.scrollTop=function(){
if(!that.scrollTopAfterSubmit) return;
$([document.documentElement, document.body]).animate({
scrollTop: $(".wpcs_vehicles").offset().top
}, 1000);
that.scrollTopAfterSubmit=false;
}
this._serializeMultipleCheckbox=function(){
$('.wpcs_multiple_checkbox').each(function(){
let wrapper=this;
let hidden=$('.wpcs_element_value', wrapper);
let valueStr='';
$('.wpcs_selectable.selected', wrapper).each(function(z){
if(z!=0) valueStr +=',';
valueStr +=$(this).data('value');
});
hidden.val(valueStr);
});
}
this.resetMultipleCheckbox=function(filter){
$('.wpcs_multiple_checkbox[data-filter="' + filter + '"] .wpcs_selectable.selected').removeClass('selected');
}
this.initMultipleCheckbox=function(){
$('.wpcs_multiple_checkbox').each(function(){
let wrapper=this;
$('.wpcs_selectable', wrapper).click(function(){
$(this).toggleClass('selected');
that._preFilterAmount();
});
});
}
this.initRange=function(){
if(typeof noUiSlider==='undefined') return;
$('.dxim_filter_range').each(function(){
var slider_timeout=null;
let slider_wrapper=$(this);
let key=slider_wrapper.data('key');
let filter_1=slider_wrapper.data('filter-1');
let filter_2=slider_wrapper.data('filter-2');
let start_val=slider_wrapper.data('start');
let step=slider_wrapper.data('step');
let end_val=slider_wrapper.data('end');
let slider=document.getElementById('wpcs_fs_' + key);
let range=wpcs_slider_ranges[key];
let unit=slider_wrapper.data('unit');
let label=slider_wrapper.data('label');
let formatting=parseInt(slider_wrapper.data('formatting'));
let input_1=jQuery('#wpcs_fv_' + filter_1);
let label_1=jQuery('#wpcs_fl_' + filter_1);
let input_2=jQuery('#wpcs_fv_' + filter_2);
let label_2=jQuery('#wpcs_fl_' + filter_2);
let min_input=jQuery('.min_input', slider_wrapper);
let max_input=jQuery('.max_input', slider_wrapper);
noUiSlider.create(slider, {
start: [start_val, end_val],
format: {
to: function(value){ return Math.round(value); },
from: function(value){ return Math.round(value); }},
step: step,
connect: true,
range: range
});
slider.noUiSlider.on('update', function(values){
let val_min=values[0];
let val_max=values[1];
let html_min=val_min;
let html_max=val_max;
min_input.val(val_min);
max_input.val(val_max);
if(val_min==range.min&&val_max==range.max){
val_min=val_max='#';
html_min=range.min;
html_max=range.max;
}
if(val_min=='#'&&val_max=='#') slider_wrapper.addClass('inactive');
else slider_wrapper.removeClass('inactive');
input_1.val(val_min);
input_2.val(val_max);
if(formatting > 0){
html_min=html_min.toLocaleString('de-DE');
html_max=html_max.toLocaleString('de-DE');
}
label_1.html(html_min + " " + unit);
label_2.html(html_max + " " + unit);
});
slider.noUiSlider.on('set', function(){
that._preFilterAmount();
});
$('.min_input, .max_input', slider_wrapper).focus(function(){
$(this).data('current-value', $(this).val());
$(this).val("");
});
$('.min_input, .max_input', slider_wrapper).focusout(function(){
let val=$(this).val();
if(val==="") $(this).val($(this).data('current-value'));
slider.noUiSlider.set([min_input.val(), max_input.val()]);
});
$('.noUi-handle-upper', slider_wrapper).attr('aria-label', label + " größter Wert");
$('.noUi-handle-lower', slider_wrapper).attr('aria-label', label + " kleinster Wert");
});
};
this.initSlider=function(){
if(typeof noUiSlider==='undefined') return;
$('.dxim_filter_slider').each(function(){
let slider_timeout=null;
let slider_wrapper=$(this);
let key=slider_wrapper.attr('data-key');
let start_val=slider_wrapper.attr('data-start');
let default_value=slider_wrapper.data('default');
let unit=slider_wrapper.data('unit');
let formatting=parseInt(slider_wrapper.data('formatting'));
let step=slider_wrapper.data('step');
let label=slider_wrapper.data('label');
let slider=document.getElementById('wpcs_fs_' + key);
let range=wpcs_slider_ranges[key];
let input=jQuery('#wpcs_fv_' + key);
let label_current=jQuery('#wpcs_fl_' + key + '_current');
let input_label=jQuery('.input_label', slider_wrapper);
noUiSlider.create(slider, {
start: [start_val],
connect: 'lower',
range: range,
step: step,
});
slider.noUiSlider.on('update', function(value){
let val=Math.round(value);
let label=val;
input_label.val(val);
if(value==default_value){
val='#';
label=default_value;
}
if(formatting > 0){
label=label.toLocaleString('de-DE');
}
input.val(val);
label_current.html(label + " " + unit);
});
slider.noUiSlider.on('set', function(value){
that._preFilterAmount();
});
$('.input_label', slider_wrapper).focus(function(){
$(this).data('current-value', $(this).val());
$(this).val("");
});
$('.input_label', slider_wrapper).focusout(function(){
let val=$(this).val();
if(val===""){
$(this).val($(this).data('current-value'));
val=$(this).val();
}
slider.noUiSlider.set(val);
});
$('.noUi-handle-lower', slider_wrapper).attr('aria-label', "setze Wert für " + label);
});
};
this.initColorSelect=function(){
$('.wpcs_color_select').each(function(){
let c=this;
$('.color', c)
.click(function(){
let i=0;
let values=[]
$(this).toggleClass('active');
$('.color', c).each(function(){
if($(this).hasClass('active')){
values[i]=$(this).data('key');
i++;
}});
$('.color_value', c).val(values.join(","));
that._preFilterAmount();
})
.keydown(function(e){
if(e.key==="Enter"||e.key===" "){
$(this).trigger('click');
}});
});
}
this.initTextField=function(){
$('.dxim_filter input[type=text]').keyup(function(){
if(that.keyUpDelay!==null) window.clearTimeout(that.keyUpDelay);
that.keyUpDelay=window.setTimeout(function(){
that._preFilterAmount();
}, 800);
});
}
this.initLayoutSelector=function(){
$('#wpcs_archive_layout_selector .button')
.click(function(){
$('#wpcs_archive_layout_selector .button').removeClass('active');
let mode=$(this).data('type');
$('#wpcs_archive_layout_selector input').val(mode);
vehicle_list_properties.layout=mode;
$(this).addClass('active');
that.submit();
})
.keydown(function(e){
if(e.key==="Enter"||e.key===" ") $(this).trigger('click');
});
}
this.initPagination=function(){
$('.wpcs-pagination a[data-wpcsp]').off('click.wpcs-pagination').on('click.wpcs-pagination', function(e){
if($('#wpcs_hidden_wpcsp').length===0) return;
e.preventDefault();
let wpcsp=$(this).data('wpcsp');
$('#wpcs_hidden_wpcsp').val(wpcsp);
that.scrollTopAfterSubmit=true;
that.submit();
});
}
this.initWpcsSelect=function(){
$('.wpcsselect', '.dxim_filter').each(function(){
let select=$(this);
let field=select.data('field');
let dxim_filter=$('.dxim_filter[data-filter-name="' + field + '"]');
let load=dxim_filter.data('load');
let values=dxim_filter.data('values');
if(select.hasClass('dxim_order_select')){
select.wpcsselect({
onSelect: function(){
let val=$('.wpcs_select_value', select).val();
$('#dxim_order_hidden').val(val);
if(that.ajax) that._preFilterAmount();
}});
}else if(select.hasClass('dxim_orderby_select')){
select.wpcsselect({
onSelect: function(){
let val=$('.wpcs_select_value', select).val();
$('#dxim_orderby_hidden').val(val);
if(that.ajax) that._preFilterAmount();
}});
}else{
select.wpcsselect({
ajax: {
url: wpcs_ajax_url,
dataType: 'json',
method: 'POST',
data: function(){
var query={
action: 'getData',
field: field,
load: load,
values: values,
init_ajax_data: 1,
filterFormData: that.serialize(),
};
return query;
},
},
onSelect: function(){
if(field==="make"){
that.resetSelect("model");
}
if(that.preFilterTimeout!==null) window.clearTimeout(that.preFilterTimeout);
that.preFilterTimeout=window.setTimeout(that._preFilterAmount, 800);
}});
}});
};
this.initActiveFilters=function(){
$('.wpcs_filterform_active_filters .active_filter').each(function(){
let filter=this;
let key=$(filter).data('key');
let type=$(filter).data('type');
$('.reset', filter)
.click(function(){
if(type=="select"){
that.resetSelect(key);
that._resetPageNr();
that.submit();
}
if(type=="checkbox"){
that.resetCheckbox(key);
that._resetPageNr();
that.submit();
}
if(type=="multiple_checkbox"){
that.resetMultipleCheckbox(key);
that._resetPageNr();
that.submit();
}
if(type=="text"){
that.resetText(key);
that._resetPageNr();
that.submit();
}
if(type=="slider"){
that.resetSlider(key);
that._resetPageNr();
that.submit();
}
if(type=="color"){
that.resetColor(key);
that._resetPageNr();
that.submit();
}
if(type=="custom"){ $(document).trigger("wpcs_ajax_remove_filter", [key]); }
filter.remove();
})
.keydown(function(e){
if(e.key==="Enter"||e.key===" ") $(this).trigger('click');
});
});
}
this.initCheckboxes=function(){
$('.dxim_filter input[type=checkbox]').click(function(){
that._preFilterAmount();
});
};
this._preFilterAmount=function(){
if(that.isResetting) return;
that._resetPageNr();
if(that.ajax){
that.submitAjax();
}else{
$.ajax({
method: 'POST',
url: wpcs_ajax_url,
data: { action: 'getPreFilteredAmount', filterFormData: that.serialize(), init_ajax_data: 1 },
success: function(data){
that._refreshCounterValues(data);
}});
}};
this._refreshCounterValues=function(data){
let old_val=Math.round($('.wpcs_search_count').eq(0).attr('data-value'));
$('.wpcs_search_count').each(function(){
animateValue(this, old_val, data, 500);
});
}
this.initSubmit=function(){
$('.dxim_filter_form_submit').click(function(e){
e.preventDefault();
let target=$('#wpcs_vehicle_archive');
let redirect_url=$(this).attr('data-redirect');
let url='';
if(redirect_url!=undefined&&redirect_url!=""){
url=redirect_url;
that.ajax=false;
}else{
if(target.length < 1) url=wpcs_archive_url;
else url=wpcs_current_url;
}
that.submit(url);
});
};
this.submit=function(force_url){
if(that.ajax){
that.submitAjax();
return;
}
let url='';
if(!force_url){
let target=$('#wpcs_vehicle_archive');
if(target.length < 1) url=wpcs_archive_url;
else url=wpcs_current_url;
} else url=force_url;
let data=that.serialize();
url +="?" + data;
url +='#wpcs_vehicles';
window.location.href=url;
}
this._resetPageNr=function(){
$('#wpcs_hidden_wpcsp').val(1);
}
this.submitAjax=function(append=0){
vehicle_list_properties.append=append;
that.setLoadingState();
$.ajax({
method: 'POST',
url: wpcs_ajax_url,
data: { action: 'wpcs_fetchResults', filterFormData: that.serialize(), init_ajax_data: 1, vehicle_list_data: vehicle_list_properties },
success: function(json){
let new_vehicles=$(json.vehicle_list_html);
if(append > 0){
$('#wpcs_vehicle_archive .wpcs_vehicles_wrapper').append(new_vehicles);
}else{
$('#wpcs_vehicle_archive').replaceWith(new_vehicles);
$('#wpcs_hidden_wpcsp').val(1);
if(json.max_pages!==undefined) vehicle_list_properties.max_pages=json.max_pages;
$('.wpcs-pagination, .dxim_pagination').replaceWith(json.pagination);
that.initPagination();
$('.wpcs_filterform_active_filters').replaceWith(json.active_filters);
that.initActiveFilters();
that._refreshCounterValues(json.count);
}
that.hideLoadingState();
wpcs_compare._init_compare_buttons(new_vehicles);
wpcs_park._initToggleButtons(new_vehicles);
$(document).trigger("wpcs_ajax_form_submitted");
}});
}
this.setLoadingState=function(){
this.is_loading=true;
$('.wpcs_ajax_loader[data-category=sync]').addClass('active');
}
this.hideLoadingState=function(){
this.is_loading=false;
$('.wpcs_ajax_loader[data-category=sync]').removeClass('active');
}
this.resetSelect=function(key){
let obj=$('.wpcsselect[data-field=' + key + ']');
if(obj.length < 1) return;
$('.wpcs_select_handle', obj).html(obj.data('nothing-selected'));
$('.wpcs_select_value', obj).val('');
}
this.resetCheckbox=function(key){
let input=$('input[name=' + key + ']');
input.prop('checked', false);
}
this.resetText=function(key){
$('input[name=' + key + ']').val('');
}
this.resetSlider=function(key){
let $modernWrapper=$(
'.wpcs-range-wrapper[data-key="' + key + '"], ' +
'.wpcs-range-wrapper[data-filter-1="' + key + '"], ' +
'.wpcs-range-wrapper[data-filter-2="' + key + '"]'
);
if($modernWrapper.length){
$modernWrapper.each(function(){
let wrapper=this;
let minInput=wrapper.querySelector('.wpcs-range-min');
let maxInput=wrapper.querySelector('.wpcs-range-max');
let numMin=wrapper.querySelector('.wpcs-range-number-min');
let numMax=wrapper.querySelector('.wpcs-range-number-max');
let rangeMin=parseInt(wrapper.getAttribute('data-min'));
let rangeMax=parseInt(wrapper.getAttribute('data-max'));
if(minInput&&maxInput){
minInput.value=minInput.min;
maxInput.value=maxInput.max;
}else if(minInput){
let wKey=wrapper.getAttribute('data-key')||'';
minInput.value=wKey.indexOf('_max')!==-1 ? minInput.max:minInput.min;
}
if(numMin) numMin.value=rangeMin;
if(numMax) numMax.value=rangeMax;
['input', 'change'].forEach(function(evt){
if(minInput) minInput.dispatchEvent(new Event(evt, {bubbles: true}));
if(maxInput) maxInput.dispatchEvent(new Event(evt, {bubbles: true}));
});
});
return;
}
if(typeof noUiSlider==='undefined') return;
let obj=$('#wpcs_fs_' + key);
if(obj.length < 1){
let key2=key.replace('_max', '').replace('_min', '');
let obj2=$('#wpcs_fs_' + key2);
if(obj2.length < 1) return;
const slider=obj2[0].noUiSlider;
if(!slider) return;
if(window.wpcs_slider_ranges&&window.wpcs_slider_ranges[key2]){
const { min, max }=window.wpcs_slider_ranges[key2];
slider.set([min, max]);
}
return;
}
const slider=obj[0].noUiSlider;
if(!slider) return;
const range=window.wpcs_slider_ranges[key];
if(!range) return;
let value=key.endsWith('_min') ? range.min:range.max;
slider.set(value);
};
this.resetColor=function(key){
let obj=$('.dxim_filter[data-filter-name=' + key + '] .wpcs_color_select');
$('.color_value', obj).val('');
$('.color.active', obj).removeClass('active');
}
this.resetAllFilters=function(){
that.isResetting=true;
$('.dxim_filter[data-filter-name]').each(function(){
let wrapper=$(this);
let key=wrapper.attr('data-filter-name');
let type=wrapper.attr('data-filter-type');
if(type==='select'){
that.resetSelect(key);
}else if(type==='checkbox'){
that.resetCheckbox(key);
}else if(type==='multiple_checkbox'){
that.resetMultipleCheckbox(key);
}else if(type==='text'){
that.resetText(key);
}else if(type==='color'){
wrapper.find('.color_value').val('');
wrapper.find('.color.active').removeClass('active');
}else if(type==='slider'){
that.resetSlider(key);
}else if(type==='range'){
let rangeEl=wrapper.find('.dxim_filter_range');
let filter1=rangeEl.attr('data-filter-1');
let filter2=rangeEl.attr('data-filter-2');
if(filter1) $('#wpcs_fv_' + filter1).val('#');
if(filter2) $('#wpcs_fv_' + filter2).val('#');
that.resetSlider(key + '_min');
}});
that.isResetting=false;
that._resetPageNr();
that.submit();
};
this.setSelect=function(key, value, filterFormData){
let obj=$('.dxim_filter[data-filter-name=' + key + '] .wpcsselect');
if(obj.length < 1) return;
if(!value){ that.resetSelect(key); return; }
$('.wpcs_select_value', obj).val(value);
$('.wpcs_select_delete', obj).show();
$('.wpcs_select_handle', obj).text(value);
$.ajax({
method: 'POST',
url: wpcs_ajax_url,
dataType: 'json',
data: { action: 'getData', field: key, load: 'all', filterFormData: filterFormData||'' }}).done(function(data){
let selectedValues=value.split(',');
let labels=[];
for (let index in data){
if(selectedValues.indexOf(String(data[index]['id']))!==-1){
labels.push(data[index]['text']);
}}
if($('.wpcs_select_value', obj).val()!==value) return;
let handleText;
if(labels.length===0) handleText=value;
else if(labels.length===1) handleText=labels[0];
else                          handleText=labels.length + ' ausgewählt';
$('.wpcs_select_handle', obj).html(handleText);
});
};
this.setCheckbox=function(key, value){
$('input[name=' + key + ']', '.dxim_filter').prop('checked', value==='1'||value==='on');
};
this.setText=function(key, value){
$('input[name=' + key + ']', '.dxim_filter').val(value);
};
this.setMultipleCheckbox=function(key, value){
let wrapper=$('.dxim_filter[data-filter-name=' + key + ']');
let vals=value ? value.split(','):[];
wrapper.find('.wpcs_element_value').val(value);
wrapper.find('.wpcs_selectable').each(function(){
$(this).toggleClass('selected', vals.indexOf(String($(this).data('value')))!==-1);
});
};
this.setColor=function(key, value){
let obj=$('.dxim_filter[data-filter-name=' + key + '] .wpcs_color_select');
let vals=value ? value.split(','):[];
$('.color_value', obj).val(value);
$('.color', obj).each(function(){
$(this).toggleClass('active', vals.indexOf(String($(this).data('key')))!==-1);
});
};
this.setSlider=function(key, value){
let el=document.getElementById('wpcs_fs_' + key);
if(!el||!el.noUiSlider) return;
el.noUiSlider.set(parseFloat(value));
};
this.setRange=function(key, minValue, maxValue){
let el=document.getElementById('wpcs_fs_' + key);
if(!el||!el.noUiSlider) return;
let cur=el.noUiSlider.get();
let newMin=(minValue!==null&&minValue!==undefined) ? parseFloat(minValue):parseFloat(cur[0]);
let newMax=(maxValue!==null&&maxValue!==undefined) ? parseFloat(maxValue):parseFloat(cur[1]);
el.noUiSlider.set([newMin, newMax]);
};
this.applyFilterset=function(params){
that.isResetting=true;
$('.dxim_filter[data-filter-name]').each(function(){
let key=$(this).attr('data-filter-name');
let type=$(this).attr('data-filter-type');
if(type==='select')            that.resetSelect(key);
else if(type==='checkbox')          that.resetCheckbox(key);
else if(type==='multiple_checkbox') that.resetMultipleCheckbox(key);
else if(type==='text')              that.resetText(key);
else if(type==='color')             that.resetColor(key);
else if(type==='slider')            that.resetSlider(key);
else if(type==='range')             that.resetSlider(key + '_min');
});
that._resetPageNr();
let rangeHandled={};
$('.dxim_filter[data-filter-type="range"]').each(function(){
let key=$(this).attr('data-filter-name');
let rangeEl=$(this).find('.dxim_filter_range');
let f1=rangeEl.attr('data-filter-1');
let f2=rangeEl.attr('data-filter-2');
if(params[f1]===undefined&&params[f2]===undefined) return;
that.setRange(key,
params[f1]!==undefined ? params[f1]:null,
params[f2]!==undefined ? params[f2]:null
);
if(f1) rangeHandled[f1]=true;
if(f2) rangeHandled[f2]=true;
});
let paramsFormData=Object.keys(params).map(function(k){
return encodeURIComponent(k) + '=' + encodeURIComponent(params[k]);
}).join('&');
$.each(params, function(key, value){
if(rangeHandled[key]) return;
let w=$('.dxim_filter[data-filter-name="' + key + '"]');
if(w.length===0) return;
let type=w.attr('data-filter-type');
if(type==='select')            that.setSelect(key, value, paramsFormData);
else if(type==='checkbox')          that.setCheckbox(key, value);
else if(type==='text')              that.setText(key, value);
else if(type==='multiple_checkbox') that.setMultipleCheckbox(key, value);
else if(type==='color')             that.setColor(key, value);
else if(type==='slider')            that.setSlider(key, value);
});
that.isResetting=false;
that.submitAjax();
};
this.__construct();
}
function WPCSContactForm(){
var that=this;
this.form=null;
this.spinner=null;
this.__construct=function(){
$('.wpcs_contact_form').each(function(){
let form=this;
that._initSubmit(form);
that._initConditionalFields(form);
that._initTimeSelects(form);
that._initDateValidation(form);
});
};
this._setForm=function(form){
this.form=$(form);
this.spinner=$('.wpcs_form_submit .wpcs_icon_spin', form);
}
this._initSubmit=function(form){
$('.wpcs_form_submit', form).click(function(e){
e.preventDefault();
that._setForm(form);
if($(this).hasClass('ga')){
grecaptcha.execute(wpcs_ga_public_key, { action: "submit" }).then(function(token){
that.sendForm(token);
});
}else{
that.sendForm();
}});
}
this.sendForm=function(token){
this.spinner.css('display', 'inline-block');
let redirect=$(this.form).data('redirect');
var $hiddenInputs=$('.wpcs_conditional_field.wpcs_hidden input, .wpcs_conditional_field.wpcs_hidden select, .wpcs_conditional_field.wpcs_hidden textarea', this.form);
$hiddenInputs.prop('disabled', true);
var formData=that.form.serialize();
$hiddenInputs.prop('disabled', false);
$.ajax({
method: 'POST',
url: wpcs_ajax_url,
data: { action: 'wpcs_contactform', post: formData, token: token },
success: function(data){
that.spinner.hide();
that.unhighlightFormFields();
if(data.status===-1) that.highlightFormFields(data);
else {
that.form.parent().html(data.msg);
if(redirect!="") window.location.href=redirect;
}}
});
};
this.unhighlightFormFields=function(){
$('label', this.form).removeClass('required');
$('.wpcs-error-msg', this.form).hide();
};
this.highlightFormFields=function(data){
$('.wpcs-error-msg', this.form).fadeIn();
$(data.error).each(function(){
$('label[rel=' + this + ']', this.form).addClass('required');
});
};
this._initConditionalFields=function(form){
var $form=$(form);
var groups=$('.wpcs_conditional_group', $form);
var conditionalFields=$('.wpcs_conditional_field', $form);
if(groups.length < 1&&conditionalFields.length < 1) return;
var checkConditions=function(){
groups.each(function(){
var $group=$(this);
var condField=$group.data('condition-field');
var condValue=$group.data('condition-value');
var checked=$('input[name="' + condField + '[]"][value="' + condValue + '"]', $form).is(':checked');
if(checked) $group.removeClass('wpcs_hidden');
else $group.addClass('wpcs_hidden');
});
conditionalFields.each(function(){
var $field=$(this);
var conditions=$field.data('conditions');
if(!conditions||!Array.isArray(conditions)) return;
var isVisible=false;
for (var i=0; i < conditions.length; i++){
var cond=conditions[i];
var triggerField=cond.field;
var triggerValue=cond.value;
var checkboxChecked=$('input[name="' + triggerField + '[]"][value="' + triggerValue + '"]', $form).is(':checked');
var selectValue=$('select[name="' + triggerField + '"]', $form).val();
var selectMatches=selectValue===triggerValue;
var hiddenValue=$('input[type="hidden"][name="' + triggerField + '"]', $form).val();
var hiddenMatches=hiddenValue===triggerValue;
if(checkboxChecked||selectMatches||hiddenMatches){
isVisible=true;
break;
}}
if(isVisible){
$field.removeClass('wpcs_hidden');
}else{
$field.addClass('wpcs_hidden');
}});
};
$form.on('change', 'input[type="checkbox"], input[type="hidden"], select', checkConditions);
checkConditions();
};
this._initTimeSelects=function(form){
var $form=$(form);
$('.wpcs_time_picker', $form).each(function(){
var $picker=$(this);
var $input=$('.wpcs_time_input', $picker);
var $hiddenField=$('.wpcs_time_value', $picker);
var $dropdown=$('.wpcs_time_dropdown', $picker);
var $hoursList=$('.wpcs_time_hours', $picker);
var $minutesList=$('.wpcs_time_minutes', $picker);
var selectedHour=null;
var selectedMinute=null;
$input.on('click', function(e){
e.preventDefault();
e.stopPropagation();
$('.wpcs_time_picker').not($picker).removeClass('wpcs_open');
$picker.toggleClass('wpcs_open');
});
$dropdown.on('click', function(e){
e.stopPropagation();
});
$('.wpcs_time_option', $hoursList).on('click', function(e){
e.stopPropagation();
selectedHour=$(this).data('value');
$('.wpcs_time_option', $hoursList).removeClass('wpcs_active');
$(this).addClass('wpcs_active');
updateDisplay();
});
$('.wpcs_time_option', $minutesList).on('click', function(e){
e.stopPropagation();
selectedMinute=$(this).data('value');
$('.wpcs_time_option', $minutesList).removeClass('wpcs_active');
$(this).addClass('wpcs_active');
updateDisplay();
});
var updateDisplay=function(){
var displayHour=selectedHour!==null ? selectedHour:'--';
var displayMinute=selectedMinute!==null ? selectedMinute:'--';
$input.val(displayHour + ':' + displayMinute);
if(selectedHour!==null&&selectedMinute!==null){
$hiddenField.val(selectedHour + ':' + selectedMinute);
}else{
$hiddenField.val('');
}};});
$(document).off('click.timepicker').on('click.timepicker', function(e){
if(!$(e.target).closest('.wpcs_time_picker').length){
$('.wpcs_time_picker').removeClass('wpcs_open');
}});
};
this._initDateValidation=function(form){
var $form=$(form);
$('input[type="date"]', $form).on('change', function(){
var $input=$(this);
var value=$input.val();
var min=$input.attr('min');
var max=$input.attr('max');
if(!value) return;
if(min&&value < min){
$input.val(min);
}
if(max&&value > max){
$input.val(max);
}});
};
this.__construct();
}
function add_body_classes(){
if(typeof wpcs_screen_width_mobile=="undefined"||typeof wpcs_screen_width_tablet=="undefined") return;
let w=$(this).width();
if(w <=wpcs_screen_width_mobile) $('body').addClass('wpcs_mobile').removeClass('wpcs_tablet').removeClass('wpcs_desktop');
else if(w <=wpcs_screen_width_tablet) $('body').removeClass('wpcs_mobile').addClass('wpcs_tablet').removeClass('wpcs_desktop');
else $('body').removeClass('wpcs_mobile').removeClass('wpcs_tablet').addClass('wpcs_desktop');
}
$(window).resize(function(){
add_body_classes();
});
function WPCSScroller(scroller){
var that=this;
this.scroller=scroller;
this.__construct=function(){
$(this.scroller).on('scroll', that.updateClasses);
$(window).on('resize', that.updateClasses);
this.updateClasses();
}
this.updateClasses=function(){
if(that.scroller.scrollLeft > 0){
that.scroller.classList.add('can_scroll_left');
}else{
that.scroller.classList.remove('can_scroll_left');
}
if(that.scroller.scrollLeft < that.scroller.scrollWidth - that.scroller.clientWidth){
that.scroller.classList.add('can_scroll_right');
}else{
that.scroller.classList.remove('can_scroll_right');
}}
this.__construct();
}
function WPCSSticky(sticky){
var that=this;
this.sticky=$(sticky);
this.width;
this.offsetStart;
this.offsetStop;
this.initialTop;
this.stickyStartObj;
this.stickyStopObj;
this.__construct=function(){
this.stickyStartObj=$(this.sticky.data('sticky-start'));
this.stickyStopObj=$(this.sticky.data('sticky-stop'));
this.offsetStart=parseInt(this.sticky.data('sticky-start-offset'))||0;
this.offsetStop=parseInt(this.sticky.data('sticky-stop-offset'))||0;
$(window).on('scroll', function(){ that.update(); });
$(window).on('resize', function(){ that.update(); });
this.update();
}
this.update=function(){
if($(window).width() < 1024){
that.setSticky(false);
return;
}
let stickyStart=this.stickyStartObj.length ? this.stickyStartObj.position().top + this.stickyStartObj.outerHeight():0;
if(!this.sticky.hasClass('isSticky')) this.initialTop=this.sticky.offset().top;
let position=this.initialTop;
var scrollTop=$(window).scrollTop();
let isSticky=false;
let top=0;
if((scrollTop + stickyStart >=position)){
top=stickyStart + this.offsetStart;
isSticky=true;
}
if(isSticky&&this.stickyStopObj.length > 0){
let check=this.sticky.outerHeight() + top + this.offsetStop;
if((this.stickyStopObj.offset().top - scrollTop <=check)){
isSticky=false;
}}
if(isSticky) this.setSticky(true, top);
else this.setSticky(false)
}
this.setSticky=function(sticky, top=0){
if(sticky){
this.sticky.css({
position: 'fixed',
top: top + 'px',
width: that.calcWidth() + 'px',
}).addClass('isSticky');
}else{
this.sticky.css({
position: 'initial',
top: 'initial',
width: 'auto',
}).removeClass('isSticky');
}}
this.calcWidth=function(){
this.sticky.css({
position: 'initial',
width: 'auto'
});
return this.sticky.width();
}
this.__construct();
}
function WPCSFilterSet(){
$(document).on('click', '.wpcs-filterset-btn', function (e){
var $btn=$(this);
var isActive=$btn.hasClass('wpcs-filterset-active');
if(!(wpcs_form&&wpcs_form.ajax)){
$('.wpcs-filterset-btn').removeClass('wpcs-filterset-active');
if(!isActive) $btn.addClass('wpcs-filterset-active');
return;
}
e.preventDefault();
if(isActive){
$('.wpcs-filterset-btn').removeClass('wpcs-filterset-active');
wpcs_form.resetAllFilters();
return;
}
$('.wpcs-filterset-btn').removeClass('wpcs-filterset-active');
$btn.addClass('wpcs-filterset-active');
var href=$btn.attr('href')||'';
var qIdx=href.indexOf('?');
var params={};
if(qIdx!==-1){
href.substring(qIdx + 1).split('&').forEach(function (part){
var eq=part.indexOf('=');
if(eq > -1){
var decode=function(s){ return decodeURIComponent(s.replace(/\+/g, '%20')); };
params[decode(part.substring(0, eq))]=decode(part.substring(eq + 1));
}});
}
wpcs_form.applyFilterset(params);
});
}})(jQuery);
(function($){
function wpcsUploadFile(file, fieldKey, $wrapper){
var formData=new FormData();
formData.append('action', 'wpcs_contactform_file_upload');
formData.append('nonce', wpcs_contactform_upload_nonce);
formData.append('file', file);
var $list=$wrapper.find('.wpcs-upload-list');
var $item=$('<li class="wpcs-upload-item">' + $('<span>').text(file.name).html() + ' <span class="wpcs-upload-status">...</span></li>');
$list.append($item);
$.ajax({
url: wpcs_ajax_url,
method: 'POST',
data: formData,
processData: false,
contentType: false,
success: function(resp){
if(resp.success){
$item.find('.wpcs-upload-status').text('✓');
$wrapper.append('<input type="hidden" name="wpcs_uploads[' + fieldKey + '][]" value="' + resp.data.filename + '">');
var $remove=$('<span class="wpcs-upload-remove" style="cursor:pointer;margin-left:8px;color:#c00;" title="Entfernen">✕</span>');
$remove.on('click', function(){
$.post(wpcs_ajax_url, { action: 'wpcs_contactform_file_delete', nonce: wpcs_contactform_upload_nonce, filename: resp.data.filename });
$wrapper.find('input[value="' + resp.data.filename + '"]').remove();
$item.remove();
});
$item.append($remove);
}else{
$item.find('.wpcs-upload-status').text('Fehler: ' + (resp.data&&resp.data.msg ? resp.data.msg:'Upload fehlgeschlagen'));
}},
error: function(){
$item.find('.wpcs-upload-status').text('Upload fehlgeschlagen.');
}});
}
$(document).on('change', '.wpcs-file-input', function(){
var $input=$(this);
var $wrapper=$input.closest('.wpcs-file-upload-wrapper');
var fieldKey=$wrapper.data('field-key');
var maxFiles=parseInt($wrapper.data('max-files'))||5;
var files=this.files;
for (var i=0; i < files.length; i++){
if($wrapper.find('input[type="hidden"]').length >=maxFiles){
alert('Maximale Anzahl Dateien erreicht (' + maxFiles + ').');
break;
}
wpcsUploadFile(files[i], fieldKey, $wrapper);
}
$input.val('');
});
})(jQuery);
var wpcs_image_slideshow=null;
(function ($){
$(function (){
if(typeof $.fn.slick!=='undefined'&&$('#vehicle_single_thumbnails').length > 0){
wpcs_image_slideshow=new WPCSImageSlideshow();
}});
function WPCSImageSlideshow(){
var that=this;
this.slider=null;
this.__construct=function (){
let align=$('#wpcs_vehicle_images_wrapper').data('align');
let vertical=(align=="vertical") ? true:false;
let per_slide=parseInt($('#wpcs_vehicle_images_wrapper').data('per-slide'));
let per_slide_768=per_slide > 3 ? 3:per_slide;
that.slider=jQuery('#vehicle_single_thumbnails').slick({
slidesToShow: per_slide,
vertical: vertical,
prevArrow: '#vehicle_single_images_prev_btn',
nextArrow: '#vehicle_single_images_next_btn',
responsive: [{
breakpoint: 768,
settings: {
arrows: false,
slidesToShow: per_slide_768
}},
{
breakpoint: 480,
settings: {
vertical: false,
arrows: false,
slidesToShow: 1
}}
]
});
that.slider.on('afterChange', function (slick, currentSlide){
let currentIndex=that.slider.slick('slickCurrentSlide');
let dataSrc=jQuery('#vehicle_single_thumbnails .dxim_image_thumbnail[data-slick-index=' + currentIndex + '] > a').attr('data-src');
jQuery('#wpcs_vehicle_single_image').attr('src', dataSrc).attr('data-src', dataSrc);
});
that.slider.on('setPosition', function (){
let w=$('.dxim_image_thumbnail', that.slider).eq(0).width();
let h=Math.round((w / wpcs_image_ratio.w) * wpcs_image_ratio.h);
$('.dxim_image_thumbnail img', that.slider).css({ width: w, height: h });
});
$('#vehicle_single_thumbnails .dxim_image_thumbnail').each(function (){
let wrapper=$(this);
$('a.dxim_image_thumbnail_link', wrapper).click(function (e){
e.preventDefault();
let index=wrapper.data('slick-index');
that.slider.slick('slickGoTo', index);
});
});
};
this.__construct();
}})(jQuery);
(function (){
function initLeasingCalculator(){
if(typeof jQuery==='undefined') return;
var $=jQuery;
$('.wpcs-leasing-calc').each(function(){
if($(this).hasClass('wpcs-leasing-calc--slider')) return;
var calc=this;
var dataEl=calc.querySelector('.wpcs-leasing-calc__data');
var data;
try { data=JSON.parse(dataEl ? dataEl.textContent:'[]'); } catch(e){ return; }
if(!data.length) return;
var $laufzeit=$(calc).find('.wpcs-leasing-select[data-field="laufzeit"]');
var $laufleistung=$(calc).find('.wpcs-leasing-select[data-field="laufleistung"]');
var $sonderzahlung=$(calc).find('.wpcs-leasing-select[data-field="sonderzahlung"]');
var resultEls=calc.querySelectorAll('[data-result]');
function num(v){ return Number(v); }
function unique(field, filters){
return [...new Set(
data.filter(function(r){
return Object.keys(filters).every(function(k){
return num(r[k])===num(filters[k]);
});
}).map(function(r){ return r[field]; })
)].sort(function(a, b){ return a - b; });
}
function labelFor($el, v){
var field=$el.data('field');
if(field==='laufzeit')      return v + ' Monate';
if(field==='sonderzahlung') return v.toLocaleString('de-DE', { minimumFractionDigits: 2, maximumFractionDigits: 2 }) + ' €';
return v.toLocaleString('de-DE') + ' km/Jahr';
}
function buildSelect($el, values){
var current=num($el.find('.wpcs_select_value').val());
var $data=$el.find('.data').empty();
values.forEach(function(v){
$data.append($('<div>').attr('data-value', v).text(labelFor($el, v)));
});
var newVal=values.indexOf(current)!==-1 ? current:values[0];
$el.find('.wpcs_select_value').val(newVal);
$el.find('.wpcs_select_handle').text(labelFor($el, newVal));
}
function format(v){
return v.toLocaleString('de-DE', { minimumFractionDigits: 2, maximumFractionDigits: 2 }) + ' €';
}
function updateResults(){
var laufzeit=num($laufzeit.find('.wpcs_select_value').val());
var laufleistung=num($laufleistung.find('.wpcs_select_value').val());
var sonderzahlung=num($sonderzahlung.find('.wpcs_select_value').val());
var match=data.find(function(r){
return num(r.laufzeit)===laufzeit
&& num(r.laufleistung)===laufleistung
&& num(r.sonderzahlung)===sonderzahlung;
});
resultEls.forEach(function(el){
var field=el.dataset.result;
if(match&&match[field]!==undefined){
el.textContent=el.dataset.format==='percent'
? match[field].toLocaleString('de-DE', { minimumFractionDigits: 2, maximumFractionDigits: 2 }) + ' %'
: format(match[field]);
}else{
el.textContent='–';
}});
}
$laufzeit.wpcsselect({
onSelect: function(){
var lz=num($laufzeit.find('.wpcs_select_value').val());
buildSelect($laufleistung, unique('laufleistung', { laufzeit: lz }));
buildSelect($sonderzahlung, unique('sonderzahlung', {
laufzeit:     lz,
laufleistung: num($laufleistung.find('.wpcs_select_value').val())
}));
updateResults();
}});
$laufleistung.wpcsselect({
onSelect: function(){
buildSelect($sonderzahlung, unique('sonderzahlung', {
laufzeit:     num($laufzeit.find('.wpcs_select_value').val()),
laufleistung: num($laufleistung.find('.wpcs_select_value').val())
}));
updateResults();
}});
$sonderzahlung.wpcsselect({
onSelect: function(){ updateResults(); }});
buildSelect($laufleistung, unique('laufleistung', {
laufzeit: num($laufzeit.find('.wpcs_select_value').val())
}));
buildSelect($sonderzahlung, unique('sonderzahlung', {
laufzeit:     num($laufzeit.find('.wpcs_select_value').val()),
laufleistung: num($laufleistung.find('.wpcs_select_value').val())
}));
updateResults();
});
}
function initFinancingCalculator(){
if(typeof jQuery==='undefined') return;
var $=jQuery;
$('.wpcs-financing-calc').each(function(){
if($(this).hasClass('wpcs-financing-calc--slider')) return;
var calc=this;
var dataEl=calc.querySelector('.wpcs-financing-calc__data');
var data;
try { data=JSON.parse(dataEl ? dataEl.textContent:'[]'); } catch(e){ return; }
if(!data.length) return;
var $laufzeit=$(calc).find('.wpcs-financing-select[data-field="laufzeit"]');
var $anzahlung=$(calc).find('.wpcs-financing-select[data-field="anzahlung"]');
var resultEls=calc.querySelectorAll('[data-result]');
function num(v){ return Number(v); }
function unique(field, filters){
return [...new Set(
data.filter(function(r){
return Object.keys(filters).every(function(k){
return num(r[k])===num(filters[k]);
});
}).map(function(r){ return r[field]; })
)].sort(function(a, b){ return a - b; });
}
function labelFor($el, v){
var field=$el.data('field');
if(field==='laufzeit') return v + ' Monate';
return v.toLocaleString('de-DE', { minimumFractionDigits: 2, maximumFractionDigits: 2 }) + ' €';
}
function buildSelect($el, values){
var current=num($el.find('.wpcs_select_value').val());
var $data=$el.find('.data').empty();
values.forEach(function(v){
$data.append($('<div>').attr('data-value', v).text(labelFor($el, v)));
});
var newVal=values.indexOf(current)!==-1 ? current:values[0];
$el.find('.wpcs_select_value').val(newVal);
$el.find('.wpcs_select_handle').text(labelFor($el, newVal));
}
function format(v, fmt){
if(fmt==='percent') return v.toLocaleString('de-DE', { minimumFractionDigits: 2, maximumFractionDigits: 2 }) + ' %';
return v.toLocaleString('de-DE', { minimumFractionDigits: 2, maximumFractionDigits: 2 }) + ' €';
}
function updateResults(){
var laufzeit=num($laufzeit.find('.wpcs_select_value').val());
var anzahlung=num($anzahlung.find('.wpcs_select_value').val());
var match=data.find(function(r){
return num(r.laufzeit)===laufzeit&&num(r.anzahlung)===anzahlung;
});
resultEls.forEach(function(el){
var field=el.dataset.result;
if(match&&match[field]!==undefined){
el.textContent=format(match[field], el.dataset.format);
}else{
el.textContent='–';
}});
}
$laufzeit.wpcsselect({
onSelect: function(){
var lz=num($laufzeit.find('.wpcs_select_value').val());
buildSelect($anzahlung, unique('anzahlung', { laufzeit: lz }));
updateResults();
}});
$anzahlung.wpcsselect({
onSelect: function(){ updateResults(); }});
buildSelect($anzahlung, unique('anzahlung', {
laufzeit: num($laufzeit.find('.wpcs_select_value').val())
}));
updateResults();
});
}
function initFinancingSlider(){
if(typeof jQuery==='undefined') return;
var $=jQuery;
$('.wpcs-financing-calc--slider').each(function(){
var calc=this;
var dataEl=calc.querySelector('.wpcs-financing-calc__data');
var data;
try { data=JSON.parse(dataEl ? dataEl.textContent:'[]'); } catch(e){ return; }
if(!data.length) return;
var $laufzeit=$(calc).find('.wpcs-financing-slider[data-field="laufzeit"]');
var $anzahlung=$(calc).find('.wpcs-financing-slider[data-field="anzahlung"]');
var resultEls=calc.querySelectorAll('[data-result]');
function num(v){ return Number(v); }
function unique(field, filters){
return [...new Set(
data.filter(function(r){
return Object.keys(filters).every(function(k){
return num(r[k])===num(filters[k]);
});
}).map(function(r){ return r[field]; })
)].sort(function(a, b){ return a - b; });
}
function labelFor(field, v){
if(field==='laufzeit') return v + ' Monate';
return v.toLocaleString('de-DE', { minimumFractionDigits: 2, maximumFractionDigits: 2 }) + ' €';
}
function getVal($slider){
var values=JSON.parse($slider.attr('data-values')||'[]');
var idx=parseInt($slider.val());
return values.length > 0 ? values[idx]:0;
}
function buildSlider($slider, values, currentVal){
$slider.attr('data-values', JSON.stringify(values));
$slider.attr('max', Math.max(0, values.length - 1));
var idx=values.indexOf(num(currentVal));
$slider.val(idx!==-1 ? idx:0);
var newVal=values.length > 0 ? values[idx!==-1 ? idx:0]:0;
var $field=$slider.closest('.wpcs-financing-calc__field');
$field.find('.wpcs-financing-slider-value').text(labelFor($slider.data('field'), newVal));
$field.find('.wpcs_select_value').val(newVal);
}
function format(v, fmt){
if(fmt==='percent') return v.toLocaleString('de-DE', { minimumFractionDigits: 2, maximumFractionDigits: 2 }) + ' %';
return v.toLocaleString('de-DE', { minimumFractionDigits: 2, maximumFractionDigits: 2 }) + ' €';
}
function updateResults(){
var laufzeit=num($laufzeit.closest('.wpcs-financing-calc__field').find('.wpcs_select_value').val());
var anzahlung=num($anzahlung.closest('.wpcs-financing-calc__field').find('.wpcs_select_value').val());
var match=data.find(function(r){
return num(r.laufzeit)===laufzeit&&num(r.anzahlung)===anzahlung;
});
resultEls.forEach(function(el){
var field=el.dataset.result;
if(match&&match[field]!==undefined){
el.textContent=format(match[field], el.dataset.format);
}else{
el.textContent='–';
}});
}
$laufzeit.on('input', function(){
var lz=getVal($(this));
$(this).closest('.wpcs-financing-calc__field').find('.wpcs-financing-slider-value').text(labelFor('laufzeit', lz));
$(this).closest('.wpcs-financing-calc__field').find('.wpcs_select_value').val(lz);
var currentAz=num($anzahlung.closest('.wpcs-financing-calc__field').find('.wpcs_select_value').val());
buildSlider($anzahlung, unique('anzahlung', { laufzeit: lz }), currentAz);
updateResults();
});
$anzahlung.on('input', function(){
var az=getVal($(this));
$(this).closest('.wpcs-financing-calc__field').find('.wpcs-financing-slider-value').text(labelFor('anzahlung', az));
$(this).closest('.wpcs-financing-calc__field').find('.wpcs_select_value').val(az);
updateResults();
});
var initLz=num($laufzeit.closest('.wpcs-financing-calc__field').find('.wpcs_select_value').val());
buildSlider($laufzeit, unique('laufzeit', {}), initLz);
var initAz=num($anzahlung.closest('.wpcs-financing-calc__field').find('.wpcs_select_value').val());
buildSlider($anzahlung, unique('anzahlung', { laufzeit: initLz }), initAz);
updateResults();
});
}
function initLeasingSlider(){
if(typeof jQuery==='undefined') return;
var $=jQuery;
$('.wpcs-leasing-calc--slider').each(function(){
var calc=this;
var dataEl=calc.querySelector('.wpcs-leasing-calc__data');
var data;
try { data=JSON.parse(dataEl ? dataEl.textContent:'[]'); } catch(e){ return; }
if(!data.length) return;
var $laufzeit=$(calc).find('.wpcs-leasing-slider[data-field="laufzeit"]');
var $laufleistung=$(calc).find('.wpcs-leasing-slider[data-field="laufleistung"]');
var $sonderzahlung=$(calc).find('.wpcs-leasing-slider[data-field="sonderzahlung"]');
var resultEls=calc.querySelectorAll('[data-result]');
function num(v){ return Number(v); }
function unique(field, filters){
return [...new Set(
data.filter(function(r){
return Object.keys(filters).every(function(k){
return num(r[k])===num(filters[k]);
});
}).map(function(r){ return r[field]; })
)].sort(function(a, b){ return a - b; });
}
function labelFor(field, v){
if(field==='laufzeit')      return v + ' Monate';
if(field==='sonderzahlung') return v.toLocaleString('de-DE', { minimumFractionDigits: 2, maximumFractionDigits: 2 }) + ' €';
return v.toLocaleString('de-DE') + ' km/Jahr';
}
function getVal($slider){
var values=JSON.parse($slider.attr('data-values')||'[]');
var idx=parseInt($slider.val());
return values.length > 0 ? values[idx]:0;
}
function buildSlider($slider, values, currentVal){
$slider.attr('data-values', JSON.stringify(values));
$slider.attr('max', Math.max(0, values.length - 1));
var idx=values.indexOf(num(currentVal));
$slider.val(idx!==-1 ? idx:0);
var newVal=values.length > 0 ? values[idx!==-1 ? idx:0]:0;
var $field=$slider.closest('.wpcs-leasing-calc__field');
$field.find('.wpcs-leasing-slider-value').text(labelFor($slider.data('field'), newVal));
$field.find('.wpcs_select_value').val(newVal);
}
function format(v){
return v.toLocaleString('de-DE', { minimumFractionDigits: 2, maximumFractionDigits: 2 }) + ' €';
}
function updateResults(){
var laufzeit=num($laufzeit.closest('.wpcs-leasing-calc__field').find('.wpcs_select_value').val());
var laufleistung=num($laufleistung.closest('.wpcs-leasing-calc__field').find('.wpcs_select_value').val());
var sonderzahlung=num($sonderzahlung.closest('.wpcs-leasing-calc__field').find('.wpcs_select_value').val());
var match=data.find(function(r){
return num(r.laufzeit)===laufzeit
&& num(r.laufleistung)===laufleistung
&& num(r.sonderzahlung)===sonderzahlung;
});
resultEls.forEach(function(el){
var field=el.dataset.result;
if(match&&match[field]!==undefined){
el.textContent=el.dataset.format==='percent'
? match[field].toLocaleString('de-DE', { minimumFractionDigits: 2, maximumFractionDigits: 2 }) + ' %'
: format(match[field]);
}else{
el.textContent='–';
}});
}
$laufzeit.on('input', function(){
var lz=getVal($(this));
$(this).closest('.wpcs-leasing-calc__field').find('.wpcs-leasing-slider-value').text(labelFor('laufzeit', lz));
$(this).closest('.wpcs-leasing-calc__field').find('.wpcs_select_value').val(lz);
var currentLl=num($laufleistung.closest('.wpcs-leasing-calc__field').find('.wpcs_select_value').val());
buildSlider($laufleistung, unique('laufleistung', { laufzeit: lz }), currentLl);
var currentSz=num($sonderzahlung.closest('.wpcs-leasing-calc__field').find('.wpcs_select_value').val());
buildSlider($sonderzahlung, unique('sonderzahlung', {
laufzeit:     lz,
laufleistung: num($laufleistung.closest('.wpcs-leasing-calc__field').find('.wpcs_select_value').val())
}), currentSz);
updateResults();
});
$laufleistung.on('input', function(){
var ll=getVal($(this));
$(this).closest('.wpcs-leasing-calc__field').find('.wpcs-leasing-slider-value').text(labelFor('laufleistung', ll));
$(this).closest('.wpcs-leasing-calc__field').find('.wpcs_select_value').val(ll);
var currentSz=num($sonderzahlung.closest('.wpcs-leasing-calc__field').find('.wpcs_select_value').val());
buildSlider($sonderzahlung, unique('sonderzahlung', {
laufzeit:     num($laufzeit.closest('.wpcs-leasing-calc__field').find('.wpcs_select_value').val()),
laufleistung: ll
}), currentSz);
updateResults();
});
$sonderzahlung.on('input', function(){
var sz=getVal($(this));
$(this).closest('.wpcs-leasing-calc__field').find('.wpcs-leasing-slider-value').text(labelFor('sonderzahlung', sz));
$(this).closest('.wpcs-leasing-calc__field').find('.wpcs_select_value').val(sz);
updateResults();
});
var initLz=num($laufzeit.closest('.wpcs-leasing-calc__field').find('.wpcs_select_value').val());
buildSlider($laufzeit, unique('laufzeit', {}), initLz);
var initLl=num($laufleistung.closest('.wpcs-leasing-calc__field').find('.wpcs_select_value').val());
buildSlider($laufleistung, unique('laufleistung', { laufzeit: initLz }), initLl);
var initSz=num($sonderzahlung.closest('.wpcs-leasing-calc__field').find('.wpcs_select_value').val());
buildSlider($sonderzahlung, unique('sonderzahlung', { laufzeit: initLz, laufleistung: initLl }), initSz);
updateResults();
});
}
document.addEventListener('DOMContentLoaded', function (){
initLeasingCalculator();
initLeasingSlider();
initFinancingCalculator();
initFinancingSlider();
});
})();
var wpcs_theme_division=null;
var wpcs_theme_tabs=null;
var wpcs_theme_accordion=null;
var wpcs_theme_model=null;
var wpcs_theme_offer_group=null;
var wpcs_theme=null;
var wpcs_theme_person=null;
var wpcs_theme_filter=null;
(function($){
$(function(){
wpcs_theme_division=new WPCSThemeDivision();
wpcs_theme_tabs=new WPCSThemeTabs();
wpcs_theme_accordion=new WPCSThemeAccordion();
wpcs_theme_model=new WPCSThemeModel();
wpcs_theme_offer_group=new WPCSThemeOfferGroup();
wpcs_theme=new WPCSTheme();
wpcs_theme_filter=new WPCSThemeFilter();
wpcs_theme_person=new WPCSThemePerson();
if($('.wpcs-leasing-matrix').length){
$('.wpcs-leasing-matrix').each(function(){
var container=$(this);
var monthSelect=container.find('.leasing-months-select');
var kmSelect=container.find('.leasing-km-select');
var rateDisplay=container.find('.rate-value');
var rateSpinner=container.find('.rate-spinner');
function updateLeasingRate(){
var vehicleId=container.data('vehicle-id');
var selectedMonths=monthSelect.find('.wpcs_select_value').val();
var selectedKm=kmSelect.find('.wpcs_select_value').val();
rateDisplay.hide();
rateSpinner.show();
$.post(wpcs_ajax_url, {
action: 'wpcs_get_leasing_rate',
vehicle_id: vehicleId,
months: selectedMonths,
km: selectedKm
}, function(response){
rateSpinner.hide();
if(response.success){
rateDisplay.html(response.data.rate).show();
}else{
rateDisplay.text('n.v.').show();
}}).fail(function(){
rateSpinner.hide();
rateDisplay.text('Fehler').show();
});
}
monthSelect.wpcsselect({ onSelect: updateLeasingRate, no_deselect: true });
kmSelect.wpcsselect({ onSelect: updateLeasingRate, no_deselect: true });
updateLeasingRate();
});
}});
function WPCSTheme(){
var that=this;
this.footnotesDiv=$('#wpcs_footnotes');
this.generated_footnotes_div=$('#wpcs_generated_footnotes');
this._construct=function(){
that._initFootnotes();
}
this._initFootnotes=function(){
let html=that.generated_footnotes_div.html();
if(this.footnotesDiv.length < 1&&html!=""){
that.generated_footnotes_div.removeClass('wpcs_hidden');
}else{
this.footnotesDiv.html(html);
}}
this._construct();
}
function WPCSThemeFilter(){
var that=this;
this.filters={};
this._construct=function(){
$('.wpcsselect.wpcs_filter_select').wpcsselect({
onSelect: function(){
that._submitForm();
}});
$('.theme_filter.button').each(function(){
let container=this;
$('a.wpcs_filter_button', container).click(function(e){
e.preventDefault();
let btn=$(this);
btn.toggleClass('active');
let value=$(this).data('value');
let is_active=btn.hasClass('active');
$('input', container).prop('checked', is_active);
that._submitForm(e);
});
});
$('.theme_filter input').click(function(e){
that._submitForm();
});
if($('#wpcs_offer_and_offergroup_grid').data('jsfilter')==1){
that._submitForm();
}}
this._submitForm=function(){
let data=$('.theme_filter input').serialize();
if($('#wpcs_offer_and_offergroup_grid').data('jsfilter')==1){
let active_filters=new URLSearchParams(data);
let filterGroups={};
for (let [key, value] of active_filters.entries()){
if(!filterGroups[key]){
filterGroups[key]=[];
}
filterGroups[key].push(value);
}
$('#wpcs_offer_and_offergroup_grid article').each(function(){
let $article=$(this);
let tags=$article.data('tags');
if(!Array.isArray(tags)) tags=[];
let matchesAllGroups=true;
for (let groupKey in filterGroups){
let groupValues=filterGroups[groupKey];
let matchesThisGroup=groupValues.some(val=> tags.includes(parseInt(val))||tags.includes(val));
if(!matchesThisGroup){
matchesAllGroups=false;
break;
}}
let $container=$article.closest('.wpcs_2slides_container');
let $target=$container.length ? $container:$article;
if(matchesAllGroups){
$target.show();
}else{
$target.hide();
}});
}else{
let cleanedUrl=wpcs_current_url.replace(/\/page\/\d+\/?/, '/');
window.location.href=cleanedUrl + '?' + data;
}}
this.filterPage=function(){
}
this._construct();
}
function WPCSThemeModel(){
var that=this;
this._construct=function(){
$('.wpcsselect.model_single_model_select').wpcsselect({
target: '#wpcs_select_value_wpcs_model',
onSelect: function(){
let val=$('#wpcs_select_value_wpcs_model').val();
window.location.href=val;
}});
}
this.load=function(target_selector, settings){
$.ajax({
method: 'POST',
url: wpcs_ajax_url,
data: { action: 'wpcs_theme_load', 'do': 'load_models', settings: settings },
success: function(data){
if(data.code==1) $(target_selector).html(data.result);
}});
}
this._construct();
}
function WPCSThemeOfferGroup(){
if(window.wpcsAktionDetailFilterHandled===true) return;
var activeFilters=[];
$('#wpcs_offer_group_filter_buttons').on('click', '.wpcs_offer_group_filter_button', function(e){
e.preventDefault();
$(this).toggleClass('active');
var filter='wpcs_filter_' + $(this).attr('data-offer-filter');
if(activeFilters.includes(filter)){
activeFilters=activeFilters.filter(function(item){
return item!==filter;
});
}else{
activeFilters.push(filter);
}
if(activeFilters.length===0){
$('.wpcs_offer').closest('.wpcs_2slides_container').show();
}else{
$('.wpcs_offer').closest('.wpcs_2slides_container').hide();
activeFilters.forEach(function(activeFilter){
$('.wpcs_offer.' + activeFilter).closest('.wpcs_2slides_container').show();
});
}});
}
function WPCSThemePerson(){
var that=this;
this.person_search_timout_id=null;
this._construct=function(){
this.initWPCSSelect();
}
this.initWPCSSelect=function(){
$('.wpcsselect.locations_persons_select').wpcsselect({
onSelect: function(){
let val=$('.wpcsselect.locations_persons_select input').val();
$('#wpcs_locations_persons_select .location_wrapper').addClass('wpcs_hidden');
let current=$('#wpcs_locations_persons_select .location_wrapper[data-location=' + val + ']');
current.removeClass('wpcs_hidden');
if(typeof $.fn.slick!=='undefined'){
$('.dxim_vehicle_carousel.slick-slider', current).slick('refresh');
}}
});
}
this._construct();
}
function WPCSThemeDivision(){
var that=this;
this._construct=function(){
this.initWPCSSelect();
}
this.initWPCSSelect=function(){
$('.wpcsselect.division_select').wpcsselect({
onSelect: function(){
let division_id=jQuery('.wpcsselect.division_select input').val();
jQuery('#location_team .wpcs_team').addClass('wpcs_hidden');
jQuery('#location_team .wpcs_team[data-division=' + division_id + ']').removeClass('wpcs_hidden');
}});
}
this._construct();
}
function WPCSThemeTabs(){
var that=this;
this._construct=function(){
this.init();
}
this.init=function(){
$('.wpcs_tabs').each(function(){
let wrapper=this;
$('.wpcs_tab_control', wrapper).each(function(index){
$(this).click(function(e){
e.preventDefault();
that.changeTab(index, wrapper);
})
});
});
}
this.changeTab=function(index, tabObj){
$('.wpcs_tab_control', tabObj).removeClass('active');
$('.wpcs_tab_control', tabObj).eq(index).addClass('active');
$('.wpcs_tab_content', tabObj).removeClass('active');
$('.wpcs_tab_content', tabObj).eq(index).addClass('active');
}
this._construct();
}
function WPCSThemeAccordion(){
var that=this;
this._construct=function(){
this.init();
}
this.init=function(){
$('.wpcs_accordion').each(function(){
let wrapper=this;
$('.wpcs_accordion_control', wrapper).each(function(index){
$(this).click(function(e){
e.preventDefault();
that.changeTab(index, wrapper);
})
});
});
}
this.changeTab=function(index, tabObj){
let target=$('.wpcs_accordion_control', tabObj).eq(index);
let target_is_active=target.hasClass('active');
$('.wpcs_accordion_control', tabObj).removeClass('active');
if(!target_is_active) $('.wpcs_accordion_control', tabObj).eq(index).addClass('active');
$('.wpcs_accordion_content', tabObj).removeClass('active');
if(!target_is_active) $('.wpcs_accordion_content', tabObj).eq(index).addClass('active');
}
this._construct();
}})(jQuery);