小工具整理

This commit is contained in:
Abin committed 2025-07-31 16:05:55 +08:00
commit 1011eb44e1
566 files changed
+267142

No files matched your search

@@ -0,0 +1,2 @@
(()=>{var e,t={42227:(e,t,i)=>{"use strict";var n,s,r,o,a,l;!function(e){e[e.LoggedOut=0]="LoggedOut",e[e.Locked=1]="Locked",e[e.Unlocked=2]="Unlocked"}(n||(n={})),function(e){e[e.None=0]="None",e[e.Password=1]="Password"}(s||(s={})),function(e){e[e.Login=1]="Login",e[e.SecureNote=2]="SecureNote",e[e.Card=3]="Card",e[e.Identity=4]="Identity"}(r||(r={}));class c{constructor(e){this.accountConstructor=e}create(e){return new this.accountConstructor(e)}}class d{constructor(e){this.globalStateConstructor=e}create(e){return new this.globalStateConstructor(e)}}class u{constructor(e,t){this.globalStateFactory=new d(e),this.accountFactory=new c(t)}createGlobal(e){return this.globalStateFactory.create(e)}createAccount(e){return this.accountFactory.create(e)}}!function(e){e[e.One=1]="One",e[e.Two=2]="Two",e[e.Three=3]="Three",e[e.Four=4]="Four",e[e.Five=5]="Five",e[e.Six=6]="Six",e[e.Latest=6]="Latest"}(o||(o={})),function(e){e.System="system",e.Light="light",e.Dark="dark",e.Nord="nord",e.SolarizedDark="solarizedDark"}(a||(a={}));class h{constructor(){this.base=null,this.api=null,this.identity=null,this.icons=null,this.notifications=null,this.events=null,this.webVault=null,this.keyConnector=null}static fromJSON(e){return Object.assign(new h,e)}}class p{}class y{constructor(){this.theme=a.System,this.window=new p,this.stateVersion=o.One,this.environmentUrls=new h}}!function(e){e[e.Android=0]="Android",e[e.iOS=1]="iOS",e[e.ChromeExtension=2]="ChromeExtension",e[e.FirefoxExtension=3]="FirefoxExtension",e[e.OperaExtension=4]="OperaExtension",e[e.EdgeExtension=5]="EdgeExtension",e[e.WindowsDesktop=6]="WindowsDesktop",e[e.MacOsDesktop=7]="MacOsDesktop",e[e.LinuxDesktop=8]="LinuxDesktop",e[e.ChromeBrowser=9]="ChromeBrowser",e[e.FirefoxBrowser=10]="FirefoxBrowser",e[e.OperaBrowser=11]="OperaBrowser",e[e.EdgeBrowser=12]="EdgeBrowser",e[e.IEBrowser=13]="IEBrowser",e[e.UnknownBrowser=14]="UnknownBrowser",e[e.AndroidAmazon=15]="AndroidAmazon",e[e.UWP=16]="UWP",e[e.SafariBrowser=17]="SafariBrowser",e[e.VivaldiBrowser=18]="VivaldiBrowser",e[e.VivaldiExtension=19]="VivaldiExtension",e[e.SafariExtension=20]="SafariExtension"}(l||(l={}));var v=i(96905),g=i(71469);const m="undefined"==typeof window?i(50209):null;class f{static init(){f.inited||(f.inited=!0,f.isNode=void 0!==g&&null!=g.release&&"node"===g.release.name,f.isBrowser="undefined"!=typeof window,f.isMobileBrowser=f.isBrowser&&this.isMobile(window),f.isAppleMobileBrowser=f.isBrowser&&this.isAppleMobile(window),f.isNode?f.global=i.g:f.isBrowser?f.global=window:f.global=self)}static fromB64ToArray(e){if(f.isNode)return new Uint8Array(Buffer.from(e,"base64"));{const t=f.global.atob(e),i=new Uint8Array(t.length);for(let e=0;e<t.length;e++)i[e]=t.charCodeAt(e);return i}}static fromUrlB64ToArray(e){return f.fromB64ToArray(f.fromUrlB64ToB64(e))}static fromHexToArray(e){if(f.isNode)return new Uint8Array(Buffer.from(e,"hex"));{const t=new Uint8Array(e.length/2);for(let i=0;i<e.length;i+=2)t[i/2]=parseInt(e.substr(i,2),16);return t}}static fromUtf8ToArray(e){if(f.isNode)return new Uint8Array(Buffer.from(e,"utf8"));{const t=unescape(encodeURIComponent(e)),i=new Uint8Array(t.length);for(let e=0;e<t.length;e++)i[e]=t.charCodeAt(e);return i}}static fromByteStringToArray(e){if(null==e)return null;const t=new Uint8Array(e.length);for(let i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t}static fromBufferToB64(e){if(f.isNode)return Buffer.from(e).toString("base64");{let t="";const i=new Uint8Array(e);for(let e=0;e<i.byteLength;e++)t+=String.fromCharCode(i[e]);return f.global.btoa(t)}}static fromBufferToUrlB64(e){return f.fromB64toUrlB64(f.fromBufferToB64(e))}static fromB64toUrlB64(e){return e.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}static fromBufferToUtf8(e){if(f.isNode)return Buffer.from(e).toString("utf8");{const t=new Uint8Array(e),i=String.fromCharCode.apply(null,t);return decodeURIComponent(escape(i))}}static fromBufferToByteString(e){return String.fromCharCode.apply(null,new Uint8Array(e))}static fromBufferToHex(e){if(f.isNode)return Buffer.from(e).toString("hex");{const t=new Uint8Array(e);return Array.prototype.map.call(t,(e=>("00"+e.toString(16)).slice(-2))).join("")}}static fromUrlB64ToB64(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("Illegal base64url string!")}return t}static fromUrlB64ToUtf8(e){return f.fromB64ToUtf8(f.fromUrlB64ToB64(e))}static fromUtf8ToB64(e){return f.isNode?Buffer.from(e,"utf8").toString("base64"):decodeURIComponent(escape(f.global.btoa(e)))}static fromUtf8ToUrlB64(e){return f.fromBufferToUrlB64(f.fromUtf8ToArray(e))}static fromB64ToUtf8(e){return f.isNode?Buffer.from(e,"base64").toString("utf8"):decodeURIComponent(escape(f.global.atob(e)))}static newGuid(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}static isGuid(e){return RegExp(/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5Line truncated
//# sourceMappingURL=background.js.map