dsh-timeband 1.3.10 → 1.3.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.js +1 -1
- package/package.json +2 -2
package/dist/client.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
window.__ModuleLoader__.load({id:"dsh-timeband",factory:function(require){var module={exports:{}};var exports=module.exports;
|
|
2
|
-
"use strict";var Y=Object.defineProperty;var ze=Object.getOwnPropertyDescriptor;var Be=Object.getOwnPropertyNames;var Fe=Object.prototype.hasOwnProperty;var Ke=(e,n)=>{for(var t in n)Y(e,t,{get:n[t],enumerable:!0})},qe=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let a of Be(n))!Fe.call(e,a)&&a!==t&&Y(e,a,{get:()=>n[a],enumerable:!(r=ze(n,a))||r.enumerable});return e};var Ve=e=>qe(Y({},"__esModule",{value:!0}),e);var vt={};Ke(vt,{apply:()=>yt,inject:()=>gt});module.exports=Ve(vt);function ce(){let e=Date.now(),n=new Set,t=()=>{e=Date.now();for(let r of n)r()};return{getSnapshot:()=>e,subscribe(r){return n.add(r),()=>{n.delete(r)}},start(){let r,a=()=>{clearInterval(r),r=void 0,t(),document.visibilityState!=="hidden"&&(r=setInterval(t,1e3))};return document.addEventListener("visibilitychange",a),window.addEventListener("focus",a),window.addEventListener("pageshow",a),a(),()=>{clearInterval(r),document.removeEventListener("visibilitychange",a),window.removeEventListener("focus",a),window.removeEventListener("pageshow",a)}}}}var ue={schemaVersion:1,years:[2026],verifiedOn:"2026-09-30",source:"https://www.lufengshi.gov.cn/swlfsjj/gkmlpt/content/1/1199/mpost_1199727.html",holidays:[["2026-01-01","2026-01-03"],["2026-02-15","2026-02-23"],["2026-04-04","2026-04-06"],["2026-05-01","2026-05-05"],["2026-06-19","2026-06-21"],["2026-09-25","2026-09-27"],["2026-10-01","2026-10-07"]]};var Ge="https://raw.githubusercontent.com/NateScarlet/holiday-cn/master/",F=64*1024;function pe(e){if(!Number.isInteger(e)||e<2e3||e>9998)throw new C("invalid");return`${Ge}${e}.json`}var C=class extends Error{kind;constructor(n){super(n),this.kind=n}};function M(e){if(typeof e!="string"||!/^\d{4}-\d{2}-\d{2}$/.test(e))return!1;let n=new Date(`${e}T00:00:00Z`);return Number.isFinite(n.getTime())&&n.toISOString().slice(0,10)===e}function O(e){try{if(new TextEncoder().encode(e).length>F)throw new Error;let n=JSON.parse(e);if(!n||typeof n!="object")throw new Error;let t=n;if(t.schemaVersion!==1||!Array.isArray(t.years)||!t.years.length||t.years.length>20)throw new Error;let r=t.years;if(r.some((s,i)=>!Number.isInteger(s)||s<2e3||s>9998||i>0&&s<=r[i-1]))throw new Error;if(!M(t.verifiedOn)||typeof t.source!="string")throw new Error;let a=new URL(t.source);if(a.protocol!=="https:"||a.username||a.password||!(a.hostname==="gov.cn"||a.hostname.endsWith(".gov.cn")))throw new Error;if(!Array.isArray(t.holidays)||t.holidays.length>400)throw new Error;let o=[];for(let s of t.holidays){if(!Array.isArray(s)||s.length!==2)throw new Error;let[i,m]=s;if(!M(i)||!M(m)||i>m||i.slice(0,4)!==m.slice(0,4)||!r.includes(Number(i.slice(0,4))))throw new Error;if(o.length&&i<=o.at(-1)[1])throw new Error;o.push([i,m])}if(r.some(s=>!o.some(([i])=>Number(i.slice(0,4))===s)))throw new Error;return{schemaVersion:1,years:[...r],verifiedOn:t.verifiedOn,source:a.href,holidays:o}}catch{throw new C("invalid")}}var D=O(JSON.stringify(ue));function K(e,n){let t=n.verifiedOn>=e.verifiedOn,r=[...new Set([...e.years,...n.years])].sort((o,s)=>o-s),a=r.flatMap(o=>(n.years.includes(o)&&(t||!e.years.includes(o))?n:e).holidays.filter(([i])=>Number(i.slice(0,4))===o));return{...t?n:e,years:r,holidays:a}}var G="dsh-timeband/calendar/v1";function me(e=()=>window.localStorage){let n=new Set,t=()=>{try{let s=e().getItem(G);return s===null?{data:D,issue:null}:{data:K(D,O(s)),issue:null}}catch(s){return{data:D,issue:s instanceof C?s.kind:"storage"}}},r={...t(),update:"idle"},a=s=>{r=s;for(let i of n)i()},o=()=>{let s=t();s.issue===r.issue&&JSON.stringify(s.data)===JSON.stringify(r.data)||a({...s,update:r.update})};return{getSnapshot:()=>r,subscribe(s){return n.add(s),()=>{n.delete(s)}},refresh:o,save(s){let i=K(K(r.data,t().data),O(JSON.stringify(s)));try{e().setItem(G,JSON.stringify(i))}catch{throw new C("storage")}a({data:i,issue:null,update:"idle"})},setUpdateStatus(s,i=r.issue){(r.update!==s||r.issue!==i)&&a({...r,update:s,issue:i})},start(){let s=i=>{(i.key===G||i.key===null)&&o()};return window.addEventListener("storage",s),window.addEventListener("focus",o),()=>{window.removeEventListener("storage",s),window.removeEventListener("focus",o)}}}}function fe(e){let n=[];for(let t of[...new Set(e)].sort()){let r=n.at(-1);r&&Date.parse(`${t}T00:00:00Z`)-Date.parse(`${r[1]}T00:00:00Z`)===864e5?r[1]=t:n.push([t,t])}return n}function be(e,n,t,r){try{let a=JSON.parse(e);if(!a||typeof a!="object")throw new Error;let o=a;if(o.year!==n||!Array.isArray(o.papers)||!Array.isArray(o.days))throw new Error;if(o.papers.length===0&&o.days.length===0)return null;if(!o.papers.length||o.papers.length>20||!o.days.length||o.days.length>400)throw new Error;for(let p of o.papers){if(typeof p!="string")throw new Error;let l=new URL(p);if(l.protocol!=="https:"||l.username||l.password||!(l.hostname==="gov.cn"||l.hostname.endsWith(".gov.cn")))throw new Error}let s=[],i=[],m=new Set;for(let p of o.days){if(!p||typeof p!="object")throw new Error;let l=p;if(!M(l.date)||typeof l.isOffDay!="boolean"||typeof l.name!="string"||!l.name.trim()||m.has(l.date))throw new Error;if(l.date<`${n-1}-12-01`||l.date>`${n}-12-31`)throw new Error;m.add(l.date),l.isOffDay&&(l.date.startsWith(`${n}-`)?s:i).push(l.date)}if(!s.length)throw new Error;let f=[n],c=fe(s);if(i.length&&r.years.includes(n-1)){let p=r.holidays.filter(([w])=>w.startsWith(`${n-1}-`)),l=[...i];for(let[w,g]of p)for(let v=Date.parse(`${w}T00:00:00Z`);v<=Date.parse(`${g}T00:00:00Z`);v+=864e5)l.push(new Date(v).toISOString().slice(0,10));f.unshift(n-1),c.unshift(...fe(l))}return O(JSON.stringify({schemaVersion:1,years:f,verifiedOn:t,source:o.papers[0],holidays:c}))}catch{throw new C("invalid")}}var he="https://api-docs.deepseek.com/quick_start/pricing/",T=36e5,j=24*T,Je=8*T,J=[0,9,12,14,18,24];function A(e,n=D){if(!Number.isFinite(e)||!Number.isFinite(new Date(e).getTime()))throw new RangeError("Invalid timestamp");let t=new Date(e+Je),r=t.toISOString().slice(0,10),a=Date.parse(`${r}T00:00:00+08:00`),o=n.holidays.some(([f,c])=>r>=f&&r<=c),s=t.getUTCDay()===0||t.getUTCDay()===6,i=n.years.includes(t.getUTCFullYear());return{key:r,midnight:a,kind:o?"holiday":s?"weekend":i?"weekday":"unverified",covered:i,hour:(e-a)/T}}function We(e,n=D){let{kind:t}=A(e,n);if(t==="holiday"||t==="weekend")return[{start:0,end:24,band:"offpeak"}];let r=t==="unverified"?"unknown":"peak";return[{start:0,end:9,band:"offpeak"},{start:9,end:12,band:r},{start:12,end:14,band:"offpeak"},{start:14,end:18,band:r},{start:18,end:24,band:"offpeak"}]}function W(e,n=D){let{hour:t,kind:r}=A(e,n);return r==="holiday"||r==="weekend"||t<9||t>=12&&t<14||t>=18?"offpeak":r==="unverified"?"unknown":"peak"}function Z(e,n=D){let t=W(e,n),{midnight:r}=A(e,n);for(let a=0;a<370;a++)for(let o of J){let s=r+a*j+o*T;if(s<=e)continue;let i=W(s,n);if(i!==t)return{at:s,band:i}}return null}function X(e,n=D){let t=A(e,n),r=Number(t.key.slice(0,4));if(!t.covered)return{expiresOn:null,notice:"uncovered"};for(;n.years.includes(r+1);)r++;let a=`${r}-12-31`,o=Date.parse(`${r+1}-01-01T00:00:00+08:00`);return{expiresOn:a,notice:o-t.midnight<=30*j?"expiresSoon":null}}function q(){let e,n=0,t=0,r;return(a,o=D)=>{if(!Number.isFinite(a))throw new RangeError("Invalid timestamp");if(r&&e===o&&a>=n&&a<t)return r;let{hour:s,...i}=A(a,o),m=i.kind==="holiday"||i.kind==="weekend",f=m?0:J.findLast(p=>p<=s),c=m?24:J.find(p=>p>s);return n=i.midnight+f*T,t=i.midnight+c*T,e=o,r={day:i,band:W(a,o),next:Z(a,o),segments:We(a,o),coverage:X(a,o)},r}}function ge(e){let n=Math.max(0,Math.ceil(e/1e3)),t=Math.floor(n/86400),r=Math.floor(n/3600)%24,a=Math.floor(n/60)%60,o=[];return t>0&&o.push({value:t,unit:"days"}),n>=3600&&o.push({value:r,unit:"hours"}),n>=60&&o.push({value:a,unit:"minutes"}),{major:o,seconds:n%60}}var ye="dsh-timeband/calendar-check/v1",ve=j,Ze=1e4;async function Xe(e){if(Number(e.headers.get("content-length"))>F||!e.body)throw new C("invalid");let n=e.body.getReader(),t=new TextDecoder("utf-8",{fatal:!0}),r=0,a="";try{for(;;){let{done:o,value:s}=await n.read();if(o)break;if(r+=s.byteLength,r>F)throw new C("invalid");a+=t.decode(s,{stream:!0})}return a+t.decode()}finally{n.releaseLock()}}function we(e){let n=e.now??(()=>Date.now()),t=e.fetch??((u,y)=>fetch(u,y)),r=e.getStorage??(()=>window.localStorage),a=e.synchronize??(u=>typeof navigator<"u"&&navigator.locks?navigator.locks.request("dsh-timeband-calendar-update",u):u()),o=!1,s=!1,i=0,m,f,c,p=0,l=e.store.getSnapshot().data,w=()=>{let u=e.store.getSnapshot().data,y=n(),k=A(y,u),E=X(y,u);return k.covered?E.notice==="expiresSoon"?Number(E.expiresOn.slice(0,4))+1:null:Number(k.key.slice(0,4))},g=()=>{try{let u=JSON.parse(r().getItem(ye)??"null");if(u&&Number.isInteger(u.year)&&Number.isFinite(u.at)&&(u.status==="waiting"||u.status==="failed"))return u}catch{}return c},v=u=>{c=u;try{r().setItem(ye,JSON.stringify(u))}catch{}},b=async(u=!1)=>{if(!o||s)return;s=!0;let y=i;try{await a(async()=>{if(!o||y!==i)return;e.store.refresh();let k=w();if(k===null){e.store.setUpdateStatus("idle");return}let E=g();if(E?.year===k&&n()>=E.at&&n()-E.at<ve&&!(u&&E.status==="failed")){p=Math.min(p,E.at+ve),e.store.setUpdateStatus(E.status);return}e.store.setUpdateStatus("checking");let R=new AbortController;m=R;let U=setTimeout(()=>R.abort(),Ze);f=U;let P="failed";try{let I=await t(pe(k),{signal:R.signal,credentials:"omit",referrerPolicy:"no-referrer",cache:"no-cache",redirect:"error"});if(!o||y!==i||R.signal.aborted)return;if(I.status===404)P="waiting";else{if(!I.ok)throw new Error("Calendar request failed");let N=be(await Xe(I),k,A(n()).key,e.store.getSnapshot().data);if(!o||y!==i||R.signal.aborted)return;if(N===null)P="waiting";else{e.store.save(N);return}}}catch(I){if(!o||y!==i)return;I instanceof C&&I.kind==="storage"&&e.store.setUpdateStatus("failed","storage")}finally{clearTimeout(U),R.abort(),m===R&&(m=void 0),f===U&&(f=void 0)}!o||y!==i||(v({year:k,at:n(),status:P}),e.store.setUpdateStatus(P))})}catch{if(o&&y===i){let k=w();k!==null&&v({year:k,at:n(),status:"failed"}),e.store.setUpdateStatus("failed")}}finally{y===i&&(s=!1)}},h=()=>{let u=n(),y=e.store.getSnapshot().data;(y!==l||u<p-T||u>=p)&&(l=y,p=Math.min(u+T,A(u,y).midnight+j),b())};return{start(){o=!0,i++,s=!1,p=0;let u=window,y=[e.clock.subscribe(h),e.store.subscribe(h)],k=()=>{p=n()+T,b(!0)};u.addEventListener("online",k);let E=setInterval(h,T);return h(),()=>{o=!1,i++,s=!1,m?.abort(),clearTimeout(f),f=void 0,clearInterval(E),y.forEach(R=>R()),u.removeEventListener("online",k),e.store.getSnapshot().update==="checking"&&e.store.setUpdateStatus("idle")}}}}var H="dsh-timeband/reminders/v1",Qe={read:()=>typeof Notification=="function"?Notification.permission:"unsupported",request:()=>Notification.requestPermission()};function xe(e=()=>window.localStorage,n=Qe){let t=new Set,r=()=>{try{if(e().getItem(H)!=="true")return{enabled:!1,busy:!1,issue:null};let i=n.read();return i==="granted"?{enabled:!0,busy:!1,issue:null}:{enabled:!1,busy:!1,issue:i==="unsupported"?"unsupported":"denied"}}catch{return{enabled:!1,busy:!1,issue:"storage"}}},a=r(),o=0,s=i=>{if(!(i.enabled===a.enabled&&i.busy===a.busy&&i.issue===a.issue)){a=i;for(let m of t)m()}};return{getSnapshot:()=>a,subscribe(i){return t.add(i),()=>{t.delete(i)}},async setEnabled(i){let m=++o;if(!i){s({enabled:!1,busy:!1,issue:null});try{e().removeItem(H)}catch{s({enabled:!1,busy:!1,issue:"storage"})}return}s({enabled:!1,busy:!0,issue:null});let f;try{f=n.read(),f==="default"&&(f=await n.request())}catch{m===o&&s({enabled:!1,busy:!1,issue:"denied"});return}if(m===o){if(f!=="granted"){s({enabled:!1,busy:!1,issue:f==="unsupported"?"unsupported":"denied"});return}try{e().setItem(H,"true"),s({enabled:!0,busy:!1,issue:null})}catch{m===o&&s({enabled:!1,busy:!1,issue:"storage"})}}},fail(i){o++;try{e().removeItem(H)}catch{i="storage"}s({enabled:!1,busy:!1,issue:i})},start(){let i=()=>{a.busy||s(r())},m=f=>{(f.key===H||f.key===null)&&(o++,s(r()))};return window.addEventListener("storage",m),window.addEventListener("focus",i),window.addEventListener("pageshow",i),()=>{o++,window.removeEventListener("storage",m),window.removeEventListener("focus",i),window.removeEventListener("pageshow",i)}}}}var Q=5*6e4,z="dsh-timeband/reminder-sent/v1",et="dsh-timeband/peak-reminder";function tt(e){return typeof navigator<"u"&&navigator.locks?navigator.locks.request(et,e):Promise.resolve().then(e)}function ke(e){let n=q(),t=e.now??Date.now,r=e.getStorage??(()=>window.localStorage),a=e.synchronize??tt,o,s=null,i,m=null,f=null,c=!1,p=0,l=()=>{clearTimeout(i),i=void 0,m=null},w=b=>{let h=e.calendarStore.getSnapshot().data,u=n(b,h);if(u!==o){o=u;let y=u.band==="unknown"?null:u.next;y?.band==="offpeak"&&(y=Z(y.at,h)),s=y?.band==="peak"?y.at:null}return s},g=(b,h)=>{m!==b&&(l(),m=b,i=setTimeout(()=>{i=void 0,m=null,v()},Math.max(1,Math.min(2147483647,b-h))))},v=()=>{if(!c||!e.reminderStore.getSnapshot().enabled){l(),f=null;return}let b=t(),h=w(b);if(h===null){l(),f=null;return}if(b<h-Q){f=null,g(h-Q,b);return}if(g(h,b),f===h)return;f=h;let u=p;a(()=>{if(!c||p!==u||!e.reminderStore.getSnapshot().enabled)return;let y=t();if(y<h-Q||y>=h||w(y)!==h)return;let k;try{if(k=r().getItem(z),k!==null&&Number.isSafeInteger(Number(k))&&Number(k)>=h)return;r().setItem(z,String(h))}catch{e.reminderStore.fail("storage");return}let E=()=>{if(c){try{r().getItem(z)===String(h)&&(k===null?r().removeItem(z):r().setItem(z,k))}catch{}e.reminderStore.fail("delivery")}};try{e.notify(h,()=>{a(E).catch(()=>{c&&e.reminderStore.fail("delivery")})})}catch{E()}}).catch(()=>{c&&p===u&&e.reminderStore.fail("delivery")})};return{start(){c=!0,f=null;let b=()=>{p++,f=null,v()},h=[e.clock.subscribe(v),e.calendarStore.subscribe(b),e.reminderStore.subscribe(b)];return v(),()=>{c=!1,p++,l(),h.forEach(u=>u())}}}}function Se(e=()=>new AudioContext){let n,t=!1,r=0,a,o,s=!1,i,m=()=>((!n||n.state==="closed")&&(n=e()),n),f=()=>{r++,a?.(),a=void 0,o?.(),o=void 0},c=(g=n)=>{if(!(!g||g!==n||o||g.state==="closed"))try{g.suspend().catch(()=>{})}catch{}},p=()=>{f(),c()},l=()=>{f();let g=n;n=void 0,s=!1,i=void 0;try{g&&g.state!=="closed"&&g.close().catch(()=>{})}catch{}},w=(g,v)=>new Promise(b=>{let h=!1,u=E=>{h||(h=!0,clearTimeout(k),a===y&&(a=void 0),b(E))},y=()=>u(!1),k=setTimeout(()=>u(!1),1e3);a=y;try{g.resume().then(()=>{let E=!t&&n===g&&v===r;if(h||!E){E&&!o&&c(g),u(!1);return}s=g.state==="running",u(s)},()=>u(!1))}catch{u(!1)}});return{prime(){if(t)return Promise.resolve(!1);if(s)return Promise.resolve(!0);if(i)return i;try{let g=m(),v=r,b=w(g,v).then(h=>(v===r&&c(g),i===b&&(i=void 0),h));return i=b,b}catch{return Promise.resolve(!1)}},async play(){if(t)return!1;f();let g=r;try{let v=m();if(!await w(v,g)||t||g!==r||v.state!=="running")return!1;let b=v.createOscillator(),h=v.createGain(),u=v.currentTime+.01;b.type="sine",b.frequency.setValueAtTime(880,u),b.frequency.setValueAtTime(660,u+.26),h.gain.setValueAtTime(0,u),h.gain.linearRampToValueAtTime(.075,u+.015),h.gain.exponentialRampToValueAtTime(1e-4,u+.24),h.gain.setValueAtTime(0,u+.25),h.gain.linearRampToValueAtTime(.065,u+.275),h.gain.exponentialRampToValueAtTime(1e-4,u+.53),h.gain.linearRampToValueAtTime(0,u+.55),b.connect(h),h.connect(v.destination);let y=()=>{b.onended=null;try{b.stop()}catch{}b.disconnect(),h.disconnect()};return o=y,b.onended=()=>{y(),g===r&&(o=void 0,c(v))},b.start(u),b.stop(u+.56),!0}catch{return g===r&&p(),!1}},stop:p,release:l,dispose(){t=!0,l()}}}var nt=5e3;function Ee(e=(t,r)=>new Notification(t,r),n=Se()){let t=new Set,r=null,a=0,o=!1,s,i,m=p=>{r=p;for(let l of t)l()},f=()=>{if(clearTimeout(i),i=void 0,!!s){s.onshow=s.onerror=s.onclose=s.onclick=null;try{s.close()}catch{}s=void 0}},c=()=>{f(),n.stop(),r&&m(null)};return{getSnapshot:()=>r,subscribe(p){return t.add(p),()=>{t.delete(p)}},primeSound:()=>n.prime(),releaseSound(){c(),n.release()},show(p,l,w){if(o)return;f();let g=++a;m({id:g,title:p,body:l,delivery:"pending",sound:"pending"}),n.play().then(b=>{!o&&r?.id===g&&m({...r,sound:b?"played":"unavailable"})});let v=b=>{o||r?.id!==g||m({...r,delivery:b})};try{s=e(`DSH TimeBand \xB7 ${p}`,{body:l,tag:w,silent:!0}),s.onshow=()=>{clearTimeout(i),i=void 0,v("accepted")},s.onerror=()=>{f(),v("unavailable")},s.onclose=()=>{f(),r?.id===g&&r.delivery==="pending"&&v("unconfirmed")},s.onclick=()=>{window.focus(),c()},i=setTimeout(()=>{i=void 0,v("unconfirmed")},nt)}catch{f(),v("unavailable")}},dismiss:c,dispose(){o=!0,c(),n.dispose()}}}var Re={name:"dsh-timeband",version:"1.3.10",description:"\u5934\u50CF\u65C1\u7684 DeepSeek \u5CF0\u8C37\u65F6\u6BB5\u4E0E\u4ECA\u65E5\u65F6\u95F4\u8F74",type:"module",license:"MIT",publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},repository:{type:"git",url:"git+https://github.com/a961282799-crypto/dsh-timeband.git"},homepage:"https://github.com/a961282799-crypto/dsh-timeband#readme",bugs:{url:"https://github.com/a961282799-crypto/dsh-timeband/issues"},main:"./dist/index.js",exports:{".":"./dist/index.js","./client":"./dist/client.js","./package.json":"./package.json"},files:["dist/index.js","dist/client.js","calendars","cordis.patch.yml","README.md","LICENSE"],keywords:["dsh-plugin","deepseek-harness","timeline"],engines:{node:">=22"},dsh:{bundle:{patch:"./cordis.patch.yml"},client:{platform:"web",inject:["@deepseek-ai/dsh-api-remotes","@deepseek-ai/dsh-client-ui-renderer","@deepseek-ai/dsh-client-ui-sidebar","@deepseek-ai/dsh-client-locale"]}},peerDependencies:{"@deepseek-ai/dsh":"0.2.2-rc.1"},peerDependenciesMeta:{"@deepseek-ai/dsh":{optional:!0}},scripts:{build:"node scripts/build.mjs",typecheck:"tsc --noEmit",test:"node --experimental-strip-types --test tests/*.test.ts tests/*.test.mjs","test:browser":"playwright test",preview:"node scripts/preview.mjs",screenshots:"node scripts/screenshots.mjs",compatibility:"node scripts/check-compatibility.mjs next",check:"npm run typecheck && npm run build && npm test && npm run test:browser",prepack:"npm run typecheck && npm run build"},devDependencies:{"@deepseek-ai/cordis":"4.1.0","@deepseek-ai/dsh-client-locale":"0.2.2-rc.1","@deepseek-ai/dsh-client-ui-renderer":"0.2.2-rc.1","@deepseek-ai/dsh-client-ui-sidebar":"0.2.2-rc.1","@deepseek-ai/dsh-client-ui-slots":"0.2.2-rc.1","@playwright/test":"1.63.0","@types/node":"^24.0.0","@types/react":"~18.3.1","@types/react-dom":"~18.3.0",esbuild:"0.28.2",react:"18.3.1","react-dom":"18.3.1",typescript:"7.0.2"}};var Ne=Re.name,De=Ne.replace(/^@/,"").replace("/","-"),at="https://api.github.com/repos/a961282799-crypto/dsh-timeband/releases/latest",Ce="https://github.com/a961282799-crypto/dsh-timeband/releases",it=1e4,Te=64*1024;function ee(e){return typeof e!="string"||!/^(0|[1-9]\d{0,5})\.(0|[1-9]\d{0,5})\.(0|[1-9]\d{0,5})$/.test(e)?null:e.split(".").map(Number)}function te(e,n){let t=ee(e),r=ee(n);if(!t||!r)return!1;for(let a=0;a<3;a++)if(t[a]!==r[a])return t[a]>r[a];return!1}function ot(e){if(!ee(e))return null;let n=`v${e}`;return{version:String(e),url:`${Ce}/tag/${n}`,download:`${Ce}/download/${n}/${De}-${e}.tgz`}}function st(e){if(!e||typeof e!="object")throw new Error("Invalid release");let n=e,t=ot(typeof n.tag_name=="string"?n.tag_name.slice(1):null);if(!t||n.tag_name!==`v${t.version}`||n.draft!==!1||n.prerelease!==!1||n.html_url!==t.url||!Array.isArray(n.assets)||!n.assets.some(r=>r?.name===`${De}-${t.version}.tgz`&&r.state==="uploaded"&&r.browser_download_url===t.download))throw new Error("Invalid release");return t}async function dt(e){if(!e.ok||Number(e.headers.get("content-length"))>Te)throw new Error("Release check failed");let n=await e.text();if(new TextEncoder().encode(n).length>Te)throw new Error("Release too large");return st(JSON.parse(n))}function Ie(e){let n=e.fetch??((c,p)=>fetch(c,p)),t=new Set,r={latest:null,check:"idle",install:"idle"},a=!0,o,s,i,m=c=>{r={...r,...c};for(let p of t)p()},f=async()=>{if(!a||o||i)return;let c=new AbortController;o=c,m({check:"checking"}),s=setTimeout(()=>c.abort(),it);try{let p=await n(at,{signal:c.signal,credentials:"omit",referrerPolicy:"no-referrer",cache:"no-cache",redirect:"error"}),l=await dt(p);if(!a)return;if(c.signal.aborted)throw new Error("Release check timed out");m({latest:l,check:"current"})}catch{a&&m({check:"failed"})}finally{clearTimeout(s),s=void 0,o=void 0,c.abort()}};return{version:e.version,getSnapshot:()=>r,subscribe(c){return t.add(c),()=>{t.delete(c)}},canInstall:()=>!!e.manager(),check:f,async install(){let c=r.latest,p=e.manager();if(!a||!c||!te(c.version,e.version)||!p||o||i||["restart","applied","unknown"].includes(r.install))return;let l=crypto.randomUUID();i={manager:p,id:l},m({install:"installing"});try{let w=await p.installBundle(c.download,{requestId:l});if(!w.ok){let v=await p.waitForInstall(l);if(!v.ok||v.value===null){a&&m({install:"unknown"});return}w={ok:!0,value:v.value}}if(!a)return;let g=w.value;g.application==="failed"?m({install:g.error?.code==="incompatible-version"?"incompatible":"failed"}):["restart-required","applied"].includes(g.application)&&g.bundle===Ne?m({install:g.application==="applied"?"applied":"restart"}):m({install:"unknown"})}catch{a&&m({install:"unknown"})}finally{i=void 0}},dispose(){a=!1,o?.abort(),clearTimeout(s),s=void 0,i&&(i.manager.cancelInstall(i.id).catch(()=>{}),i=void 0)}}}var Ae="1.3.10";var x=require("react"),ne=require("react-dom");var d=require("react/jsx-runtime"),ct=new Intl.DateTimeFormat("zh-CN",{timeZone:"Asia/Shanghai",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hourCycle:"h23"}),ut=new Intl.DateTimeFormat("en-GB",{timeZone:"Asia/Shanghai",hour:"2-digit",minute:"2-digit",hourCycle:"h23"}),pt={denied:"reminderDenied",unsupported:"reminderUnsupported",storage:"reminderStorageError",delivery:"reminderDeliveryError"},Pe={pending:"reminderSending",accepted:"reminderAccepted",unconfirmed:"reminderUnconfirmed",unavailable:"reminderFallback"},mt=(0,x.memo)(function({delivery:n,t}){let r=(0,x.useSyncExternalStore)(n.subscribe,n.getSnapshot),a=(0,x.useRef)(null);return(0,x.useEffect)(()=>{r?a.current?.showPopover():a.current?.hidePopover()},[r?.id]),r?(0,ne.createPortal)((0,d.jsx)("div",{ref:a,popover:"manual",className:"dtb-reminder-banner dtb-theme",role:"status","aria-live":"polite",children:r&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"dtb-header",children:[(0,d.jsx)("strong",{children:r.title}),(0,d.jsx)("button",{type:"button",className:"dtb-close","aria-label":t("dismissReminder"),onClick:n.dismiss,children:"\xD7"})]}),(0,d.jsx)("p",{children:r.body}),(0,d.jsx)("p",{className:"dtb-note dtb-delivery-status",children:t(Pe[r.delivery])}),r.sound==="unavailable"&&(0,d.jsx)("p",{className:"dtb-note dtb-sound-feedback",children:t("reminderSoundError")})]})}),document.body):null}),Ue=(0,x.memo)(function({segments:n,hour:t,small:r=!1}){return(0,d.jsxs)("div",{className:`dtb-track${r?" dtb-track-small":""}`,"aria-hidden":"true",children:[n.map(a=>(0,d.jsx)("span",{className:`dtb-segment dtb-${a.band}`,style:{left:`${a.start/24*100}%`,width:`${(a.end-a.start)/24*100}%`}},a.start)),(0,d.jsx)("span",{className:"dtb-cursor",style:{left:`${t/24*100}%`}})]})});function Le(e,n,t){let r=n===null?null:ge(n-e),a=r?.major.map(s=>`${s.value}${t(s.unit)}`).join("")??"",o=r?`${r.seconds}${t("seconds")}`:"\u2014";return{text:`${a}${o}`,view:(0,d.jsxs)("span",{className:"dtb-countdown",children:[(0,d.jsx)("span",{className:"dtb-count-main",children:a||o}),a&&(0,d.jsx)("small",{className:"dtb-count-seconds",children:o})]})}}function ft({useClock:e,t:n,until:t,nextLabel:r}){let a=e(i=>i),{text:o,view:s}=Le(a,t,n);return(0,d.jsxs)("div",{className:"dtb-next",children:[(0,d.jsx)("span",{children:n(r)}),(0,d.jsx)("strong",{"aria-label":`${n(r)} ${o}`,children:s})]})}function bt({wide:e,useClock:n,t,until:r,nextLabel:a,band:o,segments:s,hour:i,trigger:m,id:f,open:c}){let p=n(g=>e?g:Math.floor(g/6e4)*6e4),{text:l,view:w}=Le(p,r,t);return(0,d.jsxs)("button",{type:"button",className:"dtb-chip",ref:m,popovertarget:f,popovertargetaction:"toggle","aria-label":`${t("open")} \xB7 ${t(o)} \xB7 ${t(a)} ${l}`,"aria-expanded":c,"aria-haspopup":"dialog","aria-controls":f,title:`${t(o)} \xB7 ${t(a)} ${l}`,children:[(0,d.jsxs)("span",{className:"dtb-chip-top",children:[(0,d.jsx)("span",{className:`dtb-dot dtb-${o}`}),e&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:"dtb-chip-label",children:t(o)}),(0,d.jsx)("span",{className:"dtb-chip-count",children:w})]})]}),e?(0,d.jsx)(Ue,{segments:s,hour:i,small:!0}):(0,d.jsx)("svg",{viewBox:"0 0 24 24",className:"dtb-rail-icon","aria-hidden":"true",children:(0,d.jsx)("path",{d:"M3 17 8 7l5 10 4-7 4 7"})})]})}function $e({wide:e,useClock:n,t,calendarStore:r,reminderStore:a,reminderDelivery:o,testReminder:s,pluginUpdates:i}){let m=n(S=>Math.floor(S/6e4)*6e4),f=(0,x.useSyncExternalStore)(r.subscribe,r.getSnapshot),c=(0,x.useSyncExternalStore)(a.subscribe,a.getSnapshot),p=(0,x.useSyncExternalStore)(o.subscribe,o.getSnapshot),l=(0,x.useSyncExternalStore)(i.subscribe,i.getSnapshot),w=l.latest&&te(l.latest.version,i.version),g=l.install==="restart"?"updateRestart":l.install==="applied"?"updateApplied":l.install==="unknown"?"updateUnknown":l.install==="failed"?"updateFailed":l.install==="incompatible"?"updateIncompatible":null,v=(0,x.useMemo)(()=>q(),[]),{day:b,band:h,next:u,segments:y}=v(m,f.data),k=(m-b.midnight)/T,E=u!==null&&u.band!=="unknown"&&h!=="unknown",[R,U]=(0,x.useState)(!1),P=(0,x.useRef)(!1),I=(0,x.useRef)(null),N=(0,x.useRef)(null),L=(0,x.useRef)(null),re=(0,x.useRef)(null),B=(0,x.useId)(),ae=E?u.at:null,ie=E?u.band==="peak"?"nextPeak":"nextOffpeak":"nextUnknown",oe=(0,x.useMemo)(()=>E&&u?ct.format(u.at):"",[E,u]),se=ut.format(m),de=f.issue==="storage"?"calendarStorageError":f.update==="checking"?"calendarChecking":f.update==="waiting"?"calendarWaiting":f.update==="failed"?"calendarUpdateFailed":null;(0,x.useEffect)(()=>{let S=N.current;if(!S)return;let $=()=>{I.current&&(P.current=I.current.open)},_=()=>U(S.matches(":popover-open"));return S.addEventListener("beforetoggle",$),S.addEventListener("toggle",_),()=>{S.removeEventListener("beforetoggle",$),S.removeEventListener("toggle",_)}},[]),(0,x.useLayoutEffect)(()=>{if(!R)return;let S=()=>{if(!N.current||!L.current)return;let _=L.current.getBoundingClientRect(),V=N.current.getBoundingClientRect(),je=Math.max(12,Math.min(_.left,window.innerWidth-V.width-12)),He=Math.max(12,Math.min(_.top-V.height-12,window.innerHeight-V.height-12));N.current.style.left=`${je}px`,N.current.style.top=`${He}px`};S(),re.current?.focus({preventScroll:!0});let $=new ResizeObserver(S);return N.current&&$.observe(N.current),L.current&&$.observe(L.current),window.addEventListener("resize",S),window.addEventListener("scroll",S,!0),()=>{$.disconnect(),window.removeEventListener("resize",S),window.removeEventListener("scroll",S,!0)}},[R,e]);let le=()=>{N.current?.hidePopover(),U(!1),L.current?.focus({preventScroll:!0})};return(0,d.jsxs)("div",{className:"dtb-root dtb-theme","data-wide":e,"data-band":h,children:[(0,d.jsx)(mt,{delivery:o,t}),(0,d.jsx)(bt,{wide:e,useClock:n,t,until:ae,nextLabel:ie,band:h,segments:y,hour:k,trigger:L,id:B,open:R}),(0,ne.createPortal)((0,d.jsx)("div",{ref:N,id:B,popover:"auto",role:"dialog","aria-labelledby":`${B}-title`,className:"dtb-card dtb-theme","data-band":h,onKeyDown:S=>{S.key==="Escape"&&(S.preventDefault(),S.stopPropagation(),le())},children:R&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("header",{className:"dtb-header",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"dtb-eyebrow",children:"DEEPSEEK / TIMEBAND"}),(0,d.jsx)("h2",{id:`${B}-title`,children:t("title")})]}),(0,d.jsx)("button",{type:"button",className:"dtb-close",ref:re,"aria-label":t("close"),onClick:le,children:"\xD7"})]}),(0,d.jsxs)("div",{className:"dtb-status",children:[(0,d.jsx)("span",{className:`dtb-dot dtb-${h}`}),(0,d.jsx)("strong",{children:t(h)})]}),(0,d.jsx)(ft,{useClock:n,t,until:ae,nextLabel:ie}),(0,d.jsxs)("div",{className:"dtb-date",children:[(0,d.jsx)("span",{children:t("zone")}),(0,d.jsx)("span",{children:oe&&(0,d.jsxs)(d.Fragment,{children:[t("nextSwitch")," ",oe]})})]}),(0,d.jsxs)("div",{className:"dtb-axis",role:"img","aria-label":`${t("timeline")}\uFF1A${y.map(S=>`${S.start}:00\u2013${S.end}:00 ${t(S.band)}`).join("\uFF1B")}\u3002${t("now")} ${se}`,children:[(0,d.jsxs)("div",{className:"dtb-now",style:{left:`${Math.min(91,Math.max(9,k/24*100))}%`},children:[t("now")," ",se]}),(0,d.jsx)(Ue,{segments:y,hour:k}),(0,d.jsxs)("div",{className:"dtb-ticks",children:[(0,d.jsx)("span",{children:"00"}),(0,d.jsx)("span",{children:"06"}),(0,d.jsx)("span",{children:"12"}),(0,d.jsx)("span",{children:"18"}),(0,d.jsx)("span",{children:"24"})]})]}),(0,d.jsxs)("div",{className:"dtb-day-kind",children:[b.key," ",(0,d.jsx)("span",{children:"\xB7"})," ",t(b.kind)]}),y.length>1&&(0,d.jsxs)("div",{className:"dtb-periods",children:[(0,d.jsxs)("div",{children:[(0,d.jsxs)("span",{children:[(0,d.jsx)("i",{className:`dtb-dot dtb-${b.covered?"peak":"unknown"}`}),t(b.covered?"peak":"unknown")]}),(0,d.jsx)("b",{children:"09:00\u201312:00 \xB7 14:00\u201318:00"})]}),(0,d.jsxs)("div",{children:[(0,d.jsxs)("span",{children:[(0,d.jsx)("i",{className:"dtb-dot dtb-offpeak"}),t("offpeak")]}),(0,d.jsx)("b",{children:t("rest")})]})]}),!b.covered&&(0,d.jsx)("p",{className:"dtb-note",children:t("unknownNote")}),de&&(0,d.jsx)("p",{className:"dtb-note dtb-calendar-notice",role:"status",children:t(de)}),(0,d.jsxs)("details",{className:"dtb-details",ref:I,open:P.current,children:[(0,d.jsx)("summary",{children:t("details")}),(0,d.jsx)("p",{className:"dtb-note",children:t("note")}),(0,d.jsxs)("div",{className:"dtb-reminder-settings",children:[(0,d.jsxs)("label",{className:"dtb-reminder-toggle",children:[(0,d.jsx)("span",{children:t("reminder")}),(0,d.jsx)("input",{type:"checkbox",role:"switch",checked:c.enabled,disabled:c.busy,onChange:S=>{S.currentTarget.checked&&o.primeSound(),a.setEnabled(S.currentTarget.checked)}})]}),c.enabled&&(0,d.jsx)("button",{type:"button",className:"dtb-button",onClick:s,children:t("reminderTest")}),(0,d.jsx)("p",{className:"dtb-note",children:t("reminderHint")}),p&&(0,d.jsx)("p",{className:"dtb-note dtb-test-feedback",role:"status",children:t(Pe[p.delivery])}),p?.sound==="unavailable"&&(0,d.jsx)("p",{className:"dtb-note dtb-sound-feedback",role:"status",children:t("reminderSoundError")}),c.issue&&(0,d.jsx)("p",{className:"dtb-note dtb-reminder-feedback",role:"status",children:t(pt[c.issue])})]}),(0,d.jsxs)("div",{className:"dtb-version-row",children:[(0,d.jsxs)("span",{children:["v",i.version]}),(0,d.jsx)("button",{type:"button",className:"dtb-button",disabled:l.check==="checking"||l.install==="installing",onClick:()=>{i.check()},children:t(l.check==="checking"?"updateChecking":"updateCheck")})]}),w&&(0,d.jsxs)("div",{className:"dtb-update-notice",role:"status",children:[(0,d.jsxs)("span",{children:[t("updateAvailable")," ",(0,d.jsxs)("b",{children:["v",l.latest.version]})]}),i.canInstall()?(0,d.jsx)("button",{type:"button",className:"dtb-button",disabled:l.check==="checking"||["installing","restart","applied","unknown"].includes(l.install),onClick:()=>{i.install()},children:t(l.install==="installing"?"updateInstalling":"updateInstall")}):(0,d.jsxs)("a",{href:l.latest.download,target:"_blank",rel:"noreferrer",children:[t("updateDownload")," \u2197"]}),(0,d.jsxs)("a",{href:l.latest.url,target:"_blank",rel:"noreferrer",children:[t("updateNotes")," \u2197"]}),g&&(0,d.jsx)("p",{className:"dtb-note",children:t(g)})]}),l.check==="failed"&&(0,d.jsx)("p",{className:"dtb-note",children:t("updateCheckFailed")}),l.check==="current"&&!w&&(0,d.jsx)("p",{className:"dtb-note",children:t("updateCurrent")}),(0,d.jsxs)("footer",{className:"dtb-footer",children:[(0,d.jsxs)("a",{href:f.data.source,target:"_blank",rel:"noreferrer",children:[t("calendarSource")," \u2197"]}),(0,d.jsxs)("a",{href:he,target:"_blank",rel:"noreferrer",children:[t("rule")," \u2197"]})]})]})]})}),document.body)]})}var Oe={title:"\u4ECA\u65E5\u65F6\u6BB5",zone:"\u5317\u4EAC\u65F6\u95F4 \xB7 UTC+8",peak:"\u5CF0\u65F6\u6BB5",offpeak:"\u8C37\u65F6\u6BB5",unknown:"\u5F85\u6838\u5B9E",nextPeak:"\u8DDD\u79BB\u5CF0\u65F6\u6BB5",nextOffpeak:"\u8DDD\u79BB\u8C37\u65F6\u6BB5",nextUnknown:"\u540E\u7EED\u65E5\u5386\u5F85\u66F4\u65B0",weekday:"\u5468\u4E00\u81F3\u5468\u4E94",weekend:"\u5468\u672B \xB7 \u5168\u5929\u8C37\u65F6\u6BB5",holiday:"\u516C\u5171\u5047\u671F \xB7 \u5168\u5929\u8C37\u65F6\u6BB5",unverified:"\u672C\u5E74\u5EA6\u8282\u5047\u65E5\u65E5\u5386\u5F85\u66F4\u65B0",allDay:"\u5168\u5929",rest:"\u5176\u4F59\u65F6\u6BB5",now:"\u73B0\u5728",nextSwitch:"\u4E0B\u6B21\u5207\u6362\uFF1A",close:"\u5173\u95ED\u65F6\u95F4\u8F74",open:"\u67E5\u770B\u5CF0\u8C37\u65F6\u95F4\u8F74",rule:"DeepSeek \u5B98\u65B9\u65F6\u6BB5\u89C4\u5219",details:"\u89C4\u5219\u4E0E\u63D0\u9192",note:"\u5468\u672B\uFF08\u542B\u8C03\u4F11\u4E0A\u73ED\u65E5\uFF09\u53CA\u516C\u5171\u5047\u671F\u5168\u5929\u4E3A\u8C37\u65F6\u6BB5\u3002",reminder:"\u5CF0\u65F6\u6BB5\u524D 5 \u5206\u949F\u63D0\u9192",reminderHint:"\u9ED8\u8BA4\u5173\u95ED\u3002\u5F00\u542F\u65F6\u7533\u8BF7\u901A\u77E5\u6388\u6743\uFF1B\u5E94\u7528\u8FD0\u884C\u65F6\u63D0\u9192\uFF0C\u5E76\u64AD\u653E\u8F7B\u67D4\u63D0\u793A\u97F3\u3002",reminderSoundError:"\u63D0\u793A\u97F3\u672A\u80FD\u64AD\u653E\uFF0C\u53EF\u70B9\u51FB\u300C\u6D4B\u8BD5\u63D0\u9192\u300D\u91CD\u8BD5\u3002",reminderDenied:"\u672A\u83B7\u5F97\u901A\u77E5\u6388\u6743\uFF0C\u8BF7\u5141\u8BB8\u6B64\u5E94\u7528\u7684\u901A\u77E5\u540E\u518D\u5F00\u542F\u3002",reminderUnsupported:"\u5F53\u524D\u73AF\u5883\u4E0D\u652F\u6301\u7CFB\u7EDF\u901A\u77E5\u3002",reminderStorageError:"\u63D0\u9192\u8BBE\u7F6E\u65E0\u6CD5\u4FDD\u5B58\uFF0C\u8BF7\u68C0\u67E5\u672C\u5730\u5B58\u50A8\u6743\u9650\u3002",reminderDeliveryError:"\u63D0\u9192\u53D1\u9001\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u7CFB\u7EDF\u901A\u77E5\u8BBE\u7F6E\u540E\u91CD\u65B0\u5F00\u542F\u3002",reminderTitle:"\u5373\u5C06\u8FDB\u5165\u5CF0\u65F6\u6BB5",reminderBody:"\u5317\u4EAC\u65F6\u95F4 {time} \u5F00\u59CB\u5CF0\u65F6\u6BB5\u3002",reminderTest:"\u6D4B\u8BD5\u63D0\u9192",reminderTestTitle:"\u6D4B\u8BD5\u63D0\u9192",reminderTestBody:"\u8FD9\u662F\u4E00\u6761\u6D4B\u8BD5\u63D0\u9192\u3002\u6B63\u5F0F\u63D0\u9192\u4F1A\u5728\u5CF0\u65F6\u6BB5\u5F00\u59CB\u524D 5 \u5206\u949F\u53D1\u51FA\u3002",reminderSending:"\u5E94\u7528\u5185\u63D0\u9192\u5DF2\u663E\u793A\uFF0C\u6B63\u5728\u53D1\u9001\u7CFB\u7EDF\u901A\u77E5\u2026",reminderAccepted:"\u7CFB\u7EDF\u5DF2\u63A5\u6536\u901A\u77E5\u3002\u6CA1\u6709\u6A2A\u5E45\u65F6\uFF0C\u53EF\u67E5\u770B\u901A\u77E5\u4E2D\u5FC3\u6216\u68C0\u67E5\u52FF\u6270\u6A21\u5F0F\u3002",reminderUnconfirmed:"\u7CFB\u7EDF\u672A\u786E\u8BA4\u901A\u77E5\u663E\u793A\uFF0C\u5E94\u7528\u5185\u63D0\u9192\u5DF2\u4FDD\u7559\u3002",reminderFallback:"\u7CFB\u7EDF\u901A\u77E5\u53D1\u9001\u5931\u8D25\uFF0C\u5E94\u7528\u5185\u63D0\u9192\u5DF2\u4FDD\u7559\u3002\u8BF7\u68C0\u67E5\u7CFB\u7EDF\u901A\u77E5\u8BBE\u7F6E\u3002",dismissReminder:"\u5173\u95ED\u63D0\u9192",updateAvailable:"\u6709\u65B0\u7248\u672C",updateCheck:"\u68C0\u67E5\u66F4\u65B0",updateChecking:"\u6B63\u5728\u68C0\u67E5\u2026",updateInstall:"\u66F4\u65B0",updateInstalling:"\u6B63\u5728\u66F4\u65B0\u2026",updateDownload:"\u4E0B\u8F7D\u65B0\u7248",updateNotes:"\u66F4\u65B0\u8BF4\u660E",updateRestart:"\u65B0\u7248\u5DF2\u5B89\u88C5\uFF0C\u5B8C\u5168\u9000\u51FA\u5E76\u91CD\u65B0\u6253\u5F00 Harness \u540E\u751F\u6548\u3002",updateApplied:"Harness \u5DF2\u786E\u8BA4\u5E94\u7528\u66F4\u65B0\u3002",updateUnknown:"\u66F4\u65B0\u7ED3\u679C\u5C1A\u672A\u786E\u8BA4\uFF0C\u8BF7\u5728 Harness\u300C\u63D2\u4EF6\u300D\u9875\u9762\u6838\u5BF9\u540E\u91CD\u542F\u3002",updateFailed:"\u66F4\u65B0\u672A\u6210\u529F\uFF0C\u5F53\u524D\u7248\u672C\u7EE7\u7EED\u4F7F\u7528\u3002\u53EF\u7A0D\u540E\u91CD\u8BD5\u6216\u4ECE\u53D1\u5E03\u9875\u4E0B\u8F7D\u3002",updateIncompatible:"\u65B0\u7248\u4E0E\u5F53\u524D Harness \u4E0D\u517C\u5BB9\uFF0C\u8BF7\u67E5\u770B\u66F4\u65B0\u8BF4\u660E\u3002",updateCheckFailed:"\u6682\u65F6\u65E0\u6CD5\u68C0\u67E5\u65B0\u7248\uFF0C\u8BF7\u7A0D\u540E\u70B9\u51FB\u91CD\u8BD5\u3002\u5F53\u524D\u63D2\u4EF6\u6B63\u5E38\u4F7F\u7528\u3002",updateCurrent:"\u6682\u65E0\u9700\u8981\u5B89\u88C5\u7684\u65B0\u7248\u3002",calendarSource:"\u5047\u671F\u516C\u544A\u6765\u6E90",calendarChecking:"\u6B63\u5728\u81EA\u52A8\u66F4\u65B0\u8282\u5047\u65E5\u65E5\u5386\u2026",calendarWaiting:"\u65B0\u5E74\u5EA6\u65E5\u5386\u5C1A\u672A\u53D1\u5E03\uFF0C\u5C06\u6BCF\u5929\u81EA\u52A8\u68C0\u67E5\u3002",calendarUpdateFailed:"\u65E5\u5386\u66F4\u65B0\u6682\u672A\u6210\u529F\uFF0C\u4FDD\u7559\u5DF2\u6709\u6570\u636E\u5E76\u81EA\u52A8\u91CD\u8BD5\u3002",calendarStorageError:"\u65E5\u5386\u6682\u65F6\u65E0\u6CD5\u4FDD\u5B58\uFF0C\u7EE7\u7EED\u4F7F\u7528\u5DF2\u6709\u6570\u636E\u5E76\u81EA\u52A8\u91CD\u8BD5\u3002",unknownNote:"\u7F3A\u5C11\u672C\u5E74\u5EA6\u5047\u671F\u6570\u636E\uFF0C\u5DE5\u4F5C\u65E5\u5CF0\u65F6\u6BB5\u6682\u4E0D\u4F5C\u786E\u5B9A\u5224\u65AD\u3002",timeline:"\u5317\u4EAC\u65F6\u95F4 24 \u5C0F\u65F6\u65F6\u95F4\u8F74",days:"\u5929",hours:"\u5C0F\u65F6",minutes:"\u5206\u949F",seconds:"\u79D2"},_e={title:"Today\u2019s schedule",zone:"Beijing time \xB7 UTC+8",peak:"Peak",offpeak:"Off-peak",unknown:"Unverified",nextPeak:"Until peak hours",nextOffpeak:"Until off-peak",nextUnknown:"Calendar update needed",weekday:"Monday\u2013Friday",weekend:"Weekend \xB7 off-peak all day",holiday:"Public holiday \xB7 off-peak all day",unverified:"Holiday calendar needs an update",allDay:"All day",rest:"All other hours",now:"Now",nextSwitch:"Next change:",close:"Close timeline",open:"View peak hours timeline",rule:"DeepSeek official schedule",details:"Rules and reminders",note:"Weekends (including makeup workdays) and public holidays are off-peak all day.",reminder:"Remind 5 minutes before peak",reminderHint:"Off by default. Enabling requests notification permission. Reminds with a gentle chime while the app is running.",reminderSoundError:"The chime could not play. Send a test notification to retry.",reminderDenied:"Notification permission was not granted. Allow this app\u2019s notifications, then enable reminders again.",reminderUnsupported:"System notifications are unavailable in this environment.",reminderStorageError:"Reminder settings could not be saved. Check local storage permissions.",reminderDeliveryError:"The reminder could not be delivered. Check system notification settings, then enable it again.",reminderTitle:"Peak hours start soon",reminderBody:"Peak hours start at {time} (Beijing time).",reminderTest:"Send test notification",reminderTestTitle:"Test reminder",reminderTestBody:"This is a test reminder. Peak reminders arrive 5 minutes before peak hours start.",reminderSending:"In-app reminder displayed. Sending system notification\u2026",reminderAccepted:"The system accepted the notification. If no banner appears, check Notification Center or Do Not Disturb.",reminderUnconfirmed:"System display was not confirmed. The in-app reminder remains available.",reminderFallback:"System notification failed. The in-app reminder remains available. Check system notification settings.",dismissReminder:"Dismiss reminder",updateAvailable:"Update available",updateCheck:"Check for updates",updateChecking:"Checking\u2026",updateInstall:"Update",updateInstalling:"Updating\u2026",updateDownload:"Download update",updateNotes:"Release notes",updateRestart:"Update installed. Fully quit and reopen Harness to apply it.",updateApplied:"Harness confirmed that the update was applied.",updateUnknown:"Update outcome is unconfirmed. Check Harness Plugins before restarting.",updateFailed:"Update failed. Keep using this version and retry or download from GitHub later.",updateIncompatible:"This release is incompatible with your Harness. Read its release notes.",updateCheckFailed:"Could not check for updates. Click to retry later; the plugin keeps working.",updateCurrent:"No newer release needs to be installed.",calendarSource:"Holiday notice source",calendarChecking:"Updating the holiday calendar automatically\u2026",calendarWaiting:"The new annual calendar is not published yet. Checking daily.",calendarUpdateFailed:"Calendar update failed. Keeping existing data and retrying automatically.",calendarStorageError:"Calendar could not be saved. Keeping existing data and retrying automatically.",unknownNote:"Holiday data for this year is unavailable; weekday peak periods are unverified.",timeline:"24-hour timeline in Beijing time",days:"d",hours:"h",minutes:"min",seconds:"s"};var Me=`.dtb-theme {
|
|
2
|
+
"use strict";var Y=Object.defineProperty;var ze=Object.getOwnPropertyDescriptor;var Be=Object.getOwnPropertyNames;var Fe=Object.prototype.hasOwnProperty;var Ke=(e,n)=>{for(var t in n)Y(e,t,{get:n[t],enumerable:!0})},qe=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let a of Be(n))!Fe.call(e,a)&&a!==t&&Y(e,a,{get:()=>n[a],enumerable:!(r=ze(n,a))||r.enumerable});return e};var Ve=e=>qe(Y({},"__esModule",{value:!0}),e);var vt={};Ke(vt,{apply:()=>yt,inject:()=>gt});module.exports=Ve(vt);function ce(){let e=Date.now(),n=new Set,t=()=>{e=Date.now();for(let r of n)r()};return{getSnapshot:()=>e,subscribe(r){return n.add(r),()=>{n.delete(r)}},start(){let r,a=()=>{clearInterval(r),r=void 0,t(),document.visibilityState!=="hidden"&&(r=setInterval(t,1e3))};return document.addEventListener("visibilitychange",a),window.addEventListener("focus",a),window.addEventListener("pageshow",a),a(),()=>{clearInterval(r),document.removeEventListener("visibilitychange",a),window.removeEventListener("focus",a),window.removeEventListener("pageshow",a)}}}}var ue={schemaVersion:1,years:[2026],verifiedOn:"2026-09-30",source:"https://www.lufengshi.gov.cn/swlfsjj/gkmlpt/content/1/1199/mpost_1199727.html",holidays:[["2026-01-01","2026-01-03"],["2026-02-15","2026-02-23"],["2026-04-04","2026-04-06"],["2026-05-01","2026-05-05"],["2026-06-19","2026-06-21"],["2026-09-25","2026-09-27"],["2026-10-01","2026-10-07"]]};var Ge="https://raw.githubusercontent.com/NateScarlet/holiday-cn/master/",F=64*1024;function pe(e){if(!Number.isInteger(e)||e<2e3||e>9998)throw new C("invalid");return`${Ge}${e}.json`}var C=class extends Error{kind;constructor(n){super(n),this.kind=n}};function M(e){if(typeof e!="string"||!/^\d{4}-\d{2}-\d{2}$/.test(e))return!1;let n=new Date(`${e}T00:00:00Z`);return Number.isFinite(n.getTime())&&n.toISOString().slice(0,10)===e}function O(e){try{if(new TextEncoder().encode(e).length>F)throw new Error;let n=JSON.parse(e);if(!n||typeof n!="object")throw new Error;let t=n;if(t.schemaVersion!==1||!Array.isArray(t.years)||!t.years.length||t.years.length>20)throw new Error;let r=t.years;if(r.some((s,i)=>!Number.isInteger(s)||s<2e3||s>9998||i>0&&s<=r[i-1]))throw new Error;if(!M(t.verifiedOn)||typeof t.source!="string")throw new Error;let a=new URL(t.source);if(a.protocol!=="https:"||a.username||a.password||!(a.hostname==="gov.cn"||a.hostname.endsWith(".gov.cn")))throw new Error;if(!Array.isArray(t.holidays)||t.holidays.length>400)throw new Error;let o=[];for(let s of t.holidays){if(!Array.isArray(s)||s.length!==2)throw new Error;let[i,m]=s;if(!M(i)||!M(m)||i>m||i.slice(0,4)!==m.slice(0,4)||!r.includes(Number(i.slice(0,4))))throw new Error;if(o.length&&i<=o.at(-1)[1])throw new Error;o.push([i,m])}if(r.some(s=>!o.some(([i])=>Number(i.slice(0,4))===s)))throw new Error;return{schemaVersion:1,years:[...r],verifiedOn:t.verifiedOn,source:a.href,holidays:o}}catch{throw new C("invalid")}}var D=O(JSON.stringify(ue));function K(e,n){let t=n.verifiedOn>=e.verifiedOn,r=[...new Set([...e.years,...n.years])].sort((o,s)=>o-s),a=r.flatMap(o=>(n.years.includes(o)&&(t||!e.years.includes(o))?n:e).holidays.filter(([i])=>Number(i.slice(0,4))===o));return{...t?n:e,years:r,holidays:a}}var G="dsh-timeband/calendar/v1";function me(e=()=>window.localStorage){let n=new Set,t=()=>{try{let s=e().getItem(G);return s===null?{data:D,issue:null}:{data:K(D,O(s)),issue:null}}catch(s){return{data:D,issue:s instanceof C?s.kind:"storage"}}},r={...t(),update:"idle"},a=s=>{r=s;for(let i of n)i()},o=()=>{let s=t();s.issue===r.issue&&JSON.stringify(s.data)===JSON.stringify(r.data)||a({...s,update:r.update})};return{getSnapshot:()=>r,subscribe(s){return n.add(s),()=>{n.delete(s)}},refresh:o,save(s){let i=K(K(r.data,t().data),O(JSON.stringify(s)));try{e().setItem(G,JSON.stringify(i))}catch{throw new C("storage")}a({data:i,issue:null,update:"idle"})},setUpdateStatus(s,i=r.issue){(r.update!==s||r.issue!==i)&&a({...r,update:s,issue:i})},start(){let s=i=>{(i.key===G||i.key===null)&&o()};return window.addEventListener("storage",s),window.addEventListener("focus",o),()=>{window.removeEventListener("storage",s),window.removeEventListener("focus",o)}}}}function fe(e){let n=[];for(let t of[...new Set(e)].sort()){let r=n.at(-1);r&&Date.parse(`${t}T00:00:00Z`)-Date.parse(`${r[1]}T00:00:00Z`)===864e5?r[1]=t:n.push([t,t])}return n}function be(e,n,t,r){try{let a=JSON.parse(e);if(!a||typeof a!="object")throw new Error;let o=a;if(o.year!==n||!Array.isArray(o.papers)||!Array.isArray(o.days))throw new Error;if(o.papers.length===0&&o.days.length===0)return null;if(!o.papers.length||o.papers.length>20||!o.days.length||o.days.length>400)throw new Error;for(let p of o.papers){if(typeof p!="string")throw new Error;let l=new URL(p);if(l.protocol!=="https:"||l.username||l.password||!(l.hostname==="gov.cn"||l.hostname.endsWith(".gov.cn")))throw new Error}let s=[],i=[],m=new Set;for(let p of o.days){if(!p||typeof p!="object")throw new Error;let l=p;if(!M(l.date)||typeof l.isOffDay!="boolean"||typeof l.name!="string"||!l.name.trim()||m.has(l.date))throw new Error;if(l.date<`${n-1}-12-01`||l.date>`${n}-12-31`)throw new Error;m.add(l.date),l.isOffDay&&(l.date.startsWith(`${n}-`)?s:i).push(l.date)}if(!s.length)throw new Error;let f=[n],c=fe(s);if(i.length&&r.years.includes(n-1)){let p=r.holidays.filter(([w])=>w.startsWith(`${n-1}-`)),l=[...i];for(let[w,g]of p)for(let v=Date.parse(`${w}T00:00:00Z`);v<=Date.parse(`${g}T00:00:00Z`);v+=864e5)l.push(new Date(v).toISOString().slice(0,10));f.unshift(n-1),c.unshift(...fe(l))}return O(JSON.stringify({schemaVersion:1,years:f,verifiedOn:t,source:o.papers[0],holidays:c}))}catch{throw new C("invalid")}}var he="https://api-docs.deepseek.com/quick_start/pricing/",T=36e5,j=24*T,Je=8*T,J=[0,9,12,14,18,24];function A(e,n=D){if(!Number.isFinite(e)||!Number.isFinite(new Date(e).getTime()))throw new RangeError("Invalid timestamp");let t=new Date(e+Je),r=t.toISOString().slice(0,10),a=Date.parse(`${r}T00:00:00+08:00`),o=n.holidays.some(([f,c])=>r>=f&&r<=c),s=t.getUTCDay()===0||t.getUTCDay()===6,i=n.years.includes(t.getUTCFullYear());return{key:r,midnight:a,kind:o?"holiday":s?"weekend":i?"weekday":"unverified",covered:i,hour:(e-a)/T}}function We(e,n=D){let{kind:t}=A(e,n);if(t==="holiday"||t==="weekend")return[{start:0,end:24,band:"offpeak"}];let r=t==="unverified"?"unknown":"peak";return[{start:0,end:9,band:"offpeak"},{start:9,end:12,band:r},{start:12,end:14,band:"offpeak"},{start:14,end:18,band:r},{start:18,end:24,band:"offpeak"}]}function W(e,n=D){let{hour:t,kind:r}=A(e,n);return r==="holiday"||r==="weekend"||t<9||t>=12&&t<14||t>=18?"offpeak":r==="unverified"?"unknown":"peak"}function Z(e,n=D){let t=W(e,n),{midnight:r}=A(e,n);for(let a=0;a<370;a++)for(let o of J){let s=r+a*j+o*T;if(s<=e)continue;let i=W(s,n);if(i!==t)return{at:s,band:i}}return null}function X(e,n=D){let t=A(e,n),r=Number(t.key.slice(0,4));if(!t.covered)return{expiresOn:null,notice:"uncovered"};for(;n.years.includes(r+1);)r++;let a=`${r}-12-31`,o=Date.parse(`${r+1}-01-01T00:00:00+08:00`);return{expiresOn:a,notice:o-t.midnight<=30*j?"expiresSoon":null}}function q(){let e,n=0,t=0,r;return(a,o=D)=>{if(!Number.isFinite(a))throw new RangeError("Invalid timestamp");if(r&&e===o&&a>=n&&a<t)return r;let{hour:s,...i}=A(a,o),m=i.kind==="holiday"||i.kind==="weekend",f=m?0:J.findLast(p=>p<=s),c=m?24:J.find(p=>p>s);return n=i.midnight+f*T,t=i.midnight+c*T,e=o,r={day:i,band:W(a,o),next:Z(a,o),segments:We(a,o),coverage:X(a,o)},r}}function ge(e){let n=Math.max(0,Math.ceil(e/1e3)),t=Math.floor(n/86400),r=Math.floor(n/3600)%24,a=Math.floor(n/60)%60,o=[];return t>0&&o.push({value:t,unit:"days"}),n>=3600&&o.push({value:r,unit:"hours"}),n>=60&&o.push({value:a,unit:"minutes"}),{major:o,seconds:n%60}}var ye="dsh-timeband/calendar-check/v1",ve=j,Ze=1e4;async function Xe(e){if(Number(e.headers.get("content-length"))>F||!e.body)throw new C("invalid");let n=e.body.getReader(),t=new TextDecoder("utf-8",{fatal:!0}),r=0,a="";try{for(;;){let{done:o,value:s}=await n.read();if(o)break;if(r+=s.byteLength,r>F)throw new C("invalid");a+=t.decode(s,{stream:!0})}return a+t.decode()}finally{n.releaseLock()}}function we(e){let n=e.now??(()=>Date.now()),t=e.fetch??((u,y)=>fetch(u,y)),r=e.getStorage??(()=>window.localStorage),a=e.synchronize??(u=>typeof navigator<"u"&&navigator.locks?navigator.locks.request("dsh-timeband-calendar-update",u):u()),o=!1,s=!1,i=0,m,f,c,p=0,l=e.store.getSnapshot().data,w=()=>{let u=e.store.getSnapshot().data,y=n(),k=A(y,u),E=X(y,u);return k.covered?E.notice==="expiresSoon"?Number(E.expiresOn.slice(0,4))+1:null:Number(k.key.slice(0,4))},g=()=>{try{let u=JSON.parse(r().getItem(ye)??"null");if(u&&Number.isInteger(u.year)&&Number.isFinite(u.at)&&(u.status==="waiting"||u.status==="failed"))return u}catch{}return c},v=u=>{c=u;try{r().setItem(ye,JSON.stringify(u))}catch{}},b=async(u=!1)=>{if(!o||s)return;s=!0;let y=i;try{await a(async()=>{if(!o||y!==i)return;e.store.refresh();let k=w();if(k===null){e.store.setUpdateStatus("idle");return}let E=g();if(E?.year===k&&n()>=E.at&&n()-E.at<ve&&!(u&&E.status==="failed")){p=Math.min(p,E.at+ve),e.store.setUpdateStatus(E.status);return}e.store.setUpdateStatus("checking");let R=new AbortController;m=R;let U=setTimeout(()=>R.abort(),Ze);f=U;let P="failed";try{let I=await t(pe(k),{signal:R.signal,credentials:"omit",referrerPolicy:"no-referrer",cache:"no-cache",redirect:"error"});if(!o||y!==i||R.signal.aborted)return;if(I.status===404)P="waiting";else{if(!I.ok)throw new Error("Calendar request failed");let N=be(await Xe(I),k,A(n()).key,e.store.getSnapshot().data);if(!o||y!==i||R.signal.aborted)return;if(N===null)P="waiting";else{e.store.save(N);return}}}catch(I){if(!o||y!==i)return;I instanceof C&&I.kind==="storage"&&e.store.setUpdateStatus("failed","storage")}finally{clearTimeout(U),R.abort(),m===R&&(m=void 0),f===U&&(f=void 0)}!o||y!==i||(v({year:k,at:n(),status:P}),e.store.setUpdateStatus(P))})}catch{if(o&&y===i){let k=w();k!==null&&v({year:k,at:n(),status:"failed"}),e.store.setUpdateStatus("failed")}}finally{y===i&&(s=!1)}},h=()=>{let u=n(),y=e.store.getSnapshot().data;(y!==l||u<p-T||u>=p)&&(l=y,p=Math.min(u+T,A(u,y).midnight+j),b())};return{start(){o=!0,i++,s=!1,p=0;let u=window,y=[e.clock.subscribe(h),e.store.subscribe(h)],k=()=>{p=n()+T,b(!0)};u.addEventListener("online",k);let E=setInterval(h,T);return h(),()=>{o=!1,i++,s=!1,m?.abort(),clearTimeout(f),f=void 0,clearInterval(E),y.forEach(R=>R()),u.removeEventListener("online",k),e.store.getSnapshot().update==="checking"&&e.store.setUpdateStatus("idle")}}}}var H="dsh-timeband/reminders/v1",Qe={read:()=>typeof Notification=="function"?Notification.permission:"unsupported",request:()=>Notification.requestPermission()};function xe(e=()=>window.localStorage,n=Qe){let t=new Set,r=()=>{try{if(e().getItem(H)!=="true")return{enabled:!1,busy:!1,issue:null};let i=n.read();return i==="granted"?{enabled:!0,busy:!1,issue:null}:{enabled:!1,busy:!1,issue:i==="unsupported"?"unsupported":"denied"}}catch{return{enabled:!1,busy:!1,issue:"storage"}}},a=r(),o=0,s=i=>{if(!(i.enabled===a.enabled&&i.busy===a.busy&&i.issue===a.issue)){a=i;for(let m of t)m()}};return{getSnapshot:()=>a,subscribe(i){return t.add(i),()=>{t.delete(i)}},async setEnabled(i){let m=++o;if(!i){s({enabled:!1,busy:!1,issue:null});try{e().removeItem(H)}catch{s({enabled:!1,busy:!1,issue:"storage"})}return}s({enabled:!1,busy:!0,issue:null});let f;try{f=n.read(),f==="default"&&(f=await n.request())}catch{m===o&&s({enabled:!1,busy:!1,issue:"denied"});return}if(m===o){if(f!=="granted"){s({enabled:!1,busy:!1,issue:f==="unsupported"?"unsupported":"denied"});return}try{e().setItem(H,"true"),s({enabled:!0,busy:!1,issue:null})}catch{m===o&&s({enabled:!1,busy:!1,issue:"storage"})}}},fail(i){o++;try{e().removeItem(H)}catch{i="storage"}s({enabled:!1,busy:!1,issue:i})},start(){let i=()=>{a.busy||s(r())},m=f=>{(f.key===H||f.key===null)&&(o++,s(r()))};return window.addEventListener("storage",m),window.addEventListener("focus",i),window.addEventListener("pageshow",i),()=>{o++,window.removeEventListener("storage",m),window.removeEventListener("focus",i),window.removeEventListener("pageshow",i)}}}}var Q=5*6e4,z="dsh-timeband/reminder-sent/v1",et="dsh-timeband/peak-reminder";function tt(e){return typeof navigator<"u"&&navigator.locks?navigator.locks.request(et,e):Promise.resolve().then(e)}function ke(e){let n=q(),t=e.now??Date.now,r=e.getStorage??(()=>window.localStorage),a=e.synchronize??tt,o,s=null,i,m=null,f=null,c=!1,p=0,l=()=>{clearTimeout(i),i=void 0,m=null},w=b=>{let h=e.calendarStore.getSnapshot().data,u=n(b,h);if(u!==o){o=u;let y=u.band==="unknown"?null:u.next;y?.band==="offpeak"&&(y=Z(y.at,h)),s=y?.band==="peak"?y.at:null}return s},g=(b,h)=>{m!==b&&(l(),m=b,i=setTimeout(()=>{i=void 0,m=null,v()},Math.max(1,Math.min(2147483647,b-h))))},v=()=>{if(!c||!e.reminderStore.getSnapshot().enabled){l(),f=null;return}let b=t(),h=w(b);if(h===null){l(),f=null;return}if(b<h-Q){f=null,g(h-Q,b);return}if(g(h,b),f===h)return;f=h;let u=p;a(()=>{if(!c||p!==u||!e.reminderStore.getSnapshot().enabled)return;let y=t();if(y<h-Q||y>=h||w(y)!==h)return;let k;try{if(k=r().getItem(z),k!==null&&Number.isSafeInteger(Number(k))&&Number(k)>=h)return;r().setItem(z,String(h))}catch{e.reminderStore.fail("storage");return}let E=()=>{if(c){try{r().getItem(z)===String(h)&&(k===null?r().removeItem(z):r().setItem(z,k))}catch{}e.reminderStore.fail("delivery")}};try{e.notify(h,()=>{a(E).catch(()=>{c&&e.reminderStore.fail("delivery")})})}catch{E()}}).catch(()=>{c&&p===u&&e.reminderStore.fail("delivery")})};return{start(){c=!0,f=null;let b=()=>{p++,f=null,v()},h=[e.clock.subscribe(v),e.calendarStore.subscribe(b),e.reminderStore.subscribe(b)];return v(),()=>{c=!1,p++,l(),h.forEach(u=>u())}}}}function Se(e=()=>new AudioContext){let n,t=!1,r=0,a,o,s=!1,i,m=()=>((!n||n.state==="closed")&&(n=e()),n),f=()=>{r++,a?.(),a=void 0,o?.(),o=void 0},c=(g=n)=>{if(!(!g||g!==n||o||g.state==="closed"))try{g.suspend().catch(()=>{})}catch{}},p=()=>{f(),c()},l=()=>{f();let g=n;n=void 0,s=!1,i=void 0;try{g&&g.state!=="closed"&&g.close().catch(()=>{})}catch{}},w=(g,v)=>new Promise(b=>{let h=!1,u=E=>{h||(h=!0,clearTimeout(k),a===y&&(a=void 0),b(E))},y=()=>u(!1),k=setTimeout(()=>u(!1),1e3);a=y;try{g.resume().then(()=>{let E=!t&&n===g&&v===r;if(h||!E){E&&!o&&c(g),u(!1);return}s=g.state==="running",u(s)},()=>u(!1))}catch{u(!1)}});return{prime(){if(t)return Promise.resolve(!1);if(s)return Promise.resolve(!0);if(i)return i;try{let g=m(),v=r,b=w(g,v).then(h=>(v===r&&c(g),i===b&&(i=void 0),h));return i=b,b}catch{return Promise.resolve(!1)}},async play(){if(t)return!1;f();let g=r;try{let v=m();if(!await w(v,g)||t||g!==r||v.state!=="running")return!1;let b=v.createOscillator(),h=v.createGain(),u=v.currentTime+.01;b.type="sine",b.frequency.setValueAtTime(880,u),b.frequency.setValueAtTime(660,u+.26),h.gain.setValueAtTime(0,u),h.gain.linearRampToValueAtTime(.075,u+.015),h.gain.exponentialRampToValueAtTime(1e-4,u+.24),h.gain.setValueAtTime(0,u+.25),h.gain.linearRampToValueAtTime(.065,u+.275),h.gain.exponentialRampToValueAtTime(1e-4,u+.53),h.gain.linearRampToValueAtTime(0,u+.55),b.connect(h),h.connect(v.destination);let y=()=>{b.onended=null;try{b.stop()}catch{}b.disconnect(),h.disconnect()};return o=y,b.onended=()=>{y(),g===r&&(o=void 0,c(v))},b.start(u),b.stop(u+.56),!0}catch{return g===r&&p(),!1}},stop:p,release:l,dispose(){t=!0,l()}}}var nt=5e3;function Ee(e=(t,r)=>new Notification(t,r),n=Se()){let t=new Set,r=null,a=0,o=!1,s,i,m=p=>{r=p;for(let l of t)l()},f=()=>{if(clearTimeout(i),i=void 0,!!s){s.onshow=s.onerror=s.onclose=s.onclick=null;try{s.close()}catch{}s=void 0}},c=()=>{f(),n.stop(),r&&m(null)};return{getSnapshot:()=>r,subscribe(p){return t.add(p),()=>{t.delete(p)}},primeSound:()=>n.prime(),releaseSound(){c(),n.release()},show(p,l,w){if(o)return;f();let g=++a;m({id:g,title:p,body:l,delivery:"pending",sound:"pending"}),n.play().then(b=>{!o&&r?.id===g&&m({...r,sound:b?"played":"unavailable"})});let v=b=>{o||r?.id!==g||m({...r,delivery:b})};try{s=e(`DSH TimeBand \xB7 ${p}`,{body:l,tag:w,silent:!0}),s.onshow=()=>{clearTimeout(i),i=void 0,v("accepted")},s.onerror=()=>{f(),v("unavailable")},s.onclose=()=>{f(),r?.id===g&&r.delivery==="pending"&&v("unconfirmed")},s.onclick=()=>{window.focus(),c()},i=setTimeout(()=>{i=void 0,v("unconfirmed")},nt)}catch{f(),v("unavailable")}},dismiss:c,dispose(){o=!0,c(),n.dispose()}}}var Re={name:"dsh-timeband",version:"1.3.11",description:"\u5934\u50CF\u65C1\u7684 DeepSeek \u5CF0\u8C37\u65F6\u6BB5\u4E0E\u4ECA\u65E5\u65F6\u95F4\u8F74",type:"module",license:"MIT",publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},repository:{type:"git",url:"git+https://github.com/a961282799-crypto/dsh-timeband.git"},homepage:"https://github.com/a961282799-crypto/dsh-timeband#readme",bugs:{url:"https://github.com/a961282799-crypto/dsh-timeband/issues"},main:"./dist/index.js",exports:{".":"./dist/index.js","./client":"./dist/client.js","./package.json":"./package.json"},files:["dist/index.js","dist/client.js","calendars","cordis.patch.yml","README.md","LICENSE"],keywords:["dsh-plugin","deepseek-harness","timeline"],engines:{node:">=22"},dsh:{bundle:{patch:"./cordis.patch.yml"},client:{platform:"web",inject:["@deepseek-ai/dsh-api-remotes","@deepseek-ai/dsh-client-ui-renderer","@deepseek-ai/dsh-client-ui-sidebar","@deepseek-ai/dsh-client-locale"]}},peerDependencies:{"@deepseek-ai/dsh":">=0.2.2-rc.1 <0.3.0"},peerDependenciesMeta:{"@deepseek-ai/dsh":{optional:!0}},scripts:{build:"node scripts/build.mjs",typecheck:"tsc --noEmit",test:"node --experimental-strip-types --test tests/*.test.ts tests/*.test.mjs","test:browser":"playwright test",preview:"node scripts/preview.mjs",screenshots:"node scripts/screenshots.mjs",compatibility:"node scripts/check-compatibility.mjs next",check:"npm run typecheck && npm run build && npm test && npm run test:browser",prepack:"npm run typecheck && npm run build"},devDependencies:{"@deepseek-ai/cordis":"4.1.0","@deepseek-ai/dsh-client-locale":"0.2.2-rc.1","@deepseek-ai/dsh-client-ui-renderer":"0.2.2-rc.1","@deepseek-ai/dsh-client-ui-sidebar":"0.2.2-rc.1","@deepseek-ai/dsh-client-ui-slots":"0.2.2-rc.1","@playwright/test":"1.63.0","@types/node":"^24.0.0","@types/react":"~18.3.1","@types/react-dom":"~18.3.0",esbuild:"0.28.2",react:"18.3.1","react-dom":"18.3.1",typescript:"7.0.2"}};var Ne=Re.name,De=Ne.replace(/^@/,"").replace("/","-"),at="https://api.github.com/repos/a961282799-crypto/dsh-timeband/releases/latest",Ce="https://github.com/a961282799-crypto/dsh-timeband/releases",it=1e4,Te=64*1024;function ee(e){return typeof e!="string"||!/^(0|[1-9]\d{0,5})\.(0|[1-9]\d{0,5})\.(0|[1-9]\d{0,5})$/.test(e)?null:e.split(".").map(Number)}function te(e,n){let t=ee(e),r=ee(n);if(!t||!r)return!1;for(let a=0;a<3;a++)if(t[a]!==r[a])return t[a]>r[a];return!1}function ot(e){if(!ee(e))return null;let n=`v${e}`;return{version:String(e),url:`${Ce}/tag/${n}`,download:`${Ce}/download/${n}/${De}-${e}.tgz`}}function st(e){if(!e||typeof e!="object")throw new Error("Invalid release");let n=e,t=ot(typeof n.tag_name=="string"?n.tag_name.slice(1):null);if(!t||n.tag_name!==`v${t.version}`||n.draft!==!1||n.prerelease!==!1||n.html_url!==t.url||!Array.isArray(n.assets)||!n.assets.some(r=>r?.name===`${De}-${t.version}.tgz`&&r.state==="uploaded"&&r.browser_download_url===t.download))throw new Error("Invalid release");return t}async function dt(e){if(!e.ok||Number(e.headers.get("content-length"))>Te)throw new Error("Release check failed");let n=await e.text();if(new TextEncoder().encode(n).length>Te)throw new Error("Release too large");return st(JSON.parse(n))}function Ie(e){let n=e.fetch??((c,p)=>fetch(c,p)),t=new Set,r={latest:null,check:"idle",install:"idle"},a=!0,o,s,i,m=c=>{r={...r,...c};for(let p of t)p()},f=async()=>{if(!a||o||i)return;let c=new AbortController;o=c,m({check:"checking"}),s=setTimeout(()=>c.abort(),it);try{let p=await n(at,{signal:c.signal,credentials:"omit",referrerPolicy:"no-referrer",cache:"no-cache",redirect:"error"}),l=await dt(p);if(!a)return;if(c.signal.aborted)throw new Error("Release check timed out");m({latest:l,check:"current"})}catch{a&&m({check:"failed"})}finally{clearTimeout(s),s=void 0,o=void 0,c.abort()}};return{version:e.version,getSnapshot:()=>r,subscribe(c){return t.add(c),()=>{t.delete(c)}},canInstall:()=>!!e.manager(),check:f,async install(){let c=r.latest,p=e.manager();if(!a||!c||!te(c.version,e.version)||!p||o||i||["restart","applied","unknown"].includes(r.install))return;let l=crypto.randomUUID();i={manager:p,id:l},m({install:"installing"});try{let w=await p.installBundle(c.download,{requestId:l});if(!w.ok){let v=await p.waitForInstall(l);if(!v.ok||v.value===null){a&&m({install:"unknown"});return}w={ok:!0,value:v.value}}if(!a)return;let g=w.value;g.application==="failed"?m({install:g.error?.code==="incompatible-version"?"incompatible":"failed"}):["restart-required","applied"].includes(g.application)&&g.bundle===Ne?m({install:g.application==="applied"?"applied":"restart"}):m({install:"unknown"})}catch{a&&m({install:"unknown"})}finally{i=void 0}},dispose(){a=!1,o?.abort(),clearTimeout(s),s=void 0,i&&(i.manager.cancelInstall(i.id).catch(()=>{}),i=void 0)}}}var Ae="1.3.11";var x=require("react"),ne=require("react-dom");var d=require("react/jsx-runtime"),ct=new Intl.DateTimeFormat("zh-CN",{timeZone:"Asia/Shanghai",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hourCycle:"h23"}),ut=new Intl.DateTimeFormat("en-GB",{timeZone:"Asia/Shanghai",hour:"2-digit",minute:"2-digit",hourCycle:"h23"}),pt={denied:"reminderDenied",unsupported:"reminderUnsupported",storage:"reminderStorageError",delivery:"reminderDeliveryError"},Pe={pending:"reminderSending",accepted:"reminderAccepted",unconfirmed:"reminderUnconfirmed",unavailable:"reminderFallback"},mt=(0,x.memo)(function({delivery:n,t}){let r=(0,x.useSyncExternalStore)(n.subscribe,n.getSnapshot),a=(0,x.useRef)(null);return(0,x.useEffect)(()=>{r?a.current?.showPopover():a.current?.hidePopover()},[r?.id]),r?(0,ne.createPortal)((0,d.jsx)("div",{ref:a,popover:"manual",className:"dtb-reminder-banner dtb-theme",role:"status","aria-live":"polite",children:r&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"dtb-header",children:[(0,d.jsx)("strong",{children:r.title}),(0,d.jsx)("button",{type:"button",className:"dtb-close","aria-label":t("dismissReminder"),onClick:n.dismiss,children:"\xD7"})]}),(0,d.jsx)("p",{children:r.body}),(0,d.jsx)("p",{className:"dtb-note dtb-delivery-status",children:t(Pe[r.delivery])}),r.sound==="unavailable"&&(0,d.jsx)("p",{className:"dtb-note dtb-sound-feedback",children:t("reminderSoundError")})]})}),document.body):null}),Ue=(0,x.memo)(function({segments:n,hour:t,small:r=!1}){return(0,d.jsxs)("div",{className:`dtb-track${r?" dtb-track-small":""}`,"aria-hidden":"true",children:[n.map(a=>(0,d.jsx)("span",{className:`dtb-segment dtb-${a.band}`,style:{left:`${a.start/24*100}%`,width:`${(a.end-a.start)/24*100}%`}},a.start)),(0,d.jsx)("span",{className:"dtb-cursor",style:{left:`${t/24*100}%`}})]})});function Le(e,n,t){let r=n===null?null:ge(n-e),a=r?.major.map(s=>`${s.value}${t(s.unit)}`).join("")??"",o=r?`${r.seconds}${t("seconds")}`:"\u2014";return{text:`${a}${o}`,view:(0,d.jsxs)("span",{className:"dtb-countdown",children:[(0,d.jsx)("span",{className:"dtb-count-main",children:a||o}),a&&(0,d.jsx)("small",{className:"dtb-count-seconds",children:o})]})}}function ft({useClock:e,t:n,until:t,nextLabel:r}){let a=e(i=>i),{text:o,view:s}=Le(a,t,n);return(0,d.jsxs)("div",{className:"dtb-next",children:[(0,d.jsx)("span",{children:n(r)}),(0,d.jsx)("strong",{"aria-label":`${n(r)} ${o}`,children:s})]})}function bt({wide:e,useClock:n,t,until:r,nextLabel:a,band:o,segments:s,hour:i,trigger:m,id:f,open:c}){let p=n(g=>e?g:Math.floor(g/6e4)*6e4),{text:l,view:w}=Le(p,r,t);return(0,d.jsxs)("button",{type:"button",className:"dtb-chip",ref:m,popovertarget:f,popovertargetaction:"toggle","aria-label":`${t("open")} \xB7 ${t(o)} \xB7 ${t(a)} ${l}`,"aria-expanded":c,"aria-haspopup":"dialog","aria-controls":f,title:`${t(o)} \xB7 ${t(a)} ${l}`,children:[(0,d.jsxs)("span",{className:"dtb-chip-top",children:[(0,d.jsx)("span",{className:`dtb-dot dtb-${o}`}),e&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:"dtb-chip-label",children:t(o)}),(0,d.jsx)("span",{className:"dtb-chip-count",children:w})]})]}),e?(0,d.jsx)(Ue,{segments:s,hour:i,small:!0}):(0,d.jsx)("svg",{viewBox:"0 0 24 24",className:"dtb-rail-icon","aria-hidden":"true",children:(0,d.jsx)("path",{d:"M3 17 8 7l5 10 4-7 4 7"})})]})}function $e({wide:e,useClock:n,t,calendarStore:r,reminderStore:a,reminderDelivery:o,testReminder:s,pluginUpdates:i}){let m=n(S=>Math.floor(S/6e4)*6e4),f=(0,x.useSyncExternalStore)(r.subscribe,r.getSnapshot),c=(0,x.useSyncExternalStore)(a.subscribe,a.getSnapshot),p=(0,x.useSyncExternalStore)(o.subscribe,o.getSnapshot),l=(0,x.useSyncExternalStore)(i.subscribe,i.getSnapshot),w=l.latest&&te(l.latest.version,i.version),g=l.install==="restart"?"updateRestart":l.install==="applied"?"updateApplied":l.install==="unknown"?"updateUnknown":l.install==="failed"?"updateFailed":l.install==="incompatible"?"updateIncompatible":null,v=(0,x.useMemo)(()=>q(),[]),{day:b,band:h,next:u,segments:y}=v(m,f.data),k=(m-b.midnight)/T,E=u!==null&&u.band!=="unknown"&&h!=="unknown",[R,U]=(0,x.useState)(!1),P=(0,x.useRef)(!1),I=(0,x.useRef)(null),N=(0,x.useRef)(null),L=(0,x.useRef)(null),re=(0,x.useRef)(null),B=(0,x.useId)(),ae=E?u.at:null,ie=E?u.band==="peak"?"nextPeak":"nextOffpeak":"nextUnknown",oe=(0,x.useMemo)(()=>E&&u?ct.format(u.at):"",[E,u]),se=ut.format(m),de=f.issue==="storage"?"calendarStorageError":f.update==="checking"?"calendarChecking":f.update==="waiting"?"calendarWaiting":f.update==="failed"?"calendarUpdateFailed":null;(0,x.useEffect)(()=>{let S=N.current;if(!S)return;let $=()=>{I.current&&(P.current=I.current.open)},_=()=>U(S.matches(":popover-open"));return S.addEventListener("beforetoggle",$),S.addEventListener("toggle",_),()=>{S.removeEventListener("beforetoggle",$),S.removeEventListener("toggle",_)}},[]),(0,x.useLayoutEffect)(()=>{if(!R)return;let S=()=>{if(!N.current||!L.current)return;let _=L.current.getBoundingClientRect(),V=N.current.getBoundingClientRect(),je=Math.max(12,Math.min(_.left,window.innerWidth-V.width-12)),He=Math.max(12,Math.min(_.top-V.height-12,window.innerHeight-V.height-12));N.current.style.left=`${je}px`,N.current.style.top=`${He}px`};S(),re.current?.focus({preventScroll:!0});let $=new ResizeObserver(S);return N.current&&$.observe(N.current),L.current&&$.observe(L.current),window.addEventListener("resize",S),window.addEventListener("scroll",S,!0),()=>{$.disconnect(),window.removeEventListener("resize",S),window.removeEventListener("scroll",S,!0)}},[R,e]);let le=()=>{N.current?.hidePopover(),U(!1),L.current?.focus({preventScroll:!0})};return(0,d.jsxs)("div",{className:"dtb-root dtb-theme","data-wide":e,"data-band":h,children:[(0,d.jsx)(mt,{delivery:o,t}),(0,d.jsx)(bt,{wide:e,useClock:n,t,until:ae,nextLabel:ie,band:h,segments:y,hour:k,trigger:L,id:B,open:R}),(0,ne.createPortal)((0,d.jsx)("div",{ref:N,id:B,popover:"auto",role:"dialog","aria-labelledby":`${B}-title`,className:"dtb-card dtb-theme","data-band":h,onKeyDown:S=>{S.key==="Escape"&&(S.preventDefault(),S.stopPropagation(),le())},children:R&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("header",{className:"dtb-header",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"dtb-eyebrow",children:"DEEPSEEK / TIMEBAND"}),(0,d.jsx)("h2",{id:`${B}-title`,children:t("title")})]}),(0,d.jsx)("button",{type:"button",className:"dtb-close",ref:re,"aria-label":t("close"),onClick:le,children:"\xD7"})]}),(0,d.jsxs)("div",{className:"dtb-status",children:[(0,d.jsx)("span",{className:`dtb-dot dtb-${h}`}),(0,d.jsx)("strong",{children:t(h)})]}),(0,d.jsx)(ft,{useClock:n,t,until:ae,nextLabel:ie}),(0,d.jsxs)("div",{className:"dtb-date",children:[(0,d.jsx)("span",{children:t("zone")}),(0,d.jsx)("span",{children:oe&&(0,d.jsxs)(d.Fragment,{children:[t("nextSwitch")," ",oe]})})]}),(0,d.jsxs)("div",{className:"dtb-axis",role:"img","aria-label":`${t("timeline")}\uFF1A${y.map(S=>`${S.start}:00\u2013${S.end}:00 ${t(S.band)}`).join("\uFF1B")}\u3002${t("now")} ${se}`,children:[(0,d.jsxs)("div",{className:"dtb-now",style:{left:`${Math.min(91,Math.max(9,k/24*100))}%`},children:[t("now")," ",se]}),(0,d.jsx)(Ue,{segments:y,hour:k}),(0,d.jsxs)("div",{className:"dtb-ticks",children:[(0,d.jsx)("span",{children:"00"}),(0,d.jsx)("span",{children:"06"}),(0,d.jsx)("span",{children:"12"}),(0,d.jsx)("span",{children:"18"}),(0,d.jsx)("span",{children:"24"})]})]}),(0,d.jsxs)("div",{className:"dtb-day-kind",children:[b.key," ",(0,d.jsx)("span",{children:"\xB7"})," ",t(b.kind)]}),y.length>1&&(0,d.jsxs)("div",{className:"dtb-periods",children:[(0,d.jsxs)("div",{children:[(0,d.jsxs)("span",{children:[(0,d.jsx)("i",{className:`dtb-dot dtb-${b.covered?"peak":"unknown"}`}),t(b.covered?"peak":"unknown")]}),(0,d.jsx)("b",{children:"09:00\u201312:00 \xB7 14:00\u201318:00"})]}),(0,d.jsxs)("div",{children:[(0,d.jsxs)("span",{children:[(0,d.jsx)("i",{className:"dtb-dot dtb-offpeak"}),t("offpeak")]}),(0,d.jsx)("b",{children:t("rest")})]})]}),!b.covered&&(0,d.jsx)("p",{className:"dtb-note",children:t("unknownNote")}),de&&(0,d.jsx)("p",{className:"dtb-note dtb-calendar-notice",role:"status",children:t(de)}),(0,d.jsxs)("details",{className:"dtb-details",ref:I,open:P.current,children:[(0,d.jsx)("summary",{children:t("details")}),(0,d.jsx)("p",{className:"dtb-note",children:t("note")}),(0,d.jsxs)("div",{className:"dtb-reminder-settings",children:[(0,d.jsxs)("label",{className:"dtb-reminder-toggle",children:[(0,d.jsx)("span",{children:t("reminder")}),(0,d.jsx)("input",{type:"checkbox",role:"switch",checked:c.enabled,disabled:c.busy,onChange:S=>{S.currentTarget.checked&&o.primeSound(),a.setEnabled(S.currentTarget.checked)}})]}),c.enabled&&(0,d.jsx)("button",{type:"button",className:"dtb-button",onClick:s,children:t("reminderTest")}),(0,d.jsx)("p",{className:"dtb-note",children:t("reminderHint")}),p&&(0,d.jsx)("p",{className:"dtb-note dtb-test-feedback",role:"status",children:t(Pe[p.delivery])}),p?.sound==="unavailable"&&(0,d.jsx)("p",{className:"dtb-note dtb-sound-feedback",role:"status",children:t("reminderSoundError")}),c.issue&&(0,d.jsx)("p",{className:"dtb-note dtb-reminder-feedback",role:"status",children:t(pt[c.issue])})]}),(0,d.jsxs)("div",{className:"dtb-version-row",children:[(0,d.jsxs)("span",{children:["v",i.version]}),(0,d.jsx)("button",{type:"button",className:"dtb-button",disabled:l.check==="checking"||l.install==="installing",onClick:()=>{i.check()},children:t(l.check==="checking"?"updateChecking":"updateCheck")})]}),w&&(0,d.jsxs)("div",{className:"dtb-update-notice",role:"status",children:[(0,d.jsxs)("span",{children:[t("updateAvailable")," ",(0,d.jsxs)("b",{children:["v",l.latest.version]})]}),i.canInstall()?(0,d.jsx)("button",{type:"button",className:"dtb-button",disabled:l.check==="checking"||["installing","restart","applied","unknown"].includes(l.install),onClick:()=>{i.install()},children:t(l.install==="installing"?"updateInstalling":"updateInstall")}):(0,d.jsxs)("a",{href:l.latest.download,target:"_blank",rel:"noreferrer",children:[t("updateDownload")," \u2197"]}),(0,d.jsxs)("a",{href:l.latest.url,target:"_blank",rel:"noreferrer",children:[t("updateNotes")," \u2197"]}),g&&(0,d.jsx)("p",{className:"dtb-note",children:t(g)})]}),l.check==="failed"&&(0,d.jsx)("p",{className:"dtb-note",children:t("updateCheckFailed")}),l.check==="current"&&!w&&(0,d.jsx)("p",{className:"dtb-note",children:t("updateCurrent")}),(0,d.jsxs)("footer",{className:"dtb-footer",children:[(0,d.jsxs)("a",{href:f.data.source,target:"_blank",rel:"noreferrer",children:[t("calendarSource")," \u2197"]}),(0,d.jsxs)("a",{href:he,target:"_blank",rel:"noreferrer",children:[t("rule")," \u2197"]})]})]})]})}),document.body)]})}var Oe={title:"\u4ECA\u65E5\u65F6\u6BB5",zone:"\u5317\u4EAC\u65F6\u95F4 \xB7 UTC+8",peak:"\u5CF0\u65F6\u6BB5",offpeak:"\u8C37\u65F6\u6BB5",unknown:"\u5F85\u6838\u5B9E",nextPeak:"\u8DDD\u79BB\u5CF0\u65F6\u6BB5",nextOffpeak:"\u8DDD\u79BB\u8C37\u65F6\u6BB5",nextUnknown:"\u540E\u7EED\u65E5\u5386\u5F85\u66F4\u65B0",weekday:"\u5468\u4E00\u81F3\u5468\u4E94",weekend:"\u5468\u672B \xB7 \u5168\u5929\u8C37\u65F6\u6BB5",holiday:"\u516C\u5171\u5047\u671F \xB7 \u5168\u5929\u8C37\u65F6\u6BB5",unverified:"\u672C\u5E74\u5EA6\u8282\u5047\u65E5\u65E5\u5386\u5F85\u66F4\u65B0",allDay:"\u5168\u5929",rest:"\u5176\u4F59\u65F6\u6BB5",now:"\u73B0\u5728",nextSwitch:"\u4E0B\u6B21\u5207\u6362\uFF1A",close:"\u5173\u95ED\u65F6\u95F4\u8F74",open:"\u67E5\u770B\u5CF0\u8C37\u65F6\u95F4\u8F74",rule:"DeepSeek \u5B98\u65B9\u65F6\u6BB5\u89C4\u5219",details:"\u89C4\u5219\u4E0E\u63D0\u9192",note:"\u5468\u672B\uFF08\u542B\u8C03\u4F11\u4E0A\u73ED\u65E5\uFF09\u53CA\u516C\u5171\u5047\u671F\u5168\u5929\u4E3A\u8C37\u65F6\u6BB5\u3002",reminder:"\u5CF0\u65F6\u6BB5\u524D 5 \u5206\u949F\u63D0\u9192",reminderHint:"\u9ED8\u8BA4\u5173\u95ED\u3002\u5F00\u542F\u65F6\u7533\u8BF7\u901A\u77E5\u6388\u6743\uFF1B\u5E94\u7528\u8FD0\u884C\u65F6\u63D0\u9192\uFF0C\u5E76\u64AD\u653E\u8F7B\u67D4\u63D0\u793A\u97F3\u3002",reminderSoundError:"\u63D0\u793A\u97F3\u672A\u80FD\u64AD\u653E\uFF0C\u53EF\u70B9\u51FB\u300C\u6D4B\u8BD5\u63D0\u9192\u300D\u91CD\u8BD5\u3002",reminderDenied:"\u672A\u83B7\u5F97\u901A\u77E5\u6388\u6743\uFF0C\u8BF7\u5141\u8BB8\u6B64\u5E94\u7528\u7684\u901A\u77E5\u540E\u518D\u5F00\u542F\u3002",reminderUnsupported:"\u5F53\u524D\u73AF\u5883\u4E0D\u652F\u6301\u7CFB\u7EDF\u901A\u77E5\u3002",reminderStorageError:"\u63D0\u9192\u8BBE\u7F6E\u65E0\u6CD5\u4FDD\u5B58\uFF0C\u8BF7\u68C0\u67E5\u672C\u5730\u5B58\u50A8\u6743\u9650\u3002",reminderDeliveryError:"\u63D0\u9192\u53D1\u9001\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u7CFB\u7EDF\u901A\u77E5\u8BBE\u7F6E\u540E\u91CD\u65B0\u5F00\u542F\u3002",reminderTitle:"\u5373\u5C06\u8FDB\u5165\u5CF0\u65F6\u6BB5",reminderBody:"\u5317\u4EAC\u65F6\u95F4 {time} \u5F00\u59CB\u5CF0\u65F6\u6BB5\u3002",reminderTest:"\u6D4B\u8BD5\u63D0\u9192",reminderTestTitle:"\u6D4B\u8BD5\u63D0\u9192",reminderTestBody:"\u8FD9\u662F\u4E00\u6761\u6D4B\u8BD5\u63D0\u9192\u3002\u6B63\u5F0F\u63D0\u9192\u4F1A\u5728\u5CF0\u65F6\u6BB5\u5F00\u59CB\u524D 5 \u5206\u949F\u53D1\u51FA\u3002",reminderSending:"\u5E94\u7528\u5185\u63D0\u9192\u5DF2\u663E\u793A\uFF0C\u6B63\u5728\u53D1\u9001\u7CFB\u7EDF\u901A\u77E5\u2026",reminderAccepted:"\u7CFB\u7EDF\u5DF2\u63A5\u6536\u901A\u77E5\u3002\u6CA1\u6709\u6A2A\u5E45\u65F6\uFF0C\u53EF\u67E5\u770B\u901A\u77E5\u4E2D\u5FC3\u6216\u68C0\u67E5\u52FF\u6270\u6A21\u5F0F\u3002",reminderUnconfirmed:"\u7CFB\u7EDF\u672A\u786E\u8BA4\u901A\u77E5\u663E\u793A\uFF0C\u5E94\u7528\u5185\u63D0\u9192\u5DF2\u4FDD\u7559\u3002",reminderFallback:"\u7CFB\u7EDF\u901A\u77E5\u53D1\u9001\u5931\u8D25\uFF0C\u5E94\u7528\u5185\u63D0\u9192\u5DF2\u4FDD\u7559\u3002\u8BF7\u68C0\u67E5\u7CFB\u7EDF\u901A\u77E5\u8BBE\u7F6E\u3002",dismissReminder:"\u5173\u95ED\u63D0\u9192",updateAvailable:"\u6709\u65B0\u7248\u672C",updateCheck:"\u68C0\u67E5\u66F4\u65B0",updateChecking:"\u6B63\u5728\u68C0\u67E5\u2026",updateInstall:"\u66F4\u65B0",updateInstalling:"\u6B63\u5728\u66F4\u65B0\u2026",updateDownload:"\u4E0B\u8F7D\u65B0\u7248",updateNotes:"\u66F4\u65B0\u8BF4\u660E",updateRestart:"\u65B0\u7248\u5DF2\u5B89\u88C5\uFF0C\u5B8C\u5168\u9000\u51FA\u5E76\u91CD\u65B0\u6253\u5F00 Harness \u540E\u751F\u6548\u3002",updateApplied:"Harness \u5DF2\u786E\u8BA4\u5E94\u7528\u66F4\u65B0\u3002",updateUnknown:"\u66F4\u65B0\u7ED3\u679C\u5C1A\u672A\u786E\u8BA4\uFF0C\u8BF7\u5728 Harness\u300C\u63D2\u4EF6\u300D\u9875\u9762\u6838\u5BF9\u540E\u91CD\u542F\u3002",updateFailed:"\u66F4\u65B0\u672A\u6210\u529F\uFF0C\u5F53\u524D\u7248\u672C\u7EE7\u7EED\u4F7F\u7528\u3002\u53EF\u7A0D\u540E\u91CD\u8BD5\u6216\u4ECE\u53D1\u5E03\u9875\u4E0B\u8F7D\u3002",updateIncompatible:"\u65B0\u7248\u4E0E\u5F53\u524D Harness \u4E0D\u517C\u5BB9\uFF0C\u8BF7\u67E5\u770B\u66F4\u65B0\u8BF4\u660E\u3002",updateCheckFailed:"\u6682\u65F6\u65E0\u6CD5\u68C0\u67E5\u65B0\u7248\uFF0C\u8BF7\u7A0D\u540E\u70B9\u51FB\u91CD\u8BD5\u3002\u5F53\u524D\u63D2\u4EF6\u6B63\u5E38\u4F7F\u7528\u3002",updateCurrent:"\u6682\u65E0\u9700\u8981\u5B89\u88C5\u7684\u65B0\u7248\u3002",calendarSource:"\u5047\u671F\u516C\u544A\u6765\u6E90",calendarChecking:"\u6B63\u5728\u81EA\u52A8\u66F4\u65B0\u8282\u5047\u65E5\u65E5\u5386\u2026",calendarWaiting:"\u65B0\u5E74\u5EA6\u65E5\u5386\u5C1A\u672A\u53D1\u5E03\uFF0C\u5C06\u6BCF\u5929\u81EA\u52A8\u68C0\u67E5\u3002",calendarUpdateFailed:"\u65E5\u5386\u66F4\u65B0\u6682\u672A\u6210\u529F\uFF0C\u4FDD\u7559\u5DF2\u6709\u6570\u636E\u5E76\u81EA\u52A8\u91CD\u8BD5\u3002",calendarStorageError:"\u65E5\u5386\u6682\u65F6\u65E0\u6CD5\u4FDD\u5B58\uFF0C\u7EE7\u7EED\u4F7F\u7528\u5DF2\u6709\u6570\u636E\u5E76\u81EA\u52A8\u91CD\u8BD5\u3002",unknownNote:"\u7F3A\u5C11\u672C\u5E74\u5EA6\u5047\u671F\u6570\u636E\uFF0C\u5DE5\u4F5C\u65E5\u5CF0\u65F6\u6BB5\u6682\u4E0D\u4F5C\u786E\u5B9A\u5224\u65AD\u3002",timeline:"\u5317\u4EAC\u65F6\u95F4 24 \u5C0F\u65F6\u65F6\u95F4\u8F74",days:"\u5929",hours:"\u5C0F\u65F6",minutes:"\u5206\u949F",seconds:"\u79D2"},_e={title:"Today\u2019s schedule",zone:"Beijing time \xB7 UTC+8",peak:"Peak",offpeak:"Off-peak",unknown:"Unverified",nextPeak:"Until peak hours",nextOffpeak:"Until off-peak",nextUnknown:"Calendar update needed",weekday:"Monday\u2013Friday",weekend:"Weekend \xB7 off-peak all day",holiday:"Public holiday \xB7 off-peak all day",unverified:"Holiday calendar needs an update",allDay:"All day",rest:"All other hours",now:"Now",nextSwitch:"Next change:",close:"Close timeline",open:"View peak hours timeline",rule:"DeepSeek official schedule",details:"Rules and reminders",note:"Weekends (including makeup workdays) and public holidays are off-peak all day.",reminder:"Remind 5 minutes before peak",reminderHint:"Off by default. Enabling requests notification permission. Reminds with a gentle chime while the app is running.",reminderSoundError:"The chime could not play. Send a test notification to retry.",reminderDenied:"Notification permission was not granted. Allow this app\u2019s notifications, then enable reminders again.",reminderUnsupported:"System notifications are unavailable in this environment.",reminderStorageError:"Reminder settings could not be saved. Check local storage permissions.",reminderDeliveryError:"The reminder could not be delivered. Check system notification settings, then enable it again.",reminderTitle:"Peak hours start soon",reminderBody:"Peak hours start at {time} (Beijing time).",reminderTest:"Send test notification",reminderTestTitle:"Test reminder",reminderTestBody:"This is a test reminder. Peak reminders arrive 5 minutes before peak hours start.",reminderSending:"In-app reminder displayed. Sending system notification\u2026",reminderAccepted:"The system accepted the notification. If no banner appears, check Notification Center or Do Not Disturb.",reminderUnconfirmed:"System display was not confirmed. The in-app reminder remains available.",reminderFallback:"System notification failed. The in-app reminder remains available. Check system notification settings.",dismissReminder:"Dismiss reminder",updateAvailable:"Update available",updateCheck:"Check for updates",updateChecking:"Checking\u2026",updateInstall:"Update",updateInstalling:"Updating\u2026",updateDownload:"Download update",updateNotes:"Release notes",updateRestart:"Update installed. Fully quit and reopen Harness to apply it.",updateApplied:"Harness confirmed that the update was applied.",updateUnknown:"Update outcome is unconfirmed. Check Harness Plugins before restarting.",updateFailed:"Update failed. Keep using this version and retry or download from GitHub later.",updateIncompatible:"This release is incompatible with your Harness. Read its release notes.",updateCheckFailed:"Could not check for updates. Click to retry later; the plugin keeps working.",updateCurrent:"No newer release needs to be installed.",calendarSource:"Holiday notice source",calendarChecking:"Updating the holiday calendar automatically\u2026",calendarWaiting:"The new annual calendar is not published yet. Checking daily.",calendarUpdateFailed:"Calendar update failed. Keeping existing data and retrying automatically.",calendarStorageError:"Calendar could not be saved. Keeping existing data and retrying automatically.",unknownNote:"Holiday data for this year is unavailable; weekday peak periods are unverified.",timeline:"24-hour timeline in Beijing time",days:"d",hours:"h",minutes:"min",seconds:"s"};var Me=`.dtb-theme {
|
|
3
3
|
--dtb-bg: var(--dsw-alias-bg-base, #fff);
|
|
4
4
|
--dtb-text: var(--dsw-alias-label-primary, #252925);
|
|
5
5
|
--dtb-muted: var(--dsw-alias-label-tertiary, #798079);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-timeband",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.11",
|
|
4
4
|
"description": "头像旁的 DeepSeek 峰谷时段与今日时间轴",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
}
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"@deepseek-ai/dsh": "0.2.2-rc.1"
|
|
56
|
+
"@deepseek-ai/dsh": ">=0.2.2-rc.1 <0.3.0"
|
|
57
57
|
},
|
|
58
58
|
"peerDependenciesMeta": {
|
|
59
59
|
"@deepseek-ai/dsh": {
|