(window.webpackJsonpPlesk=window.webpackJsonpPlesk||[]).push([["views/admin/settings-ui/list-languages"],{1107:function(e,t,a){"use strict";a.r(t);var n=a(145);Object(n.namespace)("AdminPanel.Server"),AdminPanel.Server.Languages={toggle(e,t){const a=t.active?"disable":"enable";new Ajax.Request(Object(n.prepareUrl)("/settings-ui/".concat(a,"-languages")),{method:"post",parameters:{ids:[t.id]},onSuccess(){e.reload(),Object(n.clearStatusMessages)(),Object(n.addStatusMessage)("info",e.lmsg("".concat(a,"Done")))}})},renderDefault:(e,t)=>e.isDefault?"<b>".concat(t,"</b>"):t},t.default=({languagesList:e,urls:t})=>{const s=n.Locale.getSection("admin.components.lists.languages"),l=new n.List({...e,id:"languages-list",operations:[{componentType:n.SmallButton,id:"buttonDisable",title:s.lmsg("buttonDisable"),description:s.lmsg("buttonDisableDescription"),addCls:"sb-list-languages-disable-selected",handler(e){l.execGroupOperation({url:t.disable,mouseEvent:e,skipConfirmation:!0})}},{componentType:n.SmallButton,id:"buttonEnable",title:s.lmsg("buttonEnable"),description:s.lmsg("buttonEnableDescription"),addCls:"sb-list-languages-enable-selected",handler(e){l.execGroupOperation({url:t.enable,mouseEvent:e,skipConfirmation:!0})}},{componentType:n.SmallButton,id:"buttonMakeDefault",title:s.lmsg("buttonMakeDefault"),description:s.lmsg("buttonMakeDefaultDescription"),addCls:"sb-list-languages-make-default-selected",handler(e){l.execGroupOperation({url:t["make-default"],mouseEvent:e,skipConfirmation:!0,checkSelection(){if(l._hideItemsNotSelectedWarning(),1===l.getSelectedItemsIds().length)return!0;const e=l._componentElement.querySelector("select-one-item-warning");return e?e.style.display="":Object(n.render)(l._componentElement.querySelector(".actions-box"),'<div class="actions-msg-container" id="select-one-item-warning"><span class="list-actions-msg">'+"<span>".concat(s.lmsg("makeDefaultSelectOne"),"</span>")+"</span></div>","top"),!1},onSuccess(e){"success"===e.status&&(l.getSelectedItems().forEach(e=>e.isDefault=!0),l.redraw())}})}}],columns:[n.list.COLUMN_SELECTION,{header:s.lmsg("headerStatus"),sortable:!0,dataIndex:"active",headerCls:"icon",cls:"icon",renderer(e){let t,l,r,i;e.active?(t="on",e.isAvailable?(l=a(936),r=s.lmsg("statusActive")):(l=a(934),r=s.lmsg("statusActiveUnavailable")),i=s.lmsg("buttonHintStatusActive")):(t="off",l=a(792),r=s.lmsg("statusInactive"),i=s.lmsg("buttonHintStatusInactive")),e.isDefault&&(i=s.lmsg("buttonHintStatusDefaultLangugage"));const o='<img src="'.concat(l,'" alt="').concat(t,'" title="">');return'<span class="tooltipData">'+"".concat(Object(n.escapeHtml)(r),"<br><br>")+"".concat(Object(n.escapeHtml)(i))+"</span>"+"".concat(e.isDefault?o:'<a data-action-name="toggle">'.concat(o,"</a>"))}},{header:s.lmsg("headerCode"),sortable:!0,dataIndex:"id",headerParams:{width:"10%"},renderer:e=>AdminPanel.Server.Languages.renderDefault(e,Object(n.escapeHtml)(e.id))},{header:s.lmsg("headerLanguage"),sortable:!0,dataIndex:"lang",headerParams:{width:"40%"},renderer:e=>AdminPanel.Server.Languages.renderDefault(e,null===e.lang?s.lmsg("langUnknown"):Object(n.escapeHtml)(e.lang))},{header:s.lmsg("headerCountry"),sortable:!0,dataIndex:"country",headerParams:{width:"40%"},renderer:e=>AdminPanel.Server.Languages.renderDefault(e,null===e.country?s.lmsg("countryUnknown"):Object(n.escapeHtml)(e.country))},{header:s.lmsg("headerUsed"),sortable:!0,dataIndex:"used",noEscape:!0,headerParams:{width:"10%"},headerCls:"t-r",cls:"t-r number",renderer:e=>AdminPanel.Server.Languages.renderDefault(e,e.used)}],itemActions:{toggle(e){AdminPanel.Server.Languages.toggle(l,e)}},isDisabledItem:e=>e.isDefault});new n.Panel({cls:"list-box",renderTo:"main",items:[l]})}},792:function(e,t){e.exports=Jsw.skinUrl+"/icons/16/plesk/off.png?84d64d1bd3267c21795505b7daa43800"},934:function(e,t){e.exports=Jsw.skinUrl+"/icons/16/plesk/att.png?448a819f0c047a05dcdef17357707ab7"},936:function(e,t){e.exports=Jsw.skinUrl+"/icons/16/plesk/on.png?7f7c68cae29103cdfe0278b2fc8d1d9f"}}]);
//# sourceMappingURL=list-languages.js.map?e1530ac9ffb99c725387