(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["views/admin/settings-ui/list-languages"],{778:(e,t,a)=>{"use strict";a.r(t);var s=a(153),n=a(260),l=a.n(n),i=a(154),r=a(143),o=a(582);const d=({items:e})=>(0,s.createElement)(i.Tabs,{active:e.findIndex((({containerCls:e})=>"active"===e))+1},e.map((({title:e,href:t},a)=>(0,s.createElement)(i.Tab,{key:a,title:e,component:o.default,to:(0,r.prepareUrl)(t)}))));d.propTypes={items:l().arrayOf(l().shape({title:l().string.isRequired,href:l().string.isRequired,containerCls:l().string})).isRequired},t.default=d},1077:(e,t,a)=>{"use strict";a.r(t);var s=a(153),n=a(260),l=a.n(n),i=a(608),r=a(778),o=a(576),d=a(642),u=a(1078);const c=({tabs:e,listLanguages:t})=>{const{addToast:a}=(0,d.useToaster)();return(0,s.createElement)(s.Fragment,null,e.length>1?(0,s.createElement)(r.default,{items:e}):null,(0,s.createElement)(o.default,null,(()=>(0,u.default)({addToast:a,...t}))))};c.propTypes={tabs:l().array.isRequired,listLanguages:l().object.isRequired},t.default=(0,i.withPageLayout)(c)},1076:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>s.default});var s=a(1077)},1078:(e,t,a)=>{"use strict";a.r(t);var s=a(143);const n=s.Locale.getSection("admin.components.lists.languages"),l=(e,t)=>e?`<b>${t}</b>`:t;t.default=({addToast:e,...t})=>new s.Panel({cls:"list-box",items:[new s.List({...t,id:"languages-list",dataUrl:"/admin/settings-ui/list-languages-data",operations:[{componentType:s.SmallButton,id:"buttonDisable",title:n.lmsg("buttonDisable"),description:n.lmsg("buttonDisableDescription"),addCls:"sb-list-languages-disable-selected",handler(e){(0,s.getComponent)("languages-list").execGroupOperation({url:"/admin/settings-ui/disable-languages",mouseEvent:e,skipConfirmation:!0})}},{componentType:s.SmallButton,id:"buttonEnable",title:n.lmsg("buttonEnable"),description:n.lmsg("buttonEnableDescription"),addCls:"sb-list-languages-enable-selected",handler(e){(0,s.getComponent)("languages-list").execGroupOperation({url:"/admin/settings-ui/enable-languages",mouseEvent:e,skipConfirmation:!0})}},{componentType:s.SmallButton,id:"buttonMakeDefault",title:n.lmsg("buttonMakeDefault"),description:n.lmsg("buttonMakeDefaultDescription"),addCls:"sb-list-languages-make-default-selected",handler(e){const t=(0,s.getComponent)("languages-list");t.execGroupOperation({url:"/admin/settings-ui/language-make-default",mouseEvent:e,skipConfirmation:!0,checkSelection(){t._hideItemsNotSelectedWarning();if(1===t.getSelectedItemsIds().length)return!0;const e=t._componentElement.querySelector("select-one-item-warning");return e?e.style.display="":(0,s.render)(t._componentElement.querySelector(".actions-box"),`<div class="actions-msg-container" id="select-one-item-warning"><span class="list-actions-msg"><span>${n.lmsg("makeDefaultSelectOne")}</span></span></div>`,"top"),!1},onSuccess(e){"success"===e.status&&(t.getSelectedItems().forEach((e=>e.isDefault=!0)),t.redraw())}})}}],columns:[s.list.COLUMN_SELECTION,{header:n.lmsg("headerStatus"),sortable:!0,dataIndex:"active",headerCls:"icon",cls:"icon",renderer({active:e,isAvailable:t,isDefault:l}){let i,r,o,d;e?(i="on",t?(r=a(808),o=n.lmsg("statusActive")):(r=a(1079),o=n.lmsg("statusActiveUnavailable")),d=n.lmsg("buttonHintStatusActive")):(i="off",r=a(809),o=n.lmsg("statusInactive"),d=n.lmsg("buttonHintStatusInactive")),l&&(d=n.lmsg("buttonHintStatusDefaultLangugage"));const u=`<img src="${r}" alt="${i}" title="">`;return`<span class="tooltipData">${(0,s.escapeHtml)(o)}<br><br>${(0,s.escapeHtml)(d)}</span>${l?u:`<a data-action-name="toggle">${u}</a>`}`}},{header:n.lmsg("headerCode"),sortable:!0,dataIndex:"id",headerParams:{width:"10%"},renderer:({id:e,isDefault:t})=>l(t,(0,s.escapeHtml)(e))},{header:n.lmsg("headerLanguage"),sortable:!0,dataIndex:"lang",headerParams:{width:"40%"},renderer:({lang:e,isDefault:t})=>l(t,null===e?n.lmsg("langUnknown"):(0,s.escapeHtml)(e))},{header:n.lmsg("headerCountry"),sortable:!0,dataIndex:"country",headerParams:{width:"40%"},renderer:({country:e,isDefault:t})=>l(t,null===e?n.lmsg("countryUnknown"):(0,s.escapeHtml)(e))},{header:n.lmsg("headerUsed"),sortable:!0,dataIndex:"used",noEscape:!0,headerParams:{width:"10%"},headerCls:"t-r",cls:"t-r number",renderer:({used:e,isDefault:t})=>l(t,e)}],itemActions:{async toggle({active:t,id:a}){const l=t?"disable":"enable";await s.api.post(`/admin/settings-ui/${l}-languages`,{ids:[a]}),(0,s.getComponent)("languages-list").reload(),e({intent:"success",message:n.lmsg(`${l}Done`)})}},isDisabledItem:({isDefault:e})=>e})]})},1079:e=>{e.exports=Jsw.skinUrl+"/icons/16/plesk/att.png?448a819f0c047a05dcdef17357707ab7"},809:e=>{e.exports=Jsw.skinUrl+"/icons/16/plesk/off.png?84d64d1bd3267c21795505b7daa43800"},808:e=>{e.exports=Jsw.skinUrl+"/icons/16/plesk/on.png?7f7c68cae29103cdfe0278b2fc8d1d9f"}}]);
//# sourceMappingURL=list-languages.js.map?82d6c8d37d125b436048