(function(e){function t(t){for(var c,o,a=t[0],l=t[1],u=t[2],d=0,p=[];d{v.value=e,r.value=e.subInput&&(!!e.subInput.value||!!e.subInput.placeholder),localStorage.setItem("rubick-system-detach",JSON.stringify(e))};try{window.initDetach(JSON.parse(p))}catch(y){}const b=i()(e=>{t.send("msg-trigger",{type:"detachInputChange",data:{text:e.target.value}})},500),f=()=>{t.send("msg-trigger",{type:"openPluginDevTools"})},m=()=>{t.send("detach:service",{type:"minimize"})},w=()=>{t.send("detach:service",{type:"maximize"})},h=()=>{t.send("detach:service",{type:"close"})};return Object.assign(window,{setSubInputValue:({value:e})=>{v.value.subInput.value=e},setSubInput:e=>{v.value.subInput.placeholder=e},removeSubInput:()=>{v.value.subInput=null}}),window.enterFullScreenTrigger=()=>{document.querySelector(".detach").classList.remove("darwin")},window.leaveFullScreenTrigger=()=>{const e=document.querySelector(".detach");e.classList.contains("darwin")||e.classList.add("darwin")},window.maximizeTrigger=()=>{const e=document.querySelector(".maximize");e&&!e.classList.contains("unmaximize")&&e.classList.add("unmaximize")},window.unmaximizeTrigger=()=>{const e=document.querySelector(".maximize");e&&e.classList.remove("unmaximize")},"darwin"===n.platform?window.onkeydown=e=>{"Escape"!==e.code?!e.metaKey||"KeyW"!==e.code&&"KeyQ"!==e.code||window.handle.close():t.send("detach:service",{type:"endFullScreen"})}:window.onkeydown=e=>{e.ctrlKey&&"KeyW"===e.code&&window.handle.close()},(e,t)=>{var i,p;return Object(c["f"])(),Object(c["c"])("div",{class:Object(c["e"])([Object(c["i"])(n).platform,"detach"])},[Object(c["d"])("div",o,[Object(c["d"])("img",{src:v.value.logo},null,8,a),r.value?(Object(c["f"])(),Object(c["c"])("input",{key:0,autofocus:"",onInput:t[0]||(t[0]=(...e)=>Object(c["i"])(b)&&Object(c["i"])(b)(...e)),value:null===(i=v.value.subInput)||void 0===i?void 0:i.value,placeholder:null===(p=v.value.subInput)||void 0===p?void 0:p.placeholder},null,40,l)):(Object(c["f"])(),Object(c["c"])("span",u,Object(c["h"])(v.value.pluginName),1))]),Object(c["d"])("div",s,[Object(c["d"])("div",{class:"handle"},[Object(c["d"])("div",{class:"devtool",onClick:f,title:"开发者工具"})]),"darwin"!==Object(c["i"])(n).platform?(Object(c["f"])(),Object(c["c"])("div",d,[Object(c["d"])("div",{class:"minimize",onClick:m}),Object(c["d"])("div",{class:"maximize",onClick:w}),Object(c["d"])("div",{class:"close",onClick:h})])):Object(c["b"])("",!0)])],2)}}};n("3480");const v=p;var b=v;n("4011");Object(c["a"])(b).mount("#app")}});