(window.saladictEntry=window.saladictEntry||[]).push([[147],{666:function(e,t,a){"use strict";a.r(t),a.d(t,"DictWikipedia",(function(){return s}));var n=a(0),i=a.n(n),l=a(1),c=a(9);const s=({result:e,searchText:t})=>{const[a,s]=Object(n.useState)(),{t:r}=Object(c.e)("content");Object(n.useEffect)(()=>{s([])},[e.langSelector]);const u=e=>{e.target.value&&t({id:"wikipedia",payload:{url:e.target.value}})};let d=null;return a&&a.length>0?d=i.a.createElement("select",{onChange:u,defaultValue:""},i.a.createElement("option",{key:"",value:""},r("chooseLang")),a.map(e=>i.a.createElement("option",{key:e.url,value:e.url},e.title))):e.langSelector&&(d=i.a.createElement("button",{className:"dictWikipedia-LangSelectorBtn",onClick:async()=>{s(await l.a.send({type:"DICT_ENGINE_METHOD",payload:{id:"wikipedia",method:"fetchLangList",args:[e.langSelector]}}))}},r("fetchLangList"))),i.a.createElement(i.a.Fragment,null,i.a.createElement("h1",{className:"dictWikipedia-Title"},e.title),d,i.a.createElement("div",{className:"dictWikipedia-Content",onClick:o},i.a.createElement("div",{className:"client-js",dangerouslySetInnerHTML:{__html:e.content}})))};function o(e){if(!e.target.classList)return;let t=e.target;if(!t.classList.contains("section-heading")&&(t=t.parentElement,!t||!t.classList.contains("section-heading")))return;e.stopPropagation(),e.preventDefault(),t.classList.toggle("open-block");const a=t.nextElementSibling;if(a){const e=t.classList.contains("open-block").toString();a.classList.toggle("open-block"),a.setAttribute("aria-pressed",e),a.setAttribute("aria-expanded",e)}const n=t.querySelector(".mw-ui-icon-mf-arrow");n&&n.classList.toggle("mf-mw-ui-icon-rotate-flip")}t.default=s}}]);