1var D=Object.defineProperty;var C=(t,e,n)=>e in t?D(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var h=(t,e,n)=>C(t,typeof e!="symbol"?e+"":e,n);const B=t=>t/4294967296|0,M=t=>t>>>0;function I(t,e,n,o){const r=B(n),s=M(n);t.setUint32(e,o?s:r,o),t.setUint32(e+4,o?r:s,o)}function g(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in t&&t.BYTES_PER_ELEMENT===1}const S=t=>t?`"${t}" `:"";function L(t,e,n=""){if(g(t)&&e===void 0)return t;const o=g(t),r="",s=o?`length=${t.length}`:`type=${typeof t}`,i=S(n)+"expected Uint8Array"+r+", got "+s;throw o?new RangeError(i):new TypeError(i)}const b=(t,e)=>{if(t===null||typeof t!="object"||Array.isArray(t))throw new TypeError((e==="object"?"":`"${e}" `)+"expected object, got type="+typeof t)};function A(t,e=!0){if(t.destroyed)throw new Error("hash was destroyed");if(e&&t.finished)throw new Error("digest() was already called")}function T(t,e){L(t,void 0,"output");const n=e.outputLen;if(!(t.length>=n))throw new RangeError('"output" expected length >= '+n)}function E(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function y(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function k(t,e){return t<<e|t>>>32-e>>>0}function O(t,e,n="opts"){return b(t,"defaults"),e!==void 0&&b(e,n),Object.assign(t,e)}function V(t,e={}){if(typeof t!="function")throw new TypeError('"hashCons" expected function, got type='+typeof t);e=O({},e,"info");const n=(r,s)=>t(s).update(r).digest(),o=t(void 0);return n.outputLen=o.outputLen,n.blockLen=o.blockLen,n.canXOF=o.canXOF,n.create=r=>t(r),Object.assign(n,e),Object.freeze(n)}function m(t,e,n){return t&e^~t&n}class j{constructor(e,n,o,r){h(this,"blockLen");h(this,"outputLen");h(this,"canXOF",!1);h(this,"padOffset");h(this,"isLE");h(this,"buffer");h(this,"view");h(this,"finished",!1);h(this,"length",0);h(this,"pos",0);h(this,"destroyed",!1);this.blockLen=e,this.outputLen=n,this.padOffset=o,this.isLE=r,this.buffer=new Uint8Array(e),this.view=y(this.buffer)}update(e){A(this),L(e);const{view:n,buffer:o,blockLen:r}=this,s=e.length;let i=!1;for(let f=0;f<s;){const c=Math.min(r-this.pos,s-f);if(c===r){const u=y(e);for(;r<=s-f;f+=r)this.process(u,f);i=!0;continue}o.set(f===0&&c===s?e:e.subarray(f,f+c),this.pos),this.pos+=c,f+=c,this.pos===r&&(this.process(n,0),this.pos=0,i=!0)}return this.length+=e.length,i&&this.roundClean(),this}digestInto(e){A(this),T(e,this),this.finished=!0;const{buffer:n,view:o,blockLen:r,isLE:s}=this;let{pos:i}=this;n[i++]=128,n.fill(0,i),this.padOffset>r-i&&(this.process(o,0),n.fill(0)),I(o,r-8,this.length*8,s),this.process(o,0),this.roundClean();const f=e===n?o:y(e),c=this.outputLen,u=c/4,a=this.get();if(c%4||u>a.length)throw new Error("invalid outputLen");for(let l=0;l<u;l++)f.setUint32(4*l,a[l],s)}digest(){const{buffer:e,outputLen:n}=this;this.digestInto(e);const o=e.slice(0,n);return this.destroy(),o}_cloneIntoMeta(e){const{buffer:n,length:o,finished:r,destroyed:s,pos:i}=this;return e.destroyed=s,e.finished=r,e.length=o,e.pos=i,i&&e.buffer.set(n),e}clone(){return this._cloneInto()}}const F=Uint32Array.from([1732584193,4023233417,2562383102,271733878,3285377520]),H=Math.pow(2,32),R=Array.from({length:64},(t,e)=>Math.floor(H*Math.abs(Math.sin(e+1)))),d=F.slice(0,4),p=new Uint32Array(16),K=(()=>{const t=[[7,12,17,22],[5,9,14,20],[4,11,16,23],[6,10,15,21]];return Uint8Array.from({length:64},(e,n)=>t[Math.floor(n/16)][n%4])})();class N extends j{constructor(){super(64,16,8,!0);h(this,"A",d[0]|0);h(this,"B",d[1]|0);h(this,"C",d[2]|0);h(this,"D",d[3]|0)}get(){const{A:n,B:o,C:r,D:s}=this;return[n,o,r,s]}set(n,o,r,s){this.A=n|0,this.B=o|0,this.C=r|0,this.D=s|0}_cloneInto(n){return(n||(n=new this.constructor)).set(...this.get()),this._cloneIntoMeta(n)}process(n,o){for(let c=0;c<16;c++,o+=4)p[c]=n.getUint32(o,!0);let{A:r,B:s,C:i,D:f}=this;for(let c=0;c<64;c++){let u,a;c<16?(u=m(s,i,f),a=c):c<32?(u=m(f,s,i),a=(5*c+1)%16):c<48?(u=s^i^f,a=(3*c+5)%16):(u=i^(s|~f),a=7*c%16),u=u+r+R[c]+p[a],r=f,f=i,i=s,s=s+k(u,K[c])}r=r+this.A|0,s=s+this.B|0,i=i+this.C|0,f=f+this.D|0,this.set(r,s,i,f)}roundClean(){E(p)}destroy(){this.destroyed=!0,this.set(0,0,0,0),E(this.buffer)}}const U=V(()=>new N),P=2,$=2;function x(...t){const e=t.reduce((r,s)=>r+s.length,0),n=new Uint8Array(e);let o=0;for(const r of t)n.set(r,o),o+=r.length;return n}function w(t,e){return[t.subarray(0,e),t.subarray(e,t.length)]}const v=t=>Uint8Array.from(atob(t),e=>e.charCodeAt(0));async function Z(t,e){const{salt:n,ciphertext:o}=X(t),{key:r,iv:s}
1=await _(e,n,8,4,1),i=await window.crypto.subtle.decrypt({name:"AES-CBC",iv:s},r,o);return new TextDecoder().decode(i)}async function z(t,e){const n=window.crypto.getRandomValues(new Uint8Array(8)),{key:o,iv:r}=await _(e,n,8,4,1),s=await window.crypto.subtle.encrypt({name:"AES-CBC",iv:r},o,new TextEncoder().encode(t)),i=new Uint8Array(8+n.length+s.byteLength);return i.set(new TextEncoder().encode("Salted__"),0),i.set(n,8),i.set(new Uint8Array(s),8+n.length),btoa(String.fromCharCode(...i))}function X(t){let e,n=v(t);const[o,r]=w(n,P*4),s=new DataView(o.buffer);return s.getInt32(0)===1398893684&&s.getInt32(4)===1701076831&&([e,n]=w(r,$*4)),{ciphertext:n,salt:e}}async function _(t,e,n,o,r){const s=new TextEncoder().encode(t),i=W(s,e,n+o,r),[f,c]=w(i,n*4);return{key:await window.crypto.subtle.importKey("raw",f,"AES-CBC",!1,["encrypt","decrypt"]),iv:c}}function W(t,e,n,o){let r=new Uint8Array,s=new Uint8Array;for(;r.byteLength<n*4;){s=U(x(s,t,e));for(let i=1;i<o;i++)s=U(s);r=x(r,s)}return r}export{Z as aesDecrypt,z as aesEncrypt};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.