window.bootbox=window.bootbox||functiona(b,c){"use strict";functiond(a){varb=s[q.locale];returnb?b[a]:s.en[a]}functione(a,c,d){a.preventDefault();vare=b.isFunction(d)&&d(a)===!1;e||c.modal("hide")}functionf(a){varb,c=0;for(bina)c++;returnc}functiong(a,c){vard=0;b.each(a,function(a,b){c(a,b,d++)})}functionh(a){varc,d;if("object"!=typeofa)thrownewError("Please supply an object of options");if(!a.message)thrownewError("Please specify a message");returna=b.extend({},q,a),a.buttons||(a.buttons={}),a.backdrop=a.backdrop?"static":!1,c=a.buttons,d=f(c),g(c,function(a,e,f){if(b.isFunction(e)&&(e=c[a]={callback:e}),"object"!==b.type(e))thrownewError("button with key "+a+" must be an object");e.label||(e.label=a),e.className||(e.className=2>=d&&f===d-1?"btn-primary":"btn-default")}),a}functioni(a,b){varc=a.length,d={};if(1>c||c>2)thrownewError("Invalid argument length");return2===c||"string"==typeofa[0]?(d[b[0]]=a[0],d[b[1]]=a[1]):d=a[0],d}functionj(a,c,d){returnb.extend(!0,{},a,i(c,d))}functionk(a,b,c){returnn(j(m.apply(null,a),b,c),a)}functionl(){for(vara={},b=0,c=arguments.length;c>b;b++){vare=arguments[b],f=e.toLowerCase(),g=e.toUpperCase();a[f]={label:d(g)}}returna}functionm(){return{buttons:l.apply(null,arguments)}}functionn(a,b){vard={};returng(b,function(a,b){d[b]=!0}),g(a.buttons,function(a){if(d[a]===c)thrownewError("button key "+a+" is not allowed (options are "+b.join("\n")+")")}),a}varo={dialog:"<div class='bootbox modal' tabindex='-1' role='dialog'><div class='modal-dialog'><div class='modal-content'><div class='modal-body'><div class='bootbox-body'></div></div></div></div></div>",header:"<div class='modal-header'><h4 class='modal-title'></h4></div>",footer:"<div class='modal-footer'></div>",closeButton:"<button type='button' class='bootbox-close-button close'>×</button>",form:"<form class='bootbox-form'></form>",inputs:{text:"<input class='bootbox-input form-control' autocomplete=off type=text />"}},p=b("body"),q={locale:"en",backdrop:!0,animate:!0,className:null,closeButton:!0,show:!0},r={};r.alert=function(){vara;if(a=k(["ok"],arguments,["message","callback"]),a.callback&&!b.isFunction(a.callback))thrownewError("alert requires callback property to be a function when provided");returna.buttons.ok.callback=a.onEscape=function(){returnb.isFunction(a.callback)?a.callback():!0},r.dialog(a)},r.confirm=function(){vara;if(a=k(["cancel","confirm"],arguments,["message","callback"]),a.buttons.cancel.callback=a.onEscape=function(){returna.callback(!1)},a.buttons.confirm.callback=function(){returna.callback(!0)},!b.isFunction(a.callback))thrownewError("confirm requires a callback");returnr.dialog(a)},r.prompt=function(){vara,d,e,f,g,h;if(f=b(o.form),d={buttons:l("cancel","confirm"),value:""},a=n(j(d,arguments,["title","callback"]),["cancel","confirm"]),h=a.show===c?!0:a.show,a.message=f,a.buttons.cancel.callback=a.onEscape=function(){returna.callback(null)},a.buttons.confirm.callback=function(){returna.callback(g.val())},a.show=!1,!a.title)thrownewError("prompt requires a title");if(!b.isFunction(a.callback))thrownewError("prompt requires a callback");returng=b(o.inputs.text),g.val(a.value),f.append(g),f.on("submit",function(a){a.preventDefault(),e.find(".btn-primary").click()}),e=r.dialog(a),e.off("shown.bs.modal"),e.on("shown.bs.modal",function(){g.focus()}),h===!0&&e.modal("show"),e},r.dialog=function(a){a=h(a);varc=b(o.dialog),d=c.find(".modal-body"),f=a.buttons,i="",j={onEscape:a.onEscape};if(g(f,function(a,b){i+="<button data-bb-handler='"+a+"' type='button' class='btn "+b.className+"'>"+b.label+"</button>",j[a]=b.callback}),d.find(".bootbox-body").html(a.message),a.animate===!0&&c.addClass("fade"),a.className&&c.addClass(a.className),a.title&&d.before(o.header),a.closeButton){vark=b(o.closeButton);a.title?c.find(".modal-header").prepend(k):k.css("margin-top","-10px").prependTo(d)}returna.title&&c.find(".modal-title").html(a.title),i.length&&(d.after(o.footer),c.find(".modal-footer").html(i)),c.on("hidden.bs.modal",function(a){a.target===this&&c.remove()}),c.on("shown.bs.modal",function(){c.find(".btn-primary:first").focus()}),c.on("escape.close.bb",function(a){j.onEscape&&e(a,c,j.onEscape)}),c.on("click",".modal-footer button",function(a){vard=b(this).data("bb-handler");e(a,c,j[d])}),c.on("click",".bootbox-close-button",function(a){e(a,c,j.onEscape)}),c.on("keyup",function(a){27===a.which&&c.trigger("escape.close.bb")}),p.append(c),c.modal({backdrop:a.backdrop,keyboard:!1,show:!1}),a.show&&c.modal("show"),c},r.setDefaults=function(a){b.extend(q,a)},r.hideAll=function(){b(".bootbox").modal("hide")};vars={br:{OK:"OK",CANCEL:"Cancelar",CONFIRM:"Sim"},da:{OK:"OK",CANCEL:"Annuller",CONFIRM:"Accepter"},de:{OK:"OK",CANCEL:"Abbrechen",CONFIRM:"Akzeptieren"},en:{OK:"OK",CANCEL:"Cancel",CONFIRM:"OK"},es:{OK:"OK",CANCEL:"Cancelar",CONFIRM:"Aceptar"},fi:{OK:"OK",CANCEL:"Peruuta",CONFIRM:"OK"},fr:{OK:"OK",CANCEL:"Annuler",CONFIRM:"D'accord"},it:{OK:"OK",CANCEL:"Annulla",CONFIRM:"Conferma"},nl:{OK:"OK",CANCEL:"Annuleren",CONFIRM:"Accepteren"},pl:{OK:"OK",CANCEL:"Anuluj",CONFIRM:"Potwierdź"},ru:{OK:"OK",CANCEL:"Отмена",CONFIRM:"Применить"},zh_CN:{OK:"OK",CANCEL:"取消",CONFIRM:"确认"},zh_TW:{OK:"OK",CANCEL:"取消",CONFIRM:"確認"}};returnr.init=function(c){window.bootbox=a(c||b)},r}(window.jQuery);