@opra/client 1.24.4 → 1.25.1
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/batch-request.d.ts +1 -0
- package/batch-request.js +1 -1
- package/browser.js +3 -3
- package/http/interfaces/http-event.d.ts +1 -1
- package/package.json +2 -2
package/batch-request.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/batch-request.js
CHANGED
package/browser.js
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* http://www.panates.com
|
|
4
4
|
*****************************************/
|
|
5
5
|
|
|
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
|
-
`+
|
|
8
|
-
`+
|
|
6
|
+
var Wt=Object.create;var _=Object.defineProperty;var Yt=Object.getOwnPropertyDescriptor;var zt=Object.getOwnPropertyNames;var Jt=Object.getPrototypeOf,Vt=Object.prototype.hasOwnProperty;var Xt=(r,t,e)=>t in r?_(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var u=(r,t)=>_(r,"name",{value:t,configurable:!0});var Q=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports);var Kt=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of zt(t))!Vt.call(r,i)&&i!==e&&_(r,i,{get:()=>t[i],enumerable:!(n=Yt(t,i))||n.enumerable});return r};var Zt=(r,t,e)=>(e=r!=null?Wt(Jt(r)):{},Kt(t||!r||!r.__esModule?_(e,"default",{value:r,enumerable:!0}):e,r));var d=(r,t,e)=>Xt(r,typeof t!="symbol"?t+"":t,e);var gt=Q($=>{"use strict";$.byteLength=vt;$.toByteArray=ee;$.fromByteArray=ie;var F=[],w=[],Qt=typeof Uint8Array<"u"?Uint8Array:Array,v="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(b=0,wt=v.length;b<wt;++b)F[b]=v[b],w[v.charCodeAt(b)]=b;var b,wt;w[45]=62;w[95]=63;function Bt(r){var t=r.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=r.indexOf("=");e===-1&&(e=t);var n=e===t?0:4-e%4;return[e,n]}u(Bt,"getLens");function vt(r){var t=Bt(r),e=t[0],n=t[1];return(e+n)*3/4-n}u(vt,"byteLength");function te(r,t,e){return(t+e)*3/4-e}u(te,"_byteLength");function ee(r){var t,e=Bt(r),n=e[0],i=e[1],o=new Qt(te(r,n,i)),s=0,c=i>0?n-4:n,a;for(a=0;a<c;a+=4)t=w[r.charCodeAt(a)]<<18|w[r.charCodeAt(a+1)]<<12|w[r.charCodeAt(a+2)]<<6|w[r.charCodeAt(a+3)],o[s++]=t>>16&255,o[s++]=t>>8&255,o[s++]=t&255;return i===2&&(t=w[r.charCodeAt(a)]<<2|w[r.charCodeAt(a+1)]>>4,o[s++]=t&255),i===1&&(t=w[r.charCodeAt(a)]<<10|w[r.charCodeAt(a+1)]<<4|w[r.charCodeAt(a+2)]>>2,o[s++]=t>>8&255,o[s++]=t&255),o}u(ee,"toByteArray");function re(r){return F[r>>18&63]+F[r>>12&63]+F[r>>6&63]+F[r&63]}u(re,"tripletToBase64");function ne(r,t,e){for(var n,i=[],o=t;o<e;o+=3)n=(r[o]<<16&16711680)+(r[o+1]<<8&65280)+(r[o+2]&255),i.push(re(n));return i.join("")}u(ne,"encodeChunk");function ie(r){for(var t,e=r.length,n=e%3,i=[],o=16383,s=0,c=e-n;s<c;s+=o)i.push(ne(r,s,s+o>c?c:s+o));return n===1?(t=r[e-1],i.push(F[t>>2]+F[t<<4&63]+"==")):n===2&&(t=(r[e-2]<<8)+r[e-1],i.push(F[t>>10]+F[t>>4&63]+F[t<<2&63]+"=")),i.join("")}u(ie,"fromByteArray")});var Et=Q(tt=>{"use strict";tt.read=function(r,t,e,n,i){var o,s,c=i*8-n-1,a=(1<<c)-1,l=a>>1,f=-7,p=e?i-1:0,I=e?-1:1,x=r[t+p];for(p+=I,o=x&(1<<-f)-1,x>>=-f,f+=c;f>0;o=o*256+r[t+p],p+=I,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;f>0;s=s*256+r[t+p],p+=I,f-=8);if(o===0)o=1-l;else{if(o===a)return s?NaN:(x?-1:1)*(1/0);s=s+Math.pow(2,n),o=o-l}return(x?-1:1)*s*Math.pow(2,o-n)};tt.write=function(r,t,e,n,i,o){var s,c,a,l=o*8-i-1,f=(1<<l)-1,p=f>>1,I=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,x=n?0:o-1,S=n?1:-1,C=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(c=isNaN(t)?1:0,s=f):(s=Math.floor(Math.log(t)/Math.LN2),t*(a=Math.pow(2,-s))<1&&(s--,a*=2),s+p>=1?t+=I/a:t+=I*Math.pow(2,1-p),t*a>=2&&(s++,a/=2),s+p>=f?(c=0,s=f):s+p>=1?(c=(t*a-1)*Math.pow(2,i),s=s+p):(c=t*Math.pow(2,p-1)*Math.pow(2,i),s=0));i>=8;r[e+x]=c&255,x+=S,c/=256,i-=8);for(s=s<<i|c,l+=i;l>0;r[e+x]=s&255,x+=S,s/=256,l-=8);r[e+x-S]|=C*128}});var $t=Q(N=>{"use strict";var et=gt(),P=Et(),It=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;N.Buffer=h;N.SlowBuffer=ae;N.INSPECT_MAX_BYTES=50;var O=2147483647;N.kMaxLength=O;h.TYPED_ARRAY_SUPPORT=oe();!h.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 oe(){try{let r=new Uint8Array(1),t={foo:u(function(){return 42},"foo")};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(r,t),r.foo()===42}catch{return!1}}u(oe,"typedArraySupport");Object.defineProperty(h.prototype,"parent",{enumerable:!0,get:u(function(){if(h.isBuffer(this))return this.buffer},"get")});Object.defineProperty(h.prototype,"offset",{enumerable:!0,get:u(function(){if(h.isBuffer(this))return this.byteOffset},"get")});function R(r){if(r>O)throw new RangeError('The value "'+r+'" is invalid for option "size"');let t=new Uint8Array(r);return Object.setPrototypeOf(t,h.prototype),t}u(R,"createBuffer");function h(r,t,e){if(typeof r=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return ot(r)}return Rt(r,t,e)}u(h,"Buffer");h.poolSize=8192;function Rt(r,t,e){if(typeof r=="string")return ue(r,t);if(ArrayBuffer.isView(r))return he(r);if(r==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);if(U(r,ArrayBuffer)||r&&U(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(U(r,SharedArrayBuffer)||r&&U(r.buffer,SharedArrayBuffer)))return nt(r,t,e);if(typeof r=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=r.valueOf&&r.valueOf();if(n!=null&&n!==r)return h.from(n,t,e);let i=ce(r);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol.toPrimitive]=="function")return h.from(r[Symbol.toPrimitive]("string"),t,e);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r)}u(Rt,"from");h.from=function(r,t,e){return Rt(r,t,e)};Object.setPrototypeOf(h.prototype,Uint8Array.prototype);Object.setPrototypeOf(h,Uint8Array);function Tt(r){if(typeof r!="number")throw new TypeError('"size" argument must be of type number');if(r<0)throw new RangeError('The value "'+r+'" is invalid for option "size"')}u(Tt,"assertSize");function se(r,t,e){return Tt(r),r<=0?R(r):t!==void 0?typeof e=="string"?R(r).fill(t,e):R(r).fill(t):R(r)}u(se,"alloc");h.alloc=function(r,t,e){return se(r,t,e)};function ot(r){return Tt(r),R(r<0?0:st(r)|0)}u(ot,"allocUnsafe");h.allocUnsafe=function(r){return ot(r)};h.allocUnsafeSlow=function(r){return ot(r)};function ue(r,t){if((typeof t!="string"||t==="")&&(t="utf8"),!h.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let e=St(r,t)|0,n=R(e),i=n.write(r,t);return i!==e&&(n=n.slice(0,i)),n}u(ue,"fromString");function rt(r){let t=r.length<0?0:st(r.length)|0,e=R(t);for(let n=0;n<t;n+=1)e[n]=r[n]&255;return e}u(rt,"fromArrayLike");function he(r){if(U(r,Uint8Array)){let t=new Uint8Array(r);return nt(t.buffer,t.byteOffset,t.byteLength)}return rt(r)}u(he,"fromArrayView");function nt(r,t,e){if(t<0||r.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(r.byteLength<t+(e||0))throw new RangeError('"length" is outside of buffer bounds');let n;return t===void 0&&e===void 0?n=new Uint8Array(r):e===void 0?n=new Uint8Array(r,t):n=new Uint8Array(r,t,e),Object.setPrototypeOf(n,h.prototype),n}u(nt,"fromArrayBuffer");function ce(r){if(h.isBuffer(r)){let t=st(r.length)|0,e=R(t);return e.length===0||r.copy(e,0,0,t),e}if(r.length!==void 0)return typeof r.length!="number"||ht(r.length)?R(0):rt(r);if(r.type==="Buffer"&&Array.isArray(r.data))return rt(r.data)}u(ce,"fromObject");function st(r){if(r>=O)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+O.toString(16)+" bytes");return r|0}u(st,"checked");function ae(r){return+r!=r&&(r=0),h.alloc(+r)}u(ae,"SlowBuffer");h.isBuffer=u(function(t){return t!=null&&t._isBuffer===!0&&t!==h.prototype},"isBuffer");h.compare=u(function(t,e){if(U(t,Uint8Array)&&(t=h.from(t,t.offset,t.byteLength)),U(e,Uint8Array)&&(e=h.from(e,e.offset,e.byteLength)),!h.isBuffer(t)||!h.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let n=t.length,i=e.length;for(let o=0,s=Math.min(n,i);o<s;++o)if(t[o]!==e[o]){n=t[o],i=e[o];break}return n<i?-1:i<n?1:0},"compare");h.isEncoding=u(function(t){switch(String(t).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");h.concat=u(function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return h.alloc(0);let n;if(e===void 0)for(e=0,n=0;n<t.length;++n)e+=t[n].length;let i=h.allocUnsafe(e),o=0;for(n=0;n<t.length;++n){let s=t[n];if(U(s,Uint8Array))o+s.length>i.length?(h.isBuffer(s)||(s=h.from(s)),s.copy(i,o)):Uint8Array.prototype.set.call(i,s,o);else if(h.isBuffer(s))s.copy(i,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=s.length}return i},"concat");function St(r,t){if(h.isBuffer(r))return r.length;if(ArrayBuffer.isView(r)||U(r,ArrayBuffer))return r.byteLength;if(typeof r!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof r);let e=r.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&e===0)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":return it(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return _t(r).length;default:if(i)return n?-1:it(r).length;t=(""+t).toLowerCase(),i=!0}}u(St,"byteLength");h.byteLength=St;function fe(r,t,e){let n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,t>>>=0,e<=t))return"";for(r||(r="utf8");;)switch(r){case"hex":return Ee(this,t,e);case"utf8":case"utf-8":return bt(this,t,e);case"ascii":return Be(this,t,e);case"latin1":case"binary":return ge(this,t,e);case"base64":return me(this,t,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ie(this,t,e);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}u(fe,"slowToString");h.prototype._isBuffer=!0;function L(r,t,e){let n=r[t];r[t]=r[e],r[e]=n}u(L,"swap");h.prototype.swap16=u(function(){let t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)L(this,e,e+1);return this},"swap16");h.prototype.swap32=u(function(){let t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)L(this,e,e+3),L(this,e+1,e+2);return this},"swap32");h.prototype.swap64=u(function(){let t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)L(this,e,e+7),L(this,e+1,e+6),L(this,e+2,e+5),L(this,e+3,e+4);return this},"swap64");h.prototype.toString=u(function(){let t=this.length;return t===0?"":arguments.length===0?bt(this,0,t):fe.apply(this,arguments)},"toString");h.prototype.toLocaleString=h.prototype.toString;h.prototype.equals=u(function(t){if(!h.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:h.compare(this,t)===0},"equals");h.prototype.inspect=u(function(){let t="",e=N.INSPECT_MAX_BYTES;return t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(t+=" ... "),"<Buffer "+t+">"},"inspect");It&&(h.prototype[It]=h.prototype.inspect);h.prototype.compare=u(function(t,e,n,i,o){if(U(t,Uint8Array)&&(t=h.from(t,t.offset,t.byteLength)),!h.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(e===void 0&&(e=0),n===void 0&&(n=t?t.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),e<0||n>t.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&e>=n)return 0;if(i>=o)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,i>>>=0,o>>>=0,this===t)return 0;let s=o-i,c=n-e,a=Math.min(s,c),l=this.slice(i,o),f=t.slice(e,n);for(let p=0;p<a;++p)if(l[p]!==f[p]){s=l[p],c=f[p];break}return s<c?-1:c<s?1:0},"compare");function Ct(r,t,e,n,i){if(r.length===0)return-1;if(typeof e=="string"?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,ht(e)&&(e=i?0:r.length-1),e<0&&(e=r.length+e),e>=r.length){if(i)return-1;e=r.length-1}else if(e<0)if(i)e=0;else return-1;if(typeof t=="string"&&(t=h.from(t,n)),h.isBuffer(t))return t.length===0?-1:Ft(r,t,e,n,i);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(r,t,e):Uint8Array.prototype.lastIndexOf.call(r,t,e):Ft(r,[t],e,n,i);throw new TypeError("val must be string, number or Buffer")}u(Ct,"bidirectionalIndexOf");function Ft(r,t,e,n,i){let o=1,s=r.length,c=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(r.length<2||t.length<2)return-1;o=2,s/=2,c/=2,e/=2}function a(f,p){return o===1?f[p]:f.readUInt16BE(p*o)}u(a,"read");let l;if(i){let f=-1;for(l=e;l<s;l++)if(a(r,l)===a(t,f===-1?0:l-f)){if(f===-1&&(f=l),l-f+1===c)return f*o}else f!==-1&&(l-=l-f),f=-1}else for(e+c>s&&(e=s-c),l=e;l>=0;l--){let f=!0;for(let p=0;p<c;p++)if(a(r,l+p)!==a(t,p)){f=!1;break}if(f)return l}return-1}u(Ft,"arrayIndexOf");h.prototype.includes=u(function(t,e,n){return this.indexOf(t,e,n)!==-1},"includes");h.prototype.indexOf=u(function(t,e,n){return Ct(this,t,e,n,!0)},"indexOf");h.prototype.lastIndexOf=u(function(t,e,n){return Ct(this,t,e,n,!1)},"lastIndexOf");function pe(r,t,e,n){e=Number(e)||0;let i=r.length-e;n?(n=Number(n),n>i&&(n=i)):n=i;let o=t.length;n>o/2&&(n=o/2);let s;for(s=0;s<n;++s){let c=parseInt(t.substr(s*2,2),16);if(ht(c))return s;r[e+s]=c}return s}u(pe,"hexWrite");function le(r,t,e,n){return q(it(t,r.length-e),r,e,n)}u(le,"utf8Write");function de(r,t,e,n){return q(Re(t),r,e,n)}u(de,"asciiWrite");function ye(r,t,e,n){return q(_t(t),r,e,n)}u(ye,"base64Write");function xe(r,t,e,n){return q(Te(t,r.length-e),r,e,n)}u(xe,"ucs2Write");h.prototype.write=u(function(t,e,n,i){if(e===void 0)i="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")i=e,n=this.length,e=0;else if(isFinite(e))e=e>>>0,isFinite(n)?(n=n>>>0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-e;if((n===void 0||n>o)&&(n=o),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let s=!1;for(;;)switch(i){case"hex":return pe(this,t,e,n);case"utf8":case"utf-8":return le(this,t,e,n);case"ascii":case"latin1":case"binary":return de(this,t,e,n);case"base64":return ye(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return xe(this,t,e,n);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}},"write");h.prototype.toJSON=u(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSON");function me(r,t,e){return t===0&&e===r.length?et.fromByteArray(r):et.fromByteArray(r.slice(t,e))}u(me,"base64Slice");function bt(r,t,e){e=Math.min(r.length,e);let n=[],i=t;for(;i<e;){let o=r[i],s=null,c=o>239?4:o>223?3:o>191?2:1;if(i+c<=e){let a,l,f,p;switch(c){case 1:o<128&&(s=o);break;case 2:a=r[i+1],(a&192)===128&&(p=(o&31)<<6|a&63,p>127&&(s=p));break;case 3:a=r[i+1],l=r[i+2],(a&192)===128&&(l&192)===128&&(p=(o&15)<<12|(a&63)<<6|l&63,p>2047&&(p<55296||p>57343)&&(s=p));break;case 4:a=r[i+1],l=r[i+2],f=r[i+3],(a&192)===128&&(l&192)===128&&(f&192)===128&&(p=(o&15)<<18|(a&63)<<12|(l&63)<<6|f&63,p>65535&&p<1114112&&(s=p))}}s===null?(s=65533,c=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),i+=c}return we(n)}u(bt,"utf8Slice");var Ut=4096;function we(r){let t=r.length;if(t<=Ut)return String.fromCharCode.apply(String,r);let e="",n=0;for(;n<t;)e+=String.fromCharCode.apply(String,r.slice(n,n+=Ut));return e}u(we,"decodeCodePointsArray");function Be(r,t,e){let n="";e=Math.min(r.length,e);for(let i=t;i<e;++i)n+=String.fromCharCode(r[i]&127);return n}u(Be,"asciiSlice");function ge(r,t,e){let n="";e=Math.min(r.length,e);for(let i=t;i<e;++i)n+=String.fromCharCode(r[i]);return n}u(ge,"latin1Slice");function Ee(r,t,e){let n=r.length;(!t||t<0)&&(t=0),(!e||e<0||e>n)&&(e=n);let i="";for(let o=t;o<e;++o)i+=Se[r[o]];return i}u(Ee,"hexSlice");function Ie(r,t,e){let n=r.slice(t,e),i="";for(let o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}u(Ie,"utf16leSlice");h.prototype.slice=u(function(t,e){let n=this.length;t=~~t,e=e===void 0?n:~~e,t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<t&&(e=t);let i=this.subarray(t,e);return Object.setPrototypeOf(i,h.prototype),i},"slice");function y(r,t,e){if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+t>e)throw new RangeError("Trying to access beyond buffer length")}u(y,"checkOffset");h.prototype.readUintLE=h.prototype.readUIntLE=u(function(t,e,n){t=t>>>0,e=e>>>0,n||y(t,e,this.length);let i=this[t],o=1,s=0;for(;++s<e&&(o*=256);)i+=this[t+s]*o;return i},"readUIntLE");h.prototype.readUintBE=h.prototype.readUIntBE=u(function(t,e,n){t=t>>>0,e=e>>>0,n||y(t,e,this.length);let i=this[t+--e],o=1;for(;e>0&&(o*=256);)i+=this[t+--e]*o;return i},"readUIntBE");h.prototype.readUint8=h.prototype.readUInt8=u(function(t,e){return t=t>>>0,e||y(t,1,this.length),this[t]},"readUInt8");h.prototype.readUint16LE=h.prototype.readUInt16LE=u(function(t,e){return t=t>>>0,e||y(t,2,this.length),this[t]|this[t+1]<<8},"readUInt16LE");h.prototype.readUint16BE=h.prototype.readUInt16BE=u(function(t,e){return t=t>>>0,e||y(t,2,this.length),this[t]<<8|this[t+1]},"readUInt16BE");h.prototype.readUint32LE=h.prototype.readUInt32LE=u(function(t,e){return t=t>>>0,e||y(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216},"readUInt32LE");h.prototype.readUint32BE=h.prototype.readUInt32BE=u(function(t,e){return t=t>>>0,e||y(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])},"readUInt32BE");h.prototype.readBigUInt64LE=T(u(function(t){t=t>>>0,D(t,"offset");let e=this[t],n=this[t+7];(e===void 0||n===void 0)&&M(t,this.length-8);let i=e+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24,o=this[++t]+this[++t]*2**8+this[++t]*2**16+n*2**24;return BigInt(i)+(BigInt(o)<<BigInt(32))},"readBigUInt64LE"));h.prototype.readBigUInt64BE=T(u(function(t){t=t>>>0,D(t,"offset");let e=this[t],n=this[t+7];(e===void 0||n===void 0)&&M(t,this.length-8);let i=e*2**24+this[++t]*2**16+this[++t]*2**8+this[++t],o=this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n;return(BigInt(i)<<BigInt(32))+BigInt(o)},"readBigUInt64BE"));h.prototype.readIntLE=u(function(t,e,n){t=t>>>0,e=e>>>0,n||y(t,e,this.length);let i=this[t],o=1,s=0;for(;++s<e&&(o*=256);)i+=this[t+s]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i},"readIntLE");h.prototype.readIntBE=u(function(t,e,n){t=t>>>0,e=e>>>0,n||y(t,e,this.length);let i=e,o=1,s=this[t+--i];for(;i>0&&(o*=256);)s+=this[t+--i]*o;return o*=128,s>=o&&(s-=Math.pow(2,8*e)),s},"readIntBE");h.prototype.readInt8=u(function(t,e){return t=t>>>0,e||y(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]},"readInt8");h.prototype.readInt16LE=u(function(t,e){t=t>>>0,e||y(t,2,this.length);let n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n},"readInt16LE");h.prototype.readInt16BE=u(function(t,e){t=t>>>0,e||y(t,2,this.length);let n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n},"readInt16BE");h.prototype.readInt32LE=u(function(t,e){return t=t>>>0,e||y(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},"readInt32LE");h.prototype.readInt32BE=u(function(t,e){return t=t>>>0,e||y(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},"readInt32BE");h.prototype.readBigInt64LE=T(u(function(t){t=t>>>0,D(t,"offset");let e=this[t],n=this[t+7];(e===void 0||n===void 0)&&M(t,this.length-8);let i=this[t+4]+this[t+5]*2**8+this[t+6]*2**16+(n<<24);return(BigInt(i)<<BigInt(32))+BigInt(e+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24)},"readBigInt64LE"));h.prototype.readBigInt64BE=T(u(function(t){t=t>>>0,D(t,"offset");let e=this[t],n=this[t+7];(e===void 0||n===void 0)&&M(t,this.length-8);let i=(e<<24)+this[++t]*2**16+this[++t]*2**8+this[++t];return(BigInt(i)<<BigInt(32))+BigInt(this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n)},"readBigInt64BE"));h.prototype.readFloatLE=u(function(t,e){return t=t>>>0,e||y(t,4,this.length),P.read(this,t,!0,23,4)},"readFloatLE");h.prototype.readFloatBE=u(function(t,e){return t=t>>>0,e||y(t,4,this.length),P.read(this,t,!1,23,4)},"readFloatBE");h.prototype.readDoubleLE=u(function(t,e){return t=t>>>0,e||y(t,8,this.length),P.read(this,t,!0,52,8)},"readDoubleLE");h.prototype.readDoubleBE=u(function(t,e){return t=t>>>0,e||y(t,8,this.length),P.read(this,t,!1,52,8)},"readDoubleBE");function m(r,t,e,n,i,o){if(!h.isBuffer(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(e+n>r.length)throw new RangeError("Index out of range")}u(m,"checkInt");h.prototype.writeUintLE=h.prototype.writeUIntLE=u(function(t,e,n,i){if(t=+t,e=e>>>0,n=n>>>0,!i){let c=Math.pow(2,8*n)-1;m(this,t,e,n,c,0)}let o=1,s=0;for(this[e]=t&255;++s<n&&(o*=256);)this[e+s]=t/o&255;return e+n},"writeUIntLE");h.prototype.writeUintBE=h.prototype.writeUIntBE=u(function(t,e,n,i){if(t=+t,e=e>>>0,n=n>>>0,!i){let c=Math.pow(2,8*n)-1;m(this,t,e,n,c,0)}let o=n-1,s=1;for(this[e+o]=t&255;--o>=0&&(s*=256);)this[e+o]=t/s&255;return e+n},"writeUIntBE");h.prototype.writeUint8=h.prototype.writeUInt8=u(function(t,e,n){return t=+t,e=e>>>0,n||m(this,t,e,1,255,0),this[e]=t&255,e+1},"writeUInt8");h.prototype.writeUint16LE=h.prototype.writeUInt16LE=u(function(t,e,n){return t=+t,e=e>>>0,n||m(this,t,e,2,65535,0),this[e]=t&255,this[e+1]=t>>>8,e+2},"writeUInt16LE");h.prototype.writeUint16BE=h.prototype.writeUInt16BE=u(function(t,e,n){return t=+t,e=e>>>0,n||m(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=t&255,e+2},"writeUInt16BE");h.prototype.writeUint32LE=h.prototype.writeUInt32LE=u(function(t,e,n){return t=+t,e=e>>>0,n||m(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=t&255,e+4},"writeUInt32LE");h.prototype.writeUint32BE=h.prototype.writeUInt32BE=u(function(t,e,n){return t=+t,e=e>>>0,n||m(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255,e+4},"writeUInt32BE");function Lt(r,t,e,n,i){Mt(t,n,i,r,e,7);let o=Number(t&BigInt(4294967295));r[e++]=o,o=o>>8,r[e++]=o,o=o>>8,r[e++]=o,o=o>>8,r[e++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return r[e++]=s,s=s>>8,r[e++]=s,s=s>>8,r[e++]=s,s=s>>8,r[e++]=s,e}u(Lt,"wrtBigUInt64LE");function kt(r,t,e,n,i){Mt(t,n,i,r,e,7);let o=Number(t&BigInt(4294967295));r[e+7]=o,o=o>>8,r[e+6]=o,o=o>>8,r[e+5]=o,o=o>>8,r[e+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return r[e+3]=s,s=s>>8,r[e+2]=s,s=s>>8,r[e+1]=s,s=s>>8,r[e]=s,e+8}u(kt,"wrtBigUInt64BE");h.prototype.writeBigUInt64LE=T(u(function(t,e=0){return Lt(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64LE"));h.prototype.writeBigUInt64BE=T(u(function(t,e=0){return kt(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64BE"));h.prototype.writeIntLE=u(function(t,e,n,i){if(t=+t,e=e>>>0,!i){let a=Math.pow(2,8*n-1);m(this,t,e,n,a-1,-a)}let o=0,s=1,c=0;for(this[e]=t&255;++o<n&&(s*=256);)t<0&&c===0&&this[e+o-1]!==0&&(c=1),this[e+o]=(t/s>>0)-c&255;return e+n},"writeIntLE");h.prototype.writeIntBE=u(function(t,e,n,i){if(t=+t,e=e>>>0,!i){let a=Math.pow(2,8*n-1);m(this,t,e,n,a-1,-a)}let o=n-1,s=1,c=0;for(this[e+o]=t&255;--o>=0&&(s*=256);)t<0&&c===0&&this[e+o+1]!==0&&(c=1),this[e+o]=(t/s>>0)-c&255;return e+n},"writeIntBE");h.prototype.writeInt8=u(function(t,e,n){return t=+t,e=e>>>0,n||m(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=t&255,e+1},"writeInt8");h.prototype.writeInt16LE=u(function(t,e,n){return t=+t,e=e>>>0,n||m(this,t,e,2,32767,-32768),this[e]=t&255,this[e+1]=t>>>8,e+2},"writeInt16LE");h.prototype.writeInt16BE=u(function(t,e,n){return t=+t,e=e>>>0,n||m(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=t&255,e+2},"writeInt16BE");h.prototype.writeInt32LE=u(function(t,e,n){return t=+t,e=e>>>0,n||m(this,t,e,4,2147483647,-2147483648),this[e]=t&255,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},"writeInt32LE");h.prototype.writeInt32BE=u(function(t,e,n){return t=+t,e=e>>>0,n||m(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255,e+4},"writeInt32BE");h.prototype.writeBigInt64LE=T(u(function(t,e=0){return Lt(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE"));h.prototype.writeBigInt64BE=T(u(function(t,e=0){return kt(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64BE"));function Pt(r,t,e,n,i,o){if(e+n>r.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}u(Pt,"checkIEEE754");function Dt(r,t,e,n,i){return t=+t,e=e>>>0,i||Pt(r,t,e,4,34028234663852886e22,-34028234663852886e22),P.write(r,t,e,n,23,4),e+4}u(Dt,"writeFloat");h.prototype.writeFloatLE=u(function(t,e,n){return Dt(this,t,e,!0,n)},"writeFloatLE");h.prototype.writeFloatBE=u(function(t,e,n){return Dt(this,t,e,!1,n)},"writeFloatBE");function Nt(r,t,e,n,i){return t=+t,e=e>>>0,i||Pt(r,t,e,8,17976931348623157e292,-17976931348623157e292),P.write(r,t,e,n,52,8),e+8}u(Nt,"writeDouble");h.prototype.writeDoubleLE=u(function(t,e,n){return Nt(this,t,e,!0,n)},"writeDoubleLE");h.prototype.writeDoubleBE=u(function(t,e,n){return Nt(this,t,e,!1,n)},"writeDoubleBE");h.prototype.copy=u(function(t,e,n,i){if(!h.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i<n&&(i=n),i===n||t.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=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),t.length-e<i-n&&(i=t.length-e+n);let o=i-n;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(e,n,i):Uint8Array.prototype.set.call(t,this.subarray(n,i),e),o},"copy");h.prototype.fill=u(function(t,e,n,i){if(typeof t=="string"){if(typeof e=="string"?(i=e,e=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!h.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(t.length===1){let s=t.charCodeAt(0);(i==="utf8"&&s<128||i==="latin1")&&(t=s)}}else typeof t=="number"?t=t&255:typeof t=="boolean"&&(t=Number(t));if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,t||(t=0);let o;if(typeof t=="number")for(o=e;o<n;++o)this[o]=t;else{let s=h.isBuffer(t)?t:h.from(t,i),c=s.length;if(c===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<n-e;++o)this[o+e]=s[o%c]}return this},"fill");var k={};function ut(r,t,e){var n;k[r]=(n=class extends e{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${r}]`,this.stack,delete this.name}get code(){return r}set code(o){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:o,writable:!0})}toString(){return`${this.name} [${r}]: ${this.message}`}},u(n,"NodeError"),n)}u(ut,"E");ut("ERR_BUFFER_OUT_OF_BOUNDS",function(r){return r?`${r} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);ut("ERR_INVALID_ARG_TYPE",function(r,t){return`The "${r}" argument must be of type number. Received type ${typeof t}`},TypeError);ut("ERR_OUT_OF_RANGE",function(r,t,e){let n=`The value of "${r}" is out of range.`,i=e;return Number.isInteger(e)&&Math.abs(e)>2**32?i=At(String(e)):typeof e=="bigint"&&(i=String(e),(e>BigInt(2)**BigInt(32)||e<-(BigInt(2)**BigInt(32)))&&(i=At(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n},RangeError);function At(r){let t="",e=r.length,n=r[0]==="-"?1:0;for(;e>=n+4;e-=3)t=`_${r.slice(e-3,e)}${t}`;return`${r.slice(0,e)}${t}`}u(At,"addNumericalSeparator");function Fe(r,t,e){D(t,"offset"),(r[t]===void 0||r[t+e]===void 0)&&M(t,r.length-(e+1))}u(Fe,"checkBounds");function Mt(r,t,e,n,i,o){if(r>e||r<t){let s=typeof t=="bigint"?"n":"",c;throw o>3?t===0||t===BigInt(0)?c=`>= 0${s} and < 2${s} ** ${(o+1)*8}${s}`:c=`>= -(2${s} ** ${(o+1)*8-1}${s}) and < 2 ** ${(o+1)*8-1}${s}`:c=`>= ${t}${s} and <= ${e}${s}`,new k.ERR_OUT_OF_RANGE("value",c,r)}Fe(n,i,o)}u(Mt,"checkIntBI");function D(r,t){if(typeof r!="number")throw new k.ERR_INVALID_ARG_TYPE(t,"number",r)}u(D,"validateNumber");function M(r,t,e){throw Math.floor(r)!==r?(D(r,e),new k.ERR_OUT_OF_RANGE(e||"offset","an integer",r)):t<0?new k.ERR_BUFFER_OUT_OF_BOUNDS:new k.ERR_OUT_OF_RANGE(e||"offset",`>= ${e?1:0} and <= ${t}`,r)}u(M,"boundsError");var Ue=/[^+/0-9A-Za-z-_]/g;function Ae(r){if(r=r.split("=")[0],r=r.trim().replace(Ue,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}u(Ae,"base64clean");function it(r,t){t=t||1/0;let e,n=r.length,i=null,o=[];for(let s=0;s<n;++s){if(e=r.charCodeAt(s),e>55295&&e<57344){if(!i){if(e>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(t-=3)>-1&&o.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((t-=1)<0)break;o.push(e)}else if(e<2048){if((t-=2)<0)break;o.push(e>>6|192,e&63|128)}else if(e<65536){if((t-=3)<0)break;o.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((t-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return o}u(it,"utf8ToBytes");function Re(r){let t=[];for(let e=0;e<r.length;++e)t.push(r.charCodeAt(e)&255);return t}u(Re,"asciiToBytes");function Te(r,t){let e,n,i,o=[];for(let s=0;s<r.length&&!((t-=2)<0);++s)e=r.charCodeAt(s),n=e>>8,i=e%256,o.push(i),o.push(n);return o}u(Te,"utf16leToBytes");function _t(r){return et.toByteArray(Ae(r))}u(_t,"base64ToBytes");function q(r,t,e,n){let i;for(i=0;i<n&&!(i+e>=t.length||i>=r.length);++i)t[i+e]=r[i];return i}u(q,"blitBuffer");function U(r,t){return r instanceof t||r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name===t.name}u(U,"isInstance");function ht(r){return r!==r}u(ht,"numberIsNaN");var Se=(function(){let r="0123456789abcdef",t=new Array(256);for(let e=0;e<16;++e){let n=e*16;for(let i=0;i<16;++i)t[n+i]=r[e]+r[i]}return t})();function T(r){return typeof BigInt>"u"?Ce:r}u(T,"defineBigIntMethod");function Ce(){throw new Error("BigInt not supported")}u(Ce,"BufferBigIntNotDefined")});var Ht=Zt($t(),1);var be=Symbol.for("kClient"),B=Symbol.for("kBackend"),g=Symbol.for("kContext");var ct=class ct{constructor(t){d(this,"document");this.document=t?.document}};u(ct,"Backend");var j=ct;var at=class at extends Error{constructor(e,n){super(e.message);d(this,"cause");d(this,"issues");d(this,"status");this.cause=n,this.issues=e.issues||[],this.status=e.status,n&&(this.cause=n,n.stack&&(this.stack=n.stack))}};u(at,"ClientError");var H=at;var A;(function(r){r.ResponseHeader="response-header",r.Response="response",r.Body="body",r.Events="events"})(A||(A={}));import pt from"@browsery/type-is";import{omit as Le}from"@jsopen/objects";import{isBlob as ke,isFormData as Pe}from"@opra/common";import{Observable as De}from"rxjs";import{isReadableStreamLike as Ne}from"rxjs/internal/util/isReadableStreamLike";var ft=class ft extends j{constructor(e,n){super(n);d(this,"serviceUrl");d(this,"interceptors");let i=new URL(e);this.serviceUrl=i.toString().split("?")[0].split("#")[0],this.serviceUrl.endsWith("/")||(this.serviceUrl+="/")}};u(ft,"HttpBackend");var G=ft;var Y=class Y{constructor(t){d(this,"headers");d(this,"ok");d(this,"status");d(this,"statusText");d(this,"url");d(this,"body");d(this,"contentType");d(this,"hasBody",!1);this.headers=t?.headers instanceof Headers?t?.headers:new Headers(t?.headers),this.status=t?.status||200,this.statusText=t?.statusText||"OK",this.url=t?.url||null,this.ok=this.status>=200&&this.status<300,this.body=t?.body,this.hasBody=t?.body!=null||!!t?.hasBody,this.contentType=(this.headers.get("content-type")||"").split(";")[0]}clone(t){return new Y({...this,...t})}};u(Y,"HttpResponse");var W=Y;var E;(function(r){r.Sent="Sent",r.UploadProgress="UploadProgress",r.ResponseHeader="ResponseHeader",r.DownloadProgress="DownloadProgress",r.Response="Response",r.User="User"})(E||(E={}));var lt=class lt extends G{constructor(e,n){super(e,n);d(this,"interceptors");d(this,"defaults");this.interceptors=Array.from(new Set([...n?.interceptors||[]])),this.defaults={...n?.defaults,headers:n?.defaults?.headers instanceof Headers?n?.defaults?.headers:new Headers(n?.defaults?.headers),params:n?.defaults?.params instanceof URLSearchParams?n?.defaults?.params:new URLSearchParams(n?.defaults?.params)}}handle(e){return new De(n=>{(async()=>{let i=this.prepareRequest(e);if(i.body&&e.reportProgress){let f=i.body,p=i.headers.get("content-length")||"0",I=parseInt(p,10)||0,x=0,S=new TransformStream({transform(C,Z){Z.enqueue(C),x+=C.byteLength,n.next({type:E.UploadProgress,request:i,total:I,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:f.pipeThrough(S),window:e.window,duplex:"half"})}let o=this.send(i);n.next({request:i,type:E.Sent});let s=await o,c=this.createResponse({url:s.url,headers:s.headers,status:s.status,statusText:s.statusText,hasBody:!!s.body});n.next({request:i,type:E.ResponseHeader,response:c});let a;if(s.body)if(e.reportProgress){let f=s.body,p=s.headers.get("content-length")||"0",I=parseInt(p,10)||0,x=0,S=new Response(new ReadableStream({async start(C){let Z=f.getReader();for(;;){let{done:Gt,value:mt}=await Z.read();if(Gt)break;x+=mt.byteLength,C.enqueue(mt),n.next({type:E.DownloadProgress,request:i,total:I,loaded:x})}C.close()}}));a=await this.parseBody(S)}else a=await this.parseBody(s);let l=this.createResponse({url:s.url,headers:s.headers,status:s.status,statusText:s.statusText,body:a});n.next({request:i,type:E.Response,response:l}),n.complete()})().catch(i=>n.error(i))})}send(e){return fetch(e)}prepareRequest(e){let n=e.headers||new Headers,i={...e,...Le(this.defaults,["headers","params"]),headers:n};this.defaults.headers.forEach((c,a)=>{n.has(a)||n.set(a,c)});let o=new URL(i.url,this.serviceUrl);this.defaults.params.size&&(this.defaults.params.forEach((c,a)=>{o.searchParams.has(a)||o.searchParams.set(a,c)}),i.url=o.toString());let s=i.body;if(s){let c="";typeof s=="string"||typeof s=="number"||typeof s=="boolean"?(c='text/plain; charset="UTF-8"',i.body=new Blob([String(s)],{type:c}),n.set("Content-Length",String(i.body.size)),delete i.duplex):Ne(s)?(c="application/octet-stream",i.duplex="half"):Buffer.isBuffer(s)?(c="application/octet-stream",n.set("Content-Length",String(s.length)),delete i.duplex):ke(s)?(c=s.type||"application/octet-stream",n.set("Content-Length",String(s.size)),delete i.duplex):(Pe(s)||(c='application/json;charset="UTF-8"',i.body=new Blob([JSON.stringify(s)],{type:c}),n.set("Content-Length",String(i.body.size))),delete i.duplex),c&&!n.has("Content-Type")&&n.set("Content-Type",c)}return new Request(o.toString(),i)}createResponse(e){return new W(e)}async parseBody(e){let n,i=e.headers.get("Content-Type")||"";if(pt.is(i,["json","application/*+json"]))n=await e.json(),typeof n=="string"&&(n=JSON.parse(n));else if(pt.is(i,["text"]))n=await e.text();else if(pt.is(i,["multipart"]))n=await e.formData();else{let o=await e.arrayBuffer();o.byteLength&&(n=o)}return n}};u(lt,"FetchBackend");var z=lt;import{updateErrorMessage as qt}from"@jsopen/objects";import{ApiDocumentFactory as qe}from"@opra/common";import _e from"@browsery/type-is";import{MimeTypes as $e}from"@opra/common";import{lastValueFrom as Ot,Observable as Oe}from"rxjs";var dt=class dt{constructor(t,e){d(this,"chain");d(this,"finalHandler");this.chain=t.reduceRight((n,i)=>(o,s)=>i.intercept(o,{handle:u(c=>n(c,s),"handle")}),Me),this.finalHandler=e}handle(t){return this.chain(t,e=>this.finalHandler.handle(e))}};u(dt,"HttpInterceptorHandler");var J=dt;function Me(r,t){return t(r)}u(Me,"chainEnd");var X=class X extends Oe{constructor(t,e){super(n=>{let i=this[g].observe;new J(t.interceptors||[],this[B]).handle(this[g]).subscribe({next(o){if(i===A.Events){n.next(o);return}if(i===A.ResponseHeader&&o.type===E.ResponseHeader){n.next(o.response),n.complete();return}if(o.type===E.Response){let{response:s}=o;if(i===A.Response){n.next(s),n.complete();return}let c=_e.is(o.response.contentType||"",[$e.opra_response_json]);if(s.status>=400&&s.status<600){n.error(new H({message:s.status+" "+s.statusText,status:s.status,issues:c?s.body.errors:void 0})),n.complete();return}n.next(o.response.body),n.complete()}},error(o){n.error(o)},complete(){n.complete()}})}),Object.defineProperty(this,B,{enumerable:!1,value:t}),Object.defineProperty(this,g,{enumerable:!1,value:{...e,observe:A.Body,headers:new Headers(e?.headers)}})}clone(){return new X(this[B],this[g])}options(t){return Object.assign(this[g],t),this}header(t,e){let n=this[g].headers;return typeof t=="object"?((t instanceof Headers?t:new Headers(t)).forEach((o,s)=>{s.toLowerCase()==="set-cookie"?n.append(s,o):n.set(s,o)}),this):(e==null||e===""?n.delete(t):n.append(t,String(e)),this)}param(t,e){e&&typeof e=="object"&&(e=JSON.stringify(e));let n=this[g].url.searchParams;return typeof t=="object"?(typeof t.forEach=="function"?t.forEach((i,o)=>n.set(String(o),String(i))):Object.entries(t).forEach(i=>n.set(String(i[0]),String(i[1]))),this):(e==null?n.delete(t):n.set(t,String(e)),this)}observe(t){if(t===this[g].observe)return this;let e=this.clone();return e[g].observe=t||A.Body,e}getBody(){return Ot(this.observe(A.Body))}getResponse(){return Ot(this.observe(A.Response))}};u(X,"HttpRequestObservable");var V=X;var je=/^(\/*)(.+)/,yt=class yt{constructor(t){Object.defineProperty(this,B,{enumerable:!1,value:t})}get serviceUrl(){return this[B].serviceUrl}async fetchDocument(t){let e={},n=u(async o=>{let s=this.request("$schema",{headers:new Headers({accept:"application/json"})});o&&s.param("id",o);let c=await s.getBody().catch(a=>{throw qt(a,"Error fetching api schema from url ("+this.serviceUrl+`).
|
|
7
|
+
`+a.message),a});if(c.references){let a=c.references;c.references={};for(let[l,f]of Object.entries(a)){if(e[f.id]===null)throw new Error("Circular reference detected");e[f.id]=null;let p=await n(f.id);c.references[l]=e[f.id]=p}}return c},"getDocument"),i=await n(t?.documentId);return await qe.createDocument(i).catch(o=>{throw qt(o,`Error loading api document.
|
|
8
|
+
`+o.message),o})}request(t,e){t=je.exec(t)?.[2]||"";let n=new V(this[B],{...e,method:e?.method||"GET",url:new URL(t,this.serviceUrl)});return e?.params&&n.param(e.params),n}delete(t,e){return this.request(t,{...e,method:"DELETE"})}get(t,e){return this.request(t,{...e,method:"GET"})}patch(t,e,n){return this.request(t,{...n,method:"PATCH",body:e})}post(t,e,n){return this.request(t,{...n,method:"POST",body:e})}put(t,e,n){return this.request(t,{...n,method:"PUT",body:e})}};u(yt,"HttpClientBase");var K=yt;var xt=class xt extends K{constructor(t,e){super(new z(t,e))}get defaults(){return this[B].defaults}};u(xt,"OpraHttpClient");var jt=xt;function Or(r,...t){let e="",n;for(n=0;n<r.length;n++)e+=r[0]+encodeURIComponent(t[n]);return e}u(Or,"urlPath");globalThis.Buffer=Ht.Buffer;export{j as Backend,H as ClientError,z as FetchBackend,G as HttpBackend,K as HttpClientBase,E as HttpEventType,A as HttpObserveType,V as HttpRequestObservable,W as HttpResponse,jt as OpraHttpClient,B as kBackend,be as kClient,g as kContext,Or as urlPath};
|
|
9
9
|
/*! Bundled license information:
|
|
10
10
|
|
|
11
11
|
ieee754/index.js:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { HttpResponse } from '../http-response';
|
|
1
|
+
import type { HttpResponse } from '../http-response.js';
|
|
2
2
|
export type HttpEvent<T = any, TResponseExt = {}> = HttpSentEvent | HttpProgressEvent | HttpResponseHeaderEvent | HttpResponseEvent<T, TResponseExt> | HttpUserEvent;
|
|
3
3
|
/**
|
|
4
4
|
* Type enumeration for the different kinds of `HttpEvent`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opra/client",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.25.1",
|
|
4
4
|
"description": "Opra Client package",
|
|
5
5
|
"author": "Panates",
|
|
6
6
|
"license": "MIT",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"tslib": "^2.8.1"
|
|
11
11
|
},
|
|
12
12
|
"peerDependencies": {
|
|
13
|
-
"@opra/common": "^1.
|
|
13
|
+
"@opra/common": "^1.25.1",
|
|
14
14
|
"rxjs": "^7.0.0 || ^8.0.0"
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|