Files
owncast/static/web/_next/static/chunks/6395-f04016ae318b5e91.js
2022-12-10 07:34:56 +00:00

30 lines
68 KiB
JavaScript

"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6395],{23917:function(t,e,n){n.d(e,{e:function(){return N}});var i,r,o=n(67294),a=n(52798),s=n(63056),c=n(59043),u=n(54911),f=n(3884),h=n(30375),l=n(14066),d=n(89823),v={deferEvents:!1},p=function(){function t(t){this.processingEvent=!1,this.queue=[],this.initialized=!1,this.options=(0,s.pi)((0,s.pi)({},v),t)}return t.prototype.initialize=function(t){if(this.initialized=!0,t){if(!this.options.deferEvents){this.schedule(t);return}this.process(t)}this.flushEvents()},t.prototype.schedule=function(t){if(!this.initialized||this.processingEvent){this.queue.push(t);return}if(0!==this.queue.length)throw Error("Event queue should be empty when it is not processing events");this.process(t),this.flushEvents()},t.prototype.clear=function(){this.queue=[]},t.prototype.flushEvents=function(){for(var t=this.queue.shift();t;)this.process(t),t=this.queue.shift()},t.prototype.process=function(t){this.processingEvent=!0;try{t()}catch(e){throw this.clear(),e}finally{this.processingEvent=!1}},t}(),y=n(98933),g=new Map,m=0,x={bookId:function(){return"x:".concat(m++)},register:function(t,e){return g.set(t,e),t},get:function(t){return g.get(t)},free:function(t){g.delete(t)}};function b(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:void(l.M||console.warn("XState could not find a global object in this environment. Please let the maintainers know and raise an issue here: https://github.com/statelyai/xstate/issues"))}var S=n(10797),w={sync:!1,autoForward:!1};(i=r||(r={}))[i.NotStarted=0]="NotStarted",i[i.Running=1]="Running",i[i.Stopped=2]="Stopped";var _=function(){function t(e,n){void 0===n&&(n=t.defaultOptions);var i=this;this.machine=e,this.delayedEventsMap={},this.listeners=new Set,this.contextListeners=new Set,this.stopListeners=new Set,this.doneListeners=new Set,this.eventListeners=new Set,this.sendListeners=new Set,this.initialized=!1,this.status=r.NotStarted,this.children=new Map,this.forwardTo=new Set,this._outgoingQueue=[],this.init=this.start,this.send=function(t,e){if((0,d.kJ)(t))return i.batch(t),i.state;var n=(0,d.g5)((0,d._v)(t,e));if(i.status===r.Stopped)return l.M||(0,d.ZK)(!1,'Event "'.concat(n.name,'" was sent to stopped service "').concat(i.machine.id,'". This service has already reached its final state, and will not transition.\nEvent: ').concat(JSON.stringify(n.data))),i.state;if(i.status!==r.Running&&!i.options.deferEvents)throw Error('Event "'.concat(n.name,'" was sent to uninitialized service "').concat(i.machine.id,'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.\nEvent: ').concat(JSON.stringify(n.data)));return i.scheduler.schedule(function(){i.forward(n);var t=i._nextState(n);i.update(t,n)}),i._state},this.sendTo=function(t,e,n){var o=i.parent&&(e===c.K.Parent||i.parent.id===e),a=o?i.parent:(0,d.HD)(e)?i.children.get(e)||x.get(e):(0,d.Bc)(e)?e:void 0;if(!a){if(!o)throw Error("Unable to send event to child '".concat(e,"' from service '").concat(i.id,"'."));l.M||(0,d.ZK)(!1,"Service '".concat(i.id,"' has no parent: unable to send event ").concat(t.type));return}if("machine"in a){if(i.status!==r.Stopped||i.parent!==a||i.state.done){var u=(0,s.pi)((0,s.pi)({},t),{name:t.name===f.vU?"".concat((0,h.vU)(i.id)):t.name,origin:i.sessionId});!n&&i.machine.config.predictableActionArguments?i._outgoingQueue.push([a,u]):a.send(u)}}else!n&&i.machine.config.predictableActionArguments?i._outgoingQueue.push([a,t.data]):a.send(t.data)},this._exec=function(t,e,n,o){void 0===o&&(o=i.machine.options.actions);var a=t.exec||(0,h.o$)(t.type,o),s=(0,d.mf)(a)?a:a?a.exec:t.exec;if(s)try{return s(e,n.data,i.machine.config.predictableActionArguments?{action:t,_event:n}:{action:t,state:i.state,_event:n})}catch(u){throw i.parent&&i.parent.send({type:"xstate.error",data:u}),u}switch(t.type){case f.lW:if("number"==typeof t.delay){i.defer(t);return}t.to?i.sendTo(t._event,t.to,n===h.bf):i.send(t._event);break;case f.al:i.cancel(t.sendId);break;case f.BL:if(i.status!==r.Running)return;var v=t.activity;if(!i.machine.config.predictableActionArguments&&!i.state.activities[v.id||v.type])break;if(v.type===c.M.Invoke){var p=(0,d.j)(v.src),y=i.machine.options.services?i.machine.options.services[p.type]:void 0,g=v.id,m=v.data;l.M||(0,d.ZK)(!("forward"in v),"`forward` property is deprecated (found in invocation of '".concat(v.src,"' in in machine '").concat(i.machine.id,"'). ")+"Please use `autoForward` instead.");var x="autoForward"in v?v.autoForward:!!v.forward;if(!y){l.M||(0,d.ZK)(!1,"No service found for invocation '".concat(v.src,"' in machine '").concat(i.machine.id,"'."));return}var b=m?(0,d.QX)(m,e,n):void 0;if("string"==typeof y)return;var S=(0,d.mf)(y)?y(e,n.data,{data:b,src:p,meta:v.meta}):y;if(!S)return;var w=void 0;(0,d.O4)(S)&&(S=b?S.withContext(b):S,w={autoForward:x}),i.spawn(S,g,w)}else i.spawnActivity(v);break;case f.sT:i.stopChild(t.activity.id);break;case f.cM:var _=t.label,E=t.value;_?i.logger(_,E):i.logger(E);break;default:l.M||(0,d.ZK)(!1,"No implementation found for action type '".concat(t.type,"'"))}};var o=(0,s.pi)((0,s.pi)({},t.defaultOptions),n),a=o.clock,u=o.logger,v=o.parent,y=o.id,g=void 0!==y?y:e.id;this.id=g,this.logger=u,this.clock=a,this.parent=v,this.options=o,this.scheduler=new p({deferEvents:this.options.deferEvents}),this.sessionId=x.bookId()}return Object.defineProperty(t.prototype,"initialState",{get:function(){var t=this;return this._initialState?this._initialState:(0,S.J)(this,function(){return t._initialState=t.machine.initialState,t._initialState})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return l.M||(0,d.ZK)(this.status!==r.NotStarted,"Attempted to read state from uninitialized service '".concat(this.id,"'. Make sure the service is started first.")),this._state},enumerable:!1,configurable:!0}),t.prototype.execute=function(t,e){var n,i;try{for(var r=(0,s.XA)(t.actions),o=r.next();!o.done;o=r.next()){var a=o.value;this.exec(a,t,e)}}catch(c){n={error:c}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(n)throw n.error}}},t.prototype.update=function(t,e){var n,i,r,o,a,c,u,f,l=this;if(t._sessionid=this.sessionId,this._state=t,(!this.machine.config.predictableActionArguments||e===h.bf)&&this.options.execute)this.execute(this.state);else for(var v=void 0;v=this._outgoingQueue.shift();)v[0].send(v[1]);if(this.children.forEach(function(t){l.state.children[t.id]=t}),this.devTools&&this.devTools.send(e.data,t),t.event)try{for(var p=(0,s.XA)(this.eventListeners),y=p.next();!y.done;y=p.next()){var g=y.value;g(t.event)}}catch(m){n={error:m}}finally{try{y&&!y.done&&(i=p.return)&&i.call(p)}finally{if(n)throw n.error}}try{for(var x=(0,s.XA)(this.listeners),b=x.next();!b.done;b=x.next()){var g=b.value;g(t,t.event)}}catch(S){r={error:S}}finally{try{b&&!b.done&&(o=x.return)&&o.call(x)}finally{if(r)throw r.error}}try{for(var w=(0,s.XA)(this.contextListeners),_=w.next();!_.done;_=w.next())(0,_.value)(this.state.context,this.state.history?this.state.history.context:void 0)}catch(E){a={error:E}}finally{try{_&&!_.done&&(c=w.return)&&c.call(w)}finally{if(a)throw a.error}}if(this.state.done){var O=t.configuration.find(function(t){return"final"===t.type&&t.parent===l.machine}),A=O&&O.doneData?(0,d.QX)(O.doneData,t.context,e):void 0;try{for(var M=(0,s.XA)(this.doneListeners),k=M.next();!k.done;k=M.next()){var g=k.value;g((0,h.Sl)(this.id,A))}}catch(j){u={error:j}}finally{try{k&&!k.done&&(f=M.return)&&f.call(M)}finally{if(u)throw u.error}}this._stop(),this._stopChildren()}},t.prototype.onTransition=function(t){return this.listeners.add(t),this.status===r.Running&&t(this.state,this.state.event),this},t.prototype.subscribe=function(t,e,n){var i=this,o=(0,d.zM)(t,e,n);this.listeners.add(o.next),this.status!==r.NotStarted&&o.next(this.state);var a=function(){i.doneListeners.delete(a),i.stopListeners.delete(a),o.complete()};return this.status===r.Stopped?o.complete():(this.onDone(a),this.onStop(a)),{unsubscribe:function(){i.listeners.delete(o.next),i.doneListeners.delete(a),i.stopListeners.delete(a)}}},t.prototype.onEvent=function(t){return this.eventListeners.add(t),this},t.prototype.onSend=function(t){return this.sendListeners.add(t),this},t.prototype.onChange=function(t){return this.contextListeners.add(t),this},t.prototype.onStop=function(t){return this.stopListeners.add(t),this},t.prototype.onDone=function(t){return this.doneListeners.add(t),this},t.prototype.off=function(t){return this.listeners.delete(t),this.eventListeners.delete(t),this.sendListeners.delete(t),this.stopListeners.delete(t),this.doneListeners.delete(t),this.contextListeners.delete(t),this},t.prototype.start=function(t){var e=this;if(this.status===r.Running)return this;this.machine._init(),x.register(this.sessionId,this),this.initialized=!0,this.status=r.Running;var n=void 0===t?this.initialState:(0,S.J)(this,function(){return(0,u.TL)(t)?e.machine.resolveState(t):e.machine.resolveState(u.ZM.from(t,e.machine.context))});return this.options.devTools&&this.attachDev(),this.scheduler.initialize(function(){e.update(n,h.bf)}),this},t.prototype._stopChildren=function(){this.children.forEach(function(t){(0,d.mf)(t.stop)&&t.stop()}),this.children.clear()},t.prototype._stop=function(){var t,e,n,i,o,a,c,u,f,h;try{for(var l=(0,s.XA)(this.listeners),d=l.next();!d.done;d=l.next()){var v=d.value;this.listeners.delete(v)}}catch(y){t={error:y}}finally{try{d&&!d.done&&(e=l.return)&&e.call(l)}finally{if(t)throw t.error}}try{for(var g=(0,s.XA)(this.stopListeners),m=g.next();!m.done;m=g.next()){var v=m.value;v(),this.stopListeners.delete(v)}}catch(x){n={error:x}}finally{try{m&&!m.done&&(i=g.return)&&i.call(g)}finally{if(n)throw n.error}}try{for(var b=(0,s.XA)(this.contextListeners),S=b.next();!S.done;S=b.next()){var v=S.value;this.contextListeners.delete(v)}}catch(w){o={error:w}}finally{try{S&&!S.done&&(a=b.return)&&a.call(b)}finally{if(o)throw o.error}}try{for(var _=(0,s.XA)(this.doneListeners),E=_.next();!E.done;E=_.next()){var v=E.value;this.doneListeners.delete(v)}}catch(O){c={error:O}}finally{try{E&&!E.done&&(u=_.return)&&u.call(_)}finally{if(c)throw c.error}}if(!this.initialized)return this;this.initialized=!1,this.status=r.Stopped,this._initialState=void 0;try{for(var A=(0,s.XA)(Object.keys(this.delayedEventsMap)),M=A.next();!M.done;M=A.next()){var k=M.value;this.clock.clearTimeout(this.delayedEventsMap[k])}}catch(j){f={error:j}}finally{try{M&&!M.done&&(h=A.return)&&h.call(A)}finally{if(f)throw f.error}}this.scheduler.clear(),this.scheduler=new p({deferEvents:this.options.deferEvents})},t.prototype.stop=function(){var t=this,e=this.scheduler;return this._stop(),e.schedule(function(){var e=(0,d.g5)({type:"xstate.stop"}),n=(0,S.J)(t,function(){var n=(0,d.xH)((0,s.ev)([],(0,s.CR)(t.state.configuration),!1).sort(function(t,e){return e.order-t.order}).map(function(e){return(0,h.AE)(e.onExit,t.machine.options.actions)})),i=(0,s.CR)((0,h.yC)(t.machine,t.state,t.state.context,e,[n],t.machine.config.predictableActionArguments?t._exec:void 0,t.machine.config.predictableActionArguments||t.machine.config.preserveActionOrder),2),r=i[0],o=i[1],a=new u.ZM({value:t.state.value,context:o,_event:e,_sessionid:t.sessionId,historyValue:void 0,history:t.state,actions:r.filter(function(t){return t.type!==f.OU&&(t.type!==f.lW||!!t.to&&t.to!==c.K.Internal)}),activities:{},events:[],configuration:[],transitions:[],children:{},done:t.state.done,tags:t.state.tags,machine:t.machine});return a.changed=!0,a});t.update(n,e),t._stopChildren(),x.free(t.sessionId)}),this},t.prototype.batch=function(t){var e=this;if(this.status===r.NotStarted&&this.options.deferEvents)l.M||(0,d.ZK)(!1,"".concat(t.length,' event(s) were sent to uninitialized service "').concat(this.machine.id,'" and are deferred. Make sure .start() is called for this service.\nEvent: ').concat(JSON.stringify(event)));else if(this.status!==r.Running)throw Error("".concat(t.length,' event(s) were sent to uninitialized service "').concat(this.machine.id,'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.'));if(t.length){var n=!!this.machine.config.predictableActionArguments&&this._exec;this.scheduler.schedule(function(){var i,r,o=e.state,a=!1,c=[];try{for(var f=(0,s.XA)(t),h=f.next();!h.done;h=f.next()){var l=h.value;!function(t){var i=(0,d.g5)(t);e.forward(i),o=(0,S.J)(e,function(){return e.machine.transition(o,i,void 0,n||void 0)}),c.push.apply(c,(0,s.ev)([],(0,s.CR)(e.machine.config.predictableActionArguments?o.actions:o.actions.map(function(t){return(0,u.j1)(t,o)})),!1)),a=a||!!o.changed}(l)}}catch(v){i={error:v}}finally{try{h&&!h.done&&(r=f.return)&&r.call(f)}finally{if(i)throw i.error}}o.changed=a,o.actions=c,e.update(o,(0,d.g5)(t[t.length-1]))})}},t.prototype.sender=function(t){return this.send.bind(this,t)},t.prototype._nextState=function(t,e){var n=this;void 0===e&&(e=!!this.machine.config.predictableActionArguments&&this._exec);var i=(0,d.g5)(t);if(0===i.name.indexOf(f.Mg)&&!this.state.nextEvents.some(function(t){return 0===t.indexOf(f.Mg)}))throw i.data.data;return(0,S.J)(this,function(){return n.machine.transition(n.state,i,void 0,e||void 0)})},t.prototype.nextState=function(t){return this._nextState(t,!1)},t.prototype.forward=function(t){var e,n;try{for(var i=(0,s.XA)(this.forwardTo),r=i.next();!r.done;r=i.next()){var o=r.value,a=this.children.get(o);if(!a)throw Error("Unable to forward event '".concat(t,"' from interpreter '").concat(this.id,"' to nonexistant child '").concat(o,"'."));a.send(t)}}catch(c){e={error:c}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}},t.prototype.defer=function(t){var e=this;this.delayedEventsMap[t.id]=this.clock.setTimeout(function(){t.to?e.sendTo(t._event,t.to,!0):e.send(t._event)},t.delay)},t.prototype.cancel=function(t){this.clock.clearTimeout(this.delayedEventsMap[t]),delete this.delayedEventsMap[t]},t.prototype.exec=function(t,e,n){void 0===n&&(n=this.machine.options.actions),this._exec(t,e.context,e._event,n)},t.prototype.removeChild=function(t){var e;this.children.delete(t),this.forwardTo.delete(t),null===(e=this.state)||void 0===e||delete e.children[t]},t.prototype.stopChild=function(t){var e=this.children.get(t);e&&(this.removeChild(t),(0,d.mf)(e.stop)&&e.stop())},t.prototype.spawn=function(t,e,n){if(this.status!==r.Running)return(0,y.Xg)(t,e);if((0,d.y8)(t))return this.spawnPromise(Promise.resolve(t),e);if((0,d.mf)(t))return this.spawnCallback(t,e);if((0,y.f3)(t))return this.spawnActor(t,e);if((0,d.bi)(t))return this.spawnObservable(t,e);if((0,d.O4)(t))return this.spawnMachine(t,(0,s.pi)((0,s.pi)({},n),{id:e}));if((0,d.HV)(t))return this.spawnBehavior(t,e);throw Error('Unable to spawn entity "'.concat(e,'" of type "').concat(typeof t,'".'))},t.prototype.spawnMachine=function(e,n){var i=this;void 0===n&&(n={});var r=new t(e,(0,s.pi)((0,s.pi)({},this.options),{parent:this,id:n.id||e.id})),o=(0,s.pi)((0,s.pi)({},w),n);return o.sync&&r.onTransition(function(t){i.send(f.Vx,{state:t,id:r.id})}),this.children.set(r.id,r),o.autoForward&&this.forwardTo.add(r.id),r.onDone(function(t){i.removeChild(r.id),i.send((0,d.g5)(t,{origin:r.id}))}).start(),r},t.prototype.spawnBehavior=function(t,e){var n,i,r,o,a,s,c,u,f=(n={id:e,parent:this},i=t.initialState,r=new Set,o=[],a=!1,s=function(){if(!a){for(a=!0;o.length>0;){var e=o.shift();i=t.transition(i,e,u),r.forEach(function(t){return t.next(i)})}a=!1}},c=(0,y.vk)({id:n.id,send:function(t){o.push(t),s()},getSnapshot:function(){return i},subscribe:function(t,e,n){var o=(0,d.zM)(t,e,n);return r.add(o),o.next(i),{unsubscribe:function(){r.delete(o)}}}}),u={parent:n.parent,self:c,id:n.id||"anonymous",observers:r},i=t.start?t.start(u):i,c);return this.children.set(e,f),f},t.prototype.spawnPromise=function(t,e){var n,i,r=this,o=!1;t.then(function(t){o||(i=t,r.removeChild(e),r.send((0,d.g5)((0,h.Sl)(e,t),{origin:e})))},function(t){if(!o){r.removeChild(e);var n=(0,h.vU)(e,t);try{r.send((0,d.g5)(n,{origin:e}))}catch(i){(0,d.v4)(t,i,e),r.devTools&&r.devTools.send(n,r.state),r.machine.strict&&r.stop()}}});var a=((n={id:e,send:function(){},subscribe:function(e,n,i){var r=(0,d.zM)(e,n,i),o=!1;return t.then(function(t){!o&&(r.next(t),o||r.complete())},function(t){o||r.error(t)}),{unsubscribe:function(){return o=!0}}},stop:function(){o=!0},toJSON:function(){return{id:e}},getSnapshot:function(){return i}})[d.L$]=function(){return this},n);return this.children.set(e,a),a},t.prototype.spawnCallback=function(t,e){var n,i,r,o=this,a=!1,s=new Set,c=new Set;try{r=t(function(t){i=t,c.forEach(function(e){return e(t)}),a||o.send((0,d.g5)(t,{origin:e}))},function(t){s.add(t)})}catch(u){this.send((0,h.vU)(e,u))}if((0,d.y8)(r))return this.spawnPromise(r,e);var f=((n={id:e,send:function(t){return s.forEach(function(e){return e(t)})},subscribe:function(t){var e=(0,d.zM)(t);return c.add(e.next),{unsubscribe:function(){c.delete(e.next)}}},stop:function(){a=!0,(0,d.mf)(r)&&r()},toJSON:function(){return{id:e}},getSnapshot:function(){return i}})[d.L$]=function(){return this},n);return this.children.set(e,f),f},t.prototype.spawnObservable=function(t,e){var n,i,r=this,o=t.subscribe(function(t){i=t,r.send((0,d.g5)(t,{origin:e}))},function(t){r.removeChild(e),r.send((0,d.g5)((0,h.vU)(e,t),{origin:e}))},function(){r.removeChild(e),r.send((0,d.g5)((0,h.Sl)(e),{origin:e}))}),a=((n={id:e,send:function(){},subscribe:function(e,n,i){return t.subscribe(e,n,i)},stop:function(){return o.unsubscribe()},getSnapshot:function(){return i},toJSON:function(){return{id:e}}})[d.L$]=function(){return this},n);return this.children.set(e,a),a},t.prototype.spawnActor=function(t,e){return this.children.set(e,t),t},t.prototype.spawnActivity=function(t){var e=this.machine.options&&this.machine.options.activities?this.machine.options.activities[t.type]:void 0;if(!e){l.M||(0,d.ZK)(!1,"No implementation found for activity '".concat(t.type,"'"));return}var n=e(this.state.context,t);this.spawnEffect(t.id,n)},t.prototype.spawnEffect=function(t,e){var n;this.children.set(t,((n={id:t,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},stop:e||void 0,getSnapshot:function(){},toJSON:function(){return{id:t}}})[d.L$]=function(){return this},n))},t.prototype.attachDev=function(){var t=b();if(this.options.devTools&&t){if(t.__REDUX_DEVTOOLS_EXTENSION__){var e="object"==typeof this.options.devTools?this.options.devTools:void 0;this.devTools=t.__REDUX_DEVTOOLS_EXTENSION__.connect((0,s.pi)((0,s.pi)({name:this.id,autoPause:!0,stateSanitizer:function(t){return{value:t.value,context:t.context,actions:t.actions}}},e),{features:(0,s.pi)({jump:!1,skip:!1},e?e.features:void 0)}),this.machine),this.devTools.init(this.state)}!function(t){if(b()){var e=function(){var t=b();if(t&&"__xstate__"in t)return t.__xstate__}();e&&e.register(t)}}(this)}},t.prototype.toJSON=function(){return{id:this.id}},t.prototype[d.L$]=function(){return this},t.prototype.getSnapshot=function(){return this.status===r.NotStarted?this.initialState:this._state},t.defaultOptions={execute:!0,deferEvents:!0,clock:{setTimeout:function(t,e){return setTimeout(t,e)},clearTimeout:function(t){return clearTimeout(t)}},logger:console.log.bind(console),devTools:!1},t.interpret=E,t}();function E(t,e){return new _(t,e)}var O=o.useLayoutEffect;function A(t){var e=o.useRef();return e.current||(e.current={v:t()}),e.current.v}var M=function(){return(M=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},k=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&0>e.indexOf(i)&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(t);r<i.length;r++)0>e.indexOf(i[r])&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]]);return n},j=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,r,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(i=o.next()).done;)a.push(i.value)}catch(s){r={error:s}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return a};function T(t){return t}function N(t){for(var e,n,i,s,c,f,h,l,d,v=[],p=1;p<arguments.length;p++)v[p-1]=arguments[p];var y=j(v,1)[0],g=void 0===y?{}:y,m=(e=A(function(){return"function"==typeof t?t():t}),n=g.context,i=g.guards,s=g.actions,c=g.activities,f=g.services,h=g.delays,g.state,l=k(g,["context","guards","actions","activities","services","delays","state"]),d=A(function(){return E(e.withConfig({context:n,guards:i,actions:s,activities:c,services:f,delays:h},function(){return M(M({},e.context),n)}),l)}),O(function(){Object.assign(d.machine.options.actions,s),Object.assign(d.machine.options.guards,i),Object.assign(d.machine.options.activities,c),Object.assign(d.machine.options.services,f),Object.assign(d.machine.options.delays,h)},[s,i,c,f,h]),d),x=(0,o.useCallback)(function(){return m.status===r.NotStarted?g.state?u.ZM.create(g.state):m.machine.initialState:m.state},[m]),b=(0,o.useCallback)(function(t,e){if(m.status===r.NotStarted)return!0;var n=void 0===e.changed&&(Object.keys(e.children).length>0||"boolean"==typeof t.changed);return!(e.changed||n)},[m]),S=(0,o.useCallback)(function(t){return m.subscribe(t).unsubscribe},[m]),w=(0,a.useSyncExternalStoreWithSelector)(S,x,x,T,b);return(0,o.useEffect)(function(){var t=g.state;return m.start(t?u.ZM.create(t):void 0),function(){m.stop(),m.status=r.NotStarted}},[]),[w,m.send,m]}},53250:function(t,e,n){/**
* @license React
* use-sync-external-store-shim.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/ var i=n(67294),r="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},o=i.useState,a=i.useEffect,s=i.useLayoutEffect,c=i.useDebugValue;function u(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!r(t,n)}catch(i){return!0}}var f="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(t,e){return e()}:function(t,e){var n=e(),i=o({inst:{value:n,getSnapshot:e}}),r=i[0].inst,f=i[1];return s(function(){r.value=n,r.getSnapshot=e,u(r)&&f({inst:r})},[t,n,e]),a(function(){return u(r)&&f({inst:r}),t(function(){u(r)&&f({inst:r})})},[t]),c(n),n};e.useSyncExternalStore=void 0!==i.useSyncExternalStore?i.useSyncExternalStore:f},50139:function(t,e,n){/**
* @license React
* use-sync-external-store-shim/with-selector.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/ var i=n(67294),r=n(61688),o="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},a=r.useSyncExternalStore,s=i.useRef,c=i.useEffect,u=i.useMemo,f=i.useDebugValue;e.useSyncExternalStoreWithSelector=function(t,e,n,i,r){var h=s(null);if(null===h.current){var l={hasValue:!1,value:null};h.current=l}else l=h.current;h=u(function(){function t(t){if(!c){if(c=!0,a=t,t=i(t),void 0!==r&&l.hasValue){var e=l.value;if(r(e,t))return s=e}return s=t}if(e=s,o(a,t))return e;var n=i(t);return void 0!==r&&r(e,n)?e:(a=t,s=n)}var a,s,c=!1,u=void 0===n?null:n;return[function(){return t(e())},null===u?void 0:function(){return t(u())}]},[e,n,i,r]);var d=a(t,h[0],h[1]);return c(function(){l.hasValue=!0,l.value=d},[d]),f(d),d}},61688:function(t,e,n){t.exports=n(53250)},52798:function(t,e,n){t.exports=n(50139)},98933:function(t,e,n){n.d(e,{Xg:function(){return c},f3:function(){return u},mu:function(){return s},vk:function(){return f}});var i=n(63056),r=n(89823),o=n(10797);function a(t){var e;return(e={id:t,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},getSnapshot:function(){},toJSON:function(){return{id:t}}})[r.L$]=function(){return this},e}function s(t,e,n,i){var o,s=(0,r.j)(t.src),u=null===(o=null==e?void 0:e.options.services)||void 0===o?void 0:o[s.type],f=t.data?(0,r.QX)(t.data,n,i):void 0,h=u?c(u,t.id,f):a(t.id);return h.meta=t,h}function c(t,e,n){var i=a(e);if(i.deferred=!0,(0,r.O4)(t)){var s=i.state=(0,o.J)(void 0,function(){return(n?t.withContext(n):t).initialState});i.getSnapshot=function(){return s}}return i}function u(t){return function(t){try{return"function"==typeof t.send}catch(e){return!1}}(t)&&"id"in t}function f(t){var e;return(0,i.pi)(((e={subscribe:function(){return{unsubscribe:function(){}}},id:"anonymous",getSnapshot:function(){}})[r.L$]=function(){return this},e),t)}},4723:function(t,e,n){n.d(e,{C:function(){return x}});var i=n(63056),r=n(89823),o=n(59043),a=n(54911),s=n(3884),c=n(30375),u=n(14066),f=n(87353),h=n(56115),l=n(98933);function d(t){return(0,i.pi)((0,i.pi)({type:s.dw},t),{toJSON:function(){t.onDone,t.onError;var e=(0,i._T)(t,["onDone","onError"]);return(0,i.pi)((0,i.pi)({},e),{type:s.dw,src:function(t){if("string"==typeof t){var e={type:t};return e.toString=function(){return t},e}return t}(t.src)})}})}var v={},p=function(t){return"#"===t[0]},y=function(t,e,n){var i=n.slice(0,-1).some(function(t){return!("cond"in t)&&!("in"in t)&&((0,r.HD)(t.target)||(0,r.O4)(t.target))});(0,r.ZK)(!i,"One or more transitions for ".concat(""===e?"the transient event":"event '".concat(e,"'")," on state '").concat(t.id,"' are unreachable. ")+"Make sure that the default transition is the last one defined.")},g=function(){function t(e,n,o,a){void 0===o&&(o="context"in e?e.context:void 0);var s,l=this;this.config=e,this._context=o,this.order=-1,this.__xstatenode=!0,this.__cache={events:void 0,relativeValue:new Map,initialStateValue:void 0,initialState:void 0,on:void 0,transitions:void 0,candidates:{},delayedTransitions:void 0},this.idMap={},this.tags=[],this.options=Object.assign({actions:{},guards:{},services:{},activities:{},delays:{}},n),this.parent=null==a?void 0:a.parent,this.key=this.config.key||(null==a?void 0:a.key)||this.config.id||"(machine)",this.machine=this.parent?this.parent.machine:this,this.path=this.parent?this.parent.path.concat(this.key):[],this.delimiter=this.config.delimiter||(this.parent?this.parent.delimiter:f.iS),this.id=this.config.id||(0,i.ev)([this.machine.key],(0,i.CR)(this.path),!1).join(this.delimiter),this.version=this.parent?this.parent.version:this.config.version,this.type=this.config.type||(this.config.parallel?"parallel":this.config.states&&Object.keys(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.schema=this.parent?this.machine.schema:null!==(s=this.config.schema)&&void 0!==s?s:{},this.description=this.config.description,u.M||(0,r.ZK)(!("parallel"in this.config),'The "parallel" property is deprecated and will be removed in version 4.1. '.concat(this.config.parallel?"Replace with `type: 'parallel'`":"Use `type: '".concat(this.type,"'`")," in the config for state node '").concat(this.id,"' instead.")),this.initial=this.config.initial,this.states=this.config.states?(0,r.Q8)(this.config.states,function(e,n){var r,o=new t(e,{},void 0,{parent:l,key:n});return Object.assign(l.idMap,(0,i.pi)(((r={})[o.id]=o,r),o.idMap)),o}):v;var p=0;!function t(e){var n,r;e.order=p++;try{for(var o=(0,i.XA)((0,h.nI)(e)),a=o.next();!a.done;a=o.next()){var s=a.value;t(s)}}catch(c){n={error:c}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}(this),this.history=!0===this.config.history?"shallow":this.config.history||!1,this._transient=!!this.config.always||!!this.config.on&&(Array.isArray(this.config.on)?this.config.on.some(function(t){return""===t.event}):""in this.config.on),this.strict=!!this.config.strict,this.onEntry=(0,r.qo)(this.config.entry||this.config.onEntry).map(function(t){return(0,c.Q8)(t)}),this.onExit=(0,r.qo)(this.config.exit||this.config.onExit).map(function(t){return(0,c.Q8)(t)}),this.meta=this.config.meta,this.doneData="final"===this.type?this.config.data:void 0,this.invoke=(0,r.qo)(this.config.invoke).map(function(t,e){if((0,r.O4)(t)){var n,o,a=(0,r.bx)(l.id,e);return l.machine.options.services=(0,i.pi)(((n={})[a]=t,n),l.machine.options.services),d({src:a,id:a})}if((0,r.HD)(t.src)){var a=t.id||(0,r.bx)(l.id,e);return d((0,i.pi)((0,i.pi)({},t),{id:a,src:t.src}))}if((0,r.O4)(t.src)||(0,r.mf)(t.src)){var a=t.id||(0,r.bx)(l.id,e);return l.machine.options.services=(0,i.pi)(((o={})[a]=t.src,o),l.machine.options.services),d((0,i.pi)((0,i.pi)({id:a},t),{src:a}))}var s=t.src;return d((0,i.pi)((0,i.pi)({id:(0,r.bx)(l.id,e)},t),{src:s}))}),this.activities=(0,r.qo)(this.config.activities).concat(this.invoke).map(function(t){return(0,c.XA)(t)}),this.transition=this.transition.bind(this),this.tags=(0,r.qo)(this.config.tags)}return t.prototype._init=function(){this.__cache.transitions||(0,h.ac)(this).forEach(function(t){return t.on})},t.prototype.withConfig=function(e,n){var r=this.options,o=r.actions,a=r.activities,s=r.guards,c=r.services,u=r.delays;return new t(this.config,{actions:(0,i.pi)((0,i.pi)({},o),e.actions),activities:(0,i.pi)((0,i.pi)({},a),e.activities),guards:(0,i.pi)((0,i.pi)({},s),e.guards),services:(0,i.pi)((0,i.pi)({},c),e.services),delays:(0,i.pi)((0,i.pi)({},u),e.delays)},null!=n?n:this.context)},t.prototype.withContext=function(e){return new t(this.config,this.options,e)},Object.defineProperty(t.prototype,"context",{get:function(){return(0,r.mf)(this._context)?this._context():this._context},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"definition",{get:function(){return{id:this.id,key:this.key,version:this.version,context:this.context,type:this.type,initial:this.initial,history:this.history,states:(0,r.Q8)(this.states,function(t){return t.definition}),on:this.on,transitions:this.transitions,entry:this.onEntry,exit:this.onExit,activities:this.activities||[],meta:this.meta,order:this.order||-1,data:this.doneData,invoke:this.invoke,description:this.description,tags:this.tags}},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){return this.definition},Object.defineProperty(t.prototype,"on",{get:function(){if(this.__cache.on)return this.__cache.on;var t=this.transitions;return this.__cache.on=t.reduce(function(t,e){return t[e.eventType]=t[e.eventType]||[],t[e.eventType].push(e),t},{})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"after",{get:function(){return this.__cache.delayedTransitions||(this.__cache.delayedTransitions=this.getDelayedTransitions(),this.__cache.delayedTransitions)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"transitions",{get:function(){return this.__cache.transitions||(this.__cache.transitions=this.formatTransitions(),this.__cache.transitions)},enumerable:!1,configurable:!0}),t.prototype.getCandidates=function(t){if(this.__cache.candidates[t])return this.__cache.candidates[t];var e=""===t,n=this.transitions.filter(function(n){var i=n.eventType===t;return e?i:i||"*"===n.eventType});return this.__cache.candidates[t]=n,n},t.prototype.getDelayedTransitions=function(){var t=this,e=this.config.after;if(!e)return[];var n=function(e,n){var i=(0,r.mf)(e)?"".concat(t.id,":delay[").concat(n,"]"):e,o=(0,c.e4)(i,t.id);return t.onEntry.push((0,c.lW)(o,{delay:e})),t.onExit.push((0,c.al)(o)),o};return((0,r.kJ)(e)?e.map(function(t,e){var r=n(t.delay,e);return(0,i.pi)((0,i.pi)({},t),{event:r})}):(0,r.xH)(Object.keys(e).map(function(t,o){var a=e[t],s=(0,r.HD)(a)?{target:a}:a,c=isNaN(+t)?t:+t,u=n(c,o);return(0,r.qo)(s).map(function(t){return(0,i.pi)((0,i.pi)({},t),{event:u,delay:c})})}))).map(function(e){var n=e.delay;return(0,i.pi)((0,i.pi)({},t.formatTransition(e)),{delay:n})})},t.prototype.getStateNodes=function(t){var e,n=this;if(!t)return[];var o=t instanceof a.ZM?t.value:(0,r.WM)(t,this.delimiter);if((0,r.HD)(o)){var s=this.getStateNode(o).initial;return void 0!==s?this.getStateNodes(((e={})[o]=s,e)):[this,this.states[o]]}var c=Object.keys(o),u=[this];return u.push.apply(u,(0,i.ev)([],(0,i.CR)((0,r.xH)(c.map(function(t){return n.getStateNode(t).getStateNodes(o[t])}))),!1)),u},t.prototype.handles=function(t){var e=(0,r.x6)(t);return this.events.includes(e)},t.prototype.resolveState=function(t){var e=t instanceof a.ZM?t:a.ZM.create(t),n=Array.from((0,h.P_)([],this.getStateNodes(e.value)));return new a.ZM((0,i.pi)((0,i.pi)({},e),{value:this.resolve(e.value),configuration:n,done:(0,h.Ij)(n,this),tags:(0,h.Oe)(n),machine:this.machine}))},t.prototype.transitionLeafNode=function(t,e,n){var i=this.getStateNode(t).next(e,n);return i&&i.transitions.length?i:this.next(e,n)},t.prototype.transitionCompoundNode=function(t,e,n){var i=Object.keys(t),r=this.getStateNode(i[0])._transition(t[i[0]],e,n);return r&&r.transitions.length?r:this.next(e,n)},t.prototype.transitionParallelNode=function(t,e,n){var o,a,s={};try{for(var c=(0,i.XA)(Object.keys(t)),u=c.next();!u.done;u=c.next()){var f=u.value,h=t[f];if(h){var l=this.getStateNode(f)._transition(h,e,n);l&&(s[f]=l)}}}catch(d){o={error:d}}finally{try{u&&!u.done&&(a=c.return)&&a.call(c)}finally{if(o)throw o.error}}var v=Object.keys(s).map(function(t){return s[t]}),p=(0,r.xH)(v.map(function(t){return t.transitions}));if(!v.some(function(t){return t.transitions.length>0}))return this.next(e,n);var y=(0,r.xH)(Object.keys(s).map(function(t){return s[t].configuration}));return{transitions:p,exitSet:(0,r.xH)(v.map(function(t){return t.exitSet})),configuration:y,source:e,actions:(0,r.xH)(Object.keys(s).map(function(t){return s[t].actions}))}},t.prototype._transition=function(t,e,n){return(0,r.HD)(t)?this.transitionLeafNode(t,e,n):1===Object.keys(t).length?this.transitionCompoundNode(t,e,n):this.transitionParallelNode(t,e,n)},t.prototype.getTransitionData=function(t,e){return this._transition(t.value,t,(0,r.g5)(e))},t.prototype.next=function(t,e){var n,o,a,s=this,c=e.name,u=[],f=[];try{for(var h=(0,i.XA)(this.getCandidates(c)),l=h.next();!l.done;l=h.next()){var d=l.value,v=d.cond,y=d.in,g=t.context,m=!y||((0,r.HD)(y)&&p(y)?t.matches((0,r.WM)(this.getStateNodeById(y).path,this.delimiter)):(0,r.W)((0,r.WM)(y,this.delimiter),(0,r.ET)(this.path.slice(0,-2))(t.value))),x=!1;try{x=!v||(0,r.vx)(this.machine,v,g,e,t)}catch(b){throw Error("Unable to evaluate guard '".concat(v.name||v.type,"' in transition for event '").concat(c,"' in state node '").concat(this.id,"':\n").concat(b.message))}if(x&&m){void 0!==d.target&&(f=d.target),u.push.apply(u,(0,i.ev)([],(0,i.CR)(d.actions),!1)),a=d;break}}}catch(S){n={error:S}}finally{try{l&&!l.done&&(o=h.return)&&o.call(h)}finally{if(n)throw n.error}}if(a){if(!f.length)return{transitions:[a],exitSet:[],configuration:t.value?[this]:[],source:t,actions:u};var w=(0,r.xH)(f.map(function(e){return s.getRelativeStateNodes(e,t.historyValue)})),_=!!a.internal;return{transitions:[a],exitSet:_?[]:(0,r.xH)(f.map(function(t){return s.getPotentiallyReenteringNodes(t)})),configuration:w,source:t,actions:u}}},t.prototype.getPotentiallyReenteringNodes=function(t){if(this.order<t.order)return[this];for(var e=[],n=this;n&&n!==t;)e.push(n),n=n.parent;return n!==t?[]:(e.push(t),e)},t.prototype.getActions=function(t,e,n,a,u,f,l){var d,v,p,y,g=this,m=f?(0,h.P_)([],this.getStateNodes(f.value)):[],x=new Set;try{for(var b=(0,i.XA)(Array.from(t).sort(function(t,e){return t.order-e.order})),S=b.next();!S.done;S=b.next()){var w=S.value;(!(0,h.e$)(m,w)||(0,h.e$)(n.exitSet,w)||w.parent&&x.has(w.parent))&&x.add(w)}}catch(_){d={error:_}}finally{try{S&&!S.done&&(v=b.return)&&v.call(b)}finally{if(d)throw d.error}}try{for(var E=(0,i.XA)(m),O=E.next();!O.done;O=E.next()){var w=O.value;(!(0,h.e$)(t,w)||(0,h.e$)(n.exitSet,w.parent))&&n.exitSet.push(w)}}catch(A){p={error:A}}finally{try{O&&!O.done&&(y=E.return)&&y.call(E)}finally{if(p)throw p.error}}n.exitSet.sort(function(t,e){return e.order-t.order});var M=Array.from(x).sort(function(t,e){return t.order-e.order}),k=new Set(n.exitSet),j=(0,r.xH)(M.map(function(t){var e=[];if("final"!==t.type)return e;var i=t.parent;if(!i.parent)return e;e.push((0,c.aT)(t.id,t.doneData),(0,c.aT)(i.id,t.doneData?(0,r.QX)(t.doneData,a,u):void 0));var o=i.parent;return"parallel"===o.type&&(0,h.G)(o).every(function(t){return(0,h.Ij)(n.configuration,t)})&&e.push((0,c.aT)(o.id)),e})),T=M.map(function(t){var e=t.onEntry,n=t.activities.map(function(t){return(0,c.BL)(t)});return(0,c.AE)(l?(0,i.ev)((0,i.ev)([],(0,i.CR)(e),!1),(0,i.CR)(n),!1):(0,i.ev)((0,i.ev)([],(0,i.CR)(n),!1),(0,i.CR)(e),!1),g.machine.options.actions)}).concat([j.map(c.OU)]),N=Array.from(k).map(function(t){return(0,c.AE)((0,i.ev)((0,i.ev)([],(0,i.CR)(t.onExit),!1),(0,i.CR)(t.activities.map(function(t){return(0,c.sT)(t)})),!1),g.machine.options.actions)}).concat([(0,c.AE)(n.actions,this.machine.options.actions)]).concat(T);if(e){var C=(0,c.AE)((0,r.xH)((0,i.ev)([],(0,i.CR)(t),!1).sort(function(t,e){return e.order-t.order}).map(function(t){return t.onExit})),this.machine.options.actions).filter(function(t){return t.type!==s.OU&&(t.type!==s.lW||!!t.to&&t.to!==o.K.Internal)});return N.concat([C])}return N},t.prototype.transition=function(t,e,n,o){void 0===t&&(t=this.initialState);var s,c=(0,r.g5)(e);if(t instanceof a.ZM)s=void 0===n?t:this.resolveState(a.ZM.from(t,n));else{var f=(0,r.HD)(t)?this.resolve((0,r.on)(this.getResolvedPath(t))):this.resolve(t),l=null!=n?n:this.machine.context;s=this.resolveState(a.ZM.from(f,l))}if(!u.M&&"*"===c.name)throw Error("An event cannot have the wildcard type ('".concat("*","')"));if(this.strict&&!this.events.includes(c.name)&&!(0,r.JQ)(c.name))throw Error("Machine '".concat(this.id,"' does not accept event '").concat(c.name,"'"));var d=this._transition(s.value,s,c)||{transitions:[],configuration:[],exitSet:[],source:s,actions:[]},v=(0,h.P_)([],this.getStateNodes(s.value)),p=d.configuration.length?(0,h.P_)(v,d.configuration):v;return d.configuration=(0,i.ev)([],(0,i.CR)(p),!1),this.resolveTransition(d,s,s.context,o,c)},t.prototype.resolveRaisedTransition=function(t,e,n,r){var o,a=t.actions;return(t=this.transition(t,e,void 0,r))._event=n,t.event=n.data,(o=t.actions).unshift.apply(o,(0,i.ev)([],(0,i.CR)(a),!1)),t},t.prototype.resolveTransition=function(t,e,n,u,f){var d,v,p,y,g=this;void 0===f&&(f=c.bf);var m=t.configuration,x=!e||t.transitions.length>0,b=x?t.configuration:e?e.configuration:[],S=(0,h.Ij)(b,this),w=x?(0,h.NA)(this.machine,m):void 0,_=e?e.historyValue?e.historyValue:t.source?this.machine.historyValue(e.value):void 0:void 0,E=this.getActions(new Set(b),S,t,n,f,e,u),O=e?(0,i.pi)({},e.activities):{};try{for(var A=(0,i.XA)(E),M=A.next();!M.done;M=A.next()){var k=M.value;try{for(var j=(p=void 0,(0,i.XA)(k)),T=j.next();!T.done;T=j.next()){var N=T.value;N.type===s.BL?O[N.activity.id||N.activity.type]=N:N.type===s.sT&&(O[N.activity.id||N.activity.type]=!1)}}catch(C){p={error:C}}finally{try{T&&!T.done&&(y=j.return)&&y.call(j)}finally{if(p)throw p.error}}}}catch(R){d={error:R}}finally{try{M&&!M.done&&(v=A.return)&&v.call(A)}finally{if(d)throw d.error}}var P=(0,i.CR)((0,c.yC)(this,e,n,f,E,u,this.machine.config.predictableActionArguments||this.machine.config.preserveActionOrder),2),D=P[0],L=P[1],H=(0,i.CR)((0,r.uK)(D,function(t){return t.type===s.OU||t.type===s.lW&&t.to===o.K.Internal}),2),V=H[0],X=H[1],I=D.filter(function(t){var e;return t.type===s.BL&&(null===(e=t.activity)||void 0===e?void 0:e.type)===s.dw}).reduce(function(t,e){return t[e.activity.id]=(0,l.mu)(e.activity,g.machine,L,f),t},e?(0,i.pi)({},e.children):{}),Z=new a.ZM({value:w||e.value,context:L,_event:f,_sessionid:e?e._sessionid:null,historyValue:w?_?(0,r.yv)(_,w):void 0:e?e.historyValue:void 0,history:!w||t.source?e:void 0,actions:w?X:[],activities:w?O:e?e.activities:{},events:[],configuration:b,transitions:t.transitions,children:I,done:S,tags:(0,h.Oe)(b),machine:this}),J=n!==L;Z.changed=f.name===s.Vx||J;var U=Z.history;U&&delete U.history;var K=!S&&(this._transient||m.some(function(t){return t._transient}));if(!x&&(!K||""===f.name))return Z;var Q=Z;if(!S)for(K&&(Q=this.resolveRaisedTransition(Q,{type:s.IA},f,u));V.length;){var q=V.shift();Q=this.resolveRaisedTransition(Q,q._event,f,u)}var $=Q.changed||(U?!!Q.actions.length||J||typeof U.value!=typeof Q.value||!(0,a.j_)(Q.value,U.value):void 0);return Q.changed=$,Q.history=U,Q},t.prototype.getStateNode=function(t){if(p(t))return this.machine.getStateNodeById(t);if(!this.states)throw Error("Unable to retrieve child state '".concat(t,"' from '").concat(this.id,"'; no child states exist."));var e=this.states[t];if(!e)throw Error("Child state '".concat(t,"' does not exist on '").concat(this.id,"'"));return e},t.prototype.getStateNodeById=function(t){var e=p(t)?t.slice(1):t;if(e===this.id)return this;var n=this.machine.idMap[e];if(!n)throw Error("Child state node '#".concat(e,"' does not exist on machine '").concat(this.id,"'"));return n},t.prototype.getStateNodeByPath=function(t){if("string"==typeof t&&p(t))try{return this.getStateNodeById(t.slice(1))}catch(e){}for(var n=(0,r.Q9)(t,this.delimiter).slice(),i=this;n.length;){var o=n.shift();if(!o.length)break;i=i.getStateNode(o)}return i},t.prototype.resolve=function(t){var e,n=this;if(!t)return this.initialStateValue||v;switch(this.type){case"parallel":return(0,r.Q8)(this.initialStateValue,function(e,i){return e?n.getStateNode(i).resolve(t[i]||e):v});case"compound":if((0,r.HD)(t)){var i=this.getStateNode(t);if("parallel"===i.type||"compound"===i.type)return(e={})[t]=i.initialStateValue,e;return t}if(!Object.keys(t).length)return this.initialStateValue||{};return(0,r.Q8)(t,function(t,e){return t?n.getStateNode(e).resolve(t):v});default:return t||v}},t.prototype.getResolvedPath=function(t){if(p(t)){var e=this.machine.idMap[t.slice(1)];if(!e)throw Error("Unable to find state node '".concat(t,"'"));return e.path}return(0,r.Q9)(t,this.delimiter)},Object.defineProperty(t.prototype,"initialStateValue",{get:function(){var t,e;if(this.__cache.initialStateValue)return this.__cache.initialStateValue;if("parallel"===this.type)e=(0,r.ib)(this.states,function(t){return t.initialStateValue||v},function(t){return"history"!==t.type});else if(void 0!==this.initial){if(!this.states[this.initial])throw Error("Initial state '".concat(this.initial,"' not found on '").concat(this.key,"'"));e=(0,h.N9)(this.states[this.initial])?this.initial:((t={})[this.initial]=this.states[this.initial].initialStateValue,t)}else e={};return this.__cache.initialStateValue=e,this.__cache.initialStateValue},enumerable:!1,configurable:!0}),t.prototype.getInitialState=function(t,e){this._init();var n=this.getStateNodes(t);return this.resolveTransition({configuration:n,exitSet:[],transitions:[],source:void 0,actions:[]},void 0,null!=e?e:this.machine.context,void 0)},Object.defineProperty(t.prototype,"initialState",{get:function(){var t=this.initialStateValue;if(!t)throw Error("Cannot retrieve initial state from simple state '".concat(this.id,"'."));return this.getInitialState(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"target",{get:function(){var t;if("history"===this.type){var e=this.config;t=(0,r.HD)(e.target)&&p(e.target)?(0,r.on)(this.machine.getStateNodeById(e.target).path.slice(this.path.length-1)):e.target}return t},enumerable:!1,configurable:!0}),t.prototype.getRelativeStateNodes=function(t,e,n){return void 0===n&&(n=!0),n?"history"===t.type?t.resolveHistory(e):t.initialStateNodes:[t]},Object.defineProperty(t.prototype,"initialStateNodes",{get:function(){var t=this;if((0,h.N9)(this))return[this];if("compound"===this.type&&!this.initial)return u.M||(0,r.ZK)(!1,"Compound state node '".concat(this.id,"' has no initial state.")),[this];var e=(0,r.SA)(this.initialStateValue);return(0,r.xH)(e.map(function(e){return t.getFromRelativePath(e)}))},enumerable:!1,configurable:!0}),t.prototype.getFromRelativePath=function(t){if(!t.length)return[this];var e=(0,i.CR)(t),n=e[0],r=e.slice(1);if(!this.states)throw Error("Cannot retrieve subPath '".concat(n,"' from node with no states"));var o=this.getStateNode(n);if("history"===o.type)return o.resolveHistory();if(!this.states[n])throw Error("Child state '".concat(n,"' does not exist on '").concat(this.id,"'"));return this.states[n].getFromRelativePath(r)},t.prototype.historyValue=function(t){if(Object.keys(this.states).length)return{current:t||this.initialStateValue,states:(0,r.ib)(this.states,function(e,n){if(!t)return e.historyValue();var i=(0,r.HD)(t)?void 0:t[n];return e.historyValue(i||e.initialStateValue)},function(t){return!t.history})}},t.prototype.resolveHistory=function(t){var e=this;if("history"!==this.type)return[this];var n=this.parent;if(!t){var i=this.target;return i?(0,r.xH)((0,r.SA)(i).map(function(t){return n.getFromRelativePath(t)})):n.initialStateNodes}var o=(0,r.gk)(n.path,"states")(t).current;return(0,r.HD)(o)?[n.getStateNode(o)]:(0,r.xH)((0,r.SA)(o).map(function(t){return"deep"===e.history?n.getFromRelativePath(t):[n.states[t[0]]]}))},Object.defineProperty(t.prototype,"stateIds",{get:function(){var t=this;return[this.id].concat((0,r.xH)(Object.keys(this.states).map(function(e){return t.states[e].stateIds})))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"events",{get:function(){if(this.__cache.events)return this.__cache.events;var t,e,n,r,o=this.states,a=new Set(this.ownEvents);if(o)try{for(var s=(0,i.XA)(Object.keys(o)),c=s.next();!c.done;c=s.next()){var u=o[c.value];if(u.states)try{for(var f=(n=void 0,(0,i.XA)(u.events)),h=f.next();!h.done;h=f.next()){var l=h.value;a.add("".concat(l))}}catch(d){n={error:d}}finally{try{h&&!h.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}}}catch(v){t={error:v}}finally{try{c&&!c.done&&(e=s.return)&&e.call(s)}finally{if(t)throw t.error}}return this.__cache.events=Array.from(a)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ownEvents",{get:function(){return Array.from(new Set(this.transitions.filter(function(t){return!(!t.target&&!t.actions.length&&t.internal)}).map(function(t){return t.eventType})))},enumerable:!1,configurable:!0}),t.prototype.resolveTarget=function(t){var e=this;if(void 0!==t)return t.map(function(t){if(!(0,r.HD)(t))return t;var n=t[0]===e.delimiter;if(n&&!e.parent)return e.getStateNodeByPath(t.slice(1));var i=n?e.key+t:t;if(!e.parent)return e.getStateNodeByPath(i);try{return e.parent.getStateNodeByPath(i)}catch(o){throw Error("Invalid transition definition for state node '".concat(e.id,"':\n").concat(o.message))}})},t.prototype.formatTransition=function(t){var e=this,n=(0,r.rg)(t.target),o="internal"in t?t.internal:!n||n.some(function(t){return(0,r.HD)(t)&&t[0]===e.delimiter}),a=this.machine.options.guards,s=this.resolveTarget(n),u=(0,i.pi)((0,i.pi)({},t),{actions:(0,c.AE)((0,r.qo)(t.actions)),cond:(0,r.Qi)(t.cond,a),target:s,source:this,internal:o,eventType:t.event,toJSON:function(){return(0,i.pi)((0,i.pi)({},u),{target:u.target?u.target.map(function(t){return"#".concat(t.id)}):void 0,source:"#".concat(e.id)})}});return u},t.prototype.formatTransitions=function(){var t,e,n,o=this;if(this.config.on){if(Array.isArray(this.config.on))n=this.config.on;else{var a=this.config.on,s=a["*"],f=(0,i._T)(a,["*"]);n=(0,r.xH)(Object.keys(f).map(function(t){u.M||""!==t||(0,r.ZK)(!1,"Empty string transition configs (e.g., `{ on: { '': ... }}`) for transient transitions are deprecated. Specify the transition in the `{ always: ... }` property instead. "+'Please check the `on` configuration for "#'.concat(o.id,'".'));var e=(0,r.jh)(t,f[t]);return u.M||y(o,t,e),e}).concat((0,r.jh)("*",void 0===s?[]:s)))}}else n=[];var h=this.config.always?(0,r.jh)("",this.config.always):[],l=this.config.onDone?(0,r.jh)(String((0,c.aT)(this.id)),this.config.onDone):[];u.M||(0,r.ZK)(!(this.config.onDone&&!this.parent),'Root nodes cannot have an ".onDone" transition. Please check the config of "'.concat(this.id,'".'));var d=(0,r.xH)(this.invoke.map(function(t){var e=[];return t.onDone&&e.push.apply(e,(0,i.ev)([],(0,i.CR)((0,r.jh)(String((0,c.Sl)(t.id)),t.onDone)),!1)),t.onError&&e.push.apply(e,(0,i.ev)([],(0,i.CR)((0,r.jh)(String((0,c.vU)(t.id)),t.onError)),!1)),e})),v=this.after,p=(0,r.xH)((0,i.ev)((0,i.ev)((0,i.ev)((0,i.ev)([],(0,i.CR)(l),!1),(0,i.CR)(d),!1),(0,i.CR)(n),!1),(0,i.CR)(h),!1).map(function(t){return(0,r.qo)(t).map(function(t){return o.formatTransition(t)})}));try{for(var g=(0,i.XA)(v),m=g.next();!m.done;m=g.next()){var x=m.value;p.push(x)}}catch(b){t={error:b}}finally{try{m&&!m.done&&(e=g.return)&&e.call(g)}finally{if(t)throw t.error}}return p},t}(),m=!1;function x(t,e){return u.M||"predictableActionArguments"in t||m||(m=!0,console.warn("It is highly recommended to set `predictableActionArguments` to `true` when using `createMachine`. https://xstate.js.org/docs/guides/actions.html")),new g(t,e)}},54911:function(t,e,n){n.d(e,{TL:function(){return u},ZM:function(){return h},j1:function(){return f},j_:function(){return function t(e,n){if(e===n)return!0;if(void 0===e||void 0===n)return!1;if((0,o.HD)(e)||(0,o.HD)(n))return e===n;var i=Object.keys(e),r=Object.keys(n);return i.length===r.length&&i.every(function(i){return t(e[i],n[i])})}}});var i=n(63056),r=n(87353),o=n(89823),a=n(56115),s=n(30375),c=n(14066);function u(t){return"object"==typeof t&&null!==t&&"value"in t&&"_event"in t}function f(t,e){var n=t.exec;return(0,i.pi)((0,i.pi)({},t),{exec:void 0!==n?function(){return n(e.context,e.event,{action:t,state:e,_event:e._event})}:void 0})}var h=function(){function t(t){var e,n=this;this.actions=[],this.activities=r.qP,this.meta={},this.events=[],this.value=t.value,this.context=t.context,this._event=t._event,this._sessionid=t._sessionid,this.event=this._event.data,this.historyValue=t.historyValue,this.history=t.history,this.actions=t.actions||[],this.activities=t.activities||r.qP,this.meta=(0,a.xZ)(t.configuration),this.events=t.events||[],this.matches=this.matches.bind(this),this.toStrings=this.toStrings.bind(this),this.configuration=t.configuration,this.transitions=t.transitions,this.children=t.children,this.done=!!t.done,this.tags=null!==(e=Array.isArray(t.tags)?new Set(t.tags):t.tags)&&void 0!==e?e:new Set,this.machine=t.machine,Object.defineProperty(this,"nextEvents",{get:function(){return(0,a.nJ)(n.configuration)}})}return t.from=function(e,n){if(e instanceof t)return e.context!==n?new t({value:e.value,context:n,_event:e._event,_sessionid:null,historyValue:e.historyValue,history:e.history,actions:[],activities:e.activities,meta:{},events:[],configuration:[],transitions:[],children:{}}):e;var i=s.bf;return new t({value:e,context:n,_event:i,_sessionid:null,historyValue:void 0,history:void 0,actions:[],activities:void 0,meta:void 0,events:[],configuration:[],transitions:[],children:{}})},t.create=function(e){return new t(e)},t.inert=function(e,n){if(e instanceof t){if(!e.actions.length)return e;var i=s.bf;return new t({value:e.value,context:n,_event:i,_sessionid:null,historyValue:e.historyValue,history:e.history,activities:e.activities,configuration:e.configuration,transitions:[],children:{}})}return t.from(e,n)},t.prototype.toStrings=function(t,e){var n=this;if(void 0===t&&(t=this.value),void 0===e&&(e="."),(0,o.HD)(t))return[t];var r=Object.keys(t);return r.concat.apply(r,(0,i.ev)([],(0,i.CR)(r.map(function(i){return n.toStrings(t[i],e).map(function(t){return i+e+t})})),!1))},t.prototype.toJSON=function(){this.configuration,this.transitions;var t=this.tags;this.machine;var e=(0,i._T)(this,["configuration","transitions","tags","machine"]);return(0,i.pi)((0,i.pi)({},e),{tags:Array.from(t)})},t.prototype.matches=function(t){return(0,o.W)(t,this.value)},t.prototype.hasTag=function(t){return this.tags.has(t)},t.prototype.can=function(t){c.M&&(0,o.ZK)(!!this.machine,"state.can(...) used outside of a machine-created State object; this will always return false.");var e,n=null===(e=this.machine)||void 0===e?void 0:e.getTransitionData(this,t);return!!(null==n?void 0:n.transitions.length)&&n.transitions.some(function(t){return void 0!==t.target||t.actions.length})},t}()},63056:function(t,e,n){n.d(e,{CR:function(){return a},XA:function(){return o},_T:function(){return r},ev:function(){return s},pi:function(){return i}});/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */ var i=function(){return(i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function r(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&0>e.indexOf(i)&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(t);r<i.length;r++)0>e.indexOf(i[r])&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]]);return n}function o(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],i=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function a(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,r,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(i=o.next()).done;)a.push(i.value)}catch(s){r={error:s}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return a}function s(t,e,n){if(n||2==arguments.length)for(var i,r=0,o=e.length;r<o;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}},3884:function(t,e,n){n.d(e,{BL:function(){return r},IA:function(){return u},Le:function(){return m},Mg:function(){return v},OU:function(){return a},RN:function(){return g},S1:function(){return l},Vx:function(){return y},al:function(){return c},cM:function(){return h},dw:function(){return d},f0:function(){return f},lW:function(){return s},sT:function(){return o},vU:function(){return p}});var i=n(59043),r=i.M.Start,o=i.M.Stop,a=i.M.Raise,s=i.M.Send,c=i.M.Cancel,u=i.M.NullEvent,f=i.M.Assign;i.M.After,i.M.DoneState;var h=i.M.Log,l=i.M.Init,d=i.M.Invoke;i.M.ErrorExecution;var v=i.M.ErrorPlatform,p=i.M.ErrorCustom,y=i.M.Update,g=i.M.Choose,m=i.M.Pure},30375:function(t,e,n){n.d(e,{AE:function(){return h},BL:function(){return y},OU:function(){return d},Q8:function(){return f},Sl:function(){return b},XA:function(){return l},aT:function(){return x},al:function(){return p},bf:function(){return c},e4:function(){return m},lW:function(){return v},o$:function(){return u},sT:function(){return g},vU:function(){return S},yC:function(){return function t(e,n,c,u,l,d,v){void 0===v&&(v=!1);var p=v?[]:w(l),y=p.length?(0,a.dt)(c,u,p,n):c,g=v?[c]:void 0,m=[];return[(0,a.xH)(l.map(function(l){var p,x,b=[];try{for(var S=(0,i.XA)(l),w=S.next();!w.done;w=S.next()){var _=w.value,E=function(l){switch(l.type){case o.OU:return{type:o.OU,_event:(0,a.g5)(l.event)};case o.lW:var p=function(t,e,n,r){var o,s={_event:n},c=(0,a.g5)((0,a.mf)(t.event)?t.event(e,n.data,s):t.event);if((0,a.HD)(t.delay)){var u=r&&r[t.delay];o=(0,a.mf)(u)?u(e,n.data,s):u}else o=(0,a.mf)(t.delay)?t.delay(e,n.data,s):t.delay;var f=(0,a.mf)(t.to)?t.to(e,n.data,s):t.to;return(0,i.pi)((0,i.pi)({},t),{to:f,_event:c,event:c.data,delay:o})}(l,y,u,e.options.delays);return s.M||(0,a.ZK)(!(0,a.HD)(l.delay)||"number"==typeof p.delay,"No delay reference for delay expression '".concat(l.delay,"' was found on machine '").concat(e.id,"'")),d&&p.to!==r.K.Internal&&m.push(p),p;case o.cM:var x,b,S=(b=y,(0,i.pi)((0,i.pi)({},l),{value:(0,a.HD)(l.expr)?l.expr:l.expr(b,u.data,{_event:u})}));return null==d||d(S,y,u),S;case o.RN:var w=null===(x=l.conds.find(function(t){var i=(0,a.Qi)(t.cond,e.options.guards);return!i||(0,a.vx)(e,i,y,u,d?void 0:n)}))||void 0===x?void 0:x.actions;if(!w)return[];var _=(0,i.CR)(t(e,n,y,u,[h((0,a.qo)(w),e.options.actions)],d,v),2),E=_[0];return y=_[1],null==g||g.push(y),E;case o.Le:var w=l.get(y,u.data);if(!w)return[];var O=(0,i.CR)(t(e,n,y,u,[h((0,a.qo)(w),e.options.actions)],d,v),2),A=O[0];return y=O[1],null==g||g.push(y),A;case o.sT:var M,k,S=(M=y,k=(0,a.mf)(l.activity)?l.activity(M,u.data):l.activity,{type:r.M.Stop,activity:"string"==typeof k?{id:k}:k});return null==d||d(S,c,u),S;case o.f0:y=(0,a.dt)(y,u,[l],d?void 0:n),null==g||g.push(y);break;default:var j=f(l,e.options.actions),T=j.exec;if(d)d(j,y,u);else if(T&&g){var N=g.length-1;j=(0,i.pi)((0,i.pi)({},j),{exec:function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];T.apply(void 0,(0,i.ev)([g[N]],(0,i.CR)(e),!1))}})}return j}}(_);E&&(b=b.concat(E))}}catch(O){p={error:O}}finally{try{w&&!w.done&&(x=S.return)&&x.call(S)}finally{if(p)throw p.error}}return m.forEach(function(t){d(t,y,u)}),m.length=0,b})),y]}}});var i=n(63056),r=n(59043),o=n(3884),a=n(89823),s=n(14066),c=(0,a.g5)({type:o.S1});function u(t,e){return e&&e[t]||void 0}function f(t,e){var n;if((0,a.HD)(t)||"number"==typeof t){var r=u(t,e);n=(0,a.mf)(r)?{type:t,exec:r}:r||{type:t,exec:void 0}}else if((0,a.mf)(t))n={type:t.name||t.toString(),exec:t};else{var r=u(t.type,e);if((0,a.mf)(r))n=(0,i.pi)((0,i.pi)({},t),{exec:r});else if(r){var o=r.type||t.type;n=(0,i.pi)((0,i.pi)((0,i.pi)({},r),t),{type:o})}else n=t}return n}var h=function(t,e){return t?((0,a.kJ)(t)?t:[t]).map(function(t){return f(t,e)}):[]};function l(t){var e=f(t);return(0,i.pi)((0,i.pi)({id:(0,a.HD)(t)?t:e.id},e),{type:e.type})}function d(t){return(0,a.HD)(t)?{type:o.OU,event:t}:v(t,{to:r.K.Internal})}function v(t,e){return{to:e?e.to:void 0,type:o.lW,event:(0,a.mf)(t)?t:(0,a._v)(t),delay:e?e.delay:void 0,id:e&&void 0!==e.id?e.id:(0,a.mf)(t)?t.name:(0,a.x6)(t)}}var p=function(t){return{type:o.al,sendId:t}};function y(t){var e=l(t);return{type:r.M.Start,activity:e,exec:void 0}}function g(t){var e=(0,a.mf)(t)?t:l(t);return{type:r.M.Stop,activity:e,exec:void 0}}function m(t,e){return"".concat(r.M.After,"(").concat(t,")").concat(e?"#".concat(e):"")}function x(t,e){var n="".concat(r.M.DoneState,".").concat(t),i={type:n,data:e};return i.toString=function(){return n},i}function b(t,e){var n="".concat(r.M.DoneInvoke,".").concat(t),i={type:n,data:e};return i.toString=function(){return n},i}function S(t,e){var n="".concat(r.M.ErrorPlatform,".").concat(t),i={type:n,data:e};return i.toString=function(){return n},i}var w=function(t){var e,n,r=[];try{for(var a=(0,i.XA)(t),s=a.next();!s.done;s=a.next())for(var c=s.value,u=0;u<c.length;){if(c[u].type===o.f0){r.push(c[u]),c.splice(u,1);continue}u++}}catch(f){e={error:f}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}return r}},87353:function(t,e,n){n.d(e,{TV:function(){return o},iS:function(){return i},qP:function(){return r},rt:function(){return a}});var i=".",r={},o="xstate.guard",a=""},14066:function(t,e,n){n.d(e,{M:function(){return i}});var i=!0},10797:function(t,e,n){n.d(e,{J:function(){return r}});var i=[],r=function(t,e){i.push(t);var n=e(t);return i.pop(),n}},56115:function(t,e,n){n.d(e,{G:function(){return s},Ij:function(){return function t(e,n){return"compound"===n.type?s(n).some(function(t){return"final"===t.type&&l(e,t)}):"parallel"===n.type&&s(n).every(function(n){return t(e,n)})}},N9:function(){return o},NA:function(){return h},Oe:function(){return p},P_:function(){return u},ac:function(){return c},e$:function(){return l},nI:function(){return a},nJ:function(){return d},xZ:function(){return v}});var i=n(63056),r=n(89823),o=function(t){return"atomic"===t.type||"final"===t.type};function a(t){return Object.keys(t.states).map(function(e){return t.states[e]})}function s(t){return a(t).filter(function(t){return"history"!==t.type})}function c(t){var e=[t];return o(t)?e:e.concat((0,r.xH)(s(t).map(c)))}function u(t,e){var n,r,o,a,c,u,h,l,d=f(new Set(t)),v=new Set(e);try{for(var p=(0,i.XA)(v),y=p.next();!y.done;y=p.next())for(var g=y.value,m=g.parent;m&&!v.has(m);)v.add(m),m=m.parent}catch(x){n={error:x}}finally{try{y&&!y.done&&(r=p.return)&&r.call(p)}finally{if(n)throw n.error}}var b=f(v);try{for(var S=(0,i.XA)(v),w=S.next();!w.done;w=S.next()){var g=w.value;if("compound"!==g.type||b.get(g)&&b.get(g).length){if("parallel"===g.type)try{for(var _=(c=void 0,(0,i.XA)(s(g))),E=_.next();!E.done;E=_.next()){var O=E.value;v.has(O)||(v.add(O),d.get(O)?d.get(O).forEach(function(t){return v.add(t)}):O.initialStateNodes.forEach(function(t){return v.add(t)}))}}catch(A){c={error:A}}finally{try{E&&!E.done&&(u=_.return)&&u.call(_)}finally{if(c)throw c.error}}}else d.get(g)?d.get(g).forEach(function(t){return v.add(t)}):g.initialStateNodes.forEach(function(t){return v.add(t)})}}catch(M){o={error:M}}finally{try{w&&!w.done&&(a=S.return)&&a.call(S)}finally{if(o)throw o.error}}try{for(var k=(0,i.XA)(v),j=k.next();!j.done;j=k.next())for(var g=j.value,m=g.parent;m&&!v.has(m);)v.add(m),m=m.parent}catch(T){h={error:T}}finally{try{j&&!j.done&&(l=k.return)&&l.call(k)}finally{if(h)throw h.error}}return v}function f(t){var e,n,r=new Map;try{for(var o=(0,i.XA)(t),a=o.next();!a.done;a=o.next()){var s=a.value;r.has(s)||r.set(s,[]),s.parent&&(r.has(s.parent)||r.set(s.parent,[]),r.get(s.parent).push(s))}}catch(c){e={error:c}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}return r}function h(t,e){var n=u([t],e);return function t(e,n){var i=n.get(e);if(!i)return{};if("compound"===e.type){var r=i[0];if(!r)return{};if(o(r))return r.key}var a={};return i.forEach(function(e){a[e.key]=t(e,n)}),a}(t,f(n))}function l(t,e){return Array.isArray(t)?t.some(function(t){return t===e}):t instanceof Set&&t.has(e)}function d(t){return(0,i.ev)([],(0,i.CR)(new Set((0,r.xH)((0,i.ev)([],(0,i.CR)(t.map(function(t){return t.ownEvents})),!1)))),!1)}function v(t){return void 0===t&&(t=[]),t.reduce(function(t,e){return void 0!==e.meta&&(t[e.id]=e.meta),t},{})}function p(t){return new Set((0,r.xH)(t.map(function(t){return t.tags})))}},59043:function(t,e,n){var i,r,o,a;n.d(e,{K:function(){return r},M:function(){return i}}),(o=i||(i={})).Start="xstate.start",o.Stop="xstate.stop",o.Raise="xstate.raise",o.Send="xstate.send",o.Cancel="xstate.cancel",o.NullEvent="",o.Assign="xstate.assign",o.After="xstate.after",o.DoneState="done.state",o.DoneInvoke="done.invoke",o.Log="xstate.log",o.Init="xstate.init",o.Invoke="xstate.invoke",o.ErrorExecution="error.execution",o.ErrorCommunication="error.communication",o.ErrorPlatform="error.platform",o.ErrorCustom="xstate.error",o.Update="xstate.update",o.Pure="xstate.pure",o.Choose="xstate.choose",(a=r||(r={})).Parent="#_parent",a.Internal="#_internal"},89823:function(t,e,n){n.d(e,{Bc:function(){return C},ET:function(){return d},HD:function(){return M},HV:function(){return b},JQ:function(){return m},L$:function(){return T},O4:function(){return N},Q8:function(){return h},Q9:function(){return c},QX:function(){return g},Qi:function(){return k},SA:function(){return function t(e){return e?M(e)?[[e]]:p(Object.keys(e).map(function(n){var i=e[n];return"string"==typeof i||i&&Object.keys(i).length?t(e[n]).map(function(t){return[n].concat(t)}):[[n]]})):[[]]}},W:function(){return function t(e,n,i){void 0===i&&(i=o.iS);var r=u(e,i),a=u(n,i);return M(a)?!!M(r)&&a===r:M(r)?r in a:Object.keys(r).every(function(e){return e in a&&t(r[e],a[e])})}},WM:function(){return u},ZK:function(){return E},_v:function(){return R},bi:function(){return j},bx:function(){return Z},dt:function(){return _},g5:function(){return P},gk:function(){return v},ib:function(){return l},j:function(){return X},jh:function(){return D},kJ:function(){return O},mf:function(){return A},on:function(){return f},qo:function(){return y},rg:function(){return L},uK:function(){return S},v4:function(){return H},vx:function(){return V},x6:function(){return s},xH:function(){return p},y8:function(){return x},yv:function(){return w},zM:function(){return I}});var i,r=n(63056),o=n(87353),a=n(14066);function s(t){try{return M(t)||"number"==typeof t?"".concat(t):t.type}catch(e){throw Error("Events must be strings or objects with a string event.type property.")}}function c(t,e){try{if(O(t))return t;return t.toString().split(e)}catch(n){throw Error("'".concat(t,"' is not a valid state path."))}}function u(t,e){return"object"==typeof t&&"value"in t&&"context"in t&&"event"in t&&"_event"in t?t.value:O(t)?f(t):"string"!=typeof t?t:f(c(t,e))}function f(t){if(1===t.length)return t[0];for(var e={},n=e,i=0;i<t.length-1;i++)i===t.length-2?n[t[i]]=t[i+1]:(n[t[i]]={},n=n[t[i]]);return e}function h(t,e){for(var n={},i=Object.keys(t),r=0;r<i.length;r++){var o=i[r];n[o]=e(t[o],o,t,r)}return n}function l(t,e,n){var i,o,a={};try{for(var s=(0,r.XA)(Object.keys(t)),c=s.next();!c.done;c=s.next()){var u=c.value,f=t[u];n(f)&&(a[u]=e(f,u,t))}}catch(h){i={error:h}}finally{try{c&&!c.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}return a}var d=function(t){return function(e){var n,i,o=e;try{for(var a=(0,r.XA)(t),s=a.next();!s.done;s=a.next())o=o[s.value]}catch(c){n={error:c}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}return o}};function v(t,e){return function(n){var i,o,a=n;try{for(var s=(0,r.XA)(t),c=s.next();!c.done;c=s.next()){var u=c.value;a=a[e][u]}}catch(f){i={error:f}}finally{try{c&&!c.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}return a}}function p(t){var e;return(e=[]).concat.apply(e,(0,r.ev)([],(0,r.CR)(t),!1))}function y(t){return void 0===t?[]:O(t)?t:[t]}function g(t,e,n){if(A(t))return t(e,n.data);var i,o,a={};try{for(var s=(0,r.XA)(Object.keys(t)),c=s.next();!c.done;c=s.next()){var u=c.value,f=t[u];A(f)?a[u]=f(e,n.data):a[u]=f}}catch(h){i={error:h}}finally{try{c&&!c.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}return a}function m(t){return/^(done|error)\./.test(t)}function x(t){return!!(t instanceof Promise||null!==t&&(A(t)||"object"==typeof t)&&A(t.then))}function b(t){return null!==t&&"object"==typeof t&&"transition"in t&&"function"==typeof t.transition}function S(t,e){var n,i,o=(0,r.CR)([[],[]],2),a=o[0],s=o[1];try{for(var c=(0,r.XA)(t),u=c.next();!u.done;u=c.next()){var f=u.value;e(f)?a.push(f):s.push(f)}}catch(h){n={error:h}}finally{try{u&&!u.done&&(i=c.return)&&i.call(c)}finally{if(n)throw n.error}}return[a,s]}function w(t,e){return{current:e,states:function t(e,n){return h(e.states,function(e,i){if(e){var r=(M(n)?void 0:n[i])||(e?e.current:void 0);if(r)return{current:r,states:t(e,r)}}})}(t,e)}}function _(t,e,n,i){return a.M||E(!!t,"Attempting to update undefined context"),t?n.reduce(function(t,n){var o,a,s=n.assignment,c={state:i,action:n,_event:e},u={};if(A(s))u=s(t,e.data,c);else try{for(var f=(0,r.XA)(Object.keys(s)),h=f.next();!h.done;h=f.next()){var l=h.value,d=s[l];u[l]=A(d)?d(t,e.data,c):d}}catch(v){o={error:v}}finally{try{h&&!h.done&&(a=f.return)&&a.call(f)}finally{if(o)throw o.error}}return Object.assign({},t,u)},t):t}var E=function(){};function O(t){return Array.isArray(t)}function A(t){return"function"==typeof t}function M(t){return"string"==typeof t}function k(t,e){return t?M(t)?{type:o.TV,name:t,predicate:e?e[t]:void 0}:A(t)?{type:o.TV,name:t.name,predicate:t}:t:void 0}function j(t){try{return"subscribe"in t&&A(t.subscribe)}catch(e){return!1}}a.M||(E=function(t,e){var n=t instanceof Error?t:void 0;if((n||!t)&&void 0!==console){var i=["Warning: ".concat(e)];n&&i.push(n),console.warn.apply(console,i)}});var T="function"==typeof Symbol&&Symbol.observable||"@@observable";function N(t){return!!t&&"__xstatenode"in t}function C(t){return!!t&&"function"==typeof t.send}function R(t,e){return M(t)||"number"==typeof t?(0,r.pi)({type:t},e):t}function P(t,e){if(!M(t)&&"$$type"in t&&"scxml"===t.$$type)return t;var n=R(t);return(0,r.pi)({name:n.type,data:n,$$type:"scxml",type:"external"},e)}function D(t,e){return(O(e)?e:[e]).map(function(e){return void 0===e||"string"==typeof e||N(e)?{target:e,event:t}:(0,r.pi)((0,r.pi)({},e),{event:t})})}function L(t){if(void 0!==t&&t!==o.rt)return y(t)}function H(t,e,n){if(!a.M){var i=t.stack?" Stacktrace was '".concat(t.stack,"'"):"";if(t===e)console.error("Missing onError handler for invocation '".concat(n,"', error was '").concat(t,"'.").concat(i));else{var r=e.stack?" Stacktrace was '".concat(e.stack,"'"):"";console.error("Missing onError handler and/or unhandled exception/promise rejection for invocation '".concat(n,"'. ")+"Original error: '".concat(t,"'. ").concat(i," Current error is '").concat(e,"'.").concat(r))}}}function V(t,e,n,i,r){var a=t.options.guards,s={state:r,cond:e,_event:i};if(e.type===o.TV)return((null==a?void 0:a[e.name])||e.predicate)(n,i.data,s);var c=null==a?void 0:a[e.type];if(!c)throw Error("Guard '".concat(e.type,"' is not implemented on machine '").concat(t.id,"'."));return c(n,i.data,s)}function X(t){return"string"==typeof t?{type:t}:t}function I(t,e,n){var i=function(){},r="object"==typeof t,o=r?t:null;return{next:((r?t.next:t)||i).bind(o),error:((r?t.error:e)||i).bind(o),complete:((r?t.complete:n)||i).bind(o)}}function Z(t,e){return"".concat(t,":invocation[").concat(e,"]")}(i={})[T]=function(){return this},i[Symbol.observable]=function(){return this}}}]);