(()=>{var t={};t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),((o,n)=>{if(!o)return;const{currency:e,products:i,purchase:a,add_to_cart:l,eventsToTrack:c}=(null===(n=t.g._googlesitekit)||void 0===n?void 0:n.wcdata)||{},r=null==c?void 0:c.includes("add_to_cart"),d=null==c?void 0:c.includes("purchase");if(l&&r){var u,s;const{price:o}=l,n=f(o,e,l);null===(u=t.g._googlesitekit)||void 0===u||null===(s=u.gtagEvent)||void 0===s||s.call(u,"add_to_cart",n)}if(a&&d){var g,_,p;const{id:o,totals:n,items:e,user_data:i}=a,l=f(n.total_price,n.currency_code,e,o,n.shipping_total,n.tax_total);null!==(g=t.g._googlesitekit)&&void 0!==g&&g.gtagUserData&&i&&(l.user_data=i),null===(_=t.g._googlesitekit)||void 0===_||null===(p=_.gtagEvent)||void 0===p||p.call(_,"purchase",l)}const v=o("body");function f(t,o,n){let e=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null;const l={value:m(t),currency:o,items:[]};if(e&&(l.transaction_id=e),"number"==typeof i&&(l.shipping=i),"number"==typeof a&&(l.tax=a),n&&n.length)for(const t of n)l.items.push(h(t));else n&&n.id&&(l.items=[h(n)]);return l}function h(t){const{id:o,name:n,price:e,variation:i,quantity:a,categories:l}=t,c={item_id:o,item_name:n,price:m(e)};if(a&&(c.quantity=a),i&&(c.item_variant=i),l&&null!=l&&l.length){let t=1;for(const o of l)c[t>1?"item_category".concat(t):"item_category"]=o.name,t++}return c}function m(t){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return parseInt(t,10)/10**o}r&&(v.on("added_to_cart",(o,n,a,l)=>{var c,r;const d=parseInt(l.data("product_id"),10);if(!d)return;const u=(null==i?void 0:i.find(t=>(null==t?void 0:t.id)===d))||{},{price:s}=u,g=f(s,e,u);null===(c=t.g._googlesitekit)||void 0===c||null===(r=c.gtagEvent)||void 0===r||r.call(c,"add_to_cart",g)}),o(".products-block-post-template .product, .wc-block-product-template .product").each(function(){const n=o(this),a=parseInt(n.find("[data-product_id]").attr("data-product_id"),10);a&&n.on("click",n=>{var l,c;const r=o(n.target).closest(".wc-block-components-product-button [data-product_id]");if(!r.length||!r.hasClass("add_to_cart_button")||r.hasClass("product_type_variable"))return;const d=(null==i?void 0:i.find(t=>(null==t?void 0:t.id)===a))||{},{price:u}=d,s=f(u,e,d);null===(l=t.g._googlesitekit)||void 0===l||null===(c=l.gtagEvent)||void 0===c||c.call(l,"add_to_cart",s)})}))})(t.g.jQuery)})();
function cmplz_create_element(e,t){e=document.createElement(e);return e.innerHtml=t,e}function cmplz_add_event(e,t,c){document.addEventListener(e,e=>{e.target.closest(t)&&c(e)})}function cmplz_is_hidden(e){return null===e.offsetParent}function cmplz_html_decode(e){return(new DOMParser).parseFromString(e,"text/html").documentElement.textContent}function cmplzLoadConsentAreaContent(e,i){document.querySelectorAll(".cmplz-consent-area.cmplz-placeholder").forEach(t=>{let c=t.getAttribute("data-category"),n=t.getAttribute("data-service");var o=t.getAttribute("data-post_id"),a=t.getAttribute("data-block_id");if(e===c||i===n){let e=new XMLHttpRequest;e.open("GET",complianz.url+"consent-area/"+o+"/"+a,!0),e.setRequestHeader("Content-type","application/json"),e.send(),t.classList.remove("cmplz-placeholder"),e.onload=function(){t.innerHTML=JSON.parse(e.response),t.querySelectorAll("script").forEach(e=>{cmplz_run_script(e.innerHTML,c,n,"inline",e)})}}})}document.querySelectorAll(".cmplz-consent-area.cmplz-placeholder").forEach(e=>{e.addEventListener("click",e=>{let t=e.target;(t=t.classList.contains("cmplz-consent-area")?t:e.target.closest(".cmplz-consent-area.cmplz-placeholder"))&&(cmplz_set_service_consent(e=t.getAttribute("data-service"),!0),cmplzLoadConsentAreaContent(!1,e),cmplz_enable_category(null,e),cmplz_set_banner_status("dismissed"))}),document.addEventListener("cmplz_enable_category",function(e){cmplzLoadConsentAreaContent(e.detail.category,e.detail.service)})}),document.addEventListener("cmplz_manage_consent_container_loaded",function(e){var t,c=window.location.href;-1!=c.indexOf("#")&&(t=-1!=c.lastIndexOf("?")?c.lastIndexOf("?"):void 0,c=c.substring(c.indexOf("#")+1,t),t=document.getElementById(c))&&(c=t.getBoundingClientRect().top+window.pageYOffset-200,window.scrollTo({top:c,behavior:"smooth"}))}),complianz.locale=complianz.locale+"&token="+Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5),(()=>{function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var c=document.createEvent("CustomEvent");return c.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),c}"function"!=typeof window.CustomEvent&&(e.prototype=window.Event.prototype,window.CustomEvent=e)})();var cmplz_banner,cmplz_manage_consent_button,cmplzResizeTimer,cmplz_banner_container=document.getElementById("cmplz-cookiebanner-container"),cmplz_waiting_inline_scripts=[],cmplz_waiting_scripts=[],cmplz_fired_scripts=[],cmplz_placeholder_class_index=0,cmplz_all_scripts_hook_fired=!1,cmplz_consent_stored_once=!1,cmplz_fired_category_events=["functional"],cmplz_fired_service_events=[],cmplz_categories=["functional","preferences","statistics","marketing"];window.cmplz_get_cookie=function(t){if("undefined"!=typeof document){t=complianz.prefix+t;var c=document.cookie.split(";");for(let e=0;e<c.length;e++){var n=c[e].trim();if(n.startsWith(t+"="))return n.substring(t.length+1)}}return""},window.cmplz_set_cookie=function(e,t,c){var n,o,a,i;"undefined"!=typeof document&&(c=void 0===c||c,n="https:"===window.location.protocol?";secure":"",(o=new Date).setTime(o.getTime()+24*complianz.cookie_expiry*60*60*1e3),o=";expires="+o.toGMTString(),a=0<(a=cmplz_get_cookie_domain()).length?";domain="+a:"",c=c?complianz.prefix:"",i=cmplz_get_cookie_path(),document.cookie=""+c+e+`=${t};SameSite=Lax${n}${o}${a};path=`+i)},window.cmplz_in_array=function(e,t){return t.includes(e)},window.cmplz_highest_accepted_category=function(){var t=cmplz_accepted_categories(),c=["marketing","statistics","preferences"];for(let e=0;e<c.length;e++)if(cmplz_in_array(c[e],t))return c[e];return"functional"};let cmplz_set_category_as_body_class=()=>{let c=document.body.classList;for(let e=c.length-1;0<=e;e--)c[e].startsWith("cmplz-")&&"cmplz-document"!==c[e]&&c.remove(c[e]);var e=cmplz_accepted_categories(),e=(Object.values(e).forEach(e=>{"string"==typeof e&&c.add("cmplz-"+e)}),cmplz_get_all_service_consents()),e=(Object.entries(e).forEach(([e,t])=>{t&&c.add("cmplz-"+e)}),c.add("cmplz-"+complianz.region,"cmplz-"+complianz.consenttype),new CustomEvent("cmplz_set_category_as_bodyclass"));document.dispatchEvent(e)},cmplz_append_css=e=>{var t=document.head||document.getElementsByTagName("head")[0],c=document.createElement("style");c.setAttribute("type","text/css"),c.appendChild(document.createTextNode(e)),t.appendChild(c)},cmplz_load_css=e=>{var t=document.head||document.getElementsByTagName("head")[0],c=document.createElement("link");c.rel="stylesheet",c.type="text/css",c.href=e,t.appendChild(c)};function cmplz_run_script(t,c,n,e,o){var a=document.createElement("script");if("inline"!==e?a.src=t:("string"!=typeof t&&(t=t.innerHTML),a.innerHTML=[t,"cmplzScriptLoaded();"].join("\n")),!cmplz_in_array(t,cmplz_fired_scripts)){cmplzCopyAttributes(o,a);try{"inline"!==e?a.onload=function(){cmplz_run_after_all_scripts(c,n),cmplz_maybe_run_waiting_scripts(t,c,n,o)}:window.cmplzScriptLoaded=function(){cmplz_run_after_all_scripts(c,n),cmplz_maybe_run_waiting_scripts(t,c,n,o)},document.head.appendChild(a)}catch(e){throw cmplz_run_after_all_scripts(c,n),"Something went wrong "+e+" while loading "+t}}}function cmplz_maybe_run_waiting_scripts(e,t,c,n){var o=cmplz_get_waiting_script(cmplz_waiting_scripts,e),o=(o&&cmplz_run_script(o,t,c,"src",n),cmplz_get_waiting_script(cmplz_waiting_inline_scripts,e));o&&cmplz_run_script(o,t,c,"inline",n)}let cmplzLazyLoader=()=>{var e=document.querySelectorAll(".cmplz-blocked-content-container");let t=new IntersectionObserver((e,n)=>{e.forEach(e=>{var t,c;e.isIntersecting&&((t=(e=e.target).getAttribute("data-placeholder-image"))&&(c=e.getAttribute("data-placeholder_class_index"),cmplz_append_css(".cmplz-placeholder-"+c+" {background-image: url("+t+") !important;}"),cmplz_set_blocked_content_container_aspect_ratio(e,t,c)),n.unobserve(e))})});e.forEach(e=>{t.observe(e)})};function cmplz_set_blocked_content_container(){document.querySelectorAll(".cmplz-image").forEach(e=>{var t,c,n,o;e.classList.contains("cmplz-processed")||(e.classList.add("cmplz-processed"),t=e.getAttribute("data-service"),c=e.getAttribute("data-category"),(n=e.parentElement).classList.add("cmplz-blocked-content-container"),o=n.getAttribute("data-placeholder_class_index"),"lazy"===e.getAttribute("loading")&&(e.removeAttribute("loading"),e.setAttribute("data-deferlazy",1)),null==o&&(cmplz_placeholder_class_index++,n.classList.add("cmplz-placeholder-"+cmplz_placeholder_class_index,"cmplz-blocked-content-container"),n.setAttribute("data-placeholder_class_index",cmplz_placeholder_class_index),cmplz_insert_placeholder_text(n,c,t)))}),document.querySelectorAll(".cmplz-placeholder-element").forEach(t=>{if(!t.classList.contains("cmplz-processed")){t.classList.add("cmplz-processed");var c=t.getAttribute("data-service"),n=t.getAttribute("data-category");let e;null===(e=t.classList.contains("cmplz-iframe")?("lazy"===t.getAttribute("loading")&&(t.removeAttribute("loading"),t.setAttribute("data-deferlazy",1)),t.parentElement):t).getAttribute("data-placeholder_class_index")&&(cmplz_placeholder_class_index++,e.classList.add("cmplz-placeholder-"+cmplz_placeholder_class_index,"cmplz-blocked-content-container"),e.setAttribute("data-placeholder_class_index",cmplz_placeholder_class_index),cmplz_insert_placeholder_text(e,n,c),n=t.getAttribute("data-placeholder-image"))&&void 0!==n&&n.length&&e.setAttribute("data-placeholder-image",n)}}),cmplzLazyLoader(),cmplz_has_consent("statistics")&&cmplz_enable_category("statistics"),cmplz_has_consent("marketing")&&cmplz_enable_category("marketing")}function cmplz_insert_placeholder_text(e,n,o){if(!e.querySelector(".cmplz-blocked-content-notice")){let t=complianz.placeholdertext;n=n||"marketing";let c;if(void 0!==t){if(1==complianz.clean_cookies){let e=o?o.replace("-"," "):"";e=e.charAt(0).toUpperCase()+e.slice(1),t=t.replace("{service}",e),(c=cmplz_create_element("div",t)).innerHTML=t,c.classList.add("cmplz-blocked-content-notice");var a=c.querySelector("button"),a=(a.setAttribute("data-service",o),a.setAttribute("data-category",n),a.setAttribute("aria-label",complianz.aria_label.replace("{service}",e)),complianz.page_links[complianz.region]),i=c.querySelector(".cmplz-links a");a&&a.hasOwnProperty("cookie-statement")&&(i.setAttribute("href",a["cookie-statement"].url),"{title}"===i.innerText)&&(i.innerText=a["cookie-statement"].title)}else{i=cmplz_create_element("button",""),a=complianz.categories.hasOwnProperty(n)?complianz.categories[n]:"marketing";i.innerText=t.replace("{category}",a),i.classList.add("cmplz-blocked-content-notice","cmplz-accept-category","cmplz-accept-"+n),i.setAttribute("data-service",o),i.setAttribute("data-category",n),i.setAttribute("aria-label",complianz.aria_label.replace("{category}",n)),c=i}("VIDEO"!==e.tagName?e:e.parentElement).appendChild(c)}}}function cmplz_set_blocked_content_container_aspect_ratio(t,c,n){var e;null!=t&&((e=new Image).addEventListener("load",function(){var e=this.naturalWidth||1,e=this.naturalHeight*(t.clientWidth/e),e=-1===c.indexOf("placeholder.jpg")?"height:"+e+"px;":"";cmplz_append_css(".cmplz-placeholder-"+n+" {"+e+"}")}),e.src=c)}function cmplz_has_blocked_scripts(){return 0<document.querySelectorAll("script[data-category], script[data-service]").length}function cmplz_enable_category(o,a){1==complianz.tm_categories&&""!==o&&cmplz_run_tm_event(o);var t={},t=(t.category=o,t.categories=cmplz_accepted_categories(),t.region=complianz.region,new CustomEvent("cmplz_before_category",{detail:t}));if(document.dispatchEvent(t),a=void 0!==a?a:"do_not_match","functional"!==(o=""===o?"do_not_match":o)){"marketing"===o&&cmplz_set_integrations_cookies();let e;e="do_not_match"!==a?'.cmplz-blocked-content-notice [data-service="'+a+'"]':1!=complianz.clean_cookies?".cmplz-blocked-content-notice.cmplz-accept-"+o:'.cmplz-blocked-content-notice [data-category="'+o+'"]',document.querySelectorAll(e).forEach(e=>{var t=e.getAttribute("data-service");e.parentNode.classList.contains("cmplz-blocked-content-notice")&&(e=e.parentNode),cmplz_is_service_denied(t)||e.parentNode.removeChild(e)}),document.querySelectorAll('[data-category="'+o+'"], [data-service="'+a+'"]').forEach(t=>{var e=t.getAttribute("data-service");if(!cmplz_is_service_denied(e)&&"functional"!==t.getAttribute("data-category")&&!t.classList.contains("cmplz-activated")){var e=t.tagName;if("LINK"===e){t.classList.add("cmplz-activated");var c=t.getAttribute("data-href");cmplz_load_css(c,o)}else if("IMG"===e){t.classList.add("cmplz-activated");c=t.getAttribute("data-src-cmplz");t.setAttribute("src",c),t.getAttribute("data-deferlazy")&&t.setAttribute("loading","lazy"),cmplz_remove_placeholder(t)}else if("IFRAME"===e){t.classList.add("cmplz-activated");let e=t.getAttribute("data-src-cmplz");c=t.getAttribute("data-cmplz-target")?t.getAttribute("data-cmplz-target"):"src";"1"===cmplz_get_url_parameter(t.getAttribute(c),"autoplay")&&(e+="&autoplay=1"),t.getAttribute("data-deferlazy")&&t.setAttribute("loading","lazy"),t.addEventListener("load",()=>{cmplz_remove_placeholder(t)}),t.setAttribute(c,e)}else t.classList.contains("cmplz-placeholder-element")&&(t.classList.add("cmplz-activated"),e=t.getAttribute("data-placeholder_class_index"),t.classList.remove("cmplz-blocked-content-container","cmplz-placeholder-"+e))}});t=document.querySelectorAll('script[data-category="'+o+'"], script[data-service="'+a+'"]');t.forEach(e=>{var t=e.getAttribute("data-waitfor"),c=e.getAttribute("data-cmplz-src");t&&(c?cmplz_waiting_scripts[t]=c:0<e.innerText.length&&(cmplz_waiting_inline_scripts[t]=e)),e.parentElement&&e.parentElement.removeChild(e)}),t.forEach(e=>{var t,c,n=e.getAttribute("type");!e.classList.contains("cmplz-activated")&&n&&"text/javascript"!==n&&(e.classList.add("cmplz-activated"),(n=e.getAttribute("data-cmplz-src"))?(e.removeAttribute("type"),cmplz_is_waiting_script(cmplz_waiting_scripts,n)||(e.getAttribute("data-post_scribe_id")?(t="#"+e.getAttribute("data-post_scribe_id"),(c=document.querySelector(t))&&(c.innerHtml(""),postscribe(t,"<script src="+n+"><\/script>"))):cmplz_run_script(n,o,a,"src",e))):0<e.innerText.length&&(cmplz_is_waiting_script(cmplz_waiting_inline_scripts,e.innerText)||cmplz_run_script(e.innerText,o,a,"inline",e)))}),cmplz_run_after_all_scripts(o,a)}}function cmplz_remove_placeholder(e){var t,c=e.closest(".cmplz-blocked-content-container");c&&(t=c.getAttribute("data-placeholder_class_index"),c.classList.remove("cmplz-blocked-content-container","cmplz-placeholder-"+t)),e.classList.remove("cmplz-iframe-styles","cmplz-iframe","video-wrap")}function cmplz_get_waiting_script(e,t){for(var c in e){var n;if(e.hasOwnProperty(c))if(-1!==t.indexOf(c))return n=e[c],delete e[c],n}return!1}function cmplz_array_is_empty(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}function cmplz_is_waiting_script(t,c){for(var n in t)if(t.hasOwnProperty(n)){let e=t[n];if("string"!=typeof e&&(e=e.innerText),-1!==c.indexOf(e)||-1!==e.indexOf(c))return!0}return!1}function cmplz_run_after_all_scripts(e,t){var c="do_not_match"!==t&&!cmplz_in_array(t,cmplz_fired_service_events),n="do_not_match"!==e&&!cmplz_in_array(e,cmplz_fired_category_events);(n||c)&&(n&&cmplz_fired_category_events.push(e),c&&cmplz_fired_service_events.push(t),(n={}).category=e,n.service=t,n.categories=cmplz_accepted_categories(),n.services=cmplz_get_all_service_consents(),n.region=complianz.region,c=new CustomEvent("cmplz_enable_category",{detail:n}),document.dispatchEvent(c)),!cmplz_all_scripts_hook_fired&&cmplz_array_is_empty(cmplz_waiting_inline_scripts)&&cmplz_array_is_empty(cmplz_waiting_scripts)&&(n=new CustomEvent("cmplz_run_after_all_scripts",{detail:e,service:t}),document.dispatchEvent(n),cmplz_all_scripts_hook_fired=!0)}window.addEventListener("resize",function(e){clearTimeout(cmplzResizeTimer),cmplzResizeTimer=setTimeout(cmplz_set_blocked_content_container,500)},!0),1==complianz.block_ajax_content&&setInterval(function(){cmplz_set_blocked_content_container()},2e3);var cmplz_fired_events=[];function cmplz_run_tm_event(e){-1===cmplz_fired_events.indexOf(e)&&(cmplz_fired_events.push(e),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"cmplz_event_"+e}),e=new CustomEvent("cmplz_tag_manager_event",{detail:e}),document.dispatchEvent(e))}function cmplz_fire_before_categories_consent(e){var t={},e=(t.categories=e,t.region=complianz.region,new CustomEvent("cmplz_before_categories_consent",{detail:t}));document.dispatchEvent(e)}function cmplz_check_cookie_policy_id(){var e=cmplz_get_cookie("policy_id");e&&parseInt(complianz.current_policy_id)!==parseInt(e)&&(cmplz_deny_all(),cmplz_set_banner_status("show"),cmplz_clear_cookies("cmplz"))}function cmplz_do_not_track(){var e="doNotTrack"in navigator&&"1"===navigator.doNotTrack,t="globalPrivacyControl"in navigator&&navigator.globalPrivacyControl;return!(!complianz.do_not_track_enabled||!t&&!e)}function cmplz_get_services_on_page(){let c=[];return document.querySelectorAll("[data-service]").forEach(e=>{var t=e.getAttribute("data-service"),e=e.getAttribute("data-category");-1==c.indexOf(t)&&c.push({category:e,service:t})}),c}function cmplz_is_bot(){var e=new RegExp("(googlebot/|Googlebot-Mobile|Google-InspectionTool|Googlebot-Image|Google favicon|Mediapartners-Google|bingbot|slurp|java|wget|curl|Commons-HttpClient|Python-urllib|libwww|httpunit|nutch|phpcrawl|msnbot|jyxobot|FAST-WebCrawler|FAST Enterprise Crawler|biglotron|teoma|convera|seekbot|gigablast|exabot|ngbot|ia_archiver|GingerCrawler|webmon |httrack|webcrawler|grub.org|UsineNouvelleCrawler|antibot|netresearchserver|speedy|fluffy|bibnum.bnf|findlink|msrbot|panscient|yacybot|AISearchBot|IOI|ips-agent|tagoobot|MJ12bot|dotbot|woriobot|yanga|buzzbot|mlbot|yandexbot|purebot|Linguee Bot|Voyager|CyberPatrol|voilabot|baiduspider|citeseerxbot|spbot|twengabot|postrank|turnitinbot|scribdbot|page2rss|sitebot|linkdex|Adidxbot|blekkobot|ezooms|dotbot|Mail.RU_Bot|discobot|heritrix|findthatfile|europarchive.org|NerdByNature.Bot|sistrix crawler|ahrefsbot|Aboundex|domaincrawler|wbsearchbot|summify|ccbot|edisterbot|seznambot|ec2linkfinder|gslfbot|aihitbot|intelium_bot|facebookexternalhit|yeti|RetrevoPageAnalyzer|lb-spider|sogou|lssbot|careerbot|wotbox|wocbot|ichiro|DuckDuckBot|lssrocketcrawler|drupact|webcompanycrawler|acoonbot|openindexspider|gnam gnam spider|web-archive-net.com.bot|backlinkcrawler|coccoc|integromedb|content crawler spider|toplistbot|seokicks-robot|it2media-domain-crawler|ip-web-crawler.com|siteexplorer.info|elisabot|proximic|changedetection|blexbot|arabot|WeSEE:Search|niki-bot|CrystalSemanticsBot|rogerbot|360Spider|psbot|InterfaxScanBot|Lipperhey SEO Service|CC Metadata Scaper|g00g1e.net|GrapeshotCrawler|urlappendbot|brainobot|fr-crawler|binlar|SimpleCrawler|Livelapbot|Twitterbot|cXensebot|smtbot|bnf.fr_bot|A6-Indexer|ADmantX|Facebot|Twitterbot|OrangeBot|memorybot|AdvBot|MegaIndex|SemanticScholarBot|ltx71|nerdybot|xovibot|BUbiNG|Qwantify|archive.org_bot|Applebot|TweetmemeBot|crawler4j|findxbot|SemrushBot|yoozBot|lipperhey|y!j-asr|Domain Re-Animator Bot|AddThis)","i"),t=navigator.userAgent;return e.test(t)}function cmplz_is_speedbot(){var e=navigator.userAgent;return new RegExp("(GTmetrix|pingdom|pingbot|Lighthouse)","i").test(e)}function cmplz_exists_service_consent(){var e,t=cmplz_get_cookie("consented_services");try{for(var c in e=JSON.parse(t))if(e.hasOwnProperty(c)&&1==e[c])return!0}catch(e){}return!1}function cmplz_set_service_consent(e,t){var c=cmplz_get_cookie("consented_services");let n;try{n=JSON.parse(c)}catch(e){n={}}n[e]=t,cmplz_set_cookie("consented_services",JSON.stringify(n));c={},c.service=e,c.value=t,c.region=complianz.region,cmplz_all_scripts_hook_fired=!1,e=new CustomEvent("cmplz_status_change_service",{detail:c});document.dispatchEvent(e)}function cmplz_clear_all_service_consents(){cmplz_set_cookie("consented_services","")}function cmplz_get_all_service_consents(){var e=cmplz_get_cookie("consented_services");let t;try{t=JSON.parse(e)}catch(e){t={}}return t}function cmplz_get_cookie_path(){return void 0!==complianz.cookie_path&&""!==complianz.cookie_path?complianz.cookie_path:"/"}function cmplz_get_cookie_domain(){return 1==complianz.set_cookies_on_root&&3<complianz.cookie_domain.length&&!complianz.cookie_domain.includes("localhost")?complianz.cookie_domain:""}function cmplz_reload_browser_compatible(){var e;-1<navigator.userAgent.toLowerCase().indexOf("firefox")?((e=new URL(window.location.href)).searchParams.set("cmplz-force-reload",Date.now().toString()),window.location.href=e.toString()):window.location.reload()}window.cmplz_accept_all=function(){for(var e in cmplz_clear_all_service_consents(),cmplz_fire_before_categories_consent(cmplz_categories),cmplz_categories)cmplz_categories.hasOwnProperty(e)&&cmplz_set_consent(cmplz_categories[e],"allow");cmplz_sync_category_checkboxes()},window.cmplz_deny_all=function(){for(var e in cmplz_categories)cmplz_categories.hasOwnProperty(e)&&cmplz_set_consent(cmplz_categories[e],"deny");let t=!1;"functional"===cmplz_highest_accepted_category()&&!cmplz_exists_service_consent()||(t=!0),cmplz_clear_cookies("cmplz_service")&&(t=!0),cmplz_clear_all_service_consents(),cmplz_integrations_revoke(),cmplz_fire_categories_event(),cmplz_track_status();var c=new CustomEvent("cmplz_revoke",{detail:t});document.dispatchEvent(c),!complianz.tcf_active&&t&&cmplz_reload_browser_compatible()},window.conditionally_show_banner=function(){complianz=cmplz_merge_object(complianz,cmplz_user_data),cmplz_maybe_auto_redirect(),cmplz_set_blocked_content_container(),window.wp_consent_type=complianz.consenttype;var e,t,c,n=new CustomEvent("wp_consent_type_defined"),o=(document.dispatchEvent(n),n=new CustomEvent("cmplz_before_cookiebanner"),document.dispatchEvent(n),1==complianz.forceEnableStats&&"optin"===complianz.consenttype&&cmplz_set_consent("statistics","allow"),cmplz_categories.reverse()),a=[];for(e in o)o.hasOwnProperty(e)&&(t=cmplz_categories[e],cmplz_has_consent(t))&&a.push(t);for(c in cmplz_fire_before_categories_consent(a),a)o.hasOwnProperty(c)&&cmplz_enable_category(a[c]);if(cmplz_exists_service_consent()){cmplz_enable_category("","general");var i,l,r,s=cmplz_get_services_on_page();for(i in s)s.hasOwnProperty(i)&&(l=s[i].service,r=s[i].category,cmplz_has_service_consent(l,r))&&(document.querySelectorAll('.cmplz-accept-service[data-service="'+l+'"]').forEach(e=>{e.checked=!0}),cmplz_enable_category("",l))}cmplz_sync_category_checkboxes(),cmplz_integrations_init(),cmplz_check_cookie_policy_id(),cmplz_set_up_auto_dismiss(),cmplz_load_manage_consent_container(),n=new CustomEvent("cmplz_cookie_banner_data",{detail:complianz}),document.dispatchEvent(n),""===cmplz_get_cookie("saved_categories")&&("optin"!==complianz.consenttype&&"optout"!==complianz.consenttype?cmplz_track_status("no_warning"):cmplz_do_not_track()&&cmplz_track_status("do_not_track")),cmplz_set_category_as_body_class(),cmplz_fire_categories_event(),cmplz_do_not_track()?(console.log("global privacy control or do not track detected: no banner."),cmplz_track_status("do_not_track")):("optin"===complianz.consenttype?(complianz.forceEnableStats&&cmplz_enable_category("statistics"),console.log("opt-in"),show_cookie_banner):"optout"===complianz.consenttype?(console.log("opt-out"),show_cookie_banner):(console.log("other consent type, no cookie warning"),cmplz_accept_all))()},window.show_cookie_banner=function(){let t=complianz.disable_cookiebanner||cmplz_is_speedbot(),e=!1;(document.querySelector("#cmplz-manage-consent-container")||document.querySelector(".cmplz-dropdown-cookiepolicy"))&&(e=!0);var c=document.getElementById("cmplz-cookiebanner-container"),c=(c&&document.body.prepend(c),document.createElement("link"));let n=complianz.page_links[complianz.region];(cmplz_banner=document.querySelector(".cmplz-cookiebanner.banner-"+complianz.user_banner_id+"."+complianz.consenttype))||(t=!0),cmplz_manage_consent_button=document.querySelector("#cmplz-manage-consent .cmplz-manage-consent.manage-consent-"+complianz.user_banner_id);var o=complianz.css_file.replace("{type}",complianz.consenttype).replace("{banner_id}",complianz.user_banner_id),o=(-1!==complianz.css_file.indexOf("cookiebanner/css/defaults/banner")&&console.log("Fallback default css file used. Please re-save banner settings, or check file writing permissions in uploads directory"),c.href=o,c.type="text/css",c.rel="stylesheet",c.onload=function(){var e;!t&&(cmplz_banner.classList.remove("cmplz-hidden"),cmplz_manage_consent_button.classList.remove("cmplz-hidden"),e=cmplz_banner.querySelector(".cmplz-close"))&&e.focus()},document.getElementsByTagName("head")[0].appendChild(c),cmplz_banner&&!t&&(cmplz_banner.querySelectorAll(".cmplz-links a:not(.cmplz-external), .cmplz-buttons a:not(.cmplz-external)").forEach(e=>{var t,c=e;for(t in c.classList.add("cmplz-hidden"),n)n.hasOwnProperty(t)&&c.classList.contains(t)&&(c.setAttribute("href",n[t].url+c.getAttribute("data-relative_url")),"{title}"===c.innerText&&(c.innerText=cmplz_html_decode(n[t].title)),c.classList.remove("cmplz-hidden"))}),cmplz_set_banner_status(),e)&&(cmplz_banner.classList.remove("cmplz-show"),cmplz_banner.classList.add("cmplz-dismissed"),cmplz_manage_consent_button.classList.remove("cmplz-dismissed"),cmplz_manage_consent_button.classList.add("cmplz-show")),new CustomEvent("cmplz_cookie_warning_loaded",{detail:complianz.region}));document.dispatchEvent(o)},window.cmplz_get_banner_status=function(){return cmplz_get_cookie("banner-status")},window.cmplz_set_banner_status=function(e){let t=cmplz_get_cookie("banner-status");(e=void 0!==e?e:t)!==t&&cmplz_set_cookie("banner-status",e),0===e.length&&(e="show"),t="show"===e?"dismissed":"show",cmplz_banner&&0<e.length&&(cmplz_banner.classList.remove("cmplz-"+t),cmplz_banner.classList.add("cmplz-"+e),cmplz_manage_consent_button)&&(cmplz_manage_consent_button.classList.add("cmplz-"+t),cmplz_manage_consent_button.classList.remove("cmplz-"+e)),cmplz_banner_container&&complianz.soft_cookiewall&&(cmplz_banner_container.classList.remove("cmplz-"+t),cmplz_banner_container.classList.add("cmplz-"+e,"cmplz-soft-cookiewall"));var c=new CustomEvent("cmplz_banner_status",{detail:e});document.dispatchEvent(c),cmplz_start_clean(),"show"===e&&(c=cmplz_banner.querySelector(".cmplz-close"))&&c.focus()},window.cmplz_has_consent=function(e){if(cmplz_is_bot())return!0;if("functional"===e)return!0;let t,c;return t=cmplz_do_not_track()?(c=cmplz_get_cookie(e),"allow"===c):(c=cmplz_get_cookie(e),("optout"===complianz.consenttype||"other"===complianz.consenttype)&&""===c||"allow"===c)},window.cmplz_is_service_denied=function(e){var t=cmplz_get_cookie("consented_services");let c;try{c=JSON.parse(t)}catch(e){c={}}return!!c.hasOwnProperty(e)&&!c[e]},window.cmplz_has_service_consent=function(e,t){var c=cmplz_get_cookie("consented_services");let n;try{n=JSON.parse(c)}catch(e){n={}}return n.hasOwnProperty(e)?n[e]:cmplz_has_consent(t)},window.cmplz_set_consent=function(e,t){cmplz_set_accepted_cookie_policy_id(),t="functional"===e?"allow":t;var c,n=cmplz_get_cookie(e);let o="allow"===t;document.querySelectorAll("input.cmplz-"+e).forEach(e=>{e.checked=o}),n!==t&&(cmplz_set_cookie(e,t),"allow"===t&&cmplz_enable_category(e),cmplz_wp_set_consent(e,t),"statistics"===e&&cmplz_wp_set_consent("statistics-anonymous","allow"),(c=new Object).category=e,c.value=t,c.region=complianz.region,c.categories=cmplz_accepted_categories(),cmplz_all_scripts_hook_fired=!1,c=new CustomEvent("cmplz_status_change",{detail:c}),document.dispatchEvent(c),"marketing"===e)&&"deny"===t&&"allow"===n&&(cmplz_integrations_revoke(),setTimeout(function(){cmplz_reload_browser_compatible()},500))};var cmplz_id_cookie,cmplz_id_session,cmplz_id,cmplz_user_data=[];if("undefined"!=typeof Storage&&sessionStorage.cmplz_user_data&&(cmplz_user_data=JSON.parse(sessionStorage.cmplz_user_data)),1!=complianz.geoip||0!=cmplz_user_data.length&&cmplz_user_data.version===complianz.version&&cmplz_user_data.banner_version===complianz.banner_version)conditionally_show_banner();else{let e=new XMLHttpRequest,t=cmplz_get_url_parameter(window.location.href,"cmplz_user_region");t=t?"&cmplz_user_region="+t:"",e.open("GET",complianz.url+"banner?"+complianz.locale+t,!0),e.setRequestHeader("Content-type","application/json"),e.send(),e.onload=function(){cmplz_user_data=JSON.parse(e.response),sessionStorage.cmplz_user_data=JSON.stringify(cmplz_user_data),conditionally_show_banner()}}function cmplz_track_status_end(){cmplz_consent_stored_once||cmplz_track_status()}function cmplz_set_up_auto_dismiss(){if("optout"===complianz.consenttype){if(1==complianz.dismiss_on_scroll){let t=function(e){window.pageYOffset>Math.floor(400)&&(cmplz_set_banner_status("dismissed"),cmplz_fire_categories_event(),cmplz_track_status(),window.removeEventListener("scroll",t),this.onWindowScroll=null)};window.addEventListener("scroll",t)}var e=parseInt(complianz.dismiss_timeout);0<e&&window.setTimeout(function(){cmplz_set_banner_status("dismissed"),cmplz_fire_categories_event(),cmplz_track_status()},Math.floor(e))}}function cmplz_fire_categories_event(){var e=new Object,e=(e.category=cmplz_highest_accepted_category(),e.categories=cmplz_accepted_categories(),e.region=complianz.region,new CustomEvent("cmplz_fire_categories",{detail:e}));document.dispatchEvent(e)}function cmplz_track_status(e){let t=[];e=void 0!==e&&e;var c=new CustomEvent("cmplz_track_status",{detail:e});document.dispatchEvent(c),t=e?[e]:cmplz_accepted_categories(),cmplz_set_category_as_body_class();let n,o;try{n=JSON.parse(cmplz_get_cookie("saved_categories"))}catch(e){n={}}try{o=JSON.parse(cmplz_get_cookie("saved_services"))}catch(e){o={}}var c=cmplz_get_all_service_consents();cmplz_equals(n,t)&&cmplz_equals(o,c)||1!=complianz.store_consent||cmplz_is_bot()||cmplz_is_speedbot()||(cmplz_set_cookie("saved_categories",JSON.stringify(t)),cmplz_set_cookie("saved_services",JSON.stringify(c)),cmplz_consent_stored_once=!0,(e=new XMLHttpRequest).open("POST",complianz.url+"track",!0),c={consented_categories:t,consented_services:c,consenttype:window.wp_consent_type},e.setRequestHeader("Content-type","application/json"),e.send(JSON.stringify(c)))}function cmplz_accepted_categories(){let e=cmplz_categories,n=[];for(var t in e)e.hasOwnProperty(t)&&(t=e[t],cmplz_has_consent(t))&&n.push(t);return e=e.filter(function(e,t,c){return cmplz_in_array(e,n)})}function cmplz_sync_category_checkboxes(){for(var e in cmplz_categories)cmplz_categories.hasOwnProperty(e)&&(e=cmplz_categories[e],cmplz_has_consent(e)||"functional"===e?document.querySelectorAll("input.cmplz-"+e).forEach(e=>{e.checked=!0}):document.querySelectorAll("input.cmplz-"+e).forEach(e=>{e.checked=!1})),document.querySelectorAll(".cmplz-accept-service").forEach(e=>{var t=e.getAttribute("data-service"),c=e.getAttribute("data-category");cmplz_has_service_consent(t,c)?e.checked=!0:cmplz_is_service_denied(t)?e.checked=!1:(c=e.getAttribute("data-category"),e.checked=!!cmplz_has_consent(c))})}function cmplz_merge_object(e,t){var c,n,o={};for(c in t)t.hasOwnProperty(c)&&(o[c]=t[c]);for(n in e)t.hasOwnProperty(n)&&void 0!==t[n]||e.hasOwnProperty(n)&&(o[n]=e[n]);return o}function cmplz_clear_cookies(t){if("undefined"==typeof document)return!1;let a=!1,i="https:"===window.location.protocol?";secure":"",l="expires="+(new Date).toGMTString(),r=location.pathname.replace(/^\/|\/$/g,"").split("/");return document.cookie.split("; ").forEach(function(e){let n=e.split(";")[0].split("=")[0];if(-1!==n.indexOf(t)){a=!0;let c=window.location.hostname.split(".");var o=1<c.length;for(r.forEach(function(e){e="/"+e;document.cookie=encodeURIComponent(n)+"=;SameSite=Lax"+i+";"+l+";domain=."+c.join(".")+";path="+e,document.cookie=encodeURIComponent(n)+"=;SameSite=Lax"+i+";"+l+";domain=."+c.join(".")+";path="+e+"/"});0<c.length;){let t="."+c.join(".");c.shift(),o&&1===c.length&&c.shift(),r.forEach(function(e){e="/"+e;document.cookie=encodeURIComponent(n)+"=;SameSite=Lax"+i+";"+l+";domain="+t+";path="+e,document.cookie=encodeURIComponent(n)+"=;SameSite=Lax"+i+";"+l+";domain="+t+";path="+e+"/"})}}}),cmplz_set_accepted_cookie_policy_id(),a}function cmplz_set_accepted_cookie_policy_id(){cmplz_set_cookie("policy_id",complianz.current_policy_id)}function cmplz_integrations_init(){var e,t=complianz.set_cookies;for(e in t)t.hasOwnProperty(e)&&"1"===t[e][1]&&cmplz_set_cookie(e,t[e][1],!1)}function cmplz_integrations_revoke(){var e,t=complianz.set_cookies;for(e in t)t.hasOwnProperty(e)&&(cmplz_set_cookie(e,t[e][1],!1),0==t[e][1])&&cmplz_clear_cookies(e)}function cmplz_set_integrations_cookies(){var e,t=complianz.set_cookies;for(e in t)t.hasOwnProperty(e)&&cmplz_set_cookie(e,t[e][0],!1)}function cmplz_get_url_parameter(e,t){if(e&&void 0!==e&&-1!==e.indexOf("?")){e=e.split("?")[1];if(e){var c=e.split("&");for(let e=0;e<c.length;e++){var n=c[e].split("=");if(n[0]===t)return void 0===n[1]||decodeURIComponent(n[1])}}}return!1}function cmplz_maybe_auto_redirect(){var e=cmplz_get_url_parameter(window.location.href,"cmplz_region_redirect"),t=cmplz_get_url_parameter(window.location.href,"cmplz-region");e&&!t&&(e=window.location.href.split("#")[0]+"&cmplz-region="+complianz.region,t=window.location.hash,window.location.href=e+t)}function cmplz_wp_set_consent(e,t){"function"==typeof wp_set_consent&&wp_set_consent(e,t)}1==complianz.store_consent&&(cmplz_id_cookie=cmplz_get_cookie("id"),cmplz_id=cmplz_id_session="","undefined"!=typeof Storage&&sessionStorage.cmplz_id&&(cmplz_id_session=JSON.parse(sessionStorage.cmplz_id)),0==cmplz_id_cookie.length&&0<cmplz_id_session.length&&(cmplz_id=cmplz_id_session,cmplz_set_cookie("id",cmplz_id)),0<cmplz_id_cookie.length&&0==cmplz_id_session.length&&(cmplz_id=cmplz_id_cookie),"undefined"!=typeof Storage)&&(sessionStorage.cmplz_id=JSON.stringify(cmplz_id)),document.addEventListener("visibilitychange",function(){"hidden"===document.visibilityState&&cmplz_track_status_end()}),window.addEventListener("pagehide",cmplz_track_status_end,!1),window.addEventListener("beforeunload",cmplz_track_status_end,!1),document.addEventListener("cmplz_consent_action",function(e){cmplz_set_consent(e.detail.category,"allow"),cmplz_fire_categories_event(),cmplz_track_status()}),cmplz_add_event("click",".cmplz-accept",function(e){e.preventDefault(),setTimeout(()=>{cmplz_accept_all(),cmplz_set_banner_status("dismissed"),cmplz_fire_categories_event(),cmplz_track_status()},0)}),cmplz_add_event("click",".cmplz-accept-category, .cmplz-accept-marketing",function(e){e.preventDefault();var e=e.target,t=e.getAttribute("data-service"),e=e.getAttribute("data-category")||"marketing";1==complianz.clean_cookies&&void 0!==t&&t?(cmplz_set_service_consent(t,!0),cmplz_enable_category("","general"),cmplz_enable_category("",t)):cmplz_set_consent(e,"allow"),cmplz_set_banner_status("dismissed"),cmplz_fire_categories_event(),cmplz_track_status()}),cmplz_add_event("click",".cmplz-accept-service",function(e){var e=e.target;"INPUT"!==e.tagName&&(void 0!==(e=e.getAttribute("data-service"))&&(cmplz_set_service_consent(e,!0),cmplz_enable_category("","general"),cmplz_enable_category("",e)),cmplz_fire_categories_event(),cmplz_track_status())}),cmplz_add_event("change",".cmplz-accept-service",function(e){var t=e.target,c=t.tagName,n=t.getAttribute("data-service");void 0!==n&&("INPUT"===c?(cmplz_set_banner_status("dismissed"),t.checked?(cmplz_set_service_consent(n,!0),cmplz_enable_category("",n)):(cmplz_set_service_consent(n,!1),setTimeout(function(){cmplz_reload_browser_compatible()},500))):(e.preventDefault(),cmplz_set_service_consent(n,!0),cmplz_enable_category("","general"),cmplz_enable_category("",n),setTimeout(function(){cmplz_reload_browser_compatible()},500))),cmplz_fire_categories_event(),cmplz_track_status()}),cmplz_add_event("click",".cmplz-save-preferences",function(e){var t,c,n,o,a,e=e.target,i=(cmplz_banner=e.closest(".cmplz-cookiebanner"),[]);for(t in cmplz_categories)cmplz_categories.hasOwnProperty(t)&&(c=cmplz_categories[t],n=cmplz_banner.querySelector("input.cmplz-"+c))&&n.checked&&i.push(c);for(o in cmplz_fire_before_categories_consent(i),cmplz_categories)cmplz_categories.hasOwnProperty(o)&&(a=cmplz_categories[o],i.includes(a)?cmplz_set_consent(a,"allow"):cmplz_set_consent(a,"deny"));cmplz_set_banner_status("dismissed"),cmplz_fire_categories_event(),cmplz_track_status()}),cmplz_add_event("click",".cmplz-close",function(e){cmplz_set_banner_status("dismissed")}),cmplz_add_event("click",".cmplz-view-preferences",function(e){var e=e.target;(cmplz_banner=e.closest(".cmplz-cookiebanner")).querySelector(".cmplz-categories").classList.contains("cmplz-fade-in")?(cmplz_banner.classList.remove("cmplz-categories-visible"),cmplz_banner.querySelector(".cmplz-categories").classList.remove("cmplz-fade-in"),cmplz_banner.querySelector(".cmplz-view-preferences").style.display="block",cmplz_banner.querySelector(".cmplz-save-preferences").style.display="none"):(cmplz_banner.classList.add("cmplz-categories-visible"),cmplz_banner.querySelector(".cmplz-categories").classList.add("cmplz-fade-in"),cmplz_banner.querySelector(".cmplz-view-preferences").style.display="none",cmplz_banner.querySelector(".cmplz-save-preferences").style.display="block",(e=cmplz_banner.querySelector(".cmplz-categories .cmplz-category"))&&(e.setAttribute("tabindex","-1"),e.focus()))}),cmplz_add_event("change",".cmplz-manage-consent-container .cmplz-category",function(e){for(var t in cmplz_categories){var c;cmplz_categories.hasOwnProperty(t)&&(t=cmplz_categories[t],c=document.querySelector(".cmplz-manage-consent-container input.cmplz-"+t))&&(c.checked?cmplz_set_consent(t,"allow"):cmplz_set_consent(t,"deny"),cmplz_set_banner_status("dismissed"),cmplz_fire_categories_event(),cmplz_track_status())}}),cmplz_add_event("click",".cmplz-deny",function(e){e.preventDefault(),cmplz_set_banner_status("dismissed"),cmplz_deny_all()}),cmplz_add_event("click","button.cmplz-manage-settings",function(e){e.preventDefault();var e=document.querySelector(".cmplz-cookiebanner .cmplz-categories"),t=document.querySelector(".cmplz-save-settings"),c=document.querySelector("button.cmplz-manage-settings");cmplz_is_hidden(e)?(t.style.display="block",c.style.display="none",e.style.display="block"):(t.style.display="none",c.style.display="block",e.style.display="none")}),cmplz_add_event("click","button.cmplz-manage-consent",function(e){e.preventDefault(),cmplz_set_banner_status("show")});var cmplzCleanCookieInterval,cmplz_cookie_data=[];function cmplz_start_clean(){if(1==complianz.clean_cookies)if((cmplz_cookie_data="undefined"!=typeof Storage?JSON.parse(sessionStorage.getItem("cmplz_cookie_data")):cmplz_cookie_data)&&0!==cmplz_cookie_data.length)cmplz_setup_clean_interval();else{let e=new XMLHttpRequest;e.open("GET",complianz.url+"cookie_data",!0),e.setRequestHeader("Content-type","application/json"),e.send(),e.onload=function(){cmplz_cookie_data=JSON.parse(e.response),sessionStorage.setItem("cmplz_cookie_data",JSON.stringify(cmplz_cookie_data)),cmplz_setup_clean_interval()}}}function cmplz_do_cleanup(){var e;for(e of["preferences","statistics","marketing"])if(!cmplz_has_consent(e)&&cmplz_cookie_data.hasOwnProperty(e)){var t,c,n=cmplz_cookie_data[e];for(t in n)if(!cmplz_has_service_consent(t,e))for(c of n[t])cmplz_clear_cookies(c),cmplz_clear_storage(c)}}function cmplz_setup_clean_interval(){!cmplz_cookie_data||cmplzCleanCookieInterval||(cmplz_do_cleanup(),cmplzCleanCookieInterval=setInterval(cmplz_do_cleanup,1e3))}function cmplz_clear_storage(e){"undefined"!=typeof Storage&&(localStorage.getItem(e)&&localStorage.removeItem(e),sessionStorage.getItem(e))&&sessionStorage.removeItem(e)}function cmplz_load_manage_consent_container(){let c=document.querySelector(".cmplz-manage-consent-container");if(c){let t=new XMLHttpRequest;t.open("GET",complianz.url+"manage_consent_html?"+complianz.locale,!0),t.setRequestHeader("Content-type","application/json"),t.send(),t.onload=function(){var e=JSON.parse(t.response);c.insertAdjacentHTML("beforeend",e),cmplz_sync_category_checkboxes();document.querySelector("#cmplz-manage-consent-container-nojavascript").style.display="none",c.style.display="block";e=new CustomEvent("cmplz_manage_consent_container_loaded");document.dispatchEvent(e)}}}function cmplz_equals(c,n){if(Array.isArray(c)||(c=Object.keys(c),n=Object.keys(n)),!c||!n)return!1;if(c.length!==n.length)return!1;for(let e=0,t=c.length;e<t;e++)if(c[e]instanceof Array&&n[e]instanceof Array){if(!cmplz_equals(c[e],n[e]))return!1}else if(c[e]!==n[e])return!1;return!0}function cmplzCopyAttributes(e,t){let c=["type","data-service","data-category","async"];Array.from(e.attributes).forEach(e=>{"data-script-type"===e.nodeName&&"module"===e.nodeValue?(t.setAttribute("type","module"),t.removeAttribute("data-script-type")):c.includes(e.nodeName)||t.setAttribute(e.nodeName,e.nodeValue)})}cmplz_add_event("keypress",".cmplz-banner-slider label",function(e){32==(e.keyCode||e.which)&&document.activeElement.click()}),cmplz_add_event("keypress",".cmplz-cookiebanner .cmplz-header .cmplz-close",function(e){13==(e.keyCode||e.which)&&document.activeElement.click()});var cmplz_has_wp_video=document.querySelector(".cmplz-wp-video-shortcode"),cmplz_times_checked=0;void 0!==window.jQuery&&jQuery(document).ready(function(r){if(cmplz_has_wp_video){document.addEventListener("cmplz_enable_category",function(e){t()});let e=setInterval(function(){cmplz_times_checked+=1,document.querySelector(".cmplz-wp-video-shortcode")&&cmplz_times_checked<100?t():clearInterval(e)},500)}function t(){if(document.querySelector(".cmplz-wp-video-shortcode")){var e,t,n,o=cmplz_accepted_categories(),a=cmplz_get_all_service_consents(),i=[];for(e in o)if(o.hasOwnProperty(e)){var l=o[e];if("functional"===l)break;i.push('.cmplz-wp-video-shortcode[data-category="'+l+'"]')}for(t in a)a.hasOwnProperty(t)&&i.push('.cmplz-wp-video-shortcode[data-service="'+t+'"]');n=i.join(",");let c=!1;0<n.length&&document.querySelectorAll(n).forEach(e=>{c=!0,e.setAttribute("controls","controls"),e.classList.add("wp-video-shortcode","cmplz-processed"),e.classList.remove("cmplz-wp-video-shortcode"),e.closest(".cmplz-wp-video").classList.remove("cmplz-wp-video");var t=e.closest(".wp-video").querySelector(".cmplz-blocked-content-notice");t&&t.parentElement.removeChild(t),e.classList.remove("cmplz-blocked-content-container")}),c&&(window.wp.mediaelement?window.wp.mediaelement.initialize():(n={videoWidth:"100%",videoHeight:"100%",enableAutosize:!0},r(".wp-video-shortcode").mediaelementplayer(n)))}}function c(e){e=r(e);"function"==typeof e.parent().fitVids&&e.parent().fitVids()}document.querySelectorAll(".cmplz-video.cmplz-activated").forEach(e=>{c(e)}),document.addEventListener("cmplz_enable_category",function(e){document.querySelectorAll(".cmplz-video.cmplz-activated").forEach(e=>{c(e)})})});
window.Choices=function(e){var t={};function i(n){if(t[n])return t[n].exports;var s=t[n]={i:n,l:!1,exports:{}};return e[n].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)i.d(n,s,function(t){return e[t]}.bind(null,s));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="/public/assets/scripts/",i(i.s=4)}([function(e,t,i){"use strict";var n=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===s}(e)}(e)};var s="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function r(e,t){return!1!==t.clone&&t.isMergeableObject(e)?l((i=e,Array.isArray(i)?[]:{}),e,t):e;var i}function o(e,t,i){return e.concat(t).map((function(e){return r(e,i)}))}function a(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return e.propertyIsEnumerable(t)})):[]}(e))}function c(e,t,i){var n={};return i.isMergeableObject(e)&&a(e).forEach((function(t){n[t]=r(e[t],i)})),a(t).forEach((function(s){(function(e,t){try{return t in e&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}catch(e){return!1}})(e,s)||(i.isMergeableObject(t[s])&&e[s]?n[s]=function(e,t){if(!t.customMerge)return l;var i=t.customMerge(e);return"function"==typeof i?i:l}(s,i)(e[s],t[s],i):n[s]=r(t[s],i))})),n}function l(e,t,i){(i=i||{}).arrayMerge=i.arrayMerge||o,i.isMergeableObject=i.isMergeableObject||n,i.cloneUnlessOtherwiseSpecified=r;var s=Array.isArray(t);return s===Array.isArray(e)?s?i.arrayMerge(e,t,i):c(e,t,i):r(t,i)}l.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,i){return l(e,i,t)}),{})};var h=l;e.exports=h},function(e,t,i){"use strict";(function(e,n){var s,r=i(3);s="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==e?e:n;var o=Object(r.a)(s);t.a=o}).call(this,i(5),i(6)(e))},function(e,t,i){
e.exports=function(e){var t={};function i(n){if(t[n])return t[n].exports;var s=t[n]={i:n,l:!1,exports:{}};return e[n].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)i.d(n,s,function(t){return e[t]}.bind(null,s));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=1)}([function(e,t){e.exports=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,i){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var r=i(2),o=i(8),a=i(0),c=function(){function e(t,i){var n=i.location,s=void 0===n?0:n,r=i.distance,a=void 0===r?100:r,c=i.threshold,l=void 0===c?.6:c,h=i.maxPatternLength,u=void 0===h?32:h,d=i.caseSensitive,p=void 0!==d&&d,m=i.tokenSeparator,f=void 0===m?/ +/g:m,v=i.findAllMatches,g=void 0!==v&&v,_=i.minMatchCharLength,b=void 0===_?1:_,y=i.id,E=void 0===y?null:y,I=i.keys,S=void 0===I?[]:I,w=i.shouldSort,O=void 0===w||w,C=i.getFn,A=void 0===C?o:C,L=i.sortFn,T=void 0===L?function(e,t){return e.score-t.score}:L,x=i.tokenize,k=void 0!==x&&x,P=i.matchAllTokens,D=void 0!==P&&P,M=i.includeMatches,N=void 0!==M&&M,F=i.includeScore,j=void 0!==F&&F,K=i.verbose,R=void 0!==K&&K;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.options={location:s,distance:a,threshold:l,maxPatternLength:u,isCaseSensitive:p,tokenSeparator:f,findAllMatches:g,minMatchCharLength:b,id:E,keys:S,includeMatches:N,includeScore:j,shouldSort:O,getFn:A,sortFn:T,verbose:R,tokenize:k,matchAllTokens:D},this.setCollection(t)}var t,i;return t=e,(i=[{key:"setCollection",value:function(e){return this.list=e,e}},{key:"search",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{limit:!1};this._log('---------\nSearch pattern: "'.concat(e,'"'));var i=this._prepareSearchers(e),n=i.tokenSearchers,s=i.fullSearcher,r=this._search(n,s),o=r.weights,a=r.results;return this._computeScore(o,a),this.options.shouldSort&&this._sort(a),t.limit&&"number"==typeof t.limit&&(a=a.slice(0,t.limit)),this._format(a)}},{key:"_prepareSearchers",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=[];if(this.options.tokenize)for(var i=e.split(this.options.tokenSeparator),n=0,s=i.length;n<s;n+=1)t.push(new r(i[n],this.options));return{tokenSearchers:t,fullSearcher:new r(e,this.options)}}},{key:"_search",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,i=this.list,n={},s=[];if("string"==typeof i[0]){for(var r=0,o=i.length;r<o;r+=1)this._analyze({key:"",value:i[r],record:r,index:r},{resultMap:n,results:s,tokenSearchers:e,fullSearcher:t});return{weights:null,results:s}}for(var a={},c=0,l=i.length;c<l;c+=1)for(var h=i[c],u=0,d=this.options.keys.length;u<d;u+=1){var p=this.options.keys[u];if("string"!=typeof p){if(a[p.name]={weight:1-p.weight||1},p.weight<=0||p.weight>1)throw new Error("Key weight has to be > 0 and <=1");p=p.name}else a[p]={weight:1};this._analyze({key:p,value:this.options.getFn(h,p),record:h,index:c},{resultMap:n,results:s,tokenSearchers:e,fullSearcher:t})}return{weights:a,results:s}}},{key:"_analyze",value:function(e,t){var i=e.key,n=e.arrayIndex,s=void 0===n?-1:n,r=e.value,o=e.record,c=e.index,l=t.tokenSearchers,h=void 0===l?[]:l,u=t.fullSearcher,d=void 0===u?[]:u,p=t.resultMap,m=void 0===p?{}:p,f=t.results,v=void 0===f?[]:f;if(null!=r){var g=!1,_=-1,b=0;if("string"==typeof r){this._log("\nKey: ".concat(""===i?"-":i));var y=d.search(r);if(this._log('Full text: "'.concat(r,'", score: ').concat(y.score)),this.options.tokenize){for(var E=r.split(this.options.tokenSeparator),I=[],S=0;S<h.length;S+=1){var w=h[S];this._log('\nPattern: "'.concat(w.pattern,'"'));for(var O=!1,C=0;C<E.length;C+=1){var A=E[C],L=w.search(A),T={};L.isMatch?(T[A]=L.score,g=!0,O=!0,I.push(L.score)):(T[A]=1,this.options.matchAllTokens||I.push(1)),this._log('Token: "'.concat(A,'", score: ').concat(T[A]))}O&&(b+=1)}_=I[0];for(var x=I.length,k=1;k<x;k+=1)_+=I[k];_/=x,this._log("Token score average:",_)}var P=y.score;_>-1&&(P=(P+_)/2),this._log("Score average:",P);var D=!this.options.tokenize||!this.options.matchAllTokens||b>=h.length;if(this._log("\nCheck Matches: ".concat(D)),(g||y.isMatch)&&D){var M=m[c];M?M.output.push({key:i,arrayIndex:s,value:r,score:P,matchedIndices:y.matchedIndices}):(m[c]={item:o,output:[{key:i,arrayIndex:s,value:r,score:P,matchedIndices:y.matchedIndices}]},v.push(m[c]))}}else if(a(r))for(var N=0,F=r.length;N<F;N+=1)this._analyze({key:i,arrayIndex:N,value:r[N],record:o,index:c},{resultMap:m,results:v,tokenSearchers:h,fullSearcher:d})}}},{key:"_computeScore",value:function(e,t){this._log("\n\nComputing score:\n");for(var i=0,n=t.length;i<n;i+=1){for(var s=t[i].output,r=s.length,o=1,a=1,c=0;c<r;c+=1){var l=e?e[s[c].key].weight:1,h=(1===l?s[c].score:s[c].score||.001)*l;1!==l?a=Math.min(a,h):(s[c].nScore=h,o*=h)}t[i].score=1===a?o:a,this._log(t[i])}}},{key:"_sort",value:function(e){this._log("\n\nSorting...."),e.sort(this.options.sortFn)}},{key:"_format",value:function(e){var t=[];if(this.options.verbose){var i=[];this._log("\n\nOutput:\n\n",JSON.stringify(e,(function(e,t){if("object"===n(t)&&null!==t){if(-1!==i.indexOf(t))return;i.push(t)}return t}))),i=null}var s=[];this.options.includeMatches&&s.push((function(e,t){var i=e.output;t.matches=[];for(var n=0,s=i.length;n<s;n+=1){var r=i[n];if(0!==r.matchedIndices.length){var o={indices:r.matchedIndices,value:r.value};r.key&&(o.key=r.key),r.hasOwnProperty("arrayIndex")&&r.arrayIndex>-1&&(o.arrayIndex=r.arrayIndex),t.matches.push(o)}}})),this.options.includeScore&&s.push((function(e,t){t.score=e.score}));for(var r=0,o=e.length;r<o;r+=1){var a=e[r];if(this.options.id&&(a.item=this.options.getFn(a.item,this.options.id)[0]),s.length){for(var c={item:a.item},l=0,h=s.length;l<h;l+=1)s[l](a,c);t.push(c)}else t.push(a.item)}return t}},{key:"_log",value:function(){var e;this.options.verbose&&(e=console).log.apply(e,arguments)}}])&&s(t.prototype,i),e}();e.exports=c},function(e,t,i){function n(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var s=i(3),r=i(4),o=i(7),a=function(){function e(t,i){var n=i.location,s=void 0===n?0:n,r=i.distance,a=void 0===r?100:r,c=i.threshold,l=void 0===c?.6:c,h=i.maxPatternLength,u=void 0===h?32:h,d=i.isCaseSensitive,p=void 0!==d&&d,m=i.tokenSeparator,f=void 0===m?/ +/g:m,v=i.findAllMatches,g=void 0!==v&&v,_=i.minMatchCharLength,b=void 0===_?1:_;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.options={location:s,distance:a,threshold:l,maxPatternLength:u,isCaseSensitive:p,tokenSeparator:f,findAllMatches:g,minMatchCharLength:b},this.pattern=this.options.isCaseSensitive?t:t.toLowerCase(),this.pattern.length<=u&&(this.patternAlphabet=o(this.pattern))}var t,i;return t=e,(i=[{key:"search",value:function(e){if(this.options.isCaseSensitive||(e=e.toLowerCase()),this.pattern===e)return{isMatch:!0,score:0,matchedIndices:[[0,e.length-1]]};var t=this.options,i=t.maxPatternLength,n=t.tokenSeparator;if(this.pattern.length>i)return s(e,this.pattern,n);var o=this.options,a=o.location,c=o.distance,l=o.threshold,h=o.findAllMatches,u=o.minMatchCharLength;return r(e,this.pattern,this.patternAlphabet,{location:a,distance:c,threshold:l,findAllMatches:h,minMatchCharLength:u})}}])&&n(t.prototype,i),e}();e.exports=a},function(e,t){var i=/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g;e.exports=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:/ +/g,s=new RegExp(t.replace(i,"\\$&").replace(n,"|")),r=e.match(s),o=!!r,a=[];if(o)for(var c=0,l=r.length;c<l;c+=1){var h=r[c];a.push([e.indexOf(h),h.length-1])}return{score:o?.5:1,isMatch:o,matchedIndices:a}}},function(e,t,i){var n=i(5),s=i(6);e.exports=function(e,t,i,r){for(var o=r.location,a=void 0===o?0:o,c=r.distance,l=void 0===c?100:c,h=r.threshold,u=void 0===h?.6:h,d=r.findAllMatches,p=void 0!==d&&d,m=r.minMatchCharLength,f=void 0===m?1:m,v=a,g=e.length,_=u,b=e.indexOf(t,v),y=t.length,E=[],I=0;I<g;I+=1)E[I]=0;if(-1!==b){var S=n(t,{errors:0,currentLocation:b,expectedLocation:v,distance:l});if(_=Math.min(S,_),-1!==(b=e.lastIndexOf(t,v+y))){var w=n(t,{errors:0,currentLocation:b,expectedLocation:v,distance:l});_=Math.min(w,_)}}b=-1;for(var O=[],C=1,A=y+g,L=1<<y-1,T=0;T<y;T+=1){for(var x=0,k=A;x<k;)n(t,{errors:T,currentLocation:v+k,expectedLocation:v,distance:l})<=_?x=k:A=k,k=Math.floor((A-x)/2+x);A=k;var P=Math.max(1,v-k+1),D=p?g:Math.min(v+k,g)+y,M=Array(D+2);M[D+1]=(1<<T)-1;for(var N=D;N>=P;N-=1){var F=N-1,j=i[e.charAt(F)];if(j&&(E[F]=1),M[N]=(M[N+1]<<1|1)&j,0!==T&&(M[N]|=(O[N+1]|O[N])<<1|1|O[N+1]),M[N]&L&&(C=n(t,{errors:T,currentLocation:F,expectedLocation:v,distance:l}))<=_){if(_=C,(b=F)<=v)break;P=Math.max(1,2*v-b)}}if(n(t,{errors:T+1,currentLocation:v,expectedLocation:v,distance:l})>_)break;O=M}return{isMatch:b>=0,score:0===C?.001:C,matchedIndices:s(E,f)}}},function(e,t){e.exports=function(e,t){var i=t.errors,n=void 0===i?0:i,s=t.currentLocation,r=void 0===s?0:s,o=t.expectedLocation,a=void 0===o?0:o,c=t.distance,l=void 0===c?100:c,h=n/e.length,u=Math.abs(a-r);return l?h+u/l:u?1:h}},function(e,t){e.exports=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=[],n=-1,s=-1,r=0,o=e.length;r<o;r+=1){var a=e[r];a&&-1===n?n=r:a||-1===n||((s=r-1)-n+1>=t&&i.push([n,s]),n=-1)}return e[r-1]&&r-n>=t&&i.push([n,r-1]),i}},function(e,t){e.exports=function(e){for(var t={},i=e.length,n=0;n<i;n+=1)t[e.charAt(n)]=0;for(var s=0;s<i;s+=1)t[e.charAt(s)]|=1<<i-s-1;return t}},function(e,t,i){var n=i(0);e.exports=function(e,t){return function e(t,i,s){if(i){var r=i.indexOf("."),o=i,a=null;-1!==r&&(o=i.slice(0,r),a=i.slice(r+1));var c=t[o];if(null!=c)if(a||"string"!=typeof c&&"number"!=typeof c)if(n(c))for(var l=0,h=c.length;l<h;l+=1)e(c[l],a,s);else a&&e(c,a,s);else s.push(c.toString())}else s.push(t);return s}(e,t,[])}}])},function(e,t,i){"use strict";function n(e){var t,i=e.Symbol;return"function"==typeof i?i.observable?t=i.observable:(t=i("observable"),i.observable=t):t="@@observable",t}i.d(t,"a",(function(){return n}))},function(e,t,i){e.exports=i(7)},function(e,t){var i;i=function(){return this}();try{i=i||new Function("return this")()}catch(e){"object"==typeof window&&(i=window)}e.exports=i},function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},function(e,t,i){"use strict";i.r(t);var n=i(2),s=i.n(n),r=i(0),o=i.n(r),a=i(1),c=function(){return Math.random().toString(36).substring(7).split("").join(".")},l={INIT:"@@redux/INIT"+c(),REPLACE:"@@redux/REPLACE"+c(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+c()}};function h(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function u(e,t,i){var n;if("function"==typeof t&&"function"==typeof i||"function"==typeof i&&"function"==typeof arguments[3])throw new Error("It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function.");if("function"==typeof t&&void 0===i&&(i=t,t=void 0),void 0!==i){if("function"!=typeof i)throw new Error("Expected the enhancer to be a function.");return i(u)(e,t)}if("function"!=typeof e)throw new Error("Expected the reducer to be a function.");var s=e,r=t,o=[],c=o,d=!1;function p(){c===o&&(c=o.slice())}function m(){if(d)throw new Error("You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return r}function f(e){if("function"!=typeof e)throw new Error("Expected the listener to be a function.");if(d)throw new Error("You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api-reference/store#subscribe(listener) for more details.");var t=!0;return p(),c.push(e),function(){if(t){if(d)throw new Error("You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api-reference/store#subscribe(listener) for more details.");t=!1,p();var i=c.indexOf(e);c.splice(i,1)}}}function v(e){if(!h(e))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(void 0===e.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(d)throw new Error("Reducers may not dispatch actions.");try{d=!0,r=s(r,e)}finally{d=!1}for(var t=o=c,i=0;i<t.length;i++){(0,t[i])()}return e}return v({type:l.INIT}),(n={dispatch:v,subscribe:f,getState:m,replaceReducer:function(e){if("function"!=typeof e)throw new Error("Expected the nextReducer to be a function.");s=e,v({type:l.REPLACE})}})[a.a]=function(){var e,t=f;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new TypeError("Expected the observer to be an object.");function i(){e.next&&e.next(m())}return i(),{unsubscribe:t(i)}}})[a.a]=function(){return this},e},n}function d(e,t){var i=t&&t.type;return"Given "+(i&&'action "'+String(i)+'"'||"an action")+', reducer "'+e+'" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.'}var p=[];var m=[];var f=[];var v,g={loading:!1},_=function(e,t){switch(void 0===e&&(e=g),t.type){case"SET_IS_LOADING":return{loading:t.isLoading};default:return e}},b=function(e){return Array.from({length:e},(function(){return(e=0,t=36,Math.floor(Math.random()*(t-e)+e)).toString(36);var e,t})).join("")},y=function(e,t){var i=e.id||e.name&&e.name+"-"+b(2)||b(4);return i=t+"-"+(i=i.replace(/(:|\.|\[|\]|,)/g,""))},E=function(e){return Object.prototype.toString.call(e).slice(8,-1)},I=function(e,t){return null!=t&&E(t)===e},S=function(e){return"string"!=typeof e?e:e.replace(/&/g,"&amp;").replace(/>/g,"&rt;").replace(/</g,"&lt;").replace(/"/g,"&quot;")},w=(v=document.createElement("div"),function(e){var t=e.trim();v.innerHTML=t;for(var i=v.children[0];v.firstChild;)v.removeChild(v.firstChild);return i}),O=function(e,t){return e.score-t.score},C=function(e){return JSON.parse(JSON.stringify(e))},A=function(e,t){var i=Object.keys(e).sort(),n=Object.keys(t).sort();return i.filter((function(e){return n.indexOf(e)<0}))},L=function(e){for(var t=Object.keys(e),i={},n=0;n<t.length;n++){var s=t[n];0,"function"==typeof e[s]&&(i[s]=e[s])}var r,o=Object.keys(i);try{!function(e){Object.keys(e).forEach((function(t){var i=e[t];if(void 0===i(void 0,{type:l.INIT}))throw new Error('Reducer "'+t+"\" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.");if(void 0===i(void 0,{type:l.PROBE_UNKNOWN_ACTION()}))throw new Error('Reducer "'+t+"\" returned undefined when probed with a random type. Don't try to handle "+l.INIT+' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.')}))}(i)}catch(e){r=e}return function(e,t){if(void 0===e&&(e={}),r)throw r;for(var n=!1,s={},a=0;a<o.length;a++){var c=o[a],l=i[c],h=e[c],u=l(h,t);if(void 0===u){var p=d(c,t);throw new Error(p)}s[c]=u,n=n||u!==h}return n?s:e}}({items:function(e,t){switch(void 0===e&&(e=p),t.type){case"ADD_ITEM":return[].concat(e,[{id:t.id,choiceId:t.choiceId,groupId:t.groupId,value:t.value,label:t.label,active:!0,highlighted:!1,customProperties:t.customProperties,placeholder:t.placeholder||!1,keyCode:null}]).map((function(e){var t=e;return t.highlighted=!1,t}));case"REMOVE_ITEM":return e.map((function(e){var i=e;return i.id===t.id&&(i.active=!1),i}));case"HIGHLIGHT_ITEM":return e.map((function(e){var i=e;return i.id===t.id&&(i.highlighted=t.highlighted),i}));default:return e}},groups:function(e,t){switch(void 0===e&&(e=m),t.type){case"ADD_GROUP":return[].concat(e,[{id:t.id,value:t.value,active:t.active,disabled:t.disabled}]);case"CLEAR_CHOICES":return[];default:return e}},choices:function(e,t){switch(void 0===e&&(e=f),t.type){case"ADD_CHOICE":return[].concat(e,[{id:t.id,elementId:t.elementId,groupId:t.groupId,value:t.value,label:t.label||t.value,disabled:t.disabled||!1,selected:!1,active:!0,score:9999,customProperties:t.customProperties,placeholder:t.placeholder||!1,keyCode:null}]);case"ADD_ITEM":return t.activateOptions?e.map((function(e){var i=e;return i.active=t.active,i})):t.choiceId>-1?e.map((function(e){var i=e;return i.id===parseInt(t.choiceId,10)&&(i.selected=!0),i})):e;case"REMOVE_ITEM":return t.choiceId>-1?e.map((function(e){var i=e;return i.id===parseInt(t.choiceId,10)&&(i.selected=!1),i})):e;case"FILTER_CHOICES":return e.map((function(e){var i=e;return i.active=t.results.some((function(e){var t=e.item,n=e.score;return t.id===i.id&&(i.score=n,!0)})),i}));case"ACTIVATE_CHOICES":return e.map((function(e){var i=e;return i.active=t.active,i}));case"CLEAR_CHOICES":return f;default:return e}},general:_}),T=function(e,t){var i=e;if("CLEAR_ALL"===t.type)i=void 0;else if("RESET_TO"===t.type)return C(t.state);return L(i,t)};function x(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var k=function(){function e(){this._store=u(T,window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__())}var t,i,n,s=e.prototype;return s.subscribe=function(e){this._store.subscribe(e)},s.dispatch=function(e){this._store.dispatch(e)},s.isLoading=function(){return this.state.general.loading},s.getChoiceById=function(e){return this.activeChoices.find((function(t){return t.id===parseInt(e,10)}))},s.getGroupById=function(e){return this.groups.find((function(t){return t.id===e}))},t=e,(i=[{key:"state",get:function(){return this._store.getState()}},{key:"items",get:function(){return this.state.items}},{key:"activeItems",get:function(){return this.items.filter((function(e){return!0===e.active}))}},{key:"highlightedActiveItems",get:function(){return this.items.filter((function(e){return e.active&&e.highlighted}))}},{key:"choices",get:function(){return this.state.choices}},{key:"activeChoices",get:function(){return this.choices.filter((function(e){return!0===e.active}))}},{key:"selectableChoices",get:function(){return this.choices.filter((function(e){return!0!==e.disabled}))}},{key:"searchableChoices",get:function(){return this.selectableChoices.filter((function(e){return!0!==e.placeholder}))}},{key:"placeholderChoice",get:function(){return[].concat(this.choices).reverse().find((function(e){return!0===e.placeholder}))}},{key:"groups",get:function(){return this.state.groups}},{key:"activeGroups",get:function(){var e=this.groups,t=this.choices;return e.filter((function(e){var i=!0===e.active&&!1===e.disabled,n=t.some((function(e){return!0===e.active&&!1===e.disabled}));return i&&n}),[])}}])&&x(t.prototype,i),n&&x(t,n),e}();function P(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var D=function(){function e(e){var t=e.element,i=e.type,n=e.classNames;this.element=t,this.classNames=n,this.type=i,this.isActive=!1}var t,i,n,s=e.prototype;return s.getChild=function(e){return this.element.querySelector(e)},s.show=function(){return this.element.classList.add(this.classNames.activeState),this.element.setAttribute("aria-expanded","true"),this.isActive=!0,this},s.hide=function(){return this.element.classList.remove(this.classNames.activeState),this.element.setAttribute("aria-expanded","false"),this.isActive=!1,this},t=e,(i=[{key:"distanceFromTopWindow",get:function(){return this.element.getBoundingClientRect().bottom}}])&&P(t.prototype,i),n&&P(t,n),e}(),M={items:[],choices:[],silent:!1,renderChoiceLimit:-1,maxItemCount:-1,addItems:!0,addItemFilter:null,removeItems:!0,removeItemButton:!1,editItems:!1,duplicateItemsAllowed:!0,delimiter:",",paste:!0,searchEnabled:!0,searchChoices:!0,searchFloor:1,searchResultLimit:4,searchFields:["label","value"],position:"auto",resetScrollPosition:!0,shouldSort:!0,shouldSortItems:!1,sorter:function(e,t){var i=e.value,n=e.label,s=void 0===n?i:n,r=t.value,o=t.label,a=void 0===o?r:o;return s.localeCompare(a,[],{sensitivity:"base",ignorePunctuation:!0,numeric:!0})},placeholder:!0,placeholderValue:null,searchPlaceholderValue:null,prependValue:null,appendValue:null,renderSelectedChoices:"auto",loadingText:"Loading...",noResultsText:"No results found",noChoicesText:"No choices to choose from",itemSelectText:"Press to select",uniqueItemText:"Only unique values can be added",customAddItemText:"Only values matching specific conditions can be added",addItemText:function(e){return'Press Enter to add <b>"'+S(e)+'"</b>'},maxItemText:function(e){return"Only "+e+" values can be added"},valueComparer:function(e,t){return e===t},fuseOptions:{includeScore:!0},callbackOnInit:null,callbackOnCreateTemplates:null,classNames:{containerOuter:"choices",containerInner:"choices__inner",input:"choices__input",inputCloned:"choices__input--cloned",list:"choices__list",listItems:"choices__list--multiple",listSingle:"choices__list--single",listDropdown:"choices__list--dropdown",item:"choices__item",itemSelectable:"choices__item--selectable",itemDisabled:"choices__item--disabled",itemChoice:"choices__item--choice",placeholder:"choices__placeholder",group:"choices__group",groupHeading:"choices__heading",button:"choices__button",activeState:"is-active",focusState:"is-focused",openState:"is-open",disabledState:"is-disabled",highlightedState:"is-highlighted",selectedState:"is-selected",flippedState:"is-flipped",loadingState:"is-loading",noResults:"has-no-results",noChoices:"has-no-choices"}},N="showDropdown",F="hideDropdown",j="change",K="choice",R="search",H="addItem",B="removeItem",V="highlightItem",G="highlightChoice",q="ADD_CHOICE",U="FILTER_CHOICES",z="ACTIVATE_CHOICES",W="CLEAR_CHOICES",X="ADD_GROUP",$="ADD_ITEM",J="REMOVE_ITEM",Y="HIGHLIGHT_ITEM",Z=46,Q=8,ee=13,te=65,ie=27,ne=38,se=40,re=33,oe=34,ae="text",ce="select-one",le="select-multiple",he=function(){function e(e){var t=e.element,i=e.type,n=e.classNames,s=e.position;this.element=t,this.classNames=n,this.type=i,this.position=s,this.isOpen=!1,this.isFlipped=!1,this.isFocussed=!1,this.isDisabled=!1,this.isLoading=!1,this._onFocus=this._onFocus.bind(this),this._onBlur=this._onBlur.bind(this)}var t=e.prototype;return t.addEventListeners=function(){this.element.addEventListener("focus",this._onFocus),this.element.addEventListener("blur",this._onBlur)},t.removeEventListeners=function(){this.element.removeEventListener("focus",this._onFocus),this.element.removeEventListener("blur",this._onBlur)},t.shouldFlip=function(e){if("number"!=typeof e)return!1;var t=!1;return"auto"===this.position?t=!window.matchMedia("(min-height: "+(e+1)+"px)").matches:"top"===this.position&&(t=!0),t},t.setActiveDescendant=function(e){this.element.setAttribute("aria-activedescendant",e)},t.removeActiveDescendant=function(){this.element.removeAttribute("aria-activedescendant")},t.open=function(e){this.element.classList.add(this.classNames.openState),this.element.setAttribute("aria-expanded","true"),this.isOpen=!0,this.shouldFlip(e)&&(this.element.classList.add(this.classNames.flippedState),this.isFlipped=!0)},t.close=function(){this.element.classList.remove(this.classNames.openState),this.element.setAttribute("aria-expanded","false"),this.removeActiveDescendant(),this.isOpen=!1,this.isFlipped&&(this.element.classList.remove(this.classNames.flippedState),this.isFlipped=!1)},t.focus=function(){this.isFocussed||this.element.focus()},t.addFocusState=function(){this.element.classList.add(this.classNames.focusState)},t.removeFocusState=function(){this.element.classList.remove(this.classNames.focusState)},t.enable=function(){this.element.classList.remove(this.classNames.disabledState),this.element.removeAttribute("aria-disabled"),this.type===ce&&this.element.setAttribute("tabindex","0"),this.isDisabled=!1},t.disable=function(){this.element.classList.add(this.classNames.disabledState),this.element.setAttribute("aria-disabled","true"),this.type===ce&&this.element.setAttribute("tabindex","-1"),this.isDisabled=!0},t.wrap=function(e){!function(e,t){void 0===t&&(t=document.createElement("div")),e.nextSibling?e.parentNode.insertBefore(t,e.nextSibling):e.parentNode.appendChild(t),t.appendChild(e)}(e,this.element)},t.unwrap=function(e){this.element.parentNode.insertBefore(e,this.element),this.element.parentNode.removeChild(this.element)},t.addLoadingState=function(){this.element.classList.add(this.classNames.loadingState),this.element.setAttribute("aria-busy","true"),this.isLoading=!0},t.removeLoadingState=function(){this.element.classList.remove(this.classNames.loadingState),this.element.removeAttribute("aria-busy"),this.isLoading=!1},t._onFocus=function(){this.isFocussed=!0},t._onBlur=function(){this.isFocussed=!1},e}();function ue(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var de=function(){function e(e){var t=e.element,i=e.type,n=e.classNames,s=e.preventPaste;this.element=t,this.type=i,this.classNames=n,this.preventPaste=s,this.isFocussed=this.element===document.activeElement,this.isDisabled=t.disabled,this._onPaste=this._onPaste.bind(this),this._onInput=this._onInput.bind(this),this._onFocus=this._onFocus.bind(this),this._onBlur=this._onBlur.bind(this)}var t,i,n,s=e.prototype;return s.addEventListeners=function(){this.element.addEventListener("paste",this._onPaste),this.element.addEventListener("input",this._onInput,{passive:!0}),this.element.addEventListener("focus",this._onFocus,{passive:!0}),this.element.addEventListener("blur",this._onBlur,{passive:!0})},s.removeEventListeners=function(){this.element.removeEventListener("input",this._onInput,{passive:!0}),this.element.removeEventListener("paste",this._onPaste),this.element.removeEventListener("focus",this._onFocus,{passive:!0}),this.element.removeEventListener("blur",this._onBlur,{passive:!0})},s.enable=function(){this.element.removeAttribute("disabled"),this.isDisabled=!1},s.disable=function(){this.element.setAttribute("disabled",""),this.isDisabled=!0},s.focus=function(){this.isFocussed||this.element.focus()},s.blur=function(){this.isFocussed&&this.element.blur()},s.clear=function(e){return void 0===e&&(e=!0),this.element.value&&(this.element.value=""),e&&this.setWidth(),this},s.setWidth=function(){var e=this.element,t=e.style,i=e.value,n=e.placeholder;t.minWidth=n.length+1+"ch",t.width=i.length+1+"ch"},s.setActiveDescendant=function(e){this.element.setAttribute("aria-activedescendant",e)},s.removeActiveDescendant=function(){this.element.removeAttribute("aria-activedescendant")},s._onInput=function(){this.type!==ce&&this.setWidth()},s._onPaste=function(e){this.preventPaste&&e.preventDefault()},s._onFocus=function(){this.isFocussed=!0},s._onBlur=function(){this.isFocussed=!1},t=e,(i=[{key:"placeholder",set:function(e){this.element.placeholder=e}},{key:"value",get:function(){return S(this.element.value)},set:function(e){this.element.value=e}}])&&ue(t.prototype,i),n&&ue(t,n),e}(),pe=function(){function e(e){var t=e.element;this.element=t,this.scrollPos=this.element.scrollTop,this.height=this.element.offsetHeight}var t=e.prototype;return t.clear=function(){this.element.innerHTML=""},t.append=function(e){this.element.appendChild(e)},t.getChild=function(e){return this.element.querySelector(e)},t.hasChildren=function(){return this.element.hasChildNodes()},t.scrollToTop=function(){this.element.scrollTop=0},t.scrollToChildElement=function(e,t){var i=this;if(e){var n=this.element.offsetHeight,s=this.element.scrollTop+n,r=e.offsetHeight,o=e.offsetTop+r,a=t>0?this.element.scrollTop+o-s:e.offsetTop;requestAnimationFrame((function(){i._animateScroll(a,t)}))}},t._scrollDown=function(e,t,i){var n=(i-e)/t,s=n>1?n:1;this.element.scrollTop=e+s},t._scrollUp=function(e,t,i){var n=(e-i)/t,s=n>1?n:1;this.element.scrollTop=e-s},t._animateScroll=function(e,t){var i=this,n=this.element.scrollTop,s=!1;t>0?(this._scrollDown(n,4,e),n<e&&(s=!0)):(this._scrollUp(n,4,e),n>e&&(s=!0)),s&&requestAnimationFrame((function(){i._animateScroll(e,t)}))},e}();function me(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var fe=function(){function e(e){var t=e.element,i=e.classNames;if(this.element=t,this.classNames=i,!(t instanceof HTMLInputElement||t instanceof HTMLSelectElement))throw new TypeError("Invalid element passed");this.isDisabled=!1}var t,i,n,s=e.prototype;return s.conceal=function(){this.element.classList.add(this.classNames.input),this.element.hidden=!0,this.element.tabIndex=-1;var e=this.element.getAttribute("style");e&&this.element.setAttribute("data-choice-orig-style",e),this.element.setAttribute("data-choice","active")},s.reveal=function(){this.element.classList.remove(this.classNames.input),this.element.hidden=!1,this.element.removeAttribute("tabindex");var e=this.element.getAttribute("data-choice-orig-style");e?(this.element.removeAttribute("data-choice-orig-style"),this.element.setAttribute("style",e)):this.element.removeAttribute("style"),this.element.removeAttribute("data-choice"),this.element.value=this.element.value},s.enable=function(){this.element.removeAttribute("disabled"),this.element.disabled=!1,this.isDisabled=!1},s.disable=function(){this.element.setAttribute("disabled",""),this.element.disabled=!0,this.isDisabled=!0},s.triggerEvent=function(e,t){!function(e,t,i){void 0===i&&(i=null);var n=new CustomEvent(t,{detail:i,bubbles:!0,cancelable:!0});e.dispatchEvent(n)}(this.element,e,t)},t=e,(i=[{key:"isActive",get:function(){return"active"===this.element.dataset.choice}},{key:"dir",get:function(){return this.element.dir}},{key:"value",get:function(){return this.element.value},set:function(e){this.element.value=e}}])&&me(t.prototype,i),n&&me(t,n),e}();function ve(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var ge=function(e){var t,i,n,s,r;function o(t){var i,n=t.element,s=t.classNames,r=t.delimiter;return(i=e.call(this,{element:n,classNames:s})||this).delimiter=r,i}return i=e,(t=o).prototype=Object.create(i.prototype),t.prototype.constructor=t,t.__proto__=i,n=o,(s=[{key:"value",get:function(){return this.element.value},set:function(e){var t=e.map((function(e){return e.value})).join(this.delimiter);this.element.setAttribute("value",t),this.element.value=t}}])&&ve(n.prototype,s),r&&ve(n,r),o}(fe);function _e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var be=function(e){var t,i,n,s,r;function o(t){var i,n=t.element,s=t.classNames,r=t.template;return(i=e.call(this,{element:n,classNames:s})||this).template=r,i}return i=e,(t=o).prototype=Object.create(i.prototype),t.prototype.constructor=t,t.__proto__=i,o.prototype.appendDocFragment=function(e){this.element.innerHTML="",this.element.appendChild(e)},n=o,(s=[{key:"placeholderOption",get:function(){return this.element.querySelector('option[value=""]')||this.element.querySelector("option[placeholder]")}},{key:"optionGroups",get:function(){return Array.from(this.element.getElementsByTagName("OPTGROUP"))}},{key:"options",get:function(){return Array.from(this.element.options)},set:function(e){var t=this,i=document.createDocumentFragment();e.forEach((function(e){return n=e,s=t.template(n),void i.appendChild(s);var n,s})),this.appendDocFragment(i)}}])&&_e(n.prototype,s),r&&_e(n,r),o}(fe),ye={containerOuter:function(e,t,i,n,s,r){var o=e.containerOuter,a=Object.assign(document.createElement("div"),{className:o});return a.dataset.type=r,t&&(a.dir=t),n&&(a.tabIndex=0),i&&(a.setAttribute("role",s?"combobox":"listbox"),s&&a.setAttribute("aria-autocomplete","list")),a.setAttribute("aria-haspopup","true"),a.setAttribute("aria-expanded","false"),a},containerInner:function(e){var t=e.containerInner;return Object.assign(document.createElement("div"),{className:t})},itemList:function(e,t){var i=e.list,n=e.listSingle,s=e.listItems;return Object.assign(document.createElement("div"),{className:i+" "+(t?n:s)})},placeholder:function(e,t){var i=e.placeholder;return Object.assign(document.createElement("div"),{className:i,innerHTML:t})},item:function(e,t,i){var n=e.item,s=e.button,r=e.highlightedState,o=e.itemSelectable,a=e.placeholder,c=t.id,l=t.value,h=t.label,u=t.customProperties,d=t.active,p=t.disabled,m=t.highlighted,f=t.placeholder,v=Object.assign(document.createElement("div"),{className:n,innerHTML:h});if(Object.assign(v.dataset,{item:"",id:c,value:l,customProperties:u}),d&&v.setAttribute("aria-selected","true"),p&&v.setAttribute("aria-disabled","true"),f&&v.classList.add(a),v.classList.add(m?r:o),i){p&&v.classList.remove(o),v.dataset.deletable="";var g=Object.assign(document.createElement("button"),{type:"button",className:s,innerHTML:"Remove item"});g.setAttribute("aria-label","Remove item: '"+l+"'"),g.dataset.button="",v.appendChild(g)}return v},choiceList:function(e,t){var i=e.list,n=Object.assign(document.createElement("div"),{className:i});return t||n.setAttribute("aria-multiselectable","true"),n.setAttribute("role","listbox"),n},choiceGroup:function(e,t){var i=e.group,n=e.groupHeading,s=e.itemDisabled,r=t.id,o=t.value,a=t.disabled,c=Object.assign(document.createElement("div"),{className:i+" "+(a?s:"")});return c.setAttribute("role","group"),Object.assign(c.dataset,{group:"",id:r,value:o}),a&&c.setAttribute("aria-disabled","true"),c.appendChild(Object.assign(document.createElement("div"),{className:n,innerHTML:o})),c},choice:function(e,t,i){var n=e.item,s=e.itemChoice,r=e.itemSelectable,o=e.selectedState,a=e.itemDisabled,c=e.placeholder,l=t.id,h=t.value,u=t.label,d=t.groupId,p=t.elementId,m=t.disabled,f=t.selected,v=t.placeholder,g=Object.assign(document.createElement("div"),{id:p,innerHTML:u,className:n+" "+s});return f&&g.classList.add(o),v&&g.classList.add(c),g.setAttribute("role",d>0?"treeitem":"option"),Object.assign(g.dataset,{choice:"",id:l,value:h,selectText:i}),m?(g.classList.add(a),g.dataset.choiceDisabled="",g.setAttribute("aria-disabled","true")):(g.classList.add(r),g.dataset.choiceSelectable=""),g},input:function(e,t){var i=e.input,n=e.inputCloned,s=Object.assign(document.createElement("input"),{type:"text",className:i+" "+n,autocomplete:"off",autocapitalize:"off",spellcheck:!1});return s.setAttribute("role","textbox"),s.setAttribute("aria-autocomplete","list"),s.setAttribute("aria-label",t),s},dropdown:function(e){var t=e.list,i=e.listDropdown,n=document.createElement("div");return n.classList.add(t,i),n.setAttribute("aria-expanded","false"),n},notice:function(e,t,i){var n=e.item,s=e.itemChoice,r=e.noResults,o=e.noChoices;void 0===i&&(i="");var a=[n,s];return"no-choices"===i?a.push(o):"no-results"===i&&a.push(r),Object.assign(document.createElement("div"),{innerHTML:t,className:a.join(" ")})},option:function(e){var t=e.label,i=e.value,n=e.customProperties,s=e.active,r=e.disabled,o=new Option(t,i,!1,s);return n&&(o.dataset.customProperties=n),o.disabled=r,o}},Ee=function(e){return void 0===e&&(e=!0),{type:z,active:e}},Ie=function(e,t){return{type:Y,id:e,highlighted:t}},Se=function(e){var t=e.value,i=e.id,n=e.active,s=e.disabled;return{type:X,value:t,id:i,active:n,disabled:s}},we=function(e){return{type:"SET_IS_LOADING",isLoading:e}};function Oe(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var Ce="-ms-scroll-limit"in document.documentElement.style&&"-ms-ime-align"in document.documentElement.style,Ae={},Le=function(){var e,t,i;function n(e,t){var i=this;void 0===e&&(e="[data-choice]"),void 0===t&&(t={}),this.config=o.a.all([M,n.defaults.options,t],{arrayMerge:function(e,t){return[].concat(t)}});var s=A(this.config,M);s.length&&console.warn("Unknown config option(s) passed",s.join(", "));var r="string"==typeof e?document.querySelector(e):e;if(!(r instanceof HTMLInputElement||r instanceof HTMLSelectElement))throw TypeError("Expected one of the following types text|select-one|select-multiple");if(this._isTextElement=r.type===ae,this._isSelectOneElement=r.type===ce,this._isSelectMultipleElement=r.type===le,this._isSelectElement=this._isSelectOneElement||this._isSelectMultipleElement,this.config.searchEnabled=this._isSelectMultipleElement||this.config.searchEnabled,["auto","always"].includes(this.config.renderSelectedChoices)||(this.config.renderSelectedChoices="auto"),t.addItemFilter&&"function"!=typeof t.addItemFilter){var a=t.addItemFilter instanceof RegExp?t.addItemFilter:new RegExp(t.addItemFilter);this.config.addItemFilter=a.test.bind(a)}if(this._isTextElement?this.passedElement=new ge({element:r,classNames:this.config.classNames,delimiter:this.config.delimiter}):this.passedElement=new be({element:r,classNames:this.config.classNames,template:function(e){return i._templates.option(e)}}),this.initialised=!1,this._store=new k,this._initialState={},this._currentState={},this._prevState={},this._currentValue="",this._canSearch=this.config.searchEnabled,this._isScrollingOnIe=!1,this._highlightPosition=0,this._wasTap=!0,this._placeholderValue=this._generatePlaceholderValue(),this._baseId=y(this.passedElement.element,"choices-"),this._direction=this.passedElement.dir,!this._direction){var c=window.getComputedStyle(this.passedElement.element).direction;c!==window.getComputedStyle(document.documentElement).direction&&(this._direction=c)}if(this._idNames={itemChoice:"item-choice"},this._presetGroups=this.passedElement.optionGroups,this._presetOptions=this.passedElement.options,this._presetChoices=this.config.choices,this._presetItems=this.config.items,this.passedElement.value&&(this._presetItems=this._presetItems.concat(this.passedElement.value.split(this.config.delimiter))),this.passedElement.options&&this.passedElement.options.forEach((function(e){i._presetChoices.push({value:e.value,label:e.innerHTML,selected:e.selected,disabled:e.disabled||e.parentNode.disabled,placeholder:""===e.value||e.hasAttribute("placeholder"),customProperties:e.getAttribute("data-custom-properties")})})),this._render=this._render.bind(this),this._onFocus=this._onFocus.bind(this),this._onBlur=this._onBlur.bind(this),this._onKeyUp=this._onKeyUp.bind(this),this._onKeyDown=this._onKeyDown.bind(this),this._onClick=this._onClick.bind(this),this._onTouchMove=this._onTouchMove.bind(this),this._onTouchEnd=this._onTouchEnd.bind(this),this._onMouseDown=this._onMouseDown.bind(this),this._onMouseOver=this._onMouseOver.bind(this),this._onFormReset=this._onFormReset.bind(this),this._onAKey=this._onAKey.bind(this),this._onEnterKey=this._onEnterKey.bind(this),this._onEscapeKey=this._onEscapeKey.bind(this),this._onDirectionKey=this._onDirectionKey.bind(this),this._onDeleteKey=this._onDeleteKey.bind(this),this.passedElement.isActive)return this.config.silent||console.warn("Trying to initialise Choices on element already initialised"),void(this.initialised=!0);this.init()}e=n,i=[{key:"defaults",get:function(){return Object.preventExtensions({get options(){return Ae},get templates(){return ye}})}}],(t=null)&&Oe(e.prototype,t),i&&Oe(e,i);var r=n.prototype;return r.init=function(){if(!this.initialised){this._createTemplates(),this._createElements(),this._createStructure(),this._initialState=C(this._store.state),this._store.subscribe(this._render),this._render(),this._addEventListeners(),(!this.config.addItems||this.passedElement.element.hasAttribute("disabled"))&&this.disable(),this.initialised=!0;var e=this.config.callbackOnInit;e&&"function"==typeof e&&e.call(this)}},r.destroy=function(){this.initialised&&(this._removeEventListeners(),this.passedElement.reveal(),this.containerOuter.unwrap(this.passedElement.element),this.clearStore(),this._isSelectElement&&(this.passedElement.options=this._presetOptions),this._templates=null,this.initialised=!1)},r.enable=function(){return this.passedElement.isDisabled&&this.passedElement.enable(),this.containerOuter.isDisabled&&(this._addEventListeners(),this.input.enable(),this.containerOuter.enable()),this},r.disable=function(){return this.passedElement.isDisabled||this.passedElement.disable(),this.containerOuter.isDisabled||(this._removeEventListeners(),this.input.disable(),this.containerOuter.disable()),this},r.highlightItem=function(e,t){if(void 0===t&&(t=!0),!e)return this;var i=e.id,n=e.groupId,s=void 0===n?-1:n,r=e.value,o=void 0===r?"":r,a=e.label,c=void 0===a?"":a,l=s>=0?this._store.getGroupById(s):null;return this._store.dispatch(Ie(i,!0)),t&&this.passedElement.triggerEvent(V,{id:i,value:o,label:c,groupValue:l&&l.value?l.value:null}),this},r.unhighlightItem=function(e){if(!e)return this;var t=e.id,i=e.groupId,n=void 0===i?-1:i,s=e.value,r=void 0===s?"":s,o=e.label,a=void 0===o?"":o,c=n>=0?this._store.getGroupById(n):null;return this._store.dispatch(Ie(t,!1)),this.passedElement.triggerEvent(V,{id:t,value:r,label:a,groupValue:c&&c.value?c.value:null}),this},r.highlightAll=function(){var e=this;return this._store.items.forEach((function(t){return e.highlightItem(t)})),this},r.unhighlightAll=function(){var e=this;return this._store.items.forEach((function(t){return e.unhighlightItem(t)})),this},r.removeActiveItemsByValue=function(e){var t=this;return this._store.activeItems.filter((function(t){return t.value===e})).forEach((function(e){return t._removeItem(e)})),this},r.removeActiveItems=function(e){var t=this;return this._store.activeItems.filter((function(t){return t.id!==e})).forEach((function(e){return t._removeItem(e)})),this},r.removeHighlightedItems=function(e){var t=this;return void 0===e&&(e=!1),this._store.highlightedActiveItems.forEach((function(i){t._removeItem(i),e&&t._triggerChange(i.value)})),this},r.showDropdown=function(e){var t=this;return this.dropdown.isActive?this:(requestAnimationFrame((function(){t.dropdown.show(),t.containerOuter.open(t.dropdown.distanceFromTopWindow),!e&&t._canSearch&&t.input.focus(),t.passedElement.triggerEvent(N,{})})),this)},r.hideDropdown=function(e){var t=this;return this.dropdown.isActive?(requestAnimationFrame((function(){t.dropdown.hide(),t.containerOuter.close(),!e&&t._canSearch&&(t.input.removeActiveDescendant(),t.input.blur()),t.passedElement.triggerEvent(F,{})})),this):this},r.getValue=function(e){void 0===e&&(e=!1);var t=this._store.activeItems.reduce((function(t,i){var n=e?i.value:i;return t.push(n),t}),[]);return this._isSelectOneElement?t[0]:t},r.setValue=function(e){var t=this;return this.initialised?(e.forEach((function(e){return t._setChoiceOrItem(e)})),this):this},r.setChoiceByValue=function(e){var t=this;return!this.initialised||this._isTextElement?this:((Array.isArray(e)?e:[e]).forEach((function(e){return t._findAndSelectChoiceByValue(e)})),this)},r.setChoices=function(e,t,i,n){var s=this;if(void 0===e&&(e=[]),void 0===t&&(t="value"),void 0===i&&(i="label"),void 0===n&&(n=!1),!this.initialised)throw new ReferenceError("setChoices was called on a non-initialized instance of Choices");if(!this._isSelectElement)throw new TypeError("setChoices can't be used with INPUT based Choices");if("string"!=typeof t||!t)throw new TypeError("value parameter must be a name of 'value' field in passed objects");if(n&&this.clearChoices(),"function"==typeof e){var r=e(this);if("function"==typeof Promise&&r instanceof Promise)return new Promise((function(e){return requestAnimationFrame(e)})).then((function(){return s._handleLoadingState(!0)})).then((function(){return r})).then((function(e){return s.setChoices(e,t,i,n)})).catch((function(e){s.config.silent||console.error(e)})).then((function(){return s._handleLoadingState(!1)})).then((function(){return s}));if(!Array.isArray(r))throw new TypeError(".setChoices first argument function must return either array of choices or Promise, got: "+typeof r);return this.setChoices(r,t,i,!1)}if(!Array.isArray(e))throw new TypeError(".setChoices must be called either with array of choices with a function resulting into Promise of array of choices");return this.containerOuter.removeLoadingState(),this._startLoading(),e.forEach((function(e){e.choices?s._addGroup({id:parseInt(e.id,10)||null,group:e,valueKey:t,labelKey:i}):s._addChoice({value:e[t],label:e[i],isSelected:e.selected,isDisabled:e.disabled,customProperties:e.customProperties,placeholder:e.placeholder})})),this._stopLoading(),this},r.clearChoices=function(){return this._store.dispatch({type:W}),this},r.clearStore=function(){return this._store.dispatch({type:"CLEAR_ALL"}),this},r.clearInput=function(){var e=!this._isSelectOneElement;return this.input.clear(e),!this._isTextElement&&this._canSearch&&(this._isSearching=!1,this._store.dispatch(Ee(!0))),this},r._render=function(){if(!this._store.isLoading()){this._currentState=this._store.state;var e=this._currentState.choices!==this._prevState.choices||this._currentState.groups!==this._prevState.groups||this._currentState.items!==this._prevState.items,t=this._isSelectElement,i=this._currentState.items!==this._prevState.items;e&&(t&&this._renderChoices(),i&&this._renderItems(),this._prevState=this._currentState)}},r._renderChoices=function(){var e=this,t=this._store,i=t.activeGroups,n=t.activeChoices,s=document.createDocumentFragment();if(this.choiceList.clear(),this.config.resetScrollPosition&&requestAnimationFrame((function(){return e.choiceList.scrollToTop()})),i.length>=1&&!this._isSearching){var r=n.filter((function(e){return!0===e.placeholder&&-1===e.groupId}));r.length>=1&&(s=this._createChoicesFragment(r,s)),s=this._createGroupsFragment(i,n,s)}else n.length>=1&&(s=this._createChoicesFragment(n,s));if(s.childNodes&&s.childNodes.length>0){var o=this._store.activeItems,a=this._canAddItem(o,this.input.value);a.response?(this.choiceList.append(s),this._highlightChoice()):this.choiceList.append(this._getTemplate("notice",a.notice))}else{var c,l;this._isSearching?(l="function"==typeof this.config.noResultsText?this.config.noResultsText():this.config.noResultsText,c=this._getTemplate("notice",l,"no-results")):(l="function"==typeof this.config.noChoicesText?this.config.noChoicesText():this.config.noChoicesText,c=this._getTemplate("notice",l,"no-choices")),this.choiceList.append(c)}},r._renderItems=function(){var e=this._store.activeItems||[];this.itemList.clear();var t=this._createItemsFragment(e);t.childNodes&&this.itemList.append(t)},r._createGroupsFragment=function(e,t,i){var n=this;void 0===i&&(i=document.createDocumentFragment());return this.config.shouldSort&&e.sort(this.config.sorter),e.forEach((function(e){var s=function(e){return t.filter((function(t){return n._isSelectOneElement?t.groupId===e.id:t.groupId===e.id&&("always"===n.config.renderSelectedChoices||!t.selected)}))}(e);if(s.length>=1){var r=n._getTemplate("choiceGroup",e);i.appendChild(r),n._createChoicesFragment(s,i,!0)}})),i},r._createChoicesFragment=function(e,t,i){var n=this;void 0===t&&(t=document.createDocumentFragment()),void 0===i&&(i=!1);var s=this.config,r=s.renderSelectedChoices,o=s.searchResultLimit,a=s.renderChoiceLimit,c=this._isSearching?O:this.config.sorter,l=function(e){if("auto"!==r||(n._isSelectOneElement||!e.selected)){var i=n._getTemplate("choice",e,n.config.itemSelectText);t.appendChild(i)}},h=e;"auto"!==r||this._isSelectOneElement||(h=e.filter((function(e){return!e.selected})));var u=h.reduce((function(e,t){return t.placeholder?e.placeholderChoices.push(t):e.normalChoices.push(t),e}),{placeholderChoices:[],normalChoices:[]}),d=u.placeholderChoices,p=u.normalChoices;(this.config.shouldSort||this._isSearching)&&p.sort(c);var m=h.length,f=this._isSelectOneElement?[].concat(d,p):p;this._isSearching?m=o:a&&a>0&&!i&&(m=a);for(var v=0;v<m;v+=1)f[v]&&l(f[v]);return t},r._createItemsFragment=function(e,t){var i=this;void 0===t&&(t=document.createDocumentFragment());var n=this.config,s=n.shouldSortItems,r=n.sorter,o=n.removeItemButton;s&&!this._isSelectOneElement&&e.sort(r),this._isTextElement?this.passedElement.value=e:this.passedElement.options=e;return e.forEach((function(e){var n=i._getTemplate("item",e,o);t.appendChild(n)})),t},r._triggerChange=function(e){null!=e&&this.passedElement.triggerEvent(j,{value:e})},r._selectPlaceholderChoice=function(){var e=this._store.placeholderChoice;e&&(this._addItem({value:e.value,label:e.label,choiceId:e.id,groupId:e.groupId,placeholder:e.placeholder}),this._triggerChange(e.value))},r._handleButtonAction=function(e,t){if(e&&t&&this.config.removeItems&&this.config.removeItemButton){var i=t.parentNode.getAttribute("data-id"),n=e.find((function(e){return e.id===parseInt(i,10)}));this._removeItem(n),this._triggerChange(n.value),this._isSelectOneElement&&this._selectPlaceholderChoice()}},r._handleItemAction=function(e,t,i){var n=this;if(void 0===i&&(i=!1),e&&t&&this.config.removeItems&&!this._isSelectOneElement){var s=t.getAttribute("data-id");e.forEach((function(e){e.id!==parseInt(s,10)||e.highlighted?!i&&e.highlighted&&n.unhighlightItem(e):n.highlightItem(e)})),this.input.focus()}},r._handleChoiceAction=function(e,t){if(e&&t){var i=t.dataset.id,n=this._store.getChoiceById(i);if(n){var s=e[0]&&e[0].keyCode?e[0].keyCode:null,r=this.dropdown.isActive;if(n.keyCode=s,this.passedElement.triggerEvent(K,{choice:n}),!n.selected&&!n.disabled)this._canAddItem(e,n.value).response&&(this._addItem({value:n.value,label:n.label,choiceId:n.id,groupId:n.groupId,customProperties:n.customProperties,placeholder:n.placeholder,keyCode:n.keyCode}),this._triggerChange(n.value));this.clearInput(),r&&this._isSelectOneElement&&(this.hideDropdown(!0),this.containerOuter.focus())}}},r._handleBackspace=function(e){if(this.config.removeItems&&e){var t=e[e.length-1],i=e.some((function(e){return e.highlighted}));this.config.editItems&&!i&&t?(this.input.value=t.value,this.input.setWidth(),this._removeItem(t),this._triggerChange(t.value)):(i||this.highlightItem(t,!1),this.removeHighlightedItems(!0))}},r._startLoading=function(){this._store.dispatch(we(!0))},r._stopLoading=function(){this._store.dispatch(we(!1))},r._handleLoadingState=function(e){void 0===e&&(e=!0);var t=this.itemList.getChild("."+this.config.classNames.placeholder);e?(this.disable(),this.containerOuter.addLoadingState(),this._isSelectOneElement?t?t.innerHTML=this.config.loadingText:(t=this._getTemplate("placeholder",this.config.loadingText),this.itemList.append(t)):this.input.placeholder=this.config.loadingText):(this.enable(),this.containerOuter.removeLoadingState(),this._isSelectOneElement?t.innerHTML=this._placeholderValue||"":this.input.placeholder=this._placeholderValue||"")},r._handleSearch=function(e){if(e&&this.input.isFocussed){var t=this._store.choices,i=this.config,n=i.searchFloor,s=i.searchChoices,r=t.some((function(e){return!e.active}));if(e&&e.length>=n){var o=s?this._searchChoices(e):0;this.passedElement.triggerEvent(R,{value:e,resultCount:o})}else r&&(this._isSearching=!1,this._store.dispatch(Ee(!0)))}},r._canAddItem=function(e,t){var i=!0,n="function"==typeof this.config.addItemText?this.config.addItemText(t):this.config.addItemText;if(!this._isSelectOneElement){var s=function(e,t,i){return void 0===i&&(i="value"),e.some((function(e){return"string"==typeof t?e[i]===t.trim():e[i]===t}))}(e,t);this.config.maxItemCount>0&&this.config.maxItemCount<=e.length&&(i=!1,n="function"==typeof this.config.maxItemText?this.config.maxItemText(this.config.maxItemCount):this.config.maxItemText),!this.config.duplicateItemsAllowed&&s&&i&&(i=!1,n="function"==typeof this.config.uniqueItemText?this.config.uniqueItemText(t):this.config.uniqueItemText),this._isTextElement&&this.config.addItems&&i&&"function"==typeof this.config.addItemFilter&&!this.config.addItemFilter(t)&&(i=!1,n="function"==typeof this.config.customAddItemText?this.config.customAddItemText(t):this.config.customAddItemText)}return{response:i,notice:n}},r._searchChoices=function(e){var t="string"==typeof e?e.trim():e,i="string"==typeof this._currentValue?this._currentValue.trim():this._currentValue;if(t.length<1&&t===i+" ")return 0;var n=this._store.searchableChoices,r=t,o=[].concat(this.config.searchFields),a=Object.assign(this.config.fuseOptions,{keys:o}),c=new s.a(n,a).search(r);return this._currentValue=t,this._highlightPosition=0,this._isSearching=!0,this._store.dispatch(function(e){return{type:U,results:e}}(c)),c.length},r._addEventListeners=function(){var e=document.documentElement;e.addEventListener("touchend",this._onTouchEnd,!0),this.containerOuter.element.addEventListener("keydown",this._onKeyDown,!0),this.containerOuter.element.addEventListener("mousedown",this._onMouseDown,!0),e.addEventListener("click",this._onClick,{passive:!0}),e.addEventListener("touchmove",this._onTouchMove,{passive:!0}),this.dropdown.element.addEventListener("mouseover",this._onMouseOver,{passive:!0}),this._isSelectOneElement&&(this.containerOuter.element.addEventListener("focus",this._onFocus,{passive:!0}),this.containerOuter.element.addEventListener("blur",this._onBlur,{passive:!0})),this.input.element.addEventListener("keyup",this._onKeyUp,{passive:!0}),this.input.element.addEventListener("focus",this._onFocus,{passive:!0}),this.input.element.addEventListener("blur",this._onBlur,{passive:!0}),this.input.element.form&&this.input.element.form.addEventListener("reset",this._onFormReset,{passive:!0}),this.input.addEventListeners()},r._removeEventListeners=function(){var e=document.documentElement;e.removeEventListener("touchend",this._onTouchEnd,!0),this.containerOuter.element.removeEventListener("keydown",this._onKeyDown,!0),this.containerOuter.element.removeEventListener("mousedown",this._onMouseDown,!0),e.removeEventListener("click",this._onClick),e.removeEventListener("touchmove",this._onTouchMove),this.dropdown.element.removeEventListener("mouseover",this._onMouseOver),this._isSelectOneElement&&(this.containerOuter.element.removeEventListener("focus",this._onFocus),this.containerOuter.element.removeEventListener("blur",this._onBlur)),this.input.element.removeEventListener("keyup",this._onKeyUp),this.input.element.removeEventListener("focus",this._onFocus),this.input.element.removeEventListener("blur",this._onBlur),this.input.element.form&&this.input.element.form.removeEventListener("reset",this._onFormReset),this.input.removeEventListeners()},r._onKeyDown=function(e){var t,i=e.target,n=e.keyCode,s=e.ctrlKey,r=e.metaKey,o=this._store.activeItems,a=this.input.isFocussed,c=this.dropdown.isActive,l=this.itemList.hasChildren(),h=String.fromCharCode(n),u=Z,d=Q,p=ee,m=te,f=ie,v=ne,g=se,_=re,b=oe,y=s||r;!this._isTextElement&&/[a-zA-Z0-9-_ ]/.test(h)&&this.showDropdown();var E=((t={})[m]=this._onAKey,t[p]=this._onEnterKey,t[f]=this._onEscapeKey,t[v]=this._onDirectionKey,t[_]=this._onDirectionKey,t[g]=this._onDirectionKey,t[b]=this._onDirectionKey,t[d]=this._onDeleteKey,t[u]=this._onDeleteKey,t);E[n]&&E[n]({event:e,target:i,keyCode:n,metaKey:r,activeItems:o,hasFocusedInput:a,hasActiveDropdown:c,hasItems:l,hasCtrlDownKeyPressed:y})},r._onKeyUp=function(e){var t=e.target,i=e.keyCode,n=this.input.value,s=this._store.activeItems,r=this._canAddItem(s,n),o=Z,a=Q;if(this._isTextElement){if(r.notice&&n){var c=this._getTemplate("notice",r.notice);this.dropdown.element.innerHTML=c.outerHTML,this.showDropdown(!0)}else this.hideDropdown(!0)}else{var l=(i===o||i===a)&&!t.value,h=!this._isTextElement&&this._isSearching,u=this._canSearch&&r.response;l&&h?(this._isSearching=!1,this._store.dispatch(Ee(!0))):u&&this._handleSearch(this.input.value)}this._canSearch=this.config.searchEnabled},r._onAKey=function(e){var t=e.hasItems;e.hasCtrlDownKeyPressed&&t&&(this._canSearch=!1,this.config.removeItems&&!this.input.value&&this.input.element===document.activeElement&&this.highlightAll())},r._onEnterKey=function(e){var t=e.event,i=e.target,n=e.activeItems,s=e.hasActiveDropdown,r=ee,o=i.hasAttribute("data-button");if(this._isTextElement&&i.value){var a=this.input.value;this._canAddItem(n,a).response&&(this.hideDropdown(!0),this._addItem({value:a}),this._triggerChange(a),this.clearInput())}if(o&&(this._handleButtonAction(n,i),t.preventDefault()),s){var c=this.dropdown.getChild("."+this.config.classNames.highlightedState);c&&(n[0]&&(n[0].keyCode=r),this._handleChoiceAction(n,c)),t.preventDefault()}else this._isSelectOneElement&&(this.showDropdown(),t.preventDefault())},r._onEscapeKey=function(e){e.hasActiveDropdown&&(this.hideDropdown(!0),this.containerOuter.focus())},r._onDirectionKey=function(e){var t,i,n,s=e.event,r=e.hasActiveDropdown,o=e.keyCode,a=e.metaKey,c=se,l=re,h=oe;if(r||this._isSelectOneElement){this.showDropdown(),this._canSearch=!1;var u,d=o===c||o===h?1:-1;if(a||o===h||o===l)u=d>0?this.dropdown.element.querySelector("[data-choice-selectable]:last-of-type"):this.dropdown.element.querySelector("[data-choice-selectable]");else{var p=this.dropdown.element.querySelector("."+this.config.classNames.highlightedState);u=p?function(e,t,i){if(void 0===i&&(i=1),e instanceof Element&&"string"==typeof t){for(var n=(i>0?"next":"previous")+"ElementSibling",s=e[n];s;){if(s.matches(t))return s;s=s[n]}return s}}(p,"[data-choice-selectable]",d):this.dropdown.element.querySelector("[data-choice-selectable]")}u&&(t=u,i=this.choiceList.element,void 0===(n=d)&&(n=1),t&&(n>0?i.scrollTop+i.offsetHeight>=t.offsetTop+t.offsetHeight:t.offsetTop>=i.scrollTop)||this.choiceList.scrollToChildElement(u,d),this._highlightChoice(u)),s.preventDefault()}},r._onDeleteKey=function(e){var t=e.event,i=e.target,n=e.hasFocusedInput,s=e.activeItems;!n||i.value||this._isSelectOneElement||(this._handleBackspace(s),t.preventDefault())},r._onTouchMove=function(){this._wasTap&&(this._wasTap=!1)},r._onTouchEnd=function(e){var t=(e||e.touches[0]).target;this._wasTap&&this.containerOuter.element.contains(t)&&((t===this.containerOuter.element||t===this.containerInner.element)&&(this._isTextElement?this.input.focus():this._isSelectMultipleElement&&this.showDropdown()),e.stopPropagation());this._wasTap=!0},r._onMouseDown=function(e){var t=e.target;if(t instanceof HTMLElement){if(Ce&&this.choiceList.element.contains(t)){var i=this.choiceList.element.firstElementChild,n="ltr"===this._direction?e.offsetX>=i.offsetWidth:e.offsetX<i.offsetLeft;this._isScrollingOnIe=n}if(t!==this.input.element){var s=t.closest("[data-button],[data-item],[data-choice]");if(s instanceof HTMLElement){var r=e.shiftKey,o=this._store.activeItems,a=s.dataset;"button"in a?this._handleButtonAction(o,s):"item"in a?this._handleItemAction(o,s,r):"choice"in a&&this._handleChoiceAction(o,s)}e.preventDefault()}}},r._onMouseOver=function(e){var t=e.target;t instanceof HTMLElement&&"choice"in t.dataset&&this._highlightChoice(t)},r._onClick=function(e){var t=e.target;this.containerOuter.element.contains(t)?this.dropdown.isActive||this.containerOuter.isDisabled?this._isSelectOneElement&&t!==this.input.element&&!this.dropdown.element.contains(t)&&this.hideDropdown():this._isTextElement?document.activeElement!==this.input.element&&this.input.focus():(this.showDropdown(),this.containerOuter.focus()):(this._store.highlightedActiveItems.length>0&&this.unhighlightAll(),this.containerOuter.removeFocusState(),this.hideDropdown(!0))},r._onFocus=function(e){var t,i=this,n=e.target;this.containerOuter.element.contains(n)&&((t={})[ae]=function(){n===i.input.element&&i.containerOuter.addFocusState()},t[ce]=function(){i.containerOuter.addFocusState(),n===i.input.element&&i.showDropdown(!0)},t[le]=function(){n===i.input.element&&(i.showDropdown(!0),i.containerOuter.addFocusState())},t)[this.passedElement.element.type]()},r._onBlur=function(e){var t=this,i=e.target;if(this.containerOuter.element.contains(i)&&!this._isScrollingOnIe){var n,s=this._store.activeItems.some((function(e){return e.highlighted}));((n={})[ae]=function(){i===t.input.element&&(t.containerOuter.removeFocusState(),s&&t.unhighlightAll(),t.hideDropdown(!0))},n[ce]=function(){t.containerOuter.removeFocusState(),(i===t.input.element||i===t.containerOuter.element&&!t._canSearch)&&t.hideDropdown(!0)},n[le]=function(){i===t.input.element&&(t.containerOuter.removeFocusState(),t.hideDropdown(!0),s&&t.unhighlightAll())},n)[this.passedElement.element.type]()}else this._isScrollingOnIe=!1,this.input.element.focus()},r._onFormReset=function(){this._store.dispatch({type:"RESET_TO",state:this._initialState})},r._highlightChoice=function(e){var t=this;void 0===e&&(e=null);var i=Array.from(this.dropdown.element.querySelectorAll("[data-choice-selectable]"));if(i.length){var n=e;Array.from(this.dropdown.element.querySelectorAll("."+this.config.classNames.highlightedState)).forEach((function(e){e.classList.remove(t.config.classNames.highlightedState),e.setAttribute("aria-selected","false")})),n?this._highlightPosition=i.indexOf(n):(n=i.length>this._highlightPosition?i[this._highlightPosition]:i[i.length-1])||(n=i[0]),n.classList.add(this.config.classNames.highlightedState),n.setAttribute("aria-selected","true"),this.passedElement.triggerEvent(G,{el:n}),this.dropdown.isActive&&(this.input.setActiveDescendant(n.id),this.containerOuter.setActiveDescendant(n.id))}},r._addItem=function(e){var t=e.value,i=e.label,n=void 0===i?null:i,s=e.choiceId,r=void 0===s?-1:s,o=e.groupId,a=void 0===o?-1:o,c=e.customProperties,l=void 0===c?null:c,h=e.placeholder,u=void 0!==h&&h,d=e.keyCode,p=void 0===d?null:d,m="string"==typeof t?t.trim():t,f=p,v=l,g=this._store.items,_=n||m,b=r||-1,y=a>=0?this._store.getGroupById(a):null,E=g?g.length+1:1;return this.config.prependValue&&(m=this.config.prependValue+m.toString()),this.config.appendValue&&(m+=this.config.appendValue.toString()),this._store.dispatch(function(e){var t=e.value,i=e.label,n=e.id,s=e.choiceId,r=e.groupId,o=e.customProperties,a=e.placeholder,c=e.keyCode;return{type:$,value:t,label:i,id:n,choiceId:s,groupId:r,customProperties:o,placeholder:a,keyCode:c}}({value:m,label:_,id:E,choiceId:b,groupId:a,customProperties:l,placeholder:u,keyCode:f})),this._isSelectOneElement&&this.removeActiveItems(E),this.passedElement.triggerEvent(H,{id:E,value:m,label:_,customProperties:v,groupValue:y&&y.value?y.value:void 0,keyCode:f}),this},r._removeItem=function(e){if(!e||!I("Object",e))return this;var t=e.id,i=e.value,n=e.label,s=e.choiceId,r=e.groupId,o=r>=0?this._store.getGroupById(r):null;return this._store.dispatch(function(e,t){return{type:J,id:e,choiceId:t}}(t,s)),o&&o.value?this.passedElement.triggerEvent(B,{id:t,value:i,label:n,groupValue:o.value}):this.passedElement.triggerEvent(B,{id:t,value:i,label:n}),this},r._addChoice=function(e){var t=e.value,i=e.label,n=void 0===i?null:i,s=e.isSelected,r=void 0!==s&&s,o=e.isDisabled,a=void 0!==o&&o,c=e.groupId,l=void 0===c?-1:c,h=e.customProperties,u=void 0===h?null:h,d=e.placeholder,p=void 0!==d&&d,m=e.keyCode,f=void 0===m?null:m;if(null!=t){var v=this._store.choices,g=n||t,_=v?v.length+1:1,b=this._baseId+"-"+this._idNames.itemChoice+"-"+_;this._store.dispatch(function(e){var t=e.value,i=e.label,n=e.id,s=e.groupId,r=e.disabled,o=e.elementId,a=e.customProperties,c=e.placeholder,l=e.keyCode;return{type:q,value:t,label:i,id:n,groupId:s,disabled:r,elementId:o,customProperties:a,placeholder:c,keyCode:l}}({id:_,groupId:l,elementId:b,value:t,label:g,disabled:a,customProperties:u,placeholder:p,keyCode:f})),r&&this._addItem({value:t,label:g,choiceId:_,customProperties:u,placeholder:p,keyCode:f})}},r._addGroup=function(e){var t=this,i=e.group,n=e.id,s=e.valueKey,r=void 0===s?"value":s,o=e.labelKey,a=void 0===o?"label":o,c=I("Object",i)?i.choices:Array.from(i.getElementsByTagName("OPTION")),l=n||Math.floor((new Date).valueOf()*Math.random()),h=!!i.disabled&&i.disabled;if(c){this._store.dispatch(Se({value:i.label,id:l,active:!0,disabled:h}));c.forEach((function(e){var i=e.disabled||e.parentNode&&e.parentNode.disabled;t._addChoice({value:e[r],label:I("Object",e)?e[a]:e.innerHTML,isSelected:e.selected,isDisabled:i,groupId:l,customProperties:e.customProperties,placeholder:e.placeholder})}))}else this._store.dispatch(Se({value:i.label,id:i.id,active:!1,disabled:i.disabled}))},r._getTemplate=function(e){var t;if(!e)return null;for(var i=this.config.classNames,n=arguments.length,s=new Array(n>1?n-1:0),r=1;r<n;r++)s[r-1]=arguments[r];return(t=this._templates[e]).call.apply(t,[this,i].concat(s))},r._createTemplates=function(){var e=this.config.callbackOnCreateTemplates,t={};e&&"function"==typeof e&&(t=e.call(this,w)),this._templates=o()(ye,t)},r._createElements=function(){this.containerOuter=new he({element:this._getTemplate("containerOuter",this._direction,this._isSelectElement,this._isSelectOneElement,this.config.searchEnabled,this.passedElement.element.type),classNames:this.config.classNames,type:this.passedElement.element.type,position:this.config.position}),this.containerInner=new he({element:this._getTemplate("containerInner"),classNames:this.config.classNames,type:this.passedElement.element.type,position:this.config.position}),this.input=new de({element:this._getTemplate("input",this._placeholderValue),classNames:this.config.classNames,type:this.passedElement.element.type,preventPaste:!this.config.paste}),this.choiceList=new pe({element:this._getTemplate("choiceList",this._isSelectOneElement)}),this.itemList=new pe({element:this._getTemplate("itemList",this._isSelectOneElement)}),this.dropdown=new D({element:this._getTemplate("dropdown"),classNames:this.config.classNames,type:this.passedElement.element.type})},r._createStructure=function(){this.passedElement.conceal(),this.containerInner.wrap(this.passedElement.element),this.containerOuter.wrap(this.containerInner.element),this._isSelectOneElement?this.input.placeholder=this.config.searchPlaceholderValue||"":this._placeholderValue&&(this.input.placeholder=this._placeholderValue,this.input.setWidth()),this.containerOuter.element.appendChild(this.containerInner.element),this.containerOuter.element.appendChild(this.dropdown.element),this.containerInner.element.appendChild(this.itemList.element),this._isTextElement||this.dropdown.element.appendChild(this.choiceList.element),this._isSelectOneElement?this.config.searchEnabled&&this.dropdown.element.insertBefore(this.input.element,this.dropdown.element.firstChild):this.containerInner.element.appendChild(this.input.element),this._isSelectElement&&(this._highlightPosition=0,this._isSearching=!1,this._startLoading(),this._presetGroups.length?this._addPredefinedGroups(this._presetGroups):this._addPredefinedChoices(this._presetChoices),this._stopLoading()),this._isTextElement&&this._addPredefinedItems(this._presetItems)},r._addPredefinedGroups=function(e){var t=this,i=this.passedElement.placeholderOption;i&&"SELECT"===i.parentNode.tagName&&this._addChoice({value:i.value,label:i.innerHTML,isSelected:i.selected,isDisabled:i.disabled,placeholder:!0}),e.forEach((function(e){return t._addGroup({group:e,id:e.id||null})}))},r._addPredefinedChoices=function(e){var t=this;this.config.shouldSort&&e.sort(this.config.sorter);var i=e.some((function(e){return e.selected})),n=e.findIndex((function(e){return void 0===e.disabled||!e.disabled}));e.forEach((function(e,s){var r=e.value,o=e.label,a=e.customProperties,c=e.placeholder;if(t._isSelectElement)if(e.choices)t._addGroup({group:e,id:e.id||null});else{var l=!!(t._isSelectOneElement&&!i&&s===n)||e.selected,h=e.disabled;t._addChoice({value:r,label:o,isSelected:l,isDisabled:h,customProperties:a,placeholder:c})}else t._addChoice({value:r,label:o,isSelected:e.selected,isDisabled:e.disabled,customProperties:a,placeholder:c})}))},r._addPredefinedItems=function(e){var t=this;e.forEach((function(e){"object"==typeof e&&e.value&&t._addItem({value:e.value,label:e.label,choiceId:e.id,customProperties:e.customProperties,placeholder:e.placeholder}),"string"==typeof e&&t._addItem({value:e})}))},r._setChoiceOrItem=function(e){var t=this;({object:function(){e.value&&(t._isTextElement?t._addItem({value:e.value,label:e.label,choiceId:e.id,customProperties:e.customProperties,placeholder:e.placeholder}):t._addChoice({value:e.value,label:e.label,isSelected:!0,isDisabled:!1,customProperties:e.customProperties,placeholder:e.placeholder}))},string:function(){t._isTextElement?t._addItem({value:e}):t._addChoice({value:e,label:e,isSelected:!0,isDisabled:!1})}})[E(e).toLowerCase()]()},r._findAndSelectChoiceByValue=function(e){var t=this,i=this._store.choices.find((function(i){return t.config.valueComparer(i.value,e)}));i&&!i.selected&&this._addItem({value:i.value,label:i.label,choiceId:i.id,groupId:i.groupId,customProperties:i.customProperties,placeholder:i.placeholder,keyCode:i.keyCode})},r._generatePlaceholderValue=function(){if(this._isSelectElement){var e=this.passedElement.placeholderOption;return!!e&&e.text}var t=this.config,i=t.placeholder,n=t.placeholderValue,s=this.passedElement.element.dataset;if(i){if(n)return n;if(s.placeholder)return s.placeholder}return!1},n}();t.default=Le}]).default;
(function(factory){
"use strict";
if(typeof define==="function"&&define.amd){
define([ "jquery" ], factory);
}else{
factory(jQuery);
}})(function($){
"use strict";
$.ui=$.ui||{};
var version=$.ui.version="1.13.2";
var widgetUuid=0;
var widgetHasOwnProperty=Array.prototype.hasOwnProperty;
var widgetSlice=Array.prototype.slice;
$.cleanData=(function(orig){
return function(elems){
var events, elem, i;
for(i=0;(elem=elems[ i ])!=null; i++){
events=$._data(elem, "events");
if(events&&events.remove){
$(elem).triggerHandler("remove");
}}
orig(elems);
};})($.cleanData);
$.widget=function(name, base, prototype){
var existingConstructor, constructor, basePrototype;
var proxiedPrototype={};
var namespace=name.split(".")[ 0 ];
name=name.split(".")[ 1 ];
var fullName=namespace + "-" + name;
if(!prototype){
prototype=base;
base=$.Widget;
}
if(Array.isArray(prototype) ){
prototype=$.extend.apply(null, [ {} ].concat(prototype) );
}
$.expr.pseudos[ fullName.toLowerCase() ]=function(elem){
return !!$.data(elem, fullName);
};
$[ namespace ]=$[ namespace ]||{};
existingConstructor=$[ namespace ][ name ];
constructor=$[ namespace ][ name ]=function(options, element){
if(!this||!this._createWidget){
return new constructor(options, element);
}
if(arguments.length){
this._createWidget(options, element);
}};
$.extend(constructor, existingConstructor, {
version: prototype.version,
_proto: $.extend({}, prototype),
_childConstructors: []
});
basePrototype=new base();
basePrototype.options=$.widget.extend({}, basePrototype.options);
$.each(prototype, function(prop, value){
if(typeof value!=="function"){
proxiedPrototype[ prop ]=value;
return;
}
proxiedPrototype[ prop ]=(function(){
function _super(){
return base.prototype[ prop ].apply(this, arguments);
}
function _superApply(args){
return base.prototype[ prop ].apply(this, args);
}
return function(){
var __super=this._super;
var __superApply=this._superApply;
var returnValue;
this._super=_super;
this._superApply=_superApply;
returnValue=value.apply(this, arguments);
this._super=__super;
this._superApply=__superApply;
return returnValue;
};})();
});
constructor.prototype=$.widget.extend(basePrototype, {
widgetEventPrefix: existingConstructor ?(basePrototype.widgetEventPrefix||name):name
}, proxiedPrototype, {
constructor: constructor,
namespace: namespace,
widgetName: name,
widgetFullName: fullName
});
if(existingConstructor){
$.each(existingConstructor._childConstructors, function(i, child){
var childPrototype=child.prototype;
$.widget(childPrototype.namespace + "." + childPrototype.widgetName, constructor,
child._proto);
});
delete existingConstructor._childConstructors;
}else{
base._childConstructors.push(constructor);
}
$.widget.bridge(name, constructor);
return constructor;
};
$.widget.extend=function(target){
var input=widgetSlice.call(arguments, 1);
var inputIndex=0;
var inputLength=input.length;
var key;
var value;
for(; inputIndex < inputLength; inputIndex++){
for(key in input[ inputIndex ]){
value=input[ inputIndex ][ key ];
if(widgetHasOwnProperty.call(input[ inputIndex ], key)&&value!==undefined){
if($.isPlainObject(value) ){
target[ key ]=$.isPlainObject(target[ key ]) ?
$.widget.extend({}, target[ key ], value) :
$.widget.extend({}, value);
}else{
target[ key ]=value;
}}
}}
return target;
};
$.widget.bridge=function(name, object){
var fullName=object.prototype.widgetFullName||name;
$.fn[ name ]=function(options){
var isMethodCall=typeof options==="string";
var args=widgetSlice.call(arguments, 1);
var returnValue=this;
if(isMethodCall){
if(!this.length&&options==="instance"){
returnValue=undefined;
}else{
this.each(function(){
var methodValue;
var instance=$.data(this, fullName);
if(options==="instance"){
returnValue=instance;
return false;
}
if(!instance){
return $.error("cannot call methods on " + name +
" prior to initialization; " +
"attempted to call method '" + options + "'");
}
if(typeof instance[ options ]!=="function" ||
options.charAt(0)==="_"){
return $.error("no such method '" + options + "' for " + name +
" widget instance");
}
methodValue=instance[ options ].apply(instance, args);
if(methodValue!==instance&&methodValue!==undefined){
returnValue=methodValue&&methodValue.jquery ?
returnValue.pushStack(methodValue.get()) :
methodValue;
return false;
}});
}}else{
if(args.length){
options=$.widget.extend.apply(null, [ options ].concat(args) );
}
this.each(function(){
var instance=$.data(this, fullName);
if(instance){
instance.option(options||{});
if(instance._init){
instance._init();
}}else{
$.data(this, fullName, new object(options, this) );
}});
}
return returnValue;
};};
$.Widget=function(){};
$.Widget._childConstructors=[];
$.Widget.prototype={
widgetName: "widget",
widgetEventPrefix: "",
defaultElement: "<div>",
options: {
classes: {},
disabled: false,
create: null
},
_createWidget: function(options, element){
element=$(element||this.defaultElement||this)[ 0 ];
this.element=$(element);
this.uuid=widgetUuid++;
this.eventNamespace="." + this.widgetName + this.uuid;
this.bindings=$();
this.hoverable=$();
this.focusable=$();
this.classesElementLookup={};
if(element!==this){
$.data(element, this.widgetFullName, this);
this._on(true, this.element, {
remove: function(event){
if(event.target===element){
this.destroy();
}}
});
this.document=$(element.style ?
element.ownerDocument :
element.document||element);
this.window=$(this.document[ 0 ].defaultView||this.document[ 0 ].parentWindow);
}
this.options=$.widget.extend({},
this.options,
this._getCreateOptions(),
options);
this._create();
if(this.options.disabled){
this._setOptionDisabled(this.options.disabled);
}
this._trigger("create", null, this._getCreateEventData());
this._init();
},
_getCreateOptions: function(){
return {};},
_getCreateEventData: $.noop,
_create: $.noop,
_init: $.noop,
destroy: function(){
var that=this;
this._destroy();
$.each(this.classesElementLookup, function(key, value){
that._removeClass(value, key);
});
this.element
.off(this.eventNamespace)
.removeData(this.widgetFullName);
this.widget()
.off(this.eventNamespace)
.removeAttr("aria-disabled");
this.bindings.off(this.eventNamespace);
},
_destroy: $.noop,
widget: function(){
return this.element;
},
option: function(key, value){
var options=key;
var parts;
var curOption;
var i;
if(arguments.length===0){
return $.widget.extend({}, this.options);
}
if(typeof key==="string"){
options={};
parts=key.split(".");
key=parts.shift();
if(parts.length){
curOption=options[ key ]=$.widget.extend({}, this.options[ key ]);
for(i=0; i < parts.length - 1; i++){
curOption[ parts[ i ] ]=curOption[ parts[ i ] ]||{};
curOption=curOption[ parts[ i ] ];
}
key=parts.pop();
if(arguments.length===1){
return curOption[ key ]===undefined ? null:curOption[ key ];
}
curOption[ key ]=value;
}else{
if(arguments.length===1){
return this.options[ key ]===undefined ? null:this.options[ key ];
}
options[ key ]=value;
}}
this._setOptions(options);
return this;
},
_setOptions: function(options){
var key;
for(key in options){
this._setOption(key, options[ key ]);
}
return this;
},
_setOption: function(key, value){
if(key==="classes"){
this._setOptionClasses(value);
}
this.options[ key ]=value;
if(key==="disabled"){
this._setOptionDisabled(value);
}
return this;
},
_setOptionClasses: function(value){
var classKey, elements, currentElements;
for(classKey in value){
currentElements=this.classesElementLookup[ classKey ];
if(value[ classKey ]===this.options.classes[ classKey ] ||
!currentElements ||
!currentElements.length){
continue;
}
elements=$(currentElements.get());
this._removeClass(currentElements, classKey);
elements.addClass(this._classes({
element: elements,
keys: classKey,
classes: value,
add: true
}) );
}},
_setOptionDisabled: function(value){
this._toggleClass(this.widget(), this.widgetFullName + "-disabled", null, !!value);
if(value){
this._removeClass(this.hoverable, null, "ui-state-hover");
this._removeClass(this.focusable, null, "ui-state-focus");
}},
enable: function(){
return this._setOptions({ disabled: false });
},
disable: function(){
return this._setOptions({ disabled: true });
},
_classes: function(options){
var full=[];
var that=this;
options=$.extend({
element: this.element,
classes: this.options.classes||{}}, options);
function bindRemoveEvent(){
var nodesToBind=[];
options.element.each(function(_, element){
var isTracked=$.map(that.classesElementLookup, function(elements){
return elements;
})
.some(function(elements){
return elements.is(element);
});
if(!isTracked){
nodesToBind.push(element);
}});
that._on($(nodesToBind), {
remove: "_untrackClassesElement"
});
}
function processClassString(classes, checkOption){
var current, i;
for(i=0; i < classes.length; i++){
current=that.classesElementLookup[ classes[ i ] ]||$();
if(options.add){
bindRemoveEvent();
current=$($.uniqueSort(current.get().concat(options.element.get()) ));
}else{
current=$(current.not(options.element).get());
}
that.classesElementLookup[ classes[ i ] ]=current;
full.push(classes[ i ]);
if(checkOption&&options.classes[ classes[ i ] ]){
full.push(options.classes[ classes[ i ] ]);
}}
}
if(options.keys){
processClassString(options.keys.match(/\S+/g)||[], true);
}
if(options.extra){
processClassString(options.extra.match(/\S+/g)||[]);
}
return full.join(" ");
},
_untrackClassesElement: function(event){
var that=this;
$.each(that.classesElementLookup, function(key, value){
if($.inArray(event.target, value)!==-1){
that.classesElementLookup[ key ]=$(value.not(event.target).get());
}});
this._off($(event.target) );
},
_removeClass: function(element, keys, extra){
return this._toggleClass(element, keys, extra, false);
},
_addClass: function(element, keys, extra){
return this._toggleClass(element, keys, extra, true);
},
_toggleClass: function(element, keys, extra, add){
add=(typeof add==="boolean") ? add:extra;
var shift=(typeof element==="string"||element===null),
options={
extra: shift ? keys:extra,
keys: shift ? element:keys,
element: shift ? this.element:element,
add: add
};
options.element.toggleClass(this._classes(options), add);
return this;
},
_on: function(suppressDisabledCheck, element, handlers){
var delegateElement;
var instance=this;
if(typeof suppressDisabledCheck!=="boolean"){
handlers=element;
element=suppressDisabledCheck;
suppressDisabledCheck=false;
}
if(!handlers){
handlers=element;
element=this.element;
delegateElement=this.widget();
}else{
element=delegateElement=$(element);
this.bindings=this.bindings.add(element);
}
$.each(handlers, function(event, handler){
function handlerProxy(){
if(!suppressDisabledCheck &&
(instance.options.disabled===true ||
$(this).hasClass("ui-state-disabled") )){
return;
}
return(typeof handler==="string" ? instance[ handler ]:handler)
.apply(instance, arguments);
}
if(typeof handler!=="string"){
handlerProxy.guid=handler.guid =
handler.guid||handlerProxy.guid||$.guid++;
}
var match=event.match(/^([\w:-]*)\s*(.*)$/);
var eventName=match[ 1 ] + instance.eventNamespace;
var selector=match[ 2 ];
if(selector){
delegateElement.on(eventName, selector, handlerProxy);
}else{
element.on(eventName, handlerProxy);
}});
},
_off: function(element, eventName){
eventName=(eventName||"").split(" ").join(this.eventNamespace + " ") +
this.eventNamespace;
element.off(eventName);
this.bindings=$(this.bindings.not(element).get());
this.focusable=$(this.focusable.not(element).get());
this.hoverable=$(this.hoverable.not(element).get());
},
_delay: function(handler, delay){
function handlerProxy(){
return(typeof handler==="string" ? instance[ handler ]:handler)
.apply(instance, arguments);
}
var instance=this;
return setTimeout(handlerProxy, delay||0);
},
_hoverable: function(element){
this.hoverable=this.hoverable.add(element);
this._on(element, {
mouseenter: function(event){
this._addClass($(event.currentTarget), null, "ui-state-hover");
},
mouseleave: function(event){
this._removeClass($(event.currentTarget), null, "ui-state-hover");
}});
},
_focusable: function(element){
this.focusable=this.focusable.add(element);
this._on(element, {
focusin: function(event){
this._addClass($(event.currentTarget), null, "ui-state-focus");
},
focusout: function(event){
this._removeClass($(event.currentTarget), null, "ui-state-focus");
}});
},
_trigger: function(type, event, data){
var prop, orig;
var callback=this.options[ type ];
data=data||{};
event=$.Event(event);
event.type=(type===this.widgetEventPrefix ?
type :
this.widgetEventPrefix + type).toLowerCase();
event.target=this.element[ 0 ];
orig=event.originalEvent;
if(orig){
for(prop in orig){
if(!(prop in event) ){
event[ prop ]=orig[ prop ];
}}
}
this.element.trigger(event, data);
return !(typeof callback==="function" &&
callback.apply(this.element[ 0 ], [ event ].concat(data) )===false ||
event.isDefaultPrevented());
}};
$.each({ show: "fadeIn", hide: "fadeOut" }, function(method, defaultEffect){
$.Widget.prototype[ "_" + method ]=function(element, options, callback){
if(typeof options==="string"){
options={ effect: options };}
var hasOptions;
var effectName = !options ?
method :
options===true||typeof options==="number" ?
defaultEffect :
options.effect||defaultEffect;
options=options||{};
if(typeof options==="number"){
options={ duration: options };}else if(options===true){
options={};}
hasOptions = !$.isEmptyObject(options);
options.complete=callback;
if(options.delay){
element.delay(options.delay);
}
if(hasOptions&&$.effects&&$.effects.effect[ effectName ]){
element[ method ](options);
}else if(effectName!==method&&element[ effectName ]){
element[ effectName ](options.duration, options.easing, callback);
}else{
element.queue(function(next){
$(this)[ method ]();
if(callback){
callback.call(element[ 0 ]);
}
next();
});
}};});
var widget=$.widget;
});
(function (factory){
'use strict';
if(typeof define==='function'&&define.amd){
define(['jquery'], factory);
}else if(typeof exports==='object'){
factory(require('jquery'));
}else{
factory(window.jQuery);
}})(function ($){
'use strict';
var counter=0,
jsonAPI=$,
jsonParse='parseJSON';
if('JSON' in window&&'parse' in JSON){
jsonAPI=JSON;
jsonParse='parse';
}
$.ajaxTransport('iframe', function (options){
if(options.async){
var initialIframeSrc=options.initialIframeSrc||'javascript:false;',
form,
iframe,
addParamChar;
return {
send: function (_, completeCallback){
form=$('<form style="display:none;"></form>');
form.attr('accept-charset', options.formAcceptCharset);
addParamChar=/\?/.test(options.url) ? '&':'?';
if(options.type==='DELETE'){
options.url=options.url + addParamChar + '_method=DELETE';
options.type='POST';
}else if(options.type==='PUT'){
options.url=options.url + addParamChar + '_method=PUT';
options.type='POST';
}else if(options.type==='PATCH'){
options.url=options.url + addParamChar + '_method=PATCH';
options.type='POST';
}
counter +=1;
iframe=$(
'<iframe src="' +
initialIframeSrc +
'" name="iframe-transport-' +
counter +
'"></iframe>'
).on('load', function (){
var fileInputClones,
paramNames=$.isArray(options.paramName)
? options.paramName
: [options.paramName];
iframe.off('load').on('load', function (){
var response;
try {
response=iframe.contents();
if(!response.length||!response[0].firstChild){
throw new Error();
}} catch (e){
response=undefined;
}
completeCallback(200, 'success', { iframe: response });
$('<iframe src="' + initialIframeSrc + '"></iframe>').appendTo(form
);
window.setTimeout(function (){
form.remove();
}, 0);
});
form
.prop('target', iframe.prop('name'))
.prop('action', options.url)
.prop('method', options.type);
if(options.formData){
$.each(options.formData, function (index, field){
$('<input type="hidden"/>')
.prop('name', field.name)
.val(field.value)
.appendTo(form);
});
}
if(options.fileInput &&
options.fileInput.length &&
options.type==='POST'
){
fileInputClones=options.fileInput.clone();
options.fileInput.after(function (index){
return fileInputClones[index];
});
if(options.paramName){
options.fileInput.each(function (index){
$(this).prop('name', paramNames[index]||options.paramName);
});
}
form
.append(options.fileInput)
.prop('enctype', 'multipart/form-data')
.prop('encoding', 'multipart/form-data');
options.fileInput.removeAttr('form');
}
window.setTimeout(function (){
form.submit();
if(fileInputClones&&fileInputClones.length){
options.fileInput.each(function (index, input){
var clone=$(fileInputClones[index]);
$(input)
.prop('name', clone.prop('name'))
.attr('form', clone.attr('form'));
clone.replaceWith(input);
});
}}, 0);
});
form.append(iframe).appendTo(document.body);
},
abort: function (){
if(iframe){
iframe.off('load').prop('src', initialIframeSrc);
}
if(form){
form.remove();
}}
};}});
$.ajaxSetup({
converters: {
'iframe text': function (iframe){
return iframe&&$(iframe[0].body).text();
},
'iframe json': function (iframe){
return iframe&&jsonAPI[jsonParse]($(iframe[0].body).text());
},
'iframe html': function (iframe){
return iframe&&$(iframe[0].body).html();
},
'iframe xml': function (iframe){
var xmlDoc=iframe&&iframe[0];
return xmlDoc&&$.isXMLDoc(xmlDoc)
? xmlDoc
: $.parseXML((xmlDoc.XMLDocument&&xmlDoc.XMLDocument.xml) ||
$(xmlDoc.body).html()
);
},
'iframe script': function (iframe){
return iframe&&$.globalEval($(iframe[0].body).text());
}}
});
});
(function (factory){
'use strict';
if(typeof define==='function'&&define.amd){
define(['jquery', 'jquery-ui/ui/widget'], factory);
}else if(typeof exports==='object'){
factory(require('jquery'), require('./vendor/jquery.ui.widget'));
}else{
factory(window.jQuery);
}})(function ($){
'use strict';
$.support.fileInput = !(
new RegExp(
'(Android (1\\.[0156]|2\\.[01]))' +
'|(Windows Phone (OS 7|8\\.0))|(XBLWP)|(ZuneWP)|(WPDesktop)' +
'|(w(eb)?OSBrowser)|(webOS)' +
'|(Kindle/(1\\.0|2\\.[05]|3\\.0))'
).test(window.navigator.userAgent) ||
$('<input type="file"/>').prop('disabled')
);
$.support.xhrFileUpload = !!(window.ProgressEvent&&window.FileReader);
$.support.xhrFormDataFileUpload = !!window.FormData;
$.support.blobSlice =
window.Blob &&
(Blob.prototype.slice ||
Blob.prototype.webkitSlice ||
Blob.prototype.mozSlice);
function getDragHandler(type){
var isDragOver=type==='dragover';
return function (e){
e.dataTransfer=e.originalEvent&&e.originalEvent.dataTransfer;
var dataTransfer=e.dataTransfer;
if(dataTransfer &&
$.inArray('Files', dataTransfer.types)!==-1 &&
this._trigger(type, $.Event(type, { delegatedEvent: e }))!==false
){
e.preventDefault();
if(isDragOver){
dataTransfer.dropEffect='copy';
}}
};}
$.widget('blueimp.fileupload', {
options: {
dropZone: $(document),
pasteZone: undefined,
fileInput: undefined,
replaceFileInput: true,
paramName: undefined,
singleFileUploads: true,
limitMultiFileUploads: undefined,
limitMultiFileUploadSize: undefined,
limitMultiFileUploadSizeOverhead: 512,
sequentialUploads: false,
limitConcurrentUploads: undefined,
forceIframeTransport: false,
redirect: undefined,
redirectParamName: undefined,
postMessage: undefined,
multipart: true,
maxChunkSize: undefined,
uploadedBytes: undefined,
recalculateProgress: true,
progressInterval: 100,
bitrateInterval: 500,
autoUpload: true,
uniqueFilenames: undefined,
messages: {
uploadedBytes: 'Uploaded bytes exceed file size'
},
i18n: function (message, context){
message=this.messages[message]||message.toString();
if(context){
$.each(context, function (key, value){
message=message.replace('{' + key + '}', value);
});
}
return message;
},
formData: function (form){
return form.serializeArray();
},
add: function (e, data){
if(e.isDefaultPrevented()){
return false;
}
if(data.autoUpload ||
(data.autoUpload!==false &&
$(this).fileupload('option', 'autoUpload'))
){
data.process().done(function (){
data.submit();
});
}},
processData: false,
contentType: false,
cache: false,
timeout: 0
},
_promisePipe: (function (){
var parts=$.fn.jquery.split('.');
return Number(parts[0]) > 1||Number(parts[1]) > 7 ? 'then':'pipe';
})(),
_specialOptions: [
'fileInput',
'dropZone',
'pasteZone',
'multipart',
'forceIframeTransport'
],
_blobSlice:
$.support.blobSlice &&
function (){
var slice=this.slice||this.webkitSlice||this.mozSlice;
return slice.apply(this, arguments);
},
_BitrateTimer: function (){
this.timestamp=Date.now ? Date.now():new Date().getTime();
this.loaded=0;
this.bitrate=0;
this.getBitrate=function (now, loaded, interval){
var timeDiff=now - this.timestamp;
if(!this.bitrate||!interval||timeDiff > interval){
this.bitrate=(loaded - this.loaded) * (1000 / timeDiff) * 8;
this.loaded=loaded;
this.timestamp=now;
}
return this.bitrate;
};},
_isXHRUpload: function (options){
return (
!options.forceIframeTransport &&
((!options.multipart&&$.support.xhrFileUpload) ||
$.support.xhrFormDataFileUpload)
);
},
_getFormData: function (options){
var formData;
if($.type(options.formData)==='function'){
return options.formData(options.form);
}
if($.isArray(options.formData)){
return options.formData;
}
if($.type(options.formData)==='object'){
formData=[];
$.each(options.formData, function (name, value){
formData.push({ name: name, value: value });
});
return formData;
}
return [];
},
_getTotal: function (files){
var total=0;
$.each(files, function (index, file){
total +=file.size||1;
});
return total;
},
_initProgressObject: function (obj){
var progress={
loaded: 0,
total: 0,
bitrate: 0
};
if(obj._progress){
$.extend(obj._progress, progress);
}else{
obj._progress=progress;
}},
_initResponseObject: function (obj){
var prop;
if(obj._response){
for (prop in obj._response){
if(Object.prototype.hasOwnProperty.call(obj._response, prop)){
delete obj._response[prop];
}}
}else{
obj._response={};}},
_onProgress: function (e, data){
if(e.lengthComputable){
var now=Date.now ? Date.now():new Date().getTime(),
loaded;
if(data._time &&
data.progressInterval &&
now - data._time < data.progressInterval &&
e.loaded!==e.total
){
return;
}
data._time=now;
loaded =
Math.floor((e.loaded / e.total) * (data.chunkSize||data._progress.total)
) + (data.uploadedBytes||0);
this._progress.loaded +=loaded - data._progress.loaded;
this._progress.bitrate=this._bitrateTimer.getBitrate(now,
this._progress.loaded,
data.bitrateInterval
);
data._progress.loaded=data.loaded=loaded;
data._progress.bitrate=data.bitrate=data._bitrateTimer.getBitrate(now,
loaded,
data.bitrateInterval
);
this._trigger('progress',
$.Event('progress', { delegatedEvent: e }),
data
);
this._trigger('progressall',
$.Event('progressall', { delegatedEvent: e }),
this._progress
);
}},
_initProgressListener: function (options){
var that=this,
xhr=options.xhr ? options.xhr():$.ajaxSettings.xhr();
if(xhr.upload){
$(xhr.upload).on('progress', function (e){
var oe=e.originalEvent;
e.lengthComputable=oe.lengthComputable;
e.loaded=oe.loaded;
e.total=oe.total;
that._onProgress(e, options);
});
options.xhr=function (){
return xhr;
};}},
_deinitProgressListener: function (options){
var xhr=options.xhr ? options.xhr():$.ajaxSettings.xhr();
if(xhr.upload){
$(xhr.upload).off('progress');
}},
_isInstanceOf: function (type, obj){
return Object.prototype.toString.call(obj)==='[object ' + type + ']';
},
_getUniqueFilename: function (name, map){
name=String(name);
if(map[name]){
name=name.replace(/(?: \(([\d]+)\))?(\.[^.]+)?$/,
function (_, p1, p2){
var index=p1 ? Number(p1) + 1:1;
var ext=p2||'';
return ' (' + index + ')' + ext;
}
);
return this._getUniqueFilename(name, map);
}
map[name]=true;
return name;
},
_initXHRData: function (options){
var that=this,
formData,
file=options.files[0],
multipart=options.multipart||!$.support.xhrFileUpload,
paramName =
$.type(options.paramName)==='array'
? options.paramName[0]
: options.paramName;
options.headers=$.extend({}, options.headers);
if(options.contentRange){
options.headers['Content-Range']=options.contentRange;
}
if(!multipart||options.blob||!this._isInstanceOf('File', file)){
options.headers['Content-Disposition'] =
'attachment; filename="' +
encodeURI(file.uploadName||file.name) +
'"';
}
if(!multipart){
options.contentType=file.type||'application/octet-stream';
options.data=options.blob||file;
}else if($.support.xhrFormDataFileUpload){
if(options.postMessage){
formData=this._getFormData(options);
if(options.blob){
formData.push({
name: paramName,
value: options.blob
});
}else{
$.each(options.files, function (index, file){
formData.push({
name:
($.type(options.paramName)==='array' &&
options.paramName[index]) ||
paramName,
value: file
});
});
}}else{
if(that._isInstanceOf('FormData', options.formData)){
formData=options.formData;
}else{
formData=new FormData();
$.each(this._getFormData(options), function (index, field){
formData.append(field.name, field.value);
});
}
if(options.blob){
formData.append(paramName,
options.blob,
file.uploadName||file.name
);
}else{
$.each(options.files, function (index, file){
if(that._isInstanceOf('File', file) ||
that._isInstanceOf('Blob', file)
){
var fileName=file.uploadName||file.name;
if(options.uniqueFilenames){
fileName=that._getUniqueFilename(fileName,
options.uniqueFilenames
);
}
formData.append(($.type(options.paramName)==='array' &&
options.paramName[index]) ||
paramName,
file,
fileName
);
}});
}}
options.data=formData;
}
options.blob=null;
},
_initIframeSettings: function (options){
var targetHost=$('<a></a>').prop('href', options.url).prop('host');
options.dataType='iframe ' + (options.dataType||'');
options.formData=this._getFormData(options);
if(options.redirect&&targetHost&&targetHost!==location.host){
options.formData.push({
name: options.redirectParamName||'redirect',
value: options.redirect
});
}},
_initDataSettings: function (options){
if(this._isXHRUpload(options)){
if(!this._chunkedUpload(options, true)){
if(!options.data){
this._initXHRData(options);
}
this._initProgressListener(options);
}
if(options.postMessage){
options.dataType='postmessage ' + (options.dataType||'');
}}else{
this._initIframeSettings(options);
}},
_getParamName: function (options){
var fileInput=$(options.fileInput),
paramName=options.paramName;
if(!paramName){
paramName=[];
fileInput.each(function (){
var input=$(this),
name=input.prop('name')||'files[]',
i=(input.prop('files')||[1]).length;
while (i){
paramName.push(name);
i -=1;
}});
if(!paramName.length){
paramName=[fileInput.prop('name')||'files[]'];
}}else if(!$.isArray(paramName)){
paramName=[paramName];
}
return paramName;
},
_initFormSettings: function (options){
if(!options.form||!options.form.length){
options.form=$(options.fileInput.prop('form'));
if(!options.form.length){
options.form=$(this.options.fileInput.prop('form'));
}}
options.paramName=this._getParamName(options);
if(!options.url){
options.url=options.form.prop('action')||location.href;
}
options.type=(
options.type ||
($.type(options.form.prop('method'))==='string' &&
options.form.prop('method')) ||
''
).toUpperCase();
if(options.type!=='POST' &&
options.type!=='PUT' &&
options.type!=='PATCH'
){
options.type='POST';
}
if(!options.formAcceptCharset){
options.formAcceptCharset=options.form.attr('accept-charset');
}},
_getAJAXSettings: function (data){
var options=$.extend({}, this.options, data);
this._initFormSettings(options);
this._initDataSettings(options);
return options;
},
_getDeferredState: function (deferred){
if(deferred.state){
return deferred.state();
}
if(deferred.isResolved()){
return 'resolved';
}
if(deferred.isRejected()){
return 'rejected';
}
return 'pending';
},
_enhancePromise: function (promise){
promise.success=promise.done;
promise.error=promise.fail;
promise.complete=promise.always;
return promise;
},
_getXHRPromise: function (resolveOrReject, context, args){
var dfd=$.Deferred(),
promise=dfd.promise();
context=context||this.options.context||promise;
if(resolveOrReject===true){
dfd.resolveWith(context, args);
}else if(resolveOrReject===false){
dfd.rejectWith(context, args);
}
promise.abort=dfd.promise;
return this._enhancePromise(promise);
},
_addConvenienceMethods: function (e, data){
var that=this,
getPromise=function (args){
return $.Deferred().resolveWith(that, args).promise();
};
data.process=function (resolveFunc, rejectFunc){
if(resolveFunc||rejectFunc){
data._processQueue=this._processQueue=(this._processQueue ||
getPromise([this]))
[that._promisePipe](function (){
if(data.errorThrown){
return $.Deferred().rejectWith(that, [data]).promise();
}
return getPromise(arguments);
})
[that._promisePipe](resolveFunc, rejectFunc);
}
return this._processQueue||getPromise([this]);
};
data.submit=function (){
if(this.state()!=='pending'){
data.jqXHR=this.jqXHR =
that._trigger('submit',
$.Event('submit', { delegatedEvent: e }),
this
)!==false&&that._onSend(e, this);
}
return this.jqXHR||that._getXHRPromise();
};
data.abort=function (){
if(this.jqXHR){
return this.jqXHR.abort();
}
this.errorThrown='abort';
that._trigger('fail', null, this);
return that._getXHRPromise(false);
};
data.state=function (){
if(this.jqXHR){
return that._getDeferredState(this.jqXHR);
}
if(this._processQueue){
return that._getDeferredState(this._processQueue);
}};
data.processing=function (){
return (
!this.jqXHR &&
this._processQueue &&
that._getDeferredState(this._processQueue)==='pending'
);
};
data.progress=function (){
return this._progress;
};
data.response=function (){
return this._response;
};},
_getUploadedBytes: function (jqXHR){
var range=jqXHR.getResponseHeader('Range'),
parts=range&&range.split('-'),
upperBytesPos=parts&&parts.length > 1&&parseInt(parts[1], 10);
return upperBytesPos&&upperBytesPos + 1;
},
_chunkedUpload: function (options, testOnly){
options.uploadedBytes=options.uploadedBytes||0;
var that=this,
file=options.files[0],
fs=file.size,
ub=options.uploadedBytes,
mcs=options.maxChunkSize||fs,
slice=this._blobSlice,
dfd=$.Deferred(),
promise=dfd.promise(),
jqXHR,
upload;
if(!(
this._isXHRUpload(options) &&
slice &&
(ub||($.type(mcs)==='function' ? mcs(options):mcs) < fs)
) ||
options.data
){
return false;
}
if(testOnly){
return true;
}
if(ub >=fs){
file.error=options.i18n('uploadedBytes');
return this._getXHRPromise(false, options.context, [
null,
'error',
file.error
]);
}
upload=function (){
var o=$.extend({}, options),
currentLoaded=o._progress.loaded;
o.blob=slice.call(file,
ub,
ub + ($.type(mcs)==='function' ? mcs(o):mcs),
file.type
);
o.chunkSize=o.blob.size;
o.contentRange =
'bytes ' + ub + '-' + (ub + o.chunkSize - 1) + '/' + fs;
that._trigger('chunkbeforesend', null, o);
that._initXHRData(o);
that._initProgressListener(o);
jqXHR=(
(that._trigger('chunksend', null, o)!==false&&$.ajax(o)) ||
that._getXHRPromise(false, o.context)
)
.done(function (result, textStatus, jqXHR){
ub=that._getUploadedBytes(jqXHR)||ub + o.chunkSize;
if(currentLoaded + o.chunkSize - o._progress.loaded){
that._onProgress($.Event('progress', {
lengthComputable: true,
loaded: ub - o.uploadedBytes,
total: ub - o.uploadedBytes
}),
o
);
}
options.uploadedBytes=o.uploadedBytes=ub;
o.result=result;
o.textStatus=textStatus;
o.jqXHR=jqXHR;
that._trigger('chunkdone', null, o);
that._trigger('chunkalways', null, o);
if(ub < fs){
upload();
}else{
dfd.resolveWith(o.context, [result, textStatus, jqXHR]);
}})
.fail(function (jqXHR, textStatus, errorThrown){
o.jqXHR=jqXHR;
o.textStatus=textStatus;
o.errorThrown=errorThrown;
that._trigger('chunkfail', null, o);
that._trigger('chunkalways', null, o);
dfd.rejectWith(o.context, [jqXHR, textStatus, errorThrown]);
})
.always(function (){
that._deinitProgressListener(o);
});
};
this._enhancePromise(promise);
promise.abort=function (){
return jqXHR.abort();
};
upload();
return promise;
},
_beforeSend: function (e, data){
if(this._active===0){
this._trigger('start');
this._bitrateTimer=new this._BitrateTimer();
this._progress.loaded=this._progress.total=0;
this._progress.bitrate=0;
}
this._initResponseObject(data);
this._initProgressObject(data);
data._progress.loaded=data.loaded=data.uploadedBytes||0;
data._progress.total=data.total=this._getTotal(data.files)||1;
data._progress.bitrate=data.bitrate=0;
this._active +=1;
this._progress.loaded +=data.loaded;
this._progress.total +=data.total;
},
_onDone: function (result, textStatus, jqXHR, options){
var total=options._progress.total,
response=options._response;
if(options._progress.loaded < total){
this._onProgress($.Event('progress', {
lengthComputable: true,
loaded: total,
total: total
}),
options
);
}
response.result=options.result=result;
response.textStatus=options.textStatus=textStatus;
response.jqXHR=options.jqXHR=jqXHR;
this._trigger('done', null, options);
},
_onFail: function (jqXHR, textStatus, errorThrown, options){
var response=options._response;
if(options.recalculateProgress){
this._progress.loaded -=options._progress.loaded;
this._progress.total -=options._progress.total;
}
response.jqXHR=options.jqXHR=jqXHR;
response.textStatus=options.textStatus=textStatus;
response.errorThrown=options.errorThrown=errorThrown;
this._trigger('fail', null, options);
},
_onAlways: function (jqXHRorResult, textStatus, jqXHRorError, options){
this._trigger('always', null, options);
},
_onSend: function (e, data){
if(!data.submit){
this._addConvenienceMethods(e, data);
}
var that=this,
jqXHR,
aborted,
slot,
pipe,
options=that._getAJAXSettings(data),
send=function (){
that._sending +=1;
options._bitrateTimer=new that._BitrateTimer();
jqXHR =
jqXHR ||
(
((aborted ||
that._trigger('send',
$.Event('send', { delegatedEvent: e }),
options
)===false) &&
that._getXHRPromise(false, options.context, aborted)) ||
that._chunkedUpload(options) ||
$.ajax(options)
)
.done(function (result, textStatus, jqXHR){
that._onDone(result, textStatus, jqXHR, options);
})
.fail(function (jqXHR, textStatus, errorThrown){
that._onFail(jqXHR, textStatus, errorThrown, options);
})
.always(function (jqXHRorResult, textStatus, jqXHRorError){
that._deinitProgressListener(options);
that._onAlways(jqXHRorResult,
textStatus,
jqXHRorError,
options
);
that._sending -=1;
that._active -=1;
if(options.limitConcurrentUploads &&
options.limitConcurrentUploads > that._sending
){
var nextSlot=that._slots.shift();
while (nextSlot){
if(that._getDeferredState(nextSlot)==='pending'){
nextSlot.resolve();
break;
}
nextSlot=that._slots.shift();
}}
if(that._active===0){
that._trigger('stop');
}});
return jqXHR;
};
this._beforeSend(e, options);
if(this.options.sequentialUploads ||
(this.options.limitConcurrentUploads &&
this.options.limitConcurrentUploads <=this._sending)
){
if(this.options.limitConcurrentUploads > 1){
slot=$.Deferred();
this._slots.push(slot);
pipe=slot[that._promisePipe](send);
}else{
this._sequence=this._sequence[that._promisePipe](send, send);
pipe=this._sequence;
}
pipe.abort=function (){
aborted=[undefined, 'abort', 'abort'];
if(!jqXHR){
if(slot){
slot.rejectWith(options.context, aborted);
}
return send();
}
return jqXHR.abort();
};
return this._enhancePromise(pipe);
}
return send();
},
_onAdd: function (e, data){
var that=this,
result=true,
options=$.extend({}, this.options, data),
files=data.files,
filesLength=files.length,
limit=options.limitMultiFileUploads,
limitSize=options.limitMultiFileUploadSize,
overhead=options.limitMultiFileUploadSizeOverhead,
batchSize=0,
paramName=this._getParamName(options),
paramNameSet,
paramNameSlice,
fileSet,
i,
j=0;
if(!filesLength){
return false;
}
if(limitSize&&files[0].size===undefined){
limitSize=undefined;
}
if(!(options.singleFileUploads||limit||limitSize) ||
!this._isXHRUpload(options)
){
fileSet=[files];
paramNameSet=[paramName];
}else if(!(options.singleFileUploads||limitSize)&&limit){
fileSet=[];
paramNameSet=[];
for (i=0; i < filesLength; i +=limit){
fileSet.push(files.slice(i, i + limit));
paramNameSlice=paramName.slice(i, i + limit);
if(!paramNameSlice.length){
paramNameSlice=paramName;
}
paramNameSet.push(paramNameSlice);
}}else if(!options.singleFileUploads&&limitSize){
fileSet=[];
paramNameSet=[];
for (i=0; i < filesLength; i=i + 1){
batchSize +=files[i].size + overhead;
if(i + 1===filesLength ||
batchSize + files[i + 1].size + overhead > limitSize ||
(limit&&i + 1 - j >=limit)
){
fileSet.push(files.slice(j, i + 1));
paramNameSlice=paramName.slice(j, i + 1);
if(!paramNameSlice.length){
paramNameSlice=paramName;
}
paramNameSet.push(paramNameSlice);
j=i + 1;
batchSize=0;
}}
}else{
paramNameSet=paramName;
}
data.originalFiles=files;
$.each(fileSet||files, function (index, element){
var newData=$.extend({}, data);
newData.files=fileSet ? element:[element];
newData.paramName=paramNameSet[index];
that._initResponseObject(newData);
that._initProgressObject(newData);
that._addConvenienceMethods(e, newData);
result=that._trigger('add',
$.Event('add', { delegatedEvent: e }),
newData
);
return result;
});
return result;
},
_replaceFileInput: function (data){
var input=data.fileInput,
inputClone=input.clone(true),
restoreFocus=input.is(document.activeElement);
data.fileInputClone=inputClone;
$('<form></form>').append(inputClone)[0].reset();
input.after(inputClone).detach();
if(restoreFocus){
inputClone.trigger('focus');
}
$.cleanData(input.off('remove'));
this.options.fileInput=this.options.fileInput.map(function (i, el){
if(el===input[0]){
return inputClone[0];
}
return el;
});
if(input[0]===this.element[0]){
this.element=inputClone;
}},
_handleFileTreeEntry: function (entry, path){
var that=this,
dfd=$.Deferred(),
entries=[],
dirReader,
errorHandler=function (e){
if(e&&!e.entry){
e.entry=entry;
}
dfd.resolve([e]);
},
successHandler=function (entries){
that
._handleFileTreeEntries(entries, path + entry.name + '/')
.done(function (files){
dfd.resolve(files);
})
.fail(errorHandler);
},
readEntries=function (){
dirReader.readEntries(function (results){
if(!results.length){
successHandler(entries);
}else{
entries=entries.concat(results);
readEntries();
}}, errorHandler);
};
path=path||'';
if(entry.isFile){
if(entry._file){
entry._file.relativePath=path;
dfd.resolve(entry._file);
}else{
entry.file(function (file){
file.relativePath=path;
dfd.resolve(file);
}, errorHandler);
}}else if(entry.isDirectory){
dirReader=entry.createReader();
readEntries();
}else{
dfd.resolve([]);
}
return dfd.promise();
},
_handleFileTreeEntries: function (entries, path){
var that=this;
return $.when
.apply($,
$.map(entries, function (entry){
return that._handleFileTreeEntry(entry, path);
})
)
[this._promisePipe](function (){
return Array.prototype.concat.apply([], arguments);
});
},
_getDroppedFiles: function (dataTransfer){
dataTransfer=dataTransfer||{};
var items=dataTransfer.items;
if(items &&
items.length &&
(items[0].webkitGetAsEntry||items[0].getAsEntry)
){
return this._handleFileTreeEntries($.map(items, function (item){
var entry;
if(item.webkitGetAsEntry){
entry=item.webkitGetAsEntry();
if(entry){
entry._file=item.getAsFile();
}
return entry;
}
return item.getAsEntry();
})
);
}
return $.Deferred().resolve($.makeArray(dataTransfer.files)).promise();
},
_getSingleFileInputFiles: function (fileInput){
fileInput=$(fileInput);
var entries=fileInput.prop('entries'),
files,
value;
if(entries&&entries.length){
return this._handleFileTreeEntries(entries);
}
files=$.makeArray(fileInput.prop('files'));
if(!files.length){
value=fileInput.prop('value');
if(!value){
return $.Deferred().resolve([]).promise();
}
files=[{ name: value.replace(/^.*\\/, '') }];
}else if(files[0].name===undefined&&files[0].fileName){
$.each(files, function (index, file){
file.name=file.fileName;
file.size=file.fileSize;
});
}
return $.Deferred().resolve(files).promise();
},
_getFileInputFiles: function (fileInput){
if(!(fileInput instanceof $)||fileInput.length===1){
return this._getSingleFileInputFiles(fileInput);
}
return $.when
.apply($, $.map(fileInput, this._getSingleFileInputFiles))
[this._promisePipe](function (){
return Array.prototype.concat.apply([], arguments);
});
},
_onChange: function (e){
var that=this,
data={
fileInput: $(e.target),
form: $(e.target.form)
};
this._getFileInputFiles(data.fileInput).always(function (files){
data.files=files;
if(that.options.replaceFileInput){
that._replaceFileInput(data);
}
if(that._trigger('change',
$.Event('change', { delegatedEvent: e }),
data
)!==false
){
that._onAdd(e, data);
}});
},
_onPaste: function (e){
var items =
e.originalEvent &&
e.originalEvent.clipboardData &&
e.originalEvent.clipboardData.items,
data={ files: [] };
if(items&&items.length){
$.each(items, function (index, item){
var file=item.getAsFile&&item.getAsFile();
if(file){
data.files.push(file);
}});
if(this._trigger('paste',
$.Event('paste', { delegatedEvent: e }),
data
)!==false
){
this._onAdd(e, data);
}}
},
_onDrop: function (e){
e.dataTransfer=e.originalEvent&&e.originalEvent.dataTransfer;
var that=this,
dataTransfer=e.dataTransfer,
data={};
if(dataTransfer&&dataTransfer.files&&dataTransfer.files.length){
e.preventDefault();
this._getDroppedFiles(dataTransfer).always(function (files){
data.files=files;
if(that._trigger('drop',
$.Event('drop', { delegatedEvent: e }),
data
)!==false
){
that._onAdd(e, data);
}});
}},
_onDragOver: getDragHandler('dragover'),
_onDragEnter: getDragHandler('dragenter'),
_onDragLeave: getDragHandler('dragleave'),
_initEventHandlers: function (){
if(this._isXHRUpload(this.options)){
this._on(this.options.dropZone, {
dragover: this._onDragOver,
drop: this._onDrop,
dragenter: this._onDragEnter,
dragleave: this._onDragLeave
});
this._on(this.options.pasteZone, {
paste: this._onPaste
});
}
if($.support.fileInput){
this._on(this.options.fileInput, {
change: this._onChange
});
}},
_destroyEventHandlers: function (){
this._off(this.options.dropZone, 'dragenter dragleave dragover drop');
this._off(this.options.pasteZone, 'paste');
this._off(this.options.fileInput, 'change');
},
_destroy: function (){
this._destroyEventHandlers();
},
_setOption: function (key, value){
var reinit=$.inArray(key, this._specialOptions)!==-1;
if(reinit){
this._destroyEventHandlers();
}
this._super(key, value);
if(reinit){
this._initSpecialOptions();
this._initEventHandlers();
}},
_initSpecialOptions: function (){
var options=this.options;
if(options.fileInput===undefined){
options.fileInput=this.element.is('input[type="file"]')
? this.element
: this.element.find('input[type="file"]');
}else if(!(options.fileInput instanceof $)){
options.fileInput=$(options.fileInput);
}
if(!(options.dropZone instanceof $)){
options.dropZone=$(options.dropZone);
}
if(!(options.pasteZone instanceof $)){
options.pasteZone=$(options.pasteZone);
}},
_getRegExp: function (str){
var parts=str.split('/'),
modifiers=parts.pop();
parts.shift();
return new RegExp(parts.join('/'), modifiers);
},
_isRegExpOption: function (key, value){
return (
key!=='url' &&
$.type(value)==='string' &&
/^\/.*\/[igm]{0,3}$/.test(value)
);
},
_initDataAttributes: function (){
var that=this,
options=this.options,
data=this.element.data();
$.each(this.element[0].attributes, function (index, attr){
var key=attr.name.toLowerCase(),
value;
if(/^data-/.test(key)){
key=key.slice(5).replace(/-[a-z]/g, function (str){
return str.charAt(1).toUpperCase();
});
value=data[key];
if(that._isRegExpOption(key, value)){
value=that._getRegExp(value);
}
options[key]=value;
}});
},
_create: function (){
this._initDataAttributes();
this._initSpecialOptions();
this._slots=[];
this._sequence=this._getXHRPromise(true);
this._sending=this._active=0;
this._initProgressObject(this);
this._initEventHandlers();
},
active: function (){
return this._active;
},
progress: function (){
return this._progress;
},
add: function (data){
var that=this;
if(!data||this.options.disabled){
return;
}
if(data.fileInput&&!data.files){
this._getFileInputFiles(data.fileInput).always(function (files){
data.files=files;
that._onAdd(null, data);
});
}else{
data.files=$.makeArray(data.files);
this._onAdd(null, data);
}},
send: function (data){
if(data&&!this.options.disabled){
if(data.fileInput&&!data.files){
var that=this,
dfd=$.Deferred(),
promise=dfd.promise(),
jqXHR,
aborted;
promise.abort=function (){
aborted=true;
if(jqXHR){
return jqXHR.abort();
}
dfd.reject(null, 'abort', 'abort');
return promise;
};
this._getFileInputFiles(data.fileInput).always(function (files){
if(aborted){
return;
}
if(!files.length){
dfd.reject();
return;
}
data.files=files;
jqXHR=that._onSend(null, data);
jqXHR.then(function (result, textStatus, jqXHR){
dfd.resolve(result, textStatus, jqXHR);
},
function (jqXHR, textStatus, errorThrown){
dfd.reject(jqXHR, textStatus, errorThrown);
}
);
});
return this._enhancePromise(promise);
}
data.files=$.makeArray(data.files);
if(data.files.length){
return this._onSend(null, data);
}}
return this._getXHRPromise(false, data&&data.context);
}});
});
(()=>{"use strict";const e=function(e,t){var n=t.find(".jss-ff-el-net-promoter");n.length&&e.each(n,function(t,n){e(n).on("click","label",function(t){var n=e(this);n.addClass("active"),n.prevAll().removeClass("active"),n.nextAll().removeClass("active")})})};var t=function(e){!function(e){e.on("click",".js-repeat .repeat-plus",function(e){var t=jQuery(this),n=t.closest(".ff-el-repeat"),a=parseInt(n.data("max_repeat")),i=n.find(".ff-t-cell:first-child .ff-el-input--content > input").length;if(!(a&&a<=i)){a&&a-i==1&&n.find(".repeat-plus").hide();var r=t.closest("div"),o=r.index(),s=t.closest(".ff-el-input--content").find(".ff-t-cell").length;t.closest(".ff-el-input--content").find(".ff-t-cell").each(function(e,t){var n=jQuery(this).find(".ff-el-form-control:last-child"),a=n.attr("tabindex"),i=n.clone(),r={value:"",id:"ffrpt-"+(new Date).getTime()+e};a&&(r.tabIndex=parseInt(a)+s),i.prop(r),i.insertAfter(n)}),r.clone().insertAfter(r),t.closest(".ff-el-input--content").find(".ff-t-cell").eq(0).find("input:eq(".concat(o+1,")")).focus()}}),e.on("click",".js-repeat .repeat-minus",function(e){var t=!1,n=jQuery(this),a=n.closest("div");n.closest(".ff-el-repeat").find(".repeat-plus").show(),n.closest(".ff-el-input--content").find(".ff-t-cell").each(function(){var e=a.index(),n=jQuery(this).find(".ff-el-form-control:eq("+e+")");a.siblings().length&&(t=n.remove().length)}),t&&a.remove()})}(e),function(e){var t=window.localStorage.getItem("ff_window_type");jQuery(".ff_form_preview").length&&jQuery(".ff_flexible_table").addClass(t),e.on("screen-change",function(e,t){jQuery(".ff_form_preview").length&&("375px"===t?jQuery(".ff_flexible_table").addClass("mobile"):jQuery(".ff_flexible_table").removeClass("mobile"))}),e.on("repeater-container-names-update",function(e,t){var n=t.attr("data-root_name"),a=0;t.find(".ff_repeater_cont_row").each(function(e,t){jQuery(this).find(".ff-el-form-control").each(function(t,i){var r=jQuery(i);0==e&&(a=r.attr("tabindex")),r.prop({name:n+"["+e+"][]"}),r.attr("data-name",n+"_"+t+"_"+e),a&&r.attr("tabindex",a)})})}),e.on("click",".js-repeater .repeat-plus",function(e){var t=jQuery(this),n=t.closest("table"),a=t.closest("tr"),i=parseInt(n.attr("data-max_repeat")),r=n.find("tbody tr").length;if(i&&r==i)n.addClass("repeat-maxed");else{var o=a.clone();o.find("td").each(function(e,t){var n=jQuery(this).find(".ff-el-form-control:last-child"),a="ffrpt-"+(new Date).getTime()+e,i={value:n.attr("data-default")||"",id:a};n.prop(i);var r=n.attr("data-mask");r&&n.mask(r)}),o.insertAfter(a);var s=n.attr("data-root_name"),l=0;n.find("tbody tr").each(function(e,t){jQuery(this).find(".ff-el-form-control").each(function(t,n){var a=jQuery(n);0==e&&(l=a.attr("tabindex")),a.prop({name:s+"["+e+"][]"}),a.attr("data-name",s+"_"+t+"_"+e),l&&a.attr("tabindex",l)})}),o.find(".ff-el-form-control")[0].focus(),n.trigger("repeat_change"),i&&r+1==i&&n.addClass("repeat-maxed")}}),e.on("click",".js-repeater .repeat-minus",function(e){var t=jQuery(this),n=t.closest("table");if(1!=n.find("tbody tr").length){t.closest("tr").remove(),n.removeClass("repeat-maxed");var a=n.attr("data-root_name");n.find("tbody tr").each(function(e,t){jQuery(this).find(".ff-el-form-control").each(function(t,n){jQuery(n).prop({name:a+"["+e+"][]"})})}),n.trigger("repeat_change")}}),e.on("click",".js-container-repeat-buttons .repeat-plus",function(t){var n=jQuery(this),a=n.closest(".ff-repeater-container"),i=n.closest(".ff_repeater_cont_row"),r=parseInt(a.attr("data-max_repeat")),o=a.find(".ff_repeater_cont_row").length;if(r&&o==r)a.addClass("repeat-maxed");else{var s=i.clone();s.find(".ff_repeater_cell").each(function(e,t){var n=jQuery(this).find(".ff-el-form-control:last-child"),a="ffrpt-"+(new Date).getTime()+e,i={value:n.attr("data-default")||"",id:a};n.prop(i);var r=n.attr("data-mask");r&&n.mask(r),jQuery(this).find("label").attr("for",a)}),s.insertAfter(i),e.trigger("repeater-container-names-update",[a]),s.find(".ff-el-form-control")[0].focus(),a.trigger("repeat_change"),r&&o+1==r&&a.addClass("repeat-maxed")}}),e.on("click",".js-container-repeat-buttons .repeat-minus",function(t){var n=jQuery(this),a=n.closest(".ff-repeater-container"),i=n.closest(".ff_repeater_cont_row");a.find(".ff_repeater_cont_row").length>1&&(i.remove(),a.removeClass("repeat-maxed"),e.trigger("repeater-container-names-update",[a]),a.trigger("repeat_change"))})}(e),function(e){e.on("keydown",".repeat-plus",function(e){"Enter"===e.key&&(e.preventDefault(),jQuery(this).click())}),e.on("keydown",".repeat-minus",function(e){"Enter"===e.key&&(e.preventDefault(),jQuery(this).click())})}(e)};function n(){n=function(e,t){return new r(e,void 0,t)};var e=RegExp.prototype,t=new WeakMap;function r(e,n,i){var o=RegExp(e,n);return t.set(o,i||t.get(e)),a(o,r.prototype)}function o(e,n){var a=t.get(n);return Object.keys(a).reduce(function(t,n){var i=a[n];if("number"==typeof i)t[n]=e[i];else{for(var r=0;void 0===e[i[r]]&&r+1<i.length;)r++;t[n]=e[i[r]]}return t},Object.create(null))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&a(e,t)}(r,RegExp),r.prototype.exec=function(t){var n=e.exec.call(this,t);if(n){n.groups=o(n,this);var a=n.indices;a&&(a.groups=o(a,this))}return n},r.prototype[Symbol.replace]=function(n,a){if("string"==typeof a){var r=t.get(this);return e[Symbol.replace].call(this,n,a.replace(/\$<([^>]+)(>|$)/g,function(e,t,n){if(""===n)return e;var a=r[t];return Array.isArray(a)?"$"+a.join("$"):"number"==typeof a?"$"+a:""}))}if("function"==typeof a){var s=this;return e[Symbol.replace].call(this,n,function(){var e=arguments;return"object"!=i(e[e.length-1])&&(e=[].slice.call(e)).push(o(e,s)),a.apply(this,e)})}return e[Symbol.replace].call(this,n,a)},n.apply(this,arguments)}function a(e,t){return a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},a(e,t)}function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function r(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 o(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)?o(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var a=0,i=function(){};return{s:i,n:function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}},e:function(e){throw e},f:i}}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 r,s=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){l=!0,r=e},f:function(){try{s||null==n.return||n.return()}finally{if(l)throw r}}}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n<t;n++)a[n]=e[n];return a}function s(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,l(a.key),a)}}function l(e){var t=function(e,t){if("object"!=i(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var a=n.call(e,t||"default");if("object"!=i(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==i(t)?t:t+""}const f=function(){return e=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.fields=t,this.formData=n,this.counter=0,this.field_statues={},this.elementCache={}},(t=[{key:"setFields",value:function(e){this.fields=e}},{key:"setFormData",value:function(e){this.elementCache={},this.formData=e}},{key:"getCalculatedStatuses",value:function(){this.elementCache={};for(var e=0,t=Object.keys(this.fields);e<t.length;e++){var n=t[e],a=this.fields[n];this.field_statues[n]=this.evaluate(a,n)}return this.field_statues}},{key:"evaluate",value:function(e,t){var n=this;if(e._visited)return console.warn("Circular dependency detected for field: ".concat(t)),!1;var a=!1;if(e.status){var i,r;this.counter++;var o=e.type,s=1;if(e._visited=!0,"group"===o&&null!=e&&e.condition_groups?a=this.evaluateGroups(e.condition_groups):("any"==o&&(s=0),e.conditions.forEach(function(e){var a=n.getItemEvaluateValue(e,n.formData[e.field]);a&&n.fields[e.field]&&e.field!=t&&(a=n.evaluate(n.fields[e.field],e.field)),"any"==o?a&&(s=1):!a&&s&&(s=!1)}),a=1==s),e._visited=!1,(null!==(i=e.conditions)&&void 0!==i&&i.length||null!==(r=e.condition_groups)&&void 0!==r&&r.length)&&!a)return a}return e.container_condition&&(a=this.evaluate(e.container_condition,t)),a}},{key:"evaluateGroups",value:function(e){var t,n=r(e);try{for(n.s();!(t=n.n()).done;){var a=t.value;if(a&&Array.isArray(a.rules)&&0!==a.rules.length)try{if(!0===this.evaluateRuleGroup(a.rules))return!0}catch(e){console.warn("Error evaluating group:",e);continue}}}catch(e){n.e(e)}finally{n.f()}return!1}},{key:"evaluateRuleGroup",value:function(e){var t=this;return e.map(function(e){try{var n=t.getItemEvaluateValue(e,t.formData[e.field]);return n&&t.fields[e.field]&&t.fields[e.field].status?t.evaluate(t.fields[e.field],e.field):n}catch(t){return console.warn("Error evaluating rule:",e,t),!1}}).every(function(e){return!0===e})}},{key:"getItemEvaluateValue",value:function(e,t){t=t||null;var n=this.elementCache[e.field];return n&&n.length||(n=jQuery("[name='".concat(e.field,"']")),this.elementCache[e.field]=n),"="==e.operator?""===e.value?null===t:"object"==i(t)?null!==t&&-1!=t.indexOf(e.value):n.hasClass("ff_numeric")?this.parseFormattedNumericValue(n,t)==this.parseFormattedNumericValue(n,e.value):t==e.value:"!="==e.operator?"object"==i(t)?null!==t&&-1==t.indexOf(e.value):n.hasClass("ff_numeric")?this.parseFormattedNumericValue(n,t)!=this.parseFormattedNumericValue(n,e.value):t!=e.value:">"==e.operator?t&&this.parseFormattedNumericValue(n,t)>this.parseFormattedNumericValue(n,e.value):"<"==e.operator?t&&this.parseFormattedNumericValue(n,t)<this.parseFormattedNumericValue(n,e.value):">="==e.operator?t&&this.parseFormattedNumericValue(n,t)>=this.parseFormattedNumericValue(n,e.value):"<="==e.operator?t&&this.parseFormattedNumericValue(n,t)<=this.parseFormattedNumericValue(n,e.value):"startsWith"==e.operator?t&&t.startsWith(e.value):"endsWith"==e.operator?t&&t.endsWith(e.value):"contains"==e.operator?null!==t&&-1!=t.indexOf(e.value):"doNotContains"==e.operator?null!==t&&-1==t.indexOf(e.value):"test_regex"==e.operator&&(t=t||"",this.stringToRegex(e.value).test(t))}},{key:"stringToRegex",value:function(e){var t,a=(null===(t=String(e).match(n(/^\/(.*)\/([gimsuy]*)$/,{body:1,flags:2})))||void 0===t?void 0:t.groups)||{},i=a.body,r=a.flags;return i?(r=r||"g",RegExp(i,r)):new RegExp(e,"g")}},{key:"parseFormattedNumericValue",value:function(e,t){if(e.hasClass("ff_numeric")){var n=JSON.parse(e.attr("data-formatter"));return currency(t,n).value}return Number(t)||0}}])&&s(e.prototype,t),a&&s(e,a),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,a}();const c=function(e,t,n){var a="."+n.form_instance;(function(){var i=this,r={},o={},s=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:300;return function(){for(var a=arguments.length,r=new Array(a),o=0;o<a;o++)r[o]=arguments[o];clearTimeout(t),t=setTimeout(function(){return e.apply(i,r)},n)}}(function(e){l(e)},n.debounce_time||300),l=function(n){e.each(n,function(e,n){var a=u(e).closest(".has-conditions");n?("0px"==a.css("height")&&a.attr("style",""),a.removeClass("ff_excluded").addClass("ff_cond_v").slideDown(200,function(){a.find('input[type="range"]').length>0&&setTimeout(function(){t.trigger("reInitRangeSliders")},50)})):a.removeClass("ff_cond_v").addClass("ff_excluded").slideUp(200)}),t.trigger("do_calculation"),t.trigger("ff_render_dynamic_smartcodes",t)},c=function(){var n={};return e.each(r,function(a,i){var r=i.prop("type")||i.attr("data-type");if("radio"==r)n[a]="",i.each(function(t,i){e(i).is(":checked")&&(n[a]=e(i).val())});else if("checkbox"==r)a=a.replace("[]",""),n[a]=[],i.each(function(t,i){e(i).is(":checked")&&n[a].push(e(i).val())});else if("select-multiple"==r){a=a.replace("[]","");var o=i.val();n[a]=o||[]}else if("file"==r){var s="";t.find("input[name="+a+"]").closest(".ff-el-input--content").find(".ff-uploaded-list").find(".ff-upload-preview[data-src]").each(function(t,n){s+=e(this).data("src")}),n[a]=s}else n[a]=i.val()}),n},u=function(t){var n=e(a),i=e("[data-name='"+t+"']",n);return(i=(i=i.length?i:e("[name='"+t+"']",n)).length?i:e("[data-condition_field_name='"+t+"']",n)).length?i:e("[name='"+t+"[]']",n)};return{init:function(){if(n.conditionals){e.each(n.conditionals,function(t,n){t&&("group"==n.type&&n.condition_groups?e.each(n.condition_groups,function(t,n){e.each(n.rules,function(e,t){var n=u(t.field);r[n.prop("name")]=n})}):e.each(n.conditions,function(e,t){var n=u(t.field);r[n.prop("name")]=n}))}),o=c();var a=new f(n.conditionals,o);e.each(r,function(e,n){n.on("keyup change",function(){t.hasClass("ff_force_hide")||t.hasClass("ff_submitting")||(o=c(),a.setFormData(o),setTimeout(function(){s(a.getCalculatedStatuses())},0))})}),jQuery(document.body).on("fluentform_reset",function(e,n){n&&n.length&&n[0]===t[0]&&!t.hasClass("ff_force_hide")&&setTimeout(function(){o=c(),a.setFormData(o),l(a.getCalculatedStatuses())},0)}),setTimeout(function(){l(a.getCalculatedStatuses())},0)}}}})().init()};function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function d(e){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},d(e)}function p(e){return function(e){if(Array.isArray(e))return h(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return h(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)?h(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n<t;n++)a[n]=e[n];return a}function m(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,v(a.key),a)}}function v(e){var t=function(e,t){if("object"!=d(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var a=n.call(e,t||"default");if("object"!=d(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==d(t)?t:t+""}var g,y,_=function(){return e=function e(t,n,a,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.$=t,this.$theForm=n,this.fluentFormVars=a,this.formSelector=i,this.activeStep=0,this.isRtl=!!window.fluentFormVars.is_rtl,this.isPopulatingStepData=!1,this.isInitialLoad=!0,this.fluentFormVars.stepAnimationDuration=parseInt(this.fluentFormVars.stepAnimationDuration),this.stepPersistency="yes"===this.$theForm.find(".ff-step-container").attr("data-enable_step_data_persistency"),this.stepResume=!1,this.stepPersistency&&(this.stepResume="yes"===this.$theForm.find(".ff-step-container").attr("data-enable_step_page_resume"))},t=[{key:"getPublicAPI",value:function(){return{init:this.init.bind(this),updateSlider:this.updateSlider.bind(this),populateFormDataAndSetActiveStep:this.populateFormDataAndSetActiveStep.bind(this)}}},{key:"init",value:function(){this.initFormWithSavedState(),this.removePrevFromFirstStep(),this.initStepSlider(),this.maybeAutoSlider()}},{key:"removePrevFromFirstStep",value:function(){this.$theForm.find(".fluentform-step:first").find('.step-nav [data-action="prev"]').remove()}},{key:"getFormInstance",value:function(){return window.fluentFormApp(this.$theForm)}},{key:"initFormWithSavedState",value:function(){var e=this;if(this.stepPersistency){var t=this.$,n=this;t(document).ready(function(a){var i,r;t.getJSON(e.fluentFormVars.ajaxUrl,{form_id:e.$theForm.data("form_id"),action:"fluentform_step_form_get_data",nonce:null===(i=e.fluentFormVars)||void 0===i?void 0:i.nonce,hash:null===(r=e.fluentFormVars)||void 0===r?void 0:r.hash}).then(function(e){e&&n.populateFormDataAndSetActiveStep(e)})})}}},{key:"populateFormDataAndSetActiveStep",value:function(e){var t=this,n=e.response,a=e.step_completed,i=this.$,r=[];if(i.each(n,function(e,n){if(n){var a=Object.prototype.toString.call(n);if("[object Object]"===a){var o=t.$theForm.find("[data-name=".concat(e,"]"));if(o.length&&"tabular-element"===o.attr("data-type"))jQuery.each(n,function(n,a){var r=t.$theForm.find('[name="'.concat(e,"[").concat(n,']\\[\\]"]'));r.length||(r=t.$theForm.find('[name="'.concat(e,"[").concat(n,']"]'))),i.each(r,function(e,t){var n=i(t).val();-1===i.inArray(n,a)&&n!==a||i(t).prop("checked",!0).change()})});else if("chained-select"===o.attr("data-type")){var s={meta_key:o.find("select:first").attr("data-meta_key"),form_id:o.closest("form").attr("data-form_id"),action:"fluentform_get_chained_select_options",filter_options:"all",keys:n};i.getJSON(t.fluentFormVars.ajaxUrl,s).then(function(e){i.each(e,function(e,t){var a=o.find("select[data-key='".concat(e,"']"));0!=a.attr("data-index")&&i.each(t,function(e,t){a.append(i("<option />",{value:t,text:t}))}),a.attr("disabled",!1).val(n[e])})})}else i.each(n,function(n,a){t.$theForm.find('[name="'.concat(e,"[").concat(n,']"]')).val(a).change()})}else if("[object Array]"===a){var l=t.$theForm.find("[name=".concat(e,"]"));if("file"===(l=(l=l.length?l:t.$theForm.find("[data-name=".concat(e,"]"))).length?l:t.$theForm.find("[name=".concat(e,"\\[\\]]"))).attr("type"))t.addFilesToElement(l,n);else if(l.prop("multiple"))if(i.isFunction(window.Choices)){var f=l.data("choicesjs");f&&r.push({handler:f,values:n})}else l.val(n).change();else if("repeater_field"===l.attr("data-type")){var c=l.find("tbody"),u=l.attr("data-name");i.each(n,function(e,t){0!=e?c.find("tr:last").clone().appendTo(c).find(".ff-el-form-control").each(function(n,a){var r="ffrpt-"+(new Date).getTime()+n;i(a).val(t[n]),i(a).attr({id:r,name:"".concat(u,"[").concat(e,"][]"),value:t[n]}).change()}):c.find("tr:first .ff-el-form-control").each(function(e,n){i(n).val(t[e]).change()})})}else"repeater_container"===l.attr("data-type")?(i.each(n,function(e,t){if(0!==e){var n=l.find(".ff_repeater_cont_row:first").clone();n.find(".ff_repeater_cell").each(function(n,a){var r=i(this).find(".ff-el-form-control:last-child"),o="ffrpt-"+(new Date).getTime()+"_"+e+"_"+n,s={value:t[n]||"",id:o};r.prop(s),i(this).find("label").attr("for",o)}),n.insertAfter(l.find(".ff_repeater_cont_row:last"))}else l.find(".ff_repeater_cont_row:first .ff-el-form-control").each(function(e,n){i(n).val(t[e]).change()})}),t.$theForm.trigger("repeater-container-names-update",[l]),l.trigger("repeat_change")):l.each(function(e,t){-1!==i.inArray(i(t).val(),n)&&i(t).prop("checked",!0).change()})}else{var d=t.$theForm.find("[name=".concat(e,"]"));if(d.hasClass("fluentform-post-content")&&window.wp&&window.wp.editor){var p=d.attr("id");window.tinymce.get(p).setContent(n)}if("undefined"!=typeof flatpickr&&d.prop("_flatpickr")){var h=d.prop("_flatpickr");h&&(h.config.altInput?h.setDate(n,!0):d.val(n).trigger("change"))}if("radio"===d.prop("type")||"checkbox"===d.prop("type"))i("[name=".concat(e,'][value="').concat(n,'"]')).prop("checked",!0).change(),t.$theForm.find("[name=".concat(e,'][value="').concat(n,'"]')).prop("checked",!0).change(),d.closest(".ff-el-group").find(".ff-el-ratings").length&&t.$theForm.find("[name=".concat(e,'][value="').concat(n,'"]')).closest("label").trigger("mouseenter");else{d.hasClass("ff_has_multi_select")&&d.data("choicesjs")&&(d.data("choicesjs").removeActiveItems(n),d.data("choicesjs").setChoiceByValue(n));var m=d.closest(".ff-el-group").find(".fluentform-signature-pad");if(m.length){var v=m[0].getContext("2d"),g=new Image;g.src=n,g.onload=function(){v.drawImage(g,0,0)}}d.val(n).change()}}}}),r.length>0)for(var o=0;o<r.length;o++){var s,l=r[o].handler,f=r[o].values;l.setValue(f);var c=null===(s=l.passedElement)||void 0===s?void 0:s.element;c&&i(c).trigger("change")}this.isPopulatingStepData=!0;var u=this.fluentFormVars.stepAnimationDuration;this.stepResume&&this.updateSlider(a,u,!0).then(function(){t.handleFocus(u)}).catch(function(e){console.error("An error occurred during the slider update:",e)}),this.isPopulatingStepData=!1}},{key:"initStepSlider",value:function(){var e=this.$,t=this.$theForm.find(".fluentform-step"),n=t.length,a=this.$theForm.find(".ff-step-titles li");if(!window.ff_disable_auto_step){for(var i=this.activeStep,r=0;i<n&&this.isStepAllFieldsHidden(e(t[i]))&&r<n;)i++,r++;i!==this.activeStep&&i<n&&(this.activeStep=i)}t.css("display","none"),e(t[this.activeStep]).css("display","block"),t.attr("role","group"),t.attr("aria-hidden","true"),e(t[this.activeStep]).attr("aria-hidden","false"),e(t[this.activeStep]).addClass("active"),e(a[this.activeStep]).addClass("active");var o=t.first();o.hasClass("active")&&o.find('button[data-action="next"]').css("visibility","visible"),t.length&&!t.last().hasClass("active")&&this.$theForm.find('button[type="submit"]').css("visibility","hidden"),this.stepProgressBarHandle({activeStep:this.activeStep,totalSteps:n}),this.registerStepNavigators(this.fluentFormVars.stepAnimationDuration),this.registerClickableStepNav(a,t)}},{key:"registerClickableStepNav",value:function(e,t){var n=this.$,a=this;0!==e.length&&(n.each(e,function(e,t){n(t).attr("data-step-number",e),n(t).attr({role:"button",tabindex:"0","aria-label":"Go to step "+(e+1),style:"cursor: pointer;"})}),e.on("click keydown",function(e){if("keydown"!==e.type||"Enter"===e.key||" "===e.key||13===e.keyCode||32===e.keyCode){"keydown"===e.type&&e.preventDefault();var i=a.getFormInstance(),r=n(this),o=0,s=a.fluentFormVars.stepAnimationDuration;try{var l=r.data("step-number");if(isNaN(l))return;n.each(t,function(e,t){if(o=e,e<l){var a=n(t).find(":input").not(":button").filter(function(e,t){return!n(t).closest(".has-conditions").hasClass("ff_excluded")});a.length&&i.validate(a)}}),a.updateSlider(l,s,!0).then(function(){a.handleFocus(s)}).catch(function(e){console.error("An error occurred during the slider update:",e)})}catch(e){if(!(e instanceof window.ffValidationError))throw e;a.updateSlider(o,s,!0).then(function(){a.handleFocus(s)}).catch(function(e){console.error("An error occurred during the slider update:",e)}),i.showErrorMessages(e.messages),i.scrollToFirstError(350)}}}))}},{key:"stepProgressBarHandle",value:function(e){var t=this.$;if(this.$theForm.find(".ff-el-progress").length){var n=e.totalSteps,a=e.activeStep,i=100/n*(a+1),r=this.$theForm.find(".ff-el-progress-title li"),o=this.$theForm.find(".ff-step-header .ff-el-progress-bar"),s=o.find("span");o.css({transition:"width 0.3s ease-in-out",width:i+"%"}),i?o.append(s.text(parseInt(i)+"%")):s.empty();var l=this.fluentFormVars.step_text,f=t(r[a]).text();l=l.replace("%activeStep%",a+1).replace("%totalStep%",n).replace("%stepTitle%",f),this.$theForm.find(".ff-el-progress-status").html(l).attr("aria-live","polite"),r.css("display","none"),t(r[a]).css("display","inline")}}},{key:"isStepAllFieldsHidden",value:function(e){return this.$,e.find(".ff-el-group").not(".ff-custom_html").length,!1}},{key:"animateProgressToStep",value:function(e,t,n){this.$;var a=this.$theForm.find(".ff-step-header .ff-el-progress-bar");if(!a.length||!t)return Promise.resolve();var i=100/t*(e+1);return n&&n>0?a.css({transition:"width ".concat(n,"ms ease-in-out")}):a.css({transition:"none"}),a[0]&&a[0].offsetHeight,a.css("width",i+"%"),new Promise(function(e){var t=!1,i=setTimeout(function(){t||(t=!0,e())},(n||0)+120);a.one("transitionend webkitTransitionEnd oTransitionEnd",function(){t||(t=!0,clearTimeout(i),e())})})}},{key:"registerStepNavigators",value:function(e){var t=this.$,n=this;this.handleFocus(e),t(this.formSelector).on("click",".fluentform-step .step-nav button, .fluentform-step .step-nav img",function(a){var i=t(this).data("action"),r="next",o=t(this).closest(".fluentform-step"),s=n.getFormInstance();if("next"===i){try{var l=o.find(":input").not(":button").filter(function(e,n){return!t(n).closest(".has-conditions").hasClass("ff_excluded")});l.length&&s.validate(l),n.activeStep++}catch(a){if(!(a instanceof window.ffValidationError))throw a;return s.showErrorMessages(a.messages),void s.scrollToFirstError(350)}n.$theForm.trigger("ff_to_next_page",n.activeStep),t(document).trigger("ff_to_next_page",{step:n.activeStep,form:n.$theForm});var f=n.$theForm.find(".fluentform-step");n.$theForm.trigger("ff_render_dynamic_smartcodes",t(f[n.activeStep]))}else n.activeStep--,r="prev",n.$theForm.trigger("ff_to_prev_page",n.activeStep),t(document).trigger("ff_to_prev_page",{step:n.activeStep,form:n.$theForm});var c="yes"!=n.$theForm.find(".ff-step-container").attr("data-disable_auto_focus");n.updateSlider(n.activeStep,e,c,r).then(function(){n.handleFocus(e)}).catch(function(e){console.error("An error occurred during the slider update:",e)})})}},{key:"updateSlider",value:function(e,t){var n=this,a=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"next",r=this.$,o=this;return new Promise(function(s){r("div"+n.formSelector+"_errors").empty(),n.activeStep=e;var l=n.$theForm.find(".ff-step-titles li"),f=n.$theForm.find(".fluentform-step"),c=f.length;if(!window.ff_disable_auto_step&&c){var u=o.$theForm.find(".fluentform-step").index(o.$theForm.find(".fluentform-step.active"));if("prev"===i||u>-1&&n.activeStep<u)for(;n.activeStep>0&&n.isStepAllFieldsHidden(r(f[n.activeStep]));)n.activeStep--;else for(;n.activeStep<c-1&&n.isStepAllFieldsHidden(r(f[n.activeStep]));)n.activeStep++}f.css("display","none").removeClass("active").attr("aria-hidden","true"),r(f[n.activeStep]).css("display","block").addClass("active").attr("aria-hidden","false"),l.removeClass("ff_active ff_completed"),r.each(p(Array(n.activeStep).keys()),function(e){r(r(l[e])).addClass("ff_completed")}),r(l[n.activeStep]).addClass("ff_active");var d=r(f[n.activeStep]).closest(".ff-step-container").data("animation_type"),h=r(f[n.activeStep]);h.find(".step-nav button, .step-nav img").css("visibility","hidden");var m,v=c;m="none"===d?0===t?0:t<50?50:t<200?t:window.ffTransitionTimeOut||500:t;var g,y=n.animateProgressToStep(n.activeStep,v,m);switch(d){case"slide":h.css({display:"block",position:"relative",left:n.isRtl?"-100%":"100%",opacity:0,transition:"all ".concat(t,"ms cubic-bezier(0.25, 0.1, 0.25, 1.0)")}),h[0].offsetHeight,h.css({left:"0%",opacity:1}),g=new Promise(function(e){return setTimeout(function(){h.css({position:"",left:"",transition:""}),e()},t+50)});break;case"fade":h.css({display:"block",opacity:0,transition:"opacity ".concat(t,"ms ease-in-out")}),h[0].offsetHeight,h.css("opacity",1),g=new Promise(function(e){return setTimeout(function(){h.css("transition",""),e()},t+50)});break;case"slide_down":h.css({display:"block",opacity:0,maxHeight:"0",overflow:"hidden",transition:"all ".concat(t,"ms cubic-bezier(0.25, 0.1, 0.25, 1.0)")}),h[0].offsetHeight;var _=h[0].scrollHeight;h.css({maxHeight:_+"px",opacity:1}),g=new Promise(function(e){return setTimeout(function(){h.css({maxHeight:"",overflow:"",transition:""}),e()},t+50)});break;default:var b,w=window.ffTransitionTimeOut||500;b=t<50&&t>0?50:t<w?t:w,g=new Promise(function(e){return setTimeout(e,b)})}Promise.all([g,y]).then(function(){a&&function(){if(!window.ff_disable_step_scroll){var e,t,n,a,i,s,l=o.$theForm.find(".ff_step_start");e=window.ff_scroll_top_offset?window.ff_scroll_top_offset:l.offset().top-100,a=(n=(t=l).offset().top)+t.outerHeight(),s=(i=r(window).scrollTop())+r(window).height(),a>i&&n<s&&!window.ff_force_scroll||r("html, body").animate({scrollTop:e},500,"swing")}}(),function(){var t=0===e&&!a,n=o.$theForm.hasClass("ff_submitting");if(!o.stepPersistency||o.isPopulatingStepData||t||n||o.saveStepData(o.$theForm,o.activeStep).then(function(e){}),o.stepProgressBarHandle({activeStep:o.activeStep,totalSteps:c}),f.last().hasClass("active")?o.$theForm.find('button[type="submit"]').css("visibility","visible"):o.$theForm.find('button[type="submit"]').css("visibility","hidden"),!window.ff_disable_auto_step){o.$theForm.find(".fluentform-step.active");var l=o.$theForm.find(".fluentform-step.active > div").length-1,u=o.$theForm.find(".fluentform-step.active > .ff_excluded").length;if(o.$theForm.find(".fluentform-step.active > .ff-t-container").length&&(l-=o.$theForm.find(".fluentform-step.active > .ff-t-container").length,l+=o.$theForm.find(".fluentform-step.active > .ff-t-container > .ff-t-cell > div").length,u+=o.$theForm.find(".fluentform-step.active > .ff-t-container > .ff-t-cell > .ff_excluded").length,o.$theForm.find(".fluentform-step.active > .ff-t-container.ff_excluded").length&&(u-=o.$theForm.find(".fluentform-step.active > .ff-t-container.ff_excluded").length,u-=o.$theForm.find(".fluentform-step.active > .ff-t-container.ff_excluded > .ff-t-cell > .ff_excluded").length,u+=o.$theForm.find(".fluentform-step.active > .ff-t-container.ff_excluded > .ff-t-cell > div").length)),l===u){var d="prev"===i?o.activeStep-1:o.activeStep+1;if(d>=0&&d<c){var p="none"===r(f[d]).closest(".ff-step-container").data("animation_type")?50:100;return void o.updateSlider(d,p,a,i).then(function(){s()}).catch(function(e){console.error("An error occurred during step skip:",e),s()})}}}o.$theForm.find(".fluentform-step.active").find('.step-nav button[data-action="next"]').css("visibility","visible"),o.$theForm.find(".fluentform-step.active").find('.step-nav button[data-action="prev"]').css("visibility","visible"),o.$theForm.find(".fluentform-step.active").find('.step-nav img[data-action="next"]').css("visibility","visible"),o.$theForm.find(".fluentform-step.active").find('.step-nav img[data-action="prev"]').css("visibility","visible"),s()}()})})}},{key:"handleFocus",value:function(e){var t=this.$,n=this,a=!1,i=function(a){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r="yes"!=n.$theForm.find(".ff-step-container").attr("data-disable_auto_focus");if(!n.isInitialLoad)if(r){var o=a.find("input, .ff-custom_html, select, textarea, button, a").filter(":visible");o.length&&i&&setTimeout(function(){o.first().focus()},e+50),n.isInitialLoad=!1}else{var s;!(null===(s=window.fluentFormVars)||void 0===s||!s.step_change_focus)&&setTimeout(function(){t("".concat(n.formSelector," .fluentform-step.active")).attr("tabindex","-1").focus().removeAttr("tabindex")},e),n.isInitialLoad=!1}};n.$theForm.off("keydown.stepNavigation").on("keydown.stepNavigation",function(e){if(!a&&(" "===e.key||32===e.keyCode)){var i=t("".concat(n.formSelector," .fluentform-step.active .ff-btn-next")),r=t("".concat(n.formSelector," .fluentform-step.active .ff-btn-prev"));return document.activeElement===i[0]?(e.preventDefault(),void i.click()):document.activeElement===r[0]?(e.preventDefault(),void r.click()):void 0}}),this.$theForm.on("ff_to_next_page ff_to_prev_page",function(){a=!0,setTimeout(function(){a=!1,i(n.$theForm.find(".fluentform-step.active"),!0)},e+50)}),"yes"!==this.$theForm.find(".ff-step-container").attr("data-disable_auto_focus")&&0!==n.$theForm.find(".fluentform-step").index(n.$theForm.find(".fluentform-step.active"))&&!this.isInitialLoad&&i(t("".concat(this.formSelector," .fluentform-step.active")),!0),this.isInitialLoad=!1}},{key:"saveStepData",value:function(e,t){var n=this.$,a=e.find(":input").filter(function(e,t){return!n(t).closest(".has-conditions").hasClass("ff_excluded")});a.filter(function(e,t){var a=n(t);return a.parents().hasClass("ff_repeater_table")&&"select"==a.attr("type")&&!a.val()}).prepend("<option selected disabled />");var i=a.serialize();n.each(e.find("[type=file]"),function(e,t){var a={},r=t.name+"[]";a[r]=[],n(t).closest("div").find(".ff-uploaded-list").find(".ff-upload-preview[data-src]").each(function(e,t){a[r][e]=n(this).data("src")}),n.each(a,function(e,t){if(t.length){var a={};a[e]=t,i+="&"+n.param(a)}})});var r={active_step:t,data:i,form_id:e.data("form_id"),action:"fluentform_step_form_save_data"};return n.post(this.fluentFormVars.ajaxUrl,r)}},{key:"maybeAutoSlider",value:function(){var e=this.$;if("yes"==this.$theForm.find(".ff-step-container").attr("data-enable_auto_slider")){var t=function(e){if(1==e.closest(".fluentform-step.active").find(".ff-el-group:not(.ff_excluded):not(.ff-custom_html)").length)if(e.closest(".fluentform-step.active").find(".ff_excluded").length){var t=window.ffTransitionTimeOut||500;setTimeout(function(){e.closest(".fluentform-step.active").find(".ff-btn-next").trigger("click")},t)}else e.closest(".fluentform-step.active").find(".ff-btn-next").trigger("click")};this.$theForm.find(".ff-el-form-check-radio,.ff-el-net-label, .ff-el-ratings label").on("click",function(){t(e(this))}),this.$theForm.find("select").on("change",function(){t(e(this))})}}},{key:"addFilesToElement",value:function(e,t){var n=this.$,a=this,i=e.closest(".ff-el-input--content").find(".ff-uploaded-list");n.each(t,function(e,t){t="object"===d(t)?t:{url:t,data_src:t};var r=n("<div/>",{class:"ff-upload-preview","data-src":t.data_src,style:"border: 1px solid rgb(111, 117, 125)"}),o=n("<div/>",{class:"ff-upload-thumb"});o.append(n("<div/>",{class:"ff-upload-preview-img",style:"background-image: url('".concat(a.getThumbnail(t.url),"');")}));var s=n("<div/>",{class:"ff-upload-details"}),l=n("<span/>",{html:a.fluentFormVars.upload_completed_txt,class:"ff-upload-progress-inline-text ff-inline-block"}),f=t.url.substring(t.url.lastIndexOf("/")+1);f.includes("-ff-")&&(f=f.substring(f.lastIndexOf("-ff-")+4));var c=n("<div/>",{class:"ff-upload-filename",html:f}),u=n('\n            <div class="ff-upload-progress-inline ff-el-progress">\n                <div style="width: 100%;" class="ff-el-progress-bar"></div>\n            </div>\n        '),p=n("<span/>",{"data-href":"#",html:"&times;",class:"ff-upload-remove"}),h=n("<div>",{class:"ff-upload-filesize ff-inline-block",html:""}),m=n("<div>",{class:"ff-upload-error",style:"color:red;"});s.append(c,u,l,h,m,p),r.append(o,s),i.append(r)}),e.trigger("change_remaining",-t.length),e.trigger("change")}},{key:"getThumbnail",value:function(e){if(!e)return"";var t=e.split(/[#?]/)[0].split(".").pop().trim().toLowerCase();if(-1!=["jpg","jpeg","gif","png"].indexOf(t))return e;var n=document.createElement("canvas");n.width=60,n.height=60,n.style.zIndex=8,n.style.position="absolute",n.style.border="1px solid";var a=n.getContext("2d");return a.fillStyle="rgba(0, 0, 0, 0.2)",a.fillRect(0,0,60,60),a.font="13px Arial",a.fillStyle="white",a.textAlign="center",a.fillText(t,30,30,60),n.toDataURL()}}],t&&m(e.prototype,t),n&&m(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}(),b=[{type:8,token:"round",show:"round",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t||0===t||(t=2),e=parseFloat(e).toFixed(t),parseFloat(e)}},{type:0,token:"ceil",show:"ceil",value:function(e){return Math.ceil(e)}},{type:0,token:"floor",show:"floor",value:function(e){return Math.floor(e)}},{type:0,token:"abs",show:"abs",value:function(e){return Math.abs(e)}},{type:8,token:"max",show:"max",value:function(e,t){return e>t?e:t}},{type:8,token:"min",show:"min",value:function(e,t){return e<t?e:t}}];function w(e,t){var n=t.find(".ff_has_formula");if(n.length){var a={},i={};mexp.addToken(b);var r=function(){jQuery.each(n,function(n,a){var i=jQuery(a),r=i.data("calculation_formula"),s=function(e,t){for(var n,a=[],i=RegExp(e,"g");n=i.exec(t);)delete n.input,a.push(n);return a}(/{(.*?)}/g,r),d={};jQuery.each(s,function(e,n){var a=n[0];jQuery.each(["{input.","{select.","{checkbox.","{radio.","{repeat.","{payment."],function(e,n){if(function(e,t){return-1!==e.indexOf(t)}(a,n)){var i=(p=a,h=new RegExp(n+"|}","g"),p.replace(h,"")),r=0;if("{select."===n)r=c(i);else if("{checkbox."===n)r=u(i);else if("{radio."===n)r=f(i);else if("{repeat."===n)r=l(i);else if("{payment."===n)r=function(e){var n=0,a=t.find(":input[data-name="+e+"]");if(a.length&&o(a)){var i=a[0].type;"radio"===i?n=f(e,!0):"hidden"===i?n=a.attr("data-payment_value"):"number"===i||"text"===i?n=window.ff_helper.numericVal(a):"checkbox"===i?n=u(e,!0):"select-one"===i&&(n=c(e,!0))}return n}(i);else{var s=t.find("input[name="+i+"]");o(s)&&(r=window.ff_helper.numericVal(s))}return d[a]=r,!1}var p,h})}),jQuery.each(d,function(e,t){t||(t=0),r=r.split(e).join(t)});var p="";try{r=r.replace(/\n/g,""),p=mexp.eval(r),isNaN(p)&&(p="")}catch(e){console.log(e,a)}if("text"==i[0].type){var h=e(i),m=h.val(),v=window.ff_helper.formatCurrency(h,p);if(h.val(v).prop("defaultValue",v),""==m)return;m!=v&&h.trigger("change")}else i.text(p)})};t.find("input[type=number],input[data-calc_value],select[data-calc_value],.ff_numeric,.ff_payment_item").on("change keyup",r),r(),t.on("do_calculation",function(){r()}),jQuery(document).on("fluentform_reset",function(){n.val("").prop("defaultValue",""),setTimeout(function(){r()},100)})}function o(e){return!e.closest(".ff_excluded.has-conditions").length}function s(n){var a=0,i=t.find(n);return i.closest(".ff_excluded.has-conditions").length||e.each(i,function(t,n){var i=e(n).attr("data-calc_value");i&&!isNaN(i)&&(a+=Number(i))}),a}function l(n){var s=0,l=n.split("."),f=!1;l.length>1&&(n=l[0],f=l[1]);var c=t.find("table[data-root_name="+n+"]");if(a[n]||(a[n]=!0,c.on("repeat_change",function(){r()})),o(c))if(f){var u=c.find("tbody tr td:nth-child("+f+")");e.each(u,function(t,a){var o=e(a).find(":input"),l=n+"_"+f+"_"+o.attr("id");i[l]||(i[l]=!0,o.on("change",function(){r()}));var c=0;c="select"===o.attr("type")?parseFloat(o.find("option:selected").attr("data-calc_value")):parseFloat(o.val()),isNaN(c)||(s+=c)}),s&&(s=s.toFixed(2))}else s=c.find("tbody tr").length;return s}function f(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=0,i=t.find("input[name="+e+"]:checked");return n?i.attr("data-payment_value"):(o(i)&&(a=i.attr("data-calc_value")||0),a)}function c(e){var n;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?t.find("select[name="+e+"] option:selected").data("payment_value"):(n=s("select[data-name="+e+"] option:selected"),t.find("select[data-name="+e+"]").attr("data-calc_value",n),n)}function u(e){if(!(arguments.length>1&&void 0!==arguments[1]&&arguments[1]))return s("input[data-name="+e+"]:checked");var n=t.find(":input[data-name="+e+"]").data("group_id"),a=t.find('input[data-group_id="'+n+'"]:checked'),i=0;return a.each(function(e,t){var n=jQuery(t).data("payment_value");n&&(i+=parseFloat(n))}),i}}(g=jQuery)(document.body).on("fluentform_init",function(n,a,i){if(a.attr("data-form_instance"),i){i.form_id_selector;var r="."+i.form_instance;if(function(e,t,n,a,i){var r=function(){jQuery.fn.fileupload&&(t.find('input[type="file"]').each(function(r,f){var c,d,p=e(this),h=p.closest(".ff-el-group");h.closest(".ff-column-container").is(".ff_columns_total_6, .ff_columns_total_5, .ff_columns_total_4")&&h.width()<162&&(d=h.width()),c=e("<div/>",{class:"ff-uploaded-list",style:"font-size:12px; margin-top: 15px;"+(d?"max-width:".concat(d,"px;"):"")}),p.closest("div").append(c);var m=c.width(),v=n.rules[p.prop("name")],g=v.max_file_count.value;"max_file_count"in v&&(v.max_file_count.remaining=Number(g));var y="";function _(e){var n=p.prop("name");t.trigger("show_element_error",{element:n,message:e})}function b(a,r){if(r&&r.files&&r.files.length){if(t.find(".ff-upload-preview-elem").remove(),"max_file_count"in v){e(i+"_errors").empty(),e(this).closest("div").find(".error").html("");var o=v.max_file_count.remaining;if(!o||r.files.length>o){var s="Maximum 1 file is allowed!";return s=g>1?"Maximum "+g+" files are allowed!":s,v.max_file_count&&v.max_file_count.message&&(s=v.max_file_count.message),_(s),!1}}var f=l(r.files[0],n.rules[p.prop("name")]);if(f.length)return _(f.join(", ")),!1;var c=p.prop("name");return e('[name="'.concat(c,'"]')).closest("div").find(".error").html(""),p.closest("div").find(".error").html(""),!0}}"allowed_file_types"in v?(y=v.allowed_file_types.value.join("|"),p.prop("accept","."+y.replace(/\|/g,",."))):(y=v.allowed_image_types.value.join("|"))?p.prop("accept","."+y.replace(/\|/g,",.")):p.prop("accept","image/*");var w=e(f);p.fileupload({dataType:"json",dropZone:p.closest(".ff-el-group"),url:a.ajaxUrl,formData:function(e){var t=e.serializeArray();return t.push({name:"action",value:"fluentform_file_upload"}),t.push({name:"formId",value:n.id}),t},change:b,add:function(t,n){if(b(0,n)){var i=e("<div/>",{class:"ff-upload-preview"+(d?" ff-upload-container-small-column-image":"")});n.context=i;var r=e("<div/>",{class:"ff-upload-thumb"}),l=e("<div/>",{class:"ff-upload-details"}),f=e("<div/>",{class:"ff-upload-preview-img",style:"background-image: url('".concat(o(n.files[0]),"');")}),u=e("<div>",{class:"ff-upload-error",style:"color:red;"}),p=e("<span/>",{html:a.upload_start_txt,class:"ff-upload-progress-inline-text ff-inline-block"}),h=e('\n\t\t\t\t\t\t\t\t\t<div class="ff-upload-progress-inline ff-el-progress">\n\t\t\t\t\t\t\t\t\t\t<div class="ff-el-progress-bar"></div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t'),v=e("<div/>",{class:"ff-upload-filename",text:n.files[0].name}),g=e("<span/>",{"data-href":"#","data-attachment-id":"",html:"&times;",class:"ff-upload-remove"}),y=e("<div>",{class:"ff-upload-filesize ff-inline-block",html:s(n.files[0].size)});r.append(f),l.append(v,h,p,y,u,g),i.append(r,l),c.append(i),d||(m-=91),v.css({maxWidth:m+"px"}),n.submit(),n.context.addClass("ff_uploading")}},progress:function(e,t){var n=parseInt(t.loaded/t.total*100,10);t.context.find(".ff-el-progress-bar").css("width",n+"%"),t.context.find(".ff-upload-progress-inline-text").text(a.uploading_txt)},done:function(e,n){if(n.context.removeClass("ff_uploading"),n.result&&"data"in n.result&&"files"in n.result.data)"error"in n.result.data.files[0]?(_("Upload Error: "+n.result.data.files[0].error),n.context.remove()):(n.context.find(".ff-upload-progress-inline-text").text(a.upload_completed_txt),v.max_file_count.remaining-=1,n.context.attr("data-src",n.result.data.files[0].url),n.context.find(".ff-upload-remove").attr({"data-href":n.result.data.files[0].file,"data-attachment-id":n.result.data.files[0].attachment_id}),n.context.addClass("ff_uploading_complete"),t.find("input[name="+w.data("name")+"]").trigger("change"));else{var i="Sorry! The upload failed for some unknown reason.";if(n.messages){var r=Object.keys(n.messages);r.length&&(i=n.messages[r[0]])}_(i),n.context.remove()}},fail:function(t,n){var a,i,r,o,s=[];null===(a=n.context)||void 0===a||a.remove(),null!==(i=n.jqXHR)&&void 0!==i&&i.responseJSON&&null!==(r=n.jqXHR)&&void 0!==r&&r.responseJSON.errors?e.each(n.jqXHR.responseJSON.errors,function(t,n){"object"==u(n)?e.each(n,function(e,t){s.push(t)}):s.push(n)}):null!==(o=n.jqXHR)&&void 0!==o&&o.responseText?s.push(n.jqXHR.responseText):s.push("Something is wrong when uploading the file! Please try again"),_(s.join(", "))}}),w.on("change_remaining",function(e,t){v.max_file_count.remaining+=t})}),t.find(".ff_upload_btn").on("keyup click",function(t){t.preventDefault(),t.stopPropagation(),("click"===t.type||"keyup"===t.type&&32===t.keyCode)&&e(this).siblings("input[type=file]").trigger("click")}))},o=function(e){if(e.type.match("image"))return URL.createObjectURL(e);var t=document.createElement("canvas");t.width=60,t.height=60,t.style.zIndex=8,t.style.position="absolute",t.style.border="1px solid";var n=t.getContext("2d");return n.fillStyle="rgba(0, 0, 0, 0.2)",n.fillRect(0,0,60,60),n.font="13px Arial",n.fillStyle="white",n.textAlign="center",n.fillText(e.name.substr(e.name.lastIndexOf(".")+1),30,30,60),t.toDataURL()},s=function(e){return e<1024?e+"bytes":e>=1024&&e<=1048576?(e/1024).toFixed(1)+"KB":e>1048576?(e/1048576).toFixed(1)+"MB":void 0},l=function(e,t){var n=[],a="",i="";if("allowed_file_types"in t?(a=t.allowed_file_types.value,i=t.allowed_file_types.message):"allowed_image_types"in t&&(a=t.allowed_image_types.value,i=t.allowed_image_types.message),a){var r=new RegExp("("+a.join("|")+")","i"),o=e.name.split(".").pop();o=o.toLowerCase(),r.test(o)||n.push(i)}return"max_file_size"in t&&e.size>t.max_file_size.value&&n.push(t.max_file_size.message),n};r(),t.find(".ff-uploaded-list").on("click",".ff-upload-remove",function(t){t.preventDefault();var n=e(this),i=n.closest(".ff-uploaded-list"),r=i.closest(".ff-el-input--content").find("input[type=file]"),o=n.attr("data-href"),s=n.attr("data-attachment-id");"#"==o?(n.closest(".ff-el-input--content").find(".error").remove(),n.closest(".ff-upload-preview").remove(),i.find(".ff-upload-preview").length||i.siblings(".ff-upload-progress").addClass("ff-hidden"),r.trigger("change_remaining",1)):e.post(a.ajaxUrl,{path:o,attachment_id:s,action:"fluentform_delete_uploaded_file"}).then(function(e){n.closest(".ff-el-input--content").find("input"),r.trigger("change_remaining",1),n.closest(".ff-el-input--content").find(".error").remove(),n.closest(".ff-upload-preview").remove(),i.find(".ff-upload-preview").length||i.siblings(".ff-upload-progress").addClass("ff-hidden"),r.trigger("change")})}),e(document.body).on("fluentform_reset",function(){r()})}(g,a,i,window.fluentFormVars,r),t(a),function(e,t){var n=t.find(".fluentform .js-repeat");e.each(n,function(t,n){var a=e(n);if(a.find(".ff-t-cell").length>1){var i=a.find(".ff-el-group").height()-a.find(".ff-el-group").find(".ff-el-input--content").height();a.find(".js-repeat-buttons").css("margin-top",i+"px")}var r=a.find(".ff-el-group").find(".ff-el-input--content .ff-el-form-control").outerHeight();a.find(".ff-el-repeat-buttons").height(r)})}(g,a),c(g,a,i,window.fluentFormVars),w(g,a),function(e,t){var n=t.find(".jss-ff-el-ratings");n.length&&e.each(n,function(t,n){var a=e(n);a.find("label.active").prevAll().addClass("active"),a.on("mouseenter","label",function(t){var n=e(this),a="[data-id="+n.find("input").attr("id")+"]";n.addClass("active"),n.prevAll().addClass("active"),n.nextAll().removeClass("active"),n.closest(".ff-el-input--content").find(".ff-el-rating-text").css("display","none"),n.closest(".ff-el-input--content").find(a).css("display","inline-block")}).on("click","label",function(t){var n=e(this).find(".jss-ff-svg");n.addClass("scale"),n.addClass("scalling"),setTimeout(function(e){n.removeClass("scalling"),n.removeClass("scale")},150)}).on("mouseleave",function(t){var n=e(this),a="[data-id="+n.find("input:checked").attr("id")+"]",i=n.find("input:checked").parent("label");i.length?(i.addClass("active"),i.prevAll().addClass("active"),i.nextAll().removeClass("active")):n.find("label").removeClass("active"),n.closest(".ff-el-input--content").find(".ff-el-rating-text").css("display","none"),n.closest(".ff-el-input--content").find(a).css("display","inline-block")})})}(g,a),e(g,a),a.hasClass("ff-form-has-steps")){var o=function(e,t,n,a){return new _(e,t,n,a).getPublicAPI()}(g,a,window.fluentFormVars,r);o.init(),a.on("update_slider",function(e,t){o.updateSlider(t.goBackToStep,t.animDuration,t.isScrollTop,t.actionType)})}a.hasClass("ff_has_dynamic_smartcode")&&(a.on("ff_render_dynamic_smartcodes",function(e,t){s(g(t))}),a.on("keyup change",":input",function(){s(a)}),s(a))}else console.log("No Fluent form JS vars found!");function s(e){jQuery.each(e.find(".ff_dynamic_value"),function(e,t){var n=g(t).data("ref");if("payment_summary"!=n){var i=a.find('.ff-el-form-control[name="'+n+'"]'),r=" ";i.length||(i=a.find('.ff-field_container[data-name="'+n+'"]').find("input")),i.length||((i=a.find('*[name="'+n+'"]:checked')).length||(i=a.find('*[name="'+n+'[]"]:checked'),r=", "),i.length||(i=a.find('*[name="'+n+'[]"]').find("option:selected"),r=", "));var o=[];if(!i.length){var s=a.find('.ff-el-repeater[data-name="'+n+'"] tbody tr');s.each(function(e){var t=g(this).find("input, select"),n=[];t.each(function(e){var t=g(this).val();if(t){var a=g(this).closest("td").data("label")||"Column-"+(e+1);n.push(a+": "+t)}}),n.length&&o.push("#"+(e+1)+"- "+n.join(" | "))}),s.length&&(r="<br/>")}g.each(i,function(){var e=g(this).val(),t=g(this).closest(".ff-el-group.has-conditions").hasClass("ff_excluded");e&&!t&&o.push(e)});var l,f="";f=o.length?o.join(r):g(t).data("fallback"),g(this).html(null==(l=f)?"":("string"!=typeof l&&(l=String(l)),(l=(l=l.replace(/<script[^]*?>[^]*?<\/script>/gi,"").replace(/<iframe[^]*?>[^]*?<\/iframe>/gi,"").replace(/<.*?\bon\w+=["'][^"']*["']/gi,"").replace(/javascript:/gi,"")).replace(/</g,"&lt;").replace(/>/g,"&gt;")).replace(/&lt;br\s*\/?&gt;/gi,"<br/>").replace(/\n/g,"<br/>")))}else a.trigger("calculate_payment_summary",{element:g(t)})})}}),(y=String.prototype).startsWith||(y.startsWith=function(e,t){return t=!t||t<0?0:+t,this.substring(t,t+e.length)===e}),y.endsWith||(y.endsWith=function(e,t){return(void 0===t||t>this.length)&&(t=this.length),this.substring(t-e.length,t)===e}),y.includes||(y.includes=function(e,t){if(e instanceof RegExp)throw TypeError("first argument must not be a RegExp");return void 0===t&&(t=0),-1!==this.indexOf(e,t)})})();