var e,t;"function"==typeof(e=globalThis.define)&&(t=e,e=null),function(t,n,o,r,l){var a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},i="function"==typeof a[r]&&a[r],s=i.cache||{},u="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function c(e,n){if(!s[e]){if(!t[e]){var o="function"==typeof a[r]&&a[r];if(!n&&o)return o(e,!0);if(i)return i(e,!0);if(u&&"string"==typeof e)return u(e);var l=Error("Cannot find module '"+e+"'");throw l.code="MODULE_NOT_FOUND",l}d.resolve=function(n){var o=t[e][1][n];return null!=o?o:n},d.cache={};var f=s[e]=new c.Module(e);t[e][0].call(f.exports,d,f,f.exports,this)}return s[e].exports;function d(e){var t=d.resolve(e);return!1===t?{}:c(t)}}c.isParcelRequire=!0,c.Module=function(e){this.id=e,this.bundle=c,this.exports={}},c.modules=t,c.cache=s,c.parent=i,c.register=function(e,n){t[e]=[function(e,t){t.exports=n},{}]},Object.defineProperty(c,"root",{get:function(){return a[r]}}),a[r]=c;for(var f=0;f<n.length;f++)c(n[f]);if(o){var d=c(o);"object"==typeof exports&&"undefined"!=typeof module?module.exports=d:"function"==typeof e&&e.amd?e(function(){return d}):l&&(this[l]=d)}}({"57pwz":[function(e,t,n){var o=e("@parcel/transformer-js/src/esmodule-helpers.js");o.defineInteropFlag(n),o.export(n,"config",()=>l);var r=e("~utils/async-utils");let l={matches:["https://www.deepl.com/*"],all_frames:!0};console.log("for test, deepl content script translate");let a=0;async function i(e,t){await s(t);let n=document.querySelector("#textareasContainer d-textarea div");n.textContent=e;let o=new Event("input",{bubbles:!0});n.dispatchEvent(o)}async function s(e){let t=document.querySelector('[data-testid="translator-target-lang-btn"]');if(console.log(t),t){t.click(),await (0,r.sleep)(100);let n=document.querySelector(`button[data-testid="translator-lang-option-${e}"]`);if(console.log(n),n){n.click();return}}await (0,r.sleep)(100),await s(e)}window.addEventListener("message",e=>{null==e.data||void 0==e.data||"startTranslate"!==e.data.name||a||(console.log(e.data),a=e.data.id,i(e.data.text,e.data.targetLanguage).then(()=>{!function(e){let t=setInterval(()=>{let n=document.querySelectorAll("#translation-target-heading + * span.sentence_highlight");if(n&&n.length>0){clearInterval(t),a=0;let o="";n.forEach(e=>{console.log(e.textContent),o+=e.textContent}),console.log("\u7ffb\u8bd1\u7ed3\u679c",o),window.parent.postMessage({name:"translateResult",body:{id:e,vendor:"deepl",text:o}},"*")}},1e3)}(a)}))},!1)},{"~utils/async-utils":"cu8Yf","@parcel/transformer-js/src/esmodule-helpers.js":"cHUbl"}],cu8Yf:[function(e,t,n){var o=e("@parcel/transformer-js/src/esmodule-helpers.js");async function r(e){return new Promise(t=>setTimeout(t,e))}function l(e,t){return Promise.race([e(),new Promise((e,n)=>setTimeout(()=>n(Error("Request timed out")),t))])}o.defineInteropFlag(n),o.export(n,"sleep",()=>r),o.export(n,"withTimeout",()=>l)},{"@parcel/transformer-js/src/esmodule-helpers.js":"cHUbl"}],cHUbl:[function(e,t,n){n.interopDefault=function(e){return e&&e.__esModule?e:{default:e}},n.defineInteropFlag=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.exportAll=function(e,t){return Object.keys(e).forEach(function(n){"default"===n||"__esModule"===n||t.hasOwnProperty(n)||Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[n]}})}),t},n.export=function(e,t,n){Object.defineProperty(e,t,{enumerable:!0,get:n})}},{}]},["57pwz"],"57pwz","parcelRequireefb9"),globalThis.define=t;