(self.blocksyJsonP=self.blocksyJsonP||[]).push([[897],{8123:function(e){"use strict"; /*! * arr-flatten * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. */function t(e,r){for(var n,o=0,a=e.length;o1&&void 0!==arguments[1]?arguments[1]:{};const o=function(t){"modal"!==u({mode:"inline"},r).mode&&(e.contains(t.target)||g(e.querySelector(".ct-search-results")))},a=e.querySelector('input[type="search"]'),l=u({postType:"ct_forced_any",mode:"inline",perPage:5},r);if(!a)return;if(l.postType=e.querySelector('[name="post_type"]')?`ct_forced_${e.querySelector('[name="post_type"]').value}`:e.querySelector('[name="ct_post_type"]')?`ct_forced_${e.querySelector('[name="ct_post_type"]').value}`:"ct_forced_any",l.postType.includes(":")&&l.postType.replace("ct_forced_",""),l.ctSearchTaxonomies=(null===(t=e.querySelector('[name="ct_search_taxonomies"]'))||void 0===t?void 0:t.value)||"",l.productPrice=!!e.closest('[data-live-results*="product_price"]'),l.productStatus=!!e.closest('[data-live-results*="product_status"]'),!window.fetch)return;let p=(m=function(t){if(document.removeEventListener("click",o),document.addEventListener("click",o),0===t.target.value.trim().length){g(e.querySelector(".ct-search-results"));let t=e.querySelector("[aria-live]");return void(t&&(t.innerHTML=ct_localizations.search_live_no_result))}l.queryCategory=e.querySelector('[name="ct_tax_query"]')?e.querySelector('[name="ct_tax_query"]').value:"",e.classList.add("ct-searching");const r=new URLSearchParams;r.append("_embed","1"),r.append("post_type",l.postType),r.append("per_page",l.perPage),"true"!==l.productPrice&&!0!==l.productPrice||r.append("product_price",l.productPrice),"true"!==l.productStatus&&!0!==l.productStatus||r.append("product_status",l.productStatus),l.queryCategory&&r.append("ct_tax_query",l.queryCategory),l.ctSearchTaxonomies&&r.append("ct_search_taxonomies",l.ctSearchTaxonomies),ct_localizations.lang&&r.append("lang",ct_localizations.lang),r.append("search",t.target.value),function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return f[e]?new Promise((function(t){t(f[e]),f[e]=f[e].clone()})):new Promise((function(r){return fetch(e,{headers:{"X-WP-Nonce":t}}).then((function(t){r(t),f[e]=t.clone()}))}))}(`${ct_localizations.rest_url}wp/v2/posts${ct_localizations.rest_url.indexOf("?")>-1?"&":"?"}${r.toString()}`,e.querySelector(".ct-live-results-nonce")?e.querySelector(".ct-live-results-nonce").value:"").then((function(r){let o=parseInt(r.headers.get("X-WP-Total"),10);(0,i.Xr)(ct_localizations.dynamic_styles.search_lazy).then((function(){r.json().then((function(r){if(d)return;e.classList.remove("ct-searching");let a=!!e.querySelector(".ct-search-results");d=!0;let i=e.querySelector(".ct-search-results"),{height:u}=i?i.getBoundingClientRect():0;i&&0!==t.target.value.trim().length&&0!==r.length?i&&e.removeChild(i):0!==t.target.value.trim().length&&0!==r.length||g(i);let p=ct_localizations.search_live_no_result;r.length>0&&t.target.value.trim().length>0&&(p=(r.length>1?ct_localizations.search_live_many_results:ct_localizations.search_live_one_result).replace("%s",r.length));let f=e.querySelector("[aria-live]");if(f&&(f.innerHTML=p),r.length>0&&t.target.value.trim().length>0){let i=(0,n.h)("div",{class:"ct-search-results",role:"listbox","aria-label":ct_localizations.search_live_results},r.filter((function(e){return null==e?void 0:e.id})).map((function(t){return h({post:t,hasThumbs:(e.dataset.liveResults||"").indexOf("thumbs")>-1})})),o>l.perPage?(0,n.h)("a",{className:"ct-search-more",href:ct_localizations.search_url.replace(/QUERY_STRING/,t.target.value)},ct_localizations.show_more_text):[]);if(e.appendChild(i),a){let t=e.querySelector(".ct-search-results"),{height:r}=t.getBoundingClientRect();u!==r&&(t.style.height=`${u}px`,t.classList.add("ct-slide"),requestAnimationFrame((function(){t.style.height=`${r}px`,(0,s.k)(t,(function(){t.removeAttribute("style"),t.classList.remove("ct-slide")}))})))}else!function(e){e.classList.add("ct-fade-enter");let{height:t}=e.getBoundingClientRect();e.classList.add("ct-fade-leave"),e.style.height=0,e.closest("form").classList.add("ct-has-dropdown"),requestAnimationFrame((function(){e.style.height=`${t}px`,e.classList.remove("ct-fade-enter"),e.classList.add("ct-fade-enter-active"),(0,s.k)(e,(function(){return e.removeAttribute("style")}))}))}(e.querySelector(".ct-search-results"));e.querySelector(".ct-search-more")&&e.querySelector(".ct-search-more").addEventListener("click",(function(t){t.preventDefault(),e.submit()})),(0,c.O)()&&window.scrollTo(0,0)}d=!1}))}))}))},y=200,function(){if(!y)return m.apply(this,arguments);var e=this,t=arguments;clearTimeout(v),v=setTimeout((function(){return v=null,m.apply(e,t)}),y)});var m,y,v;a.addEventListener("input",p),"modal"===u({mode:"inline"},r).mode&&a.addEventListener("blur",(function(e){return setTimeout((function(){return p(e)}))})),a.addEventListener("focus",(function(e){p(e)})),a.value.length>0&&p({target:a})};function g(e){if(!e)return;let{height:t}=e.getBoundingClientRect();e.classList.add("ct-fade-leave"),e.style.height=`${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,(0,s.k)(e,(function(){return e.parentNode&&e.parentNode.removeChild(e)}))}))}function y(e){var t=[];if("object"==typeof e||"function"==typeof e){for(var r=Object.keys(e),n=r.length,o=0;o!i.includes(e))),s=e=>(e=>c.includes(e))(e)?document.createElementNS("http://www.w3.org/2000/svg",e):e===DocumentFragment?document.createDocumentFragment():document.createElement(e),l=(e,t,r)=>{null!=r&&(/^xlink[AHRST]/.test(t)?e.setAttributeNS("http://www.w3.org/1999/xlink",t.replace("xlink","xlink:").toLowerCase(),r):e.setAttribute(t,r))},u=(e,t,r)=>{const n=s(e);return Object.keys(t).forEach((e=>{const r=t[e];if("class"===e||"className"===e)l(n,"class",r);else if("style"===e)((e,t)=>{Object.keys(t).forEach((r=>{let n=t[r];"number"!=typeof n||a.test(r)||(n+="px"),e.style[r]=n}))})(n,r);else if(0===e.indexOf("on")){const t=e.slice(2).toLowerCase();n.addEventListener(t,r)}else"dangerouslySetInnerHTML"===e?n.innerHTML=r.__html:"key"!==e&&!1!==r&&l(n,e,!0===r?"":r)})),t.dangerouslySetInnerHTML||n.appendChild(r),n};function p(e,t){const r=[].slice.apply(arguments,[2]),n=document.createDocumentFragment();return o(r).forEach((e=>{e instanceof Node?n.appendChild(e):"boolean"!=typeof e&&null!=e&&n.appendChild(document.createTextNode(e))})),u(e,t||{},n)}const d={createElement:p,Fragment:"function"==typeof DocumentFragment?DocumentFragment:()=>{}};e.exports=d,e.exports.h=p,e.exports.default=d},4979:function(e){"use strict";e.exports=JSON.parse('["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","animation","audio","canvas","circle","clipPath","color-profile","cursor","defs","desc","discard","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","handler","hatch","hatchpath","hkern","iframe","image","line","linearGradient","listener","marker","mask","mesh","meshgradient","meshpatch","meshrow","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","prefetch","radialGradient","rect","script","set","solidColor","solidcolor","stop","style","svg","switch","symbol","tbreak","text","textArea","textPath","title","tref","tspan","unknown","use","video","view","vkern"]')}}]);