site_oueb_2/wp-content/themes/oceanwp/assets/js/overlay-search.min.js

1 line
12 KiB
JavaScript
Executable File

!function r(n,i,l){function s(t,e){if(!i[t]){if(!n[t]){var o="function"==typeof require&&require;if(!e&&o)return o(t,!0);if(a)return a(t,!0);throw(o=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",o}o=i[t]={exports:{}},n[t][0].call(o.exports,function(e){return s(n[t][1][e]||e)},o,o.exports,r,n,i,l)}return i[t].exports}for(var a="function"==typeof require&&require,e=0;e<l.length;e++)s(l[e]);return s}({1:[function(e,t,o){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),o.options=void 0;var r=oceanwpLocalize;o.options=r},{}],2:[function(e,t,o){"use strict";var r=e("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(o,"__esModule",{value:!0}),o.fadeOutNav=o.fadeInNav=o.isSelectorValid=o.isElement=o.getSiblings=o.visible=o.offset=o.fadeToggle=o.fadeOut=o.fadeIn=o.slideToggle=o.slideUp=o.slideDown=o.wrap=void 0;var n=r(e("@babel/runtime/helpers/typeof"));o.wrap=function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document.createElement("div");return e.nextSibling?e.parentNode.insertBefore(t,e.nextSibling):e.parentNode.appendChild(t),t.appendChild(e)};function i(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:300,o=window.getComputedStyle(e).display;"none"===o&&(o="block"),e.style.transitionProperty="height",e.style.transitionDuration="".concat(t,"ms"),e.style.opacity=0,e.style.display=o;var r=e.offsetHeight;e.style.height=0,e.style.opacity=1,e.style.overflow="hidden",setTimeout(function(){e.style.height="".concat(r,"px")},5),window.setTimeout(function(){e.style.removeProperty("height"),e.style.removeProperty("overflow"),e.style.removeProperty("transition-duration"),e.style.removeProperty("transition-property"),e.style.removeProperty("opacity")},t+50)}o.slideDown=i;function l(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:300;e.style.boxSizing="border-box",e.style.transitionProperty="height, margin",e.style.transitionDuration="".concat(t,"ms"),e.style.height="".concat(e.offsetHeight,"px"),e.style.marginTop=0,e.style.marginBottom=0,e.style.overflow="hidden",setTimeout(function(){e.style.height=0},5),window.setTimeout(function(){e.style.display="none",e.style.removeProperty("height"),e.style.removeProperty("margin-top"),e.style.removeProperty("margin-bottom"),e.style.removeProperty("overflow"),e.style.removeProperty("transition-duration"),e.style.removeProperty("transition-property")},t+50)}o.slideUp=l;o.slideToggle=function(e,t){("none"===window.getComputedStyle(e).display?i:l)(e,t)};function s(e){var t={duration:300,display:null,opacity:1,callback:null};Object.assign(t,1<arguments.length&&void 0!==arguments[1]?arguments[1]:{}),e.style.opacity=0,e.style.display=t.display||"block",setTimeout(function(){e.style.transition="".concat(t.duration,"ms opacity ease"),e.style.opacity=t.opacity},5),setTimeout(function(){e.style.removeProperty("transition"),t.callback&&t.callback()},t.duration+50)}o.fadeIn=s;function a(e){var t;"none"!==e.style.display&&(t={duration:300,display:null,opacity:0,callback:null},Object.assign(t,1<arguments.length&&void 0!==arguments[1]?arguments[1]:{}),e.style.opacity=1,e.style.display=t.display||"block",setTimeout(function(){e.style.transition="".concat(t.duration,"ms opacity ease"),e.style.opacity=t.opacity},5),setTimeout(function(){e.style.display="none",e.style.removeProperty("transition"),t.callback&&t.callback()},t.duration+50))}o.fadeOut=a;o.fadeToggle=function(e,t){("none"===window.getComputedStyle(e).display?s:a)(e,t)};o.offset=function(e){if(!e.getClientRects().length)return{top:0,left:0};var t=e.getBoundingClientRect(),e=e.ownerDocument.defaultView;return{top:t.top+e.pageYOffset,left:t.left+e.pageXOffset}};o.visible=function(e){return!!e&&!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)};o.getSiblings=function(e){var t=[];if(!e.parentNode)return t;for(var o=e.parentNode.firstChild;o;)1===o.nodeType&&o!==e&&t.push(o),o=o.nextSibling;return t};o.isElement=function(e){return"object"===("undefined"==typeof HTMLElement?"undefined":(0,n.default)(HTMLElement))?e instanceof HTMLElement:e&&"object"===(0,n.default)(e)&&null!==e&&1===e.nodeType&&"string"==typeof e.nodeName};var u,e=(u=document.createDocumentFragment(),function(e){try{u.querySelector(e)}catch(e){return!1}return!0});o.isSelectorValid=e;o.fadeInNav=function(e){var t={duration:300,visibility:"visible",opacity:1,callback:null};Object.assign(t,1<arguments.length&&void 0!==arguments[1]?arguments[1]:{}),e.style.opacity=0,e.style.visibility=t.visibility||"visible",setTimeout(function(){e.style.transition="".concat(t.duration,"ms opacity ease"),e.style.opacity=t.opacity},5)};o.fadeOutNav=function(e){var t;"hidden"!==e.style.visibility&&(t={duration:300,visibility:"hidden",opacity:0,callback:null},Object.assign(t,1<arguments.length&&void 0!==arguments[1]?arguments[1]:{}),e.style.opacity=1,e.style.visibility=t.visibility||"visible",setTimeout(function(){e.style.transition="".concat(t.duration,"ms opacity ease"),e.style.opacity=t.opacity},5),setTimeout(function(){e.style.visibility="hidden",e.style.removeProperty("transition"),t.callback&&t.callback()},t.duration+50))}},{"@babel/runtime/helpers/interopRequireDefault":15,"@babel/runtime/helpers/typeof":18}],3:[function(e,t,o){"use strict";var r=e("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0;var n=r(e("@babel/runtime/helpers/classCallCheck")),i=r(e("@babel/runtime/helpers/defineProperty"));o.default=function e(){(0,n.default)(this,e),(0,i.default)(this,"focus",function(e,t){var o=1e3*parseFloat(getComputedStyle(e).transitionDuration.replace("s",""));(o=o||600)&&setTimeout(function(){e.querySelector(t).focus()},o)})}},{"@babel/runtime/helpers/classCallCheck":8,"@babel/runtime/helpers/defineProperty":12,"@babel/runtime/helpers/interopRequireDefault":15}],4:[function(e,t,o){"use strict";var r=e("@babel/runtime/helpers/interopRequireDefault"),n=r(e("@babel/runtime/helpers/classCallCheck")),i=r(e("@babel/runtime/helpers/assertThisInitialized")),l=r(e("@babel/runtime/helpers/inherits")),s=r(e("@babel/runtime/helpers/possibleConstructorReturn")),a=r(e("@babel/runtime/helpers/getPrototypeOf")),u=r(e("@babel/runtime/helpers/classPrivateFieldSet")),c=r(e("@babel/runtime/helpers/classPrivateFieldGet")),p=e("../../constants"),f=e("../../lib/utils"),e=r(e("./base"));function d(o){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=(0,a.default)(o);return t=r?(e=(0,a.default)(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments),(0,s.default)(this,t)}}var y=new WeakMap,b=new WeakMap,v=new WeakMap,m=new WeakMap,h=new WeakMap,e=function(e){(0,l.default)(r,e);var o=d(r);function r(){var t;return(0,n.default)(this,r),t=o.call(this),y.set((0,i.default)(t),{writable:!0,value:void 0}),b.set((0,i.default)(t),{writable:!0,value:function(){(0,u.default)((0,i.default)(t),y,{toggleSearchBtn:document.querySelector("a.search-overlay-toggle"),closeBtn:document.querySelector("#searchform-overlay a.search-overlay-close"),form:document.querySelector("#searchform-overlay"),html:document.querySelector("html")})}}),v.set((0,i.default)(t),{writable:!0,value:function(){var e;null!==(e=(0,c.default)((0,i.default)(t),y).toggleSearchBtn)&&void 0!==e&&e.addEventListener("click",(0,c.default)((0,i.default)(t),m)),null!==(e=(0,c.default)((0,i.default)(t),y).closeBtn)&&void 0!==e&&e.addEventListener("click",(0,c.default)((0,i.default)(t),h))}}),m.set((0,i.default)(t),{writable:!0,value:function(e){e.preventDefault();e=(0,c.default)((0,i.default)(t),y).form;e.classList.add("active"),(0,f.fadeIn)(e),t.focus(e,'input[type="search"]'),setTimeout(function(){(0,c.default)((0,i.default)(t),y).html.style.overflow="hidden"},400)}}),h.set((0,i.default)(t),{writable:!0,value:function(e){e.preventDefault();e=(0,c.default)((0,i.default)(t),y).form;e.classList.remove("active"),(0,f.fadeOut)(e),setTimeout(function(){(0,c.default)((0,i.default)(t),y).html.style.overflow="visible"},400)}}),"overlay"!==p.options.menuSearchStyle?(0,s.default)(t):((0,c.default)((0,i.default)(t),b).call((0,i.default)(t)),(0,c.default)((0,i.default)(t),v).call((0,i.default)(t)),t)}return r}(e.default);window.oceanwp=window.oceanwp||{},oceanwp.overlaySearch=new e},{"../../constants":1,"../../lib/utils":2,"./base":3,"@babel/runtime/helpers/assertThisInitialized":5,"@babel/runtime/helpers/classCallCheck":8,"@babel/runtime/helpers/classPrivateFieldGet":10,"@babel/runtime/helpers/classPrivateFieldSet":11,"@babel/runtime/helpers/getPrototypeOf":13,"@babel/runtime/helpers/inherits":14,"@babel/runtime/helpers/interopRequireDefault":15,"@babel/runtime/helpers/possibleConstructorReturn":16}],5:[function(e,t,o){t.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},t.exports.default=t.exports,t.exports.__esModule=!0},{}],6:[function(e,t,o){t.exports=function(e,t){return t.get?t.get.call(e):t.value},t.exports.default=t.exports,t.exports.__esModule=!0},{}],7:[function(e,t,o){t.exports=function(e,t,o){if(t.set)t.set.call(e,o);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=o}},t.exports.default=t.exports,t.exports.__esModule=!0},{}],8:[function(e,t,o){t.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},t.exports.default=t.exports,t.exports.__esModule=!0},{}],9:[function(e,t,o){t.exports=function(e,t,o){if(!t.has(e))throw new TypeError("attempted to "+o+" private field on non-instance");return t.get(e)},t.exports.default=t.exports,t.exports.__esModule=!0},{}],10:[function(e,t,o){var r=e("./classApplyDescriptorGet.js"),n=e("./classExtractFieldDescriptor.js");t.exports=function(e,t){return t=n(e,t,"get"),r(e,t)},t.exports.default=t.exports,t.exports.__esModule=!0},{"./classApplyDescriptorGet.js":6,"./classExtractFieldDescriptor.js":9}],11:[function(e,t,o){var r=e("./classApplyDescriptorSet.js"),n=e("./classExtractFieldDescriptor.js");t.exports=function(e,t,o){return t=n(e,t,"set"),r(e,t,o),o},t.exports.default=t.exports,t.exports.__esModule=!0},{"./classApplyDescriptorSet.js":7,"./classExtractFieldDescriptor.js":9}],12:[function(e,t,o){t.exports=function(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e},t.exports.default=t.exports,t.exports.__esModule=!0},{}],13:[function(e,t,o){function r(e){return t.exports=r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},t.exports.default=t.exports,t.exports.__esModule=!0,r(e)}t.exports=r,t.exports.default=t.exports,t.exports.__esModule=!0},{}],14:[function(e,t,o){var r=e("./setPrototypeOf.js");t.exports=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}}),t&&r(e,t)},t.exports.default=t.exports,t.exports.__esModule=!0},{"./setPrototypeOf.js":17}],15:[function(e,t,o){t.exports=function(e){return e&&e.__esModule?e:{default:e}},t.exports.default=t.exports,t.exports.__esModule=!0},{}],16:[function(e,t,o){var r=e("@babel/runtime/helpers/typeof").default,n=e("./assertThisInitialized.js");t.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?n(e):t},t.exports.default=t.exports,t.exports.__esModule=!0},{"./assertThisInitialized.js":5,"@babel/runtime/helpers/typeof":18}],17:[function(e,o,t){function r(e,t){return o.exports=r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},o.exports.default=o.exports,o.exports.__esModule=!0,r(e,t)}o.exports=r,o.exports.default=o.exports,o.exports.__esModule=!0},{}],18:[function(e,t,o){function r(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=r=function(e){return typeof e}:t.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t.exports.default=t.exports,t.exports.__esModule=!0,r(e)}t.exports=r,t.exports.default=t.exports,t.exports.__esModule=!0},{}]},{},[4]);