(window.webpackJsonp=window.webpackJsonp||[]).push([[1],{20:function(e,t,n){var r;!function(){"use strict";var n={}.hasOwnProperty;function a(){for(var e=[],t=0;t-1===i.indexOf(e)),s=e=>(e=>c.indexOf(e)>=0)(e)?document.createElementNS("http://www.w3.org/2000/svg",e):e===DocumentFragment?document.createDocumentFragment():document.createElement(e),l=(e,t,n)=>{/^xlink[AHRST]/.test(t)?e.setAttributeNS("http://www.w3.org/1999/xlink",t.replace("xlink","xlink:").toLowerCase(),n):e.setAttribute(t,n)},u=(e,t,n)=>{const r=s(e);return Object.keys(t).forEach(e=>{const n=t[e];if("class"===e||"className"===e)l(r,"class",n);else if("style"===e)r=r,d=n,Object.keys(d).forEach(e=>{let t=d[e];"number"!=typeof t||o.test(e)||(t+="px"),r.style[e]=t});else if(0===e.indexOf("on")){const t=e.substr(2).toLowerCase();r.addEventListener(t,n)}else"dangerouslySetInnerHTML"===e?r.innerHTML=n.__html:"key"!==e&&!1!==n&&l(r,e,!0===n?"":n)}),t.dangerouslySetInnerHTML||r.appendChild(n),r};var f,d;function h(e,t){const n=[].slice.apply(arguments,[2]),r=document.createDocumentFragment();return a(n).forEach(e=>{e instanceof Node?r.appendChild(e):"boolean"!=typeof e&&null!==e&&r.appendChild(document.createTextNode(e))}),u(e,t||{},r)}const p={createElement:h,Fragment:"function"==typeof DocumentFragment?DocumentFragment:()=>{}};e.exports=p,e.exports.h=h,e.exports.default=p},46:function(e,t,n){"use strict";n.r(t),n.d(t,"handleSingleSearchForm",function(){return f});var r=n(23),a=n(20),o=n.n(a);n(13);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})(e)}function c(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var a=n.clickOutsideHandler,f=n.maybeEl,p=c({postType:"ct_forced_post",mode:"inline",perPage:5},t);if(f&&window.fetch){var m,g,y,v=(m=function(t){var n;document.removeEventListener("click",a),document.addEventListener("click",a),0!==t.target.value.trim().length?(e.classList.add("ct-searching"),(n="".concat(ct_localizations.rest_url,"wp/v2/posts").concat(ct_localizations.rest_url.indexOf("?")>-1?"&":"?","_embed=1&post_type=").concat(p.postType,"&per_page=").concat(p.perPage,"&search=").concat(t.target.value),u[n]?new Promise(function(e){e(u[n]),u[n]=u[n].clone()}):new Promise(function(e){return fetch(n).then(function(t){e(t),u[n]=t.clone()})})).then(function(n){var a=parseInt(n.headers.get("X-WP-Total"),10);n.json().then(function(n){if(!l){e.classList.remove("ct-searching");var c=!!e.querySelector(".ct-search-results");l=!0;var u=e.querySelector(".ct-search-results"),f=u?u.getBoundingClientRect():0,m=f.height;if(u&&0!==t.target.value.trim().length&&0!==n.length?u&&e.removeChild(u):0!==t.target.value.trim().length&&0!==n.length||d(u),n.length>0&&t.target.value.trim().length>0){var g=Object(r.h)("ul",{class:"ct-search-results"},n.map(function(e){var t,n=e.title.rendered,a=e.link,c=e._embedded;return Object(r.h)("li",{key:a},Object(r.h)("a",{href:a},Object(r.h)("div",{class:o()((t={},s(t,"ct-image-container",!0),s(t,"ct-no-image",!c["wp:featuredmedia"]),t))},c["wp:featuredmedia"]?Object(r.h)("img",{src:function(e){var t=[];if("object"==i(e)||"function"==typeof e){for(var n=Object.keys(e),r=n.length,a=0;ap.perPage?Object(r.h)("a",{href:ct_localizations.search_url.replace(/QUERY_STRING/,t.target.value)},ct_localizations.show_more_text):[]);if(e.appendChild(g),c){var y=e.querySelector(".ct-search-results"),v=y.getBoundingClientRect(),b=v.height;m!==b&&(y.style.height="".concat(m,"px"),y.classList.add("ct-slide"),requestAnimationFrame(function(){y.style.height="".concat(b,"px"),h(y,function(){y.removeAttribute("style"),y.classList.remove("ct-slide")})}))}else!function(e){e.classList.add("ct-fade-enter");var t=e.getBoundingClientRect().height;e.classList.add("ct-fade-leave"),e.style.height=0,e.closest("form").classList.add("ct-has-dropdown"),requestAnimationFrame(function(){e.style.height="".concat(t,"px"),e.classList.remove("ct-fade-enter"),e.classList.add("ct-fade-enter-active"),h(e,function(){return e.removeAttribute("style")})})}(e.querySelector(".ct-search-results"))}l=!1}})})):d(e.querySelector(".ct-search-results"))},g=200,function(){if(!g)return m.apply(this,arguments);var e=this,t=arguments;clearTimeout(y),y=setTimeout(function(){return y=null,m.apply(e,t)},g)});f.addEventListener("input",v),"modal"===c({mode:"inline"},t).mode&&f.addEventListener("blur",function(e){return setTimeout(function(){return v(e)})}),f.addEventListener("focus",v)}}({clickOutsideHandler:function(n){return"modal"!==c({mode:"inline"},t).mode&&!e.contains(n.target)&&d(e.querySelector(".ct-search-results"))},maybeEl:e.querySelector('input[type="search"]')})};function d(e){if(e){var t=e.getBoundingClientRect().height;e.classList.add("ct-fade-leave"),e.style.height="".concat(t,"px"),e.closest("form").classList.remove("ct-has-dropdown"),requestAnimationFrame(function(){e.classList.remove("ct-fade-leave"),e.classList.add("ct-fade-leave-active"),e.style.height=0,h(e,function(){return e.parentNode&&e.parentNode.removeChild(e)})})}}function h(e,t){var n=function(){e.removeEventListener("transitionend",r),t()},r=function(t){t.target===e&&n()};e.addEventListener("transitionend",r)}}}]);