@farris/ui-vue
Version:
Farris Vue, a Farris Design based Vue3 component library.
1,488 lines (1,487 loc) • 227 kB
JavaScript
import { ref as j, computed as L, watch as Cr, createVNode as k, createTextVNode as t0, resolveComponent as Xr, defineComponent as he, onMounted as gr, Fragment as Zr, inject as Vr } from "vue";
import { useResizeObserver as Yr } from "@vueuse/core";
import { isPlainObject as Re, cloneDeep as yr } from "lodash-es";
import * as f0 from "echarts";
import Kr from "../progress/index.esm.js";
const Er = {}, Ar = {};
function pe(i) {
const { properties: C, title: o, ignore: r } = i, s = r && Array.isArray(r), g = Object.keys(C).reduce((A, p) => ((!s || !r.find((B) => B === p)) && (A[p] = C[p].type === "object" && C[p].properties ? pe(C[p]) : yr(C[p].default)), A), {});
if (o && (!s || !r.find((A) => A === "id"))) {
const A = o.toLowerCase().replace(/-/g, "_");
g.id = `${A}_${Math.random().toString().slice(2, 6)}`;
}
return g;
}
function Qr(i) {
const { properties: C, title: o, required: r } = i;
if (r && Array.isArray(r)) {
const s = r.reduce((g, A) => (g[A] = C[A].type === "object" && C[A].properties ? pe(C[A]) : yr(C[A].default), g), {});
if (o && r.find((g) => g === "id")) {
const g = o.toLowerCase().replace(/-/g, "_");
s.id = `${g}_${Math.random().toString().slice(2, 6)}`;
}
return s;
}
return {
type: o
};
}
function mr(i, C = {}, o) {
const r = Er[i];
if (r) {
let s = Qr(r);
const g = Ar[i];
return s = g ? g({ getSchemaByType: mr }, s, C, o) : s, s;
}
return null;
}
function Jr(i, C) {
const o = pe(C);
return Object.keys(o).reduce((r, s) => (Object.prototype.hasOwnProperty.call(i, s) && (r[s] && Re(r[s]) && Re(i[s] || !i[s]) ? Object.assign(r[s], i[s] || {}) : r[s] = i[s]), r), o), o;
}
function Fr(i, C) {
return Object.keys(i).filter((r) => i[r] != null).reduce((r, s) => {
if (C.has(s)) {
const g = C.get(s);
if (typeof g == "string")
r[g] = i[s];
else {
const A = g(s, i[s], i);
Object.assign(r, A);
}
} else
r[s] = i[s];
return r;
}, {});
}
function et(i, C, o = /* @__PURE__ */ new Map()) {
const r = Jr(i, C);
return Fr(r, o);
}
function rt(i = {}) {
function C(e, t, l, n) {
if (typeof l == "number")
return n[e].length === l;
if (typeof l == "object") {
const c = Object.keys(l)[0], u = l[c];
if (c === "not")
return Number(n[e].length) !== Number(u);
if (c === "moreThan")
return Number(n[e].length) >= Number(u);
if (c === "lessThan")
return Number(n[e].length) <= Number(u);
}
return !1;
}
function o(e, t, l, n) {
return n[e] && n[e].propertyValue && String(n[e].propertyValue.value) === String(l);
}
const r = /* @__PURE__ */ new Map([
["length", C],
["getProperty", o]
]);
Object.keys(i).reduce((e, t) => (e.set(t, i[t]), e), r);
function s(e, t) {
const l = e;
return typeof t == "number" ? [{ target: l, operator: "length", param: null, value: Number(t) }] : typeof t == "boolean" ? [{ target: l, operator: "getProperty", param: e, value: !!t }] : typeof t == "object" ? Object.keys(t).map((n) => {
if (n === "length")
return { target: l, operator: "length", param: null, value: t[n] };
const c = n, u = t[n];
return { target: l, operator: "getProperty", param: c, value: u };
}) : [];
}
function g(e) {
return Object.keys(e).reduce((l, n) => {
const c = s(n, e[n]);
return l.push(...c), l;
}, []);
}
function A(e, t) {
if (r.has(e.operator)) {
const l = r.get(e.operator);
return l && l(e.target, e.param, e.value, t) || !1;
}
return !1;
}
function p(e, t) {
return g(e).reduce((c, u) => c && A(u, t), !0);
}
function B(e, t) {
const l = Object.keys(e), n = l.includes("allOf"), c = l.includes("anyOf"), u = n || c, d = (u ? e[u ? n ? "allOf" : "anyOf" : "allOf"] : [e]).map((x) => p(x, t));
return n ? !d.includes(!1) : d.includes(!0);
}
return { parseValueSchema: B };
}
const tt = {}, nt = {};
rt();
function Dr(i, C, o = /* @__PURE__ */ new Map(), r = (A, p, B, e) => p, s = {}, g = (A) => A) {
return Er[C.title] = C, Ar[C.title] = r, tt[C.title] = s, nt[C.title] = g, (A = {}, p = !0) => {
if (!p)
return Fr(A, o);
const B = et(A, C, o), e = Object.keys(i).reduce((t, l) => (t[l] = i[l].default, t), {});
return Object.assign(e, B);
};
}
function br(i, C) {
return { customClass: C.class, customStyle: C.style };
}
const at = /* @__PURE__ */ new Map([
["appearance", br]
]);
function ot(i, C, o) {
return C;
}
const it = "https://json-schema.org/draft/2020-12/schema", xt = "https://farris-design.gitee.io/weather.schema.json", st = "weather", ct = "A Farris Input Component", ut = "object", ft = {
id: {
description: "The unique identifier for a weather",
type: "string"
},
type: {
description: "The type string of weather component",
type: "string",
default: "weather"
},
appearance: {
description: "",
type: "object",
properties: {
class: {
type: "string"
},
style: {
type: "string"
}
},
default: {}
}
}, lt = [
"id",
"type"
], dt = {
$schema: it,
$id: xt,
title: st,
description: ct,
type: ut,
properties: ft,
required: lt
}, vt = "weather", ht = "A Farris Component", pt = "object", Bt = {
basic: {
description: "Basic Infomation",
title: "基本信息",
properties: {
id: {
description: "组件标识",
title: "标识",
type: "string",
readonly: !0
},
type: {
description: "组件类型",
title: "控件类型",
type: "select",
editor: {
type: "waiting for modification",
enum: []
}
}
}
}
}, Ct = {
title: vt,
description: ht,
type: pt,
categories: Bt
}, gt = {
/** 城市列表 */
cityItems: {
type: Array,
default: [
{ province: "北京", city: ["北京"] },
{ province: "山东", city: ["济南", "青岛"] },
{ province: "黑龙江", city: ["牡丹江", "齐齐哈尔"] }
]
},
/** 主题列表 */
themeItems: {
type: Array,
default: [
{ title: "school", adviceItems: ["clothes", "sports", "sunscreen"] },
{ title: "office", adviceItems: ["clothes", "traffic", "umbrella"] },
{ title: "construction", adviceItems: ["clothes", "chill", "heatstroke"] },
{ title: "tourism", adviceItems: ["clothes", "sunscreen", "tourism"] }
]
},
/** 天气数据 */
data: {
type: Object,
default: {
// 日出时间
sunriseTime: j(/* @__PURE__ */ new Date()),
// 日落时间
sunsetTime: j(/* @__PURE__ */ new Date()),
// 温度
temperature: j(0),
// 最高温
max: j(0),
// 最低温
min: j(0),
// 天气现象
weather: j("阴"),
// 空气质量
air: j(0),
// 建议
adviceItems: [
{ key: "clothes", value: { name: "穿衣", info: "毛衣", detail: "建议穿长袖毛衣等服装。" } },
{ key: "sports", value: { name: "运动", info: "适宜", detail: "各项气象条件都很好,很适合户外运动。" } },
{ key: "sunscreen", value: { name: "防晒", info: "强", detail: "建议涂抹SPF在15-20之间,PA++的防晒护肤品。" } },
{ key: "traffic", value: { name: "交通", info: "良好", detail: "天气较好,路面干燥,交通气象条件良好,车辆可以正常行驶。" } },
{ key: "umbrella", value: { name: "雨伞", info: "不带伞", detail: "天气较好,您在出门的时候无须带雨伞。" } },
{ key: "chill", value: { name: "风寒", info: "无", detail: "温度未达到风寒所需的低温,稍作防寒准备即可。" } },
{ key: "heatstroke", value: { name: "中暑", info: "无中暑风险", detail: "天气不热,在炎炎夏日中十分难得,可以告别暑气漫漫啦~" } },
{ key: "tourism", value: { name: "旅游", info: "适宜", detail: "天气较好,温度适宜,是个好天气哦。这样的天气适宜旅游,您可以尽情地享受大自然的风光。" } }
],
// 专业参数
proindexItemsSet: [[
{ title: "紫外线", icon: "UV", value: "中等", info: "16:00前注意防晒", explain: "紫外线指数(UVI)测量紫外线辐射。UVI越高,潜在伤害就越大,造成伤害的速度也越快。" },
{ title: "降水量", icon: "rainfall", value: "0mm", info: "过去24小时", explain: "降水量,是指12或24小时内降雨(雪)量的总和。" }
], [
{ title: "湿度", icon: "humidity", value: "31%", info: "露点温度为4°", explain: "空气中含水量与空气可容纳水量的比值。气温越高,空气可容纳的水量就越多。湿度高意味着可能结露或起雾。" },
{ title: "体感温度", icon: "apparentTemp", value: "14°", info: "风较大,体感更凉", explain: "体感温度传达身体感觉有多暖或多冷,可能与实际温度不同。体感温度受湿度和风影响。" }
], [
{ title: "气压", icon: "pressure", value: "1010mpa", info: "当前气压较稳定", explain: "气压的显著急剧变化用于预测天气变化。例如,气压降低表示雨雪即将来临,升高则表示天气将好转。" },
{ title: "能见度", icon: "visibility", value: "19km", info: "目前非常好", explain: "能见度会告诉你可以清晰地看到多远以外的物体。能见度测量大气透明度,不考虑光照强度或障碍物。" }
]],
// 每小时天气
dayItemsSet: [
[
{ icon: "sunny", temp: 15 },
{ icon: "sunny", temp: 16 },
{ icon: "sunny", temp: 20 },
{ icon: "sunny", temp: 22 },
{ icon: "sunny", temp: 24 },
{ icon: "cloudy", temp: 23 },
{ icon: "cloudy", temp: 20 },
{ icon: "cloudy", temp: 19 },
{ icon: "cloudy", temp: 19 },
{ icon: "cloudy", temp: 18 },
{ icon: "rainy1", temp: 18 },
{ icon: "rainy1", temp: 17 },
{ icon: "rainy1", temp: 15 },
{ icon: "rainy1", temp: 15 },
{ icon: "rainy2", temp: 15 },
{ icon: "rainy2", temp: 15 },
{ icon: "rainy2", temp: 15 },
{ icon: "sunny", temp: 15 },
{ icon: "sunny", temp: 15 },
{ icon: "sunny", temp: 18 },
{ icon: "sunny", temp: 19 },
{ icon: "sunny", temp: 19 },
{ icon: "sunny", temp: 20 },
{ icon: "sunny", temp: 20 }
],
[
{ icon: "rainy2", temp: 15 },
{ icon: "rainy2", temp: 15 },
{ icon: "rainy2", temp: 15 },
{ icon: "sunny", temp: 15 },
{ icon: "sunny", temp: 15 },
{ icon: "sunny", temp: 18 },
{ icon: "sunny", temp: 19 },
{ icon: "sunny", temp: 19 },
{ icon: "sunny", temp: 20 },
{ icon: "sunny", temp: 20 },
{ icon: "rainy2", temp: 21 },
{ icon: "rainy2", temp: 21 },
{ icon: "rainy2", temp: 21 },
{ icon: "sunny", temp: 21 },
{ icon: "sunny", temp: 22 },
{ icon: "sunny", temp: 24 },
{ icon: "sunny", temp: 24 },
{ icon: "sunny", temp: 23 },
{ icon: "sunny", temp: 20 },
{ icon: "sunny", temp: 20 },
{ icon: "sunny", temp: 19 },
{ icon: "sunny", temp: 19 },
{ icon: "sunny", temp: 15 },
{ icon: "sunny", temp: 15 }
]
// [
// { icon: "foggy", temp: 11 },
// { icon: "foggy", temp: 12 },
// { icon: "foggy", temp: 14 },
// { icon: "foggy", temp: 15 },
// { icon: "foggy", temp: 17 },
// { icon: "foggy", temp: 18 },
// { icon: "foggy", temp: 19 },
// { icon: "foggy", temp: 19 },
// { icon: "foggy", temp: 20 },
// { icon: "foggy", temp: 20 },
// { icon: "foggy", temp: 21 },
// { icon: "foggy", temp: 21 },
// { icon: "foggy", temp: 21 },
// { icon: "foggy", temp: 21 },
// { icon: "sunny", temp: 22 },
// { icon: "sunny", temp: 26 },
// { icon: "sunny", temp: 26 },
// { icon: "sunny", temp: 25 },
// { icon: "sunny", temp: 20 },
// { icon: "sunny", temp: 20 },
// { icon: "foggy", temp: 19 },
// { icon: "foggy", temp: 19 },
// { icon: "foggy", temp: 15 },
// { icon: "foggy", temp: 15 },
// ],[
// { icon: "cloudy", temp: 7 },
// { icon: "cloudy", temp: 8 },
// { icon: "cloudy", temp: 10 },
// { icon: "sunny", temp: 10 },
// { icon: "sunny", temp: 14 },
// { icon: "cloudy", temp: 18 },
// { icon: "cloudy", temp: 19 },
// { icon: "cloudy", temp: 19 },
// { icon: "sunny", temp: 20 },
// { icon: "sunny", temp: 20 },
// { icon: "cloudy", temp: 21 },
// { icon: "cloudy", temp: 21 },
// { icon: "cloudy", temp: 21 },
// { icon: "cloudy", temp: 21 },
// { icon: "cloudy", temp: 22 },
// { icon: "cloudy", temp: 22 },
// { icon: "sunny", temp: 21 },
// { icon: "sunny", temp: 21 },
// { icon: "sunny", temp: 20 },
// { icon: "sunny", temp: 20 },
// { icon: "sunny", temp: 19 },
// { icon: "sunny", temp: 19 },
// { icon: "sunny", temp: 15 },
// { icon: "sunny", temp: 15 },
// ],[
// { icon: "snowy1", temp: 3 },
// { icon: "snowy1", temp: 3 },
// { icon: "snowy1", temp: 3 },
// { icon: "snowy1", temp: 4 },
// { icon: "sunny", temp: 4 },
// { icon: "sunny", temp: 4 },
// { icon: "sunny", temp: 5 },
// { icon: "sunny", temp: 6 },
// { icon: "sunny", temp: 8 },
// { icon: "sunny", temp: 8 },
// { icon: "snowy1", temp: 10 },
// { icon: "snowy1", temp: 10 },
// { icon: "snowy1", temp: 10 },
// { icon: "snowy1", temp: 10 },
// { icon: "snowy1", temp: 10 },
// { icon: "snowy1", temp: 9 },
// { icon: "sunny", temp: 9 },
// { icon: "sunny", temp: 9 },
// { icon: "sunny", temp: 9 },
// { icon: "sunny", temp: 9 },
// { icon: "sunny", temp: 7 },
// { icon: "sunny", temp: 7 },
// { icon: "sunny", temp: 7 },
// { icon: "sunny", temp: 5 },
// ],[
// { icon: "sunny", temp: 5 },
// { icon: "sunny", temp: 7 },
// { icon: "sunny", temp: 7 },
// { icon: "sunny", temp: 7 },
// { icon: "sunny", temp: 7 },
// { icon: "sunny", temp: 7 },
// { icon: "sunny", temp: 10 },
// { icon: "sunny", temp: 10 },
// { icon: "sunny", temp: 10 },
// { icon: "sunny", temp: 15 },
// { icon: "sunny", temp: 15 },
// { icon: "sunny", temp: 15 },
// { icon: "sunny", temp: 16 },
// { icon: "sunny", temp: 19 },
// { icon: "sunny", temp: 19 },
// { icon: "sunny", temp: 19 },
// { icon: "sunny", temp: 19 },
// { icon: "sunny", temp: 18 },
// { icon: "sunny", temp: 17 },
// { icon: "sunny", temp: 17 },
// { icon: "sunny", temp: 17 },
// { icon: "sunny", temp: 17 },
// { icon: "sunny", temp: 16 },
// { icon: "sunny", temp: 10 },
// ],[
// { icon: "snowy2", temp: 4 },
// { icon: "snowy2", temp: 4 },
// { icon: "snowy2", temp: 4 },
// { icon: "sunny", temp: 4 },
// { icon: "sunny", temp: 4 },
// { icon: "sunny", temp: 6 },
// { icon: "sunny", temp: 6 },
// { icon: "sunny", temp: 6 },
// { icon: "sunny", temp: 7 },
// { icon: "sunny", temp: 8 },
// { icon: "snowy2", temp: 8 },
// { icon: "snowy2", temp: 8 },
// { icon: "snowy2", temp: 8 },
// { icon: "sunny", temp: 8 },
// { icon: "sunny", temp: 10 },
// { icon: "sunny", temp: 10 },
// { icon: "sunny", temp: 9 },
// { icon: "sunny", temp: 9 },
// { icon: "sunny", temp: 10 },
// { icon: "sunny", temp: 10 },
// { icon: "sunny", temp: 8 },
// { icon: "sunny", temp: 7 },
// { icon: "sunny", temp: 7 },
// { icon: "sunny", temp: 7 },
// ]
],
// 每日天气
weekItems: [
{ icon: "rainy1", max: 24, min: 15 },
{ icon: "rainy2", max: 24, min: 15 },
{ icon: "foggy", max: 26, min: 11 },
{ icon: "cloudy", max: 22, min: 7 },
{ icon: "snowy1", max: 10, min: 3 },
{ icon: "sunny", max: 19, min: 5 },
{ icon: "snowy2", max: 10, min: 4 }
]
}
}
}, Be = {
/** 默认数据 */
data: { type: Object, default: gt },
/** 主题参数 */
theme: { type: Number, default: 1 }
}, Te = Dr(Be, dt, at, ot, Ct);
function wr(i, C) {
function o(r) {
return r < 10 ? "0" + r : r;
}
return {
addZero: o
};
}
function _0(i, C) {
const o = j(i.data.data);
return {
colorTheme: L(() => (/* @__PURE__ */ new Date()).getTime() - o.value.default.sunriseTime.getTime() < 0 || o.value.default.sunsetTime.getTime() - (/* @__PURE__ */ new Date()).getTime() < 0 ? ["#151276", "#7939e0", "#332396", "#814ca7"] : (/* @__PURE__ */ new Date()).getTime() - o.value.default.sunriseTime.getTime() < 36e5 ? ["#49417b", "#f1b655", "#b1785b", "#d99877"] : o.value.default.sunsetTime.getTime() - (/* @__PURE__ */ new Date()).getTime() < 36e5 ? ["#9e2e2e", "#f59b0b", "#c15334", "#ff7361"] : ["#0273D7", "#76BAFF", "#388FFF", "#75C6FE"])
};
}
function Ce(i, C) {
const o = j(i.data.data), r = _0(i);
function s() {
let e = f0.getInstanceByDom(document.getElementById("sunset"));
e || (e = f0.init(document.getElementById("sunset"), null, {
height: 170,
width: 380
})), e.setOption({
series: [{
data: [{
value: (/* @__PURE__ */ new Date()).getTime() - o.value.default.sunriseTime.getTime(),
itemStyle: {
borderRadius: 10,
color: {
type: "linear",
x: 1,
y: 0,
x2: 0,
y2: 0,
colorStops: [{
offset: 1,
color: r.colorTheme.value ? r.colorTheme.value[3] : "white"
}, {
offset: 0,
color: "white"
}]
}
}
}, {
value: o.value.default.sunsetTime.getTime() - (/* @__PURE__ */ new Date()).getTime(),
itemStyle: {
opacity: 0
}
}],
type: "pie",
center: ["50%", "100%"],
radius: ["200%", "190%"],
startAngle: 180,
endAngle: 360,
label: {
show: !1
},
emphasis: {
scale: !1
},
// 占位圆
emptyCircleStyle: {
borderType: "dashed"
}
}, {
type: "gauge",
center: ["50%", "100%"],
radius: "220%",
startAngle: 180,
endAngle: 360,
// x轴刻度
axisTick: {
show: !1
},
// x轴标签
axisLabel: {
show: !1
},
axisLine: {
show: !1
},
// 切分短线份数
splitNumber: 20,
// 单条短线
splitLine: {
length: 3,
lineStyle: {
width: 10,
color: "white"
}
}
}]
});
}
function g(e) {
let t = f0.getInstanceByDom(document.getElementById("chart24h"));
t || (t = f0.init(document.getElementById("chart24h"), null, {
width: 1885,
height: 75
})), t.setOption({
xAxis: {
type: "category",
show: !1
},
yAxis: {
type: "value",
show: !1
},
series: [{
data: o.value.default.dayItemsSet[e].map((l) => l.temp),
type: "line",
itemStyle: {
color: "white"
}
}]
});
}
function A() {
const e = document.getElementById("background");
if (e) {
const t = e.getBoundingClientRect().width, l = Math.max(t, 400) * 1.11;
let n = f0.getInstanceByDom(document.getElementById("chart7d"));
n ? n.resize({
width: l,
height: 90
}) : n = f0.init(document.getElementById("chart7d"), null, {
width: l,
height: 90
}), n.setOption({
grid: {
left: 0
},
xAxis: {
type: "category",
show: !1
},
yAxis: {
type: "value",
show: !1
},
series: [{
data: o.value.default.weekItems.map((c) => c.min),
type: "line",
itemStyle: {
color: "#5C90F9"
}
}, {
data: o.value.default.weekItems.map((c) => c.max),
type: "line",
itemStyle: {
color: "#FC9657"
}
}]
});
}
}
function p() {
const e = document.getElementById("airPoint"), t = document.getElementById("background");
e && t && (e.style.marginLeft = o.value.default.air / 500 * (t.getBoundingClientRect().width - 50) - 5 + "px");
}
function B(e) {
s(), g(e), A(), p();
}
return {
renderChart24h: g,
renderChart7d: A,
renderCharts: B
};
}
function yt(i, C) {
const o = j(), r = j(i.data.data), s = j(0), g = wr(), A = Ce(i);
function p(f) {
s.value = f;
}
function B(f) {
switch (f) {
case 0:
return "今天";
case 1:
return "明天";
default:
const d = new Date((/* @__PURE__ */ new Date()).getTime() + 24 * 60 * 60 * 1e3 * f).getDay(), a = "周";
switch (d) {
case 0:
return a + "日";
case 1:
return a + "一";
case 2:
return a + "二";
case 3:
return a + "三";
case 4:
return a + "四";
case 5:
return a + "五";
case 6:
return a + "六";
}
break;
}
}
function e(f) {
const d = new Date((/* @__PURE__ */ new Date()).getTime() + 864e5 * f);
return g.addZero(d.getMonth() + 1) + "/" + g.addZero(d.getDate());
}
function t() {
const d = o.value.getBoundingClientRect().width - 120, a = document.getElementById("f-weather-24h-content");
a && (a.offsetLeft + d > -32 ? a.style.marginLeft = "-32px" : a.style.marginLeft = a.offsetLeft + d + "px");
}
function l() {
const f = o.value.getBoundingClientRect().width, d = f - 120, a = document.getElementById("f-weather-24h-content");
if (a) {
const x = a.scrollWidth - f - 130;
a.offsetLeft - d < -x ? a.style.marginLeft = "-" + x + "px" : a.style.marginLeft = a.offsetLeft - d + "px";
}
}
function n(f, d) {
if (f === 0) {
const a = /* @__PURE__ */ new Date();
return d === 0 ? "现在" : g.addZero((a.getHours() + d) % 24);
} else
return g.addZero(d);
}
Cr(s, () => {
const f = document.getElementById("f-weather-24h-content");
f.style.marginLeft = "-32px", A.renderChart24h(s.value);
});
function c() {
return k("div", {
class: "f-weather-24h-container"
}, [k("div", {
class: "f-weather-24h-title"
}, [t0("24小时天气预报")]), k("div", {
class: "f-weather-lrbutton-container"
}, [k("img", {
src: "/components/weather/src/image/arrow-left.png",
class: "f-weather-lrbutton-l",
onClick: t
}, null), k("img", {
src: "/components/weather/src/image/arrow-right.png",
class: "f-weather-lrbutton-r",
onClick: l
}, null)]), k("div", {
class: "f-weather-24h-content-scroll"
}, [k("div", {
id: "f-weather-24h-content"
}, [r.value.default.dayItemsSet.map((f, d) => d === s.value ? k("div", null, [k("tr", {
id: "report" + d,
class: "f-weather-24h-tr"
}, [f.map((a, x) => k("td", {
class: "f-weather-24h-td"
}, [k("div", null, [n(d, x)]), k("img", {
src: "http://mat1.gtimg.com/pingjs/ext2020/weather/pc/icon/weather/day/" + a.icon + ".png",
class: "f-weather-24h-img"
}, null), k("div", null, [a.temp + "°"])]))])]) : ""), k("div", {
id: "chart24h",
class: "f-weather-chart24h"
}, null)])])]);
}
function u() {
return k("div", {
class: "f-weather-7d-container"
}, [k("div", {
class: "f-weather-7d-title"
}, [t0("七日天气预报")]), k("tr", {
class: "f-weather-7d-tr"
}, [r.value.default.weekItems.map((f, d) => k("td", {
id: "day" + d,
class: "f-weather-7d-td",
style: "background-color: " + (d === s.value ? "rgba(0, 0, 0, 0.05)" : "none"),
onClick: () => p(d)
}, [k("div", {
class: "f-weather-7d-td-title"
}, [B(d)]), k("div", {
class: "f-weather-7d-td-date"
}, [e(d)]), k("img", {
src: "http://mat1.gtimg.com/pingjs/ext2020/weather/pc/icon/weather/day/" + f.icon + ".png",
class: "f-weather-7d-td-img"
}, null), k("div", {
class: "f-weather-7d-td-margin"
}, [f.max + "°"]), k("div", null, [f.min + "°"])]))]), k("div", {
id: "chart7d",
class: "f-weather-chart7d"
}, null)]);
}
function v() {
return k("div", {
ref: o
}, [c(), u()]);
}
return {
renderWeatherReport: v
};
}
function Et(i, C) {
const o = j(i.data.data);
function r() {
return k("div", null, [o.value.default.proindexItemsSet.map((s) => k("tr", {
class: "f-weather-proindex-tr"
}, [s.map((g) => k("td", {
class: "f-weather-proindex-td"
}, [k("div", {
class: "f-weather-proindex-content-scroll"
}, [k("div", {
class: "f-weather-proindex-content"
}, [k("img", {
src: "/components/weather/src/image/proindexImage/" + g.icon + ".png",
class: "f-weather-proindex-icon"
}, null), k("div", {
class: "f-weather-proindex-text"
}, [k("div", {
class: "f-weather-proindex-title"
}, [g.title]), k("div", {
class: "f-weather-proindex-value"
}, [g.value])]), k("div", {
class: "f-weather-proindex-line"
}, null), k("br", null, null), k("div", {
class: "f-weather-proindex-info"
}, [g.info]), k("br", null, null), k("div", null, [g.explain])])])]))]))]);
}
return {
renderWeatherProindex: r
};
}
function At(i, C) {
const o = j(!0), r = _0(i), {
renderWeatherReport: s
} = yt(i), {
renderWeatherProindex: g
} = Et(i), A = L(() => ({
"background-color": o.value ? r.colorTheme.value[2] : "",
color: o.value ? "white" : ""
})), p = L(() => ({
"background-color": o.value ? "" : r.colorTheme.value[2],
color: o.value ? "" : "white"
})), B = L(() => ({
display: o.value ? "block" : "none"
})), e = L(() => ({
display: o.value ? "none" : "block"
}));
function t() {
o.value = !0;
}
function l() {
o.value = !1;
}
function n() {
return k("div", {
class: "f-weather-container f-weather-detail"
}, [k("div", {
style: "display:flex"
}, [k("button", {
class: "f-weather-button f-weather-button-report",
style: A.value,
onClick: t
}, [t0("天气预报")]), k("button", {
class: "f-weather-button f-weather-button-proindex",
style: p.value,
onClick: l
}, [t0("其它参数")])]), k("div", {
style: B.value
}, [s()]), k("div", {
style: e.value
}, [g()])]);
}
return {
renderWeatherDetail: n
};
}
var O = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function _r(i) {
return i && i.__esModule && Object.prototype.hasOwnProperty.call(i, "default") ? i.default : i;
}
function mt(i) {
if (i.__esModule) return i;
var C = i.default;
if (typeof C == "function") {
var o = function r() {
return this instanceof r ? Reflect.construct(C, arguments, this.constructor) : C.apply(this, arguments);
};
o.prototype = C.prototype;
} else o = {};
return Object.defineProperty(o, "__esModule", { value: !0 }), Object.keys(i).forEach(function(r) {
var s = Object.getOwnPropertyDescriptor(i, r);
Object.defineProperty(o, r, s.get ? s : {
enumerable: !0,
get: function() {
return i[r];
}
});
}), o;
}
var de = { exports: {} }, ve = { exports: {} }, g0 = 1e3, y0 = g0 * 60, E0 = y0 * 60, A0 = E0 * 24, Ft = A0 * 365.25, Dt = function(i, C) {
C = C || {};
var o = typeof i;
if (o === "string" && i.length > 0)
return bt(i);
if (o === "number" && isNaN(i) === !1)
return C.long ? _t(i) : wt(i);
throw new Error(
"val is not a non-empty string or a valid number. val=" + JSON.stringify(i)
);
};
function bt(i) {
if (i = String(i), !(i.length > 100)) {
var C = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(
i
);
if (C) {
var o = parseFloat(C[1]), r = (C[2] || "ms").toLowerCase();
switch (r) {
case "years":
case "year":
case "yrs":
case "yr":
case "y":
return o * Ft;
case "days":
case "day":
case "d":
return o * A0;
case "hours":
case "hour":
case "hrs":
case "hr":
case "h":
return o * E0;
case "minutes":
case "minute":
case "mins":
case "min":
case "m":
return o * y0;
case "seconds":
case "second":
case "secs":
case "sec":
case "s":
return o * g0;
case "milliseconds":
case "millisecond":
case "msecs":
case "msec":
case "ms":
return o;
default:
return;
}
}
}
}
function wt(i) {
return i >= A0 ? Math.round(i / A0) + "d" : i >= E0 ? Math.round(i / E0) + "h" : i >= y0 ? Math.round(i / y0) + "m" : i >= g0 ? Math.round(i / g0) + "s" : i + "ms";
}
function _t(i) {
return b0(i, A0, "day") || b0(i, E0, "hour") || b0(i, y0, "minute") || b0(i, g0, "second") || i + " ms";
}
function b0(i, C, o) {
if (!(i < C))
return i < C * 1.5 ? Math.floor(i / C) + " " + o : Math.ceil(i / C) + " " + o + "s";
}
(function(i, C) {
C = i.exports = s.debug = s.default = s, C.coerce = B, C.disable = A, C.enable = g, C.enabled = p, C.humanize = Dt, C.names = [], C.skips = [], C.formatters = {};
var o;
function r(e) {
var t = 0, l;
for (l in e)
t = (t << 5) - t + e.charCodeAt(l), t |= 0;
return C.colors[Math.abs(t) % C.colors.length];
}
function s(e) {
function t() {
if (t.enabled) {
var l = t, n = +/* @__PURE__ */ new Date(), c = n - (o || n);
l.diff = c, l.prev = o, l.curr = n, o = n;
for (var u = new Array(arguments.length), v = 0; v < u.length; v++)
u[v] = arguments[v];
u[0] = C.coerce(u[0]), typeof u[0] != "string" && u.unshift("%O");
var f = 0;
u[0] = u[0].replace(/%([a-zA-Z%])/g, function(a, x) {
if (a === "%%") return a;
f++;
var h = C.formatters[x];
if (typeof h == "function") {
var F = u[f];
a = h.call(l, F), u.splice(f, 1), f--;
}
return a;
}), C.formatArgs.call(l, u);
var d = t.log || C.log || console.log.bind(console);
d.apply(l, u);
}
}
return t.namespace = e, t.enabled = C.enabled(e), t.useColors = C.useColors(), t.color = r(e), typeof C.init == "function" && C.init(t), t;
}
function g(e) {
C.save(e), C.names = [], C.skips = [];
for (var t = (typeof e == "string" ? e : "").split(/[\s,]+/), l = t.length, n = 0; n < l; n++)
t[n] && (e = t[n].replace(/\*/g, ".*?"), e[0] === "-" ? C.skips.push(new RegExp("^" + e.substr(1) + "$")) : C.names.push(new RegExp("^" + e + "$")));
}
function A() {
C.enable("");
}
function p(e) {
var t, l;
for (t = 0, l = C.skips.length; t < l; t++)
if (C.skips[t].test(e))
return !1;
for (t = 0, l = C.names.length; t < l; t++)
if (C.names[t].test(e))
return !0;
return !1;
}
function B(e) {
return e instanceof Error ? e.stack || e.message : e;
}
})(ve, ve.exports);
var kt = ve.exports;
(function(i, C) {
C = i.exports = kt, C.log = s, C.formatArgs = r, C.save = g, C.load = A, C.useColors = o, C.storage = typeof chrome < "u" && typeof chrome.storage < "u" ? chrome.storage.local : p(), C.colors = [
"lightseagreen",
"forestgreen",
"goldenrod",
"dodgerblue",
"darkorchid",
"crimson"
];
function o() {
return typeof window < "u" && window.process && window.process.type === "renderer" ? !0 : typeof document < "u" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // is firebug? http://stackoverflow.com/a/398120/376773
typeof window < "u" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // is firefox >= v31?
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // double check webkit in userAgent just in case we are in a worker
typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
}
C.formatters.j = function(B) {
try {
return JSON.stringify(B);
} catch (e) {
return "[UnexpectedJSONParseError]: " + e.message;
}
};
function r(B) {
var e = this.useColors;
if (B[0] = (e ? "%c" : "") + this.namespace + (e ? " %c" : " ") + B[0] + (e ? "%c " : " ") + "+" + C.humanize(this.diff), !!e) {
var t = "color: " + this.color;
B.splice(1, 0, t, "color: inherit");
var l = 0, n = 0;
B[0].replace(/%[a-zA-Z%]/g, function(c) {
c !== "%%" && (l++, c === "%c" && (n = l));
}), B.splice(n, 0, t);
}
}
function s() {
return typeof console == "object" && console.log && Function.prototype.apply.call(console.log, console, arguments);
}
function g(B) {
try {
B == null ? C.storage.removeItem("debug") : C.storage.debug = B;
} catch {
}
}
function A() {
var B;
try {
B = C.storage.debug;
} catch {
}
return !B && typeof process < "u" && "env" in process && (B = process.env.DEBUG), B;
}
C.enable(A());
function p() {
try {
return window.localStorage;
} catch {
}
}
})(de, de.exports);
var St = de.exports, We = St("jsonp"), Pt = Tt, Ht = 0;
function Rt() {
}
function Tt(i, C, o) {
typeof C == "function" && (o = C, C = {}), C || (C = {});
var r = C.prefix || "__jp", s = C.name || r + Ht++, g = C.param || "callback", A = C.timeout != null ? C.timeout : 6e4, p = encodeURIComponent, B = document.getElementsByTagName("script")[0] || document.head, e, t;
A && (t = setTimeout(function() {
l(), o && o(new Error("Timeout"));
}, A));
function l() {
e.parentNode && e.parentNode.removeChild(e), window[s] = Rt, t && clearTimeout(t);
}
function n() {
window[s] && l();
}
return window[s] = function(c) {
We("jsonp got", c), l(), o && o(null, c);
}, i += (~i.indexOf("?") ? "&" : "?") + g + "=" + p(s), i = i.replace("?&", "?"), We('jsonp req "%s"', i), e = document.createElement("script"), e.src = i, B.parentNode.insertBefore(e, B), n;
}
const Wt = /* @__PURE__ */ _r(Pt);
var kr = { exports: {} };
function zt(i) {
throw new Error('Could not dynamically require "' + i + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
}
var H0 = { exports: {} };
const qt = {}, Ot = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
default: qt
}, Symbol.toStringTag, { value: "Module" })), $t = /* @__PURE__ */ mt(Ot);
var ze;
function I() {
return ze || (ze = 1, function(i, C) {
(function(o, r) {
i.exports = r();
})(O, function() {
var o = o || function(r, s) {
var g;
if (typeof window < "u" && window.crypto && (g = window.crypto), typeof self < "u" && self.crypto && (g = self.crypto), typeof globalThis < "u" && globalThis.crypto && (g = globalThis.crypto), !g && typeof window < "u" && window.msCrypto && (g = window.msCrypto), !g && typeof O < "u" && O.crypto && (g = O.crypto), !g && typeof zt == "function")
try {
g = $t;
} catch {
}
var A = function() {
if (g) {
if (typeof g.getRandomValues == "function")
try {
return g.getRandomValues(new Uint32Array(1))[0];
} catch {
}
if (typeof g.randomBytes == "function")
try {
return g.randomBytes(4).readInt32LE();
} catch {
}
}
throw new Error("Native crypto module could not be used to get secure random number.");
}, p = Object.create || /* @__PURE__ */ function() {
function a() {
}
return function(x) {
var h;
return a.prototype = x, h = new a(), a.prototype = null, h;
};
}(), B = {}, e = B.lib = {}, t = e.Base = /* @__PURE__ */ function() {
return {
/**
* Creates a new object that inherits from this object.
*
* @param {Object} overrides Properties to copy into the new object.
*
* @return {Object} The new object.
*
* @static
*
* @example
*
* var MyType = CryptoJS.lib.Base.extend({
* field: 'value',
*
* method: function () {
* }
* });
*/
extend: function(a) {
var x = p(this);
return a && x.mixIn(a), (!x.hasOwnProperty("init") || this.init === x.init) && (x.init = function() {
x.$super.init.apply(this, arguments);
}), x.init.prototype = x, x.$super = this, x;
},
/**
* Extends this object and runs the init method.
* Arguments to create() will be passed to init().
*
* @return {Object} The new object.
*
* @static
*
* @example
*
* var instance = MyType.create();
*/
create: function() {
var a = this.extend();
return a.init.apply(a, arguments), a;
},
/**
* Initializes a newly created object.
* Override this method to add some logic when your objects are created.
*
* @example
*
* var MyType = CryptoJS.lib.Base.extend({
* init: function () {
* // ...
* }
* });
*/
init: function() {
},
/**
* Copies properties into this object.
*
* @param {Object} properties The properties to mix in.
*
* @example
*
* MyType.mixIn({
* field: 'value'
* });
*/
mixIn: function(a) {
for (var x in a)
a.hasOwnProperty(x) && (this[x] = a[x]);
a.hasOwnProperty("toString") && (this.toString = a.toString);
},
/**
* Creates a copy of this object.
*
* @return {Object} The clone.
*
* @example
*
* var clone = instance.clone();
*/
clone: function() {
return this.init.prototype.extend(this);
}
};
}(), l = e.WordArray = t.extend({
/**
* Initializes a newly created word array.
*
* @param {Array} words (Optional) An array of 32-bit words.
* @param {number} sigBytes (Optional) The number of significant bytes in the words.
*
* @example
*
* var wordArray = CryptoJS.lib.WordArray.create();
* var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);
* var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);
*/
init: function(a, x) {
a = this.words = a || [], x != s ? this.sigBytes = x : this.sigBytes = a.length * 4;
},
/**
* Converts this word array to a string.
*
* @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex
*
* @return {string} The stringified word array.
*
* @example
*
* var string = wordArray + '';
* var string = wordArray.toString();
* var string = wordArray.toString(CryptoJS.enc.Utf8);
*/
toString: function(a) {
return (a || c).stringify(this);
},
/**
* Concatenates a word array to this word array.
*
* @param {WordArray} wordArray The word array to append.
*
* @return {WordArray} This word array.
*
* @example
*
* wordArray1.concat(wordArray2);
*/
concat: function(a) {
var x = this.words, h = a.words, F = this.sigBytes, m = a.sigBytes;
if (this.clamp(), F % 4)
for (var E = 0; E < m; E++) {
var b = h[E >>> 2] >>> 24 - E % 4 * 8 & 255;
x[F + E >>> 2] |= b << 24 - (F + E) % 4 * 8;
}
else
for (var P = 0; P < m; P += 4)
x[F + P >>> 2] = h[P >>> 2];
return this.sigBytes += m, this;
},
/**
* Removes insignificant bits.
*
* @example
*
* wordArray.clamp();
*/
clamp: function() {
var a = this.words, x = this.sigBytes;
a[x >>> 2] &= 4294967295 << 32 - x % 4 * 8, a.length = r.ceil(x / 4);
},
/**
* Creates a copy of this word array.
*
* @return {WordArray} The clone.
*
* @example
*
* var clone = wordArray.clone();
*/
clone: function() {
var a = t.clone.call(this);
return a.words = this.words.slice(0), a;
},
/**
* Creates a word array filled with random bytes.
*
* @param {number} nBytes The number of random bytes to generate.
*
* @return {WordArray} The random word array.
*
* @static
*
* @example
*
* var wordArray = CryptoJS.lib.WordArray.random(16);
*/
random: function(a) {
for (var x = [], h = 0; h < a; h += 4)
x.push(A());
return new l.init(x, a);
}
}), n = B.enc = {}, c = n.Hex = {
/**
* Converts a word array to a hex string.
*
* @param {WordArray} wordArray The word array.
*
* @return {string} The hex string.
*
* @static
*
* @example
*
* var hexString = CryptoJS.enc.Hex.stringify(wordArray);
*/
stringify: function(a) {
for (var x = a.words, h = a.sigBytes, F = [], m = 0; m < h; m++) {
var E = x[m >>> 2] >>> 24 - m % 4 * 8 & 255;
F.push((E >>> 4).toString(16)), F.push((E & 15).toString(16));
}
return F.join("");
},
/**
* Converts a hex string to a word array.
*
* @param {string} hexStr The hex string.
*
* @return {WordArray} The word array.
*
* @static
*
* @example
*
* var wordArray = CryptoJS.enc.Hex.parse(hexString);
*/
parse: function(a) {
for (var x = a.length, h = [], F = 0; F < x; F += 2)
h[F >>> 3] |= parseInt(a.substr(F, 2), 16) << 24 - F % 8 * 4;
return new l.init(h, x / 2);
}
}, u = n.Latin1 = {
/**
* Converts a word array to a Latin1 string.
*
* @param {WordArray} wordArray The word array.
*
* @return {string} The Latin1 string.
*
* @static
*
* @example
*
* var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);
*/
stringify: function(a) {
for (var x = a.words, h = a.sigBytes, F = [], m = 0; m < h; m++) {
var E = x[m >>> 2] >>> 24 - m % 4 * 8 & 255;
F.push(String.fromCharCode(E));
}
return F.join("");
},
/**
* Converts a Latin1 string to a word array.
*
* @param {string} latin1Str The Latin1 string.
*
* @return {WordArray} The word array.
*
* @static
*
* @example
*
* var wordArray = CryptoJS.enc.Latin1.parse(latin1String);
*/
parse: function(a) {
for (var x = a.length, h = [], F = 0; F < x; F++)
h[F >>> 2] |= (a.charCodeAt(F) & 255) << 24 - F % 4 * 8;
return new l.init(h, x);
}
}, v = n.Utf8 = {
/**
* Converts a word array to a UTF-8 string.
*
* @param {WordArray} wordArray The word array.
*
* @return {string} The UTF-8 string.
*
* @static
*
* @example
*
* var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);
*/
stringify: function(a) {
try {
return decodeURIComponent(escape(u.stringify(a)));
} catch {
throw new Error("Malformed UTF-8 data");
}
},
/**
* Converts a UTF-8 string to a word array.
*
* @param {string} utf8Str The UTF-8 string.
*
* @return {WordArray} The word array.
*
* @static
*
* @example
*
* var wordArray = CryptoJS.enc.Utf8.parse(utf8String);
*/
parse: function(a) {
return u.parse(unescape(encodeURIComponent(a)));
}
}, f = e.BufferedBlockAlgorithm = t.extend({
/**
* Resets this block algorithm's data buffer to its initial state.
*
* @example
*
* bufferedBlockAlgorithm.reset();
*/
reset: function() {
this._data = new l.init(), this._nDataBytes = 0;
},
/**
* Adds new data to this block algorithm's buffer.
*
* @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.
*
* @example
*
* bufferedBlockAlgorithm._append('data');
* bufferedBlockAlgorithm._append(wordArray);
*/
_append: function(a) {
typeof a == "string" && (a = v.parse(a)), this._data.concat(a), this._nDataBytes += a.sigBytes;
},
/**
* Processes available data blocks.
*
* This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.
*
* @param {boolean} doFlush Whether all blocks and partial blocks should be processed.
*
* @return {WordArray} The processed data.
*
* @example
*
* var processedData = bufferedBlockAlgorithm._process();
* var processedData = bufferedBlockAlgorithm._process(!!'flush');
*/
_process: function(a) {
var x, h = this._data, F = h.words, m = h.sigBytes, E = this.blockSize, b = E * 4, P = m / b;
a ? P = r.ceil(P) : P = r.max((P | 0) - this._minBufferSize, 0);
var y = P * E, D = r.min(y * 4, m);
if (y) {
for (var S = 0; S < y; S += E)
this._doProcessBlock(F, S);
x = F.splice(0, y), h.sigBytes -= D;
}
return new l.init(x, D);
},
/**
* Creates a copy of this object.
*
* @return {Object} The clone.
*
* @example
*
* var clone = bufferedBlockAlgorithm.clone();
*/
clone: function() {
var a = t.clone.call(this);
return a._data = this._data.clone(), a;
},
_minBufferSize: 0
});
e.Hasher = f.extend({
/**
* Configuration options.
*/
cfg: t.extend(),
/**
* Initializes a newly created hasher.
*
* @param {Object} cfg (Optional) The configuration options to use for this hash computation.
*
* @example
*
* var hasher = CryptoJS.algo.SHA256.create();
*/
init: function(a) {
this.cfg = this.cfg.extend(a), this.reset();
},
/**
* Resets this hasher to its initial state.
*
* @example
*
* hasher.reset();
*/
reset: function() {
f.reset.call(this), this._doReset();
},
/**
* Updates this hasher with a message.
*
* @param {WordArray|string} messageUpdate The message to append.
*
* @return {Hasher} This hasher.
*