const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Detail-_j0qQa5U.js","./vendor-s2rfM_Vj.js","./t-r-vendor-gn7FMrPE.js","./t-r-vendor-BqYdeEzc.css","./constant-Dkm_Y9q1.js","./apis-DdFSvwR4.js","./newtab-BWIjnu6l.js","./index-Bf7N7lFc.js","./index-_OyDQdIX.css","./newtab-0VcUNIVO.css"])))=>i.map(i=>d[i]);
import{_ as e}from"./constant-Dkm_Y9q1.js";import{F as t,r as n,z as i,U as o,C as a}from"./vendor-s2rfM_Vj.js";import{F as r,g as s,L as l,G as x,s as p}from"./apis-DdFSvwR4.js";import{f as c}from"./newtab-BWIjnu6l.js";const d=new Map([["阴","yintian"],["少云","duoyun"],["大雨","dayu"],["暴雪","baoxue"],["大风","dafeng"],["冰雹","bingbao"],["强对流","qiangduiliu"],["暴雨","baoyu"],["沙尘","shachen"],["雾","wu"],["小雪","xiaoxue"],["中雪","zhongxue"],["大雪","daxue"],["轻度雾霾","qingduwumai"],["中度雾霾","zhongduwumai"],["重度雾霾","zhongduwumai"],["小雨","xiaoyu"],["中雨","zhongyu"],["雷阵雨","leizhenyu"],["雨夹雪","yujiaxue"],["阵雨","xiaoyu"],["小到中雨","xiaoyu"]]);r()?(d.set("晴","qingtian"),d.set("多云","duoyun")):(d.set("多云","wanduoyun"),d.set("晴","wanqingtian"));const h=new Map([[0,"https://www.waylon.online/static/ovo/common/weather/xiayu.jpg"],[1,"https://www.waylon.online/static/ovo/common/weather/duoyun.jpg"],[2,"https://www.waylon.online/static/ovo/common/weather/xiaxue.jpg"],[3,"https://www.waylon.online/static/ovo/common/weather/yintian.jpg"],[4,"https://www.waylon.online/static/ovo/common/weather/qingtian.jpg"]]),u=t.div`
  width: 100%;
  height: 100%;
  transition: all 0.2s ease-in-out;
`,w=t.div`
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  border-radius: 4px;
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  /* color: var(--white); */
  > h1 {
    letter-spacing: 1px;
    font-family: ovo, sans-serif;
    font-weight: 500;
    font-size: 18px;
    color: var(--white);
    text-shadow: 4px 4px 8px var(--black5);
    /* 波浪动画 */
    animation: weatherBlowUp 0.2s ease-in-out;
    @keyframes weatherBlowUp {
      0% {
        transform: scale(0);
      }
      100% {
        transform: scale(1);
      }
    }
  }
  &::before {
    content: "";
    position: absolute;
    width: 120%;
    height: 120%;
    background-image: url(${e=>h.get(e.backgroundkey)||""});
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    border-radius: 4px;
    z-index: -1;
    filter: contrast(120%);
    /* 加入动画 背景缓慢移动 */
    animation: move 25s linear infinite;
    @keyframes move {
      0% {
        transform: translate(0, -10%);
      }
      50% {
        transform: translate(-10%, 0);
      }
      100% {
        transform: translate(0, -10%);
      }
    }
  }
`,m=t.div`
  color: var(--white);
  width: 100%;
  height: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
`,f=t.div`
  font-size: 32px;
  text-shadow: 4px 4px 8px var(--black9);
  > span {
    font-size: 12px;
  }
`,g=t.i`
  margin-left: 8px;
  font-size: 32px;
  text-shadow: 4px 4px 8px var(--black9);
`,v=t.div`
  color: var(--white);
  margin-top: 4px;
  font-size: 12px;
  text-shadow: 4px 4px 8px var(--black9);
  > span,
  i {
    font-size: 12px;
    margin-right: 2px;
  }
`,y={WrapUI:t.div`
    width: 600px;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 8px 16px;
  `,HeaderUI:t.div`
    width: 100%;
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    h1 {
      display: inline-block;
      color: var(--white);
      font-size: 64px;
      font-weight: 600;
      width: 250px;
      text-align: center;
      text-shadow: 4px 4px 8px var(--black9);
      span {
        font-size: 24px;
      }
    }
    aside {
      width: 100%;
      height: 100%;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: flex-start;
      h4 {
        align-items: center;
        color: var(--white);
        font-size: 12px;
        text-shadow: 4px 4px 8px var(--black9);
        display: inline-flex;
        width: 100%;
        align-items: flex-end;
        flex-direction: column;
        padding-right: 16px;
        i {
          font-size: 16px;
          margin-right: 4px;
        }
        span {
          font-size: 12px;
          transform: scale(0.9);
          transform-origin: right;
          color: var(--white5);
          text-shadow: 4px 4px 8px var(--black9);
        }
      }
      h2 {
        margin-top: 8px;
        color: var(--white);
        font-size: 16px;
        text-shadow: 4px 4px 8px var(--black9);
        i {
          font-size: 40px;
          margin-left: 16px;
        }
      }
      h3 {
        margin-top: 8px;
        color: var(--white);
        font-size: 12px;
        text-shadow: 4px 4px 8px var(--black9);
      }
    }
  `,ContentUI:t.div`
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: row;
    width: 100%;
    height: 200px;
    color: var(--white);
    text-shadow: 4px 4px 8px var(--black5);
  `,ContentDayUI:t.div`
    flex: 1;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    transition: all 0.3s ease-in-out;
    h1 {
      font-size: 16px;
      font-weight: 500;
    }
    i {
      margin-top: 16px;
      font-size: 32px;
    }
    div {
      margin-top: 16px;
    }
    &:hover {
      background-color: var(--white3);
      border-radius: 4px;
      cursor: pointer;
    }
  `,FooterUI:t.div`
    height: 24px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    transition: all 0.3s ease-in-out;
    color: var(--white5);
    &:hover {
      text-shadow: 0 0 1px var(--white5);
      cursor: pointer;
    }
  `},b="_hover-enter_14d1b_1",j="_hover-enter-active_14d1b_6",z="_hover-exit_14d1b_16",_="_hover-exit-active_14d1b_21",k="_hover-exit-done_14d1b_27",E=n.lazy((()=>e((()=>import("./Detail-_j0qQa5U.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url))),I=Object.freeze(Object.defineProperty({__proto__:null,default:({})=>{const[e,t]=n.useState(!1),[r,h]=n.useState(!0),{handleMessage:y}=c(),[I,S]=n.useState(""),[D,U]=n.useState(""),[A,M]=n.useState(0),[q,C]=n.useState({now:{temperature:"23",weather:"",wind:""},today:{temperature:"",weather:"",wind:""},tomorrow:{temperature:"",weather:"",wind:""},DATomorrow:{temperature:"",weather:"",wind:""}});return n.useEffect((()=>{const e=s(l.WEATHER_KEY);e&&e.timeout>Date.now()?(C(e.data.weatherInfo),S(e.data.zone.city),U(e.data.zone.province),h(!1)):(async()=>{const{code:e,data:t,msg:n}=await x(D,I);200===e?(C(t.weatherInfo),t.isError?(S("北京市"),U("北京市")):(S(t.zone.city),U(t.zone.province)),p(l.WEATHER_KEY,{data:t,timeout:18e5+Date.now()})):(y.error("获取天气数据失败"),console.error('WAYLON "获取天气数据失败"',n)),h(!1)})()}),[]),i.jsxs(u,{style:{filter:r?"blur(2px)":"none"},children:[i.jsx(w,{onClick:()=>t(!0),backgroundkey:(e=>{const t=d.get(e)??"duoyun";return["dayu","zhongyu","xiaoyu","baoyu","leizhenyu","yujiaxue"].includes(t)?0:["duoyun","wanduoyun"].includes(t)?1:["xiaoxue","zhongxue","daxue","baoxue"].includes(t)?2:["yintian"].includes(t)?3:4})(q.now.weather),onMouseEnter:()=>M(1),onMouseLeave:()=>M(0),children:i.jsx(o,{children:i.jsx(a,{timeout:400,classNames:{enter:b,enterActive:j,exit:z,exitActive:_,exitDone:k},unmountOnExit:!0,children:A?i.jsx("h1",{children:"查看详情"}):i.jsxs(i.Fragment,{children:[i.jsxs(m,{children:[i.jsxs(f,{children:[q.now.temperature,i.jsx("span",{children:"°C"})]}),i.jsx(g,{className:"ovo-color "+(d.get(q.now.weather)??"duoyun")})]}),i.jsxs(v,{children:[i.jsx("i",{className:"ovo location"}),i.jsx("span",{children:I}),q.now.weather+" "+q.now.wind]})]})},A)})}),i.jsx(n.Suspense,{children:e&&i.jsx(E,{visible:e,handleVisible:t,weatherInfo:q,city:I,province:D})})]})}},Symbol.toStringTag,{value:"Module"}));export{y as D,I,d as W};
