(function(){"use strict";u8.Crm.Languages=function(){};$.extend(u8.Crm.Languages.prototype,{request:function(e){var n=this;function a(){var a=n._languages;var s=n._callbacks||[e];s.forEach(function(e){if(e){e(n,a)}});delete n._callbacks}if(this._languages){a();return}if(this._callbacks){this._callbacks.push(e);return}this._callbacks=[e];u8.request("LocalizerChannel.GetLanguages",function(e,s){n._languages=n._buildLanguages(s.response||[]);a()})},get:function(){return this._languages},getCoreLanguagesCodes:function(){return e},_buildLanguages:function(e){var n=u8.session.webConfigValues.getIntArray("Languages.Visible",[-1]);var a=u8.session.webConfigValues.getIntArray("Languages.Editable",[u8.session.environment.language.no]);if(u8.session.identity.isSuperUser){a=[-1]}var s=n.indexOf(-1)>=0;var u=a.indexOf(-1)>=0;e.forEach(function(e){var r=e.uid.no;e.visible=s?true:n.indexOf(r)>=0;e.disabled=u?false:a.indexOf(r)<0});return e}});u8.services.add("languages",u8.Crm.Languages);u8.using.loaders.push({name:"languages",load:function(e,n){u8.services.languages.request(n)}});var e={invalid:-1,ger:0,eng:1,fre:2,spa:3,por:4,nld:5,dan:6,ita:7,cze:8,hun:9,slk:10,pol:11,gre:12,ukr:13,sln:14,rus:15,swe:16,fin:17,nor:18,tur:19,cro:20,ser:21,ron:22,jpn:23,chn:24,kor:25,bul:26,tha:27,alb:28}})();