Файловый менеджер - Редактировать - /home/admin/domains/octawebtools.com/public_html/wp-content/plugins/kadence-blocks/dist/3604.js
�азад
"use strict";(globalThis.webpackChunkkadence=globalThis.webpackChunkkadence||[]).push([[3604],{3604:(t,e,n)=>{n.r(e),n.d(e,{DotLottieStateMachineManager:()=>Gt});var i,r,o,a=n(168),s=(n(2320),n(7517),function(){return s=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},s.apply(this,arguments)});function c(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n}function u(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 new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function h(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(t){r={error:t}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return a}function l(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))}(r=i||(i={})).Start="xstate.start",r.Stop="xstate.stop",r.Raise="xstate.raise",r.Send="xstate.send",r.Cancel="xstate.cancel",r.NullEvent="",r.Assign="xstate.assign",r.After="xstate.after",r.DoneState="done.state",r.DoneInvoke="done.invoke",r.Log="xstate.log",r.Init="xstate.init",r.Invoke="xstate.invoke",r.ErrorExecution="error.execution",r.ErrorCommunication="error.communication",r.ErrorPlatform="error.platform",r.ErrorCustom="xstate.error",r.Update="xstate.update",r.Pure="xstate.pure",r.Choose="xstate.choose",function(t){t.Parent="#_parent",t.Internal="#_internal"}(o||(o={}));var f=i.Start,d=i.Stop,p=i.Raise,v=i.Send,y=i.Cancel,g=i.NullEvent,m=i.Assign;i.After,i.DoneState;var b=i.Log,_=i.Init,x=i.Invoke;i.ErrorExecution;var S,w=i.ErrorPlatform,E=i.ErrorCustom,O=i.Update,k=i.Choose,T=i.Pure,N={},j="xstate.guard";function A(t,e,n){void 0===n&&(n=".");var i=I(t,n),r=I(e,n);return G(r)?!!G(i)&&r===i:G(i)?i in r:Object.keys(i).every(function(t){return t in r&&A(i[t],r[t])})}function P(t){try{return G(t)||"number"==typeof t?"".concat(t):t.type}catch{throw new Error("Events must be strings or objects with a string event.type property.")}}function L(t,e){try{return Q(t)?t:t.toString().split(e)}catch{throw new Error("'".concat(t,"' is not a valid state path."))}}function I(t,e){return function(t){return"object"==typeof t&&"value"in t&&"context"in t&&"event"in t&&"_event"in t}(t)?t.value:Q(t)?C(t):"string"!=typeof t?t:C(L(t,e))}function C(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 V(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 D(t,e,n){var i,r,o={};try{for(var a=u(Object.keys(t)),s=a.next();!s.done;s=a.next()){var c=s.value,h=t[c];n(h)&&(o[c]=e(h,c,t))}}catch(t){i={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o}var M=function(t){return function(e){var n,i,r=e;try{for(var o=u(t),a=o.next();!a.done;a=o.next())r=r[a.value]}catch(t){n={error:t}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return r}};function R(t){return t?G(t)?[[t]]:z(Object.keys(t).map(function(e){var n=t[e];return"string"==typeof n||n&&Object.keys(n).length?R(t[e]).map(function(t){return[e].concat(t)}):[[e]]})):[[]]}function z(t){var e;return(e=[]).concat.apply(e,l([],h(t),!1))}function q(t){return Q(t)?t:[t]}function B(t){return void 0===t?[]:q(t)}function J(t,e,n){var i,r;if(H(t))return t(e,n.data);var o={};try{for(var a=u(Object.keys(t)),s=a.next();!s.done;s=a.next()){var c=s.value,h=t[c];H(h)?o[c]=h(e,n.data):o[c]=h}}catch(t){i={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o}function U(t){return!!(t instanceof Promise||null!==t&&(H(t)||"object"==typeof t)&&H(t.then))}function F(t,e){return V(t.states,function(t,n){if(t){var i=(G(e)?void 0:e[n])||(t?t.current:void 0);if(i)return{current:i,states:F(t,i)}}})}function $(t,e){return{current:e,states:F(t,e)}}function X(t,e,n,i){return t&&n.reduce(function(t,n){var r,o,a=n.assignment,s={state:i,action:n,_event:e},c={};if(H(a))c=a(t,e.data,s);else try{for(var h=u(Object.keys(a)),l=h.next();!l.done;l=h.next()){var f=l.value,d=a[f];c[f]=H(d)?d(t,e.data,s):d}}catch(t){r={error:t}}finally{try{l&&!l.done&&(o=h.return)&&o.call(h)}finally{if(r)throw r.error}}return Object.assign({},t,c)},t)}function Q(t){return Array.isArray(t)}function H(t){return"function"==typeof t}function G(t){return"string"==typeof t}function W(t,e){if(t)return G(t)?{type:j,name:t,predicate:e?e[t]:void 0}:H(t)?{type:j,name:t.name,predicate:t}:t}var K="function"==typeof Symbol&&Symbol.observable||"@@observable";function Y(t){return!!t&&"__xstatenode"in t}function Z(t,e){return G(t)||"number"==typeof t?s({type:t},e):t}function tt(t,e){if(!G(t)&&"$$type"in t&&"scxml"===t.$$type)return t;var n=Z(t);return s({name:n.type,data:n,$$type:"scxml",type:"external"},e)}function et(t,e){return q(e).map(function(e){return typeof e>"u"||"string"==typeof e||Y(e)?{target:e,event:t}:s(s({},e),{event:t})})}function nt(t,e,n,i,r){var o=t.options.guards,a={state:r,cond:e,_event:i};if(e.type===j)return((null==o?void 0:o[e.name])||e.predicate)(n,i.data,a);var s=null==o?void 0:o[e.type];if(!s)throw new Error("Guard '".concat(e.type,"' is not implemented on machine '").concat(t.id,"'."));return s(n,i.data,a)}function it(t){return"string"==typeof t?{type:t}:t}function rt(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 ot(t,e){return"".concat(t,":invocation[").concat(e,"]")}function at(t){return(t.type===p||t.type===v&&t.to===o.Internal)&&"number"!=typeof t.delay}(S={})[K]=function(){return this},S[Symbol.observable]=function(){return this};var st=tt({type:_});function ct(t,e){return e&&e[t]||void 0}function ut(t,e){var n;if(G(t)||"number"==typeof t)n=H(i=ct(t,e))?{type:t,exec:i}:i||{type:t,exec:void 0};else if(H(t))n={type:t.name||t.toString(),exec:t};else{var i;if(H(i=ct(t.type,e)))n=s(s({},t),{exec:i});else if(i){var r=i.type||t.type;n=s(s(s({},i),t),{type:r})}else n=t}return n}var ht=function(t,e){return t?(Q(t)?t:[t]).map(function(t){return ut(t,e)}):[]};function lt(t){var e=ut(t);return s(s({id:G(t)?t:e.id},e),{type:e.type})}function ft(t,e){var n="".concat(i.DoneState,".").concat(t);return{type:n,data:e,toString:function(){return n}}}function dt(t,e){var n="".concat(i.DoneInvoke,".").concat(t);return{type:n,data:e,toString:function(){return n}}}function pt(t,e){var n="".concat(i.ErrorPlatform,".").concat(t);return{type:n,data:e,toString:function(){return n}}}function vt(t,e,n,r,a,c,f){void 0===f&&(f=!1);var y=f?[]:function(t){var e,n,i=[];try{for(var r=u(t),o=r.next();!o.done;o=r.next())for(var a=o.value,s=0;s<a.actions.length;)a.actions[s].type!==m?s++:(i.push(a.actions[s]),a.actions.splice(s,1))}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}return i}(a),g=y.length?X(n,r,y,e):n,_=f?[n]:void 0,x=[];function S(a,u){var y;switch(u.type){case p:var S=function(t,e,n,i){var r,o={_event:n},a=tt(H(t.event)?t.event(e,n.data,o):t.event);if(G(t.delay)){var c=i&&i[t.delay];r=H(c)?c(e,n.data,o):c}else r=H(t.delay)?t.delay(e,n.data,o):t.delay;return s(s({},t),{type:p,_event:a,delay:r})}(u,g,r,t.options.delays);return c&&"number"==typeof S.delay&&c(S,g,r),S;case v:var w=function(t,e,n,i){var r,o={_event:n},a=tt(H(t.event)?t.event(e,n.data,o):t.event);if(G(t.delay)){var c=i&&i[t.delay];r=H(c)?c(e,n.data,o):c}else r=H(t.delay)?t.delay(e,n.data,o):t.delay;var u=H(t.to)?t.to(e,n.data,o):t.to;return s(s({},t),{to:u,_event:a,event:a.data,delay:r})}(u,g,r,t.options.delays);return c&&w.to!==o.Internal&&("entry"===a?x.push(w):c(w,g,r)),w;case b:var E=function(t,e,n){return s(s({},t),{value:G(t.expr)?t.expr:t.expr(e,n.data,{_event:n})})}(u,g,r);return null==c||c(E,g,r),E;case k:if(!(A=null===(y=u.conds.find(function(n){var i=W(n.cond,t.options.guards);return!i||nt(t,i,g,r,c?void 0:e)}))||void 0===y?void 0:y.actions))return[];var O=h(vt(t,e,g,r,[{type:a,actions:ht(B(A),t.options.actions)}],c,f),2),N=O[0],j=O[1];return g=j,null==_||_.push(g),N;case T:var A;if(!(A=u.get(g,r.data)))return[];var P=h(vt(t,e,g,r,[{type:a,actions:ht(B(A),t.options.actions)}],c,f),2),L=P[0],I=P[1];return g=I,null==_||_.push(g),L;case d:return E=function(t,e,n){var r=H(t.activity)?t.activity(e,n.data):t.activity,o="string"==typeof r?{id:r}:r;return{type:i.Stop,activity:o}}(u,g,r),null==c||c(E,n,r),E;case m:g=X(g,r,[u],c?void 0:e),null==_||_.push(g);break;default:var C=ut(u,t.options.actions),V=C.exec;if(c)c(C,g,r);else if(V&&_){var D=_.length-1,M=s(s({},C),{exec:function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];V.apply(void 0,l([_[D]],h(e),!1))}});C=M}return C}}return[z(a.map(function(t){var e,n,i=[];try{for(var o=u(t.actions),a=o.next();!a.done;a=o.next()){var s=a.value,h=S(t.type,s);h&&(i=i.concat(h))}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}return x.forEach(function(t){c(t,g,r)}),x.length=0,i})),g]}var yt=function(t,e){return e(t)};function gt(t){var e;return(e={id:t,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},getSnapshot:function(){},toJSON:function(){return{id:t}}})[K]=function(){return this},e}function mt(t,e,n){var i=gt(e);if(i.deferred=!0,Y(t)){var r=i.state=yt(void 0,function(){return(n?t.withContext(n):t).initialState});i.getSnapshot=function(){return r}}return i}var bt=function(t){return"atomic"===t.type||"final"===t.type};function _t(t){return Object.keys(t.states).map(function(e){return t.states[e]})}function xt(t){return _t(t).filter(function(t){return"history"!==t.type})}function St(t){var e=[t];return bt(t)?e:e.concat(z(xt(t).map(St)))}function wt(t,e){var n,i,r,o,a,s,c,h,l=Ot(new Set(t)),f=new Set(e);try{for(var d=u(f),p=d.next();!p.done;p=d.next())for(var v=(E=p.value).parent;v&&!f.has(v);)f.add(v),v=v.parent}catch(t){n={error:t}}finally{try{p&&!p.done&&(i=d.return)&&i.call(d)}finally{if(n)throw n.error}}var y=Ot(f);try{for(var g=u(f),m=g.next();!m.done;m=g.next())if("compound"!==(E=m.value).type||y.get(E)&&y.get(E).length){if("parallel"===E.type)try{for(var b=(a=void 0,u(xt(E))),_=b.next();!_.done;_=b.next()){var x=_.value;f.has(x)||(f.add(x),l.get(x)?l.get(x).forEach(function(t){return f.add(t)}):x.initialStateNodes.forEach(function(t){return f.add(t)}))}}catch(t){a={error:t}}finally{try{_&&!_.done&&(s=b.return)&&s.call(b)}finally{if(a)throw a.error}}}else l.get(E)?l.get(E).forEach(function(t){return f.add(t)}):E.initialStateNodes.forEach(function(t){return f.add(t)})}catch(t){r={error:t}}finally{try{m&&!m.done&&(o=g.return)&&o.call(g)}finally{if(r)throw r.error}}try{for(var S=u(f),w=S.next();!w.done;w=S.next()){var E;for(v=(E=w.value).parent;v&&!f.has(v);)f.add(v),v=v.parent}}catch(t){c={error:t}}finally{try{w&&!w.done&&(h=S.return)&&h.call(S)}finally{if(c)throw c.error}}return f}function Et(t,e){var n=e.get(t);if(!n)return{};if("compound"===t.type){var i=n[0];if(!i)return{};if(bt(i))return i.key}var r={};return n.forEach(function(t){r[t.key]=Et(t,e)}),r}function Ot(t){var e,n,i=new Map;try{for(var r=u(t),o=r.next();!o.done;o=r.next()){var a=o.value;i.has(a)||i.set(a,[]),a.parent&&(i.has(a.parent)||i.set(a.parent,[]),i.get(a.parent).push(a))}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}return i}function kt(t,e){return Et(t,Ot(wt([t],e)))}function Tt(t,e){return Array.isArray(t)?t.some(function(t){return t===e}):t instanceof Set&&t.has(e)}function Nt(t,e){return"compound"===e.type?xt(e).some(function(e){return"final"===e.type&&Tt(t,e)}):"parallel"===e.type&&xt(e).every(function(e){return Nt(t,e)})}function jt(t){return new Set(z(t.map(function(t){return t.tags})))}function At(t,e){if(t===e)return!0;if(void 0===t||void 0===e)return!1;if(G(t)||G(e))return t===e;var n=Object.keys(t),i=Object.keys(e);return n.length===i.length&&n.every(function(n){return At(t[n],e[n])})}var Pt=function(){function t(t){var e,n=this;this.actions=[],this.activities=N,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||N,this.meta=function(t){return void 0===t&&(t=[]),t.reduce(function(t,e){return void 0!==e.meta&&(t[e.id]=e.meta),t},{})}(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 function(t){return l([],h(new Set(z(l([],h(t.map(function(t){return t.ownEvents})),!1)))),!1)}(n.configuration)}})}return t.from=function(e,n){return e instanceof t?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:new t({value:e,context:n,_event:st,_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=st;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="."),G(t))return[t];var i=Object.keys(t);return i.concat.apply(i,l([],h(i.map(function(i){return n.toStrings(t[i],e).map(function(t){return i+e+t})})),!1))},t.prototype.toJSON=function(){var t=this;t.configuration,t.transitions;var e=t.tags;t.machine;var n=c(t,["configuration","transitions","tags","machine"]);return s(s({},n),{tags:Array.from(e)})},t.prototype.matches=function(t){return A(t,this.value)},t.prototype.hasTag=function(t){return this.tags.has(t)},t.prototype.can=function(t){var e;this.machine;var n=null===(e=this.machine)||void 0===e?void 0:e.getTransitionData(this,t);return!(null==n||!n.transitions.length)&&n.transitions.some(function(t){return void 0!==t.target||t.actions.length})},t}(),Lt={deferEvents:!1},It=function(){function t(t){this.processingEvent=!1,this.queue=[],this.initialized=!1,this.options=s(s({},Lt),t)}return t.prototype.initialize=function(t){if(this.initialized=!0,t){if(!this.options.deferEvents)return void this.schedule(t);this.process(t)}this.flushEvents()},t.prototype.schedule=function(t){if(this.initialized&&!this.processingEvent){if(0!==this.queue.length)throw new Error("Event queue should be empty when it is not processing events");this.process(t),this.flushEvents()}else this.queue.push(t)},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(t){throw this.clear(),t}finally{this.processingEvent=!1}},t}(),Ct=new Map,Vt=0,Dt=function(t){Ct.delete(t)};function Mt(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:void 0}var Rt,zt={sync:!1,autoForward:!1};!function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"}(Rt||(Rt={}));var qt=function(){function t(e,n){void 0===n&&(n=t.defaultOptions);var r=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=Rt.NotStarted,this.children=new Map,this.forwardTo=new Set,this._outgoingQueue=[],this.init=this.start,this.send=function(t,e){if(Q(t))return r.batch(t),r.state;var n=tt(Z(t,e));if(r.status===Rt.Stopped)return r.state;if(r.status!==Rt.Running&&!r.options.deferEvents)throw new Error('Event "'.concat(n.name,'" was sent to uninitialized service "').concat(r.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 r.scheduler.schedule(function(){r.forward(n);var t=r._nextState(n);r.update(t,n)}),r._state},this.sendTo=function(t,e,n){var i=r.parent&&(e===o.Parent||r.parent.id===e),a=i?r.parent:G(e)?e===o.Internal?r:r.children.get(e)||function(t){return Ct.get(t)}(e):function(t){return!!t&&"function"==typeof t.send}(e)?e:void 0;if(a)if("machine"in a){if(r.status!==Rt.Stopped||r.parent!==a||r.state.done){var c=s(s({},t),{name:t.name===E?"".concat(pt(r.id)):t.name,origin:r.sessionId});!n&&r.machine.config.predictableActionArguments?r._outgoingQueue.push([a,c]):a.send(c)}}else!n&&r.machine.config.predictableActionArguments?r._outgoingQueue.push([a,t.data]):a.send(t.data);else if(!i)throw new Error("Unable to send event to child '".concat(e,"' from service '").concat(r.id,"'."))},this._exec=function(t,e,n,o){void 0===o&&(o=r.machine.options.actions);var a=t.exec||ct(t.type,o),s=H(a)?a:a?a.exec:t.exec;if(s)try{return s(e,n.data,r.machine.config.predictableActionArguments?{action:t,_event:n}:{action:t,state:r.state,_event:n})}catch(t){throw r.parent&&r.parent.send({type:"xstate.error",data:t}),t}switch(t.type){case p:var c=t;r.defer(c);break;case v:var u=t;if("number"==typeof u.delay)return void r.defer(u);u.to?r.sendTo(u._event,u.to,n===st):r.send(u._event);break;case y:r.cancel(t.sendId);break;case f:if(r.status!==Rt.Running)return;var h=t.activity;if(!r.machine.config.predictableActionArguments&&!r.state.activities[h.id||h.type])break;if(h.type===i.Invoke){var l=it(h.src),g=r.machine.options.services?r.machine.options.services[l.type]:void 0,m=h.id,_=h.data,x="autoForward"in h?h.autoForward:!!h.forward;if(!g)return;var S=_?J(_,e,n):void 0;if("string"==typeof g)return;var w=H(g)?g(e,n.data,{data:S,src:l,meta:h.meta}):g;if(!w)return;var E=void 0;Y(w)&&(w=S?w.withContext(S):w,E={autoForward:x}),r.spawn(w,m,E)}else r.spawnActivity(h);break;case d:r.stopChild(t.activity.id);break;case b:var O=t,k=O.label,T=O.value;k?r.logger(k,T):r.logger(T)}};var a=s(s({},t.defaultOptions),n),c=a.clock,u=a.logger,h=a.parent,l=a.id,g=void 0!==l?l:e.id;this.id=g,this.logger=u,this.clock=c,this.parent=h,this.options=a,this.scheduler=new It({deferEvents:this.options.deferEvents}),this.sessionId="x:".concat(Vt++)}return Object.defineProperty(t.prototype,"initialState",{get:function(){var t=this;return this._initialState?this._initialState:yt(this,function(){return t._initialState=t.machine.initialState,t._initialState})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),t.prototype.execute=function(t,e){var n,i;try{for(var r=u(t.actions),o=r.next();!o.done;o=r.next()){var a=o.value;this.exec(a,t,e)}}catch(t){n={error:t}}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,s,c,h,l=this;if(t._sessionid=this.sessionId,this._state=t,this.machine.config.predictableActionArguments&&e!==st||!this.options.execute)for(var f=void 0;f=this._outgoingQueue.shift();)f[0].send(f[1]);else this.execute(this.state);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 d=u(this.eventListeners),p=d.next();!p.done;p=d.next())(0,p.value)(t.event)}catch(t){n={error:t}}finally{try{p&&!p.done&&(i=d.return)&&i.call(d)}finally{if(n)throw n.error}}try{for(var v=u(this.listeners),y=v.next();!y.done;y=v.next())(0,y.value)(t,t.event)}catch(t){r={error:t}}finally{try{y&&!y.done&&(o=v.return)&&o.call(v)}finally{if(r)throw r.error}}try{for(var g=u(this.contextListeners),m=g.next();!m.done;m=g.next())(0,m.value)(this.state.context,this.state.history?this.state.history.context:void 0)}catch(t){a={error:t}}finally{try{m&&!m.done&&(s=g.return)&&s.call(g)}finally{if(a)throw a.error}}if(this.state.done){var b=t.configuration.find(function(t){return"final"===t.type&&t.parent===l.machine}),_=b&&b.doneData?J(b.doneData,t.context,e):void 0;this._doneEvent=dt(this.id,_);try{for(var x=u(this.doneListeners),S=x.next();!S.done;S=x.next())(0,S.value)(this._doneEvent)}catch(t){c={error:t}}finally{try{S&&!S.done&&(h=x.return)&&h.call(x)}finally{if(c)throw c.error}}this._stop(),this._stopChildren(),Dt(this.sessionId)}},t.prototype.onTransition=function(t){return this.listeners.add(t),this.status===Rt.Running&&t(this.state,this.state.event),this},t.prototype.subscribe=function(t,e,n){var i=this,r=rt(t,e,n);this.listeners.add(r.next),this.status!==Rt.NotStarted&&r.next(this.state);var o=function(){i.doneListeners.delete(o),i.stopListeners.delete(o),r.complete()};return this.status===Rt.Stopped?r.complete():(this.onDone(o),this.onStop(o)),{unsubscribe:function(){i.listeners.delete(r.next),i.doneListeners.delete(o),i.stopListeners.delete(o)}}},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.status===Rt.Stopped&&this._doneEvent?t(this._doneEvent):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===Rt.Running)return this;this.machine._init(),function(t,e){Ct.set(t,e)}(this.sessionId,this),this.initialized=!0,this.status=Rt.Running;var n=void 0===t?this.initialState:yt(this,function(){return function(t){return"object"==typeof t&&null!==t&&"value"in t&&"_event"in t}(t)?e.machine.resolveState(t):e.machine.resolveState(Pt.from(t,e.machine.context))});return this.options.devTools&&this.attachDev(),this.scheduler.initialize(function(){e.update(n,st)}),this},t.prototype._stopChildren=function(){this.children.forEach(function(t){H(t.stop)&&t.stop()}),this.children.clear()},t.prototype._stop=function(){var t,e,n,i,r,o,a,s,c,h;try{for(var l=u(this.listeners),f=l.next();!f.done;f=l.next()){var d=f.value;this.listeners.delete(d)}}catch(e){t={error:e}}finally{try{f&&!f.done&&(e=l.return)&&e.call(l)}finally{if(t)throw t.error}}try{for(var p=u(this.stopListeners),v=p.next();!v.done;v=p.next())(d=v.value)(),this.stopListeners.delete(d)}catch(t){n={error:t}}finally{try{v&&!v.done&&(i=p.return)&&i.call(p)}finally{if(n)throw n.error}}try{for(var y=u(this.contextListeners),g=y.next();!g.done;g=y.next())d=g.value,this.contextListeners.delete(d)}catch(t){r={error:t}}finally{try{g&&!g.done&&(o=y.return)&&o.call(y)}finally{if(r)throw r.error}}try{for(var m=u(this.doneListeners),b=m.next();!b.done;b=m.next())d=b.value,this.doneListeners.delete(d)}catch(t){a={error:t}}finally{try{b&&!b.done&&(s=m.return)&&s.call(m)}finally{if(a)throw a.error}}if(!this.initialized)return this;this.initialized=!1,this.status=Rt.Stopped,this._initialState=void 0;try{for(var _=u(Object.keys(this.delayedEventsMap)),x=_.next();!x.done;x=_.next()){var S=x.value;this.clock.clearTimeout(this.delayedEventsMap[S])}}catch(t){c={error:t}}finally{try{x&&!x.done&&(h=_.return)&&h.call(_)}finally{if(c)throw c.error}}this.scheduler.clear(),this.scheduler=new It({deferEvents:this.options.deferEvents})},t.prototype.stop=function(){var t=this,e=this.scheduler;return this._stop(),e.schedule(function(){var e=tt({type:"xstate.stop"}),n=yt(t,function(){var n=z(l([],h(t.state.configuration),!1).sort(function(t,e){return e.order-t.order}).map(function(e){return ht(e.onExit,t.machine.options.actions)})),i=h(vt(t.machine,t.state,t.state.context,e,[{type:"exit",actions: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 Pt({value:t.state.value,context:o,_event:e,_sessionid:t.sessionId,historyValue:void 0,history:t.state,actions:r.filter(function(t){return!at(t)}),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(),Dt(t.sessionId)}),this},t.prototype.batch=function(t){var e=this;if((this.status!==Rt.NotStarted||!this.options.deferEvents)&&this.status!==Rt.Running)throw new 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=[],f=function(t){var i=tt(t);e.forward(i),o=yt(e,function(){return e.machine.transition(o,i,void 0,n||void 0)}),c.push.apply(c,l([],h(e.machine.config.predictableActionArguments?o.actions:o.actions.map(function(t){return function(t,e){var n=t.exec;return s(s({},t),{exec:void 0!==n?function(){return n(e.context,e.event,{action:t,state:e,_event:e._event})}:void 0})}(t,o)})),!1)),a=a||!!o.changed};try{for(var d=u(t),p=d.next();!p.done;p=d.next())f(p.value)}catch(t){i={error:t}}finally{try{p&&!p.done&&(r=d.return)&&r.call(d)}finally{if(i)throw i.error}}o.changed=a,o.actions=c,e.update(o,tt(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=tt(t);if(0===i.name.indexOf(w)&&!this.state.nextEvents.some(function(t){return 0===t.indexOf(w)}))throw i.data.data;return yt(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=u(this.forwardTo),r=i.next();!r.done;r=i.next()){var o=r.value,a=this.children.get(o);if(!a)throw new Error("Unable to forward event '".concat(t,"' from interpreter '").concat(this.id,"' to nonexistant child '").concat(o,"'."));a.send(t)}}catch(t){e={error:t}}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,n=this.clock.setTimeout(function(){"to"in t&&t.to?e.sendTo(t._event,t.to,!0):e.send(t._event)},t.delay);t.id&&(this.delayedEventsMap[t.id]=n)},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),H(e.stop)&&e.stop())},t.prototype.spawn=function(t,e,n){if(this.status!==Rt.Running)return mt(t,e);if(U(t))return this.spawnPromise(Promise.resolve(t),e);if(H(t))return this.spawnCallback(t,e);if(function(t){return function(t){try{return"function"==typeof t.send}catch{return!1}}(t)&&"id"in t}(t))return this.spawnActor(t,e);if(function(t){try{return"subscribe"in t&&H(t.subscribe)}catch{return!1}}(t))return this.spawnObservable(t,e);if(Y(t))return this.spawnMachine(t,s(s({},n),{id:e}));if(function(t){return null!==t&&"object"==typeof t&&"transition"in t&&"function"==typeof t.transition}(t))return this.spawnBehavior(t,e);throw new 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,s(s({},this.options),{parent:this,id:n.id||e.id})),o=s(s({},zt),n);o.sync&&r.onTransition(function(t){i.send(O,{state:t,id:r.id})});var a=r;return this.children.set(r.id,a),o.autoForward&&this.forwardTo.add(r.id),r.onDone(function(t){i.removeChild(r.id),i.send(tt(t,{origin:r.id}))}).start(),a},t.prototype.spawnBehavior=function(t,e){var n=function(t,e){void 0===e&&(e={});var n=t.initialState,i=new Set,r=[],o=!1,a=function(t){var e;return s(((e={subscribe:function(){return{unsubscribe:function(){}}},id:"anonymous",getSnapshot:function(){}})[K]=function(){return this},e),t)}({id:e.id,send:function(e){r.push(e),function(){if(!o){for(o=!0;r.length>0;){var e=r.shift();n=t.transition(n,e,c),i.forEach(function(t){return t.next(n)})}o=!1}}()},getSnapshot:function(){return n},subscribe:function(t,e,r){var o=rt(t,e,r);return i.add(o),o.next(n),{unsubscribe:function(){i.delete(o)}}}}),c={parent:e.parent,self:a,id:e.id||"anonymous",observers:i};return n=t.start?t.start(c):n,a}(t,{id:e,parent:this});return this.children.set(e,n),n},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(tt(dt(e,t),{origin:e})))},function(t){if(!o){r.removeChild(e);var n=pt(e,t);try{r.send(tt(n,{origin:e}))}catch{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=rt(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}})[K]=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(tt(t,{origin:e}))},function(t){s.add(t)})}catch(t){this.send(pt(e,t))}if(U(r))return this.spawnPromise(r,e);var u=((n={id:e,send:function(t){return s.forEach(function(e){return e(t)})},subscribe:function(t){var e=rt(t);return c.add(e.next),{unsubscribe:function(){c.delete(e.next)}}},stop:function(){a=!0,H(r)&&r()},toJSON:function(){return{id:e}},getSnapshot:function(){return i}})[K]=function(){return this},n);return this.children.set(e,u),u},t.prototype.spawnObservable=function(t,e){var n,i,r=this,o=t.subscribe(function(t){i=t,r.send(tt(t,{origin:e}))},function(t){r.removeChild(e),r.send(tt(pt(e,t),{origin:e}))},function(){r.removeChild(e),r.send(tt(dt(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}}})[K]=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){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}}})[K]=function(){return this},n))},t.prototype.attachDev=function(){var t=Mt();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(s(s({name:this.id,autoPause:!0,stateSanitizer:function(t){return{value:t.value,context:t.context,actions:t.actions}}},e),{features:s({jump:!1,skip:!1},e?e.features:void 0)}),this.machine),this.devTools.init(this.state)}!function(t){if(Mt()){var e=function(){var t=Mt();if(t&&"__xstate__"in t)return t.__xstate__}();e&&e.register(t)}}(this)}},t.prototype.toJSON=function(){return{id:this.id}},t.prototype[K]=function(){return this},t.prototype.getSnapshot=function(){return this.status===Rt.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=Bt,t}();function Bt(t,e){return new qt(t,e)}function Jt(t){return"string"==typeof t?{type:t,toString:function(){return t}}:t}function Ut(t){return s(s({type:x},t),{toJSON:function(){t.onDone,t.onError;var e=c(t,["onDone","onError"]);return s(s({},e),{type:x,src:Jt(t.src)})}})}var Ft={},$t=function(t){return"#"===t[0]},Xt=function(){function t(e,n,i,r){void 0===i&&(i="context"in e?e.context:void 0);var o,a=this;this.config=e,this._context=i,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==r?void 0:r.parent,this.key=this.config.key||(null==r?void 0:r.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:"."),this.id=this.config.id||l([this.machine.key],h(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!==(o=this.config.schema)&&void 0!==o?o:{},this.description=this.config.description,this.initial=this.config.initial,this.states=this.config.states?V(this.config.states,function(e,n){var i,r=new t(e,{},void 0,{parent:a,key:n});return Object.assign(a.idMap,s(((i={})[r.id]=r,i),r.idMap)),r}):Ft;var c=0;(function t(e){var n,i;e.order=c++;try{for(var r=u(_t(e)),o=r.next();!o.done;o=r.next())t(o.value)}catch(t){n={error:t}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}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=B(this.config.entry||this.config.onEntry).map(function(t){return ut(t)}),this.onExit=B(this.config.exit||this.config.onExit).map(function(t){return ut(t)}),this.meta=this.config.meta,this.doneData="final"===this.type?this.config.data:void 0,this.invoke=B(this.config.invoke).map(function(t,e){var n,i;if(Y(t)){var r=ot(a.id,e);return a.machine.options.services=s(((n={})[r]=t,n),a.machine.options.services),Ut({src:r,id:r})}if(G(t.src))return r=t.id||ot(a.id,e),Ut(s(s({},t),{id:r,src:t.src}));if(Y(t.src)||H(t.src))return r=t.id||ot(a.id,e),a.machine.options.services=s(((i={})[r]=t.src,i),a.machine.options.services),Ut(s(s({id:r},t),{src:r}));var o=t.src;return Ut(s(s({id:ot(a.id,e)},t),{src:o}))}),this.activities=B(this.config.activities).concat(this.invoke).map(function(t){return lt(t)}),this.transition=this.transition.bind(this),this.tags=B(this.config.tags)}return t.prototype._init=function(){this.__cache.transitions||St(this).forEach(function(t){return t.on})},t.prototype.withConfig=function(e,n){var i=this.options,r=i.actions,o=i.activities,a=i.guards,c=i.services,u=i.delays;return new t(this.config,{actions:s(s({},r),e.actions),activities:s(s({},o),e.activities),guards:s(s({},a),e.guards),services:s(s({},c),e.services),delays:s(s({},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 H(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:V(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 r=function(t,e){var n=e?"#".concat(e):"";return"".concat(i.After,"(").concat(t,")").concat(n)}(H(e)?"".concat(t.id,":delay[").concat(n,"]"):e,t.id);return t.onEntry.push(function(t,e){return{to:e?e.to:void 0,type:v,event:H(t)?t:Z(t),delay:e?e.delay:void 0,id:e&&void 0!==e.id?e.id:H(t)?t.name:P(t)}}(r,{delay:e})),t.onExit.push(function(t){return{type:y,sendId:t}}(r)),r};return(Q(e)?e.map(function(t,e){var i=n(t.delay,e);return s(s({},t),{event:i})}):z(Object.keys(e).map(function(t,i){var r=e[t],o=G(r)?{target:r}:r,a=isNaN(+t)?t:+t,c=n(a,i);return B(o).map(function(t){return s(s({},t),{event:c,delay:a})})}))).map(function(e){var n=e.delay;return s(s({},t.formatTransition(e)),{delay:n})})},t.prototype.getStateNodes=function(t){var e,n=this;if(!t)return[];var i=t instanceof Pt?t.value:I(t,this.delimiter);if(G(i)){var r=this.getStateNode(i).initial;return void 0!==r?this.getStateNodes(((e={})[i]=r,e)):[this,this.states[i]]}var o=Object.keys(i),a=[this];return a.push.apply(a,l([],h(z(o.map(function(t){return n.getStateNode(t).getStateNodes(i[t])}))),!1)),a},t.prototype.handles=function(t){var e=P(t);return this.events.includes(e)},t.prototype.resolveState=function(t){var e=t instanceof Pt?t:Pt.create(t),n=Array.from(wt([],this.getStateNodes(e.value)));return new Pt(s(s({},e),{value:this.resolve(e.value),configuration:n,done:Nt(n,this),tags:jt(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 i,r,o={};try{for(var a=u(Object.keys(t)),s=a.next();!s.done;s=a.next()){var c=s.value,h=t[c];if(h){var l=this.getStateNode(c)._transition(h,e,n);l&&(o[c]=l)}}}catch(t){i={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}var f=Object.keys(o).map(function(t){return o[t]}),d=z(f.map(function(t){return t.transitions}));if(!f.some(function(t){return t.transitions.length>0}))return this.next(e,n);var p=z(Object.keys(o).map(function(t){return o[t].configuration}));return{transitions:d,exitSet:z(f.map(function(t){return t.exitSet})),configuration:p,source:e,actions:z(Object.keys(o).map(function(t){return o[t].actions}))}},t.prototype._transition=function(t,e,n){return G(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,tt(e))},t.prototype.next=function(t,e){var n,i,r,o=this,a=e.name,s=[],c=[];try{for(var f=u(this.getCandidates(a)),d=f.next();!d.done;d=f.next()){var p=d.value,v=p.cond,y=p.in,g=t.context,m=!y||(G(y)&&$t(y)?t.matches(I(this.getStateNodeById(y).path,this.delimiter)):A(I(y,this.delimiter),M(this.path.slice(0,-2))(t.value))),b=!1;try{b=!v||nt(this.machine,v,g,e,t)}catch(t){throw new Error("Unable to evaluate guard '".concat(v.name||v.type,"' in transition for event '").concat(a,"' in state node '").concat(this.id,"':\n").concat(t.message))}if(b&&m){void 0!==p.target&&(c=p.target),s.push.apply(s,l([],h(p.actions),!1)),r=p;break}}}catch(t){n={error:t}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(n)throw n.error}}if(r){if(!c.length)return{transitions:[r],exitSet:[],configuration:t.value?[this]:[],source:t,actions:s};var _=z(c.map(function(e){return o.getRelativeStateNodes(e,t.historyValue)}));return{transitions:[r],exitSet:r.internal?[]:z(c.map(function(t){return o.getPotentiallyReenteringNodes(t)})),configuration:_,source:t,actions:s}}},t.prototype.getPotentiallyReenteringNodes=function(t){if(this.order<t.order)return[this];for(var e=[],n=this,i=t;n&&n!==i;)e.push(n),n=n.parent;return n!==i?[]:(e.push(i),e)},t.prototype.getActions=function(t,e,n,r,o,a,s){var c,f,d,v,y=this,g=a?wt([],this.getStateNodes(a.value)):[],m=new Set;try{for(var b=u(Array.from(t).sort(function(t,e){return t.order-e.order})),_=b.next();!_.done;_=b.next())(!Tt(g,w=_.value)||Tt(n.exitSet,w)||w.parent&&m.has(w.parent))&&m.add(w)}catch(t){c={error:t}}finally{try{_&&!_.done&&(f=b.return)&&f.call(b)}finally{if(c)throw c.error}}try{for(var x=u(g),S=x.next();!S.done;S=x.next()){var w;(!Tt(t,w=S.value)||Tt(n.exitSet,w.parent))&&n.exitSet.push(w)}}catch(t){d={error:t}}finally{try{S&&!S.done&&(v=x.return)&&v.call(x)}finally{if(d)throw d.error}}n.exitSet.sort(function(t,e){return e.order-t.order});var E=Array.from(m).sort(function(t,e){return t.order-e.order}),O=new Set(n.exitSet),k=z(E.map(function(t){var e=[];if("final"!==t.type)return e;var i=t.parent;if(!i.parent)return e;e.push(ft(t.id,t.doneData),ft(i.id,t.doneData?J(t.doneData,r,o):void 0));var a=i.parent;return"parallel"===a.type&&xt(a).every(function(t){return Nt(n.configuration,t)})&&e.push(ft(a.id)),e})),T=E.map(function(t){var e=t.onEntry,n=t.activities.map(function(t){return function(t){var e=lt(t);return{type:i.Start,activity:e,exec:void 0}}(t)});return{type:"entry",actions:ht(s?l(l([],h(e),!1),h(n),!1):l(l([],h(n),!1),h(e),!1),y.machine.options.actions)}}).concat({type:"state_done",actions:k.map(function(t){return function(t){return{type:p,event:"function"==typeof t?t:Z(t),delay:void 0,id:void 0}}(t)})}),N=Array.from(O).map(function(t){return{type:"exit",actions:ht(l(l([],h(t.onExit),!1),h(t.activities.map(function(t){return function(t){var e=H(t)?t:lt(t);return{type:i.Stop,activity:e,exec:void 0}}(t)})),!1),y.machine.options.actions)}}),j=N.concat({type:"transition",actions:ht(n.actions,this.machine.options.actions)}).concat(T);if(e){var A=ht(z(l([],h(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!at(t)});return j.concat({type:"stop",actions:A})}return j},t.prototype.transition=function(t,e,n,i){void 0===t&&(t=this.initialState);var r,o=tt(e);if(t instanceof Pt)r=void 0===n?t:this.resolveState(Pt.from(t,n));else{var a=G(t)?this.resolve(C(this.getResolvedPath(t))):this.resolve(t),s=null!=n?n:this.machine.context;r=this.resolveState(Pt.from(a,s))}if(this.strict&&!this.events.includes(o.name)&&!function(t){return/^(done|error)\./.test(t)}(o.name))throw new Error("Machine '".concat(this.id,"' does not accept event '").concat(o.name,"'"));var c=this._transition(r.value,r,o)||{transitions:[],configuration:[],exitSet:[],source:r,actions:[]},u=wt([],this.getStateNodes(r.value)),f=c.configuration.length?wt(u,c.configuration):u;return c.configuration=l([],h(f),!1),this.resolveTransition(c,r,r.context,i,o)},t.prototype.resolveRaisedTransition=function(t,e,n,i){var r,o=t.actions;return(t=this.transition(t,e,void 0,i))._event=n,t.event=n.data,(r=t.actions).unshift.apply(r,l([],h(o),!1)),t},t.prototype.resolveTransition=function(t,e,n,i,r){var o,a,c,l,p=this;void 0===r&&(r=st);var v=t.configuration,y=!e||t.transitions.length>0,m=y?t.configuration:e?e.configuration:[],b=Nt(m,this),_=y?kt(this.machine,v):void 0,S=e?e.historyValue?e.historyValue:t.source?this.machine.historyValue(e.value):void 0:void 0,w=this.getActions(new Set(m),b,t,n,r,e,i),E=e?s({},e.activities):{};try{for(var k=u(w),T=k.next();!T.done;T=k.next()){var N=T.value;try{for(var j=(c=void 0,u(N.actions)),A=j.next();!A.done;A=j.next()){var P=A.value;P.type===f?E[P.activity.id||P.activity.type]=P:P.type===d&&(E[P.activity.id||P.activity.type]=!1)}}catch(t){c={error:t}}finally{try{A&&!A.done&&(l=j.return)&&l.call(j)}finally{if(c)throw c.error}}}}catch(t){o={error:t}}finally{try{T&&!T.done&&(a=k.return)&&a.call(k)}finally{if(o)throw o.error}}var L=h(vt(this,e,n,r,w,i,this.machine.config.predictableActionArguments||this.machine.config.preserveActionOrder),2),I=L[0],C=L[1],V=h(function(t,e){var n,i,r=h([[],[]],2),o=r[0],a=r[1];try{for(var s=u(t),c=s.next();!c.done;c=s.next()){var l=c.value;e(l)?o.push(l):a.push(l)}}catch(t){n={error:t}}finally{try{c&&!c.done&&(i=s.return)&&i.call(s)}finally{if(n)throw n.error}}return[o,a]}(I,at),2),D=V[0],M=V[1],R=I.filter(function(t){var e;return t.type===f&&(null===(e=t.activity)||void 0===e?void 0:e.type)===x}).reduce(function(t,e){return t[e.activity.id]=function(t,e,n,i){var r,o=it(t.src),a=null===(r=null==e?void 0:e.options.services)||void 0===r?void 0:r[o.type],s=t.data?J(t.data,n,i):void 0,c=a?mt(a,t.id,s):gt(t.id);return c.meta=t,c}(e.activity,p.machine,C,r),t},e?s({},e.children):{}),z=new Pt({value:_||e.value,context:C,_event:r,_sessionid:e?e._sessionid:null,historyValue:_?S?$(S,_):void 0:e?e.historyValue:void 0,history:!_||t.source?e:void 0,actions:_?M:[],activities:_?E:e?e.activities:{},events:[],configuration:m,transitions:t.transitions,children:R,done:b,tags:jt(m),machine:this}),q=n!==C;z.changed=r.name===O||q;var B=z.history;B&&delete B.history;var U=!b&&(this._transient||v.some(function(t){return t._transient}));if(!(y||U&&""!==r.name))return z;var F=z;if(!b)for(U&&(F=this.resolveRaisedTransition(F,{type:g},r,i));D.length;){var X=D.shift();F=this.resolveRaisedTransition(F,X._event,r,i)}var Q=F.changed||(B?!!F.actions.length||q||typeof B.value!=typeof F.value||!At(F.value,B.value):void 0);return F.changed=Q,F.history=B,F},t.prototype.getStateNode=function(t){if($t(t))return this.machine.getStateNodeById(t);if(!this.states)throw new Error("Unable to retrieve child state '".concat(t,"' from '").concat(this.id,"'; no child states exist."));var e=this.states[t];if(!e)throw new Error("Child state '".concat(t,"' does not exist on '").concat(this.id,"'"));return e},t.prototype.getStateNodeById=function(t){var e=$t(t)?t.slice(1):t;if(e===this.id)return this;var n=this.machine.idMap[e];if(!n)throw new 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&&$t(t))try{return this.getStateNodeById(t.slice(1))}catch{}for(var e=L(t,this.delimiter).slice(),n=this;e.length;){var i=e.shift();if(!i.length)break;n=n.getStateNode(i)}return n},t.prototype.resolve=function(t){var e,n=this;if(!t)return this.initialStateValue||Ft;switch(this.type){case"parallel":return V(this.initialStateValue,function(e,i){return e?n.getStateNode(i).resolve(t[i]||e):Ft});case"compound":if(G(t)){var i=this.getStateNode(t);return"parallel"===i.type||"compound"===i.type?((e={})[t]=i.initialStateValue,e):t}return Object.keys(t).length?V(t,function(t,e){return t?n.getStateNode(e).resolve(t):Ft}):this.initialStateValue||{};default:return t||Ft}},t.prototype.getResolvedPath=function(t){if($t(t)){var e=this.machine.idMap[t.slice(1)];if(!e)throw new Error("Unable to find state node '".concat(t,"'"));return e.path}return L(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=D(this.states,function(t){return t.initialStateValue||Ft},function(t){return"history"!==t.type});else if(void 0!==this.initial){if(!this.states[this.initial])throw new Error("Initial state '".concat(this.initial,"' not found on '").concat(this.key,"'"));e=bt(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 new 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=G(e.target)&&$t(e.target)?C(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;return bt(this)?[this]:"compound"!==this.type||this.initial?z(R(this.initialStateValue).map(function(e){return t.getFromRelativePath(e)})):[this]},enumerable:!1,configurable:!0}),t.prototype.getFromRelativePath=function(t){if(!t.length)return[this];var e=h(t),n=e[0],i=e.slice(1);if(!this.states)throw new Error("Cannot retrieve subPath '".concat(n,"' from node with no states"));var r=this.getStateNode(n);if("history"===r.type)return r.resolveHistory();if(!this.states[n])throw new Error("Child state '".concat(n,"' does not exist on '").concat(this.id,"'"));return this.states[n].getFromRelativePath(i)},t.prototype.historyValue=function(t){if(Object.keys(this.states).length)return{current:t||this.initialStateValue,states:D(this.states,function(e,n){if(!t)return e.historyValue();var i=G(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?z(R(i).map(function(t){return n.getFromRelativePath(t)})):n.initialStateNodes}var r=function(t){return function(e){var n,i,r=e;try{for(var o=u(t),a=o.next();!a.done;a=o.next()){var s=a.value;r=r.states[s]}}catch(t){n={error:t}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return r}}(n.path)(t).current;return G(r)?[n.getStateNode(r)]:z(R(r).map(function(t){return"deep"===e.history?n.getFromRelativePath(t):[n.states[t[0]]]}))},Object.defineProperty(t.prototype,"stateIds",{get:function(){var t=this,e=z(Object.keys(this.states).map(function(e){return t.states[e].stateIds}));return[this.id].concat(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"events",{get:function(){var t,e,n,i;if(this.__cache.events)return this.__cache.events;var r=this.states,o=new Set(this.ownEvents);if(r)try{for(var a=u(Object.keys(r)),s=a.next();!s.done;s=a.next()){var c=r[s.value];if(c.states)try{for(var h=(n=void 0,u(c.events)),l=h.next();!l.done;l=h.next()){var f=l.value;o.add("".concat(f))}}catch(t){n={error:t}}finally{try{l&&!l.done&&(i=h.return)&&i.call(h)}finally{if(n)throw n.error}}}}catch(e){t={error:e}}finally{try{s&&!s.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}return this.__cache.events=Array.from(o)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ownEvents",{get:function(){var t=new Set(this.transitions.filter(function(t){return!(!t.target&&!t.actions.length&&t.internal)}).map(function(t){return t.eventType}));return Array.from(t)},enumerable:!1,configurable:!0}),t.prototype.resolveTarget=function(t){var e=this;if(void 0!==t)return t.map(function(t){if(!G(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(t){throw new Error("Invalid transition definition for state node '".concat(e.id,"':\n").concat(t.message))}})},t.prototype.formatTransition=function(t){var e=this,n=function(t){if(void 0!==t&&""!==t)return B(t)}(t.target),i="internal"in t?t.internal:!n||n.some(function(t){return G(t)&&t[0]===e.delimiter}),r=this.machine.options.guards,o=this.resolveTarget(n),a=s(s({},t),{actions:ht(B(t.actions)),cond:W(t.cond,r),target:o,source:this,internal:i,eventType:t.event,toJSON:function(){return s(s({},a),{target:a.target?a.target.map(function(t){return"#".concat(t.id)}):void 0,source:"#".concat(e.id)})}});return a},t.prototype.formatTransitions=function(){var t,e,n,i=this;if(this.config.on)if(Array.isArray(this.config.on))n=this.config.on;else{var r=this.config.on,o=r["*"],a=void 0===o?[]:o,s=c(r,["*"]);n=z(Object.keys(s).map(function(t){return et(t,s[t])}).concat(et("*",a)))}else n=[];var f=this.config.always?et("",this.config.always):[],d=this.config.onDone?et(String(ft(this.id)),this.config.onDone):[],p=z(this.invoke.map(function(t){var e=[];return t.onDone&&e.push.apply(e,l([],h(et(String(dt(t.id)),t.onDone)),!1)),t.onError&&e.push.apply(e,l([],h(et(String(pt(t.id)),t.onError)),!1)),e})),v=this.after,y=z(l(l(l(l([],h(d),!1),h(p),!1),h(n),!1),h(f),!1).map(function(t){return B(t).map(function(t){return i.formatTransition(t)})}));try{for(var g=u(v),m=g.next();!m.done;m=g.next()){var b=m.value;y.push(b)}}catch(e){t={error:e}}finally{try{m&&!m.done&&(e=g.return)&&e.call(g)}finally{if(t)throw t.error}}return y},t}(),Qt={click:"onClick",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",complete:"onComplete",after:"onAfter",enter:"onEnter",show:"onShow"};Object.values(Qt);var Ht=Object.keys(Qt),Gt=class{activeStateId="";_service;_domListeners=new Map;_domElement;_playerListeners=new Map;_player;_machineSchemas=new Map;_onShowPrevValue=0;constructor(t,e){this._player=e,this._machineSchemas=this._transformToXStateSchema(t),this._domElement=e.container}start(t){this.stop();let e=this._machineSchemas.get(t);if(typeof e>"u")throw(0,a.a)(`invalid state machine id ${t}`);this._service=Bt(function(t){return new Xt(t,void 0)}(e)),this._addEventListeners(),this._service.start()}stop(){var t;this._removeEventListeners(),null==(t=this._service)||t.stop(),this._player.stop()}_removeEventListeners(){var t;this._requiresDomElement();for(let[e,n]of this._domListeners)"visibilityChange"===e&&this._player.stopPlayOnShow(),null==(t=this._domElement)||t.removeEventListener(e,n),this._domListeners.delete(e);for(let[t,e]of this._playerListeners)this._player.removeEventListener(t,e),this._playerListeners.delete(t)}_addEventListeners(){this._requiresDomElement();let t=t=>{this._service.send({type:t})},e=e=>function(){t(e)};this._service.subscribe(t=>{var n;if(typeof t.changed>"u"||t.changed){this._removeEventListeners();for(let i of t.nextEvents)if(Ht.filter(t=>"complete"!==t&&"show"!==t).includes(i)){let t=e(i);this._domListeners.set(i,t),null==(n=this._domElement)||n.addEventListener(i,t,{once:!0})}else if("complete"===i){let t=e(i);this._player.addEventListener(i,t),this._playerListeners.set(i,t)}else if("show"===i){let t=e(i);this._player.addIntersectionObserver({callbackOnIntersect:e=>{e>0&&(100!==e&&this._onShowPrevValue!==e&&t(),this._onShowPrevValue=e)},threshold:[]}),this._domListeners.set("visibilityChange",t)}}})}subscribe(t){throw(0,a.a)(t.toString())}_transformToXStateSchema(t){var e,n,i;let r=new Map;for(let o of t){let t={},s={};if(s.id=o.descriptor.id,typeof o.descriptor.initial<"u"&&(s.initial=o.descriptor.initial),typeof o<"u"){let r=o.states;for(let o in r)if(typeof r[o]<"u"&&r[o]){let s=r[o],c=s.playbackSettings,u=Object.keys(s).filter(t=>t.startsWith("on")),h={},l={};for(let t of u)if(typeof s[t]<"u"){let r=s[t];t===Qt.after?l[r.ms]={target:null!=(e=null==r?void 0:r.state)?e:""}:h[(0,a.d)(Qt,t)]=t===Qt.enter?{target:null!=(n=null==r?void 0:r.state)?n:""}:{target:null!=(i=null==r?void 0:r.state)?i:""}}t[o]={entry:()=>{!this._player.getAnimationInstance()||s.animationId&&s.animationId!==this._player.currentAnimationId?this._player.play(s.animationId,()=>({...a.h,...c})).then(()=>{this._updatePlaybackSettings(c)}).catch(t=>{(0,a.b)(`State machine error: ${t.message}`)}):this._updatePlaybackSettings(c)},exit:()=>{typeof c.segments<"u"&&this._player.resetSegments(!1),typeof c.playOnScroll<"u"&&this._player.stopPlayOnScroll()},on:h,after:l,meta:c}}}s.states=t,r.set(s.id,s)}return r}_handlePlaySegments(t){if("string"==typeof t.segments)this._player.goToAndPlay(t.segments,!0);else{let[e,n]=t.segments,i=e;0!==e&&e===n&&(i=e-1),0===e&&e===n?this._player.goToAndPlay(e,!0):this._player.playSegments([i,n],!0)}}_handlePlayOnScroll(t){let e=t.playOnScroll;if(t.segments&&"string"!=typeof t.segments){let n=t.segments;this._player.playOnScroll({threshold:e,segments:n})}else this._player.playOnScroll({threshold:e})}_updatePlaybackSettings(t){if(!this._player.getAnimationInstance())throw new Error("Unable to update playbackSettings. Animations is not rendered yet.");typeof t.autoplay<"u"&&(this._player.setAutoplay(t.autoplay),t.autoplay?this._player.play():this._player.pause()),typeof t.direction<"u"&&this._player.setDirection(t.direction),typeof t.intermission<"u"&&this._player.setIntermission(t.intermission),typeof t.loop<"u"&&this._player.setLoop(t.loop),typeof t.playMode<"u"&&this._player.setMode(t.playMode),typeof t.speed<"u"&&this._player.setSpeed(t.speed),typeof t.defaultTheme<"u"&&this._player.setDefaultTheme(t.defaultTheme),typeof t.playOnScroll<"u"&&this._handlePlayOnScroll(t),t.segments&&this._handlePlaySegments(t),t.autoplay||this._player.pause()}_requiresDomElement(){if(!this._domElement)throw(0,a.a)("Requires a DOM element to attach events.")}}}}]);
| ver. 1.4 |
Github
|
.
| PHP 8.1.32 | Генераци� �траницы: 0 |
proxy
|
phpinfo
|
�а�тройка