!function(a){a(document).ready(function(){a(".as3cf-settings").each(function(){var b=a(this);a("select.bucket",b).change(function(){var b=a(this);if("new"===b.val()){var c=function(a,c,d){alert(as3cf_i18n.create_bucket_error+d),b[0].selectedIndex=0,console.log(a),console.log(c),console.log(d)},d=function(c){if("undefined"!=typeof c.success){var d=document.createElement("option");d.value=d.innerHTML=e;var f=0;a("option",b).each(function(){return a(this).val()==e?!1:a(this).val()>e||"new"==a(this).val()?(a(d).insertBefore(a(this)),!1):void(f+=1)}),b[0].selectedIndex=f,as3cf_i18n.create_bucket_nonce=c._nonce}else alert(as3cf_i18n.create_bucket_error+c.error),b[0].selectedIndex=0},e=window.prompt(as3cf_i18n.create_bucket_prompt);if(!e)return void(b[0].selectedIndex=0);var f={action:"as3cf-create-bucket",bucket_name:e,_nonce:as3cf_i18n.create_bucket_nonce};a.ajax({url:ajaxurl,type:"POST",dataType:"JSON",success:d,error:c,data:f})}})})})}(jQuery);