angular.module("c8y.deviceDetailIdentity",[]).config(["c8yViewsProvider","c8ySearchProvider","gettext",function(e,t,i){e.when("/device/:deviceId",{templateUrl:"".concat(":::PLUGIN_PATH:::/views/","identity.html"),priority:-1e3,name:i("Identity"),icon:"barcode",showIfPermissions:{anyRole:["ROLE_IDENTITY_READ","ROLE_IDENTITY_ADMIN"]}}),e.when("/identity",{template:"<div></div>",priority:1e4,controller:["$routeParams","$window","$location","c8yIdentity","c8yAlert","gettextCatalog",function(t,e,i,n,c,d){function o(){i.url("/device?text=".concat(t.type," ").concat(t.externalId))}t.type&&t.externalId?n.getExternalId(t).then(function(e){(e=e.data.managedObject.id)?(c.success(d.getString("Device found for identity {{type}}: {{externalId}}.",t)),i.url("/device/".concat(e))):(c.danger(d.getString("Could not find device for identity {{type}}: {{externalId}}.",t)),o())},o):o()}]})}]);