(function(j,v,w,m){AC.designerMode&&function(d){d.stringTable=function(d){this.cell(d);this._tmpDialog=null;this._template='<div id="wiziFormStringTable">\r\n    <div id="wiziFormAppStringTableTabsDiv" >\r\n        <ul>\r\n            <li><a href="#tabs-1">Widgets</a></li>\r\n            <li><a href="#tabs-2">UserTokens</a></li>\r\n        </ul>\r\n        <div id="tabs-1">\r\n            <div id="wiziFormAppStringTableWidgetsDiv" class="wa-ui-dialog-content" ></div>\r\n        </div>\r\n        <div id="tabs-2">\r\n            <div id="wiziFormAppStringTableUserTokensDiv" class="wa-ui-dialog-content"></div>\r\n        </div>\r\n    </div>\r\n    <div id="wiziFormAppStringTableNoLnagDiv" class="wa-ui-dialog-content" style="width: 100%;display: none; text-align: center">\r\n        <span data-lng="ac-no_languages"></span>\r\n    </div>\r\n    <div class="waAppStringTableBtnsList btn-toolbar" style="padding-top: 4px">\r\n        <span class="btn waStringTableTokenBtnAdd" data-lng="ac-add_language_token"></span>\r\n        <span class="btn waStringTableTokenBtnRemove" data-lng="ac-delete_language_token"></span>\r\n        <div class="btn-group">\r\n            <span class="btn waStringTableTokenBtnImport" data-lng="ac-dt_import_title"></span>\r\n            <span class="btn waStringTableTokenBtnExport" data-lng="ac-dt_export_title"></span>\r\n            <span class="btn waStringTableTokenBtnTranslate" data-lng="ac-translate_language_tokens"></span>\r\n        </div>\r\n    </div>\r\n</div>\r\n';
this._languages=this._form=null;this._datatables=[];this._tabs=null;this._hasLanguages=!1;this.setValue=function(b){this.setCValue("[tokens]");this.sValue=b};this.edit=function(){function b(b){a.closeDialog.apply(a,arguments)}var a=this,c,g,o=this._tmpValue=this.getValue();c=this._tmpDialog=j(this._template);this._form=this.getEditor().form();this._hasLanguages=this._form.languages()&&this._form.languages().languages.length!=0;j(w.body).append(c);var d=AC.Core.lang().trText("dialog_title_language_tokens"),
f=AC.Core.lang().trText("dialog_button_ok"),l=AC.Core.lang().trText("dialog_button_cancel"),i={};i[l]=function(){b()};i[f]=function(){b(a.changeValue())};var d=jQuery.extend({modal:!0,height:700,width:900,resizable:!0,title:d,buttons:i,close:function(){if(a._datatables.length!=0){for(var b=0,c=a._datatables.length;b<c;b++)a._datatables[b].destroy();a._datatables=[];a._tabs&&a._tabs.tabs("destroy")}a.onClose()},resize:function(b,c){var g=c.size.height;a._datatables[0]&&a._datatables[0].height(g-126-
60);a._datatables[1]&&a._datatables[1].height(g-126-60);r.height(g-126);m.height(g-126)},dialogClass:"wa-system-dialog wa-system-style"},{}),k=c.find(".waStringTableTokenBtnAdd");k.hide();k.click(function(){a._hasLanguages&&a._addLngToken()});g=c.find(".waStringTableTokenBtnRemove");g.click(function(){a._hasLanguages&&a._removeLngToken()});var p=c.find(".waStringTableTokenBtnImport");p.click(function(){a._hasLanguages&&(a._editStop(),a._importTokens())});var n=c.find(".waStringTableTokenBtnExport");
n.click(function(){a._hasLanguages&&(a._editStop(),a._openExportDialog())});var e=c.find(".waStringTableTokenBtnTranslate");e.click(function(){a._hasLanguages&&(a._editStop(),a._translateTokens())});c.dialog(d);c.parent().click(function(b){b.stopPropagation()});var d=[{visible:!1,type:"ro"},{title:"",width:"270px",type:"readonlytext"}],f=[{visible:!1,type:"ro"},{title:"",width:"270px",type:"appLngToken"}],l=c.find("#wiziFormAppStringTableWidgetsDiv"),i=c.find("#wiziFormAppStringTableUserTokensDiv"),
m=c.find("#wiziFormAppStringTableNoLnagDiv"),r=c.find("#wiziFormAppStringTableTabsDiv");if(this._hasLanguages){this._languages=this._form.languages().languages;for(c=0,g=this._languages.length;c<g;c++)d.push({title:this._languages[c][1],align:"center",width:"150px",type:"text"}),f.push({title:this._languages[c][1],align:"center",width:"150px",type:"text"});l.empty();this._datatables[0]=new jqSimpleGrid(l,[],{touchScroll:!1,model:d,displayNative:!0,multiSelect:!0});i.empty();this._datatables[1]=new jqSimpleGrid(i,
[],{touchScroll:!1,model:f,displayNative:!0,multiSelect:!0});this._setData(o);this._tabs=r.tabs({select:function(b,a){a.index==1?k.show():k.hide()}})}else k.addClass("disabled"),g.addClass("disabled"),p.addClass("disabled"),n.addClass("disabled"),e.addClass("disabled"),r.hide(),m.show()};this._openExportDialog=function(){var b=j('<div>\r\n    <div class=\'wiziFormLanguagesListTable wa-ui-dialog-content\'/>\r\n    <form id="wiziExportTokensForm" target="target_wiziExportTokensIFrame" method="post" enctype="multipart/form-data" action="exportML.php" style="width:0;height:0;border:0px solid #fff;">\r\n        <input name="data" id="data" size="20" type="hidden" style="opacity:0;width:100px; cursor: pointer;"/>\r\n    </form>\r\n    <iframe id="target_wiziExportTokensIFrame" name="target_wiziExportTokensIFrame" style="width:0;height:0;border:0px solid #fff;" />\r\n</div>'),
a=AC.Core.lang().trText("form_language_for_export"),c=AC.Core.lang().trText("dialog_button_ok"),g=AC.Core.lang().trText("dialog_button_cancel"),d={},h=this,f,l=this._form.languages()?this._form.languages().languages:[];d[g]=function(){b.dialog("close")};d[c]=function(){var a,c=f.getSelectedRows(),g={},d,o,l,e,q,s={};if(c.length!=0){for(d=0,o=c.length;d<o;d++)g[c[d][0]]=h._form.getLanguageIndex(c[d][0],h._form.languages());for(d=0,o=h._datatables.length;d<o;d++)if(c=(a=h._datatables[d])?a.getData():
null,a&&j.isArray(c)&&c.length!=0)for(a=0,l=c.length;a<l;a++)if(q=c[a],q[1].type!="nextItemGroup")for(e in s[q[1]]={},g)s[q[1]][e]=q[g[e]+2]!=m?q[g[e]+2]:null}v.onExportTokensCallback=function(a){a.error&&WiziCore_Helper.showError(a.error.message);b.dialog("close")};g=h.context().getSession().getToken();g=h.context().config().serverUrl()+"exportML.php?callback=window.parent.onExportTokensCallback&sessionId="+g;s=JSON.stringify(s);b.find("#wiziExportTokensForm").attr("action",g);b.find("input#data").val(s);
b.find("#wiziExportTokensForm").submit()};a=jQuery.extend({modal:!0,height:400,width:300,resizable:!1,title:a,buttons:d,close:function(){f&&(f.destroy(),f=m);b.dialog("destroy").remove();b=m},dialogClass:"wa-system-dialog wa-system-style"},{});b.dialog(a);b.parent().click(function(a){a.stopPropagation()});g=[{title:AC.Core.lang().trText("form_language_id"),width:"20%",align:"center",type:"ro"},{title:AC.Core.lang().trText("form_language"),width:"80%",align:"center",type:"ro"}];c=b.find(".wiziFormLanguagesListTable");
a=parseInt(c.parent().height())-30;c.empty();f=new jqSimpleGrid(c,[],{model:g,height:a,multiSelect:!0});f.setData(l)};this._importTokens=function(){var b=j('<div id="waImportTokensDialog" style="overflow: hidden;">\r\n    <table border="0" class="waCreateDialogTable" style="height: 100%">\r\n        <tr style="vertical-align: top">\r\n            <td style="height:35px; text-align: center; vertical-align: middle;">\r\n                <div>\r\n                    <div style="position: relative; overflow:hidden; width: 103px; height: 25px; display: inline-block;">\r\n                        <form id="wiziImportTokensForm" target="target_wiziImportTokensIFrame" method="post" enctype="multipart/form-data" action="importML.php">\r\n                            <span class="button"\r\n                                  style="position:absolute; text-align: center; white-space: nowrap; width: 73px; left:0px; top:0px; cursor: pointer;"\r\n                                  data-lng="ac-console_resource_createdlg_selectfile">\r\n                            </span>\r\n                            <input name="uploadfile" id="uploadfile" type="file" style="opacity:0;width:100px; cursor: pointer;"/>\r\n                        </form>\r\n                    </div>\r\n                    <div id="waRmResourceSelectedFile"  data-lng="ac-console_resource_createdlg_nochoose"></div>\r\n                </div>\r\n            </td>\r\n        </tr>\r\n    </table>\r\n    <iframe id="target_wiziImportTokensIFrame" name="target_wiziImportTokensIFrame" style="width:0;height:0;border:0px solid #fff;">\r\n    </iframe>\r\n</div>\r\n'),
a=this,c=a.context().getSession().getToken(),c=a.context().config().serverUrl()+"importML.php?callback=window.parent.onImportTokensCallback&sessionId="+c;b.find("#wiziImportTokensForm").attr("action",c);var c=AC.Core.lang().trText("dt_import_title"),g=AC.Core.lang().trText("dialog_button_ok"),d=AC.Core.lang().trText("dialog_button_cancel"),h={};h[d]=function(){b.dialog("close")};h[g]=function(){b.find("#uploadfile").val()==""?WiziCore_Helper.showValid(AC.Core.lang().tr("console_resource_error_filerequired")):
(f.hide(),b.find("#wiziImportTokensForm").submit())};c=jQuery.extend({modal:!0,height:200,width:400,resizable:!1,title:c,buttons:h,close:function(){b.dialog("destroy").remove();b=m},dialogClass:"wa-system-dialog wa-system-style"},{});b.dialog(c);b.parent().click(function(a){a.stopPropagation()});var f=b.parent().find(".ui-dialog-buttonpane").find("button").eq(1);v.onImportTokensCallback=function(c){c.error?WiziCore_Helper.showError(c.error.message):a._processImportTokens(JSON.parse(c.data));b.dialog("close")};
b.find("#uploadfile").change(function(){var a=j(this).val(),c=a.replace(/[\\\/]/g,"$&").match(/[^\\/]+$/g)[0].substr(0,70)+(a.length>70?"...":"");b.find("#waRmResourceSelectedFile").text(c).attr("title",a)})};this._processImportTokens=function(b){WiziCore_Helper.disableInterface();var a,c,g,d,h,f,e,i,k=this._form.languages(),p={};for(c=0,g=this._datatables.length;c<g;c++)if(e=(a=this._datatables[c])?a.getData():null,a&&j.isArray(e)&&e.length!=0)for(d=0,h=e.length;d<h;d++)if(i=e[d],i[1].type!="nextItemGroup"&&
b[i[1]])for(f in b[i[1]])p[f]==m&&(p[f]=this._form.getLanguageIndex(f,k)),a.setCellValue(i.id,p[f]+2,b[i[1]][f]);WiziCore_Helper.enableInterface()};this._editStop=function(){this._datatables[0]&&this._datatables[0].editStop();this._datatables[1]&&this._datatables[1].editStop()};this._addLngToken=function(){var b,a=this._datatables[this._tabs.tabs("option","selected")];if(!a.getRowByUserDataKey("group","userTokens"))b=["userTokens",{value:"User Tokens",type:"nextItemGroup"}],b.userData={group:"userTokens"},
b.type="ro",a.addRow(b);a.addRow(["userTokens",WiziCore_Helper.generateId(10,"ac-")]);a.groupBy(0)};this._removeLngToken=function(){var b=this._datatables[this._tabs.tabs("option","selected")],a=b.getSelectedRowsId();b.removeRow(a)};this._translateTokens=function(){if(j.isArray(this._datatables)&&this._languages&&this._languages.length!=0){var b=[],a=this._form.languages().defaultLng;this._collectTokensForTranslation(b,a);var a=WiziCore_AppContext.getInstance().getSession(),c=this;WiziCore_Helper.disableInterface();
a.translateText(b,function(a,b){WiziCore_Helper.enableInterface();c._applyTranslation(a,b)})}};this._collectTokensForTranslation=function(b,a){var c,g,d,h,f,e,i,k,p,n,m,t,r=this._languages;for(c=0,g=this._datatables.length;c<g;c++)if(t=(d=this._datatables[c])?d.getData():null,d&&j.isArray(t)&&t.length!=0)for(k=0,p=t.length;k<p;k++)if(e=f=null,i=[],d=t[k],d[1].type!="nextItemGroup"){for(n=0,m=r.length;n<m;n++)if(h=r[n],!d[n+2]||d[n+2]=="")i.push(h[0]);else if(f==null||h[0]==a)f=d[n+2],e=h[0];f!=null&&
!WiziCore_Helper.isUrl(f)&&i.length!=0&&b.push([{tIndex:c,rowId:d.id},f,e,i])}};this._applyTranslation=function(b,a){if(!b){this._editStop();var c=this._languages,g,d,e,f,j,i={};for(g=0,d=c.length;g<d;g++)f=c[g],i[f[0]]=g+2;for(c=0,d=a.length;c<d;c++)for(g in e=a[c],j=e[0].rowId,f=this._datatables[e[0].tIndex],e=e[3],e)f.setCellValue(j,i[g],e[g])}};this._setData=function(b){if(b&&b[0]&&b[1]){var a=[],c=[],d,e,h,f,l,i,k,p,n,u=this._languages;for(d in b[1])if(n=d=="userTokens"?c:a,e=b[1][d],i=[d,{value:e.name,
type:"nextItemGroup"}],i.userData={group:d},i.type="ro",n.push(i),k=e.tokens,j.isArray(k))for(e=0,h=k.length;e<h;e++){p=k[e];i=[d,k[e]];for(f=0,l=u.length;f<l;f++)b[0][u[f][0]]&&b[0][u[f][0]][p]!=m&&(i[f+2]=b[0][u[f][0]][p]);n.push(i)}b=this._datatables[0];d=this._datatables[1];b.setData(a);b.groupBy(0);d.setData(c);d.groupBy(0)}};this.changeValue=function(){var b=this._datatables[1],a=[{},{}],c=this._languages;this._appendValueFromDT(a,this._datatables[0],c);this._appendValueFromDT(a,b,c);return a};
this._appendValueFromDT=function(b,a,c){if(a){var a=a.getData(),d,e,h,f,j,i,k;for(e=0,h=a.length;e<h;e++)if(d=a[e],f=d[0],d[1].type=="nextItemGroup")b[1][f]={name:d[1].value,tokens:[]};else{b[1][f].tokens||(b[1][f].tokens=[]);k=d[1];b[1][f].tokens.push(k);for(f=0,j=c.length;f<j;f++)i=c[f][0],b[0][i]||(b[0][i]={}),b[0][i][k]=d[f+2]}}};this.getNewValue=function(){return this._tmpValue}};d.stringTable.prototype=new d.dialogType;d.appLanguages=function(d){this.cell(d);this._tmpDialog=null;this._template=
'<div id="wiziFormAppLanguagesList">\r\n    <div id="wiziFormAppLanguagesListTable" class="wa-ui-dialog-content" ></div>\r\n    <div class="waAppLanguagesListBtnsList" style="padding-top: 4px">\r\n        <input class="waAppLanguagesListChBrowser" type="checkbox" />\r\n        <span data-lng="ac-proptype_dgap_get_from_browser"></span>\r\n        <div class="btn-group">\r\n            <span class="btn waAppLanguagesListBtnDefault" data-lng="ac-proptype_dgap_make_default"></span>\r\n            <span class="btn waAppLanguagesListBtnAdd" data-lng="ac-proptype_dgap_add_language"></span>\r\n            <span class="btn waAppLanguagesListBtnRemove" data-lng="ac-proptype_dgap_delete_language"></span>\r\n        </div>\r\n    </div>\r\n</div>\r\n';
this._defaultLng=this._ids=null;this._lngList={en:"English (English)",es:"Spanish (espa\u00f1ol)",de:"German (Deutsch)",fr:"French (fran\u00e7ais)",ru:"Russian (\u0440\u0443\u0441\u0441\u043a\u0438\u0439 \u044f\u0437\u044b\u043a)",it:"Italian (italiano)",zh:"Chinese (\u4e2d\u6587  (Zh\u014dngw\u00e9n))",ja:"Japanese (\u65e5\u672c\u8a9e  (\u306b\u307b\u3093\u3054))",ab:"Abkhaz (\u0430\u04a7\u0441\u0448\u04d9\u0430)",aa:"Afar (Afaraf)",af:"Afrikaans (Afrikaans)",ak:"Akan (Akan)",sq:"Albanian (gjuha shqipe)",
am:"Amharic (\u12a0\u121b\u122d\u129b)",ar:"Arabic (\u0627\u0644\u0639\u0631\u0628\u064a\u0629)",an:"Aragonese (aragon\u00e9s)",hy:"Armenian (\u0540\u0561\u0575\u0565\u0580\u0565\u0576)",as:"Assamese (\u0985\u09b8\u09ae\u09c0\u09af\u09bc\u09be)",av:"Avaric (\u0430\u0432\u0430\u0440 \u043c\u0430\u0446\u04c0)",ae:"Avestan (avesta)",ay:"Aymara (aymar aru)",az:"Azerbaijani (az\u0259rbaycan dili)",bm:"Bambara (bamanankan)",bjn:"Banjar (Bahasa Banjar)",ba:"Bashkir (\u0431\u0430\u0448\u04a1\u043e\u0440\u0442 \u0442\u0435\u043b\u0435)",
eu:"Basque (euskara)",be:"Belarusian (\u0431\u0435\u043b\u0430\u0440\u0443\u0441\u043a\u0430\u044f \u043c\u043e\u0432\u0430)",bn:"Bengali (\u09ac\u09be\u0982\u09b2\u09be)",bh:"Bihari (\u092d\u094b\u091c\u092a\u0941\u0930\u0940)",bi:"Bislama (Bislama)",bs:"Bosnian (bosanski jezik)",br:"Breton (brezhoneg)",bg:"Bulgarian (\u0431\u044a\u043b\u0433\u0430\u0440\u0441\u043a\u0438 \u0435\u0437\u0438\u043a)",my:"Burmese ()",ca:"Catalan (catal\u00e0)",ch:"Chamorro (Chamoru)",ce:"Chechen (\u043d\u043e\u0445\u0447\u0438\u0439\u043d \u043c\u043e\u0442\u0442)",
ny:"Chichewa (chiChe\u0175a)",cv:"Chuvash (\u0447\u04d1\u0432\u0430\u0448 \u0447\u04d7\u043b\u0445\u0438)",kw:"Cornish (Kernewek)",co:"Corsican (corsu, lingua corsa)",cr:"Cree (\u14c0\u1426\u1403\u152d\u140d\u140f\u1423)",hr:"Croatian (hrvatski jezik)",cs:"Czech (\u010de\u0161tina)",da:"Danish (dansk)",day:"Dayak (Behas Dayak)",dv:"Divehi (\u078b\u07a8\u0788\u07ac\u0780\u07a8)",nl:"Dutch (Nederlands)",dz:"Dzongkha (\u0f62\u0fab\u0f7c\u0f44\u0f0b\u0f41)",eo:"Esperanto (Esperanto)",et:"Estonian (eesti)",
ee:"Ewe (E\u028begbe)",fo:"Faroese (f\u00f8royskt)",fj:"Fijian (vosa Vakaviti)",fi:"Finnish (suomi)",ff:"Fula (Fulfulde)",gl:"Galician (galego)",lg:"Ganda (Luganda)",ka:"Georgian (\u10e5\u10d0\u10e0\u10d7\u10e3\u10da\u10d8)",el:"Greek (\u03b5\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ac)",gn:"Guaran\u00ed (Ava\u00f1e'\u1ebd)",gu:"Gujarati (\u0a97\u0ac1\u0a9c\u0ab0\u0abe\u0aa4\u0ac0)",ht:"Haitian (Krey\u00f2l ayisyen)",ha:"Hausa (Hausa)",he:"Hebrew (\u05e2\u05d1\u05e8\u05d9\u05ea)",hz:"Herero (Otjiherero)",
hi:"Hindi (\u0939\u093f\u0928\u094d\u0926\u0940)",ho:"Hiri Motu (Hiri Motu)",hu:"Hungarian (Magyar)",is:"Icelandic (\u00cdslenska)",io:"Ido (Ido)",ig:"Igbo (As\u1ee5s\u1ee5 Igbo)",id:"Indonesian (Bahasa Indonesia)",ia:"Interlingua (Interlingua)",ie:"Interlingue ()",iu:"Inuktitut (\u1403\u14c4\u1483\u144e\u1450\u1466)",ik:"Inupiaq (I\u00f1upiaq)",ga:"Irish (Gaeilge)",jv:"Javanese (basa Jawa)",kl:"Kalaallisut (kalaallisut)",kn:"Kannada (\u0c95\u0ca8\u0ccd\u0ca8\u0ca1)",kr:"Kanuri (Kanuri)",ks:"Kashmiri (\u0915\u0936\u094d\u092e\u0940\u0930\u0940)",
kk:"Kazakh (\u049b\u0430\u0437\u0430\u049b \u0442\u0456\u043b\u0456)",km:"Khmer (\u1781\u17d2\u1798\u17c2\u179a, \u1781\u17c1\u1798\u179a\u1797\u17b6\u179f\u17b6, \u1797\u17b6\u179f\u17b6\u1781\u17d2\u1798\u17c2\u179a)",ki:"Kikuyu (G\u0129k\u0169y\u0169)",rw:"Kinyarwanda (Ikinyarwanda)",rn:"Kirundi (Ikirundi)",kv:"Komi (\u043a\u043e\u043c\u0438 \u043a\u044b\u0432)",kg:"Kongo (KiKongo)",ko:"Korean (\ud55c\uad6d\uc5b4  (\u97d3\u570b\u8a9e))",ku:"Kurdish (Kurd\u00ee)",kj:"Kwanyama (Kuanyama)",ky:"Kyrgyz language (\u041a\u044b\u0440\u0433\u044b\u0437\u0447\u0430)",
lo:"Lao (\u0e9e\u0eb2\u0eaa\u0eb2\u0ea5\u0eb2\u0ea7)",la:"Latin (latine)",lv:"Latvian (latvie\u0161u valoda)",li:"Limburgish (Limburgs)",ln:"Lingala (Ling\u00e1la)",lt:"Lithuanian (lietuvi\u0173 kalba)",lu:"Luba-Katanga (Tshiluba)",lb:"Luxembourgish (L\u00ebtzebuergesch)",mk:"Macedonian (\u043c\u0430\u043a\u0435\u0434\u043e\u043d\u0441\u043a\u0438 \u0458\u0430\u0437\u0438\u043a)",mg:"Malagasy (Malagasy fiteny)",ms:"Malay (bahasa Melayu)",ml:"Malayalam (\u0d2e\u0d32\u0d2f\u0d3e\u0d33\u0d02)",mt:"Maltese (Malti)",
gv:"Manx (Gaelg, Gailck)",mr:"Marathi (\u092e\u0930\u093e\u0920\u0940)",mh:"Marshallese (Kajin M\u0327aje\u013c)",mn:"Mongolian (\u043c\u043e\u043d\u0433\u043e\u043b)",mi:"M\u0101ori (te reo M\u0101ori)",na:"Nauru (Ekakair\u0169 Naoero)",nv:"Navajo (Din\u00e9 bizaad)",ng:"Ndonga (Owambo)",ne:"Nepali (\u0928\u0947\u092a\u093e\u0932\u0940)",nd:"North Ndebele (isiNdebele)",se:"Northern Sami (Davvis\u00e1megiella)",no:"Norwegian (Norsk)",nb:"Norwegian Bokm\u00e5l (Norsk bokm\u00e5l)",nn:"Norwegian Nynorsk (Norsk nynorsk)",
ii:"Nuosu (\ua188\ua320\ua4bf Nuosuhxop)",oc:"Occitan (occitan)",oj:"Ojibwe (\u140a\u14c2\u1511\u14c8\u142f\u14a7\u140e\u14d0)",cu:"Old Church Slavonic (\u0469\u0437\u044b\u043a\u044a \u0441\u043b\u043e\u0432\u0463\u043d\u044c\u0441\u043a\u044a)",or:"Oriya (\u0b13\u0b21\u0b3c\u0b3f\u0b06)",om:"Oromo (Afaan Oromoo)",os:"Ossetian (\u0438\u0440\u043e\u043d \u00e6\u0432\u0437\u0430\u0433)",pa:"Panjabi (\u0a2a\u0a70\u0a1c\u0a3e\u0a2c\u0a40)",ps:"Pashto (\u067e\u069a\u062a\u0648)",fa:"Persian (\u0641\u0627\u0631\u0633\u06cc)",
pl:"Polish (j\u0119zyk polski)",pt:"Portuguese (portugu\u00eas)",pi:"P\u0101li (\u092a\u093e\u0934\u093f)",qu:"Quechua (Runa Simi)",ro:"Romanian (limba rom\u00e2n\u0103)",rm:"Romansh (rumantsch grischun)",sm:"Samoan (gagana fa'a Samoa)",sg:"Sango (y\u00e2ng\u00e2 t\u00ee s\u00e4ng\u00f6)",sa:"Sanskrit (\u0938\u0902\u0938\u094d\u0915\u0943\u0924\u092e\u094d)",sc:"Sardinian (sardu)",gd:"Scottish Gaelic (G\u00e0idhlig)",sr:"Serbian (\u0441\u0440\u043f\u0441\u043a\u0438 \u0458\u0435\u0437\u0438\u043a)",
sn:"Shona (chiShona)",sd:"Sindhi (\u0938\u093f\u0928\u094d\u0927\u0940)",si:"Sinhala (\u0dc3\u0dd2\u0d82\u0dc4\u0dbd)",sk:"Slovak (sloven\u010dina)",sl:"Slovene (slovenski jezik)",so:"Somali (Soomaaliga)",nr:"South Ndebele (isiNdebele)",st:"Southern Sotho (Sesotho)",su:"Sundanese (Basa Sunda)",sw:"Swahili (Kiswahili)",ss:"Swati (SiSwati)",sv:"Swedish (Svenska)",tl:"Tagalog (Wikang Tagalog)",ty:"Tahitian (Reo Tahiti)",tg:"Tajik (\u0442\u043e\u04b7\u0438\u043a\u04e3, to\u011fik\u012b)",ta:"Tamil (\u0ba4\u0bae\u0bbf\u0bb4\u0bcd)",
tt:"Tatar (\u0442\u0430\u0442\u0430\u0440 \u0442\u0435\u043b\u0435)",te:"Telugu (\u0c24\u0c46\u0c32\u0c41\u0c17\u0c41)",th:"Thai (\u0e44\u0e17\u0e22)",bo:"Tibetan (\u0f56\u0f7c\u0f51\u0f0b\u0f61\u0f72\u0f42)",ti:"Tigrinya (\u1275\u130d\u122d\u129b)",to:"Tonga (faka Tonga)",ts:"Tsonga (Xitsonga)",tn:"Tswana (Setswana)",tr:"Turkish (T\u00fcrk\u00e7e)",tk:"Turkmen (T\u00fcrkmen)",tw:"Twi (Twi)",ug:"Uighur (Uy\u01a3urq\u0259)",uk:"Ukrainian (\u0443\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430 \u043c\u043e\u0432\u0430)",
ur:"Urdu (\u0627\u0631\u062f\u0648)",uz:"Uzbek (O'zbek)",ve:"Venda (Tshiven\u1e13a)",vi:"Vietnamese (Ti\u1ebfng Vi\u1ec7t)",vo:"Volap\u00fck (Volap\u00fck)",wa:"Walloon (walon)",cy:"Welsh (Cymraeg)",fy:"Western Frisian (Frysk)",wo:"Wolof (Wollof)",xh:"Xhosa (isiXhosa)",yi:"Yiddish (\u05d9\u05d9\u05b4\u05d3\u05d9\u05e9)",yo:"Yoruba (Yor\u00f9b\u00e1)",za:"Zhuang (Sa\u026f cue\u014b\u0185)",zu:"Zulu (isiZulu)"};this.setValue=function(b){this.setCValue("[languages]");this.sValue=b};this.edit=function(){function b(b){a.closeDialog.apply(a,
arguments)}var a=this;this._ids=[];var c=this._tmpValue=this.getValue(),d=this._tmpDialog=j(this._template);j(w.body).append(d);var e=AC.Core.lang().trText("dialog_title_form_languages"),h=AC.Core.lang().trText("dialog_button_ok"),f=AC.Core.lang().trText("dialog_button_cancel"),l={};l[f]=function(){b()};l[h]=function(){var c=a.getEditor().form().languages();(!c||!j.isArray(c.languages)||c.languages.length==0)&&a._datatable.getData().length!=0?(c=WiziCore_Helper.showWarning("",AC.Core.lang().trText("app_languages_warning_text"),
!1,WiziCore_UI_MessageBoxWidget.MB_OKCANCEL),j(c).one(WiziCore_UI_MessageBoxWidget.onDialogClose,function(c,d){d==WiziCore_UI_MessageBoxWidget.IDOK&&b(a.changeValue())})):a._checkRemovedLng()?(c=WiziCore_Helper.showWarning("",AC.Core.lang().trText("app_languages_remove_warning_text"),!1,WiziCore_UI_MessageBoxWidget.MB_OKCANCEL),j(c).one(WiziCore_UI_MessageBoxWidget.onDialogClose,function(c,d){d==WiziCore_UI_MessageBoxWidget.IDOK&&b(a.changeValue())})):b(a.changeValue())};e=jQuery.extend({modal:!0,
height:330,width:590,resizable:!1,title:e,buttons:l,close:function(){if(a._datatable)a._datatable.destroy(),a._datatable=m;a.onClose()},dialogClass:"wa-system-dialog wa-system-style"},{});d.find(".waAppLanguagesListBtnDefault").click(function(){var b=a._datatable.getSelectedRows();if(b.length!=0){if(a._defaultLng!=null){for(var c=a._datatable.getData(),d,e=0,g=c.length;e<g;e++)c[e][0]==a._defaultLng&&(d=c[e].id);d!=m&&a._datatable.setRowClass(d,null)}a._defaultLng=b[0][0];a._datatable.setRowClass(b[0].id,
"waDefaultAppLng")}});d.find(".waAppLanguagesListBtnAdd").click(function(){a._openAddLanguageDialog()});d.find(".waAppLanguagesListBtnRemove").click(function(){var b=a._datatable.getSelectedRows(),c,d,e;for(d=0,e=b.length;d<e;d++)c=b[d][0],c=a._ids.indexOf(c),c!=-1&&a._ids.splice(c,1);a._datatable.removeRow(a._datatable.getSelectedRowsId());if(a._ids.indexOf(a._defaultLng)==-1)b=a._datatable.getData(),b.length==0?a._defaultLng=null:(a._defaultLng=b[0][0],a._datatable.setRowClass(b[0].id,"waDefaultAppLng"))});
d.dialog(e);d.parent().click(function(a){a.stopPropagation()});e=[{title:AC.Core.lang().trText("form_language_id"),width:"10%",align:"center",type:"ro"},{title:AC.Core.lang().trText("form_language"),width:"90%",align:"center",type:"ro"}];d=d.find("#wiziFormAppLanguagesListTable");h=parseInt(d.parent().height())-40;d.empty();this._datatable=new jqSimpleGrid(d,[],{model:e,height:h});this._setData(c)};this._checkRemovedLng=function(){var b=!1,a=this.getEditor().form().languages(),c;if(a&&j.isArray(a.languages)&&
a.languages.length!=0)for(var d=0,e=a.languages.length;d<e;d++)if(c=a.languages[d][0],this._ids.indexOf(c)==-1){b=!0;break}return b};this._openAddLanguageDialog=function(){var b=j("<div><div class='wiziFormLanguagesListTable wa-ui-dialog-content'/></div>"),a=AC.Core.lang().trText("form_language"),c=AC.Core.lang().trText("dialog_button_ok"),d=AC.Core.lang().trText("dialog_button_cancel"),e={},h=this,f,l,i=[];e[d]=function(){b.dialog("close")};e[c]=function(){var a=f.getSelectedRows();h._datatable.addRows(a);
for(var c=0,d=a.length;c<d;c++)h._ids.push(a[c][0]);if(h._defaultLng==null)h._defaultLng=a[0][0],h._datatable.setRowClass(a[0].id,"waDefaultAppLng");b.dialog("close")};a=jQuery.extend({modal:!0,height:400,width:300,resizable:!1,title:a,buttons:e,close:function(){f&&(f.destroy(),f=m);b.dialog("destroy").remove();b=m},dialogClass:"wa-system-dialog wa-system-style"},{});b.dialog(a);b.parent().click(function(a){a.stopPropagation()});d=[{title:AC.Core.lang().trText("form_language_id"),width:"20%",align:"center",
type:"ro"},{title:AC.Core.lang().trText("form_language"),width:"80%",align:"center",type:"ro"}];c=b.find(".wiziFormLanguagesListTable");a=parseInt(c.parent().height())-30;c.empty();f=new jqSimpleGrid(c,[],{model:d,height:a,multiSelect:!0});for(l in this._lngList)this._ids.indexOf(l)==-1&&i.push([l,this._lngList[l]]);f.setData(i)};this._setData=function(b){if(b){var a=this._tmpDialog.find(".waAppLanguagesListChBrowser");b.useBrowser?a.attr("checked","checked"):a.removeAttr("checked");this._defaultLng=
b.defaultLng!=null&&b.defaultLng!=""?b.defaultLng:null;b=b.languages;j.isArray(b)&&this._datatable.setData(b);for(var b=this._datatable.getData(),c,a=0,d=b.length;a<d;a++)b[a][0]==this._defaultLng&&(c=b[a].id),this._ids.push(b[a][0]);c&&this._datatable.setRowClass(c,"waDefaultAppLng")}};this.changeValue=function(){var b={};b.languages=this._datatable.getData();b.useBrowser=this._tmpDialog.find(".waAppLanguagesListChBrowser").is(":checked");b.defaultLng=this._defaultLng;return b};this.getNewValue=
function(){return this._tmpValue}};d.appLanguages.prototype=new d.dialogType}(jqSimpleGrid.types);j.extend(AC.Widgets.WiziCore_Api_Form.prototype,{_detectCurrentLanguage:function(){var d=null,e=this.getInputParameters("lang"),b=(!navigator.userAgent?"":navigator.userAgent).match(/[a-z]{2}-[a-z]{2}/),b=WiziCore_Helper.isAndroid()?b?b.toString():null:navigator.language?navigator.language:navigator.userLanguage?navigator.userLanguage:null,a=this.languages();a!=null&&j.isArray(a.languages)&&a.languages.length!=
0&&(d=e?e:a.useBrowser&&b!=null?b:a.defaultLng,d=d.match(/^[^-]+/).toString(),d=this.getLanguageIndex(d,this.languages())!=-1?d:a.defaultLng);return d},_beforeLanguages:function(d){var e=this.languages()?this.languages().languages:null,b=d?d.languages:null;if(j.isArray(e)&&e.length!=0){var a=[],c,g;if(j.isArray(b)&&b.length!=0)for(b=0,c=e.length;b<c;b++)g=e[b],this.getLanguageIndex(g[0],d)==-1&&a.push(g[0]);else a=e;a.length!=0&&(this._removeLanguagesFromST(a),j(this).trigger(AC.Widgets.WiziCore_Api_Form.onLanguagesRemoved))}return d},
_removeLanguagesFromST:function(d){for(var e=this.stringTable()?WiziCore_Helper.clone(this.stringTable()):[{},{}],b=0,a=d.length;b<a;b++)delete e[0][d[b]];this._project.stringTable=e},getLanguageIndex:function(d,e){var b=-1,a,c,g;if(d&&e){a=e.languages;for(c=0,g=a.length;c<g;c++)if(a[c][0]==d){b=c;break}}return b},_beforeLanguage:function(d){var e=this;this.language()==null&&d!=null&&setTimeout(function(){e._onInitLanguage();j(e).trigger(AC.Widgets.WiziCore_Api_Form.onLanguageInited)},1);return d},
_language:function(d){var e=this.stringTable();d&&e&&!this._showLngTokens&&this._isDrawn&&AC.AppLng().trElement(this.base(),e[0],d,this.languages().defaultLng);j(this).trigger(AC.Widgets.WiziCore_Api_Form.onAppLanguageChanged,[d]);this._onLanguageChanged()},_stringTable:function(){this._onSTUpdated()},addTokenToStringTable:function(d,e,b,a){var c=this.stringTable()?this.stringTable():[{},{}],g=this.language(),o;if(g){o=this.languages().defaultLng;c[1][d]||(c[1][d]={name:e,tokens:[]});j.inArray(b,
c[1][d].tokens)==-1&&c[1][d].tokens.push(b);if(typeof a=="object")for(var h in a)c[0][h]||(c[0][h]={}),c[0][h][b]=a[h];else if(a!=m&&(a=a.toString(),c[0][g]||(c[0][g]={}),c[0][g][b]=a,!c[0][o]||!c[0][o][b]))c[0][o]||(c[0][o]={}),c[0][o][b]=a;this._project.stringTable=c}},cloneToken:function(d,e,b,a){var c=this.stringTable()?this.stringTable():[{},{}],g;if(this.language()){c[1][d]||(c[1][d]={name:e,tokens:[]});j.inArray(a,c[1][d].tokens)==-1&&c[1][d].tokens.push(a);for(g in c[0])c[0][g][b]!=m&&(c[0][g][a]=
c[0][g][b]);this._project.stringTable=c}}})})($,window,document);
(function(j,v,w,m){j.extend(AC.Widgets.WiziCore_Widget_Base.prototype,{_getTranslatedValue:function(d,e){var b=this.form();return!b||b._showLngTokens||b.language()==m?d:this.translateText(d,e)},translateText:function(d,e){var b=this.form(),a=b.stringTable(),c=b.language(),b=b.languages()?b.languages().defaultLng:null;return a?AC.AppLng().trText(d,a[0],c,b,e):d},getTrValueAddLngAttr:function(d,e){var b;WiziCore_Helper.isLngToken(d)?(b=this._getTranslatedValue(d),e.attr("data-lng",d)):b=d;return b}})})($,
window,document);
