diff --git a/bing.go b/bing.go
index cb31bdc..36dd223 100644
--- a/bing.go
+++ b/bing.go
@@ -315,23 +315,24 @@ func fetchBingHistory() {
allMap[k] = r
}
- // Sort by date descending, then by market for determinism
+ // Sort by date ascending (oldest first), so index 0 = oldest, index N = newest
+ // Left-to-right navigation: left = older (smaller idx), right = newer (larger idx)
var records []BingRecord
for _, r := range allMap {
records = append(records, r)
}
sort.Slice(records, func(i, j int) bool {
if records[i].Date != records[j].Date {
- return records[i].Date > records[j].Date
+ return records[i].Date < records[j].Date
}
return records[i].Market < records[j].Market
})
// ---- Phase 3: Enforce 2000 cap ----
if len(records) > maxBingRecords {
- // Remove oldest records and their files
- toRemove := records[maxBingRecords:]
- records = records[:maxBingRecords]
+ // Records sorted oldest-first, so oldest are at the head
+ toRemove := records[:len(records)-maxBingRecords]
+ records = records[len(records)-maxBingRecords:]
for _, r := range toRemove {
p := filepath.Join(bingDir(), r.Filename)
os.Remove(p)
@@ -380,6 +381,7 @@ func getCurrentBingRecord() *BingRecord {
}
// bingPrev moves to the previous (older) image, skipping hidden ones.
+// Records sorted oldest-first, so prev = decrement index.
func bingPrev() {
bingMu.Lock()
defer bingMu.Unlock()
@@ -390,7 +392,7 @@ func bingPrev() {
}
attempts := 0
for {
- h.CurrentIdx = (h.CurrentIdx + 1) % len(h.Records)
+ h.CurrentIdx = (h.CurrentIdx - 1 + len(h.Records)) % len(h.Records)
if !h.Records[h.CurrentIdx].Hidden {
break
}
@@ -405,6 +407,7 @@ func bingPrev() {
}
// bingNext moves to the next (newer) image, skipping hidden ones.
+// Records sorted oldest-first, so next = increment index.
func bingNext() {
bingMu.Lock()
defer bingMu.Unlock()
@@ -415,7 +418,7 @@ func bingNext() {
}
attempts := 0
for {
- h.CurrentIdx = (h.CurrentIdx - 1 + len(h.Records)) % len(h.Records)
+ h.CurrentIdx = (h.CurrentIdx + 1) % len(h.Records)
if !h.Records[h.CurrentIdx].Hidden {
break
}
@@ -464,10 +467,10 @@ func bingToggleDislike() string {
if r.Hidden {
log.Printf("Bing 壁纸: 已隐藏 (date=%s)", r.Date)
- // Advance to next visible
+ // Advance to next visible (newer = +1)
attempts := 0
for {
- h.CurrentIdx = (h.CurrentIdx - 1 + len(h.Records)) % len(h.Records)
+ h.CurrentIdx = (h.CurrentIdx + 1) % len(h.Records)
if !h.Records[h.CurrentIdx].Hidden {
break
}
@@ -587,7 +590,7 @@ func bingWallpaperLoop() {
// Move to next (newer) image, skip hidden
attempts := 0
for {
- h.CurrentIdx = (h.CurrentIdx - 1 + len(h.Records)) % len(h.Records)
+ h.CurrentIdx = (h.CurrentIdx + 1) % len(h.Records)
if !h.Records[h.CurrentIdx].Hidden {
break
}
diff --git a/web-ui/src/settings/components/WallpaperSection.vue b/web-ui/src/settings/components/WallpaperSection.vue
index 1dfb534..3a89c86 100644
--- a/web-ui/src/settings/components/WallpaperSection.vue
+++ b/web-ui/src/settings/components/WallpaperSection.vue
@@ -84,7 +84,7 @@
diff --git a/web/settings.html b/web/settings.html
index f3056fc..0c20e83 100644
--- a/web/settings.html
+++ b/web/settings.html
@@ -19,8 +19,8 @@
* @vue/runtime-dom v3.5.34
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
-**/let Ys;const Ln=typeof window<"u"&&window.trustedTypes;if(Ln)try{Ys=Ln.createPolicy("vue",{createHTML:e=>e})}catch{}const li=Ys?e=>Ys.createHTML(e):e=>e,cl="http://www.w3.org/2000/svg",al="http://www.w3.org/1998/Math/MathML",We=typeof document<"u"?document:null,Hn=We&&We.createElement("template"),ul={insert:(e,t,s)=>{t.insertBefore(e,s||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,s,n)=>{const r=t==="svg"?We.createElementNS(cl,e):t==="mathml"?We.createElementNS(al,e):s?We.createElement(e,{is:s}):We.createElement(e);return e==="select"&&n&&n.multiple!=null&&r.setAttribute("multiple",n.multiple),r},createText:e=>We.createTextNode(e),createComment:e=>We.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>We.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,s,n,r,i){const o=s?s.previousSibling:t.lastChild;if(r&&(r===i||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),s),!(r===i||!(r=r.nextSibling)););else{Hn.innerHTML=li(n==="svg"?`
`:n==="mathml"?`
`:e);const l=Hn.content;if(n==="svg"||n==="mathml"){const a=l.firstChild;for(;a.firstChild;)l.appendChild(a.firstChild);l.removeChild(a)}t.insertBefore(l,s)}return[o?o.nextSibling:t.firstChild,s?s.previousSibling:t.lastChild]}},fl=Symbol("_vtc");function dl(e,t,s){const n=e[fl];n&&(t=(t?[t,...n]:[...n]).join(" ")),t==null?e.removeAttribute("class"):s?e.setAttribute("class",t):e.className=t}const Kn=Symbol("_vod"),pl=Symbol("_vsh"),hl=Symbol(""),gl=/(?:^|;)\s*display\s*:/;function vl(e,t,s){const n=e.style,r=ne(s);let i=!1;if(s&&!r){if(t)if(ne(t))for(const o of t.split(";")){const l=o.slice(0,o.indexOf(":")).trim();s[l]==null&&kt(n,l,"")}else for(const o in t)s[o]==null&&kt(n,o,"");for(const o in s){o==="display"&&(i=!0);const l=s[o];l!=null?bl(e,o,!ne(t)&&t?t[o]:void 0,l)||kt(n,o,l):kt(n,o,"")}}else if(r){if(t!==s){const o=n[hl];o&&(s+=";"+o),n.cssText=s,i=gl.test(s)}}else t&&e.removeAttribute("style");Kn in e&&(e[Kn]=i?n.display:"",e[pl]&&(n.display="none"))}const Un=/\s*!important$/;function kt(e,t,s){if($(s))s.forEach(n=>kt(e,t,n));else if(s==null&&(s=""),t.startsWith("--"))e.setProperty(t,s);else{const n=ml(e,t);Un.test(s)?e.setProperty(dt(n),s.replace(Un,""),"important"):e[n]=s}}const Wn=["Webkit","Moz","ms"],Ns={};function ml(e,t){const s=Ns[t];if(s)return s;let n=Pe(t);if(n!=="filter"&&n in e)return Ns[t]=n;n=lr(n);for(let r=0;r
Vs||(wl.then(()=>Vs=0),Vs=Date.now());function Cl(e,t){const s=n=>{if(!n._vts)n._vts=Date.now();else if(n._vts<=s.attached)return;Ke(Tl(n,s.value),t,5,[n])};return s.value=e,s.attached=Sl(),s}function Tl(e,t){if($(t)){const s=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{s.call(e),e._stopped=!0},t.map(n=>r=>!r._stopped&&n&&n(r))}else return t}const Zn=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Pl=(e,t,s,n,r,i)=>{const o=r==="svg";t==="class"?dl(e,n,o):t==="style"?vl(e,s,n):hs(t)?gs(t)||yl(e,t,s,n,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Al(e,t,n,o))?(Gn(e,t,n),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Jn(e,t,n,o,i,t!=="value")):e._isVueCE&&(Ol(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!ne(n)))?Gn(e,Pe(t),n,i,t):(t==="true-value"?e._trueValue=n:t==="false-value"&&(e._falseValue=n),Jn(e,t,n,o))};function Al(e,t,s,n){if(n)return!!(t==="innerHTML"||t==="textContent"||t in e&&Zn(t)&&R(s));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const r=e.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return Zn(t)&&ne(s)?!1:t in e}function Ol(e,t){const s=e._def.props;if(!s)return!1;const n=Pe(t);return Array.isArray(s)?s.some(r=>Pe(r)===n):Object.keys(s).some(r=>Pe(r)===n)}const fs=e=>{const t=e.props["onUpdate:modelValue"]||!1;return $(t)?s=>ts(t,s):t};function kl(e){e.target.composing=!0}function Xn(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const yt=Symbol("_assign");function Qn(e,t,s){return t&&(e=e.trim()),s&&(e=bs(e)),e}const Zs={created(e,{modifiers:{lazy:t,trim:s,number:n}},r){e[yt]=fs(r);const i=n||r.props&&r.props.type==="number";lt(e,t?"change":"input",o=>{o.target.composing||e[yt](Qn(e.value,s,i))}),(s||i)&<(e,"change",()=>{e.value=Qn(e.value,s,i)}),t||(lt(e,"compositionstart",kl),lt(e,"compositionend",Xn),lt(e,"change",Xn))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:s,modifiers:{lazy:n,trim:r,number:i}},o){if(e[yt]=fs(o),e.composing)return;const l=(i||e.type==="number")&&!/^0\d/.test(e.value)?bs(e.value):e.value,a=t??"";if(l===a)return;const p=e.getRootNode();(p instanceof Document||p instanceof ShadowRoot)&&p.activeElement===e&&e.type!=="range"&&(n&&t===s||r&&e.value.trim()===a)||(e.value=a)}},Ps={deep:!0,created(e,{value:t,modifiers:{number:s}},n){const r=vs(t);lt(e,"change",()=>{const i=Array.prototype.filter.call(e.options,o=>o.selected).map(o=>s?bs(ds(o)):ds(o));e[yt](e.multiple?r?new Set(i):i:i[0]),e._assigning=!0,Or(()=>{e._assigning=!1})}),e[yt]=fs(n)},mounted(e,{value:t}){er(e,t)},beforeUpdate(e,t,s){e[yt]=fs(s)},updated(e,{value:t}){e._assigning||er(e,t)}};function er(e,t){const s=e.multiple,n=$(t);if(!(s&&!n&&!vs(t))){for(let r=0,i=e.options.length;rString(p)===String(l)):o.selected=_i(t,l)>-1}else o.selected=t.has(l);else if(zt(ds(o),t)){e.selectedIndex!==r&&(e.selectedIndex=r);return}}!s&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function ds(e){return"_value"in e?e._value:e.value}const El=["ctrl","shift","alt","meta"],Il={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>El.some(s=>e[`${s}Key`]&&!t.includes(s))},Xs=(e,t)=>{if(!e)return e;const s=e._withMods||(e._withMods={}),n=t.join(".");return s[n]||(s[n]=((r,...i)=>{for(let o=0;o{const t=Ml().createApp(...e),{mount:s}=t;return t.mount=n=>{const r=Dl(n);if(!r)return;const i=t._component;!R(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent="");const o=s(r,!1,Fl(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),o},t});function Fl(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Dl(e){return ne(e)?document.querySelector(e):e}const B=window,j={loadAllSettings:()=>B.loadAllSettings(),saveToggles:e=>B.saveToggles(JSON.stringify(e)),saveLayout:e=>B.saveLayout(e),saveZodiac:e=>B.saveZodiac(e),saveCity:e=>B.saveCity(e),saveWallpaperType:(e,t)=>B.saveWallpaperType(e,t),pickLocalImage:()=>B.pickLocalImage(),enableBing:()=>B.enableBing(),bingPrev:()=>B.bingPrev(),bingNext:()=>B.bingNext(),bingToggleFavorite:()=>B.bingToggleFavorite(),getBingInfo:()=>B.getBingInfo(),saveBingAutoRefresh:e=>B.saveBingAutoRefresh(e),getBingFavorites:()=>B.getBingFavorites(),bingSetByIdx:e=>B.bingSetByIdx(e),bingThumbDataURI:e=>B.bingThumbDataURI(e),bingToggleDislike:()=>B.bingToggleDislike(),getBingMarkets:()=>B.getBingMarkets(),saveBingMarkets:e=>B.saveBingMarkets(e),pickSolidColor:()=>B.pickSolidColor(),pickGradientColor:()=>B.pickGradientColor(),addSavedColor:(e,t,s)=>B.addSavedColor(e,t,s),removeSavedColor:e=>B.removeSavedColor(e),applySavedColor:e=>B.applySavedColor(e),saveWallpaperText:e=>B.saveWallpaperText(e),saveKnowledgeKeyword:e=>B.saveKnowledgeKeyword(e),saveKnowledgePrompt:e=>B.saveKnowledgePrompt(e),pickPhotoDir:()=>B.pickPhotoDir(),clearPhotoDir:()=>B.clearPhotoDir(),savePhotoInterval:e=>B.savePhotoInterval(e),resizeToFit:(e,t)=>e.resizeToFit(e,t),saveAudioVizStyle:e=>B.saveAudioVizStyle(e),saveAudioSensitivity:e=>B.saveAudioSensitivity(e),saveAudioSmoothing:e=>B.saveAudioSmoothing(e),saveAudioColorScheme:e=>B.saveAudioColorScheme(e)},jl={class:"switch"},Nl=["checked"],Vl=pt({__name:"ToggleSwitch",props:{modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e){return(t,s)=>(D(),N("label",jl,[g("input",{type:"checkbox",checked:e.modelValue,onChange:s[0]||(s[0]=n=>t.$emit("update:modelValue",n.target.checked))},null,40,Nl),s[1]||(s[1]=g("span",{class:"track"},[g("span",{class:"thumb"})],-1))]))}}),As=(e,t)=>{const s=e.__vccOpts||e;for(const[n,r]of t)s[n]=r;return s},ps=As(Vl,[["__scopeId","data-v-d838d577"]]),Bl={class:"mb-3"},Ll={class:"bg-[var(--card-bg)] border border-[var(--card-border)] rounded-lg"},Hl={class:"text-xs font-medium text-[var(--text-muted)]"},Kl={key:0,class:"text-[10px] text-[var(--text-weak)] mt-px"},Ul=pt({__name:"ToggleSection",props:{s:{}},setup(e){const t=e,s=[{key:"autoStart",label:"开机启动",desc:"系统启动时自动运行"},{key:"wallpaper",label:"显示壁纸"},{key:"time",label:"时间日期"},{key:"showSeconds",label:"显示秒",sub:!0},{key:"weather",label:"天气信息"},{key:"zodiacCard",label:"星座运势"},{key:"knowledgeCard",label:"知识卡片"},{key:"ainewsCard",label:"AI 资讯"}],n=s.map(r=>r.key);return ft(()=>n.map(r=>t.s[r]),()=>{const r={};for(const i of n)r[i]=t.s[i];j.saveToggles(r)}),(r,i)=>(D(),N("div",Bl,[i[0]||(i[0]=g("div",{class:"text-[10px] font-semibold text-[var(--text-weak)] uppercase tracking-[1.5px] mb-1 pl-0.5"},"显示控制",-1)),g("div",Ll,[(D(),N(se,null,Se(s,o=>g("div",{key:o.key,class:Le(["flex justify-between items-center px-3.5 py-2 border-t border-[var(--card-divider)] first:border-t-0",{"pl-8":o.sub}])},[g("div",null,[g("div",Hl,re(o.label),1),o.desc?(D(),N("div",Kl,re(o.desc),1)):ye("",!0)]),oe(ps,{modelValue:e.s[o.key],"onUpdate:modelValue":l=>e.s[o.key]=l},null,8,["modelValue","onUpdate:modelValue"])],2)),64))])]))}}),sr=new Map;function jt(e,t,s,n=500){clearTimeout(sr.get(e)),sr.set(e,setTimeout(()=>t(s),n))}const Wl={class:"mb-3"},zl={class:"bg-[var(--card-bg)] border border-[var(--card-border)] rounded-lg"},Jl={class:"flex justify-between items-center px-3.5 py-2"},Gl={class:"flex gap-1"},ql=["onClick"],Yl={key:0,class:"bg-[var(--card-bg)] border border-[var(--card-border)] rounded-lg mt-1.5"},Zl={class:"flex justify-between items-center px-3.5 py-2"},Xl=["value"],Ql={key:0,class:"flex justify-between items-center px-3.5 py-2 border-t border-[var(--card-divider)]"},ec={class:"flex justify-between items-center px-3.5 py-2 border-t border-[var(--card-divider)]"},tc={class:"flex flex-wrap gap-1 justify-end"},sc=["onClick"],nc={class:"flex justify-between items-center px-3.5 py-2 border-t border-[var(--card-divider)]"},rc={class:"flex gap-1"},ic=["onClick"],oc={class:"flex justify-between items-center px-3.5 py-2 border-t border-[var(--card-divider)]"},lc=["value"],cc={class:"flex justify-between items-center px-3.5 py-2 border-t border-[var(--card-divider)]"},ac=["value"],uc={key:1,class:"bg-[var(--card-bg)] border border-[var(--card-border)] rounded-lg mt-1.5"},fc={class:"flex justify-between items-center px-3.5 py-2"},dc={class:"text-[10px] text-[var(--text-weak)] truncate mr-2"},pc={key:2,class:"bg-[var(--card-bg)] border border-[var(--card-border)] rounded-lg mt-1.5"},hc={class:"flex justify-between items-center px-3.5 py-2"},gc={class:"flex items-center gap-2 min-w-0"},vc=["src"],mc={class:"min-w-0"},bc={class:"text-xs font-medium text-[var(--text-muted)] truncate"},xc={class:"text-[10px] text-[var(--text-weak)]"},yc={class:"flex gap-1 flex-shrink-0"},_c={class:"flex justify-between items-center px-3.5 py-2 border-t border-[var(--card-divider)]"},wc={class:"px-3.5 py-2 border-t border-[var(--card-divider)]"},Sc={class:"text-[10px] text-[var(--text-weak)]"},Cc={key:0,class:"flex flex-wrap gap-2 mt-2"},Tc=["checked","onChange"],Pc={key:0,class:"px-3.5 py-2 border-t border-[var(--card-divider)]"},Ac={class:"grid grid-cols-4 gap-1.5"},Oc=["onClick"],kc=["src"],Ec={key:3,class:"bg-[var(--card-bg)] border border-[var(--card-border)] rounded-lg mt-1.5"},Ic={class:"flex justify-between items-center px-3.5 py-2"},$c={class:"flex gap-1"},Mc={key:0,class:"flex justify-between items-center px-3.5 py-2 border-t border-[var(--card-divider)]"},Rc={class:"flex items-center gap-1.5"},Fc={key:4,class:"flex flex-wrap gap-1.5 mt-1.5 px-0.5"},Dc=["onClick","onContextmenu"],jc=pt({__name:"WallpaperSection",props:{s:{},currentColor:{}},emits:["set-wp-type","pick-solid","pick-gradient","save-color","apply-color","remove-color"],setup(e){const t=e,s=[{value:"theme",label:"主题"},{value:"image",label:"本地图片"},{value:"bing",label:"Bing"},{value:"color",label:"纯色/渐变"}],n=[{value:"bars",label:"柱状"},{value:"waveform",label:"波形"},{value:"circular",label:"环形"},{value:"particles",label:"粒子"},{value:"ripples",label:"涟漪"},{value:"text",label:"文字"},{value:"stars",label:"星空"},{value:"dna",label:"DNA"},{value:"matrix",label:"矩阵"},{value:"jellyfish",label:"水母"},{value:"aurora",label:"极光"}],r=[{value:"neon",label:"霓虹"},{value:"ocean",label:"海洋"},{value:"fire",label:"火焰"},{value:"rainbow",label:"彩虹"}],i=je({date:"",title:"",copyright:"",url:"",fav:!1,idx:0,total:0,hidden:!1,market:""}),o=je(""),l=je([]),a=je(!1),p=je([]),f=je([]);async function d(){const F=await j.getBingInfo(),C=JSON.parse(F);if(i.value=C,C.url){const P=C.url.replace("_1920x1080","_400x240");o.value=P!==C.url?P:await j.bingThumbDataURI(C.url.split("/").pop()||"")}}async function v(){const F=await j.getBingMarkets(),C=JSON.parse(F);f.value=C,p.value=[{code:"zh-CN",label:"中国"},{code:"en-US",label:"美国"},{code:"ja-JP",label:"日本"},{code:"de-DE",label:"德国"},{code:"fr-FR",label:"法国"},{code:"en-GB",label:"英国"},{code:"ko-KR",label:"韩国"},{code:"ru-RU",label:"俄罗斯"},{code:"pt-BR",label:"巴西"},{code:"es-ES",label:"西班牙"}]}function A(F){const C=f.value.indexOf(F);C>=0?f.value.splice(C,1):f.value.push(F),j.saveBingMarkets(JSON.stringify(f.value))}async function L(){i.value=JSON.parse(await j.bingNext())}async function M(){i.value=JSON.parse(await j.bingPrev())}async function ee(){i.value=JSON.parse(await j.bingToggleFavorite()),await W()}async function q(F){i.value=JSON.parse(await j.bingSetByIdx(F))}async function V(){i.value=JSON.parse(await j.bingToggleDislike())}async function W(){const F=await j.getBingFavorites(),C=JSON.parse(F);l.value=await Promise.all(C.map(async P=>({idx:P.idx,thumb:await j.bingThumbDataURI(P.filename)})))}ft(()=>t.s.bingAutoRefresh,F=>j.saveBingAutoRefresh(F)),ft(()=>t.s.wallpaperType,F=>{F==="bing"&&(d(),W(),v())},{immediate:!0});async function E(){const F=await j.pickLocalImage();F&&(t.s.imagePath=F)}function te(F,C,P){return{background:P&&C?`linear-gradient(135deg,${F},${C})`:F}}const ke=us(()=>t.currentColor.c1?te(t.currentColor.c1,t.currentColor.c2,t.currentColor.gradient):{});function we(F){return te(F.color1,F.color2,F.gradient)}return(F,C)=>(D(),N("div",Wl,[C[24]||(C[24]=g("div",{class:"text-[10px] font-semibold text-[var(--text-weak)] uppercase tracking-[1.5px] mb-1 pl-0.5"},"壁纸",-1)),g("div",zl,[g("div",Jl,[C[11]||(C[11]=g("div",{class:"text-xs font-medium text-[var(--text-muted)]"},"类型选择",-1)),g("div",Gl,[(D(),N(se,null,Se(s,P=>g("button",{key:P.value,onClick:pe=>F.$emit("set-wp-type",P.value),class:Le([e.s.wallpaperType===P.value?"bg-[var(--accent)] border-[var(--accent)] text-[var(--text-strong)]":"bg-[var(--input-bg)] border-[var(--input-border)] text-[var(--text)] hover:bg-[var(--card-border)]","border rounded-md text-[11px] py-1 px-2.5 font-[inherit] cursor-pointer whitespace-nowrap transition-colors"])},re(P.label),11,ql)),64))])])]),e.s.wallpaperType==="theme"?(D(),N("div",Yl,[g("div",Zl,[C[12]||(C[12]=g("div",{class:"text-xs font-medium text-[var(--text-muted)]"},"选择主题",-1)),ut(g("select",{"onUpdate:modelValue":C[0]||(C[0]=P=>e.s.theme=P),onChange:C[1]||(C[1]=P=>ae(j).saveWallpaperType("theme",e.s.theme)),class:"bg-[var(--input-bg)] border border-[var(--input-border)] rounded-md text-[var(--text)] text-[11px] py-0.5 px-1.5 outline-none min-w-[80px] max-w-[160px] focus:border-[var(--input-border-focus)]"},[(D(!0),N(se,null,Se(e.s.themes,P=>(D(),N("option",{key:P.value,value:P.value},re(P.label),9,Xl))),128))],544),[[Ps,e.s.theme]])]),e.s.theme==="text"?(D(),N("div",Ql,[C[13]||(C[13]=g("div",{class:"text-xs font-medium text-[var(--text-muted)]"},"自定义文字",-1)),ut(g("input",{type:"text","onUpdate:modelValue":C[2]||(C[2]=P=>e.s.wallpaperText=P),onInput:C[3]||(C[3]=P=>ae(jt)("wt",ae(j).saveWallpaperText,e.s.wallpaperText)),placeholder:"输入显示文字",class:"bg-[var(--input-bg)] border border-[var(--input-border)] rounded-md text-[var(--text)] text-[11px] py-1 px-2 outline-none w-[140px] focus:border-[var(--input-border-focus)]"},null,544),[[Zs,e.s.wallpaperText]])])):ye("",!0),e.s.theme==="audio-viz"?(D(),N(se,{key:1},[g("div",ec,[C[14]||(C[14]=g("div",{class:"text-xs font-medium text-[var(--text-muted)]"},"可视化样式",-1)),g("div",tc,[(D(),N(se,null,Se(n,P=>g("button",{key:P.value,onClick:pe=>{e.s.audioVizStyle=P.value,ae(j).saveAudioVizStyle(P.value)},class:Le([e.s.audioVizStyle===P.value?"bg-[var(--accent)] border-[var(--accent)] text-[var(--text-strong)]":"bg-[var(--input-bg)] border-[var(--input-border)] text-[var(--text)] hover:bg-[var(--card-border)]","border rounded-md text-[11px] py-0.5 px-2 font-[inherit] cursor-pointer transition-colors"])},re(P.label),11,sc)),64))])]),g("div",nc,[C[15]||(C[15]=g("div",{class:"text-xs font-medium text-[var(--text-muted)]"},"配色方案",-1)),g("div",rc,[(D(),N(se,null,Se(r,P=>g("button",{key:P.value,onClick:pe=>{e.s.audioColorScheme=P.value,ae(j).saveAudioColorScheme(P.value)},class:Le([e.s.audioColorScheme===P.value?"bg-[var(--accent)] border-[var(--accent)] text-[var(--text-strong)]":"bg-[var(--input-bg)] border-[var(--input-border)] text-[var(--text)] hover:bg-[var(--card-border)]","border rounded-md text-[11px] py-0.5 px-2 font-[inherit] cursor-pointer transition-colors"])},re(P.label),11,ic)),64))])]),g("div",oc,[C[16]||(C[16]=g("div",{class:"text-xs font-medium text-[var(--text-muted)]"},"灵敏度",-1)),g("input",{type:"range",min:"0.5",max:"3",step:"0.1",value:e.s.audioSensitivity,onInput:C[4]||(C[4]=P=>{e.s.audioSensitivity=+P.target.value,ae(jt)("as",ae(j).saveAudioSensitivity,e.s.audioSensitivity)}),class:"w-[100px]"},null,40,lc)]),g("div",cc,[C[17]||(C[17]=g("div",{class:"text-xs font-medium text-[var(--text-muted)]"},"平滑度",-1)),g("input",{type:"range",min:"0",max:"0.95",step:"0.05",value:e.s.audioSmoothing,onInput:C[5]||(C[5]=P=>{e.s.audioSmoothing=+P.target.value,ae(jt)("am",ae(j).saveAudioSmoothing,e.s.audioSmoothing)}),class:"w-[100px]"},null,40,ac)])],64)):ye("",!0)])):ye("",!0),e.s.wallpaperType==="image"?(D(),N("div",uc,[g("div",fc,[g("div",dc,re(e.s.imagePath||"未选择图片"),1),g("button",{class:"btn",onClick:E},"选择图片")])])):ye("",!0),e.s.wallpaperType==="bing"?(D(),N("div",pc,[g("div",hc,[g("div",gc,[i.value.url?(D(),N("img",{key:0,src:o.value,class:"w-16 h-10 object-cover rounded flex-shrink-0"},null,8,vc)):ye("",!0),g("div",mc,[g("div",bc,re(i.value.copyright||"Bing 每日壁纸"),1),g("div",xc,re(i.value.idx>0?`${i.value.idx} / ${i.value.total}`:""),1)])]),g("div",yc,[g("button",{class:"btn-sm",onClick:M},"◀"),g("button",{class:"btn-sm",onClick:L},"▶"),g("button",{class:"btn-sm",onClick:ee},re(i.value.fav?"★":"☆"),1),g("button",{class:"btn-sm",onClick:V},"👎")])]),g("div",_c,[C[18]||(C[18]=g("div",null,[g("div",{class:"text-xs font-medium text-[var(--text-muted)]"},"定时切换"),g("div",{class:"text-[10px] text-[var(--text-weak)] mt-px"},"每小时自动切换壁纸")],-1)),oe(ps,{modelValue:e.s.bingAutoRefresh,"onUpdate:modelValue":C[6]||(C[6]=P=>e.s.bingAutoRefresh=P)},null,8,["modelValue"])]),g("div",wc,[g("div",{class:"flex justify-between items-center cursor-pointer select-none",onClick:C[7]||(C[7]=P=>a.value=!a.value)},[C[19]||(C[19]=g("div",{class:"text-xs font-medium text-[var(--text-muted)]"},"壁纸来源地区",-1)),g("span",Sc,re(a.value?"收起":"展开")+" "+re(f.value.length)+"/"+re(p.value.length),1)]),a.value?(D(),N("div",Cc,[(D(!0),N(se,null,Se(p.value,P=>(D(),N("label",{key:P.code,class:"flex items-center gap-1.5 text-xs text-[var(--text)] cursor-pointer"},[g("input",{type:"checkbox",checked:f.value.includes(P.code),onChange:pe=>A(P.code),class:"accent-[var(--accent)]"},null,40,Tc),ri(" "+re(P.label),1)]))),128))])):ye("",!0)]),l.value.length?(D(),N("div",Pc,[C[20]||(C[20]=g("div",{class:"text-[10px] text-[var(--text-weak)] mb-1.5"},"收藏列表",-1)),g("div",Ac,[(D(!0),N(se,null,Se(l.value,(P,pe)=>(D(),N("div",{key:pe,class:"cursor-pointer rounded overflow-hidden hover:opacity-80",onClick:tt=>q(P.idx)},[g("img",{src:P.thumb,class:"w-full h-10 object-cover rounded"},null,8,kc)],8,Oc))),128))])])):ye("",!0)])):ye("",!0),e.s.wallpaperType==="color"?(D(),N("div",Ec,[g("div",Ic,[C[21]||(C[21]=g("div",{class:"text-xs font-medium text-[var(--text-muted)]"},"选择颜色",-1)),g("div",$c,[g("button",{class:"btn",onClick:C[8]||(C[8]=P=>F.$emit("pick-solid"))},"纯色"),g("button",{class:"btn",onClick:C[9]||(C[9]=P=>F.$emit("pick-gradient"))},"渐变")])]),e.currentColor.c1?(D(),N("div",Mc,[g("div",Rc,[g("span",{class:"inline-block w-6 h-4 rounded-sm border border-[var(--input-border)]",style:Nt(ke.value)},null,4),C[22]||(C[22]=g("span",{class:"text-[10px] text-[var(--text-weak)]"},"当前颜色",-1))]),g("button",{class:"btn",onClick:C[10]||(C[10]=P=>F.$emit("save-color"))},"收藏")])):ye("",!0)])):ye("",!0),e.s.savedColors.length&&e.s.wallpaperType==="color"?(D(),N("div",Fc,[(D(!0),N(se,null,Se(e.s.savedColors,(P,pe)=>(D(),N("div",{key:pe,class:"color-swatch",style:Nt(we(P)),onClick:tt=>F.$emit("apply-color",pe),onContextmenu:Xs(tt=>F.$emit("remove-color",pe),["prevent"])},[...C[23]||(C[23]=[g("span",{class:"del"},"×",-1)])],44,Dc))),128))])):ye("",!0)]))}}),Nc=As(jc,[["__scopeId","data-v-084bc698"]]),Vc={class:"mb-3"},Bc={class:"bg-[var(--card-bg)] border border-[var(--card-border)] rounded-lg"},Lc={class:"flex justify-between items-center px-3.5 py-2"},Hc=pt({__name:"LayoutSection",props:{s:{}},setup(e){return(t,s)=>(D(),N("div",Vc,[s[4]||(s[4]=g("div",{class:"text-[10px] font-semibold text-[var(--text-weak)] uppercase tracking-[1.5px] mb-1 pl-0.5"},"布局",-1)),g("div",Bc,[g("div",Lc,[s[3]||(s[3]=g("div",{class:"text-xs font-medium text-[var(--text-muted)]"},"信息布局",-1)),ut(g("select",{"onUpdate:modelValue":s[0]||(s[0]=n=>e.s.layout=n),onChange:s[1]||(s[1]=n=>ae(j).saveLayout(e.s.layout)),class:"bg-[var(--input-bg)] border border-[var(--input-border)] rounded-md text-[var(--text)] text-[11px] py-0.5 px-1.5 outline-none min-w-[80px] max-w-[160px] focus:border-[var(--input-border-focus)]"},[...s[2]||(s[2]=[g("option",{value:"single"},"合并卡片",-1),g("option",{value:"multi"},"独立卡片",-1)])],544),[[Ps,e.s.layout]])])])]))}}),Kc={class:"mb-3"},Uc={class:"bg-[var(--card-bg)] border border-[var(--card-border)] rounded-lg"},Wc={class:"flex justify-between items-center px-3.5 py-2"},zc={class:"flex justify-between items-center px-3.5 py-2 border-t border-[var(--card-divider)]"},Jc={class:"flex justify-between items-center px-3.5 py-2 border-t border-[var(--card-divider)]"},Gc={class:"text-[10px] text-[var(--text-weak)]"},qc={class:"flex gap-1"},Yc={class:"flex justify-between items-center px-3.5 py-2 border-t border-[var(--card-divider)]"},Zc=["value"],Xc=pt({__name:"PhotoSection",props:{s:{}},setup(e){const t=e;ft(()=>[t.s.photoCard,t.s.photoFrameMode],([r,i])=>{j.saveToggles({photoCard:r,photoFrameMode:i})});async function s(){const r=await j.pickPhotoDir();r&&(t.s.photoDir=r)}async function n(){await j.clearPhotoDir(),t.s.photoDir=""}return(r,i)=>(D(),N("div",Kc,[i[7]||(i[7]=g("div",{class:"text-[10px] font-semibold text-[var(--text-weak)] uppercase tracking-[1.5px] mb-1 pl-0.5"},"相册",-1)),g("div",Uc,[g("div",Wc,[i[4]||(i[4]=g("div",null,[g("div",{class:"text-xs font-medium text-[var(--text-muted)]"},"相册展示")],-1)),oe(ps,{modelValue:e.s.photoCard,"onUpdate:modelValue":i[0]||(i[0]=o=>e.s.photoCard=o)},null,8,["modelValue"])]),g("div",zc,[i[5]||(i[5]=g("div",null,[g("div",{class:"text-xs font-medium text-[var(--text-muted)]"},"电子相册模式"),g("div",{class:"text-[10px] text-[var(--text-weak)] mt-px"},"照片铺满整个壁纸")],-1)),oe(ps,{modelValue:e.s.photoFrameMode,"onUpdate:modelValue":i[1]||(i[1]=o=>e.s.photoFrameMode=o)},null,8,["modelValue"])]),g("div",Jc,[g("div",Gc,re(e.s.photoDir||"未选择目录"),1),g("div",qc,[g("button",{class:"btn",onClick:s},"选择目录"),e.s.photoDir?(D(),N("button",{key:0,class:"btn-sm",onClick:n},"清除")):ye("",!0)])]),g("div",Yc,[i[6]||(i[6]=g("div",{class:"text-xs font-medium text-[var(--text-muted)]"},"切换间隔",-1)),ut(g("select",{"onUpdate:modelValue":i[2]||(i[2]=o=>e.s.photoInterval=o),onChange:i[3]||(i[3]=o=>ae(j).savePhotoInterval(Number(e.s.photoInterval))),class:"bg-[var(--input-bg)] border border-[var(--input-border)] rounded-md text-[var(--text)] text-[11px] py-0.5 px-1.5 outline-none min-w-[80px] max-w-[160px] focus:border-[var(--input-border-focus)]"},[(D(),N(se,null,Se([5,10,15,20,30,60],o=>g("option",{key:o,value:o},re(o)+" 秒",9,Zc)),64))],544),[[Ps,e.s.photoInterval]])])])]))}}),Qc=As(Xc,[["__scopeId","data-v-bb86a692"]]),ea={class:"mb-3"},ta={class:"bg-[var(--card-bg)] border border-[var(--card-border)] rounded-lg"},sa={class:"flex justify-between items-center px-3.5 py-2"},na=["value"],ra={class:"flex justify-between items-center px-3.5 py-2 border-t border-[var(--card-divider)]"},ia={class:"flex justify-between items-center px-3.5 py-2 border-t border-[var(--card-divider)]"},oa={class:"flex justify-between items-center px-3.5 py-2 border-t border-[var(--card-divider)] relative"},la={class:"text-[var(--text)] text-[11px]"},ca={class:"city-panel"},aa={class:"city-col"},ua=["onClick"],fa={class:"city-col"},da=["onClick"],pa=pt({__name:"PersonalizeSection",props:{s:{}},setup(e){const t=e,s=["白羊座","金牛座","双子座","巨蟹座","狮子座","处女座","天秤座","天蝎座","射手座","摩羯座","水瓶座","双鱼座"],n=je(!1),r=je(""),i=je(""),o=us(()=>r.value?t.s.citiesByProv[r.value]||[]:[]),l=us(()=>r.value&&i.value?`${r.value} · ${i.value}`:"未选择");function a(f){t.s.city=f.id,i.value=f.name,n.value=!1,j.saveCity(f.id)}function p(f){const d=document.querySelector(".city-picker");d&&!d.contains(f.target)&&(n.value=!1)}return dn(()=>{document.addEventListener("click",p);const f=Object.entries(t.s.citiesByProv);for(const[d,v]of f){const A=v.find(L=>L.id===t.s.city);if(A){r.value=d,i.value=A.name;break}}}),pn(()=>document.removeEventListener("click",p)),(f,d)=>(D(),N("div",ea,[d[12]||(d[12]=g("div",{class:"text-[10px] font-semibold text-[var(--text-weak)] uppercase tracking-[1.5px] mb-1 pl-0.5"},"个性化",-1)),g("div",ta,[g("div",sa,[d[7]||(d[7]=g("div",{class:"text-xs font-medium text-[var(--text-muted)]"},"我的星座",-1)),ut(g("select",{"onUpdate:modelValue":d[0]||(d[0]=v=>e.s.zodiac=v),onChange:d[1]||(d[1]=v=>ae(j).saveZodiac(e.s.zodiac)),class:"bg-[var(--input-bg)] border border-[var(--input-border)] rounded-md text-[var(--text)] text-[11px] py-0.5 px-1.5 outline-none min-w-[80px] max-w-[160px] focus:border-[var(--input-border-focus)]"},[(D(),N(se,null,Se(s,v=>g("option",{key:v,value:v},re(v),9,na)),64))],544),[[Ps,e.s.zodiac]])]),g("div",ra,[d[8]||(d[8]=g("div",null,[g("div",{class:"text-xs font-medium text-[var(--text-muted)]"},"知识关键字"),g("div",{class:"text-[10px] text-[var(--text-weak)] mt-px"},"AI 将根据关键字生成知识小卡片")],-1)),ut(g("input",{type:"text","onUpdate:modelValue":d[2]||(d[2]=v=>e.s.knowledgeKeyword=v),onInput:d[3]||(d[3]=v=>ae(jt)("kw",ae(j).saveKnowledgeKeyword,e.s.knowledgeKeyword)),placeholder:"如: 历史、科学、冷知识",class:"bg-[var(--input-bg)] border border-[var(--input-border)] rounded-md text-[var(--text)] text-[11px] py-1 px-2 outline-none w-[140px] focus:border-[var(--input-border-focus)]"},null,544),[[Zs,e.s.knowledgeKeyword]])]),g("div",ia,[d[9]||(d[9]=g("div",null,[g("div",{class:"text-xs font-medium text-[var(--text-muted)]"},"知识提示词"),g("div",{class:"text-[10px] text-[var(--text-weak)] mt-px"},"补充风格或方向,系统会保证内容密度")],-1)),ut(g("input",{type:"text","onUpdate:modelValue":d[4]||(d[4]=v=>e.s.knowledgePrompt=v),onInput:d[5]||(d[5]=v=>ae(jt)("kp",ae(j).saveKnowledgePrompt,e.s.knowledgePrompt)),placeholder:"如: 偏实践、给出判断标准",class:"bg-[var(--input-bg)] border border-[var(--input-border)] rounded-md text-[var(--text)] text-[11px] py-1 px-2 outline-none w-[140px] focus:border-[var(--input-border-focus)]"},null,544),[[Zs,e.s.knowledgePrompt]])]),g("div",oa,[d[11]||(d[11]=g("div",{class:"text-xs font-medium text-[var(--text-muted)]"},"天气城市",-1)),g("div",{class:Le(["city-picker",{open:n.value}]),tabindex:"0",onClick:d[6]||(d[6]=v=>n.value=!n.value)},[g("span",la,re(l.value),1),d[10]||(d[10]=g("span",{class:"absolute right-1.5 top-1/2 -translate-y-1/2 text-[var(--text-weak)] text-[10px] pointer-events-none"},"▾",-1)),g("div",ca,[g("div",aa,[(D(!0),N(se,null,Se(e.s.provinces,v=>(D(),N("div",{key:v,class:Le({active:v===r.value}),onClick:Xs(A=>r.value=v,["stop"])},re(v),11,ua))),128))]),g("div",fa,[(D(!0),N(se,null,Se(o.value,v=>(D(),N("div",{key:v.id,class:Le({active:v.id===e.s.city}),onClick:Xs(A=>a(v),["stop"])},re(v.name),11,da))),128))])])],2)])])]))}}),ha=As(pa,[["__scopeId","data-v-1a50093a"]]),ga={class:"p-4 select-none overflow-y-auto"},va=pt({__name:"App",setup(e){const t=je(!1),s=Lt({lightTheme:!1,wallpaper:!0,time:!0,weather:!0,zodiacCard:!0,knowledgeCard:!0,layout:"single",zodiac:"射手座",city:"",provinces:[],citiesByProv:{},wallpaperType:"theme",theme:"",themes:[],color1:"",color2:"",colorGradient:!1,savedColors:[],bingAutoRefresh:!1,knowledgeKeyword:"",knowledgePrompt:"",wallpaperText:"",imagePath:"",showSeconds:!0,ainewsCard:!0,photoDir:"",photoInterval:15,photoCard:!0,photoFrameMode:!1,autoStart:!1,audioVizStyle:"bars",audioSensitivity:1.5,audioSmoothing:.7,audioColorScheme:"neon"});async function n(){const d=await j.loadAllSettings(),v=JSON.parse(d);v.lightTheme&&(document.documentElement.className="light"),Object.assign(s,{...v,citiesByProv:v.citiesByProv||{},provinces:v.provinces||[],themes:v.themes||[],savedColors:v.savedColors||[]}),v.color1&&(r.c1=v.color1,r.c2=v.color2||"",r.gradient=v.colorGradient||!1)}window.__refreshSettings=n;const r=Lt({c1:"",c2:"",gradient:!1});function i(d){const v=s.wallpaperType;s.wallpaperType=d,t.value&&(d==="theme"?j.saveWallpaperType("theme",s.theme):d==="bing"&&v!=="bing"&&j.enableBing())}async function o(){const d=await j.pickSolidColor();d&&(r.c1=d,r.c2="",r.gradient=!1)}async function l(){const d=await j.pickGradientColor();if(d){const v=d.split(",");r.c1=v[0],r.c2=v[1]||"",r.gradient=!0}}function a(){r.c1&&(j.addSavedColor(r.c1,r.c2,r.gradient),s.savedColors.push({color1:r.c1,color2:r.c2,gradient:r.gradient}))}function p(d){j.applySavedColor(d);const v=s.savedColors[d];r.c1=v.color1,r.c2=v.color2,r.gradient=v.gradient}async function f(d){await j.removeSavedColor(d),s.savedColors.splice(d,1)}return dn(async()=>{await n(),setTimeout(()=>{const d=document.documentElement;j.resizeToFit&&j.resizeToFit(d.scrollWidth,d.scrollHeight+8)},100),t.value=!0}),(d,v)=>(D(),N("div",ga,[v[0]||(v[0]=g("div",{class:"mb-3.5"},[g("h1",{class:"text-base font-semibold text-[var(--text-strong)]"},"桌面设置"),g("p",{class:"text-[11px] text-[var(--text-weak)] mt-0.5"},"壁纸 · 布局 · 信息显示")],-1)),oe(Ul,{s},null,8,["s"]),oe(Nc,{s,onSetWpType:i,"current-color":r,onPickSolid:o,onPickGradient:l,onSaveColor:a,onApplyColor:p,onRemoveColor:f},null,8,["s","current-color"]),oe(Hc,{s},null,8,["s"]),oe(Qc,{s},null,8,["s"]),oe(ha,{s},null,8,["s"]),v[1]||(v[1]=g("div",{class:"text-center text-[11px] text-[var(--footer-color)] mt-3 py-1.5 tracking-wide"},"u-desktop v1.0",-1))]))}});Rl(va).mount("#app");
-
+**/let Ys;const Ln=typeof window<"u"&&window.trustedTypes;if(Ln)try{Ys=Ln.createPolicy("vue",{createHTML:e=>e})}catch{}const li=Ys?e=>Ys.createHTML(e):e=>e,cl="http://www.w3.org/2000/svg",al="http://www.w3.org/1998/Math/MathML",We=typeof document<"u"?document:null,Hn=We&&We.createElement("template"),ul={insert:(e,t,s)=>{t.insertBefore(e,s||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,s,n)=>{const r=t==="svg"?We.createElementNS(cl,e):t==="mathml"?We.createElementNS(al,e):s?We.createElement(e,{is:s}):We.createElement(e);return e==="select"&&n&&n.multiple!=null&&r.setAttribute("multiple",n.multiple),r},createText:e=>We.createTextNode(e),createComment:e=>We.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>We.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,s,n,r,i){const o=s?s.previousSibling:t.lastChild;if(r&&(r===i||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),s),!(r===i||!(r=r.nextSibling)););else{Hn.innerHTML=li(n==="svg"?``:n==="mathml"?``:e);const l=Hn.content;if(n==="svg"||n==="mathml"){const a=l.firstChild;for(;a.firstChild;)l.appendChild(a.firstChild);l.removeChild(a)}t.insertBefore(l,s)}return[o?o.nextSibling:t.firstChild,s?s.previousSibling:t.lastChild]}},fl=Symbol("_vtc");function dl(e,t,s){const n=e[fl];n&&(t=(t?[t,...n]:[...n]).join(" ")),t==null?e.removeAttribute("class"):s?e.setAttribute("class",t):e.className=t}const Kn=Symbol("_vod"),pl=Symbol("_vsh"),hl=Symbol(""),gl=/(?:^|;)\s*display\s*:/;function vl(e,t,s){const n=e.style,r=ne(s);let i=!1;if(s&&!r){if(t)if(ne(t))for(const o of t.split(";")){const l=o.slice(0,o.indexOf(":")).trim();s[l]==null&&kt(n,l,"")}else for(const o in t)s[o]==null&&kt(n,o,"");for(const o in s){o==="display"&&(i=!0);const l=s[o];l!=null?bl(e,o,!ne(t)&&t?t[o]:void 0,l)||kt(n,o,l):kt(n,o,"")}}else if(r){if(t!==s){const o=n[hl];o&&(s+=";"+o),n.cssText=s,i=gl.test(s)}}else t&&e.removeAttribute("style");Kn in e&&(e[Kn]=i?n.display:"",e[pl]&&(n.display="none"))}const Un=/\s*!important$/;function kt(e,t,s){if($(s))s.forEach(n=>kt(e,t,n));else if(s==null&&(s=""),t.startsWith("--"))e.setProperty(t,s);else{const n=ml(e,t);Un.test(s)?e.setProperty(dt(n),s.replace(Un,""),"important"):e[n]=s}}const Wn=["Webkit","Moz","ms"],Ns={};function ml(e,t){const s=Ns[t];if(s)return s;let n=Pe(t);if(n!=="filter"&&n in e)return Ns[t]=n;n=lr(n);for(let r=0;rVs||(wl.then(()=>Vs=0),Vs=Date.now());function Cl(e,t){const s=n=>{if(!n._vts)n._vts=Date.now();else if(n._vts<=s.attached)return;Ke(Tl(n,s.value),t,5,[n])};return s.value=e,s.attached=Sl(),s}function Tl(e,t){if($(t)){const s=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{s.call(e),e._stopped=!0},t.map(n=>r=>!r._stopped&&n&&n(r))}else return t}const Zn=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Pl=(e,t,s,n,r,i)=>{const o=r==="svg";t==="class"?dl(e,n,o):t==="style"?vl(e,s,n):hs(t)?gs(t)||yl(e,t,s,n,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Al(e,t,n,o))?(Gn(e,t,n),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Jn(e,t,n,o,i,t!=="value")):e._isVueCE&&(Ol(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!ne(n)))?Gn(e,Pe(t),n,i,t):(t==="true-value"?e._trueValue=n:t==="false-value"&&(e._falseValue=n),Jn(e,t,n,o))};function Al(e,t,s,n){if(n)return!!(t==="innerHTML"||t==="textContent"||t in e&&Zn(t)&&R(s));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const r=e.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return Zn(t)&&ne(s)?!1:t in e}function Ol(e,t){const s=e._def.props;if(!s)return!1;const n=Pe(t);return Array.isArray(s)?s.some(r=>Pe(r)===n):Object.keys(s).some(r=>Pe(r)===n)}const fs=e=>{const t=e.props["onUpdate:modelValue"]||!1;return $(t)?s=>ts(t,s):t};function kl(e){e.target.composing=!0}function Xn(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const yt=Symbol("_assign");function Qn(e,t,s){return t&&(e=e.trim()),s&&(e=bs(e)),e}const Zs={created(e,{modifiers:{lazy:t,trim:s,number:n}},r){e[yt]=fs(r);const i=n||r.props&&r.props.type==="number";lt(e,t?"change":"input",o=>{o.target.composing||e[yt](Qn(e.value,s,i))}),(s||i)&<(e,"change",()=>{e.value=Qn(e.value,s,i)}),t||(lt(e,"compositionstart",kl),lt(e,"compositionend",Xn),lt(e,"change",Xn))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:s,modifiers:{lazy:n,trim:r,number:i}},o){if(e[yt]=fs(o),e.composing)return;const l=(i||e.type==="number")&&!/^0\d/.test(e.value)?bs(e.value):e.value,a=t??"";if(l===a)return;const p=e.getRootNode();(p instanceof Document||p instanceof ShadowRoot)&&p.activeElement===e&&e.type!=="range"&&(n&&t===s||r&&e.value.trim()===a)||(e.value=a)}},Ps={deep:!0,created(e,{value:t,modifiers:{number:s}},n){const r=vs(t);lt(e,"change",()=>{const i=Array.prototype.filter.call(e.options,o=>o.selected).map(o=>s?bs(ds(o)):ds(o));e[yt](e.multiple?r?new Set(i):i:i[0]),e._assigning=!0,Or(()=>{e._assigning=!1})}),e[yt]=fs(n)},mounted(e,{value:t}){er(e,t)},beforeUpdate(e,t,s){e[yt]=fs(s)},updated(e,{value:t}){e._assigning||er(e,t)}};function er(e,t){const s=e.multiple,n=$(t);if(!(s&&!n&&!vs(t))){for(let r=0,i=e.options.length;rString(p)===String(l)):o.selected=_i(t,l)>-1}else o.selected=t.has(l);else if(zt(ds(o),t)){e.selectedIndex!==r&&(e.selectedIndex=r);return}}!s&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function ds(e){return"_value"in e?e._value:e.value}const El=["ctrl","shift","alt","meta"],Il={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>El.some(s=>e[`${s}Key`]&&!t.includes(s))},Xs=(e,t)=>{if(!e)return e;const s=e._withMods||(e._withMods={}),n=t.join(".");return s[n]||(s[n]=((r,...i)=>{for(let o=0;o{const t=Ml().createApp(...e),{mount:s}=t;return t.mount=n=>{const r=Dl(n);if(!r)return;const i=t._component;!R(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent="");const o=s(r,!1,Fl(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),o},t});function Fl(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Dl(e){return ne(e)?document.querySelector(e):e}const B=window,j={loadAllSettings:()=>B.loadAllSettings(),saveToggles:e=>B.saveToggles(JSON.stringify(e)),saveLayout:e=>B.saveLayout(e),saveZodiac:e=>B.saveZodiac(e),saveCity:e=>B.saveCity(e),saveWallpaperType:(e,t)=>B.saveWallpaperType(e,t),pickLocalImage:()=>B.pickLocalImage(),enableBing:()=>B.enableBing(),bingPrev:()=>B.bingPrev(),bingNext:()=>B.bingNext(),bingToggleFavorite:()=>B.bingToggleFavorite(),getBingInfo:()=>B.getBingInfo(),saveBingAutoRefresh:e=>B.saveBingAutoRefresh(e),getBingFavorites:()=>B.getBingFavorites(),bingSetByIdx:e=>B.bingSetByIdx(e),bingThumbDataURI:e=>B.bingThumbDataURI(e),bingToggleDislike:()=>B.bingToggleDislike(),getBingMarkets:()=>B.getBingMarkets(),saveBingMarkets:e=>B.saveBingMarkets(e),pickSolidColor:()=>B.pickSolidColor(),pickGradientColor:()=>B.pickGradientColor(),addSavedColor:(e,t,s)=>B.addSavedColor(e,t,s),removeSavedColor:e=>B.removeSavedColor(e),applySavedColor:e=>B.applySavedColor(e),saveWallpaperText:e=>B.saveWallpaperText(e),saveKnowledgeKeyword:e=>B.saveKnowledgeKeyword(e),saveKnowledgePrompt:e=>B.saveKnowledgePrompt(e),pickPhotoDir:()=>B.pickPhotoDir(),clearPhotoDir:()=>B.clearPhotoDir(),savePhotoInterval:e=>B.savePhotoInterval(e),resizeToFit:(e,t)=>e.resizeToFit(e,t),saveAudioVizStyle:e=>B.saveAudioVizStyle(e),saveAudioSensitivity:e=>B.saveAudioSensitivity(e),saveAudioSmoothing:e=>B.saveAudioSmoothing(e),saveAudioColorScheme:e=>B.saveAudioColorScheme(e)},jl={class:"switch"},Nl=["checked"],Vl=pt({__name:"ToggleSwitch",props:{modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e){return(t,s)=>(D(),N("label",jl,[g("input",{type:"checkbox",checked:e.modelValue,onChange:s[0]||(s[0]=n=>t.$emit("update:modelValue",n.target.checked))},null,40,Nl),s[1]||(s[1]=g("span",{class:"track"},[g("span",{class:"thumb"})],-1))]))}}),As=(e,t)=>{const s=e.__vccOpts||e;for(const[n,r]of t)s[n]=r;return s},ps=As(Vl,[["__scopeId","data-v-d838d577"]]),Bl={class:"mb-3"},Ll={class:"bg-[var(--card-bg)] border border-[var(--card-border)] rounded-lg"},Hl={class:"text-xs font-medium text-[var(--text-muted)]"},Kl={key:0,class:"text-[10px] text-[var(--text-weak)] mt-px"},Ul=pt({__name:"ToggleSection",props:{s:{}},setup(e){const t=e,s=[{key:"autoStart",label:"开机启动",desc:"系统启动时自动运行"},{key:"wallpaper",label:"显示壁纸"},{key:"time",label:"时间日期"},{key:"showSeconds",label:"显示秒",sub:!0},{key:"weather",label:"天气信息"},{key:"zodiacCard",label:"星座运势"},{key:"knowledgeCard",label:"知识卡片"},{key:"ainewsCard",label:"AI 资讯"}],n=s.map(r=>r.key);return ft(()=>n.map(r=>t.s[r]),()=>{const r={};for(const i of n)r[i]=t.s[i];j.saveToggles(r)}),(r,i)=>(D(),N("div",Bl,[i[0]||(i[0]=g("div",{class:"text-[10px] font-semibold text-[var(--text-weak)] uppercase tracking-[1.5px] mb-1 pl-0.5"},"显示控制",-1)),g("div",Ll,[(D(),N(se,null,Se(s,o=>g("div",{key:o.key,class:Le(["flex justify-between items-center px-3.5 py-2 border-t border-[var(--card-divider)] first:border-t-0",{"pl-8":o.sub}])},[g("div",null,[g("div",Hl,re(o.label),1),o.desc?(D(),N("div",Kl,re(o.desc),1)):ye("",!0)]),oe(ps,{modelValue:e.s[o.key],"onUpdate:modelValue":l=>e.s[o.key]=l},null,8,["modelValue","onUpdate:modelValue"])],2)),64))])]))}}),sr=new Map;function jt(e,t,s,n=500){clearTimeout(sr.get(e)),sr.set(e,setTimeout(()=>t(s),n))}const Wl={class:"mb-3"},zl={class:"bg-[var(--card-bg)] border border-[var(--card-border)] rounded-lg"},Jl={class:"flex justify-between items-center px-3.5 py-2"},Gl={class:"flex gap-1"},ql=["onClick"],Yl={key:0,class:"bg-[var(--card-bg)] border border-[var(--card-border)] rounded-lg mt-1.5"},Zl={class:"flex justify-between items-center px-3.5 py-2"},Xl=["value"],Ql={key:0,class:"flex justify-between items-center px-3.5 py-2 border-t border-[var(--card-divider)]"},ec={class:"flex justify-between items-center px-3.5 py-2 border-t border-[var(--card-divider)]"},tc={class:"flex flex-wrap gap-1 justify-end"},sc=["onClick"],nc={class:"flex justify-between items-center px-3.5 py-2 border-t border-[var(--card-divider)]"},rc={class:"flex gap-1"},ic=["onClick"],oc={class:"flex justify-between items-center px-3.5 py-2 border-t border-[var(--card-divider)]"},lc=["value"],cc={class:"flex justify-between items-center px-3.5 py-2 border-t border-[var(--card-divider)]"},ac=["value"],uc={key:1,class:"bg-[var(--card-bg)] border border-[var(--card-border)] rounded-lg mt-1.5"},fc={class:"flex justify-between items-center px-3.5 py-2"},dc={class:"text-[10px] text-[var(--text-weak)] truncate mr-2"},pc={key:2,class:"bg-[var(--card-bg)] border border-[var(--card-border)] rounded-lg mt-1.5"},hc={class:"flex justify-between items-center px-3.5 py-2"},gc={class:"flex items-center gap-2 min-w-0"},vc=["src"],mc={class:"min-w-0"},bc={class:"text-xs font-medium text-[var(--text-muted)] truncate"},xc={class:"text-[10px] text-[var(--text-weak)]"},yc={class:"flex gap-1 flex-shrink-0"},_c={class:"flex justify-between items-center px-3.5 py-2 border-t border-[var(--card-divider)]"},wc={class:"px-3.5 py-2 border-t border-[var(--card-divider)]"},Sc={class:"text-[10px] text-[var(--text-weak)]"},Cc={key:0,class:"flex flex-wrap gap-2 mt-2"},Tc=["checked","onChange"],Pc={key:0,class:"px-3.5 py-2 border-t border-[var(--card-divider)]"},Ac={class:"grid grid-cols-4 gap-1.5"},Oc=["onClick"],kc=["src"],Ec={key:3,class:"bg-[var(--card-bg)] border border-[var(--card-border)] rounded-lg mt-1.5"},Ic={class:"flex justify-between items-center px-3.5 py-2"},$c={class:"flex gap-1"},Mc={key:0,class:"flex justify-between items-center px-3.5 py-2 border-t border-[var(--card-divider)]"},Rc={class:"flex items-center gap-1.5"},Fc={key:4,class:"flex flex-wrap gap-1.5 mt-1.5 px-0.5"},Dc=["onClick","onContextmenu"],jc=pt({__name:"WallpaperSection",props:{s:{},currentColor:{}},emits:["set-wp-type","pick-solid","pick-gradient","save-color","apply-color","remove-color"],setup(e){const t=e,s=[{value:"theme",label:"主题"},{value:"image",label:"本地图片"},{value:"bing",label:"Bing"},{value:"color",label:"纯色/渐变"}],n=[{value:"bars",label:"柱状"},{value:"waveform",label:"波形"},{value:"circular",label:"环形"},{value:"particles",label:"粒子"},{value:"ripples",label:"涟漪"},{value:"text",label:"文字"},{value:"stars",label:"星空"},{value:"dna",label:"DNA"},{value:"matrix",label:"矩阵"},{value:"jellyfish",label:"水母"},{value:"aurora",label:"极光"}],r=[{value:"neon",label:"霓虹"},{value:"ocean",label:"海洋"},{value:"fire",label:"火焰"},{value:"rainbow",label:"彩虹"}],i=je({date:"",title:"",copyright:"",url:"",fav:!1,idx:0,total:0,hidden:!1,market:""}),o=je(""),l=je([]),a=je(!1),p=je([]),f=je([]);async function d(){const F=await j.getBingInfo(),C=JSON.parse(F);if(i.value=C,C.url){const P=C.url.replace("_1920x1080","_400x240");o.value=P!==C.url?P:await j.bingThumbDataURI(C.url.split("/").pop()||"")}}async function v(){const F=await j.getBingMarkets(),C=JSON.parse(F);f.value=C,p.value=[{code:"zh-CN",label:"中国"},{code:"en-US",label:"美国"},{code:"ja-JP",label:"日本"},{code:"de-DE",label:"德国"},{code:"fr-FR",label:"法国"},{code:"en-GB",label:"英国"},{code:"ko-KR",label:"韩国"},{code:"ru-RU",label:"俄罗斯"},{code:"pt-BR",label:"巴西"},{code:"es-ES",label:"西班牙"}]}function A(F){const C=f.value.indexOf(F);C>=0?f.value.splice(C,1):f.value.push(F),j.saveBingMarkets(JSON.stringify(f.value))}async function L(){i.value=JSON.parse(await j.bingNext())}async function M(){i.value=JSON.parse(await j.bingPrev())}async function ee(){i.value=JSON.parse(await j.bingToggleFavorite()),await W()}async function q(F){i.value=JSON.parse(await j.bingSetByIdx(F))}async function V(){i.value=JSON.parse(await j.bingToggleDislike())}async function W(){const F=await j.getBingFavorites(),C=JSON.parse(F);l.value=await Promise.all(C.map(async P=>({idx:P.idx,thumb:await j.bingThumbDataURI(P.filename)})))}ft(()=>t.s.bingAutoRefresh,F=>j.saveBingAutoRefresh(F)),ft(()=>t.s.wallpaperType,F=>{F==="bing"&&(d(),W(),v())},{immediate:!0});async function E(){const F=await j.pickLocalImage();F&&(t.s.imagePath=F)}function te(F,C,P){return{background:P&&C?`linear-gradient(135deg,${F},${C})`:F}}const ke=us(()=>t.currentColor.c1?te(t.currentColor.c1,t.currentColor.c2,t.currentColor.gradient):{});function we(F){return te(F.color1,F.color2,F.gradient)}return(F,C)=>(D(),N("div",Wl,[C[24]||(C[24]=g("div",{class:"text-[10px] font-semibold text-[var(--text-weak)] uppercase tracking-[1.5px] mb-1 pl-0.5"},"壁纸",-1)),g("div",zl,[g("div",Jl,[C[11]||(C[11]=g("div",{class:"text-xs font-medium text-[var(--text-muted)]"},"类型选择",-1)),g("div",Gl,[(D(),N(se,null,Se(s,P=>g("button",{key:P.value,onClick:pe=>F.$emit("set-wp-type",P.value),class:Le([e.s.wallpaperType===P.value?"bg-[var(--accent)] border-[var(--accent)] text-[var(--text-strong)]":"bg-[var(--input-bg)] border-[var(--input-border)] text-[var(--text)] hover:bg-[var(--card-border)]","border rounded-md text-[11px] py-1 px-2.5 font-[inherit] cursor-pointer whitespace-nowrap transition-colors"])},re(P.label),11,ql)),64))])])]),e.s.wallpaperType==="theme"?(D(),N("div",Yl,[g("div",Zl,[C[12]||(C[12]=g("div",{class:"text-xs font-medium text-[var(--text-muted)]"},"选择主题",-1)),ut(g("select",{"onUpdate:modelValue":C[0]||(C[0]=P=>e.s.theme=P),onChange:C[1]||(C[1]=P=>ae(j).saveWallpaperType("theme",e.s.theme)),class:"bg-[var(--input-bg)] border border-[var(--input-border)] rounded-md text-[var(--text)] text-[11px] py-0.5 px-1.5 outline-none min-w-[80px] max-w-[160px] focus:border-[var(--input-border-focus)]"},[(D(!0),N(se,null,Se(e.s.themes,P=>(D(),N("option",{key:P.value,value:P.value},re(P.label),9,Xl))),128))],544),[[Ps,e.s.theme]])]),e.s.theme==="text"?(D(),N("div",Ql,[C[13]||(C[13]=g("div",{class:"text-xs font-medium text-[var(--text-muted)]"},"自定义文字",-1)),ut(g("input",{type:"text","onUpdate:modelValue":C[2]||(C[2]=P=>e.s.wallpaperText=P),onInput:C[3]||(C[3]=P=>ae(jt)("wt",ae(j).saveWallpaperText,e.s.wallpaperText)),placeholder:"输入显示文字",class:"bg-[var(--input-bg)] border border-[var(--input-border)] rounded-md text-[var(--text)] text-[11px] py-1 px-2 outline-none w-[140px] focus:border-[var(--input-border-focus)]"},null,544),[[Zs,e.s.wallpaperText]])])):ye("",!0),e.s.theme==="audio-viz"?(D(),N(se,{key:1},[g("div",ec,[C[14]||(C[14]=g("div",{class:"text-xs font-medium text-[var(--text-muted)]"},"可视化样式",-1)),g("div",tc,[(D(),N(se,null,Se(n,P=>g("button",{key:P.value,onClick:pe=>{e.s.audioVizStyle=P.value,ae(j).saveAudioVizStyle(P.value)},class:Le([e.s.audioVizStyle===P.value?"bg-[var(--accent)] border-[var(--accent)] text-[var(--text-strong)]":"bg-[var(--input-bg)] border-[var(--input-border)] text-[var(--text)] hover:bg-[var(--card-border)]","border rounded-md text-[11px] py-0.5 px-2 font-[inherit] cursor-pointer transition-colors"])},re(P.label),11,sc)),64))])]),g("div",nc,[C[15]||(C[15]=g("div",{class:"text-xs font-medium text-[var(--text-muted)]"},"配色方案",-1)),g("div",rc,[(D(),N(se,null,Se(r,P=>g("button",{key:P.value,onClick:pe=>{e.s.audioColorScheme=P.value,ae(j).saveAudioColorScheme(P.value)},class:Le([e.s.audioColorScheme===P.value?"bg-[var(--accent)] border-[var(--accent)] text-[var(--text-strong)]":"bg-[var(--input-bg)] border-[var(--input-border)] text-[var(--text)] hover:bg-[var(--card-border)]","border rounded-md text-[11px] py-0.5 px-2 font-[inherit] cursor-pointer transition-colors"])},re(P.label),11,ic)),64))])]),g("div",oc,[C[16]||(C[16]=g("div",{class:"text-xs font-medium text-[var(--text-muted)]"},"灵敏度",-1)),g("input",{type:"range",min:"0.5",max:"3",step:"0.1",value:e.s.audioSensitivity,onInput:C[4]||(C[4]=P=>{e.s.audioSensitivity=+P.target.value,ae(jt)("as",ae(j).saveAudioSensitivity,e.s.audioSensitivity)}),class:"w-[100px]"},null,40,lc)]),g("div",cc,[C[17]||(C[17]=g("div",{class:"text-xs font-medium text-[var(--text-muted)]"},"平滑度",-1)),g("input",{type:"range",min:"0",max:"0.95",step:"0.05",value:e.s.audioSmoothing,onInput:C[5]||(C[5]=P=>{e.s.audioSmoothing=+P.target.value,ae(jt)("am",ae(j).saveAudioSmoothing,e.s.audioSmoothing)}),class:"w-[100px]"},null,40,ac)])],64)):ye("",!0)])):ye("",!0),e.s.wallpaperType==="image"?(D(),N("div",uc,[g("div",fc,[g("div",dc,re(e.s.imagePath||"未选择图片"),1),g("button",{class:"btn",onClick:E},"选择图片")])])):ye("",!0),e.s.wallpaperType==="bing"?(D(),N("div",pc,[g("div",hc,[g("div",gc,[i.value.url?(D(),N("img",{key:0,src:o.value,class:"w-16 h-10 object-cover rounded flex-shrink-0"},null,8,vc)):ye("",!0),g("div",mc,[g("div",bc,re(i.value.copyright||"Bing 每日壁纸"),1),g("div",xc,re(i.value.total>0?`${i.value.idx+1} / ${i.value.total}`:""),1)])]),g("div",yc,[g("button",{class:"btn-sm",onClick:M},"◀"),g("button",{class:"btn-sm",onClick:L},"▶"),g("button",{class:"btn-sm",onClick:ee},re(i.value.fav?"★":"☆"),1),g("button",{class:"btn-sm",onClick:V},"👎")])]),g("div",_c,[C[18]||(C[18]=g("div",null,[g("div",{class:"text-xs font-medium text-[var(--text-muted)]"},"定时切换"),g("div",{class:"text-[10px] text-[var(--text-weak)] mt-px"},"每小时自动切换壁纸")],-1)),oe(ps,{modelValue:e.s.bingAutoRefresh,"onUpdate:modelValue":C[6]||(C[6]=P=>e.s.bingAutoRefresh=P)},null,8,["modelValue"])]),g("div",wc,[g("div",{class:"flex justify-between items-center cursor-pointer select-none",onClick:C[7]||(C[7]=P=>a.value=!a.value)},[C[19]||(C[19]=g("div",{class:"text-xs font-medium text-[var(--text-muted)]"},"壁纸来源地区",-1)),g("span",Sc,re(a.value?"收起":"展开")+" "+re(f.value.length)+"/"+re(p.value.length),1)]),a.value?(D(),N("div",Cc,[(D(!0),N(se,null,Se(p.value,P=>(D(),N("label",{key:P.code,class:"flex items-center gap-1.5 text-xs text-[var(--text)] cursor-pointer"},[g("input",{type:"checkbox",checked:f.value.includes(P.code),onChange:pe=>A(P.code),class:"accent-[var(--accent)]"},null,40,Tc),ri(" "+re(P.label),1)]))),128))])):ye("",!0)]),l.value.length?(D(),N("div",Pc,[C[20]||(C[20]=g("div",{class:"text-[10px] text-[var(--text-weak)] mb-1.5"},"收藏列表",-1)),g("div",Ac,[(D(!0),N(se,null,Se(l.value,(P,pe)=>(D(),N("div",{key:pe,class:"cursor-pointer rounded overflow-hidden hover:opacity-80",onClick:tt=>q(P.idx)},[g("img",{src:P.thumb,class:"w-full h-10 object-cover rounded"},null,8,kc)],8,Oc))),128))])])):ye("",!0)])):ye("",!0),e.s.wallpaperType==="color"?(D(),N("div",Ec,[g("div",Ic,[C[21]||(C[21]=g("div",{class:"text-xs font-medium text-[var(--text-muted)]"},"选择颜色",-1)),g("div",$c,[g("button",{class:"btn",onClick:C[8]||(C[8]=P=>F.$emit("pick-solid"))},"纯色"),g("button",{class:"btn",onClick:C[9]||(C[9]=P=>F.$emit("pick-gradient"))},"渐变")])]),e.currentColor.c1?(D(),N("div",Mc,[g("div",Rc,[g("span",{class:"inline-block w-6 h-4 rounded-sm border border-[var(--input-border)]",style:Nt(ke.value)},null,4),C[22]||(C[22]=g("span",{class:"text-[10px] text-[var(--text-weak)]"},"当前颜色",-1))]),g("button",{class:"btn",onClick:C[10]||(C[10]=P=>F.$emit("save-color"))},"收藏")])):ye("",!0)])):ye("",!0),e.s.savedColors.length&&e.s.wallpaperType==="color"?(D(),N("div",Fc,[(D(!0),N(se,null,Se(e.s.savedColors,(P,pe)=>(D(),N("div",{key:pe,class:"color-swatch",style:Nt(we(P)),onClick:tt=>F.$emit("apply-color",pe),onContextmenu:Xs(tt=>F.$emit("remove-color",pe),["prevent"])},[...C[23]||(C[23]=[g("span",{class:"del"},"×",-1)])],44,Dc))),128))])):ye("",!0)]))}}),Nc=As(jc,[["__scopeId","data-v-ca908ae8"]]),Vc={class:"mb-3"},Bc={class:"bg-[var(--card-bg)] border border-[var(--card-border)] rounded-lg"},Lc={class:"flex justify-between items-center px-3.5 py-2"},Hc=pt({__name:"LayoutSection",props:{s:{}},setup(e){return(t,s)=>(D(),N("div",Vc,[s[4]||(s[4]=g("div",{class:"text-[10px] font-semibold text-[var(--text-weak)] uppercase tracking-[1.5px] mb-1 pl-0.5"},"布局",-1)),g("div",Bc,[g("div",Lc,[s[3]||(s[3]=g("div",{class:"text-xs font-medium text-[var(--text-muted)]"},"信息布局",-1)),ut(g("select",{"onUpdate:modelValue":s[0]||(s[0]=n=>e.s.layout=n),onChange:s[1]||(s[1]=n=>ae(j).saveLayout(e.s.layout)),class:"bg-[var(--input-bg)] border border-[var(--input-border)] rounded-md text-[var(--text)] text-[11px] py-0.5 px-1.5 outline-none min-w-[80px] max-w-[160px] focus:border-[var(--input-border-focus)]"},[...s[2]||(s[2]=[g("option",{value:"single"},"合并卡片",-1),g("option",{value:"multi"},"独立卡片",-1)])],544),[[Ps,e.s.layout]])])])]))}}),Kc={class:"mb-3"},Uc={class:"bg-[var(--card-bg)] border border-[var(--card-border)] rounded-lg"},Wc={class:"flex justify-between items-center px-3.5 py-2"},zc={class:"flex justify-between items-center px-3.5 py-2 border-t border-[var(--card-divider)]"},Jc={class:"flex justify-between items-center px-3.5 py-2 border-t border-[var(--card-divider)]"},Gc={class:"text-[10px] text-[var(--text-weak)]"},qc={class:"flex gap-1"},Yc={class:"flex justify-between items-center px-3.5 py-2 border-t border-[var(--card-divider)]"},Zc=["value"],Xc=pt({__name:"PhotoSection",props:{s:{}},setup(e){const t=e;ft(()=>[t.s.photoCard,t.s.photoFrameMode],([r,i])=>{j.saveToggles({photoCard:r,photoFrameMode:i})});async function s(){const r=await j.pickPhotoDir();r&&(t.s.photoDir=r)}async function n(){await j.clearPhotoDir(),t.s.photoDir=""}return(r,i)=>(D(),N("div",Kc,[i[7]||(i[7]=g("div",{class:"text-[10px] font-semibold text-[var(--text-weak)] uppercase tracking-[1.5px] mb-1 pl-0.5"},"相册",-1)),g("div",Uc,[g("div",Wc,[i[4]||(i[4]=g("div",null,[g("div",{class:"text-xs font-medium text-[var(--text-muted)]"},"相册展示")],-1)),oe(ps,{modelValue:e.s.photoCard,"onUpdate:modelValue":i[0]||(i[0]=o=>e.s.photoCard=o)},null,8,["modelValue"])]),g("div",zc,[i[5]||(i[5]=g("div",null,[g("div",{class:"text-xs font-medium text-[var(--text-muted)]"},"电子相册模式"),g("div",{class:"text-[10px] text-[var(--text-weak)] mt-px"},"照片铺满整个壁纸")],-1)),oe(ps,{modelValue:e.s.photoFrameMode,"onUpdate:modelValue":i[1]||(i[1]=o=>e.s.photoFrameMode=o)},null,8,["modelValue"])]),g("div",Jc,[g("div",Gc,re(e.s.photoDir||"未选择目录"),1),g("div",qc,[g("button",{class:"btn",onClick:s},"选择目录"),e.s.photoDir?(D(),N("button",{key:0,class:"btn-sm",onClick:n},"清除")):ye("",!0)])]),g("div",Yc,[i[6]||(i[6]=g("div",{class:"text-xs font-medium text-[var(--text-muted)]"},"切换间隔",-1)),ut(g("select",{"onUpdate:modelValue":i[2]||(i[2]=o=>e.s.photoInterval=o),onChange:i[3]||(i[3]=o=>ae(j).savePhotoInterval(Number(e.s.photoInterval))),class:"bg-[var(--input-bg)] border border-[var(--input-border)] rounded-md text-[var(--text)] text-[11px] py-0.5 px-1.5 outline-none min-w-[80px] max-w-[160px] focus:border-[var(--input-border-focus)]"},[(D(),N(se,null,Se([5,10,15,20,30,60],o=>g("option",{key:o,value:o},re(o)+" 秒",9,Zc)),64))],544),[[Ps,e.s.photoInterval]])])])]))}}),Qc=As(Xc,[["__scopeId","data-v-bb86a692"]]),ea={class:"mb-3"},ta={class:"bg-[var(--card-bg)] border border-[var(--card-border)] rounded-lg"},sa={class:"flex justify-between items-center px-3.5 py-2"},na=["value"],ra={class:"flex justify-between items-center px-3.5 py-2 border-t border-[var(--card-divider)]"},ia={class:"flex justify-between items-center px-3.5 py-2 border-t border-[var(--card-divider)]"},oa={class:"flex justify-between items-center px-3.5 py-2 border-t border-[var(--card-divider)] relative"},la={class:"text-[var(--text)] text-[11px]"},ca={class:"city-panel"},aa={class:"city-col"},ua=["onClick"],fa={class:"city-col"},da=["onClick"],pa=pt({__name:"PersonalizeSection",props:{s:{}},setup(e){const t=e,s=["白羊座","金牛座","双子座","巨蟹座","狮子座","处女座","天秤座","天蝎座","射手座","摩羯座","水瓶座","双鱼座"],n=je(!1),r=je(""),i=je(""),o=us(()=>r.value?t.s.citiesByProv[r.value]||[]:[]),l=us(()=>r.value&&i.value?`${r.value} · ${i.value}`:"未选择");function a(f){t.s.city=f.id,i.value=f.name,n.value=!1,j.saveCity(f.id)}function p(f){const d=document.querySelector(".city-picker");d&&!d.contains(f.target)&&(n.value=!1)}return dn(()=>{document.addEventListener("click",p);const f=Object.entries(t.s.citiesByProv);for(const[d,v]of f){const A=v.find(L=>L.id===t.s.city);if(A){r.value=d,i.value=A.name;break}}}),pn(()=>document.removeEventListener("click",p)),(f,d)=>(D(),N("div",ea,[d[12]||(d[12]=g("div",{class:"text-[10px] font-semibold text-[var(--text-weak)] uppercase tracking-[1.5px] mb-1 pl-0.5"},"个性化",-1)),g("div",ta,[g("div",sa,[d[7]||(d[7]=g("div",{class:"text-xs font-medium text-[var(--text-muted)]"},"我的星座",-1)),ut(g("select",{"onUpdate:modelValue":d[0]||(d[0]=v=>e.s.zodiac=v),onChange:d[1]||(d[1]=v=>ae(j).saveZodiac(e.s.zodiac)),class:"bg-[var(--input-bg)] border border-[var(--input-border)] rounded-md text-[var(--text)] text-[11px] py-0.5 px-1.5 outline-none min-w-[80px] max-w-[160px] focus:border-[var(--input-border-focus)]"},[(D(),N(se,null,Se(s,v=>g("option",{key:v,value:v},re(v),9,na)),64))],544),[[Ps,e.s.zodiac]])]),g("div",ra,[d[8]||(d[8]=g("div",null,[g("div",{class:"text-xs font-medium text-[var(--text-muted)]"},"知识关键字"),g("div",{class:"text-[10px] text-[var(--text-weak)] mt-px"},"AI 将根据关键字生成知识小卡片")],-1)),ut(g("input",{type:"text","onUpdate:modelValue":d[2]||(d[2]=v=>e.s.knowledgeKeyword=v),onInput:d[3]||(d[3]=v=>ae(jt)("kw",ae(j).saveKnowledgeKeyword,e.s.knowledgeKeyword)),placeholder:"如: 历史、科学、冷知识",class:"bg-[var(--input-bg)] border border-[var(--input-border)] rounded-md text-[var(--text)] text-[11px] py-1 px-2 outline-none w-[140px] focus:border-[var(--input-border-focus)]"},null,544),[[Zs,e.s.knowledgeKeyword]])]),g("div",ia,[d[9]||(d[9]=g("div",null,[g("div",{class:"text-xs font-medium text-[var(--text-muted)]"},"知识提示词"),g("div",{class:"text-[10px] text-[var(--text-weak)] mt-px"},"补充风格或方向,系统会保证内容密度")],-1)),ut(g("input",{type:"text","onUpdate:modelValue":d[4]||(d[4]=v=>e.s.knowledgePrompt=v),onInput:d[5]||(d[5]=v=>ae(jt)("kp",ae(j).saveKnowledgePrompt,e.s.knowledgePrompt)),placeholder:"如: 偏实践、给出判断标准",class:"bg-[var(--input-bg)] border border-[var(--input-border)] rounded-md text-[var(--text)] text-[11px] py-1 px-2 outline-none w-[140px] focus:border-[var(--input-border-focus)]"},null,544),[[Zs,e.s.knowledgePrompt]])]),g("div",oa,[d[11]||(d[11]=g("div",{class:"text-xs font-medium text-[var(--text-muted)]"},"天气城市",-1)),g("div",{class:Le(["city-picker",{open:n.value}]),tabindex:"0",onClick:d[6]||(d[6]=v=>n.value=!n.value)},[g("span",la,re(l.value),1),d[10]||(d[10]=g("span",{class:"absolute right-1.5 top-1/2 -translate-y-1/2 text-[var(--text-weak)] text-[10px] pointer-events-none"},"▾",-1)),g("div",ca,[g("div",aa,[(D(!0),N(se,null,Se(e.s.provinces,v=>(D(),N("div",{key:v,class:Le({active:v===r.value}),onClick:Xs(A=>r.value=v,["stop"])},re(v),11,ua))),128))]),g("div",fa,[(D(!0),N(se,null,Se(o.value,v=>(D(),N("div",{key:v.id,class:Le({active:v.id===e.s.city}),onClick:Xs(A=>a(v),["stop"])},re(v.name),11,da))),128))])])],2)])])]))}}),ha=As(pa,[["__scopeId","data-v-1a50093a"]]),ga={class:"p-4 select-none overflow-y-auto"},va=pt({__name:"App",setup(e){const t=je(!1),s=Lt({lightTheme:!1,wallpaper:!0,time:!0,weather:!0,zodiacCard:!0,knowledgeCard:!0,layout:"single",zodiac:"射手座",city:"",provinces:[],citiesByProv:{},wallpaperType:"theme",theme:"",themes:[],color1:"",color2:"",colorGradient:!1,savedColors:[],bingAutoRefresh:!1,knowledgeKeyword:"",knowledgePrompt:"",wallpaperText:"",imagePath:"",showSeconds:!0,ainewsCard:!0,photoDir:"",photoInterval:15,photoCard:!0,photoFrameMode:!1,autoStart:!1,audioVizStyle:"bars",audioSensitivity:1.5,audioSmoothing:.7,audioColorScheme:"neon"});async function n(){const d=await j.loadAllSettings(),v=JSON.parse(d);v.lightTheme&&(document.documentElement.className="light"),Object.assign(s,{...v,citiesByProv:v.citiesByProv||{},provinces:v.provinces||[],themes:v.themes||[],savedColors:v.savedColors||[]}),v.color1&&(r.c1=v.color1,r.c2=v.color2||"",r.gradient=v.colorGradient||!1)}window.__refreshSettings=n;const r=Lt({c1:"",c2:"",gradient:!1});function i(d){const v=s.wallpaperType;s.wallpaperType=d,t.value&&(d==="theme"?j.saveWallpaperType("theme",s.theme):d==="bing"&&v!=="bing"&&j.enableBing())}async function o(){const d=await j.pickSolidColor();d&&(r.c1=d,r.c2="",r.gradient=!1)}async function l(){const d=await j.pickGradientColor();if(d){const v=d.split(",");r.c1=v[0],r.c2=v[1]||"",r.gradient=!0}}function a(){r.c1&&(j.addSavedColor(r.c1,r.c2,r.gradient),s.savedColors.push({color1:r.c1,color2:r.c2,gradient:r.gradient}))}function p(d){j.applySavedColor(d);const v=s.savedColors[d];r.c1=v.color1,r.c2=v.color2,r.gradient=v.gradient}async function f(d){await j.removeSavedColor(d),s.savedColors.splice(d,1)}return dn(async()=>{await n(),setTimeout(()=>{const d=document.documentElement;j.resizeToFit&&j.resizeToFit(d.scrollWidth,d.scrollHeight+8)},100),t.value=!0}),(d,v)=>(D(),N("div",ga,[v[0]||(v[0]=g("div",{class:"mb-3.5"},[g("h1",{class:"text-base font-semibold text-[var(--text-strong)]"},"桌面设置"),g("p",{class:"text-[11px] text-[var(--text-weak)] mt-0.5"},"壁纸 · 布局 · 信息显示")],-1)),oe(Ul,{s},null,8,["s"]),oe(Nc,{s,onSetWpType:i,"current-color":r,onPickSolid:o,onPickGradient:l,onSaveColor:a,onApplyColor:p,onRemoveColor:f},null,8,["s","current-color"]),oe(Hc,{s},null,8,["s"]),oe(Qc,{s},null,8,["s"]),oe(ha,{s},null,8,["s"]),v[1]||(v[1]=g("div",{class:"text-center text-[11px] text-[var(--footer-color)] mt-3 py-1.5 tracking-wide"},"u-desktop v1.0",-1))]))}});Rl(va).mount("#app");
+