define("admin/mail_config",["jquery","cla_select2"],function(e,n){return function(e){function n(t){if(s[t])return s[t].exports;var a=s[t]={i:t,l:!1,exports:{}};return e[t].call(a.exports,a,a.exports,n),a.l=!0,a.exports}var s={};return n.m=e,n.c=s,n.i=function(e){return e},n.d=function(e,s,t){n.o(e,s)||Object.defineProperty(e,s,{configurable:!1,enumerable:!0,get:t})},n.n=function(e){var s=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(s,"a",s),s},n.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},n.p="/components/",n(n.s="./assets/js/admin/mail_config.js")}({"./assets/js/admin/mail_config.js":function(e,n,s){var t,a;t=[s(0),s(1)],void 0!==(a=function(e){return function(){e("#mailTabs a").click(function(n){n.preventDefault(),e(this).tab("show")});var n=document.location.toString();n.match("#")&&e('.nav-item a[href="#'+n.split("#")[1]+'"]').tab("show"),e("#mailTabs .nav-link").on("shown.bs.tab",function(e){window.location.hash=e.target.hash});var s=e("#mail_send_driver");s.select2(),s.on("change",function(){e(".js-mail-config-field").addClass("d-none"),e(".js-mail-driver-"+e(this).val()).removeClass("d-none"),e(".js-driver-desc").addClass("d-none"),e("#driver_desc_"+e(this).val()).removeClass("d-none")}),e("#test_connection").on("click",function(n){n.preventDefault();var s=e("#mail_send_driver").val(),t={driver:s,params:{}};e(".js-mail-driver-"+s).find("input").each(function(){for(var n="",s=/\|(.*)]/gm;null!==(matches=s.exec(e(this).prop("name")));)matches.index===s.lastIndex&&s.lastIndex++,matches.forEach(function(e,s){n=e});"radio"===e(this).prop("type")?e(this).prop("checked")&&(t.params[n]=e(this).val()):t.params[n]=e(this).val()}),e.post({method:"POST",url:"/api/sysadmin/v1/mail/test_connection",data:t,success:function(e,n,s){"boolean"==typeof e.result&&e.result?cla.showMessage(lmsg("panels.sysadmin.mail.config.test_success"),"",!1):"boolean"==typeof e.testOccurred&&e.testOccurred?cla.showMessage(lmsg("panels.sysadmin.mail.config.test_fail"),e.errorMessage,!0):cla.showMessage(lmsg("panels.sysadmin.mail.config.test_not_run"),e.errorMessage,"info")},error:function(e,n,s){cla.showMessage(lmsg("common.error"),lmsg("panels.sysadmin.mail.config.test_error"),!0)}})})}}.apply(n,t))&&(e.exports=a)},0:function(n,s){n.exports=e},1:function(e,s){e.exports=n}})});
//# sourceMappingURL=mail_config.js.map