1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[509],{61125:(t,e,s)=>{s.d(e,{P:()=>r});var n=s(27196),i=s(10402);function r(t){return new n.y(function(e){(0,i.Xf)(t()).subscribe(e)})}},74222:(t,e,s)=>{s.d(e,{E:()=>n});var n=new(s(27196)).y(function(t){return t.complete()})},5730:(t,e,s)=>{s.d(e,{R:()=>function t(e,s,p,y){if((0,u.m)(p)&&(y=p,p=void 0),y)return t(e,s,p).pipe((0,c.Z)(y));var v=(0,n.CR)((0,u.m)(e.addEventListener)&&(0,u.m)(e.removeEventListener)?l.map(function(t){return function(n){return e[t](s,n,p)}}):(0,u.m)(e.addListener)&&(0,u.m)(e.removeListener)?h.map(d(e,s)):(0,u.m)(e.on)&&(0,u.m)(e.off)?f.map(d(e,s)):[],2),g=v[0],m=v[1];if(!g&&(0,a.z)(e))return(0,o.z)(function(e){return t(e,s,p)})((0,i.Xf)(e));if(!g)throw TypeError("Invalid event target");return new r.y(function(t){var e=function(){for(var e=[],s=0;s<arguments.length;s++)e[s]=arguments[s];return t.next(1<e.length?e:e[0])};return g(e),function(){return m(e)}})}});var n=s(11735),i=s(10402),r=s(27196),o=s(54196),a=s(45982),u=s(66706),c=s(2899),h=["addListener","removeListener"],l=["addEventListener","removeEventListener"],f=["on","off"];function d(t,e){return function(s){return function(n){return t[s](e,n)}}}},29809:(t,e,s)=>{s.d(e,{b:()=>r});var n=s(54196),i=s(66706);function r(t,e){return(0,i.m)(e)?(0,n.z)(t,e,1):(0,n.z)(t,1)}},54196:(t,e,s)=>{s.d(e,{z:()=>function t(e,s,u){return(void 0===u&&(u=1/0),(0,a.m)(s))?t(function(t,r){return(0,n.U)(function(e,n){return s(t,e,r,n)})((0,i.Xf)(e(t,r)))},u):("number"==typeof s&&(u=s),(0,r.e)(function(t,s){var n,r,a,c,h,l,f,d,p;return n=u,a=[],c=0,h=0,l=!1,f=function(){!l||a.length||c||s.complete()},d=function(t){return c<n?p(t):a.push(t)},p=function(t){c++;var u=!1;(0,i.Xf)(e(t,h++)).subscribe((0,o.x)(s,function(t){r?d(t):s.next(t)},function(){u=!0},void 0,function(){if(u)try{for(c--;a.length&&c<n;)!function(){var t=a.shift();p(t)}();f()}catch(t){s.error(t)}}))},t.subscribe((0,o.x)(s,d,function(){l=!0,f()})),function(){}}))}});var n=s(65690),i=s(10402),r=s(13306),o=(s(41336),s(37272)),a=s(66706)},18952:(t,e,s)=>{s.d(e,{q:()=>o});var n=s(74222),i=s(13306),r=s(37272);function o(t){return t<=0?function(){return n.E}:(0,i.e)(function(e,s){var n=0;e.subscribe((0,r.x)(s,function(e){++n<=t&&(s.next(e),t<=n&&s.complete())}))})}},31755:(t,e,s)=>{s.d(e,{R:()=>a});var n=s(13306),i=s(37272),r=s(10402),o=s(96453);function a(t){return(0,n.e)(function(e,s){(0,r.Xf)(t).subscribe((0,i.x)(s,function(){return s.complete()},o.Z)),s.closed||e.subscribe(s)})}},1574:(t,e,s)=>{s.d(e,{E9:()=>r,Y$:()=>u,ah:()=>p,p4:()=>f});var n=s(73944);let i=new WeakMap;function r(t){return{config:t,start:(e,s)=>{let{self:n,system:r,emit:o}=s,a={receivers:void 0,dispose:void 0};i.set(n,a),a.dispose=t({input:e.input,system:r,self:n,sendBack:t=>{"stopped"!==n.getSnapshot().status&&n._parent&&r._relay(n,n._parent,t)},receive:t=>{a.receivers??=new Set,a.receivers.add(t)},emit:o})},transition:(t,e,s)=>{let r=i.get(s.self);return e.type===n.X?(t={...t,status:"stopped",error:void 0},r.dispose?.()):r.receivers?.forEach(t=>t(e)),t},getInitialSnapshot:(t,e)=>({status:"active",output:void 0,error:void 0,input:e}),getPersistedSnapshot:t=>t,restoreSnapshot:t=>t}}let o="xstate.observable.error",a="xstate.observable.complete";function u(t){return{config:t,transition:(t,e)=>{if("active"!==t.status)return t;switch(e.type){case o:return{...t,status:"error",error:e.data,input:void 0,_subscription:void 0};case a:return{...t,status:"done",input:void 0,_subscription:void 0};case n.X:return t._subscription.unsubscribe(),{...t,status:"stopped",input:void 0,_subscription:void 0};default:return t}},getInitialSnapshot:(t,e)=>({status:"active",output:void 0,error:void 0,context:void 0,input:e,_subscription:void 0}),start:(e,{self:s,system:n,emit:i})=>{"done"!==e.status&&(e._subscription=t({input:e.input,system:n,self:s,emit:i}).subscribe({next:t=>{s._parent&&n._relay(s,s._parent,t)},error:t=>{n._relay(s,s,{type:o,data:t})},complete:()=>{n._relay(s,s,{type:a})}}))},getPersistedSnapshot:({_subscription:t,...e})=>e,restoreSnapshot:t=>({...t,_subscription:void 0})}}let c="xstate.promise.resolve",h="xstate.promise.reject",l=new WeakMap;function f(t){return{config:t,transition:(t,e,s)=>{if("active"!==t.status)return t;switch(e.type){case c:{let s=e.data;return{...t,status:"done",output:s,input:void 0}}case h:return{...t,status:"error",error:e.data,input:void 0};case n.X:return l.get(s.self)?.abort(),{...t,status:"stopped",input:void 0};default:return t}},start:(e,{self:s,system:n,emit:i})=>{if("active"!==e.status)return;let r=new AbortController;l.set(s,r),Promise.resolve(t({input:e.input,system:n,self:s,signal:r.signal,emit:i})).then(t=>
1{"active"===s.getSnapshot().status&&(l.delete(s),n._relay(s,s,{type:c,data:t}))},t=>{"active"===s.getSnapshot().status&&(l.delete(s),n._relay(s,s,{type:h,data:t}))})},getInitialSnapshot:(t,e)=>({status:"active",output:void 0,error:void 0,input:e}),getPersistedSnapshot:t=>t,restoreSnapshot:t=>t}}let d=function(t,e){return{config:t,transition:(e,s,n)=>({...e,context:t(e.context,s,n)}),getInitialSnapshot:(t,s)=>({status:"active",output:void 0,error:void 0,context:"function"==typeof e?e({input:s}):e}),getPersistedSnapshot:t=>t,restoreSnapshot:t=>t}}(t=>void 0,void 0);function p(){return(0,n.A)(d)}},18072:(t,e,s)=>{s.d(e,{a:()=>r,b:()=>v,c:()=>d,e:()=>u,s:()=>p});var n=s(73944);function i(t,e,s,i,{assignment:r}){if(!e.context)throw Error("Cannot assign to undefined `context`. Ensure that `context` is defined in the machine config.");let o={},a={context:e.context,event:s.event,spawn:function(t,{machine:e,context:s},i,r){let o=(o,a={})=>{let{systemId:u,input:c}=a;if("string"!=typeof o)return(0,n.A)(o,{id:a.id,parent:t.self,syncSnapshot:a.syncSnapshot,input:a.input,src:o,systemId:u});{let h=(0,n.z)(e,o);if(!h)throw Error(`Actor logic '${o}' not implemented in machine '${e.id}'`);let l=(0,n.A)(h,{id:a.id,parent:t.self,syncSnapshot:a.syncSnapshot,input:"function"==typeof c?c({context:s,event:i,self:t.self}):c,src:o,systemId:u});return r[l.id]=l,l}};return(e,s)=>{let i=o(e,s);return r[i.id]=i,t.defer(()=>{i._processingStatus!==n.T.Stopped&&i.start()}),i}}(t,e,s.event,o),self:t.self,system:t.system},u={};if("function"==typeof r)u=r(a,i);else for(let t of Object.keys(r)){let e=r[t];u[t]="function"==typeof e?e(a,i):e}let c=Object.assign({},e.context,u);return[(0,n.U)(e,{context:c,children:Object.keys(o).length?{...e.children,...o}:e.children})]}function r(t){function e(t,e){}return e.type="xstate.assign",e.assignment=t,e.resolve=i,e}function o(t,e,s,n,{event:i}){return[e,{event:"function"==typeof i?i(s,n):i}]}function a(t,{event:e}){t.defer(()=>t.emit(e))}function u(t){function e(t,e){}return e.type="xstate.emit",e.event=t,e.resolve=o,e.execute=a,e}let c=function(t){return t.Parent="#_parent",t.Internal="#_internal",t}({});function h(t,e,s,n,{to:i,event:r,id:o,delay:a},u){let h,l;let f=e.machine.implementations.delays;if("string"==typeof r)throw Error(`Only event objects may be used with sendTo; use sendTo({ type: "${r}" }) instead`);let d="function"==typeof r?r(s,n):r;if("string"==typeof a){let t=f&&f[a];h="function"==typeof t?t(s,n):t}else h="function"==typeof a?a(s,n):a;let p="function"==typeof i?i(s,n):i;if("string"==typeof p){if(!(l=p===c.Parent?t.self._parent:p===c.Internal?t.self:p.startsWith("#_")?e.children[p.slice(2)]:u.deferredActorIds?.includes(p)?p:e.children[p]))throw Error(`Unable to send event to actor '${p}' from machine '${e.machine.id}'.`)}else l=p||t.self;return[e,{to:l,event:d,id:o,delay:h}]}function l(t,e,s){"string"==typeof s.to&&(s.to=e.children[s.to])}function f(t,e){t.defer(()=>{let{to:s,event:i,delay:r,id:o}=e;if("number"==typeof r){t.system.scheduler.schedule(t.self,s,i,r,o);return}t.system._relay(t.self,s,i.type===n.V?(0,n.W)(t.self.id,i.data):i)})}function d(t,e,s){function n(t,e){}return n.type="xsnapshot.sendTo",n.to=t,n.event=e,n.id=s?.id,n.delay=s?.delay,n.resolve=h,n.retryResolve=l,n.execute=f,n}function p(t,e){return d(c.Parent,t,e)}function y(t,e,s,i,{collect:o}){let a=[],c=function(t){a.push(t)};return c.assign=(...t)=>{a.push(r(...t))},c.cancel=(...t)=>{a.push((0,n.M)(...t))},c.raise=(...t)=>{a.push((0,n.O)(...t))},c.sendTo=(...t)=>{a.push(d(...t))},c.sendParent=(...t)=>{a.push(p(...t))},c.spawnChild=(...t)=>{a.push((0,n.P)(...t))},c.stopChild=(...t)=>{a.push((0,n.R)(...t))},c.emit=(...t)=>{a.push(u(...t))},o({context:s.context,event:s.event,enqueue:c,check:t=>(0,n.e)(t,e.context,s.event,e),self:t.self,system:t.system},i),[e,void 0,a]}function v(t){function e(t,e){}return e.type="xstate.enqueueActions",e.collect=t,e.resolve=y,e}},73944:(t,e,s)=>{s.d(e,{$:()=>j,A:()=>N,M:()=>P,N:()=>o,O:()=>tN,P:()=>D,R:()=>V,S:()=>r,T:()=>O,U:()=>tj,V:()=>u,W:()=>l,X:()=>c,a:()=>S,b:()=>Q,c:()=>k,d:()=>te,e:()=>W,f:()=>tt,g:()=>K,h:()=>H,i:()=>U,j:()=>tu,k:()=>tI,l:()=>G,m:()=>g,n:()=>tm,o:()=>function t(e,s,n,i){return"string"==typeof s?function(t,e,s,n){let i=to(t,e).next(s,n);return i&&i.length?i:t.next(s,n)}(e,s,n,i):1===Object.keys(s).length?function(e,s,n,i){let r=Object.keys(s),o=t(to(e,r[0]),s[r[0]],n,i);return o&&o.length?o:e.next(n,i)}(e,s,n,i):function(e,s,n,i){let r=[];for(let o of Object.keys(s)){let a=s[o];if(!a)continue;let u=t(to(e,o),a,n,i);u&&r.push(...u)}return r.length?r:e.next(n,i)}(e,s,n,i)},p:()=>tg,q:()=>f,r:()=>tS,s:()=>tp,t:()=>m,u:()=>tr,v:()=>y,w:()=>F,x:()=>ta,y:()=>tO,z:()=>$});let n=t=>{if("undefined"==typeof window)return;let e=function(){let t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==s.g?s.g:void 0;if(t.__xstate__)return t.__xstate__}();e&&e.register(t)};class i{constructor(t){this._process=t,this._active=!1,this._current=null,this._last=null}start(){this._active=!0,this.flush()}clear(){this._current&&(this._current.next=null,this._last=this._current)}enqueue(t){let e={value:t,next:null};if(this._current){this._last.next=e,this._last=e;return}this._current=e,this._last=e,this._active&&this.flush()}flush(){for(;this._current;){let t=this._current;this._process(t.value),this._current=t.next}this._last=null}}let r=".",o="",a="xstate.init",u="xstate.error",c="xstate.stop";function h(t,e){return{type:`xstate.done.state.${t}`,output:e}}function l(t,e){return{type:`xstate.error.actor.${t}`,error:e,actorId:t}}
1function f(t){return{type:a,input:t}}function d(t){setTimeout(()=>{throw t})}let p="function"==typeof Symbol&&Symbol.observable||"@@observable";function y(t){if(b(t))return t;let e=[],s="";for(let n=0;n<t.length;n++){switch(t.charCodeAt(n)){case 92:s+=t[n+1],n++;continue;case 46:e.push(s),s="";continue}s+=t[n]}return e.push(s),e}function v(t){return t&&"object"==typeof t&&"machine"in t&&"value"in t?t.value:"string"!=typeof t?t:function(t){if(1===t.length)return t[0];let e={},s=e;for(let e=0;e<t.length-1;e++)if(e===t.length-2)s[t[e]]=t[e+1];else{let n=s;s={},n[t[e]]=s}return e}(y(t))}function g(t,e){let s={},n=Object.keys(t);for(let i=0;i<n.length;i++){let r=n[i];s[r]=e(t[r],r,t,i)}return s}function m(t){return void 0===t?[]:b(t)?t:[t]}function _(t,e,s,n){return"function"==typeof t?t({context:e,event:s,self:n}):t}function b(t){return Array.isArray(t)}function S(t){return(b(t)?t:[t]).map(t=>void 0===t||"string"==typeof t?{target:t}:t)}function x(t){if(void 0!==t&&""!==t)return m(t)}function w(t,e,s){let n="object"==typeof t,i=n?t:void 0;return{next:(n?t.next:t)?.bind(i),error:(n?t.error:e)?.bind(i),complete:(n?t.complete:s)?.bind(i)}}function k(t,e){return`${e}.${t}`}function $(t,e){let s=e.match(/^xstate\.invoke\.(\d+)\.(.*)/);if(!s)return t.implementations.actors[e];let[,n,i]=s,r=t.getStateNodeById(i).config.invoke;return(Array.isArray(r)?r[n]:r).src}function E(t,e){return`${t.sessionId}.${e}`}let I=0,j=1,O=function(t){return t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped",t}({}),T={clock:{setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t)},logger:console.log.bind(console),devTools:!1};class A{constructor(t,e){this.logic=t,this._snapshot=void 0,this.clock=void 0,this.options=void 0,this.id=void 0,this.mailbox=new i(this._process.bind(this)),this.observers=new Set,this.eventListeners=new Map,this.logger=void 0,this._processingStatus=O.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 s={...T,...e},{clock:n,logger:r,parent:o,syncSnapshot:a,id:u,systemId:c,inspect:h}=s;this.system=o?o.system:function(t,e){let s=new Map,n=new Map,i=new WeakMap,r=new Set,o={},{clock:a,logger:u}=e,c={schedule:(t,e,s,n,i=Math.random().toString(36).slice(2))=>{let r={source:t,target:e,event:s,delay:n,id:i,startedAt:Date.now()},u=E(t,i);h._snapshot._scheduledEvents[u]=r;let c=a.setTimeout(()=>{delete o[u],delete h._snapshot._scheduledEvents[u],h._relay(t,e,s)},n);o[u]=c},cancel:(t,e)=>{let s=E(t,e),n=o[s];delete o[s],delete h._snapshot._scheduledEvents[s],void 0!==n&&a.clearTimeout(n)},cancelAll:t=>{for(let e in h._snapshot._scheduledEvents){let s=h._snapshot._scheduledEvents[e];s.source===t&&c.cancel(t,s.id)}}},h={_snapshot:{_scheduledEvents:(e?.snapshot&&e.snapshot.scheduler)??{}},_bookId:()=>`x:${I++}`,_register:(t,e)=>(s.set(t,e),t),_unregister:t=>{s.delete(t.sessionId);let e=i.get(t);void 0!==e&&(n.delete(e),i.delete(t))},get:t=>n.get(t),_set:(t,e)=>{let s=n.get(t);if(s&&s!==e)throw Error(`Actor with system ID '${t}' already exists.`);n.set(t,e),i.set(e,t)},inspect:t=>{let e=w(t);return r.add(e),{unsubscribe(){r.delete(e)}}},_sendInspectionEvent:e=>{if(!r.size)return;let s={...e,rootId:t.sessionId};r.forEach(t=>t.next?.(s))},_relay:(t,e,s)=>{h._sendInspectionEvent({type:"@xstate.event",sourceRef:t,actorRef:e,event:s}),e._send(s)},scheduler:c,getSnapshot:()=>({_scheduledEvents:{...h._snapshot._scheduledEvents}}),start:()=>{let t=h._snapshot._scheduledEvents;for(let e in h._snapshot._scheduledEvents={},t){let{source:s,target:n,event:i,delay:r,id:o}=t[e];c.schedule(s,n,i,r,o)}},_clock:a,_logger:u};return h}(this,{clock:n,logger:r}),h&&!o&&this.system.inspect(w(h)),this.sessionId=this.system._bookId(),this.id=u??this.sessionId,this.logger=e?.logger??this.system._logger,this.clock=e?.clock??this.system._clock,this._parent=o,this._syncSnapshot=a,this.options=s,this.src=s.src??t,this.ref=this,this._actorScope={self:this,id:this.id,sessionId:this.sessionId,logger:this.logger,defer:t=>{this._deferred.push(t)},system:this.system,stopChild:t=>{if(t._parent!==this)throw Error(`Cannot stop child actor ${t.id} of ${this.id} because it is not a child`);t._stop()},emit:t=>{let e=this.eventListeners.get(t.type),s=this.eventListeners.get("*");if(e||s)for(let n of Array.from(new Set([...e?e.values():[],...s?s.values():[]])))n(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(e?.snapshot??e?.state),c&&"active"!==this._snapshot.status&&this.system._unregister(this)}_initState(t){try{this._snapshot=t?this.logic.restoreSnapshot?this.logic.restoreSnapshot(t,this._actorScope):t:this.logic.getInitialSnapshot(this._actorScope,this.options?.input)}catch(t){this._snapshot={status:"error",output:void 0,error:t}}}update(t,e){let s;for(this._snapshot=t;s=this._deferred.shift();)try{s()}catch(e){this._deferred.length=0,this._snapshot={...t,status:"error",error:e}}switch(this._snapshot.status){case"active":for(let e of this.observers)try{e.
1next?.(t)}catch(t){d(t)}break;case"done":var n;for(let e of this.observers)try{e.next?.(t)}catch(t){d(t)}this._stopProcedure(),this._complete(),this._doneEvent=(n=this.id,{type:`xstate.done.actor.${n}`,output:this._snapshot.output,actorId:n}),this._parent&&this.system._relay(this,this._parent,this._doneEvent);break;case"error":this._error(this._snapshot.error)}this.system._sendInspectionEvent({type:"@xstate.snapshot",actorRef:this,event:e,snapshot:t})}subscribe(t,e,s){let n=w(t,e,s);if(this._processingStatus!==O.Stopped)this.observers.add(n);else switch(this._snapshot.status){case"done":try{n.complete?.()}catch(t){d(t)}break;case"error":{let t=this._snapshot.error;if(n.error)try{n.error(t)}catch(t){d(t)}else d(t)}}return{unsubscribe:()=>{this.observers.delete(n)}}}on(t,e){let s=this.eventListeners.get(t);s||(s=new Set,this.eventListeners.set(t,s));let n=e.bind(void 0);return s.add(n),{unsubscribe:()=>{s.delete(n)}}}start(){if(this._processingStatus===O.Running)return this;this._syncSnapshot&&this.subscribe({next:t=>{"active"===t.status&&this.system._relay(this,this._parent,{type:`xstate.snapshot.${this.id}`,snapshot:t})},error:()=>{}}),this.system._register(this.sessionId,this),this._systemId&&this.system._set(this._systemId,this),this._processingStatus=O.Running;let t=f(this.options.input);switch(this.system._sendInspectionEvent({type:"@xstate.event",sourceRef:this._parent,actorRef:this,event:t}),this._snapshot.status){case"done":return this.update(this._snapshot,t),this;case"error":return this._error(this._snapshot.error),this}if(this._parent||this.system.start(),this.logic.start)try{this.logic.start(this._snapshot,this._actorScope)}catch(t){return this._snapshot={...this._snapshot,status:"error",error:t},this._error(t),this}return this.update(this._snapshot,t),this.options.devTools&&this.attachDevTools(),this.mailbox.start(),this}_process(t){let e,s;try{e=this.logic.transition(this._snapshot,t,this._actorScope)}catch(t){s={err:t}}if(s){let{err:t}=s;this._snapshot={...this._snapshot,status:"error",error:t},this._error(t);return}this.update(e,t),t.type===c&&(this._stopProcedure(),this._complete())}_stop(){return this._processingStatus===O.Stopped||((this.mailbox.clear(),this._processingStatus===O.NotStarted)?this._processingStatus=O.Stopped:this.mailbox.enqueue({type:c})),this}stop(){if(this._parent)throw Error("A non-root actor cannot be stopped directly.");return this._stop()}_complete(){for(let t of this.observers)try{t.complete?.()}catch(t){d(t)}this.observers.clear()}_reportError(t){if(!this.observers.size){this._parent||d(t);return}let e=!1;for(let s of this.observers){let n=s.error;e||=!n;try{n?.(t)}catch(t){d(t)}}this.observers.clear(),e&&d(t)}_error(t){this._stopProcedure(),this._reportError(t),this._parent&&this.system._relay(this,this._parent,l(this.id,t))}_stopProcedure(){return this._processingStatus!==O.Running||(this.system.scheduler.cancelAll(this),this.mailbox.clear(),this.mailbox=new i(this._process.bind(this)),this._processingStatus=O.Stopped,this.system._unregister(this)),this}_send(t){this._processingStatus!==O.Stopped&&this.mailbox.enqueue(t)}send(t){this.system._relay(void 0,this,t)}attachDevTools(){let{devTools:t}=this.options;t&&("function"==typeof t?t:n)(this)}toJSON(){return{xstate$$type:j,id:this.id}}getPersistedSnapshot(t){return this.logic.getPersistedSnapshot(this._snapshot,t)}[p](){return this}getSnapshot(){return this._snapshot}}function N(t,...[e]){return new A(t,e)}function M(t,e,s,n,{sendId:i}){return[e,"function"==typeof i?i(s,n):i]}function R(t,e){t.defer(()=>{t.system.scheduler.cancel(t.self,e)})}function P(t){function e(t,e){}return e.type="xstate.cancel",e.sendId=t,e.resolve=M,e.execute=R,e}function C(t,e,s,n,{id:i,systemId:r,src:o,input:a,syncSnapshot:u}){let c;let h="string"==typeof o?$(e.machine,o):o,l="function"==typeof i?i(s):i;return h&&(c=N(h,{id:l,src:o,parent:t.self,syncSnapshot:u,systemId:r,input:"function"==typeof a?a({context:e.context,event:s.event,self:t.self}):a})),[tj(e,{children:{...e.children,[l]:c}}),{id:i,actorRef:c}]}function z(t,{id:e,actorRef:s}){s&&t.defer(()=>{s._processingStatus!==O.Stopped&&s.start()})}function D(...[t,{id:e,systemId:s,input:n,syncSnapshot:i=!1}={}]){function r(t,e){}return r.type="snapshot.spawnChild",r.id=e,r.systemId=s,r.src=t,r.input=n,r.syncSnapshot=i,r.resolve=C,r.execute=z,r}function L(t,e,s,n,{actorRef:i}){let r="function"==typeof i?i(s,n):i,o="string"==typeof r?e.children[r]:r,a=e.children;return o&&(a={...a},delete a[o.id]),[tj(e,{children:a}),o]}function J(t,e){if(e){if(t.system._unregister(e),e._processingStatus!==O.Running){t.stopChild(e);return}t.defer(()=>{t.stopChild(e)})}}function V(t){function e(t,e){}return e.type="xstate.stopChild",e.actorRef=t,e.resolve=L,e.execute=J,e}function W(t,e,s,n){let{machine:i}=n,r="function"==typeof t,o=r?t:i.implementations.guards["string"==typeof t?t:t.type];if(!r&&!o)throw Error(`Guard '${"string"==typeof t?t:t.type}' is not implemented.'.`);if("function"!=typeof o)return W(o,e,s,n);let a={context:e,event:s},u=r||"string"==typeof t?void 0:"params"in t?"function"==typeof t.params?t.params({context:e,event:s}):t.params:void 0;return"check"in o?o.check(n,a,o):o(a,u)}let X=t=>"atomic"===t.type||"final"===t.type;function q(t){return Object.values(t.states).filter(t=>"history"!==t.type)}function B(t,e){let s=[];if(e===t)return s;let n=t.parent;for(;n&&n!==e;)s.push(n),n=n.parent;return s}function U(t){let e=new Set(t),s=Z(e);for(let t of e)if("compound"!==t.type||s.get(t)&&s.get(t).length){if("parallel"===t.type){for(let s of q(t))if("history"!==s.type&&!e.has(s))for(let t of ti(s))e.add(t)}}else ti(t).forEach(t=>e.add(t));for(let t of e){let s=t.parent;for(;s;)e.add(s),s=s.parent}return e}function Z(t){let e=new Map;for(let s of t)e.has(s)||e.set(s,[]),s.parent&&(e.has(s.parent)||e.set(s.parent,[]),e.get(s.parent).push(s));return e}function Y(t,e){return function t(e,s){let n=s.get(e);if(!n)return{};if("compound"===e.type){let t=n[0];if(!t)return{};if(X(t))return t.key}let i={};for(let e of n)i[e.key]=t(e,s);return i}(t,Z(U(e)))}function G(t,e){return"compound"===e.type?q(e).some(e=>"final"===e.type&&t.has(e)):"parallel"===e.type?q(e).every(e=>G(t,e)):"final"===e.type}let F=t=>"#"===t[0];function H(t,e){return t.transitions.get(e)||[...t.transitions.keys()].filter(t=>{if("*"===t)return!0;
1if(!t.endsWith(".*"))return!1;let s=t.split("."),n=e.split(".");for(let t=0;t<s.length;t++){let e=s[t],i=n[t];if("*"===e)return t===s.length-1;if(e!==i)return!1}return!0}).sort((t,e)=>e.length-t.length).flatMap(e=>t.transitions.get(e))}function K(t){let e=t.config.after;if(!e)return[];let s=(e,s)=>{var n;let i=(n=t.id,{type:`xstate.after.${e}.${n}`}),r=i.type;return t.entry.push(tN(i,{id:r,delay:e})),t.exit.push(P(r)),r};return Object.keys(e).flatMap((t,n)=>{let i=e[t],r=Number.isNaN(+t)?t:+t,o=s(r);return m("string"==typeof i?{target:i}:i).map(t=>({...t,event:o,delay:r}))}).map(e=>{let{delay:s}=e;return{...Q(t,e.event,e),delay:s}})}function Q(t,e,s){let n=x(s.target),i=s.reenter??!1,o=function(t,e){if(void 0!==e)return e.map(e=>{if("string"!=typeof e)return e;if(F(e))return t.machine.getStateNodeById(e);let s=e[0]===r;if(s&&!t.parent)return ta(t,e.slice(1));let n=s?t.key+e:e;if(t.parent)try{return ta(t.parent,n)}catch(e){throw Error(`Invalid transition definition for state node '${t.id}': 2${e.message}`)}else throw Error(`Invalid target: "${e}" is not a valid target from the root node. Did you mean ".${e}"?`)})}(t,n),a={...s,actions:m(s.actions),guard:s.guard,target:o,source:t,reenter:i,eventType:e,toJSON:()=>({...a,source:`#${t.id}`,target:o?o.map(t=>`#${t.id}`):void 0})};return a}function tt(t){let e=new Map;if(t.config.on)for(let s of Object.keys(t.config.on)){if(s===o)throw Error('Null events ("") cannot be specified as a transition key. Use `always: { ... }` instead.');let n=t.config.on[s];e.set(s,S(n).map(e=>Q(t,s,e)))}if(t.config.onDone){let s=`xstate.done.state.${t.id}`;e.set(s,S(t.config.onDone).map(e=>Q(t,s,e)))}for(let s of t.invoke){if(s.onDone){let n=`xstate.done.actor.${s.id}`;e.set(n,S(s.onDone).map(e=>Q(t,n,e)))}if(s.onError){let n=`xstate.error.actor.${s.id}`;e.set(n,S(s.onError).map(e=>Q(t,n,e)))}if(s.onSnapshot){let n=`xstate.snapshot.${s.id}`;e.set(n,S(s.onSnapshot).map(e=>Q(t,n,e)))}}for(let s of t.after){let t=e.get(s.eventType);t||(t=[],e.set(s.eventType,t)),t.push(s)}return e}function te(t,e){let s="string"==typeof e?t.states[e]:e?t.states[e.target]:void 0;if(!s&&e)throw Error(`Initial state node "${e}" not found on parent state node #${t.id}`);let n={source:t,actions:e&&"string"!=typeof e?m(e.actions):[],eventType:null,reenter:!1,target:s?[s]:[],toJSON:()=>({...n,source:`#${t.id}`,target:s?[`#${s.id}`]:[]})};return n}function ts(t){let e=x(t.config.target);return e?{target:e.map(e=>"string"==typeof e?ta(t.parent,e):e)}:t.parent.initial}function tn(t){return"history"===t.type}function ti(t){let e=tr(t);for(let s of e)for(let n of B(s,t))e.add(n);return e}function tr(t){let e=new Set;return!function t(s){if(!e.has(s)){if(e.add(s),"compound"===s.type)t(s.initial.target[0]);else if("parallel"===s.type)for(let e of q(s))t(e)}}(t),e}function to(t,e){if(F(e))return t.machine.getStateNodeById(e);if(!t.states)throw Error(`Unable to retrieve child state '${e}' from '${t.id}'; no child states exist.`);let s=t.states[e];if(!s)throw Error(`Child state '${e}' does not exist on '${t.id}'`);return s}function ta(t,e){if("string"==typeof e&&F(e))try{return t.machine.getStateNodeById(e)}catch(t){}let s=y(e).slice(),n=t;for(;s.length;){let t=s.shift();if(!t.length)break;n=to(n,t)}return n}function tu(t,e){if("string"==typeof e){let s=t.states[e];if(!s)throw Error(`State '${e}' does not exist on '${t.id}'`);return[t,s]}let s=Object.keys(e),n=s.map(e=>to(t,e)).filter(Boolean);return[t.machine.root,t].concat(n,s.reduce((s,n)=>{let i=to(t,n);if(!i)return s;let r=tu(i,e[n]);return s.concat(r)},[]))}function tc(t,e){let s=t;for(;s.parent&&s.parent!==e;)s=s.parent;return s.parent===e}function th(t,e,s){let n=new Set;for(let i of t){let t=!1,r=new Set;for(let o of n)if(function(t,e){let s=new Set(t),n=new Set(e);for(let t of s)if(n.has(t))return!0;for(let t of n)if(s.has(t))return!0;return!1}(td([i],e,s),td([o],e,s))){if(tc(i.source,o.source))r.add(o);else{t=!0;break}}if(!t){for(let t of r)n.delete(t);n.add(i)}}return Array.from(n)}function tl(t,e){if(!t.target)return[];let s=new Set;for(let n of t.target)if(tn(n)){if(e[n.id])for(let t of e[n.id])s.add(t);else for(let t of tl(ts(n),e))s.add(t)}else s.add(n);return[...s]}function tf(t,e){let s=tl(t,e);if(!s)return;if(!t.reenter&&s.every(e=>e===t.source||tc(e,t.source)))return t.source;let n=function(t){let[e,...s]=t;for(let t of B(e,void 0))if(s.every(e=>tc(e,t)))return t}(s.concat(t.source));return n||(t.reenter?void 0:t.source.machine.root)}function td(t,e,s){let n=new Set;for(let i of t)if(i.target?.length){let t=tf(i,s);for(let s of(i.reenter&&i.source===t&&n.add(t),e))tc(s,t)&&n.add(s)}return[...n]}function tp(t,e,s,n,i,r){if(!t.length)return e;let o=new Set(e._nodes),a=e.historyValue,u=th(t,o,a),c=e;i||([c,a]=function(t,e,s,n,i,r,o){let a,u=t,c=td(n,i,r);for(let t of(c.sort((t,e)=>e.order-t.order),c))for(let e of function(t){return Object.keys(t.states).map(e=>t.states[e]).filter(t=>"history"===t.type)}(t)){let s;s="deep"===e.history?e=>X(e)&&tc(e,t):e=>e.parent===t,(a??={...r})[e.id]=Array.from(i).filter(s)}for(let t of c)u=tg(u,e,s,[...t.exit,...t.invoke.map(t=>V(t.id))],o),i.delete(t);return[u,a||r]}(c,n,s,u,o,a,r)),c=function(t,e,s,n,i,r,o,a){let u=t,c=new Set,l=new Set;(function(t,e,s,n){for(let i of t){let t=tf(i,e);for(let r of i.target||[])!tn(r)&&(i.source!==r||i.source!==t||i.reenter)&&(n.add(r),s.add(r)),ty(r,e,s,n);for(let r of tl(i,e)){let o=B(r,t);t?.type==="parallel"&&o.push(t),tv(n,e,s,o,!i.source.parent&&i.reenter?void 0:t)}}})(n,o,l,c),a&&l.add(t.machine.root);let f=new Set;for(let t of[...c].sort((t,e)=>t.order-e.order)){i.add(t);let n=[];for(let e of(n.push(...t.entry),t.invoke))n.push(D(e.src,{...e,syncSnapshot:!!e.onSnapshot}));if(l.has(t)){let e=t.initial.actions;n.push(...e)}if(u=tg(u,e,s,n,r,t.invoke.map(t=>
2t.id)),"final"===t.type){let n=t.parent,o=n?.type==="parallel"?n:n?.parent,a=o||t;for(n?.type==="compound"&&r.push(h(n.id,void 0!==t.output?_(t.output,u.context,e,s.self):void 0));o?.type==="parallel"&&!f.has(o)&&G(i,o);)f.add(o),r.push(h(o.id)),a=o,o=o.parent;if(o)continue;u=tj(u,{status:"done",output:function(t,e,s,n,i){if(void 0===n.output)return;let r=h(i.id,void 0!==i.output&&i.parent?_(i.output,t.context,e,s.self):void 0);return _(n.output,t.context,r,s.self)}(u,e,s,u.machine.root,a)})}}return u}(c=tg(c,n,s,u.flatMap(t=>t.actions),r),n,s,u,o,r,a,i);let l=[...o];"done"===c.status&&(c=tg(c,n,s,l.sort((t,e)=>e.order-t.order).flatMap(t=>t.exit),r));try{if(a===e.historyValue&&function(t,e){if(t.length!==e.size)return!1;for(let s of t)if(!e.has(s))return!1;return!0}(e._nodes,o))return c;return tj(c,{_nodes:l,historyValue:a})}catch(t){throw t}}function ty(t,e,s,n){if(tn(t)){if(e[t.id]){let i=e[t.id];for(let t of i)n.add(t),ty(t,e,s,n);for(let r of i)tv(n,e,s,B(r,t.parent))}else{let i=ts(t);for(let r of i.target)n.add(r),i===t.parent?.initial&&s.add(t.parent),ty(r,e,s,n);for(let r of i.target)tv(n,e,s,B(r,t.parent))}}else if("compound"===t.type){let[i]=t.initial.target;tn(i)||(n.add(i),s.add(i)),ty(i,e,s,n),tv(n,e,s,B(i,t))}else if("parallel"===t.type)for(let i of q(t).filter(t=>!tn(t)))[...n].some(t=>tc(t,i))||(tn(i)||(n.add(i),s.add(i)),ty(i,e,s,n))}function tv(t,e,s,n,i){for(let r of n)if((!i||tc(r,i))&&t.add(r),"parallel"===r.type)for(let n of q(r).filter(t=>!tn(t)))[...t].some(t=>tc(t,n))||(t.add(n),ty(n,e,s,t))}function tg(t,e,s,n,i,r){let o=r?[]:void 0,a=function t(e,s,n,i,r,o){let{machine:a}=e,u=e;for(let e of i){let i="function"==typeof e,h=i?e:a.implementations.actions["string"==typeof e?e:e.type];
2if(!h)continue;let l={context:u.context,event:s,self:n.self,system:n.system},f=i||"string"==typeof e?void 0:"params"in e?"function"==typeof e.params?e.params({context:u.context,event:s}):e.params:void 0;function c(){n.system._sendInspectionEvent({type:"@xstate.action",actorRef:n.self,action:{type:"string"==typeof e?e:"object"==typeof e?e.type:e.name||"(anonymous)",params:f}}),h(l,f)}if(!("resolve"in h)){n.self._processingStatus===O.Running?c():n.defer(()=>{c()});continue}let[d,p,y]=h.resolve(n,u,l,f,h,r);u=d,"retryResolve"in h&&o?.push([h,p]),"execute"in h&&(n.self._processingStatus===O.Running?h.execute(n,p):n.defer(h.execute.bind(null,n,p))),y&&(u=t(u,s,n,y,r,o))}return u}(t,e,s,n,{internalQueue:i,deferredActorIds:r},o);return o?.forEach(([t,e])=>{t.retryResolve(s,a,e)}),a}function tm(t,e,s,n=[]){let i=t,r=[];function o(t,e,n){s.system._sendInspectionEvent({type:"@xstate.microstep",actorRef:s.self,event:e,snapshot:t,_transitions:n}),r.push(t)}if(e.type===c)return o(i=tj(t_(i,e,s),{status:"stopped"}),e,[]),{snapshot:i,microstates:r};let u=e;if(u.type!==a){let e=u,a=e.type.startsWith("xstate.error.actor"),c=tb(e,i);if(a&&!c.length)return o(i=tj(t,{status:"error",error:e.error}),e,[]),{snapshot:i,microstates:r};o(i=tp(c,t,s,u,!1,n),e,c)}let h=!0;for(;"active"===i.status;){let t=h?function(t,e){let s=new Set;for(let n of t._nodes.filter(X))t:for(let i of[n].concat(B(n,void 0)))if(i.always){for(let n of i.always)if(void 0===n.guard||W(n.guard,t.context,e,t)){s.add(n);break t}}return th(Array.from(s),new Set(t._nodes),t.historyValue)}(i,u):[],e=t.length?i:void 0;if(!t.length){if(!n.length)break;t=tb(u=n.shift(),i)}h=(i=tp(t,i,s,u,!1,n))!==e,o(i,u,t)}return"active"!==i.status&&t_(i,u,s),{snapshot:i,microstates:r}}function t_(t,e,s){return tg(t,e,s,Object.values(t.children).map(t=>V(t)),[])}function tb(t,e){return e.machine.getTransitionData(e,t)}function tS(t,e){let s=U(tu(t,e));return Y(t,[...s])}let tx=function(t){return function t(e,s){let n=v(e),i=v(s);return"string"==typeof i?"string"==typeof n&&i===n:"string"==typeof n?n in i:Object.keys(n).every(e=>e in i&&t(n[e],i[e]))}(t,this.value)},tw=function(t){return this.tags.has(t)},tk=function(t){let e=this.machine.getTransitionData(this,t);return!!e?.length&&e.some(t=>void 0!==t.target||t.actions.length)},t$=function(){let{_nodes:t,tags:e,machine:s,getMeta:n,toJSON:i,can:r,hasTag:o,matches:a,...u}=this;return{...u,tags:Array.from(e)}},tE=function(){return this._nodes.reduce((t,e)=>(void 0!==e.meta&&(t[e.id]=e.meta),t),{})};function tI(t,e){return{status:t.status,output:t.output,error:t.error,machine:e,context:t.context,_nodes:t._nodes,value:Y(e.root,t._nodes),tags:new Set(t._nodes.flatMap(t=>t.tags)),children:t.children,historyValue:t.historyValue||{},matches:tx,hasTag:tw,can:tk,getMeta:tE,toJSON:t$}}function tj(t,e={}){return tI({...t,...e},t.machine)}function tO(t,e){let{_nodes:s,tags:n,machine:i,children:r,context:o,can:a,hasTag:u,matches:c,getMeta:h,toJSON:l,...f}=t,d={};for(let t in r){let s=r[t];d[t]={snapshot:s.getPersistedSnapshot(e),src:s.src,systemId:s._systemId,syncSnapshot:s._syncSnapshot}}return{...f,context:function t(e){let s;for(let n in e){let i=e[n];if(i&&"object"==typeof i){if("sessionId"in i&&"send"in i&&"ref"in i)(s??=Array.isArray(e)?e.slice():{...e})[n]={xstate$$type:j,id:i.id};else{let r=t(i);r!==i&&((s??=Array.isArray(e)?e.slice():{...e})[n]=r)}}}return s??e}(o),children:d}}function tT(t,e,s,n,{event:i,id:r,delay:o},{internalQueue:a}){let u;let c=e.machine.implementations.delays;if("string"==typeof i)throw Error(`Only event objects may be used with raise; use raise({ type: "${i}" }) instead`);let h="function"==typeof i?i(s,n):i;if("string"==typeof o){let t=c&&c[o];u="function"==typeof t?t(s,n):t}else u="function"==typeof o?o(s,n):o;return"number"!=typeof u&&a.push(h),[e,{event:h,id:r,delay:u}]}function tA(t,e){let{event:s,delay:n,id:i}=e;if("number"==typeof n){t.defer(()=>{let e=t.self;t.system.scheduler.schedule(e,e,s,n,i)});return}}function tN(t,e){function s(t,e){}return s.type="xstate.raise",s.event=t,s.id=e?.id,s.delay=e?.delay,s.resolve=tT,s.execute=tA,s}},61953:(t,e,s)=>{s.d(e,{ZD:()=>r,cY:()=>f}),s(1574);var n=s(73944),i=s(18072);function r(t,e){let s=(0,n.t)(e);if(!s.includes(t.type)){let e=1===s.length?`type "${s[0]}"`:`one of types "${s.join('", "')}"`;throw Error(`Expected event ${JSON.stringify(t)} to have ${e}`)}}let o=new WeakMap;function a(t,e,s){let n=o.get(t);return n?e in n||(n[e]=s()):(n={[e]:s()},o.set(t,n)),n[e]}let u={},c=t=>"string"==typeof t?{type:t}:"function"==typeof t?"resolve"in t?{type:t.type}:{type:t.name}:t;class h{constructor(t,e){if(this.config=t,this.key=void 0,this.id=void 0,this.type=void 0,this.path=void 0,this.states=void 0,this.history=void 0,this.entry=void 0,this.exit=void 0,this.parent=void 0,this.machine=void 0,this.meta=void 0,this.output=void 0,this.order=-1,this.description=void 0,this.tags=[],this.transitions=void 0,this.always=void 0,this.parent=e._parent,this.key=e._key,this.machine=e._machine,this.path=this.parent?this.parent.path.concat(this.key):[],this.id=this.config.id||[this.machine.id,...this.path].join(n.S),this.type=this.config.type||(this.config.states&&Object.keys(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.description=this.config.description,this.order=this.machine.idMap.size,this.machine.idMap.set(this.id,this),this.states=this.config.states?(0,n.m)(this.config.states,(t,e)=>new h(t,{_parent:this,_key:e,_machine:this.machine})):u,"compound"===this.type&&!this.config.initial)throw Error(`No initial state specified for c
2ompound state node "#${this.id}". Try adding { initial: "${Object.keys(this.states)[0]}" } to the state config.`);this.history=!0===this.config.history?"shallow":this.config.history||!1,this.entry=(0,n.t)(this.config.entry).slice(),this.exit=(0,n.t)(this.config.exit).slice(),this.meta=this.config.meta,this.output="final"!==this.type&&this.parent?void 0:this.config.output,this.tags=(0,n.t)(t.tags).slice()}_initialize(){this.transitions=(0,n.f)(this),this.config.always&&(this.always=(0,n.a)(this.config.always).map(t=>(0,n.b)(this,n.N,t))),Object.keys(this.states).forEach(t=>{this.states[t]._initialize()})}get definition(){return{id:this.id,key:this.key,version:this.machine.version,type:this.type,initial:this.initial?{target:this.initial.target,source:this,actions:this.initial.actions.map(c),eventType:null,reenter:!1,toJSON:()=>({target:this.initial.target.map(t=>`#${t.id}`),source:`#${this.id}`,actions:this.initial.actions.map(c),eventType:null})}:void 0,history:this.history,states:(0,n.m)(this.states,t=>t.definition),on:this.on,transitions:[...this.transitions.values()].flat().map(t=>({...t,actions:t.actions.map(c)})),entry:this.entry.map(c),exit:this.exit.map(c),meta:this.meta,order:this.order||-1,output:this.output,invoke:this.invoke,description:this.description,tags:this.tags}}toJSON(){return this.definition}get invoke(){return a(this,"invoke",()=>(0,n.t)(this.config.invoke).map((t,e)=>{let{src:s,systemId:i}=t,r=t.id??(0,n.c)(this.id,e),o="string"==typeof s?s:`xstate.invoke.${(0,n.c)(this.id,e)}`;return{...t,src:o,id:r,systemId:i,toJSON(){let{onDone:e,onError:s,...n}=t;return{...n,type:"xstate.invoke",src:o,id:r}}}}))}get on(){return a(this,"on",()=>[...this.transitions].flatMap(([t,e])=>e.map(e=>[t,e])).reduce((t,[e,s])=>(t[e]=t[e]||[],t[e].push(s),t),{}))}get after(){return a(this,"delayedTransitions",()=>(0,n.g)(this))}get initial(){return a(this,"initial",()=>(0,n.d)(this,this.config.initial))}next(t,e){let s;let i=e.type,r=[];for(let o of a(this,`candidates-${i}`,()=>(0,n.h)(this,i))){let{guard:a}=o,u=t.context,c=!1;try{c=!a||(0,n.e)(a,u,e,t)}catch(e){let t="string"==typeof a?a:"object"==typeof a?a.type:void 0;throw Error(`Unable to evaluate guard ${t?`'${t}' `:""}in transition for event '${i}' in state node '${this.id}': 3${e.message}`)}if(c){r.push(...o.actions),s=o;break}}return s?[s]:void 0}get events(){return a(this,"events",()=>{let{states:t}=this,e=new Set(this.ownEvents);if(t)for(let s of Object.keys(t)){let n=t[s];if(n.states)for(let t of n.events)e.add(`${t}`)}return Array.from(e)})}get ownEvents(){return Array.from(new Set([...this.transitions.keys()].filter(t=>this.transitions.get(t).some(t=>!(!t.target&&!t.actions.length&&!t.reenter)))))}}class l{constructor(t,e){this.config=t,this.version=void 0,this.schemas=void 0,this.implementations=void 0,this.__xstatenode=!0,this.idMap=new Map,this.root=void 0,this.id=void 0,this.states=void 0,this.events=void 0,this.id=t.id||"(machine)",this.implementations={actors:e?.actors??{},actions:e?.actions??{},delays:e?.delays??{},guards:e?.guards??{}},this.version=this.config.version,this.schemas=this.config.schemas,this.transition=this.transition.bind(this),this.getInitialSnapshot=this.getInitialSnapshot.bind(this),this.getPersistedSnapshot=this.getPersistedSnapshot.bind(this),this.restoreSnapshot=this.restoreSnapshot.bind(this),this.start=this.start.bind(this),this.root=new h(t,{_key:this.id,_machine:this}),this.root._initialize(),this.states=this.root.states,this.events=this.root.events}provide(t){let{actions:e,guards:s,actors:n,delays:i}=this.implementations;return new l(this.config,{actions:{...e,...t.actions},guards:{...s,...t.guards},actors:{...n,...t.actors},delays:{...i,...t.delays}})}resolveState(t){let e=(0,n.r)(this.root,t.value),s=(0,n.i)((0,n.j)(this.root,e));return(0,n.k)({_nodes:[...s],context:t.context||{},children:{},status:(0,n.l)(s,this.root)?"done":t.status||"active",output:t.output,error:t.error,historyValue:t.historyValue},this)}transition(t,e,s){return(0,n.n)(t,e,s).snapshot}microstep(t,e,s){return(0,n.n)(t,e,s).microstates}getTransitionData(t,e){return(0,n.o)(this.root,t.value,t,e)||[]}getPreInitialState(t,e,s){let{context:r}=this.config,o=(0,n.k)({context:"function"!=typeof r&&r?r:{},_nodes:[this.root],children:{},status:"active"},this);return"function"==typeof r?(0,n.p)(o,e,t,[(0,i.a)(({spawn:t,event:e,self:s})=>r({spawn:t,input:e.input,self:s}))],s):o}getInitialSnapshot(t,e){let s=(0,n.q)(e),i=[],r=this.getPreInitialState(t,s,i),o=(0,n.s)([{target:[...(0,n.u)(this.root)],source:this.root,reenter
3:!0,actions:[],eventType:null,toJSON:null}],r,t,s,!0,i),{snapshot:a}=(0,n.n)(o,s,t,i);return a}start(t){Object.values(t.children).forEach(t=>{"active"===t.getSnapshot().status&&t.start()})}getStateNodeById(t){let e=(0,n.v)(t),s=e.slice(1),i=(0,n.w)(e[0])?e[0].slice(1):e[0],r=this.idMap.get(i);if(!r)throw Error(`Child state node '#${i}' does not exist on machine '${this.id}'`);return(0,n.x)(r,s)}get definition(){return this.root.definition}toJSON(){return this.definition}getPersistedSnapshot(t,e){return(0,n.y)(t,e)}restoreSnapshot(t,e){let s={},i=t.children;Object.keys(i).forEach(t=>{let r=i[t],o=r.snapshot,a=r.src,u="string"==typeof a?(0,n.z)(this,a):a;if(!u)return;let c=(0,n.A)(u,{id:t,parent:e.self,syncSnapshot:r.syncSnapshot,snapshot:o,src:a,systemId:r.systemId});s[t]=c});let r=(0,n.k)({...t,children:s,_nodes:Array.from((0,n.i)((0,n.j)(this.root,t.value)))},this),o=new Set;return!function t(e,s){if(!o.has(e))for(let i in o.add(e),e){let r=e[i];if(r&&"object"==typeof r){if("xstate$$type"in r&&r.xstate$$type===n.$){e[i]=s[r.id];continue}t(r,s)}}}(r.context,s),r}}function f({schemas:t,actors:e,actions:s,guards:n,delays:i}){return{createMachine:r=>new l({...r,schemas:t},{actors:e,actions:s,guards:n,delays:i})}}}}]);
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.