import { h } from './chunks/d4789960.js';
import './chunks/456564be.js';
import { u as useProp } from './chunks/c26036df.js';
import { u as useEvent } from './chunks/d4058887.js';
import { a as useRef, u as useEffect } from './chunks/4ccc6eeb.js';
import { g as getComponentOrDefine } from './chunks/071ed725.js';
import './chunks/23e44913.js';
import './chunks/a02c5734.js';
import './horse-download-box.js';
import './chunks/d76d6172.js';
import './kun-icon.js';
import './chunks/cd857e99.js';
import './chunks/e5702756.js';
import './kun-image.js';
import './chunks/1c3fc91c.js';
import './chunks/cf049716.js';
import './chunks/ba37e29a.js';
import { R as ROUTES } from './chunks/31c885ba.js';
import './kun-upload-file.js';

function useDocumentTitleHook(title, retainOnUnmount = false) {
  const defaultTitle = useRef(document.title);
  useEffect(() => {
    document.title = title;
    return () => {
      if (!retainOnUnmount) document.title = defaultTitle.current;
    };
  }, [title]);
}

const loginBoxstyle = `
.fixed-left-top {
  position: fixed;
  top: 10px;
  left: 15px;
}

.needle-item {
  margin-right: 10px;
}
.needle-items {
  display: flex;
  justify-content: center;
  flex-direction: row;
}
.wechat-img {
  width: 268px;
  height: 265px;
  padding: 26px
}

.login-box-flat {
  width: 400px;
  padding-bottom: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 20px;
  background:rgba(255,255,255,1);
}

.login-box {
  width: 400px;
  padding-bottom: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 20px;
  background:rgba(255,255,255,1);
  box-shadow:0px 3px 19px 0px rgba(223,223,223,0.5);
  border-radius:5px;
}

.page {
  width: 100%;
  height: 100vh;
  background:rgba(249,249,249,1);
  justify-content: center;
  display: flex;
  align-items: center;
  flex-direction: column;
}

.login-title {
  font-size:40px;
  color:rgba(33,34,38,1);
  line-height:56px;
  margin-bottom: 50px;
}

`;

const LoginComponent = () => {
  const d = useProp("message");
  useEffect(() => {
    setTimeout(() => {
      const obj = new WxLogin({
        self_redirect: false,
        id: "login-box",
        appid: "wx4332e11f7d5c65e6",
        scope: "snsapi_login",
        redirect_uri: `https://www.xunlianying.vip/${ROUTES.RedirectWechat}`,
        href: "https://file.wintercoming.xyz/web/plume/index.css"
      });
    }, 100);
  }, []);
  useDocumentTitleHook("登录");
  const eventInit = {
    bubbles: true,
    composed: true
  };
  const dispatchMyEvent = useEvent("LoginEvent", eventInit);
  const dispatchLoginWeibo = useEvent("LoginWeibo", eventInit);

  const handlerLogin1 = () => {
    dispatchMyEvent({
      // eslint-disable-next-line @typescript-eslint/camelcase
      user_name: "guofucheng",
      password: "wozhiaini"
    });
  };

  const handlerLoginWeibo = () => {
    dispatchLoginWeibo({
      // eslint-disable-next-line @typescript-eslint/camelcase
      user_name: "guofucheng",
      password: "wozhiaini"
    });
  };

  return h("host", null, h("style", null, loginBoxstyle), h("div", {
    className: "page"
  }, h("div", {
    className: "fixed-left-top"
  }, h("horse-download-box", null)), h("span", {
    className: "login-title"
  }, "\u767B\u5F55", d), h("div", {
    className: "login-box"
  }, h("span", null, "\u8BF7\u6253\u5F00\u624B\u673A\u5FAE\u4FE1\u626B\u63CF\u4E8C\u7EF4\u7801", h("span", {
    onclick: () => handlerLogin1()
  }, "\u786E\u8BA4\u767B\u5F55")), h("div", null, h("div", {
    id: "login-box",
    className: "wechat-img"
  })), h("div", {
    className: "needle-items"
  }, h("div", {
    role: "presentation"
  }, h("span", {
    className: "needle-item",
    onclick: handlerLoginWeibo
  }, h("kun-icon", {
    iconType: "weibo",
    width: 16,
    height: 16
  })))))));
};

LoginComponent.props = {
  message: {
    type: String,
    value: "login-component",
    reflect: true,
    event: {
      type: "changeMessage"
    }
  }
};
var loginComponent = getComponentOrDefine("login-component", LoginComponent);

export default loginComponent;
export { loginBoxstyle };
//# sourceMappingURL=login-component.js.map
