import PluginBase from 'chrome-extension://lnnmjmalakahagblkkcnjkoaihlfglon/dist/modules/plugin-base.js';import ExtensionUtil from 'chrome-extension://lnnmjmalakahagblkkcnjkoaihlfglon/dist/modules/extension-util.js';var matchedAnswer="",previousLanguage=PluginBase.util.getLanguage();const particles={"もう":"も","わ":"は"};function fuzzyParticle(transcript){const maybe=particles[transcript];return null===maybe?transcript:maybe}function notEmpty(value){return null!=value}function matchAnswer(transcript){transcript=transcript.toLowerCase();const answers=Array.from(document.querySelectorAll("#answer_in_kana")).map(answer=>answer.getAttribute("data-answer")).filter(notEmpty);for(var i=0;i{var head=document.getElementsByTagName("head")[0],script=document.createElement("script");script.type="text/javascript",script.innerHTML="history.pushState = ( f => function pushState(){\n var ret = f.apply(this, arguments);\n window.dispatchEvent(new Event('locationchange'));\n return ret;\n })(history.pushState);\n history.replaceState = ( f => function replaceState(){\n var ret = f.apply(this, arguments);\n window.dispatchEvent(new Event('locationchange'));\n return ret;\n })(history.replaceState);",head.appendChild(script),window.addEventListener("locationchange",locationChangeHandler),locationChangeHandler();},destroy:()=>{window.removeEventListener("locationchange",locationChangeHandler),exitBunproContext();},contexts:{Bunpro:{commands:["LipSurf.Change Language to Japanese","LipSurf.Normal Mode","LipSurf.Turn off LipSurf","Answer","Hint","Next","Wrong","Info"]}},commands:[{name:"Answer",description:"Submit an answer for a Bunpro review",match:{description:"[answer]",fn:transcript=>{if(document.location.href.match(/.*www.bunpro.jp\/(learn|study|cram)$/))return matchAnswer(transcript)}},normal:!1,pageFn:inputAnswer},{name:"Hint",description:"Toggle the translated hint",match:"hint",normal:!1,pageFn:function(){clickElement("#show-english-hint");}},{name:"Next",description:"Go to the next card",match:"next",normal:!1,pageFn:clickNext},{name:"Wrong",description:"Mark a card wrong",match:"wrong",normal:!1,pageFn:function(){matchedAnswer="あああ",inputAnswer();}},{name:"Info",description:"Show grammar info",match:"info",normal:!1,pageFn:function(){clickElement("#show-grammar");}}]};Bunpro.languages.ja={niceName:"Bunpro",description:"Bunpro",commands:{Answer:{name:"答え (answer)",match:{description:"[Bunproの答え]",fn:matchAnswer}},Hint:{name:"暗示 (hint)",match:["ひんと","あんじ"]},Next:{name:"次へ (next)",match:["つぎ","ねくすと","ていしゅつ","すすむ","ちぇっく"]},Wrong:{name:"バツ (wrong)",match:["だめ","ばつ"]},Info:{name:"情報 (info)",match:["じょうほう"]}}}; export default Bunpro; export { matchAnswer }; LS-SPLITallPlugins.Bunpro = (() => { var matchedAnswer="",previousLanguage=PluginBase.util.getLanguage();const particles={"もう":"も","わ":"は"};function fuzzyParticle(transcript){const maybe=particles[transcript];return null===maybe?transcript:maybe}function notEmpty(value){return null!=value}function matchAnswer(transcript){transcript=transcript.toLowerCase();const answers=Array.from(document.querySelectorAll("#answer_in_kana")).map(answer=>answer.getAttribute("data-answer")).filter(notEmpty);for(var i=0;i{var head=document.getElementsByTagName("head")[0],script=document.createElement("script");script.type="text/javascript",script.innerHTML="history.pushState = ( f => function pushState(){\n var ret = f.apply(this, arguments);\n window.dispatchEvent(new Event('locationchange'));\n return ret;\n })(history.pushState);\n history.replaceState = ( f => function replaceState(){\n var ret = f.apply(this, arguments);\n window.dispatchEvent(new Event('locationchange'));\n return ret;\n })(history.replaceState);",head.appendChild(script),window.addEventListener("locationchange",locationChangeHandler),locationChangeHandler();},destroy:()=>{window.removeEventListener("locationchange",locationChangeHandler),exitBunproContext();},commands:{Answer:{match:{en:transcript=>{if(document.location.href.match(/.*www.bunpro.jp\/(learn|study|cram)$/))return matchAnswer(transcript)},ja:matchAnswer},normal:!1,pageFn:inputAnswer},Hint:{normal:!1,pageFn:function(){clickElement("#show-english-hint");}},Next:{normal:!1,pageFn:clickNext},Wrong:{normal:!1,pageFn:function(){matchedAnswer="あああ",inputAnswer();}},Info:{normal:!1,pageFn:function(){clickElement("#show-grammar");}}}}; return Bunpro; })() LS-SPLITallPlugins.Bunpro = (() => { var previousLanguage=PluginBase.util.getLanguage();function exitBunproContext(){PluginBase.util.enterContext(["Normal"]),PluginBase.util.setLanguage(previousLanguage);}function locationChangeHandler(){document.location.href,document.location.href.match(/.*bunpro.jp\/(learn|study|cram)$/)?(previousLanguage=PluginBase.util.getLanguage(),PluginBase.util.enterContext(["Bunpro"]),PluginBase.util.setLanguage("ja")):exitBunproContext();}var Bunpro={...PluginBase,init:()=>{var head=document.getElementsByTagName("head")[0],script=document.createElement("script");script.type="text/javascript",script.innerHTML="history.pushState = ( f => function pushState(){\n var ret = f.apply(this, arguments);\n window.dispatchEvent(new Event('locationchange'));\n return ret;\n })(history.pushState);\n history.replaceState = ( f => function replaceState(){\n var ret = f.apply(this, arguments);\n window.dispatchEvent(new Event('locationchange'));\n return ret;\n })(history.replaceState);",head.appendChild(script),window.addEventListener("locationchange",locationChangeHandler),locationChangeHandler();},destroy:()=>{window.removeEventListener("locationchange",locationChangeHandler),exitBunproContext();},commands:{}}; return Bunpro; })()