doipjs/dist/doip.fetchers.min.js

22 lines
1.1 MiB
JavaScript
Raw Permalink Normal View History

2024-11-25 09:52:27 -07:00
var doipFetchers=function(e){"use strict";var t=Object.freeze({__proto__:null,get activitypub(){return Or},get aspe(){return ev},get dns(){return rv},get graphql(){return nv},get http(){return ov},get irc(){return OB},get matrix(){return KB},get openpgp(){return HB},get telegram(){return NB},get xmpp(){return gS}}),r="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function n(e,t){return function(){return e.apply(t,arguments)}}const{toString:i}=Object.prototype,{getPrototypeOf:a}=Object,o=(s=Object.create(null),e=>{const t=i.call(e);return s[t]||(s[t]=t.slice(8,-1).toLowerCase())});var s;const c=e=>(e=e.toLowerCase(),t=>o(t)===e),u=e=>t=>typeof t===e,{isArray:h}=Array,l=u("undefined");const f=c("ArrayBuffer");const d=u("string"),p=u("function"),g=u("number"),A=e=>null!==e&&"object"==typeof e,y=e=>{if("object"!==o(e))return!1;const t=a(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},m=c("Date"),b=c("File"),w=c("Blob"),v=c("FileList"),I=c("URLSearchParams");function E(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let n,i;if("object"!=typeof e&&(e=[e]),h(e))for(n=0,i=e.length;n<i;n++)t.call(null,e[n],n,e);else{const i=r?Object.getOwnPropertyNames(e):Object.keys(e),a=i.length;let o;for(n=0;n<a;n++)o=i[n],t.call(null,e[o],o,e)}}function B(e,t){t=t.toLowerCase();const r=Object.keys(e);let n,i=r.length;for(;i-- >0;)if(n=r[i],t===n.toLowerCase())return n;return null}const C="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:r,_=e=>!l(e)&&e!==C;const k=(S="undefined"!=typeof Uint8Array&&a(Uint8Array),e=>S&&e instanceof S);var S;const Q=c("HTMLFormElement"),x=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),P=c("RegExp"),M=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};E(r,((r,i)=>{let a;!1!==(a=t(r,i,e))&&(n[i]=a||r)})),Object.defineProperties(e,n)},U="abcdefghijklmnopqrstuvwxyz",D="0123456789",R={DIGIT:D,ALPHA:U,ALPHA_DIGIT:U+U.toUpperCase()+D};const F=c("AsyncFunction");var T={isArray:h,isArrayBuffer:f,isBuffer:function(e){return null!==e&&!l(e)&&null!==e.constructor&&!l(e.constructor)&&p(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||p(e.append)&&("formdata"===(t=o(e))||"object"===t&&p(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&f(e.buffer),t},isString:d,isNumber:g,isBoolean:e=>!0===e||!1===e,isObject:A,isPlainObject:y,isUndefined:l,isDate:m,isFile:b,isBlob:w,isRegExp:P,isFunction:p,isStream:e=>A(e)&&p(e.pipe),isURLSearchParams:I,isTypedArray:k,isFileList:v,forEach:E,merge:function e(){const{caseless:t}=_(this)&&this||{},r={},n=(n,i)=>{const a=t&&B(r,i)||i;y(r[a])&&y(n)?r[a]=e(r[a],n):y(n)?r[a]=e({},n):h(n)?r[a]=n.slice():r[a]=n};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&E(arguments[e],n);return r},extend:(e,t,r,{allOwnKeys:i}={})=>(E(t,((t,i)=>{r&&p(t)?e[i]=n(t,r):e[i]=t}),{allOwnKeys:i}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{let i,o,s;const c={};if(t=t||{},null==e)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)s=i[o],n&&!n(s,e,t)||c[s]||(t[s]=e[s],c[s]=!0);e=!1!==r&&a(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:o,kindOfTest:c,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return-1!==n&&n===r},toArray:e=>{if(!e)return null;if(h(e))return e;let t=e.length;if(!g(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let n;for(;(n=r.n
2024-01-23 11:06:49 -07:00
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
2024-11-25 09:52:27 -07:00
***************************************************************************** */};function pm(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+t+" is not a constructor or null");function r(){this.constructor=e}dm(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function gm(e){if(!e)throw new TypeError("Assertion failed")}function Am(){}var ym=function(){function e(e){this._underlyingReader=void 0,this._readerMode=void 0,this._readableStreamController=void 0,this._pendingRead=void 0,this._underlyingStream=e,this._attachDefaultReader()}return e.prototype.start=function(e){this._readableStreamController=e},e.prototype.cancel=function(e){return gm(void 0!==this._underlyingReader),this._underlyingReader.cancel(e)},e.prototype._attachDefaultReader=function(){if("default"!==this._readerMode){this._detachReader();var e=this._underlyingStream.getReader();this._readerMode="default",this._attachReader(e)}},e.prototype._attachReader=function(e){var t=this;gm(void 0===this._underlyingReader),this._underlyingReader=e;var r=this._underlyingReader.closed;r&&r.then((function(){return t._finishPendingRead()})).then((function(){e===t._underlyingReader&&t._readableStreamController.close()}),(function(r){e===t._underlyingReader&&t._readableStreamController.error(r)})).catch(Am)},e.prototype._detachReader=function(){void 0!==this._underlyingReader&&(this._underlyingReader.releaseLock(),this._underlyingReader=void 0,this._readerMode=void 0)},e.prototype._pullWithDefaultReader=function(){var e=this;this._attachDefaultReader();var t=this._underlyingReader.read().then((function(t){var r=e._readableStreamController;t.done?e._tryClose():r.enqueue(t.value)}));return this._setPendingRead(t),t},e.prototype._tryClose=function(){try{this._readableStreamController.close()}catch(e){}},e.prototype._setPendingRead=function(e){var t,r=this,n=function(){r._pendingRead===t&&(r._pendingRead=void 0)};this._pendingRead=t=e.then(n,n)},e.prototype._finishPendingRead=function(){var e=this;if(this._pendingRead){var t=function(){return e._finishPendingRead()};return this._pendingRead.then(t,t)}},e}();function mm(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}!function(e){function t(){return null!==e&&e.apply(this,arguments)||this}pm(t,e),t.prototype.pull=function(){return this._pullWithDefaultReader()}}(ym),function(e){function t(t){var r=this,n=function(e){try{return e.getReader({mode:"byob"}).releaseLock(),!0}catch(e){return!1}}(t);return(r=e.call(this,t)||this)._supportsByob=n,r}pm(t,e),Object.defineProperty(t.prototype,"type",{get:function(){return"bytes"},enumerable:!1,configurable:!0}),t.prototype._attachByobReader=function(){if("byob"!==this._readerMode){gm(this._supportsByob),this._detachReader();var e=this._underlyingStream.getReader({mode:"byob"});this._readerMode="byob",this._attachReader(e)}},t.prototype.pull=function(){if(this._supportsByob){var e=this._readableStreamController.byobRequest;if(e)return this._pullWithByobRequest(e)}return this._pullWithDefaultReader()},t.prototype._pullWithByobRequest=function(e){var t=this;this._attachByobReader();var r=new Uint8Array(e.view.byteLength),n=this._underlyingReader.read(r).then((function(r){var n,i,a;t._readableStreamController,r.done?(t._tryClose(),e.respond(0)):(n=r.value,i=e.view,a=mm(n),mm(i).set(a,0),e.respond(r.value.byteLength))}));return this._setPendingRead(n),n}}(ym);var bm=fc((function(e){!function(e,t){function r(e,t){if(!e)throw Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function i(e,t,r){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var a;"object"==typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{a=void 0}catch(e){}function o(e,t,r){for(var n=0,i=Math.min(e.length,r),a=t;a<i;a++){var o=e.charCodeAt(a)-48;n<<=4,n|=o>=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return n}function s(e,t,r,n){for(var i=0,a=Math.min(e
2024-01-23 11:06:49 -07:00
/*!
* hash-wasm (https://www.npmjs.com/package/hash-wasm)
* (c) Dani Biro
* @license MIT
*/
2024-11-25 09:52:27 -07:00
function Gb(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}c((n=n.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;class jb{constructor(){this.mutex=Promise.resolve()}lock(){let e=()=>{};return this.mutex=this.mutex.then((()=>new Promise(e))),new Promise((t=>{e=t}))}dispatch(e){return Gb(this,void 0,void 0,(function*(){const t=yield this.lock();try{return yield Promise.resolve(e())}finally{t()}}))}}var zb;const Wb="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:r,Zb=null!==(zb=Wb.Buffer)&&void 0!==zb?zb:null,Jb=Wb.TextEncoder?new Wb.TextEncoder:null;function Vb(e,t){return(15&e)+(e>>6|e>>3&8)<<4|(15&t)+(t>>6|t>>3&8)}function Yb(e,t){const r=t.length>>1;for(let n=0;n<r;n++){const r=n<<1;e[n]=Vb(t.charCodeAt(r),t.charCodeAt(r+1))}}const $b="a".charCodeAt(0)-10,Xb="0".charCodeAt(0);function ew(e,t,r){let n=0;for(let i=0;i<r;i++){let r=t[i]>>>4;e[n++]=r>9?r+$b:r+Xb,r=15&t[i],e[n++]=r>9?r+$b:r+Xb}return String.fromCharCode.apply(null,e)}const tw=null!==Zb?e=>{if("string"==typeof e){const t=Zb.from(e,"utf8");return new Uint8Array(t.buffer,t.byteOffset,t.length)}if(Zb.isBuffer(e))return new Uint8Array(e.buffer,e.byteOffset,e.length);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Invalid data type!")}:e=>{if("string"==typeof e)return Jb.encode(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Invalid data type!")},rw="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",nw=new Uint8Array(256);for(let e=0;e<rw.length;e++)nw[rw.charCodeAt(e)]=e;function iw(e,t=!0){const r=e.length,n=r%3,i=[],a=r-n;for(let t=0;t<a;t+=3){const r=(e[t]<<16&16711680)+(e[t+1]<<8&65280)+(255&e[t+2]),n=rw.charAt(r>>18&63)+rw.charAt(r>>12&63)+rw.charAt(r>>6&63)+rw.charAt(63&r);i.push(n)}if(1===n){const n=e[r-1],a=rw.charAt(n>>2),o=rw.charAt(n<<4&63);i.push(`${a}${o}`),t&&i.push("==")}else if(2===n){const n=(e[r-2]<<8)+e[r-1],a=rw.charAt(n>>10),o=rw.charAt(n>>4&63),s=rw.charAt(n<<2&63);i.push(`${a}${o}${s}`),t&&i.push("=")}return i.join("")}function aw(e){let t=Math.floor(.75*e.length);const r=e.length;return"="===e[r-1]&&(t-=1,"="===e[r-2]&&(t-=1)),t}function ow(e){const t=aw(e),r=e.length,n=new Uint8Array(t);let i=0;for(let t=0;t<r;t+=4){const r=nw[e.charCodeAt(t)],a=nw[e.charCodeAt(t+1)],o=nw[e.charCodeAt(t+2)],s=nw[e.charCodeAt(t+3)];n[i]=r<<2|a>>4,i+=1,n[i]=(15&a)<<4|o>>2,i+=1,n[i]=(3&o)<<6|63&s,i+=1}return n}const sw=16384,cw=4,uw=new jb,hw=new Map;function lw(e,t){return Gb(this,void 0,void 0,(function*(){let r=null,n=null,i=!1;if("undefined"==typeof WebAssembly)throw new Error("WebAssembly is not supported in this environment!");const a=()=>new DataView(r.exports.memory.buffer).getUint32(r.exports.STATE_SIZE,!0),o=uw.dispatch((()=>Gb(this,void 0,void 0,(function*(){if(!hw.has(e.name)){const t=ow(e.data),r=WebAssembly.compile(t);hw.set(e.name,r)}const t=yield hw.get(e.name);r=yield WebAssembly.instantiate(t,{})})))),s=(e=null)=>{i=!0,r.exports.Hash_Init(e)},c=e=>{if(!i)throw new Error("update() called before init()");(e=>{let t=0;for(;t<e.length;){const i=e.subarray(t,t+sw);t+=i.length,n.set(i),r.exports.Hash_Update(i.length)}})(tw(e))},u=new Uint8Array(2*t),h=(e,a=null)=>{if(!i)throw new Error("digest() called before init()");return i=!1,r.exports.Hash_Final(a),"binary"===e?n.slice(0,t):ew(u,n,t)},l=e=>"string"==typeof e?e.length<sw/4:e.byteLength<sw;let f=l;switch(e.name){case"argon2":case"scrypt":f=()=>!0;break;case"blake2b":case"blake2s":f=(e,t)=>t<=512&&l(e);break;case"blake3":f=(e,t)=>0===t&&l(e);break;case"xxhash64":case"xxhash3":case"xxhash128":f=()=>!1}return yield(()=>Gb(this,void 0,void 0,(function*(){r||(yield o);const e=r.exports.Hash_GetBuffer(),t=r.exports.memory.buffer;n=new Uint8Array(t,e,sw)})))(),{getMemory:()=>n,writeMemory:(e,t