!function(e){vart={};functionn(o){if(t[o])returnt[o].exports;varr=t[o]={i:o,l:!1,exports:{}};returne[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeofSymbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)returne;if(4&t&&"object"==typeofe&&e&&e.__esModule)returne;varo=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeofe)for(varrine)n.d(o,r,function(t){returne[t]}.bind(null,r));returno},n.n=function(e){vart=e&&e.__esModule?function(){returne.default}:function(){returne};returnn.d(t,"a",t),t},n.o=function(e,t){returnObject.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t){varn=[],o=function(){$("#username").val(""),$("#password").val(""),$("#confirm_password").val(""),$("#role").val(""),$("#modal\\.flashes").empty()},r=function(e){$("#modalSubmit").unbind("click").click(function(){!function(e){if($("#password").val()===$("#confirm_password").val()){vart={username:$("#username").val(),password:$("#password").val(),role:$("#role").val()};-1!=e?(t.id=e,api.userId.put(t).success(function(e){successFlash("User "+escapeHtml(t.username)+" updated successfully!"),s(),o(),$("#modal").modal("hide")}).error(function(e){modalError(e.responseJSON.message)})):api.users.post(t).success(function(e){successFlash("User "+escapeHtml(t.username)+" registered successfully!"),s(),o(),$("#modal").modal("hide")}).error(function(e){modalError(e.responseJSON.message)})}elsemodalError("Passwords must match.")}(e)}),$("#role").select2(),-1==e?($("#role").val("user"),$("#role").trigger("change")):api.userId.get(e).success(function(e){$("#username").val(e.username),$("#role").val(e.role.slug),$("#role").trigger("change")}).error(function(){errorFlash("Error fetching user")})},s=function(){$("#userTable").hide(),$("#loading").show(),api.users.get().success(function(e){n=e,$("#loading").hide(),$("#userTable").show();vart=$("#userTable").DataTable({destroy:!0,columnDefs:[{orderable:!1,targets:"no-sort"}]});t.clear(),userRows=[],$.each(n,function(e,t){userRows.push([escapeHtml(t.username),escapeHtml(t.role.name),"<div class='pull-right'> <button class='btn btn-warning impersonate_button' data-user-id='"+t.id+"'> <i class='fa fa-retweet'></i> </button> <button class='btn btn-primary edit_button' data-toggle='modal' data-backdrop='static' data-target='#modal' data-user-id='"+t.id+"'> <i class='fa fa-pencil'></i> </button> <button class='btn btn-danger delete_button' data-user-id='"+t.id+"'> <i class='fa fa-trash-o'></i> </button></div>"])}),t.rows.add(userRows).draw()}).error(function(){errorFlash("Error fetching users")})};$(document).ready(function(){s(),$("#modal").on("hide.bs.modal",function(){o()}),$.fn.select2.defaults.set("width","100%"),$.fn.select2.defaults.set("dropdownParent",$("#role-select")),$.fn.select2.defaults.set("theme","bootstrap"),$.fn.select2.defaults.set("sorter",function(e){returne.sort(function(e,t){returne.text.toLowerCase()>t.text.toLowerCase()?1:e.text.toLowerCase()<t.text.toLowerCase()?-1:0})}),$("#new_button").on("click",function(){r(-1)}),$("#userTable").on("click",".edit_button",function(e){r($(this).attr("data-user-id"))}),$("#userTable").on("click",".delete_button",function(e){vart,o;t=$(this).attr("data-user-id"),(o=n.find(function(e){returne.id==t}))&&Swal.fire({title:"Are you sure?",text:"This will delete the account for "+escapeHtml(o.username)+" as well as all of the objects they have created.\n\nThis can't be undone!",type:"warning",animation:!1,showCancelButton:!0,confirmButtonText:"Delete",confirmButtonColor:"#428bca",reverseButtons:!0,allowOutsideClick:!1,preConfirm:function(){returnnewPromise(f