dns-worker 1.1.8 → 1.1.9

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.
@@ -1 +1 @@
1
- import"./vendor-utils-xrsi4rSa.js";import{$ as e,$t as t,A as ee,At as n,B as r,Bt as i,C as a,Ct as o,D as s,Dt as c,E as l,Et as u,F as d,Ft as f,G as p,Gt as m,H as h,Ht as g,I as _,It as v,J as y,K as b,Kt as x,L as S,Lt as C,M as w,Mt as T,N as E,Nt as D,O,Ot as k,P as A,Pt as j,Q as M,Qt as N,R as P,Rt as F,S as I,St as L,T as R,Tt as z,U as B,Ut as V,V as H,Vt as U,W,Wt as G,X as K,Xt as q,Y as J,Z as te,Zt as Y,_t as X,an as Z,at as Q,b as ne,bt as re,ct as ie,dt as ae,en as oe,et as se,ft as ce,gt as le,ht as ue,in as de,it as fe,j as pe,jt as me,k as he,kt as ge,lt as _e,mt as ve,nn as ye,nt as be,on as xe,ot as Se,pt as Ce,q as we,rn as Te,rt as $,st as Ee,tn as De,tt as Oe,ut as ke,v as Ae,vt as je,w as Me,wt as Ne,x as Pe,xt as Fe,y as Ie,yt as Le,z as Re,zt as ze}from"./index-D0aw4Fjy.js";export{$ as exportProfileLogs};
1
+ import"./vendor-utils-xrsi4rSa.js";import{$ as e,$t as t,A as ee,At as n,B as r,Bt as i,C as a,Ct as o,D as s,Dt as c,E as l,Et as u,F as d,Ft as f,G as p,Gt as m,H as h,Ht as g,I as _,It as v,J as y,K as b,Kt as x,L as S,Lt as C,M as w,Mt as T,N as E,Nt as D,O,Ot as k,P as A,Pt as j,Q as M,Qt as N,R as P,Rt as F,S as I,St as L,T as R,Tt as z,U as B,Ut as V,V as H,Vt as U,W,Wt as G,X as K,Xt as q,Y as J,Z as te,Zt as Y,_t as X,an as Z,at as Q,b as ne,bt as re,ct as ie,dt as ae,en as oe,et as se,ft as ce,gt as le,ht as ue,in as de,it as fe,j as pe,jt as me,k as he,kt as ge,lt as _e,mt as ve,nn as ye,nt as be,on as xe,ot as Se,pt as Ce,q as we,rn as Te,rt as $,st as Ee,tn as De,tt as Oe,ut as ke,v as Ae,vt as je,w as Me,wt as Ne,x as Pe,xt as Fe,y as Ie,yt as Le,z as Re,zt as ze}from"./index-Wx4BrrkZ.js";export{$ as exportProfileLogs};
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-C4Xdq4VV.js";import{$ as t,en as n,j as r,ut as i,vt as a}from"./vendor-react-BtC4HVVO.js";import{S as o,b as s}from"./vendor-icons-other-BTYC6Wvz.js";import{L as c,N as l,O as u,R as d,S as f,V as p,f as m,p as h,z as g}from"./vendor-ui-core-DUyKOLA8.js";import{_t as _}from"./vendor-utils-xrsi4rSa.js";import{E as v,Lt as y,b}from"./index-D0aw4Fjy.js";var x=e(o(),1),S=e(s(),1);const C=({isMobile:e,unlocking:r,onUnlockPasskey:i,onOpenRecoveryDialog:a})=>{let{t:o}=n();return(0,S.jsx)(`div`,{className:_(`mb-2 shrink-0`,e?`px-2`:`px-4`),children:(0,S.jsx)(f,{intent:p.PRIMARY,icon:`lock`,title:o(`settings.e2eeTitle`,`端到端加密日志`),children:(0,S.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center justify-between gap-3 mt-1`,children:[(0,S.jsx)(`p`,{className:`text-xs opacity-80 m-0`,children:o(`settings.e2eeUnlockPrompt`,`日志已通过端到端加密保护。请验证已授权的硬件 Passkey 或输入紧急恢复密钥以在本地解密。`)}),(0,S.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap shrink-0`,children:[(0,S.jsx)(l,{intent:p.PRIMARY,icon:`key`,small:!0,loading:r,onClick:i,className:`font-medium`,children:o(`settings.e2eeUnlockNow`,`验证 Passkey 解锁`)}),(0,S.jsx)(l,{intent:p.NONE,icon:(0,S.jsx)(t,{size:14}),small:!0,disabled:r,onClick:a,className:`font-medium`,children:o(`settings.e2eeUnlockRecovery`,`使用恢复密钥解锁`)})]})]})})})},w=({isOpen:e,onClose:t,recoveryKeyInput:r,setRecoveryKeyInput:i,recoveryError:a,unlocking:o,onSubmit:s})=>{let{t:_}=n();return(0,S.jsx)(u,{isOpen:e,onClose:t,title:_(`account.e2ee.unlockWithRecoveryTitle`,`使用恢复密钥解锁`),icon:`key`,className:`dark:bg-gray-900`,children:(0,S.jsxs)(`form`,{onSubmit:s,autoComplete:`off`,children:[(0,S.jsxs)(`div`,{className:c,children:[(0,S.jsx)(`p`,{className:`text-xs text-gray-500 dark:text-gray-400 mb-3`,children:_(`account.e2ee.unlockWithRecoveryDesc`,`请输入 30 位紧急恢复密钥。注意:根据单次使用规则,恢复密钥验证成功后将立即自动轮换。`)}),a&&(0,S.jsx)(f,{intent:p.DANGER,className:`mb-3 text-xs`,children:a}),(0,S.jsx)(h,{label:_(`account.e2ee.recoveryKeyInputLabel`,`恢复密钥`),labelFor:`recovery-key-input-logs`,children:(0,S.jsx)(m,{id:`recovery-key-input-logs`,name:`recovery_key_input_logs`,autoComplete:`off`,autoCorrect:`off`,autoCapitalize:`off`,spellCheck:!1,"data-1p-ignore":`true`,"data-lpignore":`true`,"data-bwignore":`true`,placeholder:`123456-789012-345678-901234-567890`,value:r,onChange:e=>i(e.target.value),leftIcon:`key`,className:`font-mono text-xs`,autoFocus:!0})})]}),(0,S.jsx)(`div`,{className:d,children:(0,S.jsxs)(`div`,{className:g,children:[(0,S.jsx)(l,{onClick:t,text:_(`common.cancel`,`取消`)}),(0,S.jsx)(l,{type:`submit`,intent:p.PRIMARY,loading:o,disabled:!r.trim(),text:_(`account.e2ee.unlockConfirm`,`解锁日志`)})]})})]})})},T=({rotatedKey:e,onClose:t,copiedKey:o,onCopyKey:s})=>{let{t:m}=n();return(0,S.jsxs)(u,{isOpen:!!e,onClose:t,title:m(`account.recoveryKey.autoRotatedTitle`,`恢复密钥已自动轮换`),icon:`warning-sign`,isCloseButtonShown:!1,canOutsideClickClose:!1,className:`dark:bg-gray-900`,children:[(0,S.jsxs)(`div`,{className:c,children:[(0,S.jsx)(f,{intent:p.WARNING,icon:(0,S.jsx)(r,{size:16}),className:`mb-4 text-xs`,children:m(`account.recoveryKey.autoRotatedNotice`,`根据恢复密钥单次使用规则,您的原恢复密钥已失效,系统已为您生成全新 30 位紧急恢复密钥。请务必立即复制并妥善离线保存,关闭后将无法再次查看!`)}),e&&(0,S.jsxs)(`div`,{className:`space-y-3`,children:[(0,S.jsx)(`div`,{className:`p-3 bg-gray-100 dark:bg-gray-800 rounded border border-gray-200 dark:border-gray-700 font-mono text-center text-lg font-bold tracking-widest select-all text-gray-900 dark:text-gray-100`,children:e}),(0,S.jsx)(`div`,{className:`flex justify-center`,children:(0,S.jsx)(l,{intent:p.PRIMARY,icon:o?(0,S.jsx)(a,{size:14,className:`text-green-400`}):(0,S.jsx)(i,{size:14}),text:o?m(`common.copied`,`已复制`):m(`common.copyKey`,`复制新恢复密钥`),onClick:()=>s(e)})})]})]}),(0,S.jsx)(`div`,{className:d,children:(0,S.jsx)(`div`,{className:g,children:(0,S.jsx)(l,{intent:p.SUCCESS,onClick:t,text:m(`account.recoveryKey.savedAndClose`,`我已妥善保存并继续`)})})})]})};function E({profileId:e,range:t,fetchLogs:r,onUnlocked:i,toasterRef:a}){let{t:o}=n(),[s,c]=(0,x.useState)(!1),[l,u]=(0,x.useState)(!1),[d,f]=(0,x.useState)(!1),[m,h]=(0,x.useState)(!1),[g,_]=(0,x.useState)(``),[S,C]=(0,x.useState)(``),[w,T]=(0,x.useState)(null),[E,D]=(0,x.useState)(!1),O=(0,x.useRef)(!1),k=(0,x.useRef)(e);k.current!==e&&(k.current=e,O.current=!1);let A=(0,x.useCallback)(async()=>{i?await i():r&&t&&await r(t,!0)},[i,r,t]),j=(0,x.useCallback)(async()=>{try{let t=await v.getStatus(e),n=!!(t.enabled||t.hasKeys);c(n);let r=v.isProfileUnlocked(e);if(u(r),n&&!r&&t.wrappedPasskeys&&t.wrappedPasskeys.length>0&&!O.current){O.current=!0;try{await v.unlockProfile(e)&&(u(!0),await b.reDecryptLocalLogs(e),await A())}catch(e){console.debug(`[useLogsE2ee] Silent auto-unlock skipped or cancelled:`,e)}}}catch{c(!1)}},[e,A]);return(0,x.useEffect)(()=>{j()},[j]),{isE2eeEnabled:s,isE2eeUnlocked:l,unlocking:d,recoveryDialogOpen:m,setRecoveryDialogOpen:h,recoveryKeyInput:g,setRecoveryKeyInput:_,recoveryError:S,setRecoveryError:C,rotatedKey:w,setRotatedKey:T,copiedKey:E,handleCopyRotatedKey:e=>{navigator.clipboard.writeText(e),D(!0),setTimeout(()=>D(!1),2e3)},handleUnlockPasskey:async()=>{try{f(!0),await v.unlockProfile(e)&&(u(!0),await b.reDecryptLocalLogs(e),a?.current?.show({message:o(`settings.e2eeUnlockSuccess`,`私钥已成功在此设备解锁`),intent:p.SUCCESS}),await A())}catch(e){console.error(`Failed to unlock E2EE via Passkey:`,e),a?.current?.show({message:e.message||o(`settings.e2eeUnlockError`,`验证 Passkey 解锁失败`),intent:p.DANGER})}finally{f(!1)}},handleUnlockRecoveryKey:async t=>{t.preventDefault();let n=g.trim();if(n){f(!0),C(``);try{await v.unlockWithRecoveryKey(n);try{let e=await y({recoveryKey:n});await v.wrapCurrentKeyForRecovery(e.recovery_key),T(e.recovery_key)}catch(e){console.warn(`[useLogsE2ee] Recovery key auto-rotation failed:`,e)}u(!0),h(!1),_(``),await b.reDecryptLocalLogs(e),a?.current?.show({message:o(`settings.e2eeUnlockSuccess`,`私钥已成功在此设备解锁`),intent:p.SUCCESS}),await A()}catch(e){console.error(`Failed to unlock E2EE via recovery key:`,e),C(e.message||o(`account.e2ee.recoveryUnlockFailed`,`恢复密钥无效或解析失败`))}finally{f(!1)}}}}}export{C as i,T as n,w as r,E as t};
1
+ import{i as e}from"./rolldown-runtime-C4Xdq4VV.js";import{$ as t,en as n,j as r,ut as i,vt as a}from"./vendor-react-BtC4HVVO.js";import{S as o,b as s}from"./vendor-icons-other-BTYC6Wvz.js";import{L as c,N as l,O as u,R as d,S as f,V as p,f as m,p as h,z as g}from"./vendor-ui-core-DUyKOLA8.js";import{_t as _}from"./vendor-utils-xrsi4rSa.js";import{E as v,Lt as y,b}from"./index-Wx4BrrkZ.js";var x=e(o(),1),S=e(s(),1);const C=({isMobile:e,unlocking:r,onUnlockPasskey:i,onOpenRecoveryDialog:a})=>{let{t:o}=n();return(0,S.jsx)(`div`,{className:_(`mb-2 shrink-0`,e?`px-2`:`px-4`),children:(0,S.jsx)(f,{intent:p.PRIMARY,icon:`lock`,title:o(`settings.e2eeTitle`,`端到端加密日志`),children:(0,S.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center justify-between gap-3 mt-1`,children:[(0,S.jsx)(`p`,{className:`text-xs opacity-80 m-0`,children:o(`settings.e2eeUnlockPrompt`,`日志已通过端到端加密保护。请验证已授权的硬件 Passkey 或输入紧急恢复密钥以在本地解密。`)}),(0,S.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap shrink-0`,children:[(0,S.jsx)(l,{intent:p.PRIMARY,icon:`key`,small:!0,loading:r,onClick:i,className:`font-medium`,children:o(`settings.e2eeUnlockNow`,`验证 Passkey 解锁`)}),(0,S.jsx)(l,{intent:p.NONE,icon:(0,S.jsx)(t,{size:14}),small:!0,disabled:r,onClick:a,className:`font-medium`,children:o(`settings.e2eeUnlockRecovery`,`使用恢复密钥解锁`)})]})]})})})},w=({isOpen:e,onClose:t,recoveryKeyInput:r,setRecoveryKeyInput:i,recoveryError:a,unlocking:o,onSubmit:s})=>{let{t:_}=n();return(0,S.jsx)(u,{isOpen:e,onClose:t,title:_(`account.e2ee.unlockWithRecoveryTitle`,`使用恢复密钥解锁`),icon:`key`,className:`dark:bg-gray-900`,children:(0,S.jsxs)(`form`,{onSubmit:s,autoComplete:`off`,children:[(0,S.jsxs)(`div`,{className:c,children:[(0,S.jsx)(`p`,{className:`text-xs text-gray-500 dark:text-gray-400 mb-3`,children:_(`account.e2ee.unlockWithRecoveryDesc`,`请输入 30 位紧急恢复密钥。注意:根据单次使用规则,恢复密钥验证成功后将立即自动轮换。`)}),a&&(0,S.jsx)(f,{intent:p.DANGER,className:`mb-3 text-xs`,children:a}),(0,S.jsx)(h,{label:_(`account.e2ee.recoveryKeyInputLabel`,`恢复密钥`),labelFor:`recovery-key-input-logs`,children:(0,S.jsx)(m,{id:`recovery-key-input-logs`,name:`recovery_key_input_logs`,autoComplete:`off`,autoCorrect:`off`,autoCapitalize:`off`,spellCheck:!1,"data-1p-ignore":`true`,"data-lpignore":`true`,"data-bwignore":`true`,placeholder:`123456-789012-345678-901234-567890`,value:r,onChange:e=>i(e.target.value),leftIcon:`key`,className:`font-mono text-xs`,autoFocus:!0})})]}),(0,S.jsx)(`div`,{className:d,children:(0,S.jsxs)(`div`,{className:g,children:[(0,S.jsx)(l,{onClick:t,text:_(`common.cancel`,`取消`)}),(0,S.jsx)(l,{type:`submit`,intent:p.PRIMARY,loading:o,disabled:!r.trim(),text:_(`account.e2ee.unlockConfirm`,`解锁日志`)})]})})]})})},T=({rotatedKey:e,onClose:t,copiedKey:o,onCopyKey:s})=>{let{t:m}=n();return(0,S.jsxs)(u,{isOpen:!!e,onClose:t,title:m(`account.recoveryKey.autoRotatedTitle`,`恢复密钥已自动轮换`),icon:`warning-sign`,isCloseButtonShown:!1,canOutsideClickClose:!1,className:`dark:bg-gray-900`,children:[(0,S.jsxs)(`div`,{className:c,children:[(0,S.jsx)(f,{intent:p.WARNING,icon:(0,S.jsx)(r,{size:16}),className:`mb-4 text-xs`,children:m(`account.recoveryKey.autoRotatedNotice`,`根据恢复密钥单次使用规则,您的原恢复密钥已失效,系统已为您生成全新 30 位紧急恢复密钥。请务必立即复制并妥善离线保存,关闭后将无法再次查看!`)}),e&&(0,S.jsxs)(`div`,{className:`space-y-3`,children:[(0,S.jsx)(`div`,{className:`p-3 bg-gray-100 dark:bg-gray-800 rounded border border-gray-200 dark:border-gray-700 font-mono text-center text-lg font-bold tracking-widest select-all text-gray-900 dark:text-gray-100`,children:e}),(0,S.jsx)(`div`,{className:`flex justify-center`,children:(0,S.jsx)(l,{intent:p.PRIMARY,icon:o?(0,S.jsx)(a,{size:14,className:`text-green-400`}):(0,S.jsx)(i,{size:14}),text:o?m(`common.copied`,`已复制`):m(`common.copyKey`,`复制新恢复密钥`),onClick:()=>s(e)})})]})]}),(0,S.jsx)(`div`,{className:d,children:(0,S.jsx)(`div`,{className:g,children:(0,S.jsx)(l,{intent:p.SUCCESS,onClick:t,text:m(`account.recoveryKey.savedAndClose`,`我已妥善保存并继续`)})})})]})};function E({profileId:e,range:t,fetchLogs:r,onUnlocked:i,toasterRef:a}){let{t:o}=n(),[s,c]=(0,x.useState)(!1),[l,u]=(0,x.useState)(!1),[d,f]=(0,x.useState)(!1),[m,h]=(0,x.useState)(!1),[g,_]=(0,x.useState)(``),[S,C]=(0,x.useState)(``),[w,T]=(0,x.useState)(null),[E,D]=(0,x.useState)(!1),O=(0,x.useRef)(!1),k=(0,x.useRef)(e);k.current!==e&&(k.current=e,O.current=!1);let A=(0,x.useCallback)(async()=>{i?await i():r&&t&&await r(t,!0)},[i,r,t]),j=(0,x.useCallback)(async()=>{try{let t=await v.getStatus(e),n=!!(t.enabled||t.hasKeys);c(n);let r=v.isProfileUnlocked(e);if(u(r),n&&!r&&t.wrappedPasskeys&&t.wrappedPasskeys.length>0&&!O.current){O.current=!0;try{await v.unlockProfile(e)&&(u(!0),await b.reDecryptLocalLogs(e),await A())}catch(e){console.debug(`[useLogsE2ee] Silent auto-unlock skipped or cancelled:`,e)}}}catch{c(!1)}},[e,A]);return(0,x.useEffect)(()=>{j()},[j]),{isE2eeEnabled:s,isE2eeUnlocked:l,unlocking:d,recoveryDialogOpen:m,setRecoveryDialogOpen:h,recoveryKeyInput:g,setRecoveryKeyInput:_,recoveryError:S,setRecoveryError:C,rotatedKey:w,setRotatedKey:T,copiedKey:E,handleCopyRotatedKey:e=>{navigator.clipboard.writeText(e),D(!0),setTimeout(()=>D(!1),2e3)},handleUnlockPasskey:async()=>{try{f(!0),await v.unlockProfile(e)&&(u(!0),await b.reDecryptLocalLogs(e),a?.current?.show({message:o(`settings.e2eeUnlockSuccess`,`私钥已成功在此设备解锁`),intent:p.SUCCESS}),await A())}catch(e){console.error(`Failed to unlock E2EE via Passkey:`,e),a?.current?.show({message:e.message||o(`settings.e2eeUnlockError`,`验证 Passkey 解锁失败`),intent:p.DANGER})}finally{f(!1)}},handleUnlockRecoveryKey:async t=>{t.preventDefault();let n=g.trim();if(n){f(!0),C(``);try{await v.unlockWithRecoveryKey(n);try{let e=await y({recoveryKey:n});await v.wrapCurrentKeyForRecovery(e.recovery_key),T(e.recovery_key)}catch(e){console.warn(`[useLogsE2ee] Recovery key auto-rotation failed:`,e)}u(!0),h(!1),_(``),await b.reDecryptLocalLogs(e),a?.current?.show({message:o(`settings.e2eeUnlockSuccess`,`私钥已成功在此设备解锁`),intent:p.SUCCESS}),await A()}catch(e){console.error(`Failed to unlock E2EE via recovery key:`,e),C(e.message||o(`account.e2ee.recoveryUnlockFailed`,`恢复密钥无效或解析失败`))}finally{f(!1)}}}}}export{C as i,T as n,w as r,E as t};
package/static/index.html CHANGED
@@ -8,7 +8,7 @@
8
8
  <link rel="shortcut icon" href="/favicon.ico">
9
9
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
10
10
  <title>DNS Worker</title>
11
- <script type="module" crossorigin src="/assets/index-D0aw4Fjy.js"></script>
11
+ <script type="module" crossorigin src="/assets/index-Wx4BrrkZ.js"></script>
12
12
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-C4Xdq4VV.js">
13
13
  <link rel="modulepreload" crossorigin href="/assets/vendor-icons-16-BgwRBCeU.js">
14
14
  <link rel="modulepreload" crossorigin href="/assets/vendor-icons-20-X5NPN60g.js">
@@ -1 +0,0 @@
1
- import{_ as e,g as t,h as n}from"./index-D0aw4Fjy.js";export{t as setSystemLocale,e as setSystemTimeZone};