|
1
|
+(()=>{var t={9455(t,e,o){"use strict";o.d(e,{A:()=>r});var n=o(1601),s=o.n(n),i=o(6314),a=o.n(i)()(s());a.push([t.id,"/*!\n * Toastify js 1.12.0\n * https://github.com/apvarun/toastify-js\n * @license MIT licensed\n *\n * Copyright (C) 2018 Varun A P\n */\n\n.toastify {\n padding: 12px 20px;\n color: #ffffff;\n display: inline-block;\n box-shadow: 0 3px 6px -1px rgba(0, 0, 0, 0.12), 0 10px 36px -4px rgba(77, 96, 232, 0.3);\n background: -webkit-linear-gradient(315deg, #73a5ff, #5477f5);\n background: linear-gradient(135deg, #73a5ff, #5477f5);\n position: fixed;\n opacity: 0;\n transition: all 0.4s cubic-bezier(0.215, 0.61, 0.355, 1);\n border-radius: 2px;\n cursor: pointer;\n text-decoration: none;\n max-width: calc(50% - 20px);\n z-index: 2147483647;\n}\n\n.toastify.on {\n opacity: 1;\n}\n\n.toast-close {\n background: transparent;\n border: 0;\n color: white;\n cursor: pointer;\n font-family: inherit;\n font-size: 1em;\n opacity: 0.4;\n padding: 0 5px;\n}\n\n.toastify-right {\n right: 15px;\n}\n\n.toastify-left {\n left: 15px;\n}\n\n.toastify-top {\n top: -150px;\n}\n\n.toastify-bottom {\n bottom: -150px;\n}\n\n.toastify-rounded {\n border-radius: 25px;\n}\n\n.toastify-avatar {\n width: 1.5em;\n height: 1.5em;\n margin: -7px 5px;\n border-radius: 2px;\n}\n\n.toastify-center {\n margin-left: auto;\n margin-right: auto;\n left: 0;\n right: 0;\n max-width: fit-content;\n max-width: -moz-fit-content;\n}\n\n@media only screen and (max-width: 360px) {\n .toastify-right, .toastify-left {\n margin-left: auto;\n margin-right: auto;\n left: 0;\n right: 0;\n max-width: fit-content;\n }\n}\n",""]);const r=a},6314(t){"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var o="",n=void 0!==e[5];return e[4]&&(o+="@supports (".concat(e[4],") {")),e[2]&&(o+="@media ".concat(e[2]," {")),n&&(o+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),o+=t(e),n&&(o+="}"),e[2]&&(o+="}"),e[4]&&(o+="}"),o}).join("")},e.i=function(t,o,n,s,i){"string"==typeof t&&(t=[[null,t,void 0]]);var a={};if(n)for(var r=0;r<this.length;r++){var l=this[r][0];null!=l&&(a[l]=!0)}for(var c=0;c<t.length;c++){var d=[].concat(t[c]);n&&a[d[0]]||(void 0!==i&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=i),o&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=o):d[2]=o),s&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=s):d[4]="".concat(s)),e.push(d))}},e}},1601(t){"use strict";t.exports=function(t){return t[1]}},5072(t){"use strict";var e=[];function o(t){for(var o=-1,n=0;n<e.length;n++)if(e[n].identifier===t){o=n;break}return o}function n(t,n){for(var i={},a=[],r=0;r<t.length;r++){var l=t[r],c=n.base?l[0]+n.base:l[0],d=i[c]||0,p="".concat(c," ").concat(d);i[c]=d+1;var u=o(p),f={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==u)e[u].references++,e[u].updater(f);else{var h=s(f,n);n.byIndex=r,e.splice(r,0,{identifier:p,updater:h,references:1})}a.push(p)}return a}function s(t,e){var o=e.domAPI(e);return o.update(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap&&e.supports===t.supports&&e.layer===t.layer)return;o.update(t=e)}else o.remove()}}t.exports=function(t,s){var i=n(t=t||[],s=s||{});return function(t){t=t||[];for(var a=0;a<i.length;a++){var r=o(i[a]);e[r].references--}for(var l=n(t,s),c=0;c<i.length;c++){var d=o(i[c]);0===e[d].references&&(e[d].updater(),e.splice(d,1))}i=l}}},7659(t){"use strict";var e={};t.exports=function(t,o){var n=function(t){if(void 0===e[t]){var o=document.querySelector(t);if(window.HTMLIFrameElement&&o instanceof window.HTMLIFrameElement)try{o=o.contentDocument.head}catch(t){o=null}e[t]=o}return e[t]}(t);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");n.appendChild(o)}},540(t){"use strict";t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},5056(t,e,o){"use strict";t.exports=function(t){var e=o.nc;e&&t.setAttribute("nonce",e)}},7825(t){"use strict";t.exports=function(t){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=t.insertStyleElement(t);return{update:function(o){!function(t,e,o){var n="";o.supports&&(n+="@supports (".concat(o.supports,") {")),o.media&&(n+="@media ".concat(o.media," {"));var s=void 0!==o.layer;s&&(n+="@layer".concat(o.layer.length>0?" ".concat(o.layer):""," {")),n+=o.css,s&&(n+="}"),o.media&&(n+="}"),o.supports&&(n+="}");var i=o.sourceMap;i&&"undefined"!=typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),e.styleTagTransform(n,t,e.options)}(e,t,o)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},1113(t){"use strict";t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}},7736(t){var e;e=function(t){var e=function(t){return new e.lib.init(t)};function o(t,e){return e.offset[t]?isNaN(e.offset[t])?e.offset[t]:e.offset[t]+"px":"0px"}function n(t,e){return!(!t||"string"!=typeof e||!(t.className&&t.className.trim().split(/\s+/gi).indexOf(e)>-1))}return e.defaults={oldestFirst:!0,text:"Toastify is awesome!",node:void 0,duration:3e3,selector:void 0,callback:function(){},destination:void 0,newWindow:!1,close:!1,gravity:"toastify-top",positionLeft:!1,position:"",backgroundColor:"",avatar:"",className:"",stopOnFocus:!0,onClick:function(){},offset:{x:0,y:0},escapeMarkup:!0,ariaLive:"polite",style:{background:""}},e.lib=e.prototype={toastify:"1.12.0",constructor:e,init:function(t){return t||(t={}),this.options={},this.toastElement=null,this.options.text=t.text||e.defaults.text,this.options.node=t.node||e.defaults.node,this.options.duration=0===t.duration?0:t.duration||e.defaults.duration,this.options.selector=t.selector||e.defaults.selector,this.options.callback=t.callback||e.defaults.callback,this.options.destination=t.destination||e.defaults.destination,this.options.newWindow=t.newWindow||e.defaults.newWindow,this.options.close=t.close||e.defaults.close,this.options.gravity="bottom"===t.gravity?"toastify-bottom":e.defaults.gravity,this.options.positionLeft=t.positionLeft||e.defaults.positionLeft,this.options.position=t.position||e.defaults.position,this.options.backgroundColor=t.backgroundColor||e.defaults.backgroundColor,this.options.avatar=t.avatar||e.defaults.avatar,this.options.className=t.className||e.defaults.className,this.options.stopOnFocus=void 0===t.stopOnFocus?e.defaults.stopOnFocus:t.stopOnFocus,this.options.onClick=t.onClick||e.defaults.onClick,this.options.offset=t.offset||e.defaults.offset,this.options.escapeMarkup=void 0!==t.escapeMarkup?t.escapeMarkup:e.defaults.escapeMarkup,this.options.ariaLive=t.ariaLive||e.defaults.ariaLive,this.options.style=t.style||e.defaults.style,t.backgroundColor&&(this.options.style.background=t.backgroundColor),this},buildToast:function(){if(!this.options)throw"Toastify is not initialized";var t=document.createElement("div");for(var e in t.className="toastify on "+this.options.className,this.options.position?t.className+=" toastify-"+this.options.position:!0===this.options.positionLeft?(t.className+=" toastify-left",console.warn("Property `positionLeft` will be depreciated in further versions. Please use `position` instead.")):t.className+=" toastify-right",t.className+=" "+this.options.gravity,this.options.backgroundColor&&console.warn('DEPRECATION NOTICE: "backgroundColor" is being deprecated. Please use the "style.background" property.'),this.options.style)t.style[e]=this.options.style[e];if(this.options.ariaLive&&t.setAttribute("aria-live",this.options.ariaLive),this.options.node&&this.options.node.nodeType===Node.ELEMENT_NODE)t.appendChild(this.options.node);else if(this.options.escapeMarkup?t.innerText=this.options.text:t.innerHTML=this.options.text,""!==this.options.avatar){var n=document.createElement("img");n.src=this.options.avatar,n.className="toastify-avatar","left"==this.options.position||!0===this.options.positionLeft?t.appendChild(n):t.insertAdjacentElement("afterbegin",n)}if(!0===this.options.close){var s=document.createElement("button");s.type="button",s.setAttribute("aria-label","Close"),s.className="toast-close",s.innerHTML="✖",s.addEventListener("click",function(t){t.stopPropagation(),this.removeElement(this.toastElement),window.clearTimeout(this.toastElement.timeOutValue)}.bind(this));var i=window.innerWidth>0?window.innerWidth:screen.width;("left"==this.options.position||!0===this.options.positionLeft)&&i>360?t.insertAdjacentElement("afterbegin",s):t.appendChild(s)}if(this.options.stopOnFocus&&this.options.duration>0){var a=this;t.addEventListener("mouseover",function(e){window.clearTimeout(t.timeOutValue)}),t.addEventListener("mouseleave",function(){t.timeOutValue=window.setTimeout(function(){a.removeElement(t)},a.options.duration)})}if(void 0!==this.options.destination&&t.addEventListener("click",function(t){t.stopPropagation(),!0===this.options.newWindow?window.open(this.options.destination,"_blank"):window.location=this.options.destination}.bind(this)),"function"==typeof this.options.onClick&&void 0===this.options.destination&&t.addEventListener("click",function(t){t.stopPropagation(),this.options.onClick()}.bind(this)),"object"==typeof this.options.offset){var r=o("x",this.options),l=o("y",this.options),c="left"==this.options.position?r:"-"+r,d="toastify-top"==this.options.gravity?l:"-"+l;t.style.transform="translate("+c+","+d+")"}return t},showToast:function(){var t;if(this.toastElement=this.buildToast(),!(t="string"==typeof this.options.selector?document.getElementById(this.options.selector):this.options.selector instanceof HTMLElement||"undefined"!=typeof ShadowRoot&&this.options.selector instanceof ShadowRoot?this.options.selector:document.body))throw"Root element is not defined";var o=e.defaults.oldestFirst?t.firstChild:t.lastChild;return t.insertBefore(this.toastElement,o),e.reposition(),this.options.duration>0&&(this.toastElement.timeOutValue=window.setTimeout(function(){this.removeElement(this.toastElement)}.bind(this),this.options.duration)),this},hideToast:function(){this.toastElement.timeOutValue&&clearTimeout(this.toastElement.timeOutValue),this.removeElement(this.toastElement)},removeElement:function(t){t.className=t.className.replace(" on",""),window.setTimeout(function(){this.options.node&&this.options.node.parentNode&&this.options.node.parentNode.removeChild(this.options.node),t.parentNode&&t.parentNode.removeChild(t),this.options.callback.call(t),e.reposition()}.bind(this),400)}},e.reposition=function(){for(var t,e={top:15,bottom:15},o={top:15,bottom:15},s={top:15,bottom:15},i=document.getElementsByClassName("toastify"),a=0;a<i.length;a++){t=!0===n(i[a],"toastify-top")?"toastify-top":"toastify-bottom";var r=i[a].offsetHeight;t=t.substr(9,t.length-1),(window.innerWidth>0?window.innerWidth:screen.width)<=360?(i[a].style[t]=s[t]+"px",s[t]+=r+15):!0===n(i[a],"toastify-left")?(i[a].style[t]=e[t]+"px",e[t]+=r+15):(i[a].style[t]=o[t]+"px",o[t]+=r+15)}return this},e.lib.init.prototype=e.lib,e},t.exports?t.exports=e():this.Toastify=e()}},e={};function o(n){var s=e[n];if(void 0!==s)return s.exports;var i=e[n]={id:n,exports:{}};return t[n].call(i.exports,i,i.exports,o),i.exports}o.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return o.d(e,{a:e}),e},o.d=(t,e)=>{for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o.nc=void 0,(()=>{"use strict";window.lpToggleEnableInit=0,window.lpFullScreenViewInit=0;var t=o(7736),e=o.n(t),n=o(5072),s=o.n(n),i=o(7825),a=o.n(i),r=o(7659),l=o.n(r),c=o(5056),d=o.n(c),p=o(540),u=o.n(p),f=o(1113),h=o.n(f),m=o(9455),v={};v.styleTagTransform=h(),v.setAttributes=d(),v.insert=l().bind(null,"head"),v.domAPI=a(),v.insertStyleElement=u(),s()(m.A,v),m.A&&m.A.locals&&m.A.locals;const y={text:"",gravity:lpData.toast.gravity,position:lpData.toast.position,className:`${lpData.toast.classPrefix}`,close:1==lpData.toast.close,stopOnFocus:1==lpData.toast.stopOnFocus,duration:lpData.toast.duration},b=(t,o="success",n)=>{let s=y;n&&(s={...s,...n}),new(e())({...s,text:t,className:`${lpData.toast.classPrefix} ${o}`}).showToast()};class g{static selectors={elAddonsNewVersionTotals:".lp-addons-new-version-totals",elBtnDismiss:".btn-lp-notice-dismiss",elAdminMenu:"#adminmenu",elTabLP:"#toplevel_page_learn_press",elTabLPName:".wp-menu-name",elTabLPNotice:".tab-lp-admin-notice",elTabLPAddons:'a[href="admin.php?page=learn-press-addons"]',elMenuAddons:".lp-menu-addons",elUpdatePlugins:".update-plugins",elMessage:".learn-press-message"};init(){((t,e)=>{const o=document.querySelector(t);o?e():new MutationObserver((o,n)=>{const s=document.querySelector(t);s&&(n.disconnect(),e())}).observe(document.documentElement,{childList:!0,subtree:!0})})(g.selectors.elAddonsNewVersionTotals,()=>{this.notifyAddonsNewVersion()}),this.events()}notifyAddonsNewVersion(){try{const t=document.querySelector(g.selectors.elAdminMenu);if(!t)return;const e=t.querySelector(g.selectors.elTabLP);if(!e)return;const o=e.querySelector(g.selectors.elTabLPName);if(!o)return;const n=document.querySelector(g.selectors.elAddonsNewVersionTotals);if(!n)return;const s='<span class="tab-lp-admin-notice"></span>';o.querySelector(g.selectors.elTabLPNotice)||o.insertAdjacentHTML("beforeend",s);const i=e.querySelector(g.selectors.elTabLPAddons);if(!i)return;const a=n.dataset.total,r=i.querySelector(g.selectors.elMenuAddons);if(!r)return;i.setAttribute("href","admin.php?page=learn-press-addons&tab=update"),r.textContent=a,r.classList.remove("lp-hidden")}catch(t){console.log(t)}}events(){g._loadedEvents||(g._loadedEvents=!0,((t,e)=>{document.addEventListener(t,o=>{const n=o.target;let s={e:o,target:n};e.forEach(e=>{s={...s,...e},e.conditionBeforeCallBack&&!0!==e.conditionBeforeCallBack(s)||"keydown"===t&&e.checkIsEventEnter&&"Enter"!==o.key||n.closest(e.selector)&&(e.class?e.class[e.callBack](s):e.callBack(s))})})})("click",[{selector:g.selectors.elBtnDismiss,class:this,callBack:this.dismissNotice.name}]))}dismissNotice(t){const{e,target:o}=t,n=o.closest(g.selectors.elBtnDismiss);if(n&&(e.preventDefault(),confirm(n.dataset.message))){const t=n.closest(g.selectors.elMessage),e=JSON.parse(n.dataset.send);window.lpAJAXG.fetchAJAX(e,{success:e=>{const{message:o,status:n}=e;b(o,n),"success"===n&&t?.remove()},error:t=>{b(t,"error")}})}}}(new g).init()})()})(); |