import{z as e,y as n}from"./index.9f83bdd8.1783337707176.js";import{b as i}from"./app.7aadae50.1783337707176.js";const t={"tab://setting":()=>{e.emit("openController")},"tab://addSearchEngine":(n={})=>{e.emit("openApp",i.searchEngine)},"tab://addicon":(n={})=>{e.emit("openApp",{...i.addIcon,data:n})},"tab://editAll":(e={})=>{setTimeout((()=>{n.state.editStatus=!0}),100)},"tab://background":(n={})=>{e.emit("openApp",i.wallpaper)},"tab://bookmark":(n={})=>{n.full=!1,n.size={width:window.innerWidth<500?"calc(100% - 15px)":"1000px",height:window.innerWidth>500?"550px":window.innerHeight-200+"px"},n.component="bookmark",e.emit("openPlugin",n)},"tab://tip":(n={})=>{n.full=!1,n.size={width:window.innerWidth<500?"calc(100% - 15px)":"600px",height:"450px",closeBtn:!0},n.component="tip",e.emit("openPlugin",n)}};window.openCard=function(n){let{width:i=null,height:t=null,minHeight:o=null,minWidth:a=null,custom:d={},origin:r={},id:p=""}=n;d||(d={});const{width:l=(window.innerWidth<1200?window.innerWidth<900?window.innerWidth:900:1200),height:s=(window.innerHeight<700?window.innerHeight:700)}=d;e.emit("openApp",{width:null==i?l:i,height:null==t?s:t,title:n.name,src:n.src,url:n.url,minHeight:o,minWidth:a,custom:d,origin:r,id:p})};const o=e=>{n.state.moveStatus=!1,window.openCard({name:e.name,src:e.src,url:e.window})},a=(i,t=!1)=>{const o=n.getters.find(i);if(o){const{app:n=0,custom:i={}}=o;if(1===n){if(/^http/.test(o.url),o.url,"/noteApp"===o.url)return void e.emit("openApp",{...o,name_en:"noteApp"});window.openCard({...o,origin:o})}else r(o.url,t)}},d=e=>{let n=document.createElement("a");n.href=e,n.target="_blank",n.click(),n.remove()},r=(e,i=!1)=>{if(t[e])t[e]();else if(i)d(e);else if(n.state.config.openType.linkOpen)d(e);else{let n=document.createElement("a");n.href=e,n.click(),n.remove()}};e.on("openCard",(e=>{window.openCard(e)}));export{t as C,a,o as b,d as o,r};
