@foxy.io/elements 1.11.0-beta.3 → 1.11.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/foxy-access-recovery-form.js +1 -1
- package/dist/cdn/foxy-address-card.js +2 -2
- package/dist/cdn/foxy-address-form.js +1 -1
- package/dist/cdn/foxy-attribute-card.js +1 -1
- package/dist/cdn/foxy-attribute-form.js +1 -1
- package/dist/cdn/foxy-cancellation-form.js +1 -1
- package/dist/cdn/foxy-collection-page.js +1 -1
- package/dist/cdn/foxy-collection-pages.js +1 -1
- package/dist/cdn/foxy-custom-field-form.js +1 -0
- package/dist/cdn/foxy-customer-api.js +1 -1
- package/dist/cdn/foxy-customer-form.js +1 -1
- package/dist/cdn/foxy-customer-portal-settings.js +1 -1
- package/dist/cdn/foxy-customer-portal.js +2 -2
- package/dist/cdn/foxy-customer.js +1 -1
- package/dist/cdn/foxy-customers-table.js +1 -1
- package/dist/cdn/foxy-donation.js +1 -1
- package/dist/cdn/foxy-error-entry-card.js +1 -1
- package/dist/cdn/foxy-form-dialog.js +1 -1
- package/dist/cdn/foxy-i18n.js +1 -1
- package/dist/cdn/foxy-items-form.js +1 -1
- package/dist/cdn/foxy-nucleon-element.js +1 -1
- package/dist/cdn/foxy-payment-method-card.js +1 -1
- package/dist/cdn/foxy-sign-in-form.js +1 -230
- package/dist/cdn/foxy-spinner.js +1 -1
- package/dist/cdn/foxy-subscription-card.js +1 -1
- package/dist/cdn/foxy-subscription-form.js +2 -2
- package/dist/cdn/foxy-subscriptions-table.js +1 -1
- package/dist/cdn/foxy-table.js +1 -1
- package/dist/cdn/foxy-transactions-table.js +1 -1
- package/dist/cdn/foxy-user-form.js +1 -1
- package/dist/cdn/foxy-users-table.js +1 -1
- package/dist/cdn/{shared-bf28ab5e.js → shared-005e1fc5.js} +1 -1
- package/dist/cdn/{shared-84203d52.js → shared-00811efe.js} +1 -1
- package/dist/cdn/{shared-333c169c.js → shared-07867126.js} +1 -1
- package/dist/cdn/{shared-c70d9713.js → shared-09384e52.js} +1 -1
- package/dist/cdn/{shared-f01a1892.js → shared-1d138c7a.js} +1 -1
- package/dist/cdn/{shared-1a1aa39f.js → shared-2864fa12.js} +1 -1
- package/dist/cdn/{shared-525dd8c8.js → shared-420ef4a6.js} +1 -1
- package/dist/cdn/{shared-a7709d26.js → shared-423c0fb8.js} +1 -1
- package/dist/cdn/{shared-e058cb87.js → shared-50ff98d4.js} +1 -1
- package/dist/cdn/{shared-96de56d4.js → shared-524b3c41.js} +1 -1
- package/dist/cdn/{shared-bba615b8.js → shared-52d3b939.js} +19 -19
- package/dist/cdn/{shared-497fd63c.js → shared-670c194c.js} +1 -1
- package/dist/cdn/shared-7bc6d89f.js +1 -0
- package/dist/cdn/{shared-8057ee9c.js → shared-8dd2593f.js} +1 -1
- package/dist/cdn/{shared-17322a2a.js → shared-93df17fe.js} +5 -5
- package/dist/cdn/shared-957a60e1.js +1 -0
- package/dist/cdn/shared-96fcd96f.js +1 -0
- package/dist/cdn/{shared-9f78e096.js → shared-a4e05ba4.js} +1 -1
- package/dist/cdn/{shared-aac9fed8.js → shared-a6f0d39f.js} +1 -1
- package/dist/cdn/shared-b76c5f57.js +15 -0
- package/dist/cdn/{shared-23966eed.js → shared-c9e0b693.js} +1 -1
- package/dist/cdn/{shared-851b97ef.js → shared-d8160231.js} +1 -1
- package/dist/cdn/shared-dc5928e9.js +1 -0
- package/dist/cdn/{shared-a5fbfdc7.js → shared-e5ab982d.js} +1 -1
- package/dist/cdn/shared-f4119f12.js +230 -0
- package/dist/cdn/{shared-090432b4.js → shared-f62abcd5.js} +1 -1
- package/dist/cdn/{shared-bc29ada7.js → shared-f866a93f.js} +1 -1
- package/dist/cdn/{shared-f06d08d5.js → shared-fd05e1a1.js} +1 -1
- package/dist/cdn/translations/shared/de.json +1 -0
- package/dist/cdn/translations/shared/en.json +1 -0
- package/dist/cdn/translations/shared/es.json +1 -0
- package/dist/elements/public/CollectionPage/CollectionPage.d.ts +2 -0
- package/dist/elements/public/CollectionPage/CollectionPage.js +7 -0
- package/dist/elements/public/CollectionPage/CollectionPage.js.map +1 -1
- package/dist/elements/public/CollectionPage/types.d.ts +3 -0
- package/dist/elements/public/CollectionPage/types.js.map +1 -1
- package/dist/elements/public/CollectionPages/CollectionPages.d.ts +2 -0
- package/dist/elements/public/CollectionPages/CollectionPages.js +7 -0
- package/dist/elements/public/CollectionPages/CollectionPages.js.map +1 -1
- package/dist/elements/public/CollectionPages/types.d.ts +3 -0
- package/dist/elements/public/CollectionPages/types.js.map +1 -1
- package/dist/elements/public/CustomFieldForm/CustomFieldForm.d.ts +49 -0
- package/dist/elements/public/CustomFieldForm/CustomFieldForm.js +235 -0
- package/dist/elements/public/CustomFieldForm/CustomFieldForm.js.map +1 -0
- package/dist/elements/public/CustomFieldForm/index.d.ts +9 -0
- package/dist/elements/public/CustomFieldForm/index.js +11 -0
- package/dist/elements/public/CustomFieldForm/index.js.map +1 -0
- package/dist/elements/public/CustomFieldForm/types.d.ts +22 -0
- package/dist/elements/public/CustomFieldForm/types.js +2 -0
- package/dist/elements/public/CustomFieldForm/types.js.map +1 -0
- package/dist/elements/public/NucleonElement/NucleonElement.d.ts +8 -0
- package/dist/elements/public/NucleonElement/NucleonElement.js +40 -6
- package/dist/elements/public/NucleonElement/NucleonElement.js.map +1 -1
- package/dist/elements/public/index.d.ts +1 -0
- package/dist/elements/public/index.defined.d.ts +1 -0
- package/dist/elements/public/index.defined.js +1 -0
- package/dist/elements/public/index.defined.js.map +1 -1
- package/dist/elements/public/index.js +1 -0
- package/dist/elements/public/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/cdn/shared-306080cb.js +0 -1
- package/dist/cdn/shared-361d5d17.js +0 -15
- package/dist/cdn/shared-6872bf5c.js +0 -1
- package/dist/cdn/shared-69d0ca61.js +0 -1
|
@@ -170,4 +170,4 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
170
170
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
171
171
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
172
172
|
PERFORMANCE OF THIS SOFTWARE.
|
|
173
|
-
***************************************************************************** */function yt(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}function vt(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function gt(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function _t(t,e){for(var n=0,r=e.length,i=t.length;n<r;n++,i++)t[i]=e[n];return t}var mt={};function bt(t){return Object.keys(t)}function wt(t,e,n){void 0===n&&(n=".");var r=Ot(t,n),i=Ot(e,n);return Ft(i)?!!Ft(r)&&i===r:Ft(r)?r in i:bt(r).every((function(t){return t in i&&wt(r[t],i[t])}))}function St(t){try{return Ft(t)||"number"==typeof t?""+t:t.type}catch(t){throw new Error("Events must be strings or objects with a string event.type property.")}}function xt(t,e){try{return Vt(t)?t:t.toString().split(e)}catch(e){throw new Error("'"+t+"' is not a valid state path.")}}function Ot(t,e){return"object"==typeof(n=t)&&"value"in n&&"context"in n&&"event"in n&&"_event"in n?t.value:Vt(t)?jt(t):"string"!=typeof t?t:jt(xt(t,e));var n}function jt(t){if(1===t.length)return t[0];for(var e={},n=e,r=0;r<t.length-1;r++)r===t.length-2?n[t[r]]=t[r+1]:(n[t[r]]={},n=n[t[r]]);return e}function Et(t,e){for(var n={},r=bt(t),i=0;i<r.length;i++){var o=r[i];n[o]=e(t[o],o,t,i)}return n}function Pt(t,e,n){var r,i,o={};try{for(var s=vt(bt(t)),a=s.next();!a.done;a=s.next()){var c=a.value,u=t[c];n(u)&&(o[c]=e(u,c,t))}}catch(t){r={error:t}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return o}var At=function(t){return function(e){var n,r,i=e;try{for(var o=vt(t),s=o.next();!s.done;s=o.next()){i=i[s.value]}}catch(t){n={error:t}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i}};function kt(t){return t?Ft(t)?[[t]]:Tt(bt(t).map((function(e){var n=t[e];return"string"==typeof n||n&&Object.keys(n).length?kt(t[e]).map((function(t){return[e].concat(t)})):[[e]]}))):[[]]}function Tt(t){var e;return(e=[]).concat.apply(e,_t([],gt(t)))}function Nt(t){return Vt(t)?t:[t]}function Ct(t){return void 0===t?[]:Nt(t)}function Rt(t,e,n){var r,i;if(Mt(t))return t(e,n.data);var o={};try{for(var s=vt(Object.keys(t)),a=s.next();!a.done;a=s.next()){var c=a.value,u=t[c];Mt(u)?o[c]=u(e,n.data):o[c]=u}}catch(t){r={error:t}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return o}function Dt(t){return t instanceof Promise||!(null===t||!Mt(t)&&"object"!=typeof t||!Mt(t.then))}function Ut(t){return null!==t&&"object"==typeof t&&"transition"in t&&"function"==typeof t.transition}function It(t,e){var n,r,i=gt([[],[]],2),o=i[0],s=i[1];try{for(var a=vt(t),c=a.next();!c.done;c=a.next()){var u=c.value;e(u)?o.push(u):s.push(u)}}catch(t){n={error:t}}finally{try{c&&!c.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return[o,s]}function Lt(t,e){return Et(t.states,(function(t,n){if(t){var r=(Ft(e)?void 0:e[n])||(t?t.current:void 0);if(r)return{current:r,states:Lt(t,r)}}}))}function Vt(t){return Array.isArray(t)}function Mt(t){return"function"==typeof t}function Ft(t){return"string"==typeof t}function $t(t,e){if(t)return Ft(t)?{type:"xstate.guard",name:t,predicate:e?e[t]:void 0}:Mt(t)?{type:"xstate.guard",name:t.name,predicate:t}:t}function Bt(t){try{return"subscribe"in t&&Mt(t.subscribe)}catch(t){return!1}}var zt,qt,Wt=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}();function Ht(t){try{return"__xstatenode"in t}catch(t){return!1}}function Jt(t){return!!t&&"function"==typeof t.send}function Gt(t,e){return Ft(t)||"number"==typeof t?dt({type:t},e):t}function Kt(t,e){if(!Ft(t)&&"$$type"in t&&"scxml"===t.$$type)return t;var n=Gt(t);return dt({name:n.type,data:n,$$type:"scxml",type:"external"},e)}function Zt(t,e){return Nt(e).map((function(e){return void 0===e||"string"==typeof e||Ht(e)?{target:e,event:t}:dt(dt({},e),{event:t})}))}function Qt(t,e,n,r,i){var o=t.options.guards,s={state:i,cond:e,_event:r};if("xstate.guard"===e.type)return e.predicate(n,r.data,s);var a=o[e.type];if(!a)throw new Error("Guard '"+e.type+"' is not implemented on machine '"+t.id+"'.");return a(n,r.data,s)}function Xt(t){return"string"==typeof t?{type:t}:t}function Yt(t,e,n){if("object"==typeof t)return t;var r=function(){};return{next:t,error:e||r,complete:n||r}}!function(t){t.Start="xstate.start",t.Stop="xstate.stop",t.Raise="xstate.raise",t.Send="xstate.send",t.Cancel="xstate.cancel",t.NullEvent="",t.Assign="xstate.assign",t.After="xstate.after",t.DoneState="done.state",t.DoneInvoke="done.invoke",t.Log="xstate.log",t.Init="xstate.init",t.Invoke="xstate.invoke",t.ErrorExecution="error.execution",t.ErrorCommunication="error.communication",t.ErrorPlatform="error.platform",t.ErrorCustom="xstate.error",t.Update="xstate.update",t.Pure="xstate.pure",t.Choose="xstate.choose"}(zt||(zt={})),function(t){t.Parent="#_parent",t.Internal="#_internal"}(qt||(qt={}));var te=zt.Start,ee=zt.Stop,ne=zt.Raise,re=zt.Send,ie=zt.Cancel,oe=zt.NullEvent,se=zt.Assign;zt.After,zt.DoneState;var ae=zt.Log,ce=zt.Init,ue=zt.Invoke;zt.ErrorExecution;var le=zt.ErrorPlatform,he=zt.ErrorCustom,fe=zt.Update,pe=zt.Choose,de=zt.Pure,ye=Kt({type:ce});function ve(t,e){return e&&e[t]||void 0}function ge(t,e){var n;if(Ft(t)||"number"==typeof t){var r=ve(t,e);n=Mt(r)?{type:t,exec:r}:r||{type:t,exec:void 0}}else if(Mt(t))n={type:t.name||t.toString(),exec:t};else{if(Mt(r=ve(t.type,e)))n=dt(dt({},t),{exec:r});else if(r){var i=r.type||t.type;n=dt(dt(dt({},r),t),{type:i})}else n=t}return Object.defineProperty(n,"toString",{value:function(){return n.type},enumerable:!1,configurable:!0}),n}var _e=function(t,e){return t?(Vt(t)?t:[t]).map((function(t){return ge(t,e)})):[]};function me(t){var e=ge(t);return dt(dt({id:Ft(t)?t:e.id},e),{type:e.type})}function be(t){return Ft(t)?{type:ne,event:t}:we(t,{to:qt.Internal})}function we(t,e){return{to:e?e.to:void 0,type:re,event:Mt(t)?t:Gt(t),delay:e?e.delay:void 0,id:e&&void 0!==e.id?e.id:Mt(t)?t.name:St(t)}}function Se(t,e){return we(t,dt(dt({},e),{to:qt.Parent}))}function xe(){return Se(fe)}function Oe(t,e){return we(t,dt(dt({},e),{to:function(t,e,n){return n._event.origin}}))}var je=function(t,e){return{context:t,event:e}};function Ee(t,e){return void 0===t&&(t=je),{type:ae,label:e,expr:t}}var Pe=function(t){return{type:ie,sendId:t}};function Ae(t){var e=me(t);return{type:zt.Start,activity:e,exec:void 0}}function ke(t){var e=Mt(t)?t:me(t);return{type:zt.Stop,activity:e,exec:void 0}}var Te=function(t){return{type:se,assignment:t}};function Ne(t,e){var n=e?"#"+e:"";return zt.After+"("+t+")"+n}function Ce(t,e){var n=zt.DoneState+"."+t,r={type:n,data:e,toString:function(){return n}};return r}function Re(t,e){var n=zt.DoneInvoke+"."+t,r={type:n,data:e,toString:function(){return n}};return r}function De(t,e){var n=zt.ErrorPlatform+"."+t,r={type:n,data:e,toString:function(){return n}};return r}function Ue(t){return{type:zt.Pure,get:t}}function Ie(t,e){return we((function(t,e){return e}),dt(dt({},e),{to:t}))}function Le(t,e){return Se((function(e,n,r){return{type:he,data:Mt(t)?t(e,n,r):t}}),dt(dt({},e),{to:qt.Parent}))}function Ve(t){return{type:zt.Choose,conds:t}}function Me(t,e,n,r,i){var o=gt(It(i,(function(t){return t.type===se})),2),s=o[0],a=o[1],c=s.length?function(t,e,n,r){return t?n.reduce((function(t,n){var i,o,s=n.assignment,a={state:r,action:n,_event:e},c={};if(Mt(s))c=s(t,e.data,a);else try{for(var u=vt(bt(s)),l=u.next();!l.done;l=u.next()){var h=l.value,f=s[h];c[h]=Mt(f)?f(t,e.data,a):f}}catch(t){i={error:t}}finally{try{l&&!l.done&&(o=u.return)&&o.call(u)}finally{if(i)throw i.error}}return Object.assign({},t,c)}),t):t}(n,r,s,e):n;return[Tt(a.map((function(n){var i;switch(n.type){case ne:return{type:ne,_event:Kt(n.event)};case re:return function(t,e,n,r){var i,o={_event:n},s=Kt(Mt(t.event)?t.event(e,n.data,o):t.event);if(Ft(t.delay)){var a=r&&r[t.delay];i=Mt(a)?a(e,n.data,o):a}else i=Mt(t.delay)?t.delay(e,n.data,o):t.delay;var c=Mt(t.to)?t.to(e,n.data,o):t.to;return dt(dt({},t),{to:c,_event:s,event:s.data,delay:i})}(n,c,r,t.options.delays);case ae:return function(t,e,n){return dt(dt({},t),{value:Ft(t.expr)?t.expr:t.expr(e,n.data,{_event:n})})}(n,c,r);case pe:if(!(s=null===(i=n.conds.find((function(n){var i=$t(n.cond,t.options.guards);return!i||Qt(t,i,c,r,e)})))||void 0===i?void 0:i.actions))return[];var o=Me(t,e,c,r,_e(Ct(s),t.options.actions));return c=o[1],o[0];case de:var s;if(!(s=n.get(c,r.data)))return[];o=Me(t,e,c,r,_e(Ct(s),t.options.actions));return c=o[1],o[0];case ee:return function(t,e,n){var r=Mt(t.activity)?t.activity(e,n.data):t.activity,i="string"==typeof r?{id:r}:r;return{type:zt.Stop,activity:i}}(n,c,r);default:return ge(n,t.options.actions)}}))),c]}var Fe=function(t){return"atomic"===t.type||"final"===t.type};function $e(t){return bt(t.states).map((function(e){return t.states[e]}))}function Be(t){var e=[t];return Fe(t)?e:e.concat(Tt($e(t).map(Be)))}function ze(t,e){var n,r,i,o,s,a,c,u,l=We(new Set(t)),h=new Set(e);try{for(var f=vt(h),p=f.next();!p.done;p=f.next())for(var d=(x=p.value).parent;d&&!h.has(d);)h.add(d),d=d.parent}catch(t){n={error:t}}finally{try{p&&!p.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}var y=We(h);try{for(var v=vt(h),g=v.next();!g.done;g=v.next()){if("compound"!==(x=g.value).type||y.get(x)&&y.get(x).length){if("parallel"===x.type)try{for(var _=(s=void 0,vt($e(x))),m=_.next();!m.done;m=_.next()){var b=m.value;"history"!==b.type&&(h.has(b)||(h.add(b),l.get(b)?l.get(b).forEach((function(t){return h.add(t)})):b.initialStateNodes.forEach((function(t){return h.add(t)}))))}}catch(t){s={error:t}}finally{try{m&&!m.done&&(a=_.return)&&a.call(_)}finally{if(s)throw s.error}}}else l.get(x)?l.get(x).forEach((function(t){return h.add(t)})):x.initialStateNodes.forEach((function(t){return h.add(t)}))}}catch(t){i={error:t}}finally{try{g&&!g.done&&(o=v.return)&&o.call(v)}finally{if(i)throw i.error}}try{for(var w=vt(h),S=w.next();!S.done;S=w.next()){var x;for(d=(x=S.value).parent;d&&!h.has(d);)h.add(d),d=d.parent}}catch(t){c={error:t}}finally{try{S&&!S.done&&(u=w.return)&&u.call(w)}finally{if(c)throw c.error}}return h}function qe(t,e){var n=e.get(t);if(!n)return{};if("compound"===t.type){var r=n[0];if(!r)return{};if(Fe(r))return r.key}var i={};return n.forEach((function(t){i[t.key]=qe(t,e)})),i}function We(t){var e,n,r=new Map;try{for(var i=vt(t),o=i.next();!o.done;o=i.next()){var s=o.value;r.has(s)||r.set(s,[]),s.parent&&(r.has(s.parent)||r.set(s.parent,[]),r.get(s.parent).push(s))}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r}function He(t,e){return qe(t,We(ze([t],e)))}function Je(t,e){return Array.isArray(t)?t.some((function(t){return t===e})):t instanceof Set&&t.has(e)}function Ge(t,e){return"compound"===e.type?$e(e).some((function(e){return"final"===e.type&&Je(t,e)})):"parallel"===e.type&&$e(e).every((function(e){return Ge(t,e)}))}function Ke(t,e){if(t===e)return!0;if(void 0===t||void 0===e)return!1;if(Ft(t)||Ft(e))return t===e;var n=bt(t),r=bt(e);return n.length===r.length&&n.every((function(n){return Ke(t[n],e[n])}))}function Ze(t){return!Ft(t)&&("value"in t&&"history"in t)}function Qe(t,e){var n=t.exec;return dt(dt({},t),{exec:void 0!==n?function(){return n(e.context,e.event,{action:t,state:e,_event:e._event})}:void 0})}var Xe=function(){function t(t){var e,n,r=this;this.actions=[],this.activities=mt,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||mt,this.meta=(void 0===(n=t.configuration)&&(n=[]),n.reduce((function(t,e){return void 0!==e.meta&&(t[e.id]=e.meta),t}),{})),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=t.tags)&&void 0!==e?e:new Set,Object.defineProperty(this,"nextEvents",{get:function(){return function(t){return _t([],gt(new Set(Tt(_t([],gt(t.map((function(t){return t.ownEvents}))))))))}(r.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:ye,_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 r=ye;return new t({value:e.value,context:n,_event:r,_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="."),Ft(t))return[t];var r=bt(t);return r.concat.apply(r,_t([],gt(r.map((function(r){return n.toStrings(t[r],e).map((function(t){return r+e+t}))})))))},t.prototype.toJSON=function(){var t=this;t.configuration,t.transitions;var e=t.tags,n=yt(t,["configuration","transitions","tags"]);return dt(dt({},n),{tags:Array.from(e)})},t.prototype.matches=function(t){return wt(t,this.value)},t.prototype.hasTag=function(t){return this.tags.has(t)},t}(),Ye=function(t,e){return e(t)};function tn(t){return{id:t,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},getSnapshot:function(){},toJSON:function(){return{id:t}}}}function en(t,e,n,r){var i,o=Xt(t.src),s=null===(i=null==e?void 0:e.options.services)||void 0===i?void 0:i[o.type],a=t.data?Rt(t.data,n,r):void 0,c=s?function(t,e,n){var r=tn(e);if(r.deferred=!0,Ht(t)){var i=r.state=Ye(void 0,(function(){return(n?t.withContext(n):t).initialState}));r.getSnapshot=function(){return i}}return r}(s,t.id,a):tn(t.id);return c.meta=t,c}function nn(t){return function(t){try{return"function"==typeof t.send}catch(t){return!1}}(t)&&"id"in t}function rn(t){return dt({subscribe:function(){return{unsubscribe:function(){}}},id:"anonymous",getSnapshot:function(){}},t)}function on(t){if("string"==typeof t){var e={type:t,toString:function(){return t}};return e}return t}function sn(t){return dt(dt({type:ue},t),{toJSON:function(){t.onDone,t.onError;var e=yt(t,["onDone","onError"]);return dt(dt({},e),{type:ue,src:on(t.src)})}})}var an={},cn=function(t){return"#"===t[0]},un=function(){function t(e,n,r){var i,o=this;void 0===r&&(r=e.context),this.config=e,this._context=r,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=this.options._parent,this.key=this.config.key||this.options._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||_t([this.machine.key],gt(this.path)).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&&bt(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.schema=this.parent?this.machine.schema:null!==(i=this.config.schema)&&void 0!==i?i:{},this.initial=this.config.initial,this.states=this.config.states?Et(this.config.states,(function(e,n){var r,i=new t(e,{_parent:o,_key:n});return Object.assign(o.idMap,dt(((r={})[i.id]=i,r),i.idMap)),i})):an;var s=0;!function t(e){var n,r;e.order=s++;try{for(var i=vt($e(e)),o=i.next();!o.done;o=i.next()){t(o.value)}}catch(t){n={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}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=Ct(this.config.entry||this.config.onEntry).map((function(t){return ge(t)})),this.onExit=Ct(this.config.exit||this.config.onExit).map((function(t){return ge(t)})),this.meta=this.config.meta,this.doneData="final"===this.type?this.config.data:void 0,this.invoke=Ct(this.config.invoke).map((function(t,e){var n,r;if(Ht(t))return o.machine.options.services=dt(((n={})[t.id]=t,n),o.machine.options.services),sn({src:t.id,id:t.id});if(Ft(t.src))return sn(dt(dt({},t),{id:t.id||t.src,src:t.src}));if(Ht(t.src)||Mt(t.src)){var i=o.id+":invocation["+e+"]";return o.machine.options.services=dt(((r={})[i]=t.src,r),o.machine.options.services),sn(dt(dt({id:i},t),{src:i}))}var s=t.src;return sn(dt(dt({id:s.type},t),{src:s}))})),this.activities=Ct(this.config.activities).concat(this.invoke).map((function(t){return me(t)})),this.transition=this.transition.bind(this),this.tags=Ct(this.config.tags)}return t.prototype._init=function(){this.__cache.transitions||Be(this).forEach((function(t){return t.on}))},t.prototype.withConfig=function(e,n){var r=this.options,i=r.actions,o=r.activities,s=r.guards,a=r.services,c=r.delays;return new t(this.config,{actions:dt(dt({},i),e.actions),activities:dt(dt({},o),e.activities),guards:dt(dt({},s),e.guards),services:dt(dt({},a),e.services),delays:dt(dt({},c),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 Mt(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:Et(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}},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 r=n.eventType===t;return e?r:r||"*"===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=Ne(Mt(e)?t.id+":delay["+n+"]":e,t.id);return t.onEntry.push(we(r,{delay:e})),t.onExit.push(Pe(r)),r};return(Vt(e)?e.map((function(t,e){var r=n(t.delay,e);return dt(dt({},t),{event:r})})):Tt(bt(e).map((function(t,r){var i=e[t],o=Ft(i)?{target:i}:i,s=isNaN(+t)?t:+t,a=n(s,r);return Ct(o).map((function(t){return dt(dt({},t),{event:a,delay:s})}))})))).map((function(e){var n=e.delay;return dt(dt({},t.formatTransition(e)),{delay:n})}))},t.prototype.getStateNodes=function(t){var e,n=this;if(!t)return[];var r=t instanceof Xe?t.value:Ot(t,this.delimiter);if(Ft(r)){var i=this.getStateNode(r).initial;return void 0!==i?this.getStateNodes(((e={})[r]=i,e)):[this,this.states[r]]}var o=bt(r),s=o.map((function(t){return n.getStateNode(t)}));return s.push(this),s.concat(o.reduce((function(t,e){var i=n.getStateNode(e).getStateNodes(r[e]);return t.concat(i)}),[]))},t.prototype.handles=function(t){var e=St(t);return this.events.includes(e)},t.prototype.resolveState=function(t){var e=Array.from(ze([],this.getStateNodes(t.value)));return new Xe(dt(dt({},t),{value:this.resolve(t.value),configuration:e,done:Ge(e,this)}))},t.prototype.transitionLeafNode=function(t,e,n){var r=this.getStateNode(t).next(e,n);return r&&r.transitions.length?r:this.next(e,n)},t.prototype.transitionCompoundNode=function(t,e,n){var r=bt(t),i=this.getStateNode(r[0])._transition(t[r[0]],e,n);return i&&i.transitions.length?i:this.next(e,n)},t.prototype.transitionParallelNode=function(t,e,n){var r,i,o={};try{for(var s=vt(bt(t)),a=s.next();!a.done;a=s.next()){var c=a.value,u=t[c];if(u){var l=this.getStateNode(c)._transition(u,e,n);l&&(o[c]=l)}}}catch(t){r={error:t}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}var h=bt(o).map((function(t){return o[t]})),f=Tt(h.map((function(t){return t.transitions})));if(!h.some((function(t){return t.transitions.length>0})))return this.next(e,n);var p=Tt(h.map((function(t){return t.entrySet}))),d=Tt(bt(o).map((function(t){return o[t].configuration})));return{transitions:f,entrySet:p,exitSet:Tt(h.map((function(t){return t.exitSet}))),configuration:d,source:e,actions:Tt(bt(o).map((function(t){return o[t].actions})))}},t.prototype._transition=function(t,e,n){return Ft(t)?this.transitionLeafNode(t,e,n):1===bt(t).length?this.transitionCompoundNode(t,e,n):this.transitionParallelNode(t,e,n)},t.prototype.next=function(t,e){var n,r,i,o=this,s=e.name,a=[],c=[];try{for(var u=vt(this.getCandidates(s)),l=u.next();!l.done;l=u.next()){var h=l.value,f=h.cond,p=h.in,d=t.context,y=!p||(Ft(p)&&cn(p)?t.matches(Ot(this.getStateNodeById(p).path,this.delimiter)):wt(Ot(p,this.delimiter),At(this.path.slice(0,-2))(t.value))),v=!1;try{v=!f||Qt(this.machine,f,d,e,t)}catch(t){throw new Error("Unable to evaluate guard '"+(f.name||f.type)+"' in transition for event '"+s+"' in state node '"+this.id+"':\n"+t.message)}if(v&&y){void 0!==h.target&&(c=h.target),a.push.apply(a,_t([],gt(h.actions))),i=h;break}}}catch(t){n={error:t}}finally{try{l&&!l.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}if(i){if(!c.length)return{transitions:[i],entrySet:[],exitSet:[],configuration:t.value?[this]:[],source:t,actions:a};var g=Tt(c.map((function(e){return o.getRelativeStateNodes(e,t.historyValue)}))),_=!!i.internal;return{transitions:[i],entrySet:_?[]:Tt(g.map((function(t){return o.nodesFromChild(t)}))),exitSet:_?[]:[this],configuration:g,source:t,actions:a}}},t.prototype.nodesFromChild=function(t){if(t.escapes(this))return[];for(var e=[],n=t;n&&n!==this;)e.push(n),n=n.parent;return e.push(this),e},t.prototype.escapes=function(t){if(this===t)return!1;for(var e=this.parent;e;){if(e===t)return!1;e=e.parent}return!0},t.prototype.getActions=function(t,e,n,r){var i,o,s,a,c=ze([],r?this.getStateNodes(r.value):[this]),u=t.configuration.length?ze(c,t.configuration):c;try{for(var l=vt(u),h=l.next();!h.done;h=l.next()){Je(c,d=h.value)||t.entrySet.push(d)}}catch(t){i={error:t}}finally{try{h&&!h.done&&(o=l.return)&&o.call(l)}finally{if(i)throw i.error}}try{for(var f=vt(c),p=f.next();!p.done;p=f.next()){var d;Je(u,d=p.value)&&!Je(t.exitSet,d.parent)||t.exitSet.push(d)}}catch(t){s={error:t}}finally{try{p&&!p.done&&(a=f.return)&&a.call(f)}finally{if(s)throw s.error}}t.source||(t.exitSet=[],t.entrySet.push(this));var y=Tt(t.entrySet.map((function(r){var i=[];if("final"!==r.type)return i;var o=r.parent;if(!o.parent)return i;i.push(Ce(r.id,r.doneData),Ce(o.id,r.doneData?Rt(r.doneData,e,n):void 0));var s=o.parent;return"parallel"===s.type&&$e(s).every((function(e){return Ge(t.configuration,e)}))&&i.push(Ce(s.id)),i})));t.exitSet.sort((function(t,e){return e.order-t.order})),t.entrySet.sort((function(t,e){return t.order-e.order}));var v=new Set(t.entrySet),g=new Set(t.exitSet),_=gt([Tt(Array.from(v).map((function(t){return _t(_t([],gt(t.activities.map((function(t){return Ae(t)})))),gt(t.onEntry))}))).concat(y.map(be)),Tt(Array.from(g).map((function(t){return _t(_t([],gt(t.onExit)),gt(t.activities.map((function(t){return ke(t)}))))})))],2),m=_[0],b=_[1];return _e(b.concat(t.actions).concat(m),this.machine.options.actions)},t.prototype.transition=function(t,e,n){void 0===t&&(t=this.initialState);var r,i,o=Kt(e);if(t instanceof Xe)r=void 0===n?t:this.resolveState(Xe.from(t,n));else{var s=Ft(t)?this.resolve(jt(this.getResolvedPath(t))):this.resolve(t),a=null!=n?n:this.machine.context;r=this.resolveState(Xe.from(s,a))}if(this.strict&&!this.events.includes(o.name)&&(i=o.name,!/^(done|error)\./.test(i)))throw new Error("Machine '"+this.id+"' does not accept event '"+o.name+"'");var c=this._transition(r.value,r,o)||{transitions:[],configuration:[],entrySet:[],exitSet:[],source:r,actions:[]},u=ze([],this.getStateNodes(r.value)),l=c.configuration.length?ze(u,c.configuration):u;return c.configuration=_t([],gt(l)),this.resolveTransition(c,r,o)},t.prototype.resolveRaisedTransition=function(t,e,n){var r,i=t.actions;return(t=this.transition(t,e))._event=n,t.event=n.data,(r=t.actions).unshift.apply(r,_t([],gt(i))),t},t.prototype.resolveTransition=function(t,e,n,r){var i,o,s=this;void 0===n&&(n=ye),void 0===r&&(r=this.machine.context);var a=t.configuration,c=!e||t.transitions.length>0,u=c?He(this.machine,a):void 0,l=e?e.historyValue?e.historyValue:t.source?this.machine.historyValue(e.value):void 0:void 0,h=e?e.context:r,f=this.getActions(t,h,n,e),p=e?dt({},e.activities):{};try{for(var d=vt(f),y=d.next();!y.done;y=d.next()){var v=y.value;v.type===te?p[v.activity.id||v.activity.type]=v:v.type===ee&&(p[v.activity.id||v.activity.type]=!1)}}catch(t){i={error:t}}finally{try{y&&!y.done&&(o=d.return)&&o.call(d)}finally{if(i)throw i.error}}var g,_,m=gt(Me(this,e,h,n,f),2),b=m[0],w=m[1],S=gt(It(b,(function(t){return t.type===ne||t.type===re&&t.to===qt.Internal})),2),x=S[0],O=S[1],j=b.filter((function(t){var e;return t.type===te&&(null===(e=t.activity)||void 0===e?void 0:e.type)===ue})).reduce((function(t,e){return t[e.activity.id]=en(e.activity,s.machine,w,n),t}),e?dt({},e.children):{}),E=u?t.configuration:e?e.configuration:[],P=Ge(E,this),A=new Xe({value:u||e.value,context:w,_event:n,_sessionid:e?e._sessionid:null,historyValue:u?l?(g=l,_=u,{current:_,states:Lt(g,_)}):void 0:e?e.historyValue:void 0,history:!u||t.source?e:void 0,actions:u?O:[],activities:u?p:e?e.activities:{},events:[],configuration:E,transitions:t.transitions,children:j,done:P,tags:null==e?void 0:e.tags}),k=h!==w;A.changed=n.name===fe||k;var T=A.history;T&&delete T.history;var N=!P&&(this._transient||a.some((function(t){return t._transient})));if(!(c||N&&""!==n.name))return A;var C=A;if(!P)for(N&&(C=this.resolveRaisedTransition(C,{type:oe},n));x.length;){var R=x.shift();C=this.resolveRaisedTransition(C,R._event,n)}var D=C.changed||(T?!!C.actions.length||k||typeof T.value!=typeof C.value||!Ke(C.value,T.value):void 0);return C.changed=D,C.history=T,C.tags=new Set(Tt(C.configuration.map((function(t){return t.tags})))),C},t.prototype.getStateNode=function(t){if(cn(t))return this.machine.getStateNodeById(t);if(!this.states)throw new Error("Unable to retrieve child state '"+t+"' from '"+this.id+"'; no child states exist.");var e=this.states[t];if(!e)throw new Error("Child state '"+t+"' does not exist on '"+this.id+"'");return e},t.prototype.getStateNodeById=function(t){var e=cn(t)?t.slice("#".length):t;if(e===this.id)return this;var n=this.machine.idMap[e];if(!n)throw new Error("Child state node '#"+e+"' does not exist on machine '"+this.id+"'");return n},t.prototype.getStateNodeByPath=function(t){if("string"==typeof t&&cn(t))try{return this.getStateNodeById(t.slice(1))}catch(t){}for(var e=xt(t,this.delimiter).slice(),n=this;e.length;){var r=e.shift();if(!r.length)break;n=n.getStateNode(r)}return n},t.prototype.resolve=function(t){var e,n=this;if(!t)return this.initialStateValue||an;switch(this.type){case"parallel":return Et(this.initialStateValue,(function(e,r){return e?n.getStateNode(r).resolve(t[r]||e):an}));case"compound":if(Ft(t)){var r=this.getStateNode(t);return"parallel"===r.type||"compound"===r.type?((e={})[t]=r.initialStateValue,e):t}return bt(t).length?Et(t,(function(t,e){return t?n.getStateNode(e).resolve(t):an})):this.initialStateValue||{};default:return t||an}},t.prototype.getResolvedPath=function(t){if(cn(t)){var e=this.machine.idMap[t.slice("#".length)];if(!e)throw new Error("Unable to find state node '"+t+"'");return e.path}return xt(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=Pt(this.states,(function(t){return t.initialStateValue||an}),(function(t){return!("history"===t.type)}));else if(void 0!==this.initial){if(!this.states[this.initial])throw new Error("Initial state '"+this.initial+"' not found on '"+this.key+"'");e=Fe(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){var n=this.getStateNodes(t);return this.resolveTransition({configuration:n,entrySet:n,exitSet:[],transitions:[],source:void 0,actions:[]},void 0,void 0,e)},Object.defineProperty(t.prototype,"initialState",{get:function(){this._init();var t=this.initialStateValue;if(!t)throw new Error("Cannot retrieve initial state from simple state '"+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=Ft(e.target)&&cn(e.target)?jt(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 Fe(this)?[this]:"compound"!==this.type||this.initial?Tt(kt(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=gt(t),n=e[0],r=e.slice(1);if(!this.states)throw new Error("Cannot retrieve subPath '"+n+"' from node with no states");var i=this.getStateNode(n);if("history"===i.type)return i.resolveHistory();if(!this.states[n])throw new Error("Child state '"+n+"' does not exist on '"+this.id+"'");return this.states[n].getFromRelativePath(r)},t.prototype.historyValue=function(t){if(bt(this.states).length)return{current:t||this.initialStateValue,states:Pt(this.states,(function(e,n){if(!t)return e.historyValue();var r=Ft(t)?void 0:t[n];return e.historyValue(r||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 r=this.target;return r?Tt(kt(r).map((function(t){return n.getFromRelativePath(t)}))):n.initialStateNodes}var i,o,s=(i=n.path,o="states",function(t){var e,n,r=t;try{for(var s=vt(i),a=s.next();!a.done;a=s.next()){var c=a.value;r=r[o][c]}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}return r})(t).current;return Ft(s)?[n.getStateNode(s)]:Tt(kt(s).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=Tt(bt(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,r;if(this.__cache.events)return this.__cache.events;var i=this.states,o=new Set(this.ownEvents);if(i)try{for(var s=vt(bt(i)),a=s.next();!a.done;a=s.next()){var c=i[a.value];if(c.states)try{for(var u=(n=void 0,vt(c.events)),l=u.next();!l.done;l=u.next()){var h=l.value;o.add(""+h)}}catch(t){n={error:t}}finally{try{l&&!l.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}}catch(e){t={error:e}}finally{try{a&&!a.done&&(e=s.return)&&e.call(s)}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(!Ft(t))return t;var n=t[0]===e.delimiter;if(n&&!e.parent)return e.getStateNodeByPath(t.slice(1));var r=n?e.key+t:t;if(!e.parent)return e.getStateNodeByPath(r);try{return e.parent.getStateNodeByPath(r)}catch(t){throw new Error("Invalid transition definition for state node '"+e.id+"':\n"+t.message)}}))},t.prototype.formatTransition=function(t){var e=this,n=function(t){if(void 0!==t&&""!==t)return Ct(t)}(t.target),r="internal"in t?t.internal:!n||n.some((function(t){return Ft(t)&&t[0]===e.delimiter})),i=this.machine.options.guards,o=this.resolveTarget(n),s=dt(dt({},t),{actions:_e(Ct(t.actions)),cond:$t(t.cond,i),target:o,source:this,internal:r,eventType:t.event,toJSON:function(){return dt(dt({},s),{target:s.target?s.target.map((function(t){return"#"+t.id})):void 0,source:"#"+e.id})}});return s},t.prototype.formatTransitions=function(){var t,e,n,r=this;if(this.config.on)if(Array.isArray(this.config.on))n=this.config.on;else{var i=this.config.on,o="*",s=i[o],a=void 0===s?[]:s,c=yt(i,["*"]);n=Tt(bt(c).map((function(t){return Zt(t,c[t])})).concat(Zt("*",a)))}else n=[];var u=this.config.always?Zt("",this.config.always):[],l=this.config.onDone?Zt(String(Ce(this.id)),this.config.onDone):[],h=Tt(this.invoke.map((function(t){var e=[];return t.onDone&&e.push.apply(e,_t([],gt(Zt(String(Re(t.id)),t.onDone)))),t.onError&&e.push.apply(e,_t([],gt(Zt(String(De(t.id)),t.onError)))),e}))),f=this.after,p=Tt(_t(_t(_t(_t([],gt(l)),gt(h)),gt(n)),gt(u)).map((function(t){return Ct(t).map((function(t){return r.formatTransition(t)}))})));try{for(var d=vt(f),y=d.next();!y.done;y=d.next()){var v=y.value;p.push(v)}}catch(e){t={error:e}}finally{try{y&&!y.done&&(e=d.return)&&e.call(d)}finally{if(t)throw t.error}}return p},t}();function ln(t,e,n){return void 0===n&&(n=t.context),new un(t,e,n)}function hn(t,e){return new un(t,e)}const fn=Te({failure:null}),pn=Te({errors:[]}),dn=Te({edits:null}),yn=Te({data:null}),vn=pn,gn=Te({failure:(t,e)=>e.data}),_n=Te({errors:(t,e)=>e.data}),mn=Te({data:(t,e)=>e.data}),bn=Te({edits:(t,e)=>Object.assign(Object.assign({},t.edits),e.data)});const wn=hn({context:{data:null,edits:null,errors:[],failure:null},entry:["validate"],id:"nucleon",initial:"init",on:{DELETE:{actions:["clearData","clearEdits","clearErrors"],target:"#nucleon.busy.deleting"},FETCH:{actions:["clearData","clearEdits","clearErrors"],target:"#nucleon.busy.fetching"},SET_DATA:{actions:["setData","clearEdits","clearErrors"],target:"#nucleon.init"}},states:{busy:{states:{creating:{invoke:{onDone:{actions:["setData","clearEdits","validate"],target:"#nucleon.idle.snapshot"},onError:[{actions:"setErrors",cond:"isV8nErrorEvent",target:"#nucleon.idle"},{actions:"setFailure",target:"#nucleon.fail"}],src:"sendPost"}},deleting:{invoke:{onDone:{actions:["clearData","clearEdits","validate"],target:"#nucleon.idle.template"},onError:[{actions:"setErrors",cond:"isV8nErrorEvent",target:"#nucleon.idle"},{actions:"setFailure",target:"#nucleon.fail"}],src:"sendDelete"}},fetching:{invoke:{onDone:{actions:["setData","clearErrors","validate"],target:"#nucleon.idle.snapshot"},onError:[{actions:"setErrors",cond:"isV8nErrorEvent",target:"#nucleon.idle"},{actions:"setFailure",target:"#nucleon.fail"}],src:"sendGet"}},updating:{invoke:{onDone:{actions:["setData","clearEdits","validate"],target:"#nucleon.idle.snapshot"},onError:[{actions:"setErrors",cond:"isV8nErrorEvent",target:"#nucleon.idle"},{actions:"setFailure",target:"#nucleon.fail"}],src:"sendPatch"}}}},fail:{exit:"clearFailure"},idle:{initial:"unknown",on:{EDIT:{actions:["applyEdit","validate"],target:".unknown"}},states:{snapshot:{initial:"unknown",states:{clean:{initial:"unknown",states:{invalid:{},unknown:{always:[{cond:"hasErrors",target:"invalid"},{target:"valid"}]},valid:{}}},dirty:{initial:"unknown",on:{UNDO:{actions:["clearEdits","clearErrors","validate"],target:"#nucleon.idle.snapshot.clean"}},states:{invalid:{},unknown:{always:[{cond:"hasErrors",target:"invalid"},{target:"valid"}]},valid:{on:{SUBMIT:{target:"#nucleon.busy.updating"}}}}},unknown:{always:[{cond:"hasEdits",target:"dirty"},{target:"clean"}]}}},template:{initial:"unknown",states:{clean:{initial:"unknown",states:{invalid:{},unknown:{always:[{cond:"hasErrors",target:"invalid"},{target:"valid"}]},valid:{}}},dirty:{initial:"unknown",on:{UNDO:{actions:["clearEdits","clearErrors","validate"],target:"#nucleon.idle.template.clean"}},states:{invalid:{},unknown:{always:[{cond:"hasErrors",target:"invalid"},{target:"valid"}]},valid:{on:{SUBMIT:{target:"#nucleon.busy.creating"}}}}},unknown:{always:[{cond:"hasEdits",target:"dirty"},{target:"clean"}]}}},unknown:{always:[{cond:"hasData",target:"snapshot"},{target:"template"}]}}},init:{always:[{cond:"hasData",target:"idle.snapshot"},{target:"idle.template"}]}}},{actions:Object.freeze({__proto__:null,clearFailure:fn,clearErrors:pn,clearEdits:dn,clearData:yn,validate:vn,setFailure:gn,setErrors:_n,setData:mn,applyEdit:bn}),guards:Object.freeze({__proto__:null,hasData:t=>null!==t.data,hasEdits:t=>null!==t.edits,hasErrors:t=>t.errors.length>0,isV8nErrorEvent:(t,e)=>Array.isArray(e.data)})});var Sn;!function(t){t[t.List=0]="List",t[t.Set=1]="Set"}(Sn||(Sn={}));class xn{constructor(t){this.__value=t,this.__tree=xn.__parse(t)}static get True(){return jn}static get False(){return On}static fromAttribute(t,e){return null===t?xn.False:""===t||t===e?xn.True:new xn(t)}matches(t,e=!1){const n=this.zoom(t).toString();return e?"not=*"===n:""!==n}zoom(t){const[e,...n]=t.split(":"),{only:r,not:i}=this.__tree;if(null==r?void 0:r[e]){const t=new xn(xn.__stringify(r[e]));return 0===n.length?t:t.zoom(n.join(":"))}return!i||i.includes(e)?xn.False:xn.True}toString(){return this.__value}toAttribute(t=""){var e;return"*"===(null===(e=this.__tree.not)||void 0===e?void 0:e[0])?t:0===this.__value.trim().length?null:this.toString()}static __stringify(t,e=""){return t.only?Object.entries(t.only).reduce(((t,[n,r])=>{const i=xn.__stringify(r,0===e.length?n:`${e}:${n}`);return 0===t.length?i:`${t} ${i}`}),""):t.not?`${0===e.length?"":`${e}:`}not=${t.not.join(",")}`:e}static __parse(t){const e={},n={branch:e,buffer:"",entity:Sn.List,tree:e};return Array.from(`${t} `).forEach(((e,r)=>{try{xn.__processors[n.entity](n,e)}catch(e){const n="This error occured at: ",i=t=>t.substring(Math.max(0,r-30),r+30),o=i(t),s=" ".repeat(n.length)+i("^".padStart(r+1," "));throw new SyntaxError([e.message,`${n}${o}`,s].join("\n"))}})),e}}xn.__processors={[Sn.List](t,e){var n,r,i,o;if(Array.isArray(t.branch))throw new SyntaxError("Paths are not allowed in sets.");if("="===e){if("not"===t.buffer){const e=null!==(n=t.branch.not)&&void 0!==n?n:[];return delete t.branch.only,t.branch.not=e,t.entity=Sn.Set,t.branch=e,void(t.buffer="")}throw new SyntaxError(`Unknown modifier "${t.buffer}".`)}if(/^\s$/.test(e)||":"===e){if(t.buffer.length>0){const n=t.buffer,s=null!==(i=null===(r=t.branch.only)||void 0===r?void 0:r[n])&&void 0!==i?i:{};":"!==e&&(s.not=["*"]),!0!==(null===(o=t.branch.not)||void 0===o?void 0:o.includes("*"))&&(t.branch.only=Object.assign(Object.assign({},t.branch.only),{[n]:s}),delete t.branch.not),t.branch=":"===e?s:t.tree,t.buffer=""}}else{if(!/^[a-z]|-$/.test(e))throw new SyntaxError(`Expected [a-z], "-", ":" or a whitespace, but got "${e}" instead.`);t.buffer+=e}},[Sn.Set](t,e){if(!Array.isArray(t.branch))throw new SyntaxError("Unexpected set item.");if(0!==t.buffer.length||!/^\s$/.test(e)){if(","===e||"*"===e||/^\s$/.test(e)){const n="*"===e?"*":t.buffer,r=new Set([...t.branch,n]),i=r.has("*")?new Set(["*"]):r;return t.branch.splice(0,t.branch.length,...i),t.entity=","===e?Sn.Set:Sn.List,t.branch=","===e?t.branch:t.tree,void(t.buffer="")}if(!/^[a-z]|-$/.test(e))throw new SyntaxError(`Expected [a-z], "-", "," or a whitespace, but got "${e}" instead.`);t.buffer+=e}}};const On=new xn(""),jn=new xn("not=*");var En="object"==typeof global&&global&&global.Object===Object&&global,Pn="object"==typeof self&&self&&self.Object===Object&&self,An=En||Pn||Function("return this")(),kn=An.Symbol,Tn=Object.prototype,Nn=Tn.hasOwnProperty,Cn=Tn.toString,Rn=kn?kn.toStringTag:void 0;var Dn=Object.prototype.toString;var Un=kn?kn.toStringTag:void 0;function In(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Un&&Un in Object(t)?function(t){var e=Nn.call(t,Rn),n=t[Rn];try{t[Rn]=void 0;var r=!0}catch(t){}var i=Cn.call(t);return r&&(e?t[Rn]=n:delete t[Rn]),i}(t):function(t){return Dn.call(t)}(t)}function Ln(t){return null!=t&&"object"==typeof t}function Vn(t){return"symbol"==typeof t||Ln(t)&&"[object Symbol]"==In(t)}var Mn=Array.isArray,Fn=kn?kn.prototype:void 0,$n=Fn?Fn.toString:void 0;function Bn(t){if("string"==typeof t)return t;if(Mn(t))return function(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}(t,Bn)+"";if(Vn(t))return $n?$n.call(t):"";var e=t+"";return"0"==e&&1/t==-Infinity?"-0":e}function zn(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function qn(t){if(!zn(t))return!1;var e=In(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}var Wn,Hn=An["__core-js_shared__"],Jn=(Wn=/[^.]+$/.exec(Hn&&Hn.keys&&Hn.keys.IE_PROTO||""))?"Symbol(src)_1."+Wn:"";var Gn=Function.prototype.toString;function Kn(t){if(null!=t){try{return Gn.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var Zn=/^\[object .+?Constructor\]$/,Qn=Function.prototype,Xn=Object.prototype,Yn=Qn.toString,tr=Xn.hasOwnProperty,er=RegExp("^"+Yn.call(tr).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function nr(t){return!(!zn(t)||(e=t,Jn&&Jn in e))&&(qn(t)?er:Zn).test(Kn(t));var e}function rr(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return nr(n)?n:void 0}var ir=rr(An,"WeakMap"),or=/^(?:0|[1-9]\d*)$/;function sr(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&or.test(t))&&t>-1&&t%1==0&&t<e}function ar(t,e){return t===e||t!=t&&e!=e}function cr(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function ur(t){return null!=t&&cr(t.length)&&!qn(t)}var lr=Object.prototype;function hr(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||lr)}function fr(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function pr(t){return Ln(t)&&"[object Arguments]"==In(t)}var dr=Object.prototype,yr=dr.hasOwnProperty,vr=dr.propertyIsEnumerable,gr=pr(function(){return arguments}())?pr:function(t){return Ln(t)&&yr.call(t,"callee")&&!vr.call(t,"callee")};var _r="object"==typeof exports&&exports&&!exports.nodeType&&exports,mr=_r&&"object"==typeof module&&module&&!module.nodeType&&module,br=mr&&mr.exports===_r?An.Buffer:void 0,wr=(br?br.isBuffer:void 0)||function(){return!1},Sr={};function xr(t){return function(e){return t(e)}}Sr["[object Float32Array]"]=Sr["[object Float64Array]"]=Sr["[object Int8Array]"]=Sr["[object Int16Array]"]=Sr["[object Int32Array]"]=Sr["[object Uint8Array]"]=Sr["[object Uint8ClampedArray]"]=Sr["[object Uint16Array]"]=Sr["[object Uint32Array]"]=!0,Sr["[object Arguments]"]=Sr["[object Array]"]=Sr["[object ArrayBuffer]"]=Sr["[object Boolean]"]=Sr["[object DataView]"]=Sr["[object Date]"]=Sr["[object Error]"]=Sr["[object Function]"]=Sr["[object Map]"]=Sr["[object Number]"]=Sr["[object Object]"]=Sr["[object RegExp]"]=Sr["[object Set]"]=Sr["[object String]"]=Sr["[object WeakMap]"]=!1;var Or="object"==typeof exports&&exports&&!exports.nodeType&&exports,jr=Or&&"object"==typeof module&&module&&!module.nodeType&&module,Er=jr&&jr.exports===Or&&En.process,Pr=function(){try{var t=jr&&jr.require&&jr.require("util").types;return t||Er&&Er.binding&&Er.binding("util")}catch(t){}}(),Ar=Pr&&Pr.isTypedArray,kr=Ar?xr(Ar):function(t){return Ln(t)&&cr(t.length)&&!!Sr[In(t)]},Tr=Object.prototype.hasOwnProperty;function Nr(t,e){var n=Mn(t),r=!n&&gr(t),i=!n&&!r&&wr(t),o=!n&&!r&&!i&&kr(t),s=n||r||i||o,a=s?fr(t.length,String):[],c=a.length;for(var u in t)!e&&!Tr.call(t,u)||s&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||sr(u,c))||a.push(u);return a}function Cr(t,e){return function(n){return t(e(n))}}var Rr=Cr(Object.keys,Object),Dr=Object.prototype.hasOwnProperty;function Ur(t){return ur(t)?Nr(t):function(t){if(!hr(t))return Rr(t);var e=[];for(var n in Object(t))Dr.call(t,n)&&"constructor"!=n&&e.push(n);return e}(t)}var Ir=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Lr=/^\w*$/;var Vr=rr(Object,"create");var Mr=Object.prototype.hasOwnProperty;var Fr=Object.prototype.hasOwnProperty;function $r(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Br(t,e){for(var n=t.length;n--;)if(ar(t[n][0],e))return n;return-1}$r.prototype.clear=function(){this.__data__=Vr?Vr(null):{},this.size=0},$r.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},$r.prototype.get=function(t){var e=this.__data__;if(Vr){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return Mr.call(e,t)?e[t]:void 0},$r.prototype.has=function(t){var e=this.__data__;return Vr?void 0!==e[t]:Fr.call(e,t)},$r.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Vr&&void 0===e?"__lodash_hash_undefined__":e,this};var zr=Array.prototype.splice;function qr(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}qr.prototype.clear=function(){this.__data__=[],this.size=0},qr.prototype.delete=function(t){var e=this.__data__,n=Br(e,t);return!(n<0)&&(n==e.length-1?e.pop():zr.call(e,n,1),--this.size,!0)},qr.prototype.get=function(t){var e=this.__data__,n=Br(e,t);return n<0?void 0:e[n][1]},qr.prototype.has=function(t){return Br(this.__data__,t)>-1},qr.prototype.set=function(t,e){var n=this.__data__,r=Br(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this};var Wr=rr(An,"Map");function Hr(t,e){var n,r,i=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map}function Jr(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Jr.prototype.clear=function(){this.size=0,this.__data__={hash:new $r,map:new(Wr||qr),string:new $r}},Jr.prototype.delete=function(t){var e=Hr(this,t).delete(t);return this.size-=e?1:0,e},Jr.prototype.get=function(t){return Hr(this,t).get(t)},Jr.prototype.has=function(t){return Hr(this,t).has(t)},Jr.prototype.set=function(t,e){var n=Hr(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this};function Gr(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=t.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(Gr.Cache||Jr),n}Gr.Cache=Jr;var Kr,Zr,Qr,Xr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Yr=/\\(\\)?/g,ti=(Kr=function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Xr,(function(t,n,r,i){e.push(r?i.replace(Yr,"$1"):n||t)})),e},Zr=Gr(Kr,(function(t){return 500===Qr.size&&Qr.clear(),t})),Qr=Zr.cache,Zr);function ei(t,e){return Mn(t)?t:function(t,e){if(Mn(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!Vn(t))||Lr.test(t)||!Ir.test(t)||null!=e&&t in Object(e)}(t,e)?[t]:ti(function(t){return null==t?"":Bn(t)}(t))}function ni(t){if("string"==typeof t||Vn(t))return t;var e=t+"";return"0"==e&&1/t==-Infinity?"-0":e}function ri(t,e,n){var r=null==t?void 0:function(t,e){for(var n=0,r=(e=ei(e,t)).length;null!=t&&n<r;)t=t[ni(e[n++])];return n&&n==r?t:void 0}(t,e);return void 0===r?n:r}function ii(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}function oi(t){var e=this.__data__=new qr(t);this.size=e.size}function si(){return[]}oi.prototype.clear=function(){this.__data__=new qr,this.size=0},oi.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},oi.prototype.get=function(t){return this.__data__.get(t)},oi.prototype.has=function(t){return this.__data__.has(t)},oi.prototype.set=function(t,e){var n=this.__data__;if(n instanceof qr){var r=n.__data__;if(!Wr||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Jr(r)}return n.set(t,e),this.size=n.size,this};var ai=Object.prototype.propertyIsEnumerable,ci=Object.getOwnPropertySymbols,ui=ci?function(t){return null==t?[]:(t=Object(t),function(t,e){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n<r;){var s=t[n];e(s,n,t)&&(o[i++]=s)}return o}(ci(t),(function(e){return ai.call(t,e)})))}:si;function li(t,e,n){var r=e(t);return Mn(t)?r:ii(r,n(t))}function hi(t){return li(t,Ur,ui)}var fi=rr(An,"DataView"),pi=rr(An,"Promise"),di=rr(An,"Set"),yi=Kn(fi),vi=Kn(Wr),gi=Kn(pi),_i=Kn(di),mi=Kn(ir),bi=In;(fi&&"[object DataView]"!=bi(new fi(new ArrayBuffer(1)))||Wr&&"[object Map]"!=bi(new Wr)||pi&&"[object Promise]"!=bi(pi.resolve())||di&&"[object Set]"!=bi(new di)||ir&&"[object WeakMap]"!=bi(new ir))&&(bi=function(t){var e=In(t),n="[object Object]"==e?t.constructor:void 0,r=n?Kn(n):"";if(r)switch(r){case yi:return"[object DataView]";case vi:return"[object Map]";case gi:return"[object Promise]";case _i:return"[object Set]";case mi:return"[object WeakMap]"}return e});var wi=bi,Si=An.Uint8Array;function xi(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Jr;++e<n;)this.add(t[e])}function Oi(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function ji(t,e){return t.has(e)}xi.prototype.add=xi.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},xi.prototype.has=function(t){return this.__data__.has(t)};function Ei(t,e,n,r,i,o){var s=1&n,a=t.length,c=e.length;if(a!=c&&!(s&&c>a))return!1;var u=o.get(t),l=o.get(e);if(u&&l)return u==e&&l==t;var h=-1,f=!0,p=2&n?new xi:void 0;for(o.set(t,e),o.set(e,t);++h<a;){var d=t[h],y=e[h];if(r)var v=s?r(y,d,h,e,t,o):r(d,y,h,t,e,o);if(void 0!==v){if(v)continue;f=!1;break}if(p){if(!Oi(e,(function(t,e){if(!ji(p,e)&&(d===t||i(d,t,n,r,o)))return p.push(e)}))){f=!1;break}}else if(d!==y&&!i(d,y,n,r,o)){f=!1;break}}return o.delete(t),o.delete(e),f}function Pi(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function Ai(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}var ki=kn?kn.prototype:void 0,Ti=ki?ki.valueOf:void 0;var Ni=Object.prototype.hasOwnProperty;var Ci="[object Object]",Ri=Object.prototype.hasOwnProperty;function Di(t,e,n,r,i,o){var s=Mn(t),a=Mn(e),c=s?"[object Array]":wi(t),u=a?"[object Array]":wi(e),l=(c="[object Arguments]"==c?Ci:c)==Ci,h=(u="[object Arguments]"==u?Ci:u)==Ci,f=c==u;if(f&&wr(t)){if(!wr(e))return!1;s=!0,l=!1}if(f&&!l)return o||(o=new oi),s||kr(t)?Ei(t,e,n,r,i,o):function(t,e,n,r,i,o,s){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!o(new Si(t),new Si(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return ar(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var a=Pi;case"[object Set]":var c=1&r;if(a||(a=Ai),t.size!=e.size&&!c)return!1;var u=s.get(t);if(u)return u==e;r|=2,s.set(t,e);var l=Ei(a(t),a(e),r,i,o,s);return s.delete(t),l;case"[object Symbol]":if(Ti)return Ti.call(t)==Ti.call(e)}return!1}(t,e,c,n,r,i,o);if(!(1&n)){var p=l&&Ri.call(t,"__wrapped__"),d=h&&Ri.call(e,"__wrapped__");if(p||d){var y=p?t.value():t,v=d?e.value():e;return o||(o=new oi),i(y,v,n,r,o)}}return!!f&&(o||(o=new oi),function(t,e,n,r,i,o){var s=1&n,a=hi(t),c=a.length;if(c!=hi(e).length&&!s)return!1;for(var u=c;u--;){var l=a[u];if(!(s?l in e:Ni.call(e,l)))return!1}var h=o.get(t),f=o.get(e);if(h&&f)return h==e&&f==t;var p=!0;o.set(t,e),o.set(e,t);for(var d=s;++u<c;){var y=t[l=a[u]],v=e[l];if(r)var g=s?r(v,y,l,e,t,o):r(y,v,l,t,e,o);if(!(void 0===g?y===v||i(y,v,n,r,o):g)){p=!1;break}d||(d="constructor"==l)}if(p&&!d){var _=t.constructor,m=e.constructor;_==m||!("constructor"in t)||!("constructor"in e)||"function"==typeof _&&_ instanceof _&&"function"==typeof m&&m instanceof m||(p=!1)}return o.delete(t),o.delete(e),p}(t,e,n,r,i,o))}function Ui(t,e,n,r,i){return t===e||(null==t||null==e||!Ln(t)&&!Ln(e)?t!=t&&e!=e:Di(t,e,n,r,Ui,i))}function Ii(t,e){return Ui(t,e)}class Li extends Error{constructor(){super("not enough info to update; please reload resource instead")}}var Vi=lt((function(t){var e=t.exports=function(t){return new n(t)};function n(t){this.value=t}function r(t,e,n){var r=[],s=[],l=!0;return function t(h){var f=n?i(h):h,p={},d=!0,y={node:f,node_:h,path:[].concat(r),parent:s[s.length-1],parents:s,key:r.slice(-1)[0],isRoot:0===r.length,level:r.length,circular:null,update:function(t,e){y.isRoot||(y.parent.node[y.key]=t),y.node=t,e&&(d=!1)},delete:function(t){delete y.parent.node[y.key],t&&(d=!1)},remove:function(t){a(y.parent.node)?y.parent.node.splice(y.key,1):delete y.parent.node[y.key],t&&(d=!1)},keys:null,before:function(t){p.before=t},after:function(t){p.after=t},pre:function(t){p.pre=t},post:function(t){p.post=t},stop:function(){l=!1},block:function(){d=!1}};if(!l)return y;function v(){if("object"==typeof y.node&&null!==y.node){y.keys&&y.node_===y.node||(y.keys=o(y.node)),y.isLeaf=0==y.keys.length;for(var t=0;t<s.length;t++)if(s[t].node_===h){y.circular=s[t];break}}else y.isLeaf=!0,y.keys=null;y.notLeaf=!y.isLeaf,y.notRoot=!y.isRoot}v();var g=e.call(y,y.node);return void 0!==g&&y.update&&y.update(g),p.before&&p.before.call(y,y.node),d?("object"!=typeof y.node||null===y.node||y.circular||(s.push(y),v(),c(y.keys,(function(e,i){r.push(e),p.pre&&p.pre.call(y,y.node[e],e);var o=t(y.node[e]);n&&u.call(y.node,e)&&(y.node[e]=o.node),o.isLast=i==y.keys.length-1,o.isFirst=0==i,p.post&&p.post.call(y,o),r.pop()})),s.pop()),p.after&&p.after.call(y,y.node),y):y}(t).node}function i(t){if("object"==typeof t&&null!==t){var e;if(a(t))e=[];else if("[object Date]"===s(t))e=new Date(t.getTime?t.getTime():t);else if(function(t){return"[object RegExp]"===s(t)}(t))e=new RegExp(t);else if(function(t){return"[object Error]"===s(t)}(t))e={message:t.message};else if(function(t){return"[object Boolean]"===s(t)}(t))e=new Boolean(t);else if(function(t){return"[object Number]"===s(t)}(t))e=new Number(t);else if(function(t){return"[object String]"===s(t)}(t))e=new String(t);else if(Object.create&&Object.getPrototypeOf)e=Object.create(Object.getPrototypeOf(t));else if(t.constructor===Object)e={};else{var n=t.constructor&&t.constructor.prototype||t.__proto__||{},r=function(){};r.prototype=n,e=new r}return c(o(t),(function(n){e[n]=t[n]})),e}return t}n.prototype.get=function(t){for(var e=this.value,n=0;n<t.length;n++){var r=t[n];if(!e||!u.call(e,r)){e=void 0;break}e=e[r]}return e},n.prototype.has=function(t){for(var e=this.value,n=0;n<t.length;n++){var r=t[n];if(!e||!u.call(e,r))return!1;e=e[r]}return!0},n.prototype.set=function(t,e){for(var n=this.value,r=0;r<t.length-1;r++){var i=t[r];u.call(n,i)||(n[i]={}),n=n[i]}return n[t[r]]=e,e},n.prototype.map=function(t){return r(this.value,t,!0)},n.prototype.forEach=function(t){return this.value=r(this.value,t,!1),this.value},n.prototype.reduce=function(t,e){var n=1===arguments.length,r=n?this.value:e;return this.forEach((function(e){this.isRoot&&n||(r=t.call(this,r,e))})),r},n.prototype.paths=function(){var t=[];return this.forEach((function(e){t.push(this.path)})),t},n.prototype.nodes=function(){var t=[];return this.forEach((function(e){t.push(this.node)})),t},n.prototype.clone=function(){var t=[],e=[];return function n(r){for(var s=0;s<t.length;s++)if(t[s]===r)return e[s];if("object"==typeof r&&null!==r){var a=i(r);return t.push(r),e.push(a),c(o(r),(function(t){a[t]=n(r[t])})),t.pop(),e.pop(),a}return r}(this.value)};var o=Object.keys||function(t){var e=[];for(var n in t)e.push(n);return e};function s(t){return Object.prototype.toString.call(t)}var a=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},c=function(t,e){if(t.forEach)return t.forEach(e);for(var n=0;n<t.length;n++)e(t[n],n,t)};c(o(n.prototype),(function(t){e[t]=function(e){var r=[].slice.call(arguments,1),i=new n(e);return i[t].apply(i,r)}}));var u=Object.hasOwnProperty||function(t,e){return e in t}}));class Mi{constructor(){this.__callbacks=[]}share(t){const{related:e,source:n,data:r}=t,i=null===r?new Map([[n,null]]):Mi.__createPatch(r);[...this.__callbacks].forEach((t=>{t((t=>{const n=Mi.__applyPatch(i,t,e);return Ii(t,n)?t:n}))}))}track(t){return this.__callbacks.push(t),()=>{this.__callbacks.splice(this.__callbacks.indexOf(t),1)}}cease(){this.__callbacks.length=0}static __isResource(t){return"string"==typeof ri(t,"_links.self.href")}static __approximateURI(t){try{const e=new URL(t);return e.search="",e.hash="",e.toString()}catch(e){return t}}static __createPatch(t){return Vi(t).reduce((function(t,e){if(!Mi.__isResource(e))return t;const n=Vi(e).map((function(){var t;(null===(t=this.key)||void 0===t?void 0:t.startsWith("_"))&&this.delete(!0)}));return t.set(e._links.self.href,n),t}),new Map)}static __applyPatch(t,e,n){var r,i;const o=null!==(r=null==n?void 0:n.map((t=>Mi.__approximateURI(t))))&&void 0!==r?r:[];return null!==(i=Vi({data:e}).map((function(e){if(!Mi.__isResource(e))return;const n=e._links.self.href,r=Mi.__approximateURI(n);if(o.includes(r))throw new Mi.UpdateError;if(t.has(n)){const r=t.get(n);if(r)return this.update(Object.assign(Object.assign({},e),r),!0);if(!this.parent.parent)return this.delete(!0);throw new Mi.UpdateError}})).data)&&void 0!==i?i:null}}Mi.UpdateError=Li;var Fi=lt((function(t,e){t.exports=function(){function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function e(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function n(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function o(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?i(Object(n),!0).forEach((function(e){r(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function s(t){return function(t){if(Array.isArray(t))return c(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||a(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,e){if(t){if("string"==typeof t)return c(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(t,e):void 0}}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function u(t){if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(t=a(t))){var e=0,n=function(){};return{s:n,n:function(){return e>=t.length?{done:!0}:{done:!1,value:t[e++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i,o=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return o=t.done,t},e:function(t){s=!0,i=t},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw i}}}}var l={};l[l.Fatal=0]="Fatal",l[l.Error=0]="Error",l[l.Warn=1]="Warn",l[l.Log=2]="Log",l[l.Info=3]="Info",l[l.Success=3]="Success",l[l.Debug=4]="Debug",l[l.Trace=5]="Trace",l[l.Silent=-1/0]="Silent",l[l.Verbose=1/0]="Verbose";var h={silent:{level:-1},fatal:{level:l.Fatal},error:{level:l.Error},warn:{level:l.Warn},log:{level:l.Log},info:{level:l.Info},success:{level:l.Success},debug:{level:l.Debug},trace:{level:l.Trace},verbose:{level:l.Trace},ready:{level:l.Info},start:{level:l.Info}};function f(t){return e=t,!("[object Object]"!==Object.prototype.toString.call(e)||!t.message&&!t.args||t.stack);var e}var p=!1,d=[],y=function(){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};for(var r in t(this,e),this._reporters=n.reporters||[],this._types=n.types||h,this.level=void 0!==n.level?n.level:3,this._defaults=n.defaults||{},this._async=void 0!==n.async?n.async:void 0,this._stdout=n.stdout,this._stderr=n.stderr,this._mockFn=n.mockFn,this._throttle=n.throttle||1e3,this._throttleMin=n.throttleMin||5,this._types){var i=o(o({type:r},this._types[r]),this._defaults);this[r]=this._wrapLogFn(i),this[r].raw=this._wrapLogFn(i,!0)}this._mockFn&&this.mockTypes(),this._lastLogSerialized=void 0,this._lastLog=void 0,this._lastLogTime=void 0,this._lastLogCount=0,this._throttleTimeout=void 0}return n(e,[{key:"create",value:function(t){return new e(Object.assign({reporters:this._reporters,level:this.level,types:this._types,defaults:this._defaults,stdout:this._stdout,stderr:this._stderr,mockFn:this._mockFn},t))}},{key:"withDefaults",value:function(t){return this.create({defaults:Object.assign({},this._defaults,t)})}},{key:"withTag",value:function(t){return this.withDefaults({tag:this._defaults.tag?this._defaults.tag+":"+t:t})}},{key:"addReporter",value:function(t){return this._reporters.push(t),this}},{key:"removeReporter",value:function(t){if(t){var e=this._reporters.indexOf(t);if(e>=0)return this._reporters.splice(e,1)}else this._reporters.splice(0);return this}},{key:"setReporters",value:function(t){return this._reporters=Array.isArray(t)?t:[t],this}},{key:"wrapAll",value:function(){this.wrapConsole(),this.wrapStd()}},{key:"restoreAll",value:function(){this.restoreConsole(),this.restoreStd()}},{key:"wrapConsole",value:function(){for(var t in this._types)console["__"+t]||(console["__"+t]=console[t]),console[t]=this[t].raw}},{key:"restoreConsole",value:function(){for(var t in this._types)console["__"+t]&&(console[t]=console["__"+t],delete console["__"+t])}},{key:"wrapStd",value:function(){this._wrapStream(this.stdout,"log"),this._wrapStream(this.stderr,"log")}},{key:"_wrapStream",value:function(t,e){var n=this;t&&(t.__write||(t.__write=t.write),t.write=function(t){n[e].raw(String(t).trim())})}},{key:"restoreStd",value:function(){this._restoreStream(this.stdout),this._restoreStream(this.stderr)}},{key:"_restoreStream",value:function(t){t&&t.__write&&(t.write=t.__write,delete t.__write)}},{key:"pauseLogs",value:function(){p=!0}},{key:"resumeLogs",value:function(){p=!1;var t,e=u(d.splice(0));try{for(e.s();!(t=e.n()).done;){var n=t.value;n[0]._logFn(n[1],n[2])}}catch(t){e.e(t)}finally{e.f()}}},{key:"mockTypes",value:function(t){if(this._mockFn=t||this._mockFn,"function"==typeof this._mockFn)for(var e in this._types)this[e]=this._mockFn(e,this._types[e])||this[e],this[e].raw=this[e]}},{key:"_wrapLogFn",value:function(t,e){var n=this;return function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];if(!p)return n._logFn(t,i,e);d.push([n,t,i,e])}}},{key:"_logFn",value:function(t,e,n){var r=this;if(t.level>this.level)return!!this._async&&Promise.resolve(!1);var i=Object.assign({date:new Date,args:[]},t);!n&&1===e.length&&f(e[0])?Object.assign(i,e[0]):i.args=Array.from(e),i.message&&(i.args.unshift(i.message),delete i.message),i.additional&&(Array.isArray(i.additional)||(i.additional=i.additional.split("\n")),i.args.push("\n"+i.additional.join("\n")),delete i.additional),i.type="string"==typeof i.type?i.type.toLowerCase():"",i.tag="string"==typeof i.tag?i.tag.toLowerCase():"";var a=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=r._lastLogCount-r._throttleMin;if(r._lastLog&&e>0){var n=s(r._lastLog.args);e>1&&n.push("(repeated ".concat(e," times)")),r._log(o(o({},r._lastLog),{},{args:n})),r._lastLogCount=1}if(t){if(r._lastLog=i,r._async)return r._logAsync(i);r._log(i)}};clearTimeout(this._throttleTimeout);var c=this._lastLogTime?i.date-this._lastLogTime:0;if(this._lastLogTime=i.date,c<this._throttle)try{var u=JSON.stringify([i.type,i.tag,i.args]),l=this._lastLogSerialized===u;if(this._lastLogSerialized=u,l&&(this._lastLogCount++,this._lastLogCount>this._throttleMin))return void(this._throttleTimeout=setTimeout(a,this._throttle))}catch(t){}a(!0)}},{key:"_log",value:function(t){var e,n=u(this._reporters);try{for(n.s();!(e=n.n()).done;)e.value.log(t,{async:!1,stdout:this.stdout,stderr:this.stderr})}catch(t){n.e(t)}finally{n.f()}}},{key:"_logAsync",value:function(t){var e=this;return Promise.all(this._reporters.map((function(n){return n.log(t,{async:!0,stdout:e.stdout,stderr:e.stderr})})))}},{key:"stdout",get:function(){return this._stdout||console._stdout}},{key:"stderr",get:function(){return this._stderr||console._stderr}}]),e}();y.prototype.add=y.prototype.addReporter,y.prototype.remove=y.prototype.removeReporter,y.prototype.clear=y.prototype.removeReporter,y.prototype.withScope=y.prototype.withTag,y.prototype.mock=y.prototype.mockTypes,y.prototype.pause=y.prototype.pauseLogs,y.prototype.resume=y.prototype.resumeLogs;var v,g=function(){function e(n){t(this,e),this.options=Object.assign({},n),this.defaultColor="#7f8c8d",this.levelColorMap={0:"#c0392b",1:"#f39c12",3:"#00BCD4"},this.typeColorMap={success:"#2ecc71"}}return n(e,[{key:"log",value:function(t){var e=t.level<1?console.__error||console.error:1===t.level&&console.warn?console.__warn||console.warn:console.__log||console.log,n="log"!==t.type?t.type:"",r=t.tag?t.tag:"",i=this.typeColorMap[t.type]||this.levelColorMap[t.level]||this.defaultColor,o="\n background: ".concat(i,";\n border-radius: 0.5em;\n color: white;\n font-weight: bold;\n padding: 2px 0.5em;\n "),a="%c".concat([r,n].filter(Boolean).join(":"));"string"==typeof t.args[0]?e.apply(void 0,["".concat(a,"%c ").concat(t.args[0]),o,""].concat(s(t.args.slice(1)))):e.apply(void 0,[a,o].concat(s(t.args)))}}]),e}();return"undefined"!=typeof window&&window.consola||((v=new y({reporters:[new g]})).Consola=y,v.LogLevel=l,v.BrowserReporter=g,v)}()})),$i=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},Bi=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),zi=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},qi=function(){function t(e,n,r,i){$i(this,t),this.name=e,this.fn=n,this.args=r,this.modifiers=i}return Bi(t,[{key:"_test",value:function(t){var e=this.fn;try{Hi(this.modifiers.slice(),e)(t)}catch(t){e=function(){return!1}}try{return Hi(this.modifiers.slice(),e)(t)}catch(t){return!1}}},{key:"_check",value:function(t){try{Hi(this.modifiers.slice(),this.fn)(t)}catch(t){if(Hi(this.modifiers.slice(),(function(t){return t}))(!1))return}if(!Hi(this.modifiers.slice(),this.fn)(t))throw null}},{key:"_testAsync",value:function(t){var e=this;return new Promise((function(n,r){Ji(e.modifiers.slice(),e.fn)(t).then((function(e){e?n(t):r(null)})).catch((function(t){return r(t)}))}))}}]),t}();function Wi(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"simple";return"object"==typeof t?t[e]:t}function Hi(t,e){if(t.length){var n=t.shift(),r=Hi(t,e);return n.perform(r)}return Wi(e)}function Ji(t,e){if(t.length){var n=t.shift(),r=Ji(t,e);return n.performAsync(r)}return function(t){return Promise.resolve(Wi(e,"async")(t))}}var Gi=function t(e,n,r){$i(this,t),this.name=e,this.perform=n,this.performAsync=r},Ki=function(t){function e(t,n,r,i){$i(this,e);for(var o=arguments.length,s=Array(o>4?o-4:0),a=4;a<o;a++)s[a-4]=arguments[a];var c=zi(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,s));return Error.captureStackTrace&&Error.captureStackTrace(c,e),c.rule=t,c.value=n,c.cause=r,c.target=i,c}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,Error),e}(),Zi=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];$i(this,t),this.chain=e,this.nextRuleModifiers=n}return Bi(t,[{key:"_applyRule",value:function(t,e){var n=this;return function(){for(var r=arguments.length,i=Array(r),o=0;o<r;o++)i[o]=arguments[o];return n.chain.push(new qi(e,t.apply(n,i),i,n.nextRuleModifiers)),n.nextRuleModifiers=[],n}}},{key:"_applyModifier",value:function(t,e){return this.nextRuleModifiers.push(new Gi(e,t.simple,t.async)),this}},{key:"_clone",value:function(){return new t(this.chain.slice(),this.nextRuleModifiers.slice())}},{key:"test",value:function(t){return this.chain.every((function(e){return e._test(t)}))}},{key:"testAll",value:function(t){var e=[];return this.chain.forEach((function(n){try{n._check(t)}catch(r){e.push(new Ki(n,t,r))}})),e}},{key:"check",value:function(t){this.chain.forEach((function(e){try{e._check(t)}catch(n){throw new Ki(e,t,n)}}))}},{key:"testAsync",value:function(t){var e=this;return new Promise((function(n,r){Qi(t,e.chain.slice(),n,r)}))}}]),t}();function Qi(t,e,n,r){if(e.length){var i=e.shift();i._testAsync(t).then((function(){Qi(t,e,n,r)}),(function(e){r(new Ki(i,t,e))}))}else n(t)}function Xi(){return to(new Zi)}var Yi={};function to(t){return new Proxy(t,{get:function(e,n){if(n in e)return e[n];var r=to(t._clone());return n in eo?r._applyModifier(eo[n],n):n in Yi?r._applyRule(Yi[n],n):n in ro?r._applyRule(ro[n],n):void 0}})}Xi.extend=function(t){Object.assign(Yi,t)},Xi.clearCustomRules=function(){Yi={}};var eo={not:{simple:function(t){return function(e){return!t(e)}},async:function(t){return function(e){return Promise.resolve(t(e)).then((function(t){return!t})).catch((function(t){return!0}))}}},some:{simple:function(t){return function(e){return no(e).some((function(e){try{return t(e)}catch(t){return!1}}))}},async:function(t){return function(e){return Promise.all(no(e).map((function(e){try{return t(e).catch((function(t){return!1}))}catch(t){return!1}}))).then((function(t){return t.some(Boolean)}))}}},every:{simple:function(t){return function(e){return no(e).every(t)}},async:function(t){return function(e){return Promise.all(no(e).map(t)).then((function(t){return t.every(Boolean)}))}}}};function no(t){return"string"==typeof t?t.split(""):t}var ro={equal:function(t){return function(e){return e==t}},exact:function(t){return function(e){return e===t}},number:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return function(e){return"number"==typeof e&&(t||isFinite(e))}},integer:function(){return function(t){return(Number.isInteger||oo)(t)}},numeric:function(){return function(t){return!isNaN(parseFloat(t))&&isFinite(t)}},string:function(){return io("string")},boolean:function(){return io("boolean")},undefined:function(){return io("undefined")},null:function(){return io("null")},array:function(){return io("array")},object:function(){return io("object")},instanceOf:function(t){return function(e){return e instanceof t}},pattern:function(t){return function(e){return t.test(e)}},lowercase:function(){return function(t){return/^([a-z]+\s*)+$/.test(t)}},uppercase:function(){return function(t){return/^([A-Z]+\s*)+$/.test(t)}},vowel:function(){return function(t){return/^[aeiou]+$/i.test(t)}},consonant:function(){return function(t){return/^(?=[^aeiou])([a-z]+)$/i.test(t)}},first:function(t){return function(e){return e[0]==t}},last:function(t){return function(e){return e[e.length-1]==t}},empty:function(){return function(t){return 0===t.length}},length:function(t,e){return function(n){return n.length>=t&&n.length<=(e||t)}},minLength:function(t){return function(e){return e.length>=t}},maxLength:function(t){return function(e){return e.length<=t}},negative:function(){return function(t){return t<0}},positive:function(){return function(t){return t>=0}},between:function(t,e){return function(n){return n>=t&&n<=e}},range:function(t,e){return function(n){return n>=t&&n<=e}},lessThan:function(t){return function(e){return e<t}},lessThanOrEqual:function(t){return function(e){return e<=t}},greaterThan:function(t){return function(e){return e>t}},greaterThanOrEqual:function(t){return function(e){return e>=t}},even:function(){return function(t){return t%2==0}},odd:function(){return function(t){return t%2!=0}},includes:function(t){return function(e){return~e.indexOf(t)}},schema:function(t){return function(t){return{simple:function(e){var n=[];if(Object.keys(t).forEach((function(r){var i=t[r];try{i.check((e||{})[r])}catch(t){t.target=r,n.push(t)}})),n.length>0)throw n;return!0},async:function(e){var n=[],r=Object.keys(t).map((function(r){return t[r].testAsync((e||{})[r]).catch((function(t){t.target=r,n.push(t)}))}));return Promise.all(r).then((function(t){if(n.length>0)throw n;return!0}))}}}(t)},passesAnyOf:function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(t){return e.some((function(e){return e.test(t)}))}},optional:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return function(n){return e&&"string"==typeof n&&""===n.trim()||null!=n&&t.check(n),!0}}};function io(t){return function(e){return Array.isArray(e)&&"array"===t||null===e&&"null"===t||typeof e===t}}function oo(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}Xi.extend({curieChain:()=>t=>Array.isArray(t)&&t[0]instanceof URL&&t.slice(1).every((t=>"string"==typeof t)),typeOf:t=>e=>typeof e===t});const so=Xi().schema({clear:Xi().typeOf("function"),getItem:Xi().typeOf("function"),key:Xi().typeOf("function"),length:Xi().number(),removeItem:Xi().typeOf("function"),setItem:Xi().typeOf("function")});class ao extends Error{constructor(t){ao.v8n.constructor.check(t),super(`authentication failed with code ${t.code}`),this.originalError=t.originalError,this.code=t.code}}ao.NEW_PASSWORD_REQUIRED="NEW_PASSWORD_REQUIRED",ao.INVALID_NEW_PASSWORD="INVALID_NEW_PASSWORD",ao.UNAUTHORIZED="UNAUTHORIZED",ao.UNKNOWN="UNKNOWN",ao.v8n={constructor:Xi().schema({code:Xi().passesAnyOf(Xi().exact(ao.NEW_PASSWORD_REQUIRED),Xi().exact(ao.INVALID_NEW_PASSWORD),Xi().exact(ao.UNAUTHORIZED),Xi().exact(ao.UNKNOWN))})};var co=ut(lt((function(t){function e(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}t.exports=function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t},t.exports.default=t.exports,t.exports.__esModule=!0}))),uo=lt((function(t){t.exports=function(t,e){return e.get?e.get.call(t):e.value},t.exports.default=t.exports,t.exports.__esModule=!0})),lo=lt((function(t){t.exports=function(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)},t.exports.default=t.exports,t.exports.__esModule=!0})),ho=ut(lt((function(t){t.exports=function(t,e){var n=lo(t,e,"get");return uo(t,n)},t.exports.default=t.exports,t.exports.__esModule=!0}))),fo=new WeakMap,po=function(){function t(){fo.set(this,{writable:!0,value:new Map})}var e=t.prototype;return e.key=function(t){t=Number.parseInt(t,10);for(var e=ho(this,fo).keys(),n=0,r=e.next();!r.done;){if(n===t)return r.value;n+=1,r=e.next()}return null},e.getItem=function(t){var e;return null!=(e=ho(this,fo).get(""+t))?e:null},e.setItem=function(t,e){ho(this,fo).set(""+t,""+e)},e.removeItem=function(t){ho(this,fo).delete(""+t)},e.clear=function(){ho(this,fo).clear()},co(t,[{key:"length",get:function(){return ho(this,fo).size}}]),t}();class yo extends Error{constructor(t){super(),yo.v8n.constructor.check(t),this.response=t}}yo.v8n={constructor:Xi().instanceOf(pt.Response)};var vo=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(t){o(t)}}function a(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))},go=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};function _o(t){const{json:e}=t,n=go(t,["json"]);if("_links"in e){const t=e._links;e._links=Object.entries(t).reduce(((t,[e,r])=>{if(Array.isArray(r))return Object.assign(Object.assign({},t),{[e]:r});const i=new xo(Object.assign(Object.assign({},n),{path:[new URL(r.href)]})),o={delete:i.delete.bind(i),follow:i.follow.bind(i),get:i.get.bind(i),patch:i.patch.bind(i),post:i.post.bind(i),put:i.put.bind(i)};return Object.assign(Object.assign({},t),{[e]:Object.assign(Object.assign({},r),o)})}),{})}if("_embedded"in e){const t=e._embedded;e._embedded=Object.entries(t).reduce(((t,[e,r])=>Object.assign(t,{[e]:Array.isArray(r)?r.map((t=>_o(Object.assign(Object.assign({},n),{json:t})))):_o(Object.assign(Object.assign({},n),{json:r}))})),{})}return e}class mo extends pt.Response{constructor(t){mo.v8n.constructor.check(t),super(t.body,t),this._console=t.console,this._fetch=t.fetch,this._cache=t.cache}json(){const t=Object.create(null,{json:{get:()=>super.json}});return vo(this,void 0,void 0,(function*(){const e=yield t.json.call(this),n={cache:this._cache,console:this._console,fetch:this._fetch};return _o(Object.assign({json:e},n))}))}}mo.v8n={constructor:Xi().schema({cache:so,console:Xi().instanceOf(Fi.constructor),fetch:Xi().typeOf("function")})};var bo=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(t){o(t)}}function a(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))};function wo(t,e){const n=""===t?"":t+":";return"string"==typeof e?n+e:Array.isArray(e)?e.map((e=>wo(t,e))).join():Object.entries(e).map((([t,e])=>wo(n+t,e))).join()}function So(t){return"string"==typeof t?t:Array.isArray(t)?t.map((t=>So(t))).join():Object.entries(t).map((([t,e])=>`${t} ${e}`)).join()}class xo{constructor(t){xo.v8n.classConstructor.check(t),this._path=t.path,this._fetch=t.fetch,this._cache=t.cache,this._console=t.console}get(t){return bo(this,void 0,void 0,(function*(){xo.v8n.get.check(t);const e=yield this._resolve(),{filters:n,fields:r,offset:i,limit:o,order:s,zoom:a}=null!=t?t:{};void 0!==n&&n.forEach((t=>{[...new URLSearchParams(t).entries()].forEach((([t,n])=>e.searchParams.append(t,n)))})),void 0!==r&&e.searchParams.set("fields",r.join(",")),void 0!==i&&e.searchParams.set("offset",String(i)),void 0!==o&&e.searchParams.set("limit",String(o)),void 0!==s&&e.searchParams.set("order",So(s)),void 0!==a&&e.searchParams.set("zoom",wo("",a));const c=yield this._fetch(new pt.Request(e.toString())),u={cache:this._cache,console:this._console,fetch:this._fetch};return new mo(Object.assign(Object.assign(Object.assign({},u),c),{body:yield c.text()}))}))}put(t){return bo(this,void 0,void 0,(function*(){const e=yield this._resolve(),n=new pt.Request(e.toString(),{body:JSON.stringify(t),method:"PUT"}),r=yield this._fetch(n),i={cache:this._cache,console:this._console,fetch:this._fetch};return new mo(Object.assign(Object.assign(Object.assign({},i),r),{body:yield r.text()}))}))}post(t){return bo(this,void 0,void 0,(function*(){const e=yield this._resolve(),n=new pt.Request(e.toString(),{body:JSON.stringify(t),method:"POST"}),r=yield this._fetch(n),i={cache:this._cache,console:this._console,fetch:this._fetch};return new mo(Object.assign(Object.assign(Object.assign({},i),r),{body:yield r.text()}))}))}patch(t){return bo(this,void 0,void 0,(function*(){const e=yield this._resolve(),n=new pt.Request(e.toString(),{body:JSON.stringify(t),method:"PATCH"}),r=yield this._fetch(n),i={cache:this._cache,console:this._console,fetch:this._fetch};return new mo(Object.assign(Object.assign(Object.assign({},i),r),{body:yield r.text()}))}))}delete(){return bo(this,void 0,void 0,(function*(){const t=yield this._resolve(),e=new pt.Request(t.toString(),{method:"DELETE"}),n=yield this._fetch(e),r={cache:this._cache,console:this._console,fetch:this._fetch};return new mo(Object.assign(Object.assign(Object.assign({},r),n),{body:yield n.text()}))}))}follow(t){xo.v8n.follow.check(t);const e={cache:this._cache,console:this._console,fetch:this._fetch},n=this._path.concat(t);return new xo(Object.assign(Object.assign({},e),{path:n}))}_resolve(){return bo(this,void 0,void 0,(function*(){if(1===this._path.length)return new URL(this._path[0].toString());const[t,e]=this._path,n=`${t.toString()} > ${e}`,r={cache:this._cache,console:this._console,fetch:this._fetch};this._console.trace(`Trying to resolve ${n}...`);const i=this._cache.getItem(n);if(i){this._console.success(`Resolved ${n} to ${i.toString()} using cache.`);const t=[new URL(i),...this._path.slice(2)];return new xo(Object.assign(Object.assign({},r),{path:t}))._resolve()}const o=yield this._fetch(t.toString());if(o.ok){const t=yield o.json(),i=new URL(t._links[e].href),s=[i,...this._path.slice(2)];return this._cache.setItem(n,i.toString()),this._console.trace(`Cached ${i.toString()} for ${n}.`),this._console.success(`Resolved ${n} to ${i.toString()} online.`),new xo(Object.assign(Object.assign({},r),{path:s}))._resolve()}throw this._console.error(`Failed to resolve ${n}.`),new yo(o)}))}}xo.v8n={classConstructor:Xi().schema({cache:so,console:Xi().instanceOf(Fi.constructor),fetch:Xi().typeOf("function"),path:Xi().curieChain()}),follow:Xi().string(),get:Xi().optional(Xi().schema({fields:Xi().optional(Xi().array().every.string()),filters:Xi().optional(Xi().array().every.string()),limit:Xi().optional(Xi().number()),offset:Xi().optional(Xi().number()),order:Xi().optional(Xi().passesAnyOf(Xi().string(),Xi().object(),Xi().array())),zoom:Xi().optional(Xi().passesAnyOf(Xi().string(),Xi().object(),Xi().array()))}))},xo.ResolutionError=yo,xo.Response=mo;var Oo=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(t){o(t)}}function a(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))};class jo extends xo{constructor(t){var e,n,r;jo.v8n.classConstructor.check(t),super({cache:null!==(e=t.cache)&&void 0!==e?e:new po,console:Fi.create({level:t.level}).withTag("@foxy.io/sdk"),fetch:null!==(n=t.fetch)&&void 0!==n?n:pt.fetch,path:[t.base]}),this.console=this._console,this.storage=null!==(r=t.storage)&&void 0!==r?r:new po,this.cache=this._cache,this.base=t.base}fetch(...t){return Oo(this,void 0,void 0,(function*(){return this._fetch(...t)}))}}jo.WHATWGResponse=pt.Response,jo.WHATWGRequest=pt.Request,jo.WHATWGHeaders=pt.Headers,jo.whatwgFetch=pt.fetch,jo.AuthError=ao,jo.Node=xo,jo.v8n={classConstructor:Xi().schema({base:Xi().instanceOf(URL),cache:Xi().optional(so),fetch:Xi().optional(Xi().typeOf("function")),level:Xi().optional(Xi().integer()),storage:Xi().optional(so)})};export{Gt as $,jo as A,xn as B,bt as C,Kt as D,le as E,ft as F,ve as G,ae as H,ee as I,te as J,zt as K,rt as L,Xt as M,Ht as N,ie as O,re as P,Dt as Q,Mi as R,nn as S,s as T,Bt as U,Ut as V,fe as W,De as X,Wt as Y,Vt as Z,ot as _,P as a,Ii as a$,qt as a0,Ft as a1,Jt as a2,he as a3,Ze as a4,Xe as a5,_t as a6,gt as a7,Qe as a8,be as a9,Vn as aA,zn as aB,rr as aC,ar as aD,ur as aE,sr as aF,hr as aG,Nr as aH,Cr as aI,Ur as aJ,An as aK,ui as aL,si as aM,ii as aN,li as aO,Si as aP,kn as aQ,Ln as aR,wi as aS,Pr as aT,xr as aU,wr as aV,oi as aW,Mn as aX,hi as aY,fr as aZ,ln as a_,we as aa,Se as ab,xe as ac,Ee as ad,Pe as ae,Ae as af,ke as ag,Ne as ah,Ce as ai,Oe as aj,Ie as ak,Le as al,Ve as am,Ue as an,N as ao,g as ap,hn as aq,Y as ar,A as as,u as at,e as au,n as av,at as aw,F as ax,tt as ay,Xi as az,Te as b,et as c,y as d,Gr as e,lt as f,ut as g,M as h,ct as i,ht as j,pt as k,I as l,wn as m,r as n,S as o,dt as p,rn as q,Yt as r,Ye as s,Vi as t,vt as u,Ge as v,Rt as w,Re as x,ye as y,Mt as z};
|
|
173
|
+
***************************************************************************** */function yt(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}function vt(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function gt(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function _t(t,e){for(var n=0,r=e.length,i=t.length;n<r;n++,i++)t[i]=e[n];return t}var mt={};function bt(t){return Object.keys(t)}function wt(t,e,n){void 0===n&&(n=".");var r=Ot(t,n),i=Ot(e,n);return Ft(i)?!!Ft(r)&&i===r:Ft(r)?r in i:bt(r).every((function(t){return t in i&&wt(r[t],i[t])}))}function St(t){try{return Ft(t)||"number"==typeof t?""+t:t.type}catch(t){throw new Error("Events must be strings or objects with a string event.type property.")}}function xt(t,e){try{return Vt(t)?t:t.toString().split(e)}catch(e){throw new Error("'"+t+"' is not a valid state path.")}}function Ot(t,e){return"object"==typeof(n=t)&&"value"in n&&"context"in n&&"event"in n&&"_event"in n?t.value:Vt(t)?jt(t):"string"!=typeof t?t:jt(xt(t,e));var n}function jt(t){if(1===t.length)return t[0];for(var e={},n=e,r=0;r<t.length-1;r++)r===t.length-2?n[t[r]]=t[r+1]:(n[t[r]]={},n=n[t[r]]);return e}function Et(t,e){for(var n={},r=bt(t),i=0;i<r.length;i++){var o=r[i];n[o]=e(t[o],o,t,i)}return n}function Pt(t,e,n){var r,i,o={};try{for(var s=vt(bt(t)),a=s.next();!a.done;a=s.next()){var c=a.value,u=t[c];n(u)&&(o[c]=e(u,c,t))}}catch(t){r={error:t}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return o}var At=function(t){return function(e){var n,r,i=e;try{for(var o=vt(t),s=o.next();!s.done;s=o.next()){i=i[s.value]}}catch(t){n={error:t}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i}};function kt(t){return t?Ft(t)?[[t]]:Tt(bt(t).map((function(e){var n=t[e];return"string"==typeof n||n&&Object.keys(n).length?kt(t[e]).map((function(t){return[e].concat(t)})):[[e]]}))):[[]]}function Tt(t){var e;return(e=[]).concat.apply(e,_t([],gt(t)))}function Nt(t){return Vt(t)?t:[t]}function Ct(t){return void 0===t?[]:Nt(t)}function Rt(t,e,n){var r,i;if(Mt(t))return t(e,n.data);var o={};try{for(var s=vt(Object.keys(t)),a=s.next();!a.done;a=s.next()){var c=a.value,u=t[c];Mt(u)?o[c]=u(e,n.data):o[c]=u}}catch(t){r={error:t}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return o}function Dt(t){return t instanceof Promise||!(null===t||!Mt(t)&&"object"!=typeof t||!Mt(t.then))}function Ut(t){return null!==t&&"object"==typeof t&&"transition"in t&&"function"==typeof t.transition}function It(t,e){var n,r,i=gt([[],[]],2),o=i[0],s=i[1];try{for(var a=vt(t),c=a.next();!c.done;c=a.next()){var u=c.value;e(u)?o.push(u):s.push(u)}}catch(t){n={error:t}}finally{try{c&&!c.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return[o,s]}function Lt(t,e){return Et(t.states,(function(t,n){if(t){var r=(Ft(e)?void 0:e[n])||(t?t.current:void 0);if(r)return{current:r,states:Lt(t,r)}}}))}function Vt(t){return Array.isArray(t)}function Mt(t){return"function"==typeof t}function Ft(t){return"string"==typeof t}function $t(t,e){if(t)return Ft(t)?{type:"xstate.guard",name:t,predicate:e?e[t]:void 0}:Mt(t)?{type:"xstate.guard",name:t.name,predicate:t}:t}function Bt(t){try{return"subscribe"in t&&Mt(t.subscribe)}catch(t){return!1}}var zt,qt,Wt=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}();function Ht(t){try{return"__xstatenode"in t}catch(t){return!1}}function Jt(t){return!!t&&"function"==typeof t.send}function Gt(t,e){return Ft(t)||"number"==typeof t?dt({type:t},e):t}function Kt(t,e){if(!Ft(t)&&"$$type"in t&&"scxml"===t.$$type)return t;var n=Gt(t);return dt({name:n.type,data:n,$$type:"scxml",type:"external"},e)}function Zt(t,e){return Nt(e).map((function(e){return void 0===e||"string"==typeof e||Ht(e)?{target:e,event:t}:dt(dt({},e),{event:t})}))}function Qt(t,e,n,r,i){var o=t.options.guards,s={state:i,cond:e,_event:r};if("xstate.guard"===e.type)return e.predicate(n,r.data,s);var a=o[e.type];if(!a)throw new Error("Guard '"+e.type+"' is not implemented on machine '"+t.id+"'.");return a(n,r.data,s)}function Xt(t){return"string"==typeof t?{type:t}:t}function Yt(t,e,n){if("object"==typeof t)return t;var r=function(){};return{next:t,error:e||r,complete:n||r}}!function(t){t.Start="xstate.start",t.Stop="xstate.stop",t.Raise="xstate.raise",t.Send="xstate.send",t.Cancel="xstate.cancel",t.NullEvent="",t.Assign="xstate.assign",t.After="xstate.after",t.DoneState="done.state",t.DoneInvoke="done.invoke",t.Log="xstate.log",t.Init="xstate.init",t.Invoke="xstate.invoke",t.ErrorExecution="error.execution",t.ErrorCommunication="error.communication",t.ErrorPlatform="error.platform",t.ErrorCustom="xstate.error",t.Update="xstate.update",t.Pure="xstate.pure",t.Choose="xstate.choose"}(zt||(zt={})),function(t){t.Parent="#_parent",t.Internal="#_internal"}(qt||(qt={}));var te=zt.Start,ee=zt.Stop,ne=zt.Raise,re=zt.Send,ie=zt.Cancel,oe=zt.NullEvent,se=zt.Assign;zt.After,zt.DoneState;var ae=zt.Log,ce=zt.Init,ue=zt.Invoke;zt.ErrorExecution;var le=zt.ErrorPlatform,he=zt.ErrorCustom,fe=zt.Update,pe=zt.Choose,de=zt.Pure,ye=Kt({type:ce});function ve(t,e){return e&&e[t]||void 0}function ge(t,e){var n;if(Ft(t)||"number"==typeof t){var r=ve(t,e);n=Mt(r)?{type:t,exec:r}:r||{type:t,exec:void 0}}else if(Mt(t))n={type:t.name||t.toString(),exec:t};else{if(Mt(r=ve(t.type,e)))n=dt(dt({},t),{exec:r});else if(r){var i=r.type||t.type;n=dt(dt(dt({},r),t),{type:i})}else n=t}return Object.defineProperty(n,"toString",{value:function(){return n.type},enumerable:!1,configurable:!0}),n}var _e=function(t,e){return t?(Vt(t)?t:[t]).map((function(t){return ge(t,e)})):[]};function me(t){var e=ge(t);return dt(dt({id:Ft(t)?t:e.id},e),{type:e.type})}function be(t){return Ft(t)?{type:ne,event:t}:we(t,{to:qt.Internal})}function we(t,e){return{to:e?e.to:void 0,type:re,event:Mt(t)?t:Gt(t),delay:e?e.delay:void 0,id:e&&void 0!==e.id?e.id:Mt(t)?t.name:St(t)}}function Se(t,e){return we(t,dt(dt({},e),{to:qt.Parent}))}function xe(){return Se(fe)}function Oe(t,e){return we(t,dt(dt({},e),{to:function(t,e,n){return n._event.origin}}))}var je=function(t,e){return{context:t,event:e}};function Ee(t,e){return void 0===t&&(t=je),{type:ae,label:e,expr:t}}var Pe=function(t){return{type:ie,sendId:t}};function Ae(t){var e=me(t);return{type:zt.Start,activity:e,exec:void 0}}function ke(t){var e=Mt(t)?t:me(t);return{type:zt.Stop,activity:e,exec:void 0}}var Te=function(t){return{type:se,assignment:t}};function Ne(t,e){var n=e?"#"+e:"";return zt.After+"("+t+")"+n}function Ce(t,e){var n=zt.DoneState+"."+t,r={type:n,data:e,toString:function(){return n}};return r}function Re(t,e){var n=zt.DoneInvoke+"."+t,r={type:n,data:e,toString:function(){return n}};return r}function De(t,e){var n=zt.ErrorPlatform+"."+t,r={type:n,data:e,toString:function(){return n}};return r}function Ue(t){return{type:zt.Pure,get:t}}function Ie(t,e){return we((function(t,e){return e}),dt(dt({},e),{to:t}))}function Le(t,e){return Se((function(e,n,r){return{type:he,data:Mt(t)?t(e,n,r):t}}),dt(dt({},e),{to:qt.Parent}))}function Ve(t){return{type:zt.Choose,conds:t}}function Me(t,e,n,r,i){var o=gt(It(i,(function(t){return t.type===se})),2),s=o[0],a=o[1],c=s.length?function(t,e,n,r){return t?n.reduce((function(t,n){var i,o,s=n.assignment,a={state:r,action:n,_event:e},c={};if(Mt(s))c=s(t,e.data,a);else try{for(var u=vt(bt(s)),l=u.next();!l.done;l=u.next()){var h=l.value,f=s[h];c[h]=Mt(f)?f(t,e.data,a):f}}catch(t){i={error:t}}finally{try{l&&!l.done&&(o=u.return)&&o.call(u)}finally{if(i)throw i.error}}return Object.assign({},t,c)}),t):t}(n,r,s,e):n;return[Tt(a.map((function(n){var i;switch(n.type){case ne:return{type:ne,_event:Kt(n.event)};case re:return function(t,e,n,r){var i,o={_event:n},s=Kt(Mt(t.event)?t.event(e,n.data,o):t.event);if(Ft(t.delay)){var a=r&&r[t.delay];i=Mt(a)?a(e,n.data,o):a}else i=Mt(t.delay)?t.delay(e,n.data,o):t.delay;var c=Mt(t.to)?t.to(e,n.data,o):t.to;return dt(dt({},t),{to:c,_event:s,event:s.data,delay:i})}(n,c,r,t.options.delays);case ae:return function(t,e,n){return dt(dt({},t),{value:Ft(t.expr)?t.expr:t.expr(e,n.data,{_event:n})})}(n,c,r);case pe:if(!(s=null===(i=n.conds.find((function(n){var i=$t(n.cond,t.options.guards);return!i||Qt(t,i,c,r,e)})))||void 0===i?void 0:i.actions))return[];var o=Me(t,e,c,r,_e(Ct(s),t.options.actions));return c=o[1],o[0];case de:var s;if(!(s=n.get(c,r.data)))return[];o=Me(t,e,c,r,_e(Ct(s),t.options.actions));return c=o[1],o[0];case ee:return function(t,e,n){var r=Mt(t.activity)?t.activity(e,n.data):t.activity,i="string"==typeof r?{id:r}:r;return{type:zt.Stop,activity:i}}(n,c,r);default:return ge(n,t.options.actions)}}))),c]}var Fe=function(t){return"atomic"===t.type||"final"===t.type};function $e(t){return bt(t.states).map((function(e){return t.states[e]}))}function Be(t){var e=[t];return Fe(t)?e:e.concat(Tt($e(t).map(Be)))}function ze(t,e){var n,r,i,o,s,a,c,u,l=We(new Set(t)),h=new Set(e);try{for(var f=vt(h),p=f.next();!p.done;p=f.next())for(var d=(x=p.value).parent;d&&!h.has(d);)h.add(d),d=d.parent}catch(t){n={error:t}}finally{try{p&&!p.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}var y=We(h);try{for(var v=vt(h),g=v.next();!g.done;g=v.next()){if("compound"!==(x=g.value).type||y.get(x)&&y.get(x).length){if("parallel"===x.type)try{for(var _=(s=void 0,vt($e(x))),m=_.next();!m.done;m=_.next()){var b=m.value;"history"!==b.type&&(h.has(b)||(h.add(b),l.get(b)?l.get(b).forEach((function(t){return h.add(t)})):b.initialStateNodes.forEach((function(t){return h.add(t)}))))}}catch(t){s={error:t}}finally{try{m&&!m.done&&(a=_.return)&&a.call(_)}finally{if(s)throw s.error}}}else l.get(x)?l.get(x).forEach((function(t){return h.add(t)})):x.initialStateNodes.forEach((function(t){return h.add(t)}))}}catch(t){i={error:t}}finally{try{g&&!g.done&&(o=v.return)&&o.call(v)}finally{if(i)throw i.error}}try{for(var w=vt(h),S=w.next();!S.done;S=w.next()){var x;for(d=(x=S.value).parent;d&&!h.has(d);)h.add(d),d=d.parent}}catch(t){c={error:t}}finally{try{S&&!S.done&&(u=w.return)&&u.call(w)}finally{if(c)throw c.error}}return h}function qe(t,e){var n=e.get(t);if(!n)return{};if("compound"===t.type){var r=n[0];if(!r)return{};if(Fe(r))return r.key}var i={};return n.forEach((function(t){i[t.key]=qe(t,e)})),i}function We(t){var e,n,r=new Map;try{for(var i=vt(t),o=i.next();!o.done;o=i.next()){var s=o.value;r.has(s)||r.set(s,[]),s.parent&&(r.has(s.parent)||r.set(s.parent,[]),r.get(s.parent).push(s))}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r}function He(t,e){return qe(t,We(ze([t],e)))}function Je(t,e){return Array.isArray(t)?t.some((function(t){return t===e})):t instanceof Set&&t.has(e)}function Ge(t,e){return"compound"===e.type?$e(e).some((function(e){return"final"===e.type&&Je(t,e)})):"parallel"===e.type&&$e(e).every((function(e){return Ge(t,e)}))}function Ke(t,e){if(t===e)return!0;if(void 0===t||void 0===e)return!1;if(Ft(t)||Ft(e))return t===e;var n=bt(t),r=bt(e);return n.length===r.length&&n.every((function(n){return Ke(t[n],e[n])}))}function Ze(t){return!Ft(t)&&("value"in t&&"history"in t)}function Qe(t,e){var n=t.exec;return dt(dt({},t),{exec:void 0!==n?function(){return n(e.context,e.event,{action:t,state:e,_event:e._event})}:void 0})}var Xe=function(){function t(t){var e,n,r=this;this.actions=[],this.activities=mt,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||mt,this.meta=(void 0===(n=t.configuration)&&(n=[]),n.reduce((function(t,e){return void 0!==e.meta&&(t[e.id]=e.meta),t}),{})),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=t.tags)&&void 0!==e?e:new Set,Object.defineProperty(this,"nextEvents",{get:function(){return function(t){return _t([],gt(new Set(Tt(_t([],gt(t.map((function(t){return t.ownEvents}))))))))}(r.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:ye,_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 r=ye;return new t({value:e.value,context:n,_event:r,_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="."),Ft(t))return[t];var r=bt(t);return r.concat.apply(r,_t([],gt(r.map((function(r){return n.toStrings(t[r],e).map((function(t){return r+e+t}))})))))},t.prototype.toJSON=function(){var t=this;t.configuration,t.transitions;var e=t.tags,n=yt(t,["configuration","transitions","tags"]);return dt(dt({},n),{tags:Array.from(e)})},t.prototype.matches=function(t){return wt(t,this.value)},t.prototype.hasTag=function(t){return this.tags.has(t)},t}(),Ye=function(t,e){return e(t)};function tn(t){return{id:t,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},getSnapshot:function(){},toJSON:function(){return{id:t}}}}function en(t,e,n,r){var i,o=Xt(t.src),s=null===(i=null==e?void 0:e.options.services)||void 0===i?void 0:i[o.type],a=t.data?Rt(t.data,n,r):void 0,c=s?function(t,e,n){var r=tn(e);if(r.deferred=!0,Ht(t)){var i=r.state=Ye(void 0,(function(){return(n?t.withContext(n):t).initialState}));r.getSnapshot=function(){return i}}return r}(s,t.id,a):tn(t.id);return c.meta=t,c}function nn(t){return function(t){try{return"function"==typeof t.send}catch(t){return!1}}(t)&&"id"in t}function rn(t){return dt({subscribe:function(){return{unsubscribe:function(){}}},id:"anonymous",getSnapshot:function(){}},t)}function on(t){if("string"==typeof t){var e={type:t,toString:function(){return t}};return e}return t}function sn(t){return dt(dt({type:ue},t),{toJSON:function(){t.onDone,t.onError;var e=yt(t,["onDone","onError"]);return dt(dt({},e),{type:ue,src:on(t.src)})}})}var an={},cn=function(t){return"#"===t[0]},un=function(){function t(e,n,r){var i,o=this;void 0===r&&(r=e.context),this.config=e,this._context=r,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=this.options._parent,this.key=this.config.key||this.options._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||_t([this.machine.key],gt(this.path)).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&&bt(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.schema=this.parent?this.machine.schema:null!==(i=this.config.schema)&&void 0!==i?i:{},this.initial=this.config.initial,this.states=this.config.states?Et(this.config.states,(function(e,n){var r,i=new t(e,{_parent:o,_key:n});return Object.assign(o.idMap,dt(((r={})[i.id]=i,r),i.idMap)),i})):an;var s=0;!function t(e){var n,r;e.order=s++;try{for(var i=vt($e(e)),o=i.next();!o.done;o=i.next()){t(o.value)}}catch(t){n={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}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=Ct(this.config.entry||this.config.onEntry).map((function(t){return ge(t)})),this.onExit=Ct(this.config.exit||this.config.onExit).map((function(t){return ge(t)})),this.meta=this.config.meta,this.doneData="final"===this.type?this.config.data:void 0,this.invoke=Ct(this.config.invoke).map((function(t,e){var n,r;if(Ht(t))return o.machine.options.services=dt(((n={})[t.id]=t,n),o.machine.options.services),sn({src:t.id,id:t.id});if(Ft(t.src))return sn(dt(dt({},t),{id:t.id||t.src,src:t.src}));if(Ht(t.src)||Mt(t.src)){var i=o.id+":invocation["+e+"]";return o.machine.options.services=dt(((r={})[i]=t.src,r),o.machine.options.services),sn(dt(dt({id:i},t),{src:i}))}var s=t.src;return sn(dt(dt({id:s.type},t),{src:s}))})),this.activities=Ct(this.config.activities).concat(this.invoke).map((function(t){return me(t)})),this.transition=this.transition.bind(this),this.tags=Ct(this.config.tags)}return t.prototype._init=function(){this.__cache.transitions||Be(this).forEach((function(t){return t.on}))},t.prototype.withConfig=function(e,n){var r=this.options,i=r.actions,o=r.activities,s=r.guards,a=r.services,c=r.delays;return new t(this.config,{actions:dt(dt({},i),e.actions),activities:dt(dt({},o),e.activities),guards:dt(dt({},s),e.guards),services:dt(dt({},a),e.services),delays:dt(dt({},c),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 Mt(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:Et(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}},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 r=n.eventType===t;return e?r:r||"*"===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=Ne(Mt(e)?t.id+":delay["+n+"]":e,t.id);return t.onEntry.push(we(r,{delay:e})),t.onExit.push(Pe(r)),r};return(Vt(e)?e.map((function(t,e){var r=n(t.delay,e);return dt(dt({},t),{event:r})})):Tt(bt(e).map((function(t,r){var i=e[t],o=Ft(i)?{target:i}:i,s=isNaN(+t)?t:+t,a=n(s,r);return Ct(o).map((function(t){return dt(dt({},t),{event:a,delay:s})}))})))).map((function(e){var n=e.delay;return dt(dt({},t.formatTransition(e)),{delay:n})}))},t.prototype.getStateNodes=function(t){var e,n=this;if(!t)return[];var r=t instanceof Xe?t.value:Ot(t,this.delimiter);if(Ft(r)){var i=this.getStateNode(r).initial;return void 0!==i?this.getStateNodes(((e={})[r]=i,e)):[this,this.states[r]]}var o=bt(r),s=o.map((function(t){return n.getStateNode(t)}));return s.push(this),s.concat(o.reduce((function(t,e){var i=n.getStateNode(e).getStateNodes(r[e]);return t.concat(i)}),[]))},t.prototype.handles=function(t){var e=St(t);return this.events.includes(e)},t.prototype.resolveState=function(t){var e=Array.from(ze([],this.getStateNodes(t.value)));return new Xe(dt(dt({},t),{value:this.resolve(t.value),configuration:e,done:Ge(e,this)}))},t.prototype.transitionLeafNode=function(t,e,n){var r=this.getStateNode(t).next(e,n);return r&&r.transitions.length?r:this.next(e,n)},t.prototype.transitionCompoundNode=function(t,e,n){var r=bt(t),i=this.getStateNode(r[0])._transition(t[r[0]],e,n);return i&&i.transitions.length?i:this.next(e,n)},t.prototype.transitionParallelNode=function(t,e,n){var r,i,o={};try{for(var s=vt(bt(t)),a=s.next();!a.done;a=s.next()){var c=a.value,u=t[c];if(u){var l=this.getStateNode(c)._transition(u,e,n);l&&(o[c]=l)}}}catch(t){r={error:t}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}var h=bt(o).map((function(t){return o[t]})),f=Tt(h.map((function(t){return t.transitions})));if(!h.some((function(t){return t.transitions.length>0})))return this.next(e,n);var p=Tt(h.map((function(t){return t.entrySet}))),d=Tt(bt(o).map((function(t){return o[t].configuration})));return{transitions:f,entrySet:p,exitSet:Tt(h.map((function(t){return t.exitSet}))),configuration:d,source:e,actions:Tt(bt(o).map((function(t){return o[t].actions})))}},t.prototype._transition=function(t,e,n){return Ft(t)?this.transitionLeafNode(t,e,n):1===bt(t).length?this.transitionCompoundNode(t,e,n):this.transitionParallelNode(t,e,n)},t.prototype.next=function(t,e){var n,r,i,o=this,s=e.name,a=[],c=[];try{for(var u=vt(this.getCandidates(s)),l=u.next();!l.done;l=u.next()){var h=l.value,f=h.cond,p=h.in,d=t.context,y=!p||(Ft(p)&&cn(p)?t.matches(Ot(this.getStateNodeById(p).path,this.delimiter)):wt(Ot(p,this.delimiter),At(this.path.slice(0,-2))(t.value))),v=!1;try{v=!f||Qt(this.machine,f,d,e,t)}catch(t){throw new Error("Unable to evaluate guard '"+(f.name||f.type)+"' in transition for event '"+s+"' in state node '"+this.id+"':\n"+t.message)}if(v&&y){void 0!==h.target&&(c=h.target),a.push.apply(a,_t([],gt(h.actions))),i=h;break}}}catch(t){n={error:t}}finally{try{l&&!l.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}if(i){if(!c.length)return{transitions:[i],entrySet:[],exitSet:[],configuration:t.value?[this]:[],source:t,actions:a};var g=Tt(c.map((function(e){return o.getRelativeStateNodes(e,t.historyValue)}))),_=!!i.internal;return{transitions:[i],entrySet:_?[]:Tt(g.map((function(t){return o.nodesFromChild(t)}))),exitSet:_?[]:[this],configuration:g,source:t,actions:a}}},t.prototype.nodesFromChild=function(t){if(t.escapes(this))return[];for(var e=[],n=t;n&&n!==this;)e.push(n),n=n.parent;return e.push(this),e},t.prototype.escapes=function(t){if(this===t)return!1;for(var e=this.parent;e;){if(e===t)return!1;e=e.parent}return!0},t.prototype.getActions=function(t,e,n,r){var i,o,s,a,c=ze([],r?this.getStateNodes(r.value):[this]),u=t.configuration.length?ze(c,t.configuration):c;try{for(var l=vt(u),h=l.next();!h.done;h=l.next()){Je(c,d=h.value)||t.entrySet.push(d)}}catch(t){i={error:t}}finally{try{h&&!h.done&&(o=l.return)&&o.call(l)}finally{if(i)throw i.error}}try{for(var f=vt(c),p=f.next();!p.done;p=f.next()){var d;Je(u,d=p.value)&&!Je(t.exitSet,d.parent)||t.exitSet.push(d)}}catch(t){s={error:t}}finally{try{p&&!p.done&&(a=f.return)&&a.call(f)}finally{if(s)throw s.error}}t.source||(t.exitSet=[],t.entrySet.push(this));var y=Tt(t.entrySet.map((function(r){var i=[];if("final"!==r.type)return i;var o=r.parent;if(!o.parent)return i;i.push(Ce(r.id,r.doneData),Ce(o.id,r.doneData?Rt(r.doneData,e,n):void 0));var s=o.parent;return"parallel"===s.type&&$e(s).every((function(e){return Ge(t.configuration,e)}))&&i.push(Ce(s.id)),i})));t.exitSet.sort((function(t,e){return e.order-t.order})),t.entrySet.sort((function(t,e){return t.order-e.order}));var v=new Set(t.entrySet),g=new Set(t.exitSet),_=gt([Tt(Array.from(v).map((function(t){return _t(_t([],gt(t.activities.map((function(t){return Ae(t)})))),gt(t.onEntry))}))).concat(y.map(be)),Tt(Array.from(g).map((function(t){return _t(_t([],gt(t.onExit)),gt(t.activities.map((function(t){return ke(t)}))))})))],2),m=_[0],b=_[1];return _e(b.concat(t.actions).concat(m),this.machine.options.actions)},t.prototype.transition=function(t,e,n){void 0===t&&(t=this.initialState);var r,i,o=Kt(e);if(t instanceof Xe)r=void 0===n?t:this.resolveState(Xe.from(t,n));else{var s=Ft(t)?this.resolve(jt(this.getResolvedPath(t))):this.resolve(t),a=null!=n?n:this.machine.context;r=this.resolveState(Xe.from(s,a))}if(this.strict&&!this.events.includes(o.name)&&(i=o.name,!/^(done|error)\./.test(i)))throw new Error("Machine '"+this.id+"' does not accept event '"+o.name+"'");var c=this._transition(r.value,r,o)||{transitions:[],configuration:[],entrySet:[],exitSet:[],source:r,actions:[]},u=ze([],this.getStateNodes(r.value)),l=c.configuration.length?ze(u,c.configuration):u;return c.configuration=_t([],gt(l)),this.resolveTransition(c,r,o)},t.prototype.resolveRaisedTransition=function(t,e,n){var r,i=t.actions;return(t=this.transition(t,e))._event=n,t.event=n.data,(r=t.actions).unshift.apply(r,_t([],gt(i))),t},t.prototype.resolveTransition=function(t,e,n,r){var i,o,s=this;void 0===n&&(n=ye),void 0===r&&(r=this.machine.context);var a=t.configuration,c=!e||t.transitions.length>0,u=c?He(this.machine,a):void 0,l=e?e.historyValue?e.historyValue:t.source?this.machine.historyValue(e.value):void 0:void 0,h=e?e.context:r,f=this.getActions(t,h,n,e),p=e?dt({},e.activities):{};try{for(var d=vt(f),y=d.next();!y.done;y=d.next()){var v=y.value;v.type===te?p[v.activity.id||v.activity.type]=v:v.type===ee&&(p[v.activity.id||v.activity.type]=!1)}}catch(t){i={error:t}}finally{try{y&&!y.done&&(o=d.return)&&o.call(d)}finally{if(i)throw i.error}}var g,_,m=gt(Me(this,e,h,n,f),2),b=m[0],w=m[1],S=gt(It(b,(function(t){return t.type===ne||t.type===re&&t.to===qt.Internal})),2),x=S[0],O=S[1],j=b.filter((function(t){var e;return t.type===te&&(null===(e=t.activity)||void 0===e?void 0:e.type)===ue})).reduce((function(t,e){return t[e.activity.id]=en(e.activity,s.machine,w,n),t}),e?dt({},e.children):{}),E=u?t.configuration:e?e.configuration:[],P=Ge(E,this),A=new Xe({value:u||e.value,context:w,_event:n,_sessionid:e?e._sessionid:null,historyValue:u?l?(g=l,_=u,{current:_,states:Lt(g,_)}):void 0:e?e.historyValue:void 0,history:!u||t.source?e:void 0,actions:u?O:[],activities:u?p:e?e.activities:{},events:[],configuration:E,transitions:t.transitions,children:j,done:P,tags:null==e?void 0:e.tags}),k=h!==w;A.changed=n.name===fe||k;var T=A.history;T&&delete T.history;var N=!P&&(this._transient||a.some((function(t){return t._transient})));if(!(c||N&&""!==n.name))return A;var C=A;if(!P)for(N&&(C=this.resolveRaisedTransition(C,{type:oe},n));x.length;){var R=x.shift();C=this.resolveRaisedTransition(C,R._event,n)}var D=C.changed||(T?!!C.actions.length||k||typeof T.value!=typeof C.value||!Ke(C.value,T.value):void 0);return C.changed=D,C.history=T,C.tags=new Set(Tt(C.configuration.map((function(t){return t.tags})))),C},t.prototype.getStateNode=function(t){if(cn(t))return this.machine.getStateNodeById(t);if(!this.states)throw new Error("Unable to retrieve child state '"+t+"' from '"+this.id+"'; no child states exist.");var e=this.states[t];if(!e)throw new Error("Child state '"+t+"' does not exist on '"+this.id+"'");return e},t.prototype.getStateNodeById=function(t){var e=cn(t)?t.slice("#".length):t;if(e===this.id)return this;var n=this.machine.idMap[e];if(!n)throw new Error("Child state node '#"+e+"' does not exist on machine '"+this.id+"'");return n},t.prototype.getStateNodeByPath=function(t){if("string"==typeof t&&cn(t))try{return this.getStateNodeById(t.slice(1))}catch(t){}for(var e=xt(t,this.delimiter).slice(),n=this;e.length;){var r=e.shift();if(!r.length)break;n=n.getStateNode(r)}return n},t.prototype.resolve=function(t){var e,n=this;if(!t)return this.initialStateValue||an;switch(this.type){case"parallel":return Et(this.initialStateValue,(function(e,r){return e?n.getStateNode(r).resolve(t[r]||e):an}));case"compound":if(Ft(t)){var r=this.getStateNode(t);return"parallel"===r.type||"compound"===r.type?((e={})[t]=r.initialStateValue,e):t}return bt(t).length?Et(t,(function(t,e){return t?n.getStateNode(e).resolve(t):an})):this.initialStateValue||{};default:return t||an}},t.prototype.getResolvedPath=function(t){if(cn(t)){var e=this.machine.idMap[t.slice("#".length)];if(!e)throw new Error("Unable to find state node '"+t+"'");return e.path}return xt(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=Pt(this.states,(function(t){return t.initialStateValue||an}),(function(t){return!("history"===t.type)}));else if(void 0!==this.initial){if(!this.states[this.initial])throw new Error("Initial state '"+this.initial+"' not found on '"+this.key+"'");e=Fe(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){var n=this.getStateNodes(t);return this.resolveTransition({configuration:n,entrySet:n,exitSet:[],transitions:[],source:void 0,actions:[]},void 0,void 0,e)},Object.defineProperty(t.prototype,"initialState",{get:function(){this._init();var t=this.initialStateValue;if(!t)throw new Error("Cannot retrieve initial state from simple state '"+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=Ft(e.target)&&cn(e.target)?jt(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 Fe(this)?[this]:"compound"!==this.type||this.initial?Tt(kt(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=gt(t),n=e[0],r=e.slice(1);if(!this.states)throw new Error("Cannot retrieve subPath '"+n+"' from node with no states");var i=this.getStateNode(n);if("history"===i.type)return i.resolveHistory();if(!this.states[n])throw new Error("Child state '"+n+"' does not exist on '"+this.id+"'");return this.states[n].getFromRelativePath(r)},t.prototype.historyValue=function(t){if(bt(this.states).length)return{current:t||this.initialStateValue,states:Pt(this.states,(function(e,n){if(!t)return e.historyValue();var r=Ft(t)?void 0:t[n];return e.historyValue(r||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 r=this.target;return r?Tt(kt(r).map((function(t){return n.getFromRelativePath(t)}))):n.initialStateNodes}var i,o,s=(i=n.path,o="states",function(t){var e,n,r=t;try{for(var s=vt(i),a=s.next();!a.done;a=s.next()){var c=a.value;r=r[o][c]}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}return r})(t).current;return Ft(s)?[n.getStateNode(s)]:Tt(kt(s).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=Tt(bt(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,r;if(this.__cache.events)return this.__cache.events;var i=this.states,o=new Set(this.ownEvents);if(i)try{for(var s=vt(bt(i)),a=s.next();!a.done;a=s.next()){var c=i[a.value];if(c.states)try{for(var u=(n=void 0,vt(c.events)),l=u.next();!l.done;l=u.next()){var h=l.value;o.add(""+h)}}catch(t){n={error:t}}finally{try{l&&!l.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}}catch(e){t={error:e}}finally{try{a&&!a.done&&(e=s.return)&&e.call(s)}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(!Ft(t))return t;var n=t[0]===e.delimiter;if(n&&!e.parent)return e.getStateNodeByPath(t.slice(1));var r=n?e.key+t:t;if(!e.parent)return e.getStateNodeByPath(r);try{return e.parent.getStateNodeByPath(r)}catch(t){throw new Error("Invalid transition definition for state node '"+e.id+"':\n"+t.message)}}))},t.prototype.formatTransition=function(t){var e=this,n=function(t){if(void 0!==t&&""!==t)return Ct(t)}(t.target),r="internal"in t?t.internal:!n||n.some((function(t){return Ft(t)&&t[0]===e.delimiter})),i=this.machine.options.guards,o=this.resolveTarget(n),s=dt(dt({},t),{actions:_e(Ct(t.actions)),cond:$t(t.cond,i),target:o,source:this,internal:r,eventType:t.event,toJSON:function(){return dt(dt({},s),{target:s.target?s.target.map((function(t){return"#"+t.id})):void 0,source:"#"+e.id})}});return s},t.prototype.formatTransitions=function(){var t,e,n,r=this;if(this.config.on)if(Array.isArray(this.config.on))n=this.config.on;else{var i=this.config.on,o="*",s=i[o],a=void 0===s?[]:s,c=yt(i,["*"]);n=Tt(bt(c).map((function(t){return Zt(t,c[t])})).concat(Zt("*",a)))}else n=[];var u=this.config.always?Zt("",this.config.always):[],l=this.config.onDone?Zt(String(Ce(this.id)),this.config.onDone):[],h=Tt(this.invoke.map((function(t){var e=[];return t.onDone&&e.push.apply(e,_t([],gt(Zt(String(Re(t.id)),t.onDone)))),t.onError&&e.push.apply(e,_t([],gt(Zt(String(De(t.id)),t.onError)))),e}))),f=this.after,p=Tt(_t(_t(_t(_t([],gt(l)),gt(h)),gt(n)),gt(u)).map((function(t){return Ct(t).map((function(t){return r.formatTransition(t)}))})));try{for(var d=vt(f),y=d.next();!y.done;y=d.next()){var v=y.value;p.push(v)}}catch(e){t={error:e}}finally{try{y&&!y.done&&(e=d.return)&&e.call(d)}finally{if(t)throw t.error}}return p},t}();function ln(t,e,n){return void 0===n&&(n=t.context),new un(t,e,n)}function hn(t,e){return new un(t,e)}const fn=Te({failure:null}),pn=Te({errors:[]}),dn=Te({edits:null}),yn=Te({data:null}),vn=pn,gn=Te({failure:(t,e)=>e.data}),_n=Te({errors:(t,e)=>e.data}),mn=Te({data:(t,e)=>e.data}),bn=Te({edits:(t,e)=>Object.assign(Object.assign({},t.edits),e.data)});const wn=hn({context:{data:null,edits:null,errors:[],failure:null},entry:["validate"],id:"nucleon",initial:"init",on:{DELETE:{actions:["clearData","clearEdits","clearErrors"],target:"#nucleon.busy.deleting"},FETCH:{actions:["clearData","clearEdits","clearErrors"],target:"#nucleon.busy.fetching"},REFRESH:{target:"#nucleon.busy.fetching"},SET_DATA:{actions:["setData","clearEdits","clearErrors"],target:"#nucleon.init"}},states:{busy:{states:{creating:{invoke:{onDone:{actions:["setData","clearEdits","validate"],target:"#nucleon.idle.snapshot"},onError:[{actions:"setErrors",cond:"isV8nErrorEvent",target:"#nucleon.idle"},{actions:"setFailure",target:"#nucleon.fail"}],src:"sendPost"}},deleting:{invoke:{onDone:{actions:["clearData","clearEdits","validate"],target:"#nucleon.idle.template"},onError:[{actions:"setErrors",cond:"isV8nErrorEvent",target:"#nucleon.idle"},{actions:"setFailure",target:"#nucleon.fail"}],src:"sendDelete"}},fetching:{invoke:{onDone:{actions:["setData","clearErrors","validate"],target:"#nucleon.idle.snapshot"},onError:[{actions:"setErrors",cond:"isV8nErrorEvent",target:"#nucleon.idle"},{actions:"setFailure",target:"#nucleon.fail"}],src:"sendGet"}},updating:{invoke:{onDone:{actions:["setData","clearEdits","validate"],target:"#nucleon.idle.snapshot"},onError:[{actions:"setErrors",cond:"isV8nErrorEvent",target:"#nucleon.idle"},{actions:"setFailure",target:"#nucleon.fail"}],src:"sendPatch"}}}},fail:{exit:"clearFailure"},idle:{initial:"unknown",on:{EDIT:{actions:["applyEdit","validate"],target:".unknown"}},states:{snapshot:{initial:"unknown",states:{clean:{initial:"unknown",states:{invalid:{},unknown:{always:[{cond:"hasErrors",target:"invalid"},{target:"valid"}]},valid:{}}},dirty:{initial:"unknown",on:{UNDO:{actions:["clearEdits","clearErrors","validate"],target:"#nucleon.idle.snapshot.clean"}},states:{invalid:{},unknown:{always:[{cond:"hasErrors",target:"invalid"},{target:"valid"}]},valid:{on:{SUBMIT:{target:"#nucleon.busy.updating"}}}}},unknown:{always:[{cond:"hasEdits",target:"dirty"},{target:"clean"}]}}},template:{initial:"unknown",states:{clean:{initial:"unknown",states:{invalid:{},unknown:{always:[{cond:"hasErrors",target:"invalid"},{target:"valid"}]},valid:{}}},dirty:{initial:"unknown",on:{UNDO:{actions:["clearEdits","clearErrors","validate"],target:"#nucleon.idle.template.clean"}},states:{invalid:{},unknown:{always:[{cond:"hasErrors",target:"invalid"},{target:"valid"}]},valid:{on:{SUBMIT:{target:"#nucleon.busy.creating"}}}}},unknown:{always:[{cond:"hasEdits",target:"dirty"},{target:"clean"}]}}},unknown:{always:[{cond:"hasData",target:"snapshot"},{target:"template"}]}}},init:{always:[{cond:"hasData",target:"idle.snapshot"},{target:"idle.template"}]}}},{actions:Object.freeze({__proto__:null,clearFailure:fn,clearErrors:pn,clearEdits:dn,clearData:yn,validate:vn,setFailure:gn,setErrors:_n,setData:mn,applyEdit:bn}),guards:Object.freeze({__proto__:null,hasData:t=>null!==t.data,hasEdits:t=>null!==t.edits,hasErrors:t=>t.errors.length>0,isV8nErrorEvent:(t,e)=>Array.isArray(e.data)})});var Sn;!function(t){t[t.List=0]="List",t[t.Set=1]="Set"}(Sn||(Sn={}));class xn{constructor(t){this.__value=t,this.__tree=xn.__parse(t)}static get True(){return jn}static get False(){return On}static fromAttribute(t,e){return null===t?xn.False:""===t||t===e?xn.True:new xn(t)}matches(t,e=!1){const n=this.zoom(t).toString();return e?"not=*"===n:""!==n}zoom(t){const[e,...n]=t.split(":"),{only:r,not:i}=this.__tree;if(null==r?void 0:r[e]){const t=new xn(xn.__stringify(r[e]));return 0===n.length?t:t.zoom(n.join(":"))}return!i||i.includes(e)?xn.False:xn.True}toString(){return this.__value}toAttribute(t=""){var e;return"*"===(null===(e=this.__tree.not)||void 0===e?void 0:e[0])?t:0===this.__value.trim().length?null:this.toString()}static __stringify(t,e=""){return t.only?Object.entries(t.only).reduce(((t,[n,r])=>{const i=xn.__stringify(r,0===e.length?n:`${e}:${n}`);return 0===t.length?i:`${t} ${i}`}),""):t.not?`${0===e.length?"":`${e}:`}not=${t.not.join(",")}`:e}static __parse(t){const e={},n={branch:e,buffer:"",entity:Sn.List,tree:e};return Array.from(`${t} `).forEach(((e,r)=>{try{xn.__processors[n.entity](n,e)}catch(e){const n="This error occured at: ",i=t=>t.substring(Math.max(0,r-30),r+30),o=i(t),s=" ".repeat(n.length)+i("^".padStart(r+1," "));throw new SyntaxError([e.message,`${n}${o}`,s].join("\n"))}})),e}}xn.__processors={[Sn.List](t,e){var n,r,i,o;if(Array.isArray(t.branch))throw new SyntaxError("Paths are not allowed in sets.");if("="===e){if("not"===t.buffer){const e=null!==(n=t.branch.not)&&void 0!==n?n:[];return delete t.branch.only,t.branch.not=e,t.entity=Sn.Set,t.branch=e,void(t.buffer="")}throw new SyntaxError(`Unknown modifier "${t.buffer}".`)}if(/^\s$/.test(e)||":"===e){if(t.buffer.length>0){const n=t.buffer,s=null!==(i=null===(r=t.branch.only)||void 0===r?void 0:r[n])&&void 0!==i?i:{};":"!==e&&(s.not=["*"]),!0!==(null===(o=t.branch.not)||void 0===o?void 0:o.includes("*"))&&(t.branch.only=Object.assign(Object.assign({},t.branch.only),{[n]:s}),delete t.branch.not),t.branch=":"===e?s:t.tree,t.buffer=""}}else{if(!/^[a-z]|-$/.test(e))throw new SyntaxError(`Expected [a-z], "-", ":" or a whitespace, but got "${e}" instead.`);t.buffer+=e}},[Sn.Set](t,e){if(!Array.isArray(t.branch))throw new SyntaxError("Unexpected set item.");if(0!==t.buffer.length||!/^\s$/.test(e)){if(","===e||"*"===e||/^\s$/.test(e)){const n="*"===e?"*":t.buffer,r=new Set([...t.branch,n]),i=r.has("*")?new Set(["*"]):r;return t.branch.splice(0,t.branch.length,...i),t.entity=","===e?Sn.Set:Sn.List,t.branch=","===e?t.branch:t.tree,void(t.buffer="")}if(!/^[a-z]|-$/.test(e))throw new SyntaxError(`Expected [a-z], "-", "," or a whitespace, but got "${e}" instead.`);t.buffer+=e}}};const On=new xn(""),jn=new xn("not=*");var En="object"==typeof global&&global&&global.Object===Object&&global,Pn="object"==typeof self&&self&&self.Object===Object&&self,An=En||Pn||Function("return this")(),kn=An.Symbol,Tn=Object.prototype,Nn=Tn.hasOwnProperty,Cn=Tn.toString,Rn=kn?kn.toStringTag:void 0;var Dn=Object.prototype.toString;var Un=kn?kn.toStringTag:void 0;function In(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Un&&Un in Object(t)?function(t){var e=Nn.call(t,Rn),n=t[Rn];try{t[Rn]=void 0;var r=!0}catch(t){}var i=Cn.call(t);return r&&(e?t[Rn]=n:delete t[Rn]),i}(t):function(t){return Dn.call(t)}(t)}function Ln(t){return null!=t&&"object"==typeof t}function Vn(t){return"symbol"==typeof t||Ln(t)&&"[object Symbol]"==In(t)}var Mn=Array.isArray,Fn=kn?kn.prototype:void 0,$n=Fn?Fn.toString:void 0;function Bn(t){if("string"==typeof t)return t;if(Mn(t))return function(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}(t,Bn)+"";if(Vn(t))return $n?$n.call(t):"";var e=t+"";return"0"==e&&1/t==-Infinity?"-0":e}function zn(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function qn(t){if(!zn(t))return!1;var e=In(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}var Wn,Hn=An["__core-js_shared__"],Jn=(Wn=/[^.]+$/.exec(Hn&&Hn.keys&&Hn.keys.IE_PROTO||""))?"Symbol(src)_1."+Wn:"";var Gn=Function.prototype.toString;function Kn(t){if(null!=t){try{return Gn.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var Zn=/^\[object .+?Constructor\]$/,Qn=Function.prototype,Xn=Object.prototype,Yn=Qn.toString,tr=Xn.hasOwnProperty,er=RegExp("^"+Yn.call(tr).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function nr(t){return!(!zn(t)||(e=t,Jn&&Jn in e))&&(qn(t)?er:Zn).test(Kn(t));var e}function rr(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return nr(n)?n:void 0}var ir=rr(An,"WeakMap"),or=/^(?:0|[1-9]\d*)$/;function sr(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&or.test(t))&&t>-1&&t%1==0&&t<e}function ar(t,e){return t===e||t!=t&&e!=e}function cr(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function ur(t){return null!=t&&cr(t.length)&&!qn(t)}var lr=Object.prototype;function hr(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||lr)}function fr(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function pr(t){return Ln(t)&&"[object Arguments]"==In(t)}var dr=Object.prototype,yr=dr.hasOwnProperty,vr=dr.propertyIsEnumerable,gr=pr(function(){return arguments}())?pr:function(t){return Ln(t)&&yr.call(t,"callee")&&!vr.call(t,"callee")};var _r="object"==typeof exports&&exports&&!exports.nodeType&&exports,mr=_r&&"object"==typeof module&&module&&!module.nodeType&&module,br=mr&&mr.exports===_r?An.Buffer:void 0,wr=(br?br.isBuffer:void 0)||function(){return!1},Sr={};function xr(t){return function(e){return t(e)}}Sr["[object Float32Array]"]=Sr["[object Float64Array]"]=Sr["[object Int8Array]"]=Sr["[object Int16Array]"]=Sr["[object Int32Array]"]=Sr["[object Uint8Array]"]=Sr["[object Uint8ClampedArray]"]=Sr["[object Uint16Array]"]=Sr["[object Uint32Array]"]=!0,Sr["[object Arguments]"]=Sr["[object Array]"]=Sr["[object ArrayBuffer]"]=Sr["[object Boolean]"]=Sr["[object DataView]"]=Sr["[object Date]"]=Sr["[object Error]"]=Sr["[object Function]"]=Sr["[object Map]"]=Sr["[object Number]"]=Sr["[object Object]"]=Sr["[object RegExp]"]=Sr["[object Set]"]=Sr["[object String]"]=Sr["[object WeakMap]"]=!1;var Or="object"==typeof exports&&exports&&!exports.nodeType&&exports,jr=Or&&"object"==typeof module&&module&&!module.nodeType&&module,Er=jr&&jr.exports===Or&&En.process,Pr=function(){try{var t=jr&&jr.require&&jr.require("util").types;return t||Er&&Er.binding&&Er.binding("util")}catch(t){}}(),Ar=Pr&&Pr.isTypedArray,kr=Ar?xr(Ar):function(t){return Ln(t)&&cr(t.length)&&!!Sr[In(t)]},Tr=Object.prototype.hasOwnProperty;function Nr(t,e){var n=Mn(t),r=!n&&gr(t),i=!n&&!r&&wr(t),o=!n&&!r&&!i&&kr(t),s=n||r||i||o,a=s?fr(t.length,String):[],c=a.length;for(var u in t)!e&&!Tr.call(t,u)||s&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||sr(u,c))||a.push(u);return a}function Cr(t,e){return function(n){return t(e(n))}}var Rr=Cr(Object.keys,Object),Dr=Object.prototype.hasOwnProperty;function Ur(t){return ur(t)?Nr(t):function(t){if(!hr(t))return Rr(t);var e=[];for(var n in Object(t))Dr.call(t,n)&&"constructor"!=n&&e.push(n);return e}(t)}var Ir=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Lr=/^\w*$/;var Vr=rr(Object,"create");var Mr=Object.prototype.hasOwnProperty;var Fr=Object.prototype.hasOwnProperty;function $r(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Br(t,e){for(var n=t.length;n--;)if(ar(t[n][0],e))return n;return-1}$r.prototype.clear=function(){this.__data__=Vr?Vr(null):{},this.size=0},$r.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},$r.prototype.get=function(t){var e=this.__data__;if(Vr){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return Mr.call(e,t)?e[t]:void 0},$r.prototype.has=function(t){var e=this.__data__;return Vr?void 0!==e[t]:Fr.call(e,t)},$r.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Vr&&void 0===e?"__lodash_hash_undefined__":e,this};var zr=Array.prototype.splice;function qr(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}qr.prototype.clear=function(){this.__data__=[],this.size=0},qr.prototype.delete=function(t){var e=this.__data__,n=Br(e,t);return!(n<0)&&(n==e.length-1?e.pop():zr.call(e,n,1),--this.size,!0)},qr.prototype.get=function(t){var e=this.__data__,n=Br(e,t);return n<0?void 0:e[n][1]},qr.prototype.has=function(t){return Br(this.__data__,t)>-1},qr.prototype.set=function(t,e){var n=this.__data__,r=Br(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this};var Wr=rr(An,"Map");function Hr(t,e){var n,r,i=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map}function Jr(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Jr.prototype.clear=function(){this.size=0,this.__data__={hash:new $r,map:new(Wr||qr),string:new $r}},Jr.prototype.delete=function(t){var e=Hr(this,t).delete(t);return this.size-=e?1:0,e},Jr.prototype.get=function(t){return Hr(this,t).get(t)},Jr.prototype.has=function(t){return Hr(this,t).has(t)},Jr.prototype.set=function(t,e){var n=Hr(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this};function Gr(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=t.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(Gr.Cache||Jr),n}Gr.Cache=Jr;var Kr,Zr,Qr,Xr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Yr=/\\(\\)?/g,ti=(Kr=function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Xr,(function(t,n,r,i){e.push(r?i.replace(Yr,"$1"):n||t)})),e},Zr=Gr(Kr,(function(t){return 500===Qr.size&&Qr.clear(),t})),Qr=Zr.cache,Zr);function ei(t,e){return Mn(t)?t:function(t,e){if(Mn(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!Vn(t))||Lr.test(t)||!Ir.test(t)||null!=e&&t in Object(e)}(t,e)?[t]:ti(function(t){return null==t?"":Bn(t)}(t))}function ni(t){if("string"==typeof t||Vn(t))return t;var e=t+"";return"0"==e&&1/t==-Infinity?"-0":e}function ri(t,e,n){var r=null==t?void 0:function(t,e){for(var n=0,r=(e=ei(e,t)).length;null!=t&&n<r;)t=t[ni(e[n++])];return n&&n==r?t:void 0}(t,e);return void 0===r?n:r}function ii(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}function oi(t){var e=this.__data__=new qr(t);this.size=e.size}function si(){return[]}oi.prototype.clear=function(){this.__data__=new qr,this.size=0},oi.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},oi.prototype.get=function(t){return this.__data__.get(t)},oi.prototype.has=function(t){return this.__data__.has(t)},oi.prototype.set=function(t,e){var n=this.__data__;if(n instanceof qr){var r=n.__data__;if(!Wr||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Jr(r)}return n.set(t,e),this.size=n.size,this};var ai=Object.prototype.propertyIsEnumerable,ci=Object.getOwnPropertySymbols,ui=ci?function(t){return null==t?[]:(t=Object(t),function(t,e){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n<r;){var s=t[n];e(s,n,t)&&(o[i++]=s)}return o}(ci(t),(function(e){return ai.call(t,e)})))}:si;function li(t,e,n){var r=e(t);return Mn(t)?r:ii(r,n(t))}function hi(t){return li(t,Ur,ui)}var fi=rr(An,"DataView"),pi=rr(An,"Promise"),di=rr(An,"Set"),yi=Kn(fi),vi=Kn(Wr),gi=Kn(pi),_i=Kn(di),mi=Kn(ir),bi=In;(fi&&"[object DataView]"!=bi(new fi(new ArrayBuffer(1)))||Wr&&"[object Map]"!=bi(new Wr)||pi&&"[object Promise]"!=bi(pi.resolve())||di&&"[object Set]"!=bi(new di)||ir&&"[object WeakMap]"!=bi(new ir))&&(bi=function(t){var e=In(t),n="[object Object]"==e?t.constructor:void 0,r=n?Kn(n):"";if(r)switch(r){case yi:return"[object DataView]";case vi:return"[object Map]";case gi:return"[object Promise]";case _i:return"[object Set]";case mi:return"[object WeakMap]"}return e});var wi=bi,Si=An.Uint8Array;function xi(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Jr;++e<n;)this.add(t[e])}function Oi(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function ji(t,e){return t.has(e)}xi.prototype.add=xi.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},xi.prototype.has=function(t){return this.__data__.has(t)};function Ei(t,e,n,r,i,o){var s=1&n,a=t.length,c=e.length;if(a!=c&&!(s&&c>a))return!1;var u=o.get(t),l=o.get(e);if(u&&l)return u==e&&l==t;var h=-1,f=!0,p=2&n?new xi:void 0;for(o.set(t,e),o.set(e,t);++h<a;){var d=t[h],y=e[h];if(r)var v=s?r(y,d,h,e,t,o):r(d,y,h,t,e,o);if(void 0!==v){if(v)continue;f=!1;break}if(p){if(!Oi(e,(function(t,e){if(!ji(p,e)&&(d===t||i(d,t,n,r,o)))return p.push(e)}))){f=!1;break}}else if(d!==y&&!i(d,y,n,r,o)){f=!1;break}}return o.delete(t),o.delete(e),f}function Pi(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function Ai(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}var ki=kn?kn.prototype:void 0,Ti=ki?ki.valueOf:void 0;var Ni=Object.prototype.hasOwnProperty;var Ci="[object Object]",Ri=Object.prototype.hasOwnProperty;function Di(t,e,n,r,i,o){var s=Mn(t),a=Mn(e),c=s?"[object Array]":wi(t),u=a?"[object Array]":wi(e),l=(c="[object Arguments]"==c?Ci:c)==Ci,h=(u="[object Arguments]"==u?Ci:u)==Ci,f=c==u;if(f&&wr(t)){if(!wr(e))return!1;s=!0,l=!1}if(f&&!l)return o||(o=new oi),s||kr(t)?Ei(t,e,n,r,i,o):function(t,e,n,r,i,o,s){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!o(new Si(t),new Si(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return ar(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var a=Pi;case"[object Set]":var c=1&r;if(a||(a=Ai),t.size!=e.size&&!c)return!1;var u=s.get(t);if(u)return u==e;r|=2,s.set(t,e);var l=Ei(a(t),a(e),r,i,o,s);return s.delete(t),l;case"[object Symbol]":if(Ti)return Ti.call(t)==Ti.call(e)}return!1}(t,e,c,n,r,i,o);if(!(1&n)){var p=l&&Ri.call(t,"__wrapped__"),d=h&&Ri.call(e,"__wrapped__");if(p||d){var y=p?t.value():t,v=d?e.value():e;return o||(o=new oi),i(y,v,n,r,o)}}return!!f&&(o||(o=new oi),function(t,e,n,r,i,o){var s=1&n,a=hi(t),c=a.length;if(c!=hi(e).length&&!s)return!1;for(var u=c;u--;){var l=a[u];if(!(s?l in e:Ni.call(e,l)))return!1}var h=o.get(t),f=o.get(e);if(h&&f)return h==e&&f==t;var p=!0;o.set(t,e),o.set(e,t);for(var d=s;++u<c;){var y=t[l=a[u]],v=e[l];if(r)var g=s?r(v,y,l,e,t,o):r(y,v,l,t,e,o);if(!(void 0===g?y===v||i(y,v,n,r,o):g)){p=!1;break}d||(d="constructor"==l)}if(p&&!d){var _=t.constructor,m=e.constructor;_==m||!("constructor"in t)||!("constructor"in e)||"function"==typeof _&&_ instanceof _&&"function"==typeof m&&m instanceof m||(p=!1)}return o.delete(t),o.delete(e),p}(t,e,n,r,i,o))}function Ui(t,e,n,r,i){return t===e||(null==t||null==e||!Ln(t)&&!Ln(e)?t!=t&&e!=e:Di(t,e,n,r,Ui,i))}function Ii(t,e){return Ui(t,e)}class Li extends Error{constructor(){super("not enough info to update; please reload resource instead")}}var Vi=lt((function(t){var e=t.exports=function(t){return new n(t)};function n(t){this.value=t}function r(t,e,n){var r=[],s=[],l=!0;return function t(h){var f=n?i(h):h,p={},d=!0,y={node:f,node_:h,path:[].concat(r),parent:s[s.length-1],parents:s,key:r.slice(-1)[0],isRoot:0===r.length,level:r.length,circular:null,update:function(t,e){y.isRoot||(y.parent.node[y.key]=t),y.node=t,e&&(d=!1)},delete:function(t){delete y.parent.node[y.key],t&&(d=!1)},remove:function(t){a(y.parent.node)?y.parent.node.splice(y.key,1):delete y.parent.node[y.key],t&&(d=!1)},keys:null,before:function(t){p.before=t},after:function(t){p.after=t},pre:function(t){p.pre=t},post:function(t){p.post=t},stop:function(){l=!1},block:function(){d=!1}};if(!l)return y;function v(){if("object"==typeof y.node&&null!==y.node){y.keys&&y.node_===y.node||(y.keys=o(y.node)),y.isLeaf=0==y.keys.length;for(var t=0;t<s.length;t++)if(s[t].node_===h){y.circular=s[t];break}}else y.isLeaf=!0,y.keys=null;y.notLeaf=!y.isLeaf,y.notRoot=!y.isRoot}v();var g=e.call(y,y.node);return void 0!==g&&y.update&&y.update(g),p.before&&p.before.call(y,y.node),d?("object"!=typeof y.node||null===y.node||y.circular||(s.push(y),v(),c(y.keys,(function(e,i){r.push(e),p.pre&&p.pre.call(y,y.node[e],e);var o=t(y.node[e]);n&&u.call(y.node,e)&&(y.node[e]=o.node),o.isLast=i==y.keys.length-1,o.isFirst=0==i,p.post&&p.post.call(y,o),r.pop()})),s.pop()),p.after&&p.after.call(y,y.node),y):y}(t).node}function i(t){if("object"==typeof t&&null!==t){var e;if(a(t))e=[];else if("[object Date]"===s(t))e=new Date(t.getTime?t.getTime():t);else if(function(t){return"[object RegExp]"===s(t)}(t))e=new RegExp(t);else if(function(t){return"[object Error]"===s(t)}(t))e={message:t.message};else if(function(t){return"[object Boolean]"===s(t)}(t))e=new Boolean(t);else if(function(t){return"[object Number]"===s(t)}(t))e=new Number(t);else if(function(t){return"[object String]"===s(t)}(t))e=new String(t);else if(Object.create&&Object.getPrototypeOf)e=Object.create(Object.getPrototypeOf(t));else if(t.constructor===Object)e={};else{var n=t.constructor&&t.constructor.prototype||t.__proto__||{},r=function(){};r.prototype=n,e=new r}return c(o(t),(function(n){e[n]=t[n]})),e}return t}n.prototype.get=function(t){for(var e=this.value,n=0;n<t.length;n++){var r=t[n];if(!e||!u.call(e,r)){e=void 0;break}e=e[r]}return e},n.prototype.has=function(t){for(var e=this.value,n=0;n<t.length;n++){var r=t[n];if(!e||!u.call(e,r))return!1;e=e[r]}return!0},n.prototype.set=function(t,e){for(var n=this.value,r=0;r<t.length-1;r++){var i=t[r];u.call(n,i)||(n[i]={}),n=n[i]}return n[t[r]]=e,e},n.prototype.map=function(t){return r(this.value,t,!0)},n.prototype.forEach=function(t){return this.value=r(this.value,t,!1),this.value},n.prototype.reduce=function(t,e){var n=1===arguments.length,r=n?this.value:e;return this.forEach((function(e){this.isRoot&&n||(r=t.call(this,r,e))})),r},n.prototype.paths=function(){var t=[];return this.forEach((function(e){t.push(this.path)})),t},n.prototype.nodes=function(){var t=[];return this.forEach((function(e){t.push(this.node)})),t},n.prototype.clone=function(){var t=[],e=[];return function n(r){for(var s=0;s<t.length;s++)if(t[s]===r)return e[s];if("object"==typeof r&&null!==r){var a=i(r);return t.push(r),e.push(a),c(o(r),(function(t){a[t]=n(r[t])})),t.pop(),e.pop(),a}return r}(this.value)};var o=Object.keys||function(t){var e=[];for(var n in t)e.push(n);return e};function s(t){return Object.prototype.toString.call(t)}var a=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},c=function(t,e){if(t.forEach)return t.forEach(e);for(var n=0;n<t.length;n++)e(t[n],n,t)};c(o(n.prototype),(function(t){e[t]=function(e){var r=[].slice.call(arguments,1),i=new n(e);return i[t].apply(i,r)}}));var u=Object.hasOwnProperty||function(t,e){return e in t}}));class Mi{constructor(){this.__callbacks=[]}share(t){const{related:e,source:n,data:r}=t,i=null===r?new Map([[n,null]]):Mi.__createPatch(r);[...this.__callbacks].forEach((t=>{t((t=>{const n=Mi.__applyPatch(i,t,e);return Ii(t,n)?t:n}))}))}track(t){return this.__callbacks.push(t),()=>{this.__callbacks.splice(this.__callbacks.indexOf(t),1)}}cease(){this.__callbacks.length=0}static __isResource(t){return"string"==typeof ri(t,"_links.self.href")}static __approximateURI(t){try{const e=new URL(t);return e.search="",e.hash="",e.toString()}catch(e){return t}}static __createPatch(t){return Vi(t).reduce((function(t,e){if(!Mi.__isResource(e))return t;const n=Vi(e).map((function(){var t;(null===(t=this.key)||void 0===t?void 0:t.startsWith("_"))&&this.delete(!0)}));return t.set(e._links.self.href,n),t}),new Map)}static __applyPatch(t,e,n){var r,i;const o=null!==(r=null==n?void 0:n.map((t=>Mi.__approximateURI(t))))&&void 0!==r?r:[];return null!==(i=Vi({data:e}).map((function(e){if(!Mi.__isResource(e))return;const n=e._links.self.href,r=Mi.__approximateURI(n);if(o.includes(r))throw new Mi.UpdateError;if(t.has(n)){const r=t.get(n);if(r)return this.update(Object.assign(Object.assign({},e),r),!0);if(!this.parent.parent)return this.delete(!0);throw new Mi.UpdateError}})).data)&&void 0!==i?i:null}}Mi.UpdateError=Li;var Fi=lt((function(t,e){t.exports=function(){function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function e(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function n(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function o(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?i(Object(n),!0).forEach((function(e){r(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function s(t){return function(t){if(Array.isArray(t))return c(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||a(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,e){if(t){if("string"==typeof t)return c(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(t,e):void 0}}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function u(t){if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(t=a(t))){var e=0,n=function(){};return{s:n,n:function(){return e>=t.length?{done:!0}:{done:!1,value:t[e++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i,o=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return o=t.done,t},e:function(t){s=!0,i=t},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw i}}}}var l={};l[l.Fatal=0]="Fatal",l[l.Error=0]="Error",l[l.Warn=1]="Warn",l[l.Log=2]="Log",l[l.Info=3]="Info",l[l.Success=3]="Success",l[l.Debug=4]="Debug",l[l.Trace=5]="Trace",l[l.Silent=-1/0]="Silent",l[l.Verbose=1/0]="Verbose";var h={silent:{level:-1},fatal:{level:l.Fatal},error:{level:l.Error},warn:{level:l.Warn},log:{level:l.Log},info:{level:l.Info},success:{level:l.Success},debug:{level:l.Debug},trace:{level:l.Trace},verbose:{level:l.Trace},ready:{level:l.Info},start:{level:l.Info}};function f(t){return e=t,!("[object Object]"!==Object.prototype.toString.call(e)||!t.message&&!t.args||t.stack);var e}var p=!1,d=[],y=function(){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};for(var r in t(this,e),this._reporters=n.reporters||[],this._types=n.types||h,this.level=void 0!==n.level?n.level:3,this._defaults=n.defaults||{},this._async=void 0!==n.async?n.async:void 0,this._stdout=n.stdout,this._stderr=n.stderr,this._mockFn=n.mockFn,this._throttle=n.throttle||1e3,this._throttleMin=n.throttleMin||5,this._types){var i=o(o({type:r},this._types[r]),this._defaults);this[r]=this._wrapLogFn(i),this[r].raw=this._wrapLogFn(i,!0)}this._mockFn&&this.mockTypes(),this._lastLogSerialized=void 0,this._lastLog=void 0,this._lastLogTime=void 0,this._lastLogCount=0,this._throttleTimeout=void 0}return n(e,[{key:"create",value:function(t){return new e(Object.assign({reporters:this._reporters,level:this.level,types:this._types,defaults:this._defaults,stdout:this._stdout,stderr:this._stderr,mockFn:this._mockFn},t))}},{key:"withDefaults",value:function(t){return this.create({defaults:Object.assign({},this._defaults,t)})}},{key:"withTag",value:function(t){return this.withDefaults({tag:this._defaults.tag?this._defaults.tag+":"+t:t})}},{key:"addReporter",value:function(t){return this._reporters.push(t),this}},{key:"removeReporter",value:function(t){if(t){var e=this._reporters.indexOf(t);if(e>=0)return this._reporters.splice(e,1)}else this._reporters.splice(0);return this}},{key:"setReporters",value:function(t){return this._reporters=Array.isArray(t)?t:[t],this}},{key:"wrapAll",value:function(){this.wrapConsole(),this.wrapStd()}},{key:"restoreAll",value:function(){this.restoreConsole(),this.restoreStd()}},{key:"wrapConsole",value:function(){for(var t in this._types)console["__"+t]||(console["__"+t]=console[t]),console[t]=this[t].raw}},{key:"restoreConsole",value:function(){for(var t in this._types)console["__"+t]&&(console[t]=console["__"+t],delete console["__"+t])}},{key:"wrapStd",value:function(){this._wrapStream(this.stdout,"log"),this._wrapStream(this.stderr,"log")}},{key:"_wrapStream",value:function(t,e){var n=this;t&&(t.__write||(t.__write=t.write),t.write=function(t){n[e].raw(String(t).trim())})}},{key:"restoreStd",value:function(){this._restoreStream(this.stdout),this._restoreStream(this.stderr)}},{key:"_restoreStream",value:function(t){t&&t.__write&&(t.write=t.__write,delete t.__write)}},{key:"pauseLogs",value:function(){p=!0}},{key:"resumeLogs",value:function(){p=!1;var t,e=u(d.splice(0));try{for(e.s();!(t=e.n()).done;){var n=t.value;n[0]._logFn(n[1],n[2])}}catch(t){e.e(t)}finally{e.f()}}},{key:"mockTypes",value:function(t){if(this._mockFn=t||this._mockFn,"function"==typeof this._mockFn)for(var e in this._types)this[e]=this._mockFn(e,this._types[e])||this[e],this[e].raw=this[e]}},{key:"_wrapLogFn",value:function(t,e){var n=this;return function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];if(!p)return n._logFn(t,i,e);d.push([n,t,i,e])}}},{key:"_logFn",value:function(t,e,n){var r=this;if(t.level>this.level)return!!this._async&&Promise.resolve(!1);var i=Object.assign({date:new Date,args:[]},t);!n&&1===e.length&&f(e[0])?Object.assign(i,e[0]):i.args=Array.from(e),i.message&&(i.args.unshift(i.message),delete i.message),i.additional&&(Array.isArray(i.additional)||(i.additional=i.additional.split("\n")),i.args.push("\n"+i.additional.join("\n")),delete i.additional),i.type="string"==typeof i.type?i.type.toLowerCase():"",i.tag="string"==typeof i.tag?i.tag.toLowerCase():"";var a=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=r._lastLogCount-r._throttleMin;if(r._lastLog&&e>0){var n=s(r._lastLog.args);e>1&&n.push("(repeated ".concat(e," times)")),r._log(o(o({},r._lastLog),{},{args:n})),r._lastLogCount=1}if(t){if(r._lastLog=i,r._async)return r._logAsync(i);r._log(i)}};clearTimeout(this._throttleTimeout);var c=this._lastLogTime?i.date-this._lastLogTime:0;if(this._lastLogTime=i.date,c<this._throttle)try{var u=JSON.stringify([i.type,i.tag,i.args]),l=this._lastLogSerialized===u;if(this._lastLogSerialized=u,l&&(this._lastLogCount++,this._lastLogCount>this._throttleMin))return void(this._throttleTimeout=setTimeout(a,this._throttle))}catch(t){}a(!0)}},{key:"_log",value:function(t){var e,n=u(this._reporters);try{for(n.s();!(e=n.n()).done;)e.value.log(t,{async:!1,stdout:this.stdout,stderr:this.stderr})}catch(t){n.e(t)}finally{n.f()}}},{key:"_logAsync",value:function(t){var e=this;return Promise.all(this._reporters.map((function(n){return n.log(t,{async:!0,stdout:e.stdout,stderr:e.stderr})})))}},{key:"stdout",get:function(){return this._stdout||console._stdout}},{key:"stderr",get:function(){return this._stderr||console._stderr}}]),e}();y.prototype.add=y.prototype.addReporter,y.prototype.remove=y.prototype.removeReporter,y.prototype.clear=y.prototype.removeReporter,y.prototype.withScope=y.prototype.withTag,y.prototype.mock=y.prototype.mockTypes,y.prototype.pause=y.prototype.pauseLogs,y.prototype.resume=y.prototype.resumeLogs;var v,g=function(){function e(n){t(this,e),this.options=Object.assign({},n),this.defaultColor="#7f8c8d",this.levelColorMap={0:"#c0392b",1:"#f39c12",3:"#00BCD4"},this.typeColorMap={success:"#2ecc71"}}return n(e,[{key:"log",value:function(t){var e=t.level<1?console.__error||console.error:1===t.level&&console.warn?console.__warn||console.warn:console.__log||console.log,n="log"!==t.type?t.type:"",r=t.tag?t.tag:"",i=this.typeColorMap[t.type]||this.levelColorMap[t.level]||this.defaultColor,o="\n background: ".concat(i,";\n border-radius: 0.5em;\n color: white;\n font-weight: bold;\n padding: 2px 0.5em;\n "),a="%c".concat([r,n].filter(Boolean).join(":"));"string"==typeof t.args[0]?e.apply(void 0,["".concat(a,"%c ").concat(t.args[0]),o,""].concat(s(t.args.slice(1)))):e.apply(void 0,[a,o].concat(s(t.args)))}}]),e}();return"undefined"!=typeof window&&window.consola||((v=new y({reporters:[new g]})).Consola=y,v.LogLevel=l,v.BrowserReporter=g,v)}()})),$i=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},Bi=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),zi=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},qi=function(){function t(e,n,r,i){$i(this,t),this.name=e,this.fn=n,this.args=r,this.modifiers=i}return Bi(t,[{key:"_test",value:function(t){var e=this.fn;try{Hi(this.modifiers.slice(),e)(t)}catch(t){e=function(){return!1}}try{return Hi(this.modifiers.slice(),e)(t)}catch(t){return!1}}},{key:"_check",value:function(t){try{Hi(this.modifiers.slice(),this.fn)(t)}catch(t){if(Hi(this.modifiers.slice(),(function(t){return t}))(!1))return}if(!Hi(this.modifiers.slice(),this.fn)(t))throw null}},{key:"_testAsync",value:function(t){var e=this;return new Promise((function(n,r){Ji(e.modifiers.slice(),e.fn)(t).then((function(e){e?n(t):r(null)})).catch((function(t){return r(t)}))}))}}]),t}();function Wi(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"simple";return"object"==typeof t?t[e]:t}function Hi(t,e){if(t.length){var n=t.shift(),r=Hi(t,e);return n.perform(r)}return Wi(e)}function Ji(t,e){if(t.length){var n=t.shift(),r=Ji(t,e);return n.performAsync(r)}return function(t){return Promise.resolve(Wi(e,"async")(t))}}var Gi=function t(e,n,r){$i(this,t),this.name=e,this.perform=n,this.performAsync=r},Ki=function(t){function e(t,n,r,i){$i(this,e);for(var o=arguments.length,s=Array(o>4?o-4:0),a=4;a<o;a++)s[a-4]=arguments[a];var c=zi(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,s));return Error.captureStackTrace&&Error.captureStackTrace(c,e),c.rule=t,c.value=n,c.cause=r,c.target=i,c}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,Error),e}(),Zi=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];$i(this,t),this.chain=e,this.nextRuleModifiers=n}return Bi(t,[{key:"_applyRule",value:function(t,e){var n=this;return function(){for(var r=arguments.length,i=Array(r),o=0;o<r;o++)i[o]=arguments[o];return n.chain.push(new qi(e,t.apply(n,i),i,n.nextRuleModifiers)),n.nextRuleModifiers=[],n}}},{key:"_applyModifier",value:function(t,e){return this.nextRuleModifiers.push(new Gi(e,t.simple,t.async)),this}},{key:"_clone",value:function(){return new t(this.chain.slice(),this.nextRuleModifiers.slice())}},{key:"test",value:function(t){return this.chain.every((function(e){return e._test(t)}))}},{key:"testAll",value:function(t){var e=[];return this.chain.forEach((function(n){try{n._check(t)}catch(r){e.push(new Ki(n,t,r))}})),e}},{key:"check",value:function(t){this.chain.forEach((function(e){try{e._check(t)}catch(n){throw new Ki(e,t,n)}}))}},{key:"testAsync",value:function(t){var e=this;return new Promise((function(n,r){Qi(t,e.chain.slice(),n,r)}))}}]),t}();function Qi(t,e,n,r){if(e.length){var i=e.shift();i._testAsync(t).then((function(){Qi(t,e,n,r)}),(function(e){r(new Ki(i,t,e))}))}else n(t)}function Xi(){return to(new Zi)}var Yi={};function to(t){return new Proxy(t,{get:function(e,n){if(n in e)return e[n];var r=to(t._clone());return n in eo?r._applyModifier(eo[n],n):n in Yi?r._applyRule(Yi[n],n):n in ro?r._applyRule(ro[n],n):void 0}})}Xi.extend=function(t){Object.assign(Yi,t)},Xi.clearCustomRules=function(){Yi={}};var eo={not:{simple:function(t){return function(e){return!t(e)}},async:function(t){return function(e){return Promise.resolve(t(e)).then((function(t){return!t})).catch((function(t){return!0}))}}},some:{simple:function(t){return function(e){return no(e).some((function(e){try{return t(e)}catch(t){return!1}}))}},async:function(t){return function(e){return Promise.all(no(e).map((function(e){try{return t(e).catch((function(t){return!1}))}catch(t){return!1}}))).then((function(t){return t.some(Boolean)}))}}},every:{simple:function(t){return function(e){return no(e).every(t)}},async:function(t){return function(e){return Promise.all(no(e).map(t)).then((function(t){return t.every(Boolean)}))}}}};function no(t){return"string"==typeof t?t.split(""):t}var ro={equal:function(t){return function(e){return e==t}},exact:function(t){return function(e){return e===t}},number:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return function(e){return"number"==typeof e&&(t||isFinite(e))}},integer:function(){return function(t){return(Number.isInteger||oo)(t)}},numeric:function(){return function(t){return!isNaN(parseFloat(t))&&isFinite(t)}},string:function(){return io("string")},boolean:function(){return io("boolean")},undefined:function(){return io("undefined")},null:function(){return io("null")},array:function(){return io("array")},object:function(){return io("object")},instanceOf:function(t){return function(e){return e instanceof t}},pattern:function(t){return function(e){return t.test(e)}},lowercase:function(){return function(t){return/^([a-z]+\s*)+$/.test(t)}},uppercase:function(){return function(t){return/^([A-Z]+\s*)+$/.test(t)}},vowel:function(){return function(t){return/^[aeiou]+$/i.test(t)}},consonant:function(){return function(t){return/^(?=[^aeiou])([a-z]+)$/i.test(t)}},first:function(t){return function(e){return e[0]==t}},last:function(t){return function(e){return e[e.length-1]==t}},empty:function(){return function(t){return 0===t.length}},length:function(t,e){return function(n){return n.length>=t&&n.length<=(e||t)}},minLength:function(t){return function(e){return e.length>=t}},maxLength:function(t){return function(e){return e.length<=t}},negative:function(){return function(t){return t<0}},positive:function(){return function(t){return t>=0}},between:function(t,e){return function(n){return n>=t&&n<=e}},range:function(t,e){return function(n){return n>=t&&n<=e}},lessThan:function(t){return function(e){return e<t}},lessThanOrEqual:function(t){return function(e){return e<=t}},greaterThan:function(t){return function(e){return e>t}},greaterThanOrEqual:function(t){return function(e){return e>=t}},even:function(){return function(t){return t%2==0}},odd:function(){return function(t){return t%2!=0}},includes:function(t){return function(e){return~e.indexOf(t)}},schema:function(t){return function(t){return{simple:function(e){var n=[];if(Object.keys(t).forEach((function(r){var i=t[r];try{i.check((e||{})[r])}catch(t){t.target=r,n.push(t)}})),n.length>0)throw n;return!0},async:function(e){var n=[],r=Object.keys(t).map((function(r){return t[r].testAsync((e||{})[r]).catch((function(t){t.target=r,n.push(t)}))}));return Promise.all(r).then((function(t){if(n.length>0)throw n;return!0}))}}}(t)},passesAnyOf:function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(t){return e.some((function(e){return e.test(t)}))}},optional:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return function(n){return e&&"string"==typeof n&&""===n.trim()||null!=n&&t.check(n),!0}}};function io(t){return function(e){return Array.isArray(e)&&"array"===t||null===e&&"null"===t||typeof e===t}}function oo(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}Xi.extend({curieChain:()=>t=>Array.isArray(t)&&t[0]instanceof URL&&t.slice(1).every((t=>"string"==typeof t)),typeOf:t=>e=>typeof e===t});const so=Xi().schema({clear:Xi().typeOf("function"),getItem:Xi().typeOf("function"),key:Xi().typeOf("function"),length:Xi().number(),removeItem:Xi().typeOf("function"),setItem:Xi().typeOf("function")});class ao extends Error{constructor(t){ao.v8n.constructor.check(t),super(`authentication failed with code ${t.code}`),this.originalError=t.originalError,this.code=t.code}}ao.NEW_PASSWORD_REQUIRED="NEW_PASSWORD_REQUIRED",ao.INVALID_NEW_PASSWORD="INVALID_NEW_PASSWORD",ao.UNAUTHORIZED="UNAUTHORIZED",ao.UNKNOWN="UNKNOWN",ao.v8n={constructor:Xi().schema({code:Xi().passesAnyOf(Xi().exact(ao.NEW_PASSWORD_REQUIRED),Xi().exact(ao.INVALID_NEW_PASSWORD),Xi().exact(ao.UNAUTHORIZED),Xi().exact(ao.UNKNOWN))})};var co=ut(lt((function(t){function e(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}t.exports=function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t},t.exports.default=t.exports,t.exports.__esModule=!0}))),uo=lt((function(t){t.exports=function(t,e){return e.get?e.get.call(t):e.value},t.exports.default=t.exports,t.exports.__esModule=!0})),lo=lt((function(t){t.exports=function(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)},t.exports.default=t.exports,t.exports.__esModule=!0})),ho=ut(lt((function(t){t.exports=function(t,e){var n=lo(t,e,"get");return uo(t,n)},t.exports.default=t.exports,t.exports.__esModule=!0}))),fo=new WeakMap,po=function(){function t(){fo.set(this,{writable:!0,value:new Map})}var e=t.prototype;return e.key=function(t){t=Number.parseInt(t,10);for(var e=ho(this,fo).keys(),n=0,r=e.next();!r.done;){if(n===t)return r.value;n+=1,r=e.next()}return null},e.getItem=function(t){var e;return null!=(e=ho(this,fo).get(""+t))?e:null},e.setItem=function(t,e){ho(this,fo).set(""+t,""+e)},e.removeItem=function(t){ho(this,fo).delete(""+t)},e.clear=function(){ho(this,fo).clear()},co(t,[{key:"length",get:function(){return ho(this,fo).size}}]),t}();class yo extends Error{constructor(t){super(),yo.v8n.constructor.check(t),this.response=t}}yo.v8n={constructor:Xi().instanceOf(pt.Response)};var vo=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(t){o(t)}}function a(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))},go=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};function _o(t){const{json:e}=t,n=go(t,["json"]);if("_links"in e){const t=e._links;e._links=Object.entries(t).reduce(((t,[e,r])=>{if(Array.isArray(r))return Object.assign(Object.assign({},t),{[e]:r});const i=new xo(Object.assign(Object.assign({},n),{path:[new URL(r.href)]})),o={delete:i.delete.bind(i),follow:i.follow.bind(i),get:i.get.bind(i),patch:i.patch.bind(i),post:i.post.bind(i),put:i.put.bind(i)};return Object.assign(Object.assign({},t),{[e]:Object.assign(Object.assign({},r),o)})}),{})}if("_embedded"in e){const t=e._embedded;e._embedded=Object.entries(t).reduce(((t,[e,r])=>Object.assign(t,{[e]:Array.isArray(r)?r.map((t=>_o(Object.assign(Object.assign({},n),{json:t})))):_o(Object.assign(Object.assign({},n),{json:r}))})),{})}return e}class mo extends pt.Response{constructor(t){mo.v8n.constructor.check(t),super(t.body,t),this._console=t.console,this._fetch=t.fetch,this._cache=t.cache}json(){const t=Object.create(null,{json:{get:()=>super.json}});return vo(this,void 0,void 0,(function*(){const e=yield t.json.call(this),n={cache:this._cache,console:this._console,fetch:this._fetch};return _o(Object.assign({json:e},n))}))}}mo.v8n={constructor:Xi().schema({cache:so,console:Xi().instanceOf(Fi.constructor),fetch:Xi().typeOf("function")})};var bo=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(t){o(t)}}function a(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))};function wo(t,e){const n=""===t?"":t+":";return"string"==typeof e?n+e:Array.isArray(e)?e.map((e=>wo(t,e))).join():Object.entries(e).map((([t,e])=>wo(n+t,e))).join()}function So(t){return"string"==typeof t?t:Array.isArray(t)?t.map((t=>So(t))).join():Object.entries(t).map((([t,e])=>`${t} ${e}`)).join()}class xo{constructor(t){xo.v8n.classConstructor.check(t),this._path=t.path,this._fetch=t.fetch,this._cache=t.cache,this._console=t.console}get(t){return bo(this,void 0,void 0,(function*(){xo.v8n.get.check(t);const e=yield this._resolve(),{filters:n,fields:r,offset:i,limit:o,order:s,zoom:a}=null!=t?t:{};void 0!==n&&n.forEach((t=>{[...new URLSearchParams(t).entries()].forEach((([t,n])=>e.searchParams.append(t,n)))})),void 0!==r&&e.searchParams.set("fields",r.join(",")),void 0!==i&&e.searchParams.set("offset",String(i)),void 0!==o&&e.searchParams.set("limit",String(o)),void 0!==s&&e.searchParams.set("order",So(s)),void 0!==a&&e.searchParams.set("zoom",wo("",a));const c=yield this._fetch(new pt.Request(e.toString())),u={cache:this._cache,console:this._console,fetch:this._fetch};return new mo(Object.assign(Object.assign(Object.assign({},u),c),{body:yield c.text()}))}))}put(t){return bo(this,void 0,void 0,(function*(){const e=yield this._resolve(),n=new pt.Request(e.toString(),{body:JSON.stringify(t),method:"PUT"}),r=yield this._fetch(n),i={cache:this._cache,console:this._console,fetch:this._fetch};return new mo(Object.assign(Object.assign(Object.assign({},i),r),{body:yield r.text()}))}))}post(t){return bo(this,void 0,void 0,(function*(){const e=yield this._resolve(),n=new pt.Request(e.toString(),{body:JSON.stringify(t),method:"POST"}),r=yield this._fetch(n),i={cache:this._cache,console:this._console,fetch:this._fetch};return new mo(Object.assign(Object.assign(Object.assign({},i),r),{body:yield r.text()}))}))}patch(t){return bo(this,void 0,void 0,(function*(){const e=yield this._resolve(),n=new pt.Request(e.toString(),{body:JSON.stringify(t),method:"PATCH"}),r=yield this._fetch(n),i={cache:this._cache,console:this._console,fetch:this._fetch};return new mo(Object.assign(Object.assign(Object.assign({},i),r),{body:yield r.text()}))}))}delete(){return bo(this,void 0,void 0,(function*(){const t=yield this._resolve(),e=new pt.Request(t.toString(),{method:"DELETE"}),n=yield this._fetch(e),r={cache:this._cache,console:this._console,fetch:this._fetch};return new mo(Object.assign(Object.assign(Object.assign({},r),n),{body:yield n.text()}))}))}follow(t){xo.v8n.follow.check(t);const e={cache:this._cache,console:this._console,fetch:this._fetch},n=this._path.concat(t);return new xo(Object.assign(Object.assign({},e),{path:n}))}_resolve(){return bo(this,void 0,void 0,(function*(){if(1===this._path.length)return new URL(this._path[0].toString());const[t,e]=this._path,n=`${t.toString()} > ${e}`,r={cache:this._cache,console:this._console,fetch:this._fetch};this._console.trace(`Trying to resolve ${n}...`);const i=this._cache.getItem(n);if(i){this._console.success(`Resolved ${n} to ${i.toString()} using cache.`);const t=[new URL(i),...this._path.slice(2)];return new xo(Object.assign(Object.assign({},r),{path:t}))._resolve()}const o=yield this._fetch(t.toString());if(o.ok){const t=yield o.json(),i=new URL(t._links[e].href),s=[i,...this._path.slice(2)];return this._cache.setItem(n,i.toString()),this._console.trace(`Cached ${i.toString()} for ${n}.`),this._console.success(`Resolved ${n} to ${i.toString()} online.`),new xo(Object.assign(Object.assign({},r),{path:s}))._resolve()}throw this._console.error(`Failed to resolve ${n}.`),new yo(o)}))}}xo.v8n={classConstructor:Xi().schema({cache:so,console:Xi().instanceOf(Fi.constructor),fetch:Xi().typeOf("function"),path:Xi().curieChain()}),follow:Xi().string(),get:Xi().optional(Xi().schema({fields:Xi().optional(Xi().array().every.string()),filters:Xi().optional(Xi().array().every.string()),limit:Xi().optional(Xi().number()),offset:Xi().optional(Xi().number()),order:Xi().optional(Xi().passesAnyOf(Xi().string(),Xi().object(),Xi().array())),zoom:Xi().optional(Xi().passesAnyOf(Xi().string(),Xi().object(),Xi().array()))}))},xo.ResolutionError=yo,xo.Response=mo;var Oo=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(t){o(t)}}function a(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))};class jo extends xo{constructor(t){var e,n,r;jo.v8n.classConstructor.check(t),super({cache:null!==(e=t.cache)&&void 0!==e?e:new po,console:Fi.create({level:t.level}).withTag("@foxy.io/sdk"),fetch:null!==(n=t.fetch)&&void 0!==n?n:pt.fetch,path:[t.base]}),this.console=this._console,this.storage=null!==(r=t.storage)&&void 0!==r?r:new po,this.cache=this._cache,this.base=t.base}fetch(...t){return Oo(this,void 0,void 0,(function*(){return this._fetch(...t)}))}}jo.WHATWGResponse=pt.Response,jo.WHATWGRequest=pt.Request,jo.WHATWGHeaders=pt.Headers,jo.whatwgFetch=pt.fetch,jo.AuthError=ao,jo.Node=xo,jo.v8n={classConstructor:Xi().schema({base:Xi().instanceOf(URL),cache:Xi().optional(so),fetch:Xi().optional(Xi().typeOf("function")),level:Xi().optional(Xi().integer()),storage:Xi().optional(so)})};export{Gt as $,jo as A,xn as B,bt as C,Kt as D,le as E,ft as F,ve as G,ae as H,ee as I,te as J,zt as K,rt as L,Xt as M,Ht as N,ie as O,re as P,Dt as Q,Mi as R,nn as S,s as T,Bt as U,Ut as V,fe as W,De as X,Wt as Y,Vt as Z,ot as _,P as a,Ii as a$,qt as a0,Ft as a1,Jt as a2,he as a3,Ze as a4,Xe as a5,_t as a6,gt as a7,Qe as a8,be as a9,Vn as aA,zn as aB,rr as aC,ar as aD,ur as aE,sr as aF,hr as aG,Nr as aH,Cr as aI,Ur as aJ,An as aK,ui as aL,si as aM,ii as aN,li as aO,Si as aP,kn as aQ,Ln as aR,wi as aS,Pr as aT,xr as aU,wr as aV,oi as aW,Mn as aX,hi as aY,fr as aZ,ln as a_,we as aa,Se as ab,xe as ac,Ee as ad,Pe as ae,Ae as af,ke as ag,Ne as ah,Ce as ai,Oe as aj,Ie as ak,Le as al,Ve as am,Ue as an,N as ao,hn as ap,Y as aq,g as ar,A as as,u as at,e as au,n as av,at as aw,F as ax,tt as ay,Xi as az,Te as b,et as c,y as d,Gr as e,lt as f,ut as g,M as h,ct as i,ht as j,pt as k,I as l,wn as m,r as n,S as o,dt as p,rn as q,Yt as r,Ye as s,Vi as t,vt as u,Ge as v,Rt as w,Re as x,ye as y,Mt as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as t,h as e}from"./shared-
|
|
1
|
+
import{_ as t,h as e}from"./shared-00811efe.js";import{C as s}from"./shared-c9e0b693.js";import"./foxy-nucleon-element.js";import{R as l,T as a,a as i}from"./shared-8dd2593f.js";import{c as r}from"./shared-4e709717.js";import{N as d}from"./shared-dc5928e9.js";let n,o,h,u,c,m=t=>t;const p=s(l(a(i(d))));class v extends p{constructor(){super(...arguments),this.templates={},this.columns=[]}static get properties(){return t(t({},super.properties),{},{columns:{attribute:!1}})}render(){var t,s;return e(n||(n=m` <div data-testid="wrapper" class="relative" aria-busy="${0}" aria-live="polite"> <table class="table-fixed w-full" data-testid="table"> <thead class="sr-only"> <tr> ${0} </tr> </thead> <tbody class="divide-y divide-contrast-10"> ${0} </tbody> </table> ${0} </div> ${0} `),this.in("busy"),this.columns.map((t=>{var s;return e(o||(o=m` <th> ${0} </th> `),null===(s=t.header)||void 0===s?void 0:s.call(t,{html:e,lang:this.lang,data:this.data,ns:this.ns}))})),this.__rows.map((t=>{var s;return e(h||(h=m` <tr class="h-l"> ${0} </tr> `),null===(s=this.columns)||void 0===s?void 0:s.map(((s,l)=>{var a;return e(u||(u=m` <td class="${0}"> ${0} </td> `),r({"text-right":l===this.columns.length-1,"hidden sm-table-cell":"sm"===s.hideBelow,"hidden md-table-cell":"md"===s.hideBelow,"hidden lg-table-cell":"lg"===s.hideBelow,"hidden xl-table-cell":"xl"===s.hideBelow,"truncate h-l font-lumo text-body text-m":!0}),t?null===(a=s.cell)||void 0===a?void 0:a.call(s,{html:e,lang:this.lang,data:t,ns:this.ns}):"")})))})),this.in({idle:"snapshot"})?"":e(c||(c=m` <div class="absolute inset-0 flex items-center justify-center"> <foxy-spinner data-testid="spinner" layout="vertical" state="${0}" class="p-m bg-base shadow-xs rounded-t-l rounded-b-l" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> `),this.in("busy")?"busy":this.in("idle")?"empty":"error",this.lang,this.ns,null!==(s=null===(t=customElements.get("foxy-spinner"))||void 0===t?void 0:t.defaultNS)&&void 0!==s?s:""),this.renderTemplateOrSlot())}get __rows(){var t,e,s;const l=Object.values(null!==(e=null===(t=this.data)||void 0===t?void 0:t._embedded)&&void 0!==e?e:{}).reduce(((t,e)=>[...t,...e]),[]);let a;if(0===l.length)try{const t=new URL(null!==(s=this.href)&&void 0!==s?s:"").searchParams.get("limit"),e=parseInt(null!=t?t:"");a=isNaN(e)?20:e}catch(t){a=20}else a=l.length;return new Array(a).fill(null).map(((t,e)=>{var s;return null!==(s=l[e])&&void 0!==s?s:t}))}}export{v as T};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{L as e,h as r}from"./shared-
|
|
1
|
+
import{L as e,h as r}from"./shared-00811efe.js";import{b as s}from"./shared-8dd2593f.js";let t,o=e=>e;class n extends e{static get styles(){return s.styles}render(){return r(t||(t=o` <p class="flex text-s border border-contrast-10 rounded-t-l rounded-b-l p-s text-body leading-s"> <iron-icon icon="lumo:error" class="text-error flex-shrink-0 mr-s"></iron-icon> <slot></slot> </p> `))}}function a(e){const[r,s,t]=e.split("-").map((e=>parseInt(e,10)));return[r,s,t].some((e=>"number"!=typeof e||isNaN(e)))?null:new Date(r,s-1,t)}export{n as W,a as p};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{T as t}from"./shared-
|
|
1
|
+
import{T as t}from"./shared-07867126.js";import{a as s}from"./shared-8dd2593f.js";let e,n,a,o,l,i,r=t=>t;class c extends(s(t,"transactions-table")){constructor(){super(...arguments),this.columns=[c.priceColumn,c.summaryColumn,c.statusColumn,c.idColumn,c.dateColumn,c.receiptColumn]}}c.priceColumn={cell:t=>t.html(e||(e=r`
|
|
2
2
|
<foxy-i18n
|
|
3
3
|
data-testclass="i18n totals"
|
|
4
4
|
class="text-s font-semibold font-tnum"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-b98f88c9.js";import"./shared-cd700eac.js";import"./shared-45d647e4.js";import{L as t,h as e}from"./shared-
|
|
1
|
+
import"./shared-b98f88c9.js";import"./shared-cd700eac.js";import"./shared-45d647e4.js";import{L as t,h as e}from"./shared-00811efe.js";import{T as a,S as s,a as n}from"./shared-8dd2593f.js";import{c as i}from"./shared-4e709717.js";import{p as r,W as o}from"./shared-09384e52.js";import"./shared-f62abcd5.js";import"./foxy-spinner.js";import"./foxy-i18n.js";import"./shared-e0248713.js";import{C as d,i as l}from"./shared-c9e0b693.js";import"./shared-52d3b939.js";import"./shared-d8160231.js";import"./shared-54c485d2.js";import"./shared-3ae39e52.js";import{G as c}from"./shared-420ef4a6.js";import{N as h}from"./shared-dc5928e9.js";function u(t){return[t.getFullYear().toString().padStart(4,"0"),(t.getMonth()+1).toString().padStart(2,"0"),t.getDate().toString().padStart(2,"0")].join("-")}let m,g,p,v,b,f=t=>t;class y extends(a(t)){constructor(){super(...arguments),this.checkAvailability=()=>!0,this.readonly=!1,this.disabled=!1,this.value="",this.start="",this.lang=""}static get properties(){return{checkAvailability:{attribute:!1},readonly:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},value:{type:String},start:{type:String},lang:{type:String}}}render(){var t,a;const s=new Date(null!==(a=null!==(t=this.__startAsDate)&&void 0!==t?t:this.__valueAsDate)&&void 0!==a?a:Date.now()),n=new Date(s),r=new Date(s),o=this.lang||navigator.language;return n.setMonth(n.getMonth()-1),r.setMonth(r.getMonth()+1),e(m||(m=f` <div class="text-m text-body font-lumo leading-m"> <div class="grid p-xs" style="grid-template:auto/max-content auto max-content"> <vaadin-button data-testid="prev" aria-label="${0}" theme="icon tertiary" class="px-xs" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:chevron-left"></iron-icon> </vaadin-button> <span data-testid="month" class="${0}"> ${0} </span> <vaadin-button data-testid="next" aria-label="${0}" theme="icon tertiary" class="px-xs" ?disabled="${0}" @click="${0}"> <iron-icon icon="icons:chevron-right"></iron-icon> </vaadin-button> </div> ${0} </div> `),n.toLocaleString(o,{year:"numeric",month:"long"}),this.disabled,this.__handlePrevButtonClick,i({"text-center self-center font-medium":!0,"text-disabled":this.disabled}),s.toLocaleDateString(o,{month:"long",year:"numeric"}),r.toLocaleString(o,{year:"numeric",month:"long"}),this.disabled,this.__handleNextButtonClick,this.__renderMonth(s.getMonth(),s.getFullYear()))}get __valueAsDate(){return r(this.value)}set __valueAsDate(t){this.value=t?u(t):""}get __startAsDate(){return r(this.start)}set __startAsDate(t){this.start=t?u(t):""}__renderMonth(t,a){var s,n,r;const o=this.lang||navigator.language,d=new Date(a,t,1,0,0,0,0),l=[];for(let t=0;t<7;++t){const a=new Date;for(;a.getDay()!==t;)a.setDate(a.getDate()+1);l.push(e(g||(g=f` <span class="${0}"> ${0} </span> `),i({"self-center text-xxs uppercase font-medium tracking-wider":!0,"text-secondary":!this.disabled,"text-disabled":this.disabled}),a.toLocaleString(o,{weekday:"short"})))}for(;d.getMonth()===t;){const i=d.getFullYear()===(null===(s=this.__valueAsDate)||void 0===s?void 0:s.getFullYear())&&d.getMonth()===(null===(n=this.__valueAsDate)||void 0===n?void 0:n.getMonth())&&d.getDate()===(null===(r=this.__valueAsDate)||void 0===r?void 0:r.getDate());l.push(e(p||(p=f` <div style="grid-column:${0}" data-testclass="day-of-month"> ${0} </div> `),d.getDay()+1,this.__renderDate(d.getDate(),t,a,i))),d.setDate(d.getDate()+1)}return e(v||(v=f` <form data-testid="grid" class="grid gap-s p-s text-center" style="grid-template:auto/repeat(7,1fr)"> ${0} </form> `),l)}__renderDate(t,a,s,n=!1){const r=this.disabled||this.readonly||!this.checkAvailability(new Date(s,a,t));return e(b||(b=f` <label class="${0}"> <input name="date" type="radio" value="${0}" class="sr-only" ?disabled="${0}" @change="${0}"> ${0} </label> `),i({"font-tnum select-none relative flex h-m items-center justify-center rounded":!0,"cursor-pointer focus-within-ring-2 focus-within-ring-primary-50":!r,"bg-contrast-5 hover-bg-contrast-10":!n&&!r,"bg-primary text-primary-contrast":n&&!r,"border border-dashed border-contrast-20 text-disabled":!n&&r,"border border-dashed border-primary text-primary":n&&r}),t,this.readonly||this.disabled||r,(()=>{this.__valueAsDate=new Date(s,a,t),this.dispatchEvent(new CustomEvent("change"))}),t)}__handlePrevButtonClick(){var t;const e=new Date(null!==(t=this.start)&&void 0!==t?t:Date.now());this.__startAsDate=new Date(e.setMonth(e.getMonth()-1))}__handleNextButtonClick(){var t;const e=new Date(null!==(t=this.start)&&void 0!==t?t:Date.now());this.__startAsDate=new Date(e.setMonth(e.getMonth()+1))}}customElements.define("foxy-internal-calendar",y);let _,x,$,D,w=t=>t;const S=s(a(d(n(h,"cancellation-form"))));class j extends S{constructor(){super(...arguments),this.templates={},this.__renderWarning=()=>{const{lang:t,ns:a}=this;return e(_||(_=w` <div> ${0} <x-warning> <foxy-i18n data-testid="warning" class="${0}" lang="${0}" key="end_subscription_explainer" ns="${0}"> </foxy-i18n> </x-warning> ${0} </div> `),this.renderTemplateOrSlot("warning:before"),i({"text-disabled":!this.in({idle:"snapshot"})}),t,a,this.renderTemplateOrSlot("warning:after"))},this.__renderEndDate=()=>{var t,a;const{constructor:s,lang:n,ns:r}=this,o=s.__tomorrow.getTime(),d=this.in({idle:"snapshot"});return e(x||(x=w` <div> ${0} <x-group frame> <foxy-i18n data-testid="end-date-label" class="${0}" slot="header" lang="${0}" key="end_date" ns="${0}"> </foxy-i18n> <foxy-internal-calendar data-testid="end-date" .checkAvailability="${0}" ?disabled="${0}" ?readonly="${0}" value="${0}" lang="${0}" @change="${0}"> </foxy-internal-calendar> </x-group> ${0} </div> `),this.renderTemplateOrSlot("end-date:before"),i({"text-disabled":!d}),n,r,(t=>t.getTime()>=o),!d||this.disabledSelector.matches("end-date",!0),!!(null===(t=this.data)||void 0===t?void 0:t.end_date)||this.readonlySelector.matches("end-date",!0),l(null!==(a=this.form.end_date)&&void 0!==a?a:void 0),n,(t=>{this.edit({end_date:t.target.value})}),this.renderTemplateOrSlot("end-date:after"))},this.__renderSubmit=()=>{const t=this.in({idle:{snapshot:{clean:"valid"}}})||this.in({idle:{snapshot:{dirty:"valid"}}});return e($||($=w` <div> ${0} <vaadin-button data-testid="submit" ?disabled="${0}" theme="primary error" class="w-full" @click="${0}"> <foxy-i18n ns="${0}" lang="${0}" key="end_subscription"></foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot("submit:before"),!t||this.disabledSelector.matches("submit",!0),(()=>this.submit()),this.ns,this.lang,this.renderTemplateOrSlot("submit:after"))}}static get scopedElements(){return{"foxy-internal-calendar":customElements.get("foxy-internal-calendar"),"foxy-internal-sandbox":customElements.get("foxy-internal-sandbox"),"vaadin-button":customElements.get("vaadin-button"),"foxy-spinner":customElements.get("foxy-spinner"),"foxy-i18n":customElements.get("foxy-i18n"),"x-warning":o,"x-group":c}}static get v8n(){return[({end_date:t})=>!!t||"end_date_required"]}render(){var t,a;const s=this.hiddenSelector,n=this.in("busy"),r=this.in("fail");return e(D||(D=w` <div class="space-y-l font-lumo text-m text-body leading-m relative"> ${0} ${0} ${0} <div data-testid="spinner" class="${0}"> <foxy-spinner layout="vertical" class="m-auto p-m bg-base shadow-xs rounded-t-l rounded-b-l" state="${0}" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> `),s.matches("warning",!0)?"":this.__renderWarning(),s.matches("end-date",!0)?"":this.__renderEndDate(),s.matches("submit",!0)?"":this.__renderSubmit(),i({"transition duration-500 ease-in-out absolute inset-0 flex":!0,"opacity-0 pointer-events-none":!n&&!r}),r?"error":n?"busy":"empty",this.lang,this.ns,null!==(a=null===(t=customElements.get("foxy-spinner"))||void 0===t?void 0:t.defaultNS)&&void 0!==a?a:"")}submit(){if(!this.form.end_date){const t=this.constructor;this.edit({end_date:u(t.__tomorrow)})}super.submit()}static get __tomorrow(){const t=new Date;return t.setDate(t.getDate()+1),t.setHours(0,0,0,0),t}}customElements.define("foxy-cancellation-form",j);export{j as C,u as s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{L as e,_ as s,h as t}from"./shared-
|
|
1
|
+
import{L as e,_ as s,h as t}from"./shared-00811efe.js";import{b as r}from"./shared-8dd2593f.js";let a,o=e=>e;class n extends e{constructor(){super(...arguments),this.frame=!1}static get properties(){return s(s({},super.properties),{},{frame:{type:Boolean}})}static get styles(){return r.styles}render(){return t(a||(a=o` <section class="space-y-s font-lumo antialiased"> <h3 class="${0}"> <slot name="header"></slot> </h3> <div class="rounded-t-l rounded-b-l ${0}"> <slot></slot> </div> </section> `),"text-s font-medium text-secondary leading-none "+(this.frame?"":"pl-m"),this.frame?"border border-contrast-10":"")}}export{n as G};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{L as t,c as e,h as s}from"./shared-
|
|
1
|
+
import{L as t,c as e,h as s}from"./shared-00811efe.js";import{b as a}from"./shared-8dd2593f.js";let d,i,r,l=t=>t;class o extends t{constructor(){super(...arguments),this.items=[],this.disabled=!1}static get properties(){return{disabled:{type:Boolean,reflect:!0},items:{attribute:!1}}}static get styles(){return[a.styles,e(d||(d=l`.max-w-0{max-width:0}`))]}render(){const t=this.disabled?"text-disabled":"text-body",e=this.disabled?"text-disabled":"text-secondary",a="max-w-0 truncate py-s";return s(i||(i=l` <table class="font-lumo text-m leading-m w-full"> <tbody class="divide-y divide-contrast-10"> ${0} </tbody> </table> `),this.items.map((({name:d,value:i})=>s(r||(r=l` <tr> <td class="${0} ${0} w-1-3 pr-m" title="${0}">${0}</td> <td class="${0} ${0} w-2-3" title="${0}">${0}</td> </tr> `),a,e,d,d,a,t,i,i))))}}export{o as P};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e,_ as t,h as r}from"./shared-
|
|
1
|
+
import{c as e,_ as t,h as r}from"./shared-00811efe.js";import{B as s}from"./shared-b98f88c9.js";import{c as n}from"./shared-8dd2593f.js";import{I as o}from"./shared-52d3b939.js";let i,a,l,c=e=>e;class d{constructor(e="unknown"){this.type=e}}class h extends CustomEvent{constructor(){super("reload")}}class p extends n{constructor(){super(...arguments),this.type="unknown",this.reload=!1}static get scopedElements(){return{"vaadin-button":s,"iron-icon":customElements.get("iron-icon"),"x-i18n":o}}static get styles(){return[super.styles,e(i||(i=c`:host{position:absolute;top:0;right:0;bottom:0;left:0}.container-narrow{max-width:400px}`))]}static get properties(){return t(t({},super.properties),{},{reload:{type:Boolean,reflect:!0},type:{type:String}})}render(){return r(a||(a=c` <article class="bg-base font-lumo text-center leading-m p-m h-full flex flex-col items-center justify-center"> <iron-icon icon="lumo:error" class="text-error w-l h-l mb-m"></iron-icon> <header class="text-xl text-header container-narrow font-medium"> <x-i18n ns="${0}" lang="${0}" key="errors.${0}.title"></x-i18n> </header> <p class="text-m text-secondary container-narrow mb-l"> <x-i18n ns="${0}" lang="${0}" key="errors.${0}.message"></x-i18n> </p> <div class="flex space-x-s"> <a rel="nofollow noreferrer noopener" href="${0}" target="_blank" class="px-m py-xs text-primary font-medium tracking-wide border border-contrast-10 rounded transition-colors duration-200 hover-bg-primary-10 hover-border-primary-10 focus-outline-none focus-shadow-outline" router-ignore> <x-i18n ns="${0}" lang="${0}" key="errors.${0}.action"></x-i18n> </a> ${0} </div> </article> `),this.ns,this.lang,this.type,this.ns,this.lang,this.type,this._i18n.t(`errors.${this.type}.href`).toString(),this.ns,this.lang,this.type,this.reload?r(l||(l=c` <vaadin-button data-testid="reload" theme="primary" @click="${0}"> <x-i18n ns="${0}" lang="${0}" key="reload"></x-i18n> <iron-icon icon="icons:refresh" slot="suffix"></iron-icon> </vaadin-button> `),(()=>this.dispatchEvent(new h)),this.ns,this.lang):"")}}export{p as E,d as F};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as e,az as t,k as s}from"./shared-
|
|
1
|
+
import{A as e,az as t,k as s}from"./shared-00811efe.js";var n=function(e,t,s,n){return new(s||(s=Promise))((function(i,o){function r(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(r,a)}c((n=n.apply(e,t||[])).next())}))};class i extends e{constructor(e){super(Object.assign(Object.assign({},e),{fetch:(...e)=>this.__fetch(...e)}))}signIn(t){return n(this,void 0,void 0,(function*(){i.v8n.credentials.check(t);const s=yield this.fetch(new URL("./authenticate",this.base).toString(),{body:JSON.stringify(t),method:"POST"});if(!s.ok){const t=401===s.status?"UNAUTHORIZED":"UNKNOWN";throw new e.AuthError({code:t})}{const e=yield s.json(),t=Object.assign(Object.assign({},e),{date_created:(new Date).toISOString()});this.storage.setItem(i.SESSION,JSON.stringify(t))}}))}sendPasswordResetEmail(t){return n(this,void 0,void 0,(function*(){i.v8n.email.check(t.email);if(!(yield this.fetch(new URL("./forgot_password",this.base).toString(),{body:JSON.stringify(t),method:"POST"})).ok)throw new e.AuthError({code:"UNKNOWN"})}))}signOut(){return n(this,void 0,void 0,(function*(){if(!(yield this.fetch(new URL("./authenticate",this.base).toString(),{method:"DELETE"})).ok)throw new e.AuthError({code:"UNKNOWN"});this.storage.clear(),this.cache.clear()}))}__fetch(e,t){var o;return n(this,void 0,void 0,(function*(){let n=JSON.parse(null!==(o=this.storage.getItem(i.SESSION))&&void 0!==o?o:"null");const r=new s.Request(e,t);if(null!==n){new Date(n.date_created).getTime()+1e3*n.expires_in<Date.now()?(this.console.info("Session has expired, signing out."),this.storage.clear(),this.cache.clear(),n=null):r.headers.set("Authorization",`Bearer ${n.session_token}`)}r.headers.set("Content-Type","application/json"),r.headers.set("FOXY-API-VERSION","1"),this.console.trace(`${r.method} ${r.url}`);const a=yield s.fetch(r);if(n&&a.ok){const e=Object.assign(Object.assign({},n),{date_created:(new Date).toISOString()});this.storage.setItem(i.SESSION,JSON.stringify(e))}return a}))}}i.SESSION="session",i.v8n=Object.assign({},e.v8n,{credentials:t().schema({email:t().string(),newPassword:t().optional(t().string()),password:t().string()}),email:t().string()});let o=/(-?(?:\d+\.?\d*|\d*\.?\d+)(?:e[-+]?\d+)?)\s*([a-zµμ]*)/gi;function r(e="",t="ms"){var s=null;return(e=e.replace(/(\d),(\d)/g,"$1$2")).replace(o,(function(e,t,n){(n=r[n]||r[n.toLowerCase().replace(/s$/,"")])&&(s=(s||0)+parseFloat(t,10)*n)})),s&&s/r[t]}r.nanosecond=r.ns=1e-6,r["µs"]=r["μs"]=r.us=r.microsecond=.001,r.millisecond=r.ms=1,r.second=r.sec=r.s=1e3*r.ms,r.minute=r.min=r.m=60*r.s,r.hour=r.hr=r.h=60*r.m,r.day=r.d=24*r.h,r.week=r.wk=r.w=7*r.d,r.month=r.b=30.4375*r.d,r.year=r.yr=r.y=365.25*r.d;export{i as A,r as p};
|