apify-client 3.0.0-beta.115 → 3.0.0-beta.116

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/dist/bundle.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*! LICENSE: bundle.js.LICENSE.txt */
2
- var e={v(e,t,i){var n=i("z");let r=/[\u001b\u009b][[\]#;?()]*(?:(?:(?:[^\W_]*;?[^\W_]*)\u0007)|(?:(?:[0-9]{1,4}(;[0-9]{0,4})*)?[~0-9=<>cf-nqrtyA-PRZ]))/g,o=()=>{let e={enabled:void 0!==n&&"0"!==n.env.FORCE_COLOR,visible:!0,styles:{},keys:{}},t=(e,t,i)=>"function"==typeof e?e(t):e.wrap(t,i),o=(i,n)=>{if(""===i||null==i)return"";if(!1===e.enabled)return i;if(!1===e.visible)return"";let r=""+i,o=r.includes("\n"),a=n.length;for(a>0&&n.includes("unstyle")&&(n=[...new Set(["unstyle",...n])].reverse());a-- >0;)r=t(e.styles[n[a]],r,o);return r},a=(t,i,n)=>{var r;let a,s,l;e.styles[t]=(a=(r={name:t,codes:i}).open=`\x1b[${r.codes[0]}m`,s=r.close=`\x1b[${r.codes[1]}m`,l=r.regex=RegExp(`\\u001b\\[${r.codes[1]}m`,"g"),r.wrap=(e,t)=>{e.includes(s)&&(e=e.replace(l,s+a));let i=a+e+s;return t?i.replace(/\r*\n/g,`${s}$&${a}`):i},r),(e.keys[n]||(e.keys[n]=[])).push(t),Reflect.defineProperty(e,t,{configurable:!0,enumerable:!0,set(i){e.alias(t,i)},get(){let i=e=>o(e,i.stack);return Reflect.setPrototypeOf(i,e),i.stack=this.stack?this.stack.concat(t):[t],i}})};return a("reset",[0,0],"modifier"),a("bold",[1,22],"modifier"),a("dim",[2,22],"modifier"),a("italic",[3,23],"modifier"),a("underline",[4,24],"modifier"),a("inverse",[7,27],"modifier"),a("hidden",[8,28],"modifier"),a("strikethrough",[9,29],"modifier"),a("black",[30,39],"color"),a("red",[31,39],"color"),a("green",[32,39],"color"),a("yellow",[33,39],"color"),a("blue",[34,39],"color"),a("magenta",[35,39],"color"),a("cyan",[36,39],"color"),a("white",[37,39],"color"),a("gray",[90,39],"color"),a("grey",[90,39],"color"),a("bgBlack",[40,49],"bg"),a("bgRed",[41,49],"bg"),a("bgGreen",[42,49],"bg"),a("bgYellow",[43,49],"bg"),a("bgBlue",[44,49],"bg"),a("bgMagenta",[45,49],"bg"),a("bgCyan",[46,49],"bg"),a("bgWhite",[47,49],"bg"),a("blackBright",[90,39],"bright"),a("redBright",[91,39],"bright"),a("greenBright",[92,39],"bright"),a("yellowBright",[93,39],"bright"),a("blueBright",[94,39],"bright"),a("magentaBright",[95,39],"bright"),a("cyanBright",[96,39],"bright"),a("whiteBright",[97,39],"bright"),a("bgBlackBright",[100,49],"bgBright"),a("bgRedBright",[101,49],"bgBright"),a("bgGreenBright",[102,49],"bgBright"),a("bgYellowBright",[103,49],"bgBright"),a("bgBlueBright",[104,49],"bgBright"),a("bgMagentaBright",[105,49],"bgBright"),a("bgCyanBright",[106,49],"bgBright"),a("bgWhiteBright",[107,49],"bgBright"),e.ansiRegex=r,e.hasColor=e.hasAnsi=t=>(e.ansiRegex.lastIndex=0,"string"==typeof t&&""!==t&&e.ansiRegex.test(t)),e.alias=(t,i)=>{let n="string"==typeof i?e[i]:i;if("function"!=typeof n)throw TypeError("Expected alias to be the name of an existing color (string) or a function");n.stack||(Reflect.defineProperty(n,"name",{value:t}),e.styles[t]=n,n.stack=[t]),Reflect.defineProperty(e,t,{configurable:!0,enumerable:!0,set(i){e.alias(t,i)},get(){let t=e=>o(e,t.stack);return Reflect.setPrototypeOf(t,e),t.stack=this.stack?this.stack.concat(n.stack):n.stack,t}})},e.theme=t=>{if(!(null!==t&&"object"==typeof t&&!Array.isArray(t)))throw TypeError("Expected theme to be an object");for(let i of Object.keys(t))e.alias(i,t[i]);return e},e.alias("unstyle",t=>"string"==typeof t&&""!==t?(e.ansiRegex.lastIndex=0,t.replace(e.ansiRegex,"")):""),e.alias("noop",e=>e),e.none=e.clear=e.noop,e.stripColor=e.unstyle,e.symbols=i("L"),e.define=a,e};e.exports=o(),e.exports.create=o},L(e,t,i){var n=i("z");let r=void 0!==n&&"Hyper"===n.env.TERM_PROGRAM,o=void 0!==n&&"win32"===n.platform,a=void 0!==n&&"linux"===n.platform,s={ballotDisabled:"☒",ballotOff:"☐",ballotOn:"☑",bullet:"•",bulletWhite:"◦",fullBlock:"█",heart:"❤",identicalTo:"≡",line:"─",mark:"※",middot:"·",minus:"-",multiplication:"×",obelus:"÷",pencilDownRight:"✎",pencilRight:"✏",pencilUpRight:"✐",percent:"%",pilcrow2:"❡",pilcrow:"¶",plusMinus:"±",question:"?",section:"§",starsOff:"☆",starsOn:"★",upDownArrow:"↕"},l=Object.assign({},s,{check:"√",cross:"×",ellipsisLarge:"...",ellipsis:"...",info:"i",questionSmall:"?",pointer:">",pointerSmall:"»",radioOff:"( )",radioOn:"(*)",warning:"‼"}),u=Object.assign({},s,{ballotCross:"✘",check:"✔",cross:"✖",ellipsisLarge:"⋯",ellipsis:"…",info:"ℹ",questionFull:"?",questionSmall:"﹖",pointer:a?"▸":"❯",pointerSmall:a?"‣":"›",radioOff:"◯",radioOn:"◉",warning:"⚠"});e.exports=o&&!r?l:u,Reflect.defineProperty(e.exports,"common",{enumerable:!1,value:s}),Reflect.defineProperty(e.exports,"windows",{enumerable:!1,value:l}),Reflect.defineProperty(e.exports,"other",{enumerable:!1,value:u})},J(e,t){t.byteLength=function(e){var t=l(e),i=t[0],n=t[1];return(i+n)*3/4-n},t.toByteArray=function(e){var t,i,o=l(e),a=o[0],s=o[1],u=new r((a+s)*3/4-s),c=0,p=s>0?a-4:a;for(i=0;i<p;i+=4)t=n[e.charCodeAt(i)]<<18|n[e.charCodeAt(i+1)]<<12|n[e.charCodeAt(i+2)]<<6|n[e.charCodeAt(i+3)],u[c++]=t>>16&255,u[c++]=t>>8&255,u[c++]=255&t;return 2===s&&(t=n[e.charCodeAt(i)]<<2|n[e.charCodeAt(i+1)]>>4,u[c++]=255&t),1===s&&(t=n[e.charCodeAt(i)]<<10|n[e.charCodeAt(i+1)]<<4|n[e.charCodeAt(i+2)]>>2,u[c++]=t>>8&255,u[c++]=255&t),u},t.fromByteArray=function(e){for(var t,n=e.length,r=n%3,o=[],a=0,s=n-r;a<s;a+=16383)o.push(function(e,t,n){for(var r,o=[],a=t;a<n;a+=3)r=(e[a]<<16&0xff0000)+(e[a+1]<<8&65280)+(255&e[a+2]),o.push(i[r>>18&63]+i[r>>12&63]+i[r>>6&63]+i[63&r]);return o.join("")}(e,a,a+16383>s?s:a+16383));return 1===r?o.push(i[(t=e[n-1])>>2]+i[t<<4&63]+"=="):2===r&&o.push(i[(t=(e[n-2]<<8)+e[n-1])>>10]+i[t>>4&63]+i[t<<2&63]+"="),o.join("")};for(var i=[],n=[],r="u">typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=o.length;a<s;++a)i[a]=o[a],n[o.charCodeAt(a)]=a;function l(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var i=e.indexOf("=");-1===i&&(i=t);var n=i===t?0:4-i%4;return[i,n]}n[45]=62,n[95]=63},d(e,t,i){var n=i("J"),r=i("r"),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function a(e){if(e>0x7fffffff)throw RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,s.prototype),t}function s(e,t,i){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return c(e)}return l(e,t,i)}function l(e,t,i){if("string"==typeof e){var n=e,r=t;if(("string"!=typeof r||""===r)&&(r="utf8"),!s.isEncoding(r))throw TypeError("Unknown encoding: "+r);var o=0|h(n,r),l=a(o),u=l.write(n,r);return u!==o&&(l=l.slice(0,u)),l}if(ArrayBuffer.isView(e)){var c=e;if(k(c,Uint8Array)){var m=new Uint8Array(c);return d(m.buffer,m.byteOffset,m.byteLength)}return p(c)}if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(k(e,ArrayBuffer)||e&&k(e.buffer,ArrayBuffer)||"u">typeof SharedArrayBuffer&&(k(e,SharedArrayBuffer)||e&&k(e.buffer,SharedArrayBuffer)))return d(e,t,i);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');var g=e.valueOf&&e.valueOf();if(null!=g&&g!==e)return s.from(g,t,i);var y=function(e){if(s.isBuffer(e)){var t=0|f(e.length),i=a(t);return 0===i.length||e.copy(i,0,0,t),i}return void 0!==e.length?"number"!=typeof e.length||function(e){return e!=e}(e.length)?a(0):p(e):"Buffer"===e.type&&Array.isArray(e.data)?p(e.data):void 0}(e);if(y)return y;if("u">typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return s.from(e[Symbol.toPrimitive]("string"),t,i);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function c(e){return u(e),a(e<0?0:0|f(e))}function p(e){for(var t=e.length<0?0:0|f(e.length),i=a(t),n=0;n<t;n+=1)i[n]=255&e[n];return i}function d(e,t,i){var n;if(t<0||e.byteLength<t)throw RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(i||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(n=void 0===t&&void 0===i?new Uint8Array(e):void 0===i?new Uint8Array(e,t):new Uint8Array(e,t,i),s.prototype),n}function f(e){if(e>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function h(e,t){if(s.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||k(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var i=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===i)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return O(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return x(e).length;default:if(r)return n?-1:O(e).length;t=(""+t).toLowerCase(),r=!0}}function m(e,t,i){var r,o,a,s=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===i||i>this.length)&&(i=this.length),i<=0||(i>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,i){var n=e.length;(!t||t<0)&&(t=0),(!i||i<0||i>n)&&(i=n);for(var r="",o=t;o<i;++o)r+=C[e[o]];return r}(this,t,i);case"utf8":case"utf-8":return v(this,t,i);case"ascii":return function(e,t,i){var n="";i=Math.min(e.length,i);for(var r=t;r<i;++r)n+=String.fromCharCode(127&e[r]);return n}(this,t,i);case"latin1":case"binary":return function(e,t,i){var n="";i=Math.min(e.length,i);for(var r=t;r<i;++r)n+=String.fromCharCode(e[r]);return n}(this,t,i);case"base64":return r=this,o=t,a=i,0===o&&a===r.length?n.fromByteArray(r):n.fromByteArray(r.slice(o,a));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,i){for(var n=e.slice(t,i),r="",o=0;o<n.length-1;o+=2)r+=String.fromCharCode(n[o]+256*n[o+1]);return r}(this,t,i);default:if(s)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),s=!0}}function g(e,t,i){var n=e[t];e[t]=e[i],e[i]=n}function y(e,t,i,n,r){var o;if(0===e.length)return -1;if("string"==typeof i?(n=i,i=0):i>0x7fffffff?i=0x7fffffff:i<-0x80000000&&(i=-0x80000000),(o=i*=1)!=o&&(i=r?0:e.length-1),i<0&&(i=e.length+i),i>=e.length)if(r)return -1;else i=e.length-1;else if(i<0)if(!r)return -1;else i=0;if("string"==typeof t&&(t=s.from(t,n)),s.isBuffer(t))return 0===t.length?-1:b(e,t,i,n,r);if("number"==typeof t){if(t&=255,"function"==typeof Uint8Array.prototype.indexOf)if(r)return Uint8Array.prototype.indexOf.call(e,t,i);else return Uint8Array.prototype.lastIndexOf.call(e,t,i);return b(e,[t],i,n,r)}throw TypeError("val must be string, number or Buffer")}function b(e,t,i,n,r){var o,a=1,s=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return -1;a=2,s/=2,l/=2,i/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(r){var c=-1;for(o=i;o<s;o++)if(u(e,o)===u(t,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===l)return c*a}else -1!==c&&(o-=o-c),c=-1}else for(i+l>s&&(i=s-l),o=i;o>=0;o--){for(var p=!0,d=0;d<l;d++)if(u(e,o+d)!==u(t,d)){p=!1;break}if(p)return o}return -1}function v(e,t,i){i=Math.min(e.length,i);for(var n=[],r=t;r<i;){var o,a,s,l,u=e[r],c=null,p=u>239?4:u>223?3:u>191?2:1;if(r+p<=i)switch(p){case 1:u<128&&(c=u);break;case 2:(192&(o=e[r+1]))==128&&(l=(31&u)<<6|63&o)>127&&(c=l);break;case 3:o=e[r+1],a=e[r+2],(192&o)==128&&(192&a)==128&&(l=(15&u)<<12|(63&o)<<6|63&a)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:o=e[r+1],a=e[r+2],s=e[r+3],(192&o)==128&&(192&a)==128&&(192&s)==128&&(l=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&l<1114112&&(c=l)}null===c?(c=65533,p=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),r+=p}var d=n,f=d.length;if(f<=4096)return String.fromCharCode.apply(String,d);for(var h="",m=0;m<f;)h+=String.fromCharCode.apply(String,d.slice(m,m+=4096));return h}function _(e,t,i){if(e%1!=0||e<0)throw RangeError("offset is not uint");if(e+t>i)throw RangeError("Trying to access beyond buffer length")}function w(e,t,i,n,r,o){if(!s.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>r||t<o)throw RangeError('"value" argument is out of bounds');if(i+n>e.length)throw RangeError("Index out of range")}function E(e,t,i,n,r,o){if(i+n>e.length||i<0)throw RangeError("Index out of range")}function S(e,t,i,n,o){return t*=1,i>>>=0,o||E(e,t,i,4,34028234663852886e22,-34028234663852886e22),r.write(e,t,i,n,23,4),i+4}function T(e,t,i,n,o){return t*=1,i>>>=0,o||E(e,t,i,8,17976931348623157e292,-17976931348623157e292),r.write(e,t,i,n,52,8),i+8}t.Buffer=s,t.SlowBuffer=function(e){return+e!=e&&(e=0),s.alloc(+e)},t.INSPECT_MAX_BYTES=50,t.kMaxLength=0x7fffffff,s.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),!s.TYPED_ARRAY_SUPPORT&&"u">typeof console&&"function"==typeof console.error&&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."),Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}}),s.poolSize=8192,s.from=function(e,t,i){return l(e,t,i)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array),s.alloc=function(e,t,i){return(u(e),e<=0)?a(e):void 0!==t?"string"==typeof i?a(e).fill(t,i):a(e).fill(t):a(e)},s.allocUnsafe=function(e){return c(e)},s.allocUnsafeSlow=function(e){return c(e)},s.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==s.prototype},s.compare=function(e,t){if(k(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),k(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(e)||!s.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var i=e.length,n=t.length,r=0,o=Math.min(i,n);r<o;++r)if(e[r]!==t[r]){i=e[r],n=t[r];break}return i<n?-1:+(n<i)},s.isEncoding=function(e){switch(String(e).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}},s.concat=function(e,t){if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return s.alloc(0);if(void 0===t)for(i=0,t=0;i<e.length;++i)t+=e[i].length;var i,n=s.allocUnsafe(t),r=0;for(i=0;i<e.length;++i){var o=e[i];if(k(o,Uint8Array))r+o.length>n.length?s.from(o).copy(n,r):Uint8Array.prototype.set.call(n,o,r);else if(s.isBuffer(o))o.copy(n,r);else throw TypeError('"list" argument must be an Array of Buffers');r+=o.length}return n},s.byteLength=h,s.prototype._isBuffer=!0,s.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)g(this,t,t+1);return this},s.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},s.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},s.prototype.toString=function(){var e=this.length;return 0===e?"":0==arguments.length?v(this,0,e):m.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(e){if(!s.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===s.compare(this,e)},s.prototype.inspect=function(){var e="",i=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(e+=" ... "),"<Buffer "+e+">"},o&&(s.prototype[o]=s.prototype.inspect),s.prototype.compare=function(e,t,i,n,r){if(k(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===i&&(i=e?e.length:0),void 0===n&&(n=0),void 0===r&&(r=this.length),t<0||i>e.length||n<0||r>this.length)throw RangeError("out of range index");if(n>=r&&t>=i)return 0;if(n>=r)return -1;if(t>=i)return 1;if(t>>>=0,i>>>=0,n>>>=0,r>>>=0,this===e)return 0;for(var o=r-n,a=i-t,l=Math.min(o,a),u=this.slice(n,r),c=e.slice(t,i),p=0;p<l;++p)if(u[p]!==c[p]){o=u[p],a=c[p];break}return o<a?-1:+(a<o)},s.prototype.includes=function(e,t,i){return -1!==this.indexOf(e,t,i)},s.prototype.indexOf=function(e,t,i){return y(this,e,t,i,!0)},s.prototype.lastIndexOf=function(e,t,i){return y(this,e,t,i,!1)},s.prototype.write=function(e,t,i,n){if(void 0===t)n="utf8",i=this.length,t=0;else if(void 0===i&&"string"==typeof t)n=t,i=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(i)?(i>>>=0,void 0===n&&(n="utf8")):(n=i,i=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var r,o,a,s,l,u,c,p,d=this.length-t;if((void 0===i||i>d)&&(i=d),e.length>0&&(i<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var f=!1;;)switch(n){case"hex":return function(e,t,i,n){i=Number(i)||0;var r=e.length-i;n?(n=Number(n))>r&&(n=r):n=r;var o=t.length;n>o/2&&(n=o/2);for(var a=0;a<n;++a){var s,l=parseInt(t.substr(2*a,2),16);if((s=l)!=s)break;e[i+a]=l}return a}(this,e,t,i);case"utf8":case"utf-8":return r=t,o=i,A(O(e,this.length-r),this,r,o);case"ascii":case"latin1":case"binary":return a=t,s=i,A(function(e){for(var t=[],i=0;i<e.length;++i)t.push(255&e.charCodeAt(i));return t}(e),this,a,s);case"base64":return l=t,u=i,A(x(e),this,l,u);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return c=t,p=i,A(function(e,t){for(var i,n,r=[],o=0;o<e.length&&!((t-=2)<0);++o)n=(i=e.charCodeAt(o))>>8,r.push(i%256),r.push(n);return r}(e,this.length-c),this,c,p);default:if(f)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),f=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},s.prototype.slice=function(e,t){var i=this.length;e=~~e,t=void 0===t?i:~~t,e<0?(e+=i)<0&&(e=0):e>i&&(e=i),t<0?(t+=i)<0&&(t=0):t>i&&(t=i),t<e&&(t=e);var n=this.subarray(e,t);return Object.setPrototypeOf(n,s.prototype),n},s.prototype.readUintLE=s.prototype.readUIntLE=function(e,t,i){e>>>=0,t>>>=0,i||_(e,t,this.length);for(var n=this[e],r=1,o=0;++o<t&&(r*=256);)n+=this[e+o]*r;return n},s.prototype.readUintBE=s.prototype.readUIntBE=function(e,t,i){e>>>=0,t>>>=0,i||_(e,t,this.length);for(var n=this[e+--t],r=1;t>0&&(r*=256);)n+=this[e+--t]*r;return n},s.prototype.readUint8=s.prototype.readUInt8=function(e,t){return e>>>=0,t||_(e,1,this.length),this[e]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(e,t){return e>>>=0,t||_(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(e,t){return e>>>=0,t||_(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(e,t){return e>>>=0,t||_(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+0x1000000*this[e+3]},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(e,t){return e>>>=0,t||_(e,4,this.length),0x1000000*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readIntLE=function(e,t,i){e>>>=0,t>>>=0,i||_(e,t,this.length);for(var n=this[e],r=1,o=0;++o<t&&(r*=256);)n+=this[e+o]*r;return n>=(r*=128)&&(n-=Math.pow(2,8*t)),n},s.prototype.readIntBE=function(e,t,i){e>>>=0,t>>>=0,i||_(e,t,this.length);for(var n=t,r=1,o=this[e+--n];n>0&&(r*=256);)o+=this[e+--n]*r;return o>=(r*=128)&&(o-=Math.pow(2,8*t)),o},s.prototype.readInt8=function(e,t){return(e>>>=0,t||_(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},s.prototype.readInt16LE=function(e,t){e>>>=0,t||_(e,2,this.length);var i=this[e]|this[e+1]<<8;return 32768&i?0xffff0000|i:i},s.prototype.readInt16BE=function(e,t){e>>>=0,t||_(e,2,this.length);var i=this[e+1]|this[e]<<8;return 32768&i?0xffff0000|i:i},s.prototype.readInt32LE=function(e,t){return e>>>=0,t||_(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return e>>>=0,t||_(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readFloatLE=function(e,t){return e>>>=0,t||_(e,4,this.length),r.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return e>>>=0,t||_(e,4,this.length),r.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return e>>>=0,t||_(e,8,this.length),r.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return e>>>=0,t||_(e,8,this.length),r.read(this,e,!1,52,8)},s.prototype.writeUintLE=s.prototype.writeUIntLE=function(e,t,i,n){if(e*=1,t>>>=0,i>>>=0,!n){var r=Math.pow(2,8*i)-1;w(this,e,t,i,r,0)}var o=1,a=0;for(this[t]=255&e;++a<i&&(o*=256);)this[t+a]=e/o&255;return t+i},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(e,t,i,n){if(e*=1,t>>>=0,i>>>=0,!n){var r=Math.pow(2,8*i)-1;w(this,e,t,i,r,0)}var o=i-1,a=1;for(this[t+o]=255&e;--o>=0&&(a*=256);)this[t+o]=e/a&255;return t+i},s.prototype.writeUint8=s.prototype.writeUInt8=function(e,t,i){return e*=1,t>>>=0,i||w(this,e,t,1,255,0),this[t]=255&e,t+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(e,t,i){return e*=1,t>>>=0,i||w(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(e,t,i){return e*=1,t>>>=0,i||w(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(e,t,i){return e*=1,t>>>=0,i||w(this,e,t,4,0xffffffff,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(e,t,i){return e*=1,t>>>=0,i||w(this,e,t,4,0xffffffff,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},s.prototype.writeIntLE=function(e,t,i,n){if(e*=1,t>>>=0,!n){var r=Math.pow(2,8*i-1);w(this,e,t,i,r-1,-r)}var o=0,a=1,s=0;for(this[t]=255&e;++o<i&&(a*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/a|0)-s&255;return t+i},s.prototype.writeIntBE=function(e,t,i,n){if(e*=1,t>>>=0,!n){var r=Math.pow(2,8*i-1);w(this,e,t,i,r-1,-r)}var o=i-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a|0)-s&255;return t+i},s.prototype.writeInt8=function(e,t,i){return e*=1,t>>>=0,i||w(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},s.prototype.writeInt16LE=function(e,t,i){return e*=1,t>>>=0,i||w(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeInt16BE=function(e,t,i){return e*=1,t>>>=0,i||w(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeInt32LE=function(e,t,i){return e*=1,t>>>=0,i||w(this,e,t,4,0x7fffffff,-0x80000000),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},s.prototype.writeInt32BE=function(e,t,i){return e*=1,t>>>=0,i||w(this,e,t,4,0x7fffffff,-0x80000000),e<0&&(e=0xffffffff+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},s.prototype.writeFloatLE=function(e,t,i){return S(this,e,t,!0,i)},s.prototype.writeFloatBE=function(e,t,i){return S(this,e,t,!1,i)},s.prototype.writeDoubleLE=function(e,t,i){return T(this,e,t,!0,i)},s.prototype.writeDoubleBE=function(e,t,i){return T(this,e,t,!1,i)},s.prototype.copy=function(e,t,i,n){if(!s.isBuffer(e))throw TypeError("argument should be a Buffer");if(i||(i=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<i&&(n=i),n===i||0===e.length||0===this.length)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-i&&(n=e.length-t+i);var r=n-i;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,i,n):Uint8Array.prototype.set.call(e,this.subarray(i,n),t),r},s.prototype.fill=function(e,t,i,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,i=this.length):"string"==typeof i&&(n=i,i=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!s.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===e.length){var r,o=e.charCodeAt(0);("utf8"===n&&o<128||"latin1"===n)&&(e=o)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<i)throw RangeError("Out of range index");if(i<=t)return this;if(t>>>=0,i=void 0===i?this.length:i>>>0,e||(e=0),"number"==typeof e)for(r=t;r<i;++r)this[r]=e;else{var a=s.isBuffer(e)?e:s.from(e,n),l=a.length;if(0===l)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(r=0;r<i-t;++r)this[r+t]=a[r%l]}return this};var R=/[^+/0-9A-Za-z-_]/g;function O(e,t){t=t||1/0;for(var i,n=e.length,r=null,o=[],a=0;a<n;++a){if((i=e.charCodeAt(a))>55295&&i<57344){if(!r){if(i>56319||a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}r=i;continue}if(i<56320){(t-=3)>-1&&o.push(239,191,189),r=i;continue}i=(r-55296<<10|i-56320)+65536}else r&&(t-=3)>-1&&o.push(239,191,189);if(r=null,i<128){if((t-=1)<0)break;o.push(i)}else if(i<2048){if((t-=2)<0)break;o.push(i>>6|192,63&i|128)}else if(i<65536){if((t-=3)<0)break;o.push(i>>12|224,i>>6&63|128,63&i|128)}else if(i<1114112){if((t-=4)<0)break;o.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}else throw Error("Invalid code point")}return o}function x(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(R,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function A(e,t,i,n){for(var r=0;r<n&&!(r+i>=t.length)&&!(r>=e.length);++r)t[r+i]=e[r];return r}function k(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}var C=function(){for(var e="0123456789abcdef",t=Array(256),i=0;i<16;++i)for(var n=16*i,r=0;r<16;++r)t[n+r]=e[i]+e[r];return t}()},q(e){var t,i="object"==typeof Reflect?Reflect:null,n=i&&"function"==typeof i.apply?i.apply:function(e,t,i){return Function.prototype.apply.call(e,t,i)};t=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var r=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise(function(i,n){var r,o,a;function s(i){e.removeListener(t,l),n(i)}function l(){"function"==typeof e.removeListener&&e.removeListener("error",s),i([].slice.call(arguments))}m(e,t,l,{once:!0}),"error"!==t&&(r=e,o=s,a={once:!0},"function"==typeof r.on&&m(r,"error",o,a))})},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var a=10;function s(e){if("function"!=typeof e)throw TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function u(e,t,i,n){if(s(i),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,i.listener?i.listener:i),o=e._events),a=o[t]),void 0===a)a=o[t]=i,++e._eventsCount;else if("function"==typeof a?a=o[t]=n?[i,a]:[a,i]:n?a.unshift(i):a.push(i),(r=l(e))>0&&a.length>r&&!a.warned){a.warned=!0;var r,o,a,u=Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,console&&console.warn&&console.warn(u)}return e}function c(){if(!this.fired)return(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0==arguments.length)?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,i){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:i},r=c.bind(n);return r.listener=i,n.wrapFn=r,r}function d(e,t,i){var n=e._events;if(void 0===n)return[];var r=n[t];return void 0===r?[]:"function"==typeof r?i?[r.listener||r]:[r]:i?function(e){for(var t=Array(e.length),i=0;i<t.length;++i)t[i]=e[i].listener||e[i];return t}(r):h(r,r.length)}function f(e){var t=this._events;if(void 0!==t){var i=t[e];if("function"==typeof i)return 1;if(void 0!==i)return i.length}return 0}function h(e,t){for(var i=Array(t),n=0;n<t;++n)i[n]=e[n];return i}function m(e,t,i,n){if("function"==typeof e.on)n.once?e.once(t,i):e.on(t,i);else if("function"==typeof e.addEventListener)e.addEventListener(t,function r(o){n.once&&e.removeEventListener(t,r),i(o)});else throw TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||r(e))throw RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),o.init=function(){(void 0===this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||r(e))throw RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return l(this)},o.prototype.emit=function(e){for(var t=[],i=1;i<arguments.length;i++)t.push(arguments[i]);var r="error"===e,o=this._events;if(void 0!==o)r=r&&void 0===o.error;else if(!r)return!1;if(r){if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var a,s=Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var l=o[e];if(void 0===l)return!1;if("function"==typeof l)n(l,this,t);else for(var u=l.length,c=h(l,u),i=0;i<u;++i)n(c[i],this,t);return!0},o.prototype.addListener=function(e,t){return u(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return u(this,e,t,!0)},o.prototype.once=function(e,t){return s(t),this.on(e,p(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return s(t),this.prependListener(e,p(this,e,t)),this},o.prototype.removeListener=function(e,t){var i,n,r,o,a;if(s(t),void 0===(n=this._events)||void 0===(i=n[e]))return this;if(i===t||i.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,i.listener||t));else if("function"!=typeof i){for(r=-1,o=i.length-1;o>=0;o--)if(i[o]===t||i[o].listener===t){a=i[o].listener,r=o;break}if(r<0)return this;0===r?i.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(i,r),1===i.length&&(n[e]=i[0]),void 0!==n.removeListener&&this.emit("removeListener",e,a||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,i,n;if(void 0===(i=this._events))return this;if(void 0===i.removeListener)return 0==arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==i[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete i[e]),this;if(0==arguments.length){var r,o=Object.keys(i);for(n=0;n<o.length;++n)"removeListener"!==(r=o[n])&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=i[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return d(this,e,!0)},o.prototype.rawListeners=function(e){return d(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},o.prototype.listenerCount=f,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},r(e,t){t.read=function(e,t,i,n,r){var o,a,s=8*r-n-1,l=(1<<s)-1,u=l>>1,c=-7,p=i?r-1:0,d=i?-1:1,f=e[t+p];for(p+=d,o=f&(1<<-c)-1,f>>=-c,c+=s;c>0;o=256*o+e[t+p],p+=d,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=256*a+e[t+p],p+=d,c-=8);if(0===o)o=1-u;else{if(o===l)return a?0/0:(f?-1:1)*2e308;a+=Math.pow(2,n),o-=u}return(f?-1:1)*a*Math.pow(2,o-n)},t.write=function(e,t,i,n,r,o){var a,s,l,u=8*o-r-1,c=(1<<u)-1,p=c>>1,d=5960464477539062e-23*(23===r),f=n?0:o-1,h=n?1:-1,m=+(t<0||0===t&&1/t<0);for(isNaN(t=Math.abs(t))||1/0===t?(s=+!!isNaN(t),a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+p>=1?t+=d/l:t+=d*Math.pow(2,1-p),t*l>=2&&(a++,l/=2),a+p>=c?(s=0,a=c):a+p>=1?(s=(t*l-1)*Math.pow(2,r),a+=p):(s=t*Math.pow(2,p-1)*Math.pow(2,r),a=0));r>=8;e[i+f]=255&s,f+=h,s/=256,r-=8);for(a=a<<r|s,u+=r;u>0;e[i+f]=255&a,f+=h,a/=256,u-=8);e[i+f-h]|=128*m}},c5(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var i=function(){};i.prototype=t.prototype,e.prototype=new i,e.prototype.constructor=e}}},z(e){var t,i,n,r=e.exports={};function o(){throw Error("setTimeout has not been defined")}function a(){throw Error("clearTimeout has not been defined")}try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{i="function"==typeof clearTimeout?clearTimeout:a}catch(e){i=a}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(i){try{return t.call(null,e,0)}catch(i){return t.call(this,e,0)}}}var l=[],u=!1,c=-1;function p(){u&&n&&(u=!1,n.length?l=n.concat(l):c=-1,l.length&&d())}function d(){if(!u){var e=s(p);u=!0;for(var t=l.length;t;){for(n=l,l=[];++c<t;)n&&n[c].run();c=-1,t=l.length}n=null,u=!1,function(e){if(i===clearTimeout)return clearTimeout(e);if((i===a||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(e);try{i(e)}catch(t){try{return i.call(null,e)}catch(t){return i.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function h(){}r.nextTick=function(e){var t=Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)t[i-1]=arguments[i];l.push(new f(e,t)),1!==l.length||u||s(d)},f.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=h,r.addListener=h,r.once=h,r.off=h,r.removeListener=h,r.removeAllListeners=h,r.emit=h,r.prependListener=h,r.prependOnceListener=h,r.listeners=function(e){return[]},r.binding=function(e){throw Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(e){throw Error("process.chdir is not supported")},r.umask=function(){return 0}},K(e,t,i){var n=i("d"),r=n.Buffer;function o(e,t){for(var i in e)t[i]=e[i]}function a(e,t,i){return r(e,t,i)}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=a),a.prototype=Object.create(r.prototype),o(r,a),a.from=function(e,t,i){if("number"==typeof e)throw TypeError("Argument must not be a number");return r(e,t,i)},a.alloc=function(e,t,i){if("number"!=typeof e)throw TypeError("Argument must be a number");var n=r(e);return void 0!==t?"string"==typeof i?n.fill(t,i):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return r(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return n.SlowBuffer(e)}},c(e,t,i){e.exports=r;var n=i("q").EventEmitter;function r(){n.call(this)}i("c5")(r,n),r.Readable=i("e"),r.Writable=i("ep"),r.Duplex=i("F"),r.Transform=i("hR"),r.PassThrough=i("zM"),r.finished=i("n"),r.pipeline=i("Kx"),r.Stream=r,r.prototype.pipe=function(e,t){var i=this;function r(t){e.writable&&!1===e.write(t)&&i.pause&&i.pause()}function o(){i.readable&&i.resume&&i.resume()}i.on("data",r),e.on("drain",o),e._isStdio||t&&!1===t.end||(i.on("end",s),i.on("close",l));var a=!1;function s(){a||(a=!0,e.end())}function l(){a||(a=!0,"function"==typeof e.destroy&&e.destroy())}function u(e){if(c(),0===n.listenerCount(this,"error"))throw e}function c(){i.removeListener("data",r),e.removeListener("drain",o),i.removeListener("end",s),i.removeListener("close",l),i.removeListener("error",u),e.removeListener("error",u),i.removeListener("end",c),i.removeListener("close",c),e.removeListener("close",c)}return i.on("error",u),e.on("error",u),i.on("end",c),i.on("close",c),e.on("close",c),e.emit("pipe",i),e}},x(e){var t={};function i(e,i,n){n||(n=Error);var r=function(e){function t(t,n,r){return e.call(this,"string"==typeof i?i:i(t,n,r))||this}return t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e,t}(n);r.prototype.name=n.name,r.prototype.code=e,t[e]=r}function n(e,t){if(!Array.isArray(e))return"of ".concat(t," ").concat(String(e));var i=e.length;return(e=e.map(function(e){return String(e)}),i>2)?"one of ".concat(t," ").concat(e.slice(0,i-1).join(", "),", or ")+e[i-1]:2===i?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}i("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),i("ERR_INVALID_ARG_TYPE",function(e,t,i){if("string"==typeof t&&(r="not ",t.substr(0,r.length)===r)?(l="must not be",t=t.replace(/^not /,"")):l="must be",o=" argument",(void 0===a||a>e.length)&&(a=e.length),e.substring(a-o.length,a)===o)u="The ".concat(e," ").concat(l," ").concat(n(t,"type"));else{var r,o,a,s,l,u,c=("number"!=typeof s&&(s=0),s+1>e.length||-1===e.indexOf(".",s))?"argument":"property";u='The "'.concat(e,'" ').concat(c," ").concat(l," ").concat(n(t,"type"))}return u+". Received type ".concat(typeof i)},TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.F=t},F(e,t,i){var n=i("z"),r=Object.keys||function(e){var t=[];for(var i in e)t.push(i);return t};e.exports=c;var o=i("e"),a=i("ep");i("c5")(c,o);for(var s=r(a.prototype),l=0;l<s.length;l++){var u=s[l];c.prototype[u]||(c.prototype[u]=a.prototype[u])}function c(e){if(!(this instanceof c))return new c(e);o.call(this,e),a.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",p)))}function p(){this._writableState.ended||n.nextTick(d,this)}function d(e){e.end()}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(c.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(c.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(c.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})},zM(e,t,i){e.exports=r;var n=i("hR");function r(e){if(!(this instanceof r))return new r(e);n.call(this,e)}i("c5")(r,n),r.prototype._transform=function(e,t,i){i(null,e)}},e(e,t,i){var n,r,o,a,s,l=i("z");e.exports=R,R.ReadableState=T,i("q").EventEmitter;var u=function(e,t){return e.listeners(t).length},c=i("Js"),p=i("d").Buffer,d=(void 0!==i.g?i.g:"u">typeof window?window:"u">typeof self?self:{}).Uint8Array||function(){},f=i("b");r=f&&f.debuglog?f.debuglog("stream"):function(){};var h=i("LP"),m=i("w"),g=i("G").getHighWaterMark,y=i("x").F,b=y.ERR_INVALID_ARG_TYPE,v=y.ERR_STREAM_PUSH_AFTER_EOF,_=y.ERR_METHOD_NOT_IMPLEMENTED,w=y.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;i("c5")(R,c);var E=m.errorOrDestroy,S=["error","close","destroy","pause","resume"];function T(e,t,r){n=n||i("F"),e=e||{},"boolean"!=typeof r&&(r=t instanceof n),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=g(this,e,"readableHighWaterMark",r),this.buffer=new h,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(o||(o=i("t").I),this.decoder=new o(e.encoding),this.encoding=e.encoding)}function R(e){if(n=n||i("F"),!(this instanceof R))return new R(e);var t=this instanceof n;this._readableState=new T(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),c.call(this)}function O(e,t,i,n,o){r("readableAddChunk",t);var a,s,l=e._readableState;if(null===t)l.reading=!1,function(e,t){if(r("onEofChunk"),!t.ended){if(t.decoder){var i=t.decoder.end();i&&i.length&&(t.buffer.push(i),t.length+=t.objectMode?1:i.length)}t.ended=!0,t.sync?k(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,C(e)))}}(e,l);else if(o||(s=function(e,t){var i;return p.isBuffer(t)||t instanceof d||"string"==typeof t||void 0===t||e.objectMode||(i=new b("chunk",["string","Buffer","Uint8Array"],t)),i}(l,t)),s)E(e,s);else if(l.objectMode||t&&t.length>0)if("string"==typeof t||l.objectMode||Object.getPrototypeOf(t)===p.prototype||(a=t,t=p.from(a)),n)l.endEmitted?E(e,new w):x(e,l,t,!0);else if(l.ended)E(e,new v);else{if(l.destroyed)return!1;l.reading=!1,l.decoder&&!i?(t=l.decoder.write(t),l.objectMode||0!==t.length?x(e,l,t,!1):P(e,l)):x(e,l,t,!1)}else n||(l.reading=!1,P(e,l));return!l.ended&&(l.length<l.highWaterMark||0===l.length)}function x(e,t,i,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",i)):(t.length+=t.objectMode?1:i.length,n?t.buffer.unshift(i):t.buffer.push(i),t.needReadable&&k(e)),P(e,t)}function A(e,t){var i;if(e<=0||0===t.length&&t.ended)return 0;if(t.objectMode)return 1;if(e!=e)if(t.flowing&&t.length)return t.buffer.head.data.length;else return t.length;return(e>t.highWaterMark&&((i=e)>=0x40000000?i=0x40000000:(i--,i|=i>>>1,i|=i>>>2,i|=i>>>4,i|=i>>>8,i|=i>>>16,i++),t.highWaterMark=i),e<=t.length)?e:t.ended?t.length:(t.needReadable=!0,0)}function k(e){var t=e._readableState;r("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(r("emitReadable",t.flowing),t.emittedReadable=!0,l.nextTick(C,e))}function C(e){var t=e._readableState;r("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,N(e)}function P(e,t){t.readingMore||(t.readingMore=!0,l.nextTick(I,e,t))}function I(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var i=t.length;if(r("maybeReadMore read 0"),e.read(0),i===t.length)break}t.readingMore=!1}function U(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function z(e){r("readable nexttick read 0"),e.read(0)}function L(e,t){r("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),N(e),t.flowing&&!t.reading&&e.read(0)}function N(e){var t=e._readableState;for(r("flow",t.flowing);t.flowing&&null!==e.read(););}function $(e,t){var i;return 0===t.length?null:(t.objectMode?i=t.buffer.shift():!e||e>=t.length?(i=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):i=t.buffer.consume(e,t.decoder),i)}function D(e){var t=e._readableState;r("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,l.nextTick(M,t,e))}function M(e,t){if(r("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var i=t._writableState;(!i||i.autoDestroy&&i.finished)&&t.destroy()}}function j(e,t){for(var i=0,n=e.length;i<n;i++)if(e[i]===t)return i;return -1}Object.defineProperty(R.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),R.prototype.destroy=m.destroy,R.prototype._undestroy=m.undestroy,R.prototype._destroy=function(e,t){t(e)},R.prototype.push=function(e,t){var i,n=this._readableState;return n.objectMode?i=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=p.from(e,t),t=""),i=!0),O(this,e,t,!1,i)},R.prototype.unshift=function(e){return O(this,e,null,!0,!1)},R.prototype.isPaused=function(){return!1===this._readableState.flowing},R.prototype.setEncoding=function(e){o||(o=i("t").I);var t=new o(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,r="";null!==n;)r+=t.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==r&&this._readableState.buffer.push(r),this._readableState.length=r.length,this},R.prototype.read=function(e){r("read",e),e=parseInt(e,10);var t,i=this._readableState,n=e;if(0!==e&&(i.emittedReadable=!1),0===e&&i.needReadable&&((0!==i.highWaterMark?i.length>=i.highWaterMark:i.length>0)||i.ended))return r("read: emitReadable",i.length,i.ended),0===i.length&&i.ended?D(this):k(this),null;if(0===(e=A(e,i))&&i.ended)return 0===i.length&&D(this),null;var o=i.needReadable;return r("need readable",o),(0===i.length||i.length-e<i.highWaterMark)&&r("length less than watermark",o=!0),i.ended||i.reading?r("reading or ended",o=!1):o&&(r("do read"),i.reading=!0,i.sync=!0,0===i.length&&(i.needReadable=!0),this._read(i.highWaterMark),i.sync=!1,i.reading||(e=A(n,i))),null===(t=e>0?$(e,i):null)?(i.needReadable=i.length<=i.highWaterMark,e=0):(i.length-=e,i.awaitDrain=0),0===i.length&&(i.ended||(i.needReadable=!0),n!==e&&i.ended&&D(this)),null!==t&&this.emit("data",t),t},R.prototype._read=function(e){E(this,new _("_read()"))},R.prototype.pipe=function(e,t){var i,n=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1,r("pipe count=%d opts=%j",o.pipesCount,t);var a=t&&!1===t.end||e===l.stdout||e===l.stderr?g:s;function s(){r("onend"),e.end()}o.endEmitted?l.nextTick(a):n.once("end",a),e.on("unpipe",function t(i,a){r("onunpipe"),i===n&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,r("cleanup"),e.removeListener("close",h),e.removeListener("finish",m),e.removeListener("drain",c),e.removeListener("error",f),e.removeListener("unpipe",t),n.removeListener("end",s),n.removeListener("end",g),n.removeListener("data",d),p=!0,o.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&c())});var c=(i=n,function(){var e=i._readableState;r("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&u(i,"data")&&(e.flowing=!0,N(i))});e.on("drain",c);var p=!1;function d(t){r("ondata");var i=e.write(t);r("dest.write",i),!1===i&&((1===o.pipesCount&&o.pipes===e||o.pipesCount>1&&-1!==j(o.pipes,e))&&!p&&(r("false write response, pause",o.awaitDrain),o.awaitDrain++),n.pause())}function f(t){r("onerror",t),g(),e.removeListener("error",f),0===u(e,"error")&&E(e,t)}function h(){e.removeListener("finish",m),g()}function m(){r("onfinish"),e.removeListener("close",h),g()}function g(){r("unpipe"),n.unpipe(e)}return n.on("data",d),!function(e,t,i){if("function"==typeof e.prependListener)return e.prependListener(t,i);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(i):e._events[t]=[i,e._events[t]]:e.on(t,i)}(e,"error",f),e.once("close",h),e.once("finish",m),e.emit("pipe",n),o.flowing||(r("pipe resume"),n.resume()),e},R.prototype.unpipe=function(e){var t=this._readableState,i={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,i)),this;if(!e){var n=t.pipes,r=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<r;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=j(t.pipes,e);return -1===a||(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,i)),this},R.prototype.on=function(e,t){var i=c.prototype.on.call(this,e,t),n=this._readableState;return"data"===e?(n.readableListening=this.listenerCount("readable")>0,!1!==n.flowing&&this.resume()):"readable"!==e||n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,r("on readable",n.length,n.reading),n.length?k(this):n.reading||l.nextTick(z,this)),i},R.prototype.addListener=R.prototype.on,R.prototype.removeListener=function(e,t){var i=c.prototype.removeListener.call(this,e,t);return"readable"===e&&l.nextTick(U,this),i},R.prototype.removeAllListeners=function(e){var t=c.prototype.removeAllListeners.apply(this,arguments);return("readable"===e||void 0===e)&&l.nextTick(U,this),t},R.prototype.resume=function(){var e,t,i=this._readableState;return i.flowing||(r("resume"),i.flowing=!i.readableListening,e=this,(t=i).resumeScheduled||(t.resumeScheduled=!0,l.nextTick(L,e,t))),i.paused=!1,this},R.prototype.pause=function(){return r("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(r("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},R.prototype.wrap=function(e){var t=this,i=this._readableState,n=!1;for(var o in e.on("end",function(){if(r("wrapped end"),i.decoder&&!i.ended){var e=i.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(o){r("wrapped data"),i.decoder&&(o=i.decoder.write(o)),i.objectMode&&null==o||(i.objectMode||o&&o.length)&&(t.push(o)||(n=!0,e.pause()))}),e)void 0===this[o]&&"function"==typeof e[o]&&(this[o]=function(t){return function(){return e[t].apply(e,arguments)}}(o));for(var a=0;a<S.length;a++)e.on(S[a],this.emit.bind(this,S[a]));return this._read=function(t){r("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(R.prototype[Symbol.asyncIterator]=function(){return void 0===a&&(a=i("tm")),a(this)}),Object.defineProperty(R.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(R.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(R.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),R._fromList=$,Object.defineProperty(R.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(R.from=function(e,t){return void 0===s&&(s=i("s")),s(R,e,t)})},hR(e,t,i){e.exports=c;var n=i("x").F,r=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,a=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=n.ERR_TRANSFORM_WITH_LENGTH_0,l=i("F");function u(e,t){var i=this._transformState;i.transforming=!1;var n=i.writecb;if(null===n)return this.emit("error",new o);i.writechunk=null,i.writecb=null,null!=t&&this.push(t),n(e);var r=this._readableState;r.reading=!1,(r.needReadable||r.length<r.highWaterMark)&&this._read(r.highWaterMark)}function c(e){if(!(this instanceof c))return new c(e);l.call(this,e),this._transformState={afterTransform:u.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",p)}function p(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?d(this,null,null):this._flush(function(t,i){d(e,t,i)})}function d(e,t,i){if(t)return e.emit("error",t);if(null!=i&&e.push(i),e._writableState.length)throw new s;if(e._transformState.transforming)throw new a;return e.push(null)}i("c5")(c,l),c.prototype.push=function(e,t){return this._transformState.needTransform=!1,l.prototype.push.call(this,e,t)},c.prototype._transform=function(e,t,i){i(new r("_transform()"))},c.prototype._write=function(e,t,i){var n=this._transformState;if(n.writecb=i,n.writechunk=e,n.writeencoding=t,!n.transforming){var r=this._readableState;(n.needTransform||r.needReadable||r.length<r.highWaterMark)&&this._read(r.highWaterMark)}},c.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},c.prototype._destroy=function(e,t){l.prototype._destroy.call(this,e,function(e){t(e)})}},ep(e,t,i){var n,r,o=i("z");function a(e){var t=this;this.next=null,this.entry=null,this.finish=function(){var i=t,n=e,r=i.entry;for(i.entry=null;r;){var o=r.callback;n.pendingcb--,o(void 0),r=r.next}n.corkedRequestsFree.next=i}}e.exports=R,R.WritableState=T;var s={deprecate:i("N")},l=i("Js"),u=i("d").Buffer,c=(void 0!==i.g?i.g:"u">typeof window?window:"u">typeof self?self:{}).Uint8Array||function(){},p=i("w"),d=i("G").getHighWaterMark,f=i("x").F,h=f.ERR_INVALID_ARG_TYPE,m=f.ERR_METHOD_NOT_IMPLEMENTED,g=f.ERR_MULTIPLE_CALLBACK,y=f.ERR_STREAM_CANNOT_PIPE,b=f.ERR_STREAM_DESTROYED,v=f.ERR_STREAM_NULL_VALUES,_=f.ERR_STREAM_WRITE_AFTER_END,w=f.ERR_UNKNOWN_ENCODING,E=p.errorOrDestroy;function S(){}function T(e,t,r){n=n||i("F"),e=e||{},"boolean"!=typeof r&&(r=t instanceof n),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=d(this,e,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===e.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var i=e._writableState,n=i.sync,r=i.writecb;if("function"!=typeof r)throw new g;if(i.writing=!1,i.writecb=null,i.length-=i.writelen,i.writelen=0,t)--i.pendingcb,n?(o.nextTick(r,t),o.nextTick(P,e,i),e._writableState.errorEmitted=!0,E(e,t)):(r(t),e._writableState.errorEmitted=!0,E(e,t),P(e,i));else{var a=k(i)||e.destroyed;a||i.corked||i.bufferProcessing||!i.bufferedRequest||A(e,i),n?o.nextTick(x,e,i,a,r):x(e,i,a,r)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}i("c5")(R,l),T.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t};try{Object.defineProperty(T.prototype,"buffer",{get:s.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}function R(e){var t=this instanceof(n=n||i("F"));if(!t&&!r.call(R,this))return new R(e);this._writableState=new T(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),l.call(this)}function O(e,t,i,n,r,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new b("write")):i?e._writev(r,t.onwrite):e._write(r,o,t.onwrite),t.sync=!1}function x(e,t,i,n){var r,o;i||(r=e,0===(o=t).length&&o.needDrain&&(o.needDrain=!1,r.emit("drain"))),t.pendingcb--,n(),P(e,t)}function A(e,t){t.bufferProcessing=!0;var i=t.bufferedRequest;if(e._writev&&i&&i.next){var n=Array(t.bufferedRequestCount),r=t.corkedRequestsFree;r.entry=i;for(var o=0,s=!0;i;)n[o]=i,i.isBuf||(s=!1),i=i.next,o+=1;n.allBuffers=s,O(e,t,!0,t.length,n,"",r.finish),t.pendingcb++,t.lastBufferedRequest=null,r.next?(t.corkedRequestsFree=r.next,r.next=null):t.corkedRequestsFree=new a(t),t.bufferedRequestCount=0}else{for(;i;){var l=i.chunk,u=i.encoding,c=i.callback,p=t.objectMode?1:l.length;if(O(e,t,!1,p,l,u,c),i=i.next,t.bufferedRequestCount--,t.writing)break}null===i&&(t.lastBufferedRequest=null)}t.bufferedRequest=i,t.bufferProcessing=!1}function k(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function C(e,t){e._final(function(i){t.pendingcb--,i&&E(e,i),t.prefinished=!0,e.emit("prefinish"),P(e,t)})}function P(e,t){var i=k(t);if(i&&(t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,o.nextTick(C,e,t))),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return i}"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(r=Function.prototype[Symbol.hasInstance],Object.defineProperty(R,Symbol.hasInstance,{value:function(e){return!!r.call(this,e)||this===R&&e&&e._writableState instanceof T}})):r=function(e){return e instanceof this},R.prototype.pipe=function(){E(this,new y)},R.prototype.write=function(e,t,i){var n,r,a,s,l,p,d,f=this._writableState,m=!1,g=!f.objectMode&&(n=e,u.isBuffer(n)||n instanceof c);return(g&&!u.isBuffer(e)&&(r=e,e=u.from(r)),"function"==typeof t&&(i=t,t=null),g?t="buffer":t||(t=f.defaultEncoding),"function"!=typeof i&&(i=S),f.ending)?(a=i,E(this,s=new _),o.nextTick(a,s)):(g||(l=e,p=i,null===l?d=new v:"string"==typeof l||f.objectMode||(d=new h("chunk",["string","Buffer"],l)),!d||(E(this,d),o.nextTick(p,d),0)))&&(f.pendingcb++,m=function(e,t,i,n,r,o){if(!i){var a,s,l=(a=n,s=r,t.objectMode||!1===t.decodeStrings||"string"!=typeof a||(a=u.from(a,s)),a);n!==l&&(i=!0,r="buffer",n=l)}var c=t.objectMode?1:n.length;t.length+=c;var p=t.length<t.highWaterMark;if(p||(t.needDrain=!0),t.writing||t.corked){var d=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:r,isBuf:i,callback:o,next:null},d?d.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else O(e,t,!1,c,n,r,o);return p}(this,f,g,e,t,i)),m},R.prototype.cork=function(){this._writableState.corked++},R.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||A(this,e))},R.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new w(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(R.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(R.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),R.prototype._write=function(e,t,i){i(new m("_write()"))},R.prototype._writev=null,R.prototype.end=function(e,t,i){var n,r,a,s=this._writableState;return"function"==typeof e?(i=e,e=null,t=null):"function"==typeof t&&(i=t,t=null),null!=e&&this.write(e,t),s.corked&&(s.corked=1,this.uncork()),s.ending||(n=this,r=s,a=i,r.ending=!0,P(n,r),a&&(r.finished?o.nextTick(a):n.once("finish",a)),r.ended=!0,n.writable=!1),this},Object.defineProperty(R.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(R.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),R.prototype.destroy=p.destroy,R.prototype._undestroy=p.undestroy,R.prototype._destroy=function(e,t){t(e)}},tm(e,t,i){var n,r=i("z");function o(e,t,i){var n;return(t="symbol"==typeof(n=function(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?n:String(n))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var a=i("n"),s=Symbol("lastResolve"),l=Symbol("lastReject"),u=Symbol("error"),c=Symbol("ended"),p=Symbol("lastPromise"),d=Symbol("handlePromise"),f=Symbol("stream");function h(e,t){return{value:e,done:t}}function m(e){var t=e[s];if(null!==t){var i=e[f].read();null!==i&&(e[p]=null,e[s]=null,e[l]=null,t(h(i,!1)))}}function g(e){r.nextTick(m,e)}var y=Object.getPrototypeOf(function(){}),b=Object.setPrototypeOf((o(n={get stream(){return this[f]},next:function(){var e,t,i=this,n=this[u];if(null!==n)return Promise.reject(n);if(this[c])return Promise.resolve(h(void 0,!0));if(this[f].destroyed)return new Promise(function(e,t){r.nextTick(function(){i[u]?t(i[u]):e(h(void 0,!0))})});var o=this[p];if(o)t=new Promise((e=this,function(t,i){o.then(function(){e[c]?t(h(void 0,!0)):e[d](t,i)},i)}));else{var a=this[f].read();if(null!==a)return Promise.resolve(h(a,!1));t=new Promise(this[d])}return this[p]=t,t}},Symbol.asyncIterator,function(){return this}),o(n,"return",function(){var e=this;return new Promise(function(t,i){e[f].destroy(null,function(e){e?i(e):t(h(void 0,!0))})})}),n),y);e.exports=function(e){var t,i=Object.create(b,(o(t={},f,{value:e,writable:!0}),o(t,s,{value:null,writable:!0}),o(t,l,{value:null,writable:!0}),o(t,u,{value:null,writable:!0}),o(t,c,{value:e._readableState.endEmitted,writable:!0}),o(t,d,{value:function(e,t){var n=i[f].read();n?(i[p]=null,i[s]=null,i[l]=null,e(h(n,!1))):(i[s]=e,i[l]=t)},writable:!0}),t));return i[p]=null,a(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=i[l];null!==t&&(i[p]=null,i[s]=null,i[l]=null,t(e)),i[u]=e;return}var n=i[s];null!==n&&(i[p]=null,i[s]=null,i[l]=null,n(h(void 0,!0))),i[c]=!0}),e.on("readable",g.bind(null,i)),i}},LP(e,t,i){function n(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,n)}return i}function r(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?n(Object(i),!0).forEach(function(t){var n,r,a;n=e,r=t,a=i[t],(r=o(r))in n?Object.defineProperty(n,r,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[r]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):n(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}function o(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var a=i("d").Buffer,s=i("o").inspect,l=s&&s.custom||"inspect";e.exports=function(){var e;function t(){if(!(this instanceof t))throw TypeError("Cannot call a class as a function");this.head=null,this.tail=null,this.length=0}return e=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,i=""+t.data;t=t.next;)i+=e+t.data;return i}},{key:"concat",value:function(e){if(0===this.length)return a.alloc(0);for(var t,i,n=a.allocUnsafe(e>>>0),r=this.head,o=0;r;)t=r.data,i=o,a.prototype.copy.call(t,n,i),o+=r.data.length,r=r.next;return n}},{key:"consume",value:function(e,t){var i;return e<this.head.data.length?(i=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):i=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),i}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,i=1,n=t.data;for(e-=n.length;t=t.next;){var r=t.data,o=e>r.length?r.length:e;if(o===r.length?n+=r:n+=r.slice(0,e),0==(e-=o)){o===r.length?(++i,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=r.slice(o));break}++i}return this.length-=i,n}},{key:"_getBuffer",value:function(e){var t=a.allocUnsafe(e),i=this.head,n=1;for(i.data.copy(t),e-=i.data.length;i=i.next;){var r=i.data,o=e>r.length?r.length:e;if(r.copy(t,t.length-e,0,o),0==(e-=o)){o===r.length?(++n,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=r.slice(o));break}++n}return this.length-=n,t}},{key:l,value:function(e,t){return s(this,r(r({},t),{},{depth:0,customInspect:!1}))}}],function(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,o(n.key),n)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}()},w(e,t,i){var n=i("z");function r(e,t){a(e,t),o(e)}function o(e){e._writableState&&!e._writableState.emitClose||(!e._readableState||e._readableState.emitClose)&&e.emit("close")}function a(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var i=this,s=this._readableState&&this._readableState.destroyed,l=this._writableState&&this._writableState.destroyed;return s||l?t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(a,this,e)):n.nextTick(a,this,e)):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?i._writableState?i._writableState.errorEmitted?n.nextTick(o,i):(i._writableState.errorEmitted=!0,n.nextTick(r,i,e)):n.nextTick(r,i,e):t?(n.nextTick(o,i),t(e)):n.nextTick(o,i)})),this},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var i=e._readableState,n=e._writableState;i&&i.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}},n(e,t,i){var n=i("x").F.ERR_STREAM_PREMATURE_CLOSE;function r(){}e.exports=function e(t,i,o){if("function"==typeof i)return e(t,null,i);i||(i={}),a=o||r,s=!1,o=function(){if(!s){s=!0;for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];a.apply(this,t)}};var a,s,l=i.readable||!1!==i.readable&&t.readable,u=i.writable||!1!==i.writable&&t.writable,c=function(){t.writable||d()},p=t._writableState&&t._writableState.finished,d=function(){u=!1,p=!0,l||o.call(t)},f=t._readableState&&t._readableState.endEmitted,h=function(){l=!1,f=!0,u||o.call(t)},m=function(e){o.call(t,e)},g=function(){var e;return l&&!f?(t._readableState&&t._readableState.ended||(e=new n),o.call(t,e)):u&&!p?(t._writableState&&t._writableState.ended||(e=new n),o.call(t,e)):void 0},y=function(){t.req.on("finish",d)};return t.setHeader&&"function"==typeof t.abort?(t.on("complete",d),t.on("abort",g),t.req?y():t.on("request",y)):u&&!t._writableState&&(t.on("end",c),t.on("close",c)),t.on("end",h),t.on("finish",d),!1!==i.error&&t.on("error",m),t.on("close",g),function(){t.removeListener("complete",d),t.removeListener("abort",g),t.removeListener("request",y),t.req&&t.req.removeListener("finish",d),t.removeListener("end",c),t.removeListener("close",c),t.removeListener("finish",d),t.removeListener("end",h),t.removeListener("error",m),t.removeListener("close",g)}}},s(e){e.exports=function(){throw Error("Readable.from is not available in the browser")}},Kx(e,t,i){var n,r=i("x").F,o=r.ERR_MISSING_ARGS,a=r.ERR_STREAM_DESTROYED;function s(e){if(e)throw e}function l(e){e()}function u(e,t){return e.pipe(t)}e.exports=function(){for(var e,t,r=arguments.length,c=Array(r),p=0;p<r;p++)c[p]=arguments[p];var d=(e=c).length&&"function"==typeof e[e.length-1]?e.pop():s;if(Array.isArray(c[0])&&(c=c[0]),c.length<2)throw new o("streams");var f=c.map(function(e,r){var o,s,u,p,h,m,g=r<c.length-1;return o=r>0,u=s=function(e){t||(t=e),e&&f.forEach(l),g||(f.forEach(l),d(t))},p=!1,s=function(){p||(p=!0,u.apply(void 0,arguments))},h=!1,e.on("close",function(){h=!0}),void 0===n&&(n=i("n")),n(e,{readable:g,writable:o},function(e){if(e)return s(e);h=!0,s()}),m=!1,function(t){if(!h&&!m){if(m=!0,e.setHeader&&"function"==typeof e.abort)return e.abort();if("function"==typeof e.destroy)return e.destroy();s(t||new a("pipe"))}}});return c.reduce(u)}},G(e,t,i){var n=i("x").F.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,i,r){var o=null!=t.highWaterMark?t.highWaterMark:r?t[i]:null;if(null!=o){if(!(isFinite(o)&&Math.floor(o)===o)||o<0)throw new n(r?i:"highWaterMark",o);return Math.floor(o)}return e.objectMode?16:16384}}},Js(e,t,i){e.exports=i("q").EventEmitter},t(e,t,i){var n=i("K").Buffer,r=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;switch(this.encoding=function(e){var t=function(e){var t;if(!e)return"utf8";for(;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===r||!r(e)))throw Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=l,this.end=u,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=c,this.end=p,t=3;break;default:this.write=d,this.end=f;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,i=function(e,t){if((192&t[0])!=128)return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if((192&t[1])!=128)return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&(192&t[2])!=128)return e.lastNeed=2,"�"}}(this,e);return void 0!==i?i:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):void(e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length)}function l(e,t){if((e.length-t)%2==0){var i=e.toString("utf16le",t);if(i){var n=i.charCodeAt(i.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],i.slice(0,-1)}return i}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function u(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var i=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,i)}return t}function c(e,t){var i=(e.length-t)%3;return 0===i?e.toString("base64",t):(this.lastNeed=3-i,this.lastTotal=3,1===i?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-i))}function p(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function f(e){return e&&e.length?this.write(e):""}t.I=o,o.prototype.write=function(e){var t,i;if(0===e.length)return"";if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";i=this.lastNeed,this.lastNeed=0}else i=0;return i<e.length?t?t+this.text(e,i):this.text(e,i):t||""},o.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},o.prototype.text=function(e,t){var i=function(e,t,i){var n=t.length-1;if(n<i)return 0;var r=a(t[n]);return r>=0?(r>0&&(e.lastNeed=r-1),r):--n<i||-2===r?0:(r=a(t[n]))>=0?(r>0&&(e.lastNeed=r-2),r):--n<i||-2===r?0:(r=a(t[n]))>=0?(r>0&&(2===r?r=0:e.lastNeed=r-3),r):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=i;var n=e.length-(i-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},N(e,t,i){e.exports=function(e,t){if(n("noDeprecation"))return e;var i=!1;return function(){if(!i){if(n("throwDeprecation"))throw Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),i=!0}return e.apply(this,arguments)}};function n(e){try{if(!i.g.localStorage)return!1}catch(e){return!1}var t=i.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}},o(){},b(){}},t={};function i(n){var r=t[n];if(void 0!==r)return r.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,i),o.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t,n)=>{var r=(t,n)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,[n]:t[r]})};r(t,"get"),r(n,"value")},i.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}})(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var n={};(()=>{let e,t,r,o,a,s,l,u,c,p,d,f;function h(e){let t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,i])=>-1===t.indexOf(+e)).map(([e,t])=>t)}function m(e,t="|"){return e.map(e=>N(e)).join(t)}function g(e,t){return"bigint"==typeof t?t.toString():t}i.d(n,{TD:()=>pi,B:()=>pr,h0:()=>u3,XP:()=>u8,v8:()=>po,G7:()=>u9,Lu:()=>u7,vp:()=>cn,Jo:()=>co,UP:()=>oz,rj:()=>pq,VI:()=>oP,Ns:()=>oV,Ip:()=>aT,kt:()=>uJ,KW:()=>uQ,fK:()=>oM,wb:()=>c_,wv:()=>pc,yY:()=>cf,my:()=>aQ,qQ:()=>o$,_:()=>aO,Qq:()=>aZ,tY:()=>oL,rE:()=>aP,PD:()=>cA,lE:()=>ph,ss:()=>uW,kq:()=>uK,m_:()=>oD,O_:()=>ct,OE:()=>oj,oc:()=>cq,oW:()=>py,dK:()=>oJ,Ry:()=>cX,Ng:()=>c1,Hg:()=>ce,L6:()=>pv,Ty:()=>pE,gP:()=>oB,py:()=>pT,YS:()=>uG,t1:()=>pk,jE:()=>pP,D_:()=>oN,jx:()=>pI,F:()=>pL,J_:()=>c9,hH:()=>pN,zC:()=>pz,_l:()=>u5,fu:()=>aA});let y=class Cached{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return void 0!==e&&(this._value=e(),this._getter=void 0),this._value}};function b(e){return new y(e)}function v(e){let t=+!!e.startsWith("^"),i=e.endsWith("$")?e.length-1:e.length;return e.slice(t,i)}function _(e,t,i){Object.defineProperty(e,t,{value:i,writable:!0,enumerable:!0,configurable:!0})}function w(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function E(e){return w(e._zod.def)??e._zod.def.shape}function S(e,t,i){Object.defineProperty(e,t,{get(){let e=i();return _(this,t,e),e},enumerable:!0,configurable:!0})}function T(e,t,i){t in e?_(e,t,i):e[t]=i}function R(e,t,i,n){let r=E(t);for(let o of i){let i=Object.getOwnPropertyDescriptor(r,o);i.enumerable&&(i.get?S(e,o,()=>{let e=t._zod.def.shape[o];return n?n(e,o):e}):T(e,o,n?n(i.value,o):i.value))}}function O(...e){let t={};for(let i of e)Object.assign(t,Object.getOwnPropertyDescriptors(i));return Object.defineProperties({},t)}let x="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function A(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let k=b(()=>{if(el.jitless||"u">typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch(e){return!1}});function C(e){if(!1===A(e))return!1;let t=e.constructor;if(void 0===t||"function"!=typeof t)return!0;let i=t.prototype;return!1!==A(i)&&!1!==Object.prototype.hasOwnProperty.call(i,"isPrototypeOf")}function P(e){return C(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}let I=new Set(["string","number","symbol"]);function U(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function z(e,t,i){let n=new e._zod.constr(t??e._zod.def);return(!t||i?.parent)&&(n._zod.parent=e),n}function L(e){if(!e)return{};if("string"==typeof e)return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");e.error=e.message}return(delete e.message,"string"==typeof e.error)?{...e,error:()=>e.error}:e}function N(e){return"bigint"==typeof e?e.toString()+"n":"string"==typeof e?`"${e}"`:`${e}`}let $={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-0x80000000,0x7fffffff],uint32:[0,0xffffffff],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},D={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function M(e,t){let i=E(e),n=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(i,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&n.push(e)}return n}function j(e,t){let i={};R(i,e,Reflect.ownKeys(E(e)));for(let e of Reflect.ownKeys(t)){let n=Object.getOwnPropertyDescriptor(t,e);n.enumerable&&(n.get?S(i,e,()=>t[e]):T(i,e,n.value))}return i}function B(e,t,i,n="partial"){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.${n}() cannot be used on object schemas containing refinements`);let o=i?new Set(M(t,i)):void 0,a={};return R(a,t,Reflect.ownKeys(E(t)),e&&((t,i)=>o&&!o.has(i)?t:new e({type:"optional",innerType:t}))),z(t,O(t._zod.def,{shape:a,checks:[]}))}function F(e,t=0){if(!0===e.aborted)return!0;for(let i=t;i<e.issues.length;i++)if(e.issues[i]?.continue!==!0)return!0;return!1}function q(e,t){return t.map(t=>(t.path??(t.path=[]),t.path.unshift(e),t))}function Z(e){return"string"==typeof e?e:e?.message}function W(e){let t=[];for(let i of e??[]){let e=i._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let n=e.maximum??e.length??e.size;n>=0&&t.push([n,i])}return t}function K(e,t,i){var n;for(let r=t;r<e.length;r++)(n=e[r]).schema??(n.schema=i)}function G(e,t,i){let n=e.inst?._zod?.traits;n?.has("$ZodType")&&(n.has("$ZodCheck")?e.schema??(e.schema=e.inst):e.schema=e.inst);let r=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,o=e.message?e.message:Z(e.inst?._zod.def?.error?.(e))??Z(r?.(e))??Z(t?.error?.(e))??Z(i.customError?.(e))??Z(i.localeError?.(e))??"Invalid input",a={};for(let t of Object.keys(e))"inst"!==t&&"schema"!==t&&"continue"!==t&&"input"!==t&&"__proto__"!==t&&(a[t]=e[t]);return a.path??(a.path=[]),a.message=o,t?.reportInput&&(a.input=e.input),a}let V=/[\uD800-\uDBFF]/;function H(e){let t=e.length;if(!V.test(e))return t;let i=t;for(let n=0;n<t-1;n++)(64512&e.charCodeAt(n))==55296&&(64512&e.charCodeAt(n+1))==56320&&(i--,n++);return i}function J(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function Y(...e){let[t,i,n]=e;return"string"==typeof t?{message:t,code:"custom",input:i,inst:n}:{...t}}function X(e,t,i,n=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:n,value:i}),i}function Q(e,t){for(let i in e){let n=e[i];Object.defineProperty(t,i,{configurable:!0,enumerable:!0,get(){return X(this,i,n(this))},set(e){X(this,i,e)}})}return t}let ee=!1,et={configurable:!0,get(){ee=!0}};function ei(t,i,n){let r=Object.getPrototypeOf(t._zod);if(i in r&&e!==t._zod){e=void 0;return}e=t._zod,Object.defineProperty(r,i,{configurable:!0,get(){Object.defineProperty(this,i,et);let e=ee;ee=!1;try{let t=n(this);return ee?delete this[i]:Object.defineProperty(this,i,{configurable:!0,writable:!0,value:t}),ee=ee||e,t}catch(t){throw delete this[i],ee=ee||e,t}},set(e){Object.defineProperty(this,i,{configurable:!0,writable:!0,value:e})}})}let en={value:void 0,enumerable:!1},er="captureStackTrace"in Error?Error:null;function eo(e,t,i,n){function r(e){this.def=e,this.constr=u,this.traits=new Set}r.prototype={};let o=i&&new WeakSet;function a(n,a){if(n._zod){if(n._zod.traits.has(e))return}else{en.value=new r(a);try{Object.defineProperty(n,"_zod",en)}finally{en.value=void 0}}if(n._zod.traits.add(e),t(n,a),o){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let a=r??e;if(!o.has(a)){o.add(a);for(let e in i){let t=Object.getOwnPropertyDescriptor(i,e);t.get?Object.defineProperty(a,e,{...t,enumerable:!1}):function(e,t,i){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?i:X(this,t,i.bind(this))},set(e){X(this,t,e)}})}(a,e,t.value)}}}let s=u.prototype;for(let e in s)Object.prototype.hasOwnProperty.call(s,e)&&(e in n||(n[e]=s[e].bind(n)))}let s=n?.Parent??Object;let l=class Definition extends s{};function u(e){let t=n?.Parent?function(e){let t=er;if(t){let i=t.stackTraceLimit;if("number"==typeof i){try{t.stackTraceLimit=0}catch{return er=null,new e}try{return new e}finally{t.stackTraceLimit=i}}}return new e}(l):this;a(t,e);let i=t._zod.deferred;if(i){for(let e of i)e();t._zod.deferred=void 0}let r=globalThis.__zod_globalConfig?.postProcessor;return r&&r(t),t}return Object.defineProperty(l,"name",{value:e}),Object.defineProperty(u,"init",{value:a}),Object.defineProperty(u,Symbol.hasInstance,{value:t=>!!n?.Parent&&t instanceof n.Parent||t?._zod?.traits?.has(e)}),Object.defineProperty(u,"name",{value:e}),u}let ea=class $ZodAsyncError extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}};let es=class $ZodEncodeError extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}};(ou=globalThis).__zod_globalConfig??(ou.__zod_globalConfig={});let el=globalThis.__zod_globalConfig;function eu(e){return e&&Object.assign(el,e),el}let ec=class $ZodCyclicError extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}};let ep="~memo",ed=[];function ef(e){return null!==e&&"object"==typeof e}function eh(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}let em=new WeakMap,eg=[],ey={alloc(e,i,n){let r=t;if(!r)return n;t=void 0;let o={value:n,issues:null};return r.set(i.value,o),eg.push(o),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,i=(e,i)=>{var n,r;let o;if("backward"!==i.direction&&(n=i,r=e.value,void 0!==(o=n[ep]?.backEdges)&&ef(r)&&o.has(r)))throw new ec;return t(e,i)};e._zod.parse=i,e._zod.run===t&&(e._zod.run=i)})},attach(e){var i;let n,r,o,a=!1;(i=e._zod).deferred??(i.deferred=[]),e._zod.deferred.push(()=>{let i=e._zod.parse,s=(l,u)=>{let c;if(void 0===n){let t=function e(t,i,n){var r,o;let a=em.get(t);if(void 0!==a)return 2*!!a;if(i.has(t))return 2;i.add(t);let s=0,l=t=>{if(2!==s&&t?._zod){let r=e(t,i,n);r>s&&(s=r)}},u=e=>{e>s&&(s=e)},c=t._zod.def;switch(c.type){case"object":{let t=w(c);u(t?((t,r)=>{let o=0;for(let a of Reflect.ownKeys(t)){let s=Object.getOwnPropertyDescriptor(t,a);if(r&&!s.enumerable)continue;let l=s.get?1:s.value?._zod?e(s.value,i,n):0;l>o&&(o=l)}return o})(t,!0):1),l(c.catchall);break}case"array":l(c.element);break;case"tuple":for(let e of c.items)l(e);l(c.rest);break;case"record":case"map":l(c.keyType),l(c.valueType);break;case"set":l(c.valueType);break;case"union":for(let e of c.options)l(e);break;case"intersection":l(c.left),l(c.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":l(c.innerType);break;case"pipe":l(c.in),l(c.out);break;case"function":l(c.input),l(c.output);break;case"lazy":{let r=c._cachedInner??(n?t._zod.innerType:void 0);u(r?e(r,i,!1):1);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let i=t.value;if(i&&"object"==typeof i){if(i._zod)l(i);else if(Array.isArray(i))for(let e of i)l(e)}}}return i.delete(t),r=t,1!==(o=s)&&em.set(r,2===o),o}(e,new Set,!1);if(0===t)return e._zod.parse=i,e._zod.run===s&&(e._zod.run=i),i(l,u);2===t||a?n=!0:a=!0}let p=l.value;if(!ef(p))return i(l,u);let d=u[ep];if(d||(d={buckets:new WeakMap,backEdges:void 0},u[ep]=d),r===u)c=o;else{var f;let t;(t=(f=d).buckets.get(e))||(t=new WeakMap,f.buckets.set(e,t)),c=t,r=u,o=c}let h=c.get(p);if(h)return l.value=h.value,h.issues?h.issues.length&&l.issues.push(...eh(h.issues)):(l.memo=!0,d.backEdges??(d.backEdges=new WeakSet),d.backEdges.add(h.value)),l;t=c;let m=eg.length,g=i(l,u);t=void 0;let y=eg.length>m?eg.pop():void 0;return g instanceof Promise?g.then(e=>(y&&(y.issues=e.issues.length?eh(e.issues):ed),e)):(y&&(y.issues=g.issues.length?eh(g.issues):ed),g)};e._zod.parse=s,e._zod.run===i&&(e._zod.run=s)})}},eb=/^[cC][0-9a-z]{6,}$/,ev=/^[0-9a-z]+$/,e_=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,ew=/^[0-9a-vA-V]{20}$/,eE=/^[A-Za-z0-9]{27}$/,eS=/^[a-zA-Z0-9_-]{21}$/,eT=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,eR=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,eO=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,ex=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,eA=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ek=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,eC=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,eP=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,eI=/^https?$/,eU=/^\+[1-9]\d{6,14}$/,ez="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",eL=RegExp(`^${ez}$`);function eN(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}let e$=/^[\s\S]{0,}$/,eD=/^-?\d+$/,eM=/^-?\d+(?:\.\d+)?$/,ej=/^(?:true|false)$/i,eB=/^null$/i,eF=/^[^A-Z]*$/,eq=/^[^a-z]*$/,eZ=eo("$ZodCheck",(e,t)=>{var i;e._zod??(e._zod={}),e._zod.def=t,(i=e._zod).onattach??(i.onattach=[])}),eW=e=>{let t=e.value;return null!=t&&void 0!==t.length},eK={number:"number",bigint:"bigint",object:"date"},eG=eo("$ZodCheckLessThan",(e,t)=>{eZ.init(e,t);let i=eK[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:eK[typeof n.value]??i,code:"too_big",maximum:"object"==typeof t.value?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),eV=eo("$ZodCheckGreaterThan",(e,t)=>{eZ.init(e,t);let i=eK[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:eK[typeof n.value]??i,code:"too_small",minimum:"object"==typeof t.value?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),eH=eo("$ZodCheckMultipleOf",(e,t)=>{eZ.init(e,t),e._zod.check=i=>{let n,r,o;if(typeof i.value!=typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof i.value?t.value!==BigInt(0)&&i.value%t.value===BigInt(0):0==(r=Math.round(n=i.value/t.value),o=4*Number.EPSILON*Math.max(Math.abs(n),1),Math.abs(n-r)<o?0:n-r))||i.issues.push({origin:typeof i.value,code:"not_multiple_of",divisor:t.value,input:i.value,inst:e,continue:!t.abort})}}),eJ=eo("$ZodCheckNumberFormat",(e,t)=>{eZ.init(e,t),t.format=t.format||"float64";let i=t.format?.includes("int"),n=i?"int":"number",[r,o]=$[t.format];e._zod.check=a=>{let s=a.value;if(i){if(!Number.isInteger(s))return void a.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});if(!Number.isSafeInteger(s))return void(s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}))}s<r&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),s>o&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),eY=eo("$ZodCheckMaxLength",(e,t)=>{var i;eZ.init(e,t),(i=e._zod.def).when??(i.when=eW),e._zod.check=i=>{let n=i.value,r=n.length;if(("string"==typeof n&&r>t.maximum?H(n):r)<=t.maximum)return;let o=J(n);i.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),eX=eo("$ZodCheckMinLength",(e,t)=>{var i;eZ.init(e,t),(i=e._zod.def).when??(i.when=eW),e._zod.check=i=>{let n=i.value,r=n.length;if(("string"==typeof n&&r>=t.minimum&&r<2*t.minimum?H(n):r)>=t.minimum)return;let o=J(n);i.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),eQ=eo("$ZodCheckLengthEquals",(e,t)=>{var i;eZ.init(e,t),(i=e._zod.def).when??(i.when=eW),e._zod.check=i=>{let n=i.value,r=n.length,o="string"==typeof n&&r>=t.length&&r<=2*t.length?H(n):r;if(o===t.length)return;let a=J(n),s=o>t.length;i.issues.push({origin:a,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),e0=eo("$ZodCheckStringFormat",(e,t)=>{var i,n;eZ.init(e,t),t.pattern?(i=e._zod).check??(i.check=i=>{t.pattern.lastIndex=0,t.pattern.test(i.value)||i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),e1=eo("$ZodCheckRegex",(e,t)=>{e0.init(e,t),e._zod.check=i=>{t.pattern.lastIndex=0,t.pattern.test(i.value)||i.issues.push({origin:"string",code:"invalid_format",format:"regex",input:i.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),e2=eo("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=eF),e0.init(e,t)}),e4=eo("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=eq),e0.init(e,t)}),e9=eo("$ZodCheckIncludes",(e,t)=>{eZ.init(e,t);let i=U(t.includes),n=new RegExp("number"==typeof t.position?`^.{${t.position},}${i}`:i);t.pattern=n,e._zod.check=i=>{i.value.includes(t.includes,t.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:e,continue:!t.abort})}}),e3=eo("$ZodCheckStartsWith",(e,t)=>{eZ.init(e,t);let i=RegExp(`^${U(t.prefix)}.*`);t.pattern??(t.pattern=i),e._zod.check=i=>{i.value.startsWith(t.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),e6=eo("$ZodCheckEndsWith",(e,t)=>{eZ.init(e,t);let i=RegExp(`.*${U(t.suffix)}$`);t.pattern??(t.pattern=i),e._zod.check=i=>{i.value.endsWith(t.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}});function e8(e,t,i){e.issues.length&&t.issues.push(...q(i,e.issues))}let e5=eo("$ZodCheckProperties",(e,t)=>{let i;eZ.init(e,t),X(e,Symbol.iterator,function*(){yield e},!1),e._zod.check=n=>{let r;if(null==n.value)return void n.issues.push({expected:"object",code:"invalid_type",input:n.value,inst:e});i??(i=Reflect.ownKeys(t.shape).map(e=>[e,t.shape[e]]));let o=n.value;for(let[e,t]of i){let i=t._zod.run({value:o[e],issues:[]},{});i instanceof Promise?(r??(r=[]),r.push(i.then(t=>e8(t,n,e)))):e8(i,n,e)}if(r)return Promise.all(r).then(()=>void 0)}}),e7=eo("$ZodCheckOverwrite",(e,t)=>{eZ.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});let te=class Doc{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{this.indent-=1}}write(e){if("function"==typeof e){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let t=e.split("\n").filter(e=>e),i=Math.min(...t.map(e=>e.length-e.trimStart().length));for(let e of t.map(e=>e.slice(i)).map(e=>" ".repeat(2*this.indent)+e))this.content.push(e)}compile(){let e=Function,t=this?.content??[""];return new e(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
2
+ var e={v(e,t,i){var n=i("z");let r=/[\u001b\u009b][[\]#;?()]*(?:(?:(?:[^\W_]*;?[^\W_]*)\u0007)|(?:(?:[0-9]{1,4}(;[0-9]{0,4})*)?[~0-9=<>cf-nqrtyA-PRZ]))/g,o=()=>{let e={enabled:void 0!==n&&"0"!==n.env.FORCE_COLOR,visible:!0,styles:{},keys:{}},t=(e,t,i)=>"function"==typeof e?e(t):e.wrap(t,i),o=(i,n)=>{if(""===i||null==i)return"";if(!1===e.enabled)return i;if(!1===e.visible)return"";let r=""+i,o=r.includes("\n"),a=n.length;for(a>0&&n.includes("unstyle")&&(n=[...new Set(["unstyle",...n])].reverse());a-- >0;)r=t(e.styles[n[a]],r,o);return r},a=(t,i,n)=>{var r;let a,s,l;e.styles[t]=(a=(r={name:t,codes:i}).open=`\x1b[${r.codes[0]}m`,s=r.close=`\x1b[${r.codes[1]}m`,l=r.regex=RegExp(`\\u001b\\[${r.codes[1]}m`,"g"),r.wrap=(e,t)=>{e.includes(s)&&(e=e.replace(l,s+a));let i=a+e+s;return t?i.replace(/\r*\n/g,`${s}$&${a}`):i},r),(e.keys[n]||(e.keys[n]=[])).push(t),Reflect.defineProperty(e,t,{configurable:!0,enumerable:!0,set(i){e.alias(t,i)},get(){let i=e=>o(e,i.stack);return Reflect.setPrototypeOf(i,e),i.stack=this.stack?this.stack.concat(t):[t],i}})};return a("reset",[0,0],"modifier"),a("bold",[1,22],"modifier"),a("dim",[2,22],"modifier"),a("italic",[3,23],"modifier"),a("underline",[4,24],"modifier"),a("inverse",[7,27],"modifier"),a("hidden",[8,28],"modifier"),a("strikethrough",[9,29],"modifier"),a("black",[30,39],"color"),a("red",[31,39],"color"),a("green",[32,39],"color"),a("yellow",[33,39],"color"),a("blue",[34,39],"color"),a("magenta",[35,39],"color"),a("cyan",[36,39],"color"),a("white",[37,39],"color"),a("gray",[90,39],"color"),a("grey",[90,39],"color"),a("bgBlack",[40,49],"bg"),a("bgRed",[41,49],"bg"),a("bgGreen",[42,49],"bg"),a("bgYellow",[43,49],"bg"),a("bgBlue",[44,49],"bg"),a("bgMagenta",[45,49],"bg"),a("bgCyan",[46,49],"bg"),a("bgWhite",[47,49],"bg"),a("blackBright",[90,39],"bright"),a("redBright",[91,39],"bright"),a("greenBright",[92,39],"bright"),a("yellowBright",[93,39],"bright"),a("blueBright",[94,39],"bright"),a("magentaBright",[95,39],"bright"),a("cyanBright",[96,39],"bright"),a("whiteBright",[97,39],"bright"),a("bgBlackBright",[100,49],"bgBright"),a("bgRedBright",[101,49],"bgBright"),a("bgGreenBright",[102,49],"bgBright"),a("bgYellowBright",[103,49],"bgBright"),a("bgBlueBright",[104,49],"bgBright"),a("bgMagentaBright",[105,49],"bgBright"),a("bgCyanBright",[106,49],"bgBright"),a("bgWhiteBright",[107,49],"bgBright"),e.ansiRegex=r,e.hasColor=e.hasAnsi=t=>(e.ansiRegex.lastIndex=0,"string"==typeof t&&""!==t&&e.ansiRegex.test(t)),e.alias=(t,i)=>{let n="string"==typeof i?e[i]:i;if("function"!=typeof n)throw TypeError("Expected alias to be the name of an existing color (string) or a function");n.stack||(Reflect.defineProperty(n,"name",{value:t}),e.styles[t]=n,n.stack=[t]),Reflect.defineProperty(e,t,{configurable:!0,enumerable:!0,set(i){e.alias(t,i)},get(){let t=e=>o(e,t.stack);return Reflect.setPrototypeOf(t,e),t.stack=this.stack?this.stack.concat(n.stack):n.stack,t}})},e.theme=t=>{if(!(null!==t&&"object"==typeof t&&!Array.isArray(t)))throw TypeError("Expected theme to be an object");for(let i of Object.keys(t))e.alias(i,t[i]);return e},e.alias("unstyle",t=>"string"==typeof t&&""!==t?(e.ansiRegex.lastIndex=0,t.replace(e.ansiRegex,"")):""),e.alias("noop",e=>e),e.none=e.clear=e.noop,e.stripColor=e.unstyle,e.symbols=i("L"),e.define=a,e};e.exports=o(),e.exports.create=o},L(e,t,i){var n=i("z");let r=void 0!==n&&"Hyper"===n.env.TERM_PROGRAM,o=void 0!==n&&"win32"===n.platform,a=void 0!==n&&"linux"===n.platform,s={ballotDisabled:"☒",ballotOff:"☐",ballotOn:"☑",bullet:"•",bulletWhite:"◦",fullBlock:"█",heart:"❤",identicalTo:"≡",line:"─",mark:"※",middot:"·",minus:"-",multiplication:"×",obelus:"÷",pencilDownRight:"✎",pencilRight:"✏",pencilUpRight:"✐",percent:"%",pilcrow2:"❡",pilcrow:"¶",plusMinus:"±",question:"?",section:"§",starsOff:"☆",starsOn:"★",upDownArrow:"↕"},l=Object.assign({},s,{check:"√",cross:"×",ellipsisLarge:"...",ellipsis:"...",info:"i",questionSmall:"?",pointer:">",pointerSmall:"»",radioOff:"( )",radioOn:"(*)",warning:"‼"}),u=Object.assign({},s,{ballotCross:"✘",check:"✔",cross:"✖",ellipsisLarge:"⋯",ellipsis:"…",info:"ℹ",questionFull:"?",questionSmall:"﹖",pointer:a?"▸":"❯",pointerSmall:a?"‣":"›",radioOff:"◯",radioOn:"◉",warning:"⚠"});e.exports=o&&!r?l:u,Reflect.defineProperty(e.exports,"common",{enumerable:!1,value:s}),Reflect.defineProperty(e.exports,"windows",{enumerable:!1,value:l}),Reflect.defineProperty(e.exports,"other",{enumerable:!1,value:u})},J(e,t){t.byteLength=function(e){var t=l(e),i=t[0],n=t[1];return(i+n)*3/4-n},t.toByteArray=function(e){var t,i,o=l(e),a=o[0],s=o[1],u=new r((a+s)*3/4-s),c=0,p=s>0?a-4:a;for(i=0;i<p;i+=4)t=n[e.charCodeAt(i)]<<18|n[e.charCodeAt(i+1)]<<12|n[e.charCodeAt(i+2)]<<6|n[e.charCodeAt(i+3)],u[c++]=t>>16&255,u[c++]=t>>8&255,u[c++]=255&t;return 2===s&&(t=n[e.charCodeAt(i)]<<2|n[e.charCodeAt(i+1)]>>4,u[c++]=255&t),1===s&&(t=n[e.charCodeAt(i)]<<10|n[e.charCodeAt(i+1)]<<4|n[e.charCodeAt(i+2)]>>2,u[c++]=t>>8&255,u[c++]=255&t),u},t.fromByteArray=function(e){for(var t,n=e.length,r=n%3,o=[],a=0,s=n-r;a<s;a+=16383)o.push(function(e,t,n){for(var r,o=[],a=t;a<n;a+=3)r=(e[a]<<16&0xff0000)+(e[a+1]<<8&65280)+(255&e[a+2]),o.push(i[r>>18&63]+i[r>>12&63]+i[r>>6&63]+i[63&r]);return o.join("")}(e,a,a+16383>s?s:a+16383));return 1===r?o.push(i[(t=e[n-1])>>2]+i[t<<4&63]+"=="):2===r&&o.push(i[(t=(e[n-2]<<8)+e[n-1])>>10]+i[t>>4&63]+i[t<<2&63]+"="),o.join("")};for(var i=[],n=[],r="u">typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=o.length;a<s;++a)i[a]=o[a],n[o.charCodeAt(a)]=a;function l(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var i=e.indexOf("=");-1===i&&(i=t);var n=i===t?0:4-i%4;return[i,n]}n[45]=62,n[95]=63},d(e,t,i){var n=i("J"),r=i("r"),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function a(e){if(e>0x7fffffff)throw RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,s.prototype),t}function s(e,t,i){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return c(e)}return l(e,t,i)}function l(e,t,i){if("string"==typeof e){var n=e,r=t;if(("string"!=typeof r||""===r)&&(r="utf8"),!s.isEncoding(r))throw TypeError("Unknown encoding: "+r);var o=0|h(n,r),l=a(o),u=l.write(n,r);return u!==o&&(l=l.slice(0,u)),l}if(ArrayBuffer.isView(e)){var c=e;if(k(c,Uint8Array)){var m=new Uint8Array(c);return d(m.buffer,m.byteOffset,m.byteLength)}return p(c)}if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(k(e,ArrayBuffer)||e&&k(e.buffer,ArrayBuffer)||"u">typeof SharedArrayBuffer&&(k(e,SharedArrayBuffer)||e&&k(e.buffer,SharedArrayBuffer)))return d(e,t,i);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');var g=e.valueOf&&e.valueOf();if(null!=g&&g!==e)return s.from(g,t,i);var y=function(e){if(s.isBuffer(e)){var t=0|f(e.length),i=a(t);return 0===i.length||e.copy(i,0,0,t),i}return void 0!==e.length?"number"!=typeof e.length||function(e){return e!=e}(e.length)?a(0):p(e):"Buffer"===e.type&&Array.isArray(e.data)?p(e.data):void 0}(e);if(y)return y;if("u">typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return s.from(e[Symbol.toPrimitive]("string"),t,i);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function c(e){return u(e),a(e<0?0:0|f(e))}function p(e){for(var t=e.length<0?0:0|f(e.length),i=a(t),n=0;n<t;n+=1)i[n]=255&e[n];return i}function d(e,t,i){var n;if(t<0||e.byteLength<t)throw RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(i||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(n=void 0===t&&void 0===i?new Uint8Array(e):void 0===i?new Uint8Array(e,t):new Uint8Array(e,t,i),s.prototype),n}function f(e){if(e>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function h(e,t){if(s.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||k(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var i=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===i)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return O(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return x(e).length;default:if(r)return n?-1:O(e).length;t=(""+t).toLowerCase(),r=!0}}function m(e,t,i){var r,o,a,s=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===i||i>this.length)&&(i=this.length),i<=0||(i>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,i){var n=e.length;(!t||t<0)&&(t=0),(!i||i<0||i>n)&&(i=n);for(var r="",o=t;o<i;++o)r+=C[e[o]];return r}(this,t,i);case"utf8":case"utf-8":return v(this,t,i);case"ascii":return function(e,t,i){var n="";i=Math.min(e.length,i);for(var r=t;r<i;++r)n+=String.fromCharCode(127&e[r]);return n}(this,t,i);case"latin1":case"binary":return function(e,t,i){var n="";i=Math.min(e.length,i);for(var r=t;r<i;++r)n+=String.fromCharCode(e[r]);return n}(this,t,i);case"base64":return r=this,o=t,a=i,0===o&&a===r.length?n.fromByteArray(r):n.fromByteArray(r.slice(o,a));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,i){for(var n=e.slice(t,i),r="",o=0;o<n.length-1;o+=2)r+=String.fromCharCode(n[o]+256*n[o+1]);return r}(this,t,i);default:if(s)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),s=!0}}function g(e,t,i){var n=e[t];e[t]=e[i],e[i]=n}function y(e,t,i,n,r){var o;if(0===e.length)return -1;if("string"==typeof i?(n=i,i=0):i>0x7fffffff?i=0x7fffffff:i<-0x80000000&&(i=-0x80000000),(o=i*=1)!=o&&(i=r?0:e.length-1),i<0&&(i=e.length+i),i>=e.length)if(r)return -1;else i=e.length-1;else if(i<0)if(!r)return -1;else i=0;if("string"==typeof t&&(t=s.from(t,n)),s.isBuffer(t))return 0===t.length?-1:b(e,t,i,n,r);if("number"==typeof t){if(t&=255,"function"==typeof Uint8Array.prototype.indexOf)if(r)return Uint8Array.prototype.indexOf.call(e,t,i);else return Uint8Array.prototype.lastIndexOf.call(e,t,i);return b(e,[t],i,n,r)}throw TypeError("val must be string, number or Buffer")}function b(e,t,i,n,r){var o,a=1,s=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return -1;a=2,s/=2,l/=2,i/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(r){var c=-1;for(o=i;o<s;o++)if(u(e,o)===u(t,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===l)return c*a}else -1!==c&&(o-=o-c),c=-1}else for(i+l>s&&(i=s-l),o=i;o>=0;o--){for(var p=!0,d=0;d<l;d++)if(u(e,o+d)!==u(t,d)){p=!1;break}if(p)return o}return -1}function v(e,t,i){i=Math.min(e.length,i);for(var n=[],r=t;r<i;){var o,a,s,l,u=e[r],c=null,p=u>239?4:u>223?3:u>191?2:1;if(r+p<=i)switch(p){case 1:u<128&&(c=u);break;case 2:(192&(o=e[r+1]))==128&&(l=(31&u)<<6|63&o)>127&&(c=l);break;case 3:o=e[r+1],a=e[r+2],(192&o)==128&&(192&a)==128&&(l=(15&u)<<12|(63&o)<<6|63&a)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:o=e[r+1],a=e[r+2],s=e[r+3],(192&o)==128&&(192&a)==128&&(192&s)==128&&(l=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&l<1114112&&(c=l)}null===c?(c=65533,p=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),r+=p}var d=n,f=d.length;if(f<=4096)return String.fromCharCode.apply(String,d);for(var h="",m=0;m<f;)h+=String.fromCharCode.apply(String,d.slice(m,m+=4096));return h}function _(e,t,i){if(e%1!=0||e<0)throw RangeError("offset is not uint");if(e+t>i)throw RangeError("Trying to access beyond buffer length")}function w(e,t,i,n,r,o){if(!s.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>r||t<o)throw RangeError('"value" argument is out of bounds');if(i+n>e.length)throw RangeError("Index out of range")}function E(e,t,i,n,r,o){if(i+n>e.length||i<0)throw RangeError("Index out of range")}function S(e,t,i,n,o){return t*=1,i>>>=0,o||E(e,t,i,4,34028234663852886e22,-34028234663852886e22),r.write(e,t,i,n,23,4),i+4}function T(e,t,i,n,o){return t*=1,i>>>=0,o||E(e,t,i,8,17976931348623157e292,-17976931348623157e292),r.write(e,t,i,n,52,8),i+8}t.Buffer=s,t.SlowBuffer=function(e){return+e!=e&&(e=0),s.alloc(+e)},t.INSPECT_MAX_BYTES=50,t.kMaxLength=0x7fffffff,s.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),!s.TYPED_ARRAY_SUPPORT&&"u">typeof console&&"function"==typeof console.error&&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."),Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}}),s.poolSize=8192,s.from=function(e,t,i){return l(e,t,i)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array),s.alloc=function(e,t,i){return(u(e),e<=0)?a(e):void 0!==t?"string"==typeof i?a(e).fill(t,i):a(e).fill(t):a(e)},s.allocUnsafe=function(e){return c(e)},s.allocUnsafeSlow=function(e){return c(e)},s.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==s.prototype},s.compare=function(e,t){if(k(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),k(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(e)||!s.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var i=e.length,n=t.length,r=0,o=Math.min(i,n);r<o;++r)if(e[r]!==t[r]){i=e[r],n=t[r];break}return i<n?-1:+(n<i)},s.isEncoding=function(e){switch(String(e).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}},s.concat=function(e,t){if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return s.alloc(0);if(void 0===t)for(i=0,t=0;i<e.length;++i)t+=e[i].length;var i,n=s.allocUnsafe(t),r=0;for(i=0;i<e.length;++i){var o=e[i];if(k(o,Uint8Array))r+o.length>n.length?s.from(o).copy(n,r):Uint8Array.prototype.set.call(n,o,r);else if(s.isBuffer(o))o.copy(n,r);else throw TypeError('"list" argument must be an Array of Buffers');r+=o.length}return n},s.byteLength=h,s.prototype._isBuffer=!0,s.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)g(this,t,t+1);return this},s.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},s.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},s.prototype.toString=function(){var e=this.length;return 0===e?"":0==arguments.length?v(this,0,e):m.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(e){if(!s.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===s.compare(this,e)},s.prototype.inspect=function(){var e="",i=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(e+=" ... "),"<Buffer "+e+">"},o&&(s.prototype[o]=s.prototype.inspect),s.prototype.compare=function(e,t,i,n,r){if(k(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===i&&(i=e?e.length:0),void 0===n&&(n=0),void 0===r&&(r=this.length),t<0||i>e.length||n<0||r>this.length)throw RangeError("out of range index");if(n>=r&&t>=i)return 0;if(n>=r)return -1;if(t>=i)return 1;if(t>>>=0,i>>>=0,n>>>=0,r>>>=0,this===e)return 0;for(var o=r-n,a=i-t,l=Math.min(o,a),u=this.slice(n,r),c=e.slice(t,i),p=0;p<l;++p)if(u[p]!==c[p]){o=u[p],a=c[p];break}return o<a?-1:+(a<o)},s.prototype.includes=function(e,t,i){return -1!==this.indexOf(e,t,i)},s.prototype.indexOf=function(e,t,i){return y(this,e,t,i,!0)},s.prototype.lastIndexOf=function(e,t,i){return y(this,e,t,i,!1)},s.prototype.write=function(e,t,i,n){if(void 0===t)n="utf8",i=this.length,t=0;else if(void 0===i&&"string"==typeof t)n=t,i=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(i)?(i>>>=0,void 0===n&&(n="utf8")):(n=i,i=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var r,o,a,s,l,u,c,p,d=this.length-t;if((void 0===i||i>d)&&(i=d),e.length>0&&(i<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var f=!1;;)switch(n){case"hex":return function(e,t,i,n){i=Number(i)||0;var r=e.length-i;n?(n=Number(n))>r&&(n=r):n=r;var o=t.length;n>o/2&&(n=o/2);for(var a=0;a<n;++a){var s,l=parseInt(t.substr(2*a,2),16);if((s=l)!=s)break;e[i+a]=l}return a}(this,e,t,i);case"utf8":case"utf-8":return r=t,o=i,A(O(e,this.length-r),this,r,o);case"ascii":case"latin1":case"binary":return a=t,s=i,A(function(e){for(var t=[],i=0;i<e.length;++i)t.push(255&e.charCodeAt(i));return t}(e),this,a,s);case"base64":return l=t,u=i,A(x(e),this,l,u);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return c=t,p=i,A(function(e,t){for(var i,n,r=[],o=0;o<e.length&&!((t-=2)<0);++o)n=(i=e.charCodeAt(o))>>8,r.push(i%256),r.push(n);return r}(e,this.length-c),this,c,p);default:if(f)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),f=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},s.prototype.slice=function(e,t){var i=this.length;e=~~e,t=void 0===t?i:~~t,e<0?(e+=i)<0&&(e=0):e>i&&(e=i),t<0?(t+=i)<0&&(t=0):t>i&&(t=i),t<e&&(t=e);var n=this.subarray(e,t);return Object.setPrototypeOf(n,s.prototype),n},s.prototype.readUintLE=s.prototype.readUIntLE=function(e,t,i){e>>>=0,t>>>=0,i||_(e,t,this.length);for(var n=this[e],r=1,o=0;++o<t&&(r*=256);)n+=this[e+o]*r;return n},s.prototype.readUintBE=s.prototype.readUIntBE=function(e,t,i){e>>>=0,t>>>=0,i||_(e,t,this.length);for(var n=this[e+--t],r=1;t>0&&(r*=256);)n+=this[e+--t]*r;return n},s.prototype.readUint8=s.prototype.readUInt8=function(e,t){return e>>>=0,t||_(e,1,this.length),this[e]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(e,t){return e>>>=0,t||_(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(e,t){return e>>>=0,t||_(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(e,t){return e>>>=0,t||_(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+0x1000000*this[e+3]},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(e,t){return e>>>=0,t||_(e,4,this.length),0x1000000*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readIntLE=function(e,t,i){e>>>=0,t>>>=0,i||_(e,t,this.length);for(var n=this[e],r=1,o=0;++o<t&&(r*=256);)n+=this[e+o]*r;return n>=(r*=128)&&(n-=Math.pow(2,8*t)),n},s.prototype.readIntBE=function(e,t,i){e>>>=0,t>>>=0,i||_(e,t,this.length);for(var n=t,r=1,o=this[e+--n];n>0&&(r*=256);)o+=this[e+--n]*r;return o>=(r*=128)&&(o-=Math.pow(2,8*t)),o},s.prototype.readInt8=function(e,t){return(e>>>=0,t||_(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},s.prototype.readInt16LE=function(e,t){e>>>=0,t||_(e,2,this.length);var i=this[e]|this[e+1]<<8;return 32768&i?0xffff0000|i:i},s.prototype.readInt16BE=function(e,t){e>>>=0,t||_(e,2,this.length);var i=this[e+1]|this[e]<<8;return 32768&i?0xffff0000|i:i},s.prototype.readInt32LE=function(e,t){return e>>>=0,t||_(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return e>>>=0,t||_(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readFloatLE=function(e,t){return e>>>=0,t||_(e,4,this.length),r.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return e>>>=0,t||_(e,4,this.length),r.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return e>>>=0,t||_(e,8,this.length),r.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return e>>>=0,t||_(e,8,this.length),r.read(this,e,!1,52,8)},s.prototype.writeUintLE=s.prototype.writeUIntLE=function(e,t,i,n){if(e*=1,t>>>=0,i>>>=0,!n){var r=Math.pow(2,8*i)-1;w(this,e,t,i,r,0)}var o=1,a=0;for(this[t]=255&e;++a<i&&(o*=256);)this[t+a]=e/o&255;return t+i},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(e,t,i,n){if(e*=1,t>>>=0,i>>>=0,!n){var r=Math.pow(2,8*i)-1;w(this,e,t,i,r,0)}var o=i-1,a=1;for(this[t+o]=255&e;--o>=0&&(a*=256);)this[t+o]=e/a&255;return t+i},s.prototype.writeUint8=s.prototype.writeUInt8=function(e,t,i){return e*=1,t>>>=0,i||w(this,e,t,1,255,0),this[t]=255&e,t+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(e,t,i){return e*=1,t>>>=0,i||w(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(e,t,i){return e*=1,t>>>=0,i||w(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(e,t,i){return e*=1,t>>>=0,i||w(this,e,t,4,0xffffffff,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(e,t,i){return e*=1,t>>>=0,i||w(this,e,t,4,0xffffffff,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},s.prototype.writeIntLE=function(e,t,i,n){if(e*=1,t>>>=0,!n){var r=Math.pow(2,8*i-1);w(this,e,t,i,r-1,-r)}var o=0,a=1,s=0;for(this[t]=255&e;++o<i&&(a*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/a|0)-s&255;return t+i},s.prototype.writeIntBE=function(e,t,i,n){if(e*=1,t>>>=0,!n){var r=Math.pow(2,8*i-1);w(this,e,t,i,r-1,-r)}var o=i-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a|0)-s&255;return t+i},s.prototype.writeInt8=function(e,t,i){return e*=1,t>>>=0,i||w(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},s.prototype.writeInt16LE=function(e,t,i){return e*=1,t>>>=0,i||w(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeInt16BE=function(e,t,i){return e*=1,t>>>=0,i||w(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeInt32LE=function(e,t,i){return e*=1,t>>>=0,i||w(this,e,t,4,0x7fffffff,-0x80000000),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},s.prototype.writeInt32BE=function(e,t,i){return e*=1,t>>>=0,i||w(this,e,t,4,0x7fffffff,-0x80000000),e<0&&(e=0xffffffff+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},s.prototype.writeFloatLE=function(e,t,i){return S(this,e,t,!0,i)},s.prototype.writeFloatBE=function(e,t,i){return S(this,e,t,!1,i)},s.prototype.writeDoubleLE=function(e,t,i){return T(this,e,t,!0,i)},s.prototype.writeDoubleBE=function(e,t,i){return T(this,e,t,!1,i)},s.prototype.copy=function(e,t,i,n){if(!s.isBuffer(e))throw TypeError("argument should be a Buffer");if(i||(i=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<i&&(n=i),n===i||0===e.length||0===this.length)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-i&&(n=e.length-t+i);var r=n-i;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,i,n):Uint8Array.prototype.set.call(e,this.subarray(i,n),t),r},s.prototype.fill=function(e,t,i,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,i=this.length):"string"==typeof i&&(n=i,i=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!s.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===e.length){var r,o=e.charCodeAt(0);("utf8"===n&&o<128||"latin1"===n)&&(e=o)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<i)throw RangeError("Out of range index");if(i<=t)return this;if(t>>>=0,i=void 0===i?this.length:i>>>0,e||(e=0),"number"==typeof e)for(r=t;r<i;++r)this[r]=e;else{var a=s.isBuffer(e)?e:s.from(e,n),l=a.length;if(0===l)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(r=0;r<i-t;++r)this[r+t]=a[r%l]}return this};var R=/[^+/0-9A-Za-z-_]/g;function O(e,t){t=t||1/0;for(var i,n=e.length,r=null,o=[],a=0;a<n;++a){if((i=e.charCodeAt(a))>55295&&i<57344){if(!r){if(i>56319||a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}r=i;continue}if(i<56320){(t-=3)>-1&&o.push(239,191,189),r=i;continue}i=(r-55296<<10|i-56320)+65536}else r&&(t-=3)>-1&&o.push(239,191,189);if(r=null,i<128){if((t-=1)<0)break;o.push(i)}else if(i<2048){if((t-=2)<0)break;o.push(i>>6|192,63&i|128)}else if(i<65536){if((t-=3)<0)break;o.push(i>>12|224,i>>6&63|128,63&i|128)}else if(i<1114112){if((t-=4)<0)break;o.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}else throw Error("Invalid code point")}return o}function x(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(R,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function A(e,t,i,n){for(var r=0;r<n&&!(r+i>=t.length)&&!(r>=e.length);++r)t[r+i]=e[r];return r}function k(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}var C=function(){for(var e="0123456789abcdef",t=Array(256),i=0;i<16;++i)for(var n=16*i,r=0;r<16;++r)t[n+r]=e[i]+e[r];return t}()},q(e){var t,i="object"==typeof Reflect?Reflect:null,n=i&&"function"==typeof i.apply?i.apply:function(e,t,i){return Function.prototype.apply.call(e,t,i)};t=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var r=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise(function(i,n){var r,o,a;function s(i){e.removeListener(t,l),n(i)}function l(){"function"==typeof e.removeListener&&e.removeListener("error",s),i([].slice.call(arguments))}m(e,t,l,{once:!0}),"error"!==t&&(r=e,o=s,a={once:!0},"function"==typeof r.on&&m(r,"error",o,a))})},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var a=10;function s(e){if("function"!=typeof e)throw TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function u(e,t,i,n){if(s(i),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,i.listener?i.listener:i),o=e._events),a=o[t]),void 0===a)a=o[t]=i,++e._eventsCount;else if("function"==typeof a?a=o[t]=n?[i,a]:[a,i]:n?a.unshift(i):a.push(i),(r=l(e))>0&&a.length>r&&!a.warned){a.warned=!0;var r,o,a,u=Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,console&&console.warn&&console.warn(u)}return e}function c(){if(!this.fired)return(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0==arguments.length)?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,i){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:i},r=c.bind(n);return r.listener=i,n.wrapFn=r,r}function d(e,t,i){var n=e._events;if(void 0===n)return[];var r=n[t];return void 0===r?[]:"function"==typeof r?i?[r.listener||r]:[r]:i?function(e){for(var t=Array(e.length),i=0;i<t.length;++i)t[i]=e[i].listener||e[i];return t}(r):h(r,r.length)}function f(e){var t=this._events;if(void 0!==t){var i=t[e];if("function"==typeof i)return 1;if(void 0!==i)return i.length}return 0}function h(e,t){for(var i=Array(t),n=0;n<t;++n)i[n]=e[n];return i}function m(e,t,i,n){if("function"==typeof e.on)n.once?e.once(t,i):e.on(t,i);else if("function"==typeof e.addEventListener)e.addEventListener(t,function r(o){n.once&&e.removeEventListener(t,r),i(o)});else throw TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||r(e))throw RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),o.init=function(){(void 0===this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||r(e))throw RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return l(this)},o.prototype.emit=function(e){for(var t=[],i=1;i<arguments.length;i++)t.push(arguments[i]);var r="error"===e,o=this._events;if(void 0!==o)r=r&&void 0===o.error;else if(!r)return!1;if(r){if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var a,s=Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var l=o[e];if(void 0===l)return!1;if("function"==typeof l)n(l,this,t);else for(var u=l.length,c=h(l,u),i=0;i<u;++i)n(c[i],this,t);return!0},o.prototype.addListener=function(e,t){return u(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return u(this,e,t,!0)},o.prototype.once=function(e,t){return s(t),this.on(e,p(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return s(t),this.prependListener(e,p(this,e,t)),this},o.prototype.removeListener=function(e,t){var i,n,r,o,a;if(s(t),void 0===(n=this._events)||void 0===(i=n[e]))return this;if(i===t||i.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,i.listener||t));else if("function"!=typeof i){for(r=-1,o=i.length-1;o>=0;o--)if(i[o]===t||i[o].listener===t){a=i[o].listener,r=o;break}if(r<0)return this;0===r?i.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(i,r),1===i.length&&(n[e]=i[0]),void 0!==n.removeListener&&this.emit("removeListener",e,a||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,i,n;if(void 0===(i=this._events))return this;if(void 0===i.removeListener)return 0==arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==i[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete i[e]),this;if(0==arguments.length){var r,o=Object.keys(i);for(n=0;n<o.length;++n)"removeListener"!==(r=o[n])&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=i[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return d(this,e,!0)},o.prototype.rawListeners=function(e){return d(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},o.prototype.listenerCount=f,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},r(e,t){t.read=function(e,t,i,n,r){var o,a,s=8*r-n-1,l=(1<<s)-1,u=l>>1,c=-7,p=i?r-1:0,d=i?-1:1,f=e[t+p];for(p+=d,o=f&(1<<-c)-1,f>>=-c,c+=s;c>0;o=256*o+e[t+p],p+=d,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=256*a+e[t+p],p+=d,c-=8);if(0===o)o=1-u;else{if(o===l)return a?0/0:(f?-1:1)*2e308;a+=Math.pow(2,n),o-=u}return(f?-1:1)*a*Math.pow(2,o-n)},t.write=function(e,t,i,n,r,o){var a,s,l,u=8*o-r-1,c=(1<<u)-1,p=c>>1,d=5960464477539062e-23*(23===r),f=n?0:o-1,h=n?1:-1,m=+(t<0||0===t&&1/t<0);for(isNaN(t=Math.abs(t))||1/0===t?(s=+!!isNaN(t),a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+p>=1?t+=d/l:t+=d*Math.pow(2,1-p),t*l>=2&&(a++,l/=2),a+p>=c?(s=0,a=c):a+p>=1?(s=(t*l-1)*Math.pow(2,r),a+=p):(s=t*Math.pow(2,p-1)*Math.pow(2,r),a=0));r>=8;e[i+f]=255&s,f+=h,s/=256,r-=8);for(a=a<<r|s,u+=r;u>0;e[i+f]=255&a,f+=h,a/=256,u-=8);e[i+f-h]|=128*m}},c5(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var i=function(){};i.prototype=t.prototype,e.prototype=new i,e.prototype.constructor=e}}},z(e){var t,i,n,r=e.exports={};function o(){throw Error("setTimeout has not been defined")}function a(){throw Error("clearTimeout has not been defined")}try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{i="function"==typeof clearTimeout?clearTimeout:a}catch(e){i=a}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(i){try{return t.call(null,e,0)}catch(i){return t.call(this,e,0)}}}var l=[],u=!1,c=-1;function p(){u&&n&&(u=!1,n.length?l=n.concat(l):c=-1,l.length&&d())}function d(){if(!u){var e=s(p);u=!0;for(var t=l.length;t;){for(n=l,l=[];++c<t;)n&&n[c].run();c=-1,t=l.length}n=null,u=!1,function(e){if(i===clearTimeout)return clearTimeout(e);if((i===a||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(e);try{i(e)}catch(t){try{return i.call(null,e)}catch(t){return i.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function h(){}r.nextTick=function(e){var t=Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)t[i-1]=arguments[i];l.push(new f(e,t)),1!==l.length||u||s(d)},f.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=h,r.addListener=h,r.once=h,r.off=h,r.removeListener=h,r.removeAllListeners=h,r.emit=h,r.prependListener=h,r.prependOnceListener=h,r.listeners=function(e){return[]},r.binding=function(e){throw Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(e){throw Error("process.chdir is not supported")},r.umask=function(){return 0}},K(e,t,i){var n=i("d"),r=n.Buffer;function o(e,t){for(var i in e)t[i]=e[i]}function a(e,t,i){return r(e,t,i)}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=a),a.prototype=Object.create(r.prototype),o(r,a),a.from=function(e,t,i){if("number"==typeof e)throw TypeError("Argument must not be a number");return r(e,t,i)},a.alloc=function(e,t,i){if("number"!=typeof e)throw TypeError("Argument must be a number");var n=r(e);return void 0!==t?"string"==typeof i?n.fill(t,i):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return r(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return n.SlowBuffer(e)}},c(e,t,i){e.exports=r;var n=i("q").EventEmitter;function r(){n.call(this)}i("c5")(r,n),r.Readable=i("e"),r.Writable=i("ep"),r.Duplex=i("F"),r.Transform=i("hR"),r.PassThrough=i("zM"),r.finished=i("n"),r.pipeline=i("Kx"),r.Stream=r,r.prototype.pipe=function(e,t){var i=this;function r(t){e.writable&&!1===e.write(t)&&i.pause&&i.pause()}function o(){i.readable&&i.resume&&i.resume()}i.on("data",r),e.on("drain",o),e._isStdio||t&&!1===t.end||(i.on("end",s),i.on("close",l));var a=!1;function s(){a||(a=!0,e.end())}function l(){a||(a=!0,"function"==typeof e.destroy&&e.destroy())}function u(e){if(c(),0===n.listenerCount(this,"error"))throw e}function c(){i.removeListener("data",r),e.removeListener("drain",o),i.removeListener("end",s),i.removeListener("close",l),i.removeListener("error",u),e.removeListener("error",u),i.removeListener("end",c),i.removeListener("close",c),e.removeListener("close",c)}return i.on("error",u),e.on("error",u),i.on("end",c),i.on("close",c),e.on("close",c),e.emit("pipe",i),e}},x(e){var t={};function i(e,i,n){n||(n=Error);var r=function(e){function t(t,n,r){return e.call(this,"string"==typeof i?i:i(t,n,r))||this}return t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e,t}(n);r.prototype.name=n.name,r.prototype.code=e,t[e]=r}function n(e,t){if(!Array.isArray(e))return"of ".concat(t," ").concat(String(e));var i=e.length;return(e=e.map(function(e){return String(e)}),i>2)?"one of ".concat(t," ").concat(e.slice(0,i-1).join(", "),", or ")+e[i-1]:2===i?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}i("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),i("ERR_INVALID_ARG_TYPE",function(e,t,i){if("string"==typeof t&&(r="not ",t.substr(0,r.length)===r)?(l="must not be",t=t.replace(/^not /,"")):l="must be",o=" argument",(void 0===a||a>e.length)&&(a=e.length),e.substring(a-o.length,a)===o)u="The ".concat(e," ").concat(l," ").concat(n(t,"type"));else{var r,o,a,s,l,u,c=("number"!=typeof s&&(s=0),s+1>e.length||-1===e.indexOf(".",s))?"argument":"property";u='The "'.concat(e,'" ').concat(c," ").concat(l," ").concat(n(t,"type"))}return u+". Received type ".concat(typeof i)},TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.F=t},F(e,t,i){var n=i("z"),r=Object.keys||function(e){var t=[];for(var i in e)t.push(i);return t};e.exports=c;var o=i("e"),a=i("ep");i("c5")(c,o);for(var s=r(a.prototype),l=0;l<s.length;l++){var u=s[l];c.prototype[u]||(c.prototype[u]=a.prototype[u])}function c(e){if(!(this instanceof c))return new c(e);o.call(this,e),a.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",p)))}function p(){this._writableState.ended||n.nextTick(d,this)}function d(e){e.end()}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(c.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(c.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(c.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})},zM(e,t,i){e.exports=r;var n=i("hR");function r(e){if(!(this instanceof r))return new r(e);n.call(this,e)}i("c5")(r,n),r.prototype._transform=function(e,t,i){i(null,e)}},e(e,t,i){var n,r,o,a,s,l=i("z");e.exports=R,R.ReadableState=T,i("q").EventEmitter;var u=function(e,t){return e.listeners(t).length},c=i("Js"),p=i("d").Buffer,d=(void 0!==i.g?i.g:"u">typeof window?window:"u">typeof self?self:{}).Uint8Array||function(){},f=i("b");r=f&&f.debuglog?f.debuglog("stream"):function(){};var h=i("LP"),m=i("w"),g=i("G").getHighWaterMark,y=i("x").F,b=y.ERR_INVALID_ARG_TYPE,v=y.ERR_STREAM_PUSH_AFTER_EOF,_=y.ERR_METHOD_NOT_IMPLEMENTED,w=y.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;i("c5")(R,c);var E=m.errorOrDestroy,S=["error","close","destroy","pause","resume"];function T(e,t,r){n=n||i("F"),e=e||{},"boolean"!=typeof r&&(r=t instanceof n),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=g(this,e,"readableHighWaterMark",r),this.buffer=new h,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(o||(o=i("t").I),this.decoder=new o(e.encoding),this.encoding=e.encoding)}function R(e){if(n=n||i("F"),!(this instanceof R))return new R(e);var t=this instanceof n;this._readableState=new T(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),c.call(this)}function O(e,t,i,n,o){r("readableAddChunk",t);var a,s,l=e._readableState;if(null===t)l.reading=!1,function(e,t){if(r("onEofChunk"),!t.ended){if(t.decoder){var i=t.decoder.end();i&&i.length&&(t.buffer.push(i),t.length+=t.objectMode?1:i.length)}t.ended=!0,t.sync?k(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,C(e)))}}(e,l);else if(o||(s=function(e,t){var i;return p.isBuffer(t)||t instanceof d||"string"==typeof t||void 0===t||e.objectMode||(i=new b("chunk",["string","Buffer","Uint8Array"],t)),i}(l,t)),s)E(e,s);else if(l.objectMode||t&&t.length>0)if("string"==typeof t||l.objectMode||Object.getPrototypeOf(t)===p.prototype||(a=t,t=p.from(a)),n)l.endEmitted?E(e,new w):x(e,l,t,!0);else if(l.ended)E(e,new v);else{if(l.destroyed)return!1;l.reading=!1,l.decoder&&!i?(t=l.decoder.write(t),l.objectMode||0!==t.length?x(e,l,t,!1):P(e,l)):x(e,l,t,!1)}else n||(l.reading=!1,P(e,l));return!l.ended&&(l.length<l.highWaterMark||0===l.length)}function x(e,t,i,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",i)):(t.length+=t.objectMode?1:i.length,n?t.buffer.unshift(i):t.buffer.push(i),t.needReadable&&k(e)),P(e,t)}function A(e,t){var i;if(e<=0||0===t.length&&t.ended)return 0;if(t.objectMode)return 1;if(e!=e)if(t.flowing&&t.length)return t.buffer.head.data.length;else return t.length;return(e>t.highWaterMark&&((i=e)>=0x40000000?i=0x40000000:(i--,i|=i>>>1,i|=i>>>2,i|=i>>>4,i|=i>>>8,i|=i>>>16,i++),t.highWaterMark=i),e<=t.length)?e:t.ended?t.length:(t.needReadable=!0,0)}function k(e){var t=e._readableState;r("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(r("emitReadable",t.flowing),t.emittedReadable=!0,l.nextTick(C,e))}function C(e){var t=e._readableState;r("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,N(e)}function P(e,t){t.readingMore||(t.readingMore=!0,l.nextTick(I,e,t))}function I(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var i=t.length;if(r("maybeReadMore read 0"),e.read(0),i===t.length)break}t.readingMore=!1}function U(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function z(e){r("readable nexttick read 0"),e.read(0)}function L(e,t){r("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),N(e),t.flowing&&!t.reading&&e.read(0)}function N(e){var t=e._readableState;for(r("flow",t.flowing);t.flowing&&null!==e.read(););}function $(e,t){var i;return 0===t.length?null:(t.objectMode?i=t.buffer.shift():!e||e>=t.length?(i=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):i=t.buffer.consume(e,t.decoder),i)}function D(e){var t=e._readableState;r("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,l.nextTick(M,t,e))}function M(e,t){if(r("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var i=t._writableState;(!i||i.autoDestroy&&i.finished)&&t.destroy()}}function j(e,t){for(var i=0,n=e.length;i<n;i++)if(e[i]===t)return i;return -1}Object.defineProperty(R.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),R.prototype.destroy=m.destroy,R.prototype._undestroy=m.undestroy,R.prototype._destroy=function(e,t){t(e)},R.prototype.push=function(e,t){var i,n=this._readableState;return n.objectMode?i=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=p.from(e,t),t=""),i=!0),O(this,e,t,!1,i)},R.prototype.unshift=function(e){return O(this,e,null,!0,!1)},R.prototype.isPaused=function(){return!1===this._readableState.flowing},R.prototype.setEncoding=function(e){o||(o=i("t").I);var t=new o(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,r="";null!==n;)r+=t.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==r&&this._readableState.buffer.push(r),this._readableState.length=r.length,this},R.prototype.read=function(e){r("read",e),e=parseInt(e,10);var t,i=this._readableState,n=e;if(0!==e&&(i.emittedReadable=!1),0===e&&i.needReadable&&((0!==i.highWaterMark?i.length>=i.highWaterMark:i.length>0)||i.ended))return r("read: emitReadable",i.length,i.ended),0===i.length&&i.ended?D(this):k(this),null;if(0===(e=A(e,i))&&i.ended)return 0===i.length&&D(this),null;var o=i.needReadable;return r("need readable",o),(0===i.length||i.length-e<i.highWaterMark)&&r("length less than watermark",o=!0),i.ended||i.reading?r("reading or ended",o=!1):o&&(r("do read"),i.reading=!0,i.sync=!0,0===i.length&&(i.needReadable=!0),this._read(i.highWaterMark),i.sync=!1,i.reading||(e=A(n,i))),null===(t=e>0?$(e,i):null)?(i.needReadable=i.length<=i.highWaterMark,e=0):(i.length-=e,i.awaitDrain=0),0===i.length&&(i.ended||(i.needReadable=!0),n!==e&&i.ended&&D(this)),null!==t&&this.emit("data",t),t},R.prototype._read=function(e){E(this,new _("_read()"))},R.prototype.pipe=function(e,t){var i,n=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1,r("pipe count=%d opts=%j",o.pipesCount,t);var a=t&&!1===t.end||e===l.stdout||e===l.stderr?g:s;function s(){r("onend"),e.end()}o.endEmitted?l.nextTick(a):n.once("end",a),e.on("unpipe",function t(i,a){r("onunpipe"),i===n&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,r("cleanup"),e.removeListener("close",h),e.removeListener("finish",m),e.removeListener("drain",c),e.removeListener("error",f),e.removeListener("unpipe",t),n.removeListener("end",s),n.removeListener("end",g),n.removeListener("data",d),p=!0,o.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&c())});var c=(i=n,function(){var e=i._readableState;r("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&u(i,"data")&&(e.flowing=!0,N(i))});e.on("drain",c);var p=!1;function d(t){r("ondata");var i=e.write(t);r("dest.write",i),!1===i&&((1===o.pipesCount&&o.pipes===e||o.pipesCount>1&&-1!==j(o.pipes,e))&&!p&&(r("false write response, pause",o.awaitDrain),o.awaitDrain++),n.pause())}function f(t){r("onerror",t),g(),e.removeListener("error",f),0===u(e,"error")&&E(e,t)}function h(){e.removeListener("finish",m),g()}function m(){r("onfinish"),e.removeListener("close",h),g()}function g(){r("unpipe"),n.unpipe(e)}return n.on("data",d),!function(e,t,i){if("function"==typeof e.prependListener)return e.prependListener(t,i);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(i):e._events[t]=[i,e._events[t]]:e.on(t,i)}(e,"error",f),e.once("close",h),e.once("finish",m),e.emit("pipe",n),o.flowing||(r("pipe resume"),n.resume()),e},R.prototype.unpipe=function(e){var t=this._readableState,i={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,i)),this;if(!e){var n=t.pipes,r=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<r;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=j(t.pipes,e);return -1===a||(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,i)),this},R.prototype.on=function(e,t){var i=c.prototype.on.call(this,e,t),n=this._readableState;return"data"===e?(n.readableListening=this.listenerCount("readable")>0,!1!==n.flowing&&this.resume()):"readable"!==e||n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,r("on readable",n.length,n.reading),n.length?k(this):n.reading||l.nextTick(z,this)),i},R.prototype.addListener=R.prototype.on,R.prototype.removeListener=function(e,t){var i=c.prototype.removeListener.call(this,e,t);return"readable"===e&&l.nextTick(U,this),i},R.prototype.removeAllListeners=function(e){var t=c.prototype.removeAllListeners.apply(this,arguments);return("readable"===e||void 0===e)&&l.nextTick(U,this),t},R.prototype.resume=function(){var e,t,i=this._readableState;return i.flowing||(r("resume"),i.flowing=!i.readableListening,e=this,(t=i).resumeScheduled||(t.resumeScheduled=!0,l.nextTick(L,e,t))),i.paused=!1,this},R.prototype.pause=function(){return r("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(r("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},R.prototype.wrap=function(e){var t=this,i=this._readableState,n=!1;for(var o in e.on("end",function(){if(r("wrapped end"),i.decoder&&!i.ended){var e=i.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(o){r("wrapped data"),i.decoder&&(o=i.decoder.write(o)),i.objectMode&&null==o||(i.objectMode||o&&o.length)&&(t.push(o)||(n=!0,e.pause()))}),e)void 0===this[o]&&"function"==typeof e[o]&&(this[o]=function(t){return function(){return e[t].apply(e,arguments)}}(o));for(var a=0;a<S.length;a++)e.on(S[a],this.emit.bind(this,S[a]));return this._read=function(t){r("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(R.prototype[Symbol.asyncIterator]=function(){return void 0===a&&(a=i("tm")),a(this)}),Object.defineProperty(R.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(R.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(R.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),R._fromList=$,Object.defineProperty(R.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(R.from=function(e,t){return void 0===s&&(s=i("s")),s(R,e,t)})},hR(e,t,i){e.exports=c;var n=i("x").F,r=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,a=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=n.ERR_TRANSFORM_WITH_LENGTH_0,l=i("F");function u(e,t){var i=this._transformState;i.transforming=!1;var n=i.writecb;if(null===n)return this.emit("error",new o);i.writechunk=null,i.writecb=null,null!=t&&this.push(t),n(e);var r=this._readableState;r.reading=!1,(r.needReadable||r.length<r.highWaterMark)&&this._read(r.highWaterMark)}function c(e){if(!(this instanceof c))return new c(e);l.call(this,e),this._transformState={afterTransform:u.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",p)}function p(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?d(this,null,null):this._flush(function(t,i){d(e,t,i)})}function d(e,t,i){if(t)return e.emit("error",t);if(null!=i&&e.push(i),e._writableState.length)throw new s;if(e._transformState.transforming)throw new a;return e.push(null)}i("c5")(c,l),c.prototype.push=function(e,t){return this._transformState.needTransform=!1,l.prototype.push.call(this,e,t)},c.prototype._transform=function(e,t,i){i(new r("_transform()"))},c.prototype._write=function(e,t,i){var n=this._transformState;if(n.writecb=i,n.writechunk=e,n.writeencoding=t,!n.transforming){var r=this._readableState;(n.needTransform||r.needReadable||r.length<r.highWaterMark)&&this._read(r.highWaterMark)}},c.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},c.prototype._destroy=function(e,t){l.prototype._destroy.call(this,e,function(e){t(e)})}},ep(e,t,i){var n,r,o=i("z");function a(e){var t=this;this.next=null,this.entry=null,this.finish=function(){var i=t,n=e,r=i.entry;for(i.entry=null;r;){var o=r.callback;n.pendingcb--,o(void 0),r=r.next}n.corkedRequestsFree.next=i}}e.exports=R,R.WritableState=T;var s={deprecate:i("N")},l=i("Js"),u=i("d").Buffer,c=(void 0!==i.g?i.g:"u">typeof window?window:"u">typeof self?self:{}).Uint8Array||function(){},p=i("w"),d=i("G").getHighWaterMark,f=i("x").F,h=f.ERR_INVALID_ARG_TYPE,m=f.ERR_METHOD_NOT_IMPLEMENTED,g=f.ERR_MULTIPLE_CALLBACK,y=f.ERR_STREAM_CANNOT_PIPE,b=f.ERR_STREAM_DESTROYED,v=f.ERR_STREAM_NULL_VALUES,_=f.ERR_STREAM_WRITE_AFTER_END,w=f.ERR_UNKNOWN_ENCODING,E=p.errorOrDestroy;function S(){}function T(e,t,r){n=n||i("F"),e=e||{},"boolean"!=typeof r&&(r=t instanceof n),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=d(this,e,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===e.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var i=e._writableState,n=i.sync,r=i.writecb;if("function"!=typeof r)throw new g;if(i.writing=!1,i.writecb=null,i.length-=i.writelen,i.writelen=0,t)--i.pendingcb,n?(o.nextTick(r,t),o.nextTick(P,e,i),e._writableState.errorEmitted=!0,E(e,t)):(r(t),e._writableState.errorEmitted=!0,E(e,t),P(e,i));else{var a=k(i)||e.destroyed;a||i.corked||i.bufferProcessing||!i.bufferedRequest||A(e,i),n?o.nextTick(x,e,i,a,r):x(e,i,a,r)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}i("c5")(R,l),T.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t};try{Object.defineProperty(T.prototype,"buffer",{get:s.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}function R(e){var t=this instanceof(n=n||i("F"));if(!t&&!r.call(R,this))return new R(e);this._writableState=new T(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),l.call(this)}function O(e,t,i,n,r,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new b("write")):i?e._writev(r,t.onwrite):e._write(r,o,t.onwrite),t.sync=!1}function x(e,t,i,n){var r,o;i||(r=e,0===(o=t).length&&o.needDrain&&(o.needDrain=!1,r.emit("drain"))),t.pendingcb--,n(),P(e,t)}function A(e,t){t.bufferProcessing=!0;var i=t.bufferedRequest;if(e._writev&&i&&i.next){var n=Array(t.bufferedRequestCount),r=t.corkedRequestsFree;r.entry=i;for(var o=0,s=!0;i;)n[o]=i,i.isBuf||(s=!1),i=i.next,o+=1;n.allBuffers=s,O(e,t,!0,t.length,n,"",r.finish),t.pendingcb++,t.lastBufferedRequest=null,r.next?(t.corkedRequestsFree=r.next,r.next=null):t.corkedRequestsFree=new a(t),t.bufferedRequestCount=0}else{for(;i;){var l=i.chunk,u=i.encoding,c=i.callback,p=t.objectMode?1:l.length;if(O(e,t,!1,p,l,u,c),i=i.next,t.bufferedRequestCount--,t.writing)break}null===i&&(t.lastBufferedRequest=null)}t.bufferedRequest=i,t.bufferProcessing=!1}function k(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function C(e,t){e._final(function(i){t.pendingcb--,i&&E(e,i),t.prefinished=!0,e.emit("prefinish"),P(e,t)})}function P(e,t){var i=k(t);if(i&&(t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,o.nextTick(C,e,t))),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return i}"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(r=Function.prototype[Symbol.hasInstance],Object.defineProperty(R,Symbol.hasInstance,{value:function(e){return!!r.call(this,e)||this===R&&e&&e._writableState instanceof T}})):r=function(e){return e instanceof this},R.prototype.pipe=function(){E(this,new y)},R.prototype.write=function(e,t,i){var n,r,a,s,l,p,d,f=this._writableState,m=!1,g=!f.objectMode&&(n=e,u.isBuffer(n)||n instanceof c);return(g&&!u.isBuffer(e)&&(r=e,e=u.from(r)),"function"==typeof t&&(i=t,t=null),g?t="buffer":t||(t=f.defaultEncoding),"function"!=typeof i&&(i=S),f.ending)?(a=i,E(this,s=new _),o.nextTick(a,s)):(g||(l=e,p=i,null===l?d=new v:"string"==typeof l||f.objectMode||(d=new h("chunk",["string","Buffer"],l)),!d||(E(this,d),o.nextTick(p,d),0)))&&(f.pendingcb++,m=function(e,t,i,n,r,o){if(!i){var a,s,l=(a=n,s=r,t.objectMode||!1===t.decodeStrings||"string"!=typeof a||(a=u.from(a,s)),a);n!==l&&(i=!0,r="buffer",n=l)}var c=t.objectMode?1:n.length;t.length+=c;var p=t.length<t.highWaterMark;if(p||(t.needDrain=!0),t.writing||t.corked){var d=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:r,isBuf:i,callback:o,next:null},d?d.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else O(e,t,!1,c,n,r,o);return p}(this,f,g,e,t,i)),m},R.prototype.cork=function(){this._writableState.corked++},R.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||A(this,e))},R.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new w(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(R.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(R.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),R.prototype._write=function(e,t,i){i(new m("_write()"))},R.prototype._writev=null,R.prototype.end=function(e,t,i){var n,r,a,s=this._writableState;return"function"==typeof e?(i=e,e=null,t=null):"function"==typeof t&&(i=t,t=null),null!=e&&this.write(e,t),s.corked&&(s.corked=1,this.uncork()),s.ending||(n=this,r=s,a=i,r.ending=!0,P(n,r),a&&(r.finished?o.nextTick(a):n.once("finish",a)),r.ended=!0,n.writable=!1),this},Object.defineProperty(R.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(R.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),R.prototype.destroy=p.destroy,R.prototype._undestroy=p.undestroy,R.prototype._destroy=function(e,t){t(e)}},tm(e,t,i){var n,r=i("z");function o(e,t,i){var n;return(t="symbol"==typeof(n=function(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?n:String(n))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var a=i("n"),s=Symbol("lastResolve"),l=Symbol("lastReject"),u=Symbol("error"),c=Symbol("ended"),p=Symbol("lastPromise"),d=Symbol("handlePromise"),f=Symbol("stream");function h(e,t){return{value:e,done:t}}function m(e){var t=e[s];if(null!==t){var i=e[f].read();null!==i&&(e[p]=null,e[s]=null,e[l]=null,t(h(i,!1)))}}function g(e){r.nextTick(m,e)}var y=Object.getPrototypeOf(function(){}),b=Object.setPrototypeOf((o(n={get stream(){return this[f]},next:function(){var e,t,i=this,n=this[u];if(null!==n)return Promise.reject(n);if(this[c])return Promise.resolve(h(void 0,!0));if(this[f].destroyed)return new Promise(function(e,t){r.nextTick(function(){i[u]?t(i[u]):e(h(void 0,!0))})});var o=this[p];if(o)t=new Promise((e=this,function(t,i){o.then(function(){e[c]?t(h(void 0,!0)):e[d](t,i)},i)}));else{var a=this[f].read();if(null!==a)return Promise.resolve(h(a,!1));t=new Promise(this[d])}return this[p]=t,t}},Symbol.asyncIterator,function(){return this}),o(n,"return",function(){var e=this;return new Promise(function(t,i){e[f].destroy(null,function(e){e?i(e):t(h(void 0,!0))})})}),n),y);e.exports=function(e){var t,i=Object.create(b,(o(t={},f,{value:e,writable:!0}),o(t,s,{value:null,writable:!0}),o(t,l,{value:null,writable:!0}),o(t,u,{value:null,writable:!0}),o(t,c,{value:e._readableState.endEmitted,writable:!0}),o(t,d,{value:function(e,t){var n=i[f].read();n?(i[p]=null,i[s]=null,i[l]=null,e(h(n,!1))):(i[s]=e,i[l]=t)},writable:!0}),t));return i[p]=null,a(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=i[l];null!==t&&(i[p]=null,i[s]=null,i[l]=null,t(e)),i[u]=e;return}var n=i[s];null!==n&&(i[p]=null,i[s]=null,i[l]=null,n(h(void 0,!0))),i[c]=!0}),e.on("readable",g.bind(null,i)),i}},LP(e,t,i){function n(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,n)}return i}function r(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?n(Object(i),!0).forEach(function(t){var n,r,a;n=e,r=t,a=i[t],(r=o(r))in n?Object.defineProperty(n,r,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[r]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):n(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}function o(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var a=i("d").Buffer,s=i("o").inspect,l=s&&s.custom||"inspect";e.exports=function(){var e;function t(){if(!(this instanceof t))throw TypeError("Cannot call a class as a function");this.head=null,this.tail=null,this.length=0}return e=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,i=""+t.data;t=t.next;)i+=e+t.data;return i}},{key:"concat",value:function(e){if(0===this.length)return a.alloc(0);for(var t,i,n=a.allocUnsafe(e>>>0),r=this.head,o=0;r;)t=r.data,i=o,a.prototype.copy.call(t,n,i),o+=r.data.length,r=r.next;return n}},{key:"consume",value:function(e,t){var i;return e<this.head.data.length?(i=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):i=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),i}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,i=1,n=t.data;for(e-=n.length;t=t.next;){var r=t.data,o=e>r.length?r.length:e;if(o===r.length?n+=r:n+=r.slice(0,e),0==(e-=o)){o===r.length?(++i,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=r.slice(o));break}++i}return this.length-=i,n}},{key:"_getBuffer",value:function(e){var t=a.allocUnsafe(e),i=this.head,n=1;for(i.data.copy(t),e-=i.data.length;i=i.next;){var r=i.data,o=e>r.length?r.length:e;if(r.copy(t,t.length-e,0,o),0==(e-=o)){o===r.length?(++n,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=r.slice(o));break}++n}return this.length-=n,t}},{key:l,value:function(e,t){return s(this,r(r({},t),{},{depth:0,customInspect:!1}))}}],function(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,o(n.key),n)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}()},w(e,t,i){var n=i("z");function r(e,t){a(e,t),o(e)}function o(e){e._writableState&&!e._writableState.emitClose||(!e._readableState||e._readableState.emitClose)&&e.emit("close")}function a(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var i=this,s=this._readableState&&this._readableState.destroyed,l=this._writableState&&this._writableState.destroyed;return s||l?t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(a,this,e)):n.nextTick(a,this,e)):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?i._writableState?i._writableState.errorEmitted?n.nextTick(o,i):(i._writableState.errorEmitted=!0,n.nextTick(r,i,e)):n.nextTick(r,i,e):t?(n.nextTick(o,i),t(e)):n.nextTick(o,i)})),this},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var i=e._readableState,n=e._writableState;i&&i.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}},n(e,t,i){var n=i("x").F.ERR_STREAM_PREMATURE_CLOSE;function r(){}e.exports=function e(t,i,o){if("function"==typeof i)return e(t,null,i);i||(i={}),a=o||r,s=!1,o=function(){if(!s){s=!0;for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];a.apply(this,t)}};var a,s,l=i.readable||!1!==i.readable&&t.readable,u=i.writable||!1!==i.writable&&t.writable,c=function(){t.writable||d()},p=t._writableState&&t._writableState.finished,d=function(){u=!1,p=!0,l||o.call(t)},f=t._readableState&&t._readableState.endEmitted,h=function(){l=!1,f=!0,u||o.call(t)},m=function(e){o.call(t,e)},g=function(){var e;return l&&!f?(t._readableState&&t._readableState.ended||(e=new n),o.call(t,e)):u&&!p?(t._writableState&&t._writableState.ended||(e=new n),o.call(t,e)):void 0},y=function(){t.req.on("finish",d)};return t.setHeader&&"function"==typeof t.abort?(t.on("complete",d),t.on("abort",g),t.req?y():t.on("request",y)):u&&!t._writableState&&(t.on("end",c),t.on("close",c)),t.on("end",h),t.on("finish",d),!1!==i.error&&t.on("error",m),t.on("close",g),function(){t.removeListener("complete",d),t.removeListener("abort",g),t.removeListener("request",y),t.req&&t.req.removeListener("finish",d),t.removeListener("end",c),t.removeListener("close",c),t.removeListener("finish",d),t.removeListener("end",h),t.removeListener("error",m),t.removeListener("close",g)}}},s(e){e.exports=function(){throw Error("Readable.from is not available in the browser")}},Kx(e,t,i){var n,r=i("x").F,o=r.ERR_MISSING_ARGS,a=r.ERR_STREAM_DESTROYED;function s(e){if(e)throw e}function l(e){e()}function u(e,t){return e.pipe(t)}e.exports=function(){for(var e,t,r=arguments.length,c=Array(r),p=0;p<r;p++)c[p]=arguments[p];var d=(e=c).length&&"function"==typeof e[e.length-1]?e.pop():s;if(Array.isArray(c[0])&&(c=c[0]),c.length<2)throw new o("streams");var f=c.map(function(e,r){var o,s,u,p,h,m,g=r<c.length-1;return o=r>0,u=s=function(e){t||(t=e),e&&f.forEach(l),g||(f.forEach(l),d(t))},p=!1,s=function(){p||(p=!0,u.apply(void 0,arguments))},h=!1,e.on("close",function(){h=!0}),void 0===n&&(n=i("n")),n(e,{readable:g,writable:o},function(e){if(e)return s(e);h=!0,s()}),m=!1,function(t){if(!h&&!m){if(m=!0,e.setHeader&&"function"==typeof e.abort)return e.abort();if("function"==typeof e.destroy)return e.destroy();s(t||new a("pipe"))}}});return c.reduce(u)}},G(e,t,i){var n=i("x").F.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,i,r){var o=null!=t.highWaterMark?t.highWaterMark:r?t[i]:null;if(null!=o){if(!(isFinite(o)&&Math.floor(o)===o)||o<0)throw new n(r?i:"highWaterMark",o);return Math.floor(o)}return e.objectMode?16:16384}}},Js(e,t,i){e.exports=i("q").EventEmitter},t(e,t,i){var n=i("K").Buffer,r=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;switch(this.encoding=function(e){var t=function(e){var t;if(!e)return"utf8";for(;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===r||!r(e)))throw Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=l,this.end=u,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=c,this.end=p,t=3;break;default:this.write=d,this.end=f;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,i=function(e,t){if((192&t[0])!=128)return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if((192&t[1])!=128)return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&(192&t[2])!=128)return e.lastNeed=2,"�"}}(this,e);return void 0!==i?i:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):void(e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length)}function l(e,t){if((e.length-t)%2==0){var i=e.toString("utf16le",t);if(i){var n=i.charCodeAt(i.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],i.slice(0,-1)}return i}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function u(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var i=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,i)}return t}function c(e,t){var i=(e.length-t)%3;return 0===i?e.toString("base64",t):(this.lastNeed=3-i,this.lastTotal=3,1===i?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-i))}function p(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function f(e){return e&&e.length?this.write(e):""}t.I=o,o.prototype.write=function(e){var t,i;if(0===e.length)return"";if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";i=this.lastNeed,this.lastNeed=0}else i=0;return i<e.length?t?t+this.text(e,i):this.text(e,i):t||""},o.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},o.prototype.text=function(e,t){var i=function(e,t,i){var n=t.length-1;if(n<i)return 0;var r=a(t[n]);return r>=0?(r>0&&(e.lastNeed=r-1),r):--n<i||-2===r?0:(r=a(t[n]))>=0?(r>0&&(e.lastNeed=r-2),r):--n<i||-2===r?0:(r=a(t[n]))>=0?(r>0&&(2===r?r=0:e.lastNeed=r-3),r):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=i;var n=e.length-(i-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},N(e,t,i){e.exports=function(e,t){if(n("noDeprecation"))return e;var i=!1;return function(){if(!i){if(n("throwDeprecation"))throw Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),i=!0}return e.apply(this,arguments)}};function n(e){try{if(!i.g.localStorage)return!1}catch(e){return!1}var t=i.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}},o(){},b(){}},t={};function i(n){var r=t[n];if(void 0!==r)return r.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,i),o.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t,n)=>{var r=(t,n)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,[n]:t[r]})};r(t,"get"),r(n,"value")},i.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}})(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var n={};(()=>{let e,t,r,o,a,s,l,u,c,p,d,f;function h(e){let t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,i])=>-1===t.indexOf(+e)).map(([e,t])=>t)}function m(e,t="|"){return e.map(e=>N(e)).join(t)}function g(e,t){return"bigint"==typeof t?t.toString():t}i.d(n,{TD:()=>pn,B:()=>po,h0:()=>u6,XP:()=>u5,v8:()=>pa,G7:()=>u3,Lu:()=>ce,vp:()=>cr,Jo:()=>ca,UP:()=>oz,rj:()=>pZ,VI:()=>oP,Ns:()=>oV,Ip:()=>aR,kt:()=>uY,KW:()=>u0,fK:()=>oM,wb:()=>cw,wv:()=>pp,yY:()=>ch,my:()=>a0,qQ:()=>o$,_:()=>ax,Qq:()=>aW,tY:()=>oL,rE:()=>aI,PD:()=>ck,lE:()=>pm,ss:()=>uK,kq:()=>uG,m_:()=>oD,O_:()=>ci,OE:()=>oj,oc:()=>cZ,oW:()=>pb,dK:()=>oJ,Ry:()=>cQ,Ng:()=>c2,Hg:()=>ct,L6:()=>p_,Ty:()=>pS,gP:()=>oB,py:()=>pR,YS:()=>uV,t1:()=>pC,jE:()=>pI,D_:()=>oN,jx:()=>pU,F:()=>pN,J_:()=>c3,hH:()=>p$,zC:()=>pL,_l:()=>u7,fu:()=>ak});let y=class Cached{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return void 0!==e&&(this._value=e(),this._getter=void 0),this._value}};function b(e){return new y(e)}function v(e){let t=+!!e.startsWith("^"),i=e.endsWith("$")?e.length-1:e.length;return e.slice(t,i)}function _(e,t,i){Object.defineProperty(e,t,{value:i,writable:!0,enumerable:!0,configurable:!0})}function w(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function E(e){return w(e._zod.def)??e._zod.def.shape}function S(e,t,i){Object.defineProperty(e,t,{get(){let e=i();return _(this,t,e),e},enumerable:!0,configurable:!0})}function T(e,t,i){t in e?_(e,t,i):e[t]=i}function R(e,t,i,n){let r=E(t);for(let o of i){let i=Object.getOwnPropertyDescriptor(r,o);i.enumerable&&(i.get?S(e,o,()=>{let e=t._zod.def.shape[o];return n?n(e,o):e}):T(e,o,n?n(i.value,o):i.value))}}function O(...e){let t={};for(let i of e)Object.assign(t,Object.getOwnPropertyDescriptors(i));return Object.defineProperties({},t)}let x="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function A(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let k=b(()=>{if(el.jitless||"u">typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch(e){return!1}});function C(e){if(!1===A(e))return!1;let t=e.constructor;if(void 0===t||"function"!=typeof t)return!0;let i=t.prototype;return!1!==A(i)&&!1!==Object.prototype.hasOwnProperty.call(i,"isPrototypeOf")}function P(e){return C(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}let I=new Set(["string","number","symbol"]);function U(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function z(e,t,i){let n=new e._zod.constr(t??e._zod.def);return(!t||i?.parent)&&(n._zod.parent=e),n}function L(e){if(!e)return{};if("string"==typeof e)return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");e.error=e.message}return(delete e.message,"string"==typeof e.error)?{...e,error:()=>e.error}:e}function N(e){return"bigint"==typeof e?e.toString()+"n":"string"==typeof e?`"${e}"`:`${e}`}let $={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-0x80000000,0x7fffffff],uint32:[0,0xffffffff],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},D={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function M(e,t){let i=E(e),n=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(i,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&n.push(e)}return n}function j(e,t){let i={};R(i,e,Reflect.ownKeys(E(e)));for(let e of Reflect.ownKeys(t)){let n=Object.getOwnPropertyDescriptor(t,e);n.enumerable&&(n.get?S(i,e,()=>t[e]):T(i,e,n.value))}return i}function B(e,t,i,n="partial"){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.${n}() cannot be used on object schemas containing refinements`);let o=i?new Set(M(t,i)):void 0,a={};return R(a,t,Reflect.ownKeys(E(t)),e&&((t,i)=>o&&!o.has(i)?t:new e({type:"optional",innerType:t}))),z(t,O(t._zod.def,{shape:a,checks:[]}))}function F(e,t=0){if(!0===e.aborted)return!0;for(let i=t;i<e.issues.length;i++)if(e.issues[i]?.continue!==!0)return!0;return!1}function q(e,t){return t.map(t=>(t.path??(t.path=[]),t.path.unshift(e),t))}function Z(e){return"string"==typeof e?e:e?.message}function W(e){let t=[];for(let i of e??[]){let e=i._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let n=e.maximum??e.length??e.size;n>=0&&t.push([n,i])}return t}function K(e,t,i){var n;for(let r=t;r<e.length;r++)(n=e[r]).schema??(n.schema=i)}function G(e,t,i){let n=e.inst?._zod?.traits;n?.has("$ZodType")&&(n.has("$ZodCheck")?e.schema??(e.schema=e.inst):e.schema=e.inst);let r=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,o=e.message?e.message:Z(e.inst?._zod.def?.error?.(e))??Z(r?.(e))??Z(t?.error?.(e))??Z(i.customError?.(e))??Z(i.localeError?.(e))??"Invalid input",a={};for(let t of Object.keys(e))"inst"!==t&&"schema"!==t&&"continue"!==t&&"input"!==t&&"__proto__"!==t&&(a[t]=e[t]);return a.path??(a.path=[]),a.message=o,t?.reportInput&&(a.input=e.input),a}let V=/[\uD800-\uDBFF]/;function H(e){let t=e.length;if(!V.test(e))return t;let i=t;for(let n=0;n<t-1;n++)(64512&e.charCodeAt(n))==55296&&(64512&e.charCodeAt(n+1))==56320&&(i--,n++);return i}function J(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function Y(...e){let[t,i,n]=e;return"string"==typeof t?{message:t,code:"custom",input:i,inst:n}:{...t}}function X(e,t,i,n=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:n,value:i}),i}function Q(e,t){for(let i in e){let n=e[i];Object.defineProperty(t,i,{configurable:!0,enumerable:!0,get(){return X(this,i,n(this))},set(e){X(this,i,e)}})}return t}let ee=!1,et={configurable:!0,get(){ee=!0}};function ei(t,i,n){let r=Object.getPrototypeOf(t._zod);if(i in r&&e!==t._zod){e=void 0;return}e=t._zod,Object.defineProperty(r,i,{configurable:!0,get(){Object.defineProperty(this,i,et);let e=ee;ee=!1;try{let t=n(this);return ee?delete this[i]:Object.defineProperty(this,i,{configurable:!0,writable:!0,value:t}),ee=ee||e,t}catch(t){throw delete this[i],ee=ee||e,t}},set(e){Object.defineProperty(this,i,{configurable:!0,writable:!0,value:e})}})}let en={value:void 0,enumerable:!1},er="captureStackTrace"in Error?Error:null;function eo(e,t,i,n){function r(e){this.def=e,this.constr=u,this.traits=new Set}r.prototype={};let o=i&&new WeakSet;function a(n,a){if(n._zod){if(n._zod.traits.has(e))return}else{en.value=new r(a);try{Object.defineProperty(n,"_zod",en)}finally{en.value=void 0}}if(n._zod.traits.add(e),t(n,a),o){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let a=r??e;if(!o.has(a)){o.add(a);for(let e in i){let t=Object.getOwnPropertyDescriptor(i,e);t.get?Object.defineProperty(a,e,{...t,enumerable:!1}):function(e,t,i){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?i:X(this,t,i.bind(this))},set(e){X(this,t,e)}})}(a,e,t.value)}}}let s=u.prototype;for(let e in s)Object.prototype.hasOwnProperty.call(s,e)&&(e in n||(n[e]=s[e].bind(n)))}let s=n?.Parent??Object;let l=class Definition extends s{};function u(e){let t=n?.Parent?function(e){let t=er;if(t){let i=t.stackTraceLimit;if("number"==typeof i){try{t.stackTraceLimit=0}catch{return er=null,new e}try{return new e}finally{t.stackTraceLimit=i}}}return new e}(l):this;a(t,e);let i=t._zod.deferred;if(i){for(let e of i)e();t._zod.deferred=void 0}let r=globalThis.__zod_globalConfig?.postProcessor;return r&&r(t),t}return Object.defineProperty(l,"name",{value:e}),Object.defineProperty(u,"init",{value:a}),Object.defineProperty(u,Symbol.hasInstance,{value:t=>!!n?.Parent&&t instanceof n.Parent||t?._zod?.traits?.has(e)}),Object.defineProperty(u,"name",{value:e}),u}let ea=class $ZodAsyncError extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}};let es=class $ZodEncodeError extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}};(ou=globalThis).__zod_globalConfig??(ou.__zod_globalConfig={});let el=globalThis.__zod_globalConfig;function eu(e){return e&&Object.assign(el,e),el}let ec=class $ZodCyclicError extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}};let ep="~memo",ed=[];function ef(e){return null!==e&&"object"==typeof e}function eh(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}let em=new WeakMap,eg=[],ey={alloc(e,i,n){let r=t;if(!r)return n;t=void 0;let o={value:n,issues:null};return r.set(i.value,o),eg.push(o),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,i=(e,i)=>{var n,r;let o;if("backward"!==i.direction&&(n=i,r=e.value,void 0!==(o=n[ep]?.backEdges)&&ef(r)&&o.has(r)))throw new ec;return t(e,i)};e._zod.parse=i,e._zod.run===t&&(e._zod.run=i)})},attach(e){var i;let n,r,o,a=!1;(i=e._zod).deferred??(i.deferred=[]),e._zod.deferred.push(()=>{let i=e._zod.parse,s=(l,u)=>{let c;if(void 0===n){let t=function e(t,i,n){var r,o;let a=em.get(t);if(void 0!==a)return 2*!!a;if(i.has(t))return 2;i.add(t);let s=0,l=t=>{if(2!==s&&t?._zod){let r=e(t,i,n);r>s&&(s=r)}},u=e=>{e>s&&(s=e)},c=t._zod.def;switch(c.type){case"object":{let t=w(c);u(t?((t,r)=>{let o=0;for(let a of Reflect.ownKeys(t)){let s=Object.getOwnPropertyDescriptor(t,a);if(r&&!s.enumerable)continue;let l=s.get?1:s.value?._zod?e(s.value,i,n):0;l>o&&(o=l)}return o})(t,!0):1),l(c.catchall);break}case"array":l(c.element);break;case"tuple":for(let e of c.items)l(e);l(c.rest);break;case"record":case"map":l(c.keyType),l(c.valueType);break;case"set":l(c.valueType);break;case"union":for(let e of c.options)l(e);break;case"intersection":l(c.left),l(c.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":l(c.innerType);break;case"pipe":l(c.in),l(c.out);break;case"function":l(c.input),l(c.output);break;case"lazy":{let r=c._cachedInner??(n?t._zod.innerType:void 0);u(r?e(r,i,!1):1);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let i=t.value;if(i&&"object"==typeof i){if(i._zod)l(i);else if(Array.isArray(i))for(let e of i)l(e)}}}return i.delete(t),r=t,1!==(o=s)&&em.set(r,2===o),o}(e,new Set,!1);if(0===t)return e._zod.parse=i,e._zod.run===s&&(e._zod.run=i),i(l,u);2===t||a?n=!0:a=!0}let p=l.value;if(!ef(p))return i(l,u);let d=u[ep];if(d||(d={buckets:new WeakMap,backEdges:void 0},u[ep]=d),r===u)c=o;else{var f;let t;(t=(f=d).buckets.get(e))||(t=new WeakMap,f.buckets.set(e,t)),c=t,r=u,o=c}let h=c.get(p);if(h)return l.value=h.value,h.issues?h.issues.length&&l.issues.push(...eh(h.issues)):(l.memo=!0,d.backEdges??(d.backEdges=new WeakSet),d.backEdges.add(h.value)),l;t=c;let m=eg.length,g=i(l,u);t=void 0;let y=eg.length>m?eg.pop():void 0;return g instanceof Promise?g.then(e=>(y&&(y.issues=e.issues.length?eh(e.issues):ed),e)):(y&&(y.issues=g.issues.length?eh(g.issues):ed),g)};e._zod.parse=s,e._zod.run===i&&(e._zod.run=s)})}},eb=/^[cC][0-9a-z]{6,}$/,ev=/^[0-9a-z]+$/,e_=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,ew=/^[0-9a-vA-V]{20}$/,eE=/^[A-Za-z0-9]{27}$/,eS=/^[a-zA-Z0-9_-]{21}$/,eT=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,eR=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,eO=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,ex=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,eA=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ek=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,eC=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,eP=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,eI=/^https?$/,eU=/^\+[1-9]\d{6,14}$/,ez="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",eL=RegExp(`^${ez}$`);function eN(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}let e$=/^[\s\S]{0,}$/,eD=/^-?\d+$/,eM=/^-?\d+(?:\.\d+)?$/,ej=/^(?:true|false)$/i,eB=/^null$/i,eF=/^[^A-Z]*$/,eq=/^[^a-z]*$/,eZ=eo("$ZodCheck",(e,t)=>{var i;e._zod??(e._zod={}),e._zod.def=t,(i=e._zod).onattach??(i.onattach=[])}),eW=e=>{let t=e.value;return null!=t&&void 0!==t.length},eK={number:"number",bigint:"bigint",object:"date"},eG=eo("$ZodCheckLessThan",(e,t)=>{eZ.init(e,t);let i=eK[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:eK[typeof n.value]??i,code:"too_big",maximum:"object"==typeof t.value?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),eV=eo("$ZodCheckGreaterThan",(e,t)=>{eZ.init(e,t);let i=eK[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:eK[typeof n.value]??i,code:"too_small",minimum:"object"==typeof t.value?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),eH=eo("$ZodCheckMultipleOf",(e,t)=>{eZ.init(e,t),e._zod.check=i=>{let n,r,o;if(typeof i.value!=typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof i.value?t.value!==BigInt(0)&&i.value%t.value===BigInt(0):0==(r=Math.round(n=i.value/t.value),o=4*Number.EPSILON*Math.max(Math.abs(n),1),Math.abs(n-r)<o?0:n-r))||i.issues.push({origin:typeof i.value,code:"not_multiple_of",divisor:t.value,input:i.value,inst:e,continue:!t.abort})}}),eJ=eo("$ZodCheckNumberFormat",(e,t)=>{eZ.init(e,t),t.format=t.format||"float64";let i=t.format?.includes("int"),n=i?"int":"number",[r,o]=$[t.format];e._zod.check=a=>{let s=a.value;if(i){if(!Number.isInteger(s))return void a.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});if(!Number.isSafeInteger(s))return void(s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}))}s<r&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),s>o&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),eY=eo("$ZodCheckMaxLength",(e,t)=>{var i;eZ.init(e,t),(i=e._zod.def).when??(i.when=eW),e._zod.check=i=>{let n=i.value,r=n.length;if(("string"==typeof n&&r>t.maximum?H(n):r)<=t.maximum)return;let o=J(n);i.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),eX=eo("$ZodCheckMinLength",(e,t)=>{var i;eZ.init(e,t),(i=e._zod.def).when??(i.when=eW),e._zod.check=i=>{let n=i.value,r=n.length;if(("string"==typeof n&&r>=t.minimum&&r<2*t.minimum?H(n):r)>=t.minimum)return;let o=J(n);i.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),eQ=eo("$ZodCheckLengthEquals",(e,t)=>{var i;eZ.init(e,t),(i=e._zod.def).when??(i.when=eW),e._zod.check=i=>{let n=i.value,r=n.length,o="string"==typeof n&&r>=t.length&&r<=2*t.length?H(n):r;if(o===t.length)return;let a=J(n),s=o>t.length;i.issues.push({origin:a,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),e0=eo("$ZodCheckStringFormat",(e,t)=>{var i,n;eZ.init(e,t),t.pattern?(i=e._zod).check??(i.check=i=>{t.pattern.lastIndex=0,t.pattern.test(i.value)||i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),e1=eo("$ZodCheckRegex",(e,t)=>{e0.init(e,t),e._zod.check=i=>{t.pattern.lastIndex=0,t.pattern.test(i.value)||i.issues.push({origin:"string",code:"invalid_format",format:"regex",input:i.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),e2=eo("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=eF),e0.init(e,t)}),e4=eo("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=eq),e0.init(e,t)}),e9=eo("$ZodCheckIncludes",(e,t)=>{eZ.init(e,t);let i=U(t.includes),n=new RegExp("number"==typeof t.position?`^.{${t.position},}${i}`:i);t.pattern=n,e._zod.check=i=>{i.value.includes(t.includes,t.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:e,continue:!t.abort})}}),e3=eo("$ZodCheckStartsWith",(e,t)=>{eZ.init(e,t);let i=RegExp(`^${U(t.prefix)}.*`);t.pattern??(t.pattern=i),e._zod.check=i=>{i.value.startsWith(t.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),e6=eo("$ZodCheckEndsWith",(e,t)=>{eZ.init(e,t);let i=RegExp(`.*${U(t.suffix)}$`);t.pattern??(t.pattern=i),e._zod.check=i=>{i.value.endsWith(t.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}});function e8(e,t,i){e.issues.length&&t.issues.push(...q(i,e.issues))}let e5=eo("$ZodCheckProperties",(e,t)=>{let i;eZ.init(e,t),X(e,Symbol.iterator,function*(){yield e},!1),e._zod.check=n=>{let r;if(null==n.value)return void n.issues.push({expected:"object",code:"invalid_type",input:n.value,inst:e});i??(i=Reflect.ownKeys(t.shape).map(e=>[e,t.shape[e]]));let o=n.value;for(let[e,t]of i){let i=t._zod.run({value:o[e],issues:[]},{});i instanceof Promise?(r??(r=[]),r.push(i.then(t=>e8(t,n,e)))):e8(i,n,e)}if(r)return Promise.all(r).then(()=>void 0)}}),e7=eo("$ZodCheckOverwrite",(e,t)=>{eZ.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});let te=class Doc{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{this.indent-=1}}write(e){if("function"==typeof e){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let t=e.split("\n").filter(e=>e),i=Math.min(...t.map(e=>e.length-e.trimStart().length));for(let e of t.map(e=>e.slice(i)).map(e=>" ".repeat(2*this.indent)+e))this.content.push(e)}compile(){let e=Function,t=this?.content??[""];return new e(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
3
3
  ${t.join("\n")}
4
4
  };`)(...Object.values(this.closed))}};let tt={major:4,minor:6,patch:7},ti=eo("$ZodType",(e,t)=>{var i;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=tt;let n=e._zod.def.checks,r=e._zod.traits.has("$ZodCheck")?[e,...n??[]]:n?.length?[...n]:[];for(let t of r)for(let i of t._zod.onattach)i(e);if(0===r.length)(i=e._zod).deferred??(i.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,i,n)=>{let r;if(t.memo)return t;let o=F(t);for(let a of i){if(a._zod.def.when){if(function(e,t=0){if(!0===e.aborted)return!0;for(let i=t;i<e.issues.length;i++)if(e.issues[i]?.continue===!1)return!0;return!1}(t)||!a._zod.def.when(t))continue}else if(o)continue;let i=t.issues.length,s=a._zod.check(t);if(s instanceof Promise&&n?.async===!1)throw new ea;if(r||s instanceof Promise)r=(r??Promise.resolve()).then(async()=>{await s,t.issues.length!==i&&(K(t.issues,i,e),o||(o=F(t,i)))});else{if(t.issues.length===i)continue;K(t.issues,i,e),o||(o=F(t,i))}}return r?r.then(()=>t):t},i=(i,n,o)=>{if(F(i))return i.aborted=!0,i;let a=t(n,r,o);if(a instanceof Promise){if(!1===o.async)throw new ea;return a.then(t=>e._zod.parse(t,o))}return e._zod.parse(a,o)};e._zod.run=(n,o)=>{if(o.skipChecks)return e._zod.parse(n,o);if("backward"===o.direction){let t=e._zod.parse({value:n.value,issues:[]},{...o,skipChecks:!0});return t instanceof Promise?t.then(e=>i(e,n,o)):i(t,n,o)}let a=e._zod.parse(n,o);if(a instanceof Promise){if(!1===o.async)throw new ea;return a.then(e=>t(e,r,o))}return t(a,r,o)}}},{get"~standard"(){return X(this,"~standard",tr(this),!1)},set"~standard"(e){X(this,"~standard",e)}}),tn=(e,t)=>e.issues.length?{issues:e.issues.map(e=>G(e,t,eu()))}:{value:e.value};function tr(e){return{validate:t=>{let i={async:!1};try{let n=e._zod.run({value:t,issues:[]},i);if(!(n instanceof Promise))return tn(n,i)}catch(e){}return async function(e,t){let i={async:!0};return tn(await e._zod.run({value:t,issues:[]},i),i)}(e,t)},vendor:"zod",version:1}}let to=eo("$ZodString",(e,t)=>{ti.init(e,t),e._zod.pattern=t.pattern??e$,e._zod.parse=(i,n)=>{if(t.coerce)try{i.value=String(i.value)}catch(e){}return"string"==typeof i.value||i.issues.push({expected:"string",code:"invalid_type",input:i.value,inst:e}),i}}),ta=eo("$ZodStringFormat",(e,t)=>{e0.init(e,t),to.init(e,t)}),ts=eo("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=eR),ta.init(e,t)}),tl=eo("$ZodUUID",(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=eO(e))}else t.pattern??(t.pattern=eO());ta.init(e,t)}),tu=eo("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=ex),ta.init(e,t)});function tc(e){try{if("u">typeof URL&&"function"==typeof URL.canParse)return URL.canParse(e);return new URL(e),!0}catch{return!1}}let tp=/[\t\n\r]/g;function td(e){return e.replace(tp,"")}let tf=eo("$ZodURL",(e,t)=>{ta.init(e,t),e._zod.check=i=>{try{var n,r;let o=i.value.trim(),a="normalize"in t||"hostname"in t||"protocol"in t?function(e,t){if(!t.normalize&&t.protocol?.source===eI.source&&!/^https?:\/\//i.test(e))return 1;try{if("u">typeof URL){let t=URL;if("function"==typeof t.parse)return t.parse(e)??2}return new URL(e)}catch{return 2}}(o,t):tc(o)||2;if(1===a)return void i.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:i.value,inst:e,continue:!t.abort});if(2===a)return void i.issues.push({code:"invalid_format",format:"url",input:i.value,inst:e,continue:!t.abort});if(!0===a){i.value=td(o);return}t.hostname&&((n=t.hostname).lastIndex=0,!n.test(a.hostname))&&i.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:i.value,inst:e,continue:!t.abort}),t.protocol&&((r=t.protocol).lastIndex=0,!r.test(a.protocol.endsWith(":")?a.protocol.slice(0,-1):a.protocol))&&i.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:i.value,inst:e,continue:!t.abort}),i.value=t.normalize?a.href:td(o);return}catch(n){i.issues.push({code:"invalid_format",format:"url",input:i.value,inst:e,continue:!t.abort})}}}),th=eo("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=RegExp("^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$","u")),ta.init(e,t)}),tm=eo("$ZodNanoID",(e,t)=>{var i;if(void 0!==t.length&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=void 0===t.length?eS:(i=t.length,RegExp(`^[a-zA-Z0-9_-]{${i}}$`))),ta.init(e,t)}),tg=eo("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=eb),ta.init(e,t)}),ty=eo("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=ev),ta.init(e,t)}),tb=eo("$ZodULID",(e,t)=>{t.pattern??(t.pattern=e_),ta.init(e,t)}),tv=eo("$ZodXID",(e,t)=>{t.pattern??(t.pattern=ew),ta.init(e,t)}),t_=eo("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=eE),ta.init(e,t)}),tw=eo("$ZodISODateTime",(e,t)=>{let i,n,r;t.pattern??(i=["Z"],t.offset&&i.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)"),n=`${eN({precision:t.precision,seconds:!0})}(?:${i.join("|")})`,r=t.local?`${n}|${eN({precision:t.precision})}`:n,t.pattern=RegExp(`^${ez}T(?:${r})$`)),ta.init(e,t)}),tE=eo("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=eL),ta.init(e,t)}),tS=eo("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=RegExp(`^${eN(t)}$`)),ta.init(e,t)}),tT=eo("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=eT),ta.init(e,t)}),tR=eo("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=eA),ta.init(e,t)}),tO=/^[0-9a-fA-F:.]+$/;function tx(e){return!!tO.test(e)&&tc(`http://[${e}]`)}let tA=eo("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=ek),ta.init(e,t),e._zod.check=i=>{tx(i.value)||i.issues.push({code:"invalid_format",format:"ipv6",input:i.value,inst:e,continue:!t.abort})}}),tk=eo("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=eC),ta.init(e,t)}),tC=eo("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=eP),ta.init(e,t),e._zod.check=i=>{!function(e){let t=e.split("/");if(2!==t.length)return!1;let[i,n]=t;if(!n)return!1;let r=Number(n);return`${r}`===n&&!(r<0)&&!(r>128)&&tx(i)}(i.value)&&i.issues.push({code:"invalid_format",format:"cidrv6",input:i.value,inst:e,continue:!t.abort})}});function tP(e){if(""===e)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}let tI=/^[0-9a-zA-Z+/]*={0,2}$/,tU=eo("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=tI),ta.init(e,t),e._zod.check=i=>{tP(i.value)||i.issues.push({code:"invalid_format",format:"base64",input:i.value,inst:e,continue:!t.abort})}}),tz=/^[A-Za-z0-9_-]*$/,tL=eo("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=tz),ta.init(e,t),e._zod.check=i=>{!function(e){if(!tz.test(e))return!1;let t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return tP(t.padEnd(4*Math.ceil(t.length/4),"="))}(i.value)&&i.issues.push({code:"invalid_format",format:"base64url",input:i.value,inst:e,continue:!t.abort})}}),tN=eo("$ZodE164",(e,t)=>{t.pattern??(t.pattern=eU),ta.init(e,t)}),t$=eo("$ZodJWT",(e,t)=>{ta.init(e,t),e._zod.check=i=>{!function(e,t=null){try{let i=e.split(".");if(3!==i.length)return!1;let[n]=i;if(!n)return!1;let r=JSON.parse(atob(n));if("typ"in r&&r?.typ!=="JWT"||!r.alg||t&&(!("alg"in r)||r.alg!==t))return!1;return!0}catch{return!1}}(i.value,t.alg)&&i.issues.push({code:"invalid_format",format:"jwt",input:i.value,inst:e,continue:!t.abort})}}),tD=eo("$ZodNumber",(e,t)=>{ti.init(e,t),e._zod.pattern=eM,e._zod.parse=(i,n)=>{if(t.coerce)try{i.value=Number(i.value)}catch(e){}let r=i.value;if("number"==typeof r&&!Number.isNaN(r)&&Number.isFinite(r))return i;let o="number"==typeof r?Number.isNaN(r)?"NaN":Number.isFinite(r)?void 0:String(r):void 0;return i.issues.push({expected:"number",code:"invalid_type",input:r,inst:e,...o?{received:o}:{}}),i}}),tM=eo("$ZodNumberFormat",(e,t)=>{eJ.init(e,t),tD.init(e,t)}),tj=eo("$ZodBoolean",(e,t)=>{ti.init(e,t),e._zod.pattern=ej,e._zod.parse=(i,n)=>{if(t.coerce)try{i.value=!!i.value}catch(e){}let r=i.value;return"boolean"==typeof r||i.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:e}),i}}),tB=eo("$ZodNull",(e,t)=>{ti.init(e,t),e._zod.pattern=eB,e._zod.values=new Set([null]),e._zod.parse=(t,i)=>{let n=t.value;return null===n||t.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),t}}),tF=eo("$ZodUnknown",(e,t)=>{ti.init(e,t),e._zod.parse=e=>e}),tq=eo("$ZodNever",(e,t)=>{ti.init(e,t),e._zod.parse=(t,i)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)}),tZ=eo("$ZodDate",(e,t)=>{ti.init(e,t),e._zod.parse=(i,n)=>{if(t.coerce)try{i.value=new Date(i.value)}catch(e){}let r=i.value,o=r instanceof Date;return o&&!Number.isNaN(r.getTime())||i.issues.push({expected:"date",code:"invalid_type",input:r,...o?{received:"Invalid Date"}:{},inst:e}),i}}),tW=e=>Array.isArray(e)?e.length:-1;function tK(e,t,i){e.issues.length&&t.issues.push(...q(i,e.issues)),t.value[i]=e.value}let tG=eo("$ZodArray",(e,t)=>{ti.init(e,t);let i=el.memoizer;i?.attach(e),e._zod.parse=(n,r)=>{let o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=i?i.alloc(e,n,Array(o.length),r):Array(o.length);let a=[],s=r?.abortEarly;for(let e=0;e<o.length;e++){let i=o[e],l=t.element._zod.run({value:i,issues:[]},r);if(l instanceof Promise)a.push(l.then(t=>tK(t,n,e)));else if(tK(l,n,e),s&&0!==l.issues.length&&F(l))break}return a.length?Promise.all(a).then(()=>n):n},function(e,t){let i=W(e._zod.def.checks);if(!i.length)return;let n=Math.min(...i.map(e=>e[0])),r=e._zod.parse;e._zod.parse=(i,o)=>{let a=t(i.value);if(a>n&&!o?.skipChecks&&o?.direction!=="backward"){for(let[t,n]of W(e._zod.def.checks))if(a>t&&n._zod.def.when(i)){let t=i.issues.length;return n._zod.check(i),i.issues[t].continue=!1,K(i.issues,t,e),i}}return r(i,o)}}(e,tW)});function tV(e,t,i,n,r,o){let a=i in n,s="optional"===o;if(a||!s||"optional"!==r){if(e.issues.length){if(void 0!==r&&s&&!a)return;t.issues.push(...q(i,e.issues))}if(!a&&void 0===r){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[i]});return}void 0===e.value?(a||"defaulted"===r&&!s)&&(t.value[i]=void 0):t.value[i]=e.value}}let tH=[];function tJ(e){var t;let i=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:tH,o=r.length?[...i,...r]:i;for(let t of o)if(!e.shape?.[t]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=Object.keys(t=e.shape).filter(e=>void 0!==t[e]._zod.optin&&"optional"===t[e]._zod.optout);return{...e,allKeys:o,symbolKeys:r,keySet:new Set(i),numKeys:i.length,optionalKeys:new Set(a)}}function tY(e,t,i,n,r,o,a){let s=[],l=r.keySet,u=r.catchall._zod,c=u.def.type,p=u.optin,d=u.optout,f=0;for(let r in t){if(a&&i.issues.length!==f){if(F(i,f))break;f=i.issues.length}if(l.has(r))continue;if("__proto__"===r){"never"===c&&s.push(r);continue}if("never"===c){s.push(r);continue}let o=u.run({value:t[r],issues:[]},n);o instanceof Promise?e.push(o.then(e=>tV(e,i,r,t,p,d))):tV(o,i,r,t,p,d)}return(s.length&&i.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:o,continue:!0}),e.length)?Promise.all(e).then(()=>i):i}let tX=eo("$ZodObject",(e,t)=>{let i;ti.init(e,t);let n=Object.getOwnPropertyDescriptor(t,"shape"),r=n?.get?n.get.raw:t.shape??{};if(r){let e=()=>{let i={...r};return Object.defineProperty(t,"shape",{value:i}),e.raw=i,i};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let o=b(()=>tJ(t));ei(e,"propValues",e=>{let t=e.def.shape,i={};for(let e in t){let n=t[e]._zod;if(n.values){for(let t of(Object.prototype.hasOwnProperty.call(i,e)||_(i,e,new Set),n.values))i[e].add(t);void 0!==n.optin&&i[e].add(void 0)}}return i});let a=t.catchall,s=el.memoizer;s?.attach(e),e._zod.parse=(t,n)=>{i??(i=o.value);let r=t.value;if(!A(r))return t.issues.push({expected:"object",code:"invalid_type",input:r,inst:e}),t;t.value=s?s.alloc(e,t,{},n):{};let l=[],u=i.shape,c=n?.abortEarly,p=t.issues.length;for(let e of i.allKeys){if(c&&t.issues.length!==p){if(F(t,p))break;p=t.issues.length}if("__proto__"===e)continue;let i=u[e],o=i._zod.optin,a=i._zod.optout,s=i._zod.run({value:r[e],issues:[]},n);s instanceof Promise?l.push(s.then(i=>tV(i,t,e,r,o,a))):tV(s,t,e,r,o,a)}return a?tY(l,r,t,n,o.value,e,!0===c):l.length?Promise.all(l).then(()=>t):t}}),tQ=eo("$ZodObjectJIT",(e,t)=>{let i,n;tX.init(e,t);let r=e._zod.parse,o=b(()=>tJ(t)),a=el.memoizer,s=!el.jitless,l=s&&k.value,u=t.catchall;e._zod.parse=(c,p)=>{n??(n=o.value);let d=c.value;return A(d)?s&&l&&p?.async===!1&&!0!==p.jitless?(i||(i=(t=>{let i=o.value,n=i.symbolKeys,r=new te(["payload","ctx"],{shape:t,inst:e,memo:a,syms:n}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,l=(e,t)=>`
5
5
  let ${e}_ab = false;
@@ -57,14 +57,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
57
57
  ${e}`:null===e?"\nnull":"symbol"==typeof e?`
58
58
  ${e.toString()}`:"object"==typeof e&&r9 in e?this._parseLoggerException(e,t):`
59
59
  ${JSON.stringify(e,null,2)}`}_parseLoggerException(e,t=1){let i=[];e.type&&i.push(`type=${e.type}`),e.details&&Object.entries(e.details).map(([e,t])=>i.push(`${e}=${t}`));let n=e.stack||e.reason||e.message,r=n===e.stack,o=function(e,t){let i,n=t.split("\n");try{({cause:i}=e)}catch{}if(null!=i&&"object"==typeof i&&r9 in i){var r;let e=(r=i).stack?String(r.stack):Error.prototype.toString.call(r),t=e.indexOf("\n at");if(-1!==t){let{len:i,offset:r}=function(e,t){for(let i=0;i<e.length-3;i++){let n=t.indexOf(e[i]);if(-1!==n){let r=t.length-n;if(r>3){let o=1,a=Math.min(e.length-i,r);for(;a>o&&e[i+o]===t[n+o];)o++;if(o>3)return{len:o,offset:i}}}}return{len:0,offset:0}}(n,e.slice(t+1).split("\n"));if(i>0){let e=i-2,t=` ... ${e} lines matching cause stack trace ...`;n.splice(r+1,e,o_.grey(t))}}}return n}(e,n);r&&(o[0]=e.message||o[0]),i.length&&(o[0]+=o_.gray(`(details: ${i.join(", ")})`));for(let e=1;e<o.length;e++)o[e]=o_.gray(o[e]);if(e.cause){let i=this._parseException(e.cause,t+1).trim().split("\n");o.push(o_.red(` CAUSE: ${o_.reset(i[0])}`),...i.slice(1))}return`
60
- ${o.map(e=>`${" ".repeat(2*t)}${e}`).join("\n")}`}};let oA=class Log{LEVELS=op;options;preferredFieldsMap;warningsOnceLogged=new Set;constructor(e={}){let t;if(this.options={...{level:(t=om.env.APIFY_LOG_LEVEL)?Number.isFinite(+t)?+t:op[t]?op[t]:+t:op.INFO,maxDepth:4,gradualLimitFactor:.5,maxStringLength:1e3,maxArrayLength:500,maxFields:20,preferredFields:[...r8],prefix:null,suffix:null,truncationSuffix:r6,truncationFlagKey:r3,logger:(e=>{switch(e){case od.JSON:return new ov;case od.TEXT:default:return new ox}})(function(){let e=om.env[rY]||od.TEXT;switch(e.toLowerCase()){case od.JSON.toLowerCase():return od.JSON;case od.TEXT.toLowerCase():return od.TEXT;default:return console.warn(`Unknown value for environment variable ${rY}: ${e}`),od.TEXT}}()),data:{}},...e},!op[this.options.level])throw Error('Options "level" must be one of log.LEVELS enum!');if("number"!=typeof this.options.maxDepth)throw Error('Options "maxDepth" must be a number!');if("number"!=typeof this.options.gradualLimitFactor)throw Error('Options "gradualLimitFactor" must be a number!');if("number"!=typeof this.options.maxStringLength)throw Error('Options "maxStringLength" must be a number!');if("number"!=typeof this.options.maxArrayLength)throw Error('Options "maxArrayLength" must be a number!');if("number"!=typeof this.options.maxFields)throw Error('Options "maxFields" must be a number!');if(!Array.isArray(this.options.preferredFields))throw Error('Options "preferredFields" must be an array!');if(this.options.prefix&&"string"!=typeof this.options.prefix)throw Error('Options "prefix" must be a string!');if(this.options.suffix&&"string"!=typeof this.options.suffix)throw Error('Options "suffix" must be a string!');if("string"!=typeof this.options.truncationSuffix)throw Error('Options "truncationSuffix" must be a string!');if("string"!=typeof this.options.truncationFlagKey)throw Error('Options "truncationFlagKey" must be a string!');if("object"!=typeof this.options.logger)throw Error('Options "logger" must be an object!');if("object"!=typeof this.options.data)throw Error('Options "data" must be an object!');this.preferredFieldsMap=Object.fromEntries(this.options.preferredFields.map((e,t)=>[e,t]))}_sanitizeData(e){return function e(t,i){let{maxDepth:n=1/0,gradualLimitFactor:r=1,maxStringLength:o=1/0,maxArrayLength:a=1/0,maxFields:s=1/0,preferredFieldsMap:l={},truncationSuffix:u=r6,truncationFlagKey:c=r3}=i;if("string"==typeof t)return t.length>o?function(e,t,i=r6){if(t=Math.floor(t),i.length>t)throw Error("suffix string cannot be longer than maxLength");return"string"==typeof e&&e.length>t&&(e=e.substr(0,t-i.length)+i),e}(t,o,u):t;if(["number","boolean","symbol","bigint"].includes(typeof t)||null==t||t instanceof Date)return t;if(t instanceof Error){let{name:e,message:i,stack:n,cause:r,...o}=t;t={name:e,message:i,stack:n,cause:r,...o,[r9]:!0}}let p=t=>e(t,{...i,maxDepth:n-1,maxStringLength:Math.max(Math.floor(o*r),u.length),maxArrayLength:Math.floor(a*r),maxFields:Math.floor(s*r)});if(Array.isArray(t)){if(n<=0)return"[array]";let e=t.slice(0,a).map(p);return t.length>a&&e.push(u),e}if("object"==typeof t&&null!==t){if(n<=0)return"[object]";let e=Reflect.ownKeys(t);e.sort((e,t)=>{let i=l[String(e)]??-1,n=l[String(t)]??-1;return -1===i&&-1===n?0:-1===i?1:-1===n?-1:i-n});let i={};return e.slice(0,s).forEach(e=>{i[e]=p(t[e])}),e.length>s&&(i[c]=!0),i}if("function"==typeof t)return"[function]";console.log(`WARNING: Object cannot be logged: ${t}`)}(e,{maxDepth:this.options.maxDepth,gradualLimitFactor:this.options.gradualLimitFactor,maxStringLength:this.options.maxStringLength,maxArrayLength:this.options.maxArrayLength,maxFields:this.options.maxFields,preferredFieldsMap:this.preferredFieldsMap,truncationSuffix:this.options.truncationSuffix,truncationFlagKey:this.options.truncationFlagKey})}getLevel(){return this.options.level}setLevel(e){if(!op[e])throw Error('Options "level" must be one of log.LEVELS enum!');this.options.level=e}internal(e,t,i,n){e>this.options.level||(i=Reflect.ownKeys(i={...this.options.data,...i}).length>0?this._sanitizeData(i):void 0,n=this._sanitizeData(n),this.options.logger.log(e,t,i,n,{prefix:this.options.prefix,suffix:this.options.suffix}))}setOptions(e){this.options={...this.options,...e}}getOptions(){return{...this.options}}child(e){let{prefix:t}=this.options;e.prefix&&(t=t?`${t}:${e.prefix}`:e.prefix);let i=e.data?{...this.options.data,...e.data}:this.options.data;return new Log({...this.options,...e,prefix:t,data:i})}error(e,t){this.internal(op.ERROR,e,t)}exception(e,t,i){this.internal(op.ERROR,t,i,e)}softFail(e,t){this.internal(op.SOFT_FAIL,e,t)}warning(e,t){this.internal(op.WARNING,e,t)}info(e,t){this.internal(op.INFO,e,t)}debug(e,t){this.internal(op.DEBUG,e,t)}perf(e,t){this.internal(op.PERF,e,t)}warningOnce(e){this.warningsOnceLogged.has(e)||(this.warningsOnceLogged.add(e),this.warning(e))}deprecated(e){this.warningOnce(e)}};let ok=new oA,oC={isNode:!1,fetchFailsWithCause:!1,platform:void 0,async compress(){throw Error("Request body compression is only available in Node.js.")},async createHttpAgents(){},streamToWeb(){throw Error("A Readable stream is only available in Node.js.")},unusedProxyHint(){},openBlobBody:e=>e};let oP=class ApifyClientError extends Error{};function oI(e){return e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}let oU=/at( async)? (?![A-Za-z]*HttpClient\.)([A-Za-z]+(Collection)?Client)\.(?!call \()([A-Za-z]+) \(/;let oz=class ApifyApiError extends oP{name;clientMethod;statusCode;type;attempt;httpMethod;path;originalStack;data;constructor(e,t){let i,n,r,o=e.data;if(ao(o)){let t=new TextDecoder().decode(e.data);try{o=JSON.parse(t)}catch{o=t}}if(o&&o.error){let{error:e}=o;i=e.message,n=e.type,r=e.data}else if(o){let e;try{e=JSON.stringify(o,null,2)}catch{e=`${o}`}i=`Unexpected error: ${e}`}super(i),this.name=this.constructor.name,this.clientMethod=this.#e(),this.statusCode=e.status,this.type=n,this.attempt=t,this.httpMethod=e.config?.method,this.path=this.#t(e);let a=this.stack;this.originalStack=a.slice(a.indexOf("\n")),this.stack=this.#i(),this.data=r}static fromResponse(e,t){return new(oF[e.status]??(e.status>=500?oB:ApifyApiError))(e,t)}#t(e){let t,i=e.config?.url;try{t=new URL(i)}catch{return i}return t.pathname+t.search}#e(){let e=this.stack.match(oU);return e?`${e[2]}.${e[4]}`:"unknown"}#i(){let{name:e,...t}=this,i=Object.entries(t).map(e=>{let[t,i]=e;return"originalStack"===t&&(t="stack"),` ${t}: ${i}`}).join("\n");return`${e}: ${this.message}
60
+ ${o.map(e=>`${" ".repeat(2*t)}${e}`).join("\n")}`}};let oA=class Log{LEVELS=op;options;preferredFieldsMap;warningsOnceLogged=new Set;constructor(e={}){let t;if(this.options={...{level:(t=om.env.APIFY_LOG_LEVEL)?Number.isFinite(+t)?+t:op[t]?op[t]:+t:op.INFO,maxDepth:4,gradualLimitFactor:.5,maxStringLength:1e3,maxArrayLength:500,maxFields:20,preferredFields:[...r8],prefix:null,suffix:null,truncationSuffix:r6,truncationFlagKey:r3,logger:(e=>{switch(e){case od.JSON:return new ov;case od.TEXT:default:return new ox}})(function(){let e=om.env[rY]||od.TEXT;switch(e.toLowerCase()){case od.JSON.toLowerCase():return od.JSON;case od.TEXT.toLowerCase():return od.TEXT;default:return console.warn(`Unknown value for environment variable ${rY}: ${e}`),od.TEXT}}()),data:{}},...e},!op[this.options.level])throw Error('Options "level" must be one of log.LEVELS enum!');if("number"!=typeof this.options.maxDepth)throw Error('Options "maxDepth" must be a number!');if("number"!=typeof this.options.gradualLimitFactor)throw Error('Options "gradualLimitFactor" must be a number!');if("number"!=typeof this.options.maxStringLength)throw Error('Options "maxStringLength" must be a number!');if("number"!=typeof this.options.maxArrayLength)throw Error('Options "maxArrayLength" must be a number!');if("number"!=typeof this.options.maxFields)throw Error('Options "maxFields" must be a number!');if(!Array.isArray(this.options.preferredFields))throw Error('Options "preferredFields" must be an array!');if(this.options.prefix&&"string"!=typeof this.options.prefix)throw Error('Options "prefix" must be a string!');if(this.options.suffix&&"string"!=typeof this.options.suffix)throw Error('Options "suffix" must be a string!');if("string"!=typeof this.options.truncationSuffix)throw Error('Options "truncationSuffix" must be a string!');if("string"!=typeof this.options.truncationFlagKey)throw Error('Options "truncationFlagKey" must be a string!');if("object"!=typeof this.options.logger)throw Error('Options "logger" must be an object!');if("object"!=typeof this.options.data)throw Error('Options "data" must be an object!');this.preferredFieldsMap=Object.fromEntries(this.options.preferredFields.map((e,t)=>[e,t]))}_sanitizeData(e){return function e(t,i){let{maxDepth:n=1/0,gradualLimitFactor:r=1,maxStringLength:o=1/0,maxArrayLength:a=1/0,maxFields:s=1/0,preferredFieldsMap:l={},truncationSuffix:u=r6,truncationFlagKey:c=r3}=i;if("string"==typeof t)return t.length>o?function(e,t,i=r6){if(t=Math.floor(t),i.length>t)throw Error("suffix string cannot be longer than maxLength");return"string"==typeof e&&e.length>t&&(e=e.substr(0,t-i.length)+i),e}(t,o,u):t;if(["number","boolean","symbol","bigint"].includes(typeof t)||null==t||t instanceof Date)return t;if(t instanceof Error){let{name:e,message:i,stack:n,cause:r,...o}=t;t={name:e,message:i,stack:n,cause:r,...o,[r9]:!0}}let p=t=>e(t,{...i,maxDepth:n-1,maxStringLength:Math.max(Math.floor(o*r),u.length),maxArrayLength:Math.floor(a*r),maxFields:Math.floor(s*r)});if(Array.isArray(t)){if(n<=0)return"[array]";let e=t.slice(0,a).map(p);return t.length>a&&e.push(u),e}if("object"==typeof t&&null!==t){if(n<=0)return"[object]";let e=Reflect.ownKeys(t);e.sort((e,t)=>{let i=l[String(e)]??-1,n=l[String(t)]??-1;return -1===i&&-1===n?0:-1===i?1:-1===n?-1:i-n});let i={};return e.slice(0,s).forEach(e=>{i[e]=p(t[e])}),e.length>s&&(i[c]=!0),i}if("function"==typeof t)return"[function]";console.log(`WARNING: Object cannot be logged: ${t}`)}(e,{maxDepth:this.options.maxDepth,gradualLimitFactor:this.options.gradualLimitFactor,maxStringLength:this.options.maxStringLength,maxArrayLength:this.options.maxArrayLength,maxFields:this.options.maxFields,preferredFieldsMap:this.preferredFieldsMap,truncationSuffix:this.options.truncationSuffix,truncationFlagKey:this.options.truncationFlagKey})}getLevel(){return this.options.level}setLevel(e){if(!op[e])throw Error('Options "level" must be one of log.LEVELS enum!');this.options.level=e}internal(e,t,i,n){e>this.options.level||(i=Reflect.ownKeys(i={...this.options.data,...i}).length>0?this._sanitizeData(i):void 0,n=this._sanitizeData(n),this.options.logger.log(e,t,i,n,{prefix:this.options.prefix,suffix:this.options.suffix}))}setOptions(e){this.options={...this.options,...e}}getOptions(){return{...this.options}}child(e){let{prefix:t}=this.options;e.prefix&&(t=t?`${t}:${e.prefix}`:e.prefix);let i=e.data?{...this.options.data,...e.data}:this.options.data;return new Log({...this.options,...e,prefix:t,data:i})}error(e,t){this.internal(op.ERROR,e,t)}exception(e,t,i){this.internal(op.ERROR,t,i,e)}softFail(e,t){this.internal(op.SOFT_FAIL,e,t)}warning(e,t){this.internal(op.WARNING,e,t)}info(e,t){this.internal(op.INFO,e,t)}debug(e,t){this.internal(op.DEBUG,e,t)}perf(e,t){this.internal(op.PERF,e,t)}warningOnce(e){this.warningsOnceLogged.has(e)||(this.warningsOnceLogged.add(e),this.warning(e))}deprecated(e){this.warningOnce(e)}};let ok=new oA,oC={isNode:!1,fetchFailsWithCause:!1,platform:void 0,async compress(){throw Error("Request body compression is only available in Node.js.")},async createHttpAgents(){},streamToWeb(){throw Error("A Readable stream is only available in Node.js.")},unusedProxyHint(){},openBlobBody:e=>e,openStreamBody(e){if(!function(){if(/^(Cloudflare-Workers$|Deno\/|Bun\/)/.test(globalThis.navigator?.userAgent??""))return!0;let e=!1;try{let t=new Request("https://api.apify.com",{method:"POST",body:new ReadableStream,get duplex(){return e=!0,"half"}});return e&&!t.headers.has("content-type")}catch{return!1}}())throw TypeError("This runtime cannot send a ReadableStream as a request body. Read it into a Blob or bytes first, for example with `await new Response(stream).blob()`.");return e}};let oP=class ApifyClientError extends Error{};function oI(e){return e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}let oU=/at( async)? (?![A-Za-z]*HttpClient\.)([A-Za-z]+(Collection)?Client)\.(?!call \()([A-Za-z]+) \(/;let oz=class ApifyApiError extends oP{name;clientMethod;statusCode;type;attempt;httpMethod;path;originalStack;data;constructor(e,t){let i,n,r,o=e.data;if(ao(o)){let t=new TextDecoder().decode(e.data);try{o=JSON.parse(t)}catch{o=t}}if(o&&o.error){let{error:e}=o;i=e.message,n=e.type,r=e.data}else if(o){let e;try{e=JSON.stringify(o,null,2)}catch{e=`${o}`}i=`Unexpected error: ${e}`}super(i),this.name=this.constructor.name,this.clientMethod=this.#e(),this.statusCode=e.status,this.type=n,this.attempt=t,this.httpMethod=e.config?.method,this.path=this.#t(e);let a=this.stack;this.originalStack=a.slice(a.indexOf("\n")),this.stack=this.#i(),this.data=r}static fromResponse(e,t){return new(oF[e.status]??(e.status>=500?oB:ApifyApiError))(e,t)}#t(e){let t,i=e.config?.url;try{t=new URL(i)}catch{return i}return t.pathname+t.search}#e(){let e=this.stack.match(oU);return e?`${e[2]}.${e[4]}`:"unknown"}#i(){let{name:e,...t}=this,i=Object.entries(t).map(e=>{let[t,i]=e;return"originalStack"===t&&(t="stack"),` ${t}: ${i}`}).join("\n");return`${e}: ${this.message}
61
61
  ${i}`}};let oL=class InvalidRequestError extends oz{};let oN=class UnauthorizedError extends oz{};let o$=class ForbiddenError extends oz{};let oD=class NotFoundError extends oz{};let oM=class ConflictError extends oz{};let oj=class RateLimitError extends oz{};let oB=class ServerError extends oz{};let oF={400:oL,401:oN,403:o$,404:oD,409:oM,429:oj},{localeError:oq}=ne();function oZ(e){return null===e?"null":Array.isArray(e)?"array":typeof e}let oW=/^Invalid input: expected (an array of .+|a typed array|an object|object|array|function|number|string|boolean)$/;function oK(e){switch(typeof e){case"string":if(""===e)return"''";return e.length>200?`${e.slice(0,200)}… (${e.length-200} more characters)`:e;case"number":case"boolean":return String(e);case"bigint":return`${e}n`;default:return}}function oG(e){if("number"==typeof e&&Number.isNaN(e))return"received NaN";if(""===e)return"received an empty string";let t=oK(e);return void 0===t?`received ${oZ(e)}`:`received the ${oZ(e)} \`${t}\``}let oV=class ArgumentValidationError extends Error{issues;cause;constructor(e,t,i){super(function(e,t,i){let n=[],r={total:0};for(let i of e.issues)!function e(t,i,n,r,o){let a=[...n,...t.path];if("invalid_union"===t.code){let n=t.errors.map(e=>e.reduce((e,t)=>Math.max(e,function e(t,i){let n=i+t.path.length;if("invalid_union"===t.code){let i=-1;for(let r of t.errors)for(let t of r)i=Math.max(i,e(t,n));return i}return n}(t,a.length)),-1)),s=Math.max(...n);for(let[l,u]of t.errors.entries())if(n[l]===s)for(let t of u)e(t,i,a,r,o);return}if(o.total+=1,r.length>=10)return;let s=a.length?` at \`${function(e){let t="";for(let i of e)"number"==typeof i?t+=`[${i}]`:t+=t?`.${String(i)}`:String(i);return t}(a)}\``:"",l=function(e,t){let i=e;for(let e of t){if(null===i||"object"!=typeof i)return;i=i[e]}return i}(i,a),u=oK(l),c=function(e,t){if("invalid_type"===e.code){if("number"===e.expected&&"number"==typeof t)return"Invalid input: expected a finite number";if("date"===e.expected&&"[object Date]"===Object.prototype.toString.call(t))return"Invalid input: expected a valid date"}return e.message}(t,l),p="",d=oW.exec(c),f=/, received (\S+)$/.exec(c),h=d?.[1].startsWith("an array of")?"array":d?.[1];d&&h!==(Number.isNaN(l)?"NaN":oZ(l))?c+=`, ${oG(l)}`:f&&f[1]===oZ(l)&&void 0!==u?c=`${c.slice(0,f.index)}, ${oG(l)}`:void 0===u||c.endsWith(`received ${u}`)||(p=`, got \`${u}\``),r.push(`${c}${s}${p}`)}(i,t,[],n,r);let o=i?n.map(e=>`${e} in \`${i}\``):[...n],a=r.total-n.length;return a>0&&o.push(`... and ${a} more problem${1===a?"":"s"}`),o.join("\n")}(e,t,i),{cause:e}),this.name="ArgumentValidationError",this.issues=e.issues,this.cause=e}};function oH(e,t,i){let n=t.safeParse(e,{error:oq});if(!n.success)throw new oV(n.error,e,i);return n.data}rD(e=>"object"==typeof e&&null!==e,{error:"Invalid input: expected object"});let oJ=class ResponseValidationError extends oP{issues;method;url;constructor(e,t,i){let n=i.method.toUpperCase(),r=new oV(e,t).message;super(`Response from ${n} ${i.url} does not match the API schema:
62
62
  ${r}
63
- The API returned something its OpenAPI specification does not describe. Please report this at https://github.com/apify/apify-client-js/issues.`,{cause:e}),this.name="ResponseValidationError",this.issues=e.issues,this.method=n,this.url=i.url}};var oY=JSON.parse('{"rE":"3.0.0-beta.115"}'),oX=i("z");let oQ=new TextEncoder,{rE:o0}=oY,o1=["audio/","image/","video/"],o2=new Set(["application/epub+zip","application/gzip","application/java-archive","application/vnd.android.package-archive","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.rar","application/x-7z-compressed","application/x-bzip","application/x-bzip2","application/x-gzip","application/x-rar-compressed","application/x-xz","application/x-zip-compressed","application/zip","application/zstd","font/woff","font/woff2"]),o4=new Set(["audio/aiff","audio/basic","audio/l16","audio/l24","audio/midi","audio/vnd.wave","audio/wav","audio/wave","audio/x-aiff","audio/x-wav","image/bmp","image/tiff","image/vnd.adobe.photoshop","image/vnd.microsoft.icon","image/x-icon","image/x-ms-bmp"]),o9=["+json","+xml"];function o3(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let o6=rD(o3,{error:"Invalid input: expected an object"}),{localeError:o8}=ne(),o5=new rc({type:"object",shape:{data:rn()}??{},...L(void 0)});function o7(e,t){let{method:i="GET",url:n=""}=e.config,r=o5.safeParse(e.data,{error:o8});if(!r.success)throw new oJ(r.error,e.data,{method:i,url:n});let{data:o}=r.data,a=t.safeParse(o,{error:o8});if(!a.success)throw new oJ(a.error,o,{method:i,url:n});return a.data}function ae(e){if(!(e instanceof oD))throw e}function at(e,t){if(!t)throw e;ae(e)}function ai(e){if(e){var t=oQ.encode(JSON.stringify(e));let i="";for(let e=0;e<t.length;e+=32768)i+=String.fromCharCode(...t.subarray(e,e+32768));return btoa(i)}}function an(e){return"string"==typeof e?oQ.encode(e):ao(e)?ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e):void 0}function ar(e){return void 0!==oX?oX.env?.[e]:void 0}function ao(e){return ArrayBuffer.isView(e)?!as(e,"DataView"):as(e,"ArrayBuffer")}function aa(e){return as(e,"Blob")||as(e,"File")}function as(e,t){return Object.prototype.toString.call(e)===`[object ${t}]`}function al(e){return as(e,"ReadableStream")}function au(e){if(null===e||"object"!=typeof e)return!1;let{on:t,pipe:i}=e;return"function"==typeof t&&"function"==typeof i}r5=function(e,t){if("object"!==oI(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!==oI(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(Symbol.asyncIterator,"string"),r="symbol"===oI(r5)?r5:String(r5);let ac=class RequestQueuePaginationIterator{#n;#r;#o;#a;constructor(e){this.#n=e.maxPageLimit,this.#o=e.limit,this.#a=e.cursor,this.#r=e.getPage}async *[r](){let e=this.#a,t=0;for(;;){let i=this.#o?Math.min(this.#n,this.#o-t):this.#n,n=await this.#r({limit:i,cursor:e});if(0===n.items.length||(yield n,t+=n.items.length,this.#o&&t>=this.#o||!n.nextCursor))return;e=n.nextCursor}}};function ap(e,t){return(0===e&&(e=void 0),0===t&&(t=void 0),void 0===e)?t:void 0===t?e:Math.min(e,t)}let ad={limit:n6().min(0).optional(),offset:n6().min(0).optional(),chunkSize:n6().positive().optional()};function af(e,t){for(let[i,n]of Object.entries(t??{}))if(void 0!==n){if(Array.isArray(n)){e.searchParams.set(i,n.join(","));continue}e.searchParams.set(i,String(n))}return e}let ah=nU().nonempty().refine(e=>"."!==e&&".."!==e,{error:"URL path must not contain dot segments"});function am(e){return encodeURIComponent(oH(e,ah))}function ag(e){return Array.isArray(e)?e.map(am).join("/"):e}async function ay(e,t){return new Promise(i=>{if(t?.aborted)return void i();let n=()=>{clearTimeout(r),i()},r=setTimeout(()=>{t?.removeEventListener("abort",n),i()},e);t?.addEventListener("abort",n,{once:!0})})}let ab=new Uint8Array(256);ab[9]|=2,ab[32]|=2,ab[59]|=4,ab[44]|=8;for(let e=128;e<=255;e++)ab[e]|=1;for(let e of"!#$%&'*+-.^_`|~")ab[e.charCodeAt(0)]|=16;for(let e=48;e<=57;e++)ab[e]|=16;for(let e=65;e<=90;e++)ab[e]|=17;for(let e=97;e<=122;e++)ab[e]|=16;let av=((f=function(){}).prototype=Object.create(null),f),a_="application/json",aw=[RegExp(`^${a_}`,"i"),/^application\/.*xml$/i,/^text\//i],aE=rD(e=>"object"==typeof e&&null!==e&&"string"==typeof e.contentEncoding&&"function"==typeof e.compress,{error:"Invalid input: expected an HttpCompressor"}),aS=rp({quality:n5().min(0).max(11).default(6)});let aT=class BrotliHttpCompressor{contentEncoding="br";#s;constructor(e={}){let{quality:t}=oH(e,aS,"BrotliHttpCompressorOptions");this.#s=t}async compress(e){return oC.compress(e,{algorithm:"br",quality:this.#s})}};let aR=rp({quality:n5().min(1).max(9).default(6)});let aO=class GzipHttpCompressor{contentEncoding="gzip";#s;constructor(e={}){let{quality:t}=oH(e,aR,"GzipHttpCompressorOptions");this.#s=t}async compress(e){return oC.compress(e,{algorithm:"gzip",quality:this.#s})}};let ax=rp({quality:n5().min(1).max(19).default(3)});let aA=class ZstdHttpCompressor{contentEncoding="zstd";#s;constructor(e={}){let{quality:t}=oH(e,ax,"ZstdHttpCompressorOptions");this.#s=t}async compress(e){return oC.compress(e,{algorithm:"zstd",quality:this.#s})}};let ak=rh([rw(["brotli","gzip","zstd"]),aE]);function aC(e){if("string"!=typeof e)return e;switch(e){case"gzip":return new aO;case"brotli":return new aT;case"zstd":return new aA}}let aP=class InvalidResponseBodyError extends oP{code;response;constructor(e,t){super(`Response body could not be parsed.
64
- Cause:${t.message}`),this.name=this.constructor.name,this.code="invalid-response-body",this.response=e,this.cause=t}};let aI=n6().gt(0);let aU=class Statistics{calls=0;requests=0;rateLimitErrors=[];addRateLimitError(e){oH(e,aI);let t=e-1;this.#l(t),this.rateLimitErrors[t]++}#l(e){if(this.rateLimitErrors.length<=e)for(let t=0;t<=e;t++)"number"!=typeof this.rateLimitErrors[t]&&(this.rateLimitErrors[t]=0)}};let az=rh([rw(["short","medium","long","noTimeout"]),n6().positive()]).optional(),aL=rj(AbortSignal).optional(),aN={timeoutSecs:az,signal:aL},a$=rp(aN);var aD=i("d").Buffer;let aM="application/json",aj="application/x-www-form-urlencoded",aB={maxRetries:n6().int().nonnegative(),minDelayBetweenRetriesMillis:n6().nonnegative(),timeoutShortSecs:n6().positive(),timeoutMediumSecs:n6().positive(),timeoutLongSecs:n6().positive(),timeoutMaxSecs:n6().positive()},aF=rd(aB).partial(),aq=new Set(["FormData","ReadableStream"]);let aZ=class HttpClient{stats;logger;maxRetries;minDelayBetweenRetriesMillis;timeoutMillis;timeoutMaxMillis;httpCompressor;defaultHeaders;constructor(e={}){oH(e,aF,"HttpClientOptions"),this.stats=e.stats??new aU,this.logger=e.logger??ok.child({prefix:"ApifyClient"}),this.maxRetries=e.maxRetries??8,this.minDelayBetweenRetriesMillis=e.minDelayBetweenRetriesMillis??500,this.timeoutMillis={short:(e.timeoutShortSecs??5)*1e3,medium:(e.timeoutMediumSecs??30)*1e3,long:(e.timeoutLongSecs??360)*1e3},this.timeoutMaxMillis=(e.timeoutMaxSecs??360)*1e3,this.httpCompressor=aC(e.compression??"brotli");let t={},i=e.workflowKey||ar("APIFY_WORKFLOW_KEY");if(i&&(t["X-Apify-Workflow-Key"]=i),oC.platform){var n;let i=!!ar("APIFY_IS_AT_HOME"),r=`ApifyClient/${o0} (${oC.platform}); isAtHome/${i}`;e.userAgentSuffix&&(r+=`; ${(Array.isArray(n=e.userAgentSuffix)?n:[n]).join("; ")}`),t["User-Agent"]=r}e.token&&(t.Authorization=`Bearer ${e.token}`),this.defaultHeaders=aK(t,e.headers)}setDefaultAuthorization(e){void 0===aW(this.defaultHeaders,"authorization")&&(this.defaultHeaders.Authorization=`Bearer ${e}`)}isTimeoutError(e){return e instanceof Error&&"TimeoutError"===e.name}isRetryableTransportError(e){return!1}async close(){}async sendRequest(e){throw Error(`Implement sendRequest() to send ${e.method} ${e.url}, or override call() entirely.`)}async call(e){e.signal?.throwIfAborted(),this.stats.calls++;let{headers:t,body:i}=await this.prepareRequest(e),n=this.buildUrl(e.url,e.params);return this.#u(async(r,o)=>this.#c({config:e,url:n,headers:t,body:i,attempt:o,stopRetrying:r}),e.signal)}async prepareRequest(e){let t=aK(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Authorization",i=aW(e,"authorization");if("Authorization"===t||void 0===i)return e;let n={...e};return aG(n,"authorization"),aK(n,{[t]:i})}(this.defaultHeaders,e.authorizationHeader),e.headers),i=function(e,t,i){if(null!=e){if(au(e))return e;if(aa(e))return void 0===aW(t,"content-type")&&e.type&&(t["Content-Type"]=e.type),e;if(ao(e))return!oC.isNode||aD.isBuffer(e)?e:ArrayBuffer.isView(e)?aD.from(e.buffer,e.byteOffset,e.byteLength):aD.from(e);if("string"==typeof e)return e;if("object"==typeof e){var n,r;if(e instanceof URLSearchParams)return void 0===aW(t,"content-type")&&(t["Content-Type"]=`${aj};charset=utf-8`),e.toString();let o=(n=e,Object.prototype.toString.call(n).slice(8,-1));if(aq.has(o))throw TypeError(`Unsupported request body type: ${o}`);void 0===aW(t,"content-type")&&(t["Content-Type"]=aM);let a=aW(t,"content-type");if(aV(a)===aj){let t,i;return r=e,t=new URLSearchParams,i=(e,n)=>{if(null!=n)if(n instanceof Date)t.append(e,n.toISOString());else if(ao(n)){var r;t.append(e,(ArrayBuffer.isView(r=n)?aD.from(r.buffer,r.byteOffset,r.byteLength):aD.from(r)).toString("base64"))}else if(Array.isArray(n)){let t=n.some(aJ);n.forEach((n,r)=>i(t?`${e}[${r}]`:`${e}[]`,n))}else"object"==typeof n?Object.entries(n).forEach(t=>{let[n,r]=t;return i(`${e}[${n}]`,r)}):t.append(e,String(n))},Object.entries(r).forEach(e=>{let[t,n]=e;return i(t,n)}),t.toString()}return JSON.stringify(e,i&&aV(a)===aM?aH:void 0)}throw TypeError(`Unsupported request body type: ${typeof e}`)}}(e.data,t,e.stringifyFunctions),n=e.compression??this.httpCompressor,r=n&&function(e,t){if(void 0===e||!oC.isNode||void 0!==aW(t,"content-encoding")||!function(e){if(!e)return!0;let t=e.split(";",1)[0].trim().toLowerCase();return!!(o4.has(t)||o9.some(e=>t.endsWith(e)))||!o2.has(t)&&!o1.some(e=>t.startsWith(e))}(aW(t,"content-type")))return;let i=an(e);return i&&i.byteLength>=1024?i:void 0}(i,t);return r&&(i=await n.compress(aD.from(r.buffer,r.byteOffset,r.byteLength)),aG(t=aK(t,{"Content-Encoding":n.contentEncoding}),"content-length")),aa(i)&&oC.isNode&&(t=aK(t,{"Content-Length":String(i.size)})),{headers:t,body:i}}buildUrl(e,t){let i=[];for(let[e,n]of Object.entries(t??{}))void 0!==n&&(n instanceof Date?i.push([e,n.toISOString()]):"boolean"==typeof n?i.push([e,String(Number(n))]):i.push([e,String(n)]));if(0===i.length)return e;let n=new URLSearchParams(i).toString();return`${e}${e.includes("?")?"&":"?"}${n}`}computeTimeoutMillis(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"medium";if("noTimeout"===t)return;let i="number"==typeof t?1e3*t:this.timeoutMillis[t];return i>this.timeoutMaxMillis&&this.logger.warningOnce(`The requested timeout of ${i/1e3}s exceeds timeoutMaxSecs (${this.timeoutMaxMillis/1e3}s) and is capped at it. Raise timeoutMaxSecs on the client to allow longer request timeouts.`),Math.min(i*2**(e-1),this.timeoutMaxMillis)}async #u(e,t){let i=!0,n=()=>{i=!1};for(let r=1;r<=this.maxRetries;r++){t?.throwIfAborted();try{return await e(n,r)}catch(e){if(t?.throwIfAborted(),!i)throw e;this.#p(e,r)}let o=this.minDelayBetweenRetriesMillis*2**(r-1)*(1+Math.random());await ay(o,t)}return t?.throwIfAborted(),e(n,this.maxRetries+1)}async #c(e){let t,i,n,{config:r,url:o,headers:a,body:s,attempt:l,stopRetrying:u}=e;this.stats.requests++;let c=au(r.data),p=aa(s)?oC.openBlobBody(s,e=>{t={error:e}}):s;try{i=await this.sendRequest({method:r.method,url:o,headers:a,body:p,timeoutMillis:this.computeTimeoutMillis(l,r.timeoutSecs),stream:"stream"===r.responseType,followRedirects:r.followRedirects??!0,signal:r.signal})}catch(e){if(r.signal?.throwIfAborted(),t)throw u(),function(e,t){if(!(e instanceof Error)||void 0!==e.cause)return e;let i=new Set;for(let n=t;n instanceof Error&&!i.has(n);n=n.cause){if(n===e)return e;i.add(n)}return e.cause=t,e}(t.error,e);throw this.#d(e,r,u),e}finally{p!==s&&au(p)&&p.destroy()}let d=i.status>=300,f=d&&this.#f(i.status,r.retryStatusCodes),h=d&&!1===r.throwOnErrorStatus&&(!f||c||l>this.maxRetries);au(i.body)&&(i.body=oC.streamToWeb(i.body)),d&&!h&&al(i.body)&&(i.body=await new Response(i.body).arrayBuffer().catch(()=>void 0)),ao(i.body)&&(i.body=function(e){if(oC.isNode&&aD.isBuffer(e))return e;let t=an(e);return oC.isNode?aD.from(t.buffer,t.byteOffset,t.byteLength):t}(i.body));try{n=this.#h(i,r)}catch(e){if(!d)throw u(),e;n=i.body}let m={status:i.status,headers:i.headers,data:n,config:r};if(!d||(429===i.status&&!1!==r.throwOnErrorStatus&&this.stats.addRateLimitError(l),h))return m;let g=oz.fromResponse(m,l);throw f?c&&(this.#m(),u()):u(),g}#h(e,t){let{body:i}=e;if("stream"===t.responseType||"buffer"===t.responseType||void 0===i||!ao(i))return i;if(0!==i.byteLength)try{var n;return function(e,t){var i;let n,r;try{let e=function(e){let t=e.length,i=0;for(;(2&ab[e.charCodeAt(i)])!=0;)i++;let n=i,r=0,o=-1,a=0;for(;n<t;){let t=e.charCodeAt(n),i=ab[t];if((4&i)!=0){a|=8&i;break}(2&i)!=0?-1===o&&(o=n):o=-1,r|=65280&t|i,n++}let s=-1===o?n:o,l=e.slice(i,s),u=(65281&r)==0?l:l.toLowerCase();return n===t||0!==a?{type:u,index:n,parameters:new av}:function(e,t,i,n){let r=new av;e:for(;i<n;){for(i++;(2&ab[e.charCodeAt(i)])!=0;)i++;let t=i,o=0,a=-1;for(;i<n;){let s=e.charCodeAt(i),l=ab[s];if((4&l)!=0){if((8&l)!=0)break e;continue e}if(61===s){let s=-1===a?i:a,l=e.slice(t,s),u=(65281&o)==0?l:l.toLowerCase();for(i++;(2&ab[e.charCodeAt(i)])!=0;)i++;if(i<n&&34===e.charCodeAt(i)){let t=++i,o=!1;for(;i<n;){let a=e.charCodeAt(i);if(34===a){void 0===r[u]&&(r[u]=o?function(e,t,i){let n="";for(let r=t;r<i;r++)92===e.charCodeAt(r)&&(n+=e.slice(t,r),t=++r);return n+e.slice(t,i)}(e,t,i):e.slice(t,i)),i++;let a=0;for(;i<n;){let t=ab[e.charCodeAt(i)];if((4&t)!=0){a=8&t;break}i++}if(0!==a)break e;continue e}if(92===a&&i+1<n){o=!0,i+=2;continue}i++}continue e}let c=i,p=0,d=-1;for(;i<n;){let t=ab[e.charCodeAt(i)];if((4&t)!=0){p=8&t;break}(2&t)!=0?-1===d&&(d=i):d=-1,i++}if(void 0===r[u]){let t=-1===d?i:d;r[u]=e.slice(c,t)}if(0!==p)break e;continue e}(2&l)!=0?-1===a&&(a=i):a=-1,o|=65280&s|l,i++}}return{type:t,index:i,parameters:r}}(e,u,n,t)}(t);n=e.type,r=e.parameters.charset}catch{return e}if(!((i=n)&&aw.some(e=>e.test(i))))return e;let o=function(e){try{return new TextDecoder(e,{ignoreBOM:!0})}catch{return}}(r);if(!o)return e;let a=o.decode(e);return n===a_?JSON.parse(a):a}(i,(n=e.headers["content-type"],(Array.isArray(n)?n[0]:n)??""))}catch(t){throw new aP(e,t)}}#d(e,t,i){t.doNotRetryTimeouts&&this.isTimeoutError(e)||!1===t.retryTransportErrors||!this.isRetryableTransportError(e)?i():au(t.data)&&(this.#m(),i())}#f(e,t){return t?t.includes(e):429===e||e>=500}#m(){this.logger.warningOnce("Request body was a stream - retrying will not work, as part of it was already consumed."),this.logger.warningOnce("If you want Apify client to handle retries for you, collect the stream into a buffer before sending it.")}#p(e,t){if(t===Math.round(this.maxRetries/2)){let{stack:i,cause:n}=e,r=n instanceof Error?`
63
+ The API returned something its OpenAPI specification does not describe. Please report this at https://github.com/apify/apify-client-js/issues.`,{cause:e}),this.name="ResponseValidationError",this.issues=e.issues,this.method=n,this.url=i.url}};var oY=JSON.parse('{"rE":"3.0.0-beta.116"}'),oX=i("z");let oQ=new TextEncoder,{rE:o0}=oY,o1=["audio/","image/","video/"],o2=new Set(["application/epub+zip","application/gzip","application/java-archive","application/vnd.android.package-archive","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.rar","application/x-7z-compressed","application/x-bzip","application/x-bzip2","application/x-gzip","application/x-rar-compressed","application/x-xz","application/x-zip-compressed","application/zip","application/zstd","font/woff","font/woff2"]),o4=new Set(["audio/aiff","audio/basic","audio/l16","audio/l24","audio/midi","audio/vnd.wave","audio/wav","audio/wave","audio/x-aiff","audio/x-wav","image/bmp","image/tiff","image/vnd.adobe.photoshop","image/vnd.microsoft.icon","image/x-icon","image/x-ms-bmp"]),o9=["+json","+xml"];function o3(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let o6=rD(o3,{error:"Invalid input: expected an object"}),{localeError:o8}=ne(),o5=new rc({type:"object",shape:{data:rn()}??{},...L(void 0)});function o7(e,t){let{method:i="GET",url:n=""}=e.config,r=o5.safeParse(e.data,{error:o8});if(!r.success)throw new oJ(r.error,e.data,{method:i,url:n});let{data:o}=r.data,a=t.safeParse(o,{error:o8});if(!a.success)throw new oJ(a.error,o,{method:i,url:n});return a.data}function ae(e){if(!(e instanceof oD))throw e}function at(e,t){if(!t)throw e;ae(e)}function ai(e){if(e){var t=oQ.encode(JSON.stringify(e));let i="";for(let e=0;e<t.length;e+=32768)i+=String.fromCharCode(...t.subarray(e,e+32768));return btoa(i)}}function an(e){return"string"==typeof e?oQ.encode(e):ao(e)?ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e):void 0}function ar(e){return void 0!==oX?oX.env?.[e]:void 0}function ao(e){return ArrayBuffer.isView(e)?!as(e,"DataView"):as(e,"ArrayBuffer")}function aa(e){return as(e,"Blob")||as(e,"File")}function as(e,t){return Object.prototype.toString.call(e)===`[object ${t}]`}function al(e){return as(e,"ReadableStream")}function au(e){if(null===e||"object"!=typeof e)return!1;let{on:t,pipe:i}=e;return"function"==typeof t&&"function"==typeof i}function ac(e){return au(e)||al(e)}r5=function(e,t){if("object"!==oI(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!==oI(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(Symbol.asyncIterator,"string"),r="symbol"===oI(r5)?r5:String(r5);let ap=class RequestQueuePaginationIterator{#n;#r;#o;#a;constructor(e){this.#n=e.maxPageLimit,this.#o=e.limit,this.#a=e.cursor,this.#r=e.getPage}async *[r](){let e=this.#a,t=0;for(;;){let i=this.#o?Math.min(this.#n,this.#o-t):this.#n,n=await this.#r({limit:i,cursor:e});if(0===n.items.length||(yield n,t+=n.items.length,this.#o&&t>=this.#o||!n.nextCursor))return;e=n.nextCursor}}};function ad(e,t){return(0===e&&(e=void 0),0===t&&(t=void 0),void 0===e)?t:void 0===t?e:Math.min(e,t)}let af={limit:n6().min(0).optional(),offset:n6().min(0).optional(),chunkSize:n6().positive().optional()};function ah(e,t){for(let[i,n]of Object.entries(t??{}))if(void 0!==n){if(Array.isArray(n)){e.searchParams.set(i,n.join(","));continue}e.searchParams.set(i,String(n))}return e}let am=nU().nonempty().refine(e=>"."!==e&&".."!==e,{error:"URL path must not contain dot segments"});function ag(e){return encodeURIComponent(oH(e,am))}function ay(e){return Array.isArray(e)?e.map(ag).join("/"):e}async function ab(e,t){return new Promise(i=>{if(t?.aborted)return void i();let n=()=>{clearTimeout(r),i()},r=setTimeout(()=>{t?.removeEventListener("abort",n),i()},e);t?.addEventListener("abort",n,{once:!0})})}let av=new Uint8Array(256);av[9]|=2,av[32]|=2,av[59]|=4,av[44]|=8;for(let e=128;e<=255;e++)av[e]|=1;for(let e of"!#$%&'*+-.^_`|~")av[e.charCodeAt(0)]|=16;for(let e=48;e<=57;e++)av[e]|=16;for(let e=65;e<=90;e++)av[e]|=17;for(let e=97;e<=122;e++)av[e]|=16;let a_=((f=function(){}).prototype=Object.create(null),f),aw="application/json",aE=[RegExp(`^${aw}`,"i"),/^application\/.*xml$/i,/^text\//i],aS=rD(e=>"object"==typeof e&&null!==e&&"string"==typeof e.contentEncoding&&"function"==typeof e.compress,{error:"Invalid input: expected an HttpCompressor"}),aT=rp({quality:n5().min(0).max(11).default(6)});let aR=class BrotliHttpCompressor{contentEncoding="br";#s;constructor(e={}){let{quality:t}=oH(e,aT,"BrotliHttpCompressorOptions");this.#s=t}async compress(e){return oC.compress(e,{algorithm:"br",quality:this.#s})}};let aO=rp({quality:n5().min(1).max(9).default(6)});let ax=class GzipHttpCompressor{contentEncoding="gzip";#s;constructor(e={}){let{quality:t}=oH(e,aO,"GzipHttpCompressorOptions");this.#s=t}async compress(e){return oC.compress(e,{algorithm:"gzip",quality:this.#s})}};let aA=rp({quality:n5().min(1).max(19).default(3)});let ak=class ZstdHttpCompressor{contentEncoding="zstd";#s;constructor(e={}){let{quality:t}=oH(e,aA,"ZstdHttpCompressorOptions");this.#s=t}async compress(e){return oC.compress(e,{algorithm:"zstd",quality:this.#s})}};let aC=rh([rw(["brotli","gzip","zstd"]),aS]);function aP(e){if("string"!=typeof e)return e;switch(e){case"gzip":return new ax;case"brotli":return new aR;case"zstd":return new ak}}let aI=class InvalidResponseBodyError extends oP{code;response;constructor(e,t){super(`Response body could not be parsed.
64
+ Cause:${t.message}`),this.name=this.constructor.name,this.code="invalid-response-body",this.response=e,this.cause=t}};let aU=n6().gt(0);let az=class Statistics{calls=0;requests=0;rateLimitErrors=[];addRateLimitError(e){oH(e,aU);let t=e-1;this.#l(t),this.rateLimitErrors[t]++}#l(e){if(this.rateLimitErrors.length<=e)for(let t=0;t<=e;t++)"number"!=typeof this.rateLimitErrors[t]&&(this.rateLimitErrors[t]=0)}};let aL=rh([rw(["short","medium","long","noTimeout"]),n6().positive()]).optional(),aN=rj(AbortSignal).optional(),a$={timeoutSecs:aL,signal:aN},aD=rp(a$);var aM=i("d").Buffer;let aj="application/json",aB="application/x-www-form-urlencoded",aF={maxRetries:n6().int().nonnegative(),minDelayBetweenRetriesMillis:n6().nonnegative(),timeoutShortSecs:n6().positive(),timeoutMediumSecs:n6().positive(),timeoutLongSecs:n6().positive(),timeoutMaxSecs:n6().positive()},aq=rd(aF).partial(),aZ=new Set(["FormData"]);let aW=class HttpClient{stats;logger;maxRetries;minDelayBetweenRetriesMillis;timeoutMillis;timeoutMaxMillis;httpCompressor;defaultHeaders;constructor(e={}){oH(e,aq,"HttpClientOptions"),this.stats=e.stats??new az,this.logger=e.logger??ok.child({prefix:"ApifyClient"}),this.maxRetries=e.maxRetries??8,this.minDelayBetweenRetriesMillis=e.minDelayBetweenRetriesMillis??500,this.timeoutMillis={short:(e.timeoutShortSecs??5)*1e3,medium:(e.timeoutMediumSecs??30)*1e3,long:(e.timeoutLongSecs??360)*1e3},this.timeoutMaxMillis=(e.timeoutMaxSecs??360)*1e3,this.httpCompressor=aP(e.compression??"brotli");let t={},i=e.workflowKey||ar("APIFY_WORKFLOW_KEY");if(i&&(t["X-Apify-Workflow-Key"]=i),oC.platform){var n;let i=!!ar("APIFY_IS_AT_HOME"),r=`ApifyClient/${o0} (${oC.platform}); isAtHome/${i}`;e.userAgentSuffix&&(r+=`; ${(Array.isArray(n=e.userAgentSuffix)?n:[n]).join("; ")}`),t["User-Agent"]=r}e.token&&(t.Authorization=`Bearer ${e.token}`),this.defaultHeaders=aG(t,e.headers)}setDefaultAuthorization(e){void 0===aK(this.defaultHeaders,"authorization")&&(this.defaultHeaders.Authorization=`Bearer ${e}`)}isTimeoutError(e){return e instanceof Error&&"TimeoutError"===e.name}isRetryableTransportError(e){return!1}async close(){}async sendRequest(e){throw Error(`Implement sendRequest() to send ${e.method} ${e.url}, or override call() entirely.`)}async call(e){e.signal?.throwIfAborted(),this.stats.calls++;let{headers:t,body:i}=await this.prepareRequest(e),n=this.buildUrl(e.url,e.params);try{return await this.#u(async(r,o)=>this.#c({config:e,url:n,headers:t,body:i,attempt:o,stopRetrying:r}),e.signal)}catch(t){throw al(e.data)&&au(i)&&i.destroy(),t}}async prepareRequest(e){let t=aG(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Authorization",i=aK(e,"authorization");if("Authorization"===t||void 0===i)return e;let n={...e};return aV(n,"authorization"),aG(n,{[t]:i})}(this.defaultHeaders,e.authorizationHeader),e.headers),i=function(e,t,i){if(null!=e){if(au(e))return e;if(al(e))return oC.openStreamBody(e);if(aa(e))return void 0===aK(t,"content-type")&&e.type&&(t["Content-Type"]=e.type),e;if(ao(e))return!oC.isNode||aM.isBuffer(e)?e:ArrayBuffer.isView(e)?aM.from(e.buffer,e.byteOffset,e.byteLength):aM.from(e);if("string"==typeof e)return e;if("object"==typeof e){var n,r;if(e instanceof URLSearchParams)return void 0===aK(t,"content-type")&&(t["Content-Type"]=`${aB};charset=utf-8`),e.toString();let o=(n=e,Object.prototype.toString.call(n).slice(8,-1));if(aZ.has(o))throw TypeError(`Unsupported request body type: ${o}`);void 0===aK(t,"content-type")&&(t["Content-Type"]=aj);let a=aK(t,"content-type");if(aH(a)===aB){let t,i;return r=e,t=new URLSearchParams,i=(e,n)=>{if(null!=n)if(n instanceof Date)t.append(e,n.toISOString());else if(ao(n)){var r;t.append(e,(ArrayBuffer.isView(r=n)?aM.from(r.buffer,r.byteOffset,r.byteLength):aM.from(r)).toString("base64"))}else if(Array.isArray(n)){let t=n.some(aY);n.forEach((n,r)=>i(t?`${e}[${r}]`:`${e}[]`,n))}else"object"==typeof n?Object.entries(n).forEach(t=>{let[n,r]=t;return i(`${e}[${n}]`,r)}):t.append(e,String(n))},Object.entries(r).forEach(e=>{let[t,n]=e;return i(t,n)}),t.toString()}return JSON.stringify(e,i&&aH(a)===aj?aJ:void 0)}throw TypeError(`Unsupported request body type: ${typeof e}`)}}(e.data,t,e.stringifyFunctions),n=e.compression??this.httpCompressor,r=n&&function(e,t){if(void 0===e||!oC.isNode||void 0!==aK(t,"content-encoding")||!function(e){if(!e)return!0;let t=e.split(";",1)[0].trim().toLowerCase();return!!(o4.has(t)||o9.some(e=>t.endsWith(e)))||!o2.has(t)&&!o1.some(e=>t.startsWith(e))}(aK(t,"content-type")))return;let i=an(e);return i&&i.byteLength>=1024?i:void 0}(i,t);return r&&(i=await n.compress(aM.from(r.buffer,r.byteOffset,r.byteLength)),aV(t=aG(t,{"Content-Encoding":n.contentEncoding}),"content-length")),aa(i)&&oC.isNode&&(t=aG(t,{"Content-Length":String(i.size)})),{headers:t,body:i}}buildUrl(e,t){let i=[];for(let[e,n]of Object.entries(t??{}))void 0!==n&&(n instanceof Date?i.push([e,n.toISOString()]):"boolean"==typeof n?i.push([e,String(Number(n))]):i.push([e,String(n)]));if(0===i.length)return e;let n=new URLSearchParams(i).toString();return`${e}${e.includes("?")?"&":"?"}${n}`}computeTimeoutMillis(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"medium";if("noTimeout"===t)return;let i="number"==typeof t?1e3*t:this.timeoutMillis[t];return i>this.timeoutMaxMillis&&this.logger.warningOnce(`The requested timeout of ${i/1e3}s exceeds timeoutMaxSecs (${this.timeoutMaxMillis/1e3}s) and is capped at it. Raise timeoutMaxSecs on the client to allow longer request timeouts.`),Math.min(i*2**(e-1),this.timeoutMaxMillis)}async #u(e,t){let i=!0,n=()=>{i=!1};for(let r=1;r<=this.maxRetries;r++){t?.throwIfAborted();try{return await e(n,r)}catch(e){if(t?.throwIfAborted(),!i)throw e;this.#p(e,r)}let o=this.minDelayBetweenRetriesMillis*2**(r-1)*(1+Math.random());await ab(o,t)}return t?.throwIfAborted(),e(n,this.maxRetries+1)}async #c(e){let t,i,n,{config:r,url:o,headers:a,body:s,attempt:l,stopRetrying:u}=e;this.stats.requests++;let c=ac(r.data),p=aa(s)?oC.openBlobBody(s,e=>{t={error:e}}):s;try{i=await this.sendRequest({method:r.method,url:o,headers:a,body:p,timeoutMillis:this.computeTimeoutMillis(l,r.timeoutSecs),stream:"stream"===r.responseType,followRedirects:r.followRedirects??!0,signal:r.signal})}catch(e){if(r.signal?.throwIfAborted(),t)throw u(),function(e,t){if(!(e instanceof Error)||void 0!==e.cause)return e;let i=new Set;for(let n=t;n instanceof Error&&!i.has(n);n=n.cause){if(n===e)return e;i.add(n)}return e.cause=t,e}(t.error,e);throw this.#d(e,r,u),e}finally{p!==s&&au(p)&&p.destroy()}let d=i.status>=300,f=d&&this.#f(i.status,r.retryStatusCodes),h=d&&!1===r.throwOnErrorStatus&&(!f||c||l>this.maxRetries);au(i.body)&&(i.body=oC.streamToWeb(i.body)),d&&!h&&al(i.body)&&(i.body=await new Response(i.body).arrayBuffer().catch(()=>void 0)),ao(i.body)&&(i.body=function(e){if(oC.isNode&&aM.isBuffer(e))return e;let t=an(e);return oC.isNode?aM.from(t.buffer,t.byteOffset,t.byteLength):t}(i.body));try{n=this.#h(i,r)}catch(e){if(!d)throw u(),e;n=i.body}let m={status:i.status,headers:i.headers,data:n,config:r};if(!d||(429===i.status&&!1!==r.throwOnErrorStatus&&this.stats.addRateLimitError(l),h))return m;let g=oz.fromResponse(m,l);throw f?c&&(this.#m(),u()):u(),g}#h(e,t){let{body:i}=e;if("stream"===t.responseType||"buffer"===t.responseType||void 0===i||!ao(i))return i;if(0!==i.byteLength)try{var n;return function(e,t){var i;let n,r;try{let e=function(e){let t=e.length,i=0;for(;(2&av[e.charCodeAt(i)])!=0;)i++;let n=i,r=0,o=-1,a=0;for(;n<t;){let t=e.charCodeAt(n),i=av[t];if((4&i)!=0){a|=8&i;break}(2&i)!=0?-1===o&&(o=n):o=-1,r|=65280&t|i,n++}let s=-1===o?n:o,l=e.slice(i,s),u=(65281&r)==0?l:l.toLowerCase();return n===t||0!==a?{type:u,index:n,parameters:new a_}:function(e,t,i,n){let r=new a_;e:for(;i<n;){for(i++;(2&av[e.charCodeAt(i)])!=0;)i++;let t=i,o=0,a=-1;for(;i<n;){let s=e.charCodeAt(i),l=av[s];if((4&l)!=0){if((8&l)!=0)break e;continue e}if(61===s){let s=-1===a?i:a,l=e.slice(t,s),u=(65281&o)==0?l:l.toLowerCase();for(i++;(2&av[e.charCodeAt(i)])!=0;)i++;if(i<n&&34===e.charCodeAt(i)){let t=++i,o=!1;for(;i<n;){let a=e.charCodeAt(i);if(34===a){void 0===r[u]&&(r[u]=o?function(e,t,i){let n="";for(let r=t;r<i;r++)92===e.charCodeAt(r)&&(n+=e.slice(t,r),t=++r);return n+e.slice(t,i)}(e,t,i):e.slice(t,i)),i++;let a=0;for(;i<n;){let t=av[e.charCodeAt(i)];if((4&t)!=0){a=8&t;break}i++}if(0!==a)break e;continue e}if(92===a&&i+1<n){o=!0,i+=2;continue}i++}continue e}let c=i,p=0,d=-1;for(;i<n;){let t=av[e.charCodeAt(i)];if((4&t)!=0){p=8&t;break}(2&t)!=0?-1===d&&(d=i):d=-1,i++}if(void 0===r[u]){let t=-1===d?i:d;r[u]=e.slice(c,t)}if(0!==p)break e;continue e}(2&l)!=0?-1===a&&(a=i):a=-1,o|=65280&s|l,i++}}return{type:t,index:i,parameters:r}}(e,u,n,t)}(t);n=e.type,r=e.parameters.charset}catch{return e}if(!((i=n)&&aE.some(e=>e.test(i))))return e;let o=function(e){try{return new TextDecoder(e,{ignoreBOM:!0})}catch{return}}(r);if(!o)return e;let a=o.decode(e);return n===aw?JSON.parse(a):a}(i,(n=e.headers["content-type"],(Array.isArray(n)?n[0]:n)??""))}catch(t){throw new aI(e,t)}}#d(e,t,i){t.doNotRetryTimeouts&&this.isTimeoutError(e)||!1===t.retryTransportErrors||!this.isRetryableTransportError(e)?i():ac(t.data)&&(this.#m(),i())}#f(e,t){return t?t.includes(e):429===e||e>=500}#m(){this.logger.warningOnce("Request body was a stream - retrying will not work, as part of it was already consumed."),this.logger.warningOnce("If you want Apify client to handle retries for you, collect the stream into a buffer before sending it.")}#p(e,t){if(t===Math.round(this.maxRetries/2)){let{stack:i,cause:n}=e,r=n instanceof Error?`
65
65
  Caused by: ${n.stack??n}`:"";this.logger.warning(`API request failed ${t} times. Max attempts: ${this.maxRetries+1}.
66
- Cause:${i??e}${r}`)}}};function aW(e,t){let i=t.toLowerCase(),n=Object.keys(e).find(e=>e.toLowerCase()===i);return void 0===n?void 0:e[n]}function aK(e,t){let i={...e};for(let[e,n]of Object.entries(t??{})){for(let t of Object.keys(i))t.toLowerCase()===e.toLowerCase()&&delete i[t];i[e]=n}return i}function aG(e,t){let i=t.toLowerCase();for(let t of Object.keys(e))t.toLowerCase()===i&&delete e[t]}function aV(e){return e?.split(";",1)[0].trim().toLowerCase()}function aH(e,t){return"function"==typeof t?t.toString():t}function aJ(e){return!!Array.isArray(e)||"object"==typeof e&&null!==e&&!(e instanceof Date)&&!ao(e)}let aY=new Set(["ETIMEDOUT","UND_ERR_CONNECT_TIMEOUT","UND_ERR_HEADERS_TIMEOUT","UND_ERR_BODY_TIMEOUT"]),aX=new Set(["ERR_INVALID_URL","ERR_INVALID_ARG_TYPE","ERR_INVALID_ARG_VALUE","UND_ERR_INVALID_ARG","UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"]);let aQ=class FetchHttpClient extends aZ{#g;constructor(e={}){super(e),this.#g=e.fetch}isTimeoutError(e){if(super.isTimeoutError(e))return!0;let t=a1(e);return void 0!==t&&aY.has(t)}isRetryableTransportError(e){if(this.isTimeoutError(e))return!0;let t=a1(e)??a2(e);return!(void 0!==t&&aX.has(t))&&(oC.fetchFailsWithCause?e instanceof TypeError&&void 0!==e.cause:e instanceof TypeError||void 0!==t)}async sendRequest(e){let t,{method:i,url:n,headers:r,body:o,timeoutMillis:a,stream:s,followRedirects:l,signal:u}=e,c=new AbortController,p=!1,d=()=>{clearTimeout(t),void 0===a||p||(t=setTimeout(()=>c.abort(new DOMException(`timeout of ${a}ms exceeded`,"TimeoutError")),a))};d();try{var f;let e,t,a=globalThis.location?.href;if(!oC.fetchFailsWithCause&&!URL.canParse(n,a))throw Object.assign(TypeError(`Invalid URL: ${n}`),{code:"ERR_INVALID_URL"});let p=await (this.#g??globalThis.fetch)(n,{method:i,headers:r,body:au(o)&&!a0?async function*(e,t){for await(let i of e){let e="string"==typeof i?new TextEncoder().encode(i):i;if(!(e instanceof Uint8Array)||e.byteLength<=65536){t(),yield e;continue}for(let i=0;i<e.byteLength;i+=65536)t(),yield e.subarray(i,i+65536)}}(o,d):o,redirect:l&&!au(o)?"follow":"manual",signal:u?AbortSignal.any([u,c.signal]):c.signal,...au(o)?{duplex:"half"}:{}});if("opaqueredirect"===p.type)throw new oP(`${i} ${n} responded with a redirect, which the client does not follow.`);return{status:p.status,headers:(f=p.headers,e=Object.fromEntries(f),(t=f.getSetCookie?.()??[]).length>0&&(e["set-cookie"]=t),e),body:s?p.body??new Blob([]).stream():await async function(e,t){let i=[],n=0,r=e.body?.getReader();for(let e=await r?.read();e&&!e.done;e=await r?.read())t(),i.push(e.value),n+=e.value.byteLength;let o=new Uint8Array(n),a=0;for(let e of i)o.set(e,a),a+=e.byteLength;return o}(p,d)}}catch(e){throw!this.#g&&this.isRetryableTransportError(e)&&this.#y(),e}finally{p=!0,clearTimeout(t)}}#y(){let e=oC.unusedProxyHint();e&&this.logger.warningOnce(e)}};let a0="Bun"in globalThis;function a1(e){return a2(e instanceof Error?e.cause:void 0)}function a2(e){let t=e?.code;return"string"==typeof t?t:void 0}let a4=class ApiClient{id;safeId;baseUrl;publicBaseUrl;resourcePath;url;apifyClient;httpClient;params;constructor(e){let{baseUrl:t,publicBaseUrl:i,apifyClient:n,httpClient:r,resourcePath:o,id:a,params:s={}}=e;this.id=a,this.safeId=a&&this.toSafeId(a),this.baseUrl=t,this.publicBaseUrl=i,this.resourcePath=o,this.url=a?`${t}/${o}/${am(this.safeId)}`:`${t}/${o}`,this.apifyClient=n,this.httpClient=r,this.params=s}subResourceOptions(e){return{...{baseUrl:this.buildUrl(),publicBaseUrl:this.publicBaseUrl,apifyClient:this.apifyClient,httpClient:this.httpClient,params:this.buildParams()},...e}}buildUrl(e){return e?`${this.url}/${ag(e)}`:this.url}buildPublicUrl(e){let t=this.id?`${this.publicBaseUrl}/${this.resourcePath}/${am(this.safeId)}`:`${this.publicBaseUrl}/${this.resourcePath}`;return e?`${t}/${ag(e)}`:t}buildParams(e){return{...this.params,...e}}toSafeId(e){return e.replaceAll("/","~")}listPaginatedFromCallback(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{chunkSize:i,...n}=t,r=ap(t.limit,i),o=e({...n,limit:r}),a=(e,t)=>{let i=Math.max(e.count??0,e.items.length);return t?Math.min(i,t):i};return Object.defineProperty(o,Symbol.asyncIterator,{value:async function*(){let s=await o;yield*s.items;let l=a(s,r),u=(t.offset??0)+l,c=t.limit?t.limit-l:void 0;for(;l>0&&(void 0===c||c>0);){let t=ap(c,i),r={...n,limit:t,offset:u};s=await e(r),yield*s.items,u+=l=a(s,t),void 0!==c&&(c-=l)}}})}};let a9=class ResourceClient extends a4{timeoutForWaitForFinish(e,t,i){if(void 0!==e)return e;if(void 0===i)return t;let n=Math.min(i,60);return n<=0?t:n+this.httpClient.timeoutMillis[t]/1e3}async getResource(e,t,i,n){let r={url:this.buildUrl(),method:"GET",params:this.buildParams(t),timeoutSecs:i,signal:n};try{let t=await this.httpClient.call(r);return o7(t,e)}catch(e){at(e,this.id)}}async updateResource(e,t,i,n){return o7(await this.httpClient.call({url:this.buildUrl(),method:"PUT",params:this.buildParams(),data:t,timeoutSecs:i,signal:n}),e)}async deleteResource(e,t){try{await this.httpClient.call({url:this.buildUrl(),method:"DELETE",params:this.buildParams(),timeoutSecs:e,signal:t})}catch(e){at(e,this.id)}}async waitForJobFinish(e){let t,i,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{waitSecs:o=999999,timeoutSecs:a="noTimeout",signal:s}=r,l=1e3*o,u=Date.now(),c=()=>{let e=Date.now();return!(e-u>=l)&&(void 0===i||!(e-i>=3e3))&&!(t&&rH.includes(t.status))};for(;;){let r=Math.max(0,Math.round((l-(Date.now()-u))/1e3)),o={url:this.buildUrl(),method:"GET",params:this.buildParams({waitForFinish:r}),timeoutSecs:a,signal:s};try{let n=await this.httpClient.call(o);t=o7(n,e),i=void 0}catch(e){ae(e),t=void 0,i??=Date.now(),n=e}if(!c())break;await ay(250,s),s?.throwIfAborted()}if(!t)throw n;return t}};function a3(e){return iE(nL,e)}function a6(e){return new ra({type:"date",coerce:!0,...L(e)})}function a8(e){let t;return()=>t??=e()}let a5=a8(()=>rd({total:n5().min(0),offset:n5().min(0),limit:n5().min(1),desc:re(),count:n5().min(0)})),a7=a8(()=>rd({totalBuilds:n5().optional(),totalRuns:n5().optional(),totalUsers:n5().optional(),totalUsers7Days:n5().optional(),totalUsers30Days:n5().optional(),totalUsers90Days:n5().optional(),totalMetamorphs:n5().optional(),lastRunStartedAt:a3({offset:!0}).pipe(a6()).optional(),actorReviewCount:n5().optional(),actorReviewRating:n6().optional(),bookmarkCount:n5().optional(),publicActorRunStats30Days:rd({ABORTED:n5().optional(),FAILED:n5().optional(),SUCCEEDED:n5().optional(),"TIMED-OUT":n5().optional(),TOTAL:n5().optional()}).optional()})),se=a8(()=>rd({id:nU(),createdAt:a3({offset:!0}).pipe(a6()),modifiedAt:a3({offset:!0}).pipe(a6()),name:nU(),username:nU(),title:nU().optional(),stats:a7().nullable().optional()})),st=a8(()=>a5().extend({items:ru(se())})),si=a8(()=>rw(["LIMITED_PERMISSIONS","FULL_PERMISSIONS"]).or(nU())),sn=a8(()=>rw(["BASE64","TEXT"]).or(nU())),sr=a8(()=>rd({format:sn().optional(),content:nU().optional(),name:nU()})),so=a8(()=>rd({name:nU(),folder:re()})),sa=a8(()=>ru(rh([sr(),so()]))),ss=a8(()=>rd({build:nU().optional(),timeoutSecs:n5().optional(),memoryMbytes:n5().optional(),restartOnError:re().nullable().optional(),maxItems:n5().nullable().optional(),maxTotalChargeUsd:n6().nullable().optional(),isMaxTotalChargeUsdSetByUser:re().nullable().optional(),forcePermissionLevel:si().nullable().optional()})),sl=a8(()=>rd({isEnabled:re().nullable().optional(),desiredRequestsPerActorRun:n5().nullable().optional(),maxRequestsPerActorRun:n5().nullable().optional(),idleTimeoutSecs:n5().nullable().optional(),build:nU().nullable().optional(),memoryMbytes:n5().nullable().optional(),disableStandbyFieldsOverride:re().nullable().optional(),shouldPassActorInput:re().nullable().optional(),tenancy:rw(["SINGLE_TENANT","MULTI_TENANT"]).or(nU()).nullable().optional(),isConsoleAuthEnabled:re().nullable().optional(),isTokenlessEnabled:re().nullable().optional()})),su=a8(()=>rd({body:nU().optional(),contentType:nU().optional()})),sc=a8(()=>rw(["SOURCE_FILES","GIT_REPO","TARBALL","GITHUB_GIST","SOURCE_CODE"]).or(nU())),sp=a8(()=>rd({name:nU(),value:nU().optional(),isSecret:re().nullable().optional(),valueHash:nU().optional()})),sd=a8(()=>rd({versionNumber:nU().regex(/^([0-9]|[1-9][0-9])\.([0-9]|[1-9][0-9])$/),sourceType:sc().nullable(),envVars:ru(sp()).nullable().optional(),applyEnvVarsToBuild:re().nullable().optional(),buildTag:nU().nullable().optional(),sourceFiles:sa().optional(),gitRepoUrl:nU().nullable().optional(),tarballUrl:nU().nullable().optional(),gitHubGistUrl:nU().nullable().optional(),actorPath:nU().min(1).max(255).nullable().optional(),githubWebhookId:n5().nullable().optional(),gitlabWebhookId:n5().nullable().optional(),bitbucketWebhookId:nU().nullable().optional()})),sf=a8(()=>rd({apifyMarginPercentage:n6(),createdAt:a3({offset:!0}).pipe(a6()),startedAt:a3({offset:!0}).pipe(a6()),notifiedAboutFutureChangeAt:a3({offset:!0}).pipe(a6()).nullable().optional(),notifiedAboutChangeAt:a3({offset:!0}).pipe(a6()).nullable().optional(),notifiedAboutRentalToPpePriceChangeAt:a3({offset:!0}).pipe(a6()).nullable().optional(),reasonForChange:nU().nullable().optional(),isPriceChangeNotificationSuppressed:re().optional(),forceContainsSignificantPriceChange:re().optional()})),sh=a8(()=>rd({tieredEventPriceUsd:n6()})),sm=a8(()=>rv(nU(),sh())),sg=a8(()=>rd({eventTitle:nU(),eventDescription:nU(),eventPriceUsd:n6().optional(),eventTieredPricingUsd:sm().optional(),isPrimaryEvent:re().optional(),isOneTimeEvent:re().nullable().optional()})),sy=a8(()=>sf().extend({pricingModel:rS("PAY_PER_EVENT"),pricingPerEvent:rd({actorChargeEvents:rv(nU(),sg()).optional()}),minimalMaxTotalChargeUsd:n6().nullable().optional(),isPPEPlatformUsagePaidByUser:re().nullable().optional()})),sb=a8(()=>rd({tieredPricePerUnitUsd:n6()})),sv=a8(()=>rv(nU(),sb())),s_=a8(()=>sf().extend({pricingModel:rS("PRICE_PER_DATASET_ITEM"),unitName:nU(),pricePerUnitUsd:n6().optional(),tieredPricing:sv().optional()})),sw=a8(()=>sf().extend({pricingModel:rS("FLAT_PRICE_PER_MONTH"),trialMinutes:n5(),pricePerUnitUsd:n6()})),sE=a8(()=>sf().extend({pricingModel:rS("FREE")})),sS=a8(()=>rg("pricingModel",[sy(),s_(),sw(),sE()])),sT=a8(()=>rd({buildId:nU().optional(),buildNumber:nU().regex(/^([0-9]|[1-9][0-9])\.([0-9]|[1-9][0-9])(\.[1-9][0-9]{0,4})$/).nullable().optional(),buildNumberInt:n5().optional(),finishedAt:a3({offset:!0}).pipe(a6()).nullable().optional()})),sR=a8(()=>rv(nU(),sT().nullable())),sO=a8(()=>rw(["NONE","RESIDENTIAL_PROXY_REQUIRED","UNDER_MAINTENANCE"]).or(nU()).nullable()),sx=a8(()=>rd({id:nU(),userId:nU(),name:nU(),username:nU(),description:nU().nullable().optional(),restartOnError:re().nullable().optional(),isPublic:re(),actorPermissionLevel:si().optional(),createdAt:a3({offset:!0}).pipe(a6()),modifiedAt:a3({offset:!0}).pipe(a6()),stats:a7(),versions:ru(sd()),pricingInfos:ru(sS()).optional(),defaultRunOptions:ss(),exampleRunInput:su().nullable().optional(),isDeprecated:re().nullable().optional(),deploymentKey:nU().optional(),title:nU().nullable().optional(),taggedBuilds:sR().nullable().optional(),actorStandby:sl().nullable().optional(),readmeSummary:nU().optional(),seoTitle:nU().nullable().optional(),seoDescription:nU().nullable().optional(),pictureUrl:nU().nullable().optional(),standbyUrl:nU().nullable().optional(),notice:sO().optional(),categories:ru(nU()).optional(),isCritical:re().optional(),isGeneric:re().optional(),isSourceCodeHidden:re().optional(),hasNoDataset:re().optional()})),sA=a8(()=>rd({total:n5(),items:ru(sd())})),sk=a8(()=>rd({total:n5(),items:ru(sp())})),sC=a8(()=>rw(["ACTOR.BUILD.ABORTED","ACTOR.BUILD.CREATED","ACTOR.BUILD.FAILED","ACTOR.BUILD.SUCCEEDED","ACTOR.BUILD.TIMED_OUT","ACTOR.RUN.ABORTED","ACTOR.RUN.CREATED","ACTOR.RUN.FAILED","ACTOR.RUN.RESURRECTED","ACTOR.RUN.SUCCEEDED","ACTOR.RUN.TIMED_OUT","TEST"]).or(nU())),sP=a8(()=>rd({actorId:nU().nullable().optional(),actorTaskId:nU().nullable().optional(),actorRunId:nU().nullable().optional()})),sI=a8(()=>rd({userIntegrationId:nU().optional(),channelId:nU().optional(),messageTemplate:nU().optional()})),sU=a8(()=>rd({fields:ru(nU()).optional(),omit:ru(nU()).optional()})),sz=a8(()=>rd({userIntegrationId:nU().optional(),emailTo:ru(nU()).optional(),subject:nU().optional(),body:nU().optional(),attachmentFormat:nU().optional(),attachmentTransformation:sU().optional()})),sL=a8(()=>rd({userIntegrationId:nU().optional(),filename:nU().optional(),format:nU().nullable().optional(),transformation:sU().optional()})),sN=a8(()=>rd({userIntegrationId:nU().optional(),repository:nU().optional(),title:nU().optional(),body:nU().optional()})),s$=a8(()=>rw(["ACTIVE","SUCCEEDED","FAILED"]).or(nU())),sD=a8(()=>rd({status:s$(),finishedAt:a3({offset:!0}).pipe(a6()).nullable().optional(),removedAt:a3({offset:!0}).pipe(a6()).nullable().optional()})),sM=a8(()=>rd({totalDispatches:n5().optional()})),sj=a8(()=>rd({id:nU(),createdAt:a3({offset:!0}).pipe(a6()),modifiedAt:a3({offset:!0}).pipe(a6()),userId:nU(),isAdHoc:re().nullable().optional(),isEnabled:re().optional(),actionType:nU().optional(),isApifyIntegration:re().nullable().optional(),shouldInterpolateStrings:re().nullable().optional(),eventTypes:ru(sC()),condition:sP(),ignoreSslErrors:re(),doNotRetry:re().nullable().optional(),requestUrl:nq({normalize:!0}).nullable().optional(),payloadTemplate:nU().nullable().optional(),headersTemplate:nU().nullable().optional(),title:nU().nullable().optional(),description:nU().nullable().optional(),slackMessage:sI().optional(),googleMail:sz().optional(),googleDrive:sL().optional(),githubIssue:sN().optional(),lastDispatch:sD().nullable().optional(),stats:sM().nullable().optional()})),sB=a8(()=>rw(["READY","RUNNING","SUCCEEDED","FAILED","TIMING-OUT","TIMED-OUT","ABORTING","ABORTED"]).or(nU())),sF=a8(()=>rw(["DEVELOPMENT","WEB","API","SCHEDULER","TEST","WEBHOOK","ACTOR","CLI","CI","STANDBY","MCP"]).or(nU())),sq=a8(()=>rd({origin:sF(),clientIp:nU().optional(),userAgent:nU().optional(),githubActionsRunUrl:nU().optional(),actorRunId:nU().optional(),webhookDispatchId:nU().optional()})),sZ=a8(()=>rd({id:nU(),actId:nU().optional(),userId:nU().optional(),status:sB(),startedAt:a3({offset:!0}).pipe(a6()),finishedAt:a3({offset:!0}).pipe(a6()).nullable().optional(),usageTotalUsd:n6().optional(),buildNumber:nU().regex(/^([0-9]|[1-9][0-9])\.([0-9]|[1-9][0-9])(\.[1-9][0-9]{0,4})$/),buildNumberInt:n5().optional(),meta:sq().optional()})),sW=a8(()=>a5().extend({items:ru(sZ())})),sK=a8(()=>rd({durationMillis:n5().optional(),runTimeSecs:n6().optional(),computeUnits:n6().optional(),imageSizeBytes:n5().nullable().optional()})),sG=a8(()=>rd({useCache:re().nullable().optional(),betaPackages:re().nullable().optional(),memoryMbytes:n5().nullable().optional(),diskMbytes:n5().nullable().optional(),tag:nU().nullable().optional(),debug:re().nullable().optional()})),sV=a8(()=>rd({ACTOR_COMPUTE_UNITS:n6().nullable().optional()})),sH=a8(()=>rd({templateId:nU().optional(),generatedBy:nU().optional()})),sJ=a8(()=>rd({actorSpecification:rS(1).optional(),name:nU().optional(),title:nU().optional(),description:nU().optional(),version:nU().regex(/^[0-9]+(\.[0-9]+)+$/).optional(),buildTag:nU().optional(),meta:sH().optional(),environmentVariables:rv(nU(),nU()).optional(),dockerfile:nU().optional(),dockerContextDir:nU().optional(),readme:nU().nullable().optional(),input:rv(nU(),rn()).nullable().optional(),output:rv(nU(),rn()).nullable().optional(),changelog:nU().nullable().optional(),storages:rd({dataset:rv(nU(),rn()).optional(),datasets:rv(nU(),rv(nU(),rn())).optional(),keyValueStore:rv(nU(),rn()).optional()}).optional(),defaultMemoryMbytes:rh([nU(),n5()]).optional(),minMemoryMbytes:n5().min(128).optional(),maxMemoryMbytes:n5().min(128).optional(),usesStandbyMode:re().optional(),webServerSchema:rv(nU(),rn()).optional(),webServerMcpPath:nU().optional()})),sY=a8(()=>rd({id:nU(),actId:nU(),userId:nU(),startedAt:a3({offset:!0}).pipe(a6()),finishedAt:a3({offset:!0}).pipe(a6()).nullable().optional(),status:sB(),meta:sq(),stats:sK().nullable().optional(),options:sG().nullable().optional(),usage:sV().nullable().optional(),usageTotalUsd:n6().nullable().optional(),usageUsd:sV().nullable().optional(),inputSchema:nU().nullable().optional(),readme:nU().nullable().optional(),changelog:nU().nullable().optional(),exitCode:n5().nullable().optional(),gitCommitId:nU().optional(),gitBranchName:nU().optional(),createdByOrganizationMemberUserId:nU().optional(),buildNumber:nU().regex(/^([0-9]|[1-9][0-9])\.([0-9]|[1-9][0-9])(\.[1-9][0-9]{0,4})$/),imageDigest:nU().nullable().optional(),actVersion:rd({sourceType:sc().optional(),buildTag:nU().nullable().optional(),versionNumber:nU().regex(/^([0-9]|[1-9][0-9])\.([0-9]|[1-9][0-9])$/).optional(),gitRepoUrl:nU().optional(),sourceFiles:ru(sr()).optional(),gitHubGistUrl:nU().optional(),tarballUrl:nU().optional(),actorPath:nU().nullable().optional()}).optional(),actorDefinition:sJ().nullable().optional()})),sX=a8(()=>rd({origin:sF(),clientIp:nU().nullable().optional(),userAgent:nU().nullable().optional(),scheduleId:nU().nullable().optional(),scheduledAt:a3({offset:!0}).pipe(a6()).nullable().optional(),actorRunId:nU().optional(),webhookDispatchId:nU().optional(),scheduledAct2Id:nU().optional(),scheduledActorTaskId:nU().optional()})),sQ=a8(()=>rd({deployment:rw(["SINGLE_TENANT","MULTI_TENANT_OWNER_PAID","MULTI_TENANT_FREE_USERS","MULTI_TENANT_PAYING_USERS"]).or(nU())})),s0=a8(()=>rd({id:nU(),actId:nU(),userId:nU().optional(),actorTaskId:nU().nullable().optional(),status:sB(),startedAt:a3({offset:!0}).pipe(a6()),finishedAt:a3({offset:!0}).pipe(a6()).nullable().optional(),buildId:nU(),buildNumber:nU().regex(/^([0-9]|[1-9][0-9])\.([0-9]|[1-9][0-9])(\.[1-9][0-9]{0,4})$/).optional(),buildNumberInt:n5().optional(),meta:sX(),usageTotalUsd:n6(),defaultKeyValueStoreId:nU(),defaultDatasetId:nU(),defaultRequestQueueId:nU(),standby:sQ().nullable().optional()})),s1=a8(()=>a5().extend({items:ru(s0())})),s2=a8(()=>rd({inputBodyLen:n5().min(0).nullable().optional(),migrationCount:n5().min(0).optional(),rebootCount:n5().min(0).optional(),restartCount:n5().min(0).optional(),resurrectCount:n5().min(0).optional(),memAvgBytes:n6().optional(),memMaxBytes:n5().min(0).optional(),memCurrentBytes:n5().min(0).optional(),cpuAvgUsage:n6().optional(),cpuMaxUsage:n6().optional(),cpuCurrentUsage:n6().optional(),netRxBytes:n5().min(0).optional(),netTxBytes:n5().min(0).optional(),durationMillis:n5().min(0).optional(),runTimeSecs:n6().min(0).optional(),metamorph:n5().min(0).optional(),computeUnits:n6().min(0).optional()})),s4=a8(()=>rd({eventTotalUsd:n6(),eventTitle:nU()})),s9=a8(()=>rd({platform:nU().optional(),appId:nU().optional(),isAiTool:re().optional()})),s3=a8(()=>rd({build:nU(),timeoutSecs:n5().min(0),memoryMbytes:n5().min(128).max(32768),diskMbytes:n5().min(0),restartOnError:re().nullable().optional(),maxItems:n5().min(0).nullable().optional(),maxTotalChargeUsd:n6().min(0).nullable().optional(),isMaxTotalChargeUsdSetByUser:re().optional()})),s6=a8(()=>rw(["ANYONE_WITH_ID_CAN_READ","ANYONE_WITH_NAME_CAN_READ","FOLLOW_USER_SETTING","RESTRICTED"]).or(nU())),s8=a8(()=>rd({ACTOR_COMPUTE_UNITS:n6().nullable().optional(),DATASET_READS:n5().nullable().optional(),DATASET_WRITES:n5().nullable().optional(),KEY_VALUE_STORE_READS:n5().nullable().optional(),KEY_VALUE_STORE_WRITES:n5().nullable().optional(),KEY_VALUE_STORE_LISTS:n5().nullable().optional(),REQUEST_QUEUE_READS:n5().nullable().optional(),REQUEST_QUEUE_WRITES:n5().nullable().optional(),DATA_TRANSFER_INTERNAL_GBYTES:n6().nullable().optional(),DATA_TRANSFER_EXTERNAL_GBYTES:n6().nullable().optional(),PROXY_RESIDENTIAL_TRANSFER_GBYTES:n6().nullable().optional(),PROXY_SERPS:n5().nullable().optional(),PROXY_UNBLOCKER_UNITS:n6().nullable().optional()})),s5=a8(()=>rd({ACTOR_COMPUTE_UNITS:n6().nullable().optional(),DATASET_READS:n6().nullable().optional(),DATASET_WRITES:n6().nullable().optional(),KEY_VALUE_STORE_READS:n6().nullable().optional(),KEY_VALUE_STORE_WRITES:n6().nullable().optional(),KEY_VALUE_STORE_LISTS:n6().nullable().optional(),REQUEST_QUEUE_READS:n6().nullable().optional(),REQUEST_QUEUE_WRITES:n6().nullable().optional(),DATA_TRANSFER_INTERNAL_GBYTES:n6().nullable().optional(),DATA_TRANSFER_EXTERNAL_GBYTES:n6().nullable().optional(),PROXY_RESIDENTIAL_TRANSFER_GBYTES:n6().nullable().optional(),PROXY_SERPS:n6().nullable().optional(),PROXY_UNBLOCKER_UNITS:n6().nullable().optional()})),s7=a8(()=>rd({createdAt:a3({offset:!0}).pipe(a6()),actorId:nU(),buildId:nU(),inputKey:nU().nullable().optional(),buildTags:ru(nU()).optional()})),le=a8(()=>rd({id:nU(),actId:nU(),userId:nU(),actorTaskId:nU().nullable().optional(),startedAt:a3({offset:!0}).pipe(a6()),finishedAt:a3({offset:!0}).pipe(a6()).nullable().optional(),status:sB(),statusMessage:nU().nullable().optional(),isStatusMessageTerminal:re().nullable().optional(),meta:sX(),pricingInfo:sS().optional(),stats:s2(),chargedEventCounts:rv(nU(),n5()).optional(),accountedChargedEventCounts:rv(nU(),n5()).nullable().optional(),eventUsage:rv(nU(),s4()).optional(),externalChargedTotalUsd:n6().optional(),standby:sQ().nullable().optional(),integrationTracking:s9().optional(),createdByOrganizationMemberUserId:nU().optional(),consoleUrl:nq({normalize:!0}).optional(),output:rv(nU(),nq({normalize:!0})).optional(),options:s3(),buildId:nU(),exitCode:n5().nullable().optional(),generalAccess:s6().nullable().optional(),defaultKeyValueStoreId:nU(),defaultDatasetId:nU(),defaultRequestQueueId:nU(),storageIds:rd({datasets:rd({default:nU().optional()}).catchall(nU()).optional(),keyValueStores:rd({default:nU().optional()}).catchall(nU()).optional(),requestQueues:rd({default:nU().optional()}).catchall(nU()).optional()}).optional(),buildNumber:nU().regex(/^([0-9]|[1-9][0-9])\.([0-9]|[1-9][0-9])(\.[1-9][0-9]{0,4})$/).nullable().optional(),containerUrl:nq({normalize:!0}).optional(),isContainerServerReady:re().nullable().optional(),gitBranchName:nU().nullable().optional(),usage:s8().nullable().optional(),usageTotalUsd:n6().nullable().optional(),usageUsd:s5().nullable().optional(),metamorphs:ru(s7()).nullable().optional(),platformUsageBillingModel:nU().optional()})),lt=a8(()=>rd({readCount:n5().optional(),writeCount:n5().optional(),storageBytes:n5().optional(),inflatedBytes:n5().optional()})),li=a8(()=>rd({id:nU(),name:nU().nullable().optional(),title:nU().nullable().optional(),userId:nU(),createdAt:a3({offset:!0}).pipe(a6()),modifiedAt:a3({offset:!0}).pipe(a6()),accessedAt:a3({offset:!0}).pipe(a6()),itemCount:n5().min(0),cleanItemCount:n5().min(0),actId:nU().nullable().optional(),actRunId:nU().nullable().optional(),fields:ru(nU()).nullable().optional(),schema:rv(nU(),rn()).nullable().optional(),consoleUrl:nq({normalize:!0}),itemsPublicUrl:nq({normalize:!0}).optional(),urlSigningSecretKey:nU().nullable().optional(),generalAccess:s6().nullable().optional(),stats:lt().optional()})),ln=a8(()=>rd({min:n6().nullable().optional(),max:n6().nullable().optional(),nullCount:n5().nullable().optional(),emptyCount:n5().nullable().optional()})),lr=a8(()=>rd({fieldStatistics:rv(nU(),ln()).nullable().optional()})),lo=a8(()=>rd({readCount:n5().optional(),writeCount:n5().optional(),deleteCount:n5().optional(),listCount:n5().optional(),s3StorageBytes:n5().optional(),storageBytes:n5().optional()})),la=a8(()=>rd({id:nU(),name:nU().nullable().optional(),title:nU().nullable().optional(),userId:nU().nullable().optional(),username:nU().nullable().optional(),createdAt:a3({offset:!0}).pipe(a6()),modifiedAt:a3({offset:!0}).pipe(a6()),accessedAt:a3({offset:!0}).pipe(a6()),actId:nU().nullable().optional(),actRunId:nU().nullable().optional(),consoleUrl:nq({normalize:!0}).optional(),keysPublicUrl:nq({normalize:!0}).optional(),recordsPublicUrl:nq({normalize:!0}).optional(),schema:rv(nU(),rn()).nullable().optional(),urlSigningSecretKey:nU().nullable().optional(),generalAccess:s6().nullable().optional(),stats:lo().optional()})),ls=a8(()=>rd({key:nU(),size:n5(),recordPublicUrl:nq({normalize:!0})})),ll=a8(()=>rd({items:ru(ls()),count:n5(),limit:n5(),exclusiveStartKey:nU().nullable().optional(),isTruncated:re(),nextExclusiveStartKey:nU().nullable().optional()})),lu=a8(()=>nU()),lc=a8(()=>nU()),lp=a8(()=>a3({offset:!0}).pipe(a6())),ld=a8(()=>a3({offset:!0}).pipe(a6())),lf=a8(()=>a3({offset:!0}).pipe(a6())),lh=a8(()=>n5().min(0)),lm=a8(()=>n5().min(0)),lg=a8(()=>n5()),ly=a8(()=>re()),lb=a8(()=>rd({deleteCount:n5().optional(),headItemReadCount:n5().optional(),readCount:n5().optional(),storageBytes:n5().optional(),writeCount:n5().optional()})),lv=a8(()=>rd({id:lu(),name:nU().nullable().optional(),title:nU().nullable().optional(),userId:lc(),actId:nU().nullable().optional(),actRunId:nU().nullable().optional(),createdAt:lp(),modifiedAt:ld(),accessedAt:lf(),totalRequestCount:lh(),handledRequestCount:lm(),pendingRequestCount:lg(),hadMultipleClients:ly(),consoleUrl:nq({normalize:!0}),stats:lb().optional(),generalAccess:s6().nullable().optional()})),l_=a8(()=>nU()),lw=a8(()=>nU()),lE=a8(()=>rw(["GET","HEAD","POST","PUT","DELETE","CONNECT","OPTIONS","TRACE","PATCH"]).or(nU())),lS=a8(()=>lE()),lT=a8(()=>n5()),lR=a8(()=>rv(nU(),rn())),lO=a8(()=>rd({uniqueKey:l_(),url:lw(),method:lS().optional(),retryCount:lT().optional(),loadedUrl:nU().nullable().optional(),payload:rh([nU(),rv(nU(),rn())]).nullable().optional(),headers:rv(nU(),rn()).nullable().optional(),userData:lR().optional(),noRetry:re().nullable().optional(),errorMessages:ru(nU()).nullable().optional(),handledAt:a3({offset:!0}).pipe(a6()).nullable().optional()})),lx=a8(()=>nU()),lA=a8(()=>a3({offset:!0}).pipe(a6())),lk=a8(()=>lO().extend({id:lx().optional(),lockExpiresAt:lA().optional(),lockByClient:nU().optional()}).required({id:!0})),lC=a8(()=>rd({items:ru(lk()),limit:n5(),exclusiveStartId:nU().optional(),cursor:nU().optional(),nextCursor:nU().optional()})),lP=a8(()=>re()),lI=a8(()=>re()),lU=a8(()=>rd({requestId:lx(),wasAlreadyPresent:lP(),wasAlreadyHandled:lI()})),lz=a8(()=>rd({requestId:lx(),uniqueKey:l_(),wasAlreadyPresent:lP(),wasAlreadyHandled:lI()})),lL=a8(()=>rd({id:lx().optional(),uniqueKey:l_(),url:lw(),method:lS().optional()})),lN=a8(()=>rd({processedRequests:ru(lz()),unprocessedRequests:ru(lL())})),l$=a8(()=>rd({uniqueKey:l_().optional(),id:lx()})),lD=a8(()=>rd({uniqueKey:l_(),id:lx().optional()})),lM=a8(()=>rh([l$(),lD()])),lj=a8(()=>rd({processedRequests:ru(lM()),unprocessedRequests:ru(lL())})),lB=a8(()=>rd({unlockedCount:n5()})),lF=a8(()=>rd({lockExpiresAt:lA()})),lq=a8(()=>n5()),lZ=a8(()=>rd({id:lx(),uniqueKey:l_(),url:lw(),method:lS().optional(),retryCount:lT().optional()})),lW=a8(()=>rd({limit:lq(),queueModifiedAt:ld(),hadMultipleClients:ly(),items:ru(lZ())})),lK=a8(()=>rd({id:lx(),uniqueKey:l_(),url:lw(),method:lS().optional(),retryCount:lT().optional(),lockExpiresAt:lA()})),lG=a8(()=>rd({limit:lq(),queueModifiedAt:ld(),queueHasLockedRequests:re().optional(),clientKey:nU().optional(),hadMultipleClients:ly(),lockSecs:n5(),items:ru(lK())})),lV=a8(()=>rd({totalRuns:n5().optional(),lastRunStartedAt:a3({offset:!0}).pipe(a6()).nullable().optional()})),lH=a8(()=>rd({id:nU(),userId:nU(),actId:nU(),actName:nU().nullable().optional(),name:nU(),title:nU().nullable().optional(),username:nU().nullable().optional(),actUsername:nU().nullable().optional(),createdAt:a3({offset:!0}).pipe(a6()),modifiedAt:a3({offset:!0}).pipe(a6()),stats:lV().nullable().optional(),isPublic:re().optional()})),lJ=a8(()=>a5().extend({items:ru(lH())})),lY=a8(()=>rd({build:nU().nullable().optional(),timeoutSecs:n5().nullable().optional(),memoryMbytes:n5().nullable().optional(),maxItems:n5().nullable().optional(),maxTotalChargeUsd:n6().nullable().optional(),restartOnError:re().nullable().optional(),isMaxTotalChargeUsdSetByUser:re().nullable().optional(),forcePermissionLevel:si().nullable().optional()})),lX=a8(()=>rv(nU(),rn())),lQ=a8(()=>rd({publishedAt:a3({offset:!0}).pipe(a6()).nullable().optional(),seoTitle:nU().max(60).nullable().optional(),seoDescription:nU().max(160).nullable().optional(),inputSchemaFields:ru(nU()).nullable().optional(),datasetName:nU().nullable().optional(),datasetView:nU().nullable().optional(),categorization:nU().nullable().optional(),highlightedFields:ru(nU()).nullable().optional(),faq:ru(rd({question:nU(),answer:nU()})).nullable().optional()})),l0=a8(()=>rd({id:nU(),userId:nU(),actId:nU(),name:nU(),nameLowerCase:nU().optional(),username:nU().nullable().optional(),createdAt:a3({offset:!0}).pipe(a6()),modifiedAt:a3({offset:!0}).pipe(a6()),removedAt:a3({offset:!0}).pipe(a6()).nullable().optional(),stats:lV().nullable().optional(),options:lY().nullable().optional(),input:rh([lX(),ru(lX())]).nullable().optional(),title:nU().nullable().optional(),description:nU().nullable().optional(),actorStandby:sl().nullable().optional(),standbyUrl:nq({normalize:!0}).nullable().optional(),isPublic:re().optional(),publicConfig:lQ().nullable().optional()})),l1=a8(()=>rd({readCount:n5().optional(),writeCount:n5().optional(),deleteCount:n5().optional(),listCount:n5().optional(),s3StorageBytes:n5().optional()})),l2=a8(()=>rd({id:nU(),name:nU().nullable().optional(),title:nU().nullable().optional(),userId:nU().nullable().optional(),username:nU().nullable().optional(),createdAt:a3({offset:!0}).pipe(a6()),modifiedAt:a3({offset:!0}).pipe(a6()),accessedAt:a3({offset:!0}).pipe(a6()),actId:nU().nullable().optional(),actRunId:nU().nullable().optional(),schema:rh([rv(nU(),rn()),nU()]).nullable().optional(),generalAccess:s6().nullable().optional(),stats:l1().optional()})),l4=a8(()=>a5().extend({unnamed:re().optional(),items:ru(l2())})),l9=a8(()=>rd({id:nU(),name:nU().nullable().optional(),userId:nU(),createdAt:a3({offset:!0}).pipe(a6()),modifiedAt:a3({offset:!0}).pipe(a6()),accessedAt:a3({offset:!0}).pipe(a6()),itemCount:n5(),cleanItemCount:n5(),actId:nU().nullable().optional(),actRunId:nU().nullable().optional(),title:nU().nullable().optional(),username:nU().optional(),generalAccess:s6().nullable().optional(),stats:lt().optional()})),l3=a8(()=>a5().extend({unnamed:re().optional(),items:ru(l9())})),l6=a8(()=>rd({deleteCount:n5().optional(),headItemReadCount:n5().optional(),readCount:n5().optional(),writeCount:n5().optional(),s3StorageBytes:n5().optional(),dynamodbStorageBytes:n5().optional()})),l8=a8(()=>rd({id:lu(),name:nU().nullable().optional(),title:nU().nullable().optional(),userId:lc(),username:nU().optional(),createdAt:lp(),modifiedAt:ld(),accessedAt:lf(),expireAt:a3({offset:!0}).pipe(a6()).optional(),totalRequestCount:lh(),handledRequestCount:lm(),pendingRequestCount:lg(),actId:nU().nullable().optional(),actRunId:nU().nullable().optional(),hadMultipleClients:ly(),generalAccess:s6().nullable().optional(),stats:l6().optional()})),l5=a8(()=>a5().extend({unnamed:re().optional(),items:ru(l8())})),l7=a8(()=>rd({id:nU(),createdAt:a3({offset:!0}).pipe(a6()),modifiedAt:a3({offset:!0}).pipe(a6()),userId:nU(),isAdHoc:re().nullable().optional(),isApifyIntegration:re().optional(),isEnabled:re().optional(),actionType:nU().optional(),shouldInterpolateStrings:re().nullable().optional(),eventTypes:ru(sC()),condition:sP(),ignoreSslErrors:re(),doNotRetry:re(),requestUrl:nq({normalize:!0}).nullable().optional(),headersTemplate:nU().nullable().optional(),title:nU().nullable().optional(),description:nU().nullable().optional(),slackMessage:sI().optional(),googleMail:sz().optional(),googleDrive:sL().optional(),githubIssue:sN().optional(),lastDispatch:sD().nullable().optional(),stats:sM().nullable().optional()})),ue=a8(()=>a5().extend({items:ru(l7())})),ut=a8(()=>rd({_id:nU().optional(),actionType:nU().optional(),condition:sP().optional(),requestUrl:nq({normalize:!0}).nullable().optional(),isAdHoc:re().optional(),isApifyIntegration:re().nullable().optional(),slackMessage:sI().optional(),googleMail:sz().optional(),googleDrive:sL().optional(),githubIssue:sN().optional()})),ui=a8(()=>rd({id:nU(),userId:nU(),webhookId:nU(),createdAt:a3({offset:!0}).pipe(a6()),status:s$(),eventType:sC(),eventData:rd({actorId:nU(),actorRunId:nU().optional(),actorBuildId:nU().optional(),actorTaskId:nU().nullable().optional()}).nullable().optional(),webhook:ut().nullable().optional(),calls:ru(rd({startedAt:a3({offset:!0}).pipe(a6()).nullable().optional(),finishedAt:a3({offset:!0}).pipe(a6()).nullable().optional(),errorMessage:nU().nullable().optional(),responseStatus:n5().nullable().optional(),responseBody:nU().nullable().optional(),debugPostMessage:rv(nU(),rn()).optional()})).optional()})),un=a8(()=>a5().extend({items:ru(ui())})),ur=a8(()=>rd({id:nU(),userId:nU(),name:nU(),cronExpression:nU(),timezone:nU(),isEnabled:re(),isExclusive:re(),createdAt:a3({offset:!0}).pipe(a6()),modifiedAt:a3({offset:!0}).pipe(a6()),nextRunAt:a3({offset:!0}).pipe(a6()).nullable().optional(),lastRunAt:a3({offset:!0}).pipe(a6()).nullable().optional()})),uo=a8(()=>rd({email:re().optional()})),ua=a8(()=>rd({id:nU(),type:rS("RUN_ACTOR"),actorId:nU()})),us=a8(()=>rd({id:nU(),type:rS("RUN_ACTOR_TASK"),actorTaskId:nU()})),ul=a8(()=>rg("type",[ua(),us()])),uu=a8(()=>ur().extend({title:nU().nullable().optional(),notifications:uo().optional(),integrationTracking:s9().optional(),actions:ru(ul())})),uc=a8(()=>a5().extend({items:ru(uu())})),up=a8(()=>rd({body:nU().nullable().optional(),contentType:nU().nullable().optional()})),ud=a8(()=>rd({version:n5().optional(),data:rd({cronExpression:nU().optional(),timezone:nU().optional()}).optional()}).nullable()),uf=a8(()=>rd({id:nU(),type:rS("RUN_ACTOR"),actorId:nU(),runInput:up().nullable().optional(),runOptions:lY().nullable().optional()})),uh=a8(()=>rd({id:nU(),type:rS("RUN_ACTOR_TASK"),actorTaskId:nU(),input:rv(nU(),rn()).nullable().optional()})),um=a8(()=>rg("type",[uf(),uh()])),ug=a8(()=>ur().extend({description:nU().nullable().optional(),title:nU().nullable().optional(),notifications:uo().optional(),uiState:ud().optional(),integrationTracking:s9().optional(),actions:ru(um())})),uy=a8(()=>rd({message:nU(),level:nU(),createdAt:a3({offset:!0}).pipe(a6())})),ub=a8(()=>rd({pricingModel:nU(),apifyMarginPercentage:n6().optional(),createdAt:a3({offset:!0}).pipe(a6()).optional(),startedAt:a3({offset:!0}).pipe(a6()).optional(),notifiedAboutChangeAt:a3({offset:!0}).pipe(a6()).nullable().optional(),notifiedAboutFutureChangeAt:a3({offset:!0}).pipe(a6()).nullable().optional(),isPriceChangeNotificationSuppressed:re().optional(),forceContainsSignificantPriceChange:re().optional(),isPPEPlatformUsagePaidByUser:re().optional(),reasonForChange:nU().nullable().optional(),minimalMaxTotalChargeUsd:n6().nullable().optional(),pricingPerEvent:rv(nU(),rn()).nullable().optional(),pricePerUnitUsd:n6().optional(),trialMinutes:n5().optional(),unitName:nU().optional(),tieredPricing:rv(nU(),rd({tieredPricePerUnitUsd:n6().optional()})).optional(),notifiedAboutRentalToPpePriceChangeAt:a3({offset:!0}).pipe(a6()).nullable().optional()})),uv=a8(()=>rd({id:nU(),title:nU(),name:nU(),username:nU(),userFullName:nU().nullable().optional(),description:nU().nullable().optional(),categories:ru(nU()).optional(),notice:sO().optional(),pictureUrl:nU().nullable().optional(),userPictureUrl:nq({normalize:!0}).nullable().optional(),url:nq({normalize:!0}).nullable().optional(),stats:rd({totalUsers:n5(),totalRuns:n5().optional(),totalUsers7Days:n5().optional(),totalUsers30Days:n5().optional(),totalUsers90Days:n5().optional(),actorReviewRating:n6(),actorReviewCount:n5()}),currentPricingInfo:ub().optional(),isWhiteListedForAgenticPayments:re().nullable().optional(),isVerified:re().optional(),badge:nU().nullable().optional(),readmeSummary:nU().optional(),inputSchema:rd({type:nU(),properties:rv(nU(),rd({type:rh([nU(),ru(nU())]).optional()})),required:ru(nU()).optional()}).optional()})),u_=a8(()=>a5().extend({items:ru(uv())})),uw=a8(()=>rd({bio:nU().nullable().optional(),readme:nU().nullable().optional(),name:nU().optional(),pictureUrl:nq({normalize:!0}).nullable().optional(),githubUsername:nU().nullable().optional(),websiteUrl:nq({normalize:!0}).nullable().optional(),twitterUsername:nU().nullable().optional()})),uE=a8(()=>rd({id:nU().optional(),name:nU(),description:nU().nullable(),availableCount:n5().optional()})),uS=a8(()=>rd({password:nU().nullable().optional(),groups:ru(uE())})),uT=a8(()=>rv(nU(),n5())),uR=a8(()=>rd({id:nU().optional(),description:nU().optional(),isEnabled:re().optional(),monthlyBasePriceUsd:n6().optional(),monthlyUsageCreditsUsd:n6().optional(),usageDiscountPercent:n6().optional(),enabledPlatformFeatures:ru(nU()).optional(),maxMonthlyUsageUsd:n6().optional(),maxActorMemoryGbytes:n6().optional(),maxMonthlyActorComputeUnits:n6().optional(),maxMonthlyResidentialProxyGbytes:n6().optional(),maxMonthlyProxySerps:n5().optional(),maxMonthlyExternalDataTransferGbytes:n6().optional(),maxActorCount:n5().optional(),maxActorTaskCount:n5().optional(),dataRetentionDays:n5().optional(),availableProxyGroups:uT(),teamAccountSeatCount:n5().optional(),supportLevel:nU().optional(),availableAddOns:ru(nU()).optional(),tier:nU().optional(),apiRateLimitBoosts:n5().optional(),maxScheduleCount:n5().optional(),maxConcurrentActorRuns:n5().optional(),planPricing:rv(nU(),rn()).optional(),planVersion:n6().optional(),legacyPlanId:nU().optional(),planTags:ru(nU()).optional(),overageThresholdUsd:n6().optional(),maxMonthlyUnblockerUnits:n5().optional(),maxPublicActorTaskCount:n5().optional(),maxPublicActorTaskCountPerActor:n5().optional(),forceBillingInterval:nU().optional(),personalizedSupport:nU().nullable().optional(),monitoringLevel:rw(["STANDARD"]).or(nU()).nullable().optional(),isPayingCustomer:re().optional()})),uO=a8(()=>rd({isEnabled:re(),disabledReason:nU().nullable(),disabledReasonType:nU().nullable(),isTrial:re(),trialExpirationAt:a3({offset:!0}).pipe(a6()).nullable()})),ux=a8(()=>rd({ACTORS:uO(),STORAGE:uO(),SCHEDULER:uO(),PROXY:uO(),PROXY_EXTERNAL_ACCESS:uO(),PROXY_RESIDENTIAL:uO(),PROXY_SERPS:uO(),WEBHOOKS:uO(),ACTORS_PUBLIC_ALL:uO(),ACTORS_PUBLIC_DEVELOPER:uO()})),uA=a8(()=>rd({id:nU().optional(),username:nU(),profile:uw().optional(),email:nU().nullable().optional(),proxy:uS().optional(),plan:uR().optional(),effectivePlatformFeatures:ux().optional(),createdAt:a3({offset:!0}).pipe(a6()).optional(),isPaying:re().optional(),organizationOwnerUserId:nU().nullable().optional()})),uk=a8(()=>rd({startAt:a3({offset:!0}).pipe(a6()),endAt:a3({offset:!0}).pipe(a6())})),uC=a8(()=>rd({quantityAbove:n6(),discountPercent:n6(),tierQuantity:n6(),unitPriceUsd:n6(),priceUsd:n6()})),uP=a8(()=>rd({quantity:n6(),baseAmountUsd:n6(),baseUnitPriceUsd:n6().optional(),amountAfterVolumeDiscountUsd:n6().optional(),priceTiers:ru(uC()).optional()})),uI=a8(()=>rv(nU(),uP())),uU=a8(()=>rv(nU(),uP())),uz=a8(()=>rd({date:a3({offset:!0}).pipe(a6()),serviceUsage:uU(),totalUsageCreditsUsd:n6()})),uL=a8(()=>rd({usageCycle:uk(),monthlyServiceUsage:uI(),dailyServiceUsages:ru(uz()),totalUsageCreditsUsdBeforeVolumeDiscount:n6(),totalUsageCreditsUsdAfterVolumeDiscount:n6()})),uN=a8(()=>rd({maxMonthlyUsageUsd:n6(),maxMonthlyActorComputeUnits:n6(),maxMonthlyExternalDataTransferGbytes:n6(),maxMonthlyProxySerps:n5(),maxMonthlyResidentialProxyGbytes:n6(),maxActorMemoryGbytes:n6(),maxActorCount:n5(),maxActorTaskCount:n5(),maxConcurrentActorJobs:n5(),maxTeamAccountSeatCount:n5(),dataRetentionDays:n5(),maxScheduleCount:n5().optional(),maxMonthlyUnblockerUnits:n6().optional()})),u$=a8(()=>rd({monthlyUsageUsd:n6(),monthlyActorComputeUnits:n6(),monthlyExternalDataTransferGbytes:n6(),monthlyProxySerps:n5(),monthlyResidentialProxyGbytes:n6(),actorMemoryGbytes:n6(),actorCount:n5(),actorTaskCount:n5(),activeActorJobCount:n5(),teamAccountSeatCount:n5(),scheduleCount:n5().optional(),monthlyUnblockerUnits:n6().optional()})),uD=a8(()=>rd({monthlyUsageCycle:uk(),limits:uN(),current:u$()})),uM=a8(()=>{let e=sY();return e.extend({actVersion:e.shape.actVersion.unwrap().extend({buildTag:nU().nullable().optional()}).optional()})}),uj=a8(()=>ug().extend({uiState:ud().nullable().optional()})),uB=new Set(["actor-memory-limit-exceeded","concurrent-runs-limit-exceeded"]);async function uF(e,t,i,n){if(!t)return e();let r=!0===t?1/0:Date.now()+1e3*t;for(;;)try{return await e()}catch(o){if(!(o instanceof oz)||!uB.has(o.type??""))throw o;let e=r-Date.now();if(e<=0)throw o;let t=Math.min(1e4,e);i.info(`Not enough resources to start the run, retrying in ${Number((t/1e3).toPrecision(3))}s: ${o.message}`),await ay(t,n),n?.throwIfAborted()}}let uq=rp({raw:re().optional(),...aN}),uZ=uq.extend({buffer:re().optional()});let uW=class LogClient extends a9{constructor(e){super({resourcePath:"logs",...e})}async get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="long",signal:i,buffer:n,...r}=oH(e,uZ,"LogGetOptions"),o={url:this.buildUrl(),method:"GET",params:this.buildParams(r),timeoutSecs:t,signal:i};n&&(o.responseType="buffer");try{return(await this.httpClient.call(o)).data}catch(e){at(e,this.id)}}async stream(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="long",signal:i,raw:n}=oH(e,uq,"LogOptions"),r={url:this.buildUrl(),method:"GET",params:this.buildParams({stream:!0,raw:n}),responseType:"stream",timeoutSecs:t,signal:i};try{return(await this.httpClient.call(r)).data}catch(e){at(e,this.id)}}};let uK=class LoggerActorRedirect extends oy{constructor(e={}){super({skipTime:!0,level:op.DEBUG,...e})}_log(e,t,i,n){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};if(e>this.options.level)return;if(i||n)throw Error("Redirect logger does not use other arguments than level and message");let{prefix:o}=r;o=o?`${o}`:"";let a="";this.options.skipTime||(a=`${new Date().toISOString().replace("Z","").replace("T"," ")} `);let s=`${ow().gray(a)}${ow().cyan(o)}${t||""}`;return this._outputWithConsole(op.INFO,s),s}};let uG=class StreamedLog{#b;#v=[];#_=new TextDecoder;#w=/(?:\n|^)(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z)/g;#E;#S;#T;#R=null;#O=!1;#x=new AbortController;#A=new AbortController;constructor(e){let{toLog:t,logClient:i,fromStart:n=!0,signal:r}=e;this.#b=t,this.#S=i,this.#T=r,this.#E=n?null:new Date}start(){if(this.#R)throw Error("Streaming task already active");this.#O=!1,this.#x=new AbortController,this.#A=new AbortController,this.#R=this.#k()}async stop(){if(!this.#R)throw Error("Streaming task is not active");this.#O=!0,this.#A.abort();let e=this.#x,t=setTimeout(()=>e.abort(),1e3);try{await this.#R}catch(e){if(!(e instanceof Error&&"AbortError"===e.name))throw e}finally{clearTimeout(t),this.#R=null}}async #k(){let e=this.#T?AbortSignal.any([this.#T,this.#x.signal]):this.#x.signal;try{let t,i=500;for(;!t;){let n;if(this.#O){let i=await this.#S.get({raw:!0,signal:this.#T});t=await this.#C([new TextEncoder().encode(i??"")],e);break}try{n=await this.#S.stream({raw:!0,signal:e})}catch(e){if(this.#O&&!this.#T?.aborted)continue;throw e}if(!n)return;if(this.#O){await n.cancel().catch(()=>{});continue}(t=await this.#C(n,e))||(await ay(i,AbortSignal.any([e,this.#A.signal])),i=Math.min(2*i,5e3))}let n=this.#_.decode(t).trim();n.length&&this.#b.info(n)}catch(t){if(e.aborted)return;ok.warning("Log redirection stopped due to error",t)}}async #C(e,t){let i;try{for await(let t of e){i??=new Uint8Array;let e=new Uint8Array(i.length+t.length);e.set(i,0),e.set(t,i.length);let n=e.lastIndexOf(10);if(i=e.slice(n),this.#v.push(e.slice(0,n)),this.#P(),this.#O)break}}catch(e){if(!t.aborted)throw e}return i}#P(){let e=this.#_.decode(function(e){let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0)),i=0;for(let n of e)t.set(n,i),i+=n.length;return t}(this.#v)).split(this.#w).slice(1),t=e.filter((e,t)=>t%2==0),i=e.filter((e,t)=>t%2!=0);this.#v=[],t.forEach((e,t)=>{let n=i[t];this.#E&&new Date(e)<this.#E||this.#b.info((e+n).trim())})}};let uV=rp({waitForFinish:n6().optional(),...aN}),uH=rp({waitSecs:n6().optional(),...aN});let uJ=class BuildClient extends a9{constructor(e){super({resourcePath:"actor-builds",...e})}async get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t,signal:i,...n}=oH(e,uV,"BuildClientGetOptions");return this.getResource(uM(),n,this.timeoutForWaitForFinish(t,"short",n.waitForFinish),i)}async abort(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:i}=oH(e,a$,"TimeoutOptions");return o7(await this.httpClient.call({url:this.buildUrl("abort"),method:"POST",params:this.buildParams(),timeoutSecs:t,signal:i}),uM())}async delete(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:i}=oH(e,a$,"TimeoutOptions");return this.deleteResource(t,i)}async getOpenApiDefinition(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="medium",signal:i}=oH(e,a$,"TimeoutOptions");return(await this.httpClient.call({url:this.buildUrl("openapi.json"),method:"GET",params:this.buildParams(),timeoutSecs:t,signal:i})).data}async waitForFinish(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=oH(e,uH,"BuildClientWaitForFinishOptions");return this.waitForJobFinish(uM(),t)}log(){return new uW(this.subResourceOptions({resourcePath:"log"}))}};let uY=class ResourceCollectionClient extends a4{async listResources(e,t,i,n){return o7(await this.httpClient.call({url:this.buildUrl(),method:"GET",params:this.buildParams(t),timeoutSecs:i,signal:n}),e)}listUnpaginatedResources(e,t,i){let n=this.listResources(e,void 0,t,i);return Object.defineProperty(n,Symbol.asyncIterator,{async *value(){yield*(await n).items}})}listResourcesPaginated(e,t,i){let{timeoutSecs:n=i,signal:r,...o}=t;return this.listPaginatedFromCallback(async t=>this.listResources(e,t,n,r),o)}async createResource(e,t,i,n){return o7(await this.httpClient.call({url:this.buildUrl(),method:"POST",params:this.buildParams(),data:t,timeoutSecs:i,signal:n}),e)}async getOrCreateResource(e,t,i,n,r){return o7(await this.httpClient.call({url:this.buildUrl(),method:"POST",params:this.buildParams({name:t}),data:i,timeoutSecs:n,signal:r}),e)}};let uX=rp({...ad,desc:re().optional(),...aN});let uQ=class BuildCollectionClient extends uY{constructor(e){super({...e,resourcePath:e.resourcePath||"actor-builds"})}list(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=oH(e,uX,"BuildCollectionClientListOptions");return this.listResourcesPaginated(sW(),t,"medium")}};let u0=[429,503],u1=/^(\d+)\.(\d+)\.(\d+)$/;function u2(e){let t=u1.exec(e??"");if(t)return[Number(t[1]),Number(t[2]),Number(t[3])]}let u4=rp({method:rw(["GET","HEAD","POST","PUT","DELETE","CONNECT","OPTIONS","TRACE","PATCH"]).optional(),params:rv(nU(),rn()).optional(),headers:rv(nU(),nU()).optional(),data:rn().optional(),parentRequestId:nU().optional(),compression:ak.optional(),responseType:rw(["parsed","buffer","stream"]).optional(),...aN});let u9=class ActorServerClient extends a9{#I;constructor(e){super({resourcePath:"actors",...e})}async getUrl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:i}=oH(e,a$,"TimeoutOptions"),n=this.#I??=this.#U(t,i).then(e=>e.standbyUrl);try{return await n}catch(e){throw this.#I===n&&(this.#I=void 0),e}}async getOpenApiSpec(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:i}=oH(e,a$,"TimeoutOptions"),n=await this.#U(t,i),r=n.actorStandby?.build||"latest",o=n.taggedBuilds?.[r]?.buildId??void 0,a=u2(r);if(void 0===o&&void 0!==a)for await(let e of new uQ(this.subResourceOptions({resourcePath:"builds"})).list({desc:!0,timeoutSecs:t,signal:i})){if(e.buildNumber===r){o=e.id;break}if(function(e,t){let i=u2(e);return void 0!==i&&i[0]===t[0]&&i[1]===t[1]&&i[2]<t[2]}(e.buildNumber,a))break}let s=void 0===o?void 0:await new uJ({baseUrl:this.apifyClient.baseUrl,publicBaseUrl:this.apifyClient.publicBaseUrl,httpClient:this.httpClient,apifyClient:this.apifyClient,id:o}).get({timeoutSecs:t,signal:i});if(void 0===s)throw new oP(`Build ${r} of Actor ${this.id} does not exist.`);return s.actorDefinition?.webServerSchema}async request(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,nU());let{method:i="GET",params:n,headers:r,data:o,parentRequestId:a,compression:s,responseType:l,timeoutSecs:u="long",signal:c}=oH(t,u4,"ActorServerRequestOptions"),p=await this.getUrl({signal:c}),d=e.split("#")[0].replace(/^\/+/,"");return this.httpClient.call({url:`${p.replace(/\/+$/,"")}/${d}`,method:i,params:n,headers:void 0===a?r:aK(r??{},{"X-Actor-Request-ID":a}),data:o,compression:void 0!==s&&aC(s),authorizationHeader:"X-Apify-Authorization",throwOnErrorStatus:!1,retryStatusCodes:u0,retryTransportErrors:!1,followRedirects:!1,responseType:l,timeoutSecs:u,signal:c})}async #U(e,t){let i=o7(await this.httpClient.call({url:this.buildUrl(),method:"GET",params:this.buildParams(),timeoutSecs:e,signal:t}),sx());if(!i.standbyUrl)throw new oP(`Actor ${this.id} is not a Server Actor.`);return this.#I=Promise.resolve(i.standbyUrl),i}};let u3=class ActorEnvVarClient extends a9{constructor(e){super({resourcePath:"env-vars",...e})}async get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:i}=oH(e,a$,"TimeoutOptions");return this.getResource(sp(),{},t,i)}async update(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,o6);let{timeoutSecs:i="short",signal:n}=oH(t,a$,"TimeoutOptions");return this.updateResource(sp(),e,i,n)}async delete(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:i}=oH(e,a$,"TimeoutOptions");return this.deleteResource(t,i)}};let u6=o6.optional();let u8=class ActorEnvVarCollectionClient extends uY{constructor(e){super({resourcePath:"env-vars",...e})}list(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:i}=oH(e,a$,"TimeoutOptions");return this.listUnpaginatedResources(sk(),t,i)}async create(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,u6);let{timeoutSecs:i="short",signal:n}=oH(t,a$,"TimeoutOptions");return this.createResource(sp(),e,i,n)}};var u5=((r7={}).Active="ACTIVE",r7.Succeeded="SUCCEEDED",r7.Failed="FAILED",r7),u7=((oe={}).SourceFiles="SOURCE_FILES",oe.GitRepo="GIT_REPO",oe.Tarball="TARBALL",oe.GitHubGist="GITHUB_GIST",oe.SourceCode="SOURCE_CODE",oe),ce=((ot={}).RunActor="RUN_ACTOR",ot.RunActorTask="RUN_ACTOR_TASK",ot),ct=((oi={}).Actors="ACTORS",oi.Storage="STORAGE",oi.ProxySERPS="PROXY_SERPS",oi.Scheduler="SCHEDULER",oi.Webhooks="WEBHOOKS",oi.Proxy="PROXY",oi.ProxyExternalAccess="PROXY_EXTERNAL_ACCESS",oi);let ci=nU().min(1);let cn=class ActorVersionClient extends a9{constructor(e){super({resourcePath:"versions",...e})}async get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:i}=oH(e,a$,"TimeoutOptions");return this.getResource(sd(),{},t,i)}async update(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,o6);let{timeoutSecs:i="short",signal:n}=oH(t,a$,"TimeoutOptions");return this.updateResource(sd(),e,i,n)}async delete(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:i}=oH(e,a$,"TimeoutOptions");return this.deleteResource(t,i)}envVar(e){return oH(e,ci),new u3(this.subResourceOptions({id:e}))}envVars(){return new u8(this.subResourceOptions())}};let cr=o6.optional();let co=class ActorVersionCollectionClient extends uY{constructor(e){super({resourcePath:"versions",...e})}list(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:i}=oH(e,a$,"TimeoutOptions");return this.listUnpaginatedResources(sA(),t,i)}async create(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,cr);let{timeoutSecs:i="short",signal:n}=oH(t,a$,"TimeoutOptions");return this.createResource(sd(),e,i,n)}};let ca="toBSON",cs="toString",cl="_bsontype";RegExp(`(.|^$|^${ca}$|^${cl}|^${cs}$)`),RegExp(".","g"),RegExp("^$"),RegExp(`^${ca}$`),RegExp(`^${cs}$`),RegExp(`^${cl}$`),RegExp("^(anonymous|page-not-found|docs|terms-of-use|about|pricing|privacy-policy|customers|request-form|request-solution|release-notes|jobs|api-reference|video-tutorials|acts|key-value-stores|schedules|account|sign-up|sign-in-discourse|admin|documentation|change-password|enroll-account|forgot-password|reset-password|sign-in|verify-email|live-status|browser-info|webhooks|health-check|api|change-log|dashboard|community|crawlers|ext|schemas|admin|administration|crawler|act|library|lib|apifier|team|contact|doc|documentation|for-business|for-developers|developers|business|integrations|job|setting|settings|privacy|policy|assets|help|config|configuration|terms|hiring|hire|status|status-page|solutions|support|market|marketplace|download|downloads|username|users|user|login|logout|signin|sign|signup|sign-out|signout|plugins|plug-ins|reset|password|passwords|square|profile-photos|profiles|true|false|js|css|img|images|image|partials|fonts|font|dynamic_templates|app|schedules|community|storage|storages|account|node_modules|bower_components|video|knowledgebase|forum|customers|blog|health-check|health|anim|forum_topics.json|forum_categories.json|me|you|him|she|it|external|actor|crawler|scheduler|api|sdk|puppeteer|webdriver|selenium|(selenium.*webdriver)|undefined|page-analyzer|wp-login.php|welcome.action|echo|proxy|super-proxy|gdpr|case-studies|use-cases|how-to|kb|cookies|cookie-policy|cookies-policy|powered-by|run|runs|actor|actors|act|acts|success-stories|roadmap|join-marketplace|presskit|press-kit|covid-19|covid|covid19|matfyz|ideas|public-actors|resources|partners|affiliate|industries|web-scraping|custom-solutions|solution-provider|alternatives|platform|freelancers|freelancer|partner|preview|templates|data-for-generative-ai|discord|praguecrawl|prague-crawl|bob|ai-agents|reel|video-reel|mcp|mcpc|model-context-protocol|modelcontextprotocol|apify.com|design-kit|press-kit|scrapers|professional-services|challenge|challange|1m-challenge|1m-usd-challenge|contact-sales|creator|creators|creator-plan|request-an-integration|whitepaper|adviser|crawlee|ultimate-scraper|agent-skills|key-value-store|request-queue|request-queues|build|builds|dataset|datasets|schedule|standby|pay-per-event|pay-per-result|pay-per-usage|ppe|ppr|compute-unit|compute-units|agent|agents|agentic|llms|llm|openai|anthropic|claude|copilot|mistral|gemini|llama|chatbot|chatgpt|prompt|prompts|embeddings|vectors|rag|agentic-commerce|agentic-economy|agentic-payments|a2a|a2b|a2p|ap2|b2a|acp|ucp|mpp|x402|l402|anp|agp|erc-8004|kya|kyapay|official|verified|certified|authorized|partner-official|gold-partner|premium-partner|staff|moderator|apify-admin|console|cli|studio|gateway|workbench|agents-marketplace|agents-store|mcp-server|mcp-servers|mcp-gateway|asia|latam|emea|apac|i18n|l10n|localization|localisation|usd|eur|gbp|jpy|cny|usdc|usdt|btc|eth|sol|crypto|fiat|stablecoin|stablecoins|payment|payments|payout|payouts|invoice|invoices|wallet|soc|soc2|iso|iso-27001|hipaa|ccpa|pci|pci-dss|dpa|dpia|dmca|sla|eula|aml|kyc|contributor|contributors|maintainer|maintainers|core-team|oss|open-source|opensource|open-source-software|spam|scam|phishing|malware|hack|hacked|giveaway|airdrop|bitcoin-giveaway|free-credits|free-money|launch|launches|webinar|webinars|meetup|meetups|summit|conference|conferences|org|orgs|organisation|workspace|workspaces|tenant|tenants|role|roles|permission|permissions|saml|scim|token|tokens|apikey|api-key|api-keys|keys|secret|secrets|coupon|coupons|discount|discounts|promos|refund|refunds|credit|credits|billing-portal|production|prod|canary|internal|restricted|conversations|reactions|mentions|channel|channels|inbox|no-reply|noreply|accessibility|imprint|impressum|trust|trust-center|security-center|brand|branding|support-team|abuse|outage|incident|incidents|what-is-new|whatsnew|index|index\\.html|(favicon\\.[a-z]+)|BingSiteAuth.xml|(google.+\\.html)|robots\\.txt|(sitemap\\.[a-z]+)|(apple-touch-icon.*)|security-whitepaper\\.pdf|security\\.txt|llms\\.txt|llms-full\\.txt|(.*\\.md)|(\\..*)|(xxx-.*)|((.+[^a-z]|)porn([^a-z].+|))|((.+[^a-z]|)vagina([^a-z].+|))|((.+[^a-z]|)dildo([^a-z].+|))|((.+[^a-z]|)nsfw([^a-z].+|))|((.+[^a-z]|)hentai([^a-z].+|))|((.+[^a-z]|)cunt([^a-z].+|))|((.+[^a-z]|)fuck([^a-z].+|))|((.+[^a-z]|)shit([^a-z].+|))|((.+[^a-z]|)bitch([^a-z].+|))|((.+[^a-z]|)slut([^a-z].+|))|((.+[^a-z]|)whore([^a-z].+|))|((.+[^a-z]|)boob([^a-z].+|))|((.+[^a-z]|)tits([^a-z].+|))|((.+[^a-z]|)cock([^a-z].+|))|((.+[^a-z]|)anus([^a-z].+|))|((.+[^a-z]|)pussy([^a-z].+|))|((.+[^a-z]|)nude([^a-z].+|))|((.+[^a-z]|)penis([^a-z].+|))|((.+[^a-z]|)naked([^a-z].+|))|(install-cli\\..*)|([^0-9a-z].*)|(.*[^0-9a-z])|(.*[_.\\-]{2}.*)|0|about|access|account|accounts|activate|activities|activity|ad|add|address|adm|admin|administration|administrator|ads|adult|advertising|affiliate|affiliates|ajax|all|alpha|analysis|analytics|android|anon|anonymous|api|app|apps|archive|archives|article|asct|asset|atom|auth|authentication|avatar|backup|balancer-manager|banner|banners|beta|billing|bin|blog|blogs|board|book|bookmark|bot|bots|bug|business|cache|cadastro|calendar|call|campaign|cancel|captcha|career|careers|cart|categories|category|cgi|cgi-bin|changelog|chat|check|checking|checkout|client|cliente|clients|code|codereview|comercial|comment|comments|communities|community|company|compare|compras|config|configuration|connect|contact|contact-us|contact_us|contactus|contest|contribute|corp|create|css|dashboard|data|db|default|delete|demo|design|designer|destroy|dev|devel|developer|developers|diagram|diary|dict|dictionary|die|dir|direct_messages|directory|dist|doc|docs|documentation|domain|download|downloads|ecommerce|edit|editor|edu|education|email|employment|empty|end|enterprise|entries|entry|error|errors|eval|event|events|exit|explore|facebook|faq|favorite|favorites|feature|features|feed|feedback|feeds|file|files|first|flash|fleet|fleets|flog|follow|followers|following|forgot|form|forum|forums|founder|free|friend|friends|ftp|gadget|gadgets|game|games|get|gift|gifts|gist|github|graph|group|groups|guest|guests|help|home|homepage|host|hosting|hostmaster|hostname|howto|hpg|html|http|httpd|https|i|iamges|icon|icons|id|idea|ideas|image|images|imap|img|index|indice|info|information|inquiry|instagram|intranet|invitations|invite|ipad|iphone|irc|is|issue|issues|it|item|items|java|javascript|job|jobs|join|js|json|jump|knowledgebase|language|languages|last|ldap-status|legal|license|link|links|linux|list|lists|log|log-in|log-out|log_in|log_out|login|logout|logs|m|mac|mail|mail1|mail2|mail3|mail4|mail5|mailer|mailing|maintenance|manager|manual|map|maps|marketing|master|me|media|member|members|message|messages|messenger|microblog|microblogs|mine|mis|mob|mobile|movie|movies|mp3|msg|msn|music|musicas|mx|my|mysql|name|named|nan|navi|navigation|net|network|new|news|newsletter|nick|nickname|notes|noticias|notification|notifications|notify|ns|ns1|ns10|ns2|ns3|ns4|ns5|ns6|ns7|ns8|ns9|null|oauth|oauth_clients|offer|offers|official|old|online|openid|operator|order|orders|organization|organizations|overview|owner|owners|page|pager|pages|panel|password|payment|perl|phone|photo|photoalbum|photos|php|phpmyadmin|phppgadmin|phpredisadmin|pic|pics|ping|plan|plans|plugin|plugins|policy|pop|pop3|popular|portal|post|postfix|postmaster|posts|pr|premium|press|price|pricing|privacy|privacy-policy|privacy_policy|privacypolicy|private|product|products|profile|project|projects|promo|pub|public|purpose|put|python|query|random|ranking|read|readme|recent|recruit|recruitment|register|registration|release|remove|replies|report|reports|repositories|repository|req|request|requests|reset|roc|root|rss|ruby|rule|sag|sale|sales|sample|samples|save|school|script|scripts|search|secure|security|self|send|server|server-info|server-status|service|services|session|sessions|setting|settings|setup|share|shop|show|sign-in|sign-up|sign_in|sign_up|signin|signout|signup|site|sitemap|sites|smartphone|smtp|soporte|source|spec|special|sql|src|ssh|ssl|ssladmin|ssladministrator|sslwebmaster|staff|stage|staging|start|stat|state|static|stats|status|store|stores|stories|style|styleguide|stylesheet|stylesheets|subdomain|subscribe|subscription|subscriptions|suporte|support|svn|swf|sys|sysadmin|sysadministrator|system|tablet|tablets|tag|talk|task|tasks|team|teams|tech|telnet|term|terms|terms-of-service|terms_of_service|termsofservice|test|test1|test2|test3|teste|testing|tests|theme|themes|thread|threads|tmp|todo|tool|tools|top|topic|topics|tos|tour|translations|trends|tutorial|tux|tv|twitter|undef|unfollow|unsubscribe|update|upload|uploads|url|usage|user|username|users|usuario|vendas|ver|version|video|videos|visitor|watch|weather|web|webhook|webhooks|webmail|webmaster|website|websites|welcome|widget|widgets|wiki|win|windows|word|work|works|workshop|ww|wws|www|www1|www2|www3|www4|www5|www6|www7|wwws|wwww|xfn|xml|xmpp|xpg|xxx|yaml|year|yml|you|yourdomain|yourname|yoursite|yourusername)$","i"),(on=of||(of={})).MONGODB_PING="MONGODB_PING",on.MONGODB_READ="MONGODB_READ",on.MONGODB_WRITE="MONGODB_WRITE",on.REDIS="REDIS",on.REDIS_PING="REDIS_PING",on.REDIS_WRITE="REDIS_WRITE",i("c"),i("d").Buffer,i("d").Buffer,i("d").Buffer,(or=oh||(oh={})).VERSION="v",or.USER="u";let cu="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),cc=globalThis.crypto?.subtle;async function cp(e,t){if(!cc)throw Error(`SubtleCrypto is not available in this environment.
66
+ Cause:${i??e}${r}`)}}};function aK(e,t){let i=t.toLowerCase(),n=Object.keys(e).find(e=>e.toLowerCase()===i);return void 0===n?void 0:e[n]}function aG(e,t){let i={...e};for(let[e,n]of Object.entries(t??{})){for(let t of Object.keys(i))t.toLowerCase()===e.toLowerCase()&&delete i[t];i[e]=n}return i}function aV(e,t){let i=t.toLowerCase();for(let t of Object.keys(e))t.toLowerCase()===i&&delete e[t]}function aH(e){return e?.split(";",1)[0].trim().toLowerCase()}function aJ(e,t){return"function"==typeof t?t.toString():t}function aY(e){return!!Array.isArray(e)||"object"==typeof e&&null!==e&&!(e instanceof Date)&&!ao(e)}let aX=new Set(["ETIMEDOUT","UND_ERR_CONNECT_TIMEOUT","UND_ERR_HEADERS_TIMEOUT","UND_ERR_BODY_TIMEOUT"]),aQ=new Set(["ERR_INVALID_URL","ERR_INVALID_ARG_TYPE","ERR_INVALID_ARG_VALUE","UND_ERR_INVALID_ARG","UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"]);let a0=class FetchHttpClient extends aW{#g;constructor(e={}){super(e),this.#g=e.fetch}isTimeoutError(e){if(super.isTimeoutError(e))return!0;let t=a2(e);return void 0!==t&&aX.has(t)}isRetryableTransportError(e){if(this.isTimeoutError(e))return!0;let t=a2(e)??a4(e);return!(void 0!==t&&aQ.has(t))&&(oC.fetchFailsWithCause?e instanceof TypeError&&void 0!==e.cause:e instanceof TypeError||void 0!==t)}async sendRequest(e){let t,i,{method:n,url:r,headers:o,body:a,timeoutMillis:s,stream:l,followRedirects:u,signal:c}=e,p=new AbortController,d=!1,f=()=>{clearTimeout(t),void 0===s||d||(t=setTimeout(()=>p.abort(new DOMException(`timeout of ${s}ms exceeded`,"TimeoutError")),s))};f();try{var h,m,g,y,b;let e,t,s,d,v=globalThis.location?.href;if(!oC.fetchFailsWithCause&&!URL.canParse(r,v))throw Object.assign(TypeError(`Invalid URL: ${r}`),{code:"ERR_INVALID_URL"});h=a,m=f,i=al(h)?(g=h,y=m,t=g.getReader(),new ReadableStream({async pull(i){if(!e?.byteLength){let{done:n,value:r}=await t.read();if(n)return i.close();e=r}y(),i.enqueue(e.subarray(0,65536)),e=e.subarray(65536)},async cancel(e){await t.cancel(e)}},{highWaterMark:0})):au(h)&&!a1?async function*(e,t){for await(let i of e){let e="string"==typeof i?new TextEncoder().encode(i):i;if(!(e instanceof Uint8Array)||e.byteLength<=65536){t(),yield e;continue}for(let i=0;i<e.byteLength;i+=65536)t(),yield e.subarray(i,i+65536)}}(h,m):h;let _=await (this.#g??globalThis.fetch)(r,{method:n,headers:o,body:i,redirect:u&&!ac(a)?"follow":"manual",signal:c?AbortSignal.any([c,p.signal]):p.signal,...ac(a)?{duplex:"half"}:{}});if("opaqueredirect"===_.type)throw new oP(`${n} ${r} responded with a redirect, which the client does not follow.`);return{status:_.status,headers:(b=_.headers,s=Object.fromEntries(b),(d=b.getSetCookie?.()??[]).length>0&&(s["set-cookie"]=d),s),body:l?_.body??new Blob([]).stream():await async function(e,t){let i=[],n=0,r=e.body?.getReader();for(let e=await r?.read();e&&!e.done;e=await r?.read())t(),i.push(e.value),n+=e.value.byteLength;let o=new Uint8Array(n),a=0;for(let e of i)o.set(e,a),a+=e.byteLength;return o}(_,f)}}catch(e){throw al(i)&&!i.locked&&i.cancel(e).catch(()=>{}),!this.#g&&this.isRetryableTransportError(e)&&this.#y(),e}finally{d=!0,clearTimeout(t)}}#y(){let e=oC.unusedProxyHint();e&&this.logger.warningOnce(e)}};let a1="Bun"in globalThis;function a2(e){return a4(e instanceof Error?e.cause:void 0)}function a4(e){let t=e?.code;return"string"==typeof t?t:void 0}let a9=class ApiClient{id;safeId;baseUrl;publicBaseUrl;resourcePath;url;apifyClient;httpClient;params;constructor(e){let{baseUrl:t,publicBaseUrl:i,apifyClient:n,httpClient:r,resourcePath:o,id:a,params:s={}}=e;this.id=a,this.safeId=a&&this.toSafeId(a),this.baseUrl=t,this.publicBaseUrl=i,this.resourcePath=o,this.url=a?`${t}/${o}/${ag(this.safeId)}`:`${t}/${o}`,this.apifyClient=n,this.httpClient=r,this.params=s}subResourceOptions(e){return{...{baseUrl:this.buildUrl(),publicBaseUrl:this.publicBaseUrl,apifyClient:this.apifyClient,httpClient:this.httpClient,params:this.buildParams()},...e}}buildUrl(e){return e?`${this.url}/${ay(e)}`:this.url}buildPublicUrl(e){let t=this.id?`${this.publicBaseUrl}/${this.resourcePath}/${ag(this.safeId)}`:`${this.publicBaseUrl}/${this.resourcePath}`;return e?`${t}/${ay(e)}`:t}buildParams(e){return{...this.params,...e}}toSafeId(e){return e.replaceAll("/","~")}listPaginatedFromCallback(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{chunkSize:i,...n}=t,r=ad(t.limit,i),o=e({...n,limit:r}),a=(e,t)=>{let i=Math.max(e.count??0,e.items.length);return t?Math.min(i,t):i};return Object.defineProperty(o,Symbol.asyncIterator,{value:async function*(){let s=await o;yield*s.items;let l=a(s,r),u=(t.offset??0)+l,c=t.limit?t.limit-l:void 0;for(;l>0&&(void 0===c||c>0);){let t=ad(c,i),r={...n,limit:t,offset:u};s=await e(r),yield*s.items,u+=l=a(s,t),void 0!==c&&(c-=l)}}})}};let a3=class ResourceClient extends a9{timeoutForWaitForFinish(e,t,i){if(void 0!==e)return e;if(void 0===i)return t;let n=Math.min(i,60);return n<=0?t:n+this.httpClient.timeoutMillis[t]/1e3}async getResource(e,t,i,n){let r={url:this.buildUrl(),method:"GET",params:this.buildParams(t),timeoutSecs:i,signal:n};try{let t=await this.httpClient.call(r);return o7(t,e)}catch(e){at(e,this.id)}}async updateResource(e,t,i,n){return o7(await this.httpClient.call({url:this.buildUrl(),method:"PUT",params:this.buildParams(),data:t,timeoutSecs:i,signal:n}),e)}async deleteResource(e,t){try{await this.httpClient.call({url:this.buildUrl(),method:"DELETE",params:this.buildParams(),timeoutSecs:e,signal:t})}catch(e){at(e,this.id)}}async waitForJobFinish(e){let t,i,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{waitSecs:o=999999,timeoutSecs:a="noTimeout",signal:s}=r,l=1e3*o,u=Date.now(),c=()=>{let e=Date.now();return!(e-u>=l)&&(void 0===i||!(e-i>=3e3))&&!(t&&rH.includes(t.status))};for(;;){let r=Math.max(0,Math.round((l-(Date.now()-u))/1e3)),o={url:this.buildUrl(),method:"GET",params:this.buildParams({waitForFinish:r}),timeoutSecs:a,signal:s};try{let n=await this.httpClient.call(o);t=o7(n,e),i=void 0}catch(e){ae(e),t=void 0,i??=Date.now(),n=e}if(!c())break;await ab(250,s),s?.throwIfAborted()}if(!t)throw n;return t}};function a6(e){return iE(nL,e)}function a8(e){return new ra({type:"date",coerce:!0,...L(e)})}function a5(e){let t;return()=>t??=e()}let a7=a5(()=>rd({total:n5().min(0),offset:n5().min(0),limit:n5().min(1),desc:re(),count:n5().min(0)})),se=a5(()=>rd({totalBuilds:n5().optional(),totalRuns:n5().optional(),totalUsers:n5().optional(),totalUsers7Days:n5().optional(),totalUsers30Days:n5().optional(),totalUsers90Days:n5().optional(),totalMetamorphs:n5().optional(),lastRunStartedAt:a6({offset:!0}).pipe(a8()).optional(),actorReviewCount:n5().optional(),actorReviewRating:n6().optional(),bookmarkCount:n5().optional(),publicActorRunStats30Days:rd({ABORTED:n5().optional(),FAILED:n5().optional(),SUCCEEDED:n5().optional(),"TIMED-OUT":n5().optional(),TOTAL:n5().optional()}).optional()})),st=a5(()=>rd({id:nU(),createdAt:a6({offset:!0}).pipe(a8()),modifiedAt:a6({offset:!0}).pipe(a8()),name:nU(),username:nU(),title:nU().optional(),stats:se().nullable().optional()})),si=a5(()=>a7().extend({items:ru(st())})),sn=a5(()=>rw(["LIMITED_PERMISSIONS","FULL_PERMISSIONS"]).or(nU())),sr=a5(()=>rw(["BASE64","TEXT"]).or(nU())),so=a5(()=>rd({format:sr().optional(),content:nU().optional(),name:nU()})),sa=a5(()=>rd({name:nU(),folder:re()})),ss=a5(()=>ru(rh([so(),sa()]))),sl=a5(()=>rd({build:nU().optional(),timeoutSecs:n5().optional(),memoryMbytes:n5().optional(),restartOnError:re().nullable().optional(),maxItems:n5().nullable().optional(),maxTotalChargeUsd:n6().nullable().optional(),isMaxTotalChargeUsdSetByUser:re().nullable().optional(),forcePermissionLevel:sn().nullable().optional()})),su=a5(()=>rd({isEnabled:re().nullable().optional(),desiredRequestsPerActorRun:n5().nullable().optional(),maxRequestsPerActorRun:n5().nullable().optional(),idleTimeoutSecs:n5().nullable().optional(),build:nU().nullable().optional(),memoryMbytes:n5().nullable().optional(),disableStandbyFieldsOverride:re().nullable().optional(),shouldPassActorInput:re().nullable().optional(),tenancy:rw(["SINGLE_TENANT","MULTI_TENANT"]).or(nU()).nullable().optional(),isConsoleAuthEnabled:re().nullable().optional(),isTokenlessEnabled:re().nullable().optional()})),sc=a5(()=>rd({body:nU().optional(),contentType:nU().optional()})),sp=a5(()=>rw(["SOURCE_FILES","GIT_REPO","TARBALL","GITHUB_GIST","SOURCE_CODE"]).or(nU())),sd=a5(()=>rd({name:nU(),value:nU().optional(),isSecret:re().nullable().optional(),valueHash:nU().optional()})),sf=a5(()=>rd({versionNumber:nU().regex(/^([0-9]|[1-9][0-9])\.([0-9]|[1-9][0-9])$/),sourceType:sp().nullable(),envVars:ru(sd()).nullable().optional(),applyEnvVarsToBuild:re().nullable().optional(),buildTag:nU().nullable().optional(),sourceFiles:ss().optional(),gitRepoUrl:nU().nullable().optional(),tarballUrl:nU().nullable().optional(),gitHubGistUrl:nU().nullable().optional(),actorPath:nU().min(1).max(255).nullable().optional(),githubWebhookId:n5().nullable().optional(),gitlabWebhookId:n5().nullable().optional(),bitbucketWebhookId:nU().nullable().optional()})),sh=a5(()=>rd({apifyMarginPercentage:n6(),createdAt:a6({offset:!0}).pipe(a8()),startedAt:a6({offset:!0}).pipe(a8()),notifiedAboutFutureChangeAt:a6({offset:!0}).pipe(a8()).nullable().optional(),notifiedAboutChangeAt:a6({offset:!0}).pipe(a8()).nullable().optional(),notifiedAboutRentalToPpePriceChangeAt:a6({offset:!0}).pipe(a8()).nullable().optional(),reasonForChange:nU().nullable().optional(),isPriceChangeNotificationSuppressed:re().optional(),forceContainsSignificantPriceChange:re().optional()})),sm=a5(()=>rd({tieredEventPriceUsd:n6()})),sg=a5(()=>rv(nU(),sm())),sy=a5(()=>rd({eventTitle:nU(),eventDescription:nU(),eventPriceUsd:n6().optional(),eventTieredPricingUsd:sg().optional(),isPrimaryEvent:re().optional(),isOneTimeEvent:re().nullable().optional()})),sb=a5(()=>sh().extend({pricingModel:rS("PAY_PER_EVENT"),pricingPerEvent:rd({actorChargeEvents:rv(nU(),sy()).optional()}),minimalMaxTotalChargeUsd:n6().nullable().optional(),isPPEPlatformUsagePaidByUser:re().nullable().optional()})),sv=a5(()=>rd({tieredPricePerUnitUsd:n6()})),s_=a5(()=>rv(nU(),sv())),sw=a5(()=>sh().extend({pricingModel:rS("PRICE_PER_DATASET_ITEM"),unitName:nU(),pricePerUnitUsd:n6().optional(),tieredPricing:s_().optional()})),sE=a5(()=>sh().extend({pricingModel:rS("FLAT_PRICE_PER_MONTH"),trialMinutes:n5(),pricePerUnitUsd:n6()})),sS=a5(()=>sh().extend({pricingModel:rS("FREE")})),sT=a5(()=>rg("pricingModel",[sb(),sw(),sE(),sS()])),sR=a5(()=>rd({buildId:nU().optional(),buildNumber:nU().regex(/^([0-9]|[1-9][0-9])\.([0-9]|[1-9][0-9])(\.[1-9][0-9]{0,4})$/).nullable().optional(),buildNumberInt:n5().optional(),finishedAt:a6({offset:!0}).pipe(a8()).nullable().optional()})),sO=a5(()=>rv(nU(),sR().nullable())),sx=a5(()=>rw(["NONE","RESIDENTIAL_PROXY_REQUIRED","UNDER_MAINTENANCE"]).or(nU()).nullable()),sA=a5(()=>rd({id:nU(),userId:nU(),name:nU(),username:nU(),description:nU().nullable().optional(),restartOnError:re().nullable().optional(),isPublic:re(),actorPermissionLevel:sn().optional(),createdAt:a6({offset:!0}).pipe(a8()),modifiedAt:a6({offset:!0}).pipe(a8()),stats:se(),versions:ru(sf()),pricingInfos:ru(sT()).optional(),defaultRunOptions:sl(),exampleRunInput:sc().nullable().optional(),isDeprecated:re().nullable().optional(),deploymentKey:nU().optional(),title:nU().nullable().optional(),taggedBuilds:sO().nullable().optional(),actorStandby:su().nullable().optional(),readmeSummary:nU().optional(),seoTitle:nU().nullable().optional(),seoDescription:nU().nullable().optional(),pictureUrl:nU().nullable().optional(),standbyUrl:nU().nullable().optional(),notice:sx().optional(),categories:ru(nU()).optional(),isCritical:re().optional(),isGeneric:re().optional(),isSourceCodeHidden:re().optional(),hasNoDataset:re().optional()})),sk=a5(()=>rd({total:n5(),items:ru(sf())})),sC=a5(()=>rd({total:n5(),items:ru(sd())})),sP=a5(()=>rw(["ACTOR.BUILD.ABORTED","ACTOR.BUILD.CREATED","ACTOR.BUILD.FAILED","ACTOR.BUILD.SUCCEEDED","ACTOR.BUILD.TIMED_OUT","ACTOR.RUN.ABORTED","ACTOR.RUN.CREATED","ACTOR.RUN.FAILED","ACTOR.RUN.RESURRECTED","ACTOR.RUN.SUCCEEDED","ACTOR.RUN.TIMED_OUT","TEST"]).or(nU())),sI=a5(()=>rd({actorId:nU().nullable().optional(),actorTaskId:nU().nullable().optional(),actorRunId:nU().nullable().optional()})),sU=a5(()=>rd({userIntegrationId:nU().optional(),channelId:nU().optional(),messageTemplate:nU().optional()})),sz=a5(()=>rd({fields:ru(nU()).optional(),omit:ru(nU()).optional()})),sL=a5(()=>rd({userIntegrationId:nU().optional(),emailTo:ru(nU()).optional(),subject:nU().optional(),body:nU().optional(),attachmentFormat:nU().optional(),attachmentTransformation:sz().optional()})),sN=a5(()=>rd({userIntegrationId:nU().optional(),filename:nU().optional(),format:nU().nullable().optional(),transformation:sz().optional()})),s$=a5(()=>rd({userIntegrationId:nU().optional(),repository:nU().optional(),title:nU().optional(),body:nU().optional()})),sD=a5(()=>rw(["ACTIVE","SUCCEEDED","FAILED"]).or(nU())),sM=a5(()=>rd({status:sD(),finishedAt:a6({offset:!0}).pipe(a8()).nullable().optional(),removedAt:a6({offset:!0}).pipe(a8()).nullable().optional()})),sj=a5(()=>rd({totalDispatches:n5().optional()})),sB=a5(()=>rd({id:nU(),createdAt:a6({offset:!0}).pipe(a8()),modifiedAt:a6({offset:!0}).pipe(a8()),userId:nU(),isAdHoc:re().nullable().optional(),isEnabled:re().optional(),actionType:nU().optional(),isApifyIntegration:re().nullable().optional(),shouldInterpolateStrings:re().nullable().optional(),eventTypes:ru(sP()),condition:sI(),ignoreSslErrors:re(),doNotRetry:re().nullable().optional(),requestUrl:nq({normalize:!0}).nullable().optional(),payloadTemplate:nU().nullable().optional(),headersTemplate:nU().nullable().optional(),title:nU().nullable().optional(),description:nU().nullable().optional(),slackMessage:sU().optional(),googleMail:sL().optional(),googleDrive:sN().optional(),githubIssue:s$().optional(),lastDispatch:sM().nullable().optional(),stats:sj().nullable().optional()})),sF=a5(()=>rw(["READY","RUNNING","SUCCEEDED","FAILED","TIMING-OUT","TIMED-OUT","ABORTING","ABORTED"]).or(nU())),sq=a5(()=>rw(["DEVELOPMENT","WEB","API","SCHEDULER","TEST","WEBHOOK","ACTOR","CLI","CI","STANDBY","MCP"]).or(nU())),sZ=a5(()=>rd({origin:sq(),clientIp:nU().optional(),userAgent:nU().optional(),githubActionsRunUrl:nU().optional(),actorRunId:nU().optional(),webhookDispatchId:nU().optional()})),sW=a5(()=>rd({id:nU(),actId:nU().optional(),userId:nU().optional(),status:sF(),startedAt:a6({offset:!0}).pipe(a8()),finishedAt:a6({offset:!0}).pipe(a8()).nullable().optional(),usageTotalUsd:n6().optional(),buildNumber:nU().regex(/^([0-9]|[1-9][0-9])\.([0-9]|[1-9][0-9])(\.[1-9][0-9]{0,4})$/),buildNumberInt:n5().optional(),meta:sZ().optional()})),sK=a5(()=>a7().extend({items:ru(sW())})),sG=a5(()=>rd({durationMillis:n5().optional(),runTimeSecs:n6().optional(),computeUnits:n6().optional(),imageSizeBytes:n5().nullable().optional()})),sV=a5(()=>rd({useCache:re().nullable().optional(),betaPackages:re().nullable().optional(),memoryMbytes:n5().nullable().optional(),diskMbytes:n5().nullable().optional(),tag:nU().nullable().optional(),debug:re().nullable().optional()})),sH=a5(()=>rd({ACTOR_COMPUTE_UNITS:n6().nullable().optional()})),sJ=a5(()=>rd({templateId:nU().optional(),generatedBy:nU().optional()})),sY=a5(()=>rd({actorSpecification:rS(1).optional(),name:nU().optional(),title:nU().optional(),description:nU().optional(),version:nU().regex(/^[0-9]+(\.[0-9]+)+$/).optional(),buildTag:nU().optional(),meta:sJ().optional(),environmentVariables:rv(nU(),nU()).optional(),dockerfile:nU().optional(),dockerContextDir:nU().optional(),readme:nU().nullable().optional(),input:rv(nU(),rn()).nullable().optional(),output:rv(nU(),rn()).nullable().optional(),changelog:nU().nullable().optional(),storages:rd({dataset:rv(nU(),rn()).optional(),datasets:rv(nU(),rv(nU(),rn())).optional(),keyValueStore:rv(nU(),rn()).optional()}).optional(),defaultMemoryMbytes:rh([nU(),n5()]).optional(),minMemoryMbytes:n5().min(128).optional(),maxMemoryMbytes:n5().min(128).optional(),usesStandbyMode:re().optional(),webServerSchema:rv(nU(),rn()).optional(),webServerMcpPath:nU().optional()})),sX=a5(()=>rd({id:nU(),actId:nU(),userId:nU(),startedAt:a6({offset:!0}).pipe(a8()),finishedAt:a6({offset:!0}).pipe(a8()).nullable().optional(),status:sF(),meta:sZ(),stats:sG().nullable().optional(),options:sV().nullable().optional(),usage:sH().nullable().optional(),usageTotalUsd:n6().nullable().optional(),usageUsd:sH().nullable().optional(),inputSchema:nU().nullable().optional(),readme:nU().nullable().optional(),changelog:nU().nullable().optional(),exitCode:n5().nullable().optional(),gitCommitId:nU().optional(),gitBranchName:nU().optional(),createdByOrganizationMemberUserId:nU().optional(),buildNumber:nU().regex(/^([0-9]|[1-9][0-9])\.([0-9]|[1-9][0-9])(\.[1-9][0-9]{0,4})$/),imageDigest:nU().nullable().optional(),actVersion:rd({sourceType:sp().optional(),buildTag:nU().nullable().optional(),versionNumber:nU().regex(/^([0-9]|[1-9][0-9])\.([0-9]|[1-9][0-9])$/).optional(),gitRepoUrl:nU().optional(),sourceFiles:ru(so()).optional(),gitHubGistUrl:nU().optional(),tarballUrl:nU().optional(),actorPath:nU().nullable().optional()}).optional(),actorDefinition:sY().nullable().optional()})),sQ=a5(()=>rd({origin:sq(),clientIp:nU().nullable().optional(),userAgent:nU().nullable().optional(),scheduleId:nU().nullable().optional(),scheduledAt:a6({offset:!0}).pipe(a8()).nullable().optional(),actorRunId:nU().optional(),webhookDispatchId:nU().optional(),scheduledAct2Id:nU().optional(),scheduledActorTaskId:nU().optional()})),s0=a5(()=>rd({deployment:rw(["SINGLE_TENANT","MULTI_TENANT_OWNER_PAID","MULTI_TENANT_FREE_USERS","MULTI_TENANT_PAYING_USERS"]).or(nU())})),s1=a5(()=>rd({id:nU(),actId:nU(),userId:nU().optional(),actorTaskId:nU().nullable().optional(),status:sF(),startedAt:a6({offset:!0}).pipe(a8()),finishedAt:a6({offset:!0}).pipe(a8()).nullable().optional(),buildId:nU(),buildNumber:nU().regex(/^([0-9]|[1-9][0-9])\.([0-9]|[1-9][0-9])(\.[1-9][0-9]{0,4})$/).optional(),buildNumberInt:n5().optional(),meta:sQ(),usageTotalUsd:n6(),defaultKeyValueStoreId:nU(),defaultDatasetId:nU(),defaultRequestQueueId:nU(),standby:s0().nullable().optional()})),s2=a5(()=>a7().extend({items:ru(s1())})),s4=a5(()=>rd({inputBodyLen:n5().min(0).nullable().optional(),migrationCount:n5().min(0).optional(),rebootCount:n5().min(0).optional(),restartCount:n5().min(0).optional(),resurrectCount:n5().min(0).optional(),memAvgBytes:n6().optional(),memMaxBytes:n5().min(0).optional(),memCurrentBytes:n5().min(0).optional(),cpuAvgUsage:n6().optional(),cpuMaxUsage:n6().optional(),cpuCurrentUsage:n6().optional(),netRxBytes:n5().min(0).optional(),netTxBytes:n5().min(0).optional(),durationMillis:n5().min(0).optional(),runTimeSecs:n6().min(0).optional(),metamorph:n5().min(0).optional(),computeUnits:n6().min(0).optional()})),s9=a5(()=>rd({eventTotalUsd:n6(),eventTitle:nU()})),s3=a5(()=>rd({platform:nU().optional(),appId:nU().optional(),isAiTool:re().optional()})),s6=a5(()=>rd({build:nU(),timeoutSecs:n5().min(0),memoryMbytes:n5().min(128).max(32768),diskMbytes:n5().min(0),restartOnError:re().nullable().optional(),maxItems:n5().min(0).nullable().optional(),maxTotalChargeUsd:n6().min(0).nullable().optional(),isMaxTotalChargeUsdSetByUser:re().optional()})),s8=a5(()=>rw(["ANYONE_WITH_ID_CAN_READ","ANYONE_WITH_NAME_CAN_READ","FOLLOW_USER_SETTING","RESTRICTED"]).or(nU())),s5=a5(()=>rd({ACTOR_COMPUTE_UNITS:n6().nullable().optional(),DATASET_READS:n5().nullable().optional(),DATASET_WRITES:n5().nullable().optional(),KEY_VALUE_STORE_READS:n5().nullable().optional(),KEY_VALUE_STORE_WRITES:n5().nullable().optional(),KEY_VALUE_STORE_LISTS:n5().nullable().optional(),REQUEST_QUEUE_READS:n5().nullable().optional(),REQUEST_QUEUE_WRITES:n5().nullable().optional(),DATA_TRANSFER_INTERNAL_GBYTES:n6().nullable().optional(),DATA_TRANSFER_EXTERNAL_GBYTES:n6().nullable().optional(),PROXY_RESIDENTIAL_TRANSFER_GBYTES:n6().nullable().optional(),PROXY_SERPS:n5().nullable().optional(),PROXY_UNBLOCKER_UNITS:n6().nullable().optional()})),s7=a5(()=>rd({ACTOR_COMPUTE_UNITS:n6().nullable().optional(),DATASET_READS:n6().nullable().optional(),DATASET_WRITES:n6().nullable().optional(),KEY_VALUE_STORE_READS:n6().nullable().optional(),KEY_VALUE_STORE_WRITES:n6().nullable().optional(),KEY_VALUE_STORE_LISTS:n6().nullable().optional(),REQUEST_QUEUE_READS:n6().nullable().optional(),REQUEST_QUEUE_WRITES:n6().nullable().optional(),DATA_TRANSFER_INTERNAL_GBYTES:n6().nullable().optional(),DATA_TRANSFER_EXTERNAL_GBYTES:n6().nullable().optional(),PROXY_RESIDENTIAL_TRANSFER_GBYTES:n6().nullable().optional(),PROXY_SERPS:n6().nullable().optional(),PROXY_UNBLOCKER_UNITS:n6().nullable().optional()})),le=a5(()=>rd({createdAt:a6({offset:!0}).pipe(a8()),actorId:nU(),buildId:nU(),inputKey:nU().nullable().optional(),buildTags:ru(nU()).optional()})),lt=a5(()=>rd({id:nU(),actId:nU(),userId:nU(),actorTaskId:nU().nullable().optional(),startedAt:a6({offset:!0}).pipe(a8()),finishedAt:a6({offset:!0}).pipe(a8()).nullable().optional(),status:sF(),statusMessage:nU().nullable().optional(),isStatusMessageTerminal:re().nullable().optional(),meta:sQ(),pricingInfo:sT().optional(),stats:s4(),chargedEventCounts:rv(nU(),n5()).optional(),accountedChargedEventCounts:rv(nU(),n5()).nullable().optional(),eventUsage:rv(nU(),s9()).optional(),externalChargedTotalUsd:n6().optional(),standby:s0().nullable().optional(),integrationTracking:s3().optional(),createdByOrganizationMemberUserId:nU().optional(),consoleUrl:nq({normalize:!0}).optional(),output:rv(nU(),nq({normalize:!0})).optional(),options:s6(),buildId:nU(),exitCode:n5().nullable().optional(),generalAccess:s8().nullable().optional(),defaultKeyValueStoreId:nU(),defaultDatasetId:nU(),defaultRequestQueueId:nU(),storageIds:rd({datasets:rd({default:nU().optional()}).catchall(nU()).optional(),keyValueStores:rd({default:nU().optional()}).catchall(nU()).optional(),requestQueues:rd({default:nU().optional()}).catchall(nU()).optional()}).optional(),buildNumber:nU().regex(/^([0-9]|[1-9][0-9])\.([0-9]|[1-9][0-9])(\.[1-9][0-9]{0,4})$/).nullable().optional(),containerUrl:nq({normalize:!0}).optional(),isContainerServerReady:re().nullable().optional(),gitBranchName:nU().nullable().optional(),usage:s5().nullable().optional(),usageTotalUsd:n6().nullable().optional(),usageUsd:s7().nullable().optional(),metamorphs:ru(le()).nullable().optional(),platformUsageBillingModel:nU().optional()})),li=a5(()=>rd({readCount:n5().optional(),writeCount:n5().optional(),storageBytes:n5().optional(),inflatedBytes:n5().optional()})),ln=a5(()=>rd({id:nU(),name:nU().nullable().optional(),title:nU().nullable().optional(),userId:nU(),createdAt:a6({offset:!0}).pipe(a8()),modifiedAt:a6({offset:!0}).pipe(a8()),accessedAt:a6({offset:!0}).pipe(a8()),itemCount:n5().min(0),cleanItemCount:n5().min(0),actId:nU().nullable().optional(),actRunId:nU().nullable().optional(),fields:ru(nU()).nullable().optional(),schema:rv(nU(),rn()).nullable().optional(),consoleUrl:nq({normalize:!0}),itemsPublicUrl:nq({normalize:!0}).optional(),urlSigningSecretKey:nU().nullable().optional(),generalAccess:s8().nullable().optional(),stats:li().optional()})),lr=a5(()=>rd({min:n6().nullable().optional(),max:n6().nullable().optional(),nullCount:n5().nullable().optional(),emptyCount:n5().nullable().optional()})),lo=a5(()=>rd({fieldStatistics:rv(nU(),lr()).nullable().optional()})),la=a5(()=>rd({readCount:n5().optional(),writeCount:n5().optional(),deleteCount:n5().optional(),listCount:n5().optional(),s3StorageBytes:n5().optional(),storageBytes:n5().optional()})),ls=a5(()=>rd({id:nU(),name:nU().nullable().optional(),title:nU().nullable().optional(),userId:nU().nullable().optional(),username:nU().nullable().optional(),createdAt:a6({offset:!0}).pipe(a8()),modifiedAt:a6({offset:!0}).pipe(a8()),accessedAt:a6({offset:!0}).pipe(a8()),actId:nU().nullable().optional(),actRunId:nU().nullable().optional(),consoleUrl:nq({normalize:!0}).optional(),keysPublicUrl:nq({normalize:!0}).optional(),recordsPublicUrl:nq({normalize:!0}).optional(),schema:rv(nU(),rn()).nullable().optional(),urlSigningSecretKey:nU().nullable().optional(),generalAccess:s8().nullable().optional(),stats:la().optional()})),ll=a5(()=>rd({key:nU(),size:n5(),recordPublicUrl:nq({normalize:!0})})),lu=a5(()=>rd({items:ru(ll()),count:n5(),limit:n5(),exclusiveStartKey:nU().nullable().optional(),isTruncated:re(),nextExclusiveStartKey:nU().nullable().optional()})),lc=a5(()=>nU()),lp=a5(()=>nU()),ld=a5(()=>a6({offset:!0}).pipe(a8())),lf=a5(()=>a6({offset:!0}).pipe(a8())),lh=a5(()=>a6({offset:!0}).pipe(a8())),lm=a5(()=>n5().min(0)),lg=a5(()=>n5().min(0)),ly=a5(()=>n5()),lb=a5(()=>re()),lv=a5(()=>rd({deleteCount:n5().optional(),headItemReadCount:n5().optional(),readCount:n5().optional(),storageBytes:n5().optional(),writeCount:n5().optional()})),l_=a5(()=>rd({id:lc(),name:nU().nullable().optional(),title:nU().nullable().optional(),userId:lp(),actId:nU().nullable().optional(),actRunId:nU().nullable().optional(),createdAt:ld(),modifiedAt:lf(),accessedAt:lh(),totalRequestCount:lm(),handledRequestCount:lg(),pendingRequestCount:ly(),hadMultipleClients:lb(),consoleUrl:nq({normalize:!0}),stats:lv().optional(),generalAccess:s8().nullable().optional()})),lw=a5(()=>nU()),lE=a5(()=>nU()),lS=a5(()=>rw(["GET","HEAD","POST","PUT","DELETE","CONNECT","OPTIONS","TRACE","PATCH"]).or(nU())),lT=a5(()=>lS()),lR=a5(()=>n5()),lO=a5(()=>rv(nU(),rn())),lx=a5(()=>rd({uniqueKey:lw(),url:lE(),method:lT().optional(),retryCount:lR().optional(),loadedUrl:nU().nullable().optional(),payload:rh([nU(),rv(nU(),rn())]).nullable().optional(),headers:rv(nU(),rn()).nullable().optional(),userData:lO().optional(),noRetry:re().nullable().optional(),errorMessages:ru(nU()).nullable().optional(),handledAt:a6({offset:!0}).pipe(a8()).nullable().optional()})),lA=a5(()=>nU()),lk=a5(()=>a6({offset:!0}).pipe(a8())),lC=a5(()=>lx().extend({id:lA().optional(),lockExpiresAt:lk().optional(),lockByClient:nU().optional()}).required({id:!0})),lP=a5(()=>rd({items:ru(lC()),limit:n5(),exclusiveStartId:nU().optional(),cursor:nU().optional(),nextCursor:nU().optional()})),lI=a5(()=>re()),lU=a5(()=>re()),lz=a5(()=>rd({requestId:lA(),wasAlreadyPresent:lI(),wasAlreadyHandled:lU()})),lL=a5(()=>rd({requestId:lA(),uniqueKey:lw(),wasAlreadyPresent:lI(),wasAlreadyHandled:lU()})),lN=a5(()=>rd({id:lA().optional(),uniqueKey:lw(),url:lE(),method:lT().optional()})),l$=a5(()=>rd({processedRequests:ru(lL()),unprocessedRequests:ru(lN())})),lD=a5(()=>rd({uniqueKey:lw().optional(),id:lA()})),lM=a5(()=>rd({uniqueKey:lw(),id:lA().optional()})),lj=a5(()=>rh([lD(),lM()])),lB=a5(()=>rd({processedRequests:ru(lj()),unprocessedRequests:ru(lN())})),lF=a5(()=>rd({unlockedCount:n5()})),lq=a5(()=>rd({lockExpiresAt:lk()})),lZ=a5(()=>n5()),lW=a5(()=>rd({id:lA(),uniqueKey:lw(),url:lE(),method:lT().optional(),retryCount:lR().optional()})),lK=a5(()=>rd({limit:lZ(),queueModifiedAt:lf(),hadMultipleClients:lb(),items:ru(lW())})),lG=a5(()=>rd({id:lA(),uniqueKey:lw(),url:lE(),method:lT().optional(),retryCount:lR().optional(),lockExpiresAt:lk()})),lV=a5(()=>rd({limit:lZ(),queueModifiedAt:lf(),queueHasLockedRequests:re().optional(),clientKey:nU().optional(),hadMultipleClients:lb(),lockSecs:n5(),items:ru(lG())})),lH=a5(()=>rd({totalRuns:n5().optional(),lastRunStartedAt:a6({offset:!0}).pipe(a8()).nullable().optional()})),lJ=a5(()=>rd({id:nU(),userId:nU(),actId:nU(),actName:nU().nullable().optional(),name:nU(),title:nU().nullable().optional(),username:nU().nullable().optional(),actUsername:nU().nullable().optional(),createdAt:a6({offset:!0}).pipe(a8()),modifiedAt:a6({offset:!0}).pipe(a8()),stats:lH().nullable().optional(),isPublic:re().optional()})),lY=a5(()=>a7().extend({items:ru(lJ())})),lX=a5(()=>rd({build:nU().nullable().optional(),timeoutSecs:n5().nullable().optional(),memoryMbytes:n5().nullable().optional(),maxItems:n5().nullable().optional(),maxTotalChargeUsd:n6().nullable().optional(),restartOnError:re().nullable().optional(),isMaxTotalChargeUsdSetByUser:re().nullable().optional(),forcePermissionLevel:sn().nullable().optional()})),lQ=a5(()=>rv(nU(),rn())),l0=a5(()=>rd({publishedAt:a6({offset:!0}).pipe(a8()).nullable().optional(),seoTitle:nU().max(60).nullable().optional(),seoDescription:nU().max(160).nullable().optional(),inputSchemaFields:ru(nU()).nullable().optional(),datasetName:nU().nullable().optional(),datasetView:nU().nullable().optional(),categorization:nU().nullable().optional(),highlightedFields:ru(nU()).nullable().optional(),faq:ru(rd({question:nU(),answer:nU()})).nullable().optional()})),l1=a5(()=>rd({id:nU(),userId:nU(),actId:nU(),name:nU(),nameLowerCase:nU().optional(),username:nU().nullable().optional(),createdAt:a6({offset:!0}).pipe(a8()),modifiedAt:a6({offset:!0}).pipe(a8()),removedAt:a6({offset:!0}).pipe(a8()).nullable().optional(),stats:lH().nullable().optional(),options:lX().nullable().optional(),input:rh([lQ(),ru(lQ())]).nullable().optional(),title:nU().nullable().optional(),description:nU().nullable().optional(),actorStandby:su().nullable().optional(),standbyUrl:nq({normalize:!0}).nullable().optional(),isPublic:re().optional(),publicConfig:l0().nullable().optional()})),l2=a5(()=>rd({readCount:n5().optional(),writeCount:n5().optional(),deleteCount:n5().optional(),listCount:n5().optional(),s3StorageBytes:n5().optional()})),l4=a5(()=>rd({id:nU(),name:nU().nullable().optional(),title:nU().nullable().optional(),userId:nU().nullable().optional(),username:nU().nullable().optional(),createdAt:a6({offset:!0}).pipe(a8()),modifiedAt:a6({offset:!0}).pipe(a8()),accessedAt:a6({offset:!0}).pipe(a8()),actId:nU().nullable().optional(),actRunId:nU().nullable().optional(),schema:rh([rv(nU(),rn()),nU()]).nullable().optional(),generalAccess:s8().nullable().optional(),stats:l2().optional()})),l9=a5(()=>a7().extend({unnamed:re().optional(),items:ru(l4())})),l3=a5(()=>rd({id:nU(),name:nU().nullable().optional(),userId:nU(),createdAt:a6({offset:!0}).pipe(a8()),modifiedAt:a6({offset:!0}).pipe(a8()),accessedAt:a6({offset:!0}).pipe(a8()),itemCount:n5(),cleanItemCount:n5(),actId:nU().nullable().optional(),actRunId:nU().nullable().optional(),title:nU().nullable().optional(),username:nU().optional(),generalAccess:s8().nullable().optional(),stats:li().optional()})),l6=a5(()=>a7().extend({unnamed:re().optional(),items:ru(l3())})),l8=a5(()=>rd({deleteCount:n5().optional(),headItemReadCount:n5().optional(),readCount:n5().optional(),writeCount:n5().optional(),s3StorageBytes:n5().optional(),dynamodbStorageBytes:n5().optional()})),l5=a5(()=>rd({id:lc(),name:nU().nullable().optional(),title:nU().nullable().optional(),userId:lp(),username:nU().optional(),createdAt:ld(),modifiedAt:lf(),accessedAt:lh(),expireAt:a6({offset:!0}).pipe(a8()).optional(),totalRequestCount:lm(),handledRequestCount:lg(),pendingRequestCount:ly(),actId:nU().nullable().optional(),actRunId:nU().nullable().optional(),hadMultipleClients:lb(),generalAccess:s8().nullable().optional(),stats:l8().optional()})),l7=a5(()=>a7().extend({unnamed:re().optional(),items:ru(l5())})),ue=a5(()=>rd({id:nU(),createdAt:a6({offset:!0}).pipe(a8()),modifiedAt:a6({offset:!0}).pipe(a8()),userId:nU(),isAdHoc:re().nullable().optional(),isApifyIntegration:re().optional(),isEnabled:re().optional(),actionType:nU().optional(),shouldInterpolateStrings:re().nullable().optional(),eventTypes:ru(sP()),condition:sI(),ignoreSslErrors:re(),doNotRetry:re(),requestUrl:nq({normalize:!0}).nullable().optional(),headersTemplate:nU().nullable().optional(),title:nU().nullable().optional(),description:nU().nullable().optional(),slackMessage:sU().optional(),googleMail:sL().optional(),googleDrive:sN().optional(),githubIssue:s$().optional(),lastDispatch:sM().nullable().optional(),stats:sj().nullable().optional()})),ut=a5(()=>a7().extend({items:ru(ue())})),ui=a5(()=>rd({_id:nU().optional(),actionType:nU().optional(),condition:sI().optional(),requestUrl:nq({normalize:!0}).nullable().optional(),isAdHoc:re().optional(),isApifyIntegration:re().nullable().optional(),slackMessage:sU().optional(),googleMail:sL().optional(),googleDrive:sN().optional(),githubIssue:s$().optional()})),un=a5(()=>rd({id:nU(),userId:nU(),webhookId:nU(),createdAt:a6({offset:!0}).pipe(a8()),status:sD(),eventType:sP(),eventData:rd({actorId:nU(),actorRunId:nU().optional(),actorBuildId:nU().optional(),actorTaskId:nU().nullable().optional()}).nullable().optional(),webhook:ui().nullable().optional(),calls:ru(rd({startedAt:a6({offset:!0}).pipe(a8()).nullable().optional(),finishedAt:a6({offset:!0}).pipe(a8()).nullable().optional(),errorMessage:nU().nullable().optional(),responseStatus:n5().nullable().optional(),responseBody:nU().nullable().optional(),debugPostMessage:rv(nU(),rn()).optional()})).optional()})),ur=a5(()=>a7().extend({items:ru(un())})),uo=a5(()=>rd({id:nU(),userId:nU(),name:nU(),cronExpression:nU(),timezone:nU(),isEnabled:re(),isExclusive:re(),createdAt:a6({offset:!0}).pipe(a8()),modifiedAt:a6({offset:!0}).pipe(a8()),nextRunAt:a6({offset:!0}).pipe(a8()).nullable().optional(),lastRunAt:a6({offset:!0}).pipe(a8()).nullable().optional()})),ua=a5(()=>rd({email:re().optional()})),us=a5(()=>rd({id:nU(),type:rS("RUN_ACTOR"),actorId:nU()})),ul=a5(()=>rd({id:nU(),type:rS("RUN_ACTOR_TASK"),actorTaskId:nU()})),uu=a5(()=>rg("type",[us(),ul()])),uc=a5(()=>uo().extend({title:nU().nullable().optional(),notifications:ua().optional(),integrationTracking:s3().optional(),actions:ru(uu())})),up=a5(()=>a7().extend({items:ru(uc())})),ud=a5(()=>rd({body:nU().nullable().optional(),contentType:nU().nullable().optional()})),uf=a5(()=>rd({version:n5().optional(),data:rd({cronExpression:nU().optional(),timezone:nU().optional()}).optional()}).nullable()),uh=a5(()=>rd({id:nU(),type:rS("RUN_ACTOR"),actorId:nU(),runInput:ud().nullable().optional(),runOptions:lX().nullable().optional()})),um=a5(()=>rd({id:nU(),type:rS("RUN_ACTOR_TASK"),actorTaskId:nU(),input:rv(nU(),rn()).nullable().optional()})),ug=a5(()=>rg("type",[uh(),um()])),uy=a5(()=>uo().extend({description:nU().nullable().optional(),title:nU().nullable().optional(),notifications:ua().optional(),uiState:uf().optional(),integrationTracking:s3().optional(),actions:ru(ug())})),ub=a5(()=>rd({message:nU(),level:nU(),createdAt:a6({offset:!0}).pipe(a8())})),uv=a5(()=>rd({pricingModel:nU(),apifyMarginPercentage:n6().optional(),createdAt:a6({offset:!0}).pipe(a8()).optional(),startedAt:a6({offset:!0}).pipe(a8()).optional(),notifiedAboutChangeAt:a6({offset:!0}).pipe(a8()).nullable().optional(),notifiedAboutFutureChangeAt:a6({offset:!0}).pipe(a8()).nullable().optional(),isPriceChangeNotificationSuppressed:re().optional(),forceContainsSignificantPriceChange:re().optional(),isPPEPlatformUsagePaidByUser:re().optional(),reasonForChange:nU().nullable().optional(),minimalMaxTotalChargeUsd:n6().nullable().optional(),pricingPerEvent:rv(nU(),rn()).nullable().optional(),pricePerUnitUsd:n6().optional(),trialMinutes:n5().optional(),unitName:nU().optional(),tieredPricing:rv(nU(),rd({tieredPricePerUnitUsd:n6().optional()})).optional(),notifiedAboutRentalToPpePriceChangeAt:a6({offset:!0}).pipe(a8()).nullable().optional()})),u_=a5(()=>rd({id:nU(),title:nU(),name:nU(),username:nU(),userFullName:nU().nullable().optional(),description:nU().nullable().optional(),categories:ru(nU()).optional(),notice:sx().optional(),pictureUrl:nU().nullable().optional(),userPictureUrl:nq({normalize:!0}).nullable().optional(),url:nq({normalize:!0}).nullable().optional(),stats:rd({totalUsers:n5(),totalRuns:n5().optional(),totalUsers7Days:n5().optional(),totalUsers30Days:n5().optional(),totalUsers90Days:n5().optional(),actorReviewRating:n6(),actorReviewCount:n5()}),currentPricingInfo:uv().optional(),isWhiteListedForAgenticPayments:re().nullable().optional(),isVerified:re().optional(),badge:nU().nullable().optional(),readmeSummary:nU().optional(),inputSchema:rd({type:nU(),properties:rv(nU(),rd({type:rh([nU(),ru(nU())]).optional()})),required:ru(nU()).optional()}).optional()})),uw=a5(()=>a7().extend({items:ru(u_())})),uE=a5(()=>rd({bio:nU().nullable().optional(),readme:nU().nullable().optional(),name:nU().optional(),pictureUrl:nq({normalize:!0}).nullable().optional(),githubUsername:nU().nullable().optional(),websiteUrl:nq({normalize:!0}).nullable().optional(),twitterUsername:nU().nullable().optional()})),uS=a5(()=>rd({id:nU().optional(),name:nU(),description:nU().nullable(),availableCount:n5().optional()})),uT=a5(()=>rd({password:nU().nullable().optional(),groups:ru(uS())})),uR=a5(()=>rv(nU(),n5())),uO=a5(()=>rd({id:nU().optional(),description:nU().optional(),isEnabled:re().optional(),monthlyBasePriceUsd:n6().optional(),monthlyUsageCreditsUsd:n6().optional(),usageDiscountPercent:n6().optional(),enabledPlatformFeatures:ru(nU()).optional(),maxMonthlyUsageUsd:n6().optional(),maxActorMemoryGbytes:n6().optional(),maxMonthlyActorComputeUnits:n6().optional(),maxMonthlyResidentialProxyGbytes:n6().optional(),maxMonthlyProxySerps:n5().optional(),maxMonthlyExternalDataTransferGbytes:n6().optional(),maxActorCount:n5().optional(),maxActorTaskCount:n5().optional(),dataRetentionDays:n5().optional(),availableProxyGroups:uR(),teamAccountSeatCount:n5().optional(),supportLevel:nU().optional(),availableAddOns:ru(nU()).optional(),tier:nU().optional(),apiRateLimitBoosts:n5().optional(),maxScheduleCount:n5().optional(),maxConcurrentActorRuns:n5().optional(),planPricing:rv(nU(),rn()).optional(),planVersion:n6().optional(),legacyPlanId:nU().optional(),planTags:ru(nU()).optional(),overageThresholdUsd:n6().optional(),maxMonthlyUnblockerUnits:n5().optional(),maxPublicActorTaskCount:n5().optional(),maxPublicActorTaskCountPerActor:n5().optional(),forceBillingInterval:nU().optional(),personalizedSupport:nU().nullable().optional(),monitoringLevel:rw(["STANDARD"]).or(nU()).nullable().optional(),isPayingCustomer:re().optional()})),ux=a5(()=>rd({isEnabled:re(),disabledReason:nU().nullable(),disabledReasonType:nU().nullable(),isTrial:re(),trialExpirationAt:a6({offset:!0}).pipe(a8()).nullable()})),uA=a5(()=>rd({ACTORS:ux(),STORAGE:ux(),SCHEDULER:ux(),PROXY:ux(),PROXY_EXTERNAL_ACCESS:ux(),PROXY_RESIDENTIAL:ux(),PROXY_SERPS:ux(),WEBHOOKS:ux(),ACTORS_PUBLIC_ALL:ux(),ACTORS_PUBLIC_DEVELOPER:ux()})),uk=a5(()=>rd({id:nU().optional(),username:nU(),profile:uE().optional(),email:nU().nullable().optional(),proxy:uT().optional(),plan:uO().optional(),effectivePlatformFeatures:uA().optional(),createdAt:a6({offset:!0}).pipe(a8()).optional(),isPaying:re().optional(),organizationOwnerUserId:nU().nullable().optional()})),uC=a5(()=>rd({startAt:a6({offset:!0}).pipe(a8()),endAt:a6({offset:!0}).pipe(a8())})),uP=a5(()=>rd({quantityAbove:n6(),discountPercent:n6(),tierQuantity:n6(),unitPriceUsd:n6(),priceUsd:n6()})),uI=a5(()=>rd({quantity:n6(),baseAmountUsd:n6(),baseUnitPriceUsd:n6().optional(),amountAfterVolumeDiscountUsd:n6().optional(),priceTiers:ru(uP()).optional()})),uU=a5(()=>rv(nU(),uI())),uz=a5(()=>rv(nU(),uI())),uL=a5(()=>rd({date:a6({offset:!0}).pipe(a8()),serviceUsage:uz(),totalUsageCreditsUsd:n6()})),uN=a5(()=>rd({usageCycle:uC(),monthlyServiceUsage:uU(),dailyServiceUsages:ru(uL()),totalUsageCreditsUsdBeforeVolumeDiscount:n6(),totalUsageCreditsUsdAfterVolumeDiscount:n6()})),u$=a5(()=>rd({maxMonthlyUsageUsd:n6(),maxMonthlyActorComputeUnits:n6(),maxMonthlyExternalDataTransferGbytes:n6(),maxMonthlyProxySerps:n5(),maxMonthlyResidentialProxyGbytes:n6(),maxActorMemoryGbytes:n6(),maxActorCount:n5(),maxActorTaskCount:n5(),maxConcurrentActorJobs:n5(),maxTeamAccountSeatCount:n5(),dataRetentionDays:n5(),maxScheduleCount:n5().optional(),maxMonthlyUnblockerUnits:n6().optional()})),uD=a5(()=>rd({monthlyUsageUsd:n6(),monthlyActorComputeUnits:n6(),monthlyExternalDataTransferGbytes:n6(),monthlyProxySerps:n5(),monthlyResidentialProxyGbytes:n6(),actorMemoryGbytes:n6(),actorCount:n5(),actorTaskCount:n5(),activeActorJobCount:n5(),teamAccountSeatCount:n5(),scheduleCount:n5().optional(),monthlyUnblockerUnits:n6().optional()})),uM=a5(()=>rd({monthlyUsageCycle:uC(),limits:u$(),current:uD()})),uj=a5(()=>{let e=sX();return e.extend({actVersion:e.shape.actVersion.unwrap().extend({buildTag:nU().nullable().optional()}).optional()})}),uB=a5(()=>uy().extend({uiState:uf().nullable().optional()})),uF=new Set(["actor-memory-limit-exceeded","concurrent-runs-limit-exceeded"]);async function uq(e,t,i,n){if(!t)return e();let r=!0===t?1/0:Date.now()+1e3*t;for(;;)try{return await e()}catch(o){if(!(o instanceof oz)||!uF.has(o.type??""))throw o;let e=r-Date.now();if(e<=0)throw o;let t=Math.min(1e4,e);i.info(`Not enough resources to start the run, retrying in ${Number((t/1e3).toPrecision(3))}s: ${o.message}`),await ab(t,n),n?.throwIfAborted()}}let uZ=rp({raw:re().optional(),...a$}),uW=uZ.extend({buffer:re().optional()});let uK=class LogClient extends a3{constructor(e){super({resourcePath:"logs",...e})}async get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="long",signal:i,buffer:n,...r}=oH(e,uW,"LogGetOptions"),o={url:this.buildUrl(),method:"GET",params:this.buildParams(r),timeoutSecs:t,signal:i};n&&(o.responseType="buffer");try{return(await this.httpClient.call(o)).data}catch(e){at(e,this.id)}}async stream(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="long",signal:i,raw:n}=oH(e,uZ,"LogOptions"),r={url:this.buildUrl(),method:"GET",params:this.buildParams({stream:!0,raw:n}),responseType:"stream",timeoutSecs:t,signal:i};try{return(await this.httpClient.call(r)).data}catch(e){at(e,this.id)}}};let uG=class LoggerActorRedirect extends oy{constructor(e={}){super({skipTime:!0,level:op.DEBUG,...e})}_log(e,t,i,n){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};if(e>this.options.level)return;if(i||n)throw Error("Redirect logger does not use other arguments than level and message");let{prefix:o}=r;o=o?`${o}`:"";let a="";this.options.skipTime||(a=`${new Date().toISOString().replace("Z","").replace("T"," ")} `);let s=`${ow().gray(a)}${ow().cyan(o)}${t||""}`;return this._outputWithConsole(op.INFO,s),s}};let uV=class StreamedLog{#b;#v=[];#_=new TextDecoder;#w=/(?:\n|^)(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z)/g;#E;#S;#T;#R=null;#O=!1;#x=new AbortController;#A=new AbortController;constructor(e){let{toLog:t,logClient:i,fromStart:n=!0,signal:r}=e;this.#b=t,this.#S=i,this.#T=r,this.#E=n?null:new Date}start(){if(this.#R)throw Error("Streaming task already active");this.#O=!1,this.#x=new AbortController,this.#A=new AbortController,this.#R=this.#k()}async stop(){if(!this.#R)throw Error("Streaming task is not active");this.#O=!0,this.#A.abort();let e=this.#x,t=setTimeout(()=>e.abort(),1e3);try{await this.#R}catch(e){if(!(e instanceof Error&&"AbortError"===e.name))throw e}finally{clearTimeout(t),this.#R=null}}async #k(){let e=this.#T?AbortSignal.any([this.#T,this.#x.signal]):this.#x.signal;try{let t,i=500;for(;!t;){let n;if(this.#O){let i=await this.#S.get({raw:!0,signal:this.#T});t=await this.#C([new TextEncoder().encode(i??"")],e);break}try{n=await this.#S.stream({raw:!0,signal:e})}catch(e){if(this.#O&&!this.#T?.aborted)continue;throw e}if(!n)return;if(this.#O){await n.cancel().catch(()=>{});continue}(t=await this.#C(n,e))||(await ab(i,AbortSignal.any([e,this.#A.signal])),i=Math.min(2*i,5e3))}let n=this.#_.decode(t).trim();n.length&&this.#b.info(n)}catch(t){if(e.aborted)return;ok.warning("Log redirection stopped due to error",t)}}async #C(e,t){let i;try{for await(let t of e){i??=new Uint8Array;let e=new Uint8Array(i.length+t.length);e.set(i,0),e.set(t,i.length);let n=e.lastIndexOf(10);if(i=e.slice(n),this.#v.push(e.slice(0,n)),this.#P(),this.#O)break}}catch(e){if(!t.aborted)throw e}return i}#P(){let e=this.#_.decode(function(e){let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0)),i=0;for(let n of e)t.set(n,i),i+=n.length;return t}(this.#v)).split(this.#w).slice(1),t=e.filter((e,t)=>t%2==0),i=e.filter((e,t)=>t%2!=0);this.#v=[],t.forEach((e,t)=>{let n=i[t];this.#E&&new Date(e)<this.#E||this.#b.info((e+n).trim())})}};let uH=rp({waitForFinish:n6().optional(),...a$}),uJ=rp({waitSecs:n6().optional(),...a$});let uY=class BuildClient extends a3{constructor(e){super({resourcePath:"actor-builds",...e})}async get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t,signal:i,...n}=oH(e,uH,"BuildClientGetOptions");return this.getResource(uj(),n,this.timeoutForWaitForFinish(t,"short",n.waitForFinish),i)}async abort(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:i}=oH(e,aD,"TimeoutOptions");return o7(await this.httpClient.call({url:this.buildUrl("abort"),method:"POST",params:this.buildParams(),timeoutSecs:t,signal:i}),uj())}async delete(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:i}=oH(e,aD,"TimeoutOptions");return this.deleteResource(t,i)}async getOpenApiDefinition(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="medium",signal:i}=oH(e,aD,"TimeoutOptions");return(await this.httpClient.call({url:this.buildUrl("openapi.json"),method:"GET",params:this.buildParams(),timeoutSecs:t,signal:i})).data}async waitForFinish(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=oH(e,uJ,"BuildClientWaitForFinishOptions");return this.waitForJobFinish(uj(),t)}log(){return new uK(this.subResourceOptions({resourcePath:"log"}))}};let uX=class ResourceCollectionClient extends a9{async listResources(e,t,i,n){return o7(await this.httpClient.call({url:this.buildUrl(),method:"GET",params:this.buildParams(t),timeoutSecs:i,signal:n}),e)}listUnpaginatedResources(e,t,i){let n=this.listResources(e,void 0,t,i);return Object.defineProperty(n,Symbol.asyncIterator,{async *value(){yield*(await n).items}})}listResourcesPaginated(e,t,i){let{timeoutSecs:n=i,signal:r,...o}=t;return this.listPaginatedFromCallback(async t=>this.listResources(e,t,n,r),o)}async createResource(e,t,i,n){return o7(await this.httpClient.call({url:this.buildUrl(),method:"POST",params:this.buildParams(),data:t,timeoutSecs:i,signal:n}),e)}async getOrCreateResource(e,t,i,n,r){return o7(await this.httpClient.call({url:this.buildUrl(),method:"POST",params:this.buildParams({name:t}),data:i,timeoutSecs:n,signal:r}),e)}};let uQ=rp({...af,desc:re().optional(),...a$});let u0=class BuildCollectionClient extends uX{constructor(e){super({...e,resourcePath:e.resourcePath||"actor-builds"})}list(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=oH(e,uQ,"BuildCollectionClientListOptions");return this.listResourcesPaginated(sK(),t,"medium")}};let u1=[429,503],u2=/^(\d+)\.(\d+)\.(\d+)$/;function u4(e){let t=u2.exec(e??"");if(t)return[Number(t[1]),Number(t[2]),Number(t[3])]}let u9=rp({method:rw(["GET","HEAD","POST","PUT","DELETE","CONNECT","OPTIONS","TRACE","PATCH"]).optional(),params:rv(nU(),rn()).optional(),headers:rv(nU(),nU()).optional(),data:rn().optional(),parentRequestId:nU().optional(),compression:aC.optional(),responseType:rw(["parsed","buffer","stream"]).optional(),...a$});let u3=class ActorServerClient extends a3{#I;constructor(e){super({resourcePath:"actors",...e})}async getUrl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:i}=oH(e,aD,"TimeoutOptions"),n=this.#I??=this.#U(t,i).then(e=>e.standbyUrl);try{return await n}catch(e){throw this.#I===n&&(this.#I=void 0),e}}async getOpenApiSpec(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:i}=oH(e,aD,"TimeoutOptions"),n=await this.#U(t,i),r=n.actorStandby?.build||"latest",o=n.taggedBuilds?.[r]?.buildId??void 0,a=u4(r);if(void 0===o&&void 0!==a)for await(let e of new u0(this.subResourceOptions({resourcePath:"builds"})).list({desc:!0,timeoutSecs:t,signal:i})){if(e.buildNumber===r){o=e.id;break}if(function(e,t){let i=u4(e);return void 0!==i&&i[0]===t[0]&&i[1]===t[1]&&i[2]<t[2]}(e.buildNumber,a))break}let s=void 0===o?void 0:await new uY({baseUrl:this.apifyClient.baseUrl,publicBaseUrl:this.apifyClient.publicBaseUrl,httpClient:this.httpClient,apifyClient:this.apifyClient,id:o}).get({timeoutSecs:t,signal:i});if(void 0===s)throw new oP(`Build ${r} of Actor ${this.id} does not exist.`);return s.actorDefinition?.webServerSchema}async request(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,nU());let{method:i="GET",params:n,headers:r,data:o,parentRequestId:a,compression:s,responseType:l,timeoutSecs:u="long",signal:c}=oH(t,u9,"ActorServerRequestOptions"),p=await this.getUrl({signal:c}),d=e.split("#")[0].replace(/^\/+/,"");return this.httpClient.call({url:`${p.replace(/\/+$/,"")}/${d}`,method:i,params:n,headers:void 0===a?r:aG(r??{},{"X-Actor-Request-ID":a}),data:o,compression:void 0!==s&&aP(s),authorizationHeader:"X-Apify-Authorization",throwOnErrorStatus:!1,retryStatusCodes:u1,retryTransportErrors:!1,followRedirects:!1,responseType:l,timeoutSecs:u,signal:c})}async #U(e,t){let i=o7(await this.httpClient.call({url:this.buildUrl(),method:"GET",params:this.buildParams(),timeoutSecs:e,signal:t}),sA());if(!i.standbyUrl)throw new oP(`Actor ${this.id} is not a Server Actor.`);return this.#I=Promise.resolve(i.standbyUrl),i}};let u6=class ActorEnvVarClient extends a3{constructor(e){super({resourcePath:"env-vars",...e})}async get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:i}=oH(e,aD,"TimeoutOptions");return this.getResource(sd(),{},t,i)}async update(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,o6);let{timeoutSecs:i="short",signal:n}=oH(t,aD,"TimeoutOptions");return this.updateResource(sd(),e,i,n)}async delete(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:i}=oH(e,aD,"TimeoutOptions");return this.deleteResource(t,i)}};let u8=o6.optional();let u5=class ActorEnvVarCollectionClient extends uX{constructor(e){super({resourcePath:"env-vars",...e})}list(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:i}=oH(e,aD,"TimeoutOptions");return this.listUnpaginatedResources(sC(),t,i)}async create(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,u8);let{timeoutSecs:i="short",signal:n}=oH(t,aD,"TimeoutOptions");return this.createResource(sd(),e,i,n)}};var u7=((r7={}).Active="ACTIVE",r7.Succeeded="SUCCEEDED",r7.Failed="FAILED",r7),ce=((oe={}).SourceFiles="SOURCE_FILES",oe.GitRepo="GIT_REPO",oe.Tarball="TARBALL",oe.GitHubGist="GITHUB_GIST",oe.SourceCode="SOURCE_CODE",oe),ct=((ot={}).RunActor="RUN_ACTOR",ot.RunActorTask="RUN_ACTOR_TASK",ot),ci=((oi={}).Actors="ACTORS",oi.Storage="STORAGE",oi.ProxySERPS="PROXY_SERPS",oi.Scheduler="SCHEDULER",oi.Webhooks="WEBHOOKS",oi.Proxy="PROXY",oi.ProxyExternalAccess="PROXY_EXTERNAL_ACCESS",oi);let cn=nU().min(1);let cr=class ActorVersionClient extends a3{constructor(e){super({resourcePath:"versions",...e})}async get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:i}=oH(e,aD,"TimeoutOptions");return this.getResource(sf(),{},t,i)}async update(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,o6);let{timeoutSecs:i="short",signal:n}=oH(t,aD,"TimeoutOptions");return this.updateResource(sf(),e,i,n)}async delete(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:i}=oH(e,aD,"TimeoutOptions");return this.deleteResource(t,i)}envVar(e){return oH(e,cn),new u6(this.subResourceOptions({id:e}))}envVars(){return new u5(this.subResourceOptions())}};let co=o6.optional();let ca=class ActorVersionCollectionClient extends uX{constructor(e){super({resourcePath:"versions",...e})}list(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:i}=oH(e,aD,"TimeoutOptions");return this.listUnpaginatedResources(sk(),t,i)}async create(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,co);let{timeoutSecs:i="short",signal:n}=oH(t,aD,"TimeoutOptions");return this.createResource(sf(),e,i,n)}};let cs="toBSON",cl="toString",cu="_bsontype";RegExp(`(.|^$|^${cs}$|^${cu}|^${cl}$)`),RegExp(".","g"),RegExp("^$"),RegExp(`^${cs}$`),RegExp(`^${cl}$`),RegExp(`^${cu}$`),RegExp("^(anonymous|page-not-found|docs|terms-of-use|about|pricing|privacy-policy|customers|request-form|request-solution|release-notes|jobs|api-reference|video-tutorials|acts|key-value-stores|schedules|account|sign-up|sign-in-discourse|admin|documentation|change-password|enroll-account|forgot-password|reset-password|sign-in|verify-email|live-status|browser-info|webhooks|health-check|api|change-log|dashboard|community|crawlers|ext|schemas|admin|administration|crawler|act|library|lib|apifier|team|contact|doc|documentation|for-business|for-developers|developers|business|integrations|job|setting|settings|privacy|policy|assets|help|config|configuration|terms|hiring|hire|status|status-page|solutions|support|market|marketplace|download|downloads|username|users|user|login|logout|signin|sign|signup|sign-out|signout|plugins|plug-ins|reset|password|passwords|square|profile-photos|profiles|true|false|js|css|img|images|image|partials|fonts|font|dynamic_templates|app|schedules|community|storage|storages|account|node_modules|bower_components|video|knowledgebase|forum|customers|blog|health-check|health|anim|forum_topics.json|forum_categories.json|me|you|him|she|it|external|actor|crawler|scheduler|api|sdk|puppeteer|webdriver|selenium|(selenium.*webdriver)|undefined|page-analyzer|wp-login.php|welcome.action|echo|proxy|super-proxy|gdpr|case-studies|use-cases|how-to|kb|cookies|cookie-policy|cookies-policy|powered-by|run|runs|actor|actors|act|acts|success-stories|roadmap|join-marketplace|presskit|press-kit|covid-19|covid|covid19|matfyz|ideas|public-actors|resources|partners|affiliate|industries|web-scraping|custom-solutions|solution-provider|alternatives|platform|freelancers|freelancer|partner|preview|templates|data-for-generative-ai|discord|praguecrawl|prague-crawl|bob|ai-agents|reel|video-reel|mcp|mcpc|model-context-protocol|modelcontextprotocol|apify.com|design-kit|press-kit|scrapers|professional-services|challenge|challange|1m-challenge|1m-usd-challenge|contact-sales|creator|creators|creator-plan|request-an-integration|whitepaper|adviser|crawlee|ultimate-scraper|agent-skills|key-value-store|request-queue|request-queues|build|builds|dataset|datasets|schedule|standby|pay-per-event|pay-per-result|pay-per-usage|ppe|ppr|compute-unit|compute-units|agent|agents|agentic|llms|llm|openai|anthropic|claude|copilot|mistral|gemini|llama|chatbot|chatgpt|prompt|prompts|embeddings|vectors|rag|agentic-commerce|agentic-economy|agentic-payments|a2a|a2b|a2p|ap2|b2a|acp|ucp|mpp|x402|l402|anp|agp|erc-8004|kya|kyapay|official|verified|certified|authorized|partner-official|gold-partner|premium-partner|staff|moderator|apify-admin|console|cli|studio|gateway|workbench|agents-marketplace|agents-store|mcp-server|mcp-servers|mcp-gateway|asia|latam|emea|apac|i18n|l10n|localization|localisation|usd|eur|gbp|jpy|cny|usdc|usdt|btc|eth|sol|crypto|fiat|stablecoin|stablecoins|payment|payments|payout|payouts|invoice|invoices|wallet|soc|soc2|iso|iso-27001|hipaa|ccpa|pci|pci-dss|dpa|dpia|dmca|sla|eula|aml|kyc|contributor|contributors|maintainer|maintainers|core-team|oss|open-source|opensource|open-source-software|spam|scam|phishing|malware|hack|hacked|giveaway|airdrop|bitcoin-giveaway|free-credits|free-money|launch|launches|webinar|webinars|meetup|meetups|summit|conference|conferences|org|orgs|organisation|workspace|workspaces|tenant|tenants|role|roles|permission|permissions|saml|scim|token|tokens|apikey|api-key|api-keys|keys|secret|secrets|coupon|coupons|discount|discounts|promos|refund|refunds|credit|credits|billing-portal|production|prod|canary|internal|restricted|conversations|reactions|mentions|channel|channels|inbox|no-reply|noreply|accessibility|imprint|impressum|trust|trust-center|security-center|brand|branding|support-team|abuse|outage|incident|incidents|what-is-new|whatsnew|index|index\\.html|(favicon\\.[a-z]+)|BingSiteAuth.xml|(google.+\\.html)|robots\\.txt|(sitemap\\.[a-z]+)|(apple-touch-icon.*)|security-whitepaper\\.pdf|security\\.txt|llms\\.txt|llms-full\\.txt|(.*\\.md)|(\\..*)|(xxx-.*)|((.+[^a-z]|)porn([^a-z].+|))|((.+[^a-z]|)vagina([^a-z].+|))|((.+[^a-z]|)dildo([^a-z].+|))|((.+[^a-z]|)nsfw([^a-z].+|))|((.+[^a-z]|)hentai([^a-z].+|))|((.+[^a-z]|)cunt([^a-z].+|))|((.+[^a-z]|)fuck([^a-z].+|))|((.+[^a-z]|)shit([^a-z].+|))|((.+[^a-z]|)bitch([^a-z].+|))|((.+[^a-z]|)slut([^a-z].+|))|((.+[^a-z]|)whore([^a-z].+|))|((.+[^a-z]|)boob([^a-z].+|))|((.+[^a-z]|)tits([^a-z].+|))|((.+[^a-z]|)cock([^a-z].+|))|((.+[^a-z]|)anus([^a-z].+|))|((.+[^a-z]|)pussy([^a-z].+|))|((.+[^a-z]|)nude([^a-z].+|))|((.+[^a-z]|)penis([^a-z].+|))|((.+[^a-z]|)naked([^a-z].+|))|(install-cli\\..*)|([^0-9a-z].*)|(.*[^0-9a-z])|(.*[_.\\-]{2}.*)|0|about|access|account|accounts|activate|activities|activity|ad|add|address|adm|admin|administration|administrator|ads|adult|advertising|affiliate|affiliates|ajax|all|alpha|analysis|analytics|android|anon|anonymous|api|app|apps|archive|archives|article|asct|asset|atom|auth|authentication|avatar|backup|balancer-manager|banner|banners|beta|billing|bin|blog|blogs|board|book|bookmark|bot|bots|bug|business|cache|cadastro|calendar|call|campaign|cancel|captcha|career|careers|cart|categories|category|cgi|cgi-bin|changelog|chat|check|checking|checkout|client|cliente|clients|code|codereview|comercial|comment|comments|communities|community|company|compare|compras|config|configuration|connect|contact|contact-us|contact_us|contactus|contest|contribute|corp|create|css|dashboard|data|db|default|delete|demo|design|designer|destroy|dev|devel|developer|developers|diagram|diary|dict|dictionary|die|dir|direct_messages|directory|dist|doc|docs|documentation|domain|download|downloads|ecommerce|edit|editor|edu|education|email|employment|empty|end|enterprise|entries|entry|error|errors|eval|event|events|exit|explore|facebook|faq|favorite|favorites|feature|features|feed|feedback|feeds|file|files|first|flash|fleet|fleets|flog|follow|followers|following|forgot|form|forum|forums|founder|free|friend|friends|ftp|gadget|gadgets|game|games|get|gift|gifts|gist|github|graph|group|groups|guest|guests|help|home|homepage|host|hosting|hostmaster|hostname|howto|hpg|html|http|httpd|https|i|iamges|icon|icons|id|idea|ideas|image|images|imap|img|index|indice|info|information|inquiry|instagram|intranet|invitations|invite|ipad|iphone|irc|is|issue|issues|it|item|items|java|javascript|job|jobs|join|js|json|jump|knowledgebase|language|languages|last|ldap-status|legal|license|link|links|linux|list|lists|log|log-in|log-out|log_in|log_out|login|logout|logs|m|mac|mail|mail1|mail2|mail3|mail4|mail5|mailer|mailing|maintenance|manager|manual|map|maps|marketing|master|me|media|member|members|message|messages|messenger|microblog|microblogs|mine|mis|mob|mobile|movie|movies|mp3|msg|msn|music|musicas|mx|my|mysql|name|named|nan|navi|navigation|net|network|new|news|newsletter|nick|nickname|notes|noticias|notification|notifications|notify|ns|ns1|ns10|ns2|ns3|ns4|ns5|ns6|ns7|ns8|ns9|null|oauth|oauth_clients|offer|offers|official|old|online|openid|operator|order|orders|organization|organizations|overview|owner|owners|page|pager|pages|panel|password|payment|perl|phone|photo|photoalbum|photos|php|phpmyadmin|phppgadmin|phpredisadmin|pic|pics|ping|plan|plans|plugin|plugins|policy|pop|pop3|popular|portal|post|postfix|postmaster|posts|pr|premium|press|price|pricing|privacy|privacy-policy|privacy_policy|privacypolicy|private|product|products|profile|project|projects|promo|pub|public|purpose|put|python|query|random|ranking|read|readme|recent|recruit|recruitment|register|registration|release|remove|replies|report|reports|repositories|repository|req|request|requests|reset|roc|root|rss|ruby|rule|sag|sale|sales|sample|samples|save|school|script|scripts|search|secure|security|self|send|server|server-info|server-status|service|services|session|sessions|setting|settings|setup|share|shop|show|sign-in|sign-up|sign_in|sign_up|signin|signout|signup|site|sitemap|sites|smartphone|smtp|soporte|source|spec|special|sql|src|ssh|ssl|ssladmin|ssladministrator|sslwebmaster|staff|stage|staging|start|stat|state|static|stats|status|store|stores|stories|style|styleguide|stylesheet|stylesheets|subdomain|subscribe|subscription|subscriptions|suporte|support|svn|swf|sys|sysadmin|sysadministrator|system|tablet|tablets|tag|talk|task|tasks|team|teams|tech|telnet|term|terms|terms-of-service|terms_of_service|termsofservice|test|test1|test2|test3|teste|testing|tests|theme|themes|thread|threads|tmp|todo|tool|tools|top|topic|topics|tos|tour|translations|trends|tutorial|tux|tv|twitter|undef|unfollow|unsubscribe|update|upload|uploads|url|usage|user|username|users|usuario|vendas|ver|version|video|videos|visitor|watch|weather|web|webhook|webhooks|webmail|webmaster|website|websites|welcome|widget|widgets|wiki|win|windows|word|work|works|workshop|ww|wws|www|www1|www2|www3|www4|www5|www6|www7|wwws|wwww|xfn|xml|xmpp|xpg|xxx|yaml|year|yml|you|yourdomain|yourname|yoursite|yourusername)$","i"),(on=of||(of={})).MONGODB_PING="MONGODB_PING",on.MONGODB_READ="MONGODB_READ",on.MONGODB_WRITE="MONGODB_WRITE",on.REDIS="REDIS",on.REDIS_PING="REDIS_PING",on.REDIS_WRITE="REDIS_WRITE",i("c"),i("d").Buffer,i("d").Buffer,i("d").Buffer,(or=oh||(oh={})).VERSION="v",or.USER="u";let cc="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),cp=globalThis.crypto?.subtle;async function cd(e,t){if(!cp)throw Error(`SubtleCrypto is not available in this environment.
67
67
  Please ensure you're running in an environment that supports Web Crypto API,
68
- or submit an issue to https://github.com/apify/apify-shared-js so we can help you further.`);let i=new TextEncoder,n=await cc.importKey("raw",i.encode(e),{name:"HMAC",hash:"SHA-256"},!1,["sign"]),r=Array.from(new Uint8Array(await cc.sign("HMAC",n,i.encode(t)))).map(e=>e.toString(16).padStart(2,"0")).join("").substring(0,30);var o=BigInt(`0x${r}`);if(0n===o)return cu[0];let a="";for(;o>0n;)a=cu[Number(o%62n)]+a,o/=62n;return a}async function cd({resourceId:e,urlSigningSecretKey:t,expiresInMillis:i,version:n=0}){let r=i?new Date().getTime()+i:0,o=await cp(t,`${n}.${r}.${e}`);var a=new TextEncoder().encode(`${n}.${r}.${o}`);let s="";for(let e=0;e<a.length;e++)s+=String.fromCharCode(a[e]);return btoa(s).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}i("d").Buffer;var cf=((oo={}).JSON="json",oo.JSONL="jsonl",oo.XML="xml",oo.HTML="html",oo.CSV="csv",oo.XLSX="xlsx",oo.RSS="rss",oo);let ch=rw(cf),cm=rD(o3,"Expected an object"),cg=rp({clean:re().optional(),desc:re().optional(),flatten:ru(nU()).optional(),fields:ru(nU()).optional(),omit:ru(nU()).optional(),...ad,skipEmpty:re().optional(),skipHidden:re().optional(),unwind:ru(nU()).optional(),view:nU().optional(),signature:nU().optional(),...aN}),cy=rp({attachment:re().optional(),bom:re().optional(),clean:re().optional(),delimiter:nU().optional(),desc:re().optional(),flatten:ru(nU()).optional(),fields:ru(nU()).optional(),omit:ru(nU()).optional(),limit:n6().min(0).optional(),offset:n6().min(0).optional(),skipEmpty:re().optional(),skipHeaderRow:re().optional(),skipHidden:re().optional(),unwind:ru(nU()).optional(),view:nU().optional(),xmlRoot:nU().optional(),xmlRow:nU().optional(),signature:nU().optional(),stream:re().optional(),...aN}),cb=rh([cm,nU(),ru(cm)]),cv=rp({clean:re().optional(),desc:re().optional(),flatten:ru(nU()).optional(),fields:ru(nU()).optional(),format:ch.optional(),omit:ru(nU()).optional(),limit:n6().min(0).optional(),offset:n6().min(0).optional(),skipEmpty:re().optional(),skipHidden:re().optional(),unwind:ru(nU()).optional(),view:nU().optional(),expiresInSecs:n6().positive().optional(),...aN});let c_=class DatasetClient extends a9{constructor(e){super({resourcePath:"datasets",...e})}async get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:i}=oH(e,a$,"TimeoutOptions");return this.getResource(li(),{},t,i)}async update(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,o6);let{timeoutSecs:i="short",signal:n}=oH(t,a$,"TimeoutOptions");return this.updateResource(li(),e,i,n)}async delete(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:i}=oH(e,a$,"TimeoutOptions");return this.deleteResource(t,i)}listItems(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var t=this;let{timeoutSecs:i="long",signal:n,...r}=oH(e,cg,"DatasetClientListItemOptions");return this.listPaginatedFromCallback(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=await t.httpClient.call({url:t.buildUrl("items"),method:"GET",params:t.buildParams(e),timeoutSecs:i,signal:n});return t.#z(r,e.desc??!1)},r)}async downloadItems(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,ch);let{timeoutSecs:i="long",signal:n,stream:r,...o}=oH(t,cy,"DatasetClientDownloadItemsOptions"),{data:a}=await this.httpClient.call({url:this.buildUrl("items"),method:"GET",params:this.buildParams({format:e,...o}),responseType:r?"stream":"buffer",timeoutSecs:i,signal:n});return a}async pushItems(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,cb);let{timeoutSecs:i="medium",signal:n}=oH(t,a$,"TimeoutOptions");await this.httpClient.call({url:this.buildUrl("items"),method:"POST",headers:{"content-type":"application/json; charset=utf-8"},data:e,params:this.buildParams(),doNotRetryTimeouts:!0,timeoutSecs:i,signal:n})}async getStatistics(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:i}=oH(e,a$,"TimeoutOptions");return o7(await this.httpClient.call({url:this.buildUrl("statistics"),method:"GET",params:this.buildParams(),timeoutSecs:t,signal:i}),lr())}async createItemsPublicUrl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="long",signal:i,expiresInSecs:n,...r}=oH(e,cv,"DatasetClientCreateItemsUrlOptions"),o=await this.get({timeoutSecs:t,signal:i}),a=new URL(this.buildPublicUrl("items"));if(o?.urlSigningSecretKey){let e=await cd({resourceId:o.id,urlSigningSecretKey:o.urlSigningSecretKey,expiresInMillis:n?1e3*n:void 0});a.searchParams.set("signature",e)}return(a=af(a,r)).toString()}#z(e,t){let i=e.headers["x-apify-pagination-desc"];return{items:e.data,total:Number(e.headers["x-apify-pagination-total"]),offset:Number(e.headers["x-apify-pagination-offset"]),count:Math.max(Number(e.headers["x-apify-pagination-count"]??0),e.data.length),limit:Number(e.headers["x-apify-pagination-limit"]),desc:"string"==typeof i?JSON.parse(i):t}}};let cw=rp({limit:n6().min(0).optional(),chunkSize:n6().positive().optional(),exclusiveStartKey:nU().optional(),collection:nU().optional(),prefix:nU().optional(),signature:nU().optional(),...aN}),cE=nU().min(1),cS=rp({limit:n6().min(0).optional(),exclusiveStartKey:nU().optional(),collection:nU().optional(),prefix:nU().optional(),expiresInSecs:n6().positive().optional(),...aN}),cT=nU(),cR=rp({buffer:re().optional(),stream:re().optional(),disableRedirect:re().optional(),signature:nU().optional(),...aN}),cO=rp({key:nU(),value:rD(e=>void 0!==e&&"symbol"!=typeof e&&"bigint"!=typeof e&&"function"!=typeof e&&("number"!=typeof e||Number.isFinite(e)),"Expected a JSON-serializable value, binary data, or a stream"),contentType:nU().min(1).optional(),contentEncoding:nU().trim().min(1).optional()}),cx=rp({...aN,doNotRetryTimeouts:re().optional()});let cA=class KeyValueStoreClient extends a9{constructor(e){super({resourcePath:"key-value-stores",...e})}async get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:i}=oH(e,a$,"TimeoutOptions");return this.getResource(la(),{},t,i)}async update(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,o6);let{timeoutSecs:i="long",signal:n}=oH(t,a$,"TimeoutOptions");return this.updateResource(la(),e,i,n)}async delete(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:i}=oH(e,a$,"TimeoutOptions");return this.deleteResource(t,i)}listKeys(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var t=this;let{chunkSize:i,timeoutSecs:n="medium",signal:r,...o}=oH(e,cw,"KeyValueClientListKeysOptions"),a=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o7(await t.httpClient.call({url:t.buildUrl("keys"),method:"GET",params:t.buildParams(e),timeoutSecs:n,signal:r}),ll())},s=a({...o,limit:ap(o.limit,i)});return Object.defineProperty(s,Symbol.asyncIterator,{value:async function*(){let e=await s;yield*e.items;let t=o.limit?o.limit-e.items.length:void 0;for(;e.items.length>0&&null!=e.nextExclusiveStartKey&&(void 0===t||t>0);){let n={...o,limit:ap(t,i),exclusiveStartKey:e.nextExclusiveStartKey};e=await a(n),yield*e.items,t&&(t-=e.items.length)}}})}async getRecordPublicUrl(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,cE);let{timeoutSecs:i="long",signal:n}=oH(t,a$,"TimeoutOptions"),r=await this.get({timeoutSecs:i,signal:n}),o=new URL(this.buildPublicUrl(["records",e]));if(r?.urlSigningSecretKey){let t=await cp(r.urlSigningSecretKey,e);o.searchParams.append("signature",t)}return o.toString()}async createKeysPublicUrl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="long",signal:i,expiresInSecs:n,...r}=oH(e,cS,"KeyValueClientCreateKeysUrlOptions"),o=await this.get({timeoutSecs:t,signal:i}),a=new URL(this.buildPublicUrl("keys"));if(o?.urlSigningSecretKey){let e=await cd({resourceId:o.id,urlSigningSecretKey:o.urlSigningSecretKey,expiresInMillis:n?1e3*n:void 0});a.searchParams.set("signature",e)}return(a=af(a,r)).toString()}async recordExists(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{timeoutSecs:i="long",signal:n}=oH(t,a$,"TimeoutOptions"),r={url:this.buildUrl(["records",e]),method:"HEAD",params:this.buildParams(),timeoutSecs:i,signal:n};try{return await this.httpClient.call(r),!0}catch(e){ae(e)}return!1}async getRecord(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,cT);let i=oH(t,cR,"KeyValueClientGetRecordOptions");"disableRedirect"in i&&ok.deprecated("The disableRedirect option for getRecord() is deprecated. It has no effect and will be removed in the following major release.");let n={attachment:"true"};i.signature&&(n.signature=i.signature);let r={url:this.buildUrl(["records",e]),method:"GET",params:this.buildParams(n),timeoutSecs:i.timeoutSecs??"long",signal:i.signal};i.buffer&&(r.responseType="buffer"),i.stream&&(r.responseType="stream");try{let t=await this.httpClient.call(r);return{key:e,value:t.data,contentType:t.headers["content-type"]}}catch(e){ae(e)}}async setRecord(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,cO);let i=oH(t,cx,"KeyValueStoreRecordOptions"),{key:n,contentEncoding:r}=e,{value:o,contentType:a}=e,{timeoutSecs:s="long",signal:l,doNotRetryTimeouts:u}=i;if(void 0!==r&&!oC.isNode)throw Error("The contentEncoding option can only be used in Node.js environment.");if(al(o))throw TypeError("A web ReadableStream cannot be stored as a record value. Convert it with Readable.fromWeb() in Node.js, or read it into bytes first.");let c=au(o)||ao(o)||aa(o);if(void 0!==r&&"identity"!==r.trim().toLowerCase()&&!c)throw TypeError(`Cannot upload a value of type ${typeof o} with Content-Encoding: ${r}. An encoding other than identity declares the value is already compressed, so pass the compressed bytes as a Buffer, an ArrayBuffer, a typed array, a Blob, or a readable stream.`);if(a||(a=aa(o)?o.type||"application/octet-stream":c?"application/octet-stream":"string"==typeof o?"text/plain; charset=utf-8":"application/json; charset=utf-8"),a.startsWith("application/json")&&!c&&"string"!=typeof o)try{o=JSON.stringify(o,null,2)}catch(e){throw Error(`The record value cannot be stringified to JSON. Please provide other content type.
69
- Cause: ${e.message}`)}let p={url:this.buildUrl(["records",n]),method:"PUT",params:this.buildParams(),data:o,headers:{"content-type":a,...void 0!==r&&{"content-encoding":r}},doNotRetryTimeouts:u,timeoutSecs:s,signal:l};await this.httpClient.call(p)}async deleteRecord(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,cT);let{timeoutSecs:i="short",signal:n}=oH(t,a$,"TimeoutOptions");await this.httpClient.call({url:this.buildUrl(["records",e]),method:"DELETE",params:this.buildParams(),timeoutSecs:i,signal:n})}};let ck=rp({limit:n6().min(0).optional(),...aN}),cC=rp({lockSecs:n6(),limit:n6().min(0).optional(),...aN}),cP=rD(e=>o3(e)&&void 0===e.id,"Expected a request object without an `id`"),cI=rp({forefront:re().optional(),...aN}),cU=ru(cP).min(1),cz=re().optional(),cL=n6().optional(),cN=ru(rD(e=>o3(e)&&("string"==typeof e.id||"string"==typeof e.uniqueKey),"Expected a request object with an `id` or a `uniqueKey`")).min(1).max(25),c$=nU(),cD=rD(e=>o3(e)&&"string"==typeof e.id,"Expected a request object with an `id`"),cM=rp({lockSecs:n6(),forefront:re().optional(),...aN}),cj=ru(rw(["locked","pending"])).min(1),cB=rp({limit:n6().min(0).optional(),chunkSize:n6().positive().optional(),cursor:nU().optional(),filter:cj.optional(),...aN}),cF=rp({limit:n6().min(0).optional(),maxPageLimit:n6().default(1e3),cursor:nU().optional(),filter:cj.optional(),...aN});let cq=class RequestQueueClient extends a9{#L;#N;constructor(e,t={}){super({resourcePath:"request-queues",...e}),this.#L=t.clientKey,this.#N=t.timeoutSecs}#$(e,t){return void 0!==e?e:void 0===this.#N||this.httpClient.timeoutMillis[t]/1e3<=this.#N?t:this.#N}async get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t,signal:i}=oH(e,a$,"TimeoutOptions");return this.getResource(lv(),{},this.#$(t,"short"),i)}async update(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,o6);let{timeoutSecs:i,signal:n}=oH(t,a$,"TimeoutOptions");return this.updateResource(lv(),e,this.#$(i,"short"),n)}async delete(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t,signal:i}=oH(e,a$,"TimeoutOptions");return this.deleteResource(this.#$(t,"short"),i)}async listHead(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=oH(e,ck,"RequestQueueClientListHeadOptions");return o7(await this.httpClient.call({url:this.buildUrl("head"),method:"GET",timeoutSecs:this.#$(t.timeoutSecs,"short"),signal:t.signal,params:this.buildParams({limit:t.limit,clientKey:this.#L})}),lW())}async listAndLockHead(e){let t=oH(e,cC,"RequestQueueClientListAndLockHeadOptions");return o7(await this.httpClient.call({url:this.buildUrl("head/lock"),method:"POST",timeoutSecs:this.#$(t.timeoutSecs,"medium"),signal:t.signal,params:this.buildParams({limit:t.limit,lockSecs:t.lockSecs,clientKey:this.#L})}),lG())}async addRequest(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,cP);let i=oH(t,cI,"RequestQueueClientAddRequestOptions");return o7(await this.httpClient.call({url:this.buildUrl("requests"),method:"POST",timeoutSecs:this.#$(i.timeoutSecs,"short"),signal:i.signal,data:e,params:this.buildParams({forefront:i.forefront,clientKey:this.#L})}),lU())}async addRequestBatch(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=oH(t,cI,"RequestQueueClientAddRequestOptions");return o7(await this.httpClient.call({url:this.buildUrl("requests/batch"),method:"POST",timeoutSecs:this.#$(i.timeoutSecs,"medium"),signal:i.signal,headers:{"content-type":"application/json"},data:`[${e.map(e=>{let{json:t}=e;return t}).join(",")}]`,params:this.buildParams({forefront:i.forefront,clientKey:this.#L})}),lN())}async addRequestBatchWithRetries(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{forefront:i,timeoutSecs:n,signal:r,maxUnprocessedRequestsRetries:o=3,minDelayBetweenUnprocessedRequestsRetriesMillis:a=500}=t,s=e,l=[],u=[];for(let t=0;t<1+o;t++){try{let o=await this.addRequestBatch(s,{forefront:i,timeoutSecs:n,signal:r});l.push(...o.processedRequests),u=o.unprocessedRequests,0!==u.length&&this.httpClient.stats.addRateLimitError(t+1);let a=l.map(e=>{let{uniqueKey:t}=e;return t});if(s=e.filter(e=>{let{request:t}=e;return!a.includes(t.uniqueKey)}),0===s.length)break}catch(i){if(r?.throwIfAborted(),i instanceof oJ)throw i;ok.exception(i,"Request batch insert failed");let t=l.map(e=>{let{uniqueKey:t}=e;return t});u=e.filter(e=>{let{request:i}=e;return!t.includes(i.uniqueKey)}).map(e=>{let{request:{method:t,uniqueKey:i,url:n}}=e;return{method:t,uniqueKey:i,url:n}});break}let o=Math.floor((1+Math.random())*2**t*a);await ay(o,r),r?.throwIfAborted()}return{processedRequests:l,unprocessedRequests:u}}async batchAddRequests(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{forefront:i,timeoutSecs:n,signal:r,maxUnprocessedRequestsRetries:o=3,maxParallel:a=5,minDelayBetweenUnprocessedRequestsRetriesMillis:s=500}=t;oH(e,cU),oH(i,cz),oH(n,az),oH(r,aL),oH(o,cL),oH(a,cL),oH(s,cL);let l=new Set,u=[],c=9437184-Math.ceil(9437184*1e-4);for(let i of function(e,t){let{maxCount:i,maxByteLength:n}=t,r=[],o=[],a=1;for(let t of e)o.length>0&&(o.length>=i||a+t.byteLength+1>n)&&(r.push(o),o=[],a=1),o.push(t),a+=t.byteLength+1;return o.length>0&&r.push(o),r}(e.map((e,t)=>{let i=JSON.stringify(e),n=oQ.encode(i).byteLength;if(n+2>c)throw Error(`RequestQueueClient.batchAddRequests: The size of the request with index: ${t} exceeds the maximum allowed size (${c} bytes).`);return{request:e,json:i,byteLength:n}}),{maxCount:25,maxByteLength:c})){let e=this.addRequestBatchWithRetries(i,t);l.add(e),e.then(t=>{l.delete(e),u.push(t)},()=>void 0),l.size>=a&&await Promise.race(l)}await Promise.all(l);let p={processedRequests:[],unprocessedRequests:[]};return u.forEach(e=>{let{processedRequests:t,unprocessedRequests:i}=e;p.processedRequests.push(...t),p.unprocessedRequests.push(...i)}),p}async batchDeleteRequests(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,cN);let{timeoutSecs:i,signal:n}=oH(t,a$,"TimeoutOptions");return o7(await this.httpClient.call({url:this.buildUrl("requests/batch"),method:"DELETE",timeoutSecs:this.#$(i,"short"),signal:n,data:e,params:this.buildParams({clientKey:this.#L})}),lj())}async getRequest(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,c$);let{timeoutSecs:i,signal:n}=oH(t,a$,"TimeoutOptions"),r={url:this.buildUrl(["requests",e]),method:"GET",timeoutSecs:this.#$(i,"short"),signal:n,params:this.buildParams()};try{let e=await this.httpClient.call(r);return o7(e,lk())}catch(e){ae(e)}}async updateRequest(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,cD);let i=oH(t,cI,"RequestQueueClientAddRequestOptions");return o7(await this.httpClient.call({url:this.buildUrl(["requests",e.id]),method:"PUT",timeoutSecs:this.#$(i.timeoutSecs,"medium"),signal:i.signal,data:e,params:this.buildParams({forefront:i.forefront,clientKey:this.#L})}),lU())}async deleteRequest(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,c$);let{timeoutSecs:i,signal:n}=oH(t,a$,"TimeoutOptions");await this.httpClient.call({url:this.buildUrl(["requests",e]),method:"DELETE",timeoutSecs:this.#$(i,"short"),signal:n,params:this.buildParams({clientKey:this.#L})})}async prolongRequestLock(e,t){oH(e,c$);let i=oH(t,cM,"RequestQueueClientProlongRequestLockOptions");return o7(await this.httpClient.call({url:this.buildUrl(["requests",e,"lock"]),method:"PUT",timeoutSecs:this.#$(i.timeoutSecs,"medium"),signal:i.signal,params:this.buildParams({forefront:i.forefront,lockSecs:i.lockSecs,clientKey:this.#L})}),lF())}async deleteRequestLock(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,c$);let i=oH(t,cI,"RequestQueueClientDeleteRequestLockOptions");await this.httpClient.call({url:this.buildUrl(["requests",e,"lock"]),method:"DELETE",timeoutSecs:this.#$(i.timeoutSecs,"short"),signal:i.signal,params:this.buildParams({forefront:i.forefront,clientKey:this.#L})})}listRequests(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var t=this;let{chunkSize:i,timeoutSecs:n,signal:r,...o}=oH(e,cB,"RequestQueueClientListRequestsOptions"),a=this.#$(n,"medium"),s=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o7(await t.httpClient.call({url:t.buildUrl("requests"),method:"GET",timeoutSecs:a,signal:r,params:t.buildParams({...e,filter:e.filter?e.filter.join(","):void 0,clientKey:t.#L})}),lC())},l=s({...o,limit:ap(o.limit,i)});return Object.defineProperty(l,Symbol.asyncIterator,{value:async function*(){let e=await l;yield*e.items;let t=o.limit?o.limit-e.items.length:void 0;for(;e.items.length>0&&e.nextCursor&&(void 0===t||t>0);){let n={...o,limit:ap(t,i),cursor:e.nextCursor};e=await s(n),yield*e.items,t&&(t-=e.items.length)}}})}async unlockRequests(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t,signal:i}=oH(e,a$,"TimeoutOptions");return o7(await this.httpClient.call({url:this.buildUrl("requests/unlock"),method:"POST",timeoutSecs:this.#$(t,"long"),signal:i,params:this.buildParams({clientKey:this.#L})}),lB())}paginateRequests(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{limit:t,cursor:i,filter:n,maxPageLimit:r,timeoutSecs:o,signal:a}=oH(e,cF,"RequestQueueClientPaginateRequestsOptions");return new ac({getPage:async e=>this.listRequests({...e,filter:n,timeoutSecs:o,signal:a}),limit:t,cursor:i,maxPageLimit:r})}};let cZ=rp({waitForFinish:n6().optional(),...aN}),cW=rp({gracefully:re().optional(),...aN}),cK=nU(),cG=rp({contentType:nU().optional(),build:nU().optional(),...aN}),cV=rp({build:nU().optional(),memory:n6().optional(),runTimeoutSecs:n6().optional(),maxItems:n6().optional(),maxTotalChargeUsd:n6().optional(),restartOnError:re().optional(),...aN}),cH=rp({eventName:nU(),count:n6().default(1),idempotencyKey:nU().optional(),requestId:nU().optional(),...aN}),cJ=rp({waitSecs:n6().optional(),...aN}),cY=rp({clean:re().optional(),fields:ru(nU()).optional(),omit:ru(nU()).optional(),...ad,skipEmpty:re().optional(),skipHidden:re().optional(),unwind:ru(nU()).optional(),pollIntervalSecs:n6().min(0).optional(),...aN});let cX=class RunClient extends a9{constructor(e){super({...e,resourcePath:e.resourcePath||"actor-runs"})}async get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t,signal:i,...n}=oH(e,cZ,"RunGetOptions");return this.getResource(le(),n,this.timeoutForWaitForFinish(t,"short",n.waitForFinish),i)}async abort(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="medium",signal:i,...n}=oH(e,cW,"RunAbortOptions");return o7(await this.httpClient.call({url:this.buildUrl("abort"),method:"POST",params:this.buildParams(n),timeoutSecs:t,signal:i}),le())}async delete(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:i}=oH(e,a$,"TimeoutOptions");return this.deleteResource(t,i)}async metamorph(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};oH(e,cK);let n=oH(i,cG,"RunMetamorphOptions"),r={targetActorId:this.toSafeId(e),build:n.build},o={url:this.buildUrl("metamorph"),method:"POST",data:t,params:this.buildParams(r),stringifyFunctions:!0,timeoutSecs:n.timeoutSecs??"medium",signal:n.signal};return n.contentType&&(o.headers={"content-type":n.contentType}),o7(await this.httpClient.call(o),le())}async reboot(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="medium",signal:i}=oH(e,a$,"TimeoutOptions"),n={url:this.buildUrl("reboot"),method:"POST",timeoutSecs:t,signal:i};return o7(await this.httpClient.call(n),le())}async update(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,o6);let{timeoutSecs:i="short",signal:n}=oH(t,a$,"TimeoutOptions");return this.updateResource(le(),e,i,n)}async resurrect(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="medium",signal:i,runTimeoutSecs:n,...r}=oH(e,cV,"RunResurrectOptions");return o7(await this.httpClient.call({url:this.buildUrl("resurrect"),method:"POST",params:this.buildParams({...r,timeout:n}),timeoutSecs:t,signal:i}),le())}async charge(e){let{eventName:t,count:i,idempotencyKey:n,timeoutSecs:r="short",requestId:o,signal:a}=oH(e,cH,"RunChargeOptions"),s=(Math.random()+1).toString(36).slice(3,8),l=n??`${this.id}-${t}-${Date.now()}-${s}`,u={url:this.buildUrl("charge"),method:"POST",data:{eventName:t,count:i,requestId:o},headers:{"idempotency-key":l},timeoutSecs:r,signal:a};return await this.httpClient.call(u)}async waitForFinish(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=oH(e,cJ,"RunWaitForFinishOptions");return this.waitForJobFinish(le(),t)}dataset(){return new c_(this.subResourceOptions({resourcePath:"dataset"}))}keyValueStore(){return new cA(this.subResourceOptions({resourcePath:"key-value-store"}))}requestQueue(){return new cq(this.subResourceOptions({resourcePath:"request-queue"}))}log(){return new uW(this.subResourceOptions({resourcePath:"log"}))}async getStreamedLog(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};oH(e.timeoutSecs,az),oH(e.signal,aL);let{fromStart:t=!0,timeoutSecs:i="long",signal:n}=e,{toLog:r}=e;if(null!==r&&oC.isNode){if(void 0===r||"default"===r){let e=await this.get({timeoutSecs:i,signal:n}),t=e?.id??"",o=e?.actId??"",a=o?await this.apifyClient.actor(o).get({timeoutSecs:i,signal:n}):void 0,s=[a?.name??"",`runId:${t}`].filter(Boolean).join(" ");r=new oA({level:r2.DEBUG,prefix:`${s} -> `,logger:new uK})}return new uG({logClient:this.log(),toLog:r,fromStart:t,signal:n})}}async *iterateDatasetItems(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{offset:t,limit:i,chunkSize:n,pollIntervalSecs:r=5,timeoutSecs:o="long",signal:a,...s}=oH(e,cY,"RunIterateDatasetItemsOptions"),l=n||1e3,u=t??0,c=i?u+i:void 0,p=await this.get({timeoutSecs:o,signal:a}),d=p&&p.id!==this.id?this.apifyClient.run(p.id):this,f=d.dataset(),h=async(e,t)=>f.listItems({...s,offset:e,limit:t,timeoutSecs:o,signal:a});for(;;){let e=!p||rH.includes(p.status),t=await f.get({timeoutSecs:o,signal:a}),i=t?.itemCount??0;for(void 0!==c&&(i=Math.min(i,c));u<i;){let e=Math.min(l,i-u),t=await h(u,e);yield*t.items,u+=e}if(void 0!==c&&u>=c)return;if(e)break;p=await d.waitForFinish({waitSecs:r,timeoutSecs:o,signal:a})}let{clean:m,skipEmpty:g,unwind:y}=s;for(;;){let e=void 0!==c?Math.min(l,c-u):l,t=await h(u,e);if(yield*t.items,0===t.count&&(!(m||g||y?.length)||0===(await f.listItems({offset:u,limit:1,timeoutSecs:o,signal:a})).items.length)||(u+=e,void 0!==c&&u>=c))return}}};let cQ=rw(rV),c0=rp({...ad,desc:re().optional(),status:rh([cQ,ru(cQ)]).optional(),startedBefore:rh([rs(),nU()]).optional(),startedAfter:rh([rs(),nU()]).optional(),...aN});let c1=class RunCollectionClient extends uY{constructor(e){super({resourcePath:"runs",...e})}list(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=oH(e,c0,"RunCollectionListOptions");return this.listResourcesPaginated(s1(),t,"medium")}};let c2=rp({...ad,desc:re().optional(),...aN}),c4=o6.optional();let c9=class WebhookCollectionClient extends uY{constructor(e){super({resourcePath:"webhooks",...e})}list(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=oH(e,c2,"WebhookCollectionListOptions");return this.listResourcesPaginated(ue(),t,"medium")}async create(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,c4);let{timeoutSecs:i="short",signal:n}=oH(t,a$,"TimeoutOptions");return this.createResource(sj(),e,i,n)}};let c3=rp({build:nU().optional(),contentType:nU().optional(),memory:n6().optional(),runTimeoutSecs:n6().min(0).optional(),waitForFinish:n6().optional(),webhooks:ru(o6).optional(),maxItems:n6().min(0).optional(),maxTotalChargeUsd:n6().min(0).optional(),restartOnError:re().optional(),forcePermissionLevel:rw(r0).optional(),waitForResources:rh([re(),n6().min(0)]).optional(),...aN}),c6=rp({build:nU().optional(),contentType:nU().optional(),memory:n6().optional(),runTimeoutSecs:n6().min(0).optional(),waitSecs:n6().min(0).optional(),webhooks:ru(o6).optional(),maxItems:n6().min(0).optional(),maxTotalChargeUsd:n6().min(0).optional(),log:rh([new rt({type:"null",...L(void 0)}),rj(oA),rS("default")]).optional(),restartOnError:re().optional(),forcePermissionLevel:rw(r0).optional(),waitForResources:rh([re(),n6().min(0)]).optional(),...aN}),c8=rp({build:nU().optional(),contentType:nU().optional(),...aN}),c5=nU().min(1),c7=rp({betaPackages:re().optional(),tag:nU().optional(),useCache:re().optional(),waitForFinish:n6().optional(),...aN}),pe=rp({waitForFinish:n6().optional(),...aN}),pt=rp({status:rw(rV).optional(),origin:rw(rJ).optional()});let pi=class ActorClient extends a9{#D;constructor(e){super({resourcePath:"actors",...e})}async get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:i}=oH(e,a$,"TimeoutOptions");return this.getResource(sx(),{},t,i)}async update(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,o6);let{timeoutSecs:i="short",signal:n}=oH(t,a$,"TimeoutOptions");return this.updateResource(sx(),e,i,n)}async delete(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:i}=oH(e,a$,"TimeoutOptions");return this.deleteResource(t,i)}async start(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=oH(t,c3,"ActorStartOptions"),{waitForFinish:n,runTimeoutSecs:r,memory:o,build:a,maxItems:s,maxTotalChargeUsd:l,restartOnError:u,forcePermissionLevel:c,waitForResources:p,timeoutSecs:d,signal:f}=i,h={waitForFinish:n,timeout:r,memory:o,build:a,webhooks:ai(i.webhooks),maxItems:s,maxTotalChargeUsd:l,restartOnError:u,forcePermissionLevel:c},m={url:this.buildUrl("runs"),method:"POST",data:e,params:this.buildParams(h),stringifyFunctions:!0,timeoutSecs:this.timeoutForWaitForFinish(d,"medium",n),signal:f};return i.contentType&&(m.headers={"content-type":i.contentType}),o7(await uF(async()=>this.httpClient.call(m),!au(e)&&p,this.httpClient.logger,f),le())}async call(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{waitSecs:i,log:n,timeoutSecs:r="noTimeout",signal:o,...a}=oH(t,c6,"ActorCallOptions"),{id:s}=await this.start(e,{...a,timeoutSecs:r,signal:o}),l=this.apifyClient.run(s),u=await l.getStreamedLog({toLog:n,signal:o});return u?.start(),this.apifyClient.run(s).waitForFinish({waitSecs:i,timeoutSecs:r,signal:o}).finally(async()=>{await u?.stop()})}async validateInput(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=oH(t,c8,"ActorValidateInputOptions"),n={url:this.buildUrl("validate-input"),method:"POST",data:e,params:this.buildParams({build:i.build}),stringifyFunctions:!0,timeoutSecs:i.timeoutSecs??"short",signal:i.signal};return i.contentType&&(n.headers={"content-type":i.contentType}),(await this.httpClient.call(n)).data.valid}async build(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,c5);let{timeoutSecs:i,signal:n,...r}=oH(t,c7,"ActorBuildOptions");return o7(await this.httpClient.call({url:this.buildUrl("builds"),method:"POST",params:this.buildParams({version:e,...r}),timeoutSecs:this.timeoutForWaitForFinish(i,"medium",r.waitForFinish),signal:n}),uM())}async defaultBuild(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t,signal:i,...n}=oH(e,pe,"BuildClientGetOptions"),{id:r}=o7(await this.httpClient.call({url:this.buildUrl("builds/default"),method:"GET",params:this.buildParams(n),timeoutSecs:this.timeoutForWaitForFinish(t,"short",n.waitForFinish),signal:i}),uM());return new uJ({baseUrl:this.apifyClient.baseUrl,publicBaseUrl:this.apifyClient.publicBaseUrl,httpClient:this.httpClient,apifyClient:this.apifyClient,id:r})}lastRun(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=oH(e,pt,"ActorLastRunOptions");return new cX(this.subResourceOptions({id:"last",params:this.buildParams(t),resourcePath:"runs"}))}builds(){return new uQ(this.subResourceOptions({resourcePath:"builds"}))}runs(){return new c1(this.subResourceOptions({resourcePath:"runs"}))}version(e){return oH(e,c5),new cn(this.subResourceOptions({id:e}))}versions(){return new co(this.subResourceOptions())}webhooks(){return new c9(this.subResourceOptions())}server(){return this.#D??=new u9({baseUrl:this.baseUrl,publicBaseUrl:this.publicBaseUrl,apifyClient:this.apifyClient,httpClient:this.httpClient,id:this.id,params:this.params}),this.#D}standby(){return this.httpClient.logger.deprecated("`standby()` is deprecated and will be removed in v4. Use `server()` instead."),this.server()}};let pn=o6.optional();let pr=class ActorCollectionClient extends uY{constructor(e){super({resourcePath:"actors",...e})}list(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=oH(e,pa,"ActorCollectionListOptions");return this.listResourcesPaginated(st(),t,"medium")}async create(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,pn);let{timeoutSecs:i="medium",signal:n}=oH(t,a$,"TimeoutOptions");return this.createResource(sx(),e,i,n)}};var po=((oa={}).CREATED_AT="createdAt",oa.LAST_RUN_STARTED_AT="stats.lastRunStartedAt",oa);let pa=rp({my:re().optional(),...ad,desc:re().optional(),sortBy:rw(po).optional(),...aN}),ps=rp({unnamed:re().optional(),...ad,desc:re().optional(),ownership:rw(r1).optional(),...aN}),pl=nU().optional(),pu=o6.optional();let pc=class DatasetCollectionClient extends uY{constructor(e){super({resourcePath:"datasets",...e})}list(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=oH(e,ps,"DatasetCollectionClientListOptions");return this.listResourcesPaginated(l3(),t,"medium")}async getOrCreate(e,t){oH(e,pl),oH(t?.schema,pu),oH(t?.timeoutSecs,az),oH(t?.signal,aL);let{timeoutSecs:i="short",signal:n,...r}=t??{},o=Object.keys(r).length>0;return this.getOrCreateResource(li(),e,o?r:void 0,i,n)}};let pp=rp({unnamed:re().optional(),...ad,desc:re().optional(),ownership:rw(r1).optional(),...aN}),pd=nU().optional(),pf=o6.optional();let ph=class KeyValueStoreCollectionClient extends uY{constructor(e){super({resourcePath:"key-value-stores",...e})}list(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=oH(e,pp,"KeyValueStoreCollectionClientListOptions");return this.listResourcesPaginated(l4(),t,"medium")}async getOrCreate(e,t){oH(e,pd),oH(t?.schema,pf),oH(t?.timeoutSecs,az),oH(t?.signal,aL);let{timeoutSecs:i="short",signal:n,...r}=t??{},o=Object.keys(r).length>0;return this.getOrCreateResource(la(),e,o?r:void 0,i,n)}};let pm=rp({unnamed:re().optional(),...ad,desc:re().optional(),ownership:rw(r1).optional(),...aN}),pg=nU().optional();let py=class RequestQueueCollectionClient extends uY{constructor(e){super({resourcePath:"request-queues",...e})}list(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=oH(e,pm,"RequestQueueCollectionListOptions");return this.listResourcesPaginated(l5(),t,"medium")}async getOrCreate(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,pg);let{timeoutSecs:i="short",signal:n}=oH(t,a$,"TimeoutOptions");return this.getOrCreateResource(lv(),e,void 0,i,n)}};let pb=ru(uy());let pv=class ScheduleClient extends a9{constructor(e){super({resourcePath:"schedules",...e})}async get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:i}=oH(e,a$,"TimeoutOptions");return this.getResource(uj(),{},t,i)}async update(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,o6);let{timeoutSecs:i="short",signal:n}=oH(t,a$,"TimeoutOptions");return this.updateResource(uj(),e,i,n)}async delete(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:i}=oH(e,a$,"TimeoutOptions");return this.deleteResource(t,i)}async getLog(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="medium",signal:i}=oH(e,a$,"TimeoutOptions");return o7(await this.httpClient.call({url:this.buildUrl("log"),method:"GET",params:this.buildParams(),timeoutSecs:t,signal:i}),pb)}};let p_=rp({...ad,desc:re().optional(),...aN}),pw=o6.optional();let pE=class ScheduleCollectionClient extends uY{constructor(e){super({resourcePath:"schedules",...e})}list(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=oH(e,p_,"ScheduleCollectionListOptions");return this.listResourcesPaginated(uc(),t,"medium")}async create(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,pw);let{timeoutSecs:i="short",signal:n}=oH(t,a$,"TimeoutOptions");return this.createResource(uj(),e,i,n)}};let pS=rp({...ad,search:nU().optional(),sortBy:nU().optional(),category:nU().optional(),username:nU().optional(),pricingModel:nU().optional(),includeUnrunnableActors:re().optional(),...aN});let pT=class StoreCollectionClient extends uY{constructor(e){super({resourcePath:"store",...e})}list(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=oH(e,pS,"StoreCollectionListOptions");return this.listResourcesPaginated(u_(),t,"medium")}};let pR=o6.optional(),pO=rp({build:nU().optional(),memory:n6().optional(),runTimeoutSecs:n6().min(0).optional(),waitForFinish:n6().optional(),webhooks:ru(o6).optional(),maxItems:n6().min(0).optional(),maxTotalChargeUsd:n6().min(0).optional(),restartOnError:re().optional(),waitForResources:rh([re(),n6().min(0)]).optional(),...aN}),px=rp({build:nU().optional(),memory:n6().optional(),runTimeoutSecs:n6().min(0).optional(),waitSecs:n6().min(0).optional(),webhooks:ru(o6).optional(),maxItems:n6().min(0).optional(),maxTotalChargeUsd:n6().min(0).optional(),restartOnError:re().optional(),waitForResources:rh([re(),n6().min(0)]).optional(),...aN}),pA=rp({status:rw(rV).optional(),origin:rw(rJ).optional()});let pk=class TaskClient extends a9{constructor(e){super({resourcePath:"actor-tasks",...e})}async get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:i}=oH(e,a$,"TimeoutOptions");return this.getResource(l0(),{},t,i)}async update(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,o6);let{timeoutSecs:i="short",signal:n}=oH(t,a$,"TimeoutOptions");return this.updateResource(l0(),e,i,n)}async publish(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.update({isPublic:!0},e)}async unpublish(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.update({isPublic:!1},e)}async delete(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:i}=oH(e,a$,"TimeoutOptions");return this.deleteResource(t,i)}async start(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,pR);let i=oH(t,pO,"TaskStartOptions"),{waitForFinish:n,runTimeoutSecs:r,memory:o,build:a,maxItems:s,maxTotalChargeUsd:l,restartOnError:u,waitForResources:c,timeoutSecs:p,signal:d}=i,f={waitForFinish:n,timeout:r,memory:o,build:a,webhooks:ai(i.webhooks),maxItems:s,maxTotalChargeUsd:l,restartOnError:u},h={url:this.buildUrl("runs"),method:"POST",data:e,params:this.buildParams(f),stringifyFunctions:!0,headers:{"Content-Type":"application/json"},timeoutSecs:this.timeoutForWaitForFinish(p,"medium",n),signal:d};return o7(await uF(async()=>this.httpClient.call(h),!au(e)&&c,this.httpClient.logger,d),le())}async call(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,pR);let{waitSecs:i,timeoutSecs:n="noTimeout",signal:r,...o}=oH(t,px,"TaskCallOptions"),{id:a}=await this.start(e,{...o,timeoutSecs:n,signal:r});return this.apifyClient.run(a).waitForFinish({waitSecs:i,timeoutSecs:n,signal:r})}async getInput(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:i}=oH(e,a$,"TimeoutOptions");return(await this.httpClient.call({url:this.buildUrl("input"),method:"GET",params:this.buildParams(),timeoutSecs:t,signal:i})).data}async updateInput(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{timeoutSecs:i="short",signal:n}=oH(t,a$,"TimeoutOptions");return(await this.httpClient.call({url:this.buildUrl("input"),method:"PUT",params:this.buildParams(),data:e,timeoutSecs:i,signal:n})).data}lastRun(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=oH(e,pA,"TaskLastRunOptions");return new cX(this.subResourceOptions({id:"last",params:this.buildParams(t),resourcePath:"runs"}))}runs(){return new c1(this.subResourceOptions({resourcePath:"runs"}))}webhooks(){return new c9(this.subResourceOptions())}};let pC=rp({...ad,desc:re().optional(),...aN});let pP=class TaskCollectionClient extends uY{constructor(e){super({resourcePath:"actor-tasks",...e})}list(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=oH(e,pC,"TaskCollectionListOptions");return this.listResourcesPaginated(lJ(),t,"medium")}async create(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,o6);let{timeoutSecs:i="medium",signal:n}=oH(t,a$,"TimeoutOptions");return this.createResource(l0(),e,i,n)}};let pI=class UserClient extends a9{constructor(e){super({resourcePath:"users",...e})}async get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:i}=oH(e,a$,"TimeoutOptions");return this.getResource(uA(),{},t,i)}async monthlyUsage(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:i}=oH(e,a$,"TimeoutOptions");return o7(await this.httpClient.call({url:this.buildUrl("usage/monthly"),method:"GET",params:this.buildParams(),timeoutSecs:t,signal:i}),uL())}async limits(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:i}=oH(e,a$,"TimeoutOptions");return o7(await this.httpClient.call({url:this.buildUrl("limits"),method:"GET",params:this.buildParams(),timeoutSecs:t,signal:i}),uD())}async updateLimits(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{timeoutSecs:i="short",signal:n}=oH(t,a$,"TimeoutOptions"),r={url:this.buildUrl("limits"),method:"PUT",params:this.buildParams(),data:e,timeoutSecs:i,signal:n};await this.httpClient.call(r)}};let pU=rp({...ad,desc:re().optional(),...aN});let pz=class WebhookDispatchCollectionClient extends uY{constructor(e){super({resourcePath:"webhook-dispatches",...e})}list(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=oH(e,pU,"WebhookDispatchCollectionListOptions");return this.listResourcesPaginated(un(),t,"medium")}};let pL=class WebhookClient extends a9{constructor(e){super({resourcePath:"webhooks",...e})}async get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:i}=oH(e,a$,"TimeoutOptions");return this.getResource(sj(),{},t,i)}async update(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,o6);let{timeoutSecs:i="short",signal:n}=oH(t,a$,"TimeoutOptions");return this.updateResource(sj(),e,i,n)}async delete(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:i}=oH(e,a$,"TimeoutOptions");return this.deleteResource(t,i)}async test(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="medium",signal:i}=oH(e,a$,"TimeoutOptions");return o7(await this.httpClient.call({url:this.buildUrl("test"),method:"POST",params:this.buildParams(),timeoutSecs:t,signal:i}),ui())}dispatches(){return new pz(this.subResourceOptions({resourcePath:"dispatches"}))}};let pN=class WebhookDispatchClient extends a9{constructor(e){super({resourcePath:"webhook-dispatches",...e})}async get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:i}=oH(e,a$,"TimeoutOptions");return this.getResource(ui(),{},t,i)}};let p$="https://api.apify.com";function pD(e){let t=new URL(e),i=t.pathname.replace(/\/+$/,"");return t.pathname=i.endsWith("/v2")?i:`${i}/v2`,t.href}let pM=rp({baseUrl:nU().default(p$),compression:ak.default("brotli"),headers:rv(nU(),nU()).optional(),publicBaseUrl:nU().default(p$),maxRetries:aB.maxRetries.default(8),minDelayBetweenRetriesMillis:aB.minDelayBetweenRetriesMillis.default(500),timeoutShortSecs:aB.timeoutShortSecs.default(5),timeoutMediumSecs:aB.timeoutMediumSecs.default(30),timeoutLongSecs:aB.timeoutLongSecs.default(360),timeoutMaxSecs:aB.timeoutMaxSecs.default(360),token:nU().optional(),userAgentSuffix:rh([nU(),ru(nU())]).optional()}),pj=rp({baseUrl:nU().default(p$),publicBaseUrl:nU().default(p$),token:nU().optional(),httpClient:rj(aZ)}),pB=nU().min(1),pF=rp({clientKey:nU().min(1).optional(),timeoutSecs:n6().positive().optional()});let pq=class ApifyClient{baseUrl;publicBaseUrl;token;stats;logger;#M;#j;constructor(e={}){let t=oH(e,pM,"ApifyClientOptions"),{baseUrl:i,compression:n,headers:r,publicBaseUrl:o,maxRetries:a,minDelayBetweenRetriesMillis:s,timeoutShortSecs:l,timeoutMediumSecs:u,timeoutLongSecs:c,timeoutMaxSecs:p,token:d}=t;this.baseUrl=pD(i),this.publicBaseUrl=pD(o),this.token=d,this.stats=new aU,this.logger=ok.child({prefix:"ApifyClient"}),this.#j={stats:this.stats,maxRetries:a,minDelayBetweenRetriesMillis:s,compression:n,headers:r,timeoutShortSecs:l,timeoutMediumSecs:u,timeoutLongSecs:c,timeoutMaxSecs:p,logger:this.logger,token:this.token,userAgentSuffix:t.userAgentSuffix}}static withCustomHttpClient(e){let{httpClient:t,...i}=oH(e,pj,"ApifyClientCustomHttpClientOptions"),n=new ApifyClient(i);return n.httpClient=t,n}get httpClient(){return this.#M??=new aQ(this.#j),this.#M}set httpClient(e){this.token&&e.setDefaultAuthorization(this.token),this.#M=e,this.stats=e.stats}#B(){return{baseUrl:this.baseUrl,publicBaseUrl:this.publicBaseUrl,apifyClient:this,httpClient:this.httpClient}}actors(){return new pr(this.#B())}actor(e){return oH(e,pB),new pi({id:e,...this.#B()})}builds(){return new uQ(this.#B())}build(e){return oH(e,pB),new uJ({id:e,...this.#B()})}datasets(){return new pc(this.#B())}dataset(e){return oH(e,pB),new c_({id:e,...this.#B()})}keyValueStores(){return new ph(this.#B())}keyValueStore(e){return oH(e,pB),new cA({id:e,...this.#B()})}log(e){return oH(e,pB),new uW({id:e,...this.#B()})}requestQueues(){return new py(this.#B())}requestQueue(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,pB);let i=oH(t,pF,"RequestQueueUserOptions");return new cq({id:e,...this.#B()},i)}runs(){return new c1({...this.#B(),resourcePath:"actor-runs"})}run(e){return oH(e,pB),new cX({id:e,...this.#B()})}tasks(){return new pP(this.#B())}task(e){return oH(e,pB),new pk({id:e,...this.#B()})}schedules(){return new pE(this.#B())}schedule(e){return oH(e,pB),new pv({id:e,...this.#B()})}user(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"me";return oH(e,pB),new pI({id:e,...this.#B()})}webhooks(){return new c9(this.#B())}webhook(e){return oH(e,pB),new pL({id:e,...this.#B()})}webhookDispatches(){return new pz(this.#B())}webhookDispatch(e){return oH(e,pB),new pN({id:e,...this.#B()})}store(){return new pT(this.#B())}async setStatusMessage(e,t){let i=ar(rX);if(!i)throw Error(`Environment variable ${rX} is not set!`);await this.run(i).update({statusMessage:e,...t})}}})();var r=n.TD,o=n.B,a=n.h0,s=n.XP,l=n.v8,u=n.G7,c=n.Lu,p=n.vp,d=n.Jo,f=n.UP,h=n.rj,m=n.VI,g=n.Ns,y=n.Ip,b=n.kt,v=n.KW,_=n.fK,w=n.wb,E=n.wv,S=n.yY,T=n.my,R=n.qQ,O=n._,x=n.Qq,A=n.tY,k=n.rE,C=n.PD,P=n.lE,I=n.ss,U=n.kq,z=n.m_,L=n.O_,N=n.OE,$=n.oc,D=n.oW,M=n.dK,j=n.Ry,B=n.Ng,F=n.Hg,q=n.L6,Z=n.Ty,W=n.gP,K=n.py,G=n.YS,V=n.t1,H=n.jE,J=n.D_,Y=n.jx,X=n.F,Q=n.J_,ee=n.hH,et=n.zC,ei=n._l,en=n.fu;export{r as ActorClient,o as ActorCollectionClient,a as ActorEnvVarClient,s as ActorEnvVarCollectionClient,l as ActorListSortBy,u as ActorServerClient,c as ActorSourceType,p as ActorVersionClient,d as ActorVersionCollectionClient,f as ApifyApiError,h as ApifyClient,m as ApifyClientError,g as ArgumentValidationError,y as BrotliHttpCompressor,b as BuildClient,v as BuildCollectionClient,_ as ConflictError,w as DatasetClient,E as DatasetCollectionClient,S as DownloadItemsFormat,T as FetchHttpClient,R as ForbiddenError,O as GzipHttpCompressor,x as HttpClient,A as InvalidRequestError,k as InvalidResponseBodyError,C as KeyValueStoreClient,P as KeyValueStoreCollectionClient,I as LogClient,U as LoggerActorRedirect,z as NotFoundError,L as PlatformFeature,N as RateLimitError,$ as RequestQueueClient,D as RequestQueueCollectionClient,M as ResponseValidationError,j as RunClient,B as RunCollectionClient,F as ScheduleActions,q as ScheduleClient,Z as ScheduleCollectionClient,W as ServerError,K as StoreCollectionClient,G as StreamedLog,V as TaskClient,H as TaskCollectionClient,J as UnauthorizedError,Y as UserClient,X as WebhookClient,Q as WebhookCollectionClient,ee as WebhookDispatchClient,et as WebhookDispatchCollectionClient,ei as WebhookDispatchStatus,en as ZstdHttpCompressor};
68
+ or submit an issue to https://github.com/apify/apify-shared-js so we can help you further.`);let i=new TextEncoder,n=await cp.importKey("raw",i.encode(e),{name:"HMAC",hash:"SHA-256"},!1,["sign"]),r=Array.from(new Uint8Array(await cp.sign("HMAC",n,i.encode(t)))).map(e=>e.toString(16).padStart(2,"0")).join("").substring(0,30);var o=BigInt(`0x${r}`);if(0n===o)return cc[0];let a="";for(;o>0n;)a=cc[Number(o%62n)]+a,o/=62n;return a}async function cf({resourceId:e,urlSigningSecretKey:t,expiresInMillis:i,version:n=0}){let r=i?new Date().getTime()+i:0,o=await cd(t,`${n}.${r}.${e}`);var a=new TextEncoder().encode(`${n}.${r}.${o}`);let s="";for(let e=0;e<a.length;e++)s+=String.fromCharCode(a[e]);return btoa(s).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}i("d").Buffer;var ch=((oo={}).JSON="json",oo.JSONL="jsonl",oo.XML="xml",oo.HTML="html",oo.CSV="csv",oo.XLSX="xlsx",oo.RSS="rss",oo);let cm=rw(ch),cg=rD(o3,"Expected an object"),cy=rp({clean:re().optional(),desc:re().optional(),flatten:ru(nU()).optional(),fields:ru(nU()).optional(),omit:ru(nU()).optional(),...af,skipEmpty:re().optional(),skipHidden:re().optional(),unwind:ru(nU()).optional(),view:nU().optional(),signature:nU().optional(),...a$}),cb=rp({attachment:re().optional(),bom:re().optional(),clean:re().optional(),delimiter:nU().optional(),desc:re().optional(),flatten:ru(nU()).optional(),fields:ru(nU()).optional(),omit:ru(nU()).optional(),limit:n6().min(0).optional(),offset:n6().min(0).optional(),skipEmpty:re().optional(),skipHeaderRow:re().optional(),skipHidden:re().optional(),unwind:ru(nU()).optional(),view:nU().optional(),xmlRoot:nU().optional(),xmlRow:nU().optional(),signature:nU().optional(),stream:re().optional(),...a$}),cv=rh([cg,nU(),ru(cg)]),c_=rp({clean:re().optional(),desc:re().optional(),flatten:ru(nU()).optional(),fields:ru(nU()).optional(),format:cm.optional(),omit:ru(nU()).optional(),limit:n6().min(0).optional(),offset:n6().min(0).optional(),skipEmpty:re().optional(),skipHidden:re().optional(),unwind:ru(nU()).optional(),view:nU().optional(),expiresInSecs:n6().positive().optional(),...a$});let cw=class DatasetClient extends a3{constructor(e){super({resourcePath:"datasets",...e})}async get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:i}=oH(e,aD,"TimeoutOptions");return this.getResource(ln(),{},t,i)}async update(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,o6);let{timeoutSecs:i="short",signal:n}=oH(t,aD,"TimeoutOptions");return this.updateResource(ln(),e,i,n)}async delete(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:i}=oH(e,aD,"TimeoutOptions");return this.deleteResource(t,i)}listItems(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var t=this;let{timeoutSecs:i="long",signal:n,...r}=oH(e,cy,"DatasetClientListItemOptions");return this.listPaginatedFromCallback(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=await t.httpClient.call({url:t.buildUrl("items"),method:"GET",params:t.buildParams(e),timeoutSecs:i,signal:n});return t.#z(r,e.desc??!1)},r)}async downloadItems(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,cm);let{timeoutSecs:i="long",signal:n,stream:r,...o}=oH(t,cb,"DatasetClientDownloadItemsOptions"),{data:a}=await this.httpClient.call({url:this.buildUrl("items"),method:"GET",params:this.buildParams({format:e,...o}),responseType:r?"stream":"buffer",timeoutSecs:i,signal:n});return a}async pushItems(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,cv);let{timeoutSecs:i="medium",signal:n}=oH(t,aD,"TimeoutOptions");await this.httpClient.call({url:this.buildUrl("items"),method:"POST",headers:{"content-type":"application/json; charset=utf-8"},data:e,params:this.buildParams(),doNotRetryTimeouts:!0,timeoutSecs:i,signal:n})}async getStatistics(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:i}=oH(e,aD,"TimeoutOptions");return o7(await this.httpClient.call({url:this.buildUrl("statistics"),method:"GET",params:this.buildParams(),timeoutSecs:t,signal:i}),lo())}async createItemsPublicUrl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="long",signal:i,expiresInSecs:n,...r}=oH(e,c_,"DatasetClientCreateItemsUrlOptions"),o=await this.get({timeoutSecs:t,signal:i}),a=new URL(this.buildPublicUrl("items"));if(o?.urlSigningSecretKey){let e=await cf({resourceId:o.id,urlSigningSecretKey:o.urlSigningSecretKey,expiresInMillis:n?1e3*n:void 0});a.searchParams.set("signature",e)}return(a=ah(a,r)).toString()}#z(e,t){let i=e.headers["x-apify-pagination-desc"];return{items:e.data,total:Number(e.headers["x-apify-pagination-total"]),offset:Number(e.headers["x-apify-pagination-offset"]),count:Math.max(Number(e.headers["x-apify-pagination-count"]??0),e.data.length),limit:Number(e.headers["x-apify-pagination-limit"]),desc:"string"==typeof i?JSON.parse(i):t}}};let cE=rp({limit:n6().min(0).optional(),chunkSize:n6().positive().optional(),exclusiveStartKey:nU().optional(),collection:nU().optional(),prefix:nU().optional(),signature:nU().optional(),...a$}),cS=nU().min(1),cT=rp({limit:n6().min(0).optional(),exclusiveStartKey:nU().optional(),collection:nU().optional(),prefix:nU().optional(),expiresInSecs:n6().positive().optional(),...a$}),cR=nU(),cO=rp({buffer:re().optional(),stream:re().optional(),disableRedirect:re().optional(),signature:nU().optional(),...a$}),cx=rp({key:nU(),value:rD(e=>void 0!==e&&"symbol"!=typeof e&&"bigint"!=typeof e&&"function"!=typeof e&&("number"!=typeof e||Number.isFinite(e)),"Expected a JSON-serializable value, binary data, or a stream"),contentType:nU().min(1).optional(),contentEncoding:nU().trim().min(1).optional()}),cA=rp({...a$,doNotRetryTimeouts:re().optional()});let ck=class KeyValueStoreClient extends a3{constructor(e){super({resourcePath:"key-value-stores",...e})}async get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:i}=oH(e,aD,"TimeoutOptions");return this.getResource(ls(),{},t,i)}async update(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,o6);let{timeoutSecs:i="long",signal:n}=oH(t,aD,"TimeoutOptions");return this.updateResource(ls(),e,i,n)}async delete(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:i}=oH(e,aD,"TimeoutOptions");return this.deleteResource(t,i)}listKeys(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var t=this;let{chunkSize:i,timeoutSecs:n="medium",signal:r,...o}=oH(e,cE,"KeyValueClientListKeysOptions"),a=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o7(await t.httpClient.call({url:t.buildUrl("keys"),method:"GET",params:t.buildParams(e),timeoutSecs:n,signal:r}),lu())},s=a({...o,limit:ad(o.limit,i)});return Object.defineProperty(s,Symbol.asyncIterator,{value:async function*(){let e=await s;yield*e.items;let t=o.limit?o.limit-e.items.length:void 0;for(;e.items.length>0&&null!=e.nextExclusiveStartKey&&(void 0===t||t>0);){let n={...o,limit:ad(t,i),exclusiveStartKey:e.nextExclusiveStartKey};e=await a(n),yield*e.items,t&&(t-=e.items.length)}}})}async getRecordPublicUrl(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,cS);let{timeoutSecs:i="long",signal:n}=oH(t,aD,"TimeoutOptions"),r=await this.get({timeoutSecs:i,signal:n}),o=new URL(this.buildPublicUrl(["records",e]));if(r?.urlSigningSecretKey){let t=await cd(r.urlSigningSecretKey,e);o.searchParams.append("signature",t)}return o.toString()}async createKeysPublicUrl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="long",signal:i,expiresInSecs:n,...r}=oH(e,cT,"KeyValueClientCreateKeysUrlOptions"),o=await this.get({timeoutSecs:t,signal:i}),a=new URL(this.buildPublicUrl("keys"));if(o?.urlSigningSecretKey){let e=await cf({resourceId:o.id,urlSigningSecretKey:o.urlSigningSecretKey,expiresInMillis:n?1e3*n:void 0});a.searchParams.set("signature",e)}return(a=ah(a,r)).toString()}async recordExists(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{timeoutSecs:i="long",signal:n}=oH(t,aD,"TimeoutOptions"),r={url:this.buildUrl(["records",e]),method:"HEAD",params:this.buildParams(),timeoutSecs:i,signal:n};try{return await this.httpClient.call(r),!0}catch(e){ae(e)}return!1}async getRecord(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,cR);let i=oH(t,cO,"KeyValueClientGetRecordOptions");"disableRedirect"in i&&ok.deprecated("The disableRedirect option for getRecord() is deprecated. It has no effect and will be removed in the following major release.");let n={attachment:"true"};i.signature&&(n.signature=i.signature);let r={url:this.buildUrl(["records",e]),method:"GET",params:this.buildParams(n),timeoutSecs:i.timeoutSecs??"long",signal:i.signal};i.buffer&&(r.responseType="buffer"),i.stream&&(r.responseType="stream");try{let t=await this.httpClient.call(r);return{key:e,value:t.data,contentType:t.headers["content-type"]}}catch(e){ae(e)}}async setRecord(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,cx);let i=oH(t,cA,"KeyValueStoreRecordOptions"),{key:n,contentEncoding:r}=e,{value:o,contentType:a}=e,{timeoutSecs:s="long",signal:l,doNotRetryTimeouts:u}=i;if(void 0!==r&&!oC.isNode)throw Error("The contentEncoding option can only be used in Node.js environment.");let c=ac(o)||ao(o)||aa(o);if(void 0!==r&&"identity"!==r.trim().toLowerCase()&&!c)throw TypeError(`Cannot upload a value of type ${typeof o} with Content-Encoding: ${r}. An encoding other than identity declares the value is already compressed, so pass the compressed bytes as a Buffer, an ArrayBuffer, a typed array, a Blob, or a readable stream.`);if(a||(a=aa(o)?o.type||"application/octet-stream":c?"application/octet-stream":"string"==typeof o?"text/plain; charset=utf-8":"application/json; charset=utf-8"),a.startsWith("application/json")&&!c&&"string"!=typeof o)try{o=JSON.stringify(o,null,2)}catch(e){throw Error(`The record value cannot be stringified to JSON. Please provide other content type.
69
+ Cause: ${e.message}`)}let p={url:this.buildUrl(["records",n]),method:"PUT",params:this.buildParams(),data:o,headers:{"content-type":a,...void 0!==r&&{"content-encoding":r}},doNotRetryTimeouts:u,timeoutSecs:s,signal:l};await this.httpClient.call(p)}async deleteRecord(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,cR);let{timeoutSecs:i="short",signal:n}=oH(t,aD,"TimeoutOptions");await this.httpClient.call({url:this.buildUrl(["records",e]),method:"DELETE",params:this.buildParams(),timeoutSecs:i,signal:n})}};let cC=rp({limit:n6().min(0).optional(),...a$}),cP=rp({lockSecs:n6(),limit:n6().min(0).optional(),...a$}),cI=rD(e=>o3(e)&&void 0===e.id,"Expected a request object without an `id`"),cU=rp({forefront:re().optional(),...a$}),cz=ru(cI).min(1),cL=re().optional(),cN=n6().optional(),c$=ru(rD(e=>o3(e)&&("string"==typeof e.id||"string"==typeof e.uniqueKey),"Expected a request object with an `id` or a `uniqueKey`")).min(1).max(25),cD=nU(),cM=rD(e=>o3(e)&&"string"==typeof e.id,"Expected a request object with an `id`"),cj=rp({lockSecs:n6(),forefront:re().optional(),...a$}),cB=ru(rw(["locked","pending"])).min(1),cF=rp({limit:n6().min(0).optional(),chunkSize:n6().positive().optional(),cursor:nU().optional(),filter:cB.optional(),...a$}),cq=rp({limit:n6().min(0).optional(),maxPageLimit:n6().default(1e3),cursor:nU().optional(),filter:cB.optional(),...a$});let cZ=class RequestQueueClient extends a3{#L;#N;constructor(e,t={}){super({resourcePath:"request-queues",...e}),this.#L=t.clientKey,this.#N=t.timeoutSecs}#$(e,t){return void 0!==e?e:void 0===this.#N||this.httpClient.timeoutMillis[t]/1e3<=this.#N?t:this.#N}async get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t,signal:i}=oH(e,aD,"TimeoutOptions");return this.getResource(l_(),{},this.#$(t,"short"),i)}async update(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,o6);let{timeoutSecs:i,signal:n}=oH(t,aD,"TimeoutOptions");return this.updateResource(l_(),e,this.#$(i,"short"),n)}async delete(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t,signal:i}=oH(e,aD,"TimeoutOptions");return this.deleteResource(this.#$(t,"short"),i)}async listHead(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=oH(e,cC,"RequestQueueClientListHeadOptions");return o7(await this.httpClient.call({url:this.buildUrl("head"),method:"GET",timeoutSecs:this.#$(t.timeoutSecs,"short"),signal:t.signal,params:this.buildParams({limit:t.limit,clientKey:this.#L})}),lK())}async listAndLockHead(e){let t=oH(e,cP,"RequestQueueClientListAndLockHeadOptions");return o7(await this.httpClient.call({url:this.buildUrl("head/lock"),method:"POST",timeoutSecs:this.#$(t.timeoutSecs,"medium"),signal:t.signal,params:this.buildParams({limit:t.limit,lockSecs:t.lockSecs,clientKey:this.#L})}),lV())}async addRequest(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,cI);let i=oH(t,cU,"RequestQueueClientAddRequestOptions");return o7(await this.httpClient.call({url:this.buildUrl("requests"),method:"POST",timeoutSecs:this.#$(i.timeoutSecs,"short"),signal:i.signal,data:e,params:this.buildParams({forefront:i.forefront,clientKey:this.#L})}),lz())}async addRequestBatch(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=oH(t,cU,"RequestQueueClientAddRequestOptions");return o7(await this.httpClient.call({url:this.buildUrl("requests/batch"),method:"POST",timeoutSecs:this.#$(i.timeoutSecs,"medium"),signal:i.signal,headers:{"content-type":"application/json"},data:`[${e.map(e=>{let{json:t}=e;return t}).join(",")}]`,params:this.buildParams({forefront:i.forefront,clientKey:this.#L})}),l$())}async addRequestBatchWithRetries(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{forefront:i,timeoutSecs:n,signal:r,maxUnprocessedRequestsRetries:o=3,minDelayBetweenUnprocessedRequestsRetriesMillis:a=500}=t,s=e,l=[],u=[];for(let t=0;t<1+o;t++){try{let o=await this.addRequestBatch(s,{forefront:i,timeoutSecs:n,signal:r});l.push(...o.processedRequests),u=o.unprocessedRequests,0!==u.length&&this.httpClient.stats.addRateLimitError(t+1);let a=l.map(e=>{let{uniqueKey:t}=e;return t});if(s=e.filter(e=>{let{request:t}=e;return!a.includes(t.uniqueKey)}),0===s.length)break}catch(i){if(r?.throwIfAborted(),i instanceof oJ)throw i;ok.exception(i,"Request batch insert failed");let t=l.map(e=>{let{uniqueKey:t}=e;return t});u=e.filter(e=>{let{request:i}=e;return!t.includes(i.uniqueKey)}).map(e=>{let{request:{method:t,uniqueKey:i,url:n}}=e;return{method:t,uniqueKey:i,url:n}});break}let o=Math.floor((1+Math.random())*2**t*a);await ab(o,r),r?.throwIfAborted()}return{processedRequests:l,unprocessedRequests:u}}async batchAddRequests(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{forefront:i,timeoutSecs:n,signal:r,maxUnprocessedRequestsRetries:o=3,maxParallel:a=5,minDelayBetweenUnprocessedRequestsRetriesMillis:s=500}=t;oH(e,cz),oH(i,cL),oH(n,aL),oH(r,aN),oH(o,cN),oH(a,cN),oH(s,cN);let l=new Set,u=[],c=9437184-Math.ceil(9437184*1e-4);for(let i of function(e,t){let{maxCount:i,maxByteLength:n}=t,r=[],o=[],a=1;for(let t of e)o.length>0&&(o.length>=i||a+t.byteLength+1>n)&&(r.push(o),o=[],a=1),o.push(t),a+=t.byteLength+1;return o.length>0&&r.push(o),r}(e.map((e,t)=>{let i=JSON.stringify(e),n=oQ.encode(i).byteLength;if(n+2>c)throw Error(`RequestQueueClient.batchAddRequests: The size of the request with index: ${t} exceeds the maximum allowed size (${c} bytes).`);return{request:e,json:i,byteLength:n}}),{maxCount:25,maxByteLength:c})){let e=this.addRequestBatchWithRetries(i,t);l.add(e),e.then(t=>{l.delete(e),u.push(t)},()=>void 0),l.size>=a&&await Promise.race(l)}await Promise.all(l);let p={processedRequests:[],unprocessedRequests:[]};return u.forEach(e=>{let{processedRequests:t,unprocessedRequests:i}=e;p.processedRequests.push(...t),p.unprocessedRequests.push(...i)}),p}async batchDeleteRequests(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,c$);let{timeoutSecs:i,signal:n}=oH(t,aD,"TimeoutOptions");return o7(await this.httpClient.call({url:this.buildUrl("requests/batch"),method:"DELETE",timeoutSecs:this.#$(i,"short"),signal:n,data:e,params:this.buildParams({clientKey:this.#L})}),lB())}async getRequest(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,cD);let{timeoutSecs:i,signal:n}=oH(t,aD,"TimeoutOptions"),r={url:this.buildUrl(["requests",e]),method:"GET",timeoutSecs:this.#$(i,"short"),signal:n,params:this.buildParams()};try{let e=await this.httpClient.call(r);return o7(e,lC())}catch(e){ae(e)}}async updateRequest(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,cM);let i=oH(t,cU,"RequestQueueClientAddRequestOptions");return o7(await this.httpClient.call({url:this.buildUrl(["requests",e.id]),method:"PUT",timeoutSecs:this.#$(i.timeoutSecs,"medium"),signal:i.signal,data:e,params:this.buildParams({forefront:i.forefront,clientKey:this.#L})}),lz())}async deleteRequest(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,cD);let{timeoutSecs:i,signal:n}=oH(t,aD,"TimeoutOptions");await this.httpClient.call({url:this.buildUrl(["requests",e]),method:"DELETE",timeoutSecs:this.#$(i,"short"),signal:n,params:this.buildParams({clientKey:this.#L})})}async prolongRequestLock(e,t){oH(e,cD);let i=oH(t,cj,"RequestQueueClientProlongRequestLockOptions");return o7(await this.httpClient.call({url:this.buildUrl(["requests",e,"lock"]),method:"PUT",timeoutSecs:this.#$(i.timeoutSecs,"medium"),signal:i.signal,params:this.buildParams({forefront:i.forefront,lockSecs:i.lockSecs,clientKey:this.#L})}),lq())}async deleteRequestLock(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,cD);let i=oH(t,cU,"RequestQueueClientDeleteRequestLockOptions");await this.httpClient.call({url:this.buildUrl(["requests",e,"lock"]),method:"DELETE",timeoutSecs:this.#$(i.timeoutSecs,"short"),signal:i.signal,params:this.buildParams({forefront:i.forefront,clientKey:this.#L})})}listRequests(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var t=this;let{chunkSize:i,timeoutSecs:n,signal:r,...o}=oH(e,cF,"RequestQueueClientListRequestsOptions"),a=this.#$(n,"medium"),s=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o7(await t.httpClient.call({url:t.buildUrl("requests"),method:"GET",timeoutSecs:a,signal:r,params:t.buildParams({...e,filter:e.filter?e.filter.join(","):void 0,clientKey:t.#L})}),lP())},l=s({...o,limit:ad(o.limit,i)});return Object.defineProperty(l,Symbol.asyncIterator,{value:async function*(){let e=await l;yield*e.items;let t=o.limit?o.limit-e.items.length:void 0;for(;e.items.length>0&&e.nextCursor&&(void 0===t||t>0);){let n={...o,limit:ad(t,i),cursor:e.nextCursor};e=await s(n),yield*e.items,t&&(t-=e.items.length)}}})}async unlockRequests(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t,signal:i}=oH(e,aD,"TimeoutOptions");return o7(await this.httpClient.call({url:this.buildUrl("requests/unlock"),method:"POST",timeoutSecs:this.#$(t,"long"),signal:i,params:this.buildParams({clientKey:this.#L})}),lF())}paginateRequests(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{limit:t,cursor:i,filter:n,maxPageLimit:r,timeoutSecs:o,signal:a}=oH(e,cq,"RequestQueueClientPaginateRequestsOptions");return new ap({getPage:async e=>this.listRequests({...e,filter:n,timeoutSecs:o,signal:a}),limit:t,cursor:i,maxPageLimit:r})}};let cW=rp({waitForFinish:n6().optional(),...a$}),cK=rp({gracefully:re().optional(),...a$}),cG=nU(),cV=rp({contentType:nU().optional(),build:nU().optional(),...a$}),cH=rp({build:nU().optional(),memory:n6().optional(),runTimeoutSecs:n6().optional(),maxItems:n6().optional(),maxTotalChargeUsd:n6().optional(),restartOnError:re().optional(),...a$}),cJ=rp({eventName:nU(),count:n6().default(1),idempotencyKey:nU().optional(),requestId:nU().optional(),...a$}),cY=rp({waitSecs:n6().optional(),...a$}),cX=rp({clean:re().optional(),fields:ru(nU()).optional(),omit:ru(nU()).optional(),...af,skipEmpty:re().optional(),skipHidden:re().optional(),unwind:ru(nU()).optional(),pollIntervalSecs:n6().min(0).optional(),...a$});let cQ=class RunClient extends a3{constructor(e){super({...e,resourcePath:e.resourcePath||"actor-runs"})}async get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t,signal:i,...n}=oH(e,cW,"RunGetOptions");return this.getResource(lt(),n,this.timeoutForWaitForFinish(t,"short",n.waitForFinish),i)}async abort(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="medium",signal:i,...n}=oH(e,cK,"RunAbortOptions");return o7(await this.httpClient.call({url:this.buildUrl("abort"),method:"POST",params:this.buildParams(n),timeoutSecs:t,signal:i}),lt())}async delete(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:i}=oH(e,aD,"TimeoutOptions");return this.deleteResource(t,i)}async metamorph(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};oH(e,cG);let n=oH(i,cV,"RunMetamorphOptions"),r={targetActorId:this.toSafeId(e),build:n.build},o={url:this.buildUrl("metamorph"),method:"POST",data:t,params:this.buildParams(r),stringifyFunctions:!0,timeoutSecs:n.timeoutSecs??"medium",signal:n.signal};return n.contentType&&(o.headers={"content-type":n.contentType}),o7(await this.httpClient.call(o),lt())}async reboot(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="medium",signal:i}=oH(e,aD,"TimeoutOptions"),n={url:this.buildUrl("reboot"),method:"POST",timeoutSecs:t,signal:i};return o7(await this.httpClient.call(n),lt())}async update(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,o6);let{timeoutSecs:i="short",signal:n}=oH(t,aD,"TimeoutOptions");return this.updateResource(lt(),e,i,n)}async resurrect(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="medium",signal:i,runTimeoutSecs:n,...r}=oH(e,cH,"RunResurrectOptions");return o7(await this.httpClient.call({url:this.buildUrl("resurrect"),method:"POST",params:this.buildParams({...r,timeout:n}),timeoutSecs:t,signal:i}),lt())}async charge(e){let{eventName:t,count:i,idempotencyKey:n,timeoutSecs:r="short",requestId:o,signal:a}=oH(e,cJ,"RunChargeOptions"),s=(Math.random()+1).toString(36).slice(3,8),l=n??`${this.id}-${t}-${Date.now()}-${s}`,u={url:this.buildUrl("charge"),method:"POST",data:{eventName:t,count:i,requestId:o},headers:{"idempotency-key":l},timeoutSecs:r,signal:a};return await this.httpClient.call(u)}async waitForFinish(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=oH(e,cY,"RunWaitForFinishOptions");return this.waitForJobFinish(lt(),t)}dataset(){return new cw(this.subResourceOptions({resourcePath:"dataset"}))}keyValueStore(){return new ck(this.subResourceOptions({resourcePath:"key-value-store"}))}requestQueue(){return new cZ(this.subResourceOptions({resourcePath:"request-queue"}))}log(){return new uK(this.subResourceOptions({resourcePath:"log"}))}async getStreamedLog(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};oH(e.timeoutSecs,aL),oH(e.signal,aN);let{fromStart:t=!0,timeoutSecs:i="long",signal:n}=e,{toLog:r}=e;if(null!==r&&oC.isNode){if(void 0===r||"default"===r){let e=await this.get({timeoutSecs:i,signal:n}),t=e?.id??"",o=e?.actId??"",a=o?await this.apifyClient.actor(o).get({timeoutSecs:i,signal:n}):void 0,s=[a?.name??"",`runId:${t}`].filter(Boolean).join(" ");r=new oA({level:r2.DEBUG,prefix:`${s} -> `,logger:new uG})}return new uV({logClient:this.log(),toLog:r,fromStart:t,signal:n})}}async *iterateDatasetItems(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{offset:t,limit:i,chunkSize:n,pollIntervalSecs:r=5,timeoutSecs:o="long",signal:a,...s}=oH(e,cX,"RunIterateDatasetItemsOptions"),l=n||1e3,u=t??0,c=i?u+i:void 0,p=await this.get({timeoutSecs:o,signal:a}),d=p&&p.id!==this.id?this.apifyClient.run(p.id):this,f=d.dataset(),h=async(e,t)=>f.listItems({...s,offset:e,limit:t,timeoutSecs:o,signal:a});for(;;){let e=!p||rH.includes(p.status),t=await f.get({timeoutSecs:o,signal:a}),i=t?.itemCount??0;for(void 0!==c&&(i=Math.min(i,c));u<i;){let e=Math.min(l,i-u),t=await h(u,e);yield*t.items,u+=e}if(void 0!==c&&u>=c)return;if(e)break;p=await d.waitForFinish({waitSecs:r,timeoutSecs:o,signal:a})}let{clean:m,skipEmpty:g,unwind:y}=s;for(;;){let e=void 0!==c?Math.min(l,c-u):l,t=await h(u,e);if(yield*t.items,0===t.count&&(!(m||g||y?.length)||0===(await f.listItems({offset:u,limit:1,timeoutSecs:o,signal:a})).items.length)||(u+=e,void 0!==c&&u>=c))return}}};let c0=rw(rV),c1=rp({...af,desc:re().optional(),status:rh([c0,ru(c0)]).optional(),startedBefore:rh([rs(),nU()]).optional(),startedAfter:rh([rs(),nU()]).optional(),...a$});let c2=class RunCollectionClient extends uX{constructor(e){super({resourcePath:"runs",...e})}list(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=oH(e,c1,"RunCollectionListOptions");return this.listResourcesPaginated(s2(),t,"medium")}};let c4=rp({...af,desc:re().optional(),...a$}),c9=o6.optional();let c3=class WebhookCollectionClient extends uX{constructor(e){super({resourcePath:"webhooks",...e})}list(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=oH(e,c4,"WebhookCollectionListOptions");return this.listResourcesPaginated(ut(),t,"medium")}async create(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,c9);let{timeoutSecs:i="short",signal:n}=oH(t,aD,"TimeoutOptions");return this.createResource(sB(),e,i,n)}};let c6=rp({build:nU().optional(),contentType:nU().optional(),memory:n6().optional(),runTimeoutSecs:n6().min(0).optional(),waitForFinish:n6().optional(),webhooks:ru(o6).optional(),maxItems:n6().min(0).optional(),maxTotalChargeUsd:n6().min(0).optional(),restartOnError:re().optional(),forcePermissionLevel:rw(r0).optional(),waitForResources:rh([re(),n6().min(0)]).optional(),...a$}),c8=rp({build:nU().optional(),contentType:nU().optional(),memory:n6().optional(),runTimeoutSecs:n6().min(0).optional(),waitSecs:n6().min(0).optional(),webhooks:ru(o6).optional(),maxItems:n6().min(0).optional(),maxTotalChargeUsd:n6().min(0).optional(),log:rh([new rt({type:"null",...L(void 0)}),rj(oA),rS("default")]).optional(),restartOnError:re().optional(),forcePermissionLevel:rw(r0).optional(),waitForResources:rh([re(),n6().min(0)]).optional(),...a$}),c5=rp({build:nU().optional(),contentType:nU().optional(),...a$}),c7=nU().min(1),pe=rp({betaPackages:re().optional(),tag:nU().optional(),useCache:re().optional(),waitForFinish:n6().optional(),...a$}),pt=rp({waitForFinish:n6().optional(),...a$}),pi=rp({status:rw(rV).optional(),origin:rw(rJ).optional()});let pn=class ActorClient extends a3{#D;constructor(e){super({resourcePath:"actors",...e})}async get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:i}=oH(e,aD,"TimeoutOptions");return this.getResource(sA(),{},t,i)}async update(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,o6);let{timeoutSecs:i="short",signal:n}=oH(t,aD,"TimeoutOptions");return this.updateResource(sA(),e,i,n)}async delete(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:i}=oH(e,aD,"TimeoutOptions");return this.deleteResource(t,i)}async start(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=oH(t,c6,"ActorStartOptions"),{waitForFinish:n,runTimeoutSecs:r,memory:o,build:a,maxItems:s,maxTotalChargeUsd:l,restartOnError:u,forcePermissionLevel:c,waitForResources:p,timeoutSecs:d,signal:f}=i,h={waitForFinish:n,timeout:r,memory:o,build:a,webhooks:ai(i.webhooks),maxItems:s,maxTotalChargeUsd:l,restartOnError:u,forcePermissionLevel:c},m={url:this.buildUrl("runs"),method:"POST",data:e,params:this.buildParams(h),stringifyFunctions:!0,timeoutSecs:this.timeoutForWaitForFinish(d,"medium",n),signal:f};return i.contentType&&(m.headers={"content-type":i.contentType}),o7(await uq(async()=>this.httpClient.call(m),!ac(e)&&p,this.httpClient.logger,f),lt())}async call(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{waitSecs:i,log:n,timeoutSecs:r="noTimeout",signal:o,...a}=oH(t,c8,"ActorCallOptions"),{id:s}=await this.start(e,{...a,timeoutSecs:r,signal:o}),l=this.apifyClient.run(s),u=await l.getStreamedLog({toLog:n,signal:o});return u?.start(),this.apifyClient.run(s).waitForFinish({waitSecs:i,timeoutSecs:r,signal:o}).finally(async()=>{await u?.stop()})}async validateInput(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=oH(t,c5,"ActorValidateInputOptions"),n={url:this.buildUrl("validate-input"),method:"POST",data:e,params:this.buildParams({build:i.build}),stringifyFunctions:!0,timeoutSecs:i.timeoutSecs??"short",signal:i.signal};return i.contentType&&(n.headers={"content-type":i.contentType}),(await this.httpClient.call(n)).data.valid}async build(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,c7);let{timeoutSecs:i,signal:n,...r}=oH(t,pe,"ActorBuildOptions");return o7(await this.httpClient.call({url:this.buildUrl("builds"),method:"POST",params:this.buildParams({version:e,...r}),timeoutSecs:this.timeoutForWaitForFinish(i,"medium",r.waitForFinish),signal:n}),uj())}async defaultBuild(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t,signal:i,...n}=oH(e,pt,"BuildClientGetOptions"),{id:r}=o7(await this.httpClient.call({url:this.buildUrl("builds/default"),method:"GET",params:this.buildParams(n),timeoutSecs:this.timeoutForWaitForFinish(t,"short",n.waitForFinish),signal:i}),uj());return new uY({baseUrl:this.apifyClient.baseUrl,publicBaseUrl:this.apifyClient.publicBaseUrl,httpClient:this.httpClient,apifyClient:this.apifyClient,id:r})}lastRun(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=oH(e,pi,"ActorLastRunOptions");return new cQ(this.subResourceOptions({id:"last",params:this.buildParams(t),resourcePath:"runs"}))}builds(){return new u0(this.subResourceOptions({resourcePath:"builds"}))}runs(){return new c2(this.subResourceOptions({resourcePath:"runs"}))}version(e){return oH(e,c7),new cr(this.subResourceOptions({id:e}))}versions(){return new ca(this.subResourceOptions())}webhooks(){return new c3(this.subResourceOptions())}server(){return this.#D??=new u3({baseUrl:this.baseUrl,publicBaseUrl:this.publicBaseUrl,apifyClient:this.apifyClient,httpClient:this.httpClient,id:this.id,params:this.params}),this.#D}standby(){return this.httpClient.logger.deprecated("`standby()` is deprecated and will be removed in v4. Use `server()` instead."),this.server()}};let pr=o6.optional();let po=class ActorCollectionClient extends uX{constructor(e){super({resourcePath:"actors",...e})}list(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=oH(e,ps,"ActorCollectionListOptions");return this.listResourcesPaginated(si(),t,"medium")}async create(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,pr);let{timeoutSecs:i="medium",signal:n}=oH(t,aD,"TimeoutOptions");return this.createResource(sA(),e,i,n)}};var pa=((oa={}).CREATED_AT="createdAt",oa.LAST_RUN_STARTED_AT="stats.lastRunStartedAt",oa);let ps=rp({my:re().optional(),...af,desc:re().optional(),sortBy:rw(pa).optional(),...a$}),pl=rp({unnamed:re().optional(),...af,desc:re().optional(),ownership:rw(r1).optional(),...a$}),pu=nU().optional(),pc=o6.optional();let pp=class DatasetCollectionClient extends uX{constructor(e){super({resourcePath:"datasets",...e})}list(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=oH(e,pl,"DatasetCollectionClientListOptions");return this.listResourcesPaginated(l6(),t,"medium")}async getOrCreate(e,t){oH(e,pu),oH(t?.schema,pc),oH(t?.timeoutSecs,aL),oH(t?.signal,aN);let{timeoutSecs:i="short",signal:n,...r}=t??{},o=Object.keys(r).length>0;return this.getOrCreateResource(ln(),e,o?r:void 0,i,n)}};let pd=rp({unnamed:re().optional(),...af,desc:re().optional(),ownership:rw(r1).optional(),...a$}),pf=nU().optional(),ph=o6.optional();let pm=class KeyValueStoreCollectionClient extends uX{constructor(e){super({resourcePath:"key-value-stores",...e})}list(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=oH(e,pd,"KeyValueStoreCollectionClientListOptions");return this.listResourcesPaginated(l9(),t,"medium")}async getOrCreate(e,t){oH(e,pf),oH(t?.schema,ph),oH(t?.timeoutSecs,aL),oH(t?.signal,aN);let{timeoutSecs:i="short",signal:n,...r}=t??{},o=Object.keys(r).length>0;return this.getOrCreateResource(ls(),e,o?r:void 0,i,n)}};let pg=rp({unnamed:re().optional(),...af,desc:re().optional(),ownership:rw(r1).optional(),...a$}),py=nU().optional();let pb=class RequestQueueCollectionClient extends uX{constructor(e){super({resourcePath:"request-queues",...e})}list(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=oH(e,pg,"RequestQueueCollectionListOptions");return this.listResourcesPaginated(l7(),t,"medium")}async getOrCreate(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,py);let{timeoutSecs:i="short",signal:n}=oH(t,aD,"TimeoutOptions");return this.getOrCreateResource(l_(),e,void 0,i,n)}};let pv=ru(ub());let p_=class ScheduleClient extends a3{constructor(e){super({resourcePath:"schedules",...e})}async get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:i}=oH(e,aD,"TimeoutOptions");return this.getResource(uB(),{},t,i)}async update(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,o6);let{timeoutSecs:i="short",signal:n}=oH(t,aD,"TimeoutOptions");return this.updateResource(uB(),e,i,n)}async delete(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:i}=oH(e,aD,"TimeoutOptions");return this.deleteResource(t,i)}async getLog(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="medium",signal:i}=oH(e,aD,"TimeoutOptions");return o7(await this.httpClient.call({url:this.buildUrl("log"),method:"GET",params:this.buildParams(),timeoutSecs:t,signal:i}),pv)}};let pw=rp({...af,desc:re().optional(),...a$}),pE=o6.optional();let pS=class ScheduleCollectionClient extends uX{constructor(e){super({resourcePath:"schedules",...e})}list(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=oH(e,pw,"ScheduleCollectionListOptions");return this.listResourcesPaginated(up(),t,"medium")}async create(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,pE);let{timeoutSecs:i="short",signal:n}=oH(t,aD,"TimeoutOptions");return this.createResource(uB(),e,i,n)}};let pT=rp({...af,search:nU().optional(),sortBy:nU().optional(),category:nU().optional(),username:nU().optional(),pricingModel:nU().optional(),includeUnrunnableActors:re().optional(),...a$});let pR=class StoreCollectionClient extends uX{constructor(e){super({resourcePath:"store",...e})}list(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=oH(e,pT,"StoreCollectionListOptions");return this.listResourcesPaginated(uw(),t,"medium")}};let pO=o6.optional(),px=rp({build:nU().optional(),memory:n6().optional(),runTimeoutSecs:n6().min(0).optional(),waitForFinish:n6().optional(),webhooks:ru(o6).optional(),maxItems:n6().min(0).optional(),maxTotalChargeUsd:n6().min(0).optional(),restartOnError:re().optional(),waitForResources:rh([re(),n6().min(0)]).optional(),...a$}),pA=rp({build:nU().optional(),memory:n6().optional(),runTimeoutSecs:n6().min(0).optional(),waitSecs:n6().min(0).optional(),webhooks:ru(o6).optional(),maxItems:n6().min(0).optional(),maxTotalChargeUsd:n6().min(0).optional(),restartOnError:re().optional(),waitForResources:rh([re(),n6().min(0)]).optional(),...a$}),pk=rp({status:rw(rV).optional(),origin:rw(rJ).optional()});let pC=class TaskClient extends a3{constructor(e){super({resourcePath:"actor-tasks",...e})}async get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:i}=oH(e,aD,"TimeoutOptions");return this.getResource(l1(),{},t,i)}async update(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,o6);let{timeoutSecs:i="short",signal:n}=oH(t,aD,"TimeoutOptions");return this.updateResource(l1(),e,i,n)}async publish(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.update({isPublic:!0},e)}async unpublish(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.update({isPublic:!1},e)}async delete(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:i}=oH(e,aD,"TimeoutOptions");return this.deleteResource(t,i)}async start(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,pO);let i=oH(t,px,"TaskStartOptions"),{waitForFinish:n,runTimeoutSecs:r,memory:o,build:a,maxItems:s,maxTotalChargeUsd:l,restartOnError:u,waitForResources:c,timeoutSecs:p,signal:d}=i,f={waitForFinish:n,timeout:r,memory:o,build:a,webhooks:ai(i.webhooks),maxItems:s,maxTotalChargeUsd:l,restartOnError:u},h={url:this.buildUrl("runs"),method:"POST",data:e,params:this.buildParams(f),stringifyFunctions:!0,headers:{"Content-Type":"application/json"},timeoutSecs:this.timeoutForWaitForFinish(p,"medium",n),signal:d};return o7(await uq(async()=>this.httpClient.call(h),!ac(e)&&c,this.httpClient.logger,d),lt())}async call(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,pO);let{waitSecs:i,timeoutSecs:n="noTimeout",signal:r,...o}=oH(t,pA,"TaskCallOptions"),{id:a}=await this.start(e,{...o,timeoutSecs:n,signal:r});return this.apifyClient.run(a).waitForFinish({waitSecs:i,timeoutSecs:n,signal:r})}async getInput(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:i}=oH(e,aD,"TimeoutOptions");return(await this.httpClient.call({url:this.buildUrl("input"),method:"GET",params:this.buildParams(),timeoutSecs:t,signal:i})).data}async updateInput(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{timeoutSecs:i="short",signal:n}=oH(t,aD,"TimeoutOptions");return(await this.httpClient.call({url:this.buildUrl("input"),method:"PUT",params:this.buildParams(),data:e,timeoutSecs:i,signal:n})).data}lastRun(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=oH(e,pk,"TaskLastRunOptions");return new cQ(this.subResourceOptions({id:"last",params:this.buildParams(t),resourcePath:"runs"}))}runs(){return new c2(this.subResourceOptions({resourcePath:"runs"}))}webhooks(){return new c3(this.subResourceOptions())}};let pP=rp({...af,desc:re().optional(),...a$});let pI=class TaskCollectionClient extends uX{constructor(e){super({resourcePath:"actor-tasks",...e})}list(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=oH(e,pP,"TaskCollectionListOptions");return this.listResourcesPaginated(lY(),t,"medium")}async create(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,o6);let{timeoutSecs:i="medium",signal:n}=oH(t,aD,"TimeoutOptions");return this.createResource(l1(),e,i,n)}};let pU=class UserClient extends a3{constructor(e){super({resourcePath:"users",...e})}async get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:i}=oH(e,aD,"TimeoutOptions");return this.getResource(uk(),{},t,i)}async monthlyUsage(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:i}=oH(e,aD,"TimeoutOptions");return o7(await this.httpClient.call({url:this.buildUrl("usage/monthly"),method:"GET",params:this.buildParams(),timeoutSecs:t,signal:i}),uN())}async limits(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:i}=oH(e,aD,"TimeoutOptions");return o7(await this.httpClient.call({url:this.buildUrl("limits"),method:"GET",params:this.buildParams(),timeoutSecs:t,signal:i}),uM())}async updateLimits(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{timeoutSecs:i="short",signal:n}=oH(t,aD,"TimeoutOptions"),r={url:this.buildUrl("limits"),method:"PUT",params:this.buildParams(),data:e,timeoutSecs:i,signal:n};await this.httpClient.call(r)}};let pz=rp({...af,desc:re().optional(),...a$});let pL=class WebhookDispatchCollectionClient extends uX{constructor(e){super({resourcePath:"webhook-dispatches",...e})}list(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=oH(e,pz,"WebhookDispatchCollectionListOptions");return this.listResourcesPaginated(ur(),t,"medium")}};let pN=class WebhookClient extends a3{constructor(e){super({resourcePath:"webhooks",...e})}async get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:i}=oH(e,aD,"TimeoutOptions");return this.getResource(sB(),{},t,i)}async update(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,o6);let{timeoutSecs:i="short",signal:n}=oH(t,aD,"TimeoutOptions");return this.updateResource(sB(),e,i,n)}async delete(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:i}=oH(e,aD,"TimeoutOptions");return this.deleteResource(t,i)}async test(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="medium",signal:i}=oH(e,aD,"TimeoutOptions");return o7(await this.httpClient.call({url:this.buildUrl("test"),method:"POST",params:this.buildParams(),timeoutSecs:t,signal:i}),un())}dispatches(){return new pL(this.subResourceOptions({resourcePath:"dispatches"}))}};let p$=class WebhookDispatchClient extends a3{constructor(e){super({resourcePath:"webhook-dispatches",...e})}async get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:i}=oH(e,aD,"TimeoutOptions");return this.getResource(un(),{},t,i)}};let pD="https://api.apify.com";function pM(e){let t=new URL(e),i=t.pathname.replace(/\/+$/,"");return t.pathname=i.endsWith("/v2")?i:`${i}/v2`,t.href}let pj=rp({baseUrl:nU().default(pD),compression:aC.default("brotli"),headers:rv(nU(),nU()).optional(),publicBaseUrl:nU().default(pD),maxRetries:aF.maxRetries.default(8),minDelayBetweenRetriesMillis:aF.minDelayBetweenRetriesMillis.default(500),timeoutShortSecs:aF.timeoutShortSecs.default(5),timeoutMediumSecs:aF.timeoutMediumSecs.default(30),timeoutLongSecs:aF.timeoutLongSecs.default(360),timeoutMaxSecs:aF.timeoutMaxSecs.default(360),token:nU().optional(),userAgentSuffix:rh([nU(),ru(nU())]).optional()}),pB=rp({baseUrl:nU().default(pD),publicBaseUrl:nU().default(pD),token:nU().optional(),httpClient:rj(aW)}),pF=nU().min(1),pq=rp({clientKey:nU().min(1).optional(),timeoutSecs:n6().positive().optional()});let pZ=class ApifyClient{baseUrl;publicBaseUrl;token;stats;logger;#M;#j;constructor(e={}){let t=oH(e,pj,"ApifyClientOptions"),{baseUrl:i,compression:n,headers:r,publicBaseUrl:o,maxRetries:a,minDelayBetweenRetriesMillis:s,timeoutShortSecs:l,timeoutMediumSecs:u,timeoutLongSecs:c,timeoutMaxSecs:p,token:d}=t;this.baseUrl=pM(i),this.publicBaseUrl=pM(o),this.token=d,this.stats=new az,this.logger=ok.child({prefix:"ApifyClient"}),this.#j={stats:this.stats,maxRetries:a,minDelayBetweenRetriesMillis:s,compression:n,headers:r,timeoutShortSecs:l,timeoutMediumSecs:u,timeoutLongSecs:c,timeoutMaxSecs:p,logger:this.logger,token:this.token,userAgentSuffix:t.userAgentSuffix}}static withCustomHttpClient(e){let{httpClient:t,...i}=oH(e,pB,"ApifyClientCustomHttpClientOptions"),n=new ApifyClient(i);return n.httpClient=t,n}get httpClient(){return this.#M??=new a0(this.#j),this.#M}set httpClient(e){this.token&&e.setDefaultAuthorization(this.token),this.#M=e,this.stats=e.stats}#B(){return{baseUrl:this.baseUrl,publicBaseUrl:this.publicBaseUrl,apifyClient:this,httpClient:this.httpClient}}actors(){return new po(this.#B())}actor(e){return oH(e,pF),new pn({id:e,...this.#B()})}builds(){return new u0(this.#B())}build(e){return oH(e,pF),new uY({id:e,...this.#B()})}datasets(){return new pp(this.#B())}dataset(e){return oH(e,pF),new cw({id:e,...this.#B()})}keyValueStores(){return new pm(this.#B())}keyValueStore(e){return oH(e,pF),new ck({id:e,...this.#B()})}log(e){return oH(e,pF),new uK({id:e,...this.#B()})}requestQueues(){return new pb(this.#B())}requestQueue(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};oH(e,pF);let i=oH(t,pq,"RequestQueueUserOptions");return new cZ({id:e,...this.#B()},i)}runs(){return new c2({...this.#B(),resourcePath:"actor-runs"})}run(e){return oH(e,pF),new cQ({id:e,...this.#B()})}tasks(){return new pI(this.#B())}task(e){return oH(e,pF),new pC({id:e,...this.#B()})}schedules(){return new pS(this.#B())}schedule(e){return oH(e,pF),new p_({id:e,...this.#B()})}user(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"me";return oH(e,pF),new pU({id:e,...this.#B()})}webhooks(){return new c3(this.#B())}webhook(e){return oH(e,pF),new pN({id:e,...this.#B()})}webhookDispatches(){return new pL(this.#B())}webhookDispatch(e){return oH(e,pF),new p$({id:e,...this.#B()})}store(){return new pR(this.#B())}async setStatusMessage(e,t){let i=ar(rX);if(!i)throw Error(`Environment variable ${rX} is not set!`);await this.run(i).update({statusMessage:e,...t})}}})();var r=n.TD,o=n.B,a=n.h0,s=n.XP,l=n.v8,u=n.G7,c=n.Lu,p=n.vp,d=n.Jo,f=n.UP,h=n.rj,m=n.VI,g=n.Ns,y=n.Ip,b=n.kt,v=n.KW,_=n.fK,w=n.wb,E=n.wv,S=n.yY,T=n.my,R=n.qQ,O=n._,x=n.Qq,A=n.tY,k=n.rE,C=n.PD,P=n.lE,I=n.ss,U=n.kq,z=n.m_,L=n.O_,N=n.OE,$=n.oc,D=n.oW,M=n.dK,j=n.Ry,B=n.Ng,F=n.Hg,q=n.L6,Z=n.Ty,W=n.gP,K=n.py,G=n.YS,V=n.t1,H=n.jE,J=n.D_,Y=n.jx,X=n.F,Q=n.J_,ee=n.hH,et=n.zC,ei=n._l,en=n.fu;export{r as ActorClient,o as ActorCollectionClient,a as ActorEnvVarClient,s as ActorEnvVarCollectionClient,l as ActorListSortBy,u as ActorServerClient,c as ActorSourceType,p as ActorVersionClient,d as ActorVersionCollectionClient,f as ApifyApiError,h as ApifyClient,m as ApifyClientError,g as ArgumentValidationError,y as BrotliHttpCompressor,b as BuildClient,v as BuildCollectionClient,_ as ConflictError,w as DatasetClient,E as DatasetCollectionClient,S as DownloadItemsFormat,T as FetchHttpClient,R as ForbiddenError,O as GzipHttpCompressor,x as HttpClient,A as InvalidRequestError,k as InvalidResponseBodyError,C as KeyValueStoreClient,P as KeyValueStoreCollectionClient,I as LogClient,U as LoggerActorRedirect,z as NotFoundError,L as PlatformFeature,N as RateLimitError,$ as RequestQueueClient,D as RequestQueueCollectionClient,M as ResponseValidationError,j as RunClient,B as RunCollectionClient,F as ScheduleActions,q as ScheduleClient,Z as ScheduleCollectionClient,W as ServerError,K as StoreCollectionClient,G as StreamedLog,V as TaskClient,H as TaskCollectionClient,J as UnauthorizedError,Y as UserClient,X as WebhookClient,Q as WebhookCollectionClient,ee as WebhookDispatchClient,et as WebhookDispatchCollectionClient,ei as WebhookDispatchStatus,en as ZstdHttpCompressor};
70
70
  //# sourceMappingURL=bundle.js.map