@opra/client 1.22.9 → 1.23.2
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.
- package/browser.js +3 -3
- package/http/http-client-base.js +6 -6
- package/package.json +3 -3
package/browser.js
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* http://www.panates.com
|
|
4
4
|
*****************************************/
|
|
5
5
|
|
|
6
|
-
var Dr=Object.create;var b=Object.defineProperty;var Mr=Object.getOwnPropertyDescriptor;var Nr=Object.getOwnPropertyNames;var Pr=Object.getPrototypeOf,qr=Object.prototype.hasOwnProperty;var Hr=(n,r,e)=>r in n?b(n,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[r]=e;var s=(n,r)=>b(n,"name",{value:r,configurable:!0});var X=(n,r)=>()=>(r||n((r={exports:{}}).exports,r),r.exports);var _r=(n,r,e,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of Nr(r))!qr.call(n,i)&&i!==e&&b(n,i,{get:()=>r[i],enumerable:!(t=Mr(r,i))||t.enumerable});return n};var jr=(n,r,e)=>(e=n!=null?Dr(Pr(n)):{},_r(r||!n||!n.__esModule?b(e,"default",{value:n,enumerable:!0}):e,n));var y=(n,r,e)=>Hr(n,typeof r!="symbol"?r+"":r,e);var xr=X(D=>{"use strict";D.byteLength=Wr;D.toByteArray=Yr;D.fromByteArray=Xr;var A=[],E=[],Or=typeof Uint8Array<"u"?Uint8Array:Array,K="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(R=0,lr=K.length;R<lr;++R)A[R]=K[R],E[K.charCodeAt(R)]=R;var R,lr;E[45]=62;E[95]=63;function yr(n){var r=n.length;if(r%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=n.indexOf("=");e===-1&&(e=r);var t=e===r?0:4-e%4;return[e,t]}s(yr,"getLens");function Wr(n){var r=yr(n),e=r[0],t=r[1];return(e+t)*3/4-t}s(Wr,"byteLength");function zr(n,r,e){return(r+e)*3/4-e}s(zr,"_byteLength");function Yr(n){var r,e=yr(n),t=e[0],i=e[1],a=new Or(zr(n,t,i)),o=0,h=i>0?t-4:t,f;for(f=0;f<h;f+=4)r=E[n.charCodeAt(f)]<<18|E[n.charCodeAt(f+1)]<<12|E[n.charCodeAt(f+2)]<<6|E[n.charCodeAt(f+3)],a[o++]=r>>16&255,a[o++]=r>>8&255,a[o++]=r&255;return i===2&&(r=E[n.charCodeAt(f)]<<2|E[n.charCodeAt(f+1)]>>4,a[o++]=r&255),i===1&&(r=E[n.charCodeAt(f)]<<10|E[n.charCodeAt(f+1)]<<4|E[n.charCodeAt(f+2)]>>2,a[o++]=r>>8&255,a[o++]=r&255),a}s(Yr,"toByteArray");function Gr(n){return A[n>>18&63]+A[n>>12&63]+A[n>>6&63]+A[n&63]}s(Gr,"tripletToBase64");function Jr(n,r,e){for(var t,i=[],a=r;a<e;a+=3)t=(n[a]<<16&16711680)+(n[a+1]<<8&65280)+(n[a+2]&255),i.push(Gr(t));return i.join("")}s(Jr,"encodeChunk");function Xr(n){for(var r,e=n.length,t=e%3,i=[],a=16383,o=0,h=e-t;o<h;o+=a)i.push(Jr(n,o,o+a>h?h:o+a));return t===1?(r=n[e-1],i.push(A[r>>2]+A[r<<4&63]+"==")):t===2&&(r=(n[e-2]<<8)+n[e-1],i.push(A[r>>10]+A[r>>4&63]+A[r<<2&63]+"=")),i.join("")}s(Xr,"fromByteArray")});var wr=X(V=>{"use strict";V.read=function(n,r,e,t,i){var a,o,h=i*8-t-1,f=(1<<h)-1,l=f>>1,c=-7,p=e?i-1:0,m=e?-1:1,x=n[r+p];for(p+=m,a=x&(1<<-c)-1,x>>=-c,c+=h;c>0;a=a*256+n[r+p],p+=m,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=t;c>0;o=o*256+n[r+p],p+=m,c-=8);if(a===0)a=1-l;else{if(a===f)return o?NaN:(x?-1:1)*(1/0);o=o+Math.pow(2,t),a=a-l}return(x?-1:1)*o*Math.pow(2,a-t)};V.write=function(n,r,e,t,i,a){var o,h,f,l=a*8-i-1,c=(1<<l)-1,p=c>>1,m=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,x=t?0:a-1,U=t?1:-1,S=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(h=isNaN(r)?1:0,o=c):(o=Math.floor(Math.log(r)/Math.LN2),r*(f=Math.pow(2,-o))<1&&(o--,f*=2),o+p>=1?r+=m/f:r+=m*Math.pow(2,1-p),r*f>=2&&(o++,f/=2),o+p>=c?(h=0,o=c):o+p>=1?(h=(r*f-1)*Math.pow(2,i),o=o+p):(h=r*Math.pow(2,p-1)*Math.pow(2,i),o=0));i>=8;n[e+x]=h&255,x+=U,h/=256,i-=8);for(o=o<<i|h,l+=i;l>0;n[e+x]=o&255,x+=U,o/=256,l-=8);n[e+x-U]|=S*128}});var Rr=X(k=>{"use strict";var Z=xr(),L=wr(),mr=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;k.Buffer=u;k.SlowBuffer=re;k.INSPECT_MAX_BYTES=50;var M=2147483647;k.kMaxLength=M;u.TYPED_ARRAY_SUPPORT=Kr();!u.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function Kr(){try{var n=new Uint8Array(1),r={foo:s(function(){return 42},"foo")};return Object.setPrototypeOf(r,Uint8Array.prototype),Object.setPrototypeOf(n,r),n.foo()===42}catch{return!1}}s(Kr,"typedArraySupport");Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:s(function(){if(u.isBuffer(this))return this.buffer},"get")});Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:s(function(){if(u.isBuffer(this))return this.byteOffset},"get")});function T(n){if(n>M)throw new RangeError('The value "'+n+'" is invalid for option "size"');var r=new Uint8Array(n);return Object.setPrototypeOf(r,u.prototype),r}s(T,"createBuffer");function u(n,r,e){if(typeof n=="number"){if(typeof r=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return er(n)}return gr(n,r,e)}s(u,"Buffer");u.poolSize=8192;function gr(n,r,e){if(typeof n=="string")return Zr(n,r);if(ArrayBuffer.isView(n))return $r(n);if(n==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof n);if(v(n,ArrayBuffer)||n&&v(n.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(v(n,SharedArrayBuffer)||n&&v(n.buffer,SharedArrayBuffer)))return Q(n,r,e);if(typeof n=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var t=n.valueOf&&n.valueOf();if(t!=null&&t!==n)return u.from(t,r,e);var i=Qr(n);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof n[Symbol.toPrimitive]=="function")return u.from(n[Symbol.toPrimitive]("string"),r,e);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof n)}s(gr,"from");u.from=function(n,r,e){return gr(n,r,e)};Object.setPrototypeOf(u.prototype,Uint8Array.prototype);Object.setPrototypeOf(u,Uint8Array);function Br(n){if(typeof n!="number")throw new TypeError('"size" argument must be of type number');if(n<0)throw new RangeError('The value "'+n+'" is invalid for option "size"')}s(Br,"assertSize");function Vr(n,r,e){return Br(n),n<=0?T(n):r!==void 0?typeof e=="string"?T(n).fill(r,e):T(n).fill(r):T(n)}s(Vr,"alloc");u.alloc=function(n,r,e){return Vr(n,r,e)};function er(n){return Br(n),T(n<0?0:tr(n)|0)}s(er,"allocUnsafe");u.allocUnsafe=function(n){return er(n)};u.allocUnsafeSlow=function(n){return er(n)};function Zr(n,r){if((typeof r!="string"||r==="")&&(r="utf8"),!u.isEncoding(r))throw new TypeError("Unknown encoding: "+r);var e=Fr(n,r)|0,t=T(e),i=t.write(n,r);return i!==e&&(t=t.slice(0,i)),t}s(Zr,"fromString");function $(n){for(var r=n.length<0?0:tr(n.length)|0,e=T(r),t=0;t<r;t+=1)e[t]=n[t]&255;return e}s($,"fromArrayLike");function $r(n){if(v(n,Uint8Array)){var r=new Uint8Array(n);return Q(r.buffer,r.byteOffset,r.byteLength)}return $(n)}s($r,"fromArrayView");function Q(n,r,e){if(r<0||n.byteLength<r)throw new RangeError('"offset" is outside of buffer bounds');if(n.byteLength<r+(e||0))throw new RangeError('"length" is outside of buffer bounds');var t;return r===void 0&&e===void 0?t=new Uint8Array(n):e===void 0?t=new Uint8Array(n,r):t=new Uint8Array(n,r,e),Object.setPrototypeOf(t,u.prototype),t}s(Q,"fromArrayBuffer");function Qr(n){if(u.isBuffer(n)){var r=tr(n.length)|0,e=T(r);return e.length===0||n.copy(e,0,0,r),e}if(n.length!==void 0)return typeof n.length!="number"||nr(n.length)?T(0):$(n);if(n.type==="Buffer"&&Array.isArray(n.data))return $(n.data)}s(Qr,"fromObject");function tr(n){if(n>=M)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+M.toString(16)+" bytes");return n|0}s(tr,"checked");function re(n){return+n!=n&&(n=0),u.alloc(+n)}s(re,"SlowBuffer");u.isBuffer=s(function(r){return r!=null&&r._isBuffer===!0&&r!==u.prototype},"isBuffer");u.compare=s(function(r,e){if(v(r,Uint8Array)&&(r=u.from(r,r.offset,r.byteLength)),v(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(r)||!u.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(r===e)return 0;for(var t=r.length,i=e.length,a=0,o=Math.min(t,i);a<o;++a)if(r[a]!==e[a]){t=r[a],i=e[a];break}return t<i?-1:i<t?1:0},"compare");u.isEncoding=s(function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},"isEncoding");u.concat=s(function(r,e){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return u.alloc(0);var t;if(e===void 0)for(e=0,t=0;t<r.length;++t)e+=r[t].length;var i=u.allocUnsafe(e),a=0;for(t=0;t<r.length;++t){var o=r[t];if(v(o,Uint8Array))a+o.length>i.length?u.from(o).copy(i,a):Uint8Array.prototype.set.call(i,o,a);else if(u.isBuffer(o))o.copy(i,a);else throw new TypeError('"list" argument must be an Array of Buffers');a+=o.length}return i},"concat");function Fr(n,r){if(u.isBuffer(n))return n.length;if(ArrayBuffer.isView(n)||v(n,ArrayBuffer))return n.byteLength;if(typeof n!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof n);var e=n.length,t=arguments.length>2&&arguments[2]===!0;if(!t&&e===0)return 0;for(var i=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":return rr(n).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return Sr(n).length;default:if(i)return t?-1:rr(n).length;r=(""+r).toLowerCase(),i=!0}}s(Fr,"byteLength");u.byteLength=Fr;function ee(n,r,e){var t=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,r>>>=0,e<=r))return"";for(n||(n="utf8");;)switch(n){case"hex":return pe(this,r,e);case"utf8":case"utf-8":return Ar(this,r,e);case"ascii":return he(this,r,e);case"latin1":case"binary":return fe(this,r,e);case"base64":return se(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ce(this,r,e);default:if(t)throw new TypeError("Unknown encoding: "+n);n=(n+"").toLowerCase(),t=!0}}s(ee,"slowToString");u.prototype._isBuffer=!0;function C(n,r,e){var t=n[r];n[r]=n[e],n[e]=t}s(C,"swap");u.prototype.swap16=s(function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<r;e+=2)C(this,e,e+1);return this},"swap16");u.prototype.swap32=s(function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<r;e+=4)C(this,e,e+3),C(this,e+1,e+2);return this},"swap32");u.prototype.swap64=s(function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<r;e+=8)C(this,e,e+7),C(this,e+1,e+6),C(this,e+2,e+5),C(this,e+3,e+4);return this},"swap64");u.prototype.toString=s(function(){var r=this.length;return r===0?"":arguments.length===0?Ar(this,0,r):ee.apply(this,arguments)},"toString");u.prototype.toLocaleString=u.prototype.toString;u.prototype.equals=s(function(r){if(!u.isBuffer(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:u.compare(this,r)===0},"equals");u.prototype.inspect=s(function(){var r="",e=k.INSPECT_MAX_BYTES;return r=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(r+=" ... "),"<Buffer "+r+">"},"inspect");mr&&(u.prototype[mr]=u.prototype.inspect);u.prototype.compare=s(function(r,e,t,i,a){if(v(r,Uint8Array)&&(r=u.from(r,r.offset,r.byteLength)),!u.isBuffer(r))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof r);if(e===void 0&&(e=0),t===void 0&&(t=r?r.length:0),i===void 0&&(i=0),a===void 0&&(a=this.length),e<0||t>r.length||i<0||a>this.length)throw new RangeError("out of range index");if(i>=a&&e>=t)return 0;if(i>=a)return-1;if(e>=t)return 1;if(e>>>=0,t>>>=0,i>>>=0,a>>>=0,this===r)return 0;for(var o=a-i,h=t-e,f=Math.min(o,h),l=this.slice(i,a),c=r.slice(e,t),p=0;p<f;++p)if(l[p]!==c[p]){o=l[p],h=c[p];break}return o<h?-1:h<o?1:0},"compare");function Ur(n,r,e,t,i){if(n.length===0)return-1;if(typeof e=="string"?(t=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,nr(e)&&(e=i?0:n.length-1),e<0&&(e=n.length+e),e>=n.length){if(i)return-1;e=n.length-1}else if(e<0)if(i)e=0;else return-1;if(typeof r=="string"&&(r=u.from(r,t)),u.isBuffer(r))return r.length===0?-1:dr(n,r,e,t,i);if(typeof r=="number")return r=r&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(n,r,e):Uint8Array.prototype.lastIndexOf.call(n,r,e):dr(n,[r],e,t,i);throw new TypeError("val must be string, number or Buffer")}s(Ur,"bidirectionalIndexOf");function dr(n,r,e,t,i){var a=1,o=n.length,h=r.length;if(t!==void 0&&(t=String(t).toLowerCase(),t==="ucs2"||t==="ucs-2"||t==="utf16le"||t==="utf-16le")){if(n.length<2||r.length<2)return-1;a=2,o/=2,h/=2,e/=2}function f(x,U){return a===1?x[U]:x.readUInt16BE(U*a)}s(f,"read");var l;if(i){var c=-1;for(l=e;l<o;l++)if(f(n,l)===f(r,c===-1?0:l-c)){if(c===-1&&(c=l),l-c+1===h)return c*a}else c!==-1&&(l-=l-c),c=-1}else for(e+h>o&&(e=o-h),l=e;l>=0;l--){for(var p=!0,m=0;m<h;m++)if(f(n,l+m)!==f(r,m)){p=!1;break}if(p)return l}return-1}s(dr,"arrayIndexOf");u.prototype.includes=s(function(r,e,t){return this.indexOf(r,e,t)!==-1},"includes");u.prototype.indexOf=s(function(r,e,t){return Ur(this,r,e,t,!0)},"indexOf");u.prototype.lastIndexOf=s(function(r,e,t){return Ur(this,r,e,t,!1)},"lastIndexOf");function te(n,r,e,t){e=Number(e)||0;var i=n.length-e;t?(t=Number(t),t>i&&(t=i)):t=i;var a=r.length;t>a/2&&(t=a/2);for(var o=0;o<t;++o){var h=parseInt(r.substr(o*2,2),16);if(nr(h))return o;n[e+o]=h}return o}s(te,"hexWrite");function ne(n,r,e,t){return N(rr(r,n.length-e),n,e,t)}s(ne,"utf8Write");function ie(n,r,e,t){return N(xe(r),n,e,t)}s(ie,"asciiWrite");function oe(n,r,e,t){return N(Sr(r),n,e,t)}s(oe,"base64Write");function ae(n,r,e,t){return N(we(r,n.length-e),n,e,t)}s(ae,"ucs2Write");u.prototype.write=s(function(r,e,t,i){if(e===void 0)i="utf8",t=this.length,e=0;else if(t===void 0&&typeof e=="string")i=e,t=this.length,e=0;else if(isFinite(e))e=e>>>0,isFinite(t)?(t=t>>>0,i===void 0&&(i="utf8")):(i=t,t=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var a=this.length-e;if((t===void 0||t>a)&&(t=a),r.length>0&&(t<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return te(this,r,e,t);case"utf8":case"utf-8":return ne(this,r,e,t);case"ascii":case"latin1":case"binary":return ie(this,r,e,t);case"base64":return oe(this,r,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ae(this,r,e,t);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},"write");u.prototype.toJSON=s(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSON");function se(n,r,e){return r===0&&e===n.length?Z.fromByteArray(n):Z.fromByteArray(n.slice(r,e))}s(se,"base64Slice");function Ar(n,r,e){e=Math.min(n.length,e);for(var t=[],i=r;i<e;){var a=n[i],o=null,h=a>239?4:a>223?3:a>191?2:1;if(i+h<=e){var f,l,c,p;switch(h){case 1:a<128&&(o=a);break;case 2:f=n[i+1],(f&192)===128&&(p=(a&31)<<6|f&63,p>127&&(o=p));break;case 3:f=n[i+1],l=n[i+2],(f&192)===128&&(l&192)===128&&(p=(a&15)<<12|(f&63)<<6|l&63,p>2047&&(p<55296||p>57343)&&(o=p));break;case 4:f=n[i+1],l=n[i+2],c=n[i+3],(f&192)===128&&(l&192)===128&&(c&192)===128&&(p=(a&15)<<18|(f&63)<<12|(l&63)<<6|c&63,p>65535&&p<1114112&&(o=p))}}o===null?(o=65533,h=1):o>65535&&(o-=65536,t.push(o>>>10&1023|55296),o=56320|o&1023),t.push(o),i+=h}return ue(t)}s(Ar,"utf8Slice");var Er=4096;function ue(n){var r=n.length;if(r<=Er)return String.fromCharCode.apply(String,n);for(var e="",t=0;t<r;)e+=String.fromCharCode.apply(String,n.slice(t,t+=Er));return e}s(ue,"decodeCodePointsArray");function he(n,r,e){var t="";e=Math.min(n.length,e);for(var i=r;i<e;++i)t+=String.fromCharCode(n[i]&127);return t}s(he,"asciiSlice");function fe(n,r,e){var t="";e=Math.min(n.length,e);for(var i=r;i<e;++i)t+=String.fromCharCode(n[i]);return t}s(fe,"latin1Slice");function pe(n,r,e){var t=n.length;(!r||r<0)&&(r=0),(!e||e<0||e>t)&&(e=t);for(var i="",a=r;a<e;++a)i+=me[n[a]];return i}s(pe,"hexSlice");function ce(n,r,e){for(var t=n.slice(r,e),i="",a=0;a<t.length-1;a+=2)i+=String.fromCharCode(t[a]+t[a+1]*256);return i}s(ce,"utf16leSlice");u.prototype.slice=s(function(r,e){var t=this.length;r=~~r,e=e===void 0?t:~~e,r<0?(r+=t,r<0&&(r=0)):r>t&&(r=t),e<0?(e+=t,e<0&&(e=0)):e>t&&(e=t),e<r&&(e=r);var i=this.subarray(r,e);return Object.setPrototypeOf(i,u.prototype),i},"slice");function w(n,r,e){if(n%1!==0||n<0)throw new RangeError("offset is not uint");if(n+r>e)throw new RangeError("Trying to access beyond buffer length")}s(w,"checkOffset");u.prototype.readUintLE=u.prototype.readUIntLE=s(function(r,e,t){r=r>>>0,e=e>>>0,t||w(r,e,this.length);for(var i=this[r],a=1,o=0;++o<e&&(a*=256);)i+=this[r+o]*a;return i},"readUIntLE");u.prototype.readUintBE=u.prototype.readUIntBE=s(function(r,e,t){r=r>>>0,e=e>>>0,t||w(r,e,this.length);for(var i=this[r+--e],a=1;e>0&&(a*=256);)i+=this[r+--e]*a;return i},"readUIntBE");u.prototype.readUint8=u.prototype.readUInt8=s(function(r,e){return r=r>>>0,e||w(r,1,this.length),this[r]},"readUInt8");u.prototype.readUint16LE=u.prototype.readUInt16LE=s(function(r,e){return r=r>>>0,e||w(r,2,this.length),this[r]|this[r+1]<<8},"readUInt16LE");u.prototype.readUint16BE=u.prototype.readUInt16BE=s(function(r,e){return r=r>>>0,e||w(r,2,this.length),this[r]<<8|this[r+1]},"readUInt16BE");u.prototype.readUint32LE=u.prototype.readUInt32LE=s(function(r,e){return r=r>>>0,e||w(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216},"readUInt32LE");u.prototype.readUint32BE=u.prototype.readUInt32BE=s(function(r,e){return r=r>>>0,e||w(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])},"readUInt32BE");u.prototype.readIntLE=s(function(r,e,t){r=r>>>0,e=e>>>0,t||w(r,e,this.length);for(var i=this[r],a=1,o=0;++o<e&&(a*=256);)i+=this[r+o]*a;return a*=128,i>=a&&(i-=Math.pow(2,8*e)),i},"readIntLE");u.prototype.readIntBE=s(function(r,e,t){r=r>>>0,e=e>>>0,t||w(r,e,this.length);for(var i=e,a=1,o=this[r+--i];i>0&&(a*=256);)o+=this[r+--i]*a;return a*=128,o>=a&&(o-=Math.pow(2,8*e)),o},"readIntBE");u.prototype.readInt8=s(function(r,e){return r=r>>>0,e||w(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]},"readInt8");u.prototype.readInt16LE=s(function(r,e){r=r>>>0,e||w(r,2,this.length);var t=this[r]|this[r+1]<<8;return t&32768?t|4294901760:t},"readInt16LE");u.prototype.readInt16BE=s(function(r,e){r=r>>>0,e||w(r,2,this.length);var t=this[r+1]|this[r]<<8;return t&32768?t|4294901760:t},"readInt16BE");u.prototype.readInt32LE=s(function(r,e){return r=r>>>0,e||w(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24},"readInt32LE");u.prototype.readInt32BE=s(function(r,e){return r=r>>>0,e||w(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]},"readInt32BE");u.prototype.readFloatLE=s(function(r,e){return r=r>>>0,e||w(r,4,this.length),L.read(this,r,!0,23,4)},"readFloatLE");u.prototype.readFloatBE=s(function(r,e){return r=r>>>0,e||w(r,4,this.length),L.read(this,r,!1,23,4)},"readFloatBE");u.prototype.readDoubleLE=s(function(r,e){return r=r>>>0,e||w(r,8,this.length),L.read(this,r,!0,52,8)},"readDoubleLE");u.prototype.readDoubleBE=s(function(r,e){return r=r>>>0,e||w(r,8,this.length),L.read(this,r,!1,52,8)},"readDoubleBE");function d(n,r,e,t,i,a){if(!u.isBuffer(n))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<a)throw new RangeError('"value" argument is out of bounds');if(e+t>n.length)throw new RangeError("Index out of range")}s(d,"checkInt");u.prototype.writeUintLE=u.prototype.writeUIntLE=s(function(r,e,t,i){if(r=+r,e=e>>>0,t=t>>>0,!i){var a=Math.pow(2,8*t)-1;d(this,r,e,t,a,0)}var o=1,h=0;for(this[e]=r&255;++h<t&&(o*=256);)this[e+h]=r/o&255;return e+t},"writeUIntLE");u.prototype.writeUintBE=u.prototype.writeUIntBE=s(function(r,e,t,i){if(r=+r,e=e>>>0,t=t>>>0,!i){var a=Math.pow(2,8*t)-1;d(this,r,e,t,a,0)}var o=t-1,h=1;for(this[e+o]=r&255;--o>=0&&(h*=256);)this[e+o]=r/h&255;return e+t},"writeUIntBE");u.prototype.writeUint8=u.prototype.writeUInt8=s(function(r,e,t){return r=+r,e=e>>>0,t||d(this,r,e,1,255,0),this[e]=r&255,e+1},"writeUInt8");u.prototype.writeUint16LE=u.prototype.writeUInt16LE=s(function(r,e,t){return r=+r,e=e>>>0,t||d(this,r,e,2,65535,0),this[e]=r&255,this[e+1]=r>>>8,e+2},"writeUInt16LE");u.prototype.writeUint16BE=u.prototype.writeUInt16BE=s(function(r,e,t){return r=+r,e=e>>>0,t||d(this,r,e,2,65535,0),this[e]=r>>>8,this[e+1]=r&255,e+2},"writeUInt16BE");u.prototype.writeUint32LE=u.prototype.writeUInt32LE=s(function(r,e,t){return r=+r,e=e>>>0,t||d(this,r,e,4,4294967295,0),this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255,e+4},"writeUInt32LE");u.prototype.writeUint32BE=u.prototype.writeUInt32BE=s(function(r,e,t){return r=+r,e=e>>>0,t||d(this,r,e,4,4294967295,0),this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255,e+4},"writeUInt32BE");u.prototype.writeIntLE=s(function(r,e,t,i){if(r=+r,e=e>>>0,!i){var a=Math.pow(2,8*t-1);d(this,r,e,t,a-1,-a)}var o=0,h=1,f=0;for(this[e]=r&255;++o<t&&(h*=256);)r<0&&f===0&&this[e+o-1]!==0&&(f=1),this[e+o]=(r/h>>0)-f&255;return e+t},"writeIntLE");u.prototype.writeIntBE=s(function(r,e,t,i){if(r=+r,e=e>>>0,!i){var a=Math.pow(2,8*t-1);d(this,r,e,t,a-1,-a)}var o=t-1,h=1,f=0;for(this[e+o]=r&255;--o>=0&&(h*=256);)r<0&&f===0&&this[e+o+1]!==0&&(f=1),this[e+o]=(r/h>>0)-f&255;return e+t},"writeIntBE");u.prototype.writeInt8=s(function(r,e,t){return r=+r,e=e>>>0,t||d(this,r,e,1,127,-128),r<0&&(r=255+r+1),this[e]=r&255,e+1},"writeInt8");u.prototype.writeInt16LE=s(function(r,e,t){return r=+r,e=e>>>0,t||d(this,r,e,2,32767,-32768),this[e]=r&255,this[e+1]=r>>>8,e+2},"writeInt16LE");u.prototype.writeInt16BE=s(function(r,e,t){return r=+r,e=e>>>0,t||d(this,r,e,2,32767,-32768),this[e]=r>>>8,this[e+1]=r&255,e+2},"writeInt16BE");u.prototype.writeInt32LE=s(function(r,e,t){return r=+r,e=e>>>0,t||d(this,r,e,4,2147483647,-2147483648),this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24,e+4},"writeInt32LE");u.prototype.writeInt32BE=s(function(r,e,t){return r=+r,e=e>>>0,t||d(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255,e+4},"writeInt32BE");function vr(n,r,e,t,i,a){if(e+t>n.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}s(vr,"checkIEEE754");function Ir(n,r,e,t,i){return r=+r,e=e>>>0,i||vr(n,r,e,4,34028234663852886e22,-34028234663852886e22),L.write(n,r,e,t,23,4),e+4}s(Ir,"writeFloat");u.prototype.writeFloatLE=s(function(r,e,t){return Ir(this,r,e,!0,t)},"writeFloatLE");u.prototype.writeFloatBE=s(function(r,e,t){return Ir(this,r,e,!1,t)},"writeFloatBE");function Tr(n,r,e,t,i){return r=+r,e=e>>>0,i||vr(n,r,e,8,17976931348623157e292,-17976931348623157e292),L.write(n,r,e,t,52,8),e+8}s(Tr,"writeDouble");u.prototype.writeDoubleLE=s(function(r,e,t){return Tr(this,r,e,!0,t)},"writeDoubleLE");u.prototype.writeDoubleBE=s(function(r,e,t){return Tr(this,r,e,!1,t)},"writeDoubleBE");u.prototype.copy=s(function(r,e,t,i){if(!u.isBuffer(r))throw new TypeError("argument should be a Buffer");if(t||(t=0),!i&&i!==0&&(i=this.length),e>=r.length&&(e=r.length),e||(e=0),i>0&&i<t&&(i=t),i===t||r.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(t<0||t>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),r.length-e<i-t&&(i=r.length-e+t);var a=i-t;return this===r&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(e,t,i):Uint8Array.prototype.set.call(r,this.subarray(t,i),e),a},"copy");u.prototype.fill=s(function(r,e,t,i){if(typeof r=="string"){if(typeof e=="string"?(i=e,e=0,t=this.length):typeof t=="string"&&(i=t,t=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!u.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(r.length===1){var a=r.charCodeAt(0);(i==="utf8"&&a<128||i==="latin1")&&(r=a)}}else typeof r=="number"?r=r&255:typeof r=="boolean"&&(r=Number(r));if(e<0||this.length<e||this.length<t)throw new RangeError("Out of range index");if(t<=e)return this;e=e>>>0,t=t===void 0?this.length:t>>>0,r||(r=0);var o;if(typeof r=="number")for(o=e;o<t;++o)this[o]=r;else{var h=u.isBuffer(r)?r:u.from(r,i),f=h.length;if(f===0)throw new TypeError('The value "'+r+'" is invalid for argument "value"');for(o=0;o<t-e;++o)this[o+e]=h[o%f]}return this},"fill");var le=/[^+/0-9A-Za-z-_]/g;function ye(n){if(n=n.split("=")[0],n=n.trim().replace(le,""),n.length<2)return"";for(;n.length%4!==0;)n=n+"=";return n}s(ye,"base64clean");function rr(n,r){r=r||1/0;for(var e,t=n.length,i=null,a=[],o=0;o<t;++o){if(e=n.charCodeAt(o),e>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&a.push(239,191,189);continue}else if(o+1===t){(r-=3)>-1&&a.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&a.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(r-=3)>-1&&a.push(239,191,189);if(i=null,e<128){if((r-=1)<0)break;a.push(e)}else if(e<2048){if((r-=2)<0)break;a.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;a.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;a.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return a}s(rr,"utf8ToBytes");function xe(n){for(var r=[],e=0;e<n.length;++e)r.push(n.charCodeAt(e)&255);return r}s(xe,"asciiToBytes");function we(n,r){for(var e,t,i,a=[],o=0;o<n.length&&!((r-=2)<0);++o)e=n.charCodeAt(o),t=e>>8,i=e%256,a.push(i),a.push(t);return a}s(we,"utf16leToBytes");function Sr(n){return Z.toByteArray(ye(n))}s(Sr,"base64ToBytes");function N(n,r,e,t){for(var i=0;i<t&&!(i+e>=r.length||i>=n.length);++i)r[i+e]=n[i];return i}s(N,"blitBuffer");function v(n,r){return n instanceof r||n!=null&&n.constructor!=null&&n.constructor.name!=null&&n.constructor.name===r.name}s(v,"isInstance");function nr(n){return n!==n}s(nr,"numberIsNaN");var me=(function(){for(var n="0123456789abcdef",r=new Array(256),e=0;e<16;++e)for(var t=e*16,i=0;i<16;++i)r[t+i]=n[e]+n[i];return r})()});var kr=jr(Rr(),1);var de=Symbol.for("kClient"),g=Symbol.for("kBackend"),B=Symbol.for("kContext");var ir=class ir{constructor(r){y(this,"document");this.document=r?.document}};s(ir,"Backend");var P=ir;var or=class or extends Error{constructor(e,t){super(e.message);y(this,"cause");y(this,"issues");y(this,"status");this.cause=t,this.issues=e.issues||[],this.status=e.status,t&&(this.cause=t,t.stack&&(this.stack=t.stack))}};s(or,"ClientError");var q=or;var I;(function(n){n.ResponseHeader="response-header",n.Response="response",n.Body="body",n.Events="events"})(I||(I={}));import sr from"@browsery/type-is";import{omit as Ee}from"@jsopen/objects";import{isBlob as ge,isFormData as Be}from"@opra/common";import{Observable as Fe}from"rxjs";import{isReadableStreamLike as Ue}from"rxjs/internal/util/isReadableStreamLike";var ar=class ar extends P{constructor(e,t){super(t);y(this,"serviceUrl");y(this,"interceptors");let i=new URL(e);this.serviceUrl=i.toString().split("?")[0].split("#")[0],this.serviceUrl.endsWith("/")||(this.serviceUrl+="/")}};s(ar,"HttpBackend");var H=ar;var j=class j{constructor(r){y(this,"headers");y(this,"ok");y(this,"status");y(this,"statusText");y(this,"url");y(this,"body");y(this,"contentType");y(this,"hasBody",!1);this.headers=r?.headers instanceof Headers?r?.headers:new Headers(r?.headers),this.status=r?.status||200,this.statusText=r?.statusText||"OK",this.url=r?.url||null,this.ok=this.status>=200&&this.status<300,this.body=r?.body,this.hasBody=r?.body!=null||!!r?.hasBody,this.contentType=(this.headers.get("content-type")||"").split(";")[0]}clone(r){return new j({...this,...r})}};s(j,"HttpResponse");var _=j;var F;(function(n){n.Sent="Sent",n.UploadProgress="UploadProgress",n.ResponseHeader="ResponseHeader",n.DownloadProgress="DownloadProgress",n.Response="Response",n.User="User"})(F||(F={}));var ur=class ur extends H{constructor(e,t){super(e,t);y(this,"interceptors");y(this,"defaults");this.interceptors=Array.from(new Set([...t?.interceptors||[]])),this.defaults={...t?.defaults,headers:t?.defaults?.headers instanceof Headers?t?.defaults?.headers:new Headers(t?.defaults?.headers),params:t?.defaults?.params instanceof URLSearchParams?t?.defaults?.params:new URLSearchParams(t?.defaults?.params)}}handle(e){return new Fe(t=>{(async()=>{let i=this.prepareRequest(e);if(i.body&&e.reportProgress){let c=i.body,p=i.headers.get("content-length")||"0",m=parseInt(p,10)||0,x=0,U=new TransformStream({transform(S,J){J.enqueue(S),x+=S.byteLength,t.next({type:F.UploadProgress,request:i,total:m,loaded:x})}});i=new Request(i.url,{cache:i.cache,credentials:i.credentials,headers:i.headers,integrity:i.integrity,keepalive:i.keepalive,method:i.method,mode:i.mode,redirect:i.redirect,referrer:i.referrer,referrerPolicy:i.referrerPolicy,signal:i.signal,body:c.pipeThrough(U),window:e.window,duplex:"half"})}let a=this.send(i);t.next({request:i,type:F.Sent});let o=await a,h=this.createResponse({url:o.url,headers:o.headers,status:o.status,statusText:o.statusText,hasBody:!!o.body});t.next({request:i,type:F.ResponseHeader,response:h});let f;if(o.body)if(e.reportProgress){let c=o.body,p=o.headers.get("content-length")||"0",m=parseInt(p,10)||0,x=0,U=new Response(new ReadableStream({async start(S){let J=c.getReader();for(;;){let{done:br,value:cr}=await J.read();if(br)break;x+=cr.byteLength,S.enqueue(cr),t.next({type:F.DownloadProgress,request:i,total:m,loaded:x})}S.close()}}));f=await this.parseBody(U)}else f=await this.parseBody(o);let l=this.createResponse({url:o.url,headers:o.headers,status:o.status,statusText:o.statusText,body:f});t.next({request:i,type:F.Response,response:l}),t.complete()})().catch(i=>t.error(i))})}send(e){return fetch(e)}prepareRequest(e){let t=e.headers||new Headers,i={...e,...Ee(this.defaults,["headers","params"]),headers:t};this.defaults.headers.forEach((h,f)=>{t.has(f)||t.set(f,h)});let a=new URL(i.url,this.serviceUrl);this.defaults.params.size&&(this.defaults.params.forEach((h,f)=>{a.searchParams.has(f)||a.searchParams.set(f,h)}),i.url=a.toString());let o=i.body;if(o){let h="";typeof o=="string"||typeof o=="number"||typeof o=="boolean"?(h='text/plain; charset="UTF-8"',i.body=new Blob([String(o)],{type:h}),t.set("Content-Length",String(i.body.size)),delete i.duplex):Ue(o)?(h="application/octet-stream",i.duplex="half"):Buffer.isBuffer(o)?(h="application/octet-stream",t.set("Content-Length",String(o.length)),delete i.duplex):ge(o)?(h=o.type||"application/octet-stream",t.set("Content-Length",String(o.size)),delete i.duplex):(Be(o)||(h='application/json;charset="UTF-8"',i.body=new Blob([JSON.stringify(o)],{type:h}),t.set("Content-Length",String(i.body.size))),delete i.duplex),h&&!t.has("Content-Type")&&t.set("Content-Type",h)}return new Request(a.toString(),i)}createResponse(e){return new _(e)}async parseBody(e){let t,i=e.headers.get("Content-Type")||"";if(sr.is(i,["json","application/*+json"]))t=await e.json(),typeof t=="string"&&(t=JSON.parse(t));else if(sr.is(i,["text"]))t=await e.text();else if(sr.is(i,["multipart"]))t=await e.formData();else{let a=await e.arrayBuffer();a.byteLength&&(t=a)}return t}};s(ur,"FetchBackend");var O=ur;import{ApiDocumentFactory as Se}from"@opra/common";import ve from"@browsery/type-is";import{MimeTypes as Ie}from"@opra/common";import{lastValueFrom as Cr,Observable as Te}from"rxjs";var hr=class hr{constructor(r,e){y(this,"chain");y(this,"finalHandler");this.chain=r.reduceRight((t,i)=>(a,o)=>i.intercept(a,{handle:s(h=>t(h,o),"handle")}),Ae),this.finalHandler=e}handle(r){return this.chain(r,e=>this.finalHandler.handle(e))}};s(hr,"HttpInterceptorHandler");var W=hr;function Ae(n,r){return r(n)}s(Ae,"chainEnd");var Y=class Y extends Te{constructor(r,e){super(t=>{let i=this[B].observe;new W(r.interceptors||[],this[g]).handle(this[B]).subscribe({next(a){if(i===I.Events){t.next(a);return}if(i===I.ResponseHeader&&a.type===F.ResponseHeader){t.next(a.response),t.complete();return}if(a.type===F.Response){let{response:o}=a;if(i===I.Response){t.next(o),t.complete();return}let h=ve.is(a.response.contentType||"",[Ie.opra_response_json]);if(o.status>=400&&o.status<600){t.error(new q({message:o.status+" "+o.statusText,status:o.status,issues:h?o.body.errors:void 0})),t.complete();return}t.next(a.response.body),t.complete()}},error(a){t.error(a)},complete(){t.complete()}})}),Object.defineProperty(this,g,{enumerable:!1,value:r}),Object.defineProperty(this,B,{enumerable:!1,value:{...e,observe:I.Body,headers:new Headers(e?.headers)}})}clone(){return new Y(this[g],this[B])}options(r){return Object.assign(this[B],r),this}header(r,e){let t=this[B].headers;return typeof r=="object"?((r instanceof Headers?r:new Headers(r)).forEach((a,o)=>{o.toLowerCase()==="set-cookie"?t.append(o,a):t.set(o,a)}),this):(e==null||e===""?t.delete(r):t.append(r,String(e)),this)}param(r,e){e&&typeof e=="object"&&(e=JSON.stringify(e));let t=this[B].url.searchParams;return typeof r=="object"?(typeof r.forEach=="function"?r.forEach((i,a)=>t.set(String(a),String(i))):Object.entries(r).forEach(i=>t.set(String(i[0]),String(i[1]))),this):(e==null?t.delete(r):t.set(r,String(e)),this)}observe(r){if(r===this[B].observe)return this;let e=this.clone();return e[B].observe=r||I.Body,e}getBody(){return Cr(this.observe(I.Body))}getResponse(){return Cr(this.observe(I.Response))}};s(Y,"HttpRequestObservable");var z=Y;var Re=/^(\/*)(.+)/,fr=class fr{constructor(r){Object.defineProperty(this,g,{enumerable:!1,value:r})}get serviceUrl(){return this[g].serviceUrl}async fetchDocument(r){let e={},t=s(async a=>{let o=this.request("$schema",{headers:new Headers({accept:"application/json"})});a&&o.param("id",a);let h=await o.getBody().catch(f=>{throw f.message="Error fetching api schema from url ("+this.serviceUrl+`).
|
|
7
|
-
`+f.message,f});if(h.references){let f=h.references;h.references={};for(let[l,c]of Object.entries(f)){if(e[c.id]===null)throw new Error("Circular reference detected");e[c.id]=null;let p=await t(c.id);h.references[l]=e[c.id]=p}}return h},"getDocument"),i=await t(r?.documentId);return await
|
|
8
|
-
`+a.message,a})}request(r,e){r=
|
|
6
|
+
var Mr=Object.create;var b=Object.defineProperty;var Nr=Object.getOwnPropertyDescriptor;var Pr=Object.getOwnPropertyNames;var qr=Object.getPrototypeOf,Hr=Object.prototype.hasOwnProperty;var _r=(n,r,e)=>r in n?b(n,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[r]=e;var s=(n,r)=>b(n,"name",{value:r,configurable:!0});var X=(n,r)=>()=>(r||n((r={exports:{}}).exports,r),r.exports);var jr=(n,r,e,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of Pr(r))!Hr.call(n,i)&&i!==e&&b(n,i,{get:()=>r[i],enumerable:!(t=Nr(r,i))||t.enumerable});return n};var Or=(n,r,e)=>(e=n!=null?Mr(qr(n)):{},jr(r||!n||!n.__esModule?b(e,"default",{value:n,enumerable:!0}):e,n));var y=(n,r,e)=>_r(n,typeof r!="symbol"?r+"":r,e);var xr=X(D=>{"use strict";D.byteLength=zr;D.toByteArray=Gr;D.fromByteArray=Kr;var A=[],E=[],Wr=typeof Uint8Array<"u"?Uint8Array:Array,K="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(R=0,lr=K.length;R<lr;++R)A[R]=K[R],E[K.charCodeAt(R)]=R;var R,lr;E[45]=62;E[95]=63;function yr(n){var r=n.length;if(r%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=n.indexOf("=");e===-1&&(e=r);var t=e===r?0:4-e%4;return[e,t]}s(yr,"getLens");function zr(n){var r=yr(n),e=r[0],t=r[1];return(e+t)*3/4-t}s(zr,"byteLength");function Yr(n,r,e){return(r+e)*3/4-e}s(Yr,"_byteLength");function Gr(n){var r,e=yr(n),t=e[0],i=e[1],a=new Wr(Yr(n,t,i)),o=0,h=i>0?t-4:t,f;for(f=0;f<h;f+=4)r=E[n.charCodeAt(f)]<<18|E[n.charCodeAt(f+1)]<<12|E[n.charCodeAt(f+2)]<<6|E[n.charCodeAt(f+3)],a[o++]=r>>16&255,a[o++]=r>>8&255,a[o++]=r&255;return i===2&&(r=E[n.charCodeAt(f)]<<2|E[n.charCodeAt(f+1)]>>4,a[o++]=r&255),i===1&&(r=E[n.charCodeAt(f)]<<10|E[n.charCodeAt(f+1)]<<4|E[n.charCodeAt(f+2)]>>2,a[o++]=r>>8&255,a[o++]=r&255),a}s(Gr,"toByteArray");function Jr(n){return A[n>>18&63]+A[n>>12&63]+A[n>>6&63]+A[n&63]}s(Jr,"tripletToBase64");function Xr(n,r,e){for(var t,i=[],a=r;a<e;a+=3)t=(n[a]<<16&16711680)+(n[a+1]<<8&65280)+(n[a+2]&255),i.push(Jr(t));return i.join("")}s(Xr,"encodeChunk");function Kr(n){for(var r,e=n.length,t=e%3,i=[],a=16383,o=0,h=e-t;o<h;o+=a)i.push(Xr(n,o,o+a>h?h:o+a));return t===1?(r=n[e-1],i.push(A[r>>2]+A[r<<4&63]+"==")):t===2&&(r=(n[e-2]<<8)+n[e-1],i.push(A[r>>10]+A[r>>4&63]+A[r<<2&63]+"=")),i.join("")}s(Kr,"fromByteArray")});var wr=X(V=>{"use strict";V.read=function(n,r,e,t,i){var a,o,h=i*8-t-1,f=(1<<h)-1,l=f>>1,c=-7,p=e?i-1:0,m=e?-1:1,x=n[r+p];for(p+=m,a=x&(1<<-c)-1,x>>=-c,c+=h;c>0;a=a*256+n[r+p],p+=m,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=t;c>0;o=o*256+n[r+p],p+=m,c-=8);if(a===0)a=1-l;else{if(a===f)return o?NaN:(x?-1:1)*(1/0);o=o+Math.pow(2,t),a=a-l}return(x?-1:1)*o*Math.pow(2,a-t)};V.write=function(n,r,e,t,i,a){var o,h,f,l=a*8-i-1,c=(1<<l)-1,p=c>>1,m=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,x=t?0:a-1,U=t?1:-1,S=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(h=isNaN(r)?1:0,o=c):(o=Math.floor(Math.log(r)/Math.LN2),r*(f=Math.pow(2,-o))<1&&(o--,f*=2),o+p>=1?r+=m/f:r+=m*Math.pow(2,1-p),r*f>=2&&(o++,f/=2),o+p>=c?(h=0,o=c):o+p>=1?(h=(r*f-1)*Math.pow(2,i),o=o+p):(h=r*Math.pow(2,p-1)*Math.pow(2,i),o=0));i>=8;n[e+x]=h&255,x+=U,h/=256,i-=8);for(o=o<<i|h,l+=i;l>0;n[e+x]=o&255,x+=U,o/=256,l-=8);n[e+x-U]|=S*128}});var Rr=X(k=>{"use strict";var Z=xr(),L=wr(),mr=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;k.Buffer=u;k.SlowBuffer=ee;k.INSPECT_MAX_BYTES=50;var M=2147483647;k.kMaxLength=M;u.TYPED_ARRAY_SUPPORT=Vr();!u.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function Vr(){try{var n=new Uint8Array(1),r={foo:s(function(){return 42},"foo")};return Object.setPrototypeOf(r,Uint8Array.prototype),Object.setPrototypeOf(n,r),n.foo()===42}catch{return!1}}s(Vr,"typedArraySupport");Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:s(function(){if(u.isBuffer(this))return this.buffer},"get")});Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:s(function(){if(u.isBuffer(this))return this.byteOffset},"get")});function T(n){if(n>M)throw new RangeError('The value "'+n+'" is invalid for option "size"');var r=new Uint8Array(n);return Object.setPrototypeOf(r,u.prototype),r}s(T,"createBuffer");function u(n,r,e){if(typeof n=="number"){if(typeof r=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return er(n)}return gr(n,r,e)}s(u,"Buffer");u.poolSize=8192;function gr(n,r,e){if(typeof n=="string")return $r(n,r);if(ArrayBuffer.isView(n))return Qr(n);if(n==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof n);if(v(n,ArrayBuffer)||n&&v(n.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(v(n,SharedArrayBuffer)||n&&v(n.buffer,SharedArrayBuffer)))return Q(n,r,e);if(typeof n=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var t=n.valueOf&&n.valueOf();if(t!=null&&t!==n)return u.from(t,r,e);var i=re(n);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof n[Symbol.toPrimitive]=="function")return u.from(n[Symbol.toPrimitive]("string"),r,e);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof n)}s(gr,"from");u.from=function(n,r,e){return gr(n,r,e)};Object.setPrototypeOf(u.prototype,Uint8Array.prototype);Object.setPrototypeOf(u,Uint8Array);function Br(n){if(typeof n!="number")throw new TypeError('"size" argument must be of type number');if(n<0)throw new RangeError('The value "'+n+'" is invalid for option "size"')}s(Br,"assertSize");function Zr(n,r,e){return Br(n),n<=0?T(n):r!==void 0?typeof e=="string"?T(n).fill(r,e):T(n).fill(r):T(n)}s(Zr,"alloc");u.alloc=function(n,r,e){return Zr(n,r,e)};function er(n){return Br(n),T(n<0?0:tr(n)|0)}s(er,"allocUnsafe");u.allocUnsafe=function(n){return er(n)};u.allocUnsafeSlow=function(n){return er(n)};function $r(n,r){if((typeof r!="string"||r==="")&&(r="utf8"),!u.isEncoding(r))throw new TypeError("Unknown encoding: "+r);var e=Fr(n,r)|0,t=T(e),i=t.write(n,r);return i!==e&&(t=t.slice(0,i)),t}s($r,"fromString");function $(n){for(var r=n.length<0?0:tr(n.length)|0,e=T(r),t=0;t<r;t+=1)e[t]=n[t]&255;return e}s($,"fromArrayLike");function Qr(n){if(v(n,Uint8Array)){var r=new Uint8Array(n);return Q(r.buffer,r.byteOffset,r.byteLength)}return $(n)}s(Qr,"fromArrayView");function Q(n,r,e){if(r<0||n.byteLength<r)throw new RangeError('"offset" is outside of buffer bounds');if(n.byteLength<r+(e||0))throw new RangeError('"length" is outside of buffer bounds');var t;return r===void 0&&e===void 0?t=new Uint8Array(n):e===void 0?t=new Uint8Array(n,r):t=new Uint8Array(n,r,e),Object.setPrototypeOf(t,u.prototype),t}s(Q,"fromArrayBuffer");function re(n){if(u.isBuffer(n)){var r=tr(n.length)|0,e=T(r);return e.length===0||n.copy(e,0,0,r),e}if(n.length!==void 0)return typeof n.length!="number"||nr(n.length)?T(0):$(n);if(n.type==="Buffer"&&Array.isArray(n.data))return $(n.data)}s(re,"fromObject");function tr(n){if(n>=M)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+M.toString(16)+" bytes");return n|0}s(tr,"checked");function ee(n){return+n!=n&&(n=0),u.alloc(+n)}s(ee,"SlowBuffer");u.isBuffer=s(function(r){return r!=null&&r._isBuffer===!0&&r!==u.prototype},"isBuffer");u.compare=s(function(r,e){if(v(r,Uint8Array)&&(r=u.from(r,r.offset,r.byteLength)),v(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(r)||!u.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(r===e)return 0;for(var t=r.length,i=e.length,a=0,o=Math.min(t,i);a<o;++a)if(r[a]!==e[a]){t=r[a],i=e[a];break}return t<i?-1:i<t?1:0},"compare");u.isEncoding=s(function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},"isEncoding");u.concat=s(function(r,e){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return u.alloc(0);var t;if(e===void 0)for(e=0,t=0;t<r.length;++t)e+=r[t].length;var i=u.allocUnsafe(e),a=0;for(t=0;t<r.length;++t){var o=r[t];if(v(o,Uint8Array))a+o.length>i.length?u.from(o).copy(i,a):Uint8Array.prototype.set.call(i,o,a);else if(u.isBuffer(o))o.copy(i,a);else throw new TypeError('"list" argument must be an Array of Buffers');a+=o.length}return i},"concat");function Fr(n,r){if(u.isBuffer(n))return n.length;if(ArrayBuffer.isView(n)||v(n,ArrayBuffer))return n.byteLength;if(typeof n!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof n);var e=n.length,t=arguments.length>2&&arguments[2]===!0;if(!t&&e===0)return 0;for(var i=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":return rr(n).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return Sr(n).length;default:if(i)return t?-1:rr(n).length;r=(""+r).toLowerCase(),i=!0}}s(Fr,"byteLength");u.byteLength=Fr;function te(n,r,e){var t=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,r>>>=0,e<=r))return"";for(n||(n="utf8");;)switch(n){case"hex":return ce(this,r,e);case"utf8":case"utf-8":return Ar(this,r,e);case"ascii":return fe(this,r,e);case"latin1":case"binary":return pe(this,r,e);case"base64":return ue(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return le(this,r,e);default:if(t)throw new TypeError("Unknown encoding: "+n);n=(n+"").toLowerCase(),t=!0}}s(te,"slowToString");u.prototype._isBuffer=!0;function C(n,r,e){var t=n[r];n[r]=n[e],n[e]=t}s(C,"swap");u.prototype.swap16=s(function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<r;e+=2)C(this,e,e+1);return this},"swap16");u.prototype.swap32=s(function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<r;e+=4)C(this,e,e+3),C(this,e+1,e+2);return this},"swap32");u.prototype.swap64=s(function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<r;e+=8)C(this,e,e+7),C(this,e+1,e+6),C(this,e+2,e+5),C(this,e+3,e+4);return this},"swap64");u.prototype.toString=s(function(){var r=this.length;return r===0?"":arguments.length===0?Ar(this,0,r):te.apply(this,arguments)},"toString");u.prototype.toLocaleString=u.prototype.toString;u.prototype.equals=s(function(r){if(!u.isBuffer(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:u.compare(this,r)===0},"equals");u.prototype.inspect=s(function(){var r="",e=k.INSPECT_MAX_BYTES;return r=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(r+=" ... "),"<Buffer "+r+">"},"inspect");mr&&(u.prototype[mr]=u.prototype.inspect);u.prototype.compare=s(function(r,e,t,i,a){if(v(r,Uint8Array)&&(r=u.from(r,r.offset,r.byteLength)),!u.isBuffer(r))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof r);if(e===void 0&&(e=0),t===void 0&&(t=r?r.length:0),i===void 0&&(i=0),a===void 0&&(a=this.length),e<0||t>r.length||i<0||a>this.length)throw new RangeError("out of range index");if(i>=a&&e>=t)return 0;if(i>=a)return-1;if(e>=t)return 1;if(e>>>=0,t>>>=0,i>>>=0,a>>>=0,this===r)return 0;for(var o=a-i,h=t-e,f=Math.min(o,h),l=this.slice(i,a),c=r.slice(e,t),p=0;p<f;++p)if(l[p]!==c[p]){o=l[p],h=c[p];break}return o<h?-1:h<o?1:0},"compare");function Ur(n,r,e,t,i){if(n.length===0)return-1;if(typeof e=="string"?(t=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,nr(e)&&(e=i?0:n.length-1),e<0&&(e=n.length+e),e>=n.length){if(i)return-1;e=n.length-1}else if(e<0)if(i)e=0;else return-1;if(typeof r=="string"&&(r=u.from(r,t)),u.isBuffer(r))return r.length===0?-1:dr(n,r,e,t,i);if(typeof r=="number")return r=r&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(n,r,e):Uint8Array.prototype.lastIndexOf.call(n,r,e):dr(n,[r],e,t,i);throw new TypeError("val must be string, number or Buffer")}s(Ur,"bidirectionalIndexOf");function dr(n,r,e,t,i){var a=1,o=n.length,h=r.length;if(t!==void 0&&(t=String(t).toLowerCase(),t==="ucs2"||t==="ucs-2"||t==="utf16le"||t==="utf-16le")){if(n.length<2||r.length<2)return-1;a=2,o/=2,h/=2,e/=2}function f(x,U){return a===1?x[U]:x.readUInt16BE(U*a)}s(f,"read");var l;if(i){var c=-1;for(l=e;l<o;l++)if(f(n,l)===f(r,c===-1?0:l-c)){if(c===-1&&(c=l),l-c+1===h)return c*a}else c!==-1&&(l-=l-c),c=-1}else for(e+h>o&&(e=o-h),l=e;l>=0;l--){for(var p=!0,m=0;m<h;m++)if(f(n,l+m)!==f(r,m)){p=!1;break}if(p)return l}return-1}s(dr,"arrayIndexOf");u.prototype.includes=s(function(r,e,t){return this.indexOf(r,e,t)!==-1},"includes");u.prototype.indexOf=s(function(r,e,t){return Ur(this,r,e,t,!0)},"indexOf");u.prototype.lastIndexOf=s(function(r,e,t){return Ur(this,r,e,t,!1)},"lastIndexOf");function ne(n,r,e,t){e=Number(e)||0;var i=n.length-e;t?(t=Number(t),t>i&&(t=i)):t=i;var a=r.length;t>a/2&&(t=a/2);for(var o=0;o<t;++o){var h=parseInt(r.substr(o*2,2),16);if(nr(h))return o;n[e+o]=h}return o}s(ne,"hexWrite");function ie(n,r,e,t){return N(rr(r,n.length-e),n,e,t)}s(ie,"utf8Write");function oe(n,r,e,t){return N(we(r),n,e,t)}s(oe,"asciiWrite");function ae(n,r,e,t){return N(Sr(r),n,e,t)}s(ae,"base64Write");function se(n,r,e,t){return N(me(r,n.length-e),n,e,t)}s(se,"ucs2Write");u.prototype.write=s(function(r,e,t,i){if(e===void 0)i="utf8",t=this.length,e=0;else if(t===void 0&&typeof e=="string")i=e,t=this.length,e=0;else if(isFinite(e))e=e>>>0,isFinite(t)?(t=t>>>0,i===void 0&&(i="utf8")):(i=t,t=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var a=this.length-e;if((t===void 0||t>a)&&(t=a),r.length>0&&(t<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return ne(this,r,e,t);case"utf8":case"utf-8":return ie(this,r,e,t);case"ascii":case"latin1":case"binary":return oe(this,r,e,t);case"base64":return ae(this,r,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return se(this,r,e,t);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},"write");u.prototype.toJSON=s(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSON");function ue(n,r,e){return r===0&&e===n.length?Z.fromByteArray(n):Z.fromByteArray(n.slice(r,e))}s(ue,"base64Slice");function Ar(n,r,e){e=Math.min(n.length,e);for(var t=[],i=r;i<e;){var a=n[i],o=null,h=a>239?4:a>223?3:a>191?2:1;if(i+h<=e){var f,l,c,p;switch(h){case 1:a<128&&(o=a);break;case 2:f=n[i+1],(f&192)===128&&(p=(a&31)<<6|f&63,p>127&&(o=p));break;case 3:f=n[i+1],l=n[i+2],(f&192)===128&&(l&192)===128&&(p=(a&15)<<12|(f&63)<<6|l&63,p>2047&&(p<55296||p>57343)&&(o=p));break;case 4:f=n[i+1],l=n[i+2],c=n[i+3],(f&192)===128&&(l&192)===128&&(c&192)===128&&(p=(a&15)<<18|(f&63)<<12|(l&63)<<6|c&63,p>65535&&p<1114112&&(o=p))}}o===null?(o=65533,h=1):o>65535&&(o-=65536,t.push(o>>>10&1023|55296),o=56320|o&1023),t.push(o),i+=h}return he(t)}s(Ar,"utf8Slice");var Er=4096;function he(n){var r=n.length;if(r<=Er)return String.fromCharCode.apply(String,n);for(var e="",t=0;t<r;)e+=String.fromCharCode.apply(String,n.slice(t,t+=Er));return e}s(he,"decodeCodePointsArray");function fe(n,r,e){var t="";e=Math.min(n.length,e);for(var i=r;i<e;++i)t+=String.fromCharCode(n[i]&127);return t}s(fe,"asciiSlice");function pe(n,r,e){var t="";e=Math.min(n.length,e);for(var i=r;i<e;++i)t+=String.fromCharCode(n[i]);return t}s(pe,"latin1Slice");function ce(n,r,e){var t=n.length;(!r||r<0)&&(r=0),(!e||e<0||e>t)&&(e=t);for(var i="",a=r;a<e;++a)i+=de[n[a]];return i}s(ce,"hexSlice");function le(n,r,e){for(var t=n.slice(r,e),i="",a=0;a<t.length-1;a+=2)i+=String.fromCharCode(t[a]+t[a+1]*256);return i}s(le,"utf16leSlice");u.prototype.slice=s(function(r,e){var t=this.length;r=~~r,e=e===void 0?t:~~e,r<0?(r+=t,r<0&&(r=0)):r>t&&(r=t),e<0?(e+=t,e<0&&(e=0)):e>t&&(e=t),e<r&&(e=r);var i=this.subarray(r,e);return Object.setPrototypeOf(i,u.prototype),i},"slice");function w(n,r,e){if(n%1!==0||n<0)throw new RangeError("offset is not uint");if(n+r>e)throw new RangeError("Trying to access beyond buffer length")}s(w,"checkOffset");u.prototype.readUintLE=u.prototype.readUIntLE=s(function(r,e,t){r=r>>>0,e=e>>>0,t||w(r,e,this.length);for(var i=this[r],a=1,o=0;++o<e&&(a*=256);)i+=this[r+o]*a;return i},"readUIntLE");u.prototype.readUintBE=u.prototype.readUIntBE=s(function(r,e,t){r=r>>>0,e=e>>>0,t||w(r,e,this.length);for(var i=this[r+--e],a=1;e>0&&(a*=256);)i+=this[r+--e]*a;return i},"readUIntBE");u.prototype.readUint8=u.prototype.readUInt8=s(function(r,e){return r=r>>>0,e||w(r,1,this.length),this[r]},"readUInt8");u.prototype.readUint16LE=u.prototype.readUInt16LE=s(function(r,e){return r=r>>>0,e||w(r,2,this.length),this[r]|this[r+1]<<8},"readUInt16LE");u.prototype.readUint16BE=u.prototype.readUInt16BE=s(function(r,e){return r=r>>>0,e||w(r,2,this.length),this[r]<<8|this[r+1]},"readUInt16BE");u.prototype.readUint32LE=u.prototype.readUInt32LE=s(function(r,e){return r=r>>>0,e||w(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216},"readUInt32LE");u.prototype.readUint32BE=u.prototype.readUInt32BE=s(function(r,e){return r=r>>>0,e||w(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])},"readUInt32BE");u.prototype.readIntLE=s(function(r,e,t){r=r>>>0,e=e>>>0,t||w(r,e,this.length);for(var i=this[r],a=1,o=0;++o<e&&(a*=256);)i+=this[r+o]*a;return a*=128,i>=a&&(i-=Math.pow(2,8*e)),i},"readIntLE");u.prototype.readIntBE=s(function(r,e,t){r=r>>>0,e=e>>>0,t||w(r,e,this.length);for(var i=e,a=1,o=this[r+--i];i>0&&(a*=256);)o+=this[r+--i]*a;return a*=128,o>=a&&(o-=Math.pow(2,8*e)),o},"readIntBE");u.prototype.readInt8=s(function(r,e){return r=r>>>0,e||w(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]},"readInt8");u.prototype.readInt16LE=s(function(r,e){r=r>>>0,e||w(r,2,this.length);var t=this[r]|this[r+1]<<8;return t&32768?t|4294901760:t},"readInt16LE");u.prototype.readInt16BE=s(function(r,e){r=r>>>0,e||w(r,2,this.length);var t=this[r+1]|this[r]<<8;return t&32768?t|4294901760:t},"readInt16BE");u.prototype.readInt32LE=s(function(r,e){return r=r>>>0,e||w(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24},"readInt32LE");u.prototype.readInt32BE=s(function(r,e){return r=r>>>0,e||w(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]},"readInt32BE");u.prototype.readFloatLE=s(function(r,e){return r=r>>>0,e||w(r,4,this.length),L.read(this,r,!0,23,4)},"readFloatLE");u.prototype.readFloatBE=s(function(r,e){return r=r>>>0,e||w(r,4,this.length),L.read(this,r,!1,23,4)},"readFloatBE");u.prototype.readDoubleLE=s(function(r,e){return r=r>>>0,e||w(r,8,this.length),L.read(this,r,!0,52,8)},"readDoubleLE");u.prototype.readDoubleBE=s(function(r,e){return r=r>>>0,e||w(r,8,this.length),L.read(this,r,!1,52,8)},"readDoubleBE");function d(n,r,e,t,i,a){if(!u.isBuffer(n))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<a)throw new RangeError('"value" argument is out of bounds');if(e+t>n.length)throw new RangeError("Index out of range")}s(d,"checkInt");u.prototype.writeUintLE=u.prototype.writeUIntLE=s(function(r,e,t,i){if(r=+r,e=e>>>0,t=t>>>0,!i){var a=Math.pow(2,8*t)-1;d(this,r,e,t,a,0)}var o=1,h=0;for(this[e]=r&255;++h<t&&(o*=256);)this[e+h]=r/o&255;return e+t},"writeUIntLE");u.prototype.writeUintBE=u.prototype.writeUIntBE=s(function(r,e,t,i){if(r=+r,e=e>>>0,t=t>>>0,!i){var a=Math.pow(2,8*t)-1;d(this,r,e,t,a,0)}var o=t-1,h=1;for(this[e+o]=r&255;--o>=0&&(h*=256);)this[e+o]=r/h&255;return e+t},"writeUIntBE");u.prototype.writeUint8=u.prototype.writeUInt8=s(function(r,e,t){return r=+r,e=e>>>0,t||d(this,r,e,1,255,0),this[e]=r&255,e+1},"writeUInt8");u.prototype.writeUint16LE=u.prototype.writeUInt16LE=s(function(r,e,t){return r=+r,e=e>>>0,t||d(this,r,e,2,65535,0),this[e]=r&255,this[e+1]=r>>>8,e+2},"writeUInt16LE");u.prototype.writeUint16BE=u.prototype.writeUInt16BE=s(function(r,e,t){return r=+r,e=e>>>0,t||d(this,r,e,2,65535,0),this[e]=r>>>8,this[e+1]=r&255,e+2},"writeUInt16BE");u.prototype.writeUint32LE=u.prototype.writeUInt32LE=s(function(r,e,t){return r=+r,e=e>>>0,t||d(this,r,e,4,4294967295,0),this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255,e+4},"writeUInt32LE");u.prototype.writeUint32BE=u.prototype.writeUInt32BE=s(function(r,e,t){return r=+r,e=e>>>0,t||d(this,r,e,4,4294967295,0),this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255,e+4},"writeUInt32BE");u.prototype.writeIntLE=s(function(r,e,t,i){if(r=+r,e=e>>>0,!i){var a=Math.pow(2,8*t-1);d(this,r,e,t,a-1,-a)}var o=0,h=1,f=0;for(this[e]=r&255;++o<t&&(h*=256);)r<0&&f===0&&this[e+o-1]!==0&&(f=1),this[e+o]=(r/h>>0)-f&255;return e+t},"writeIntLE");u.prototype.writeIntBE=s(function(r,e,t,i){if(r=+r,e=e>>>0,!i){var a=Math.pow(2,8*t-1);d(this,r,e,t,a-1,-a)}var o=t-1,h=1,f=0;for(this[e+o]=r&255;--o>=0&&(h*=256);)r<0&&f===0&&this[e+o+1]!==0&&(f=1),this[e+o]=(r/h>>0)-f&255;return e+t},"writeIntBE");u.prototype.writeInt8=s(function(r,e,t){return r=+r,e=e>>>0,t||d(this,r,e,1,127,-128),r<0&&(r=255+r+1),this[e]=r&255,e+1},"writeInt8");u.prototype.writeInt16LE=s(function(r,e,t){return r=+r,e=e>>>0,t||d(this,r,e,2,32767,-32768),this[e]=r&255,this[e+1]=r>>>8,e+2},"writeInt16LE");u.prototype.writeInt16BE=s(function(r,e,t){return r=+r,e=e>>>0,t||d(this,r,e,2,32767,-32768),this[e]=r>>>8,this[e+1]=r&255,e+2},"writeInt16BE");u.prototype.writeInt32LE=s(function(r,e,t){return r=+r,e=e>>>0,t||d(this,r,e,4,2147483647,-2147483648),this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24,e+4},"writeInt32LE");u.prototype.writeInt32BE=s(function(r,e,t){return r=+r,e=e>>>0,t||d(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255,e+4},"writeInt32BE");function vr(n,r,e,t,i,a){if(e+t>n.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}s(vr,"checkIEEE754");function Ir(n,r,e,t,i){return r=+r,e=e>>>0,i||vr(n,r,e,4,34028234663852886e22,-34028234663852886e22),L.write(n,r,e,t,23,4),e+4}s(Ir,"writeFloat");u.prototype.writeFloatLE=s(function(r,e,t){return Ir(this,r,e,!0,t)},"writeFloatLE");u.prototype.writeFloatBE=s(function(r,e,t){return Ir(this,r,e,!1,t)},"writeFloatBE");function Tr(n,r,e,t,i){return r=+r,e=e>>>0,i||vr(n,r,e,8,17976931348623157e292,-17976931348623157e292),L.write(n,r,e,t,52,8),e+8}s(Tr,"writeDouble");u.prototype.writeDoubleLE=s(function(r,e,t){return Tr(this,r,e,!0,t)},"writeDoubleLE");u.prototype.writeDoubleBE=s(function(r,e,t){return Tr(this,r,e,!1,t)},"writeDoubleBE");u.prototype.copy=s(function(r,e,t,i){if(!u.isBuffer(r))throw new TypeError("argument should be a Buffer");if(t||(t=0),!i&&i!==0&&(i=this.length),e>=r.length&&(e=r.length),e||(e=0),i>0&&i<t&&(i=t),i===t||r.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(t<0||t>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),r.length-e<i-t&&(i=r.length-e+t);var a=i-t;return this===r&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(e,t,i):Uint8Array.prototype.set.call(r,this.subarray(t,i),e),a},"copy");u.prototype.fill=s(function(r,e,t,i){if(typeof r=="string"){if(typeof e=="string"?(i=e,e=0,t=this.length):typeof t=="string"&&(i=t,t=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!u.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(r.length===1){var a=r.charCodeAt(0);(i==="utf8"&&a<128||i==="latin1")&&(r=a)}}else typeof r=="number"?r=r&255:typeof r=="boolean"&&(r=Number(r));if(e<0||this.length<e||this.length<t)throw new RangeError("Out of range index");if(t<=e)return this;e=e>>>0,t=t===void 0?this.length:t>>>0,r||(r=0);var o;if(typeof r=="number")for(o=e;o<t;++o)this[o]=r;else{var h=u.isBuffer(r)?r:u.from(r,i),f=h.length;if(f===0)throw new TypeError('The value "'+r+'" is invalid for argument "value"');for(o=0;o<t-e;++o)this[o+e]=h[o%f]}return this},"fill");var ye=/[^+/0-9A-Za-z-_]/g;function xe(n){if(n=n.split("=")[0],n=n.trim().replace(ye,""),n.length<2)return"";for(;n.length%4!==0;)n=n+"=";return n}s(xe,"base64clean");function rr(n,r){r=r||1/0;for(var e,t=n.length,i=null,a=[],o=0;o<t;++o){if(e=n.charCodeAt(o),e>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&a.push(239,191,189);continue}else if(o+1===t){(r-=3)>-1&&a.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&a.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(r-=3)>-1&&a.push(239,191,189);if(i=null,e<128){if((r-=1)<0)break;a.push(e)}else if(e<2048){if((r-=2)<0)break;a.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;a.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;a.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return a}s(rr,"utf8ToBytes");function we(n){for(var r=[],e=0;e<n.length;++e)r.push(n.charCodeAt(e)&255);return r}s(we,"asciiToBytes");function me(n,r){for(var e,t,i,a=[],o=0;o<n.length&&!((r-=2)<0);++o)e=n.charCodeAt(o),t=e>>8,i=e%256,a.push(i),a.push(t);return a}s(me,"utf16leToBytes");function Sr(n){return Z.toByteArray(xe(n))}s(Sr,"base64ToBytes");function N(n,r,e,t){for(var i=0;i<t&&!(i+e>=r.length||i>=n.length);++i)r[i+e]=n[i];return i}s(N,"blitBuffer");function v(n,r){return n instanceof r||n!=null&&n.constructor!=null&&n.constructor.name!=null&&n.constructor.name===r.name}s(v,"isInstance");function nr(n){return n!==n}s(nr,"numberIsNaN");var de=(function(){for(var n="0123456789abcdef",r=new Array(256),e=0;e<16;++e)for(var t=e*16,i=0;i<16;++i)r[t+i]=n[e]+n[i];return r})()});var br=Or(Rr(),1);var Ee=Symbol.for("kClient"),g=Symbol.for("kBackend"),B=Symbol.for("kContext");var ir=class ir{constructor(r){y(this,"document");this.document=r?.document}};s(ir,"Backend");var P=ir;var or=class or extends Error{constructor(e,t){super(e.message);y(this,"cause");y(this,"issues");y(this,"status");this.cause=t,this.issues=e.issues||[],this.status=e.status,t&&(this.cause=t,t.stack&&(this.stack=t.stack))}};s(or,"ClientError");var q=or;var I;(function(n){n.ResponseHeader="response-header",n.Response="response",n.Body="body",n.Events="events"})(I||(I={}));import sr from"@browsery/type-is";import{omit as ge}from"@jsopen/objects";import{isBlob as Be,isFormData as Fe}from"@opra/common";import{Observable as Ue}from"rxjs";import{isReadableStreamLike as Ae}from"rxjs/internal/util/isReadableStreamLike";var ar=class ar extends P{constructor(e,t){super(t);y(this,"serviceUrl");y(this,"interceptors");let i=new URL(e);this.serviceUrl=i.toString().split("?")[0].split("#")[0],this.serviceUrl.endsWith("/")||(this.serviceUrl+="/")}};s(ar,"HttpBackend");var H=ar;var j=class j{constructor(r){y(this,"headers");y(this,"ok");y(this,"status");y(this,"statusText");y(this,"url");y(this,"body");y(this,"contentType");y(this,"hasBody",!1);this.headers=r?.headers instanceof Headers?r?.headers:new Headers(r?.headers),this.status=r?.status||200,this.statusText=r?.statusText||"OK",this.url=r?.url||null,this.ok=this.status>=200&&this.status<300,this.body=r?.body,this.hasBody=r?.body!=null||!!r?.hasBody,this.contentType=(this.headers.get("content-type")||"").split(";")[0]}clone(r){return new j({...this,...r})}};s(j,"HttpResponse");var _=j;var F;(function(n){n.Sent="Sent",n.UploadProgress="UploadProgress",n.ResponseHeader="ResponseHeader",n.DownloadProgress="DownloadProgress",n.Response="Response",n.User="User"})(F||(F={}));var ur=class ur extends H{constructor(e,t){super(e,t);y(this,"interceptors");y(this,"defaults");this.interceptors=Array.from(new Set([...t?.interceptors||[]])),this.defaults={...t?.defaults,headers:t?.defaults?.headers instanceof Headers?t?.defaults?.headers:new Headers(t?.defaults?.headers),params:t?.defaults?.params instanceof URLSearchParams?t?.defaults?.params:new URLSearchParams(t?.defaults?.params)}}handle(e){return new Ue(t=>{(async()=>{let i=this.prepareRequest(e);if(i.body&&e.reportProgress){let c=i.body,p=i.headers.get("content-length")||"0",m=parseInt(p,10)||0,x=0,U=new TransformStream({transform(S,J){J.enqueue(S),x+=S.byteLength,t.next({type:F.UploadProgress,request:i,total:m,loaded:x})}});i=new Request(i.url,{cache:i.cache,credentials:i.credentials,headers:i.headers,integrity:i.integrity,keepalive:i.keepalive,method:i.method,mode:i.mode,redirect:i.redirect,referrer:i.referrer,referrerPolicy:i.referrerPolicy,signal:i.signal,body:c.pipeThrough(U),window:e.window,duplex:"half"})}let a=this.send(i);t.next({request:i,type:F.Sent});let o=await a,h=this.createResponse({url:o.url,headers:o.headers,status:o.status,statusText:o.statusText,hasBody:!!o.body});t.next({request:i,type:F.ResponseHeader,response:h});let f;if(o.body)if(e.reportProgress){let c=o.body,p=o.headers.get("content-length")||"0",m=parseInt(p,10)||0,x=0,U=new Response(new ReadableStream({async start(S){let J=c.getReader();for(;;){let{done:Dr,value:cr}=await J.read();if(Dr)break;x+=cr.byteLength,S.enqueue(cr),t.next({type:F.DownloadProgress,request:i,total:m,loaded:x})}S.close()}}));f=await this.parseBody(U)}else f=await this.parseBody(o);let l=this.createResponse({url:o.url,headers:o.headers,status:o.status,statusText:o.statusText,body:f});t.next({request:i,type:F.Response,response:l}),t.complete()})().catch(i=>t.error(i))})}send(e){return fetch(e)}prepareRequest(e){let t=e.headers||new Headers,i={...e,...ge(this.defaults,["headers","params"]),headers:t};this.defaults.headers.forEach((h,f)=>{t.has(f)||t.set(f,h)});let a=new URL(i.url,this.serviceUrl);this.defaults.params.size&&(this.defaults.params.forEach((h,f)=>{a.searchParams.has(f)||a.searchParams.set(f,h)}),i.url=a.toString());let o=i.body;if(o){let h="";typeof o=="string"||typeof o=="number"||typeof o=="boolean"?(h='text/plain; charset="UTF-8"',i.body=new Blob([String(o)],{type:h}),t.set("Content-Length",String(i.body.size)),delete i.duplex):Ae(o)?(h="application/octet-stream",i.duplex="half"):Buffer.isBuffer(o)?(h="application/octet-stream",t.set("Content-Length",String(o.length)),delete i.duplex):Be(o)?(h=o.type||"application/octet-stream",t.set("Content-Length",String(o.size)),delete i.duplex):(Fe(o)||(h='application/json;charset="UTF-8"',i.body=new Blob([JSON.stringify(o)],{type:h}),t.set("Content-Length",String(i.body.size))),delete i.duplex),h&&!t.has("Content-Type")&&t.set("Content-Type",h)}return new Request(a.toString(),i)}createResponse(e){return new _(e)}async parseBody(e){let t,i=e.headers.get("Content-Type")||"";if(sr.is(i,["json","application/*+json"]))t=await e.json(),typeof t=="string"&&(t=JSON.parse(t));else if(sr.is(i,["text"]))t=await e.text();else if(sr.is(i,["multipart"]))t=await e.formData();else{let a=await e.arrayBuffer();a.byteLength&&(t=a)}return t}};s(ur,"FetchBackend");var O=ur;import{updateErrorMessage as Lr}from"@jsopen/objects";import{ApiDocumentFactory as Re}from"@opra/common";import Ie from"@browsery/type-is";import{MimeTypes as Te}from"@opra/common";import{lastValueFrom as Cr,Observable as Se}from"rxjs";var hr=class hr{constructor(r,e){y(this,"chain");y(this,"finalHandler");this.chain=r.reduceRight((t,i)=>(a,o)=>i.intercept(a,{handle:s(h=>t(h,o),"handle")}),ve),this.finalHandler=e}handle(r){return this.chain(r,e=>this.finalHandler.handle(e))}};s(hr,"HttpInterceptorHandler");var W=hr;function ve(n,r){return r(n)}s(ve,"chainEnd");var Y=class Y extends Se{constructor(r,e){super(t=>{let i=this[B].observe;new W(r.interceptors||[],this[g]).handle(this[B]).subscribe({next(a){if(i===I.Events){t.next(a);return}if(i===I.ResponseHeader&&a.type===F.ResponseHeader){t.next(a.response),t.complete();return}if(a.type===F.Response){let{response:o}=a;if(i===I.Response){t.next(o),t.complete();return}let h=Ie.is(a.response.contentType||"",[Te.opra_response_json]);if(o.status>=400&&o.status<600){t.error(new q({message:o.status+" "+o.statusText,status:o.status,issues:h?o.body.errors:void 0})),t.complete();return}t.next(a.response.body),t.complete()}},error(a){t.error(a)},complete(){t.complete()}})}),Object.defineProperty(this,g,{enumerable:!1,value:r}),Object.defineProperty(this,B,{enumerable:!1,value:{...e,observe:I.Body,headers:new Headers(e?.headers)}})}clone(){return new Y(this[g],this[B])}options(r){return Object.assign(this[B],r),this}header(r,e){let t=this[B].headers;return typeof r=="object"?((r instanceof Headers?r:new Headers(r)).forEach((a,o)=>{o.toLowerCase()==="set-cookie"?t.append(o,a):t.set(o,a)}),this):(e==null||e===""?t.delete(r):t.append(r,String(e)),this)}param(r,e){e&&typeof e=="object"&&(e=JSON.stringify(e));let t=this[B].url.searchParams;return typeof r=="object"?(typeof r.forEach=="function"?r.forEach((i,a)=>t.set(String(a),String(i))):Object.entries(r).forEach(i=>t.set(String(i[0]),String(i[1]))),this):(e==null?t.delete(r):t.set(r,String(e)),this)}observe(r){if(r===this[B].observe)return this;let e=this.clone();return e[B].observe=r||I.Body,e}getBody(){return Cr(this.observe(I.Body))}getResponse(){return Cr(this.observe(I.Response))}};s(Y,"HttpRequestObservable");var z=Y;var Ce=/^(\/*)(.+)/,fr=class fr{constructor(r){Object.defineProperty(this,g,{enumerable:!1,value:r})}get serviceUrl(){return this[g].serviceUrl}async fetchDocument(r){let e={},t=s(async a=>{let o=this.request("$schema",{headers:new Headers({accept:"application/json"})});a&&o.param("id",a);let h=await o.getBody().catch(f=>{throw Lr(f,"Error fetching api schema from url ("+this.serviceUrl+`).
|
|
7
|
+
`+f.message),f});if(h.references){let f=h.references;h.references={};for(let[l,c]of Object.entries(f)){if(e[c.id]===null)throw new Error("Circular reference detected");e[c.id]=null;let p=await t(c.id);h.references[l]=e[c.id]=p}}return h},"getDocument"),i=await t(r?.documentId);return await Re.createDocument(i).catch(a=>{throw Lr(a,`Error loading api document.
|
|
8
|
+
`+a.message),a})}request(r,e){r=Ce.exec(r)?.[2]||"";let t=new z(this[g],{...e,method:e?.method||"GET",url:new URL(r,this.serviceUrl)});return e?.params&&t.param(e.params),t}delete(r,e){return this.request(r,{...e,method:"DELETE"})}get(r,e){return this.request(r,{...e,method:"GET"})}patch(r,e,t){return this.request(r,{...t,method:"PATCH",body:e})}post(r,e,t){return this.request(r,{...t,method:"POST",body:e})}put(r,e,t){return this.request(r,{...t,method:"PUT",body:e})}};s(fr,"HttpClientBase");var G=fr;var pr=class pr extends G{constructor(r,e){super(new O(r,e))}get defaults(){return this[g].defaults}};s(pr,"OpraHttpClient");var kr=pr;function St(n,...r){let e="",t;for(t=0;t<n.length;t++)e+=n[0]+encodeURIComponent(r[t]);return e}s(St,"urlPath");globalThis.Buffer=br.Buffer;export{P as Backend,q as ClientError,O as FetchBackend,H as HttpBackend,G as HttpClientBase,F as HttpEventType,I as HttpObserveType,z as HttpRequestObservable,_ as HttpResponse,kr as OpraHttpClient,g as kBackend,Ee as kClient,B as kContext,St as urlPath};
|
|
9
9
|
/*! Bundled license information:
|
|
10
10
|
|
|
11
11
|
ieee754/index.js:
|
package/http/http-client-base.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { updateErrorMessage } from '@jsopen/objects';
|
|
1
2
|
import { ApiDocumentFactory, } from '@opra/common';
|
|
2
3
|
import { kBackend } from '../constants.js';
|
|
3
4
|
import { HttpRequestObservable } from './http-request-observable.js';
|
|
@@ -26,11 +27,10 @@ export class HttpClientBase {
|
|
|
26
27
|
if (documentId)
|
|
27
28
|
req.param('id', documentId);
|
|
28
29
|
const body = await req.getBody().catch(e => {
|
|
29
|
-
e
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
e.message;
|
|
30
|
+
updateErrorMessage(e, 'Error fetching api schema from url (' +
|
|
31
|
+
this.serviceUrl +
|
|
32
|
+
').\n' +
|
|
33
|
+
e.message);
|
|
34
34
|
throw e;
|
|
35
35
|
});
|
|
36
36
|
if (body.references) {
|
|
@@ -48,7 +48,7 @@ export class HttpClientBase {
|
|
|
48
48
|
};
|
|
49
49
|
const body = await getDocument(options?.documentId);
|
|
50
50
|
return await ApiDocumentFactory.createDocument(body).catch(e => {
|
|
51
|
-
e
|
|
51
|
+
updateErrorMessage(e, 'Error loading api document.\n' + e.message);
|
|
52
52
|
throw e;
|
|
53
53
|
});
|
|
54
54
|
}
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opra/client",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.23.2",
|
|
4
4
|
"description": "Opra Client package",
|
|
5
5
|
"author": "Panates",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@jsopen/objects": "^2.
|
|
8
|
+
"@jsopen/objects": "^2.1.1",
|
|
9
9
|
"accepts": "^1.3.8",
|
|
10
10
|
"tslib": "^2.8.1"
|
|
11
11
|
},
|
|
12
12
|
"peerDependencies": {
|
|
13
|
-
"@opra/common": "^1.
|
|
13
|
+
"@opra/common": "^1.23.2",
|
|
14
14
|
"rxjs": "^7.0.0 || ^8.0.0"
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|