var qwen=function(){"use strict";var A=Object.defineProperty;var F=(l,i,c)=>i in l?A(l,i,{enumerable:!0,configurable:!0,writable:!0,value:c}):l[i]=c;var a=(l,i,c)=>F(l,typeof i!="symbol"?i+"":i,c);var p,S;function l(n){return n}const i={matches:["https://chat.qwen.ai/*"],async main(n){const e=new URL(location.href).searchParams.get("prompt");setTimeout(()=>{const r=document.querySelector("#chat-input");r&&e&&(r.value=e||"",r.scrollTo(0,r.scrollHeight))},500)}},h=(S=(p=globalThis.browser)==null?void 0:p.runtime)!=null&&S.id?globalThis.browser:globalThis.chrome;function u(n,...t){}const I={debug:(...n)=>u(console.debug,...n),log:(...n)=>u(console.log,...n),warn:(...n)=>u(console.warn,...n),error:(...n)=>u(console.error,...n)},g=class g extends Event{constructor(t,e){super(g.EVENT_NAME,{}),this.newUrl=t,this.oldUrl=e}};a(g,"EVENT_NAME",v("wxt:locationchange"));let w=g;function v(n){var t;return`${(t=h==null?void 0:h.runtime)==null?void 0:t.id}:qwen:${n}`}function T(n){let t,e;return{run(){t==null&&(e=new URL(location.href),t=n.setInterval(()=>{let r=new URL(location.href);r.href!==e.href&&(window.dispatchEvent(new w(r,e)),e=r)},1e3))}}}const d=class d{constructor(t,e){a(this,"isTopFrame",window.self===window.top);a(this,"abortController");a(this,"locationWatcher",T(this));a(this,"receivedMessageIds",new Set);this.contentScriptName=t,this.options=e,this.abortController=new AbortController,this.isTopFrame?(this.listenForNewerScripts({ignoreFirstEvent:!0}),this.stopOldScripts()):this.listenForNewerScripts()}get signal(){return this.abortController.signal}abort(t){return this.abortController.abort(t)}get isInvalid(){return h.runtime.id==null&&this.notifyInvalidated(),this.signal.aborted}get isValid(){return!this.isInvalid}onInvalidated(t){return this.signal.addEventListener("abort",t),()=>this.signal.removeEventListener("abort",t)}block(){return new Promise(()=>{})}setInterval(t,e){const r=setInterval(()=>{this.isValid&&t()},e);return this.onInvalidated(()=>clearInterval(r)),r}setTimeout(t,e){const r=setTimeout(()=>{this.isValid&&t()},e);return this.onInvalidated(()=>clearTimeout(r)),r}requestAnimationFrame(t){const e=requestAnimationFrame((...r)=>{this.isValid&&t(...r)});return this.onInvalidated(()=>cancelAnimationFrame(e)),e}requestIdleCallback(t,e){const r=requestIdleCallback((...s)=>{this.signal.aborted||t(...s)},e);return this.onInvalidated(()=>cancelIdleCallback(r)),r}addEventListener(t,e,r,s){var o;e==="wxt:locationchange"&&this.isValid&&this.locationWatcher.run(),(o=t.addEventListener)==null||o.call(t,e.startsWith("wxt:")?v(e):e,r,{...s,signal:this.signal})}notifyInvalidated(){this.abort("Content script context invalidated"),I.debug(`Content script "${this.contentScriptName}" context invalidated`)}stopOldScripts(){window.postMessage({type:d.SCRIPT_STARTED_MESSAGE_TYPE,contentScriptName:this.contentScriptName,messageId:Math.random().toString(36).slice(2)},"*")}verifyScriptStartedEvent(t){var o,E,b;const e=((o=t.data)==null?void 0:o.type)===d.SCRIPT_STARTED_MESSAGE_TYPE,r=((E=t.data)==null?void 0:E.contentScriptName)===this.contentScriptName,s=!this.receivedMessageIds.has((b=t.data)==null?void 0:b.messageId);return e&&r&&s}listenForNewerScripts(t){let e=!0;const r=s=>{if(this.verifyScriptStartedEvent(s)){this.receivedMessageIds.add(s.data.messageId);const o=e;if(e=!1,o&&(t!=null&&t.ignoreFirstEvent))return;this.notifyInvalidated()}};addEventListener("message",r),this.onInvalidated(()=>removeEventListener("message",r))}};a(d,"SCRIPT_STARTED_MESSAGE_TYPE",v("wxt:content-script-started"));let f=d;function q(){}function m(n,...t){}const N={debug:(...n)=>m(console.debug,...n),log:(...n)=>m(console.log,...n),warn:(...n)=>m(console.warn,...n),error:(...n)=>m(console.error,...n)};return(async()=>{try{const{main:n,...t}=i,e=new f("qwen",t);return await n(e)}catch(n){throw N.error('The content script "qwen" crashed on startup!',n),n}})()}();
qwen;
