!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var o;o="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,o.CS_dashboardHome=e()}}(function(){return function e(o,t,n){function a(i,r){if(!t[i]){if(!o[i]){var s="function"==typeof require&&require;if(!r&&s)return s(i,!0);if(c)return c(i,!0);var l=new Error("Cannot find module '"+i+"'");throw l.code="MODULE_NOT_FOUND",l}var d=t[i]={exports:{}};o[i][0].call(d.exports,function(e){var t=o[i][1][e];return a(t||e)},d,d.exports,e,o,t,n)}return t[i].exports}for(var c="function"==typeof require&&require,i=0;i<n.length;i++)a(n[i]);return a}({1:[function(e,o,t){tco.addDataSource(csDashboardHomeData),tco.addModule("cs-updates",e("./home/auto-updates")),tco.addModule("cs-validation",e("./home/validation")),tco.addModule("cs-validation-revoke",e("./home/revoke")),function(){if(csDashboardHomeData.modules&&csDashboardHomeData.notices)for(var e in csDashboardHomeData.modules){var o=csDashboardHomeData.modules[e];if(o.notices)for(var t in o.notices){o.notices[t];-1!==csDashboardHomeData.notices.indexOf(t)&&tco.showNotice(o.notices[t])}}}()},{"./home/auto-updates":2,"./home/revoke":3,"./home/validation":4}],2:[function(e,o,t){o.exports=function(e,o,t){var n=o["check-now"]||!1,a=o["latest-available"]||!1;n&&a&&(t.latest&&a.html(t.latest),n.find("a").click(function(e){e.preventDefault(),n.html(t.checking),tco.ajax({action:"cs_update_check",_cs_nonce:csDashboardHomeData._cs_nonce,done:function(e){e.latest&&e.latest!==t.latest?(n.html(t.completeNew),a.html(e.latest)):n.html(t.complete)},fail:function(e){console.warn("Cornerstone Update Check Error",e),n.html(t.error)}})}))}},{}],3:[function(e,o,t){o.exports=function(e,o,t){function n(){var e=tco.queryString.parse(tco.queryString.extract(window.location.href));delete e["tco-key"],e.notice="validation-revoked",window.location.search=tco.queryString.stringify(e)}var a=o.revoke||!1;a&&a.click(function(){tco.confirm({message:t.confirm,acceptClass:"tco-btn-nope",acceptBtn:t.accept,declineBtn:t.decline,accept:function(){a.removeAttr("href"),a.html(t.revoking),tco.ajax({action:"cs_validation_revoke",done:n,fail:n,_cs_nonce:csDashboardHomeData._cs_nonce})}})})}},{}],4:[function(e,o,t){o.exports=function(e,o,t){function n(o){if(!o.message)return i(o);o.complete?(e.tcoShowMessage(o.message),setTimeout(c,2500)):a(o)}function a(o){r.html(o.message),s.html(o.button);setTimeout(function(){e.tcoShowMessage("")},1300),setTimeout(function(){l.addClass("tco-active")},1950),o.url?(s.attr("href",o.url),o.newTab&&s.attr("target","_blank")):s.attr("href","#"),s.off("click"),o.dismiss&&s.click(function(){l.removeClass("tco-active"),e.tcoRemoveMessage(),setTimeout(function(){d.val("").prop("disabled",!1)},1300)})}function c(){var e=tco.queryString.parse(window.location.search);delete e["tco-key"],e.notice="validation-complete",window.location.search=tco.queryString.stringify(e)}function i(e){var o=e.message?e.message:e;o.responseText&&(o=o.responseText),a({message:t.error,button:t.errorButton,dismiss:!0}),r.find("[data-tco-error-details]").click(function(e){e.preventDefault(),tco.confirm({message:o,acceptBtn:"",declineBtn:t.errorButton,class:"tco-confirm-error"})}),console.log(e)}var r=o.message||!1,s=o.button||!1,l=o.overlay||!1,d=o.input||!1,f=o.form||!1;if($preloadKey=o["preload-key"]||!1,r&&s&&l&&d&&f&&$preloadKey){f.on("submit",function(o){o.preventDefault(),d.prop("disabled",!0),e.tcoShowMessage(t.verifying),tco.ajax({action:"cs_validation",code:d.val(),_cs_nonce:csDashboardHomeData._cs_nonce,done:n,fail:i})});var u=$preloadKey.val();"string"==typeof u&&u.length>1&&(d.val(u),f.submit()),jQuery("body").on("click",'a[data-tco-focus="validation-input"]',function(e){e.preventDefault(),d.focus()})}}},{}]},{},[1])(1)});