1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2260],{3836:(t,e)=>{"use strict";e.byteLength=function(t){var e=u(t),r=e[0],n=e[1];return(r+n)*3/4-n},e.toByteArray=function(t){var e,r,i=u(t),o=i[0],a=i[1],c=new s((o+a)*3/4-a),l=0,h=a>0?o-4:o;for(r=0;r<h;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],c[l++]=e>>16&255,c[l++]=e>>8&255,c[l++]=255&e;return 2===a&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,c[l++]=255&e),1===a&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,c[l++]=e>>8&255,c[l++]=255&e),c},e.fromByteArray=function(t){for(var e,n=t.length,s=n%3,i=[],o=0,a=n-s;o<a;o+=16383)i.push(function(t,e,n){for(var s,i=[],o=e;o<n;o+=3)i.push(r[(s=(t[o]<<16&0xff0000)+(t[o+1]<<8&65280)+(255&t[o+2]))>>18&63]+r[s>>12&63]+r[s>>6&63]+r[63&s]);return i.join("")}(t,o,o+16383>a?a:o+16383));return 1===s?i.push(r[(e=t[n-1])>>2]+r[e<<4&63]+"=="):2===s&&i.push(r[(e=(t[n-2]<<8)+t[n-1])>>10]+r[e>>4&63]+r[e<<2&63]+"="),i.join("")};for(var r=[],n=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,a=i.length;o<a;++o)r[o]=i[o],n[i.charCodeAt(o)]=o;function u(t){var e=t.length;if(e%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");-1===r&&(r=e);var n=r===e?0:4-r%4;return[r,n]}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},75927:(t,e,r)=>{"use strict";var n=r(3836),s=r(84981),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function o(t){if(t>0x7fffffff)throw RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,a.prototype),e}function a(t,e,r){if("number"==typeof t){if("string"==typeof e)throw TypeError('The "string" argument must be of type string. Received type number');return l(t)}return u(t,e,r)}function u(t,e,r){if("string"==typeof t)return function(t,e){if(("string"!=typeof e||""===e)&&(e="utf8"),!a.isEncoding(e))throw TypeError("Unknown encoding: "+e);var r=0|d(t,e),n=o(r),s=n.write(t,e);return s!==r&&(n=n.slice(0,s)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(q(t,Uint8Array)){var e=new Uint8Array(t);return f(e.buffer,e.byteOffset,e.byteLength)}return h(t)}(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(q(t,ArrayBuffer)||t&&q(t.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(q(t,SharedArrayBuffer)||t&&q(t.buffer,SharedArrayBuffer)))return f(t,e,r);if("number"==typeof t)throw TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return a.from(n,e,r);var s=function(t){if(a.isBuffer(t)){var e,r=0|p(t.length),n=o(r);return 0===n.length||t.copy(n,0,0,r),n}return void 0!==t.length?"number"!=typeof t.length||(e=t.length)!=e?o(0):h(t):"Buffer"===t.type&&Array.isArray(t.data)?h(t.data):void 0}(t);if(s)return s;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return a.from(t[Symbol.toPrimitive]("string"),e,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function c(t){if("number"!=typeof t)throw TypeError('"size" argument must be of type number');if(t<0)throw RangeError('The value "'+t+'" is invalid for option "size"')}function l(t){return c(t),o(t<0?0:0|p(t))}function h(t){for(var e=t.length<0?0:0|p(t.length),r=o(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}function f(t,e,r){var n;if(e<0||t.byteLength<e)throw RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),a.prototype),n}function p(t){if(t>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|t}function d(t,e){if(a.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||q(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var s=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return C(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return I(t).length;default:if(s)return n?-1:C(t).length;e=(""+e).toLowerCase(),s=!0}}function y(t,e,r){var s,i,o=!1;if((void 0===e||e<0)&&(e=0),e>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(e>>>=0)))return"";for(t||(t="utf8");;)switch(t){case"hex":return function(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var s="",i=e;i<r;++i)s+=A[t[i]];return s}(this,e,r);case"utf8":case"utf-8":return b(this,e,r);case"ascii":return function(t,e,r){var n="";r=Math.min(t.length,r);for(var s=e;s<r;++s)n+=String.fromCharCode(127&t[s]);return n}(this,e,r);case"latin1":case"binary":return function(t,e,r){var n="";r=Math.min(t.length,r);for(var s=e;s<r;++s)n+=String.fromCharCode(t[s]);return n}(this,e,r);case"base64":return s=e,i=r,0===s&&i===this.length?n.fromByteArray(this):n.fromByteArray(this.slice(s,i));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(t,e,r){for(var n=t.slice(e,r),s="",i=0;i<n.length-1;i+=2)s+=String.fromCharCode(n[i]+256*n[i+1]);return s}(this,e,r);default:if(o)throw TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),o=!0}}function g(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function v(t,e,r,n,s){var i;if(0===t.length)return -1;if("string"==typeof r?(n=r,r=0):r>0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),(i=r=+r)!=i&&(r=s?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(s)return -1;r=t.length-1}
1else if(r<0){if(!s)return -1;r=0}if("string"==typeof e&&(e=a.from(e,n)),a.isBuffer(e))return 0===e.length?-1:m(t,e,r,n,s);if("number"==typeof e)return(e&=255,"function"==typeof Uint8Array.prototype.indexOf)?s?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):m(t,[e],r,n,s);throw TypeError("val must be string, number or Buffer")}function m(t,e,r,n,s){var i,o=1,a=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return -1;o=2,a/=2,u/=2,r/=2}function c(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(s){var l=-1;for(i=r;i<a;i++)if(c(t,i)===c(e,-1===l?0:i-l)){if(-1===l&&(l=i),i-l+1===u)return l*o}else -1!==l&&(i-=i-l),l=-1}else for(r+u>a&&(r=a-u),i=r;i>=0;i--){for(var h=!0,f=0;f<u;f++)if(c(t,i+f)!==c(e,f)){h=!1;break}if(h)return i}return -1}function b(t,e,r){r=Math.min(t.length,r);for(var n=[],s=e;s<r;){var i,o,a,u,c=t[s],l=null,h=c>239?4:c>223?3:c>191?2:1;if(s+h<=r)switch(h){case 1:c<128&&(l=c);break;case 2:(192&(i=t[s+1]))==128&&(u=(31&c)<<6|63&i)>127&&(l=u);break;case 3:i=t[s+1],o=t[s+2],(192&i)==128&&(192&o)==128&&(u=(15&c)<<12|(63&i)<<6|63&o)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:i=t[s+1],o=t[s+2],a=t[s+3],(192&i)==128&&(192&o)==128&&(192&a)==128&&(u=(15&c)<<18|(63&i)<<12|(63&o)<<6|63&a)>65535&&u<1114112&&(l=u)}null===l?(l=65533,h=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),s+=h}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return r}(n)}function w(t,e,r){if(t%1!=0||t<0)throw RangeError("offset is not uint");if(t+e>r)throw RangeError("Trying to access beyond buffer length")}function _(t,e,r,n,s,i){if(!a.isBuffer(t))throw TypeError('"buffer" argument must be a Buffer instance');if(e>s||e<i)throw RangeError('"value" argument is out of bounds');if(r+n>t.length)throw RangeError("Index out of range")}function E(t,e,r,n,s,i){if(r+n>t.length||r<0)throw RangeError("Index out of range")}function x(t,e,r,n,i){return e=+e,r>>>=0,i||E(t,e,r,4,34028234663852886e22,-34028234663852886e22),s.write(t,e,r,n,23,4),r+4}function S(t,e,r,n,i){return e=+e,r>>>=0,i||E(t,e,r,8,17976931348623157e292,-17976931348623157e292),s.write(t,e,r,n,52,8),r+8}e.hp=a,e.IS=50,a.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),a.TYPED_ARRAY_SUPPORT||"undefined"==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(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}}),a.poolSize=8192,a.from=function(t,e,r){return u(t,e,r)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array),a.alloc=function(t,e,r){return(c(t),t<=0)?o(t):void 0!==e?"string"==typeof r?o(t).fill(e,r):o(t).fill(e):o(t)},a.allocUnsafe=function(t){return l(t)},a.allocUnsafeSlow=function(t){return l(t)},a.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==a.prototype},a.compare=function(t,e){if(q(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),q(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(t)||!a.isBuffer(e))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,n=e.length,s=0,i=Math.min(r,n);s<i;++s)if(t[s]!==e[s]){r=t[s],n=e[s];break}return r<n?-1:n<r?1:0},a.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(t,e){if(!Array.isArray(t))throw TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return a.alloc(0);if(void 0===e)for(r=0,e=0;r<t.length;++r)e+=t[r].length;var r,n=a.allocUnsafe(e),s=0;for(r=0;r<t.length;++r){var i=t[r];
vendor: 10,139 bytes, line 1
1if(q(i,Uint8Array))s+i.length>n.length?a.from(i).copy(n,s):Uint8Array.prototype.set.call(n,i,s);else if(a.isBuffer(i))i.copy(n,s);else throw TypeError('"list" argument must be an Array of Buffers');s+=i.length}return n},a.byteLength=d,a.prototype._isBuffer=!0,a.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)g(this,e,e+1);return this},a.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)g(this,e,e+3),g(this,e+1,e+2);return this},a.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)g(this,e,e+7),g(this,e+1,e+6),g(this,e+2,e+5),g(this,e+3,e+4);return this},a.prototype.toString=function(){var t=this.length;return 0===t?"":0==arguments.length?b(this,0,t):y.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(t){if(!a.isBuffer(t))throw TypeError("Argument must be a Buffer");return this===t||0===a.compare(this,t)},a.prototype.inspect=function(){var t="",r=e.IS;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},i&&(a.prototype[i]=a.prototype.inspect),a.prototype.compare=function(t,e,r,n,s){if(q(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(t))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===s&&(s=this.length),e<0||r>t.length||n<0||s>this.length)throw RangeError("out of range index");if(n>=s&&e>=r)return 0;if(n>=s)return -1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,s>>>=0,this===t)return 0;for(var i=s-n,o=r-e,u=Math.min(i,o),c=this.slice(n,s),l=t.slice(e,r),h=0;h<u;++h)if(c[h]!==l[h]){i=c[h],o=l[h];break}return i<o?-1:o<i?1:0},a.prototype.includes=function(t,e,r){return -1!==this.indexOf(t,e,r)},a.prototype.indexOf=function(t,e,r){return v(this,t,e,r,!0)},a.prototype.lastIndexOf=function(t,e,r){return v(this,t,e,r,!1)},a.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else if(isFinite(e))e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var s,i,o,a,u,c,l,h,f=this.length-e;if((void 0===r||r>f)&&(r=f),t.length>0&&(r<0||e<0)||e>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var p=!1;;)switch(n){case"hex":return function(t,e,r,n){r=Number(r)||0;var s=t.length-r;n?(n=Number(n))>s&&(n=s):n=s;var i=e.length;n>i/2&&(n=i/2);for(var o=0;o<n;++o){var a=parseInt(e.substr(2*o,2),16);if(a!=a)break;t[r+o]=a}return o}(this,t,e,r);case"utf8":case"utf-8":return s=e,i=r,R(C(t,this.length-s),this,s,i);case"ascii":case"latin1":case"binary":return o=e,a=r,R(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(t),this,o,a);case"base64":return u=e,c=r,R(I(t),this,u,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return l=e,h=r,R(function(t,e){for(var r,n,s=[],i=0;i<t.length&&!((e-=2)<0);++i)n=(r=t.charCodeAt(i))>>8,s.push(r%256),s.push(n);return s}(t,this.length-l),this,l,h);default:if(p)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),p=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},a.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);var n=this.subarray(t,e);return Object.setPrototypeOf(n,a.prototype),n},a.prototype.readUintLE=a.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||w(t,e,this.length);for(var n=this[t],s=1,i=0;++i<e&&(s*=256);)n+=this[t+i]*s;return n},a.prototype.readUintBE=a.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||w(t,e,this.length);for(var n=this[t+--e],s=1;e>0&&(s*=256);)n+=this[t+--e]*s;return n},a.prototype.readUint8=a.prototype.readUInt8=function(t,e){return t>>>=0,e||w(t,1,this.length),this[t]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(t,e){return t>>>=0,e||w(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(t,e){return t>>>=0,e||w(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(t,e){return t>>>=0,e||w(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+0x1000000*this[t+3]},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(t,e){return t>>>=0,e||w(t,4,this.length),0x1000000*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},a.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||w(t,e,this.length);for(var n=this[t],s=1,i=0;++i<e&&(s*=256);)n+=this[t+i]*s;return n>=(s*=128)&&(n-=Math.pow(2,8*e)),n},a.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||w(t,e,this.length);for(var n=e,s=1,i=this[t+--n];n>0&&(s*=256);)i+=this[t+--n]*s;return i>=(s*=128)&&(i-=Math.pow(2,8*e)),i},a.prototype.readInt8=function(t,e){return(t>>>=0,e||w(t,1,this.length),128&this[t])?-((255-this[t]+1)*1):this[t]},a.prototype.readInt16LE=function(t,e){t>>>=0,e||w(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?0xffff0000|r:r},a.prototype.readInt16BE=function(t,e){t>>>=0,e||w(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?0xffff0000|r:r},a.prototype.readInt32LE=function(t,e){return t>>>=0,e||w(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},a.prototype.readInt32BE=function(t,e){return t>>>=0,e||w(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},a.prototype.readFloatLE=function(t,e){return t>>>=0,e||w(t,4,this.length),s.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,e){return t>>>=0,e||w(t,4,this.length),s.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,e){return t>>>=0,e||w(t,8,this.length),s.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,e){return t>>>=0,e||w(t,8,this.length),s.read(this,t,!1,52,8)},a.prototype.writeUintLE=a.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e>>>=0,r>>>=0,!n){var s=Math.pow(2,8*r)-1;_(this,t,e,r,s,0)}var i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(t,e,r,n){if(t=+t,e>>>=0,r>>>=0,!n){var s=Math.pow(2,8*r)-1;_(this,t,e,r,s,0)}var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},a.prototype.writeUint8=a.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||_(this,t,e,1,255,0),this[e]=255&t,e+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||_(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||_(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||_(this,t,e,4,0xffffffff,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||_(this,t,e,4,0xffffffff,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},a.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var s=Math.pow(2,8*r-1);_(this,t,e,r,s-1,-s)}var i=0,o=1,a=0;for(this[e]=255&t;++i<r&&(o*=256);)t<0&&0===a&&0!==this[e+i-1]&&(a=1),this[e+i]=(t/o>>0)-a&255;return e+r},a.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var s=Math.pow(2,8*r-1);_(this,t,e,r,s-1,-s)}var i=r-1,o=1,a=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===a&&0!==this[e+i+1]&&(a=1),this[e+i]=(t/o>>0)-a&255;return e+r},a.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||_(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},a.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||_(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},a.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||_(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},a.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||_(this,t,e,4,0x7fffffff,-0x80000000),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},a.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||_(this,t,e,4,0x7fffffff,-0x80000000),t<0&&(t=0xffffffff+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},a.prototype.writeFloatLE=function(t,e,r){return x(this,t,e,!0,r)},a.prototype.writeFloatBE=function(t,e,r){return x(this,t,e,!1,r)},a.prototype.writeDoubleLE=function(t,e,r){return S(this,t,e,!0,r)},a.prototype.writeDoubleBE=function(t,e,r){return S(this,t,e,!1,r)},a.prototype.copy=function(t,e,r,n){if(!a.isBuffer(t))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r||0===t.length||0===this.length)return 0;if(e<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var s=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),s},a.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!a.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===t.length){var s,i=t.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(t=i)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw RangeError("Out of range index");if(r<=e)return this;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(s=e;s<r;++s)this[s]=t;else{var o=a.isBuffer(t)?t:a.from(t,n),u=o.length;
1if(0===u)throw TypeError('The value "'+t+'" is invalid for argument "value"');for(s=0;s<r-e;++s)this[s+e]=o[s%u]}return this};var T=/[^+/0-9A-Za-z-_]/g;function C(t,e){e=e||1/0;for(var r,n=t.length,s=null,i=[],o=0;o<n;++o){if((r=t.charCodeAt(o))>55295&&r<57344){if(!s){if(r>56319||o+1===n){(e-=3)>-1&&i.push(239,191,189);continue}s=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),s=r;continue}r=(s-55296<<10|r-56320)+65536}else s&&(e-=3)>-1&&i.push(239,191,189);if(s=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return i}function I(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(T,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function R(t,e,r,n){for(var s=0;s<n&&!(s+r>=e.length)&&!(s>=t.length);++s)e[s+r]=t[s];return s}function q(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}var A=function(){for(var t="0123456789abcdef",e=Array(256),r=0;r<16;++r)for(var n=16*r,s=0;s<16;++s)e[n+s]=t[r]+t[s];return e}()},84981:(t,e)=>{e.read=function(t,e,r,n,s){var i,o,a=8*s-n-1,u=(1<<a)-1,c=u>>1,l=-7,h=r?s-1:0,f=r?-1:1,p=t[e+h];for(h+=f,i=p&(1<<-l)-1,p>>=-l,l+=a;l>0;i=256*i+t[e+h],h+=f,l-=8);for(o=i&(1<<-l)-1,i>>=-l,l+=n;l>0;o=256*o+t[e+h],h+=f,l-=8);if(0===i)i=1-c;else{if(i===u)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),i-=c}return(p?-1:1)*o*Math.pow(2,i-n)},e.write=function(t,e,r,n,s,i){var o,a,u,c=8*i-s-1,l=(1<<c)-1,h=l>>1,f=23===s?5960464477539062e-23:0,p=n?0:i-1,d=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(isNaN(e=Math.abs(e))||e===1/0?(a=isNaN(e)?1:0,o=l):(o=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-o))<1&&(o--,u*=2),o+h>=1?e+=f/u:e+=f*Math.pow(2,1-h),e*u>=2&&(o++,u/=2),o+h>
1=l?(a=0,o=l):o+h>=1?(a=(e*u-1)*Math.pow(2,s),o+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,s),o=0));s>=8;t[r+p]=255&a,p+=d,a/=256,s-=8);for(o=o<<s|a,c+=s;c>0;t[r+p]=255&o,p+=d,o/=256,c-=8);t[r+p-d]|=128*y}},47279:(t,e,r)=>{"use strict";r.d(e,{c:()=>l});var n=r(3996),s=r(45160),i=r(13822),o=r(26019),a=r(36564),u=r(80195),c=r(65110),l=function(){function t(t){t&&(this._subscribe=t)}return t.prototype.lift=function(e){var r=new t;return r.source=this,r.operator=e,r},t.prototype.subscribe=function(t,e,r){var i,o=this,a=(i=t)&&i instanceof n.vU||i&&(0,u.T)(i.next)&&(0,u.T)(i.error)&&(0,u.T)(i.complete)&&(0,s.Uv)(i)?t:new n.Ms(t,e,r);return(0,c.Y)(function(){var t=o.operator,e=o.source;a.add(t?t.call(a,e):e?o._subscribe(a):o._trySubscribe(a))}),a},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},t.prototype.forEach=function(t,e){var r=this;return new(e=h(e))(function(e,s){var i=new n.Ms({next:function(e){try{t(e)}catch(t){s(t),i.unsubscribe()}},error:s,complete:e});r.subscribe(i)})},t.prototype._subscribe=function(t){var e;return null===(e=this.source)||void 0===e?void 0:e.subscribe(t)},t.prototype[i.s]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return(0,o.m)(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=h(t))(function(t,r){var n;e.subscribe(function(t){return n=t},function(t){return r(t)},function(){return t(n)})})},t.create=function(e){return new t(e)},t}();function h(t){var e;return null!==(e=null!=t?t:a.$.Promise)&&void 0!==e?e:Promise}},87659:(t,e,r)=>{"use strict";r.d(e,{m:()=>o});var n=r(6476),s=r(66677),i=r(31833),o=function(t){function e(e,r,n){void 0===e&&(e=1/0),void 0===r&&(r=1/0),void 0===n&&(n=i.U);var s=t.call(this)||this;return s._bufferSize=e,s._windowTime=r,s._timestampProvider=n,s._buffer=[],s._infiniteTimeWindow=!0,s._infiniteTimeWindow=r===1/0,s._bufferSize=Math.max(1,e),s._windowTime=Math.max(1,r),s}return(0,n.C6)(e,t),e.prototype.next=function(e){var r=this.isStopped,n=this._buffer,s=this._infiniteTimeWindow,i=this._timestampProvider,o=this._windowTime;!r&&(n.push(e),s||n.push(i.now()+o)),this._trimBuffer(),t.prototype.next.call(this,e)},e.prototype._subscribe=function(t){this._throwIfClosed(),this._trimBuffer();for(var e=this._innerSubscribe(t),r=this._infiniteTimeWindow,n=this._buffer.slice(),s=0;s<n.length&&!t.closed;s+=r?1:2)t.next(n[s]);return this._checkFinalizedStatuses(t),e},e.prototype._trimBuffer=function(){var t=this._bufferSize,e=this._timestampProvider,r=this._buffer,n=this._infiniteTimeWindow,s=(n?1:2)*t;if(t<1/0&&s<r.length&&r.splice(0,r.length-s),!n){for(var i=e.now(),o=0,a=1;a<r.length&&r[a]<=i;a+=2)o=a;o&&r.splice(0,o+1)}},e}(s.B)},66677:(t,e,r)=>{"use strict";r.d(e,{B:()=>c});var n=r(6476),s=r(47279),i=r(45160),o=(0,r(12985).L)(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),a=r(62238),u=r(65110),c=function(t){function e(){var e=t.call(this)||this;return e.closed=!1,e.currentObservers=null,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return(0,n.C6)(e,t),e.prototype.lift=function(t){var e=new l(this,this);return e.operator=t,e},e.prototype._throwIfClosed=function(){if(this.closed)throw new o},e.prototype.next=function(t){var e=this;(0,u.Y)(function(){var r,s;if(e._throwIfClosed(),!e.isStopped){e.currentObservers||(e.currentObservers=Array.from(e.observers));try{for(var i=(0,n.Ju)(e.currentObservers),o=i.next();!o.done;o=i.next())o.value.next(t)}catch(t){r={error:t}}finally{try{o&&!o.done&&(s=i.return)&&s.call(i)}finally{if(r)throw r.error}}}})},e.prototype.error=function(t){var e=this;(0,u.Y)(function(){if(e._throwIfClosed(),!e.isStopped){e.hasError=e.isStopped=!0,e.thrownError=t;for(var r=e.observers;r.length;)r.shift().error(t)}})},e.prototype.complete=function(){var t=this;(0,u.Y)(function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var e=t.observers;e.length;)e.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return(null===(t=this.observers)||void 0===t?void 0:t.length)>0}
1,enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(e){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var e=this,r=this.hasError,n=this.isStopped,s=this.observers;return r||n?i.Kn:(this.currentObservers=null,s.push(t),new i.yU(function(){e.currentObservers=null,(0,a.o)(s,t)}))},e.prototype._checkFinalizedStatuses=function(t){var e=this.hasError,r=this.thrownError,n=this.isStopped;e?t.error(r):n&&t.complete()},e.prototype.asObservable=function(){var t=new s.c;return t.source=this,t},e.create=function(t,e){return new l(t,e)},e}(s.c),l=function(t){function e(e,r){var n=t.call(this)||this;return n.destination=e,n.source=r,n}return(0,n.C6)(e,t),e.prototype.next=function(t){var e,r;null===(r=null===(e=this.destination)||void 0===e?void 0:e.next)||void 0===r||r.call(e,t)},e.prototype.error=function(t){var e,r;null===(r=null===(e=this.destination)||void 0===e?void 0:e.error)||void 0===r||r.call(e,t)},e.prototype.complete=function(){var t,e;null===(e=null===(t=this.destination)||void 0===t?void 0:t.complete)||void 0===e||e.call(t)},e.prototype._subscribe=function(t){var e,r;return null!==(r=null===(e=this.source)||void 0===e?void 0:e.subscribe(t))&&void 0!==r?r:i.Kn},e}(c)},3996:(t,e,r)=>{"use strict";r.d(e,{Ms:()=>v,vU:()=>p});var n=r(6476),s=r(80195),i=r(45160),o=r(36564),a=r(67690),u=r(86879),c=l("C",void 0,void 0);function l(t,e,r){return{kind:t,value:e,error:r}}var h=r(50522),f=r(65110),p=function(t){function e(e){var r=t.call(this)||this;return r.isStopped=!1,e?(r.destination=e,(0,i.Uv)(e)&&e.add(r)):r.destination=w,r}return(0,n.C6)(e,t),e.create=function(t,e,r){return new v(t,e,r)},e.prototype.next=function(t){this.isStopped?b(l("N",t,void 0),this):this._next(t)},e.prototype.error=function(t){this.isStopped?b(l("E",void 0,t),this):(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped?b(c,this):(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(i.yU),d=Function.prototype.bind;function y(t,e){return d.call(t,e)}var g=function(){function t(t){this.partialObserver=t}return t.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(t){m(t)}},t.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(t){m(t)}else m(t)},t.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(t){m(t)}},t}(),v=function(t){function e(e,r,n){var i,a,u=t.call(this)||this;return(0,s.T)(e)||!e?i={next:null!=e?e:void 0,error:null!=r?r:void 0,complete:null!=n?n:void 0}:u&&o.$.useDeprecatedNextContext?((a=Object.create(e)).unsubscribe=function(){return u.unsubscribe()},i={next:e.next&&y(e.next,a),error:e.error&&y(e.error,a),complete:e.complete&&y(e.complete,a)}):i=e,u.destination=new g(i),u}return(0,n.C6)(e,t),e}(p);function m(t){o.$.useDeprecatedSynchronousErrorHandling?(0,f.l)(t):(0,a.m)(t)}function b(t,e){var r=o.$.onStoppedNotification;r&&h.f.setTimeout(function(){return r(t,e)})}var w={closed:!0,next:u.l,error:function(t){throw t},complete:u.l}},45160:(t,e,r)=>{"use strict";r.d(e,{Kn:()=>u,yU:()=>a,Uv:()=>c});var n=r(6476),s=r(80195),i=(0,r(12985).L)(function(t){return function(e){t(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map(function(t,e){return e+1+") "+t.toString()}).join("\n "):"",this.name="UnsubscriptionError",this.errors=e}}),o=r(62238),a=function(){var t;function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var t,e,r,o,a,u=this._parentage;if(u){if(this._parentage=null,Array.isArray(u))try{for(var c=(0,n.Ju)(u),h=c.next();!h.done;h=c.next())h.value.remove(this)}catch(e){t={error:e}}finally{try{h&&!h.done&&(e=c.return)&&e.call(c)}finally{if(t)throw t.error}}else u.remove(this)}var f=this.initialTeardown;
1if((0,s.T)(f))try{f()}catch(t){a=t instanceof i?t.errors:[t]}var p=this._finalizers;if(p){this._finalizers=null;try{for(var d=(0,n.Ju)(p),y=d.next();!y.done;y=d.next()){var g=y.value;try{l(g)}catch(t){a=null!=a?a:[],t instanceof i?a=(0,n.fX)((0,n.fX)([],(0,n.zs)(a)),(0,n.zs)(t.errors)):a.push(t)}}}catch(t){r={error:t}}finally{try{y&&!y.done&&(o=d.return)&&o.call(d)}finally{if(r)throw r.error}}}if(a)throw new i(a)}},e.prototype.add=function(t){var r;if(t&&t!==this){if(this.closed)l(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(r=this._finalizers)&&void 0!==r?r:[]).push(t)}}},e.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},e.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},e.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&(0,o.o)(e,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&(0,o.o)(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=((t=new e).closed=!0,t),e}(),u=a.EMPTY;function c(t){return t instanceof a||t&&"closed"in t&&(0,s.T)(t.remove)&&(0,s.T)(t.add)&&(0,s.T)(t.unsubscribe)}function l(t){(0,s.T)(t)?t():t.unsubscribe()}},36564:(t,e,r)=>{"use strict";r.d(e,{$:()=>n});var n={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1}},26125:(t,e,r)=>{"use strict";r.d(e,{_:()=>i});var n=r(66710),s=r(3996);function i(t,e){var r="object"==typeof e;return new Promise(function(i,o){var a=new s.Ms({next:function(t){i(t),a.unsubscribe()},error:o,complete:function(){r?i(e.defaultValue):o(new n.G)}});t.subscribe(a)})}},83967:(t,e,r)=>{"use strict";r.d(e,{s:()=>s});var n=r(66710);function s(t,e){var r="object"==typeof e;return new Promise(function(s,i){var o,a=!1;t.subscribe({next:function(t){o=t,a=!0},error:i,complete:function(){a?s(o):r?s(e.defaultValue):i(new n.G)}})})}},9262:(t,e,r)=>{"use strict";r.d(e,{P:()=>p,z:()=>f});var n=r(47279),s=r(18025),i=r(92036),o=r(16449),a=r(7690),u=r(6274),c=r(42756),l=r(42894),h=r(65623);function f(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=(0,u.lI)(t),l=(0,u.ms)(t),h=(0,s.D)(t),f=h.args,d=h.keys;if(0===f.length)return(0,i.H)([],r);var y=new n.c(p(f,r,d?function(t){return(0,c.e)(d,t)}:o.D));return l?y.pipe((0,a.I)(l)):y}function p(t,e,r){return void 0===r&&(r=o.D),function(n){d(e,function(){for(var s=t.length,o=Array(s),a=s,u=s,c=function(s){d(e,function(){var c=(0,i.H)(t[s],e),h=!1;c.subscribe((0,l._)(n,function(t){o[s]=t,!h&&(h=!0,u--),u||n.next(r(o.slice()))},function(){--a||n.complete()}))},n)},h=0;h<s;h++)c(h)},n)}}function d(t,e,r){t?(0,h.N)(r,t,e):e()}},49400:(t,e,r)=>{"use strict";r.d(e,{x:()=>o});var n=r(59095),s=r(6274),i=r(92036);function o(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return(0,n.K)()((0,i.H)(t,(0,s.lI)(t)))}},59176:(t,e,r)=>{"use strict";r.d(e,{v:()=>i});var n=r(47279),s=r(51924);function i(t){return new n.c(function(e){(0,s.Tg)(t()).subscribe(e)})}},40065:(t,e,r)=>{"use strict";r.d(e,{I:()=>i,w:()=>s});var n=r(47279),s=new n.c(function(t){return t.complete()});function i(t){return t?new n.c(function(e){return t.schedule(function(){return e.complete()})}):s}},92036:(t,e,r)=>{"use strict";r.d(e,{H:()=>i});var n=r(2481),s=r(51924);function i(t,e){return e?(0,n.c)(t,e):(0,s.Tg)(t)}},68072:(t,e,r)=>{"use strict";r.d(e,{R:()=>function t(e,r,d,y){if((0,u.T)(d)&&(y=d,d=void 0),y)return t(e,r,d).pipe((0,c.I)(y));var g=(0,n.zs)((0,u.T)(e.addEventListener)&&(0,u.T)(e.removeEventListener)?h.map(function(t){return function(n){return e[t](r,n,d)}}):(0,u.T)(e.addListener)&&(0,u.T)(e.removeListener)?l.map(p(e,r)):(0,u.T)(e.on)&&(0,u.T)(e.off)?f.map(p(e,r)):[],2),v=g[0],m=g[1];if(!v&&(0,a.X)(e))return(0,o.Z)(function(e){return t(e,r,d)})((0,s.Tg)(e));if(!v)throw TypeError("Invalid event target");return new i.c(function(t){var e=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return t.next(1<e.length?e:e[0])};return v(e),function(){return m(e)}})}});var n=r(6476),s=r(51924),i=r(47279),o=r(36806),a=r(34255),u=r(80195),c=r(7690),l=["addListener","removeListener"],h=["addEventListener","removeEventListener"],f=["on","off"];function p(t,e){return function(r){return function(n){return t[r](e,n)}}}},51924:(t,e,r)=>{"use strict";r.d(e,{Tg:()=>y});var n=r(6476),s=r(34255),i=r(32932),o=r(47279),a=r(48469),u=r(58359),c=r(35415),l=r(48985),h=r(21168),f=r(80195),p=r(67690),d=r(13822);function y(t){if(t instanceof o.c)return t;if(null!=t){if((0,a.l)(t))return new o.c(function(e){var r=t[d.s]();if((0,f.T)(r.subscribe))return r.subscribe(e);throw TypeError("Provided object does not correctly implement Symbol.observable")});if((0,s.X)(t))return new o.c(function(e){for(var r=0;r<t.length&&!e.closed;r++)e.next(t[r]);e.complete()});if((0,i.y)(t))return new o.c(function(e){t.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,p.m)});if((0,u.T)(t))return g(t);if((0,l.x)(t))return new o.c(function(e){var r,s;try{for(var i=(0,n.Ju)(t),o=i.next();!o.done;o=i.next()){var a=o.value;if(e.next(a),e.closed)return}}catch(t){r={error:t}}finally{try{o&&!o.done&&(s=i.return)&&s.call(i)}finally{if(r)throw r.error}}e.complete()});if((0,h.U)(t))return g((0,h.C)(t))}throw(0,c.L)(t)}function g(t){return new o.c(function(e){(function(t,e){var r,s,i,o;return(0,n.sH)(this,void 0,void 0,function(){var a;return(0,n.YH)(this,function(u){switch(u.label){case 0:u.trys.push([0,5,6,11]),r=(0,n.xN)(t),u.label=1;case 1:return[4,r.next()];case 2:if((s=u.sent()).done)return[3,4];if(a=s.value,e.next(a),e.closed)return[2];u.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return i={error:u.sent()},[3,11];
1case 6:if(u.trys.push([6,,9,10]),!(s&&!s.done&&(o=r.return)))return[3,8];return[4,o.call(r)];case 7:u.sent(),u.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})})(t,e).catch(function(t){return e.error(t)})})}},70560:(t,e,r)=>{"use strict";r.d(e,{h:()=>u});var n=r(23087),s=r(51924),i=r(40065),o=r(6274),a=r(92036);function u(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=(0,o.lI)(t),u=(0,o.R0)(t,1/0);return t.length?1===t.length?(0,s.Tg)(t[0]):(0,n.U)(u)((0,a.H)(t,r)):i.w}},71317:(t,e,r)=>{"use strict";r.d(e,{of:()=>i});var n=r(6274),s=r(92036);function i(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=(0,n.lI)(t);return(0,s.H)(t,r)}},81086:(t,e,r)=>{"use strict";r.d(e,{$:()=>i});var n=r(47279),s=r(80195);function i(t,e){var r=(0,s.T)(t)?t:function(){return t},i=function(t){return t.error(r())};return new n.c(e?function(t){return e.schedule(i,0,t)}:i)}},77013:(t,e,r)=>{"use strict";r.d(e,{O:()=>a});var n=r(47279),s=r(7912),i=r(60220),o=r(9907);function a(t,e,r){void 0===t&&(t=0),void 0===r&&(r=s.b);var a=-1;return null!=e&&((0,i.m)(e)?r=e:a=e),new n.c(function(e){var n=(0,o.v)(t)?+t-r.now():t;n<0&&(n=0);var s=0;return r.schedule(function(){e.closed||(e.next(s++),0<=a?this.schedule(void 0,a):e.complete())},n)})}},42894:(t,e,r)=>{"use strict";r.d(e,{H:()=>i,_:()=>s});var n=r(6476);function s(t,e,r,n,s){return new i(t,e,r,n,s)}var i=function(t){function e(e,r,n,s,i,o){var a=t.call(this,e)||this;return a.onFinalize=i,a.shouldUnsubscribe=o,a._next=r?function(t){try{r(t)}catch(t){e.error(t)}}:t.prototype._next,a._error=s?function(t){try{s(t)}catch(t){e.error(t)}finally{this.unsubscribe()}}:t.prototype._error,a._complete=n?function(){try{n()}catch(t){e.error(t)}finally{this.unsubscribe()}}:t.prototype._complete,a}return(0,n.C6)(e,t),e.prototype.unsubscribe=function(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;t.prototype.unsubscribe.call(this),r||null===(e=this.onFinalize)||void 0===e||e.call(this)}},e}(r(3996).vU)},87463:(t,e,r)=>{"use strict";r.d(e,{W:()=>function t(e){return(0,i.N)(function(r,i){var o,a=null,u=!1;a=r.subscribe((0,s._)(i,void 0,void 0,function(s){o=(0,n.Tg)(e(s,t(e)(r))),a?(a.unsubscribe(),a=null,o.subscribe(i)):u=!0})),u&&(a.unsubscribe(),a=null,o.subscribe(i))})}});var n=r(51924),s=r(42894),i=r(64482)},59095:(t,e,r)=>{"use strict";r.d(e,{K:()=>s});var n=r(23087);function s(){return(0,n.U)(1)}},16798:(t,e,r)=>{"use strict";r.d(e,{H:()=>i});var n=r(36806),s=r(80195);function i(t,e){return(0,s.T)(e)?(0,n.Z)(t,e,1):(0,n.Z)(t,1)}},30070:(t,e,r)=>{"use strict";r.d(e,{p:()=>i});var n=r(64482),s=r(42894);function i(t,e){return(0,n.N)(function(r,n){var i=0;r.subscribe((0,s._)(n,function(r){return t.call(e,r,i++)&&n.next(r)}))})}},90346:(t,e,r)=>{"use strict";r.d(e,{j:()=>s});var n=r(64482);function s(t){return(0,n.N)(function(e,r){try{e.subscribe(r)}finally{r.add(t)}})}},31190:(t,e,r)=>{"use strict";r.d(e,{T:()=>i});var n=r(64482),s=r(42894);function i(t,e){return(0,n.N)(function(r,n){var i=0;r.subscribe((0,s._)(n,function(r){n.next(t.call(e,r,i++))}))})}},23087:(t,e,r)=>{"use strict";r.d(e,{U:()=>i});var n=r(36806),s=r(16449);function i(t){return void 0===t&&(t=1/0),(0,n.Z)(s.D,t)}},60142:(t,e,r)=>{"use strict";r.d(e,{h:()=>o});var n=r(51924),s=r(65623),i=r(42894);function o(t,e,r,o,a,u,c,l){var h=[],f=0,p=0,d=!1,y=function(){!d||h.length||f||e.complete()},g=function(t){return f<o?v(t):h.push(t)},v=function(t){u&&e.next(t),f++;var l=!1;(0,n.Tg)(r(t,p++)).subscribe((0,i._)(e,function(t){null==a||a(t),u?g(t):e.next(t)},function(){l=!0},void 0,function(){if(l)try{for(f--;h.length&&f<o;)!function(){var t=h.shift();c?(0,s.N)(e,c,function(){return v(t)}):v(t)}();y()}catch(t){e.error(t)}}))};return t.subscribe((0,i._)(e,g,function(){d=!0,y()})),function(){null==l||l()}}},36806:(t,e,r)=>{"use strict";r.d(e,{Z:()=>function t(e,r,u){return(void 0===u&&(u=1/0),(0,a.T)(r))?t(function(t,i){return(0,n.T)(function(e,n){return r(t,e,i,n)})((0,s.Tg)(e(t,i)))},u):("number"==typeof r&&(u=r),(0,i.N)(function(t,r){return(0,o.h)(t,r,e,u)}))}});var n=r(31190),s=r(51924),i=r(64482),o=r(60142),a=r(80195)},53825:(t,e,r)=>{"use strict";r.d(e,{Q:()=>o});var n=r(65623),s=r(64482),i=r(42894);function o(t,e){return void 0===e&&(e=0),(0,s.N)(function(r,s){r.subscribe((0,i._)(s,function(r){return(0,n.N)(s,t,function(){return s.next(r)},e)},function(){return(0,n.N)(s,t,function(){return s.complete()},e)},function(r){return(0,n.N)(s,t,function(){return s.error(r)},e)}))})}},28983:(t,e,r)=>{"use strict";r.d(e,{u:()=>u});var n=r(6476),s=r(51924),i=r(66677),o=r(3996),a=r(64482);function u(t){void 0===t&&(t={});var e=t.connector,r=void 0===e?function(){return new i.B}:e,n=t.resetOnError,u=void 0===n||n,l=t.resetOnComplete,h=void 0===l||l,f=t.resetOnRefCountZero,p=void 0===f||f;return function(t){var e,n,i,l=0,f=!1,d=!1,y=function(){null==n||n.unsubscribe(),n=void 0},g=function(){y(),e=i=void 0,f=d=!1},v=function(){var t=e;g(),null==t||t.unsubscribe()};return(0,a.N)(function(t,a){l++,d||f||y();var m=i=null!=i?i:r();a.add(function(){0!=--l||d||f||(n=c(v,p))}),m.subscribe(a),!e&&l>0&&(e=new o.Ms({next:function(t){return m.next(t)},error:function(t){d=!0,y(),n=c(g,u,t),m.error(t)},complete:function(){f=!0,y(),n=c(g,h),m.complete()}}),(0,s.Tg)(t).subscribe(e))})(t)}}function c(t,e){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];if(!0===e){t();return}if(!1!==e){var a=new o.Ms({next:function(){a.unsubscribe(),t()}});return(0,s.Tg)(e.apply(void 0,(0,n.fX)([],(0,n.zs)(r)))).subscribe(a)}}},12260:(t,e,r)=>{"use strict";r.d(e,{t:()=>i});var n=r(87659),s=r(28983);function i(t,e,r){var i,o,a,u,c=!1;return t&&"object"==typeof t?(u=void 0===(i=t.bufferSize)?1/0:i,e=void 0===(o=t.windowTime)?1/0:o,c=void 0!==(a=t.refCount)&&a,r=t.scheduler):u=null!=t?t:1/0,(0,s.u)({connector:function(){return new n.m(u,e,r)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:c})}},78449:(t,e,r)=>{"use strict";r.d(e,{_:()=>s});var n=r(64482);function s(t,e){return void 0===e&&(e=0),(0,n.N)(function(r,n){n.add(t.schedule(function(){return r.subscribe(n)},e))})}},43591:(t,e,r)=>{"use strict";r.d(e,{s:()=>o});var n=r(40065),s=r(64482),i=r(42894);function o(t){return t<=0?function(){return n.w}:(0,s.N)(function(e,r){var n=0;e.subscribe((0,i._)(r,function(e){++n<=t&&(r.next(e),t<=n&&r.complete())}))})}},75341:(t,e,r)=>{"use strict";r.d(e,{Q:()=>a});var n=r(64482),s=r(42894),i=r(51924),o=r(86879);function a(t){return(0,n.N)(function(e,r){(0,i.Tg)(t).subscribe((0,s._)(r,function(){return r.complete()},o.l)),r.closed||e.subscribe(r)})}}
1,8373:(t,e,r)=>{"use strict";r.d(e,{M:()=>a});var n=r(80195),s=r(64482),i=r(42894),o=r(16449);function a(t,e,r){var a=(0,n.T)(t)||e||r?{next:t,error:e,complete:r}:t;return a?(0,s.N)(function(t,e){null===(r=a.subscribe)||void 0===r||r.call(a);var r,n=!0;t.subscribe((0,i._)(e,function(t){var r;null===(r=a.next)||void 0===r||r.call(a,t),e.next(t)},function(){var t;n=!1,null===(t=a.complete)||void 0===t||t.call(a),e.complete()},function(t){var r;n=!1,null===(r=a.error)||void 0===r||r.call(a,t),e.error(t)},function(){var t,e;n&&(null===(t=a.unsubscribe)||void 0===t||t.call(a)),null===(e=a.finalize)||void 0===e||e.call(a)}))}):o.D}},2481:(t,e,r)=>{"use strict";r.d(e,{c:()=>m});var n=r(51924),s=r(53825),i=r(78449),o=r(47279),a=r(97877),u=r(80195),c=r(65623);function l(t,e){if(!t)throw Error("Iterable cannot be null");return new o.c(function(r){(0,c.N)(r,e,function(){var n=t[Symbol.asyncIterator]();(0,c.N)(r,e,function(){n.next().then(function(t){t.done?r.complete():r.next(t.value)})},0,!0)})})}var h=r(48469),f=r(32932),p=r(34255),d=r(48985),y=r(58359),g=r(35415),v=r(21168);function m(t,e){if(null!=t){if((0,h.l)(t))return(0,n.Tg)(t).pipe((0,i._)(e),(0,s.Q)(e));if((0,p.X)(t))return new o.c(function(r){var n=0;return e.schedule(function(){n===t.length?r.complete():(r.next(t[n++]),r.closed||this.schedule())})});if((0,f.y)(t))return(0,n.Tg)(t).pipe((0,i._)(e),(0,s.Q)(e));if((0,y.T)(t))return l(t,e);if((0,d.x)(t))return new o.c(function(r){var n;return(0,c.N)(r,e,function(){n=t[a.l](),(0,c.N)(r,e,function(){var t,e,s;try{e=(t=n.next()).value,s=t.done}catch(t){r.error(t);return}s?r.complete():r.next(e)},0,!0)}),function(){return(0,u.T)(null==n?void 0:n.return)&&n.return()}});if((0,v.U)(t))return l((0,v.C)(t),e)}throw(0,g.L)(t)}},1444:(t,e,r)=>{"use strict";r.d(e,{R:()=>a});var n=r(6476),s=function(t){function e(e,r){return t.call(this)||this}return(0,n.C6)(e,t),e.prototype.schedule=function(t,e){return void 0===e&&(e=0),this},e}(r(45160).yU),i={setInterval:function(t,e){for(var r=[],s=2;s<arguments.length;s++)r[s-2]=arguments[s];var o=i.delegate;return(null==o?void 0:o.setInterval)?o.setInterval.apply(o,(0,n.fX)([t,e],(0,n.zs)(r))):setInterval.apply(void 0,(0,n.fX)([t,e],(0,n.zs)(r)))},clearInterval:function(t){var e=i.delegate;return((null==e?void 0:e.clearInterval)||clearInterval)(t)},delegate:void 0},o=r(62238),a=function(t){function e(e,r){var n=t.call(this,e,r)||this;
1return n.scheduler=e,n.work=r,n.pending=!1,n}return(0,n.C6)(e,t),e.prototype.schedule=function(t,e){if(void 0===e&&(e=0),this.closed)return this;this.state=t;var r,n=this.id,s=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(s,n,e)),this.pending=!0,this.delay=e,this.id=null!==(r=this.id)&&void 0!==r?r:this.requestAsyncId(s,this.id,e),this},e.prototype.requestAsyncId=function(t,e,r){return void 0===r&&(r=0),i.setInterval(t.flush.bind(t,this),r)},e.prototype.recycleAsyncId=function(t,e,r){if(void 0===r&&(r=0),null!=r&&this.delay===r&&!1===this.pending)return e;null!=e&&i.clearInterval(e)},e.prototype.execute=function(t,e){if(this.closed)return Error("executing a cancelled action");this.pending=!1;var r=this._execute(t,e);if(r)return r;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,e){var r,n=!1;try{this.work(t)}catch(t){n=!0,r=t||Error("Scheduled action threw falsy error")}if(n)return this.unsubscribe(),r},e.prototype.unsubscribe=function(){if(!this.closed){var e=this.id,r=this.scheduler,n=r.actions;this.work=this.state=this.scheduler=null,this.pending=!1,(0,o.o)(n,this),null!=e&&(this.id=this.recycleAsyncId(r,e,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e}(s)},10936:(t,e,r)=>{"use strict";r.d(e,{q:()=>o});var n=r(6476),s=r(31833),i=function(){function t(e,r){void 0===r&&(r=t.now),this.schedulerActionCtor=e,this.now=r}return t.prototype.schedule=function(t,e,r){return void 0===e&&(e=0),new this.schedulerActionCtor(this,t).schedule(r,e)},t.now=s.U.now,t}(),o=function(t){function e(e,r){void 0===r&&(r=i.now);var n=t.call(this,e,r)||this;return n.actions=[],n._active=!1,n}return(0,n.C6)(e,t),e.prototype.flush=function(t){var e,r=this.actions;if(this._active){r.push(t);return}this._active=!0;do if(e=t.execute(t.state,t.delay))break;while(t=r.shift());if(this._active=!1,e){for(;t=r.shift();)t.unsubscribe();throw e}},e}(i)},7912:(t,e,r)=>{"use strict";r.d(e,{E:()=>s,b:()=>i});var n=r(1444),s=new(r(10936)).q(n.R),i=s},31833:(t,e,r)=>{"use strict";r.d(e,{U:()=>n});var n={now:function(){return(n.delegate||Date).now()},delegate:void 0}},50522:(t,e,r)=>{"use strict";r.d(e,{f:()=>s});var n=r(6476),s={setTimeout:function(t,e){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];var o=s.delegate;return(null==o?void 0:o.setTimeout)?o.setTimeout.apply(o,(0,n.fX)([t,e],(0,n.zs)(r))):setTimeout.apply(void 0,(0,n.fX)([t,e],(0,n.zs)(r)))},clearTimeout:function(t){var e=s.delegate;return((null==e?void 0:e.clearTimeout)||clearTimeout)(t)},delegate:void 0}},97877:(t,e,r)=>{"use strict";r.d(e,{l:()=>n});var n="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"},13822:(t,e,r)=>{"use strict";r.d(e,{s:()=>n});var n="function"==typeof Symbol&&Symbol.observable||"@@observable"},66710:(t,e,r)=>{"use strict";r.d(e,{G:()=>n});var n=(0,r(12985).L)(function(t){return function(){t(this),this.name="EmptyError",this.message="no elements in sequence"}})},6274:(t,e,r)=>{"use strict";r.d(e,{R0:()=>u,lI:()=>a,ms:()=>o});var n=r(80195),s=r(60220);function i(t){return t[t.length-1]}function o(t){return(0,n.T)(i(t))?t.pop():void 0}function a(t){return(0,s.m)(i(t))?t.pop():void 0}function u(t,e){return"number"==typeof i(t)?t.pop():e}},18025:(t,e,r)=>{"use strict";r.d(e,{D:()=>a});var n=Array.isArray,s=Object.getPrototypeOf,i=Object.prototype,o=Object.keys;function a(t){if(1===t.length){var e=t[0];if(n(e))return{args:e,keys:null};if(e&&"object"==typeof e&&s(e)===i){var r=o(e);return{args:r.map(function(t){return e[t]}),keys:r}}}return{args:t,keys:null}}},40278:(t,e,r)=>{"use strict";r.d(e,{K:()=>s});var n=Array.isArray;function s(t){return 1===t.length&&n(t[0])?t[0]:t}},62238:(t,e,r)=>{"use strict";function n(t,e){if(t){var r=t.indexOf(e);0<=r&&t.splice(r,1)}}r.d(e,{o:()=>n})},12985:(t,e,r)=>{"use strict";function n(t){var e=t(function(t){Error.call(t),t.stack=Error().stack});return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}r.d(e,{L:()=>n})},42756:(t,e,r)=>{"use strict";function n(t,e){return t.reduce(function(t,r,n){return t[r]=e[n],t},{})}r.d(e,{e:()=>n})},65110:(t,e,r)=>{"use strict";r.d(e,{Y:()=>i,l:()=>
1o});var n=r(36564),s=null;function i(t){if(n.$.useDeprecatedSynchronousErrorHandling){var e=!s;if(e&&(s={errorThrown:!1,error:null}),t(),e){var r=s,i=r.errorThrown,o=r.error;if(s=null,i)throw o}}else t()}function o(t){n.$.useDeprecatedSynchronousErrorHandling&&s&&(s.errorThrown=!0,s.error=t)}},65623:(t,e,r)=>{"use strict";function n(t,e,r,n,s){void 0===n&&(n=0),void 0===s&&(s=!1);var i=e.schedule(function(){r(),s?t.add(this.schedule(null,n)):this.unsubscribe()},n);if(t.add(i),!s)return i}r.d(e,{N:()=>n})},16449:(t,e,r)=>{"use strict";function n(t){return t}r.d(e,{D:()=>n})},34255:(t,e,r)=>{"use strict";r.d(e,{X:()=>n});var n=function(t){return t&&"number"==typeof t.length&&"function"!=typeof t}},58359:(t,e,r)=>{"use strict";r.d(e,{T:()=>s});var n=r(80195);function s(t){return Symbol.asyncIterator&&(0,n.T)(null==t?void 0:t[Symbol.asyncIterator])}},9907:(t,e,r)=>{"use strict";function n(t){return t instanceof Date&&!isNaN(t)}r.d(e,{v:()=>n})},80195:(t,e,r)=>{"use strict";function n(t){return"function"==typeof t}r.d(e,{T:()=>n})},48469:(t,e,r)=>{"use strict";r.d(e,{l:()=>i});var n=r(13822),s=r(80195);function i(t){return(0,s.T)(t[n.s])}},48985:(t,e,r)=>{"use strict";r.d(e,{x:()=>i});var n=r(97877),s=r(80195);function i(t){return(0,s.T)(null==t?void 0:t[n.l])}},32150:(t,e,r)=>{"use strict";r.d(e,{A:()=>i});var n=r(47279),s=r(80195);function i(t){return!!t&&(t instanceof n.c||(0,s.T)(t.lift)&&(0,s.T)(t.subscribe))}},32932:(t,e,r)=>{"use strict";r.d(e,{y:()=>s});var n=r(80195);function s(t){return(0,n.T)(null==t?void 0:t.then)}},21168:(t,e,r)=>{"use strict";r.d(e,{C:()=>i,U:()=>o});var n=r(6476),s=r(80195);function i(t){return(0,n.AQ)(this,arguments,function(){var e,r,s;return(0,n.YH)(this,function(i){switch(i.label){case 0:e=t.getReader(),i.label=1;case 1:i.trys.push([1,,9,10]),i.label=2;case 2:return[4,(0,n.N3)(e.read())];case 3:if(s=(r=i.sent()).value,!r.done)return[3,5];return[4,(0,n.N3)(void 0)];case 4:return[2,i.sent()];case 5:return[4,(0,n.N3)(s)];case 6:return[4,i.sent()];case 7:return i.sent(),[3,2];case 8:return[3,10];case 9:return e.releaseLock(),[7];case 10:return[2]}})})}function o(t){return(0,s.T)(null==t?void 0:t.getReader)}},60220:(t,e,r)=>{"use strict";r.d(e,{m:()=>s});var n=r(80195);function s(t){return t&&(0,n.T)(t.schedule)}},64482:(t,e,r)=>{"use strict";r.d(e,{N:()=>i,S:()=>s});var n=r(80195);function s(t){return(0,n.T)(null==t?void 0:t.lift)}function i(t){return function(e){if(s(e))return e.lift(function(e){try{return t(e,this)}catch(t){this.error(t)}});throw TypeError("Unable to lift unknown Observable type")}}},7690:(t,e,r)=>{"use strict";r.d(e,{I:()=>o});var n=r(6476),s=r(31190),i=Array.isArray;function o(t){return(0,s.T)(function(e){return i(e)?t.apply(void 0,(0,n.fX)([],(0,n.zs)(e))):t(e)}
1)}},86879:(t,e,r)=>{"use strict";function n(){}r.d(e,{l:()=>n})},26019:(t,e,r)=>{"use strict";r.d(e,{F:()=>s,m:()=>i});var n=r(16449);function s(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return i(t)}function i(t){return 0===t.length?n.D:1===t.length?t[0]:function(e){return t.reduce(function(t,e){return e(t)},e)}}},67690:(t,e,r)=>{"use strict";r.d(e,{m:()=>i});var n=r(36564),s=r(50522);function i(t){s.f.setTimeout(function(){var e=n.$.onUnhandledError;if(e)e(t);else throw t})}},35415:(t,e,r)=>{"use strict";function n(t){return TypeError("You provided "+(null!==t&&"object"==typeof t?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}r.d(e,{L:()=>n})},8691:(t,e,r)=>{"use strict";r.d(e,{H6:()=>g,K_:()=>c,OX:()=>l,SP:()=>i,Sx:()=>d});var n=r(18596);let s=new WeakMap;function i(t){return{config:t,start:(e,r)=>{let{self:n,system:i,emit:o}=r,a={receivers:void 0,dispose:void 0};s.set(n,a),a.dispose=t({input:e.input,system:i,self:n,sendBack:t=>{"stopped"!==n.getSnapshot().status&&n._parent&&i._relay(n,n._parent,t)},receive:t=>{a.receivers??=new Set,a.receivers.add(t)},emit:o})},transition:(t,e,r)=>{let i=s.get(r.self);return e.type===n.X?(t={...t,status:"stopped",error:void 0},i.dispose?.()):i.receivers?.forEach(t=>t(e)),t},getInitialSnapshot:(t,e)=>({status:"active",output:void 0,error:void 0,input:e}),getPersistedSnapshot:t=>t,restoreSnapshot:t=>t}}let o="xstate.observable.next",a="xstate.observable.error",u="xstate.observable.complete";function c(t){return{config:t,transition:(t,e)=>{if("active"!==t.status)return t;switch(e.type){case o:return{...t,context:e.data};case a:return{...t,status:"error",error:e.data,input:void 0,_subscription:void 0};case u:return{...t,status:"done",input:void 0,_subscription:void 0};case n.X:return t._subscription.unsubscribe(),{...t,status:"stopped",input:void 0,_subscription:void 0};default:return t}},getInitialSnapshot:(t,e)=>({status:"active",output:void 0,error:void 0,context:void 0,input:e,_subscription:void 0}),start:(e,{self:r,system:n,emit:s})=>{"done"!==e.status&&(e._subscription=t({input:e.input,system:n,self:r,emit:s}).subscribe({next:t=>{n._relay(r,r,{type:o,data:t})},error:t=>{n._relay(r,r,{type:a,data:t})},complete:()=>{n._relay(r,r,{type:u})}}))},getPersistedSnapshot:({_subscription:t,...e})=>e,restoreSnapshot:t=>({...t,_subscription:void 0})}}function l(t){return{config:t,transition:(t,e)=>{if("active"!==t.status)return t;switch(e.type){case a:return{...t,status:"error",error:e.data,input:void 0,_subscription:void 0};case u:return{...t,status:"done",input:void 0,_subscription:void 0};case n.X:return t._subscription.unsubscribe(),{...t,status:"stopped",input:void 0,_subscription:void 0};default:return t}},getInitialSnapshot:(t,e)=>({status:"active",output:void 0,error:void 0,context:void 0,input:e,_subscription:void 0}),start:(e,{self:r,system:n,emit:s})=>{"done"!==e.status&&(e._subscription=t({input:e.input,system:n,self:r,emit:s}).subscribe({next:t=>{r._parent&&n._relay(r,r._parent,t)},error:t=>{n._relay(r,r,{type:a,data:t})},complete:()=>{n._relay(r,r,{type:u})}}))},getPersistedSnapshot:({_subscription:t,...e})=>e,restoreSnapshot:t=>({...t,_subscription:void 0})}}let h="xstate.promise.resolve",f="xstate.promise.reject",p=new WeakMap;function d(t){return{config:t,transition:(t,e,r)=>{if("active"!==t.status)return t;switch(e.type){case h:{let r=e.data;return{...t,status:"done",output:r,input:void 0}}case f:return{...t,status:"error",error:e.data,input:void 0};case n.X:return p.get(r.self)?.abort(),{...t,status:"stopped",input:void 0};default:return t}},start:(e,{self:r,system:n,emit:s})=>{if("active"!==e.status)return;let i=new AbortController;p.set(r,i),Promise.resolve(t({input:e.input,system:n,self:r,signal:i.signal,emit:s})).then(t=>{"active"===r.getSnapshot().status&&(p.delete(r),n._relay(r,r,{type:h,data:t}))},t=>{"active"===r.getSnapshot().status&&(p.delete(r),n._relay(r,r,{type:f,data:t}))})},getInitialSnapshot:(t,e)=>({status:"active",output:void 0,error:void 0,input:e}),getPersistedSnapshot:t=>t,restoreSnapshot:t=>t}}let y=function(t,e){return{config:t,transition:(e,r,n)=>
1({...e,context:t(e.context,r,n)}),getInitialSnapshot:(t,r)=>({status:"active",output:void 0,error:void 0,context:"function"==typeof e?e({input:r}):e}),getPersistedSnapshot:t=>t,restoreSnapshot:t=>t}}(t=>void 0,void 0);function g(){return(0,n.A)(y)}},63915:(t,e,r)=>{"use strict";r.d(e,{a:()=>i,b:()=>g,c:()=>p,e:()=>u,l:()=>b,s:()=>d});var n=r(18596);function s(t,e,r,s,{assignment:i}){if(!e.context)throw Error("Cannot assign to undefined `context`. Ensure that `context` is defined in the machine config.");let o={},a={context:e.context,event:r.event,spawn:function(t,{machine:e,context:r},s,i){let o=(o,a)=>{if("string"!=typeof o)return(0,n.A)(o,{id:a?.id,parent:t.self,syncSnapshot:a?.syncSnapshot,input:a?.input,src:o,systemId:a?.systemId});{let u=(0,n.z)(e,o);if(!u)throw Error(`Actor logic '${o}' not implemented in machine '${e.id}'`);let c=(0,n.A)(u,{id:a?.id,parent:t.self,syncSnapshot:a?.syncSnapshot,input:"function"==typeof a?.input?a.input({context:r,event:s,self:t.self}):a?.input,src:o,systemId:a?.systemId});return i[c.id]=c,c}};return(e,r)=>{let s=o(e,r);return i[s.id]=s,t.defer(()=>{s._processingStatus!==n.T.Stopped&&s.start()}),s}}(t,e,r.event,o),self:t.self,system:t.system},u={};if("function"==typeof i)u=i(a,s);else for(let t of Object.keys(i)){let e=i[t];u[t]="function"==typeof e?e(a,s):e}let c=Object.assign({},e.context,u);return[(0,n.U)(e,{context:c,children:Object.keys(o).length?{...e.children,...o}:e.children}),void 0,void 0]}function i(t){function e(t,e){}return e.type="xstate.assign",e.assignment=t,e.resolve=s,e}function o(t,e,r,n,{event:s}){return[e,{event:"function"==typeof s?s(r,n):s},void 0]}function a(t,{event:e}){t.defer(()=>t.emit(e))}function u(t){function e(t,e){}return e.type="xstate.emit",e.event=t,e.resolve=o,e.execute=a,e}let c=function(t){return t.Parent="#_parent",t.Internal="#_internal",t}({});function l(t,e,r,n,{to:s,event:i,id:o,delay:a},u){let l,h;let f=e.machine.implementations.delays;if("string"==typeof i)throw Error(`Only event objects may be used with sendTo; use sendTo({ type: "${i}" }) instead`);let p="function"==typeof i?i(r,n):i;if("string"==typeof a){let t=f&&f[a];l="function"==typeof t?t(r,n):t}else l="function"==typeof a?a(r,n):a;let d="function"==typeof s?s(r,n):s;if("string"==typeof d){if(!(h=d===c.Parent?t.self._parent:d===c.Internal?t.self:d.startsWith("#_")?e.children[d.slice(2)]:u.deferredActorIds?.includes(d)?d:e.children[d]))throw Error(`Unable to send event to actor '${d}' from machine '${e.machine.id}'.`)}else h=d||t.self;return[e,{to:h,targetId:"string"==typeof d?d:void 0,event:p,id:o,delay:l},void 0]}function h(t,e,r){"string"==typeof r.to&&(r.to=e.children[r.to])}function f(t,e){t.defer(()=>{let{to:r,event:s,delay:i,id:o}=e;if("number"==typeof i){t.system.scheduler.schedule(t.self,r,s,i,o);return}t.system._relay(t.self,r,s.type===n.V?(0,n.W)(t.self.id,s.data):s)})}function p(t,e,r){function n(t,e){}return n.type="xstate.sendTo",n.to=t,n.event=e,n.id=r?.id,n.delay=r?.delay,n.resolve=l,n.retryResolve=h,n.execute=f,n}function d(t,e){return p(c.Parent,t,e)}function y(t,e,r,s,{collect:o}){let a=[],c=function(t){a.push(t)};return c.assign=(...t)=>{a.push(i(...t))},c.cancel=(...t)=>{a.push((0,n.M)(...t))},c.raise=(...t)=>{a.push((0,n.O)(...t))},c.sendTo=(...t)=>{a.push(p(...t))},c.sendParent=(...t)=>{a.push(d(...t))},c.spawnChild=(...t)=>{a.push((0,n.P)(...t))},c.stopChild=(...t)=>{a.push((0,n.R)(...t))},c.emit=(...t)=>{a.push(u(...t))},o({context:r.context,event:r.event,enqueue:c,check:t=>(0,n.e)(t,e.context,r.event,e),self:t.self,system:t.system},s),[e,void 0,a]}function g(t){function e(t,e){}return e.type="xstate.enqueueActions",e.collect=t,e.resolve=y,e}function v(t,e,r,n,{value:s,label:i}){return[e,{value:"function"==typeof s?s(r,n):s,label:i},void 0]}function m({logger:t},{value:e,label:r}){r?t(r,e):t(e)}function b(t=({context:t,event:e})=>({context:t,event:e}),e){function r(t,e){}return r.type="xstate.log",r.value=t,r.label=e,r.resolve=v,r.execute=m,r}},18596:(t,e,r)=>{"use strict";r.d(e,{$:()=>q,A:()=>k,D:()=>X,E:()=>J,G:()=>V,L:()=>x,M:()=>P,N:()=>o,O:()=>tN,P:()=>N,R:()=>L,S:()=>i,T:()=>A,U:()=>tU,V:()=>u,W:()=>h,X:()=>c,a:()=>_,b:()=>to,c:()=>S,d:()=>tu,e:()=>Y,f:()=>ta,g:()=>ti,h:()=>ts,i:()=>Z,j:()=>ty,k:()=>tj,l:()=>tr,m:()=>v,n:()=>tT,o:()=>function t(e,r,n,s){return"string"==typeof r?function(t,e,r,n){let s=tp(t,e).next(r,n);return s&&s.length?s:t.next(r,n)}(e,r,n,s):1===Object.keys(r).length?function(e,r,n,s){let i=Object.keys(r),o=t(tp(e,i[0]),r[
1i[0]],n,s);return o&&o.length?o:e.next(n,s)}(e,r,n,s):function(e,r,n,s){let i=[];for(let o of Object.keys(r)){let a=r[o];if(!a)continue;let u=t(tp(e,o),a,n,s);u&&i.push(...u)}return i.length?i:e.next(n,s)}(e,r,n,s)},p:()=>tS,q:()=>f,r:()=>tR,s:()=>t_,t:()=>m,u:()=>tf,v:()=>y,w:()=>tn,x:()=>td,y:()=>tP,z:()=>T});let n=t=>{if("undefined"==typeof window)return;let e=function(){let t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==r.g?r.g:void 0;if(t.__xstate__)return t.__xstate__}();e&&e.register(t)};class s{constructor(t){this._process=t,this._active=!1,this._current=null,this._last=null}start(){this._active=!0,this.flush()}clear(){this._current&&(this._current.next=null,this._last=this._current)}enqueue(t){let e={value:t,next:null};if(this._current){this._last.next=e,this._last=e;return}this._current=e,this._last=e,this._active&&this.flush()}flush(){for(;this._current;){let t=this._current;this._process(t.value),this._current=t.next}this._last=null}}let i=".",o="",a="xstate.init",u="xstate.error",c="xstate.stop";function l(t,e){return{type:`xstate.done.state.${t}`,output:e}}function h(t,e){return{type:`xstate.error.actor.${t}`,error:e,actorId:t}}function f(t){return{type:a,input:t}}function p(t){setTimeout(()=>{throw t})}let d="function"==typeof Symbol&&Symbol.observable||"@@observable";function y(t){if(w(t))return t;let e=[],r="";for(let n=0;n<t.length;n++){switch(t.charCodeAt(n)){case 92:r+=t[n+1],n++;continue;case 46:e.push(r),r="";
1continue}r+=t[n]}return e.push(r),e}function g(t){return t&&"object"==typeof t&&"machine"in t&&"value"in t?t.value:"string"!=typeof t?t:function(t){if(1===t.length)return t[0];let e={},r=e;for(let e=0;e<t.length-1;e++)if(e===t.length-2)r[t[e]]=t[e+1];else{let n=r;r={},n[t[e]]=r}return e}(y(t))}function v(t,e){let r={},n=Object.keys(t);for(let s=0;s<n.length;s++){let i=n[s];r[i]=e(t[i],i,t,s)}return r}function m(t){return void 0===t?[]:w(t)?t:[t]}function b(t,e,r,n){return"function"==typeof t?t({context:e,event:r,self:n}):t}function w(t){return Array.isArray(t)}function _(t){return(w(t)?t:[t]).map(t=>void 0===t||"string"==typeof t?{target:t}:t)}function E(t){if(void 0!==t&&""!==t)return m(t)}function x(t,e,r){let n="object"==typeof t,s=n?t:void 0;return{next:(n?t.next:t)?.bind(s),error:(n?t.error:e)?.bind(s),complete:(n?t.complete:r)?.bind(s)}}function S(t,e){return`${e}.${t}`}function T(t,e){let r=e.match(/^xstate\.invoke\.(\d+)\.(.*)/);if(!r)return t.implementations.actors[e];let[,n,s]=r,i=t.getStateNodeById(s).config.invoke;return(Array.isArray(i)?i[n]:i).src}function C(t,e){return`${t.sessionId}.${e}`}let I=0,R=!1,q=1,A=function(t){return t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped",t}({}),$={clock:{setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t)},logger:console.log.bind(console),devTools:!1};class O{constructor(t,e){this.logic=t,this._snapshot=void 0,this.clock=void 0,this.options=void 0,this.id=void 0,this.mailbox=new s(this._process.bind(this)),this.observers=new Set,this.eventListeners=new Map,this.logger=void 0,this._processingStatus=A.NotStarted,this._parent=void 0,this._syncSnapshot=void 0,this.ref=void 0,this._actorScope=void 0,this._systemId=void 0,this.sessionId=void 0,this.system=void 0,this._doneEvent=void 0,this.src=void 0,this._deferred=[];let r={...$,...e},{clock:n,logger:i,parent:o,syncSnapshot:a,id:u,systemId:c,inspect:l}=r;this.system=o?o.system:function(t,e){let r=new Map,n=new Map,s=new WeakMap,i=new Set,o={},{clock:a,logger:u}=e,c={schedule:(t,e,r,n,s=Math.random().toString(36).slice(2))=>{let i={source:t,target:e,event:r,delay:n,id:s,startedAt:Date.now()},u=C(t,s);l._snapshot._scheduledEvents[u]=i;let c=a.setTimeout(()=>{delete o[u],delete l._snapshot._scheduledEvents[u],l._relay(t,e,r)},n);o[u]=c},cancel:(t,e)=>{let r=C(t,e),n=o[r];delete o[r],delete l._snapshot._scheduledEvents[r],void 0!==n&&a.clearTimeout(n)},cancelAll:t=>{for(let e in l._snapshot._scheduledEvents){let r=l._snapshot._scheduledEvents[e];r.source===t&&c.cancel(t,r.id)}}},l={_snapshot:{_scheduledEvents:(e?.snapshot&&e.snapshot.scheduler)??{}},_bookId:()=>`x:${I++}`,_register:(t,e)=>(r.set(t,e),t),_unregister:t=>{r.delete(t.sessionId);let e=s.get(t);void 0!==e&&(n.delete(e),s.delete(t))},get:t=>n.get(t),_set:(t,e)=>{let r=n.get(t);if(r&&r!==e)throw Error(`Actor with system ID '${t}' already exists.`);n.set(t,e),s.set(e,t)},inspect:t=>{let e=x(t);return i.add(e),{unsubscribe(){i.delete(e)}}},_sendInspectionEvent:e=>{if(!i.size)return;let r={...e,rootId:t.sessionId};i.forEach(t=>t.next?.(r))},_relay:(t,e,r)=>{l._sendInspectionEvent({type:"@xstate.event",sourceRef:t,actorRef:e,event:r}),e._send(r)},scheduler:c,getSnapshot:()=>({_scheduledEvents:{...l._snapshot._scheduledEvents}}),start:()=>{let t=l._snapshot._scheduledEvents;for(let e in l._snapshot._scheduledEvents={},t){let{source:r,target:n,event:s,delay:i,id:o}=t[e];c.schedule(r,n,s,i,o)}},_clock:a,_logger:u};return l}(this,{clock:n,logger:i}),l&&!o&&this.system.inspect(x(l)),this.sessionId=this.system._bookId(),this.id=u??this.sessionId,this.logger=e?.logger??this.system._logger,this.clock=e?.clock??this.system._clock,this._parent=o,this._syncSnapshot=a,this.options=r,this.src=r.src??t,this.ref=this,this._actorScope={self:this,id:this.id,sessionId:this.sessionId,logger:this.logger,defer:t=>{this._deferred.push(t)},system:this.system,stopChild:t=>{if(t._parent!==this)throw Error(`Cannot stop child actor ${t.id} of ${this.id} because it is not a child`);t._stop()},emit:t=>{let e=this.eventListeners.get(t.type),r=this.eventListeners.get("*");if(e||r)for(let n of[...e?e.values():[],...r?r.values():[]])n(t)},actionExecutor:t=>{let e=()=>{if(this._actorScope.system._sendInspectionEvent({type:"@xstate.action",actorRef:this,action:{type:t.type,params:t.params}}),!t.exec)return;let e=R;try{R=!0,t.exec(t.info,t.params)}finally{R=e}};this._processingStatus===A.Running?e():this._deferred.push(e)}},this.send=this.send.bind(this),this.system._sendInspectionEvent({type:"@xstate.actor",actorRef:this}),c&&(this._systemId=c,this.system._set(c,this)),this._initState(e?.snapshot??e?.state),c&&"active"!==this._snapshot.status&&this.system._unregister(this)}_initState(t){try{this._snapshot=t?this.logic.restoreSnapshot?this.logic.restoreSnapshot(t,this._actorScope):t:this.logic.getInitialSnapshot(this._actorScope,this.options?.input)}catch(t){this._snapshot={status:"error",output:void 0,error:t}}}update(t,e){let r;for(this._snapshot=t;r=this._deferred.shift();)try{r()}catch(e){this._deferred.length=0,this._snapshot={...t,status:"error",error:e}}switch(this._snapshot.status){case"active":for(let e of this.observers)try{e.
1next?.(t)}catch(t){p(t)}break;case"done":var n;for(let e of this.observers)try{e.next?.(t)}catch(t){p(t)}this._stopProcedure(),this._complete(),this._doneEvent=(n=this.id,{type:`xstate.done.actor.${n}`,output:this._snapshot.output,actorId:n}),this._parent&&this.system._relay(this,this._parent,this._doneEvent);break;case"error":this._error(this._snapshot.error)}this.system._sendInspectionEvent({type:"@xstate.snapshot",actorRef:this,event:e,snapshot:t})}subscribe(t,e,r){let n=x(t,e,r);if(this._processingStatus!==A.Stopped)this.observers.add(n);else switch(this._snapshot.status){case"done":try{n.complete?.()}catch(t){p(t)}break;case"error":{let t=this._snapshot.error;if(n.error)try{n.error(t)}catch(t){p(t)}else p(t)}}return{unsubscribe:()=>{this.observers.delete(n)}}}on(t,e){let r=this.eventListeners.get(t);r||(r=new Set,this.eventListeners.set(t,r));let n=e.bind(void 0);return r.add(n),{unsubscribe:()=>{r.delete(n)}}}start(){if(this._processingStatus===A.Running)return this;this._syncSnapshot&&this.subscribe({next:t=>{"active"===t.status&&this.system._relay(this,this._parent,{type:`xstate.snapshot.${this.id}`,snapshot:t})},error:()=>{}}),this.system._register(this.sessionId,this),this._systemId&&this.system._set(this._systemId,this),this._processingStatus=A.Running;let t=f(this.options.input);switch(this.system._sendInspectionEvent({type:"@xstate.event",sourceRef:this._parent,actorRef:this,event:t}),this._snapshot.status){case"done":return this.update(this._snapshot,t),this;case"error":return this._error(this._snapshot.error),this}if(this._parent||this.system.start(),this.logic.start)try{this.logic.start(this._snapshot,this._actorScope)}catch(t){return this._snapshot={...this._snapshot,status:"error",error:t},this._error(t),this}return this.update(this._snapshot,t),this.options.devTools&&this.attachDevTools(),this.mailbox.start(),this}_process(t){let e,r;try{e=this.logic.transition(this._snapshot,t,this._actorScope)}catch(t){r={err:t}}if(r){let{err:t}=r;this._snapshot={...this._snapshot,status:"error",error:t},this._error(t);return}this.update(e,t),t.type===c&&(this._stopProcedure(),this._complete())}_stop(){return this._processingStatus===A.Stopped||((this.mailbox.clear(),this._processingStatus===A.NotStarted)?this._processingStatus=A.Stopped:this.mailbox.enqueue({type:c})),this}stop(){if(this._parent)throw Error("A non-root actor cannot be stopped directly.");return this._stop()}_complete(){for(let t of this.observers)try{t.complete?.()}catch(t){p(t)}this.observers.clear()}_reportError(t){if(!this.observers.size){this._parent||p(t);return}let e=!1;for(let r of this.observers){let n=r.error;e||=!n;try{n?.(t)}catch(t){p(t)}}this.observers.clear(),e&&p(t)}_error(t){this._stopProcedure(),this._reportError(t),this._parent&&this.system._relay(this,this._parent,h(this.id,t))}_stopProcedure(){return this._processingStatus!==A.Running||(this.system.scheduler.cancelAll(this),this.mailbox.clear(),this.mailbox=new s(this._process.bind(this)),this._processingStatus=A.Stopped,this.system._unregister(this)),this}_send(t){this._processingStatus!==A.Stopped&&this.mailbox.enqueue(t)}send(t){this.system._relay(void 0,this,t)}attachDevTools(){let{devTools:t}=this.options;t&&("function"==typeof t?t:n)(this)}toJSON(){return{xstate$$type:q,id:this.id}}getPersistedSnapshot(t){return this.logic.getPersistedSnapshot(this._snapshot,t)}[d](){return this}getSnapshot(){return this._snapshot}}function k(t,...[e]){return new O(t,e)}function j(t,e,r,n,{sendId:s}){return[e,{sendId:"function"==typeof s?s(r,n):s},void 0]}function U(t,e){t.defer(()=>{t.system.scheduler.cancel(t.self,e.sendId)})}function P(t){function e(t,e){}return e.type="xstate.cancel",e.sendId=t,e.resolve=j,e.execute=U,e}function D(t,e,r,n,{id:s,systemId:i,src:o,input:a,syncSnapshot:u}){let c,l;let h="string"==typeof o?T(e.machine,o):o,f="function"==typeof s?s(r):s;return h&&(l="function"==typeof a?a({context:e.context,event:r.event,self:t.self}):a,c=k(h,{id:f,src:o,parent:t.self,syncSnapshot:u,systemId:i,input:l})),[tU(e,{children:{...e.children,[f]:c}}),{id:s,systemId:i,actorRef:c,src:o,input:l},void 0]}function M(t,{actorRef:e}){e&&t.defer(()=>{e._processingStatus!==A.Stopped&&e.start()})}function N(...[t,{id:e,systemId:r,input:n,syncSnapshot:s=!1}={}]){function i(t,e){}return i.type="xstate.spawnChild",i.id=e,i.systemId=r,i.src=t,i.input=n,i.syncSnapshot=s,i.resolve=D,i.execute=M,i}function B(t,e,r,n,{actorRef:s}){let i="function"==typeof s?s(r,n):s,o="string"==typeof i?e.children[i]:i,a=e.children;return o&&(a={...a},delete a[o.id]),[tU(e,{children:a}),o,void 0]}function F(t,e){if(e){if(t.system._unregister(e),e._processingStatus!==A.Running){t.stopChild(e);return}t.defer(()=>{t.stopChild(e)})}}function L(t){function e(t,e){}return e.type="xstate.stopChild",e.actorRef=t,e.resolve=B,e.execute=F,e}function z(t,e,{stateValue:r}){if("string"==typeof r&&tn(r)){let e=t.machine.getStateNodeById(r);return t._nodes.some(t=>t===e)}return t.matches(r)}function V(t){function e(){return!1}return e.check=z,e.stateValue=t,e}function H(t,{context:e,event:r},{guards:n}){return!Y(n[0],e,r,t)}function J(t){function e(t,e){return!1}return e.check=H,e.guards=[t],e}function W(t,{context:e,event:r},{guards:n}){return n.every(n=>Y(n,e,r,t))}function X(t){function e(t,e){return!1}return e.check=W,e.guards=t,e}function Y(t,e,r,n){let{machine:s}=n,i="function"==typeof t,o=i?t:s.implementations.guards["string"==typeof t?t:t.type];if(!i&&!o)throw Error(`Guard '${"string"==typeof t?t:t.type}' is not implemented.'.`);if("function"!=typeof o)return Y(o,e,r,n);let a={context:e,event:r},u=i||"string"==typeof t?void 0:"params"in t?"function"==typeof t.params?t.params({context:e,event:r}):t.params:void 0;return"check"in o?o.check(n,a,o):o(a,u)}let G=t=>"atomic"===t.type||"final"===t.type;function K(t){return Object.values(t.states).filter(t=>"history"!==t.type)}function Q(t,e){let r=[];if(e===t)return r;let n=t.parent;for(;n&&n!==e;)r.push(n),n=n.parent;return r}function Z(t){let e=new Set(t),r=tt(e);for(let t of e)if("compound"!==t.type||r.get(t)&&r.get(t).length){if("parallel"===t.type){for(let r of K(t))if("history"!==r.type&&!e.has(r))for(let t of th(r))e.add(t)}}else th(t).forEach(t=>e.add(t));for(let t of e){let r=t.parent;for(;r;)e.add(r),r=r.parent}return e}function tt(t){let e=new Map;for(let r of t)e.has(r)||e.set(r,[]),r.parent&&(e.has(r.parent)||e.set(r.parent,[]),e.get(r.parent).push(r));return e}function te(t,e){return function t(e,r){let n=r.get(e);if(!n)return{};if("compound"===e.type){let t=n[0];if(!t)return{};if(G(t))return t.key}let s={};for(let e of n)s[e.key]=t(e,r);return s}(t,tt(Z(e)))}function tr(t,e){return"compound"===e.type?K(e).some(e=>"final"===e.type&&t.has(e)):"parallel"===e.type?K(e).every(e=>tr(t,e)):"final"===e.type}let tn=t=>"#"===t[0];function ts(t,e){return t.transitions.get(e)||[...t.transitions.keys()].filter(t=>{if("*"===t)return!0;
1if(!t.endsWith(".*"))return!1;let r=t.split("."),n=e.split(".");for(let t=0;t<r.length;t++){let e=r[t],s=n[t];if("*"===e)return t===r.length-1;if(e!==s)return!1}return!0}).sort((t,e)=>e.length-t.length).flatMap(e=>t.transitions.get(e))}function ti(t){let e=t.config.after;if(!e)return[];let r=e=>{var r;let n=(r=t.id,{type:`xstate.after.${e}.${r}`}),s=n.type;return t.entry.push(tN(n,{id:s,delay:e})),t.exit.push(P(s)),s};return Object.keys(e).flatMap(t=>{let n=e[t],s=Number.isNaN(+t)?t:+t,i=r(s);return m("string"==typeof n?{target:n}:n).map(t=>({...t,event:i,delay:s}))}).map(e=>{let{delay:r}=e;return{...to(t,e.event,e),delay:r}})}function to(t,e,r){let n=E(r.target),s=r.reenter??!1,o=function(t,e){if(void 0!==e)return e.map(e=>{if("string"!=typeof e)return e;if(tn(e))return t.machine.getStateNodeById(e);let r=e[0]===i;if(r&&!t.parent)return td(t,e.slice(1));let n=r?t.key+e:e;if(t.parent)try{return td(t.parent,n)}catch(e){throw Error(`Invalid transition definition for state node '${t.id}': 2${e.message}`)}else throw Error(`Invalid target: "${e}" is not a valid target from the root node. Did you mean ".${e}"?`)})}(t,n),a={...r,actions:m(r.actions),guard:r.guard,target:o,source:t,reenter:s,eventType:e,toJSON:()=>({...a,source:`#${t.id}`,target:o?o.map(t=>`#${t.id}`):void 0})};return a}function ta(t){let e=new Map;if(t.config.on)for(let r of Object.keys(t.config.on)){if(r===o)throw Error('Null events ("") cannot be specified as a transition key. Use `always: { ... }` instead.');let n=t.config.on[r];e.set(r,_(n).map(e=>to(t,r,e)))}if(t.config.onDone){let r=`xstate.done.state.${t.id}`;e.set(r,_(t.config.onDone).map(e=>to(t,r,e)))}for(let r of t.invoke){if(r.onDone){let n=`xstate.done.actor.${r.id}`;e.set(n,_(r.onDone).map(e=>to(t,n,e)))}if(r.onError){let n=`xstate.error.actor.${r.id}`;e.set(n,_(r.onError).map(e=>to(t,n,e)))}if(r.onSnapshot){let n=`xstate.snapshot.${r.id}`;e.set(n,_(r.onSnapshot).map(e=>to(t,n,e)))}}for(let r of t.after){let t=e.get(r.eventType);t||(t=[],e.set(r.eventType,t)),t.push(r)}return e}function tu(t,e){let r="string"==typeof e?t.states[e]:e?t.states[e.target]:void 0;if(!r&&e)throw Error(`Initial state node "${e}" not found on parent state node #${t.id}`);let n={source:t,actions:e&&"string"!=typeof e?m(e.actions):[],eventType:null,reenter:!1,target:r?[r]:[],toJSON:()=>({...n,source:`#${t.id}`,target:r?[`#${r.id}`]:[]})};return n}function tc(t){let e=E(t.config.target);return e?{target:e.map(e=>"string"==typeof e?td(t.parent,e):e)}:t.parent.initial}function tl(t){return"history"===t.type}function th(t){let e=tf(t);for(let r of e)for(let n of Q(r,t))e.add(n);return e}function tf(t){let e=new Set;return!function t(r){if(!e.has(r)){if(e.add(r),"compound"===r.type)t(r.initial.target[0]);else if("parallel"===r.type)for(let e of K(r))t(e)}}(t),e}function tp(t,e){if(tn(e))return t.machine.getStateNodeById(e);if(!t.states)throw Error(`Unable to retrieve child state '${e}' from '${t.id}'; no child states exist.`);let r=t.states[e];if(!r)throw Error(`Child state '${e}' does not exist on '${t.id}'`);return r}function td(t,e){if("string"==typeof e&&tn(e))try{return t.machine.getStateNodeById(e)}catch{}let r=y(e).slice(),n=t;for(;r.length;){let t=r.shift();if(!t.length)break;n=tp(n,t)}return n}function ty(t,e){if("string"==typeof e){let r=t.states[e];if(!r)throw Error(`State '${e}' does not exist on '${t.id}'`);return[t,r]}let r=Object.keys(e),n=r.map(e=>tp(t,e)).filter(Boolean);return[t.machine.root,t].concat(n,r.reduce((r,n)=>{let s=tp(t,n);if(!s)return r;let i=ty(s,e[n]);return r.concat(i)},[]))}function tg(t,e){let r=t;for(;r.parent&&r.parent!==e;)r=r.parent;return r.parent===e}function tv(t,e,r){let n=new Set;for(let s of t){let t=!1,i=new Set;for(let o of n)if(function(t,e){let r=new Set(t),n=new Set(e);for(let t of r)if(n.has(t))return!0;for(let t of n)if(r.has(t))return!0;return!1}(tw([s],e,r),tw([o],e,r))){if(tg(s.source,o.source))i.add(o);else{t=!0;break}}if(!t){for(let t of i)n.delete(t);n.add(s)}}return Array.from(n)}function tm(t,e){if(!t.target)return[];let r=new Set;for(let n of t.target)if(tl(n)){if(e[n.id])for(let t of e[n.id])r.add(t);else for(let t of tm(tc(n),e))r.add(t)}else r.add(n);return[...r]}function tb(t,e){let r=tm(t,e);if(!r)return;if(!t.reenter&&r.every(e=>e===t.source||tg(e,t.source)))return t.source;let n=function(t){let[e,...r]=t;for(let t of Q(e,void 0))if(r.every(e=>tg(e,t)))return t}(r.concat(t.source));return n||(t.reenter?void 0:t.source.machine.root)}function tw(t,e,r){let n=new Set;for(let s of t)if(s.target?.length){let t=tb(s,r);for(let r of(s.reenter&&s.source===t&&n.add(t),e))tg(r,t)&&n.add(r)}return[...n]}function t_(t,e,r,n,s,i){if(!t.length)return e;let o=new Set(e._nodes),a=e.historyValue,u=tv(t,o,a),c=e;s||([c,a]=function(t,e,r,n,s,i,o,a){let u,c=t,l=tw(n,s,i);for(let t of(l.sort((t,e)=>e.order-t.order),l))for(let e of function(t){return Object.keys(t.states).map(e=>t.states[e]).filter(t=>"history"===t.type)}(t)){let r;r="deep"===e.history?e=>G(e)&&tg(e,t):e=>e.parent===t,(u??={...i})[e.id]=Array.from(s).filter(r)}for(let t of l)c=tS(c,e,r,[...t.exit,...t.invoke.map(t=>L(t.id))],o,void 0),s.delete(t);return[c,u||i]}(c,n,r,u,o,a,i,r.actionExecutor)),c=function(t,e,r,n,s,i,o,a){let u=t,c=new Set,h=new Set;(function(t,e,r,n){for(let s of t){let t=tb(s,e);for(let i of s.target||[])!tl(i)&&(s.source!==i||s.source!==t||s.reenter)&&(n.add(i),r.add(i)),tE(i,e,r,n);for(let i of tm(s,e)){let o=Q(i,t);t?.type==="parallel"&&o.push(t),tx(n,e,r,o,!s.source.parent&&s.reenter?void 0:t)}}})(n,o,h,c),a&&h.add(t.machine.root);let f=new Set;for(let t of[...c].sort((t,e)=>t.order-e.order)){s.add(t);let n=[];for(let e of(n.push(...t.entry),t.invoke))n.push(N(e.src,{...e,syncSnapshot:!!e.onSnapshot}));if(h.has(t)){let e=t.initial.actions;n.push(...e)}if(u=tS(u,e,r,n,i,t.invoke.map(t=>
2t.id)),"final"===t.type){let n=t.parent,o=n?.type==="parallel"?n:n?.parent,a=o||t;for(n?.type==="compound"&&i.push(l(n.id,void 0!==t.output?b(t.output,u.context,e,r.self):void 0));o?.type==="parallel"&&!f.has(o)&&tr(s,o);)f.add(o),i.push(l(o.id)),a=o,o=o.parent;if(o)continue;u=tU(u,{status:"done",output:function(t,e,r,n,s){if(void 0===n.output)return;let i=l(s.id,void 0!==s.output&&s.parent?b(s.output,t.context,e,r.self):void 0);return b(n.output,t.context,i,r.self)}(u,e,r,u.machine.root,a)})}}return u}(c=tS(c,n,r,u.flatMap(t=>t.actions),i,void 0),n,r,u,o,i,a,s);let h=[...o];"done"===c.status&&(c=tS(c,n,r,h.sort((t,e)=>e.order-t.order).flatMap(t=>t.exit),i,void 0));try{if(a===e.historyValue&&function(t,e){if(t.length!==e.size)return!1;for(let r of t)if(!e.has(r))return!1;return!0}(e._nodes,o))return c;return tU(c,{_nodes:h,historyValue:a})}catch(t){throw t}}function tE(t,e,r,n){if(tl(t)){if(e[t.id]){let s=e[t.id];for(let t of s)n.add(t),tE(t,e,r,n);for(let i of s)tx(n,e,r,Q(i,t.parent))}else{let s=tc(t);for(let i of s.target)n.add(i),s===t.parent?.initial&&r.add(t.parent),tE(i,e,r,n);for(let i of s.target)tx(n,e,r,Q(i,t.parent))}}else if("compound"===t.type){let[s]=t.initial.target;tl(s)||(n.add(s),r.add(s)),tE(s,e,r,n),tx(n,e,r,Q(s,t))}else if("parallel"===t.type)for(let s of K(t).filter(t=>!tl(t)))[...n].some(t=>tg(t,s))||(tl(s)||(n.add(s),r.add(s)),tE(s,e,r,n))}function tx(t,e,r,n,s){for(let i of n)if((!s||tg(i,s))&&t.add(i),"parallel"===i.type)for(let n of K(i).filter(t=>!tl(t)))[...t].some(t=>tg(t,n))||(t.add(n),tE(n,e,r,t))}function tS(t,e,r,n,s,i){let o=i?[]:void 0,a=function t(e,r,n,s,i,o){let{machine:a}=e,u=e;for(let e of s){var c;let s="function"==typeof e,l=s?e:(c="string"==typeof e?e:e.type,a.implementations.actions[c]),h={context:u.context,event:r,self:n.self,system:n.system},f=s||"string"==typeof e?void 0:"params"in e?"function"==typeof e.params?e.params({context:u.context,event:r}):e.params:void 0;if(!l||!("resolve"in l)){n.actionExecutor({type:"string"==typeof e?e:"object"==typeof e?e.type:e.name||"(anonymous)",info:h,params:f,exec:l});continue}let[p,d,y]=l.resolve(n,u,h,f,l,i);u=p,"retryResolve"in l&&o?.push([l,d]),"execute"in l&&n.actionExecutor({type:l.type,info:h,params:d,exec:l.execute.bind(null,n,d)}),y&&(u=t(u,r,n,y,i,o))}return u}(t,e,r,n,{internalQueue:s,deferredActorIds:i},o);return o?.forEach(([t,e])=>{t.retryResolve(r,a,e)}),a}function tT(t,e,r,n){let s=t,i=[];function o(t,e,n){r.system._sendInspectionEvent({type:"@xstate.microstep",actorRef:r.self,event:e,snapshot:t,_transitions:n}),i.push(t)}if(e.type===c)return o(s=tU(tC(s,e,r),{status:"stopped"}),e,[]),{snapshot:s,microstates:i};let u=e;if(u.type!==a){let e=u,a=e.type.startsWith("xstate.error.actor"),c=tI(e,s);if(a&&!c.length)return o(s=tU(t,{status:"error",error:e.error}),e,[]),{snapshot:s,microstates:i};o(s=t_(c,t,r,u,!1,n),e,c)}let l=!0;for(;"active"===s.status;){let t=l?function(t,e){let r=new Set;for(let n of t._nodes.filter(G))t:for(let s of[n].concat(Q(n,void 0)))if(s.always){for(let n of s.always)if(void 0===n.guard||Y(n.guard,t.context,e,t)){r.add(n);break t}}return tv(Array.from(r),new Set(t._nodes),t.historyValue)}(s,u):[],e=t.length?s:void 0;if(!t.length){if(!n.length)break;t=tI(u=n.shift(),s)}l=(s=t_(t,s,r,u,!1,n))!==e,o(s,u,t)}return"active"!==s.status&&tC(s,u,r),{snapshot:s,microstates:i}}function tC(t,e,r){return tS(t,e,r,Object.values(t.children).map(t=>L(t)),[],void 0)}function tI(t,e){return e.machine.getTransitionData(e,t)}function tR(t,e){let r=Z(ty(t,e));return te(t,[...r])}let tq=function(t){return function t(e,r){let n=g(e),s=g(r);return"string"==typeof s?"string"==typeof n&&s===n:"string"==typeof n?n in s:Object.keys(n).every(e=>e in s&&t(n[e],s[e]))}(t,this.value)},tA=function(t){return this.tags.has(t)},t$=function(t){let e=this.machine.getTransitionData(this,t);return!!e?.length&&e.some(t=>void 0!==t.target||t.actions.length)},tO=function(){let{_nodes:t,tags:e,machine:r,getMeta:n,toJSON:s,can:i,hasTag:o,matches:a,...u}=this;return{...u,tags:Array.from(e)}},tk=function(){return this._nodes.reduce((t,e)=>(void 0!==e.meta&&(t[e.id]=e.meta),t),{})};function tj(t,e){return{status:t.status,output:t.output,error:t.error,machine:e,context:t.context,_nodes:t._nodes,value:te(e.root,t._nodes),tags:new Set(t._nodes.flatMap(t=>t.tags)),children:t.children,historyValue:t.historyValue||{},matches:tq,hasTag:tA,can:t$,getMeta:tk,toJSON:tO}}function tU(t,e={}){return tj({...t,...e},t.machine)}function tP(t,e){let{_nodes:r,tags:n,machine:s,children:i,context:o,can:a,hasTag:u,matches:c,getMeta:l,toJSON:h,...f}=t,p={};for(let t in i){let r=i[t];p[t]={snapshot:r.getPersistedSnapshot(e),src:r.src,systemId:r._systemId,syncSnapshot:r._syncSnapshot}}return{...f,context:function t(e){let r;for(let n in e){let s=e[n];if(s&&"object"==typeof s){if("sessionId"in s&&"send"in s&&"ref"in s)(r??=Array.isArray(e)?e.slice():{...e})[n]={xstate$$type:q,id:s.id};else{let i=t(s);i!==s&&((r??=Array.isArray(e)?e.slice():{...e})[n]=i)}}}return r??e}(o),children:p,historyValue:function(t){if("object"!=typeof t||null===t)return{};let e={};for(let r in t){let n=t[r];Array.isArray(n)&&(e[r]=n.map(t=>({id:t.id})))}return e}(f.historyValue)}}function tD(t,e,r,n,{event:s,id:i,delay:o},{internalQueue:a}){let u;let c=e.machine.implementations.delays;if("string"==typeof s)throw Error(`Only event objects may be used with raise; use raise({ type: "${s}" }) instead`);let l="function"==typeof s?s(r,n):s;if("string"==typeof o){let t=c&&c[o];u="function"==typeof t?t(r,n):t}else u="function"==typeof o?o(r,n):o;return"number"!=typeof u&&a.push(l),[e,{event:l,id:i,delay:u},void 0]}function tM(t,e){let{event:r,delay:n,id:s}=e;if("number"==typeof n){t.defer(()=>{let e=t.self;t.system.scheduler.schedule(e,e,r,n,s)});return}}function tN(t,e){function r(t,e){}return r.type="xstate.raise",r.event=t,r.id=e?.id,r.delay=e?.delay,r.resolve=tD,r.execute=tM,r}},47289:(t,e,r)=>{"use strict";r.d(e,{DT:()=>i,mj:()=>f}),r(8691);var n=r(18596),s=r(63915);function i(t,e){let r=(0,n.t)(e);if(!r.includes(t.type)){let e=1===r.length?`type "${r[0]}"`:`one of types "${r.join('", "')}"`;throw Error(`Expected event ${JSON.stringify(t)} to have ${e}`)}}let o=new WeakMap;function a(t,e,r){let n=o.get(t);return n?e in n||(n[e]=r()):(n={[e]:r()},o.set(t,n)),n[e]}let u={},c=t=>"string"==typeof t?{type:t}:"function"==typeof t?"resolve"in t?{type:t.type}:{type:t.name}:t;class l{constructor(t,e){if(this.config=t,this.key=void 0,this.id=void 0,this.type=void 0,this.path=void 0,this.states=void 0,this.history=void 0,this.entry=void 0,this.exit=void 0,this.parent=void 0,this.machine=void 0,this.meta=void 0,this.output=void 0,this.order=-1,this.description=void 0,this.tags=[],this.transitions=void 0,this.always=void 0,this.parent=e._parent,this.key=e._key,this.machine=e._machine,this.path=this.parent?this.parent.path.concat(this.key):[],this.id=this.config.id||[this.machine.id,...this.path].join(n.S),this.type=this.config.type||(this.config.states&&Object.keys(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.description=this.config.description,this.order=this.machine.idMap.size,this.machine.idMap.set(this.id,this),this.states=this.config.states?(0,n.m)(this.config.states,(t,e)=>new l(t,{_parent:this,_key:e,_machine:this.machine})):u,"compound"===this.type&&!this.config.initial)throw Error(`No initial state specified for c
2ompound state node "#${this.id}". Try adding { initial: "${Object.keys(this.states)[0]}" } to the state config.`);this.history=!0===this.config.history?"shallow":this.config.history||!1,this.entry=(0,n.t)(this.config.entry).slice(),this.exit=(0,n.t)(this.config.exit).slice(),this.meta=this.config.meta,this.output="final"!==this.type&&this.parent?void 0:this.config.output,this.tags=(0,n.t)(t.tags).slice()}_initialize(){this.transitions=(0,n.f)(this),this.config.always&&(this.always=(0,n.a)(this.config.always).map(t=>(0,n.b)(this,n.N,t))),Object.keys(this.states).forEach(t=>{this.states[t]._initialize()})}get definition(){return{id:this.id,key:this.key,version:this.machine.version,type:this.type,initial:this.initial?{target:this.initial.target,source:this,actions:this.initial.actions.map(c),eventType:null,reenter:!1,toJSON:()=>({target:this.initial.target.map(t=>`#${t.id}`),source:`#${this.id}`,actions:this.initial.actions.map(c),eventType:null})}:void 0,history:this.history,states:(0,n.m)(this.states,t=>t.definition),on:this.on,transitions:[...this.transitions.values()].flat().map(t=>({...t,actions:t.actions.map(c)})),entry:this.entry.map(c),exit:this.exit.map(c),meta:this.meta,order:this.order||-1,output:this.output,invoke:this.invoke,description:this.description,tags:this.tags}}toJSON(){return this.definition}get invoke(){return a(this,"invoke",()=>(0,n.t)(this.config.invoke).map((t,e)=>{let{src:r,systemId:s}=t,i=t.id??(0,n.c)(this.id,e),o="string"==typeof r?r:`xstate.invoke.${(0,n.c)(this.id,e)}`;return{...t,src:o,id:i,systemId:s,toJSON(){let{onDone:e,onError:r,...n}=t;return{...n,type:"xstate.invoke",src:o,id:i}}}}))}get on(){return a(this,"on",()=>[...this.transitions].flatMap(([t,e])=>e.map(e=>[t,e])).reduce((t,[e,r])=>(t[e]=t[e]||[],t[e].push(r),t),{}))}get after(){return a(this,"delayedTransitions",()=>(0,n.g)(this))}get initial(){return a(this,"initial",()=>(0,n.d)(this,this.config.initial))}next(t,e){let r;let s=e.type,i=[];for(let o of a(this,`candidates-${s}`,()=>(0,n.h)(this,s))){let{guard:a}=o,u=t.context,c=!1;try{c=!a||(0,n.e)(a,u,e,t)}catch(e){let t="string"==typeof a?a:"object"==typeof a?a.type:void 0;throw Error(`Unable to evaluate guard ${t?`'${t}' `:""}in transition for event '${s}' in state node '${this.id}': 3${e.message}`)}if(c){i.push(...o.actions),r=o;break}}return r?[r]:void 0}get events(){return a(this,"events",()=>{let{states:t}=this,e=new Set(this.ownEvents);if(t)for(let r of Object.keys(t)){let n=t[r];if(n.states)for(let t of n.events)e.add(`${t}`)}return Array.from(e)})}get ownEvents(){return Array.from(new Set([...this.transitions.keys()].filter(t=>this.transitions.get(t).some(t=>!(!t.target&&!t.actions.length&&!t.reenter)))))}}class h{constructor(t,e){this.config=t,this.version=void 0,this.schemas=void 0,this.implementations=void 0,this.__xstatenode=!0,this.idMap=new Map,this.root=void 0,this.id=void 0,this.states=void 0,this.events=void 0,this.id=t.id||"(machine)",this.implementations={actors:e?.actors??{},actions:e?.actions??{},delays:e?.delays??{},guards:e?.guards??{}},this.version=this.config.version,this.schemas=this.config.schemas,this.transition=this.transition.bind(this),this.getInitialSnapshot=this.getInitialSnapshot.bind(this),this.getPersistedSnapshot=this.getPersistedSnapshot.bind(this),this.restoreSnapshot=this.restoreSnapshot.bind(this),this.start=this.start.bind(this),this.root=new l(t,{_key:this.id,_machine:this}),this.root._initialize(),this.states=this.root.states,this.events=this.root.events}provide(t){let{actions:e,guards:r,actors:n,delays:s}=this.implementations;return new h(this.config,{actions:{...e,...t.actions},guards:{...r,...t.guards},actors:{...n,...t.actors},delays:{...s,...t.delays}})}resolveState(t){let e=(0,n.r)(this.root,t.value),r=(0,n.i)((0,n.j)(this.root,e));return(0,n.k)({_nodes:[...r],context:t.context||{},children:{},status:(0,n.l)(r,this.root)?"done":t.status||"active",output:t.output,error:t.error,historyValue:t.historyValue},this)}transition(t,e,r){return(0,n.n)(t,e,r,[]).snapshot}microstep(t,e,r){return(0,n.n)(t,e,r,[]).microstates}getTransitionData(t,e){return(0,n.o)(this.root,t.value,t,e)||[]}
3getPreInitialState(t,e,r){let{context:i}=this.config,o=(0,n.k)({context:"function"!=typeof i&&i?i:{},_nodes:[this.root],children:{},status:"active"},this);return"function"==typeof i?(0,n.p)(o,e,t,[(0,s.a)(({spawn:t,event:e,self:r})=>i({spawn:t,input:e.input,self:r}))],r,void 0):o}getInitialSnapshot(t,e){let r=(0,n.q)(e),s=[],i=this.getPreInitialState(t,r,s),o=(0,n.s)([{target:[...(0,n.u)(this.root)],source:this.root,reenter:!0,actions:[],eventType:null,toJSON:null}],i,t,r,!0,s),{snapshot:a}=(0,n.n)(o,r,t,s);return a}start(t){Object.values(t.children).forEach(t=>{"active"===t.getSnapshot().status&&t.start()})}getStateNodeById(t){let e=(0,n.v)(t),r=e.slice(1),s=(0,n.w)(e[0])?e[0].slice(1):e[0],i=this.idMap.get(s);if(!i)throw Error(`Child state node '#${s}' does not exist on machine '${this.id}'`);return(0,n.x)(i,r)}get definition(){return this.root.definition}toJSON(){return this.definition}getPersistedSnapshot(t,e){return(0,n.y)(t,e)}restoreSnapshot(t,e){let r={},s=t.children;Object.keys(s).forEach(t=>{let i=s[t],o=i.snapshot,a=i.src,u="string"==typeof a?(0,n.z)(this,a):a;if(!u)return;let c=(0,n.A)(u,{id:t,parent:e.self,syncSnapshot:i.syncSnapshot,snapshot:o,src:a,systemId:i.systemId});r[t]=c});let i=function(t,e){if(!t||"object"!=typeof t)return{};let r={};for(let s in t){let i=t[s];r[s]=i.map(t=>{if(t instanceof l)return t;if("object"==typeof t&&"id"in t&&"string"==typeof t.id){let r=function(t,e){try{return e.machine.getStateNodeById(t)}catch{try{return(0,n.x)(e,t.split("."))}catch{return t}}}(t.id,e);if(r instanceof l)return r}}).filter(t=>void 0!==t),0===r[s].length&&delete r[s]}return r}(t.historyValue,this.root),o=(0,n.k)({...t,children:r,_nodes:Array.from((0,n.i)((0,n.j)(this.root,t.value))),historyValue:i},this),a=new Set;return!function t(e,r){if(!a.has(e))for(let s in a.add(e),e){let i=e[s];if(i&&"object"==typeof i){if("xstate$$type"in i&&i.xstate$$type===n.$){e[s]=r[i.id];continue}t(i,r)}}}(o.context,r),o}}function f({schemas:t,actors:e,actions:r,guards:n,delays:s}){return{createMachine:i=>new h({...i,schemas:t},{actors:e,actions:r,guards:n,delays:s})}}},65239:(t,e,r)=>{"use strict";r.d(e,{A_:()=>v,C:()=>p,Hf:()=>S,IM:()=>_,Jt:()=>c,KT:()=>function t(e,r,n=[]){if(null!==e&&Array.isArray(e))return e.map((e,s)=>{if(C(e)){let i=e._key;if("string"==typeof i)return t(e,r,n.concat({_key:i,_index:s}))}return t(e,r,n.concat(s))});if(C(e)){if("block"===e._type||"span"===e._type){let s={...e};return"block"===e._type?s.children=t(e.children,r,n.concat("children")):"span"===e._type&&(s.text=t(e.text,r,n.concat("text"))),s}return Object.fromEntries(Object.entries(e).map(([e,s])=>[e,t(s,r,n.concat(e))]))}return r(e,n)},R8:()=>g,T4:()=>m,_S:()=>w,ct:()=>b,dI:()=>l,fO:()=>T,iz:()=>I});let n=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,s=/_key\s*==\s*['"](.*)['"]/,i=/^\d*:\d*$/;function o(t){return"number"==typeof t||"string"==typeof t&&/^\[\d+\]$/.test(t)}function a(t){return"string"==typeof t?s.test(t.trim()):"object"==typeof t&&"_key"in t}function u(t){if("string"==typeof t&&i.test(t))return!0;if(!Array.isArray(t)||2!==t.length)return!1;let[e,r]=t;return("number"==typeof e||""===e)&&("number"==typeof r||""===r)}function c(t,e,r){let n="string"==typeof e?h(e):e;if(!Array.isArray(n))throw Error("Path must be an array or a string");let s=t;for(let t=0;t<n.length;t++){let e=n[t];if(o(e)){if(!Array.isArray(s))return r;s=s[e]}if(a(e)){if(!Array.isArray(s))return r;s=s.find(t=>t._key===e._key)}if("string"==typeof e&&(s="object"==typeof s&&null!==s?s[e]:void 0),typeof s>"u")return r}return s}function l(t){if(!Array.isArray(t))throw Error("Path is not an array");return t.reduce((t,e,r)=>{let n=typeof e;if("number"===n)return`${t}[${e}]`;if("string"===n)return`${t}${0===r?"":"."}${e}`;if(a(e)&&e._key)return`${t}[_key=="${e._key}"]`;if(Array.isArray(e)){let[r,n]=e;return`${t}[${r}:${n}]`}throw Error(`Unsupported path segment \`${JSON.stringify(e)}\``)},"")}function h(t){if("string"!=typeof t)throw Error("Path is not a string");let e=t.match(n);if(!e)throw Error("Invalid path string");return e.map(f)}function f(t){return o(t)?Number(t.replace(/[^\d]/g,"")):a(t)?{_key:t.match(s)[1]}:u(t)?function(t){let[e,r]=t.split(":").map(t=>""===t?t:Number(t));return[e,r]}(t):t}var p=Object.freeze({__proto__:null,fromString:h,get:c,isIndexSegment:o,isIndexTuple:u,isKeySegment:a,reKeySegment:s,toString:l});let d="drafts.",y="versions.";function g(t){return t.startsWith(d)}function v(t){return t.startsWith(y)}function m(t){return v(t)?d+_(t):g(t)?t:d+t}function b(t,e){if("drafts"===e||"published"===e)throw Error('Version can not be "published" or "drafts"');return`${y}${e}.${_(t)}`}function w(t){if(!v(t))return;let[e,r,...n]=t.split(".");return r}function _(t){return v(t)?t.split(".").slice(2).join("."):g(t)?t.slice(d.length):t}let E={"\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","'":"\\'","\\":"\\\\"},x={"\\f":"\f","\\n":` 4`,"\\r":"\r","\\t":" ","\\'":"'","\\\\":"\\"};function S(t){let e;let r=[],n=/\['(.*?)'\]|\[(\d+)\]|\[\?\(@\._key=='(.*?)'\)\]/g;for(;null!==(e=n.exec(t));){if(void 0!==e[1]){let t=e[1].replace(/\\(\\|f|n|r|t|')/g,t=>x[t]);
4r.push(t);continue}if(void 0!==e[2]){r.push(parseInt(e[2],10));continue}if(void 0!==e[3]){let t=e[3].replace(/\\(\\')/g,t=>x[t]);r.push({_key:t,_index:-1});continue}}return r}function T(t,e){var r;if(!e?.mappings)return;let n=(r=t.map(t=>{if("string"==typeof t||"number"==typeof t)return t;if(-1!==t._index)return t._index;throw Error(`invalid segment:${JSON.stringify(t)}`)}),`$${r.map(t=>"string"==typeof t?`['${t.replace(/[\f\n\r\t'\\]/g,t=>E[t])}']`:"number"==typeof t?`[${t}]`:""!==t._key?`[?(@._key=='${t._key.replace(/['\\]/g,t=>E[t])}')]`:`[${t._index}]`).join("")}`);if(void 0!==e.mappings[n])return{mapping:e.mappings[n],matchedPath:n,pathSuffix:""};let s=Object.entries(e.mappings).filter(([t])=>n.startsWith(t)).sort(([t],[e])=>e.length-t.length);if(0==s.length)return;let[i,o]=s[0],a=n.substring(i.length);return{mapping:o,matchedPath:i,pathSuffix:a}}function C(t){return"object"==typeof t&&null!==t}function I(t){let{baseUrl:e,workspace:r="default",tool:n="default",id:s,type:i,path:o,projectId:a,dataset:u}=t;if(!e)throw Error("baseUrl is required");if(!o)throw Error("path is required");if(!s)throw Error("id is required");if("/"!==e&&e.endsWith("/"))throw Error("baseUrl must not end with a slash");let c="default"===r?void 0:r,h="default"===n?void 0:n,f=_(s),p=Array.isArray(o)?l(o.map(t=>{if("string"==typeof t||"number"==typeof t)return t;if(""!==t._key)return{_key:t._key};if(-1!==t._index)return t._index;throw Error(`invalid segment:${JSON.stringify(t)}`)})):o,d=new URLSearchParams({baseUrl:e,id:f,type:i,path:p});if(c&&d.set("workspace",c),h&&d.set("tool",h),a&&d.set("projectId",a),u&&d.set("dataset",u),g(s)||v(s)){if(v(s)){let t=w(s);d.set("perspective",t)}}else d.set("perspective","published");let y=["/"===e?"":e];c&&y.push(c);let m=["mode=presentation",`id=${f}`,`type=${i}`,`path=${encodeURIComponent(p)}`];return h&&m.push(`tool=${h}`),y.push("intent","edit",`${m.join(";")}?${d}`),y.join("/")}},60758:(t,e,r)=>{"use strict";r.d(e,{C:()=>o,Q:()=>c});var n={0:8203,1:8204,2:8205,3:8290,4:8291,5:8288,6:65279,7:8289,8:119155,9:119156,a:119157,b:119158,c:119159,d:119160,e:119161,f:119162},s={0:8203,1:8204,2:8205,3:65279},i=[,,,,].fill(String.fromCodePoint(s[0])).join("");function o(t,e,r="auto"){let n;return!0===r||"auto"===r&&(!(!Number.isNaN(Number(t))||/[a-z]/i.test(t)&&!/\d+(?:[-:\/]\d+){2}(?:T\d+(?:[-:\/]\d+){1,2}(\.\d+)?Z?)?/.test(t))&&Date.parse(t)||function(t){try{new URL(t,t.startsWith("/")?"https://acme.com":void 0)}catch{return!1}return!0}(t))?t:`${t}${n=JSON.stringify(e),`${i}${Array.from(n).map(t=>{let e=t.charCodeAt(0);if(e>255)throw Error(`Only ASCII edit info can be encoded. Error attempting to encode ${n} on character ${t} (${e})`);return Array.from(e.toString(4).padStart(4,"0")).map(t=>String.fromCodePoint(s[t])).join("")}).join("")}`}`}Object.fromEntries(Object.entries(s).map(t=>t.reverse())),Object.fromEntries(Object.entries(n).map(t=>t.reverse()));var a=`${Object.values(n).map(t=>`\\u{${t.toString(16)}}`).join("")}`,u=RegExp(`[${a}]{4,}`,"gu");function c(t){var e,r;return t&&JSON.parse({cleaned:(e=JSON.stringify(t)).replace(u,""),encoded:(null==(r=e.match(u))?void 0:r[0])||""}.cleaned)}},31103:(t,e,r)=>{"use strict";r.d(e,{Q6:()=>t1,MZ:()=>ty,u_:()=>tb,gP:()=>tg,UU:()=>rl,x_:()=>tK});let n=!(typeof navigator>"u")&&"ReactNative"===navigator.product,s={timeout:n?6e4:12e4},i=function(t){let e={...s,..."string"==typeof t?{url:t}:t};if(e.timeout=function t(e){if(!1===e||0===e)return!1;if(e.connect||e.socket)return e;let r=Number(e);return isNaN(r)?t(s.timeout):{connect:r,socket:r}}(e.timeout),e.query){let{url:t,searchParams:r}=function(t){let e=t.indexOf("?");if(-1===e)return{url:t,searchParams:new URLSearchParams};let r=t.slice(0,e),s=t.slice(e+1);if(!n)return{url:r,searchParams:new URLSearchParams(s)};if("function"!=typeof decodeURIComponent)throw Error("Broken `URLSearchParams` implementation, and `decodeURIComponent` is not defined");let i=new URLSearchParams;for(let t of s.split("&")){let[e,r]=t.split("=");e&&i.append(o(e),o(r||""))}return{url:r,searchParams:i}}(e.url);for(let[n,s]of Object.entries(e.query)){if(void 0!==s){if(Array.isArray(s))for(let t of s)r.append(n,t);else r.append(n,s)}let i=r.toString();i&&(e.url=`${t}?${i}`)}}return e.method=e.body&&!e.method?"POST":(e.method||"GET").toUpperCase(),e};function o(t){return decodeURIComponent(t.replace(/\+/g," "))}let a=/^https?:\/\//i,u=function(t){if(!a.test(t.url))throw Error(`"${t.url}" is not a valid URL`)},c=["request","response","progress","error","abort"],l=["processOptions","validateOptions","interceptRequest","finalizeOptions","onRequest","onResponse","onError","onReturn","onHeaders"];var h,f,p=function(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}(function(){if(f)return h;f=1;var t=function(t){return t.replace(/^\s+|\s+$/g,"")};return h=function(e){if(!e)return{};for(var r,n={},s=t(e).split("\n"),i=0;i<s.length;i++){var o=s[i],a=o.indexOf(":"),u=t(o.slice(0,a)).toLowerCase(),c=t(o.slice(a+1));typeof n[u]>"u"?n[u]=c:(r=n[u],"[object Array]"===Object.prototype.toString.call(r)?n[u].push(c):n[u]=[n[u],c])}return n}}());class d{onabort;onerror;onreadystatechange;ontimeout;readyState=0;response;responseText="";responseType="";status;statusText;withCredentials;#t;#e;#r;#n={};#s;#i={};#o;open(t,e,r){this.#t=t,this.#e=e,this.#r="",this.readyState=1,this.onreadystatechange?.(),this.#s=void 0}abort(){this.#s&&this.#s.abort()}getAllResponseHeaders(){return this.#r}setRequestHeader(t,e){this.#n[t]=e}setInit(t,e=!0){this.#i=t,this.#o=e}send(t){let e="arraybuffer"!==this.responseType,r={...this.#i,method:this.#t,headers:this.#n,body:t};"function"==typeof AbortController&&this.#o&&(this.#s=new AbortController,"u">typeof EventTarget&&this.#s.signal instanceof EventTarget&&(r.signal=this.#s.signal)),"u">typeof document&&(r.credentials=this.withCredentials?"include":"omit"),fetch(this.#e,r).then(t=>
4(t.headers.forEach((t,e)=>{this.#r+=`${e}: ${t}\r 5`}),this.status=t.status,this.statusText=t.statusText,this.readyState=3,this.onreadystatechange?.(),e?t.text():t.arrayBuffer())).then(t=>{"string"==typeof t?this.responseText=t:this.response=t,this.readyState=4,this.onreadystatechange?.()}).catch(t=>{"AbortError"!==t.name?this.onerror?.(t):this.onabort?.()})}}let y="function"==typeof XMLHttpRequest?"xhr":"fetch",g="xhr"===y?XMLHttpRequest:d,v=(t,e)=>{let r=t.options,n=t.applyMiddleware("finalizeOptions",r),s={},i=t.applyMiddleware("interceptRequest",void 0,{adapter:y,context:t});if(i){let t=setTimeout(e,0,null,i);return{abort:()=>clearTimeout(t)}}let o=new g;o instanceof d&&"object"==typeof n.fetch&&o.setInit(n.fetch,n.useAbortSignal??!0);let a=n.headers,u=n.timeout,c=!1,l=!1,h=!1;if(o.onerror=t=>{m(o instanceof d?t instanceof Error?t:Error(`Request error while attempting to reach is ${n.url}`,{cause:t}):Error(`Request error while attempting to reach is ${n.url}${t.lengthComputable?`(${t.loaded} of ${t.total} bytes transferred)`:""}`))},o.ontimeout=t=>{m(Error(`Request timeout while attempting to reach ${n.url}${t.lengthComputable?`(${t.loaded} of ${t.total} bytes transferred)`:""}`))},o.onabort=()=>{v(!0),c=!0},o.onreadystatechange=function(){u&&(v(),s.socket=setTimeout(()=>f("ESOCKETTIMEDOUT"),u.socket)),!c&&o&&4===o.readyState&&0!==o.status&&function(){if(!(c||l||h)){if(0===o.status)return void m(Error("Unknown XHR error"));v(),l=!0,e(null,{body:o.response||(""===o.responseType||"text"===o.responseType?o.responseText:""),url:n.url,method:n.method,headers:p(o.getAllResponseHeaders()),statusCode:o.status,statusMessage:o.statusText})}}()},o.open(n.method,n.url,!0),o.withCredentials=!!n.withCredentials,a&&o.setRequestHeader)for(let t in a)a.hasOwnProperty(t)&&o.setRequestHeader(t,a[t]);return n.rawBody&&(o.responseType="arraybuffer"),t.applyMiddleware("onRequest",{options:n,adapter:y,request:o,context:t}),o.send(n.body||null),u&&(s.connect=setTimeout(()=>f("ETIMEDOUT"),u.connect)),{abort:function(){c=!0,o&&o.abort()}};function f(e){h=!0,o.abort();let r=Error("ESOCKETTIMEDOUT"===e?`Socket timed out on request to ${n.url}`:`Connection timed out on request to ${n.url}`);r.code=e,t.channels.error.publish(r)}function v(t){(t||c||o&&o.readyState>=2&&s.connect)&&clearTimeout(s.connect),s.socket&&clearTimeout(s.socket)}function m(t){if(l)return;v(!0),l=!0,o=null;let r=t||Error(`Network error while attempting to reach ${n.url}`);r.isNetworkError=!0,r.request=n,e(r)}},m=(t=[],e=v)=>(function t(e,r){let n=[],s=l.reduce((t,e)=>(t[e]=t[e]||[],t),{processOptions:[i],validateOptions:[u]});function o(t){let e;let n=c.reduce((t,e)=>(t[e]=function(){let t=Object.create(null),e=0;return{publish:function(e){for(let r in t)t[r](e)},subscribe:function(r){let n=e++;return t[n]=r,function(){delete t[n]}}}}(),t),{}),i=function(t,e,...r){let n="onError"===t,i=e;for(let e=0;e<s[t].length&&(i=(0,s[t][e])(i,...r),!n||i);e++);return i},o=i("processOptions",t);i("validateOptions",o);let a={options:o,channels:n,applyMiddleware:i},u=n.request.subscribe(t=>{e=r(t,(e,r)=>((t,e,r)=>{let s=t,o=e;if(!s)try{o=i("onResponse",e,r)}catch(t){o=null,s=t}(s=s&&i("onError",s,r))?n.error.publish(s):o&&n.response.publish(o)})(e,r,t))});n.abort.subscribe(()=>{u(),e&&e.abort()});let l=i("onReturn",n,a);return l===n&&n.request.publish(a),l}return o.use=function(t){if(!t)throw Error("Tried to add middleware that resolved to falsey value");if("function"==typeof t)throw Error("Tried to add middleware that was a function. It probably expects you to pass options to it.");if(t.onReturn&&s.onReturn.length>0)throw Error("Tried to add new middleware with `onReturn` handler, but another handler has already been registered for this event");return l.forEach(e=>{t[e]&&s[e].push(t[e])}),n.push(t),o},o.clone=()=>t(n,r),e.forEach(o.use),o})(t,e);var b,w,_,E,x,S=r(87358),T=r(75927).hp,C={exports:{}};x||(x=1,function(t,e){let r;e.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;let r="color: "+this.color;e.splice(1,0,r,"color: inherit");let n=0,s=0;e[0].replace(/%[a-zA-Z%]/g,t=>{"%%"!==t&&(n++,"%c"===t&&(s=n))}),e.splice(s,0,r)},e.save=function(t){try{t?e.storage.setItem("debug",t):e.storage.removeItem("debug")}catch{}},e.load=function(){let t;try{t=e.storage.getItem("debug")}catch{}return!t&&"u">typeof S&&"env"in S&&(t=S.env.DEBUG),t},e.useColors=function(){let t;return"u">typeof window&&!!window.process&&("renderer"===window.process.type||!!window.process.__nwjs)||!("u">typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&
5("u">typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"u">typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"u">typeof navigator&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||"u">typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},e.storage=function(){try{return localStorage}catch{}}(),e.destroy=(r=!1,()=>{r||(r=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.log=console.debug||console.log||(()=>{}),t.exports=(E?_:(E=1,_=function(t){function e(t){let n,s,i,o=null;function a(...t){if(!a.enabled)return;let r=Number(new Date),s=r-(n||r);a.diff=s,a.prev=n,a.curr=r,n=r,t[0]=e.coerce(t[0]),"string"!=typeof t[0]&&t.unshift("%O");let i=0;t[0]=t[0].replace(/%([a-zA-Z%])/g,(r,n)=>{if("%%"===r)return"%";i++;let s=e.formatters[n];if("function"==typeof s){let e=t[i];r=s.call(a,e),t.splice(i,1),i--}return r}),e.formatArgs.call(a,t),(a.log||e.log).apply(a,t)}return a.namespace=t,a.useColors=e.useColors(),a.color=e.selectColor(t),a.extend=r,a.destroy=e.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==o?o:(s!==e.namespaces&&(s=e.namespaces,i=e.enabled(t)),i),set:t=>{o=t}}),"function"==typeof e.init&&e.init(a),a}function r(t,r){let n=e(this.namespace+(typeof r>"u"?":":r)+t);return n.log=this.log,n}function n(t,e){let r=0,n=0,s=-1,i=0;for(;r<t.length;)if(n<e.length&&(e[n]===t[r]||"*"===e[n]))"*"===e[n]?(s=n,i=r):r++,n++;else{if(-1===s)return!1;n=s+1,r=++i}for(;n<e.length&&"*"===e[n];)n++;return n===e.length}return e.debug=e,e.default=e,e.coerce=function(t){return t instanceof Error?t.stack||t.message:t},e.disable=function(){let t=[...e.names,...e.skips.map(t=>"-"+t)].join(",");return e.enable(""),t},e.enable=function(t){for(let r of(e.save(t),e.namespaces=t,e.names=[],e.skips=[],("string"==typeof t?t:"").trim().replace(" ",",").split(",").filter(Boolean)))"-"===r[0]?e.skips.push(r.slice(1)):e.names.push(r)},e.enabled=function(t){for(let r of e.skips)if(n(t,r))return!1;for(let r of e.names)if(n(t,r))return!0;return!1},e.humanize=function(){if(w)return b;function t(t,e,r,n){return Math.round(t/r)+" "+n+(e>=1.5*r?"s":"")}return w=1,b=function(e,r){r=r||{};var n,s,i=typeof e;if("string"===i&&e.length>0)return function(t){if(!((t=String(t)).length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]);switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*r;case"weeks":case"week":case"w":return 6048e5*r;case"days":case"day":case"d":return 864e5*r;case"hours":case"hour":case"hrs":case"hr":case"h":return 36e5*r;case"minutes":case"minute":case"mins":case"min":case"m":return 6e4*r;case"seconds":case"second":case"secs":case"sec":case"s":return 1e3*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}(e);if("number"===i&&isFinite(e))return r.long?(s=Math.abs(e))>=864e5?t(e,s,864e5,"day"):s>=36e5?t(e,s,36e5,"hour"):s>=6e4?t(e,s,6e4,"minute"):s>=1e3?t(e,s,1e3,"second"):e+" ms":(n=Math.abs(e))>=864e5?Math.round(e/864e5)+"d":n>=36e5?Math.round(e/36e5)+"h":n>=6e4?Math.round(e/6e4)+"m":n>=1e3?Math.round(e/1e3)+"s":e+"ms";throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}}(),e.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(t).forEach(r=>{e[r]=t[r]}),e.names=[],e.skips=[],e.formatters={},e.selectColor=function(t){let r=0;for(let e=0;e<t.length;e++)r=(r<<5)-r+t.charCodeAt(e)|0;return e.colors[Math.abs(r)%e.colors.length]},e.enable(e.load()),e}))(e);let{formatters:n}=t.exports;n.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}}
5(C,C.exports)),C.exports,Object.prototype.hasOwnProperty;let I=typeof T>"u"?()=>!1:t=>T.isBuffer(t);function R(t){return"[object Object]"===Object.prototype.toString.call(t)}let q=["boolean","string","number"],A={};"u">typeof globalThis?A=globalThis:"u">typeof window?A=window:"u">typeof global?A=global:"u">typeof self&&(A=self);var $=A;let O=(t={})=>{let e=t.implementation||Promise;if(!e)throw Error("`Promise` is not available in global scope, and no implementation was passed");return{onReturn:(r,n)=>new e((e,s)=>{let i=n.options.cancelToken;i&&i.promise.then(t=>{r.abort.publish(t),s(t)}),r.error.subscribe(s),r.response.subscribe(r=>{e(t.onlyBody?r.body:r)}),setTimeout(()=>{try{r.request.publish(n)}catch(t){s(t)}},0)})}};class k{__CANCEL__=!0;message;constructor(t){this.message=t}toString(){return"Cancel"+(this.message?`: ${this.message}`:"")}}class j{promise;reason;constructor(t){if("function"!=typeof t)throw TypeError("executor must be a function.");let e=null;this.promise=new Promise(t=>{e=t}),t(t=>{this.reason||(this.reason=new k(t),e(this.reason))})}static source=()=>{let t;return{token:new j(e=>{t=e}),cancel:t}}}O.Cancel=k,O.CancelToken=j,O.isCancel=t=>!(!t||!t?.__CANCEL__);var U=(t,e,r)=>("GET"===r.method||"HEAD"===r.method)&&(t.isNetworkError||!1);function P(t){return 100*Math.pow(2,t)+100*Math.random()}let D=(t={})=>(t=>{let e=t.maxRetries||5,r=t.retryDelay||P,n=t.shouldRetry;return{onError:(t,s)=>{var i;let o=s.options,a=o.maxRetries||e,u=o.retryDelay||r,c=o.shouldRetry||n,l=o.attemptNumber||0;if(null!==(i=o.body)&&"object"==typeof i&&"function"==typeof i.pipe||!c(t,l,o)||l>=a)return t;let h=Object.assign({},s,{options:Object.assign({},o,{attemptNumber:l+1})});return setTimeout(()=>s.channels.request.publish(h),u(l)),null}}})({shouldRetry:U,...t});D.shouldRetry=U;var M=r(47279),N=r(59176),B=r(32150),F=r(71317),L=r(36806),z=r(92036),V=r(83967),H=r(12260),J=r(87463),W=r(49400),X=r(77013),Y=r(81086),G=r(8373),K=r(90346),Q=r(28983),Z=r(70560),tt=r(40065),te=r(31190),tr=r(26125),tn=r(60758),ts=r(6476),ti=r(9262),to=r(64482),ta=r(40278),tu=r(7690),tc=r(26019),tl=r(6274);function th(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=(0,tl.ms)(t);return r?(0,tc.F)(th.apply(void 0,(0,ts.fX)([],(0,ts.zs)(t))),(0,tu.I)(r)):(0,to.N)(function(e,r){(0,ti.P)((0,ts.fX)([e],(0,ts.zs)((0,ta.K)(t))))(r)})}var tf=r(30070),tp=r(65239),td=r(37354);class ty extends Error{response;statusCode=400;responseBody;details;constructor(t){let e=tv(t);super(e.message),Object.assign(this,e)}}class tg extends Error{response;statusCode=500;responseBody;details;constructor(t){let e=tv(t);super(e.message),Object.assign(this,e)}}function tv(t){let e=t.body,r={response:t,statusCode:t.statusCode,responseBody:-1!==(t.headers["content-type"]||"").toLowerCase().indexOf("application/json")?JSON.stringify(e,null,2):e,message:"",details:void 0};if(e.error&&e.message)return r.message=`${e.error} - ${e.message}`,r;if(tm(e)&&tm(e.error)&&"mutationError"===e.error.type&&"string"==typeof e.error.description||tm(e)&&tm(e.error)&&"actionError"===e.error.type&&"string"==typeof e.error.description){let t=e.error.items||[],n=t.slice(0,5).map(t=>t.error?.description).filter(Boolean),s=n.length?`: 6- ${n.join(` 7- `)}`:"";return t.length>5&&(s+=` 8...and ${t.length-5} more`),r.message=`${e.error.description}${s}`,r.details=e.error,r}return e.error&&e.error.description?(r.message=e.error.description,r.details=e.error):r.message=e.error||e.message||function(t){let e=t.statusMessage?` ${t.statusMessage}`:"";return`${t.method}-request to ${t.url} resulted in HTTP ${t.statusCode}${e}`}(t),r}function tm(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}class tb extends Error{projectId;addOriginUrl;constructor({projectId:t}){super("CorsOriginError"),this.name="CorsOriginError",this.projectId=t;let e=new URL(`https://sanity.io/manage/project/${t}/api`);if("u">typeof location){let{origin:t}=location;e.searchParams.set("cors","add"),e.searchParams.set("origin",t),this.addOriginUrl=e,this.message=`The current origin is not allowed to connect to the Live Content API. Add it here: ${e}`}
8else this.message=`The current origin is not allowed to connect to the Live Content API. Change your configuration here: ${e}`}}let tw={onResponse:t=>{if(t.statusCode>=500)throw new tg(t);if(t.statusCode>=400)throw new ty(t);return t}};function t_(t){return m([D({shouldRetry:tE}),...t,function(){let t={};return{onResponse:e=>{let r=e.headers["x-sanity-warning"];for(let e of Array.isArray(r)?r:[r])!e||t[e]||(t[e]=!0,console.warn(e));return e}}}(),{processOptions:t=>{let e=t.body;return!e||"function"==typeof e.pipe||I(e)||-1===q.indexOf(typeof e)&&!Array.isArray(e)&&!function(t){if(!1===R(t))return!1;let e=t.constructor;if(void 0===e)return!0;let r=e.prototype;return!(!1===R(r)||!1===r.hasOwnProperty("isPrototypeOf"))}(e)?t:Object.assign({},t,{body:JSON.stringify(t.body),headers:Object.assign({},t.headers,{"Content-Type":"application/json"})})}},{onResponse:t=>{let e=t.headers["content-type"]||"",r=-1!==e.indexOf("application/json");return t.body&&e&&r?Object.assign({},t,{body:function(t){try{return JSON.parse(t)}catch(t){throw t.message=`Failed to parsed response body as JSON: ${t.message}`,t}}(t.body)}):t},processOptions:t=>Object.assign({},t,{headers:Object.assign({Accept:"application/json"},t.headers)})},{onRequest:t=>{if("xhr"!==t.adapter)return;let e=t.request,r=t.context;function n(t){return e=>{let n=e.lengthComputable?e.loaded/e.total*100:-1;r.channels.progress.publish({stage:t,percent:n,total:e.total,loaded:e.loaded,lengthComputable:e.lengthComputable})}}"upload"in e&&"onprogress"in e.upload&&(e.upload.onprogress=n("upload")),"onprogress"in e&&(e.onprogress=n("download"))}},tw,function(t={}){let e=t.implementation||$.Observable;if(!e)throw Error("`Observable` is not available in global scope, and no implementation was passed");return{onReturn:(t,r)=>new e(e=>(t.error.subscribe(t=>e.error(t)),t.progress.subscribe(t=>e.next(Object.assign({type:"progress"},t))),t.response.subscribe(t=>{e.next(Object.assign({type:"response"},t)),e.complete()}),t.request.publish(r),()=>t.abort.publish()))}}({implementation:M.c})])}function tE(t,e,r){if(0===r.maxRetries)return!1;let n="GET"===r.method||"HEAD"===r.method,s=(r.uri||r.url).startsWith("/data/query"),i=t.response&&(429===t.response.statusCode||502===t.response.statusCode||503===t.response.statusCode);return(!!n||!!s)&&!!i||D.shouldRetry(t,e,r)}function tx(t){return"https://www.sanity.io/help/"+t}let tS=["image","file"],tT=["before","after","replace"],tC=t=>{if(!/^(~[a-z0-9]{1}[-\w]{0,63}|[a-z0-9]{1}[-\w]{0,63})$/.test(t))throw Error("Datasets can only contain lowercase characters, numbers, underscores and dashes, and start with tilde, and be maximum 64 characters")},tI=t=>{if(!/^[-a-z0-9]+$/i.test(t))throw Error("`projectId` can only contain only a-z, 0-9 and dashes")},tR=t=>{if(-1===tS.indexOf(t))throw Error(`Invalid asset type: ${t}. Must be one of ${tS.join(", ")}`)},tq=(t,e)=>{if(null===e||"object"!=typeof e||Array.isArray(e))throw Error(`${t}() takes an object of properties`)},tA=(t,e)=>{if("string"!=typeof e||!/^[a-z0-9_][a-z0-9_.-]{0,127}$/i.test(e)||e.includes(".."))throw Error(`${t}(): "${e}" is not a valid document ID`)},t$=(t,e)=>{if(!e._id)throw Error(`${t}() requires that the document contains an ID ("_id" property)`);tA(t,e._id)},tO=(t,e)=>{if("string"!=typeof e)throw Error(`\`${t}()\`: \`${e}\` is not a valid document type`)},tk=(t,e)=>{if(!e._type)throw Error(`\`${t}()\` requires that the document contains a type (\`_type\` property)`);tO(t,e._type)},tj=(t,e)=>{if(e._id&&e._id!==t)throw Error(`The provided document ID (\`${e._id}\`) does not match the generated version ID (\`${t}\`)`)},tU=(t,e,r)=>{let n="insert(at, selector, items)";if(-1===tT.indexOf(t)){let t=tT.map(t=>`"${t}"`).join(", ");throw Error(`${n} takes an "at"-argument which is one of: ${t}`)}if("string"!=typeof e)throw Error(`${n} takes a "selector"-argument which must be a string`);if(!Array.isArray(r))throw Error(`${n} takes an "items"-argument which must be an array`)},tP=t=>{if(!t.dataset)throw Error("`dataset` must be provided to perform queries");return t.dataset||""},tD=t=>{if("string"!=typeof t||!/^[a-z0-9._-]{1,75}$/i.test(t))throw Error("Tag can only contain alphanumeric characters, underscores, dashes and dots, and be between one and 75 characters long.");return t},tM=t=>{if(!t["~experimental_resource"])throw Error("`resource` must be provided to perform resource queries");let{type:e,id:r}=t["~experimental_resource"];switch(e){case"dataset":if(2!==r.split(".").length)throw Error('Dataset resource ID must be in the format "project.dataset"');return;case"dashboard":case"media-library":case"canvas":return;default:throw Error(`Unsupported resource type: ${e.toString()}`)}},tN=(t,e)=>{if(e["~experimental_resource"])throw Error(`\`${t}\` does not support resource-based operations`)},tB=t=>(function(t){let e=!1,r;return(...n)=>(e||(r=t(...n),e=!0),r)})((...e)=>console.warn(t.join(" "),...e)),tF=tB(["Because you set `withCredentials` to true, we will override your `useCdn`","setting to be false since (cookie-based) credentials are never set on the CDN"]),tL=tB(["Since you haven't set a value for `useCdn`, we will deliver content using our","global, edge-cached API-CDN. If you wish to have content delivered faster, set","`useCdn: false` to use the Live API. Note: You may incur higher costs using the live API."]),tz=tB(["The Sanity client is configured with the `perspective` set to `drafts` or `previewDrafts`, which doesn't support the API-CDN.","The Live API will be used instead. Set `useCdn: false` in your configuration to hide this warning."]),tV=tB(["The `previewDrafts` perspective has been renamed to `drafts` and will be removed in a future API version"]),tH=tB(["You have configured Sanity client to use a token in the browser. This may cause unintentional security issues.",`See ${tx("js-cl
8ient-browser-token")} for more information and how to hide this warning.`]),tJ=tB(["You have configured Sanity client to use a token, but also provided `withCredentials: true`.","This is no longer supported - only token will be used - remove `withCredentials: true`."]),tW=tB(["Using the Sanity client without specifying an API version is deprecated.",`See ${tx("js-client-api-version")}`]),tX=(tB(["The default export of @sanity/client has been deprecated. Use the named export `createClient` instead."]),{apiHost:"https://api.sanity.io",apiVersion:"1",useProjectHostname:!0,stega:{enabled:!1}}),tY=["localhost","127.0.0.1","0.0.0.0"],tG=t=>-1!==tY.indexOf(t);function tK(t){if(Array.isArray(t)&&t.length>1&&t.includes("raw"))throw TypeError('Invalid API perspective value: "raw". The raw-perspective can not be combined with other perspectives')}let tQ=(t,e)=>{let r={...e,...t,stega:{..."boolean"==typeof e.stega?{enabled:e.stega}:e.stega||tX.stega,..."boolean"==typeof t.stega?{enabled:t.stega}:t.stega||{}}};r.apiVersion||tW();let n={...tX,...r},s=n.useProjectHostname&&!n["~experimental_resource"];if(typeof Promise>"u"){let t=tx("js-client-promise-polyfill");throw Error(`No native Promise-implementation found, polyfill needed - see ${t}`)}if(s&&!n.projectId)throw Error("Configuration must contain `projectId`");if(n["~experimental_resource"]&&tM(n),"u">typeof n.perspective&&tK(n.perspective),"encodeSourceMap"in n)throw Error("It looks like you're using options meant for '@sanity/preview-kit/client'. 'encodeSourceMap' is not supported in '@sanity/client'. Did you mean 'stega.enabled'?");if("encodeSourceMapAtPath"in n)throw Error("It looks like you're using options meant for '@sanity/preview-kit/client'. 'encodeSourceMapAtPath' is not supported in '@sanity/client'. Did you mean 'stega.filter'?");if("boolean"!=typeof n.stega.enabled)throw Error(`stega.enabled must be a boolean, received ${n.stega.enabled}`);if(n.stega.enabled&&void 0===n.stega.studioUrl)throw Error("stega.studioUrl must be defined when stega.enabled is true");if(n.stega.enabled&&"string"!=typeof n.stega.studioUrl&&"function"!=typeof n.stega.studioUrl)throw Error(`stega.studioUrl must be a string or a function, received ${n.stega.studioUrl}`);let i="u">typeof window&&window.location&&window.location.hostname,o=i&&tG(window.location.hostname),a=!!n.token;n.withCredentials&&a&&(tJ(),n.withCredentials=!1),i&&o&&a&&!0!==n.ignoreBrowserTokenWarning?tH():typeof n.useCdn>"u"&&tL(),s&&tI(n.projectId),n.dataset&&tC(n.dataset),"requestTagPrefix"in n&&(n.requestTagPrefix=n.requestTagPrefix?tD(n.requestTagPrefix).replace(/\.+$/,""):void 0),n.apiVersion=`${n.apiVersion}`.replace(/^v/,""),n.isDefaultApi=n.apiHost===tX.apiHost,!0===n.useCdn&&n.withCredentials&&tF(),n.useCdn=!1!==n.useCdn&&!n.withCredentials,function(t){if("1"===t||"X"===t)return;let e=new Date(t);if(!(/^\d{4}-\d{2}-\d{2}$/.test(t)&&e instanceof Date&&e.getTime()>0))throw Error("Invalid API version string, expected `1` or date in format `YYYY-MM-DD`")}(n.apiVersion);let u=n.apiHost.split("://",2),c=u[0],l=u[1],h=n.isDefaultApi?"apicdn.sanity.io":l;return s?(n.url=`${c}://${n.projectId}.${l}/v${n.apiVersion}`,n.cdnUrl=`${c}://${n.projectId}.${h}/v${n.apiVersion}`):(n.url=`${n.apiHost}/v${n.apiVersion}`,n.cdnUrl=n.url),n};
8class tZ extends Error{name="ConnectionFailedError"}class t0 extends Error{name="DisconnectError";reason;constructor(t,e,r={}){super(t,r),this.reason=e}}class t1 extends Error{name="ChannelError";data;constructor(t,e){super(t),this.data=e}}class t2 extends Error{name="MessageError";data;constructor(t,e,r={}){super(t,r),this.data=e}}class t6 extends Error{name="MessageParseError"}let t3=["channelError","disconnect"];function t8(t,e){return(0,N.v)(()=>{let e=t();return(0,B.A)(e)?e:(0,F.of)(e)}).pipe((0,L.Z)(t=>new M.c(r=>{let n=e.includes("open"),s=e.includes("reconnect");function i(e){if("data"in e){let[t,n]=t5(e);r.error(t?new t6("Unable to parse EventSource error message",{cause:n}):new t2((n?.data).message,n));return}t.readyState===t.CLOSED?r.error(new tZ("EventSource connection failed")):s&&r.next({type:"reconnect"})}function o(){r.next({type:"open"})}function a(t){let[e,n]=t5(t);if(e){r.error(new t6("Unable to parse EventSource message",{cause:e}));return}if("channelError"===t.type){var s;r.error(new t1((s=n?.data).error?s.error.description?s.error.description:"string"==typeof s.error?s.error:JSON.stringify(s.error,null,2):s.message||"Unknown listener error",n.data));return}if("disconnect"===t.type){r.error(new t0(`Server disconnected client: ${n.data?.reason||"unknown error"}`));return}r.next({type:t.type,id:t.lastEventId,...n.data?{data:n.data}:{}})}t.addEventListener("error",i),n&&t.addEventListener("open",o);let u=[...new Set([...t3,...e])].filter(t=>"error"!==t&&"open"!==t&&"reconnect"!==t);return u.forEach(e=>t.addEventListener(e,a)),()=>{t.removeEventListener("error",i),n&&t.removeEventListener("open",o),u.forEach(e=>t.removeEventListener(e,a)),t.close()}})))}function t5(t){try{let e="string"==typeof t.data&&JSON.parse(t.data);return[null,{type:t.type,id:t.lastEventId,...!function(t){for(let e in t)return!1;return!0}(e)?{data:e}:{}}]}catch(t){return[t,null]}}function t4(t){if("string"==typeof t)return{id:t};if(Array.isArray(t))return{query:"*[_id in $ids]",params:{ids:t}};if("object"==typeof t&&null!==t&&"query"in t&&"string"==typeof t.query)return"params"in t&&"object"==typeof t.params&&null!==t.params?{query:t.query,params:t.params}:{query:t.query};let e=["* Document ID (<docId>)","* Array of document IDs","* Object containing `query`"].join(` 9`);throw Error(`Unknown selection - must be one of: 10 11${e}`)}class t9{selection;operations;constructor(t,e={}){this.selection=t,this.operations=e}set(t){return this._assign("set",t)}setIfMissing(t){return this._assign("setIfMissing",t)}diffMatchPatch(t){return tq("diffMatchPatch",t),this._assign("diffMatchPatch",t)}unset(t){if(!Array.isArray(t))throw Error("unset(attrs) takes an array of attributes to unset, non-array given");return this.operations=Object.assign({},this.operations,{unset:t}),this}inc(t){return this._assign("inc",t)}dec(t){return this._assign("dec",t)}insert(t,e,r){return tU(t,e,r),this._assign("insert",{[t]:e,items:r})}append(t,e){return this.insert("after",`${t}[-1]`,e)}prepend(t,e){return this.insert("before",`${t}[0]`,e)}splice(t,e,r,n){let s=e<0?e-1:e,i=typeof r>"u"||-1===r?-1:Math.max(0,e+r),o=`${t}[${s}:${s<0&&i>=0?"":i}]`;return this.insert("replace",o,n||[])}ifRevisionId(t){return this.operations.ifRevisionID=t,this}serialize(){return{...t4(this.selection),...this.operations}}toJSON(){return this.serialize()}reset(){return this.operations={},this}_assign(t,e,r=!0){return tq(t,e),this.operations=Object.assign({},this.operations,{[t]:Object.assign({},r&&this.operations[t]||{},e)}),this}_set(t,e){return this._assign(t,e,!1)}}class t7 extends t9{#a;constructor(t,e,r){super(t,e),this.#a=r}clone(){return new t7(this.selection,{...this.operations},this.#a)}commit(t){if(!this.#a)throw Error("No `client` passed to patch, either provide one or pass the patch to a clients `mutate()` method");let e=Object.assign({returnFirst:"string"==typeof this.selection,returnDocuments:!0},t);return this.#a.mutate({patch:this.serialize()},e)}}class et extends t9{#a;constructor(t,e,r){super(t,e),this.#a=r}clone(){return new et(this.selection,{...this.operations},this.#a)}commit(t){if(!this.#a)throw Error("No `client` passed to patch, either provide one or pass the patch to a clients `mutate()` method");let e=Object.assign({returnFirst:"string"==typeof this.selection,returnDocuments:!0},t);return this.#a.mutate({patch:this.serialize()},e)}}let ee={returnDocuments:!1};class er{operations;trxId;constructor(t=[],e){this.operations=t,this.trxId=e}create(t){return tq("create",t),this._add({create:t})}createIfNotExists(t){let e="createIfNotExists";return tq(e,t),t$(e,t),this._add({[e]:t})}createOrReplace(t){let e="createOrReplace";return tq(e,t),t$(e,t),this._add({[e]:t})}delete(t){return tA("delete",t),this._add({delete:{id:t}})}transactionId(t){return t?(this.trxId=t,this):this.trxId}serialize(){return[...this.operations]}toJSON(){return this.serialize()}reset(){return this.operations=[],this}_add(t){return this.operations.push(t),this}}class en extends er{#a;constructor(t,e,r){super(t,r),this.#a=e}clone(){return new en([...this.operations],this.#a,this.trxId)}commit(t){if(!this.#a)throw Error("No `client` passed to transaction, either provide one or pass the transaction to a clients `mutate()` method");return this.#a.mutate(this.serialize(),Object.assign({transactionId:this.trxId},ee,t||{}))}patch(t,e){let r="function"==typeof e,n="string"!=typeof t&&t instanceof et,s="object"==typeof t&&("query"in t||"id"in t);if(n)return this._add({patch:t.serialize()});if(r){let r=e(new et(t,{},this.#a));if(!(r instanceof et))throw Error("function passed to `patch()` must return the patch");return this._add({patch:r.serialize()})}if(s){let r=new et(t,e||{},this.#a);return this._add({patch:r.serialize()})}return this._add({patch:{id:t,...e}})}}class es extends er{#a;constructor(t,e,r){super(t,r),this.#a=e}clone(){return new es([...this.operations],this.#a,this.trxId)}commit(t){if(!this.#a)throw Error("No `client` passed to transaction, either provide one or pass the transaction to a clients `mutate()` method");return this.#a.mutate(this.serialize(),Object.assign({transactionId:this.trxId},ee,t||{}))}patch(t,e){let r="function"==typeof e;if("string"!=typeof t&&t instanceof t7)return this._add({patch:t.serialize()});if(r){let r=e(new t7(t,{},this.#a));if(!(r instanceof t7))throw Error("function passed to `patch()` must return the patch");return this._add({patch:r.serialize()})}return this._add({patch:{id:t,...e}})}}let ei=({query:t,params:e={},options:r={}})=>{let n=new URLSearchParams,{tag:s,includeMutations:i,returnQuery:o,...a}=r;for(let[r,i]of(s&&n.append("tag",s),n.append("query",t),Object.entries(e)))n.append(`$${r}`,JSON.stringify(i));for(let[t,e]of Object.entries(a))e&&n.append(t,`${e}`);return!1===o&&n.append("returnQuery","false"),!1===i&&n.append("includeMutations","fal
11se"),`?${n}`},eo=(t,e)=>!1===t?void 0:typeof t>"u"?e:t,ea=(t={})=>({dryRun:t.dryRun,returnIds:!0,returnDocuments:eo(t.returnDocuments,!0),visibility:t.visibility||"sync",autoGenerateArrayKeys:t.autoGenerateArrayKeys,skipCrossDatasetReferenceValidation:t.skipCrossDatasetReferenceValidation}),eu=t=>"response"===t.type,ec=t=>t.body,el=(t,e)=>t.reduce((t,r)=>(t[e(r)]=r,t),Object.create(null));function eh(t,e,n,s,i={},o={}){let a="stega"in o?{...n||{},..."boolean"==typeof o.stega?{enabled:o.stega}:o.stega||{}}:n,u=a.enabled?(0,tn.Q)(i):i,c=!1===o.filterResponse?t=>t:t=>t.result,{cache:l,next:h,...f}={useAbortSignal:"u">typeof o.signal,resultSourceMap:a.enabled?"withKeyArraySelector":o.resultSourceMap,...o,returnQuery:!1===o.filterResponse&&!1!==o.returnQuery},p=eS(t,e,"query",{query:s,params:u},"u">typeof l||"u">typeof h?{...f,fetch:{cache:l,next:h}}:f);return a.enabled?p.pipe(function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return th.apply(void 0,(0,ts.fX)([],(0,ts.zs)(t)))}((0,z.H)(r.e(4836).then(r.bind(r,24836)).then(function(t){return t.stegaEncodeSourceMap$1}).then(({stegaEncodeSourceMap:t})=>t))),(0,te.T)(([t,e])=>{let r=e(t.result,t.resultSourceMap,a);return c({...t,result:r})})):p.pipe((0,te.T)(c))}function ef(t,e,r,n={}){let s={uri:eU(t,"doc",(()=>{if(!n.releaseId)return r;let t=(0,tp._S)(r);if(!t){if((0,tp.R8)(r))throw Error(`The document ID (\`${r}\`) is a draft, but \`options.releaseId\` is set as \`${n.releaseId}\``);return(0,tp.ct)(r,n.releaseId)}if(t!==n.releaseId)throw Error(`The document ID (\`${r}\`) is already a version of \`${t}\` release, but this does not match the provided \`options.releaseId\` (\`${n.releaseId}\`)`);return r})()),json:!0,tag:n.tag,signal:n.signal};return ek(t,e,s).pipe((0,tf.p)(eu),(0,te.T)(t=>t.body.documents&&t.body.documents[0]))}function ep(t,e,r,n={}){let s={uri:eU(t,"doc",r.join(",")),json:!0,tag:n.tag,signal:n.signal};return ek(t,e,s).pipe((0,tf.p)(eu),(0,te.T)(t=>{let e=el(t.body.documents||[],t=>t._id);return r.map(t=>e[t]||null)}))}function ed(t,e,r,n={}){return eS(t,e,"query",{query:"*[sanity::partOfRelease($releaseId)]",params:{releaseId:r}},n)}function ey(t,e,r,n){return t$("createIfNotExists",r),eT(t,e,r,"createIfNotExists",n)}function eg(t,e,r,n){return t$("createOrReplace",r),eT(t,e,r,"createOrReplace",n)}function ev(t,e,r,n,s){return t$("createVersion",r),tk("createVersion",r),ex(t,e,{actionType:"sanity.action.document.version.create",publishedId:n,document:r},s)}function em(t,e,r,n){return eS(t,e,"mutate",{mutations:[{delete:t4(r)}]},n)}function eb(t,e,r,n=!1,s){return ex(t,e,{actionType:"sanity.action.document.version.discard",versionId:r,purge:n},s)}function ew(t,e,r,n){return t$("replaceVersion",r),tk("replaceVersion",r),ex(t,e,{actionType:"sanity.action.document.version.replace",document:r},n)}function e_(t,e,r,n,s){return ex(t,e,{actionType:"sanity.action.document.version.unpublish",versionId:r,publishedId:n},s)}function eE(t,e,r,n){let s;return eS(t,e,"mutate",{mutations:Array.isArray(s=r instanceof et||r instanceof t7?{patch:r.serialize()}:r instanceof en||r instanceof es?r.serialize():r)?s:[s],transactionId:n&&n.transactionId||void 0},n)}function ex(t,e,r,n){let s=Array.isArray(r)?r:[r];return eS(t,e,"actions",{actions:s,transactionId:n&&n.transactionId||void 0,skipCrossDatasetReferenceValidation:n&&n.skipCrossDatasetReferenceValidation||void 0,dryRun:n&&n.dryRun||void 0},n)}function eS(t,e,r,n,s={}){let i="mutate"===r,o="actions"===r,a=i||o?"":ei(n),u=!i&&!o&&a.length<11264,c=u?a:"",l=s.returnFirst,{timeout:h,token:f,tag:p,headers:d,returnQuery:y,lastLiveEventId:g,cacheMode:v}=s,m={method:u?"GET":"POST",uri:eU(t,r,c),json:!0,body:u?void 0:n,query:i&&ea(s),timeout:h,headers:d,token:f,tag:p,returnQuery:y,perspective:s.perspective,resultSourceMap:s.resultSourceMap,lastLiveEventId:Array.isArray(g)?g[0]:g,cacheMode:v,canUseCdn:"query"===r,signal:s.signal,fetch:s.fetch,useAbortSignal:s.useAbortSignal,useCdn:s.useCdn};return ek(t,e,m).pipe((0,tf.p)(eu),(0,te.T)(ec),(0,te.T)(t=>{if(!i)return t;let e=t.results||[];if(s.returnDocuments)return l?e[0]&&e[0].document:e.map(t=>t.document);let r=l?e[0]&&e[0].id:e.map(t=>
11t.id);return{transactionId:t.transactionId,results:e,[l?"documentId":"documentIds"]:r}}))}function eT(t,e,r,n,s={}){return eS(t,e,"mutate",{mutations:[{[n]:r}]},Object.assign({returnFirst:!0,returnDocuments:!0},s))}let eC=t=>void 0!==t.config().dataset&&void 0!==t.config().projectId||void 0!==t.config()["~experimental_resource"],eI=(t,e)=>eC(t)&&e.startsWith(eU(t,"query")),eR=(t,e)=>eC(t)&&e.startsWith(eU(t,"mutate")),eq=(t,e)=>eC(t)&&e.startsWith(eU(t,"doc","")),eA=(t,e)=>eC(t)&&e.startsWith(eU(t,"listen")),e$=(t,e)=>eC(t)&&e.startsWith(eU(t,"history","")),eO=(t,e)=>e.startsWith("/data/")||eI(t,e)||eR(t,e)||eq(t,e)||eA(t,e)||e$(t,e);function ek(t,e,r){var n;let s=r.url||r.uri,i=t.config(),o=typeof r.canUseCdn>"u"?["GET","HEAD"].indexOf(r.method||"GET")>=0&&eO(t,s):r.canUseCdn,a=(r.useCdn??i.useCdn)&&o,u=r.tag&&i.requestTagPrefix?[i.requestTagPrefix,r.tag].join("."):r.tag||i.requestTagPrefix;if(u&&null!==r.tag&&(r.query={tag:tD(u),...r.query}),["GET","HEAD","POST"].indexOf(r.method||"GET")>=0&&eI(t,s)){let t=r.resultSourceMap??i.resultSourceMap;void 0!==t&&!1!==t&&(r.query={resultSourceMap:t,...r.query});let e=r.perspective||i.perspective;"u">typeof e&&("previewDrafts"===e&&tV(),tK(e),r.query={perspective:Array.isArray(e)?e.join(","):e,...r.query},(Array.isArray(e)&&e.length>0||"previewDrafts"===e||"drafts"===e)&&a&&(a=!1,tz())),r.lastLiveEventId&&(r.query={...r.query,lastLiveEventId:r.lastLiveEventId}),!1===r.returnQuery&&(r.query={returnQuery:"false",...r.query}),a&&"noStale"==r.cacheMode&&(r.query={cacheMode:"noStale",...r.query})}let c=function(t,e={}){let r={};t.headers&&Object.assign(r,t.headers);let n=e.token||t.token;n&&(r.Authorization=`Bearer ${n}`),e.useGlobalApi||t.useProjectHostname||!t.projectId||(r["X-Sanity-Project-ID"]=t.projectId);let s=!!(typeof e.withCredentials>"u"?t.withCredentials:e.withCredentials),i=typeof e.timeout>"u"?t.timeout:e.timeout;return Object.assign({},e,{headers:Object.assign({},r,e.headers||{}),timeout:typeof i>"u"?3e5:i,proxy:e.proxy||t.proxy,json:!0,withCredentials:s,fetch:"object"==typeof e.fetch&&"object"==typeof t.fetch?{...t.fetch,...e.fetch}:e.fetch||t.fetch})}(i,Object.assign({},r,{url:eP(t,s,a)})),l=new M.c(t=>e(c,i.requester).subscribe(t));return r.signal?l.pipe((n=r.signal,t=>new M.c(e=>{let r=()=>e.error(function(t){if(eD)return new DOMException(t?.reason??"The operation was aborted.","AbortError");let e=Error(t?.reason??"The operation was aborted.");return e.name="AbortError",e}(n));if(n&&n.aborted){r();return}let s=t.subscribe(e);return n.addEventListener("abort",r),()=>{n.removeEventListener("abort",r),s.unsubscribe()}}))):l}function ej(t,e,r){return ek(t,e,r).pipe((0,tf.p)(t=>"response"===t.type),(0,te.T)(t=>t.body))}function eU(t,e,r){let n=t.config();if(n["~experimental_resource"]){tM(n);let t=eM(n),s=void 0!==r?`${e}/${r}`:e;return`${t}/${s}`.replace(/\/($|\?)/,"$1")}let s=tP(n),i=`/${e}/${s}`;return`/data${void 0!==r?`${i}/${r}`:i}`.replace(/\/($|\?)/,"$1")}function eP(t,e,r=!1){let{url:n,cdnUrl:s}=t.config();return`${r?s:n}/${e.replace(/^\//,"")}`}let eD=!!globalThis.DOMException,eM=t=>{if(!t["~experimental_resource"])throw Error("`resource` must be provided to perform resource queries");let{type:e,id:r}=t["~experimental_resource"];switch(e){case"dataset":{let t=r.split(".");if(2!==t.length)throw Error('Dataset ID must be in the format "project.dataset"');return`/projects/${t[0]}/datasets/${t[1]}`}case"canvas":return`/canvases/${r}`;case"media-library":return`/media-libraries/${r}`;case"dashboard":return`/dashboards/${r}`;default:throw Error(`Unsupported resource type: ${e.toString()}`)}};function eN(t,e,r){let n=tP(t.config());return ej(t,e,{method:"POST",uri:`/agent/action/generate/${n}`,body:r})}function eB(t,e,r){let n=tP(t.config());return ej(t,e,{method:"POST",uri:`/agent/action/transform/${n}`,body:r})}function eF(t,e,r){let n=tP(t.config());return ej(t,e,{method:"POST",uri:`/agent/action/translate/${n}`,body:r})}class eL{#a;#u;constructor(t,e){this.#a=t,this.#u=e}generate(t){return eN(this.#a,this.#u,t)}transform(t){return eB(this.#a,this.#u,t)}translate(t){return eF(this.#a,this.#u,t)}}class ez{#a;#u;constructor(t,e){this.#a=t,this.#u=e}generate(t){return(0,V.s)(eN(this.#a,this.#u,t))}transform(t){return(0,V.s)(eB(this.#a,this.#u,t))}translate(t){return(0,V.s)(eF(this.#a,this.#u,t))}}class eV{#a;#u;
11constructor(t,e){this.#a=t,this.#u=e}upload(t,e,r){return eJ(this.#a,this.#u,t,e,r)}}class eH{#a;#u;constructor(t,e){this.#a=t,this.#u=e}upload(t,e,r){let n=eJ(this.#a,this.#u,t,e,r);return(0,V.s)(n.pipe((0,tf.p)(t=>"response"===t.type),(0,te.T)(t=>t.body.document)))}}function eJ(t,e,r,n,s={}){tR(r);let i=s.extract||void 0;i&&!i.length&&(i=["none"]);let o=t.config(),a=!(typeof File>"u")&&n instanceof File?Object.assign({filename:!1===s.preserveFilename?void 0:n.name,contentType:n.type},s):s,{tag:u,label:c,title:l,description:h,creditLine:f,filename:p,source:d}=a,y={label:c,title:l,description:h,filename:p,meta:i,creditLine:f};return d&&(y.sourceId=d.id,y.sourceName=d.name,y.sourceUrl=d.url),ek(t,e,{tag:u,method:"POST",timeout:a.timeout||0,uri:function(t,e){let r="image"===e?"images":"files";if(t["~experimental_resource"]){let{type:e,id:n}=t["~experimental_resource"];switch(e){case"dataset":throw Error("Assets are not supported for dataset resources, yet. Configure the client with `{projectId: <projectId>, dataset: <datasetId>}` instead.");case"canvas":return`/canvases/${n}/assets/${r}`;case"media-library":return`/media-libraries/${n}/upload`;case"dashboard":return`/dashboards/${n}/assets/${r}`;default:throw Error(`Unsupported resource type: ${e.toString()}`)}}let n=tP(t);return`assets/${r}/${n}`}(o,r),headers:a.contentType?{"Content-Type":a.contentType}:{},query:y,body:n})}var eW=(t,e)=>Object.keys(e).concat(Object.keys(t)).reduce((r,n)=>(r[n]=typeof t[n]>"u"?e[n]:t[n],r),{});let eX=(t,e)=>e.reduce((e,r)=>(typeof t[r]>"u"||(e[r]=t[r]),e),{}),eY=(0,N.v)(()=>r.e(2805).then(r.t.bind(r,62805,19))).pipe((0,te.T)(({default:t})=>t),(0,H.t)(1));function eG(){return function(t){return t.pipe((0,J.W)((t,e)=>t instanceof tZ?(0,W.x)((0,F.of)({type:"reconnect"}),(0,X.O)(1e3).pipe((0,L.Z)(()=>e))):(0,Y.$)(()=>t)))}}let eK=["includePreviousRevision","includeResult","includeMutations","includeAllVersions","visibility","effectFormat","tag"],eQ={includeResult:!0};function eZ(t,e,r={}){let{url:n,token:s,withCredentials:i,requestTagPrefix:o}=this.config(),a=r.tag&&o?[o,r.tag].join("."):r.tag,u={...eW(r,eQ),tag:a},c=ei({query:t,params:e,options:{tag:a,...eX(u,eK)}}),l=`${n}${eU(this,"listen",c)}`;if(l.length>14800)return(0,Y.$)(()=>Error("Query too large for listener"));let h=u.events?u.events:["mutation"],f={};return i&&(f.withCredentials=!0),s&&(f.headers={Authorization:`Bearer ${s}`}),t8(()=>(typeof EventSource>"u"||f.headers?eY:(0,F.of)(EventSource)).pipe((0,te.T)(t=>new t(l,f))),h).pipe(eG(),(0,tf.p)(t=>h.includes(t.type)),(0,te.T)(t=>({type:t.type,..."data"in t?t.data:{}})))}let e0="2021-03-25";class e1{#a;constructor(t){this.#a=t}events({includeDrafts:t=!1,tag:e}={}){var r,n,s;tN("live",this.#a.config());let{projectId:i,apiVersion:o,token:a,withCredentials:u,requestTagPrefix:c}=this.#a.config(),l=o.replace(/^v/,"");if("X"!==l&&l<e0)throw Error(`The live events API requires API version ${e0} or later. The current API version is ${l}. Please update your API version to use this feature.`);if(t&&!a&&!u)throw Error("The live events API requires a token or withCredentials when 'includeDrafts: true'. Please update your client configuration. The token should have the lowest possible access role.");let h=eU(this.#a,"live/events"),f=new URL(this.#a.getUrl(h,!1)),p=e&&c?[c,e].join("."):e;p&&f.searchParams.set("tag",p),t&&f.searchParams.set("includeDrafts","true");let d={};t&&a&&(d.headers={Authorization:`Bearer ${a}`}),t&&u&&(d.withCredentials=!0);let y=`${f.href}::${JSON.stringify(d)}`,g=e2.get(y);if(g)return g;let v=t8(()=>(typeof EventSource>"u"||d.headers?eY:(0,F.of)(EventSource)).pipe((0,te.T)(t=>new t(f.href,d))),["message","restart","welcome","reconnect","goaway"]).pipe(eG(),(0,te.T)(t=>{if("message"===t.type){let{data:e,...r}=t;return{...r,tags:e.tags}}return t})),m=(n={method:"OPTIONS",mode:"cors",credentials:d.withCredentials?"include":"omit",headers:d.headers},new M.c(t=>{let e=new AbortController,r=e.signal;return fetch(f,{...n,signal:e.signal}).then(e=>{t.next(e),t.complete()},e=>{r.aborted||t.error(e)}),()=>e.abort()})).pipe((0,L.Z)(()=>tt.w),(0,J.W)(()=>{throw new tb({projectId:i})})),b=(0,W.x)(m,v).pipe((0,K.j)(()=>e2.delete(y)),(s="function"==typeof(r={predicate:t=>"welcome"===t.type})?{predicate:r}:r,t=>{let e,r=!1,{predicate:n,...i}=s,o=t.pipe((0,G.M)(t=>{s.predicate(t)&&(r=!0,e=t)}),(0,K.j)(()=>{r=!1,e=void 0}),(0,Q.u)(i)),a=new M.c(t=>{r&&t.next(e),t.complete()});return(0,Z.h)(o,a)}));return e2.set(y,b),b}}let e2=new Map;class e6{#a;#u;
11constructor(t,e){this.#a=t,this.#u=e}create(t,e){return e8(this.#a,this.#u,"PUT",t,e)}edit(t,e){return e8(this.#a,this.#u,"PATCH",t,e)}delete(t){return e8(this.#a,this.#u,"DELETE",t)}list(){return ej(this.#a,this.#u,{uri:"/datasets",tag:null})}}class e3{#a;#u;constructor(t,e){this.#a=t,this.#u=e}create(t,e){return tN("dataset",this.#a.config()),(0,V.s)(e8(this.#a,this.#u,"PUT",t,e))}edit(t,e){return tN("dataset",this.#a.config()),(0,V.s)(e8(this.#a,this.#u,"PATCH",t,e))}delete(t){return tN("dataset",this.#a.config()),(0,V.s)(e8(this.#a,this.#u,"DELETE",t))}list(){return tN("dataset",this.#a.config()),(0,V.s)(ej(this.#a,this.#u,{uri:"/datasets",tag:null}))}}function e8(t,e,r,n,s){return tN("dataset",t.config()),tC(n),ej(t,e,{method:r,uri:`/datasets/${n}`,body:s,tag:null})}class e5{#a;#u;constructor(t,e){this.#a=t,this.#u=e}list(t){tN("projects",this.#a.config());let e=t?.includeMembers===!1?"/projects?includeMembers=false":"/projects";return ej(this.#a,this.#u,{uri:e})}getById(t){return tN("projects",this.#a.config()),ej(this.#a,this.#u,{uri:`/projects/${t}`})}}class e4{#a;#u;constructor(t,e){this.#a=t,this.#u=e}list(t){tN("projects",this.#a.config());let e=t?.includeMembers===!1?"/projects?includeMembers=false":"/projects";return(0,V.s)(ej(this.#a,this.#u,{uri:e}))}getById(t){return tN("projects",this.#a.config()),(0,V.s)(ej(this.#a,this.#u,{uri:`/projects/${t}`}))}}let e9=(0,td.d_)("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",8),e7=(t,e)=>e?(0,tp.ct)(t,e):(0,tp.T4)(t);function rt(t,{releaseId:e,publishedId:r,document:n}){if(r&&n._id){let t=e7(r,e);return tj(t,n),t}if(n._id){let r=(0,tp.R8)(n._id),s=(0,tp.A_)(n._id);if(!r&&!s)throw Error(`\`${t}()\` requires a document with an \`_id\` that is a version or draft ID`);if(e){if(r)throw Error(`\`${t}()\` was called with a document ID (\`${n._id}\`) that is a draft ID, but a release ID (\`${e}\`) was also provided.`);let s=(0,tp._S)(n._id);if(s!==e)throw Error(`\`${t}()\` was called with a document ID (\`${n._id}\`) that is a version ID, but the release ID (\`${e}\`) does not match the document's version ID (\`${s}\`).`)}return n._id}if(r)return e7(r,e);throw Error(`\`${t}()\` requires either a publishedId or a document with an \`_id\``)}let re=(t,e)=>{if("object"==typeof t&&null!==t&&("releaseId"in t||"metadata"in t)){let{releaseId:r=e9(),metadata:n={}}=t;return[r,n,e]}return[e9(),{},t]},rr=(t,e)=>{let[r,n,s]=re(t,e);return{action:{actionType:"sanity.action.release.create",releaseId:r,metadata:{...n,releaseType:n.releaseType||"undecided"}},options:s}};class rn{#a;#u;constructor(t,e){this.#a=t,this.#u=e}get({releaseId:t},e){return ef(this.#a,this.#u,`_.releases.${t}`,e)}create(t,e){let{action:r,options:n}=rr(t,e),{releaseId:s,metadata:i}=r;return ex(this.#a,this.#u,r,n).pipe((0,te.T)(t=>({...t,releaseId:s,metadata:i})))}edit({releaseId:t,patch:e},r){return ex(this.#a,this.#u,{actionType:"sanity.action.release.edit",releaseId:t,patch:e},r)}publish({releaseId:t},e){return ex(this.#a,this.#u,{actionType:"sanity.action.release.publish",releaseId:t},e)}archive({releaseId:t},e){return ex(this.#a,this.#u,{actionType:"sanity.action.release.archive",releaseId:t},e)}unarchive({releaseId:t},e){return ex(this.#a,this.#u,{actionType:"sanity.action.release.unarchive",releaseId:t},e)}schedule({releaseId:t,publishAt:e},r){return ex(this.#a,this.#u,{actionType:"sanity.action.release.schedule",releaseId:t,publishAt:e},r)}unschedule({releaseId:t},e){return ex(this.#a,this.#u,{actionType:"sanity.action.release.unschedule",releaseId:t},e)}delete({releaseId:t},e){return ex(this.#a,this.#u,{actionType:"sanity.action.release.delete",releaseId:t},e)}fetchDocuments({releaseId:t},e){return ed(this.#a,this.#u,t,e)}}class rs{#a;#u;constructor(t,e){this.#a=t,this.#u=e}get({releaseId:t},e){return(0,V.s)(ef(this.#a,this.#u,`_.releases.${t}`,e))}async create(t,e){let{action:r,options:n}=rr(t,e),{releaseId:s,metadata:i}=r;return{...await (0,V.s)(ex(this.#a,this.#u,r,n)),releaseId:s,metadata:i}}edit({releaseId:t,patch:e},r){return(0,V.s)(ex(this.#a,this.#u,{actionType:"sanity.action.release.edit",releaseId:t,patch:e},r))}publish({releaseId:t},e){return(0,V.s)(ex(this.#a,this.#u,{actionType:"sanity.action.release.publish",releaseId:t},e))}archive({releaseId:t},e){return(0,V.s)(ex(this.#a,this.#u,{actionType:"sanity.action.release.archive",releaseId:t},e))}unarchive({releaseId:t},e){return(0,V.s)(ex(this.#a,this.#u,{actionType:"sanity.action.release.unarchive",releaseId:t},e))}schedule({releaseId:t,publishAt:e},r){return(0,V.s)(ex(this.#a,this.#u,{actionType:"sanity.action.release.schedule",releaseId:t,publishAt:e},r))}unschedule({releaseId:t},e){return(0,V.s)(ex(this.#a,this.#u,{actionType:"sanity.action.release.unschedule",releaseId:t},e))}delete({releaseId:t},e){return(0,V.s)(ex(this.#a,this.#u,{actionType:"sanity.action.release.delete",releaseId:t},e))}fetchDocuments({releaseId:t},e){return(0,V.s)(ed(this.#a,this.#u,t,e))}}class ri{#a;#u;
11constructor(t,e){this.#a=t,this.#u=e}getById(t){return ej(this.#a,this.#u,{uri:`/users/${t}`})}}class ro{#a;#u;constructor(t,e){this.#a=t,this.#u=e}getById(t){return(0,V.s)(ej(this.#a,this.#u,{uri:`/users/${t}`}))}}class ra{assets;datasets;live;projects;users;agent;releases;#c;#u;listen=eZ;constructor(t,e=tX){this.config(e),this.#u=t,this.assets=new eV(this,this.#u),this.datasets=new e6(this,this.#u),this.live=new e1(this),this.projects=new e5(this,this.#u),this.users=new ri(this,this.#u),this.agent={action:new eL(this,this.#u)},this.releases=new rn(this,this.#u)}clone(){return new ra(this.#u,this.config())}config(t){if(void 0===t)return{...this.#c};if(this.#c&&!1===this.#c.allowReconfigure)throw Error("Existing client instance cannot be reconfigured - use `withConfig(newConfig)` to return a new client");return this.#c=tQ(t,this.#c||{}),this}withConfig(t){let e=this.config();return new ra(this.#u,{...e,...t,stega:{...e.stega||{},..."boolean"==typeof t?.stega?{enabled:t.stega}:t?.stega||{}}})}fetch(t,e,r){return eh(this,this.#u,this.#c.stega,t,e,r)}getDocument(t,e){return ef(this,this.#u,t,e)}getDocuments(t,e){return ep(this,this.#u,t,e)}create(t,e){return eT(this,this.#u,t,"create",e)}createIfNotExists(t,e){return ey(this,this.#u,t,e)}createOrReplace(t,e){return eg(this,this.#u,t,e)}createVersion({document:t,publishedId:e,releaseId:r},n){let s=rt("createVersion",{document:t,publishedId:e,releaseId:r}),i={...t,_id:s},o=e||(0,tp.IM)(t._id);return ev(this,this.#u,i,o,n)}delete(t,e){return em(this,this.#u,t,e)}discardVersion({releaseId:t,publishedId:e},r,n){let s=e7(e,t);return eb(this,this.#u,s,r,n)}replaceVersion({document:t,publishedId:e,releaseId:r},n){let s=rt("replaceVersion",{document:t,publishedId:e,releaseId:r}),i={...t,_id:s};return ew(this,this.#u,i,n)}unpublishVersion({releaseId:t,publishedId:e},r){let n=(0,tp.ct)(e,t);return e_(this,this.#u,n,e,r)}mutate(t,e){return eE(this,this.#u,t,e)}patch(t,e){return new t7(t,e,this)}transaction(t){return new es(t,this)}action(t,e){return ex(this,this.#u,t,e)}request(t){return ej(this,this.#u,t)}getUrl(t,e){return eP(this,t,e)}getDataUrl(t,e){return eU(this,t,e)}}class ru{assets;datasets;live;projects;users;agent;releases;observable;#c;#u;listen=eZ;constructor(t,e=tX){this.config(e),this.#u=t,this.assets=new eH(this,this.#u),this.datasets=new e3(this,this.#u),this.live=new e1(this),this.projects=new e4(this,this.#u),this.users=new ro(this,this.#u),this.agent={action:new ez(this,this.#u)},this.releases=new rs(this,this.#u),this.observable=new ra(t,e)}clone(){return new ru(this.#u,this.config())}config(t){if(void 0===t)return{...this.#c};if(this.#c&&!1===this.#c.allowReconfigure)throw Error("Existing client instance cannot be reconfigured - use `withConfig(newConfig)` to return a new client");return this.observable&&this.observable.config(t),this.#c=tQ(t,this.#c||{}),this}withConfig(t){let e=this.config();return new ru(this.#u,{...e,...t,stega:{...e.stega||{},..."boolean"==typeof t?.stega?{enabled:t.stega}:t?.stega||{}}})}fetch(t,e,r){return(0,V.s)(eh(this,this.#u,this.#c.stega,t,e,r))}getDocument(t,e){return(0,V.s)(ef(this,this.#u,t,e))}getDocuments(t,e){return(0,V.s)(ep(this,this.#u,t,e))}create(t,e){return(0,V.s)(eT(this,this.#u,t,"create",e))}createIfNotExists(t,e){return(0,V.s)(ey(this,this.#u,t,e))}createOrReplace(t,e){return(0,V.s)(eg(this,this.#u,t,e))}createVersion({document:t,publishedId:e,releaseId:r},n){let s=rt("createVersion",{document:t,publishedId:e,releaseId:r}),i={...t,_id:s},o=e||(0,tp.IM)(t._id);return(0,tr._)(ev(this,this.#u,i,o,n))}delete(t,e){return(0,V.s)(em(this,this.#u,t,e))}discardVersion({releaseId:t,publishedId:e},r,n){let s=e7(e,t);return(0,V.s)(eb(this,this.#u,s,r,n))}replaceVersion({document:t,publishedId:e,releaseId:r},n){let s=rt("replaceVersion",{document:t,publishedId:e,releaseId:r}),i={...t,_id:s};return(0,tr._)(ew(this,this.#u,i,n))}unpublishVersion({releaseId:t,publishedId:e},r){let n=(0,tp.ct)(e,t);return(0,V.s)(e_(this,this.#u,n,e,r))}mutate(t,e){return(0,V.s)(eE(this,this.#u,t,e))}patch(t,e){return new et(t,e,this)}transaction(t){return new en(t,this)}action(t,e){return(0,V.s)(ex(this,this.#u,t,e))}request(t){return(0,V.s)(ej(this,this.#u,t))}dataRequest(t,e,r){return(0,V.s)(eS(this,this.#u,t,e,r))}getUrl(t,e){return eP(this,t,e)}getDataUrl(t,e){return eU(this,t,e)}}let rc=function(t,e){return{requester:t_(t),createClient:r=>{let n=t_(t);return new e((t,e)=>(e||n)({maxRedirects:0,maxRetries:r.maxRetries,retryDelay:r.retryDelay,...t}),r)}}}([],ru),rl=(rc.requester,rc.createClient)},36943:(t,e,r)=>{"use strict";r.d(e,{V2:()=>C,FS:()=>q,IM:()=>O,Tx:()=>A,Rr:()=>$,vd:()=>R,_K:()=>I,e3:()=>P,dK:()=>B,CC:()=>T,RM:()=>L,Uc:()=>F,tP:()=>j});var n=r(13697),s=r(8691),i=r(47289),o=r(63915),a=r(18596),u=r(59176),c=r(68072),l=r(31190),h=r(26019),f=r(30070),p=r(6476),d=r(64482),y=r(42894),g=r(62238),v=r(16798),m=r(43591),b=r(40065),w=r(75341);let _=t=>({context:e})=>{let{count:r,include:n,exclude:s,responseType:i="message.received"}=t;return{count:r,domain:e.domain,from:e.connectTo,include:n?Array.isArray(n)?n:[n]:[],exclude:s?Array.isArray(s)?s:[s]:[],responseType:i,target:e.target,to:e.name}},E=t=>e=>{let{data:r}=e;return(!t.include.length||t.include.includes(r.type))&&(!t.exclude.length||!t.exclude.includes(r.type))&&r.domain===t.domain&&r.from===t.from&&r.to===t.to&&(!t.target||e.source===t.target)},x=t=>e=>({type:t,message:e}),S=(0,u.v)(()=>(0,c.R)(window,"message")),T=t=>(0,s.OX)(({input:e})=>S.pipe(t?(0,l.T)(t):(0,h.F)(),(0,f.p)(E(e)),(0,l.T)(x(e.responseType)),e.count?(0,h.F)(function(t,e){return void 0===e&&(e=null),e=null!=e?e:t,(0,d.N)(function(r,n){var s=[],i=0;r.subscribe((0,y._)(n,function(r){var o,a,u,c,l=null;i++%e==0&&s.push([]);try{for(var h=(0,p.Ju)(s),f=h.next();!f.done;f=h.next()){var d=f.value;d.push(r),t<=d.length&&(l=null!=l?l:[]).push(d)}}catch(t){o={error:t}}finally{try{f&&!f.done&&(a=h.return)&&a.call(h)}finally{if(o)throw o.error}}if(l)try{for(var y=(0,p.Ju)(l),v=y.next();!v.done;v=y.next()){var d=v.value;(0,g.o)(s,d),n.next(d)}}catch(t){u={error:t}}finally{try{v&&!v.done&&(c=y.return)&&c.call(y)}finally{if(u)throw u.error}}},function(){var t,e;try{for(var r=(0,p.Ju)(s),i=r.next();!i.done;i=r.next()){var o=i.value;n.next(o)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}n.complete()},void 0,function(){s=null}))})}(e.count),(0,v.H)(t=>t),(0,m.s)(e.count)):(0,h.F)())),C="sanity/comlink",I="comlink/response",R="comlink/heartbeat",q="comlink/disconnect",A="comlink/handshake/syn",$="comlink/handshake/syn-ack",O="comlink/handshake/ack",k=t=>e=>e.pipe((0,m.s)(1),(0,l.T)(()=>{throw Error(t)})),j=()=>(0,i.mj)({types:{},actors:{listen:(0,s.OX)(({input:t})=>{let e=t.signal?(0,c.R)(t.signal,"abort").pipe(k(`Request ${t.requestId} aborted`)):b.w;return(0,c.R)(window,"message").pipe((0,f.p)(e=>e.data?.type===I&&e.data?.responseTo===t.requestId&&!!e.source&&t.sources.has(e.source)),(0,m.s)(t.sources.size),(0,w.Q)(e))})},actions:{"send message":({context:t},e)=>{let{sources:r,targetOrigin:n}=t,{message:s}=e;r.forEach(t=>{t.postMessage(s,{targetOrigin:n})})},"on success":(0,o.c)(({context:t})=>t.parentRef,({context:t,self:e})=>(t.response&&t.resolvable?.resolve(t.response),{type:"request.success",requestId:e.id,response:t.response,responseTo:t.responseTo})),"on fail":(0,o.c)(({context:t})=>t.parentRef,({context:t,self:e})=>(t.suppressWarnings||console.warn(`[@sanity/comlink] Received no response to message '${t.type}' on client '${t.from}' (ID: '${t.id}').`),t.resolvable?.reject(Error("No response received")),{type:"request.failed",requestId:e.id})),"on abort":(0,o.c)(({context:t})=>t.parentRef,({context:t,self:e})=>(t.resolvable?.reject(Error("Request aborted")),{type:"request.aborted",requestId:e.id}))},guards:{expectsResponse:({context:t})=>t.expectResponse},delays:{initialTimeout:0,responseTimeout:({context:t})=>t.responseTimeout??3e3}}).createMachine({context:({input:t})=>({channelId:t.channelId,data:t.data,domain:t.domain,expectResponse:t.expectResponse??!1,from:t.from,id:`msg-${(0,n.A)()}`,parentRef:t.parentRef,resolvable:t.resolvable,response:null,responseTimeout:t.responseTimeout,responseTo:t.responseTo,signal:t.signal,sources:t.sources instanceof Set?t.sources:new Set([t.sources]),suppressWarnings:t.suppressWarnings,targetOrigin:t.targetOrigin,to:t.to,type:t.type}),initial:"idle",on:{abort:".aborted"},states:{idle:{after:{initialTimeout:[{target:"sending"}]}},sending:{entry:{type:"send message",params:({context:t})=>{let{channelId:e,data:r,domain:n,from:s,id:i,responseTo:o,to:a,type:u}=t;return{message:{channelId:e,data:r,domain:n,from:s,id:i,to:a,type:u,responseTo:o}}}},always:[{guard:"expectsResponse",target:"awaiting"},"success"]},awaiting:{invoke:{id:"listen for response",src:"listen",input:({context:t})=>({requestId:t.id,sources:t.sources,signal:t.signal}),onError:"aborted"},after:{responseTimeout:"failed"},on:{message:{actions:(0,o.a)({response:({event:t})=>t.data.data,responseTo:({event:t})=>t.data.responseTo}),target:"success"}}},failed:{type:"final",entry:"on fail"},success:{type:"final",entry:"on success"},aborted:{type:"final",entry:"on abort"}},output:({context:t,self:e})=>({requestId:e.id,response:t.response,responseTo:t.responseTo})}),U=(0,s.SP)(({sendBack:t,input:e})=>{let r=()=>{t(e.event)};e.immediate&&r();let n=setInterval(r,e.interval);return()=>{clearInterval(n)}}),P=()=>(0,i.mj)({types:{},actors:{requestMachine:j(),listen:T(),sendBackAtInterval:U},actions:{"buffer message":(0,o.b)(({enqueue:t})=>{t.assign({buffer:({event:t,context:e})=>((0,i.DT)(t,"post"),[...e.buffer,t.data])}),t.emit(({event:t})=>((0,i.DT)(t,"post"),{type:"buffer.added",message:t.data}))}),"create request":(0,o.a)({requests:({context:t,event:e,self:r,spawn:s})=>{(0,i.DT)(e,"request");let o=(Array.isArray(e.data)?e.data:[e.data]).map(e=>s("requestMachine",{id:`req-${(0,n.A)()}`,input:{channelId:t.channelId,data:e.data,domain:t.domain,expectResponse:e.expectResponse,from:t.name,parentRef:r,responseTo:e.responseTo,sources:t.target,targetOrigin:t.targetOrigin,to:t.connectTo,type:e.type}}));return[...t.requests,...o]}}),"emit received message":(0,o.b)(({enqueue:t})=>{t.emit(({event:t})=>((0,i.DT)(t,"message.received"),{type:"message",message:t.message.data}))}),"emit status":(0,o.e)((t,e)=>({type:"status",status:e.status})),"post message":(0,a.O)(({event:t})=>((0,i.DT)(t,"post"),{type:"request",data:{data:t.data.data,expectResponse:!0,type:t.data.type}})),"remove request":(0,o.b)(({context:t,enqueue:e,event:r})=>{(0,i.DT)(r,["request.success","request.failed","request.aborted"]),(0,a.R)(r.requestId),e.assign({requests:t.requests.filter(({id:t})=>t!==r.requestId)})}),respond:(0,a.O)(({event:t})=>((0,i.DT)(t,"response"),{type:"request",data:{data:t.data,type:I,responseTo:t.respondTo}})),"send handshake ack":(0,a.O)({type:"request",data:{type:O}}),"send disconnect":(0,a.O)(()=>({type:"request",data:{type:q}})),"send handshake syn":(0,a.O)({type:"request",data:{type:A}}),"send pending messages":(0,o.b)(({enqueue:t})=>{t.raise(({context:t})=>({type:"request",data:t.buffer.map(({data:t,type:e})=>({data:t,type:e}))})),t.emit(({context:t})=>({type:"buffer.flushed",messages:t.buffer})),t.assign({buffer:[]})}),"set target":(0,o.a)({target:({event:t})=>((0,i.DT)(t,"target.set"),t.target)})},guards:{"has target":({context:t})=>!!t.target,"should send heartbeats":({context:t})=>t.heartbeat}}).createMachine({id:"connection",context:({input:t})=>({id:t.id||`${t.name}-${(0,n.A)()}`,buffer:[],channelId:`chn-${(0,n.A)()}`,connectTo:t.connectTo,domain:t.domain??C,heartbeat:t.heartbeat??!1,name:t.name,requests:[],target:t.target,targetOrigin:t.targetOrigin}),on:{"target.set":{actions:"set target"},"request.success":{actions:"remove request"},"request.failed":{actions:"remove request"}}
11,initial:"idle",states:{idle:{entry:[{type:"emit status",params:{status:"idle"}}],on:{connect:{target:"handshaking",guard:"has target"},post:{actions:"buffer message"}}},handshaking:{id:"handshaking",entry:[{type:"emit status",params:{status:"handshaking"}}],invoke:[{id:"send syn",src:"sendBackAtInterval",input:()=>({event:{type:"syn"},interval:500,immediate:!0})},{id:"listen for handshake",src:"listen",input:t=>_({include:$,count:1})(t)}],on:{syn:{actions:"send handshake syn"},request:{actions:"create request"},post:{actions:"buffer message"},"message.received":{target:"connected"},disconnect:{target:"disconnected"}},exit:"send handshake ack"},connected:{entry:["send pending messages",{type:"emit status",params:{status:"connected"}}],invoke:{id:"listen for messages",src:"listen",input:_({exclude:[I,R]})},on:{post:{actions:"post message"},request:{actions:"create request"},response:{actions:"respond"},"message.received":{actions:"emit received message"},disconnect:{target:"disconnected"}},initial:"heartbeat",states:{heartbeat:{initial:"checking",states:{checking:{always:{guard:"should send heartbeats",target:"sending"}},sending:{on:{"request.failed":{target:"#handshaking"}},invoke:{id:"send heartbeat",src:"sendBackAtInterval",input:()=>({event:{type:"post",data:{type:R,data:void 0}},interval:2e3,immediate:!1})}}}}}},disconnected:{id:"disconnected",entry:["send disconnect",{type:"emit status",params:{status:"disconnected"}}],on:{request:{actions:"create request"},post:{actions:"buffer message"},connect:{target:"handshaking",guard:"has target"}}}}}),D=(t,e=P())=>{let r=t.id||`${t.name}-${(0,n.A)()}`,s=(0,a.A)(e,{input:{...t,id:r}}),i=new Map,o=new Map;s.on("message",async({message:t})=>{let e=i.get(t.type);if(e){e.forEach(async e=>{let r=await e(t.data);r&&s.send({type:"response",respondTo:t.id,data:r})});return}let r=o.get(t.type);r?r.add(t):o.set(t.type,new Set([t]))});let u=()=>{s.stop()};return{actor:s,connect:()=>{s.send({type:"connect"})},disconnect:()=>{s.send({type:"disconnect"})},id:r,name:t.name,machine:e,on:(t,e,r)=>{let n=i.get(t)||new Set;i.has(t)||i.set(t,n),n.add(e);let a=o.get(t);if(a){let n=r?.replay??1;Array.from(a).slice(-n).forEach(async({data:t,id:r})=>{let n=await e(t);n&&s.send({type:"response",respondTo:r,data:n})}),o.delete(t)}return()=>{n.delete(e)}},onStatus:(t,e)=>{let{unsubscribe:r}=s.on("status",r=>{e&&r.status!==e||t(r.status)});return r},post:(t,e)=>{s.send({type:"post",data:{type:t,data:e}})},setTarget:t=>{s.send({type:"target.set",target:t})},start:()=>(s.start(),u),stop:u,get target(){return s.getSnapshot().context.target}}},M=t=>{t.disconnect(),setTimeout(()=>{t.stop()},0)},N=()=>{},B=t=>{let{targetOrigin:e}=t,r=new Set,n=new Set;return{addTarget:t=>{if(r.has(t))return N;if(!r.size||!n.size)return r.add(t),n.forEach(e=>{e.connections.forEach(e=>{e.setTarget(t),e.connect()})}),()=>{r.delete(t),n.forEach(e=>{e.connections.forEach(e=>{e.target===t&&e.disconnect()})})};r.add(t);let s=new Set;return n.forEach(r=>{let n=D({...r.input,target:t,targetOrigin:e},r.machine);s.add(n),r.connections.add(n),r.subscribers.forEach(({type:t,handler:e,unsubscribers:r})=>{r.push(n.on(t,e))}),r.internalEventSubscribers.forEach(({type:t,handler:e,unsubscribers:r})=>{r.push(n.actor.on(t,e).unsubscribe)}),r.statusSubscribers.forEach(({handler:t,unsubscribers:e})=>{e.push(n.onStatus(e=>t({connection:n.id,status:e})))}),n.start(),n.connect()}),()=>{r.delete(t),s.forEach(t=>{M(t),n.forEach(e=>{e.connections.delete(t)})})}},createChannel:(t,s=P())=>{let i={connections:new Set,input:t,internalEventSubscribers:new Set,machine:s,statusSubscribers:new Set,subscribers:new Set};n.add(i);let{connections:o,internalEventSubscribers:a,statusSubscribers:u,subscribers:c}=i;if(r.size)r.forEach(r=>{let n=D({...t,target:r,targetOrigin:e},s);o.add(n)});else{let r=D({...t,targetOrigin:e},s);o.add(r)}let l=()=>{let t=i.connections;t.forEach(M),t.clear(),n.delete(i)};return{on:(t,e)=>{let r=[];o.forEach(n=>{r.push(n.on(t,e))});let n={type:t,handler:e,unsubscribers:r};return c.add(n),()=>{r.forEach(t=>t()),c.delete(n)}},onInternalEvent:(t,e)=>{let r=[];o.forEach(n=>{r.push(n.actor.on(t,e).unsubscribe)});let n={type:t,handler:e,unsubscribers:r};return a.add(n),()=>{r.forEach(t=>t()),a.delete(n)}},onStatus:t=>{let e=[];o.forEach(r=>{e.push(r.onStatus(e=>t({connection:r.id,status:e})))});let r={handler:t,unsubscribers:e};return u.add(r),()=>{e.forEach(t=>t()),u.delete(r)}},post:(...t)=>{let[e,r]=t;o.forEach(t=>{t.post(e,r)})},start:()=>
11(o.forEach(t=>{t.start(),t.connect()}),l),stop:l}},destroy:()=>{n.forEach(({connections:t})=>{t.forEach(M),t.clear()}),n.clear(),r.clear()}}},F=()=>(0,i.mj)({types:{},actors:{requestMachine:j(),listen:T()},actions:{"buffer handshake":(0,o.a)({handshakeBuffer:({event:t,context:e})=>((0,i.DT)(t,"message.received"),[...e.handshakeBuffer,t])}),"buffer message":(0,o.b)(({enqueue:t})=>{t.assign({buffer:({event:t,context:e})=>((0,i.DT)(t,"post"),[...e.buffer,{data:t.data,resolvable:t.resolvable,options:t.options}])}),t.emit(({event:t})=>((0,i.DT)(t,"post"),{type:"buffer.added",message:t.data}))}),"create request":(0,o.a)({requests:({context:t,event:e,self:r,spawn:s})=>{(0,i.DT)(e,"request");let o=(Array.isArray(e.data)?e.data:[e.data]).map(e=>s("requestMachine",{id:`req-${(0,n.A)()}`,input:{channelId:t.channelId,data:e.data,domain:t.domain,expectResponse:e.expectResponse,from:t.name,parentRef:r,resolvable:e.resolvable,responseTimeout:e.options?.responseTimeout,responseTo:e.responseTo,signal:e.options?.signal,sources:t.target,suppressWarnings:e.options?.suppressWarnings,targetOrigin:t.targetOrigin,to:t.connectTo,type:e.type}}));return[...t.requests,...o]}}),"emit heartbeat":(0,o.e)(()=>({type:"heartbeat"})),"emit received message":(0,o.b)(({enqueue:t})=>{t.emit(({event:t})=>((0,i.DT)(t,"message.received"),{type:"message",message:t.message.data}))}),"emit status":(0,o.e)((t,e)=>({type:"status",status:e.status})),"post message":(0,a.O)(({event:t})=>((0,i.DT)(t,"post"),{type:"request",data:{data:t.data.data,expectResponse:!!t.resolvable,type:t.data.type,resolvable:t.resolvable,options:t.options}})),"process pending handshakes":(0,o.b)(({context:t,enqueue:e})=>{t.handshakeBuffer.forEach(t=>e.raise(t)),e.assign({handshakeBuffer:[]})}),"remove request":(0,o.b)(({context:t,enqueue:e,event:r})=>{(0,i.DT)(r,["request.success","request.failed","request.aborted"]),(0,a.R)(r.requestId),e.assign({requests:t.requests.filter(({id:t})=>t!==r.requestId)})}),"send response":(0,a.O)(({event:t})=>((0,i.DT)(t,["message.received","heartbeat.received"]),{type:"request",data:{type:I,responseTo:t.message.data.id,data:void 0}})),"send handshake syn ack":(0,a.O)({type:"request",data:{type:$}}),"send pending messages":(0,o.b)(({enqueue:t})=>{t.raise(({context:t})=>({type:"request",data:t.buffer.map(({data:t,resolvable:e,options:r})=>({data:t.data,type:t.type,expectResponse:!!e,resolvable:e,options:r}))})),t.emit(({context:t})=>({type:"buffer.flushed",messages:t.buffer.map(({data:t})=>t)})),t.assign({buffer:[]})}),"set connection config":(0,o.a)({channelId:({event:t})=>((0,i.DT)(t,"handshake.syn"),t.message.data.channelId),target:({event:t})=>((0,i.DT)(t,"handshake.syn"),t.message.source||void 0),targetOrigin:({event:t})=>((0,i.DT)(t,"handshake.syn"),t.message.origin)})},guards:{hasSource:({context:t})=>null!==t.target}}).createMachine({id:"node",context:({input:t})=>({buffer:[],channelId:null,connectTo:t.connectTo,domain:t.domain??C,handshakeBuffer:[],name:t.name,requests:[],target:void 0,targetOrigin:null}),invoke:{id:"listen for handshake syn",src:"listen",input:_({include:A,responseType:"handshake.syn"})},on:{"request.success":{actions:"remove request"},"request.failed":{actions:"remove request"},"request.aborted":{actions:"remove request"},"handshake.syn":{actions:"set connection config",target:".handshaking"}},initial:"idle",states:{idle:{entry:[{type:"emit status",params:{status:"idle"}}],on:{post:{actions:"buffer message"}}},handshaking:{guard:"hasSource",entry:["send handshake syn ack",{type:"emit status",params:{status:"handshaking"}}],invoke:[{id:"listen for handshake ack",src:"listen",input:_({include:O,count:1,responseType:"handshake.complete"}),onDone:"connected"},{id:"listen for disconnect",src:"listen",input:_({include:q,count:1,responseType:"disconnect"})},{id:"listen for messages",src:"listen",input:_({exclude:[q,A,O,R,I]})}],on:{request:{actions:"create request"},post:{actions:"buffer message"},"message.received":{actions:"buffer handshake"},disconnect:{target:"idle"}}},connected:{entry:["process pending handshakes","send pending messages",{type:"emit status",params:{status:"connected"}}],invoke:[{id:"listen for messages",src:"listen",input:_({exclude:[q,A,O,R,I]})},{id:"listen for heartbeat",src:"listen",input:_({include:R,responseType:"heartbeat.received"})},{id:"listen for disconnect",src:"listen",input:_({include:q,count:1,responseType:"disconnect"})}],on:{request:{actions:"create request"},post:{actions:"post message"},disconnect:{target:"idle"},"message.received":{actions:["send response","emit received message"]},"heartbeat.received":{actions:["send response","emit heartbeat"]}}}}}),L=(t,e=F())=>{let r;
11let n=(0,a.A)(e,{input:t}),s=new Map,i=new Map;n.on("message",({message:t})=>{let e=s.get(t.type);if(e){e.forEach(e=>e(t.data));return}let r=i.get(t.type);r?r.add(t):i.set(t.type,new Set([t]))});let o=()=>{n.stop()};return{actor:n,fetch:(t,e,r)=>{let{responseTimeout:s=1e4,signal:i,suppressWarnings:o}=r||{},a=function(){let t,e;return"function"==typeof Promise.withResolvers?Promise.withResolvers():{promise:new Promise((r,n)=>{t=r,e=n}),resolve:t,reject:e}}();return n.send({type:"post",data:{type:t,data:e},resolvable:a,options:{responseTimeout:s,signal:i,suppressWarnings:o}}),a.promise},machine:e,on:(t,e,r)=>{let n=s.get(t)||new Set;s.has(t)||s.set(t,n),n.add(e);let o=i.get(t);if(o){let n=r?.replay??1;Array.from(o).slice(-n).forEach(({data:t})=>e(t)),i.delete(t)}return()=>{n.delete(e)}},onStatus:(t,e)=>{let{unsubscribe:s}=n.on("status",n=>{r=n.status,e&&n.status!==e||t(n.status)});return r&&t(r),s},post:(t,e)=>{n.send({type:"post",data:{type:t,data:e}})},start:()=>(n.start(),o),stop:o}}},37354:(t,e,r)=>{"use strict";r.d(e,{Ak:()=>o,d_:()=>i});let n=t=>crypto.getRandomValues(new Uint8Array(t)),s=(t,e,r)=>{let n=(2<<Math.log(t.length-1)/Math.LN2)-1,s=-~(1.6*n*e/t.length);return (i=e)=>{let o="";for(;;){let e=r(s),a=0|s;for(;a--;)if((o+=t[e[a]&n]||"").length===i)return o}}},i=(t,e=21)=>s(t,e,n),o=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce((t,e)=>((e&=63)<36?t+=e.toString(36):e<62?t+=(e-26).toString(36).toUpperCase():e>62?t+="-":t+="_",t),"")},6476:(t,e,r)=>{"use strict";r.d(e,{AQ:()=>d,C6:()=>s,Cl:()=>i,Ju:()=>c,N3:()=>p,Tt:()=>o,YH:()=>u,fX:()=>f,gz:()=>h,sH:()=>a,xN:()=>y,zs:()=>l});var n=function(t,e){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)};function s(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var i=function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var s in e=arguments[r])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t}).apply(this,arguments)};function o(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&0>e.indexOf(n)&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var s=0,n=Object.getOwnPropertySymbols(t);s<n.length;s++)0>e.indexOf(n[s])&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(r[n[s]]=t[n[s]]);return r}function a(t,e,r,n){return new(r||(r=Promise))(function(s,i){function o(t){try{u(n.next(t))}catch(t){i(t)}}function a(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?s(t.value):((e=t.value)instanceof r?e:new r(function(t){t(e)})).then(o,a)}u((n=n.apply(t,e||[])).next())})}function u(t,e){var r,n,s,i={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(r)throw TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(i=0)),i;)try{if(r=1,n&&(s=2&a[0]?n.return:a[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,a[1])).done)return s;switch(n=0,s&&(a=[2&a[0],s.value]),a[0]){case 0:case 1:s=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(s=(s=i.trys).length>0&&s[s.length-1])&&(6===a[0]||2===a[0])){i=0;continue}if(3===a[0]&&(!s||a[1]>s[0]&&a[1]<s[3])){i.label=a[1];break}if(6===a[0]&&i.label<s[1]){i.label=s[1],s=a;break}if(s&&i.label<s[2]){i.label=s[2],i.ops.push(a);break}s[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],n=0}finally{r=s=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}function c(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function l(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,s,i=r.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(t){s={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(s)throw s.error}}return o}function h(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(l(arguments[e]));return t}function f(t,e,r){if(r||2==arguments.length)for(var n,s=0,i=e.length;s<i;s++)!n&&s in e||(n||(n=Array.prototype.slice.call(e,0,s)),n[s]=e[s]);return t.concat(n||Array.prototype.slice.call(e))}function p(t){return this instanceof p?(this.v=t,this):new p(t)}function d(t,e,r){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var n,s=r.apply(t,e||[]),i=[];return n=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),o("next"),o("throw"),o("return",function(t){return function(e){return Promise.resolve(e).then(t,c)}}),n[Symbol.asyncIterator]=function(){return this},n;function o(t,e){s[t]&&(n[t]=function(e){return new Promise(function(r,n){i.push([t,e,r,n])>1||a(t,e)})},e&&(n[t]=e(n[t])))}function a(t,e){try{var r;(r=s[t](e)).value instanceof p?Promise.resolve(r.value.v).then(u,c):l(i[0][2],r)}catch(t){l(i[0][3],t)}}function u(t){a("next",t)}function c(t){a("throw",t)}function l(t,e){t(e),i.shift(),i.length&&a(i[0][0],i[0][1])}}function y(t){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var e,r=t[Symbol.asyncIterator];return r?r.call(t):(t=c(t),e={},n("next"),n("throw"),n("return"),e[Symbol.asyncIterator]=function(){return this},e);function n(r){e[r]=t[r]&&function(e){return new Promise(function(n,s){!function(t,e,r,n){Promise.resolve(n).then(function(e){t({value:e,done:r})},e)}(n,s,(e=t[r](e)).done,e.value)})}}}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError},84880:(t,e,r)=>{"use strict";r.d(e,{J:()=>s});var n=r(12115);function s(t){let e=(0,n.useRef)(null);return(0,n.useInsertionEffect)(()=>{e.current=t},[t]),(0,n.useCallback)((...t)=>(0,e.current)(...t),[])}},13697:(t,e,r)=>{"use strict";let n;r.d(e,{A:()=>a});let s={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)},i=new Uint8Array(16),o=[];for(let t=0;t<256;++t)o.push((t+256).toString(16).slice(1));let a=function(t,e,r){if(s.randomUUID&&!e&&!t)return s.randomUUID();let a=(t=t||{}
11).random??t.rng?.()??function(){if(!n){if("undefined"==typeof crypto||!crypto.getRandomValues)throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");n=crypto.getRandomValues.bind(crypto)}return n(i)}();if(a.length<16)throw Error("Random bytes length must be >= 16");if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,e){if((r=r||0)<0||r+16>e.length)throw RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let t=0;t<16;++t)e[r+t]=a[t];return e}return function(t,e=0){return(o[t[e+0]]+o[t[e+1]]+o[t[e+2]]+o[t[e+3]]+"-"+o[t[e+4]]+o[t[e+5]]+"-"+o[t[e+6]]+o[t[e+7]]+"-"+o[t[e+8]]+o[t[e+9]]+"-"+o[t[e+10]]+o[t[e+11]]+o[t[e+12]]+o[t[e+13]]+o[t[e+14]]+o[t[e+15]]).toLowerCase()}(a)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.