(()=>{"use strict";var t={1455:t=>{t.exports=window.wp.apiFetch},23029:(t,o,e)=>{function i(t,o){if(!(t instanceof o))throw new TypeError("Cannot call a class as a function")}e.d(o,{A:()=>i})},49922:(t,o,e)=>{e.d(o,{A:()=>r});var i=e(82284),n=e(92327);function r(t){var o=(0,n.A)(t,"string");return"symbol"==(0,i.A)(o)?o:o+""}},82284:(t,o,e)=>{function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}e.d(o,{A:()=>i})},92327:(t,o,e)=>{e.d(o,{A:()=>n});var i=e(82284);function n(t,o){if("object"!=(0,i.A)(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,o||"default");if("object"!=(0,i.A)(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===o?String:Number)(t)}},92901:(t,o,e)=>{e.d(o,{A:()=>r});var i=e(49922);function n(t,o){for(var e=0;e<o.length;e++){var n=o[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(0,i.A)(n.key),n)}}function r(t,o,e){return o&&n(t.prototype,o),e&&n(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}}},o={};function e(i){var n=o[i];if(void 0!==n)return n.exports;var r=o[i]={exports:{}};return t[i](r,r.exports,e),r.exports}e.n=t=>{var o=t&&t.__esModule?()=>t.default:()=>t;return e.d(o,{a:o}),o},e.d=(t,o)=>{for(var i in o)e.o(o,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:o[i]})},e.o=(t,o)=>Object.prototype.hasOwnProperty.call(t,o);var i=e(23029),n=e(92901),r=e(1455),a=e.n(r),l=UncannyAutomatorTooltipNotification.rest;a().use(a().createNonceMiddleware(l.nonce));var c=function(){return(0,n.A)(function t(){(0,i.A)(this,t),this.tooltips=document.querySelectorAll(".uap-tooltip-notification"),this.initializeTooltips()},[{key:"initializeTooltips",value:function(){var t=this;this.tooltips.forEach(function(o){t.initializeTooltip(o)})}},{key:"initializeTooltip",value:function(t){var o=this,e=t.querySelector(".uap-tooltip-notification__close");this.positionTooltip(t),this.showTooltip(t),e.addEventListener("click",function(e){e.preventDefault(),o.hideTooltip(t,t.dataset.id)})}},{key:"showTooltip",value:function(t){t.classList.remove("uap-tooltip-notification--hidden")}},{key:"hideTooltip",value:function(t,o){t.classList.add("uap-tooltip-notification--hidden"),a()({url:"".concat(l.url,"/tooltip-notification/tooltip_id/").concat(o,"/tooltip_action/hide/"),method:"POST"}).then(function(t){return console.log(t)}).catch(function(t){return console.warn(t)})}},{key:"positionTooltip",value:function(t){var o=document.querySelector(t.dataset.target);if(o){o.insertAdjacentElement(t.dataset.position,t);var e=o.offsetHeight/2-t.offsetHeight/2;["beforebegin","afterend"].includes(t.dataset.position)&&(e+=o.offsetTop),t.style.top="".concat(e,"px")}}}])}();document.addEventListener("DOMContentLoaded",function(){new c})})();
//# sourceMappingURL=tooltip-notification.js.map