PageSourceSearch

https://caldergardens.org/_next/static/chunks/305-6a49bfdd85420b7c.js

js caldergardens.org collected 2026-09-25 00:48:53 UTC 148,695 bytes, 15 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[305],{5218:function(e,t,r){Object.defineProperty(t,"$",{enumerable:!0,get:function(){return i}});let n=r(34261);function i(e){let{createServerReference:t}=r(73849);return t(e,n.callServer)}},92882:function(e,t,r){r.d(t,{y:function(){return l}});var n=r(82971),i=r(80205),s=r(20680),o=r(29681),a=r(94782),u=r(3938),c=r(13291),l=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(e,t,r){var s,o=this,a=(s=e)&&s instanceof n.Lv||s&&(0,u.m)(s.next)&&(0,u.m)(s.error)&&(0,u.m)(s.complete)&&(0,i.Nn)(s)?e:new n.Hp(e,t,r);return(0,c.x)(function(){var e=o.operator,t=o.source;a.add(e?e.call(a,t):t?o._subscribe(a):o._trySubscribe(a))}),a},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var r=this;return new(t=h(t))(function(t,i){var s=new n.Hp({next:function(t){try{e(t)}catch(e){i(e),s.unsubscribe()}},error:i,complete:t});r.subscribe(s)})},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[s.L]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(0,o.U)(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=h(e))(function(e,r){var n;t.subscribe(function(e){return n=e},function(e){return r(e)},function(){return e(n)})})},e.create=function(t){return new e(t)},e}();function h(e){var t;return null!==(t=null!=e?e:a.v.Promise)&&void 0!==t?t:Promise}},60593:function(e,t,r){r.d(t,{t:function(){return o}});var n=r(71655),i=r(5627),s=r(42380),o=function(e){function t(t,r,n){void 0===t&&(t=1/0),void 0===r&&(r=1/0),void 0===n&&(n=s.l);var i=e.call(this)||this;return i._bufferSize=t,i._windowTime=r,i._timestampProvider=n,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=r===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,r),i}return(0,n.ZT)(t,e),t.prototype.next=function(t){var r=this.isStopped,n=this._buffer,i=this._infiniteTimeWindow,s=this._timestampProvider,o=this._windowTime;!r&&(n.push(t),i||n.push(s.now()+o)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),r=this._infiniteTimeWindow,n=this._buffer.slice(),i=0;i<n.length&&!e.closed;i+=r?1:2)e.next(n[i]);return this._checkFinalizedStatuses(e),t},t.prototype._trimBuffer=function(){var e=this._bufferSize,t=this._timestampProvider,r=this._buffer,n=this._infiniteTimeWindow,i=(n?1:2)*e;if(e<1/0&&i<r.length&&r.splice(0,r.length-i),!n){for(var s=t.now(),o=0,a=1;a<r.length&&r[a]<=s;a+=2)o=a;o&&r.splice(0,o+1)}},t}(i.x)},5627:function(e,t,r){r.d(t,{x:function(){return c}});var n=r(71655),i=r(92882),s=r(80205),o=(0,r(8747).d)(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),a=r(55174),u=r(13291),c=function(e){function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return(0,n.ZT)(t,e),t.prototype.lift=function(e){var t=new l(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new o},t.prototype.next=function(e){var t=this;(0,u.x)(function(){var r,i;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var s=(0,n.XA)(t.currentObservers),o=s.next();!o.done;o=s.next())o.value.next(e)}catch(e){r={error:e}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}}})},t.prototype.error=function(e){var t=this;(0,u.x)(function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var r=t.observers;r.length;)r.shift().error(e)}})},t.prototype.complete=function(){var e=this;(0,u.x)(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return(null===(e=this.observers)||void 0===e?void 0:e.length)>0}
1,enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,r=this.hasError,n=this.isStopped,i=this.observers;return r||n?s.Lc:(this.currentObservers=null,i.push(e),new s.w0(function(){t.currentObservers=null,(0,a.P)(i,e)}))},t.prototype._checkFinalizedStatuses=function(e){var t=this.hasError,r=this.thrownError,n=this.isStopped;t?e.error(r):n&&e.complete()},t.prototype.asObservable=function(){var e=new i.y;return e.source=this,e},t.create=function(e,t){return new l(e,t)},t}(i.y),l=function(e){function t(t,r){var n=e.call(this)||this;return n.destination=t,n.source=r,n}return(0,n.ZT)(t,e),t.prototype.next=function(e){var t,r;null===(r=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===r||r.call(t,e)},t.prototype.error=function(e){var t,r;null===(r=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===r||r.call(t,e)},t.prototype.complete=function(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)},t.prototype._subscribe=function(e){var t,r;return null!==(r=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==r?r:s.Lc},t}(c)},82971:function(e,t,r){r.d(t,{Hp:function(){return v},Lv:function(){return d}});var n=r(71655),i=r(3938),s=r(80205),o=r(94782),a=r(67052),u=r(65980),c=l("C",void 0,void 0);function l(e,t,r){return{kind:e,value:t,error:r}}var h=r(95631),f=r(13291),d=function(e){function t(t){var r=e.call(this)||this;return r.isStopped=!1,t?(r.destination=t,(0,s.Nn)(t)&&t.add(r)):r.destination=w,r}return(0,n.ZT)(t,e),t.create=function(e,t,r){return new v(e,t,r)},t.prototype.next=function(e){this.isStopped?b(l("N",e,void 0),this):this._next(e)},t.prototype.error=function(e){this.isStopped?b(l("E",void 0,e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?b(c,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(s.w0),p=Function.prototype.bind;function y(e,t){return p.call(e,t)}var g=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){m(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){m(e)}else m(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){m(e)}},e}(),v=function(e){function t(t,r,n){var s,a,u=e.call(this)||this;return(0,i.m)(t)||!t?s={next:null!=t?t:void 0,error:null!=r?r:void 0,complete:null!=n?n:void 0}:u&&o.v.useDeprecatedNextContext?((a=Object.create(t)).unsubscribe=function(){return u.unsubscribe()},s={next:t.next&&y(t.next,a),error:t.error&&y(t.error,a),complete:t.complete&&y(t.complete,a)}):s=t,u.destination=new g(s),u}return(0,n.ZT)(t,e),t}(d);function m(e){o.v.useDeprecatedSynchronousErrorHandling?(0,f.O)(e):(0,a.h)(e)}function b(e,t){var r=o.v.onStoppedNotification;r&&h.z.setTimeout(function(){return r(e,t)})}var w={closed:!0,next:u.Z,error:function(e){throw e},complete:u.Z}},80205:function(e,t,r){r.d(t,{Lc:function(){return u},w0:function(){return a},Nn:function(){return c}});var n=r(71655),i=r(3938),s=(0,r(8747).d)(function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map(function(e,t){return t+1+") "+e.toString()}).join("\n  "):"",this.name="UnsubscriptionError",this.errors=t}}),o=r(55174),a=function(){var e;function t(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var e,t,r,o,a,u=this._parentage;if(u){if(this._parentage=null,Array.isArray(u))try{for(var c=(0,n.XA)(u),h=c.next();!h.done;h=c.next())h.value.remove(this)}catch(t){e={error:t}}finally{try{h&&!h.done&&(t=c.return)&&t.call(c)}finally{if(e)throw e.error}}else u.remove(this)}var f=this.initialTeardown;
1if((0,i.m)(f))try{f()}catch(e){a=e instanceof s?e.errors:[e]}var d=this._finalizers;if(d){this._finalizers=null;try{for(var p=(0,n.XA)(d),y=p.next();!y.done;y=p.next()){var g=y.value;try{l(g)}catch(e){a=null!=a?a:[],e instanceof s?a=(0,n.ev)((0,n.ev)([],(0,n.CR)(a)),(0,n.CR)(e.errors)):a.push(e)}}}catch(e){r={error:e}}finally{try{y&&!y.done&&(o=p.return)&&o.call(p)}finally{if(r)throw r.error}}}if(a)throw new s(a)}},t.prototype.add=function(e){var r;if(e&&e!==this){if(this.closed)l(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=null!==(r=this._finalizers)&&void 0!==r?r:[]).push(e)}}},t.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},t.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},t.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&(0,o.P)(t,e)},t.prototype.remove=function(e){var r=this._finalizers;r&&(0,o.P)(r,e),e instanceof t&&e._removeParent(this)},t.EMPTY=((e=new t).closed=!0,e),t}(),u=a.EMPTY;function c(e){return e instanceof a||e&&"closed"in e&&(0,i.m)(e.remove)&&(0,i.m)(e.add)&&(0,i.m)(e.unsubscribe)}function l(e){(0,i.m)(e)?e():e.unsubscribe()}},94782:function(e,t,r){r.d(t,{v:function(){return n}});var n={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1}},5570:function(e,t,r){r.d(t,{P:function(){return s}});var n=r(92882),i=r(55832);function s(e){return new n.y(function(t){(0,i.Xf)(e()).subscribe(t)})}},52209:function(e,t,r){r.d(t,{E:function(){return n}});var n=new(r(92882)).y(function(e){return e.complete()})},39710:function(e,t,r){r.d(t,{D:function(){return b}});var n=r(55832),i=r(69204),s=r(70881);function o(e,t){return void 0===t&&(t=0),(0,s.e)(function(r,n){n.add(e.schedule(function(){return r.subscribe(n)},t))})}var a=r(92882),u=r(22061),c=r(3938),l=r(79504);function h(e,t){if(!e)throw Error("Iterable cannot be null");return new a.y(function(r){(0,l.f)(r,t,function(){var n=e[Symbol.asyncIterator]();(0,l.f)(r,t,function(){n.next().then(function(e){e.done?r.complete():r.next(e.value)})},0,!0)})})}var f=r(34049),d=r(63367),p=r(50897),y=r(59746),g=r(95827),v=r(68533),m=r(84993);function b(e,t){return t?function(e,t){if(null!=e){if((0,f.c)(e))return(0,n.Xf)(e).pipe(o(t),(0,i.Q)(t));if((0,p.z)(e))return new a.y(function(r){var n=0;return t.schedule(function(){n===e.length?r.complete():(r.next(e[n++]),r.closed||this.schedule())})});if((0,d.t)(e))return(0,n.Xf)(e).pipe(o(t),(0,i.Q)(t));if((0,g.D)(e))return h(e,t);if((0,y.T)(e))return new a.y(function(r){var n;return(0,l.f)(r,t,function(){n=e[u.h](),(0,l.f)(r,t,function(){var e,t,i;try{t=(e=n.next()).value,i=e.done}catch(e){r.error(e);return}i?r.complete():r.next(t)},0,!0)}),function(){return(0,c.m)(null==n?void 0:n.return)&&n.return()}});if((0,m.L)(e))return h((0,m.Q)(e),t)}throw(0,v.z)(e)}(e,t):(0,n.Xf)(e)}},55832:function(e,t,r){r.d(t,{Xf:function(){return y}});var n=r(71655),i=r(50897),s=r(63367),o=r(92882),a=r(34049),u=r(95827),c=r(68533),l=r(59746),h=r(84993),f=r(3938),d=r(67052),p=r(20680);function y(e){if(e instanceof o.y)return e;if(null!=e){if((0,a.c)(e))return new o.y(function(t){var r=e[p.L]();if((0,f.m)(r.subscribe))return r.subscribe(t);throw TypeError("Provided object does not correctly implement Symbol.observable")});if((0,i.z)(e))return new o.y(function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()});if((0,s.t)(e))return new o.y(function(t){e.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,d.h)});if((0,u.D)(e))return g(e);if((0,l.T)(e))return new o.y(function(t){var r,i;try{for(var s=(0,n.XA)(e),o=s.next();!o.done;o=s.next()){var a=o.value;if(t.next(a),t.closed)return}}catch(e){r={error:e}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}t.complete()});if((0,h.L)(e))return g((0,h.Q)(e))}throw(0,c.z)(e)}function g(e){return new o.y(function(t){(function(e,t){var r,i,s,o;return(0,n.mG)(this,void 0,void 0,function(){var a;return(0,n.Jh)(this,function(u){switch(u.label){case 0:u.trys.push([0,5,6,11]),r=(0,n.KL)(e),u.label=1;case 1:return[4,r.next()];case 2:if((i=u.sent()).done)return[3,4];if(a=i.value,t.next(a),t.closed)return[2];u.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s={error:u.sent()},[3,11];
1case 6:if(u.trys.push([6,,9,10]),!(i&&!i.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(s)throw s.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})})(e,t).catch(function(e){return t.error(e)})})}},94122:function(e,t,r){r.d(t,{T:function(){return u}});var n=r(96540),i=r(55832),s=r(52209),o=r(9838),a=r(39710);function u(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=(0,o.yG)(e),u=(0,o._6)(e,1/0);return e.length?1===e.length?(0,i.Xf)(e[0]):(0,n.J)(u)((0,a.D)(e,r)):s.E}},67071:function(e,t,r){r.d(t,{x:function(){return i}});var n=r(71655);function i(e,t,r,n,i){return new s(e,t,r,n,i)}var s=function(e){function t(t,r,n,i,s,o){var a=e.call(this,t)||this;return a.onFinalize=s,a.shouldUnsubscribe=o,a._next=r?function(e){try{r(e)}catch(e){t.error(e)}}:e.prototype._next,a._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,a._complete=n?function(){try{n()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,a}return(0,n.ZT)(t,e),t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;e.prototype.unsubscribe.call(this),r||null===(t=this.onFinalize)||void 0===t||t.call(this)}},t}(r(82971).Lv)},31650:function(e,t,r){r.d(t,{h:function(){return s}});var n=r(70881),i=r(67071);function s(e,t){return(0,n.e)(function(r,n){var s=0;r.subscribe((0,i.x)(n,function(r){return e.call(t,r,s++)&&n.next(r)}))})}},12373:function(e,t,r){r.d(t,{U:function(){return s}});var n=r(70881),i=r(67071);function s(e,t){return(0,n.e)(function(r,n){var s=0;r.subscribe((0,i.x)(n,function(r){n.next(e.call(t,r,s++))}))})}},96540:function(e,t,r){r.d(t,{J:function(){return s}});var n=r(67871),i=r(6826);function s(e){return void 0===e&&(e=1/0),(0,n.z)(i.y,e)}},67871:function(e,t,r){r.d(t,{z:function(){return function e(t,r,u){return(void 0===u&&(u=1/0),(0,a.m)(r))?e(function(e,s){return(0,n.U)(function(t,n){return r(e,t,s,n)})((0,i.Xf)(t(e,s)))},u):("number"==typeof r&&(u=r),(0,s.e)(function(e,r){var n,s,a,c,l,h,f,d,p;return n=u,a=[],c=0,l=0,h=!1,f=function(){!h||a.length||c||r.complete()},d=function(e){return c<n?p(e):a.push(e)},p=function(e){c++;var u=!1;(0,i.Xf)(t(e,l++)).subscribe((0,o.x)(r,function(e){s?d(e):r.next(e)},function(){u=!0},void 0,function(){if(u)try{for(c--;a.length&&c<n;)!function(){var e=a.shift();p(e)}();f()}catch(e){r.error(e)}}))},e.subscribe((0,o.x)(r,d,function(){h=!0,f()})),function(){}}))}}});var n=r(12373),i=r(55832),s=r(70881),o=(r(79504),r(67071)),a=r(3938)},69204:function(e,t,r){r.d(t,{Q:function(){return o}});var n=r(79504),i=r(70881),s=r(67071);function o(e,t){return void 0===t&&(t=0),(0,i.e)(function(r,i){r.subscribe((0,s.x)(i,function(r){return(0,n.f)(i,e,function(){return i.next(r)},t)},function(){return(0,n.f)(i,e,function(){return i.complete()},t)},function(r){return(0,n.f)(i,e,function(){return i.error(r)},t)}))})}},1673:function(e,t,r){r.d(t,{B:function(){return u}});var n=r(71655),i=r(55832),s=r(5627),o=r(82971),a=r(70881);function u(e){void 0===e&&(e={});var t=e.connector,r=void 0===t?function(){return new s.x}:t,n=e.resetOnError,u=void 0===n||n,l=e.resetOnComplete,h=void 0===l||l,f=e.resetOnRefCountZero,d=void 0===f||f;return function(e){var t,n,s,l=0,f=!1,p=!1,y=function(){null==n||n.unsubscribe(),n=void 0},g=function(){y(),t=s=void 0,f=p=!1},v=function(){var e=t;g(),null==e||e.unsubscribe()};return(0,a.e)(function(e,a){l++,p||f||y();var m=s=null!=s?s:r();a.add(function(){0!=--l||p||f||(n=c(v,d))}),m.subscribe(a),!t&&l>0&&(t=new o.Hp({next:function(e){return m.next(e)},error:function(e){p=!0,y(),n=c(g,u,e),m.error(e)},complete:function(){f=!0,y(),n=c(g,h),m.complete()}}),(0,i.Xf)(e).subscribe(t))})(e)}}function c(e,t){for(var r=[],s=2;s<arguments.length;s++)r[s-2]=arguments[s];if(!0===t){e();return}if(!1!==t){var a=new o.Hp({next:function(){a.unsubscribe(),e()}});return(0,i.Xf)(t.apply(void 0,(0,n.ev)([],(0,n.CR)(r)))).subscribe(a)}}},6945:function(e,t,r){r.d(t,{d:function(){return s}});var n=r(60593),i=r(1673);function s(e,t,r){var s,o,a,u,c=!1;return e&&"object"==typeof e?(u=void 0===(s=e.bufferSize)?1/0:s,t=void 0===(o=e.windowTime)?1/0:o,c=void 0!==(a=e.refCount)&&a,r=e.scheduler):u=null!=e?e:1/0,(0,i.B)({connector:function(){return new n.t(u,t,r)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:c})}},27951:function(e,t,r){r.d(t,{o:function(){return a}});var n=r(71655),i=function(e){function t(t,r){return e.call(this)||this}return(0,n.ZT)(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(r(80205).w0),s={setInterval:function(e,t){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];var o=s.delegate;return(null==o?void 0:o.setInterval)?o.setInterval.apply(o,(0,n.ev)([e,t],(0,n.CR)(r))):setInterval.apply(void 0,(0,n.ev)([e,t],(0,n.CR)(r)))},clearInterval:function(e){var t=s.delegate;return((null==t?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0},o=r(55174),a=function(e){function t(t,r){var n=e.call(this,t,r)||this;
1return n.scheduler=t,n.work=r,n.pending=!1,n}return(0,n.ZT)(t,e),t.prototype.schedule=function(e,t){if(void 0===t&&(t=0),this.closed)return this;this.state=e;var r,n=this.id,i=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(i,n,t)),this.pending=!0,this.delay=t,this.id=null!==(r=this.id)&&void 0!==r?r:this.requestAsyncId(i,this.id,t),this},t.prototype.requestAsyncId=function(e,t,r){return void 0===r&&(r=0),s.setInterval(e.flush.bind(e,this),r)},t.prototype.recycleAsyncId=function(e,t,r){if(void 0===r&&(r=0),null!=r&&this.delay===r&&!1===this.pending)return t;null!=t&&s.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return Error("executing a cancelled action");this.pending=!1;var r=this._execute(e,t);if(r)return r;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var r,n=!1;try{this.work(e)}catch(e){n=!0,r=e||Error("Scheduled action threw falsy error")}if(n)return this.unsubscribe(),r},t.prototype.unsubscribe=function(){if(!this.closed){var t=this.id,r=this.scheduler,n=r.actions;this.work=this.state=this.scheduler=null,this.pending=!1,(0,o.P)(n,this),null!=t&&(this.id=this.recycleAsyncId(r,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(i)},11594:function(e,t,r){r.d(t,{v:function(){return o}});var n=r(71655),i=r(42380),s=function(){function e(t,r){void 0===r&&(r=e.now),this.schedulerActionCtor=t,this.now=r}return e.prototype.schedule=function(e,t,r){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(r,t)},e.now=i.l.now,e}(),o=function(e){function t(t,r){void 0===r&&(r=s.now);var n=e.call(this,t,r)||this;return n.actions=[],n._active=!1,n}return(0,n.ZT)(t,e),t.prototype.flush=function(e){var t,r=this.actions;if(this._active){r.push(e);return}this._active=!0;do if(t=e.execute(e.state,e.delay))break;while(e=r.shift());if(this._active=!1,t){for(;e=r.shift();)e.unsubscribe();throw t}},t}(s)},42380:function(e,t,r){r.d(t,{l:function(){return n}});var n={now:function(){return(n.delegate||Date).now()},delegate:void 0}},95631:function(e,t,r){r.d(t,{z:function(){return i}});var n=r(71655),i={setTimeout:function(e,t){for(var r=[],s=2;s<arguments.length;s++)r[s-2]=arguments[s];var o=i.delegate;return(null==o?void 0:o.setTimeout)?o.setTimeout.apply(o,(0,n.ev)([e,t],(0,n.CR)(r))):setTimeout.apply(void 0,(0,n.ev)([e,t],(0,n.CR)(r)))},clearTimeout:function(e){var t=i.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0}},22061:function(e,t,r){r.d(t,{h:function(){return n}});var n="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"},20680:function(e,t,r){r.d(t,{L:function(){return n}});var n="function"==typeof Symbol&&Symbol.observable||"@@observable"},9838:function(e,t,r){r.d(t,{_6:function(){return u},jO:function(){return o},yG:function(){return a}});var n=r(3938),i=r(93039);function s(e){return e[e.length-1]}function o(e){return(0,n.m)(s(e))?e.pop():void 0}function a(e){return(0,i.K)(s(e))?e.pop():void 0}function u(e,t){return"number"==typeof s(e)?e.pop():t}},55174:function(e,t,r){r.d(t,{P:function(){return n}});function n(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}},8747:function(e,t,r){r.d(t,{d:function(){return n}});function n(e){var t=e(function(e){Error.call(e),e.stack=Error().stack});return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}},13291:function(e,t,r){r.d(t,{O:function(){return o},x:function(){return s}});var n=r(94782),i=null;function s(e){if(n.v.useDeprecatedSynchronousErrorHandling){var t=!i;if(t&&(i={errorThrown:!1,error:null}),e(),t){var r=i,s=r.errorThrown,o=r.error;if(i=null,s)throw o}}else e()}function o(e){n.v.useDeprecatedSynchronousErrorHandling&&i&&(i.errorThrown=!0,i.error=e)}},79504:function(e,t,r){r.d(t,{f:function(){return n}});function n(e,t,r,n,i){void 0===n&&(n=0),void 0===i&&(i=!1);var s=t.schedule(function(){r(),i?e.add(this.schedule(null,n)):this.unsubscribe()},n);if(e.add(s),!i)return s}},6826:function(e,t,r){r.d(t,{y:function(){return n}});function n(e){return e}},50897:function(e,t,r){r.d(t,{z:function(){return n}});var n=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e}},95827:function(e,t,r){r.d(t,{D:function(){return i}});var n=r(3938);function i(e){return Symbol.asyncIterator&&(0,n.m)(null==e?void 0:e[Symbol.asyncIterator])}},3938:function(e,t,r){r.d(t,{m:function(){return n}});function n(e){return"function"==typeof e}},34049:function(e,t,r){r.d(t,{c:function(){return s}});var n=r(20680),i=r(3938);function s(e){return(0,i.m)(e[n.L])}},59746:function(e,t,r){r.d(t,{T:function(){return s}});var n=r(22061),i=r(3938);function s(e){return(0,i.m)(null==e?void 0:e[n.h])}},63367:function(e,t,r){r.d(t,{t:function(){return i}});var n=r(3938);function i(e){return(0,n.m)(null==e?void 0:e.then)}},84993:function(e,t,r){r.d(t,{L:function(){return o},Q:function(){return s}});var n=r(71655),i=r(3938);function s(e){return(0,n.FC)(this,arguments,function(){var t,r,i;return(0,n.Jh)(this,function(s){switch(s.label){case 0:t=e.getReader(),s.label=1;case 1:s.trys.push([1,,9,10]),s.label=2;case 2:return[4,(0,n.qq)(t.read())];case 3:if(i=(r=s.sent()).value,!r.done)return[3,5];return[4,(0,n.qq)(void 0)];case 4:return[2,s.sent()];case 5:return[4,(0,n.qq)(i)];case 6:return[4,s.sent()];case 7:return s.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function o(e){return(0,i.m)(null==e?void 0:e.getReader)}},93039:function(e,t,r){r.d(t,{K:function(){return i}});var n=r(3938);function i(e){return e&&(0,n.m)(e.schedule)}},70881:function(e,t,r){r.d(t,{e:function(){return i}});var n=r(3938);function i(e){return function(t){if((0,n.m)(null==t?void 0:t.lift))return t.lift(function(t){try{return e(t,this)}catch(e){this.error(e)}});throw TypeError("Unable to lift unknown Observable type")}}},66787:function(e,t,r){r.d(t,{Z:function(){return o}});var n=r(71655),i=r(12373),s=Array.isArray;function o(e){return(0,i.U)(function(t){return s(t)?e.apply(void 0,(0,n.ev)([],(0,n.CR)(t))):e(t)})}},65980:function(e,t,r){r.d(t,{Z:function(){return n}});function n(){}},29681:function(e,t,r){r.d(t,{U:function(){return s},z:function(){return i}});var n=r(6826);function i(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return s(e)}function s(e){return 0===e.length?n.y:1===e.length?e[0]:function(t){return e.reduce(function(e,t){return t(e)},t)}}},67052:function(e,t,r){r.d(t,{h:function(){return s}});var n=r(94782),i=r(95631);function s(e){i.z.setTimeout(function(){var t=n.v.onUnhandledError;if(t)t(e);else throw e})}},68533:function(e,t,r){r.d(t,{z:function(){return n}});function n(e){return TypeError("You provided "+(null!==e&&"object"==typeof e?"an invali
1d object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}},37628:function(e,t,r){r.d(t,{E9:function(){return a},Y$:function(){return l},ah:function(){return g},p4:function(){return p}});var n,i,s=r(63927);let o=new WeakMap;function a(e){return{config:e,start:(t,r)=>{let{self:n,system:i,emit:s}=r,a={receivers:void 0,dispose:void 0};o.set(n,a),a.dispose=e({input:t.input,system:i,self:n,sendBack:e=>{"stopped"!==n.getSnapshot().status&&n._parent&&i._relay(n,n._parent,e)},receive:e=>{a.receivers??=new Set,a.receivers.add(e)},emit:s})},transition:(e,t,r)=>{let n=o.get(r.self);return t.type===s.X?(e={...e,status:"stopped",error:void 0},n.dispose?.()):n.receivers?.forEach(e=>e(t)),e},getInitialSnapshot:(e,t)=>({status:"active",output:void 0,error:void 0,input:t}),getPersistedSnapshot:e=>e,restoreSnapshot:e=>e}}let u="xstate.observable.error",c="xstate.observable.complete";function l(e){return{config:e,transition:(e,t)=>{if("active"!==e.status)return e;switch(t.type){case u:return{...e,status:"error",error:t.data,input:void 0,_subscription:void 0};case c:return{...e,status:"done",input:void 0,_subscription:void 0};case s.X:return e._subscription.unsubscribe(),{...e,status:"stopped",input:void 0,_subscription:void 0};default:return e}},getInitialSnapshot:(e,t)=>({status:"active",output:void 0,error:void 0,context:void 0,input:t,_subscription:void 0}),start:(t,{self:r,system:n,emit:i})=>{"done"!==t.status&&(t._subscription=e({input:t.input,system:n,self:r,emit:i}).subscribe({next:e=>{r._parent&&n._relay(r,r._parent,e)},error:e=>{n._relay(r,r,{type:u,data:e})},complete:()=>{n._relay(r,r,{type:c})}}))},getPersistedSnapshot:({_subscription:e,...t})=>t,restoreSnapshot:e=>({...e,_subscription:void 0})}}let h="xstate.promise.resolve",f="xstate.promise.reject",d=new WeakMap;function p(e){return{config:e,transition:(e,t,r)=>{if("active"!==e.status)return e;switch(t.type){case h:{let r=t.data;return{...e,status:"done",output:r,input:void 0}}case f:return{...e,status:"error",error:t.data,input:void 0};case s.X:return d.get(r.self)?.abort(),{...e,status:"stopped",input:void 0};default:return e}},start:(t,{self:r,system:n,emit:i})=>{if("active"!==t.status)return;let s=new AbortController;d.set(r,s),Promise.resolve(e({input:t.input,system:n,self:r,signal:s.signal,emit:i})).then(e=>{"active"===r.getSnapshot().status&&(d.delete(r),n._relay(r,r,{type:h,data:e}))},e=>{"active"===r.getSnapshot().status&&(d.delete(r),n._relay(r,r,{type:f,data:e}))})},getInitialSnapshot:(e,t)=>({status:"active",output:void 0,error:void 0,input:t}),getPersistedSnapshot:e=>e,restoreSnapshot:e=>e}}let y=(i=void 0,{config:n=e=>void 0,transition:(e,t,r)=>({...e,context:n(e.context,t,r)}),getInitialSnapshot:(e,t)=>({status:"active",output:void 0,error:void 0,context:"function"==typeof i?i({input:t}):i}),getPersistedSnapshot:e=>e,restoreSnapshot:e=>e});function g(){return(0,s.c)(y)}},31354:function(e,t,r){r.d(t,{a:function(){return s}});var n=r(63927);function i(e,t,r,i,{assignment:s}){if(!t.context)throw Error("Cannot assign to undefined `context`. Ensure that `context` is defined in the machine config.");let o={},a={context:t.context,event:r.event,spawn:function(e,{machine:t,context:r},i,s){let o=(o,a)=>{if("string"!=typeof o)return(0,n.c)(o,{id:a?.id,parent:e.self,syncSnapshot:a?.syncSnapshot,input:a?.input,src:o,systemId:a?.systemId});{let u=(0,n.R)(t,o);if(!u)throw Error(`Actor logic '${o}' not implemented in machine '${t.id}'`);let c=(0,n.c)(u,{id:a?.id,parent:e.self,syncSnapshot:a?.syncSnapshot,input:"function"==typeof a?.input?a.input({context:r,event:i,self:e.self}):a?.input,src:o,systemId:a?.systemId});return s[c.id]=c,c}};return(t,r)=>{let i=o(t,r);return s[i.id]=i,e.defer(()=>{i._processingStatus!==n.V.Stopped&&i.start()}),i}}(e,t,r.event,o),self:e.self,system:e.system},u={};if("function"==typeof s)u=s(a,i);else for(let e of Object.keys(s)){let t=s[e];u[e]="function"==typeof t?t(a,i):t}let c=Object.assign({},t.context,u);return[(0,n.W)(t,{context:c,children:Object.keys(o).length?{...t.children,...o}:t.children}),void 0,void 0]}function s(e){function t(e,t){}return t.type="xstate.assign",t.assignment=e,t.resolve=i,t}},76251:function(e,t,r){r.d(t,{a:function(){return g},b:function(){return d},e:function(){return u},s:function(){return p}});var n,i=r(63927),s=r(31354);function o(e,t,r,n,{event:i}){return[t,{event:"function"==typeof i?i(r,n):i},void 0]}function a(e,{event:t}){e.defer(()=>e.emit(t))}function u(e){function t(e,t){}return t.type="xstate.emit",t.event=e,t.resolve=o,t.execute=a,t}let c=((n={}).Parent="#_parent",n.Internal="#_internal",n);function l(e,t,r,n,{to:i,event:s,id:o,delay:a},u){let l,h;let f=t.machine.implementations.delays;if("string"==typeof s)throw Error(`Only event objects may be used with sendTo; use sendTo({ type: "${s}" }) instead`);let d="function"==typeof s?s(r,n):s;if("string"==typeof a){let e=f&&f[a];l="function"==typeof e?e(r,n):e}else l="function"==typeof a?a(r,n):a;let p="function"==typeof i?i(r,n):i;
1if("string"==typeof p){if(!(h=p===c.Parent?e.self._parent:p===c.Internal?e.self:p.startsWith("#_")?t.children[p.slice(2)]:u.deferredActorIds?.includes(p)?p:t.children[p]))throw Error(`Unable to send event to actor '${p}' from machine '${t.machine.id}'.`)}else h=p||e.self;return[t,{to:h,targetId:"string"==typeof p?p:void 0,event:d,id:o,delay:l},void 0]}function h(e,t,r){"string"==typeof r.to&&(r.to=t.children[r.to])}function f(e,t){e.defer(()=>{let{to:r,event:n,delay:s,id:o}=t;if("number"==typeof s){e.system.scheduler.schedule(e.self,r,n,s,o);return}e.system._relay(e.self,r,n.type===i.T?(0,i.U)(e.self.id,n.data):n)})}function d(e,t,r){function n(e,t){}return n.type="xstate.sendTo",n.to=e,n.event=t,n.id=r?.id,n.delay=r?.delay,n.resolve=l,n.retryResolve=h,n.execute=f,n}function p(e,t){return d(c.Parent,e,t)}function y(e,t,r,n,{collect:o}){let a=[],c=function(e){a.push(e)};return c.assign=(...e)=>{a.push((0,s.a)(...e))},c.cancel=(...e)=>{a.push((0,i.f)(...e))},c.raise=(...e)=>{a.push((0,i.r)(...e))},c.sendTo=(...e)=>{a.push(d(...e))},c.sendParent=(...e)=>{a.push(p(...e))},c.spawnChild=(...e)=>{a.push((0,i.h)(...e))},c.stopChild=(...e)=>{a.push((0,i.k)(...e))},c.emit=(...e)=>{a.push(u(...e))},o({context:r.context,event:r.event,enqueue:c,check:e=>(0,i.w)(e,t.context,r.event,t),self:e.self,system:e.system},n),[t,void 0,a]}function g(e){function t(e,t){}return t.type="xstate.enqueueActions",t.collect=e,t.resolve=y,t}},63927:function(e,t,r){var n;r.d(t,{$:function(){return k},B:function(){return K},C:function(){return eE},D:function(){return J},E:function(){return eq},F:function(){return Y},G:function(){return ew},H:function(){return function e(t,r,n,i){return"string"==typeof r?function(e,t,r,n){let i=eu(e,t).next(r,n);return i&&i.length?i:e.next(r,n)}(t,r,n,i):1===Object.keys(r).length?function(t,r,n,i){let s=Object.keys(r),o=e(eu(t,s[0]),r[s[0]],n,i);return o&&o.length?o:t.next(n,i)}(t,r,n,i):function(t,r,n,i){let s=[];for(let o of Object.keys(r)){let a=r[o];if(!a)continue;let u=e(eu(t,o),a,n,i);u&&s.push(...u)}return s.length?s:t.next(n,i)}(t,r,n,i)}},I:function(){return eb},J:function(){return d},K:function(){return eg},L:function(){return ea},M:function(){return g},N:function(){return a},O:function(){return Q},P:function(){return ec},Q:function(){return eT},R:function(){return $},S:function(){return o},T:function(){return c},U:function(){return f},V:function(){return T},W:function(){return ek},X:function(){return l},c:function(){return A},f:function(){return U},g:function(){return el},h:function(){return N},k:function(){return B},l:function(){return m},q:function(){return er},r:function(){return eA},t:function(){return b},u:function(){return x},v:function(){return et},w:function(){return V},x:function(){return C},y:function(){return ee},z:function(){return en}});let i=e=>{if("undefined"==typeof window)return;let t=function(){let e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==r.g?r.g:void 0;if(e.__xstate__)return e.__xstate__}();t&&t.register(e)};class s{constructor(e){this._process=e,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(e){let t={value:e,next:null};if(this._current){this._last.next=t,this._last=t;return}this._current=t,this._last=t,this._active&&this.flush()}flush(){for(;this._current;){let e=this._current;this._process(e.value),this._current=e.next}this._last=null}}let o=".",a="",u="xstate.init",c="xstate.error",l="xstate.stop";function h(e,t){return{type:`xstate.done.state.${e}`,output:t}}function f(e,t){return{type:`xstate.error.actor.${e}`,error:t,actorId:e}}function d(e){return{type:u,input:e}}function p(e){setTimeout(()=>{throw e})}let y="function"==typeof Symbol&&Symbol.observable||"@@observable";function g(e){if(_(e))return e;let t=[],r="";for(let n=0;n<e.length;n++){switch(e.charCodeAt(n)){case 92:r+=e[n+1],n++;continue;case 46:t.push(r),r="";
1continue}r+=e[n]}return t.push(r),t}function v(e){return e&&"object"==typeof e&&"machine"in e&&"value"in e?e.value:"string"!=typeof e?e:function(e){if(1===e.length)return e[0];let t={},r=t;for(let t=0;t<e.length-1;t++)if(t===e.length-2)r[e[t]]=e[t+1];else{let n=r;r={},n[e[t]]=r}return t}(g(e))}function m(e,t){let r={},n=Object.keys(e);for(let i=0;i<n.length;i++){let s=n[i];r[s]=t(e[s],s,e,i)}return r}function b(e){return void 0===e?[]:_(e)?e:[e]}function w(e,t,r,n){return"function"==typeof e?e({context:t,event:r,self:n}):e}function _(e){return Array.isArray(e)}function x(e){return(_(e)?e:[e]).map(e=>void 0===e||"string"==typeof e?{target:e}:e)}function E(e){if(void 0!==e&&""!==e)return b(e)}function S(e,t,r){let n="object"==typeof e,i=n?e:void 0;return{next:(n?e.next:e)?.bind(i),error:(n?e.error:t)?.bind(i),complete:(n?e.complete:r)?.bind(i)}}function C(e,t){return`${t}.${e}`}function $(e,t){let r=t.match(/^xstate\.invoke\.(\d+)\.(.*)/);if(!r)return e.implementations.actors[t];let[,n,i]=r,s=e.getStateNodeById(i).config.invoke;return(Array.isArray(s)?s[n]:s).src}function I(e,t){return`${e.sessionId}.${t}`}let R=0,q=!1,k=1,T=((n={})[n.NotStarted=0]="NotStarted",n[n.Running=1]="Running",n[n.Stopped=2]="Stopped",n),O={clock:{setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e)},logger:console.log.bind(console),devTools:!1};
1class j{constructor(e,t){this.logic=e,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=T.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={...O,...t},{clock:n,logger:i,parent:o,syncSnapshot:a,id:u,systemId:c,inspect:l}=r;this.system=o?o.system:function(e,t){let r=new Map,n=new Map,i=new WeakMap,s=new Set,o={},{clock:a,logger:u}=t,c={schedule:(e,t,r,n,i=Math.random().toString(36).slice(2))=>{let s={source:e,target:t,event:r,delay:n,id:i,startedAt:Date.now()},u=I(e,i);l._snapshot._scheduledEvents[u]=s;let c=a.setTimeout(()=>{delete o[u],delete l._snapshot._scheduledEvents[u],l._relay(e,t,r)},n);o[u]=c},cancel:(e,t)=>{let r=I(e,t),n=o[r];delete o[r],delete l._snapshot._scheduledEvents[r],void 0!==n&&a.clearTimeout(n)},cancelAll:e=>{for(let t in l._snapshot._scheduledEvents){let r=l._snapshot._scheduledEvents[t];r.source===e&&c.cancel(e,r.id)}}},l={_snapshot:{_scheduledEvents:(t?.snapshot&&t.snapshot.scheduler)??{}},_bookId:()=>`x:${R++}`,_register:(e,t)=>(r.set(e,t),e),_unregister:e=>{r.delete(e.sessionId);let t=i.get(e);void 0!==t&&(n.delete(t),i.delete(e))},get:e=>n.get(e),_set:(e,t)=>{let r=n.get(e);if(r&&r!==t)throw Error(`Actor with system ID '${e}' already exists.`);n.set(e,t),i.set(t,e)},inspect:e=>{let t=S(e);return s.add(t),{unsubscribe(){s.delete(t)}}},_sendInspectionEvent:t=>{if(!s.size)return;let r={...t,rootId:e.sessionId};s.forEach(e=>e.next?.(r))},_relay:(e,t,r)=>{l._sendInspectionEvent({type:"@xstate.event",sourceRef:e,actorRef:t,event:r}),t._send(r)},scheduler:c,getSnapshot:()=>({_scheduledEvents:{...l._snapshot._scheduledEvents}}),start:()=>{let e=l._snapshot._scheduledEvents;for(let t in l._snapshot._scheduledEvents={},e){let{source:r,target:n,event:i,delay:s,id:o}=e[t];c.schedule(r,n,i,s,o)}},_clock:a,_logger:u};return l}(this,{clock:n,logger:i}),l&&!o&&this.system.inspect(S(l)),this.sessionId=this.system._bookId(),this.id=u??this.sessionId,this.logger=t?.logger??this.system._logger,this.clock=t?.clock??this.system._clock,this._parent=o,this._syncSnapshot=a,this.options=r,this.src=r.src??e,this.ref=this,this._actorScope={self:this,id:this.id,sessionId:this.sessionId,logger:this.logger,defer:e=>{this._deferred.push(e)},system:this.system,stopChild:e=>{if(e._parent!==this)throw Error(`Cannot stop child actor ${e.id} of ${this.id} because it is not a child`);e._stop()},emit:e=>{let t=this.eventListeners.get(e.type),r=this.eventListeners.get("*");if(t||r)for(let n of[...t?t.values():[],...r?r.values():[]])n(e)},actionExecutor:e=>{let t=()=>{if(this._actorScope.system._sendInspectionEvent({type:"@xstate.action",actorRef:this,action:{type:e.type,params:e.params}}),!e.exec)return;let t=q;try{q=!0,e.exec(e.info,e.params)}finally{q=t}};this._processingStatus===T.Running?t():this._deferred.push(t)}},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(t?.snapshot??t?.state),c&&"active"!==this._snapshot.status&&this.system._unregister(this)}_initState(e){try{this._snapshot=e?this.logic.restoreSnapshot?this.logic.restoreSnapshot(e,this._actorScope):e:this.logic.getInitialSnapshot(this._actorScope,this.options?.input)}catch(e){this._snapshot={status:"error",output:void 0,error:e}}}update(e,t){let r;for(this._snapshot=e;r=this._deferred.shift();)try{r()}catch(t){this._deferred.length=0,this._snapshot={...e,status:"error",error:t}}switch(this._snapshot.status){case"active":for(let t of this.observers)try{t.next?.(e)}catch(e){p(e)}break;case"done":var n;for(let t of this.observers)try{t.next?.(e)}catch(e){p(e)}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:t,snapshot:e})}subscribe(e,t,r){let n=S(e,t,r);if(this._processingStatus!==T.Stopped)this.observers.add(n);else switch(this._snapshot.status){case"done":try{n.complete?.()}catch(e){p(e)}break;case"error":{let e=this._snapshot.error;if(n.error)try{n.error(e)}catch(e){p(e)}else p(e)}}return{unsubscribe:()=>{this.observers.delete(n)}}}on(e,t){let r=this.eventListeners.get(e);r||(r=new Set,this.eventListeners.set(e,r));let n=t.bind(void 0);return r.add(n),{unsubscribe:()=>{r.delete(n)}}}
1start(){if(this._processingStatus===T.Running)return this;this._syncSnapshot&&this.subscribe({next:e=>{"active"===e.status&&this.system._relay(this,this._parent,{type:`xstate.snapshot.${this.id}`,snapshot:e})},error:()=>{}}),this.system._register(this.sessionId,this),this._systemId&&this.system._set(this._systemId,this),this._processingStatus=T.Running;let e=d(this.options.input);switch(this.system._sendInspectionEvent({type:"@xstate.event",sourceRef:this._parent,actorRef:this,event:e}),this._snapshot.status){case"done":return this.update(this._snapshot,e),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(e){return this._snapshot={...this._snapshot,status:"error",error:e},this._error(e),this}return this.update(this._snapshot,e),this.options.devTools&&this.attachDevTools(),this.mailbox.start(),this}_process(e){let t,r;try{t=this.logic.transition(this._snapshot,e,this._actorScope)}catch(e){r={err:e}}if(r){let{err:e}=r;this._snapshot={...this._snapshot,status:"error",error:e},this._error(e);return}this.update(t,e),e.type===l&&(this._stopProcedure(),this._complete())}_stop(){return this._processingStatus===T.Stopped||((this.mailbox.clear(),this._processingStatus===T.NotStarted)?this._processingStatus=T.Stopped:this.mailbox.enqueue({type:l})),this}stop(){if(this._parent)throw Error("A non-root actor cannot be stopped directly.");return this._stop()}_complete(){for(let e of this.observers)try{e.complete?.()}catch(e){p(e)}this.observers.clear()}_reportError(e){if(!this.observers.size){this._parent||p(e);return}let t=!1;for(let r of this.observers){let n=r.error;t||=!n;try{n?.(e)}catch(e){p(e)}}this.observers.clear(),t&&p(e)}_error(e){this._stopProcedure(),this._reportError(e),this._parent&&this.system._relay(this,this._parent,f(this.id,e))}_stopProcedure(){return this._processingStatus!==T.Running||(this.system.scheduler.cancelAll(this),this.mailbox.clear(),this.mailbox=new s(this._process.bind(this)),this._processingStatus=T.Stopped,this.system._unregister(this)),this}_send(e){this._processingStatus!==T.Stopped&&this.mailbox.enqueue(e)}send(e){this.system._relay(void 0,this,e)}attachDevTools(){let{devTools:e}=this.options;e&&("function"==typeof e?e:i)(this)}toJSON(){return{xstate$$type:k,id:this.id}}getPersistedSnapshot(e){return this.logic.getPersistedSnapshot(this._snapshot,e)}[y](){return this}getSnapshot(){return this._snapshot}}function A(e,...[t]){return new j(e,t)}function P(e,t,r,n,{sendId:i}){return[t,{sendId:"function"==typeof i?i(r,n):i},void 0]}function D(e,t){e.defer(()=>{e.system.scheduler.cancel(e.self,t.sendId)})}function U(e){function t(e,t){}return t.type="xstate.cancel",t.sendId=e,t.resolve=P,t.execute=D,t}function M(e,t,r,n,{id:i,systemId:s,src:o,input:a,syncSnapshot:u}){let c,l;let h="string"==typeof o?$(t.machine,o):o,f="function"==typeof i?i(r):i;return h&&(l="function"==typeof a?a({context:t.context,event:r.event,self:e.self}):a,c=A(h,{id:f,src:o,parent:e.self,syncSnapshot:u,systemId:s,input:l})),[ek(t,{children:{...t.children,[f]:c}}),{id:i,systemId:s,actorRef:c,src:o,input:l},void 0]}function F(e,{actorRef:t}){t&&e.defer(()=>{t._processingStatus!==T.Stopped&&t.start()})}function N(...[e,{id:t,systemId:r,input:n,syncSnapshot:i=!1}={}]){function s(e,t){}return s.type="xstate.spawnChild",s.id=t,s.systemId=r,s.src=e,s.input=n,s.syncSnapshot=i,s.resolve=M,s.execute=F,s}function z(e,t,r,n,{actorRef:i}){let s="function"==typeof i?i(r,n):i,o="string"==typeof s?t.children[s]:s,a=t.children;return o&&(a={...a},delete a[o.id]),[ek(t,{children:a}),o,void 0]}function L(e,t){if(t){if(e.system._unregister(t),t._processingStatus!==T.Running){e.stopChild(t);return}e.defer(()=>{e.stopChild(t)})}}function B(e){function t(e,t){}return t.type="xstate.stopChild",t.actorRef=e,t.resolve=z,t.execute=L,t}function V(e,t,r,n){let{machine:i}=n,s="function"==typeof e,o=s?e:i.implementations.guards["string"==typeof e?e:e.type];if(!s&&!o)throw Error(`Guard '${"string"==typeof e?e:e.type}' is not implemented.'.`);if("function"!=typeof o)return V(o,t,r,n);let a={context:t,event:r},u=s||"string"==typeof e?void 0:"params"in e?"function"==typeof e.params?e.params({context:t,event:r}):e.params:void 0;return"check"in o?o.check(n,a,o):o(a,u)}let H=e=>"atomic"===e.type||"final"===e.type;function W(e){return Object.values(e.states).filter(e=>"history"!==e.type)}function X(e,t){let r=[];if(t===e)return r;let n=e.parent;for(;n&&n!==t;)r.push(n),n=n.parent;return r}function J(e){let t=new Set(e),r=Z(t);for(let e of t)if("compound"!==e.type||r.get(e)&&r.get(e).length){if("parallel"===e.type){for(let r of W(e))if("history"!==r.type&&!t.has(r))for(let e of eo(r))t.add(e)}}
1else eo(e).forEach(e=>t.add(e));for(let e of t){let r=e.parent;for(;r;)t.add(r),r=r.parent}return t}function Z(e){let t=new Map;for(let r of e)t.has(r)||t.set(r,[]),r.parent&&(t.has(r.parent)||t.set(r.parent,[]),t.get(r.parent).push(r));return t}function G(e,t){return function e(t,r){let n=r.get(t);if(!n)return{};if("compound"===t.type){let e=n[0];if(!e)return{};if(H(e))return e.key}let i={};for(let t of n)i[t.key]=e(t,r);return i}(e,Z(J(t)))}function Y(e,t){return"compound"===t.type?W(t).some(t=>"final"===t.type&&e.has(t)):"parallel"===t.type?W(t).every(t=>Y(e,t)):"final"===t.type}let Q=e=>"#"===e[0];function K(e,t){return e.transitions.get(t)||[...e.transitions.keys()].filter(e=>{if("*"===e)return!0;if(!e.endsWith(".*"))return!1;let r=e.split("."),n=t.split(".");for(let e=0;e<r.length;e++){let t=r[e],i=n[e];if("*"===t)return e===r.length-1;if(t!==i)return!1}return!0}).sort((e,t)=>t.length-e.length).flatMap(t=>e.transitions.get(t))}function ee(e){let t=e.config.after;if(!t)return[];let r=t=>{var r;let n=(r=e.id,{type:`xstate.after.${t}.${r}`}),i=n.type;return e.entry.push(eA(n,{id:i,delay:t})),e.exit.push(U(i)),i};return Object.keys(t).flatMap(e=>{let n=t[e],i=Number.isNaN(+e)?e:+e,s=r(i);return b("string"==typeof n?{target:n}:n).map(e=>({...e,event:s,delay:i}))}).map(t=>{let{delay:r}=t;return{...et(e,t.event,t),delay:r}})}function et(e,t,r){let n=E(r.target),i=r.reenter??!1,s=function(e,t){if(void 0!==t)return t.map(t=>{if("string"!=typeof t)return t;if(Q(t))return e.machine.getStateNodeById(t);let r=t[0]===o;if(r&&!e.parent)return ec(e,t.slice(1));let n=r?e.key+t:t;if(e.parent)try{return ec(e.parent,n)}catch(t){throw Error(`Invalid transition definition for state node '${e.id}':
2${t.message}`)}else throw Error(`Invalid target: "${t}" is not a valid target from the root node. Did you mean ".${t}"?`)})}(e,n),a={...r,actions:b(r.actions),guard:r.guard,target:s,source:e,reenter
2:i,eventType:t,toJSON:()=>({...a,source:`#${e.id}`,target:s?s.map(e=>`#${e.id}`):void 0})};return a}function er(e){let t=new Map;if(e.config.on)for(let r of Object.keys(e.config.on)){if(r===a)throw Error('Null events ("") cannot be specified as a transition key. Use `always: { ... }` instead.');let n=e.config.on[r];t.set(r,x(n).map(t=>et(e,r,t)))}if(e.config.onDone){let r=`xstate.done.state.${e.id}`;t.set(r,x(e.config.onDone).map(t=>et(e,r,t)))}for(let r of e.invoke){if(r.onDone){let n=`xstate.done.actor.${r.id}`;t.set(n,x(r.onDone).map(t=>et(e,n,t)))}if(r.onError){let n=`xstate.error.actor.${r.id}`;t.set(n,x(r.onError).map(t=>et(e,n,t)))}if(r.onSnapshot){let n=`xstate.snapshot.${r.id}`;t.set(n,x(r.onSnapshot).map(t=>et(e,n,t)))}}for(let r of e.after){let e=t.get(r.eventType);e||(e=[],t.set(r.eventType,e)),e.push(r)}return t}function en(e,t){let r="string"==typeof t?e.states[t]:t?e.states[t.target]:void 0;if(!r&&t)throw Error(`Initial state node "${t}" not found on parent state node #${e.id}`);let n={source:e,actions:t&&"string"!=typeof t?b(t.actions):[],eventType:null,reenter:!1,target:r?[r]:[],toJSON:()=>({...n,source:`#${e.id}`,target:r?[`#${r.id}`]:[]})};return n}function ei(e){let t=E(e.config.target);return t?{target:t.map(t=>"string"==typeof t?ec(e.parent,t):t)}:e.parent.initial}function es(e){return"history"===e.type}function eo(e){let t=ea(e);for(let r of t)for(let n of X(r,e))t.add(n);return t}function ea(e){let t=new Set;return!function e(r){if(!t.has(r)){if(t.add(r),"compound"===r.type)e(r.initial.target[0]);else if("parallel"===r.type)for(let t of W(r))e(t)}}(e),t}function eu(e,t){if(Q(t))return e.machine.getStateNodeById(t);if(!e.states)throw Error(`Unable to retrieve child state '${t}' from '${e.id}'; no child states exist.`);let r=e.states[t];if(!r)throw Error(`Child state '${t}' does not exist on '${e.id}'`);return r}function ec(e,t){if("string"==typeof t&&Q(t))try{return e.machine.getStateNodeById(t)}catch{}let r=g(t).slice(),n=e;for(;r.length;){let e=r.shift();if(!e.length)break;n=eu(n,e)}return n}function el(e,t){if("string"==typeof t){let r=e.states[t];if(!r)throw Error(`State '${t}' does not exist on '${e.id}'`);return[e,r]}let r=Object.keys(t),n=r.map(t=>eu(e,t)).filter(Boolean);return[e.machine.root,e].concat(n,r.reduce((r,n)=>{let i=eu(e,n);if(!i)return r;let s=el(i,t[n]);return r.concat(s)},[]))}function eh(e,t){let r=e;for(;r.parent&&r.parent!==t;)r=r.parent;return r.parent===t}function ef(e,t,r){let n=new Set;for(let i of e){let e=!1,s=new Set;for(let o of n)if(function(e,t){let r=new Set(e),n=new Set(t);for(let e of r)if(n.has(e))return!0;for(let e of n)if(r.has(e))return!0;return!1}(ey([i],t,r),ey([o],t,r))){if(eh(i.source,o.source))s.add(o);else{e=!0;break}}if(!e){for(let e of s)n.delete(e);n.add(i)}}return Array.from(n)}function ed(e,t){if(!e.target)return[];let r=new Set;for(let n of e.target)if(es(n)){if(t[n.id])for(let e of t[n.id])r.add(e);else for(let e of ed(ei(n),t))r.add(e)}else r.add(n);return[...r]}function ep(e,t){let r=ed(e,t);if(!r)return;if(!e.reenter&&r.every(t=>t===e.source||eh(t,e.source)))return e.source;let n=function(e){let[t,...r]=e;for(let e of X(t,void 0))if(r.every(t=>eh(t,e)))return e}(r.concat(e.source));return n||(e.reenter?void 0:e.source.machine.root)}function ey(e,t,r){let n=new Set;for(let i of e)if(i.target?.length){let e=ep(i,r);for(let r of(i.reenter&&i.source===e&&n.add(e),t))eh(r,e)&&n.add(r)}return[...n]}function eg(e,t,r,n,i,s){if(!e.length)return t;let o=new Set(t._nodes),a=t.historyValue,u=ef(e,o,a),c=t;i||([c,a]=function(e,t,r,n,i,s,o,a){let u,c=e,l=ey(n,i,s);for(let e of(l.sort((e,t)=>t.order-e.order),l))for(let t of function(e){return Object.keys(e.states).map(t=>e.states[t]).filter(e=>"history"===e.type)}(e)){let r;r="deep"===t.history?t=>H(t)&&eh(t,e):t=>t.parent===e,(u??={...s})[t.id]=Array.from(i).filter(r)}for(let e of l)c=eb(c,t,r,[...e.exit,...e.invoke.map(e=>B(e.id))],o,void 0),i.delete(e);return[c,u||s]}(c,n,r,u,o,a,s,r.actionExecutor)),c=function(e,t,r,n,i,s,o,a){let u=e,c=new Set,l=new Set;(function(e,t,r,n){for(let i of e){let e=ep(i,t);for(let s of i.target||[])!es(s)&&(i.source!==s||i.source!==e||i.reenter)&&(n.add(s),r.add(s)),ev(s,t,r,n);for(let s of ed(i,t)){let o=X(s,e);e?.type==="parallel"&&o.push(e),em(n,t,r,o,!i.source.parent&&i.reenter?void 0:e)}}})(n,o,l,c),a&&l.add(e.machine.root);let f=new Set;for(let e of[...c].sort((e,t)=>
2e.order-t.order)){i.add(e);let n=[];for(let t of(n.push(...e.entry),e.invoke))n.push(N(t.src,{...t,syncSnapshot:!!t.onSnapshot}));if(l.has(e)){let t=e.initial.actions;n.push(...t)}if(u=eb(u,t,r,n,s,e.invoke.map(e=>e.id)),"final"===e.type){let n=e.parent,o=n?.type==="parallel"?n:n?.parent,a=o||e;for(n?.type==="compound"&&s.push(h(n.id,void 0!==e.output?w(e.output,u.context,t,r.self):void 0));o?.type==="parallel"&&!f.has(o)&&Y(i,o);)f.add(o),s.push(h(o.id)),a=o,o=o.parent;if(o)continue;u=ek(u,{status:"done",output:function(e,t,r,n,i){if(void 0===n.output)return;let s=h(i.id,void 0!==i.output&&i.parent?w(i.output,e.context,t,r.self):void 0);return w(n.output,e.context,s,r.self)}(u,t,r,u.machine.root,a)})}}return u}(c=eb(c,n,r,u.flatMap(e=>e.actions),s,void 0),n,r,u,o,s,a,i);let l=[...o];"done"===c.status&&(c=eb(c,n,r,l.sort((e,t)=>t.order-e.order).flatMap(e=>e.exit),s,void 0));try{if(a===t.historyValue&&function(e,t){if(e.length!==t.size)return!1;for(let r of e)if(!t.has(r))return!1;return!0}(t._nodes,o))return c;return ek(c,{_nodes:l,historyValue:a})}catch(e){throw e}}function ev(e,t,r,n){if(es(e)){if(t[e.id]){let i=t[e.id];for(let e of i)n.add(e),ev(e,t,r,n);for(let s of i)em(n,t,r,X(s,e.parent))}else{let i=ei(e);for(let s of i.target)n.add(s),i===e.parent?.initial&&r.add(e.parent),ev(s,t,r,n);for(let s of i.target)em(n,t,r,X(s,e.parent))}}else if("compound"===e.type){let[i]=e.initial.target;es(i)||(n.add(i),r.add(i)),ev(i,t,r,n),em(n,t,r,X(i,e))}else if("parallel"===e.type)for(let i of W(e).filter(e=>!es(e)))[...n].some(e=>eh(e,i))||(es(i)||(n.add(i),r.add(i)),ev(i,t,r,n))}function em(e,t,r,n,i){for(let s of n)if((!i||eh(s,i))&&e.add(s),"parallel"===s.type)for(let n of W(s).filter(e=>!es(e)))[...e].some(e=>eh(e,n))||(e.add(n),ev(n,t,r,e))}function eb(e,t,r,n,i,s){let o=s?[]:void 0,a=function e(t,r,n,i,s,o){let{machine:a}=t,u=t;for(let t of i){var c;let i="function"==typeof t,l=i?t:(c="string"==typeof t?t:t.type,a.implementations.actions[c]),h={context:u.context,event:r,self:n.self,system:n.system},f=i||"string"==typeof t?void 0:"params"in t?"function"==typeof t.params?t.params({context:u.context,event:r}):t.params:void 0;if(!l||!("resolve"in l)){n.actionExecutor({type:"string"==typeof t?t:"object"==typeof t?t.type:t.name||"(anonymous)",info:h,params:f,exec:l});continue}let[d,p,y]=l.resolve(n,u,h,f,l,s);u=d,"retryResolve"in l&&o?.push([l,p]),"execute"in l&&n.actionExecutor({type:l.type,info:h,params:p,exec:l.execute.bind(null,n,p)}),y&&(u=e(u,r,n,y,s,o))}return u}(e,t,r,n,{internalQueue:i,deferredActorIds:s},o);return o?.forEach(([e,t])=>{e.retryResolve(r,a,t)}),a}function ew(e,t,r,n){let i=e,s=[];function o(e,t,n){r.system._sendInspectionEvent({type:"@xstate.microstep",actorRef:r.self,event:t,snapshot:e,_transitions:n}),s.push(e)}if(t.type===l)return o(i=ek(e_(i,t,r),{status:"stopped"}),t,[]),{snapshot:i,microstates:s};let a=t;if(a.type!==u){let t=a,u=t.type.startsWith("xstate.error.actor"),c=ex(t,i);if(u&&!c.length)return o(i=ek(e,{status:"error",error:t.error}),t,[]),{snapshot:i,microstates:s};o(i=eg(c,e,r,a,!1,n),t,c)}let c=!0;for(;"active"===i.status;){let e=c?function(e,t){let r=new Set;for(let n of e._nodes.filter(H))e:for(let i of[n].concat(X(n,void 0)))if(i.always){for(let n of i.always)if(void 0===n.guard||V(n.guard,e.context,t,e)){r.add(n);break e}}return ef(Array.from(r),new Set(e._nodes),e.historyValue)}(i,a):[],t=e.length?i:void 0;if(!e.length){if(!n.length)break;e=ex(a=n.shift(),i)}c=(i=eg(e,i,r,a,!1,n))!==t,o(i,a,e)}return"active"!==i.status&&e_(i,a,r),{snapshot:i,microstates:s}}function e_(e,t,r){return eb(e,t,r,Object.values(e.children).map(e=>B(e)),[],void 0)}function ex(e,t){return t.machine.getTransitionData(t,e)}function eE(e,t){let r=J(el(e,t));return G(e,[...r])}let eS=function(e){return function e(t,r){let n=v(t),i=v(r);return"string"==typeof i?"string"==typeof n&&i===n:"string"==typeof n?n in i:Object.keys(n).every(t=>t in i&&e(n[t],i[t]))}(e,this.value)},eC=function(e){return this.tags.has(e)},e$=function(e){let t=this.machine.getTransitionData(this,e);return!!t?.length&&t.some(e=>void 0!==e.target||e.actions.length)},eI=function(){let{_nodes:e,tags:t,machine:r,getMeta:n,toJSON:i,can:s,hasTag:o,matches:a,...u}=this;return{...u,tags:Array.from(t)}},eR=function(){return this._nodes.reduce((e,t)=>
2(void 0!==t.meta&&(e[t.id]=t.meta),e),{})};function eq(e,t){return{status:e.status,output:e.output,error:e.error,machine:t,context:e.context,_nodes:e._nodes,value:G(t.root,e._nodes),tags:new Set(e._nodes.flatMap(e=>e.tags)),children:e.children,historyValue:e.historyValue||{},matches:eS,hasTag:eC,can:e$,getMeta:eR,toJSON:eI}}function ek(e,t={}){return eq({...e,...t},e.machine)}function eT(e,t){let{_nodes:r,tags:n,machine:i,children:s,context:o,can:a,hasTag:u,matches:c,getMeta:l,toJSON:h,...f}=e,d={};for(let e in s){let r=s[e];d[e]={snapshot:r.getPersistedSnapshot(t),src:r.src,systemId:r._systemId,syncSnapshot:r._syncSnapshot}}return{...f,context:function e(t){let r;for(let n in t){let i=t[n];if(i&&"object"==typeof i){if("sessionId"in i&&"send"in i&&"ref"in i)(r??=Array.isArray(t)?t.slice():{...t})[n]={xstate$$type:k,id:i.id};else{let s=e(i);s!==i&&((r??=Array.isArray(t)?t.slice():{...t})[n]=s)}}}return r??t}(o),children:d,historyValue:function(e){if("object"!=typeof e||null===e)return{};let t={};for(let r in e){let n=e[r];Array.isArray(n)&&(t[r]=n.map(e=>({id:e.id})))}return t}(f.historyValue)}}function eO(e,t,r,n,{event:i,id:s,delay:o},{internalQueue:a}){let u;let c=t.machine.implementations.delays;if("string"==typeof i)throw Error(`Only event objects may be used with raise; use raise({ type: "${i}" }) instead`);let l="function"==typeof i?i(r,n):i;if("string"==typeof o){let e=c&&c[o];u="function"==typeof e?e(r,n):e}else u="function"==typeof o?o(r,n):o;return"number"!=typeof u&&a.push(l),[t,{event:l,id:s,delay:u},void 0]}function ej(e,t){let{event:r,delay:n,id:i}=t;if("number"==typeof n){e.defer(()=>{let t=e.self;e.system.scheduler.schedule(t,t,r,n,i)});return}}function eA(e,t){function r(e,t){}return r.type="xstate.raise",r.event=e,r.id=t?.id,r.delay=t?.delay,r.resolve=eO,r.execute=ej,r}},92580:function(e,t,r){r.d(t,{ZD:function(){return h},cY:function(){return f}}),r(37628);var n=r(63927),i=r(31354);let s=new WeakMap;function o(e,t,r){let n=s.get(e);return n?t in n||(n[t]=r()):(n={[t]:r()},s.set(e,n)),n[t]}let a={},u=e=>"string"==typeof e?{type:e}:"function"==typeof e?"resolve"in e?{type:e.type}:{type:e.name}:e;class c{constructor(e,t){if(this.config=e,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=t._parent,this.key=t._key,this.machine=t._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.l)(this.config.states,(e,t)=>new c(e,{_parent:this,_key:t,_machine:this.machine})):a,"compound"===this.type&&!this.config.initial)throw Error(`No initial state specified for compound 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)(e.tags).slice()}_initialize(){this.transitions=(0,n.q)(this),this.config.always&&(this.always=(0,n.u)(this.config.always).map(e=>(0,n.v)(this,n.N,e))),Object.keys(this.states).forEach(e=>{this.states[e]._initialize()})}get definition(){return{id:this.id,key:this.key,version:this.machine.version,type:this.t
2ype,initial:this.initial?{target:this.initial.target,source:this,actions:this.initial.actions.map(u),eventType:null,reenter:!1,toJSON:()=>({target:this.initial.target.map(e=>`#${e.id}`),source:`#${this.id}`,actions:this.initial.actions.map(u),eventType:null})}:void 0,history:this.history,states:(0,n.l)(this.states,e=>e.definition),on:this.on,transitions:[...this.transitions.values()].flat().map(e=>({...e,actions:e.actions.map(u)})),entry:this.entry.map(u),exit:this.exit.map(u),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 o(this,"invoke",()=>(0,n.t)(this.config.invoke).map((e,t)=>{let{src:r,systemId:i}=e,s=e.id??(0,n.x)(this.id,t),o="string"==typeof r?r:`xstate.invoke.${(0,n.x)(this.id,t)}`;return{...e,src:o,id:s,systemId:i,toJSON(){let{onDone:t,onError:r,...n}=e;return{...n,type:"xstate.invoke",src:o,id:s}}}}))}get on(){return o(this,"on",()=>[...this.transitions].flatMap(([e,t])=>t.map(t=>[e,t])).reduce((e,[t,r])=>(e[t]=e[t]||[],e[t].push(r),e),{}))}get after(){return o(this,"delayedTransitions",()=>(0,n.y)(this))}get initial(){return o(this,"initial",()=>(0,n.z)(this,this.config.initial))}next(e,t){let r;let i=t.type,s=[];for(let a of o(this,`candidates-${i}`,()=>(0,n.B)(this,i))){let{guard:o}=a,u=e.context,c=!1;try{c=!o||(0,n.w)(o,u,t,e)}catch(t){let e="string"==typeof o?o:"object"==typeof o?o.type:void 0;throw Error(`Unable to evaluate guard ${e?`'${e}' `:""}in transition for event '${i}' in state node '${this.id}':
3${t.message}`)}if(c){s.push(...a.actions),r=a;break}}return r?[r]:void 0}get events(){return o(this,"events",()=>{let{states:e}=this,t=new Set(this.ownEvents);if(e)for(let r of Object.keys(e)){let n=e[r];if(n.states)for(let e of n.events)t.add(`${e}`)}return Array.from(t)})}get ownEvents(){return Array.from(new Set([...this.transitions.keys()].filter(e=>this.transitions.get(e).some(e=>!(!e.target&&!e.actions.length&&!e.reenter)))))}}class l{constructor(e,t){this.config=e,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=e.id||"(machine)",this.implementations={actors:t?.actors??{},actions:t?.actions??{},delays:t?.delays??{},guards:t?.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 c(e,{_key:this.id,_machine:this}),this.root._initialize(),this.states=this.root.states,this.events=this.root.events}provide(e){let{actions:t,guards:r,actors:n,delays:i}=this.implementations;return new l(this.config,{actions:{...t,...e.actions},guards:{...r,...e.guards},actors:{...n,...e.actors},delays:{...i,...e.delays}})}resolveState(e){let t=(0,n.C)(this.root,e.value),r=(0,n.D)((0,n.g)(this.root,t));return(0,n.E)({_nodes:[...r],context:e.context||{},children:{},status:(0,n.F)(r,this.root)?"done":e.status||"active",output:e.output,error:e.error,historyValue:e.historyValue},this)}transition(e,t,r){return(0,n.G)(e,t,r,[]).snapshot}microstep(e,t,r){return(0,n.G)(e,t,r,[]).microstates}getTransitionData(e,t){return(0,n.H)(this.root,e.value,e,t)||[]}getPreInitialState(e,t,r){let{context:s}=this.config,o=(0,n.E)({context:"function"!=typeof s&&s?s:{},_nodes:[this.root],children:{},status:"active"},this);return"function"==typeof s?(0,n.I)(o,t,e,[(0,i.a)(({spawn:e,event:t,self:r})=>s({spawn:e,input:t.input,self:r}))],r,void 0):o}getInitialSnapshot(e,t){let r=(0,n.J)(t),i=[],s=this.getPreInitialState(e,r,i),o=(0,n.K)([{target:[...(0,n.L)(this.root)],source:this.root,reenter:!0,actions:[],eventType:null,toJSON:null}],s,e,r,!0,i),{snapshot:a}=(0,n.G)(o,r,e,i);return a}start(e){Object.values(e.children).forEach(e=>{"active"===e.getSnapshot().status&&e.start()})}getStateNodeById(e){let t=(0,n.M)(e),r=t.slice(1),i=(0,n.O)(t[0])?t[0].slice(1):t[0],s=this.idMap.get(i);if(!s)throw Error(`Child state node '#${i}' does not exist on machine '${this.id}'`);return(0,n.P)(s,r)}get definition(){return this.root.definition}toJSON(){return this.definition}getPersistedSnapshot(e,t){return(0,n.Q)(e,t)}restoreSnapshot(e,t){let r={},i=e.children;
3Object.keys(i).forEach(e=>{let s=i[e],o=s.snapshot,a=s.src,u="string"==typeof a?(0,n.R)(this,a):a;if(!u)return;let c=(0,n.c)(u,{id:e,parent:t.self,syncSnapshot:s.syncSnapshot,snapshot:o,src:a,systemId:s.systemId});r[e]=c});let s=function(e,t){if(!t||"object"!=typeof t)return{};let r={};for(let n in t)for(let i of t[n]){let t=function(e,t){if(t instanceof c)return t;try{return e.machine.getStateNodeById(t.id)}catch{}}(e,i);t&&(r[n]??=[],r[n].push(t))}return r}(this.root,e.historyValue),o=(0,n.E)({...e,children:r,_nodes:Array.from((0,n.D)((0,n.g)(this.root,e.value))),historyValue:s},this),a=new Set;return!function e(t,r){if(!a.has(t))for(let i in a.add(t),t){let s=t[i];if(s&&"object"==typeof s){if("xstate$$type"in s&&s.xstate$$type===n.$){t[i]=r[s.id];continue}e(s,r)}}}(o.context,r),o}}function h(e,t){let r=(0,n.t)(t);if(!r.includes(e.type)){let t=1===r.length?`type "${r[0]}"`:`one of types "${r.join('", "')}"`;throw Error(`Expected event ${JSON.stringify(e)} to have ${t}`)}}function f({schemas:e,actors:t,actions:r,guards:n,delays:i}){return{createMachine:s=>new l({...s,schemas:e},{actors:t,actions:r,guards:n,delays:i})}}},26795:function(e,t,r){r.d(t,{Cb:function(){return y},XL:function(){return m},Y_:function(){return g},eB:function(){return b},eT:function(){return f},qy:function(){return v},tZ:function(){return _},vs:function(){return w}});let n=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/_key\s*==\s*['"](.*)['"]/,s=/^\d*:\d*$/;function o(e){return"number"==typeof e||"string"==typeof e&&/^\[\d+\]$/.test(e)}function a(e){return"string"==typeof e?i.test(e.trim()):"object"==typeof e&&"_key"in e}function u(e){if("string"==typeof e&&s.test(e))return!0;if(!Array.isArray(e)||2!==e.length)return!1;let[t,r]=e;return("number"==typeof t||""===t)&&("number"==typeof r||""===r)}function c(e){if(!Array.isArray(e))throw Error("Path is not an array");return e.reduce((e,t,r)=>{let n=typeof t;if("number"===n)return`${e}[${t}]`;if("string"===n)return`${e}${0===r?"":"."}${t}`;if(a(t)&&t._key)return`${e}[_key=="${t._key}"]`;if(Array.isArray(t)){let[r,n]=t;return`${e}[${r}:${n}]`}throw Error(`Unsupported path segment \`${JSON.stringify(t)}\``)},"")}function l(e){if("string"!=typeof e)throw Error("Path is not a string");let t=e.match(n);if(!t)throw Error("Invalid path string");return t.map(h)}function h(e){return o(e)?Number(e.replace(/[^\d]/g,"")):a(e)?{_key:e.match(i)[1]}:u(e)?function(e){let[t,r]=e.split(":").map(e=>""===e?e:Number(e));return[t,r]}(e):e}var f=Object.freeze({__proto__:null,fromString:l,get:function(e,t,r){let n="string"==typeof t?l(t):t;if(!Array.isArray(n))throw Error("Path must be an array or a string");let i=e;for(let e=0;e<n.length;e++){let t=n[e];if(o(t)){if(!Array.isArray(i))return r;i=i[t]}if(a(t)){if(!Array.isArray(i))return r;i=i.find(e=>e._key===t._key)}if("string"==typeof t&&(i="object"==typeof i&&null!==i?i[t]:void 0),typeof i>"u")return r}return i},isIndexSegment:o,isIndexTuple:u,isKeySegment:a,reKeySegment:i,toString:c});let d="drafts.",p="versions.";function y(e){return e.startsWith(d)}function g(e){return e.startsWith(p)}function v(e){return g(e)?d+w(e):y(e)?e:d+e}function m(e,t){if("drafts"===t||"published"===t)throw Error('Version can not be "published" or "drafts"');return`${p}${t}.${w(e)}`}function b(e){if(!g(e))return;let[t,r,...n]=e.split(".");return r}function w(e){return g(e)?e.split(".").slice(2).join("."):y(e)?e.slice(d.length):e}function _(e){let{baseUrl:t,workspace:r="default",tool:n="default",id:i,type:s,path:o,projectId:a,dataset:u}=e;if(!t)throw Error("baseUrl is required");if(!o)throw Error("path is required");if(!i)throw Error("id is required");if("/"!==t&&t.endsWith("/"))throw Error("baseUrl must not end with a slash");let l="default"===r?void 0:r,h="default"===n?void 0:n,f=w(i),d=Array.isArray(o)?c(o.map(e=>{if("string"==typeof e||"number"==typeof e)return e;if(""!==e._key)return{_key:e._key};if(-1!==e._index)return e._index;throw Error(`invalid segment:${JSON.stringify(e)}`)})):o,p=new URLSearchParams({baseUrl:t,id:f,type:s,path:d});if(l&&p.set("workspace",l),h&&p.set("tool",h),a&&p.set("projectId",a),u&&p.set("dataset",u),y(i)||g(i)){if(g(i)){let e=b(i);p.set("perspective",e)}}else p.set("perspective","published");let v=["/"===t?"":t];l&&v.push(l);let m=["mode=presentation",`id=${f}`,`type=${s}`,`path=${encodeURIComponent(d)}`];return h&&m.push(`tool=${h}`),v.push("intent","edit",`${m.join(";")}?${p}`),v.join("/")}},57239:function(e,t,r){function n(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}r.d(t,{C:function(){return a},NG:function(){return l},Uy:function(){return n}});var i={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},o=[,,,,].fill(String.fromCodePoint(s[0])).join("");function a(e,t,r="auto"){let n;return!0===r||"auto"===r&&(!(!Number.isNaN(Number(e))||/[a-z]/i.test(e)&&!/\d+(?:[-:\/]\d+){2}(?:T\d+(?:[-:\/]\d+){1,2}(\.\d+)?Z?)?/.test(e))&&Date.parse(e)||function(e){try{new URL(e,e.startsWith("/")?"https://acme.com":void 0)}catch{return!1}return!0}(e))?e:`${e}${n=JSON.stringify(t),`${o}${Array.from(n).map(e=>{let t=e.charCodeAt(0);if(t>255)throw Error(`Only ASCII edit info can be encoded. Error attempting to encode ${n} on character ${e} (${t})`);return Array.from(t.toString(4).padStart(4,"0")).map(e=>String.fromCodePoint(s[e])).join("")}).join("")}`}`}Object.fromEntries(Object.entries(s).map(e=>e.reverse())),Object.fromEntries(Object.entries(i).map(e=>e.reverse()));var u=`${Object.values(i).map(e=>`\\u{${e.toString(16)}}`).join("")}`,c=RegExp(`[${u}]{4,}`,"gu");function l(e){var t,r;return e&&JSON.parse({cleaned:(t=JSON.stringify(e)).replace(c,""),encoded:(null==(r=t.match(c))?void 0:r[0])||""}.cleaned)}},95958:function(e,t,r){let n;r.d(t,{yK:function(){return N},Hq:function(){return B},ei:function(){return W},bK:function(){return V},Ol:function(){return H},UE:function(){return L},Ag:function(){return z},F8:function(){return F},dS:function(){return G},zB:function(){return Z},lB:function(){return J}});var i={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let s=new Uint8Array(16),o=[];for(let e=0;e<256;++e)o.push((e+256).toString(16).slice(1));var a=function(e,t,r){if(i.randomUUID&&!t&&!e)return i.randomUUID();let a=(e=e||{}
3).random??e.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(s)}();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,t){if((r=r||0)<0||r+16>t.length)throw RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[r+e]=a[e];return t}return function(e,t=0){return(o[e[t+0]]+o[e[t+1]]+o[e[t+2]]+o[e[t+3]]+"-"+o[e[t+4]]+o[e[t+5]]+"-"+o[e[t+6]]+o[e[t+7]]+"-"+o[e[t+8]]+o[e[t+9]]+"-"+o[e[t+10]]+o[e[t+11]]+o[e[t+12]]+o[e[t+13]]+o[e[t+14]]+o[e[t+15]]).toLowerCase()}(a)},u=r(37628),c=r(92580),l=r(76251),h=r(31354),f=r(63927),d=r(5570),p=r(71655),y=r(55832),g=r(92882),v=r(67871),m=r(50897),b=r(3938),w=r(66787),_=["addListener","removeListener"],x=["addEventListener","removeEventListener"],E=["on","off"];function S(e,t,r,n){if((0,b.m)(r)&&(n=r,r=void 0),n)return S(e,t,r).pipe((0,w.Z)(n));var i=(0,p.CR)((0,b.m)(e.addEventListener)&&(0,b.m)(e.removeEventListener)?x.map(function(n){return function(i){return e[n](t,i,r)}}):(0,b.m)(e.addListener)&&(0,b.m)(e.removeListener)?_.map(C(e,t)):(0,b.m)(e.on)&&(0,b.m)(e.off)?E.map(C(e,t)):[],2),s=i[0],o=i[1];if(!s&&(0,m.z)(e))return(0,v.z)(function(e){return S(e,t,r)})((0,y.Xf)(e));if(!s)throw TypeError("Invalid event target");return new g.y(function(e){var t=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.next(1<t.length?t:t[0])};return s(t),function(){return o(t)}})}function C(e,t){return function(r){return function(n){return e[r](t,n)}}}var $=r(12373),I=r(29681),R=r(31650),q=r(70881),k=r(67071),T=r(55174),O=r(52209);function j(e){return e<=0?function(){return O.E}:(0,q.e)(function(t,r){var n=0;t.subscribe((0,k.x)(r,function(t){++n<=e&&(r.next(t),e<=n&&r.complete())}))})}var A=r(65980);let P=e=>({context:t})=>{let{count:r,include:n,exclude:i,responseType:s="message.received"}=e;return{count:r,domain:t.domain,from:t.connectTo,include:n?Array.isArray(n)?n:[n]:[],exclude:i?Array.isArray(i)?i:[i]:[],responseType:s,target:t.target,to:t.name}},D=e=>t=>{let{data:r}=t;return(!e.include.length||e.include.includes(r.type))&&(!e.exclude.length||!e.exclude.includes(r.type))&&r.domain===e.domain&&r.from===e.from&&r.to===e.to&&(!e.target||t.source===e.target)},U=e=>t=>({type:e,message:t}),M=(0,d.P)(()=>S(window,"message")),F=e=>(0,u.Y$)(({input:t})=>{var r,n,i,s;return M.pipe(e?(0,$.U)(e):(0,I.z)(),(0,R.h)(D(t)),(0,$.U)(U(t.responseType)),t.count?(0,I.z)((r=t.count,void 0===n&&(n=null),n=null!=n?n:r,(0,q.e)(function(e,t){var i=[],s=0;e.subscribe((0,k.x)(t,function(e){var o,a,u,c,l=null;s++%n==0&&i.push([]);try{for(var h=(0,p.XA)(i),f=h.next();!f.done;f=h.next()){var d=f.value;d.push(e),r<=d.length&&(l=null!=l?l:[]).push(d)}}catch(e){o={error:e}}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.XA)(l),g=y.next();!g.done;g=y.next()){var d=g.value;(0,T.P)(i,d),t.next(d)}}catch(e){u={error:e}}finally{try{g&&!g.done&&(c=y.return)&&c.call(y)}finally{if(u)throw u.error}}},function(){var e,r;try{for(var n=(0,p.XA)(i),s=n.next();!s.done;s=n.next()){var o=s.value;t.next(o)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(r=n.return)&&r.call(n)}finally{if(e)throw e.error}}t.complete()},void 0,function(){i=null}))})),(i=e=>e,(0,b.m)(void 0)?(0,v.z)(i,s,1):(0,v.z)(i,1)),j(t.count)):(0,I.z)())}),N="sanity/comlink",z="comlink/response",L="comlink/heartbeat",B="comlink/disconnect",V="comlink/handshake/syn",H="comlink/handshake/syn-ack",W="comlink/handshake/ack",X=e=>t=>t.pipe(j(1),(0,$.U)(()=>{throw Error(e)})),J=()=>(0,c.cY)({types:{},actors:{listen:(0,u.Y$)(({input:e})=>{let t=e.signal?S(e.signal,"abort").pipe(X(`Request ${e.requestId} aborted`)):O.E;return S(window,"message").pipe((0,R.h)(t=>t.data?.type===z&&t.data?.responseTo===e.requestId&&!!t.source&&e.sources.has(t.source)),j(e.sources.size),(0,q.e)(function(e,r){(0,y.Xf)(t).subscribe((0,k.x)(r,function(){return r.complete()},A.Z)),r.closed||e.subscribe(r)}))})},actions:{"send message":({context:e},t)=>{let{sources:r,targetOrigin:n}=e,{message:i}=t;
3r.forEach(e=>{e.postMessage(i,{targetOrigin:n})})},"on success":(0,l.b)(({context:e})=>e.parentRef,({context:e,self:t})=>(e.response&&e.resolvable?.resolve(e.response),{type:"request.success",requestId:t.id,response:e.response,responseTo:e.responseTo})),"on fail":(0,l.b)(({context:e})=>e.parentRef,({context:e,self:t})=>(e.suppressWarnings||console.warn(`[@sanity/comlink] Received no response to message '${e.type}' on client '${e.from}' (ID: '${e.id}').`),e.resolvable?.reject(Error("No response received")),{type:"request.failed",requestId:t.id})),"on abort":(0,l.b)(({context:e})=>e.parentRef,({context:e,self:t})=>(e.resolvable?.reject(Error("Request aborted")),{type:"request.aborted",requestId:t.id}))},guards:{expectsResponse:({context:e})=>e.expectResponse},delays:{initialTimeout:0,responseTimeout:({context:e})=>e.responseTimeout??3e3}}).createMachine({context:({input:e})=>({channelId:e.channelId,data:e.data,domain:e.domain,expectResponse:e.expectResponse??!1,from:e.from,id:`msg-${a()}`,parentRef:e.parentRef,resolvable:e.resolvable,response:null,responseTimeout:e.responseTimeout,responseTo:e.responseTo,signal:e.signal,sources:e.sources instanceof Set?e.sources:new Set([e.sources]),suppressWarnings:e.suppressWarnings,targetOrigin:e.targetOrigin,to:e.to,type:e.type}),initial:"idle",on:{abort:".aborted"},states:{idle:{after:{initialTimeout:[{target:"sending"}]}},sending:{entry:{type:"send message",params:({context:e})=>{let{channelId:t,data:r,domain:n,from:i,id:s,responseTo:o,to:a,type:u}=e;return{message:{channelId:t,data:r,domain:n,from:i,id:s,to:a,type:u,responseTo:o}}}},always:[{guard:"expectsResponse",target:"awaiting"},"success"]},awaiting:{invoke:{id:"listen for response",src:"listen",input:({context:e})=>({requestId:e.id,sources:e.sources,signal:e.signal}),onError:"aborted"},after:{responseTimeout:"failed"},on:{message:{actions:(0,h.a)({response:({event:e})=>e.data.data,responseTo:({event:e})=>e.data.responseTo}),target:"success"}}},failed:{type:"final",entry:"on fail"},success:{type:"final",entry:"on success"},aborted:{type:"final",entry:"on abort"}},output:({context:e,self:t})=>({requestId:t.id,response:e.response,responseTo:e.responseTo})});(0,u.E9)(({sendBack:e,input:t})=>{let r=()=>{e(t.event)};t.immediate&&r();let n=setInterval(r,t.interval);return()=>{clearInterval(n)}});let Z=()=>(0,c.cY)({types:{},actors:{requestMachine:J(),listen:F()},actions:{"buffer handshake":(0,h.a)({handshakeBuffer:({event:e,context:t})=>((0,c.ZD)(e,"message.received"),[...t.handshakeBuffer,e])}),"buffer message":(0,l.a)(({enqueue:e})=>{e.assign({buffer:({event:e,context:t})=>((0,c.ZD)(e,"post"),[...t.buffer,{data:e.data,resolvable:e.resolvable,options:e.options}])}),e.emit(({event:e})=>((0,c.ZD)(e,"post"),{type:"buffer.added",message:e.data}))}),"create request":(0,h.a)({requests:({context:e,event:t,self:r,spawn:n})=>{(0,c.ZD)(t,"request");let i=(Array.isArray(t.data)?t.data:[t.data]).map(t=>n("requestMachine",{id:`req-${a()}`,input:{channelId:e.channelId,data:t.data,domain:e.domain,expectResponse:t.expectResponse,from:e.name,parentRef:r,resolvable:t.resolvable,responseTimeout:t.options?.responseTimeout,responseTo:t.responseTo,signal:t.options?.signal,sources:e.target,suppressWarnings:t.options?.suppressWarnings,targetOrigin:e.targetOrigin,to:e.connectTo,type:t.type}}));return[...e.requests,...i]}}),"emit heartbeat":(0,l.e)(()=>({type:"heartbeat"})),"emit received message":(0,l.a)(({enqueue:e})=>{e.emit(({event:e})=>((0,c.ZD)(e,"message.received"),{type:"message",message:e.message.data}))}),"emit status":(0,l.e)((e,t)=>({type:"status",status:t.status})),"post message":(0,f.r)(({event:e})=>((0,c.ZD)(e,"post"),{type:"request",data:{data:e.data.data,expectResponse:!!e.resolvable,type:e.data.type,resolvable:e.resolvable,options:e.options}})),"process pending handshakes":(0,l.a)(({context:e,enqueue:t})=>{e.handshakeBuffer.forEach(e=>t.raise(e)),t.assign({handshakeBuffer:[]})}),"remove request":(0,l.a)(({context:e,enqueue:t,event:r})=>{(0,c.ZD)(r,["request.success","request.failed","request.aborted"]),(0,f.k)(r.requestId),t.assign({requests:e.requests.filter(({id:e})=>e!==r.requestId)})}),"send response":(0,f.r)(({event:e})=>((0,c.ZD)(e,["message.received","heartbeat.received"]),{type:"request",data:{type:z,responseTo:e.message.data.id,data:void 0}})),"send handshake syn ack":(0,f.r)({type:"request",data:{type:H}}),"send pending messages":(0,l.a)(({enqueue:e})=>{e.raise(({context:e})=>({type:"request",data:e.buffer.map(({data:e,resolvable:t,options:r})=>({data:e.data,type:e.type,expectResponse:!!t,resolvable:t,options:r}))})),e.emit(({context:e})=>({type:"buffer.flushed",messages:e.buffer.map(({data:e})=>e)}
3)),e.assign({buffer:[]})}),"set connection config":(0,h.a)({channelId:({event:e})=>((0,c.ZD)(e,"handshake.syn"),e.message.data.channelId),target:({event:e})=>((0,c.ZD)(e,"handshake.syn"),e.message.source||void 0),targetOrigin:({event:e})=>((0,c.ZD)(e,"handshake.syn"),e.message.origin)})},guards:{hasSource:({context:e})=>null!==e.target}}).createMachine({id:"node",context:({input:e})=>({buffer:[],channelId:null,connectTo:e.connectTo,domain:e.domain??N,handshakeBuffer:[],name:e.name,requests:[],target:void 0,targetOrigin:null}),invoke:{id:"listen for handshake syn",src:"listen",input:P({include:V,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:P({include:W,count:1,responseType:"handshake.complete"}),onDone:"connected"},{id:"listen for disconnect",src:"listen",input:P({include:B,count:1,responseType:"disconnect"})},{id:"listen for messages",src:"listen",input:P({exclude:[B,V,W,L,z]})}],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:P({exclude:[B,V,W,L,z]})},{id:"listen for heartbeat",src:"listen",input:P({include:L,responseType:"heartbeat.received"})},{id:"listen for disconnect",src:"listen",input:P({include:B,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"]}}}}}),G=(e,t=Z())=>{let r;let n=(0,f.c)(t,{input:e}),i=new Map,s=new Map;n.on("message",({message:e})=>{let t=i.get(e.type);if(t){t.forEach(t=>t(e.data));return}let r=s.get(e.type);r?r.add(e):s.set(e.type,new Set([e]))});let o=()=>{n.stop()};return{actor:n,fetch:(e,t,r)=>{let i,s;let{responseTimeout:o=1e4,signal:a,suppressWarnings:u}=r||{},c="function"==typeof Promise.withResolvers?Promise.withResolvers():{promise:new Promise((e,t)=>{i=e,s=t}),resolve:i,reject:s};return n.send({type:"post",data:{type:e,data:t},resolvable:c,options:{responseTimeout:o,signal:a,suppressWarnings:u}}),c.promise},machine:t,on:(e,t,r)=>{let n=i.get(e)||new Set;i.has(e)||i.set(e,n),n.add(t);let o=s.get(e);if(o){let n=r?.replay??1;Array.from(o).slice(-n).forEach(({data:e})=>t(e)),s.delete(e)}return()=>{n.delete(t)}},onStatus:(e,t)=>{let{unsubscribe:i}=n.on("status",n=>{r=n.status,t&&n.status!==t||e(n.status)});return r&&e(r),i},post:(e,t)=>{n.send({type:"post",data:{type:e,data:t}})},start:()=>(n.start(),o),stop:o}}},60781:function(e,t,r){r.d(t,{Bk:function(){return s},I4:function(){return o},NZ:function(){return a},Qs:function(){return f},Uw:function(){return u},Y5:function(){return c},id:function(){return l},re:function(){return h}});let n=new Set,i="checking";function s(e){if(i!==e)for(let t of(i=e,n))t()}let o=new Set,a="checking";function u(e){for(let t of(a=e,o))t()}let c=new Set,l=null;function h(e){for(let t of(l=e,c))t()}function f(e,t){for(let e of c)e()}},38050:function(e,t,r){r.d(t,{default:function(){return s}});var n=r(37821);let i=(0,r(30591).default)(()=>r.e(1135).then(r.bind(r,11135)),{loadableGenerated:{webpack:()=>[require.resolveWeak("../_chunks-es/SanityLiveStream.js")]},ssr:!1});function s(e){return(0,n.jsx)(i,{...e})}},37509:function(e,t,r){r.d(t,{default:function(){return rF}});var n,i=r(37821);let s=!(typeof navigator>"u")&&"ReactNative"===navigator.product,o={timeout:s?6e4:12e4},a=function(e){let t={...o,..."string"==typeof e?{url:e}:e};if(t.timeout=function e(t){if(!1===t||0===t)return!1;if(t.connect||t.socket)return t;let r=Number(t);return isNaN(r)?e(o.timeout):{connect:r,socket:r}}(t.timeout),t.query){let{url:e,searchParams:r}=function(e){let t=e.indexOf("?");if(-1===t)return{url:e,searchParams:new URLSearchParams};let r=e.slice(0,t),n=e.slice(t+1);if(!s)return{url:r,searchParams:new URLSearchParams(n)};if("function"!=typeof decodeURIComponent)throw Error("Broken `URLSearchParams` implementation, and `decodeURIComponent` is not defined");let i=new URLSearchParams;for(let e of n.split("&")){let[t,r]=e.split("=");t&&i.append(u(t),u(r||""))}return{url:r,searchParams:i}}(t.url);for(let[n,i]of Object.entries(t.query)){if(void 0!==i){if(Array.isArray(i))for(let e of i)r.append(n,e);else r.append(n,i)}let s=r.toString();s&&(t.url=`${e}?${s}`)}}return t.method=t.body&&!t.method?"POST":(t.method||"GET").toUpperCase(),t};function u(e){return decodeURIComponent(e.replace(/\+/g," "))}let c=/^https?:\/\//i,l=function(e){if(!c.test(e.url))throw Error(`"${e.url}" is not a valid URL`)},h=["request","response","progress","error","abort"],f=["processOptions","validateOptions","interceptRequest","finalizeOptions","onRequest","onResponse","onError","onReturn","onHeaders"];var d,p,y,g=(d=function(){if(y)return p;y=1;var e=function(e){return e.replace(/^\s+|\s+$/g,"")};return p=function(t){if(!t)return{};for(var r=Object.create(null),n=e(t).split("\n"),i=0;i<n.length;i++){var s,o=n[i],a=o.indexOf(":"),u=e(o.slice(0,a)).toLowerCase(),c=e(o.slice(a+1));typeof r[u]>"u"?r[u]=c:(s=r[u],"[object Array]"===Object.prototype.toString.call(s))?r[u].push(c):r[u]=[r[u],c]}return r}}())&&d.__esModule&&Object.prototype.hasOwnProperty.call(d,"default")?d.default:d;class v{onabort;onerror;onreadystatechange;ontimeout;readyState=0;response;responseText="";responseType="";status;statusText;withCredentials;#e;#t;#r;#n={};#i;#s={};#o;open(e,t,r){this.#e=e,this.#t=t,this.#r="",this.readyState=1,this.onreadystatechange?.(),this.#i=void 0}abort(){this.#i&&this.#i.abort()}getAllResponseHeaders(){return this.#r}setRequestHeader(e,t){this.#n[e]=t}setInit(e,t=!0){this.#s=e,this.#o=t}send(e){let t="arraybuffer"!==this.responseType,r={...this.#s,method:this.#e,headers:this.#n,body:e};"function"==typeof AbortController&&this.#o&&(this.#i=new AbortController,"u">typeof EventTarget&&this.#i.signal instanceof EventTarget&&(r.signal=this.#i.signal)),"u">typeof document&&(r.credentials=this.withCredentials?"include":"omit"),fetch(this.#t,r).then(e=>
3(e.headers.forEach((e,t)=>{this.#r+=`${t}: ${e}\r
4`}),this.status=e.status,this.statusText=e.statusText,this.readyState=3,this.onreadystatechange?.(),t?e.text():e.arrayBuffer())).then(e=>{"string"==typeof e?this.responseText=e:this.response=e,this.readyState=4,this.onreadystatechange?.()}).catch(e=>{"AbortError"!==e.name?this.onerror?.(e):this.onabort?.()})}}let m="function"==typeof XMLHttpRequest?"xhr":"fetch",b="xhr"===m?XMLHttpRequest:v,w=(e,t)=>{let r=e.options,n=e.applyMiddleware("finalizeOptions",r),i={},s=e.applyMiddleware("interceptRequest",void 0,{adapter:m,context:e});if(s){let e=setTimeout(t,0,null,s);return{abort:()=>clearTimeout(e)}}let o=new b;o instanceof v&&"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=e=>{p(o instanceof v?e instanceof Error?e:Error(`Request error while attempting to reach is ${n.url}`,{cause:e}):Error(`Request error while attempting to reach is ${n.url}${e.lengthComputable?`(${e.loaded} of ${e.total} bytes transferred)`:""}`))},o.ontimeout=e=>{p(Error(`Request timeout while attempting to reach ${n.url}${e.lengthComputable?`(${e.loaded} of ${e.total} bytes transferred)`:""}`))},o.onabort=()=>{d(!0),c=!0},o.onreadystatechange=function(){u&&(d(),i.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 p(Error("Unknown XHR error"));d(),l=!0,t(null,{body:o.response||(""===o.responseType||"text"===o.responseType?o.responseText:""),url:n.url,method:n.method,headers:g(o.getAllResponseHeaders()),statusCode:o.status,statusMessage:o.statusText})}}()},o.open(n.method,n.url,!0),o.withCredentials=!!n.withCredentials,a&&o.setRequestHeader)for(let e in a)a.hasOwnProperty(e)&&o.setRequestHeader(e,a[e]);return n.rawBody&&(o.responseType="arraybuffer"),e.applyMiddleware("onRequest",{options:n,adapter:m,request:o,context:e}),o.send(n.body||null),u&&(i.connect=setTimeout(()=>f("ETIMEDOUT"),u.connect)),{abort:function(){c=!0,o&&o.abort()}};function f(t){h=!0,o.abort();let r=Error("ESOCKETTIMEDOUT"===t?`Socket timed out on request to ${n.url}`:`Connection timed out on request to ${n.url}`);r.code=t,e.channels.error.publish(r)}function d(e){(e||c||o&&o.readyState>=2&&i.connect)&&clearTimeout(i.connect),i.socket&&clearTimeout(i.socket)}function p(e){if(l)return;d(!0),l=!0,o=null;let r=e||Error(`Network error while attempting to reach ${n.url}`);r.isNetworkError=!0,r.request=n,t(r)}},_=(e=[],t=w)=>(function e(t,r){let n=[],i=f.reduce((e,t)=>(e[t]=e[t]||[],e),{processOptions:[a],validateOptions:[l]});function s(e){let t;let n=h.reduce((e,t)=>(e[t]=function(){let e=Object.create(null),t=0;return{publish:function(t){for(let r in e)e[r](t)},subscribe:function(r){let n=t++;return e[n]=r,function(){delete e[n]}}}}(),e),{}),s=function(e,t,...r){let n="onError"===e,s=t;for(let t=0;t<i[e].length&&(s=(0,i[e][t])(s,...r),!n||s);t++);return s},o=s("processOptions",e);s("validateOptions",o);let a={options:o,channels:n,applyMiddleware:s},u=n.request.subscribe(e=>{t=r(e,(t,r)=>((e,t,r)=>{let i=e,o=t;if(!i)try{o=s("onResponse",t,r)}catch(e){o=null,i=e}(i=i&&s("onError",i,r))?n.error.publish(i):o&&n.response.publish(o)})(t,r,e))});n.abort.subscribe(()=>{u(),t&&t.abort()});let c=s("onReturn",n,a);return c===n&&n.request.publish(a),c}return s.use=function(e){if(!e)throw Error("Tried to add middleware that resolved to falsey value");if("function"==typeof e)throw Error("Tried to add middleware that was a function. It probably expects you to pass options to it.");if(e.onReturn&&i.onReturn.length>0)throw Error("Tried to add new middleware with `onReturn` handler, but another handler has already been registered for this event");return f.forEach(t=>{e[t]&&i[t].push(e[t])}),n.push(e),s},s.clone=()=>e(n,r),t.forEach(s.use),s})(e,t);var x,E,S,C,$,I=r(59792),R=r(55690).Buffer,q={exports:{}};$||($=1,function(e,t){let r;t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;let r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,i=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(n++,"%c"===e&&(i=n))}),t.splice(i,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch{}},t.load=function(){let e;try{e=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch{}return!e&&"u">typeof I&&"env"in I&&(e=I.env.DEBUG),e},t.useColors=function(){let e;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+)/))&&
4("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&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"u">typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch{}}(),t.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`."))}),t.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"],t.log=console.debug||console.log||(()=>{}),e.exports=(C?S:(C=1,S=function(e){function t(e){let n,i,s,o=null;function a(...e){if(!a.enabled)return;let r=Number(new Date),i=r-(n||r);a.diff=i,a.prev=n,a.curr=r,n=r,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(r,n)=>{if("%%"===r)return"%";s++;let i=t.formatters[n];if("function"==typeof i){let t=e[s];r=i.call(a,t),e.splice(s,1),s--}return r}),t.formatArgs.call(a,e),(a.log||t.log).apply(a,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=r,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==o?o:(i!==t.namespaces&&(i=t.namespaces,s=t.enabled(e)),s),set:e=>{o=e}}),"function"==typeof t.init&&t.init(a),a}function r(e,r){let n=t(this.namespace+(typeof r>"u"?":":r)+e);return n.log=this.log,n}function n(e,t){let r=0,n=0,i=-1,s=0;for(;r<e.length;)if(n<t.length&&(t[n]===e[r]||"*"===t[n]))"*"===t[n]?(i=n,s=r):r++,n++;else{if(-1===i)return!1;n=i+1,r=++s}for(;n<t.length&&"*"===t[n];)n++;return n===t.length}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){let e=[...t.names,...t.skips.map(e=>"-"+e)].join(",");return t.enable(""),e},t.enable=function(e){for(let r of(t.save(e),t.namespaces=e,t.names=[],t.skips=[],("string"==typeof e?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean)))"-"===r[0]?t.skips.push(r.slice(1)):t.names.push(r)},t.enabled=function(e){for(let r of t.skips)if(n(e,r))return!1;for(let r of t.names)if(n(e,r))return!0;return!1},t.humanize=function(){if(E)return x;function e(e,t,r,n){return Math.round(e/r)+" "+n+(t>=1.5*r?"s":"")}return E=1,x=function(t,r){r=r||{};var n,i,s=typeof t;if("string"===s&&t.length>0)return function(e){if(!((e=String(e)).length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]);switch((t[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}}}}(t);if("number"===s&&isFinite(t))return r.long?(i=Math.abs(t))>=864e5?e(t,i,864e5,"day"):i>=36e5?e(t,i,36e5,"hour"):i>=6e4?e(t,i,6e4,"minute"):i>=1e3?e(t,i,1e3,"second"):t+" ms":(n=Math.abs(t))>=864e5?Math.round(t/864e5)+"d":n>=36e5?Math.round(t/36e5)+"h":n>=6e4?Math.round(t/6e4)+"m":n>=1e3?Math.round(t/1e3)+"s":t+"ms";throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}}(),t.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(e).forEach(r=>{t[r]=e[r]}),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t)|0;return t.colors[Math.abs(r)%t.colors.length]},t.enable(t.load()),t}))(t);let{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(q,q.exports)),q.exports,Object.prototype.hasOwnProperty;let k=typeof R>"u"?()=>!1:e=>R.isBuffer(e);function T(e){return"[object Object]"===Object.prototype.toString.call(e)}let O=["boolean","string","number"],j={};"u">typeof globalThis?j=globalThis:"u">typeof window?j=window:"u">typeof global?j=global:"u">typeof self&&(j=self);var A=j;let P=(e={})=>{let t=e.implementation||Promise;if(!t)throw Error("`Promise` is not available in global scope, and n
4o implementation was passed");return{onReturn:(r,n)=>new t((t,i)=>{let s=n.options.cancelToken;s&&s.promise.then(e=>{r.abort.publish(e),i(e)}),r.error.subscribe(i),r.response.subscribe(r=>{t(e.onlyBody?r.body:r)}),setTimeout(()=>{try{r.request.publish(n)}catch(e){i(e)}},0)})}};class D{__CANCEL__=!0;message;constructor(e){this.message=e}toString(){return"Cancel"+(this.message?`: ${this.message}`:"")}}class U{promise;reason;constructor(e){if("function"!=typeof e)throw TypeError("executor must be a function.");let t=null;this.promise=new Promise(e=>{t=e}),e(e=>{this.reason||(this.reason=new D(e),t(this.reason))})}static source=()=>{let e;return{token:new U(t=>{e=t}),cancel:e}}}P.Cancel=D,P.CancelToken=U,P.isCancel=e=>!(!e||!e?.__CANCEL__);var M=(e,t,r)=>("GET"===r.method||"HEAD"===r.method)&&(e.isNetworkError||!1);function F(e){return 100*Math.pow(2,e)+100*Math.random()}let N=(e={})=>(e=>{let t=e.maxRetries||5,r=e.retryDelay||F,n=e.shouldRetry;return{onError:(e,i)=>{var s;let o=i.options,a=o.maxRetries||t,u=o.retryDelay||r,c=o.shouldRetry||n,l=o.attemptNumber||0;if(null!==(s=o.body)&&"object"==typeof s&&"function"==typeof s.pipe||!c(e,l,o)||l>=a)return e;let h=Object.assign({},i,{options:Object.assign({},o,{attemptNumber:l+1})});return setTimeout(()=>i.channels.request.publish(h),u(l)),null}}})({shouldRetry:M,...e});N.shouldRetry=M;var z=r(92882),L=r(5570),B=r(3938),V=r(9838),H=r(39710);function W(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=(0,V.yG)(e);return(0,H.D)(e,r)}var X=r(67871),J=(0,r(8747).d)(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}});function Z(e,t){var r="object"==typeof t;return new Promise(function(n,i){var s,o=!1;e.subscribe({next:function(e){s=e,o=!0},error:i,complete:function(){o?n(s):r?n(t.defaultValue):i(new J)}})})}var G=r(6945),Y=r(55832),Q=r(67071),K=r(70881);function ee(e){return(0,K.e)(function(t,r){var n,i=null,s=!1;i=t.subscribe((0,Q.x)(r,void 0,void 0,function(o){n=(0,Y.Xf)(e(o,ee(e)(t))),i?(i.unsubscribe(),i=null,n.subscribe(r)):s=!0})),s&&(i.unsubscribe(),i=null,n.subscribe(r))})}var et=r(96540);function er(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(0,et.J)(1)((0,H.D)(e,(0,V.yG)(e)))}var en=r(27951),ei=new(r(11594)).v(en.o);function es(e,t){var r=(0,B.m)(e)?e:function(){return e},n=function(e){return e.error(r())};return new z.y(t?function(e){return t.schedule(n,0,e)}:n)}r(93039);var eo=r(6826);function ea(e){return(0,K.e)(function(t,r){try{t.subscribe(r)}finally{r.add(e)}})}var eu=r(1673),ec=r(94122),el=r(52209),eh=r(12373),ef=r(82971);function ed(e,t){var r="object"==typeof t;return new Promise(function(n,i){var s=new ef.Hp({next:function(e){n(e),s.unsubscribe()},error:i,complete:function(){r?n(t.defaultValue):i(new J)}});e.subscribe(s)})}var ep=r(57239),ey=r(71655),eg=r(79504);function ev(e,t,r){e?(0,eg.f)(r,e,t):t()}var em=Array.isArray,eb=r(66787),ew=r(29681);function e_(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=(0,V.jO)(e);return r?(0,ew.z)(e_.apply(void 0,(0,ey.ev)([],(0,ey.CR)(e))),(0,eb.Z)(r)):(0,K.e)(function(t,r){var n,i,s;(n=(0,ey.ev)([t],(0,ey.CR)(1===e.length&&em(e[0])?e[0]:e)),void 0===s&&(s=eo.y),function(e){ev(void 0,function(){for(var t=n.length,r=Array(t),o=t,a=t,u=function(t){ev(i,function(){var u=(0,H.D)(n[t],i),c=!1;u.subscribe((0,Q.x)(e,function(n){r[t]=n,!c&&(c=!0,a--),a||e.next(s(r.slice()))},function(){--o||e.complete()}))},e)},c=0;c<t;c++)u(c)},e)})(r)})}var ex=r(31650),eE=r(26795);let eS=e=>crypto.getRandomValues(new Uint8Array(e)),eC=(e,t,r)=>{let n=(2<<Math.log(e.length-1)/Math.LN2)-1,i=-~(1.6*n*t/e.length);return (s=t)=>{let o="";for(;;){let t=r(i),a=0|i;for(;a--;)if((o+=e[t[a]&n]||"").length===s)return o}}},e$=/\r\n|[\n\r\u2028\u2029]/;function eI(e,t){let r=0;for(let n=0;n<t.length;n++){let i=t[n].length+1;if(r+i>e)return{line:n+1,column:e-r};r+=i}return{line:t.length,column:t[t.length-1]?.length??0}}
4class eR extends Error{response;statusCode=400;responseBody;details;constructor(e,t){let r=ek(e,t);super(r.message),Object.assign(this,r)}}class eq extends Error{response;statusCode=500;responseBody;details;constructor(e){let t=ek(e);super(t.message),Object.assign(this,t)}}function ek(e,t){let r=e.body,n={response:e,statusCode:e.statusCode,responseBody:-1!==(e.headers["content-type"]||"").toLowerCase().indexOf("application/json")?JSON.stringify(r,null,2):r,message:"",details:void 0};if(!(0,ep.Uy)(r))return n.message=ej(e,r),n;let i=r.error;if("string"==typeof i&&"string"==typeof r.message)return n.message=`${i} - ${r.message}`,n;if("object"!=typeof i||null===i)return"string"==typeof i?n.message=i:"string"==typeof r.message?n.message=r.message:n.message=ej(e,r),n;if("type"in i&&"mutationError"===i.type&&"description"in i&&"string"==typeof i.description||"type"in i&&"actionError"===i.type&&"description"in i&&"string"==typeof i.description){let e=i.items||[],t=e.slice(0,5).map(e=>e.error?.description).filter(Boolean),s=t.length?`:
5- ${t.join(`
6- `)}`:"";return e.length>5&&(s+=`
7...and ${e.length-5} more`),n.message=`${i.description}${s}`,n.details=r.error,n}if(eT(i)){let e=t?.options?.query?.tag;return n.message=eO(i,e),n.details=r.error,n}return"description"in i&&"string"==typeof i.description?(n.message=i.description,n.details=i):n.message=ej(e,r),n}function eT(e){return(0,ep.Uy)(e)&&"queryParseError"===e.type&&"string"==typeof e.query&&"number"==typeof e.start&&"number"==typeof e.end}function eO(e,t){let{query:r,start:n,end:i,description:s}=e;if(!r||typeof n>"u")return`GROQ query parse error: ${s}`;let o=t?`
8
9Tag: ${t}`:"";return`GROQ query parse error:
10${function(e,t,r){let n=e.split(e$),{start:i,end:s,markerLines:o}=function(e,t){let r={...e.start},n={...r,...e.end},i=r.line??-1,s=r.column??0,o=n.line,a=n.column,u=Math.max(i-3,0),c=Math.min(t.length,o+3);-1===i&&(u=0),-1===o&&(c=t.length);let l=o-i,h={};if(l)for(let e=0;e<=l;e++){let r=e+i;if(s){if(0===e){let e=t[r-1].length;h[r]=[s,e-s+1]}else if(e===l)h[r]=[0,a];else{let n=t[r-e].length;h[r]=[0,n]}}else h[r]=!0}else s===a?s?h[i]=[s,0]:h[i]=!0:h[i]=[s,a-s];return{start:u,end:c,markerLines:h}}({start:eI(t.start,n),end:t.end?eI(t.end,n):void 0},n),a=`${s}`.length;return e.split(e$,s).slice(i,s).map((e,t)=>{let n=i+1+t,s=` ${` ${n}`.slice(-a)} |`,u=o[n],c=!o[n+1];if(!u)return` ${s}${e.length>0?` ${e}`:""}`;let l="";if(Array.isArray(u)){let t=e.slice(0,Math.max(u[0]-1,0)).replace(/[^\t]/g," "),n=u[1]||1;l=[`
11 `,s.replace(/\d/g," ")," ",t,"^".repeat(n)].join(""),c&&r&&(l+=" "+r)}return[">",s,e.length>0?` ${e}`:"",l].join("")}).join(`
12`)}(r,{start:n,end:i},s)}${o}`}function ej(e,t){let r="string"==typeof t?` (${t.length>100?`${t.slice(0,100)}\u2026`:t})`:"",n=e.statusMessage?` ${e.statusMessage}`:"";return`${e.method}-request to ${e.url} resulted in HTTP ${e.statusCode}${n}${r}`}class eA extends Error{projectId;addOriginUrl;constructor({projectId:e}){super("CorsOriginError"),this.name="CorsOriginError",this.projectId=e;let t=new URL(`https://sanity.io/manage/project/${e}/api`);if("u">typeof location){let{origin:e}=location;t.searchParams.set("cors","add"),t.searchParams.set("origin",e),this.addOriginUrl=t,this.message=`The current origin is not allowed to connect to the Live Content API. Add it here: ${t}`}else this.message=`The current origin is not allowed to connect to the Live Content API. Change your configuration here: ${t}`}}let eP={onResponse:(e,t)=>{if(e.statusCode>=500)throw new eq(e);
12if(e.statusCode>=400)throw new eR(e,t);return e}};function eD(e){return _([N({shouldRetry:eU}),...e,function(){let e={};return{onResponse:t=>{let r=t.headers["x-sanity-warning"];for(let t of Array.isArray(r)?r:[r])!t||e[t]||(e[t]=!0,console.warn(t));return t}}}(),{processOptions:e=>{let t=e.body;return!t||"function"==typeof t.pipe||k(t)||-1===O.indexOf(typeof t)&&!Array.isArray(t)&&!function(e){if(!1===T(e))return!1;let t=e.constructor;if(void 0===t)return!0;let r=t.prototype;return!(!1===T(r)||!1===r.hasOwnProperty("isPrototypeOf"))}(t)?e:Object.assign({},e,{body:JSON.stringify(e.body),headers:Object.assign({},e.headers,{"Content-Type":"application/json"})})}},{onResponse:e=>{let t=e.headers["content-type"]||"",r=-1!==t.indexOf("application/json");return e.body&&t&&r?Object.assign({},e,{body:function(e){try{return JSON.parse(e)}catch(e){throw e.message=`Failed to parsed response body as JSON: ${e.message}`,e}}(e.body)}):e},processOptions:e=>Object.assign({},e,{headers:Object.assign({Accept:"application/json"},e.headers)})},{onRequest:e=>{if("xhr"!==e.adapter)return;let t=e.request,r=e.context;function n(e){return t=>{let n=t.lengthComputable?t.loaded/t.total*100:-1;r.channels.progress.publish({stage:e,percent:n,total:t.total,loaded:t.loaded,lengthComputable:t.lengthComputable})}}"upload"in t&&"onprogress"in t.upload&&(t.upload.onprogress=n("upload")),"onprogress"in t&&(t.onprogress=n("download"))}},eP,function(e={}){let t=e.implementation||A.Observable;if(!t)throw Error("`Observable` is not available in global scope, and no implementation was passed");return{onReturn:(e,r)=>new t(t=>(e.error.subscribe(e=>t.error(e)),e.progress.subscribe(e=>t.next(Object.assign({type:"progress"},e))),e.response.subscribe(e=>{t.next(Object.assign({type:"response"},e)),t.complete()}),e.request.publish(r),()=>e.abort.publish()))}}({implementation:z.y})])}function eU(e,t,r){if(0===r.maxRetries)return!1;let n="GET"===r.method||"HEAD"===r.method,i=(r.uri||r.url).startsWith("/data/query"),s=e.response&&(429===e.response.statusCode||502===e.response.statusCode||503===e.response.statusCode);return(!!n||!!i)&&!!s||N.shouldRetry(e,t,r)}function eM(e){return"https://www.sanity.io/help/"+e}let eF=["image","file"],eN=["before","after","replace"],ez=e=>{if(!/^(~[a-z0-9]{1}[-\w]{0,63}|[a-z0-9]{1}[-\w]{0,63})$/.test(e))throw Error("Datasets can only contain lowercase characters, numbers, underscores and dashes, and start with tilde, and be maximum 64 characters")},eL=e=>{if(!/^[-a-z0-9]+$/i.test(e))throw Error("`projectId` can only contain only a-z, 0-9 and dashes")},eB=e=>{if(-1===eF.indexOf(e))throw Error(`Invalid asset type: ${e}. Must be one of ${eF.join(", ")}`)},eV=(e,t)=>{if(null===t||"object"!=typeof t||Array.isArray(t))throw Error(`${e}() takes an object of properties`)},eH=(e,t)=>{if("string"!=typeof t||!/^[a-z0-9_][a-z0-9_.-]{0,127}$/i.test(t)||t.includes(".."))throw Error(`${e}(): "${t}" is not a valid document ID`)},eW=(e,t)=>{if(!t._id)throw Error(`${e}() requires that the document contains an ID ("_id" property)`);eH(e,t._id)},eX=(e,t)=>{if("string"!=typeof t)throw Error(`\`${e}()\`: \`${t}\` is not a valid document type`)},eJ=(e,t)=>{if(!t._type)throw Error(`\`${e}()\` requires that the document contains a type (\`_type\` property)`);eX(e,t._type)},eZ=(e,t)=>{if(t._id&&t._id!==e)throw Error(`The provided document ID (\`${t._id}\`) does not match the generated version ID (\`${e}\`)`)},eG=(e,t,r)=>{let n="insert(at, selector, items)";if(-1===eN.indexOf(e)){let e=eN.map(e=>`"${e}"`).join(", ");throw Error(`${n} takes an "at"-argument which is one of: ${e}`)}if("string"!=typeof t)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`)},eY=e=>{if(!e.dataset)throw Error("`dataset` must be provided to perform queries");return e.dataset||""},eQ=e=>{if("string"!=typeof e||!/^[a-z0-9._-]{1,75}$/i.test(e))throw Error("Tag can only contain alphanumeric characters, underscores, dashes and dots, and be between one and 75 characters long.");return e},eK=e=>{if(!e["~experimental_resource"])throw Error("`resource` must be provided to perform resource queries");let{type:t,id:r}=e["~experimental_resource"];switch(t){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: ${t.toString()}`)}},e0=(e,t)=>{if(t["~experimental_resource"])throw Error(`\`${e}\` does not support resource-based operations`)},e1=e=>{var t;let r,n;return t=(...t)=>console.warn(e.join(" "),...t),r=!1,(...e)=>(r||(n=t(...e),r=!0),n)},e3=e1(["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"]),e9=e1(["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."]),e2=e1(["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."]),e5=e1(["The `previewDrafts` perspective has been renamed to  `drafts` and will be removed in a future API version"]),e6=e1(["You have configured Sanity client to use a token in the browser. This may cause unintentional security issues.",`See ${eM("js-cl
12ient-browser-token")} for more information and how to hide this warning.`]),e8=e1(["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`."]),e7=e1(["Using the Sanity client without specifying an API version is deprecated.",`See ${eM("js-client-api-version")}`]),e4=(e1(["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}}),te=["localhost","127.0.0.1","0.0.0.0"],tt=e=>-1!==te.indexOf(e);function tr(e){if(Array.isArray(e)&&e.length>1&&e.includes("raw"))throw TypeError('Invalid API perspective value: "raw". The raw-perspective can not be combined with other perspectives')}let tn=(e,t)=>{let r={...t,...e,stega:{..."boolean"==typeof t.stega?{enabled:t.stega}:t.stega||e4.stega,..."boolean"==typeof e.stega?{enabled:e.stega}:e.stega||{}}};r.apiVersion||e7();let n={...e4,...r},i=n.useProjectHostname&&!n["~experimental_resource"];if(typeof Promise>"u"){let e=eM("js-client-promise-polyfill");throw Error(`No native Promise-implementation found, polyfill needed - see ${e}`)}if(i&&!n.projectId)throw Error("Configuration must contain `projectId`");if(n["~experimental_resource"]&&eK(n),"u">typeof n.perspective&&tr(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 s="u">typeof window&&window.location&&window.location.hostname,o=s&&tt(window.location.hostname),a=!!n.token;n.withCredentials&&a&&(e8(),n.withCredentials=!1),s&&o&&a&&!0!==n.ignoreBrowserTokenWarning?e6():typeof n.useCdn>"u"&&e9(),i&&eL(n.projectId),n.dataset&&ez(n.dataset),"requestTagPrefix"in n&&(n.requestTagPrefix=n.requestTagPrefix?eQ(n.requestTagPrefix).replace(/\.+$/,""):void 0),n.apiVersion=`${n.apiVersion}`.replace(/^v/,""),n.isDefaultApi=n.apiHost===e4.apiHost,!0===n.useCdn&&n.withCredentials&&e3(),n.useCdn=!1!==n.useCdn&&!n.withCredentials,function(e){if("1"===e||"X"===e)return;let t=new Date(e);if(!(/^\d{4}-\d{2}-\d{2}$/.test(e)&&t instanceof Date&&t.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 i?(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};class ti extends Error{name="ConnectionFailedError"}class ts extends Error{name="DisconnectError";reason;constructor(e,t,r={}){super(e,r),this.reason=t}}class to extends Error{name="ChannelError";data;constructor(e,t){super(e),this.data=t}}class ta extends Error{name="MessageError";data;constructor(e,t,r={}){super(e,r),this.data=t}}class tu extends Error{name="MessageParseError"}let tc=["channelError","disconnect"];function tl(e,t){return(0,L.P)(()=>{let t=e();return t&&(t instanceof z.y||(0,B.m)(t.lift)&&(0,B.m)(t.subscribe))?t:W(t)}).pipe((0,X.z)(e=>new z.y(r=>{let n=t.includes("open"),i=t.includes("reconnect");function s(t){if("data"in t){let[e,n]=th(t);r.error(e?new tu("Unable to parse EventSource error message",{cause:n}):new ta((n?.data).message,n));return}e.readyState===e.CLOSED?r.error(new ti("EventSource connection failed")):i&&r.next({type:"reconnect"})}function o(){r.next({type:"open"})}function a(t){let[n,i]=th(t);if(n){r.error(new tu("Unable to parse EventSource message",{cause:n}));return}if("channelError"===t.type){let t=new URL(e.url).searchParams.get("tag");r.error(new to(function(e,t){let r=e.error;return r?eT(r)?eO(r,t):r.description?r.description:"string"==typeof r?r:JSON.stringify(r,null,2):e.message||"Unknown listener error"}(i?.data,t),i.data));return}if("disconnect"===t.type){r.error(new ts(`Server disconnected client: ${i.data?.reason||"unknown error"}`));return}r.next({type:t.type,id:t.lastEventId,...i.data?{data:i.data}:{}})}e.addEventListener("error",s),n&&e.addEventListener("open",o);let u=[...new Set([...tc,...t])].filter(e=>"error"!==e&&"open"!==e&&"reconnect"!==e);return u.forEach(t=>e.addEventListener(t,a)),()=>{e.removeEventListener("error",s),n&&e.removeEventListener("open",o),u.forEach(t=>e.removeEventListener(t,a)),e.close()}})))}function th(e){try{let t="string"==typeof e.data&&JSON.parse(e.data);return[null,{type:e.type,id:e.lastEventId,...!function(e){for(let t in e)return!1;return!0}(t)?{data:t}:{}}]}catch(e){return[e,null]}}function tf(e){if("string"==typeof e)return{id:e};
12if(Array.isArray(e))return{query:"*[_id in $ids]",params:{ids:e}};if("object"==typeof e&&null!==e&&"query"in e&&"string"==typeof e.query)return"params"in e&&"object"==typeof e.params&&null!==e.params?{query:e.query,params:e.params}:{query:e.query};let t=["* Document ID (<docId>)","* Array of document IDs","* Object containing `query`"].join(`
13`);throw Error(`Unknown selection - must be one of:
14
15${t}`)}class td{selection;operations;constructor(e,t={}){this.selection=e,this.operations=t}set(e){return this._assign("set",e)}setIfMissing(e){return this._assign("setIfMissing",e)}diffMatchPatch(e){return eV("diffMatchPatch",e),this._assign("diffMatchPatch",e)}unset(e){if(!Array.isArray(e))throw Error("unset(attrs) takes an array of attributes to unset, non-array given");return this.operations=Object.assign({},this.operations,{unset:e}),this}inc(e){return this._assign("inc",e)}dec(e){return this._assign("dec",e)}insert(e,t,r){return eG(e,t,r),this._assign("insert",{[e]:t,items:r})}append(e,t){return this.insert("after",`${e}[-1]`,t)}prepend(e,t){return this.insert("before",`${e}[0]`,t)}splice(e,t,r,n){let i=t<0?t-1:t,s=typeof r>"u"||-1===r?-1:Math.max(0,t+r),o=`${e}[${i}:${i<0&&s>=0?"":s}]`;return this.insert("replace",o,n||[])}ifRevisionId(e){return this.operations.ifRevisionID=e,this}serialize(){return{...tf(this.selection),...this.operations}}toJSON(){return this.serialize()}reset(){return this.operations={},this}_assign(e,t,r=!0){return eV(e,t),this.operations=Object.assign({},this.operations,{[e]:Object.assign({},r&&this.operations[e]||{},t)}),this}_set(e,t){return this._assign(e,t,!1)}}class tp extends td{#a;constructor(e,t,r){super(e,t),this.#a=r}clone(){return new tp(this.selection,{...this.operations},this.#a)}commit(e){if(!this.#a)throw Error("No `client` passed to patch, either provide one or pass the patch to a clients `mutate()` method");let t=Object.assign({returnFirst:"string"==typeof this.selection,returnDocuments:!0},e);return this.#a.mutate({patch:this.serialize()},t)}}class ty extends td{#a;constructor(e,t,r){super(e,t),this.#a=r}clone(){return new ty(this.selection,{...this.operations},this.#a)}commit(e){if(!this.#a)throw Error("No `client` passed to patch, either provide one or pass the patch to a clients `mutate()` method");let t=Object.assign({returnFirst:"string"==typeof this.selection,returnDocuments:!0},e);return this.#a.mutate({patch:this.serialize()},t)}}let tg={returnDocuments:!1};class tv{operations;trxId;constructor(e=[],t){this.operations=e,this.trxId=t}create(e){return eV("create",e),this._add({create:e})}createIfNotExists(e){let t="createIfNotExists";return eV(t,e),eW(t,e),this._add({[t]:e})}createOrReplace(e){let t="createOrReplace";return eV(t,e),eW(t,e),this._add({[t]:e})}delete(e){return eH("delete",e),this._add({delete:{id:e}})}transactionId(e){return e?(this.trxId=e,this):this.trxId}serialize(){return[...this.operations]}toJSON(){return this.serialize()}reset(){return this.operations=[],this}_add(e){return this.operations.push(e),this}}class tm extends tv{#a;constructor(e,t,r){super(e,r),this.#a=t}clone(){return new tm([...this.operations],this.#a,this.trxId)}commit(e){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},tg,e||{}))}patch(e,t){let r="function"==typeof t,n="string"!=typeof e&&e instanceof ty,i="object"==typeof e&&("query"in e||"id"in e);if(n)return this._add({patch:e.serialize()});if(r){let r=t(new ty(e,{},this.#a));if(!(r instanceof ty))throw Error("function passed to `patch()` must return the patch");return this._add({patch:r.serialize()})}if(i){let r=new ty(e,t||{},this.#a);return this._add({patch:r.serialize()})}return this._add({patch:{id:e,...t}})}}class tb extends tv{#a;constructor(e,t,r){super(e,r),this.#a=t}clone(){return new tb([...this.operations],this.#a,this.trxId)}commit(e){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},tg,e||{}))}patch(e,t){let r="function"==typeof t;if("string"!=typeof e&&e instanceof tp)return this._add({patch:e.serialize()});if(r){let r=t(new tp(e,{},this.#a));if(!(r instanceof tp))throw Error("function passed to `patch()` must return the patch");return this._add({patch:r.serialize()})}return this._add({patch:{id:e,...t}})}}let tw=({query:e,params:t={},options:r={}})=>{let n=new URLSearchParams,{tag:i,includeMutations:s,returnQuery:o,...a}=r;for(let[r,s]of(i&&n.append("tag",i),n.append("query",e),Object.entries(t)))void 0!==s&&n.append(`$${r}`,JSON.stringify(s));for(let[e,t]of Object.entries(a))t&&n.append(e,`${t}`);return!1===o&&n.append("returnQuery","false"),!1===s&&n.append("includeMutations","fal
15se"),`?${n}`},t_=(e,t)=>!1===e?void 0:typeof e>"u"?t:e,tx=(e={})=>({dryRun:e.dryRun,returnIds:!0,returnDocuments:t_(e.returnDocuments,!0),visibility:e.visibility||"sync",autoGenerateArrayKeys:e.autoGenerateArrayKeys,skipCrossDatasetReferenceValidation:e.skipCrossDatasetReferenceValidation}),tE=e=>"response"===e.type,tS=e=>e.body,tC=(e,t)=>e.reduce((e,r)=>(e[t(r)]=r,e),Object.create(null));function t$(e,t,n,i,s={},o={}){let a="stega"in o?{...n||{},..."boolean"==typeof o.stega?{enabled:o.stega}:o.stega||{}}:n,u=a.enabled?(0,ep.NG)(s):s,c=!1===o.filterResponse?e=>e:e=>e.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},d=tF(e,t,"query",{query:i,params:u},"u">typeof l||"u">typeof h?{...f,fetch:{cache:l,next:h}}:f);return a.enabled?d.pipe(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e_.apply(void 0,(0,ey.ev)([],(0,ey.CR)(e)))}((0,H.D)(r.e(8745).then(r.bind(r,48745)).then(function(e){return e.stegaEncodeSourceMap$1}).then(({stegaEncodeSourceMap:e})=>e))),(0,eh.U)(([e,t])=>{let r=t(e.result,e.resultSourceMap,a);return c({...e,result:r})})):d.pipe((0,eh.U)(c))}function tI(e,t,r,n={}){let i={uri:tG(e,"doc",(()=>{if(!n.releaseId)return r;let e=(0,eE.eB)(r);if(!e){if((0,eE.Cb)(r))throw Error(`The document ID (\`${r}\`) is a draft, but \`options.releaseId\` is set as \`${n.releaseId}\``);return(0,eE.XL)(r,n.releaseId)}if(e!==n.releaseId)throw Error(`The document ID (\`${r}\`) is already a version of \`${e}\` release, but this does not match the provided \`options.releaseId\` (\`${n.releaseId}\`)`);return r})()),json:!0,tag:n.tag,signal:n.signal};return tJ(e,t,i).pipe((0,ex.h)(tE),(0,eh.U)(e=>e.body.documents&&e.body.documents[0]))}function tR(e,t,r,n={}){let i={uri:tG(e,"doc",r.join(",")),json:!0,tag:n.tag,signal:n.signal};return tJ(e,t,i).pipe((0,ex.h)(tE),(0,eh.U)(e=>{let t=tC(e.body.documents||[],e=>e._id);return r.map(e=>t[e]||null)}))}function tq(e,t,r,n={}){return tF(e,t,"query",{query:"*[sanity::partOfRelease($releaseId)]",params:{releaseId:r}},n)}function tk(e,t,r,n){return eW("createIfNotExists",r),tN(e,t,r,"createIfNotExists",n)}function tT(e,t,r,n){return eW("createOrReplace",r),tN(e,t,r,"createOrReplace",n)}function tO(e,t,r,n,i){return eW("createVersion",r),eJ("createVersion",r),tM(e,t,{actionType:"sanity.action.document.version.create",publishedId:n,document:r},i)}function tj(e,t,r,n){return tF(e,t,"mutate",{mutations:[{delete:tf(r)}]},n)}function tA(e,t,r,n=!1,i){return tM(e,t,{actionType:"sanity.action.document.version.discard",versionId:r,purge:n},i)}function tP(e,t,r,n){return eW("replaceVersion",r),eJ("replaceVersion",r),tM(e,t,{actionType:"sanity.action.document.version.replace",document:r},n)}function tD(e,t,r,n,i){return tM(e,t,{actionType:"sanity.action.document.version.unpublish",versionId:r,publishedId:n},i)}function tU(e,t,r,n){let i;return tF(e,t,"mutate",{mutations:Array.isArray(i=r instanceof ty||r instanceof tp?{patch:r.serialize()}:r instanceof tm||r instanceof tb?r.serialize():r)?i:[i],transactionId:n&&n.transactionId||void 0},n)}function tM(e,t,r,n){let i=Array.isArray(r)?r:[r];return tF(e,t,"actions",{actions:i,transactionId:n&&n.transactionId||void 0,skipCrossDatasetReferenceValidation:n&&n.skipCrossDatasetReferenceValidation||void 0,dryRun:n&&n.dryRun||void 0},n)}function tF(e,t,r,n,i={}){let s="mutate"===r,o="actions"===r,a=s||o?"":tw(n),u=!s&&!o&&a.length<11264,c=i.returnFirst,{timeout:l,token:h,tag:f,headers:d,returnQuery:p,lastLiveEventId:y,cacheMode:g}=i,v=tG(e,r,u?a:"");return tJ(e,t,{method:u?"GET":"POST",uri:v,json:!0,body:u?void 0:n,query:s&&tx(i),timeout:l,headers:d,token:h,tag:f,returnQuery:p,perspective:i.perspective,resultSourceMap:i.resultSourceMap,lastLiveEventId:Array.isArray(y)?y[0]:y,cacheMode:g,canUseCdn:"query"===r,signal:i.signal,fetch:i.fetch,useAbortSignal:i.useAbortSignal,useCdn:i.useCdn}).pipe((0,ex.h)(tE),(0,eh.U)(tS),(0,eh.U)(e=>{if(!s)return e;let t=e.results||[];if(i.returnDocuments)return c?t[0]&&t[0].document:t.map(e=>e.document);let r=c?t[0]&&t[0].id:t.map(e=>e.id);return{transactionId:e.transactionId,results:t,[c?"documentId":"documentIds"]:r}}))}function tN(e,t,r,n,i={}){return tF(e,t,"mutate",{mutations:[{[n]:r}]},Object.assign({returnFirst:!0,returnDocuments:!0},i))}let tz=e=>void 0!==e.config().dataset&&void 0!==e.config().projectId||void 0!==e.config()["~experimental_resource"],tL=(e,t)=>tz(e)&&t.startsWith(tG(e,"query")),tB=(e,t)=>tz(e)&&t.startsWith(tG(e,"mutate")),tV=(e,t)=>tz(e)&&t.startsWith(tG(e,"doc","")),tH=(e,t)=>tz(e)&&t.startsWith(tG(e,"listen")),tW=(e,t)=>tz(e)&&t.startsWith(tG(e,"history","")),tX=(e,t)=>t.startsWith("/data/")||tL(e,t)||tB(e,t)||tV(e,t)||tH(e,t)||tW(e,t);function tJ(e,t,r){var n;let i=r.url||r.uri,s=e.config(),o=typeof r.canUseCdn>"u"?["GET","HEAD"].indexOf(r.method||"GET")>=0&&tX(e,i):r.canUseCdn,a=(r.useCdn??s.useCdn)&&o,u=r.tag&&s.requestTagPrefix?[s.requestTagPrefix,r.tag].join("."):r.tag||s.requestTagPrefix;if(u&&null!==r.tag&&(r.query={tag:eQ(u),...r.query}),["GET","HEAD","POST"].indexOf(r.method||"GET")>=0&&tL(e,i)){let e=r.resultSourceMap??s.resultSourceMap;void 0!==e&&!1!==e&&(r.query={resultSourceMap:e,...r.query});let t=r.perspective||s.perspective;"u">typeof t&&("previewDrafts"===t&&e5(),tr(t),r.query={perspective:Array.isArray(t)?t.join(","):t,...r.query},(Array.isArray(t)&&t.length>0||"previewDrafts"===t||"drafts"===t)&&a&&(a=!1,e2())),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(e,t={}){let r={};e.headers&&Object.assign(r,e.headers);let n=t.token||e.token;n&&(r.Authorization=`Bearer ${n}`),t.useGlobalApi||e.useProjectHostname||!e.projectId||(r["X-Sanity-Project-ID"]=e.projectId);let i=!!(typeof t.withCredentials>"u"?e.withCredentials:t.withCredentials),s=typeof t.timeout>"u"?e.timeout:t.timeout;return Object.assign({},t,{headers:Object.assign({},r,t.headers||{}),timeout:typeof s>"u"?3e5:s,proxy:t.proxy||e.proxy,json:!0,withCredentials:i,fetch:"object"==typeof t.fetch&&"object"==typeof e.fetch?{...e.fetch,...t.fetch}:t.fetch||e.fetch})}(s,Object.assign({},r,{url:tY(e,i,a)})),l=new z.y(e=>t(c,s.requester).subscribe(e));return r.signal?l.pipe((n=r.signal,e=>new z.y(t=>{let r=()=>t.error(function(e){if(tQ)return new DOMException(e?.reason??"The operation was aborted.","AbortError");let t=Error(e?.reason??"The operation was aborted.");return t.name="AbortError",t}(n));if(n&&n.aborted){r();return}let i=e.subscribe(t);return n.addEventListener("abort",r),()=>{n.removeEventListener("abort",r),i.unsubscribe()}}))):l}function tZ(e,t,r){return tJ(e,t,r).pipe((0,ex.h)(e=>"response"===e.type),(0,eh.U)(e=>e.body))}function tG(e,t,r){let n=e.config();if(n["~experimental_resource"]){eK(n);let e=tK(n),i=void 0!==r?`${t}/${r}`:t;return`${e}/${i}`.replace(/\/($|\?)/,"$1")}let i=eY(n),s=`/${t}/${i}`;return`/data${void 0!==r?`${s}/${r}`:s}`.replace(/\/($|\?)/,"$1")}function tY(e,t,r=!1){let{url:n,cdnUrl:i}=e.config();return`${r?i:n}/${t.replace(/^\//,"")}`}let tQ=!!globalThis.DOMException,tK=e=>{if(!e["~experimental_resource"])throw Error("`resource` must be provided to perform resource queries");let{type:t,id:r}=e["~experimental_resource"];switch(t){case"dataset":{let e=r.split(".");if(2!==e.length)throw Error('Dataset ID must be in the format "project.dataset"');return`/projects/${e[0]}/datasets/${e[1]}`}case"canvas":return`/canvases/${r}`;case"media-library":return`/media-libraries/${r}`;case"dashboard":return`/dashboards/${r}`;default:throw Error(`Unsupported resource type: ${t.toString()}`)}};function t0(e,t,r){let n=eY(e.config());return tZ(e,t,{method:"POST",uri:`/agent/action/generate/${n}`,body:r})}function t1(e,t,r){let n=eY(e.config());return tZ(e,t,{method:"POST",uri:`/agent/action/transform/${n}`,body:r})}function t3(e,t,r){let n=eY(e.config());return tZ(e,t,{method:"POST",uri:`/agent/action/translate/${n}`,body:r})}class t9{#a;#u;constructor(e,t){this.#a=e,this.#u=t}generate(e){return t0(this.#a,this.#u,e)}transform(e){return t1(this.#a,this.#u,e)}translate(e){return t3(this.#a,this.#u,e)}}class t2{#a;#u;constructor(e,t){this.#a=e,this.#u=t}generate(e){return Z(t0(this.#a,this.#u,e))}transform(e){return Z(t1(this.#a,this.#u,e))}translate(e){return Z(t3(this.#a,this.#u,e))}prompt(e){return Z(function(e,t,r){let n=eY(e.config());return tZ(e,t,{method:"POST",uri:`/agent/action/prompt/${n}`,body:r})}(this.#a,this.#u,e))}patch(e){return Z(function(e,t,r){let n=eY(e.config());return tZ(e,t,{method:"POST",uri:`/agent/action/patch/${n}`,body:r})}(this.#a,this.#u,e))}}class t5{#a;#u;
15constructor(e,t){this.#a=e,this.#u=t}upload(e,t,r){return t8(this.#a,this.#u,e,t,r)}}class t6{#a;#u;constructor(e,t){this.#a=e,this.#u=t}upload(e,t,r){return Z(t8(this.#a,this.#u,e,t,r).pipe((0,ex.h)(e=>"response"===e.type),(0,eh.U)(e=>e.body.document)))}}function t8(e,t,r,n,i={}){eB(r);let s=i.extract||void 0;s&&!s.length&&(s=["none"]);let o=e.config(),a=!(typeof File>"u")&&n instanceof File?Object.assign({filename:!1===i.preserveFilename?void 0:n.name,contentType:n.type},i):i,{tag:u,label:c,title:l,description:h,creditLine:f,filename:d,source:p}=a,y={label:c,title:l,description:h,filename:d,meta:s,creditLine:f};return p&&(y.sourceId=p.id,y.sourceName=p.name,y.sourceUrl=p.url),tJ(e,t,{tag:u,method:"POST",timeout:a.timeout||0,uri:function(e,t){let r="image"===t?"images":"files";if(e["~experimental_resource"]){let{type:t,id:n}=e["~experimental_resource"];switch(t){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: ${t.toString()}`)}}let n=eY(e);return`assets/${r}/${n}`}(o,r),headers:a.contentType?{"Content-Type":a.contentType}:{},query:y,body:n})}var t7=(e,t)=>Object.keys(t).concat(Object.keys(e)).reduce((r,n)=>(r[n]=typeof e[n]>"u"?t[n]:e[n],r),{});let t4=(e,t)=>t.reduce((t,r)=>(typeof e[r]>"u"||(t[r]=e[r]),t),{}),re=(0,L.P)(()=>r.e(2291).then(r.t.bind(r,32291,19))).pipe((0,eh.U)(({default:e})=>e),(0,G.d)(1));function rt(){return function(e){return e.pipe(ee((e,t)=>{var r;return e instanceof ti?er(W({type:"reconnect"}),(void 0===r&&(r=ei),new z.y(function(e){var t=1e3,n=0;return r.schedule(function(){e.closed||(e.next(n++),e.complete())},t)})).pipe((0,X.z)(()=>t))):es(()=>e)}))}}let rr=["includePreviousRevision","includeResult","includeMutations","includeAllVersions","visibility","effectFormat","tag"],rn={includeResult:!0};function ri(e,t,r={}){let{url:n,token:i,withCredentials:s,requestTagPrefix:o,headers:a}=this.config(),u=r.tag&&o?[o,r.tag].join("."):r.tag,c={...t7(r,rn),tag:u},l=tw({query:e,params:t,options:{tag:u,...t4(c,rr)}}),h=`${n}${tG(this,"listen",l)}`;if(h.length>14800)return es(()=>Error("Query too large for listener"));let f=c.events?c.events:["mutation"],d={};return s&&(d.withCredentials=!0),(i||a)&&(d.headers={},i&&(d.headers.Authorization=`Bearer ${i}`),a&&Object.assign(d.headers,a)),tl(()=>(typeof EventSource>"u"||d.headers?re:W(EventSource)).pipe((0,eh.U)(e=>new e(h,d))),f).pipe(rt(),(0,ex.h)(e=>f.includes(e.type)),(0,eh.U)(e=>({type:e.type,..."data"in e?e.data:{}})))}let rs="2021-03-25";class ro{#a;constructor(e){this.#a=e}events({includeDrafts:e=!1,tag:t}={}){var r,n,i;e0("live",this.#a.config());let{projectId:s,apiVersion:o,token:a,withCredentials:u,requestTagPrefix:c,headers:l}=this.#a.config(),h=o.replace(/^v/,"");if("X"!==h&&h<rs)throw Error(`The live events API requires API version ${rs} or later. The current API version is ${h}. Please update your API version to use this feature.`);if(e&&!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 f=tG(this.#a,"live/events"),d=new URL(this.#a.getUrl(f,!1)),p=t&&c?[c,t].join("."):t;p&&d.searchParams.set("tag",p),e&&d.searchParams.set("includeDrafts","true");let y={};e&&u&&(y.withCredentials=!0),(e&&a||l)&&(y.headers={},e&&a&&(y.headers.Authorization=`Bearer ${a}`),l&&Object.assign(y.headers,l));let g=`${d.href}::${JSON.stringify(y)}`,v=ra.get(g);if(v)return v;let m=tl(()=>(typeof EventSource>"u"||y.headers?re:W(EventSource)).pipe((0,eh.U)(e=>new e(d.href,y))),["message","restart","welcome","reconnect","goaway"]).pipe(rt(),(0,eh.U)(e=>{if("message"===e.type){let{data:t,...r}=e;return{...r,tags:t.tags}}return e})),b=er((n={method:"OPTIONS",mode:"cors",credentials:y.withCredentials?"include":"omit",headers:y.headers},new z.y(e=>{let t=new AbortController,r=t.signal;return fetch(d,{...n,signal:t.signal}).then(t=>{e.next(t),e.complete()},t=>{r.aborted||e.error(t)}),()=>t.abort()})).pipe((0,X.z)(()=>el.E),ee(()=>{throw new eA({projectId:s})})),m).pipe(ea(()=>ra.delete(g)),(i="function"==typeof(r={predicate:e=>"welcome"===e.type})?{predicate:r}:r,e=>{var t,r,n,s;let o,a=!1,{predicate:u,...c}=i,l=e.pipe((t=e=>{i.predicate(e)&&(a=!0,o=e)},(s=(0,B.m)(t)?{next:t,error:r,complete:n}:t)?(0,K.e)(function(e,t){null===(r=s.subscribe)||void 0===r||r.call(s);var r,n=!0;e.subscribe((0,Q.x)(t,function(e){var r;null===(r=s.next)||void 0===r||r.call(s,e),t.next(e)},function(){var e;n=!1,null===(e=s.complete)||void 0===e||e.call(s),t.complete()},function(e){var r;n=!1,null===(r=s.error)||void 0===r||r.call(s,e),t.error(e)},function(){var e,t;n&&(null===(e=s.unsubscribe)||void 0===e||e.call(s)),null===(t=s.finalize)||void 0===t||t.call(s)}))}):eo.y),ea(()=>{a=!1,o=void 0}),(0,eu.B)(c)),h=new z.y(e=>{a&&e.next(o),e.complete()});return(0,ec.T)(l,h)}));return ra.set(g,b),b}}let ra=new Map;class ru{#a;#u;constructor(e,t){this.#a=e,this.#u=t}create(e,t){return rl(this.#a,this.#u,"PUT",e,t)}edit(e,t){return rl(this.#a,this.#u,"PATCH",e,t)}delete(e){return rl(this.#a,this.#u,"DELETE",e)}list(){return tZ(this.#a,this.#u,{uri:"/datasets",tag:null})}}class rc{#a;#u;
15constructor(e,t){this.#a=e,this.#u=t}create(e,t){return e0("dataset",this.#a.config()),Z(rl(this.#a,this.#u,"PUT",e,t))}edit(e,t){return e0("dataset",this.#a.config()),Z(rl(this.#a,this.#u,"PATCH",e,t))}delete(e){return e0("dataset",this.#a.config()),Z(rl(this.#a,this.#u,"DELETE",e))}list(){return e0("dataset",this.#a.config()),Z(tZ(this.#a,this.#u,{uri:"/datasets",tag:null}))}}function rl(e,t,r,n,i){return e0("dataset",e.config()),ez(n),tZ(e,t,{method:r,uri:`/datasets/${n}`,body:i,tag:null})}class rh{#a;#u;constructor(e,t){this.#a=e,this.#u=t}list(e){e0("projects",this.#a.config());let t=e?.includeMembers===!1?"/projects?includeMembers=false":"/projects";return tZ(this.#a,this.#u,{uri:t})}getById(e){return e0("projects",this.#a.config()),tZ(this.#a,this.#u,{uri:`/projects/${e}`})}}class rf{#a;#u;constructor(e,t){this.#a=e,this.#u=t}list(e){e0("projects",this.#a.config());let t=e?.includeMembers===!1?"/projects?includeMembers=false":"/projects";return Z(tZ(this.#a,this.#u,{uri:t}))}getById(e){return e0("projects",this.#a.config()),Z(tZ(this.#a,this.#u,{uri:`/projects/${e}`}))}}let rd=((e,t=21)=>eC(e,t,eS))("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",8),rp=(e,t)=>t?(0,eE.XL)(e,t):(0,eE.qy)(e);function ry(e,{releaseId:t,publishedId:r,document:n}){if(r&&n._id){let e=rp(r,t);return eZ(e,n),e}if(n._id){let r=(0,eE.Cb)(n._id),i=(0,eE.Y_)(n._id);if(!r&&!i)throw Error(`\`${e}()\` requires a document with an \`_id\` that is a version or draft ID`);if(t){if(r)throw Error(`\`${e}()\` was called with a document ID (\`${n._id}\`) that is a draft ID, but a release ID (\`${t}\`) was also provided.`);let i=(0,eE.eB)(n._id);if(i!==t)throw Error(`\`${e}()\` was called with a document ID (\`${n._id}\`) that is a version ID, but the release ID (\`${t}\`) does not match the document's version ID (\`${i}\`).`)}return n._id}if(r)return rp(r,t);throw Error(`\`${e}()\` requires either a publishedId or a document with an \`_id\``)}let rg=(e,t)=>{if("object"==typeof e&&null!==e&&("releaseId"in e||"metadata"in e)){let{releaseId:r=rd(),metadata:n={}}=e;return[r,n,t]}return[rd(),{},e]},rv=(e,t)=>{let[r,n,i]=rg(e,t);return{action:{actionType:"sanity.action.release.create",releaseId:r,metadata:{...n,releaseType:n.releaseType||"undecided"}},options:i}};class rm{#a;#u;constructor(e,t){this.#a=e,this.#u=t}get({releaseId:e},t){return tI(this.#a,this.#u,`_.releases.${e}`,t)}create(e,t){let{action:r,options:n}=rv(e,t),{releaseId:i,metadata:s}=r;return tM(this.#a,this.#u,r,n).pipe((0,eh.U)(e=>({...e,releaseId:i,metadata:s})))}edit({releaseId:e,patch:t},r){return tM(this.#a,this.#u,{actionType:"sanity.action.release.edit",releaseId:e,patch:t},r)}publish({releaseId:e},t){return tM(this.#a,this.#u,{actionType:"sanity.action.release.publish",releaseId:e},t)}archive({releaseId:e},t){return tM(this.#a,this.#u,{actionType:"sanity.action.release.archive",releaseId:e},t)}unarchive({releaseId:e},t){return tM(this.#a,this.#u,{actionType:"sanity.action.release.unarchive",releaseId:e},t)}schedule({releaseId:e,publishAt:t},r){return tM(this.#a,this.#u,{actionType:"sanity.action.release.schedule",releaseId:e,publishAt:t},r)}unschedule({releaseId:e},t){return tM(this.#a,this.#u,{actionType:"sanity.action.release.unschedule",releaseId:e},t)}delete({releaseId:e},t){return tM(this.#a,this.#u,{actionType:"sanity.action.release.delete",releaseId:e},t)}fetchDocuments({releaseId:e},t){return tq(this.#a,this.#u,e,t)}}class rb{#a;#u;constructor(e,t){this.#a=e,this.#u=t}get({releaseId:e},t){return Z(tI(this.#a,this.#u,`_.releases.${e}`,t))}async create(e,t){let{action:r,options:n}=rv(e,t),{releaseId:i,metadata:s}=r;return{...await Z(tM(this.#a,this.#u,r,n)),releaseId:i,metadata:s}}edit({releaseId:e,patch:t},r){return Z(tM(this.#a,this.#u,{actionType:"sanity.action.release.edit",releaseId:e,patch:t},r))}publish({releaseId:e},t){return Z(tM(this.#a,this.#u,{actionType:"sanity.action.release.publish",releaseId:e},t))}archive({releaseId:e},t){return Z(tM(this.#a,this.#u,{actionType:"sanity.action.release.archive",releaseId:e},t))}unarchive({releaseId:e},t){return Z(tM(this.#a,this.#u,{actionType:"sanity.action.release.unarchive",releaseId:e},t))}schedule({releaseId:e,publishAt:t},r){return Z(tM(this.#a,this.#u,{actionType:"sanity.action.release.schedule",releaseId:e,publishAt:t},r))}unschedule({releaseId:e},t){return Z(tM(this.#a,this.#u,{actionType:"sanity.action.release.unschedule",releaseId:e},t))}delete({releaseId:e},t){return Z(tM(this.#a,this.#u,{actionType:"sanity.action.release.delete",releaseId:e},t))}fetchDocuments({releaseId:e},t){return Z(tq(this.#a,this.#u,e,t))}}class rw{#a;#u;
15constructor(e,t){this.#a=e,this.#u=t}getById(e){return tZ(this.#a,this.#u,{uri:`/users/${e}`})}}class r_{#a;#u;constructor(e,t){this.#a=e,this.#u=t}getById(e){return Z(tZ(this.#a,this.#u,{uri:`/users/${e}`}))}}class rx{assets;datasets;live;projects;users;agent;releases;#c;#u;listen=ri;constructor(e,t=e4){this.config(t),this.#u=e,this.assets=new t5(this,this.#u),this.datasets=new ru(this,this.#u),this.live=new ro(this),this.projects=new rh(this,this.#u),this.users=new rw(this,this.#u),this.agent={action:new t9(this,this.#u)},this.releases=new rm(this,this.#u)}clone(){return new rx(this.#u,this.config())}config(e){if(void 0===e)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=tn(e,this.#c||{}),this}withConfig(e){let t=this.config();return new rx(this.#u,{...t,...e,stega:{...t.stega||{},..."boolean"==typeof e?.stega?{enabled:e.stega}:e?.stega||{}}})}fetch(e,t,r){return t$(this,this.#u,this.#c.stega,e,t,r)}getDocument(e,t){return tI(this,this.#u,e,t)}getDocuments(e,t){return tR(this,this.#u,e,t)}create(e,t){return tN(this,this.#u,e,"create",t)}createIfNotExists(e,t){return tk(this,this.#u,e,t)}createOrReplace(e,t){return tT(this,this.#u,e,t)}createVersion({document:e,publishedId:t,releaseId:r},n){let i=ry("createVersion",{document:e,publishedId:t,releaseId:r}),s={...e,_id:i},o=t||(0,eE.vs)(e._id);return tO(this,this.#u,s,o,n)}delete(e,t){return tj(this,this.#u,e,t)}discardVersion({releaseId:e,publishedId:t},r,n){let i=rp(t,e);return tA(this,this.#u,i,r,n)}replaceVersion({document:e,publishedId:t,releaseId:r},n){let i=ry("replaceVersion",{document:e,publishedId:t,releaseId:r}),s={...e,_id:i};return tP(this,this.#u,s,n)}unpublishVersion({releaseId:e,publishedId:t},r){let n=(0,eE.XL)(t,e);return tD(this,this.#u,n,t,r)}mutate(e,t){return tU(this,this.#u,e,t)}patch(e,t){return new tp(e,t,this)}transaction(e){return new tb(e,this)}action(e,t){return tM(this,this.#u,e,t)}request(e){return tZ(this,this.#u,e)}getUrl(e,t){return tY(this,e,t)}getDataUrl(e,t){return tG(this,e,t)}}class rE{assets;datasets;live;projects;users;agent;releases;observable;#c;#u;listen=ri;constructor(e,t=e4){this.config(t),this.#u=e,this.assets=new t6(this,this.#u),this.datasets=new rc(this,this.#u),this.live=new ro(this),this.projects=new rf(this,this.#u),this.users=new r_(this,this.#u),this.agent={action:new t2(this,this.#u)},this.releases=new rb(this,this.#u),this.observable=new rx(e,t)}clone(){return new rE(this.#u,this.config())}config(e){if(void 0===e)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(e),this.#c=tn(e,this.#c||{}),this}withConfig(e){let t=this.config();return new rE(this.#u,{...t,...e,stega:{...t.stega||{},..."boolean"==typeof e?.stega?{enabled:e.stega}:e?.stega||{}}})}fetch(e,t,r){return Z(t$(this,this.#u,this.#c.stega,e,t,r))}getDocument(e,t){return Z(tI(this,this.#u,e,t))}getDocuments(e,t){return Z(tR(this,this.#u,e,t))}create(e,t){return Z(tN(this,this.#u,e,"create",t))}createIfNotExists(e,t){return Z(tk(this,this.#u,e,t))}createOrReplace(e,t){return Z(tT(this,this.#u,e,t))}createVersion({document:e,publishedId:t,releaseId:r},n){let i=ry("createVersion",{document:e,publishedId:t,releaseId:r}),s={...e,_id:i},o=t||(0,eE.vs)(e._id);return ed(tO(this,this.#u,s,o,n))}delete(e,t){return Z(tj(this,this.#u,e,t))}discardVersion({releaseId:e,publishedId:t},r,n){let i=rp(t,e);return Z(tA(this,this.#u,i,r,n))}replaceVersion({document:e,publishedId:t,releaseId:r},n){let i=ry("replaceVersion",{document:e,publishedId:t,releaseId:r}),s={...e,_id:i};return ed(tP(this,this.#u,s,n))}unpublishVersion({releaseId:e,publishedId:t},r){let n=(0,eE.XL)(t,e);return Z(tD(this,this.#u,n,t,r))}mutate(e,t){return Z(tU(this,this.#u,e,t))}patch(e,t){return new ty(e,t,this)}transaction(e){return new tm(e,this)}action(e,t){return Z(tM(this,this.#u,e,t))}request(e){return Z(tZ(this,this.#u,e))}dataRequest(e,t,r){return Z(tF(this,this.#u,e,t,r))}getUrl(e,t){return tY(this,e,t)}getDataUrl(e,t){return tG(this,e,t)}}let rS={requester:eD(n=[]),createClient:e=>{let t=eD(n);return new rE((r,n)=>(n||t)({maxRedirects:0,maxRetries:e.maxRetries,retryDelay:e.retryDelay,...r}),e)}},rC=(rS.requester,rS.createClient);var r$=r(77084),rI=r(73831),rR=r(30591),rq=r(58504),rk=r(58078),rT=r(9571),rO=r(60781);let rj=(0,rR.default)(()=>r.e(6124).then(r.bind(r,86124)),{loadableGenerated:{webpack:()=>[require.resolveWeak("../_chunks-es/PresentationComlink.js")]},ssr:!1}),rA=(0,rR.default)(()=>r.e(412).then(r.bind(r,90412)),{loadableGenerated:{webpack:()=>[require.resolveWeak("../_chunks-es/RefreshOnMount.js")]},ssr:!1}),rP=(0,rR.default)(()=>r.e(5976).then(r.bind(r,35976)),{loadableGenerated:{webpack:()=>[require.resolveWeak("../_chunks-es/RefreshOnFocus.js")]},ssr:!1}),rD=(0,rR.default)(()=>r.e(3492).then(r.bind(r,23492)),{loadableGenerated:{webpack:()=>[require.resolveWeak("../_chunks-es/RefreshOnReconnect.js")]},ssr:!1});function rU(e){var t;e instanceof eA?console.warn("Sanity Live is unable to connect to the Sanity API as the current origin - ".concat(window.origin," - is not in the list of allowed CORS origins for this Sanity Project."),e.addOriginUrl&&"Add it here:",null===(t=e.addOriginUrl)||void 0===t?void 0:t.toString()):console.error(e)}
15function rM(e,t){t?console.warn("Sanity Live connection closed, switching to long polling set to a interval of",t/1e3,"seconds and the server gave this reason:",e.reason):console.error("Sanity Live connection closed, automatic revalidation is disabled, the server gave this reason:",e.reason)}function rF(e){let{projectId:t,dataset:r,apiHost:n,apiVersion:s,useProjectHostname:o,token:a,requestTagPrefix:u,draftModeEnabled:c,draftModePerspective:l,refreshOnMount:h=!1,refreshOnFocus:f=!c&&(typeof window>"u"||window.self===window.top),refreshOnReconnect:d=!0,intervalOnGoAway:p=3e4,requestTag:y="next-loader.live",onError:g=rU,onGoAway:v=rM,revalidateSyncTags:m=r$.n}=e,b=(0,rk.useMemo)(()=>rC({projectId:t,dataset:r,apiHost:n,apiVersion:s,useProjectHostname:o,ignoreBrowserTokenWarning:!0,token:a,useCdn:!1,requestTagPrefix:u}),[n,s,r,t,u,a,o]),[w,_]=(0,rk.useState)(!1),x=(0,rq.useRouter)(),E=(0,rT.i)(e=>{"message"===e.type?m(e.tags):"restart"===e.type||"reconnect"===e.type?x.refresh():"goaway"===e.type&&(v(e,p),_(p))});(0,rk.useEffect)(()=>{let e=b.live.events({includeDrafts:!!a,tag:y}).subscribe({next:E,error:e=>{g(e)}});return()=>e.unsubscribe()},[b.live,g,y,a]),(0,rk.useEffect)(()=>{c&&l?(0,rO.Bk)(l):(0,rO.Bk)("unknown")},[c,l]);let[S,C]=(0,rk.useState)(!1);(0,rk.useEffect)(()=>{if(!(0,rI.Ig)()){if(c&&a){(0,rO.Uw)("live");return}if(c){(0,rO.Uw)("static");return}(0,rO.Uw)("unknown")}},[c,a]),(0,rk.useEffect)(()=>{if(!(0,rI.Ig)())return;let e=new AbortController,t=setTimeout(()=>(0,rO.Uw)("live"),3e3);return window.addEventListener("message",r=>{let{data:n}=r;n&&"object"==typeof n&&"domain"in n&&"sanity/channels"===n.domain&&"from"in n&&"presentation"===n.from&&(clearTimeout(t),(0,rO.Uw)((0,rI.Ax)()?"presentation-window":"presentation-iframe"),C(!0),e.abort())},{signal:e.signal}),()=>{clearTimeout(t),e.abort()}},[]);let $=(0,rk.useRef)(void 0);return(0,rk.useEffect)(()=>{if(c)return clearTimeout($.current),()=>{$.current=setTimeout(()=>{console.warn("Sanity Live: Draft mode was enabled, but is now being disabled")})}},[c]),(0,rk.useEffect)(()=>{if(!w)return;let e=setInterval(()=>x.refresh(),w);return()=>clearInterval(e)},[w,x]),(0,i.jsxs)(i.Fragment,{children:[c&&S&&(0,i.jsx)(rj,{projectId:t,dataset:r,draftModeEnabled:c,draftModePerspective:l}),!c&&h&&(0,i.jsx)(rA,{}),!c&&f&&(0,i.jsx)(rP,{}),!c&&d&&(0,i.jsx)(rD,{})]})}rF.displayName="SanityLive"},77084:function(e,t,r){r.d(t,{N:function(){return i},n:function(){return s}}),r(34261);var n=r(5218),i=(0,n.$)("0f51d6b55e4c7b7637487116928fc7e55499793c"),s=(0,n.$)("799c77c9593307f38dc48bb223f08b9aebe997d9")},9571:function(e,t,r){r.d(t,{i:function(){return i}});var n=r(58078);function i(e){let t=(0,n.useRef)(null);return(0,n.useInsertionEffect)(()=>{t.current=e},[e]),(0,n.useCallback)((...e)=>(0,t.current)(...e),[])}},73831:function(e,t,r){r.d(t,{Ax:function(){return h},Ig:function(){return f},XP:function(){return c},el:function(){return l}});var n=r(95958);let i={"handshake/syn":n.bK,"handshake/syn-ack":n.Ol,"handshake/ack":n.ei,"channel/response":n.Ag,"channel/heartbeat":n.UE,"channel/disconnect":n.Hq,"overlay/focus":"visual-editing/focus","overlay/navigate":"visual-editing/navigate","overlay/toggle":"visual-editing/toggle","presentation/toggleOverlay":"presentation/toggle-overlay"},s={[n.bK]:"handshake/syn",[n.Ol]:"handshake/syn-ack",[n.ei]:"handshake/ack",[n.Ag]:"channel/response",[n.UE]:"channel/heartbeat",[n.Hq]:"channel/disconnect","visual-editing/focus":"overlay/focus","visual-editing/navigate":"overlay/navigate","visual-editing/toggle":"overlay/toggle","presentation/toggle-overlay":"presentation/toggleOverlay"},o=e=>{let{data:t}=e;return t&&"object"==typeof t&&"domain"in t&&"type"in t&&"from"in t&&"to"in t&&("sanity/channels"===t.domain&&(t.domain=n.yK),"overlays"===t.to&&(t.to="visual-editing"),"overlays"===t.from&&(t.from="visual-editing"),t.channelId=t.connectionId,delete t.connectionId,t.type=i[t.type]??t.type),e},a=e=>{let{channelId:t,...r}=e,i={...r,connectionId:t};return i.domain===n.yK&&(i.domain="sanity/channels"),"visual-editing"===i.to&&(i.to="overlays"),"visual-editing"===i.from&&(i.from="overlays"),i.type=s[i.type]??i.type,"channel/response"===i.type&&i.responseTo&&!i.data&&(i.data={responseTo:i.responseTo}
15),("handshake/syn"===i.type||"handshake/syn-ack"===i.type||"handshake/ack"===i.type)&&(i.data={id:i.connectionId}),i},u=({context:e},t)=>{let{sources:r,targetOrigin:n}=e,i=a(t.message);r.forEach(e=>{e.postMessage(i,{targetOrigin:n})})},c=()=>({listen:(0,n.F8)(o),requestMachine:(0,n.lB)().provide({actions:{"send message":u}})});function l(){return window.self!==window.top}function h(){return!!window.opener}function f(){return l()||h()}},90907:function(e,t,r){r.d(t,{default:function(){return o}});var n=r(37821),i=r(58078);let s=(0,i.lazy)(()=>Promise.all([r.e(5703),r.e(8313),r.e(1404),r.e(9919)]).then(r.bind(r,73708)));function o(e){return(0,n.jsx)(i.Suspense,{fallback:null,children:(0,n.jsx)(s,{...e})})}}}]);

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.