PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.4.10
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.4.10
4.4.10 4.4.9.1 4.4.9 4.4.8 4.4.7 4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 4.4.0 4.3.9.1 4.3.9 4.3.8 4.3.7 4.1.6.9 4.1.6.9.1 4.1.6.9.2 4.1.6.9.3 4.1.6.9.4 4.1.7 4.1.7.1 4.1.7.2 4.1.7.3 All 142 releases
← All changes | assets/js/dist/admin/addons.min.js +1 -1 4.4.6 → 4.4.10 View file →
@@ -1 +1 @@
1 -(()=>{"use strict";const e={};let t;"undefined"!=typeof lpDataAdmin&&(t=lpDataAdmin.lp_rest_url,e.admin={apiAdminNotice:t+"lp/v1/admin/tools/admin-notices",apiAddons:t+"lp/v1/addon/all",apiAddonAction:t+"lp/v1/addon/action-n",apiAddonsPurchase:t+"lp/v1/addon/info-addons-purchase",apiSearchCourses:t+"lp/v1/admin/tools/search-course",apiSearchUsers:t+"lp/v1/admin/tools/search-user",apiAssignUserCourse:t+"lp/v1/admin/tools/assign-user-course",apiUnAssignUserCourse:t+"lp/v1/admin/tools/unassign-user-course"}),"undefined"!=typeof lpData&&(t=lpData.lp_rest_url,e.frontend={apiWidgets:t+"lp/v1/widgets/api",apiCourses:t+"lp/v1/courses/archive-course",apiAJAX:t+"lp/v1/load_content_via_ajax/",apiProfileCoverImage:t+"lp/v1/profile/cover-image"}),t&&(e.apiCourses=t+"lp/v1/courses/",e.apiEditCoursesArchiveBlock=t+"lp/v1/courses/edit-archive-block",e.apiCoursesSuggest=t+"lp/v1/courses/courses-suggest");const s=e;let a,n,o,c;const l=window.location.search,i=new URLSearchParams(l),r=i.get("tab");let d;const u=[],p=(e,t)=>{const s=d.querySelector(".lp-notify-action").cloneNode(!0);s.classList.remove("clone"),d.insertBefore(s,d[0]);const a=s.querySelector(`.${s.classList.value}__success`),n=s.querySelector(`.${s.classList.value}__error`);"success"===e?(a.classList.add("show"),a.querySelector(".message").innerHTML=t):(n.classList.add("show"),n.querySelector(".message").innerHTML=t),d.classList.add("show"),setTimeout(()=>{s.remove(),1===d.querySelectorAll(".lp-notify-action").length&&d.classList.remove("show")},"success"===e?3e3:4e3)};((e="")=>{const t=r?`?tab=${r}`:`?${e}`;fetch(s.admin.apiAddons+t,{method:"GET",headers:{"X-WP-Nonce":lpDataAdmin.nonce}}).then(e=>e.json()).then(e=>{const{status:t,message:s,data:a}=e;"success"===t?(n=a.html,o=a.addons):n=s}).catch(e=>{console.log(e)})})();const v=e=>{e<4?c.classList.add("max-3-items"):c.classList.remove("max-3-items")},h=setInterval(()=>{if(a&&d){if(n&&a&&d){a.innerHTML=n,c=a.querySelector("#lp-addons");const e=document.querySelector(".lp-nav-tab-wrapper");if(!e)return void clearInterval(h);const t=e.cloneNode(!0);a.insertBefore(t,a.children[0]),t.style.display="flex",e.remove();const s=t.querySelector(".nav-tab.nav-tab-active span");v(parseInt(s.textContent)),clearInterval(h)}}else a=document.querySelector(".lp-addons-page"),d=document.querySelector(".lp-notify-action-wrapper")},1);document.addEventListener("DOMContentLoaded",e=>{}),document.addEventListener("click",e=>{let t=e.target;if("span"===t.tagName.toLowerCase()){e.preventDefault();const s=t.closest(".btn-addon-action");s&&s.click()}if(t.closest(".btn-addon-action")){t=t.closest(".btn-addon-action"),e.preventDefault(),t.classList.add("handling");let a="";const n=t.closest(".lp-addon-item"),c=o[n.dataset.slug],l=t.dataset.action,i=n.querySelector(".lp-addon-item__purchase");if("purchase"===l)return i.style.display="block",void(i.querySelector(".purchase-install").style.display="flex");if("update-purchase-code"===l)return i.querySelector(".purchase-update").style.display="flex",void(i.style.display="block");if("buy"===l){const e=t.dataset.link;return void window.open(e,"_blank")}if("cancel"===l)return void(i.style.display="none");if("install"===l&&t.dataset.link){t.classList.remove("handling");const e=t.dataset.link;return void window.open(e,"_blank")}i&&(a=i.querySelector("input[name=purchase-code]").value),((e,t)=>{const a=e.addon.slug;-1===u.indexOf(a)&&(u.push(a),fetch(s.admin.apiAddonAction,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":lpDataAdmin.nonce},body:JSON.stringify({...e})}).then(e=>e.json()).then(e=>{const s=u.indexOf(a);-1!==s&&u.splice(s,1);const{status:n,message:o,data:c}=e;t&&t(n),p(n,o)}).catch(e=>{p("error",`error js: ${e}`),console.log(e)}))})({purchase_code:a,action:l,addon:c},function(e,s,o){if("success"===e)if("install"===l){n.classList.add("installed","activated"),n.classList.remove("not_installed"),i.style.display="none";const e=document.querySelector(".nav-tab[data-tab=installed] span");e.textContent=parseInt(e.textContent)+1;const t=document.querySelector(".nav-tab[data-tab=not_installed] span");t.textContent=parseInt(t.textContent)-1,i.querySelector(".purchase-install").style.display="none",i.querySelector(".purchase-update").querySelector(".enter-purchase-code").value=a}else"update"===l?(n.querySelector(".addon-version-current").innerHTML=c.version,n.classList.remove("update")):"activate"===l?n.classList.add("activated"):"deactivate"===l?n.classList.remove("activated"):"update-purchase"===l&&(i.style.display="none");t.classList.remove("handling")})}if(t.classList.contains("nav-tab")){e.preventDefault(),document.querySelectorAll(".nav-tab").forEach(function(e){e.classList.remove("nav-tab-active")}),t.classList.add("nav-tab-active");const s=t.dataset.tab,n=a.querySelectorAll(".lp-addon-item");a.querySelector("#lp-search-addons__input").value="",i.set("tab",s),window.history.pushState({},"",`${window.location.pathname}?${i.toString()}`);let o=0;n.forEach(e=>{e.classList.remove("search-not-found"),"all"===s||e.classList.contains(s)?(e.classList.remove("hide"),o++):e.classList.add("hide")}),v(o)}}),document.addEventListener("input",e=>{const t=e.target;if("lp-search-addons__input"===t.id&&(e=>{const t=a.querySelectorAll(".lp-addon-item");let s=0;t.forEach(t=>{const a=t.querySelector("a").textContent;t.classList.contains("hide")||(a.toLowerCase().includes(e.toLowerCase())?(t.classList.remove("search-not-found"),s++):t.classList.add("search-not-found"))}),v(s)})(t.value),t.classList.contains("enter-purchase-code")){e.preventDefault();const s=t.value,a=t.closest(".lp-addon-item__purchase");a&&(a.querySelector("input[name=purchase-code]").value=s)}})})();
1 +(()=>{var e={6184(e,t,s){"use strict";var o=s(7736),a=s.n(o),n=s.cjs(function(e,t){var s=[];function o(e){for(var t=-1,o=0;o<s.length;o++)if(s[o].identifier===e){t=o;break}return t}function a(e,t){for(var a={},i=[],r=0;r<e.length;r++){var l=e[r],c=t.base?l[0]+t.base:l[0],d=a[c]||0,u="".concat(c," ").concat(d);a[c]=d+1;var p=o(u),h={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==p)s[p].references++,s[p].updater(h);else{var f=n(h,t);t.byIndex=r,s.splice(r,0,{identifier:u,updater:f,references:1})}i.push(u)}return i}function n(e,t){var s=t.domAPI(t);return s.update(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;s.update(e=t)}else s.remove()}}e.exports=function(e,t){var n=a(e=e||[],t=t||{});return function(e){e=e||[];for(var i=0;i<n.length;i++){var r=o(n[i]);s[r].references--}for(var l=a(e,t),c=0;c<n.length;c++){var d=o(n[c]);0===s[d].references&&(s[d].updater(),s.splice(d,1))}n=l}}}),i=s.n(n),r=s.cjs(function(e,t){e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(s){!function(e,t,s){var o="";s.supports&&(o+="@supports (".concat(s.supports,") {")),s.media&&(o+="@media ".concat(s.media," {"));var a=void 0!==s.layer;a&&(o+="@layer".concat(s.layer.length>0?" ".concat(s.layer):""," {")),o+=s.css,a&&(o+="}"),s.media&&(o+="}"),s.supports&&(o+="}");var n=s.sourceMap;n&&"undefined"!=typeof btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(n))))," */")),t.styleTagTransform(o,e,t.options)}(t,e,s)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}}),l=s.n(r),c=s.cjs(function(e,t){var s={};e.exports=function(e,t){var o=function(e){if(void 0===s[e]){var t=document.querySelector(e);if(window.HTMLIFrameElement&&t instanceof window.HTMLIFrameElement)try{t=t.contentDocument.head}catch(e){t=null}s[e]=t}return s[e]}(e);if(!o)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");o.appendChild(t)}}),d=s.n(c),u=s.cjs(function(e,t){e.exports=function(e){var t=s.nc;t&&e.setAttribute("nonce",t)}}),p=s.n(u),h=s.cjs(function(e,t){e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}}),f=s.n(h),y=s.cjs(function(e,t){e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}}),g=s.n(y),v=s(9455),m={};m.styleTagTransform=g(),m.setAttributes=p(),m.insert=d().bind(null,"head"),m.domAPI=l(),m.insertStyleElement=f(),i()(v.A,m),v.A&&v.A.locals&&v.A.locals;const b={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},S=(e,t="success",s)=>{let o=b;s&&(o={...o,...s}),new(a())({...o,text:e,className:`${lpData.toast.classPrefix} ${t}`}).showToast()},A="loading",C=(e,t)=>{e&&(t?e.classList.add(A):e.classList.remove(A))},w=(e,t)=>{document.addEventListener(e,s=>{const o=s.target;let a={e:s,target:o};t.forEach(t=>{a={...a,...t},t.conditionBeforeCallBack&&!0!==t.conditionBeforeCallBack(a)||"keydown"===e&&t.checkIsEventEnter&&"Enter"!==s.key||o.closest(t.selector)&&(t.class?t.class[t.callBack](a):t.callBack(a))})})};window.lpToggleEnableInit=0,window.lpFullScreenViewInit=0;class x{constructor(){this.elAddonsPage=null,this.urlParams=new URLSearchParams(window.location.search)}static selectors={elAddonsPage:".lp-addons-page",elToolbar:".lp-addons-toolbar",elLPAddons:"#lp-addons",elAddonItem:".lp-addon-item",elBtnAction:".btn-addon-action",elNavTab:".nav-tab",elNavTabActive:".nav-tab.nav-tab-active",elFilter:".lp-addons-filter",elFilterToggle:".lp-addons-filter__toggle",elFilterMenu:".lp-addons-filter__menu",elCategory:".lp-addons-category",elCategoryActive:".lp-addons-category.active",elSearch:".lp-addons-search",elSearchBtn:".lp-addons-search__btn",elSearchBtnClear:".lp-addons-search__btn-clear",elSearchClose:".lp-addons-search__close",elSearchInput:"#lp-search-addons__input",elItemPurchase:".lp-addon-item__purchase",elPurchaseInstall:".purchase-install",elPurchaseCode:".enter-purchase-code",elLicense:".lp-addon-license"};init(){((e,t)=>{const s=document.querySelector(e);s?t():new MutationObserver((s,o)=>{const a=document.querySelector(e);a&&(o.disconnect(),t())}).observe(document.documentElement,{childList:!0,subtree:!0})})(x.selectors.elLPAddons,()=>{if(this.elAddonsPage=document.querySelector(x.selectors.elAddonsPage),!this.elAddonsPage)return;const e=x.selectors,t=this.urlParams.get("tab");if(t){const s=this.elAddonsPage.querySelector(`${e.elNavTab}[data-tab="${t}"]`);s&&(this.elAddonsPage.querySelectorAll(e.elNavTab).forEach(e=>{e.classList.remove("nav-tab-active"),e.setAttribute("aria-pressed","false")}),s.classList.add("nav-tab-active"),s.setAttribute("aria-pressed","true"))}let s=this.elAddonsPage.querySelector(e.elNavTabActive);s||(s=this.elAddonsPage.querySelector(`${e.elNavTab}[data-tab="all"]`)||this.elAddonsPage.querySelector(e.elNavTab),s&&(s.classList.add("nav-tab-active"),s.setAttribute("aria-pressed","true")));let o=this.elAddonsPage.querySelector(e.elCategoryActive);o||(o=this.elAddonsPage.querySelector(`${e.elCategory}[data-category="all"]`)||this.elAddonsPage.querySelector(e.elCategory),o&&(o.classList.add("active"),o.setAttribute("aria-pressed","true"))),this.filterAddons(),this.updateSearchClearBtnState(),this.updateFilterToggleState(),this.events()})}events(){w("click",[{selector:x.selectors.elBtnAction,class:this,callBack:this.handleBtnAction.name},{selector:x.selectors.elNavTab,class:this,callBack:this.handleTabClick.name},{selector:x.selectors.elCategory,class:this,callBack:this.handleCategoryClick.name},{selector:x.selectors.elFilterToggle,class:this,callBack:this.handleFilterToggleClick.name},{selector:x.selectors.elSearchBtn,class:this,callBack:this.handleSearchBtnClick.name},{selector:x.selectors.elSearchBtnClear,class:this,callBack:this.handleSearchClearClick.name},{selector:x.selectors.elSearchClose,class:this,callBack:this.handleSearchCloseClick.name}]),w("input",[{selector:x.selectors.elSearchInput,class:this,callBack:this.handleSearchInput.name},{selector:x.selectors.elPurchaseCode,class:this,callBack:this.handlePurchaseCodeInput.name}]),w("keydown",[{selector:x.selectors.elSearchInput,class:this,callBack:this.handleSearchKeydown.name}]),document.addEventListener("click",e=>{if(!this.elAddonsPage)return;const t=this.elAddonsPage.querySelector(x.selectors.elToolbar);t&&t.classList.contains("is-filter-open")&&(t.contains(e.target)||this.toggleFilterMenu(!1))}),document.addEventListener("keydown",e=>{"Escape"===e.key&&this.toggleFilterMenu(!1)})}getAddonData(e){try{return JSON.parse(e.dataset.addon)}catch(e){return null}}addonsAction(e){const{action:t,addon:s,el:o,elAddonItem:a}=e,n=x.selectors,i={action:"addon_action",action_type:t,addon:s,purchase_code:e.purchase_code||"",id_url:"addon-action"},r=()=>{C(o,0)};window.lpAJAXG.fetchAJAX(i,{success:e=>{r();const{status:s,message:i,data:l}=e;if(S(i,s),"success"===s&&l?.html)a.outerHTML=l.html;else if("install"===t||"update-purchase"===t){const e=o.closest(n.elPurchaseInstall),t=e?e.querySelector(n.elPurchaseCode):null;t&&(t.classList.add("is-error"),t.setAttribute("aria-invalid","true"))}},error:e=>{r(),S(`error js: ${e}`,"error")}})}filterAddons(){const e=x.selectors,t=this.elAddonsPage.querySelectorAll(e.elAddonItem);this.updateTabCounts(t);const s=this.elAddonsPage.querySelector(e.elNavTabActive),o=this.elAddonsPage.querySelector(e.elCategoryActive),a=this.elAddonsPage.querySelector(e.elSearchInput),n=s?s.dataset.tab:"all",i=o?o.dataset.category:"all",r=(a?a.value.trim().toLowerCase():"").split(/\s+/).filter(Boolean);this.updateCategoryCounts(t,n),t.forEach(e=>{const t=JSON.parse(e.dataset.addon),s=e.querySelector("a").textContent.toLowerCase()+t.description,o=(e.dataset.category||"").split(/\s+/).filter(Boolean),a="all"===n||e.classList.contains(n),l="all"===i||o.includes(i),c=r.every(e=>s.includes(e)),d=a&&l&&c;e.classList.toggle("hide",!a),e.classList.toggle("search-not-found",!d)})}updateCategoryCounts(e,t){const s={all:0};e.forEach(e=>{("all"===t||e.classList.contains(t))&&(s.all++,(e.dataset.category||"").split(/\s+/).filter(Boolean).forEach(e=>{s[e]=(s[e]||0)+1}))}),this.elAddonsPage.querySelectorAll(x.selectors.elCategory).forEach(e=>{const t=s[e.dataset.category]||0,o=e.querySelector(".lp-addons-category__count");o&&(o.textContent=`(${t})`),e.hidden="all"!==e.dataset.category&&0===t})}updateTabCounts(e){this.elAddonsPage.querySelectorAll(x.selectors.elNavTab).forEach(t=>{const s=t.dataset.tab,o=Array.from(e).filter(e=>"all"===s||e.classList.contains(s)).length,a=t.querySelector("span");a&&(a.textContent=o)})}handleBtnAction(e){const{e:t,target:s}=e,o=x.selectors,a=s.closest(o.elBtnAction);if("A"===a.tagName)return;t.preventDefault(),C(a,1);let n="";const i=a.closest(o.elAddonItem),r=this.getAddonData(i),l=a.dataset.action,c=i.querySelector(o.elItemPurchase);if(r){if("purchase"===l||"update-purchase-code"===l){const e=c.querySelector(o.elPurchaseInstall),t=e.querySelector(o.elPurchaseCode),s=e.querySelector(".lp-addon-purchase__submit"),n=e.querySelector(".lp-addon-purchase__clear"),r=e.querySelector(".lp-addon-purchase__cancel-clear");let d=!1;if("update-purchase-code"===l){const e=i.querySelector(o.elLicense);t.value=e&&e.dataset.purchaseCodeMasked||"",d=""!==t.value,s.dataset.action="update-purchase"}else t.value="",s.dataset.action="install";return t.disabled=d,s.classList.toggle("lp-hidden",d),n.classList.toggle("lp-hidden",!d),r.classList.add("lp-hidden"),t.classList.remove("is-error"),t.removeAttribute("aria-invalid"),c.querySelector("input[name=purchase-code]").value="",e.style.display="flex",c.style.display="block",d||t.focus(),void C(a,0)}if("clear-license"===l){const e=c.querySelector(o.elPurchaseCode),t=c.querySelector(".lp-addon-purchase__submit"),s=c.querySelector(".lp-addon-purchase__clear"),n=c.querySelector(".lp-addon-purchase__cancel-clear");return e.value="",e.disabled=!1,e.classList.remove("is-error"),e.removeAttribute("aria-invalid"),c.querySelector("input[name=purchase-code]").value="",t.classList.remove("lp-hidden"),s.classList.add("lp-hidden"),n.classList.remove("lp-hidden"),e.focus(),void C(a,0)}if("cancel-clear-license"===l){const e=i.querySelector(o.elLicense),t=c.querySelector(o.elPurchaseCode),s=c.querySelector(".lp-addon-purchase__submit"),n=c.querySelector(".lp-addon-purchase__clear");return t.value=e&&e.dataset.purchaseCodeMasked||"",t.disabled=!0,t.classList.remove("is-error"),t.removeAttribute("aria-invalid"),c.querySelector("input[name=purchase-code]").value="",s.classList.add("lp-hidden"),n.classList.remove("lp-hidden"),a.classList.add("lp-hidden"),void C(a,0)}if("cancel"===l)return c.style.display="none",c.querySelector(o.elPurchaseInstall).style.display="none",void C(a,0);c&&(n=c.querySelector("input[name=purchase-code]").value),this.addonsAction({purchase_code:n,action:l,addon:r,el:a,elAddonItem:i})}else C(a,0)}handleTabClick(e){const{e:t,target:s}=e,o=x.selectors,a=s.closest(o.elNavTab);t.preventDefault(),this.elAddonsPage.querySelectorAll(o.elNavTab).forEach(e=>{e.classList.remove("nav-tab-active"),e.setAttribute("aria-pressed","false")}),a.classList.add("nav-tab-active"),a.setAttribute("aria-pressed","true"),a.scrollIntoView&&a.scrollIntoView({inline:"center",block:"nearest",behavior:"smooth"});const n=a.dataset.tab,i=this.elAddonsPage.querySelector(o.elSearchInput);i&&(i.value="");const r=this.elAddonsPage.querySelector(o.elSearch);if(r){r.classList.remove("is-open");const e=r.querySelector(o.elSearchBtn);e&&e.setAttribute("aria-expanded","false")}this.elAddonsPage.querySelectorAll(o.elCategory).forEach(e=>{const t="all"===e.dataset.category;e.classList.toggle("active",t),e.setAttribute("aria-pressed",t?"true":"false")}),this.urlParams.set("tab",n),window.history.pushState({},"",`${window.location.pathname}?${this.urlParams.toString()}`),this.updateFilterToggleState(),this.filterAddons()}handleFilterToggleClick(e){const{e:t}=e;t.preventDefault(),t.stopPropagation(),this.toggleFilterMenu()}toggleFilterMenu(e){const t=x.selectors,s=this.elAddonsPage.querySelector(t.elToolbar),o=this.elAddonsPage.querySelector(t.elFilter);if(!s&&!o)return;const a=this.elAddonsPage.querySelector(t.elFilterToggle),n=void 0!==e?e:s?!s.classList.contains("is-filter-open"):!o.classList.contains("is-open");s&&s.classList.toggle("is-filter-open",n),o&&o.classList.toggle("is-open",n),a&&a.setAttribute("aria-expanded",n?"true":"false")}updateFilterToggleState(){const e=x.selectors,t=this.elAddonsPage.querySelector(e.elFilterToggle);if(!t)return;const s=this.elAddonsPage.querySelector(e.elNavTabActive),o=this.elAddonsPage.querySelector(e.elCategoryActive),a=s?s.dataset.tab:"all",n=o?o.dataset.category:"all",i="all"!==a||"all"!==n;t.classList.toggle("has-filter",i)}handleCategoryClick(e){const{e:t,target:s}=e,o=s.closest(x.selectors.elCategory);t.preventDefault(),this.elAddonsPage.querySelectorAll(x.selectors.elCategory).forEach(e=>{const t=e===o;e.classList.toggle("active",t),e.setAttribute("aria-pressed",t?"true":"false")}),this.updateFilterToggleState(),this.filterAddons()}handleSearchInput(){this.updateSearchClearBtnState(),this.filterAddons()}handleSearchBtnClick(e){const{e:t}=e;t.preventDefault(),this.toggleFilterMenu(!1);const s=x.selectors,o=this.elAddonsPage.querySelector(s.elSearch),a=this.elAddonsPage.querySelector(s.elSearchInput);if(o){o.classList.add("is-open");const e=o.querySelector(s.elSearchBtn);e&&e.setAttribute("aria-expanded","true")}a&&(this.updateSearchClearBtnState(),a.focus())}handleSearchClearClick(e){const{e:t}=e;t.preventDefault();const s=x.selectors,o=this.elAddonsPage.querySelector(s.elSearchInput);o&&(o.value="",this.updateSearchClearBtnState(),this.filterAddons(),o.focus())}updateSearchClearBtnState(){const e=x.selectors,t=this.elAddonsPage.querySelector(e.elSearchInput),s=this.elAddonsPage.querySelector(e.elSearchBtnClear);s&&t&&(s.disabled=!t.value.trim())}handleSearchCloseClick(e){const{e:t}=e;t.preventDefault(),this.closeSearch()}handleSearchKeydown(e){const{e:t}=e;"Escape"===t.key&&(t.preventDefault(),this.closeSearch())}closeSearch(){const e=x.selectors,t=this.elAddonsPage.querySelector(e.elSearch),s=this.elAddonsPage.querySelector(e.elSearchInput);if(t){t.classList.remove("is-open");const s=t.querySelector(e.elSearchBtn);s&&(s.setAttribute("aria-expanded","false"),s.focus())}s&&s.value&&(s.value="",this.filterAddons()),this.updateSearchClearBtnState()}handlePurchaseCodeInput(e){const{e:t,target:s}=e;t.preventDefault(),s.classList.remove("is-error"),s.removeAttribute("aria-invalid");const o=s.value,a=s.closest(x.selectors.elItemPurchase);a&&(a.querySelector("input[name=purchase-code]").value=o)}}(new x).init()},9455(e,t,s){"use strict";var o=s(1601),a=s.n(o),n=s(6314),i=s.n(n)()(a());i.push([e.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=i;s.d(t,["A",0,r])},6314(e){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var s="",o=void 0!==t[5];return t[4]&&(s+="@supports (".concat(t[4],") {")),t[2]&&(s+="@media ".concat(t[2]," {")),o&&(s+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),s+=e(t),o&&(s+="}"),t[2]&&(s+="}"),t[4]&&(s+="}"),s}).join("")},t.i=function(e,s,o,a,n){"string"==typeof e&&(e=[[null,e,void 0]]);var i={};if(o)for(var r=0;r<this.length;r++){var l=this[r][0];null!=l&&(i[l]=!0)}for(var c=0;c<e.length;c++){var d=[].concat(e[c]);o&&i[d[0]]||(void 0!==n&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=n),s&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=s):d[2]=s),a&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=a):d[4]="".concat(a)),t.push(d))}},t}},1601(e){"use strict";e.exports=function(e){return e[1]}},7736(e){var t;t=function(e){var t=function(e){return new t.lib.init(e)};function s(e,t){return t.offset[e]?isNaN(t.offset[e])?t.offset[e]:t.offset[e]+"px":"0px"}function o(e,t){return!(!e||"string"!=typeof t||!(e.className&&e.className.trim().split(/\s+/gi).indexOf(t)>-1))}return t.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:""}},t.lib=t.prototype={toastify:"1.12.0",constructor:t,init:function(e){return e||(e={}),this.options={},this.toastElement=null,this.options.text=e.text||t.defaults.text,this.options.node=e.node||t.defaults.node,this.options.duration=0===e.duration?0:e.duration||t.defaults.duration,this.options.selector=e.selector||t.defaults.selector,this.options.callback=e.callback||t.defaults.callback,this.options.destination=e.destination||t.defaults.destination,this.options.newWindow=e.newWindow||t.defaults.newWindow,this.options.close=e.close||t.defaults.close,this.options.gravity="bottom"===e.gravity?"toastify-bottom":t.defaults.gravity,this.options.positionLeft=e.positionLeft||t.defaults.positionLeft,this.options.position=e.position||t.defaults.position,this.options.backgroundColor=e.backgroundColor||t.defaults.backgroundColor,this.options.avatar=e.avatar||t.defaults.avatar,this.options.className=e.className||t.defaults.className,this.options.stopOnFocus=void 0===e.stopOnFocus?t.defaults.stopOnFocus:e.stopOnFocus,this.options.onClick=e.onClick||t.defaults.onClick,this.options.offset=e.offset||t.defaults.offset,this.options.escapeMarkup=void 0!==e.escapeMarkup?e.escapeMarkup:t.defaults.escapeMarkup,this.options.ariaLive=e.ariaLive||t.defaults.ariaLive,this.options.style=e.style||t.defaults.style,e.backgroundColor&&(this.options.style.background=e.backgroundColor),this},buildToast:function(){if(!this.options)throw"Toastify is not initialized";var e=document.createElement("div");for(var t in e.className="toastify on "+this.options.className,this.options.position?e.className+=" toastify-"+this.options.position:!0===this.options.positionLeft?(e.className+=" toastify-left",console.warn("Property `positionLeft` will be depreciated in further versions. Please use `position` instead.")):e.className+=" toastify-right",e.className+=" "+this.options.gravity,this.options.backgroundColor&&console.warn('DEPRECATION NOTICE: "backgroundColor" is being deprecated. Please use the "style.background" property.'),this.options.style)e.style[t]=this.options.style[t];if(this.options.ariaLive&&e.setAttribute("aria-live",this.options.ariaLive),this.options.node&&this.options.node.nodeType===Node.ELEMENT_NODE)e.appendChild(this.options.node);else if(this.options.escapeMarkup?e.innerText=this.options.text:e.innerHTML=this.options.text,""!==this.options.avatar){var o=document.createElement("img");o.src=this.options.avatar,o.className="toastify-avatar","left"==this.options.position||!0===this.options.positionLeft?e.appendChild(o):e.insertAdjacentElement("afterbegin",o)}if(!0===this.options.close){var a=document.createElement("button");a.type="button",a.setAttribute("aria-label","Close"),a.className="toast-close",a.innerHTML="&#10006;",a.addEventListener("click",function(e){e.stopPropagation(),this.removeElement(this.toastElement),window.clearTimeout(this.toastElement.timeOutValue)}.bind(this));var n=window.innerWidth>0?window.innerWidth:screen.width;("left"==this.options.position||!0===this.options.positionLeft)&&n>360?e.insertAdjacentElement("afterbegin",a):e.appendChild(a)}if(this.options.stopOnFocus&&this.options.duration>0){var i=this;e.addEventListener("mouseover",function(t){window.clearTimeout(e.timeOutValue)}),e.addEventListener("mouseleave",function(){e.timeOutValue=window.setTimeout(function(){i.removeElement(e)},i.options.duration)})}if(void 0!==this.options.destination&&e.addEventListener("click",function(e){e.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&&e.addEventListener("click",function(e){e.stopPropagation(),this.options.onClick()}.bind(this)),"object"==typeof this.options.offset){var r=s("x",this.options),l=s("y",this.options),c="left"==this.options.position?r:"-"+r,d="toastify-top"==this.options.gravity?l:"-"+l;e.style.transform="translate("+c+","+d+")"}return e},showToast:function(){var e;if(this.toastElement=this.buildToast(),!(e="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 s=t.defaults.oldestFirst?e.firstChild:e.lastChild;return e.insertBefore(this.toastElement,s),t.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(e){e.className=e.className.replace(" on",""),window.setTimeout(function(){this.options.node&&this.options.node.parentNode&&this.options.node.parentNode.removeChild(this.options.node),e.parentNode&&e.parentNode.removeChild(e),this.options.callback.call(e),t.reposition()}.bind(this),400)}},t.reposition=function(){for(var e,t={top:15,bottom:15},s={top:15,bottom:15},a={top:15,bottom:15},n=document.getElementsByClassName("toastify"),i=0;i<n.length;i++){e=!0===o(n[i],"toastify-top")?"toastify-top":"toastify-bottom";var r=n[i].offsetHeight;e=e.substr(9,e.length-1),(window.innerWidth>0?window.innerWidth:screen.width)<=360?(n[i].style[e]=a[e]+"px",a[e]+=r+15):!0===o(n[i],"toastify-left")?(n[i].style[e]=t[e]+"px",t[e]+=r+15):(n[i].style[e]=s[e]+"px",s[e]+=r+15)}return this},t.lib.init.prototype=t.lib,t},e.exports?e.exports=t():this.Toastify=t()}};const t={};function s(o){const a=t[o];if(void 0!==a)return a.exports;const n=t[o]={id:o,exports:{}};return e[o].call(n.exports,n,n.exports,s),n.exports}s.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{if(Array.isArray(t))for(var o=0;o<t.length;){var a=t[o++],n=t[o++];s.o(e,a)?0===n&&o++:0===n?Object.defineProperty(e,a,{enumerable:!0,value:t[o++]}):Object.defineProperty(e,a,{enumerable:!0,get:n})}else for(var a in t)s.o(t,a)&&!s.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},s.o=(e,t)=>Object.hasOwn(e,t),s.cjs=e=>{const t={exports:{}};return e.call(t.exports,t,t.exports),t.exports},s.nc=void 0,s(6184)})();