wowok_agent
Version:
Create, collaborate, and transact on your own terms with the AI-driven web3 collaboration protocol.
2 lines • 7.66 kB
JavaScript
/*! For license information please see 245.212d2f747275b2255780.js.LICENSE.txt */
;(this.webpackChunkwowok_agent=this.webpackChunkwowok_agent||[]).push([[245],{7324:(r,e,n)=>{function o(r){return r instanceof Uint8Array||ArrayBuffer.isView(r)&&"Uint8Array"===r.constructor.name}function t(r,e){return!!Array.isArray(e)&&(0===e.length||(r?e.every((r=>"string"==typeof r)):e.every((r=>Number.isSafeInteger(r)))))}function i(r){if("function"!=typeof r)throw new Error("function expected");return!0}function c(r,e){if("string"!=typeof e)throw new Error(`${r}: string expected`);return!0}function d(r){if(!Number.isSafeInteger(r))throw new Error(`invalid integer: ${r}`)}function f(r){if(!Array.isArray(r))throw new Error("array expected")}function a(r,e){if(!t(!0,e))throw new Error(`${r}: array of strings expected`)}function s(r,e){if(!t(!1,e))throw new Error(`${r}: array of numbers expected`)}function w(...r){const e=r=>r,n=(r,e)=>n=>r(e(n));return{encode:r.map((r=>r.encode)).reduceRight(n,e),decode:r.map((r=>r.decode)).reduce(n,e)}}function u(r){const e="string"==typeof r?r.split(""):r,n=e.length;a("alphabet",e);const o=new Map(e.map(((r,e)=>[r,e])));return{encode:o=>(f(o),o.map((o=>{if(!Number.isSafeInteger(o)||o<0||o>=n)throw new Error(`alphabet.encode: digit index outside alphabet "${o}". Allowed: ${r}`);return e[o]}))),decode:e=>(f(e),e.map((e=>{c("alphabet.decode",e);const n=o.get(e);if(void 0===n)throw new Error(`Unknown letter: "${e}". Allowed: ${r}`);return n})))}}function h(r=""){return c("join",r),{encode:e=>(a("join.decode",e),e.join(r)),decode:e=>(c("join.decode",e),e.split(r))}}function l(r,e="="){return d(r),c("padding",e),{encode(n){for(a("padding.encode",n);n.length*r%8;)n.push(e);return n},decode(n){a("padding.decode",n);let o=n.length;if(o*r%8)throw new Error("padding: invalid, string should have whole number of bytes");for(;o>0&&n[o-1]===e;o--)if((o-1)*r%8==0)throw new Error("padding: invalid, string has too much padding");return n.slice(0,o)}}}function p(r){return i(r),{encode:r=>r,decode:e=>r(e)}}function g(r,e,n){if(e<2)throw new Error(`convertRadix: invalid from=${e}, base cannot be less than 2`);if(n<2)throw new Error(`convertRadix: invalid to=${n}, base cannot be less than 2`);if(f(r),!r.length)return[];let o=0;const t=[],i=Array.from(r,(r=>{if(d(r),r<0||r>=e)throw new Error(`invalid integer: ${r}`);return r})),c=i.length;for(;;){let r=0,d=!0;for(let t=o;t<c;t++){const c=i[t],f=e*r,a=f+c;if(!Number.isSafeInteger(a)||f/e!==r||a-c!==f)throw new Error("convertRadix: carry overflow");const s=a/n;r=a%n;const w=Math.floor(s);if(i[t]=w,!Number.isSafeInteger(w)||w*n+r!==a)throw new Error("convertRadix: carry overflow");d&&(w?d=!1:o=t)}if(t.push(r),d)break}for(let e=0;e<r.length-1&&0===r[e];e++)t.push(0);return t.reverse()}n.d(e,{I:()=>N,tw:()=>A});const y=(r,e)=>0===e?r:y(e,r%e),E=(r,e)=>r+(e-y(r,e)),m=(()=>{let r=[];for(let e=0;e<40;e++)r.push(2**e);return r})();function v(r,e,n,o){if(f(r),e<=0||e>32)throw new Error(`convertRadix2: wrong from=${e}`);if(n<=0||n>32)throw new Error(`convertRadix2: wrong to=${n}`);if(E(e,n)>32)throw new Error(`convertRadix2: carry overflow from=${e} to=${n} carryBits=${E(e,n)}`);let t=0,i=0;const c=m[e],a=m[n]-1,s=[];for(const o of r){if(d(o),o>=c)throw new Error(`convertRadix2: invalid data word=${o} from=${e}`);if(t=t<<e|o,i+e>32)throw new Error(`convertRadix2: carry overflow pos=${i} from=${e}`);for(i+=e;i>=n;i-=n)s.push((t>>i-n&a)>>>0);const r=m[i];if(void 0===r)throw new Error("invalid carry");t&=r-1}if(t=t<<n-i&a,!o&&i>=e)throw new Error("Excess padding");if(!o&&t>0)throw new Error(`Non-zero padding: ${t}`);return o&&i>0&&s.push(t>>>0),s}function x(r,e=!1){if(d(r),r<=0||r>32)throw new Error("radix2: bits should be in (0..32]");if(E(8,r)>32||E(r,8)>32)throw new Error("radix2: carry overflow");return{encode:n=>{if(!o(n))throw new Error("radix2.encode input should be Uint8Array");return v(Array.from(n),8,r,!e)},decode:n=>(s("radix2.decode",n),Uint8Array.from(v(n,r,8,e)))}}function b(r){return i(r),function(...e){try{return r.apply(null,e)}catch(r){}}}w(x(4),u("0123456789ABCDEF"),h("")),w(x(5),u("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),l(5),h("")),w(x(5),u("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),h("")),w(x(5),u("0123456789ABCDEFGHIJKLMNOPQRSTUV"),l(5),h("")),w(x(5),u("0123456789ABCDEFGHIJKLMNOPQRSTUV"),h("")),w(x(5),u("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),h(""),p((r=>r.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")))),w(x(6),u("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),l(6),h("")),w(x(6),u("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),h("")),w(x(6),u("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),l(6),h(""));const $=(w(x(6),u("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),h("")),r=>{return w((d(e=58),{encode:r=>{if(!o(r))throw new Error("radix.encode input should be Uint8Array");return g(Array.from(r),256,e)},decode:r=>(s("radix.decode",r),Uint8Array.from(g(r,e,256)))}),u(r),h(""));var e}),A=$("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),C=($("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),$("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz"),w(u("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),h(""))),R=[996825010,642813549,513874426,1027748829,705979059];function U(r){const e=r>>25;let n=(33554431&r)<<5;for(let r=0;r<R.length;r++)1==(e>>r&1)&&(n^=R[r]);return n}function k(r,e,n=1){const o=r.length;let t=1;for(let e=0;e<o;e++){const n=r.charCodeAt(e);if(n<33||n>126)throw new Error(`Invalid prefix (${r})`);t=U(t)^n>>5}t=U(t);for(let e=0;e<o;e++)t=U(t)^31&r.charCodeAt(e);for(let r of e)t=U(t)^r;for(let r=0;r<6;r++)t=U(t);return t^=n,C.encode(v([t%m[30]],30,5,!1))}function I(r){const e="bech32"===r?1:734539939,n=x(5),t=n.decode,i=n.encode,d=b(t);function f(r,n,t=90){c("bech32.encode prefix",r),o(n)&&(n=Array.from(n)),s("bech32.encode",n);const i=r.length;if(0===i)throw new TypeError(`Invalid prefix length ${i}`);const d=i+7+n.length;if(!1!==t&&d>t)throw new TypeError(`Length ${d} exceeds limit ${t}`);const f=r.toLowerCase(),a=k(f,n,e);return`${f}1${C.encode(n)}${a}`}function a(r,n=90){c("bech32.decode input",r);const o=r.length;if(o<8||!1!==n&&o>n)throw new TypeError(`invalid string length: ${o} (${r}). Expected (8..${n})`);const t=r.toLowerCase();if(r!==t&&r!==r.toUpperCase())throw new Error("String must be lowercase or uppercase");const i=t.lastIndexOf("1");if(0===i||-1===i)throw new Error('Letter "1" must be present between prefix and data only');const d=t.slice(0,i),f=t.slice(i+1);if(f.length<6)throw new Error("Data must be at least 6 characters long");const a=C.decode(f).slice(0,-6),s=k(d,a,e);if(!f.endsWith(s))throw new Error(`Invalid checksum in ${r}: expected "${s}"`);return{prefix:d,words:a}}return{encode:f,decode:a,encodeFromBytes:function(r,e){return f(r,i(e))},decodeToBytes:function(r){const{prefix:e,words:n}=a(r,!1);return{prefix:e,words:n,bytes:t(n)}},decodeUnsafe:b(a),fromWords:t,fromWordsUnsafe:d,toWords:i}}const N=I("bech32");I("bech32m");w(x(4),u("0123456789abcdef"),h(""),p((r=>{if("string"!=typeof r||r.length%2!=0)throw new TypeError(`hex.decode: expected string, got ${typeof r} with length ${r.length}`);return r.toLowerCase()})))},9548:(r,e,n)=>{n.d(e,{kw:()=>d});var o=n(2200),t=n(4443);function i(r){if("string"!=typeof r)throw new TypeError("invalid mnemonic type: "+typeof r);return r.normalize("NFKD")}const c=r=>i("mnemonic"+r);function d(r,e=""){return(0,o.A)(t.Zf,function(r){const e=i(r),n=e.split(" ");if(![12,15,18,21,24].includes(n.length))throw new Error("Invalid mnemonic");return{nfkd:e,words:n}}(r).nfkd,c(e),{c:2048,dkLen:64})}}}]);