!function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=2)}([function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}e.exports=function(e,t,i){return t&&n(e.prototype,t),i&&n(e,i),e}},function(e,t,n){e.exports=n(3)},function(e,t,n){"use strict";n.r(t);var i=n(0),o=n.n(i),r=n(1),a=n.n(r),c=function(){function e(){o()(this,e),this.SCROLL_TO_TOP=1,this.SCROLL_TO_BOTTOM=2}return a()(e,[{key:"show",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t&&(e.style.display=null),e.classList.remove("hidden")}},{key:"hide",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t&&(e.style.display="none"),e.classList.add("hidden")}},{key:"showSpinner",value:function(e){e.classList.add("is-active")}},{key:"hideSpinner",value:function(e){e.classList.remove("is-active")}},{key:"enableElement",value:function(e){e.classList.remove("disabled")}},{key:"disableElement",value:function(e){e.classList.add("disabled")}},{key:"scrollTo",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.SCROLL_TO_TOP,i=arguments.length>2?arguments[2]:void 0,o=e.getBoundingClientRect();t=this.SCROLL_TO_BOTTOM===n?window.scrollY-window.innerHeight+o.top+o.height:window.scrollY+o.top;var r=document.scrollingElement||document.documentElement,a=r.scrollTop,c=t-a,s=+new Date,u=function(e,t,n,i){return(e/=i/2)<1?n/2*e*e+t:-n/2*(--e*(e-2)-1)+t},l=function e(){var n=+new Date-s;r.scrollTop=parseInt(u(n,a,c,i)),n<i?requestAnimationFrame(e):r.scrollTop=t};l()}}]),e}(),s=function(){function e(){o()(this,e),this.ajaxUrl=ajaxurl,this.tools=new c}return a()(e,[{key:"init",value:function(){var e=this;this.mainNotice=document.querySelector(".js-classic-editor-notice"),this.mainNotice&&(this.nonce=this.mainNotice.dataset.nonce,this.action=this.mainNotice.dataset.action,this.mainNotice.querySelector(".js-minimize").onclick=function(){return e.minimize()},this.mainNotice.querySelector(".js-request-activation").onclick=function(){return e.requestActivation()}),this.minimizedNotice=document.querySelector(".js-classic-editor-notice-minimized"),this.minimizedNotice&&(this.minimizedNotice.querySelector(".js-maximize").onclick=function(){return e.maximize()})}},{key:"minimize",value:function(){this.tools.hide(this.mainNotice,!0),this.tools.show(this.minimizedNotice,!0),this.ajax({command:"minimize"})}},{key:"maximize",value:function(){this.tools.show(this.mainNotice,!0),this.tools.hide(this.minimizedNotice,!0),this.ajax({command:"maximize"})}},{key:"requestActivation",value:function(){var e=this;this.ajax({command:"requestActivation",manager:this.mainNotice.querySelector(".js-translation-managers").value}).then((function(t){return e.activationResponse(t)}))}},{key:"activationResponse",value:function(e){alert(e)}},{key:"ajax",value:function(e){e.nonce=this.nonce,e.action=this.action;var t=Object.keys(e).map((function(t){return t+"="+e[t]})).join("&");return fetch(this.ajaxUrl,{method:"POST",body:t,headers:{"Content-Type":"application/x-www-form-urlencoded; charset=utf-8"},credentials:"same-origin"}).then((function(e){if(!e.ok)throw new Error(e.statusText);return e.json()})).then((function(e){return e.data.message}))}}]),e}();document.addEventListener("DOMContentLoaded",(function(){(new s).init()}))}]);