@ohif/extension-measurement-tracking 3.8.0 → 3.8.2

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.
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see ohif-extension-measurement-tracking.umd.js.LICENSE.txt */
2
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@ohif/ui"),require("@ohif/extension-default"),require("@ohif/extension-cornerstone-dicom-sr"),require("@ohif/core"),require("@cornerstonejs/tools"),require("@cornerstonejs/core")):"function"==typeof define&&define.amd?define(["@ohif/ui","@ohif/extension-default","@ohif/extension-cornerstone-dicom-sr","@ohif/core","@cornerstonejs/tools","@cornerstonejs/core"],t):"object"==typeof exports?exports["ohif-extension-measurement-tracking"]=t(require("@ohif/ui"),require("@ohif/extension-default"),require("@ohif/extension-cornerstone-dicom-sr"),require("@ohif/core"),require("@cornerstonejs/tools"),require("@cornerstonejs/core")):e["ohif-extension-measurement-tracking"]=t(e["@ohif/ui"],e["@ohif/extension-default"],e["@ohif/extension-cornerstone-dicom-sr"],e["@ohif/core"],e["@cornerstonejs/tools"],e["@cornerstonejs/core"])}(globalThis,((e,t,n,r,i,a)=>(()=>{var o,s,l,u,c={597:(e,t,n)=>{"use strict";n.d(t,{A:()=>Ft,B:()=>Ut});var r,i,a=n(766),o=n(374),s=n.n(o),l=function(){return l=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},l.apply(this,arguments)};function u(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function c(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function f(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,a=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o}function d(e,t,n){if(n||2===arguments.length)for(var r,i=0,a=t.length;i<a;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}!function(e){e.Start="xstate.start",e.Stop="xstate.stop",e.Raise="xstate.raise",e.Send="xstate.send",e.Cancel="xstate.cancel",e.NullEvent="",e.Assign="xstate.assign",e.After="xstate.after",e.DoneState="done.state",e.DoneInvoke="done.invoke",e.Log="xstate.log",e.Init="xstate.init",e.Invoke="xstate.invoke",e.ErrorExecution="error.execution",e.ErrorCommunication="error.communication",e.ErrorPlatform="error.platform",e.ErrorCustom="xstate.error",e.Update="xstate.update",e.Pure="xstate.pure",e.Choose="xstate.choose"}(r||(r={})),function(e){e.Parent="#_parent",e.Internal="#_internal"}(i||(i={}));var p,h=r.Start,v=r.Stop,g=r.Raise,y=r.Send,m=r.Cancel,b=r.NullEvent,S=r.Assign,w=(r.After,r.DoneState,r.Log),k=r.Init,E=r.Invoke,x=(r.ErrorExecution,r.ErrorPlatform),_=r.ErrorCustom,I=r.Update,T=r.Choose,C=r.Pure,O={},N="xstate.guard",R=!0;function D(e,t,n){void 0===n&&(n=".");var r=M(e,n),i=M(t,n);return G(i)?!!G(r)&&i===r:G(r)?r in i:Object.keys(r).every((function(e){return e in i&&D(r[e],i[e])}))}function P(e){try{return G(e)||"number"==typeof e?"".concat(e):e.type}catch(e){throw new Error("Events must be strings or objects with a string event.type property.")}}function A(e,t){try{return Q(e)?e:e.toString().split(t)}catch(t){throw new Error("'".concat(e,"' is not a valid state path."))}}function M(e,t){return function(e){return"object"==typeof e&&"value"in e&&"context"in e&&"event"in e&&"_event"in e}(e)?e.value:Q(e)?L(e):"string"!=typeof e?e:L(A(e,t))}function L(e){if(1===e.length)return e[0];for(var t={},n=t,r=0;r<e.length-1;r++)r===e.length-2?n[e[r]]=e[r+1]:(n[e[r]]={},n=n[e[r]]);return t}function U(e,t){for(var n={},r=Object.keys(e),i=0;i<r.length;i++){var a=r[i];n[a]=t(e[a],a,e,i)}return n}function j(e,t,n){var r,i,a={};try{for(var o=c(Object.keys(e)),s=o.next();!s.done;s=o.next()){var l=s.value,u=e[l];n(u)&&(a[l]=t(u,l,e))}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return a}var V=function(e){return function(t){var n,r,i=t;try{for(var a=c(e),o=a.next();!o.done;o=a.next()){i=i[o.value]}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i}};function F(e){return e?G(e)?[[e]]:z(Object.keys(e).map((function(t){var n=e[t];return"string"==typeof n||n&&Object.keys(n).length?F(e[t]).map((function(e){return[t].concat(e)})):[[t]]}))):[[]]}function z(e){var t;return(t=[]).concat.apply(t,d([],f(e),!1))}function B(e){return Q(e)?e:[e]}function H(e){return void 0===e?[]:B(e)}function W(e,t,n){var r,i;if(J(e))return e(t,n.data);var a={};try{for(var o=c(Object.keys(e)),s=o.next();!s.done;s=o.next()){var l=s.value,u=e[l];J(u)?a[l]=u(t,n.data):a[l]=u}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return a}function q(e){return e instanceof Promise||!(null===e||!J(e)&&"object"!=typeof e||!J(e.then))}function $(e,t){return U(e.states,(function(e,n){if(e){var r=(G(t)?void 0:t[n])||(e?e.current:void 0);if(r)return{current:r,states:$(e,r)}}}))}function K(e,t,n,r){R||Y(!!e,"Attempting to update undefined context");var i=e?n.reduce((function(e,n){var i,a,o=n.assignment,s={state:r,action:n,_event:t},l={};if(J(o))l=o(e,t.data,s);else try{for(var u=c(Object.keys(o)),f=u.next();!f.done;f=u.next()){var d=f.value,p=o[d];l[d]=J(p)?p(e,t.data,s):p}}catch(e){i={error:e}}finally{try{f&&!f.done&&(a=u.return)&&a.call(u)}finally{if(i)throw i.error}}return Object.assign({},e,l)}),e):e;return i}var Y=function(){};function Q(e){return Array.isArray(e)}function J(e){return"function"==typeof e}function G(e){return"string"==typeof e}function X(e,t){if(e)return G(e)?{type:N,name:e,predicate:t?t[e]:void 0}:J(e)?{type:N,name:e.name,predicate:e}:e}R||(Y=function(e,t){var n=e instanceof Error?e:void 0;if((n||!e)&&void 0!==console){var r=["Warning: ".concat(t)];n&&r.push(n),console.warn.apply(console,r)}});var Z=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}();(p={})[Z]=function(){return this},p[Symbol.observable]=function(){return this};function ee(e){return!!e&&"__xstatenode"in e}function te(e,t){return G(e)||"number"==typeof e?l({type:e},t):e}function ne(e,t){if(!G(e)&&"$$type"in e&&"scxml"===e.$$type)return e;var n=te(e);return l({name:n.type,data:n,$$type:"scxml",type:"external"},t)}function re(e,t){return B(t).map((function(t){return void 0===t||"string"==typeof t||ee(t)?{target:t,event:e}:l(l({},t),{event:e})}))}function ie(e,t,n,r,i){var a=e.options.guards,o={state:i,cond:t,_event:r};if(t.type===N)return((null==a?void 0:a[t.name])||t.predicate)(n,r.data,o);var s=null==a?void 0:a[t.type];if(!s)throw new Error("Guard '".concat(t.type,"' is not implemented on machine '").concat(e.id,"'."));return s(n,r.data,o)}function ae(e){return"string"==typeof e?{type:e}:e}function oe(e,t,n){var r=function(){},i="object"==typeof e,a=i?e:null;return{next:((i?e.next:e)||r).bind(a),error:((i?e.error:t)||r).bind(a),complete:((i?e.complete:n)||r).bind(a)}}function se(e,t){return"".concat(e,":invocation[").concat(t,"]")}function le(e){return(e.type===g||e.type===y&&e.to===i.Internal)&&"number"!=typeof e.delay}var ue=ne({type:k});function ce(e,t){return t&&t[e]||void 0}function fe(e,t){var n;if(G(e)||"number"==typeof e)n=J(r=ce(e,t))?{type:e,exec:r}:r||{type:e,exec:void 0};else if(J(e))n={type:e.name||e.toString(),exec:e};else{var r;if(J(r=ce(e.type,t)))n=l(l({},e),{exec:r});else if(r){var i=r.type||e.type;n=l(l(l({},r),e),{type:i})}else n=e}return n}var de=function(e,t){return e?(Q(e)?e:[e]).map((function(e){return fe(e,t)})):[]};function pe(e){var t=fe(e);return l(l({id:G(e)?e:t.id},t),{type:t.type})}function he(e,t){return{to:t?t.to:void 0,type:y,event:J(e)?e:te(e),delay:t?t.delay:void 0,id:t&&void 0!==t.id?t.id:J(e)?e.name:P(e)}}function ve(e,t){var n="".concat(r.DoneState,".").concat(e),i={type:n,data:t,toString:function(){return n}};return i}function ge(e,t){var n="".concat(r.DoneInvoke,".").concat(e),i={type:n,data:t,toString:function(){return n}};return i}function ye(e,t){var n="".concat(r.ErrorPlatform,".").concat(e),i={type:n,data:t,toString:function(){return n}};return i}function me(e,t,n,a,o,s,u){void 0===u&&(u=!1);var p=u?[]:function(e){var t,n,r=[];try{for(var i=c(e),a=i.next();!a.done;a=i.next())for(var o=a.value,s=0;s<o.actions.length;)o.actions[s].type!==S?s++:(r.push(o.actions[s]),o.actions.splice(s,1))}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r}(o),h=p.length?K(n,a,p,t):n,m=u?[n]:void 0,b=[];function k(o,c){var p;switch(c.type){case g:var k=function(e,t,n,r){var i,a={_event:n},o=ne(J(e.event)?e.event(t,n.data,a):e.event);if(G(e.delay)){var s=r&&r[e.delay];i=J(s)?s(t,n.data,a):s}else i=J(e.delay)?e.delay(t,n.data,a):e.delay;return l(l({},e),{type:g,_event:o,delay:i})}(c,h,a,e.options.delays);return s&&"number"==typeof k.delay&&s(k,h,a),k;case y:var E=function(e,t,n,r){var i,a={_event:n},o=ne(J(e.event)?e.event(t,n.data,a):e.event);if(G(e.delay)){var s=r&&r[e.delay];i=J(s)?s(t,n.data,a):s}else i=J(e.delay)?e.delay(t,n.data,a):e.delay;var u=J(e.to)?e.to(t,n.data,a):e.to;return l(l({},e),{to:u,_event:o,event:o.data,delay:i})}(c,h,a,e.options.delays);if(!R){var x=c.delay;Y(!G(x)||"number"==typeof E.delay,"No delay reference for delay expression '".concat(x,"' was found on machine '").concat(e.id,"'"))}return s&&E.to!==i.Internal&&("entry"===o?b.push(E):s(E,h,a)),E;case w:var _=function(e,t,n){return l(l({},e),{value:G(e.expr)?e.expr:e.expr(t,n.data,{_event:n})})}(c,h,a);return null==s||s(_,h,a),_;case T:if(!(D=null===(p=c.conds.find((function(n){var r=X(n.cond,e.options.guards);return!r||ie(e,r,h,a,s?void 0:t)})))||void 0===p?void 0:p.actions))return[];var I=f(me(e,t,h,a,[{type:o,actions:de(H(D),e.options.actions)}],s,u),2),O=I[0],N=I[1];return h=N,null==m||m.push(h),O;case C:var D;if(!(D=c.get(h,a.data)))return[];var P=f(me(e,t,h,a,[{type:o,actions:de(H(D),e.options.actions)}],s,u),2),A=P[0],M=P[1];return h=M,null==m||m.push(h),A;case v:_=function(e,t,n){var i=J(e.activity)?e.activity(t,n.data):e.activity,a="string"==typeof i?{id:i}:i;return{type:r.Stop,activity:a}}(c,h,a);return null==s||s(_,n,a),_;case S:h=K(h,a,[c],s?void 0:t),null==m||m.push(h);break;default:var L=fe(c,e.options.actions),U=L.exec;if(s)s(L,h,a);else if(U&&m){var j=m.length-1,V=l(l({},L),{exec:function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];U.apply(void 0,d([m[j]],f(t),!1))}});L=V}return L}}var E=z(o.map((function(e){var t,n,r=[];try{for(var i=c(e.actions),o=i.next();!o.done;o=i.next()){var l=o.value,u=k(e.type,l);u&&(r=r.concat(u))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return b.forEach((function(e){s(e,h,a)})),b.length=0,r})));return[E,h]}var be=[],Se=function(e,t){be.push(e);var n=t(e);return be.pop(),n};function we(e){var t;return(t={id:e,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},getSnapshot:function(){},toJSON:function(){return{id:e}}})[Z]=function(){return this},t}function ke(e,t,n){var r=we(t);if(r.deferred=!0,ee(e)){var i=r.state=Se(void 0,(function(){return(n?e.withContext(n):e).initialState}));r.getSnapshot=function(){return i}}return r}var Ee=function(e){return"atomic"===e.type||"final"===e.type};function xe(e){return Object.keys(e.states).map((function(t){return e.states[t]}))}function _e(e){return xe(e).filter((function(e){return"history"!==e.type}))}function Ie(e){var t=[e];return Ee(e)?t:t.concat(z(_e(e).map(Ie)))}function Te(e,t){var n,r,i,a,o,s,l,u,f=Oe(new Set(e)),d=new Set(t);try{for(var p=c(d),h=p.next();!h.done;h=p.next())for(var v=(x=h.value).parent;v&&!d.has(v);)d.add(v),v=v.parent}catch(e){n={error:e}}finally{try{h&&!h.done&&(r=p.return)&&r.call(p)}finally{if(n)throw n.error}}var g=Oe(d);try{for(var y=c(d),m=y.next();!m.done;m=y.next()){if("compound"!==(x=m.value).type||g.get(x)&&g.get(x).length){if("parallel"===x.type)try{for(var b=(o=void 0,c(_e(x))),S=b.next();!S.done;S=b.next()){var w=S.value;d.has(w)||(d.add(w),f.get(w)?f.get(w).forEach((function(e){return d.add(e)})):w.initialStateNodes.forEach((function(e){return d.add(e)})))}}catch(e){o={error:e}}finally{try{S&&!S.done&&(s=b.return)&&s.call(b)}finally{if(o)throw o.error}}}else f.get(x)?f.get(x).forEach((function(e){return d.add(e)})):x.initialStateNodes.forEach((function(e){return d.add(e)}))}}catch(e){i={error:e}}finally{try{m&&!m.done&&(a=y.return)&&a.call(y)}finally{if(i)throw i.error}}try{for(var k=c(d),E=k.next();!E.done;E=k.next()){var x;for(v=(x=E.value).parent;v&&!d.has(v);)d.add(v),v=v.parent}}catch(e){l={error:e}}finally{try{E&&!E.done&&(u=k.return)&&u.call(k)}finally{if(l)throw l.error}}return d}function Ce(e,t){var n=t.get(e);if(!n)return{};if("compound"===e.type){var r=n[0];if(!r)return{};if(Ee(r))return r.key}var i={};return n.forEach((function(e){i[e.key]=Ce(e,t)})),i}function Oe(e){var t,n,r=new Map;try{for(var i=c(e),a=i.next();!a.done;a=i.next()){var o=a.value;r.has(o)||r.set(o,[]),o.parent&&(r.has(o.parent)||r.set(o.parent,[]),r.get(o.parent).push(o))}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r}function Ne(e,t){return Ce(e,Oe(Te([e],t)))}function Re(e,t){return Array.isArray(e)?e.some((function(e){return e===t})):e instanceof Set&&e.has(t)}function De(e,t){return"compound"===t.type?_e(t).some((function(t){return"final"===t.type&&Re(e,t)})):"parallel"===t.type&&_e(t).every((function(t){return De(e,t)}))}function Pe(e){return new Set(z(e.map((function(e){return e.tags}))))}function Ae(e,t){if(e===t)return!0;if(void 0===e||void 0===t)return!1;if(G(e)||G(t))return e===t;var n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every((function(n){return Ae(e[n],t[n])}))}function Me(e){return"object"==typeof e&&null!==e&&("value"in e&&"_event"in e)}var Le=function(){function e(e){var t,n,r=this;this.actions=[],this.activities=O,this.meta={},this.events=[],this.value=e.value,this.context=e.context,this._event=e._event,this._sessionid=e._sessionid,this.event=this._event.data,this.historyValue=e.historyValue,this.history=e.history,this.actions=e.actions||[],this.activities=e.activities||O,this.meta=(void 0===(n=e.configuration)&&(n=[]),n.reduce((function(e,t){return void 0!==t.meta&&(e[t.id]=t.meta),e}),{})),this.events=e.events||[],this.matches=this.matches.bind(this),this.toStrings=this.toStrings.bind(this),this.configuration=e.configuration,this.transitions=e.transitions,this.children=e.children,this.done=!!e.done,this.tags=null!==(t=Array.isArray(e.tags)?new Set(e.tags):e.tags)&&void 0!==t?t:new Set,this.machine=e.machine,Object.defineProperty(this,"nextEvents",{get:function(){return function(e){return d([],f(new Set(z(d([],f(e.map((function(e){return e.ownEvents}))),!1)))),!1)}(r.configuration)}})}return e.from=function(t,n){return t instanceof e?t.context!==n?new e({value:t.value,context:n,_event:t._event,_sessionid:null,historyValue:t.historyValue,history:t.history,actions:[],activities:t.activities,meta:{},events:[],configuration:[],transitions:[],children:{}}):t:new e({value:t,context:n,_event:ue,_sessionid:null,historyValue:void 0,history:void 0,actions:[],activities:void 0,meta:void 0,events:[],configuration:[],transitions:[],children:{}})},e.create=function(t){return new e(t)},e.inert=function(t,n){if(t instanceof e){if(!t.actions.length)return t;var r=ue;return new e({value:t.value,context:n,_event:r,_sessionid:null,historyValue:t.historyValue,history:t.history,activities:t.activities,configuration:t.configuration,transitions:[],children:{}})}return e.from(t,n)},e.prototype.toStrings=function(e,t){var n=this;if(void 0===e&&(e=this.value),void 0===t&&(t="."),G(e))return[e];var r=Object.keys(e);return r.concat.apply(r,d([],f(r.map((function(r){return n.toStrings(e[r],t).map((function(e){return r+t+e}))}))),!1))},e.prototype.toJSON=function(){var e=this;e.configuration,e.transitions;var t=e.tags;e.machine;var n=u(e,["configuration","transitions","tags","machine"]);return l(l({},n),{tags:Array.from(t)})},e.prototype.matches=function(e){return D(e,this.value)},e.prototype.hasTag=function(e){return this.tags.has(e)},e.prototype.can=function(e){var t;R&&Y(!!this.machine,"state.can(...) used outside of a machine-created State object; this will always return false.");var n=null===(t=this.machine)||void 0===t?void 0:t.getTransitionData(this,e);return!!(null==n?void 0:n.transitions.length)&&n.transitions.some((function(e){return void 0!==e.target||e.actions.length}))},e}(),Ue={deferEvents:!1},je=function(){function e(e){this.processingEvent=!1,this.queue=[],this.initialized=!1,this.options=l(l({},Ue),e)}return e.prototype.initialize=function(e){if(this.initialized=!0,e){if(!this.options.deferEvents)return void this.schedule(e);this.process(e)}this.flushEvents()},e.prototype.schedule=function(e){if(this.initialized&&!this.processingEvent){if(0!==this.queue.length)throw new Error("Event queue should be empty when it is not processing events");this.process(e),this.flushEvents()}else this.queue.push(e)},e.prototype.clear=function(){this.queue=[]},e.prototype.flushEvents=function(){for(var e=this.queue.shift();e;)this.process(e),e=this.queue.shift()},e.prototype.process=function(e){this.processingEvent=!0;try{e()}catch(e){throw this.clear(),e}finally{this.processingEvent=!1}},e}(),Ve=new Map,Fe=0,ze=function(){return"x:".concat(Fe++)},Be=function(e,t){return Ve.set(e,t),e},He=function(e){return Ve.get(e)},We=function(e){Ve.delete(e)};function qe(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:void(R||console.warn("XState could not find a global object in this environment. Please let the maintainers know and raise an issue here: https://github.com/statelyai/xstate/issues"))}function $e(e){if(qe()){var t=function(){var e=qe();if(e&&"__xstate__"in e)return e.__xstate__}();t&&t.register(e)}}function Ke(e,t){void 0===t&&(t={});var n=e.initialState,r=new Set,i=[],a=!1,o=function(e){var t;return l(((t={subscribe:function(){return{unsubscribe:function(){}}},id:"anonymous",getSnapshot:function(){}})[Z]=function(){return this},t),e)}({id:t.id,send:function(t){i.push(t),function(){if(!a){for(a=!0;i.length>0;){var t=i.shift();n=e.transition(n,t,s),r.forEach((function(e){return e.next(n)}))}a=!1}}()},getSnapshot:function(){return n},subscribe:function(e,t,i){var a=oe(e,t,i);return r.add(a),a.next(n),{unsubscribe:function(){r.delete(a)}}}}),s={parent:t.parent,self:o,id:t.id||"anonymous",observers:r};return n=e.start?e.start(s):n,o}var Ye,Qe={sync:!1,autoForward:!1};!function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(Ye||(Ye={}));var Je=function(){function e(t,n){void 0===n&&(n=e.defaultOptions);var a=this;this.machine=t,this.delayedEventsMap={},this.listeners=new Set,this.contextListeners=new Set,this.stopListeners=new Set,this.doneListeners=new Set,this.eventListeners=new Set,this.sendListeners=new Set,this.initialized=!1,this.status=Ye.NotStarted,this.children=new Map,this.forwardTo=new Set,this._outgoingQueue=[],this.init=this.start,this.send=function(e,t){if(Q(e))return a.batch(e),a.state;var n=ne(te(e,t));if(a.status===Ye.Stopped)return R||Y(!1,'Event "'.concat(n.name,'" was sent to stopped service "').concat(a.machine.id,'". This service has already reached its final state, and will not transition.\nEvent: ').concat(JSON.stringify(n.data))),a.state;if(a.status!==Ye.Running&&!a.options.deferEvents)throw new Error('Event "'.concat(n.name,'" was sent to uninitialized service "').concat(a.machine.id,'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.\nEvent: ').concat(JSON.stringify(n.data)));return a.scheduler.schedule((function(){a.forward(n);var e=a._nextState(n);a.update(e,n)})),a._state},this.sendTo=function(e,t,n){var r,o=a.parent&&(t===i.Parent||a.parent.id===t),s=o?a.parent:G(t)?t===i.Internal?a:a.children.get(t)||He(t):(r=t)&&"function"==typeof r.send?t:void 0;if(s)if("machine"in s){if(a.status!==Ye.Stopped||a.parent!==s||a.state.done){var u=l(l({},e),{name:e.name===_?"".concat(ye(a.id)):e.name,origin:a.sessionId});!n&&a.machine.config.predictableActionArguments?a._outgoingQueue.push([s,u]):s.send(u)}}else!n&&a.machine.config.predictableActionArguments?a._outgoingQueue.push([s,e.data]):s.send(e.data);else{if(!o)throw new Error("Unable to send event to child '".concat(t,"' from service '").concat(a.id,"'."));R||Y(!1,"Service '".concat(a.id,"' has no parent: unable to send event ").concat(e.type))}},this._exec=function(e,t,n,i){void 0===i&&(i=a.machine.options.actions);var o=e.exec||ce(e.type,i),s=J(o)?o:o?o.exec:e.exec;if(s)try{return s(t,n.data,a.machine.config.predictableActionArguments?{action:e,_event:n}:{action:e,state:a.state,_event:n})}catch(e){throw a.parent&&a.parent.send({type:"xstate.error",data:e}),e}switch(e.type){case g:var l=e;a.defer(l);break;case y:var u=e;if("number"==typeof u.delay)return void a.defer(u);u.to?a.sendTo(u._event,u.to,n===ue):a.send(u._event);break;case m:a.cancel(e.sendId);break;case h:if(a.status!==Ye.Running)return;var c=e.activity;if(!a.machine.config.predictableActionArguments&&!a.state.activities[c.id||c.type])break;if(c.type===r.Invoke){var f=ae(c.src),d=a.machine.options.services?a.machine.options.services[f.type]:void 0,p=c.id,b=c.data;R||Y(!("forward"in c),"`forward` property is deprecated (found in invocation of '".concat(c.src,"' in in machine '").concat(a.machine.id,"'). ")+"Please use `autoForward` instead.");var S="autoForward"in c?c.autoForward:!!c.forward;if(!d)return void(R||Y(!1,"No service found for invocation '".concat(c.src,"' in machine '").concat(a.machine.id,"'.")));var k=b?W(b,t,n):void 0;if("string"==typeof d)return;var E=J(d)?d(t,n.data,{data:k,src:f,meta:c.meta}):d;if(!E)return;var x=void 0;ee(E)&&(E=k?E.withContext(k):E,x={autoForward:S}),a.spawn(E,p,x)}else a.spawnActivity(c);break;case v:a.stopChild(e.activity.id);break;case w:var _=e,I=_.label,T=_.value;I?a.logger(I,T):a.logger(T);break;default:R||Y(!1,"No implementation found for action type '".concat(e.type,"'"))}};var o=l(l({},e.defaultOptions),n),s=o.clock,u=o.logger,c=o.parent,f=o.id,d=void 0!==f?f:t.id;this.id=d,this.logger=u,this.clock=s,this.parent=c,this.options=o,this.scheduler=new je({deferEvents:this.options.deferEvents}),this.sessionId=ze()}return Object.defineProperty(e.prototype,"initialState",{get:function(){var e=this;return this._initialState?this._initialState:Se(this,(function(){return e._initialState=e.machine.initialState,e._initialState}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return R||Y(this.status!==Ye.NotStarted,"Attempted to read state from uninitialized service '".concat(this.id,"'. Make sure the service is started first.")),this._state},enumerable:!1,configurable:!0}),e.prototype.execute=function(e,t){var n,r;try{for(var i=c(e.actions),a=i.next();!a.done;a=i.next()){var o=a.value;this.exec(o,e,t)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}},e.prototype.update=function(e,t){var n,r,i,a,o,s,l,u,f=this;if(e._sessionid=this.sessionId,this._state=e,this.machine.config.predictableActionArguments&&t!==ue||!this.options.execute)for(var d=void 0;d=this._outgoingQueue.shift();)d[0].send(d[1]);else this.execute(this.state);if(this.children.forEach((function(e){f.state.children[e.id]=e})),this.devTools&&this.devTools.send(t.data,e),e.event)try{for(var p=c(this.eventListeners),h=p.next();!h.done;h=p.next()){(0,h.value)(e.event)}}catch(e){n={error:e}}finally{try{h&&!h.done&&(r=p.return)&&r.call(p)}finally{if(n)throw n.error}}try{for(var v=c(this.listeners),g=v.next();!g.done;g=v.next()){(0,g.value)(e,e.event)}}catch(e){i={error:e}}finally{try{g&&!g.done&&(a=v.return)&&a.call(v)}finally{if(i)throw i.error}}try{for(var y=c(this.contextListeners),m=y.next();!m.done;m=y.next()){(0,m.value)(this.state.context,this.state.history?this.state.history.context:void 0)}}catch(e){o={error:e}}finally{try{m&&!m.done&&(s=y.return)&&s.call(y)}finally{if(o)throw o.error}}if(this.state.done){var b=e.configuration.find((function(e){return"final"===e.type&&e.parent===f.machine})),S=b&&b.doneData?W(b.doneData,e.context,t):void 0;this._doneEvent=ge(this.id,S);try{for(var w=c(this.doneListeners),k=w.next();!k.done;k=w.next()){(0,k.value)(this._doneEvent)}}catch(e){l={error:e}}finally{try{k&&!k.done&&(u=w.return)&&u.call(w)}finally{if(l)throw l.error}}this._stop(),this._stopChildren(),We(this.sessionId)}},e.prototype.onTransition=function(e){return this.listeners.add(e),this.status===Ye.Running&&e(this.state,this.state.event),this},e.prototype.subscribe=function(e,t,n){var r=this,i=oe(e,t,n);this.listeners.add(i.next),this.status!==Ye.NotStarted&&i.next(this.state);var a=function(){r.doneListeners.delete(a),r.stopListeners.delete(a),i.complete()};return this.status===Ye.Stopped?i.complete():(this.onDone(a),this.onStop(a)),{unsubscribe:function(){r.listeners.delete(i.next),r.doneListeners.delete(a),r.stopListeners.delete(a)}}},e.prototype.onEvent=function(e){return this.eventListeners.add(e),this},e.prototype.onSend=function(e){return this.sendListeners.add(e),this},e.prototype.onChange=function(e){return this.contextListeners.add(e),this},e.prototype.onStop=function(e){return this.stopListeners.add(e),this},e.prototype.onDone=function(e){return this.status===Ye.Stopped&&this._doneEvent?e(this._doneEvent):this.doneListeners.add(e),this},e.prototype.off=function(e){return this.listeners.delete(e),this.eventListeners.delete(e),this.sendListeners.delete(e),this.stopListeners.delete(e),this.doneListeners.delete(e),this.contextListeners.delete(e),this},e.prototype.start=function(e){var t=this;if(this.status===Ye.Running)return this;this.machine._init(),Be(this.sessionId,this),this.initialized=!0,this.status=Ye.Running;var n=void 0===e?this.initialState:Se(this,(function(){return Me(e)?t.machine.resolveState(e):t.machine.resolveState(Le.from(e,t.machine.context))}));return this.options.devTools&&this.attachDev(),this.scheduler.initialize((function(){t.update(n,ue)})),this},e.prototype._stopChildren=function(){this.children.forEach((function(e){J(e.stop)&&e.stop()})),this.children.clear()},e.prototype._stop=function(){var e,t,n,r,i,a,o,s,l,u;try{for(var f=c(this.listeners),d=f.next();!d.done;d=f.next()){var p=d.value;this.listeners.delete(p)}}catch(t){e={error:t}}finally{try{d&&!d.done&&(t=f.return)&&t.call(f)}finally{if(e)throw e.error}}try{for(var h=c(this.stopListeners),v=h.next();!v.done;v=h.next()){(p=v.value)(),this.stopListeners.delete(p)}}catch(e){n={error:e}}finally{try{v&&!v.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}try{for(var g=c(this.contextListeners),y=g.next();!y.done;y=g.next()){p=y.value;this.contextListeners.delete(p)}}catch(e){i={error:e}}finally{try{y&&!y.done&&(a=g.return)&&a.call(g)}finally{if(i)throw i.error}}try{for(var m=c(this.doneListeners),b=m.next();!b.done;b=m.next()){p=b.value;this.doneListeners.delete(p)}}catch(e){o={error:e}}finally{try{b&&!b.done&&(s=m.return)&&s.call(m)}finally{if(o)throw o.error}}if(!this.initialized)return this;this.initialized=!1,this.status=Ye.Stopped,this._initialState=void 0;try{for(var S=c(Object.keys(this.delayedEventsMap)),w=S.next();!w.done;w=S.next()){var k=w.value;this.clock.clearTimeout(this.delayedEventsMap[k])}}catch(e){l={error:e}}finally{try{w&&!w.done&&(u=S.return)&&u.call(S)}finally{if(l)throw l.error}}this.scheduler.clear(),this.scheduler=new je({deferEvents:this.options.deferEvents})},e.prototype.stop=function(){var e=this,t=this.scheduler;return this._stop(),t.schedule((function(){var t;if(!(null===(t=e._state)||void 0===t?void 0:t.done)){var n=ne({type:"xstate.stop"}),r=Se(e,(function(){var t=z(d([],f(e.state.configuration),!1).sort((function(e,t){return t.order-e.order})).map((function(t){return de(t.onExit,e.machine.options.actions)}))),r=f(me(e.machine,e.state,e.state.context,n,[{type:"exit",actions:t}],e.machine.config.predictableActionArguments?e._exec:void 0,e.machine.config.predictableActionArguments||e.machine.config.preserveActionOrder),2),i=r[0],a=r[1],o=new Le({value:e.state.value,context:a,_event:n,_sessionid:e.sessionId,historyValue:void 0,history:e.state,actions:i.filter((function(e){return!le(e)})),activities:{},events:[],configuration:[],transitions:[],children:{},done:e.state.done,tags:e.state.tags,machine:e.machine});return o.changed=!0,o}));e.update(r,n),e._stopChildren(),We(e.sessionId)}})),this},e.prototype.batch=function(e){var t=this;if(this.status===Ye.NotStarted&&this.options.deferEvents)R||Y(!1,"".concat(e.length,' event(s) were sent to uninitialized service "').concat(this.machine.id,'" and are deferred. Make sure .start() is called for this service.\nEvent: ').concat(JSON.stringify(event)));else if(this.status!==Ye.Running)throw new Error("".concat(e.length,' event(s) were sent to uninitialized service "').concat(this.machine.id,'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.'));if(e.length){var n=!!this.machine.config.predictableActionArguments&&this._exec;this.scheduler.schedule((function(){var r,i,a=t.state,o=!1,s=[],u=function(e){var r=ne(e);t.forward(r),a=Se(t,(function(){return t.machine.transition(a,r,void 0,n||void 0)})),s.push.apply(s,d([],f(t.machine.config.predictableActionArguments?a.actions:a.actions.map((function(e){return function(e,t){var n=e.exec;return l(l({},e),{exec:void 0!==n?function(){return n(t.context,t.event,{action:e,state:t,_event:t._event})}:void 0})}(e,a)}))),!1)),o=o||!!a.changed};try{for(var p=c(e),h=p.next();!h.done;h=p.next()){u(h.value)}}catch(e){r={error:e}}finally{try{h&&!h.done&&(i=p.return)&&i.call(p)}finally{if(r)throw r.error}}a.changed=o,a.actions=s,t.update(a,ne(e[e.length-1]))}))}},e.prototype.sender=function(e){return this.send.bind(this,e)},e.prototype._nextState=function(e,t){var n=this;void 0===t&&(t=!!this.machine.config.predictableActionArguments&&this._exec);var r=ne(e);if(0===r.name.indexOf(x)&&!this.state.nextEvents.some((function(e){return 0===e.indexOf(x)})))throw r.data.data;return Se(this,(function(){return n.machine.transition(n.state,r,void 0,t||void 0)}))},e.prototype.nextState=function(e){return this._nextState(e,!1)},e.prototype.forward=function(e){var t,n;try{for(var r=c(this.forwardTo),i=r.next();!i.done;i=r.next()){var a=i.value,o=this.children.get(a);if(!o)throw new Error("Unable to forward event '".concat(e,"' from interpreter '").concat(this.id,"' to nonexistant child '").concat(a,"'."));o.send(e)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}},e.prototype.defer=function(e){var t=this,n=this.clock.setTimeout((function(){"to"in e&&e.to?t.sendTo(e._event,e.to,!0):t.send(e._event)}),e.delay);e.id&&(this.delayedEventsMap[e.id]=n)},e.prototype.cancel=function(e){this.clock.clearTimeout(this.delayedEventsMap[e]),delete this.delayedEventsMap[e]},e.prototype.exec=function(e,t,n){void 0===n&&(n=this.machine.options.actions),this._exec(e,t.context,t._event,n)},e.prototype.removeChild=function(e){var t;this.children.delete(e),this.forwardTo.delete(e),null===(t=this.state)||void 0===t||delete t.children[e]},e.prototype.stopChild=function(e){var t=this.children.get(e);t&&(this.removeChild(e),J(t.stop)&&t.stop())},e.prototype.spawn=function(e,t,n){if(this.status!==Ye.Running)return ke(e,t);if(q(e))return this.spawnPromise(Promise.resolve(e),t);if(J(e))return this.spawnCallback(e,t);if(function(e){try{return"function"==typeof e.send}catch(e){return!1}}(i=e)&&"id"in i)return this.spawnActor(e,t);if(function(e){try{return"subscribe"in e&&J(e.subscribe)}catch(e){return!1}}(e))return this.spawnObservable(e,t);if(ee(e))return this.spawnMachine(e,l(l({},n),{id:t}));if(null!==(r=e)&&"object"==typeof r&&"transition"in r&&"function"==typeof r.transition)return this.spawnBehavior(e,t);throw new Error('Unable to spawn entity "'.concat(t,'" of type "').concat(typeof e,'".'));var r,i},e.prototype.spawnMachine=function(t,n){var r=this;void 0===n&&(n={});var i=new e(t,l(l({},this.options),{parent:this,id:n.id||t.id})),a=l(l({},Qe),n);a.sync&&i.onTransition((function(e){r.send(I,{state:e,id:i.id})}));var o=i;return this.children.set(i.id,o),a.autoForward&&this.forwardTo.add(i.id),i.onDone((function(e){r.removeChild(i.id),r.send(ne(e,{origin:i.id}))})).start(),o},e.prototype.spawnBehavior=function(e,t){var n=Ke(e,{id:t,parent:this});return this.children.set(t,n),n},e.prototype.spawnPromise=function(e,t){var n,r,i=this,a=!1;e.then((function(e){a||(r=e,i.removeChild(t),i.send(ne(ge(t,e),{origin:t})))}),(function(e){if(!a){i.removeChild(t);var n=ye(t,e);try{i.send(ne(n,{origin:t}))}catch(r){!function(e,t,n){if(!R){var r=e.stack?" Stacktrace was '".concat(e.stack,"'"):"";if(e===t)console.error("Missing onError handler for invocation '".concat(n,"', error was '").concat(e,"'.").concat(r));else{var i=t.stack?" Stacktrace was '".concat(t.stack,"'"):"";console.error("Missing onError handler and/or unhandled exception/promise rejection for invocation '".concat(n,"'. ")+"Original error: '".concat(e,"'. ").concat(r," Current error is '").concat(t,"'.").concat(i))}}}(e,r,t),i.devTools&&i.devTools.send(n,i.state),i.machine.strict&&i.stop()}}}));var o=((n={id:t,send:function(){},subscribe:function(t,n,r){var i=oe(t,n,r),a=!1;return e.then((function(e){a||(i.next(e),a||i.complete())}),(function(e){a||i.error(e)})),{unsubscribe:function(){return a=!0}}},stop:function(){a=!0},toJSON:function(){return{id:t}},getSnapshot:function(){return r}})[Z]=function(){return this},n);return this.children.set(t,o),o},e.prototype.spawnCallback=function(e,t){var n,r,i,a=this,o=!1,s=new Set,l=new Set;try{i=e((function(e){r=e,l.forEach((function(t){return t(e)})),o||a.send(ne(e,{origin:t}))}),(function(e){s.add(e)}))}catch(e){this.send(ye(t,e))}if(q(i))return this.spawnPromise(i,t);var u=((n={id:t,send:function(e){return s.forEach((function(t){return t(e)}))},subscribe:function(e){var t=oe(e);return l.add(t.next),{unsubscribe:function(){l.delete(t.next)}}},stop:function(){o=!0,J(i)&&i()},toJSON:function(){return{id:t}},getSnapshot:function(){return r}})[Z]=function(){return this},n);return this.children.set(t,u),u},e.prototype.spawnObservable=function(e,t){var n,r,i=this,a=e.subscribe((function(e){r=e,i.send(ne(e,{origin:t}))}),(function(e){i.removeChild(t),i.send(ne(ye(t,e),{origin:t}))}),(function(){i.removeChild(t),i.send(ne(ge(t),{origin:t}))})),o=((n={id:t,send:function(){},subscribe:function(t,n,r){return e.subscribe(t,n,r)},stop:function(){return a.unsubscribe()},getSnapshot:function(){return r},toJSON:function(){return{id:t}}})[Z]=function(){return this},n);return this.children.set(t,o),o},e.prototype.spawnActor=function(e,t){return this.children.set(t,e),e},e.prototype.spawnActivity=function(e){var t=this.machine.options&&this.machine.options.activities?this.machine.options.activities[e.type]:void 0;if(t){var n=t(this.state.context,e);this.spawnEffect(e.id,n)}else R||Y(!1,"No implementation found for activity '".concat(e.type,"'"))},e.prototype.spawnEffect=function(e,t){var n;this.children.set(e,((n={id:e,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},stop:t||void 0,getSnapshot:function(){},toJSON:function(){return{id:e}}})[Z]=function(){return this},n))},e.prototype.attachDev=function(){var e=qe();if(this.options.devTools&&e){if(e.__REDUX_DEVTOOLS_EXTENSION__){var t="object"==typeof this.options.devTools?this.options.devTools:void 0;this.devTools=e.__REDUX_DEVTOOLS_EXTENSION__.connect(l(l({name:this.id,autoPause:!0,stateSanitizer:function(e){return{value:e.value,context:e.context,actions:e.actions}}},t),{features:l({jump:!1,skip:!1},t?t.features:void 0)}),this.machine),this.devTools.init(this.state)}$e(this)}},e.prototype.toJSON=function(){return{id:this.id}},e.prototype[Z]=function(){return this},e.prototype.getSnapshot=function(){return this.status===Ye.NotStarted?this.initialState:this._state},e.defaultOptions={execute:!0,deferEvents:!0,clock:{setTimeout:function(e,t){return setTimeout(e,t)},clearTimeout:function(e){return clearTimeout(e)}},logger:console.log.bind(console),devTools:!1},e.interpret=Ge,e}();function Ge(e,t){return new Je(e,t)}function Xe(e){if("string"==typeof e){var t={type:e,toString:function(){return e}};return t}return e}function Ze(e){return l(l({type:E},e),{toJSON:function(){e.onDone,e.onError;var t=u(e,["onDone","onError"]);return l(l({},t),{type:E,src:Xe(e.src)})}})}var et="",tt="*",nt={},rt=function(e){return"#"===e[0]},it=function(){function e(t,n,r,i){void 0===r&&(r="context"in t?t.context:void 0);var a,o=this;this.config=t,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=null==i?void 0:i.parent,this.key=this.config.key||(null==i?void 0:i.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||d([this.machine.key],f(this.path),!1).join(this.delimiter),this.version=this.parent?this.parent.version:this.config.version,this.type=this.config.type||(this.config.parallel?"parallel":this.config.states&&Object.keys(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.schema=this.parent?this.machine.schema:null!==(a=this.config.schema)&&void 0!==a?a:{},this.description=this.config.description,R||Y(!("parallel"in this.config),'The "parallel" property is deprecated and will be removed in version 4.1. '.concat(this.config.parallel?"Replace with `type: 'parallel'`":"Use `type: '".concat(this.type,"'`")," in the config for state node '").concat(this.id,"' instead.")),this.initial=this.config.initial,this.states=this.config.states?U(this.config.states,(function(t,n){var r,i=new e(t,{},void 0,{parent:o,key:n});return Object.assign(o.idMap,l(((r={})[i.id]=i,r),i.idMap)),i})):nt;var s=0;!function e(t){var n,r;t.order=s++;try{for(var i=c(xe(t)),a=i.next();!a.done;a=i.next()){e(a.value)}}catch(e){n={error:e}}finally{try{a&&!a.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(e){return e.event===et})):et in this.config.on),this.strict=!!this.config.strict,this.onEntry=H(this.config.entry||this.config.onEntry).map((function(e){return fe(e)})),this.onExit=H(this.config.exit||this.config.onExit).map((function(e){return fe(e)})),this.meta=this.config.meta,this.doneData="final"===this.type?this.config.data:void 0,this.invoke=H(this.config.invoke).map((function(e,t){var n,r;if(ee(e)){var i=se(o.id,t);return o.machine.options.services=l(((n={})[i]=e,n),o.machine.options.services),Ze({src:i,id:i})}if(G(e.src)){i=e.id||se(o.id,t);return Ze(l(l({},e),{id:i,src:e.src}))}if(ee(e.src)||J(e.src)){i=e.id||se(o.id,t);return o.machine.options.services=l(((r={})[i]=e.src,r),o.machine.options.services),Ze(l(l({id:i},e),{src:i}))}var a=e.src;return Ze(l(l({id:se(o.id,t)},e),{src:a}))})),this.activities=H(this.config.activities).concat(this.invoke).map((function(e){return pe(e)})),this.transition=this.transition.bind(this),this.tags=H(this.config.tags)}return e.prototype._init=function(){this.__cache.transitions||Ie(this).forEach((function(e){return e.on}))},e.prototype.withConfig=function(t,n){var r=this.options,i=r.actions,a=r.activities,o=r.guards,s=r.services,u=r.delays;return new e(this.config,{actions:l(l({},i),t.actions),activities:l(l({},a),t.activities),guards:l(l({},o),t.guards),services:l(l({},s),t.services),delays:l(l({},u),t.delays)},null!=n?n:this.context)},e.prototype.withContext=function(t){return new e(this.config,this.options,t)},Object.defineProperty(e.prototype,"context",{get:function(){return J(this._context)?this._context():this._context},enumerable:!1,configurable:!0}),Object.defineProperty(e.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:U(this.states,(function(e){return e.definition})),on:this.on,transitions:this.transitions,entry:this.onEntry,exit:this.onExit,activities:this.activities||[],meta:this.meta,order:this.order||-1,data:this.doneData,invoke:this.invoke,description:this.description,tags:this.tags}},enumerable:!1,configurable:!0}),e.prototype.toJSON=function(){return this.definition},Object.defineProperty(e.prototype,"on",{get:function(){if(this.__cache.on)return this.__cache.on;var e=this.transitions;return this.__cache.on=e.reduce((function(e,t){return e[t.eventType]=e[t.eventType]||[],e[t.eventType].push(t),e}),{})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"after",{get:function(){return this.__cache.delayedTransitions||(this.__cache.delayedTransitions=this.getDelayedTransitions(),this.__cache.delayedTransitions)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transitions",{get:function(){return this.__cache.transitions||(this.__cache.transitions=this.formatTransitions(),this.__cache.transitions)},enumerable:!1,configurable:!0}),e.prototype.getCandidates=function(e){if(this.__cache.candidates[e])return this.__cache.candidates[e];var t=e===et,n=this.transitions.filter((function(n){var r=n.eventType===e;return t?r:r||n.eventType===tt}));return this.__cache.candidates[e]=n,n},e.prototype.getDelayedTransitions=function(){var e=this,t=this.config.after;if(!t)return[];var n=function(t,n){var i=function(e,t){var n=t?"#".concat(t):"";return"".concat(r.After,"(").concat(e,")").concat(n)}(J(t)?"".concat(e.id,":delay[").concat(n,"]"):t,e.id);return e.onEntry.push(he(i,{delay:t})),e.onExit.push({type:m,sendId:i}),i};return(Q(t)?t.map((function(e,t){var r=n(e.delay,t);return l(l({},e),{event:r})})):z(Object.keys(t).map((function(e,r){var i=t[e],a=G(i)?{target:i}:i,o=isNaN(+e)?e:+e,s=n(o,r);return H(a).map((function(e){return l(l({},e),{event:s,delay:o})}))})))).map((function(t){var n=t.delay;return l(l({},e.formatTransition(t)),{delay:n})}))},e.prototype.getStateNodes=function(e){var t,n=this;if(!e)return[];var r=e instanceof Le?e.value:M(e,this.delimiter);if(G(r)){var i=this.getStateNode(r).initial;return void 0!==i?this.getStateNodes(((t={})[r]=i,t)):[this,this.states[r]]}var a=Object.keys(r),o=[this];return o.push.apply(o,d([],f(z(a.map((function(e){return n.getStateNode(e).getStateNodes(r[e])})))),!1)),o},e.prototype.handles=function(e){var t=P(e);return this.events.includes(t)},e.prototype.resolveState=function(e){var t=e instanceof Le?e:Le.create(e),n=Array.from(Te([],this.getStateNodes(t.value)));return new Le(l(l({},t),{value:this.resolve(t.value),configuration:n,done:De(n,this),tags:Pe(n),machine:this.machine}))},e.prototype.transitionLeafNode=function(e,t,n){var r=this.getStateNode(e).next(t,n);return r&&r.transitions.length?r:this.next(t,n)},e.prototype.transitionCompoundNode=function(e,t,n){var r=Object.keys(e),i=this.getStateNode(r[0])._transition(e[r[0]],t,n);return i&&i.transitions.length?i:this.next(t,n)},e.prototype.transitionParallelNode=function(e,t,n){var r,i,a={};try{for(var o=c(Object.keys(e)),s=o.next();!s.done;s=o.next()){var l=s.value,u=e[l];if(u){var f=this.getStateNode(l)._transition(u,t,n);f&&(a[l]=f)}}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}var d=Object.keys(a).map((function(e){return a[e]})),p=z(d.map((function(e){return e.transitions})));if(!d.some((function(e){return e.transitions.length>0})))return this.next(t,n);var h=z(Object.keys(a).map((function(e){return a[e].configuration})));return{transitions:p,exitSet:z(d.map((function(e){return e.exitSet}))),configuration:h,source:t,actions:z(Object.keys(a).map((function(e){return a[e].actions})))}},e.prototype._transition=function(e,t,n){return G(e)?this.transitionLeafNode(e,t,n):1===Object.keys(e).length?this.transitionCompoundNode(e,t,n):this.transitionParallelNode(e,t,n)},e.prototype.getTransitionData=function(e,t){return this._transition(e.value,e,ne(t))},e.prototype.next=function(e,t){var n,r,i,a=this,o=t.name,s=[],l=[];try{for(var u=c(this.getCandidates(o)),p=u.next();!p.done;p=u.next()){var h=p.value,v=h.cond,g=h.in,y=e.context,m=!g||(G(g)&&rt(g)?e.matches(M(this.getStateNodeById(g).path,this.delimiter)):D(M(g,this.delimiter),V(this.path.slice(0,-2))(e.value))),b=!1;try{b=!v||ie(this.machine,v,y,t,e)}catch(e){throw new Error("Unable to evaluate guard '".concat(v.name||v.type,"' in transition for event '").concat(o,"' in state node '").concat(this.id,"':\n").concat(e.message))}if(b&&m){void 0!==h.target&&(l=h.target),s.push.apply(s,d([],f(h.actions),!1)),i=h;break}}}catch(e){n={error:e}}finally{try{p&&!p.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}if(i){if(!l.length)return{transitions:[i],exitSet:[],configuration:e.value?[this]:[],source:e,actions:s};var S=z(l.map((function(t){return a.getRelativeStateNodes(t,e.historyValue)})));return{transitions:[i],exitSet:!!i.internal?[]:z(l.map((function(e){return a.getPotentiallyReenteringNodes(e)}))),configuration:S,source:e,actions:s}}},e.prototype.getPotentiallyReenteringNodes=function(e){if(this.order<e.order)return[this];for(var t=[],n=this,r=e;n&&n!==r;)t.push(n),n=n.parent;return n!==r?[]:(t.push(r),t)},e.prototype.getActions=function(e,t,n,i,a,o,s){var l,u,p,h,v=this,y=o?Te([],this.getStateNodes(o.value)):[],m=new Set;try{for(var b=c(Array.from(e).sort((function(e,t){return e.order-t.order}))),S=b.next();!S.done;S=b.next()){(!Re(y,E=S.value)||Re(n.exitSet,E)||E.parent&&m.has(E.parent))&&m.add(E)}}catch(e){l={error:e}}finally{try{S&&!S.done&&(u=b.return)&&u.call(b)}finally{if(l)throw l.error}}try{for(var w=c(y),k=w.next();!k.done;k=w.next()){var E;Re(e,E=k.value)&&!Re(n.exitSet,E.parent)||n.exitSet.push(E)}}catch(e){p={error:e}}finally{try{k&&!k.done&&(h=w.return)&&h.call(w)}finally{if(p)throw p.error}}n.exitSet.sort((function(e,t){return t.order-e.order}));var x=Array.from(m).sort((function(e,t){return e.order-t.order})),_=new Set(n.exitSet),I=z(x.map((function(e){var t=[];if("final"!==e.type)return t;var r=e.parent;if(!r.parent)return t;t.push(ve(e.id,e.doneData),ve(r.id,e.doneData?W(e.doneData,i,a):void 0));var o=r.parent;return"parallel"===o.type&&_e(o).every((function(e){return De(n.configuration,e)}))&&t.push(ve(o.id)),t}))),T=x.map((function(e){var t=e.onEntry,n=e.activities.map((function(e){return function(e){var t=pe(e);return{type:r.Start,activity:t,exec:void 0}}(e)}));return{type:"entry",actions:de(s?d(d([],f(t),!1),f(n),!1):d(d([],f(n),!1),f(t),!1),v.machine.options.actions)}})).concat({type:"state_done",actions:I.map((function(e){return function(e,t){return{type:g,event:"function"==typeof e?e:te(e),delay:t?t.delay:void 0,id:null==t?void 0:t.id}}(e)}))}),C=Array.from(_).map((function(e){return{type:"exit",actions:de(d(d([],f(e.onExit),!1),f(e.activities.map((function(e){return function(e){var t=J(e)?e:pe(e);return{type:r.Stop,activity:t,exec:void 0}}(e)}))),!1),v.machine.options.actions)}})).concat({type:"transition",actions:de(n.actions,this.machine.options.actions)}).concat(T);if(t){var O=de(z(d([],f(e),!1).sort((function(e,t){return t.order-e.order})).map((function(e){return e.onExit}))),this.machine.options.actions).filter((function(e){return!le(e)}));return C.concat({type:"stop",actions:O})}return C},e.prototype.transition=function(e,t,n,r){void 0===e&&(e=this.initialState);var i,a,o=ne(t);if(e instanceof Le)i=void 0===n?e:this.resolveState(Le.from(e,n));else{var s=G(e)?this.resolve(L(this.getResolvedPath(e))):this.resolve(e),l=null!=n?n:this.machine.context;i=this.resolveState(Le.from(s,l))}if(!R&&o.name===tt)throw new Error("An event cannot have the wildcard type ('".concat(tt,"')"));if(this.strict&&!this.events.includes(o.name)&&(a=o.name,!/^(done|error)\./.test(a)))throw new Error("Machine '".concat(this.id,"' does not accept event '").concat(o.name,"'"));var u=this._transition(i.value,i,o)||{transitions:[],configuration:[],exitSet:[],source:i,actions:[]},c=Te([],this.getStateNodes(i.value)),p=u.configuration.length?Te(c,u.configuration):c;return u.configuration=d([],f(p),!1),this.resolveTransition(u,i,i.context,r,o)},e.prototype.resolveRaisedTransition=function(e,t,n,r){var i,a=e.actions;return(e=this.transition(e,t,void 0,r))._event=n,e.event=n.data,(i=e.actions).unshift.apply(i,d([],f(a),!1)),e},e.prototype.resolveTransition=function(e,t,n,r,i){var a,o,s,u,d=this;void 0===i&&(i=ue);var p=e.configuration,g=!t||e.transitions.length>0,y=g?e.configuration:t?t.configuration:[],m=De(y,this),S=g?Ne(this.machine,p):void 0,w=t?t.historyValue?t.historyValue:e.source?this.machine.historyValue(t.value):void 0:void 0,k=this.getActions(new Set(y),m,e,n,i,t,r),x=t?l({},t.activities):{};try{for(var _=c(k),T=_.next();!T.done;T=_.next()){var C=T.value;try{for(var O=(s=void 0,c(C.actions)),N=O.next();!N.done;N=O.next()){var R=N.value;R.type===h?x[R.activity.id||R.activity.type]=R:R.type===v&&(x[R.activity.id||R.activity.type]=!1)}}catch(e){s={error:e}}finally{try{N&&!N.done&&(u=O.return)&&u.call(O)}finally{if(s)throw s.error}}}}catch(e){a={error:e}}finally{try{T&&!T.done&&(o=_.return)&&o.call(_)}finally{if(a)throw a.error}}var D,P,A=f(me(this,t,n,i,k,r,this.machine.config.predictableActionArguments||this.machine.config.preserveActionOrder),2),M=A[0],L=A[1],U=f(function(e,t){var n,r,i=f([[],[]],2),a=i[0],o=i[1];try{for(var s=c(e),l=s.next();!l.done;l=s.next()){var u=l.value;t(u)?a.push(u):o.push(u)}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return[a,o]}(M,le),2),j=U[0],V=U[1],F=M.filter((function(e){var t;return e.type===h&&(null===(t=e.activity)||void 0===t?void 0:t.type)===E})),z=F.reduce((function(e,t){return e[t.activity.id]=function(e,t,n,r){var i,a=ae(e.src),o=null===(i=null==t?void 0:t.options.services)||void 0===i?void 0:i[a.type],s=e.data?W(e.data,n,r):void 0,l=o?ke(o,e.id,s):we(e.id);return l.meta=e,l}(t.activity,d.machine,L,i),e}),t?l({},t.children):{}),B=new Le({value:S||t.value,context:L,_event:i,_sessionid:t?t._sessionid:null,historyValue:S?w?(D=w,P=S,{current:P,states:$(D,P)}):void 0:t?t.historyValue:void 0,history:!S||e.source?t:void 0,actions:S?V:[],activities:S?x:t?t.activities:{},events:[],configuration:y,transitions:e.transitions,children:z,done:m,tags:Pe(y),machine:this}),H=n!==L;B.changed=i.name===I||H;var q=B.history;q&&delete q.history;var K=!m&&(this._transient||p.some((function(e){return e._transient})));if(!(g||K&&i.name!==et))return B;var Y=B;if(!m)for(K&&(Y=this.resolveRaisedTransition(Y,{type:b},i,r));j.length;){var Q=j.shift();Y=this.resolveRaisedTransition(Y,Q._event,i,r)}var J=Y.changed||(q?!!Y.actions.length||H||typeof q.value!=typeof Y.value||!Ae(Y.value,q.value):void 0);return Y.changed=J,Y.history=q,Y},e.prototype.getStateNode=function(e){if(rt(e))return this.machine.getStateNodeById(e);if(!this.states)throw new Error("Unable to retrieve child state '".concat(e,"' from '").concat(this.id,"'; no child states exist."));var t=this.states[e];if(!t)throw new Error("Child state '".concat(e,"' does not exist on '").concat(this.id,"'"));return t},e.prototype.getStateNodeById=function(e){var t=rt(e)?e.slice(1):e;if(t===this.id)return this;var n=this.machine.idMap[t];if(!n)throw new Error("Child state node '#".concat(t,"' does not exist on machine '").concat(this.id,"'"));return n},e.prototype.getStateNodeByPath=function(e){if("string"==typeof e&&rt(e))try{return this.getStateNodeById(e.slice(1))}catch(e){}for(var t=A(e,this.delimiter).slice(),n=this;t.length;){var r=t.shift();if(!r.length)break;n=n.getStateNode(r)}return n},e.prototype.resolve=function(e){var t,n=this;if(!e)return this.initialStateValue||nt;switch(this.type){case"parallel":return U(this.initialStateValue,(function(t,r){return t?n.getStateNode(r).resolve(e[r]||t):nt}));case"compound":if(G(e)){var r=this.getStateNode(e);return"parallel"===r.type||"compound"===r.type?((t={})[e]=r.initialStateValue,t):e}return Object.keys(e).length?U(e,(function(e,t){return e?n.getStateNode(t).resolve(e):nt})):this.initialStateValue||{};default:return e||nt}},e.prototype.getResolvedPath=function(e){if(rt(e)){var t=this.machine.idMap[e.slice(1)];if(!t)throw new Error("Unable to find state node '".concat(e,"'"));return t.path}return A(e,this.delimiter)},Object.defineProperty(e.prototype,"initialStateValue",{get:function(){var e,t;if(this.__cache.initialStateValue)return this.__cache.initialStateValue;if("parallel"===this.type)t=j(this.states,(function(e){return e.initialStateValue||nt}),(function(e){return!("history"===e.type)}));else if(void 0!==this.initial){if(!this.states[this.initial])throw new Error("Initial state '".concat(this.initial,"' not found on '").concat(this.key,"'"));t=Ee(this.states[this.initial])?this.initial:((e={})[this.initial]=this.states[this.initial].initialStateValue,e)}else t={};return this.__cache.initialStateValue=t,this.__cache.initialStateValue},enumerable:!1,configurable:!0}),e.prototype.getInitialState=function(e,t){this._init();var n=this.getStateNodes(e);return this.resolveTransition({configuration:n,exitSet:[],transitions:[],source:void 0,actions:[]},void 0,null!=t?t:this.machine.context,void 0)},Object.defineProperty(e.prototype,"initialState",{get:function(){var e=this.initialStateValue;if(!e)throw new Error("Cannot retrieve initial state from simple state '".concat(this.id,"'."));return this.getInitialState(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"target",{get:function(){var e;if("history"===this.type){var t=this.config;e=G(t.target)&&rt(t.target)?L(this.machine.getStateNodeById(t.target).path.slice(this.path.length-1)):t.target}return e},enumerable:!1,configurable:!0}),e.prototype.getRelativeStateNodes=function(e,t,n){return void 0===n&&(n=!0),n?"history"===e.type?e.resolveHistory(t):e.initialStateNodes:[e]},Object.defineProperty(e.prototype,"initialStateNodes",{get:function(){var e=this;return Ee(this)?[this]:"compound"!==this.type||this.initial?z(F(this.initialStateValue).map((function(t){return e.getFromRelativePath(t)}))):(R||Y(!1,"Compound state node '".concat(this.id,"' has no initial state.")),[this])},enumerable:!1,configurable:!0}),e.prototype.getFromRelativePath=function(e){if(!e.length)return[this];var t=f(e),n=t[0],r=t.slice(1);if(!this.states)throw new Error("Cannot retrieve subPath '".concat(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 '".concat(n,"' does not exist on '").concat(this.id,"'"));return this.states[n].getFromRelativePath(r)},e.prototype.historyValue=function(e){if(Object.keys(this.states).length)return{current:e||this.initialStateValue,states:j(this.states,(function(t,n){if(!e)return t.historyValue();var r=G(e)?void 0:e[n];return t.historyValue(r||t.initialStateValue)}),(function(e){return!e.history}))}},e.prototype.resolveHistory=function(e){var t=this;if("history"!==this.type)return[this];var n=this.parent;if(!e){var r=this.target;return r?z(F(r).map((function(e){return n.getFromRelativePath(e)}))):n.initialStateNodes}var i,a,o=(i=n.path,a="states",function(e){var t,n,r=e;try{for(var o=c(i),s=o.next();!s.done;s=o.next()){var l=s.value;r=r[a][l]}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return r})(e).current;return G(o)?[n.getStateNode(o)]:z(F(o).map((function(e){return"deep"===t.history?n.getFromRelativePath(e):[n.states[e[0]]]})))},Object.defineProperty(e.prototype,"stateIds",{get:function(){var e=this,t=z(Object.keys(this.states).map((function(t){return e.states[t].stateIds})));return[this.id].concat(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"events",{get:function(){var e,t,n,r;if(this.__cache.events)return this.__cache.events;var i=this.states,a=new Set(this.ownEvents);if(i)try{for(var o=c(Object.keys(i)),s=o.next();!s.done;s=o.next()){var l=i[s.value];if(l.states)try{for(var u=(n=void 0,c(l.events)),f=u.next();!f.done;f=u.next()){var d=f.value;a.add("".concat(d))}}catch(e){n={error:e}}finally{try{f&&!f.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}return this.__cache.events=Array.from(a)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ownEvents",{get:function(){var e=new Set(this.transitions.filter((function(e){return!(!e.target&&!e.actions.length&&e.internal)})).map((function(e){return e.eventType})));return Array.from(e)},enumerable:!1,configurable:!0}),e.prototype.resolveTarget=function(e){var t=this;if(void 0!==e)return e.map((function(e){if(!G(e))return e;var n=e[0]===t.delimiter;if(n&&!t.parent)return t.getStateNodeByPath(e.slice(1));var r=n?t.key+e:e;if(!t.parent)return t.getStateNodeByPath(r);try{return t.parent.getStateNodeByPath(r)}catch(e){throw new Error("Invalid transition definition for state node '".concat(t.id,"':\n").concat(e.message))}}))},e.prototype.formatTransition=function(e){var t=this,n=function(e){if(void 0!==e&&""!==e)return H(e)}(e.target),r="internal"in e?e.internal:!n||n.some((function(e){return G(e)&&e[0]===t.delimiter})),i=this.machine.options.guards,a=this.resolveTarget(n),o=l(l({},e),{actions:de(H(e.actions)),cond:X(e.cond,i),target:a,source:this,internal:r,eventType:e.event,toJSON:function(){return l(l({},o),{target:o.target?o.target.map((function(e){return"#".concat(e.id)})):void 0,source:"#".concat(t.id)})}});return o},e.prototype.formatTransitions=function(){var e,t,n,r=this;if(this.config.on)if(Array.isArray(this.config.on))n=this.config.on;else{var i=this.config.on,a=tt,o=i[a],s=void 0===o?[]:o,l=u(i,["*"]);n=z(Object.keys(l).map((function(e){R||e!==et||Y(!1,"Empty string transition configs (e.g., `{ on: { '': ... }}`) for transient transitions are deprecated. Specify the transition in the `{ always: ... }` property instead. "+'Please check the `on` configuration for "#'.concat(r.id,'".'));var t=re(e,l[e]);return R||function(e,t,n){var r=n.slice(0,-1).some((function(e){return!("cond"in e)&&!("in"in e)&&(G(e.target)||ee(e.target))})),i=t===et?"the transient event":"event '".concat(t,"'");Y(!r,"One or more transitions for ".concat(i," on state '").concat(e.id,"' are unreachable. ")+"Make sure that the default transition is the last one defined.")}(r,e,t),t})).concat(re(tt,s)))}else n=[];var p=this.config.always?re("",this.config.always):[],h=this.config.onDone?re(String(ve(this.id)),this.config.onDone):[];R||Y(!(this.config.onDone&&!this.parent),'Root nodes cannot have an ".onDone" transition. Please check the config of "'.concat(this.id,'".'));var v=z(this.invoke.map((function(e){var t=[];return e.onDone&&t.push.apply(t,d([],f(re(String(ge(e.id)),e.onDone)),!1)),e.onError&&t.push.apply(t,d([],f(re(String(ye(e.id)),e.onError)),!1)),t}))),g=this.after,y=z(d(d(d(d([],f(h),!1),f(v),!1),f(n),!1),f(p),!1).map((function(e){return H(e).map((function(e){return r.formatTransition(e)}))})));try{for(var m=c(g),b=m.next();!b.done;b=m.next()){var S=b.value;y.push(S)}}catch(t){e={error:t}}finally{try{b&&!b.done&&(t=m.return)&&t.call(m)}finally{if(e)throw e.error}}return y},e}();var at=function(e){return{type:S,assignment:e}},ot=n(724);const st=a.useLayoutEffect;function lt(e){var t=a.useRef();return t.current||(t.current={v:e()}),t.current.v}var ut=function(){return ut=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},ut.apply(this,arguments)},ct=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function ft(e,t){var n=lt((function(){return"function"==typeof e?e():e})),r=t.context,i=t.guards,a=t.actions,o=t.activities,s=t.services,l=t.delays,u=(t.state,ct(t,["context","guards","actions","activities","services","delays","state"])),c=lt((function(){var e={context:r,guards:i,actions:a,activities:o,services:s,delays:l};return Ge(n.withConfig(e,(function(){return ut(ut({},n.context),r)})),u)}));return st((function(){Object.assign(c.machine.options.actions,a),Object.assign(c.machine.options.guards,i),Object.assign(c.machine.options.activities,o),Object.assign(c.machine.options.services,s),Object.assign(c.machine.options.delays,l)}),[a,i,o,s,l]),c}var dt=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,a=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o};function pt(e){return e}function ht(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=dt(t,1)[0],i=void 0===r?{}:r,o=ft(e,i),s=(0,a.useCallback)((function(){return o.status===Ye.NotStarted?i.state?Le.create(i.state):o.machine.initialState:o.getSnapshot()}),[o]),l=(0,a.useCallback)((function(e,t){return function(e,t,n){if(e.status===Ye.NotStarted)return!0;var r=void 0===n.changed&&(Object.keys(n.children).length>0||"boolean"==typeof t.changed);return!(n.changed||r)}(o,e,t)}),[o]),u=(0,a.useCallback)((function(e){return o.subscribe(e).unsubscribe}),[o]),c=(0,ot.useSyncExternalStoreWithSelector)(u,s,s,pt,l);return(0,a.useEffect)((function(){var e=i.state;return o.start(e?Le.create(e):void 0),function(){o.stop(),o.status=Ye.NotStarted}}),[]),[c,o.send,o]}var vt=n(307);const gt={NO_NEVER:-1,CANCEL:0,CREATE_REPORT:1,ADD_SERIES:2,SET_STUDY_AND_SERIES:3,NO_NOT_FOR_SERIES:4,HYDRATE_REPORT:5},yt={id:"measurementTracking",initial:"idle",context:{activeViewportId:null,trackedStudy:"",trackedSeries:[],ignoredSeries:[],prevTrackedStudy:"",prevTrackedSeries:[],prevIgnoredSeries:[],ignoredSRSeriesForHydration:[],isDirty:!1},states:{off:{type:"final"},labellingOnly:{on:{TRACK_SERIES:[{target:"promptLabelAnnotation",actions:["setPreviousState"]},{target:"off"}]}},idle:{entry:"clearContext",on:{TRACK_SERIES:[{target:"promptLabelAnnotation",cond:"isLabelOnMeasure",actions:["setPreviousState"]},{target:"promptBeginTracking",actions:["setPreviousState"]}],SET_TRACKED_SERIES:[{target:"tracking",actions:["setTrackedStudyAndMultipleSeries","setIsDirtyToClean"]}],PROMPT_HYDRATE_SR:{target:"promptHydrateStructuredReport",cond:"hasNotIgnoredSRSeriesForHydration"},RESTORE_PROMPT_HYDRATE_SR:"promptHydrateStructuredReport",HYDRATE_SR:"hydrateStructuredReport",UPDATE_ACTIVE_VIEWPORT_ID:{actions:at({activeViewportId:(e,t)=>t.activeViewportId})}}},promptBeginTracking:{invoke:{src:"promptBeginTracking",onDone:[{target:"tracking",actions:["setTrackedStudyAndSeries","setIsDirty"],cond:"shouldSetStudyAndSeries"},{target:"labellingOnly",cond:"isLabelOnMeasureAndShouldKillMachine"},{target:"off",cond:"shouldKillMachine"},{target:"idle"}],onError:{target:"idle"}}},tracking:{on:{TRACK_SERIES:[{target:"promptLabelAnnotation",cond:"isLabelOnMeasure",actions:["setPreviousState"]},{target:"promptTrackNewStudy",cond:"isNewStudy"},{target:"promptTrackNewSeries",cond:"isNewSeries"}],UNTRACK_SERIES:[{target:"tracking",actions:["removeTrackedSeries","setIsDirty"],cond:"hasRemainingTrackedSeries"},{target:"idle"}],SET_TRACKED_SERIES:[{target:"tracking",actions:["setTrackedStudyAndMultipleSeries"]}],SAVE_REPORT:"promptSaveReport",SET_DIRTY:[{target:"tracking",actions:["setIsDirty"],cond:"shouldSetDirty"},{target:"tracking"}]}},promptTrackNewSeries:{invoke:{src:"promptTrackNewSeries",onDone:[{target:"tracking",actions:["addTrackedSeries","setIsDirty"],cond:"shouldAddSeries"},{target:"tracking",actions:["discardPreviouslyTrackedMeasurements","setTrackedStudyAndSeries","setIsDirty"],cond:"shouldSetStudyAndSeries"},{target:"promptSaveReport",cond:"shouldPromptSaveReport"},{target:"tracking"}],onError:{target:"idle"}}},promptTrackNewStudy:{invoke:{src:"promptTrackNewStudy",onDone:[{target:"tracking",actions:["discardPreviouslyTrackedMeasurements","setTrackedStudyAndSeries","setIsDirty"],cond:"shouldSetStudyAndSeries"},{target:"tracking",actions:["ignoreSeries"],cond:"shouldAddIgnoredSeries"},{target:"promptSaveReport",cond:"shouldPromptSaveReport"},{target:"tracking"}],onError:{target:"idle"}}},promptSaveReport:{invoke:{src:"promptSaveReport",onDone:[{target:"idle",actions:["clearAllMeasurements","showStructuredReportDisplaySetInActiveViewport"],cond:"shouldSaveAndContinueWithSameReport"},{target:"tracking",actions:["discardPreviouslyTrackedMeasurements","setTrackedStudyAndSeries"],cond:"shouldSaveAndStartNewReport"},{target:"tracking"}],onError:{target:"idle"}}},promptHydrateStructuredReport:{invoke:{src:"promptHydrateStructuredReport",onDone:[{target:"tracking",actions:["setTrackedStudyAndMultipleSeries","jumpToFirstMeasurementInActiveViewport","setIsDirtyToClean"],cond:"shouldHydrateStructuredReport"},{target:"idle",actions:["ignoreHydrationForSRSeries"],cond:"shouldIgnoreHydrationForSR"}],onError:{target:"idle"}}},hydrateStructuredReport:{invoke:{src:"hydrateStructuredReport",onDone:[{target:"tracking",actions:["setTrackedStudyAndMultipleSeries","jumpToFirstMeasurementInActiveViewport","setIsDirtyToClean"]}],onError:{target:"idle"}}},promptLabelAnnotation:{invoke:{src:"promptLabelAnnotation",onDone:[{target:"labellingOnly",cond:"wasLabellingOnly"},{target:"promptBeginTracking",cond:"wasIdle"},{target:"promptTrackNewStudy",cond:"wasTrackingAndIsNewStudy"},{target:"promptTrackNewSeries",cond:"wasTrackingAndIsNewSeries"},{target:"tracking",cond:"wasTracking"},{target:"off"}]}}},strict:!0},mt={services:{promptBeginTracking:(e,t)=>{},promptTrackNewStudy:(e,t)=>{},promptTrackNewSeries:(e,t)=>{}},actions:{discardPreviouslyTrackedMeasurements:(e,t)=>{console.log("discardPreviouslyTrackedMeasurements: not implemented")},clearAllMeasurements:(e,t)=>{console.log("clearAllMeasurements: not implemented")},jumpToFirstMeasurementInActiveViewport:(e,t)=>{console.warn("jumpToFirstMeasurementInActiveViewport: not implemented")},showStructuredReportDisplaySetInActiveViewport:(e,t)=>{console.warn("showStructuredReportDisplaySetInActiveViewport: not implemented")},clearContext:at({trackedStudy:"",trackedSeries:[],ignoredSeries:[],prevTrackedStudy:"",prevTrackedSeries:[],prevIgnoredSeries:[]}),setTrackedStudyAndSeries:at(((e,t)=>({prevTrackedStudy:e.trackedStudy,prevTrackedSeries:e.trackedSeries.slice(),prevIgnoredSeries:e.ignoredSeries.slice(),trackedStudy:t.data.StudyInstanceUID,trackedSeries:[t.data.SeriesInstanceUID],ignoredSeries:[]}))),setTrackedStudyAndMultipleSeries:at(((e,t)=>{const n=t.StudyInstanceUID||t.data.StudyInstanceUID,r=t.SeriesInstanceUIDs||t.data.SeriesInstanceUIDs;return{prevTrackedStudy:e.trackedStudy,prevTrackedSeries:e.trackedSeries.slice(),prevIgnoredSeries:e.ignoredSeries.slice(),trackedStudy:n,trackedSeries:[...e.trackedSeries,...r],ignoredSeries:[]}})),setIsDirtyToClean:at(((e,t)=>({isDirty:!1}))),setIsDirty:at(((e,t)=>({isDirty:!0}))),ignoreSeries:at(((e,t)=>({prevIgnoredSeries:[...e.ignoredSeries],ignoredSeries:[...e.ignoredSeries,t.data.SeriesInstanceUID]}))),ignoreHydrationForSRSeries:at(((e,t)=>({ignoredSRSeriesForHydration:[...e.ignoredSRSeriesForHydration,t.data.srSeriesInstanceUID]}))),addTrackedSeries:at(((e,t)=>({prevTrackedSeries:[...e.trackedSeries],trackedSeries:[...e.trackedSeries,t.data.SeriesInstanceUID]}))),removeTrackedSeries:at(((e,t)=>({prevTrackedSeries:e.trackedSeries.slice().filter((e=>e!==t.SeriesInstanceUID)),trackedSeries:e.trackedSeries.slice().filter((e=>e!==t.SeriesInstanceUID))}))),setPreviousState:at(((e,t,n)=>({prevState:n.state.value})))},guards:{shouldSetDirty:(e,t)=>void 0===t.SeriesInstanceUID||e.trackedSeries.includes(t.SeriesInstanceUID),wasLabellingOnly:(e,t,n)=>"labellingOnly"===e.prevState,wasIdle:(e,t,n)=>"idle"===e.prevState,wasTracking:(e,t,n)=>"tracking"===e.prevState,wasTrackingAndIsNewStudy:(e,t,n)=>"tracking"===e.prevState&&!e.ignoredSeries.includes(t.data.SeriesInstanceUID)&&e.trackedStudy!==t.data.StudyInstanceUID,wasTrackingAndIsNewSeries:(e,t,n)=>"tracking"===e.prevState&&!e.ignoredSeries.includes(t.data.SeriesInstanceUID)&&!e.trackedSeries.includes(t.data.SeriesInstanceUID),shouldKillMachine:(e,t)=>t.data&&t.data.userResponse===gt.NO_NEVER,shouldAddSeries:(e,t)=>t.data&&t.data.userResponse===gt.ADD_SERIES,shouldSetStudyAndSeries:(e,t)=>t.data&&t.data.userResponse===gt.SET_STUDY_AND_SERIES,shouldAddIgnoredSeries:(e,t)=>t.data&&t.data.userResponse===gt.NO_NOT_FOR_SERIES,shouldPromptSaveReport:(e,t)=>t.data&&t.data.userResponse===gt.CREATE_REPORT,shouldIgnoreHydrationForSR:(e,t)=>t.data&&t.data.userResponse===gt.CANCEL,shouldSaveAndContinueWithSameReport:(e,t)=>t.data&&t.data.userResponse===gt.CREATE_REPORT&&!0===t.data.isBackupSave,shouldSaveAndStartNewReport:(e,t)=>t.data&&t.data.userResponse===gt.CREATE_REPORT&&!1===t.data.isBackupSave,shouldHydrateStructuredReport:(e,t)=>t.data&&t.data.userResponse===gt.HYDRATE_REPORT,hasRemainingTrackedSeries:(e,t)=>e.trackedSeries.length>1||!e.trackedSeries.includes(t.SeriesInstanceUID),hasNotIgnoredSRSeriesForHydration:(e,t)=>!e.ignoredSRSeriesForHydration.includes(t.SeriesInstanceUID),isNewStudy:(e,t)=>!e.ignoredSeries.includes(t.SeriesInstanceUID)&&e.trackedStudy!==t.StudyInstanceUID,isNewSeries:(e,t)=>!e.ignoredSeries.includes(t.SeriesInstanceUID)&&!e.trackedSeries.includes(t.SeriesInstanceUID)}};var bt=n(625);const St={NO_NEVER:-1,CANCEL:0,CREATE_REPORT:1,ADD_SERIES:2,SET_STUDY_AND_SERIES:3};const wt=function({servicesManager:e,extensionManager:t},n,r){const{uiViewportDialogService:i}=e.services,{viewportId:a,StudyInstanceUID:o,SeriesInstanceUID:s}=r.data||r;return new Promise((async function(e,t){let n=await function(e,t){return new Promise((function(n,r){const i=bt.A.t("MeasurementTable:Track measurements for this series?"),a=[{id:"prompt-begin-tracking-cancel",type:vt.ButtonEnums.type.secondary,text:bt.A.t("Common:No"),value:St.CANCEL},{id:"prompt-begin-tracking-no-do-not-ask-again",type:vt.ButtonEnums.type.secondary,text:bt.A.t("MeasurementTable:No, do not ask again"),value:St.NO_NEVER},{id:"prompt-begin-tracking-yes",type:vt.ButtonEnums.type.primary,text:bt.A.t("Common:Yes"),value:St.SET_STUDY_AND_SERIES}],o=t=>{e.hide(),n(t)};e.show({viewportId:t,id:"measurement-tracking-prompt-begin-tracking",type:"info",message:i,actions:a,onSubmit:o,onOutsideClick:()=>{e.hide(),n(St.CANCEL)},onKeyPress:e=>{if("Enter"===e.key){const e=a.find((e=>"prompt-begin-tracking-yes"===e.id));o(e.value)}}})}))}(i,a);e({userResponse:n,StudyInstanceUID:o,SeriesInstanceUID:s,viewportId:a})}))},kt={NO_NEVER:-1,CANCEL:0,CREATE_REPORT:1,ADD_SERIES:2,SET_STUDY_AND_SERIES:3,NO_NOT_FOR_SERIES:4};const Et=function({servicesManager:e,extensionManager:t},n,r){const{UIViewportDialogService:i}=e.services,{viewportId:a,StudyInstanceUID:o,SeriesInstanceUID:s}=r.data||r;return new Promise((async function(e,t){let r=await function(e,t){return new Promise((function(n,r){const i="Do you want to add this measurement to the existing report?",a=[{type:vt.ButtonEnums.type.secondary,text:"Cancel",value:kt.CANCEL},{type:vt.ButtonEnums.type.primary,text:"Create new report",value:kt.CREATE_REPORT},{type:vt.ButtonEnums.type.primary,text:"Add to existing report",value:kt.ADD_SERIES}],o=t=>{e.hide(),n(t)};e.show({viewportId:t,type:"info",message:i,actions:a,onSubmit:o,onOutsideClick:()=>{e.hide(),n(kt.CANCEL)}})}))}(i,a);r===kt.CREATE_REPORT&&(r=n.isDirty?await function(e,t){return new Promise((function(n,r){const i="You have existing tracked measurements. What would you like to do with your existing tracked measurements?",a=[{type:"cancel",text:"Cancel",value:kt.CANCEL},{type:"secondary",text:"Save",value:kt.CREATE_REPORT},{type:"primary",text:"Discard",value:kt.SET_STUDY_AND_SERIES}],o=t=>{e.hide(),n(t)};e.show({viewportId:t,type:"warning",message:i,actions:a,onSubmit:o,onOutsideClick:()=>{e.hide(),n(kt.CANCEL)}})}))}(i,a):kt.SET_STUDY_AND_SERIES),e({userResponse:r,StudyInstanceUID:o,SeriesInstanceUID:s,viewportId:a,isBackupSave:!1})}))},xt={NO_NEVER:-1,CANCEL:0,CREATE_REPORT:1,ADD_SERIES:2,SET_STUDY_AND_SERIES:3,NO_NOT_FOR_SERIES:4};const _t=function({servicesManager:e,extensionManager:t},n,r){const{UIViewportDialogService:i}=e.services,{viewportId:a,StudyInstanceUID:o,SeriesInstanceUID:s}=r.data||r;return new Promise((async function(e,t){let r=await function(e,t){return new Promise((function(n,r){const i=bt.A.t("MeasurementTable:Track measurements for this series?"),a=[{type:"cancel",text:bt.A.t("MeasurementTable:No"),value:xt.CANCEL},{type:"secondary",text:bt.A.t("MeasurementTable:No, do not ask again"),value:xt.NO_NOT_FOR_SERIES},{type:"primary",text:bt.A.t("MeasurementTable:Yes"),value:xt.SET_STUDY_AND_SERIES}],o=t=>{e.hide(),n(t)};e.show({viewportId:t,type:"info",message:i,actions:a,onSubmit:o,onOutsideClick:()=>{e.hide(),n(xt.CANCEL)},onKeyPress:e=>{if("Enter"===e.key){const e=a.find((e=>e.value===xt.SET_STUDY_AND_SERIES));o(e.value)}}})}))}(i,a);r===xt.SET_STUDY_AND_SERIES&&(r=n.isDirty?await function(e,t){return new Promise((function(n,r){const i="Measurements cannot span across multiple studies. Do you want to save your tracked measurements?",a=[{type:"cancel",text:"Cancel",value:xt.CANCEL},{type:"secondary",text:"No, discard previously tracked series & measurements",value:xt.SET_STUDY_AND_SERIES},{type:"primary",text:"Yes",value:xt.CREATE_REPORT}],o=t=>{e.hide(),n(t)};e.show({viewportId:t,type:"warning",message:i,actions:a,onSubmit:o,onOutsideClick:()=>{e.hide(),n(xt.CANCEL)}})}))}(i,a):xt.SET_STUDY_AND_SERIES),e({userResponse:r,StudyInstanceUID:o,SeriesInstanceUID:s,viewportId:a,isBackupSave:!1})}))};var It=n(438);const Tt=4700;const Ct={NO_NEVER:-1,CANCEL:0,CREATE_REPORT:1,ADD_SERIES:2,SET_STUDY_AND_SERIES:3,NO_NOT_FOR_SERIES:4};const Ot=function({servicesManager:e,commandsManager:t,extensionManager:n},r,i){const{uiDialogService:a,measurementService:o,displaySetService:s}=e.services,l=void 0===i.viewportId?i.data.viewportId:i.viewportId,u=void 0===i.isBackupSave?i.data.isBackupSave:i.isBackupSave,c=i?.data?.StudyInstanceUID,f=i?.data?.SeriesInstanceUID,{trackedStudy:d,trackedSeries:p}=r;let h;return new Promise((async function(r,i){const v=await(0,It.createReportDialogPrompt)(a,{extensionManager:n});if(v.action===Ct.CREATE_REPORT){const r=n.getDataSources()[0],i=o.getMeasurements().filter((e=>d===e.referenceStudyUID&&p.includes(e.referenceSeriesUID))),a=void 0===v.value||""===v.value?"Research Derived Series":v.value,l=function(e){const t=e.getActiveDisplaySets().filter((e=>"SR"===e.Modality)).map((e=>e.SeriesNumber));return Math.max(...t,Tt)+1}(s),u=async()=>t.runCommand("storeMeasurements",{measurementData:i,dataSource:r,additionalFindingTypes:["ArrowAnnotate"],options:{SeriesDescription:a,SeriesNumber:l}},"CORNERSTONE_STRUCTURED_REPORT");h=await(0,It.createReportAsync)({servicesManager:e,getReport:u})}else v.action;r({userResponse:v.action,createdDisplaySetInstanceUIDs:h,StudyInstanceUID:c,SeriesInstanceUID:f,viewportId:l,isBackupSave:u})}))};var Nt=n(838);const Rt={NO_NEVER:-1,CANCEL:0,CREATE_REPORT:1,ADD_SERIES:2,SET_STUDY_AND_SERIES:3,NO_NOT_FOR_SERIES:4,HYDRATE_REPORT:5};const Dt=function({servicesManager:e,extensionManager:t,appConfig:n},r,i){const{uiViewportDialogService:a,displaySetService:o}=e.services,{viewportId:s,displaySetInstanceUID:l}=i,u=o.getDisplaySetByUID(l);return new Promise((async function(r,o){const c=await function(e,t){return new Promise((function(n,r){const i="Do you want to continue tracking measurements for this study?",a=[{type:vt.ButtonEnums.type.secondary,text:"No",value:Rt.CANCEL},{type:vt.ButtonEnums.type.primary,text:"Yes",value:Rt.HYDRATE_REPORT}],o=t=>{e.hide(),n(t)};e.show({viewportId:t,type:"info",message:i,actions:a,onSubmit:o,onOutsideClick:()=>{e.hide(),n(Rt.CANCEL)},onKeyPress:e=>{if("Enter"===e.key){const e=a.find((e=>e.value===Rt.HYDRATE_REPORT));o(e.value)}}})}))}(a,s);let f,d;if(c===Rt.HYDRATE_REPORT){console.warn("!! HYDRATING STRUCTURED REPORT");const r=(0,Nt.hydrateStructuredReport)({servicesManager:e,extensionManager:t,appConfig:n},l);f=r.StudyInstanceUID,d=r.SeriesInstanceUIDs}r({userResponse:c,displaySetInstanceUID:i.displaySetInstanceUID,srSeriesInstanceUID:u.SeriesInstanceUID,viewportId:s,StudyInstanceUID:f,SeriesInstanceUIDs:d})}))};const Pt=function({servicesManager:e,extensionManager:t,appConfig:n},r,i){const{displaySetService:a}=e.services,{viewportId:o,displaySetInstanceUID:s}=i,l=a.getDisplaySetByUID(s);return new Promise(((r,a)=>{const u=(0,Nt.hydrateStructuredReport)({servicesManager:e,extensionManager:t,appConfig:n},s),c=u.StudyInstanceUID,f=u.SeriesInstanceUIDs;r({displaySetInstanceUID:i.displaySetInstanceUID,srSeriesInstanceUID:l.SeriesInstanceUID,viewportId:o,StudyInstanceUID:c,SeriesInstanceUIDs:f})}))};var At=n(497);const Mt=function({servicesManager:e,extensionManager:t},n,r){const{measurementService:i,customizationService:a}=e.services,{viewportId:o,StudyInstanceUID:s,SeriesInstanceUID:l,measurementId:u}=r,c=t.getModuleEntry("@ohif/extension-cornerstone.utilityModule.common"),{showLabelAnnotationPopup:f}=c.exports;return new Promise((async function(t){const n=a.get("measurementLabels"),r=i.getMeasurement(u),c=await f(r,e.services.uiDialogService,n);i.update(u,{...c},!0),t({StudyInstanceUID:s,SeriesInstanceUID:l,viewportId:o})}))},Lt=a.createContext();Lt.displayName="TrackedMeasurementsContext";const Ut=()=>(0,a.useContext)(Lt),jt="@ohif/extension-cornerstone-dicom-sr.sopClassHandlerModule.dicom-sr";function Vt({servicesManager:e,commandsManager:t,extensionManager:n},{children:r}){const[i]=(0,At.r)(),[o,s]=(0,vt.useViewportGrid)(),{activeViewportId:l,viewports:u}=o,{measurementService:c,displaySetService:f,customizationService:d}=e.services,p=Object.assign({},mt);p.actions=Object.assign({},p.actions,{jumpToFirstMeasurementInActiveViewport:(e,t)=>{const{trackedStudy:n,trackedSeries:r,activeViewportId:i}=e,a=c.getMeasurements().filter((e=>n===e.referenceStudyUID&&r.includes(e.referenceSeriesUID)));console.log("jumping to measurement reset viewport",i,a[0]);const o=a[0].displaySetInstanceUID,l=f.getDisplaySetByUID(o).images,u=l[0].imageId.startsWith("volumeId"),d=a[0].data;let p=0;!u&&d&&(p=l.findIndex((e=>{const t=Object.keys(d)[0].substring(8);return e.imageId===t})),-1===p&&(console.warn("Could not find image index for tracked measurement, using 0"),p=0)),s.setDisplaySetsForViewport({viewportId:i,displaySetInstanceUIDs:[o],viewportOptions:{initialImageOptions:{index:p}}})},showStructuredReportDisplaySetInActiveViewport:(e,t)=>{if(t.data.createdDisplaySetInstanceUIDs.length>0){const e=t.data.createdDisplaySetInstanceUIDs[0];s.setDisplaySetsForViewport({viewportId:t.data.viewportId,displaySetInstanceUIDs:[e]})}},discardPreviouslyTrackedMeasurements:(e,t)=>{const n=c.getMeasurements().filter((t=>e.prevTrackedSeries.includes(t.referenceSeriesUID))).map((e=>e.id));for(let e=0;e<n.length;e++)c.remove(n[e])},clearAllMeasurements:(e,t)=>{const n=c.getMeasurements().map((e=>e.uid));for(let e=0;e<n.length;e++)c.remove(n[e])}}),p.services=Object.assign({},p.services,{promptBeginTracking:wt.bind(null,{servicesManager:e,extensionManager:n,appConfig:i}),promptTrackNewSeries:Et.bind(null,{servicesManager:e,extensionManager:n,appConfig:i}),promptTrackNewStudy:_t.bind(null,{servicesManager:e,extensionManager:n,appConfig:i}),promptSaveReport:Ot.bind(null,{servicesManager:e,commandsManager:t,extensionManager:n,appConfig:i}),promptHydrateStructuredReport:Dt.bind(null,{servicesManager:e,extensionManager:n,appConfig:i}),hydrateStructuredReport:Pt.bind(null,{servicesManager:e,extensionManager:n,appConfig:i}),promptLabelAnnotation:Mt.bind(null,{servicesManager:e,extensionManager:n})}),p.guards=Object.assign({},p.guards,{isLabelOnMeasure:(e,t,n)=>{const r=d.get("measurementLabels");return r?.labelOnMeasure},isLabelOnMeasureAndShouldKillMachine:(e,t,n)=>{const r=d.get("measurementLabels");return t.data&&t.data.userResponse===gt.NO_NEVER&&r?.labelOnMeasure}});const h=(v=yt,g=p,void 0===y&&(y=v.context),new it(v,g,y));var v,g,y;const[m,b]=ht(h);return(0,a.useEffect)((()=>{b("UPDATE_ACTIVE_VIEWPORT_ID",{activeViewportId:l})}),[l,b]),(0,a.useEffect)((()=>{(async()=>{if(u.size>0){const t=u.get(l);if(!t||!t?.displaySetInstanceUIDs?.length)return;const{displaySetService:n}=e.services,r=n.getDisplaySetByUID(t.displaySetInstanceUIDs[0]);if(!r)return;r.SOPClassHandlerId===jt&&!r.isLoaded&&r.load&&await r.load(),r.SOPClassHandlerId===jt&&!0===r.isRehydratable&&(console.log("sending event...",m),b("PROMPT_HYDRATE_SR",{displaySetInstanceUID:r.displaySetInstanceUID,SeriesInstanceUID:r.SeriesInstanceUID,viewportId:l}))}})()}),[m,l,b,e.services,u]),a.createElement(Lt.Provider,{value:[m,b]},r)}Vt.propTypes={children:s().oneOf([s().func,s().node]),servicesManager:s().object.isRequired,commandsManager:s().object.isRequired,extensionManager:s().object.isRequired,appConfig:s().object};const Ft=function({servicesManager:e,extensionManager:t,commandsManager:n}){const r=Vt.bind(null,{servicesManager:e,extensionManager:t,commandsManager:n});return[{name:"TrackedMeasurementsContext",context:Lt,provider:r}]}},915:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>h});var r=n(766),i=n(374),a=n.n(i),o=n(307),s=n(713),l=n(597),u=n(557),c=n(871);function f(){return f=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},f.apply(this,arguments)}function d(e){const{displaySets:t,viewportId:n,servicesManager:i,extensionManager:a}=e,{measurementService:d,cornerstoneViewportService:h,viewportGridService:v,viewportActionCornersService:g}=i.services,y=t[0],{t:m}=(0,c.Bd)("Common"),[b]=(0,o.useViewportGrid)(),{activeViewportId:S}=b,[w,k]=(0,l.B)(),[E,x]=(0,r.useState)(!1),[_,I]=(0,r.useState)(null),[T,C]=(0,r.useState)(null),{trackedSeries:O}=w.context,{SeriesInstanceUID:N}=y,R=(0,r.useCallback)((()=>{const e=h.getCornerstoneViewport(n);if(e instanceof u.BaseVolumeViewport){const t=e?.getCurrentImageId();if(!t)return void(E&&x(!1))}O.includes(N)!==E&&x(!E)}),[E,w,n,N]),D=(0,r.useCallback)((e=>{e.detail.element!==T&&(e.detail.element?.addEventListener(u.Enums.Events.VOLUME_VIEWPORT_NEW_VOLUME,R),C(e.detail.element))}),[R,T]),P=(0,r.useCallback)((()=>{T?.removeEventListener(u.Enums.Events.VOLUME_VIEWPORT_NEW_VOLUME,R)}),[R,T]);(0,r.useEffect)(R,[R]),(0,r.useEffect)((()=>{const{unsubscribe:e}=h.subscribe(h.EVENTS.VIEWPORT_DATA_CHANGED,(e=>{e.viewportId===n&&R()}));return()=>{e()}}),[R,n]),(0,r.useEffect)((()=>E?(s.annotation.config.style.setViewportToolStyles(n,{global:{lineDash:""}}),void h.getRenderingEngine().renderViewport(n)):(s.annotation.config.style.setViewportToolStyles(n,{global:{lineDash:"4,4"}}),h.getRenderingEngine().renderViewport(n),()=>{s.annotation.config.style.setViewportToolStyles(n,{})})),[E]),(0,r.useEffect)((()=>{const e=d.EVENTS.MEASUREMENT_ADDED,t=d.EVENTS.RAW_MEASUREMENT_ADDED,r=[];return[e,t].forEach((e=>{r.push(d.subscribe(e,(({source:e,measurement:t})=>{const{activeViewportId:r}=v.getState();if(n===r){const{referenceStudyUID:e,referenceSeriesUID:r,uid:i}=t;k("SET_DIRTY",{SeriesInstanceUID:r}),k("TRACK_SERIES",{viewportId:n,StudyInstanceUID:e,SeriesInstanceUID:r,measurementId:i})}})).unsubscribe)})),()=>{r.forEach((e=>{e()}))}}),[d,k,n,v]);const A=(0,r.useCallback)((e=>{const t=function(e,t,n,r){const{measurementService:i,viewportGridService:a}=t.services,o=i.getMeasurements(),{activeViewportId:s,viewports:l}=a.getState(),{displaySetInstanceUIDs:u}=l.get(s),{trackedSeries:c}=r.context,f=o.filter((e=>c.includes(e.referenceSeriesUID)&&u.includes(e.displaySetInstanceUID)));if(!f.length)return;const d=f.length,p=f.map((e=>e.uid));let h=p.findIndex((e=>e===n));-1===h?h=0:(h+=e,h<0?h=d-1:h===d&&(h=0));return p[h]}(e,i,_,w);t&&(I(t),d.jumpToMeasurement(n,t))}),[d,i,_,w,n]);(0,r.useEffect)((()=>{const e=function(e,t){if(!e)return null;return r.createElement("div",{className:"relative"},r.createElement(o.Tooltip,{position:"bottom-left",content:r.createElement("div",{className:"flex py-2"},r.createElement("div",{className:"flex pt-1"},r.createElement(o.Icon,{name:"info-link",className:"text-primary-main w-4"})),r.createElement("div",{className:"ml-4 flex"},r.createElement("span",{className:"text-common-light text-base"},e?r.createElement(r.Fragment,null,t("Series is tracked and can be viewed in the measurement panel")):r.createElement(r.Fragment,null,t("Measurements for untracked series will not be shown in the measurements panel")))))},r.createElement(o.Icon,{name:"viewport-status-tracked",className:"text-aqua-pale"})))}(E,m),t=p(E,A,n===S);g.setComponents([{viewportId:n,id:"viewportStatusComponent",component:e,indexPriority:-100,location:g.LOCATIONS.topLeft},{viewportId:n,id:"viewportActionArrowsComponent",component:t,indexPriority:0,location:g.LOCATIONS.topRight}])}),[S,E,A,g,n]);return r.createElement(r.Fragment,null,r.createElement("div",{className:"relative flex h-full w-full flex-row overflow-hidden"},(()=>{const{component:t}=a.getModuleEntry("@ohif/extension-cornerstone.viewportModule.cornerstone");return r.createElement(t,f({},e,{onElementEnabled:t=>{e.onElementEnabled?.(t),D(t)},onElementDisabled:P}))})()))}d.propTypes={displaySets:a().arrayOf(a().object.isRequired).isRequired,viewportId:a().string.isRequired,dataSource:a().object,children:a().node,customProps:a().object},d.defaultProps={customProps:{}};const p=(e,t,n)=>e?r.createElement(o.ViewportActionArrows,{onArrowsClick:e=>t(e),className:n?"visible":"invisible group-hover:visible"}):null;const h=d},497:(e,t,n)=>{"use strict";n.d(t,{r:()=>l});var r=n(766),i=n(374),a=n.n(i);const o=(0,r.createContext)(null),{Provider:s}=o,l=()=>(0,r.useContext)(o);function u({children:e,value:t}){const[n,i]=(0,r.useState)(t);return r.createElement(s,{value:[n]},e)}u.propTypes={children:a().any,value:a().any}},625:(e,t,n)=>{"use strict";n.d(t,{A:()=>B});var r=n(888),i=n(719);function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&r.push.apply(r,Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach((function(t){(0,i.A)(e,t,n[t])}))}return e}var o=n(833),s=n(393);function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u(e,t){if(t&&("object"===(0,r.A)(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return l(e)}function c(e){return c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},c(e)}function f(e,t){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},f(e,t)}function d(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&f(e,t)}var p=n(333);var h=n(860);function v(e){return function(e){if(Array.isArray(e))return(0,p.A)(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||(0,h.A)(e)||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.")}()}var g=n(757),y={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,t){var n;console&&console[e]&&(n=console)[e].apply(n,v(t))}},m=new(function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,o.A)(this,e),this.init(t,n)}return(0,s.A)(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||y,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"log","",!0)}},{key:"warn",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","",!0)}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"error","")}},{key:"deprecate",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(e,t,n,r){return r&&!this.debug?null:("string"==typeof e[0]&&(e[0]="".concat(n).concat(this.prefix," ").concat(e[0])),this.logger[t](e))}},{key:"create",value:function(t){return new e(this.logger,a({},{prefix:"".concat(this.prefix,":").concat(t,":")},this.options))}}]),e}()),b=function(){function e(){(0,o.A)(this,e),this.observers={}}return(0,s.A)(e,[{key:"on",value:function(e,t){var n=this;return e.split(" ").forEach((function(e){n.observers[e]=n.observers[e]||[],n.observers[e].push(t)})),this}},{key:"off",value:function(e,t){this.observers[e]&&(t?this.observers[e]=this.observers[e].filter((function(e){return e!==t})):delete this.observers[e])}},{key:"emit",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];this.observers[e]&&[].concat(this.observers[e]).forEach((function(e){e.apply(void 0,n)}));this.observers["*"]&&[].concat(this.observers["*"]).forEach((function(t){t.apply(t,[e].concat(n))}))}}]),e}();function S(){var e,t,n=new Promise((function(n,r){e=n,t=r}));return n.resolve=e,n.reject=t,n}function w(e){return null==e?"":""+e}function k(e,t,n){function r(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function i(){return!e||"string"==typeof e}for(var a="string"!=typeof t?[].concat(t):t.split(".");a.length>1;){if(i())return{};var o=r(a.shift());!e[o]&&n&&(e[o]=new n),e=e[o]}return i()?{}:{obj:e,k:r(a.shift())}}function E(e,t,n){var r=k(e,t,Object);r.obj[r.k]=n}function x(e,t){var n=k(e,t),r=n.obj,i=n.k;if(r)return r[i]}function _(e,t,n){var r=x(e,n);return void 0!==r?r:x(t,n)}function I(e,t,n){for(var r in t)r in e?"string"==typeof e[r]||e[r]instanceof String||"string"==typeof t[r]||t[r]instanceof String?n&&(e[r]=t[r]):I(e[r],t[r],n):e[r]=t[r];return e}function T(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var C={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function O(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return C[e]})):e}var N=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return(0,o.A)(this,t),n=u(this,c(t).call(this)),b.call(l(n)),n.data=e||{},n.options=r,void 0===n.options.keySeparator&&(n.options.keySeparator="."),n}return d(t,e),(0,s.A)(t,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,a=[e,t];return n&&"string"!=typeof n&&(a=a.concat(n)),n&&"string"==typeof n&&(a=a.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(a=e.split(".")),x(this.data,a)}},{key:"addResource",value:function(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},a=this.options.keySeparator;void 0===a&&(a=".");var o=[e,t];n&&(o=o.concat(a?n.split(a):n)),e.indexOf(".")>-1&&(r=t,t=(o=e.split("."))[1]),this.addNamespaces(t),E(this.data,o,r),i.silent||this.emit("added",e,t,n,r)}},{key:"addResources",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var i in n)"string"!=typeof n[i]&&"[object Array]"!==Object.prototype.toString.apply(n[i])||this.addResource(e,t,i,n[i],{silent:!0});r.silent||this.emit("added",e,t,n)}},{key:"addResourceBundle",value:function(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},s=[e,t];e.indexOf(".")>-1&&(r=n,n=t,t=(s=e.split("."))[1]),this.addNamespaces(t);var l=x(this.data,s)||{};r?I(l,n,i):l=a({},l,n),E(this.data,s,l),o.silent||this.emit("added",e,t,n)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?a({},{},this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"toJSON",value:function(){return this.data}}]),t}(b),R={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,n,r,i){var a=this;return e.forEach((function(e){a.processors[e]&&(t=a.processors[e].process(t,n,r,i))})),t}},D=function(e){function t(e){var n,r,i,a,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,o.A)(this,t),n=u(this,c(t).call(this)),b.call(l(n)),r=["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],i=e,a=l(n),r.forEach((function(e){i[e]&&(a[e]=i[e])})),n.options=s,void 0===n.options.keySeparator&&(n.options.keySeparator="."),n.logger=m.create("translator"),n}return d(t,e),(0,s.A)(t,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},n=this.resolve(e,t);return n&&void 0!==n.res}},{key:"extractFromKey",value:function(e,t){var n=t.nsSeparator||this.options.nsSeparator;void 0===n&&(n=":");var r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,i=t.ns||this.options.defaultNS;if(n&&e.indexOf(n)>-1){var a=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(a[0])>-1)&&(i=a.shift()),e=a.join(r)}return"string"==typeof i&&(i=[i]),{key:e,namespaces:i}}},{key:"translate",value:function(e,t){var n=this;if("object"!==(0,r.A)(t)&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var i=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,o=this.extractFromKey(e[e.length-1],t),s=o.key,l=o.namespaces,u=l[l.length-1],c=t.lng||this.language,f=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(c&&"cimode"===c.toLowerCase()){if(f){var d=t.nsSeparator||this.options.nsSeparator;return u+d+s}return s}var p=this.resolve(e,t),h=p&&p.res,v=p&&p.usedKey||s,g=p&&p.exactUsedKey||s,y=Object.prototype.toString.apply(h),m=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject;if(b&&h&&("string"!=typeof h&&"boolean"!=typeof h&&"number"!=typeof h)&&["[object Number]","[object Function]","[object RegExp]"].indexOf(y)<0&&("string"!=typeof m||"[object Array]"!==y)){if(!t.returnObjects&&!this.options.returnObjects)return this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.options.returnedObjectHandler?this.options.returnedObjectHandler(v,h,t):"key '".concat(s," (").concat(this.language,")' returned an object instead of string.");if(i){var S="[object Array]"===y,w=S?[]:{},k=S?g:v;for(var E in h)if(Object.prototype.hasOwnProperty.call(h,E)){var x="".concat(k).concat(i).concat(E);w[E]=this.translate(x,a({},t,{joinArrays:!1,ns:l})),w[E]===x&&(w[E]=h[E])}h=w}}else if(b&&"string"==typeof m&&"[object Array]"===y)(h=h.join(m))&&(h=this.extendTranslation(h,e,t));else{var _=!1,I=!1;if(!this.isValidLookup(h)&&void 0!==t.defaultValue){if(_=!0,void 0!==t.count){var T=this.pluralResolver.getSuffix(c,t.count);h=t["defaultValue".concat(T)]}h||(h=t.defaultValue)}this.isValidLookup(h)||(I=!0,h=s);var C=t.defaultValue&&t.defaultValue!==h&&this.options.updateMissing;if(I||_||C){this.logger.log(C?"updateKey":"missingKey",c,u,s,C?t.defaultValue:h);var O=[],N=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&N&&N[0])for(var R=0;R<N.length;R++)O.push(N[R]);else"all"===this.options.saveMissingTo?O=this.languageUtils.toResolveHierarchy(t.lng||this.language):O.push(t.lng||this.language);var D=function(e,r){n.options.missingKeyHandler?n.options.missingKeyHandler(e,u,r,C?t.defaultValue:h,C,t):n.backendConnector&&n.backendConnector.saveMissing&&n.backendConnector.saveMissing(e,u,r,C?t.defaultValue:h,C,t),n.emit("missingKey",e,u,r,h)};if(this.options.saveMissing){var P=void 0!==t.count&&"string"!=typeof t.count;this.options.saveMissingPlurals&&P?O.forEach((function(e){n.pluralResolver.getPluralFormsOfKey(e,s).forEach((function(t){return D([e],t)}))})):D(O,s)}}h=this.extendTranslation(h,e,t,p),I&&h===s&&this.options.appendNamespaceToMissingKey&&(h="".concat(u,":").concat(s)),I&&this.options.parseMissingKeyHandler&&(h=this.options.parseMissingKeyHandler(h))}return h}},{key:"extendTranslation",value:function(e,t,n,r){var i=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,n,r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(a({},n,{interpolation:a({},this.options.interpolation,n.interpolation)}));var o=n.replace&&"string"!=typeof n.replace?n.replace:n;this.options.interpolation.defaultVariables&&(o=a({},this.options.interpolation.defaultVariables,o)),e=this.interpolator.interpolate(e,o,n.lng||this.language,n),!1!==n.nest&&(e=this.interpolator.nest(e,(function(){return i.translate.apply(i,arguments)}),n)),n.interpolation&&this.interpolator.reset()}var s=n.postProcess||this.options.postProcess,l="string"==typeof s?[s]:s;return null!=e&&l&&l.length&&!1!==n.applyPostProcessor&&(e=R.handle(l,e,t,this.options&&this.options.postProcessPassResolved?a({i18nResolved:r},n):n,this)),e}},{key:"resolve",value:function(e){var t,n,r,i,a,o=this,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!o.isValidLookup(t)){var l=o.extractFromKey(e,s),u=l.key;n=u;var c=l.namespaces;o.options.fallbackNS&&(c=c.concat(o.options.fallbackNS));var f=void 0!==s.count&&"string"!=typeof s.count,d=void 0!==s.context&&"string"==typeof s.context&&""!==s.context,p=s.lngs?s.lngs:o.languageUtils.toResolveHierarchy(s.lng||o.language,s.fallbackLng);c.forEach((function(e){o.isValidLookup(t)||(a=e,o.utils&&o.utils.hasLoadedNamespace&&!o.utils.hasLoadedNamespace(a)&&o.logger.warn('key "'.concat(n,'" for namespace "').concat(a,"\" won't get resolved as namespace was not yet loaded"),"This means something IS WRONG in your application setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"),p.forEach((function(n){if(!o.isValidLookup(t)){i=n;var a,l,c=u,p=[c];if(o.i18nFormat&&o.i18nFormat.addLookupKeys)o.i18nFormat.addLookupKeys(p,u,n,e,s);else f&&(a=o.pluralResolver.getSuffix(n,s.count)),f&&d&&p.push(c+a),d&&p.push(c+="".concat(o.options.contextSeparator).concat(s.context)),f&&p.push(c+=a);for(;l=p.pop();)o.isValidLookup(t)||(r=l,t=o.getResource(n,e,l,s))}})))}))}})),{res:t,usedKey:n,exactUsedKey:r,usedLng:i,usedNS:a}}},{key:"isValidLookup",value:function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}}]),t}(b);function P(e){return e.charAt(0).toUpperCase()+e.slice(1)}var A=function(){function e(t){(0,o.A)(this,e),this.options=t,this.whitelist=this.options.whitelist||!1,this.logger=m.create("languageUtils")}return(0,s.A)(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),this.formatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],n=e.split("-");return this.options.lowerCaseLng?n=n.map((function(e){return e.toLowerCase()})):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=P(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=P(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=P(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isWhitelisted",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitWhitelist)&&(e=this.getLanguagePartFromCode(e)),!this.whitelist||!this.whitelist.length||this.whitelist.indexOf(e)>-1}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e.default),n||[]}},{key:"toResolveHierarchy",value:function(e,t){var n=this,r=this.getFallbackCodes(t||this.options.fallbackLng||[],e),i=[],a=function(e){e&&(n.isWhitelisted(e)?i.push(e):n.logger.warn("rejecting non-whitelisted language code: ".concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&a(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&a(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&a(this.getLanguagePartFromCode(e))):"string"==typeof e&&a(this.formatLanguageCode(e)),r.forEach((function(e){i.indexOf(e)<0&&a(n.formatLanguageCode(e))})),i}}]),e}(),M=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","id","ja","jbo","ka","kk","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he"],nr:[1,2,20,21],fc:22}],L={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0===e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0===e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0===e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1===e?0:2===e?1:(e<0||e>10)&&e%10==0?2:3)}};var U=function(){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,o.A)(this,e),this.languageUtils=t,this.options=r,this.logger=m.create("pluralResolver"),this.rules=(n={},M.forEach((function(e){e.lngs.forEach((function(t){n[t]={numbers:e.nr,plurals:L[e.fc]}}))})),n)}return(0,s.A)(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=this.getRule(e);return t&&t.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){var n=this,r=[],i=this.getRule(e);return i?(i.numbers.forEach((function(i){var a=n.getSuffix(e,i);r.push("".concat(t).concat(a))})),r):r}},{key:"getSuffix",value:function(e,t){var n=this,r=this.getRule(e);if(r){var i=r.noAbs?r.plurals(t):r.plurals(Math.abs(t)),a=r.numbers[i];this.options.simplifyPluralSuffix&&2===r.numbers.length&&1===r.numbers[0]&&(2===a?a="plural":1===a&&(a=""));var o=function(){return n.options.prepend&&a.toString()?n.options.prepend+a.toString():a.toString()};return"v1"===this.options.compatibilityJSON?1===a?"":"number"==typeof a?"_plural_".concat(a.toString()):o():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===r.numbers.length&&1===r.numbers[0]?o():this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString()}return this.logger.warn("no plural rule found for: ".concat(e)),""}}]),e}(),j=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,o.A)(this,e),this.logger=m.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return(0,s.A)(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:O,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?T(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?T(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?T(t.nestingPrefix):t.nestingPrefixEscaped||T("$t("),this.nestingSuffix=t.nestingSuffix?T(t.nestingSuffix):t.nestingSuffixEscaped||T(")"),this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(t,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")}},{key:"interpolate",value:function(e,t,n,r){var i,a,o,s=this,l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function u(e){return e.replace(/\$/g,"$$$$")}var c=function(e){if(e.indexOf(s.formatSeparator)<0)return _(t,l,e);var r=e.split(s.formatSeparator),i=r.shift().trim(),a=r.join(s.formatSeparator).trim();return s.format(_(t,l,i),a,n)};this.resetRegExp();var f=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler;for(o=0;i=this.regexpUnescape.exec(e);){if(void 0===(a=c(i[1].trim())))if("function"==typeof f){var d=f(e,i,r);a="string"==typeof d?d:""}else this.logger.warn("missed to pass in variable ".concat(i[1]," for interpolating ").concat(e)),a="";else"string"==typeof a||this.useRawValueToEscape||(a=w(a));if(e=e.replace(i[0],u(a)),this.regexpUnescape.lastIndex=0,++o>=this.maxReplaces)break}for(o=0;i=this.regexp.exec(e);){if(void 0===(a=c(i[1].trim())))if("function"==typeof f){var p=f(e,i,r);a="string"==typeof p?p:""}else this.logger.warn("missed to pass in variable ".concat(i[1]," for interpolating ").concat(e)),a="";else"string"==typeof a||this.useRawValueToEscape||(a=w(a));if(a=this.escapeValue?u(this.escape(a)):u(a),e=e.replace(i[0],a),this.regexp.lastIndex=0,++o>=this.maxReplaces)break}return e}},{key:"nest",value:function(e,t){var n,r,i=a({},arguments.length>2&&void 0!==arguments[2]?arguments[2]:{});function o(e,t){if(e.indexOf(",")<0)return e;var n=e.split(",");e=n.shift();var r=n.join(",");r=(r=this.interpolate(r,i)).replace(/'/g,'"');try{i=JSON.parse(r),t&&(i=a({},t,i))}catch(t){this.logger.error("failed parsing options string in nesting for key ".concat(e),t)}return delete i.defaultValue,e}for(i.applyPostProcessor=!1,delete i.defaultValue;n=this.nestingRegexp.exec(e);){if((r=t(o.call(this,n[1].trim(),i),i))&&n[0]===e&&"string"!=typeof r)return r;"string"!=typeof r&&(r=w(r)),r||(this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(e)),r=""),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}]),e}();var V=function(e){function t(e,n,r){var i,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return(0,o.A)(this,t),i=u(this,c(t).call(this)),b.call(l(i)),i.backend=e,i.store=n,i.services=r,i.languageUtils=r.languageUtils,i.options=a,i.logger=m.create("backendConnector"),i.state={},i.queue=[],i.backend&&i.backend.init&&i.backend.init(r,a.backend,a),i}return d(t,e),(0,s.A)(t,[{key:"queueLoad",value:function(e,t,n,r){var i=this,a=[],o=[],s=[],l=[];return e.forEach((function(e){var r=!0;t.forEach((function(t){var s="".concat(e,"|").concat(t);!n.reload&&i.store.hasResourceBundle(e,t)?i.state[s]=2:i.state[s]<0||(1===i.state[s]?o.indexOf(s)<0&&o.push(s):(i.state[s]=1,r=!1,o.indexOf(s)<0&&o.push(s),a.indexOf(s)<0&&a.push(s),l.indexOf(t)<0&&l.push(t)))})),r||s.push(e)})),(a.length||o.length)&&this.queue.push({pending:o,loaded:{},errors:[],callback:r}),{toLoad:a,pending:o,toLoadLanguages:s,toLoadNamespaces:l}}},{key:"loaded",value:function(e,t,n){var r=e.split("|"),i=(0,g.A)(r,2),a=i[0],o=i[1];t&&this.emit("failedLoading",a,o,t),n&&this.store.addResourceBundle(a,o,n),this.state[e]=t?-1:2;var s={};this.queue.forEach((function(n){var r,i,l,u,c,f;r=n.loaded,i=o,u=k(r,[a],Object),c=u.obj,f=u.k,c[f]=c[f]||[],l&&(c[f]=c[f].concat(i)),l||c[f].push(i),function(e,t){for(var n=e.indexOf(t);-1!==n;)e.splice(n,1),n=e.indexOf(t)}(n.pending,e),t&&n.errors.push(t),0!==n.pending.length||n.done||(Object.keys(n.loaded).forEach((function(e){s[e]||(s[e]=[]),n.loaded[e].length&&n.loaded[e].forEach((function(t){s[e].indexOf(t)<0&&s[e].push(t)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",s),this.queue=this.queue.filter((function(e){return!e.done}))}},{key:"read",value:function(e,t,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:250,o=arguments.length>5?arguments[5]:void 0;return e.length?this.backend[n](e,t,(function(s,l){s&&l&&i<5?setTimeout((function(){r.read.call(r,e,t,n,i+1,2*a,o)}),a):o(s,l)})):o(null,{})}},{key:"prepareLoading",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var a=this.queueLoad(e,t,r,i);if(!a.toLoad.length)return a.pending.length||i(),null;a.toLoad.forEach((function(e){n.loadOne(e)}))}},{key:"load",value:function(e,t,n){this.prepareLoading(e,t,{},n)}},{key:"reload",value:function(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}},{key:"loadOne",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=e.split("|"),i=(0,g.A)(r,2),a=i[0],o=i[1];this.read(a,o,"read",null,null,(function(r,i){r&&t.logger.warn("".concat(n,"loading namespace ").concat(o," for language ").concat(a," failed"),r),!r&&i&&t.logger.log("".concat(n,"loaded namespace ").concat(o," for language ").concat(a),i),t.loaded(e,r,i)}))}},{key:"saveMissing",value:function(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)?this.logger.warn('did not save key "'.concat(n,'" for namespace "').concat(t,'" as the namespace was not yet loaded'),"This means something IS WRONG in your application setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"):(this.backend&&this.backend.create&&this.backend.create(e,t,n,r,null,a({},o,{isUpdate:i})),e&&e[0]&&this.store.addResource(e[0],t,n,r))}}]),t}(b);function F(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.whitelist&&e.whitelist.indexOf("cimode")<0&&(e.whitelist=e.whitelist.concat(["cimode"])),e}function z(){}const B=new(function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;if((0,o.A)(this,t),e=u(this,c(t).call(this)),b.call(l(e)),e.options=F(n),e.services={},e.logger=m,e.modules={external:[]},r&&!e.isInitialized&&!n.isClone){if(!e.options.initImmediate)return e.init(n,r),u(e,l(e));setTimeout((function(){e.init(n,r)}),0)}return e}return d(t,e),(0,s.A)(t,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;function i(e){return e?"function"==typeof e?new e:e:null}if("function"==typeof t&&(n=t,t={}),this.options=a({},{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,whitelist:!1,nonExplicitWhitelist:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===(0,r.A)(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===(0,r.A)(e[2])||"object"===(0,r.A)(e[3])){var n=e[3]||e[2];Object.keys(n).forEach((function(e){t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:function(e,t,n){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",maxReplaces:1e3}},this.options,F(t)),this.format=this.options.interpolation.format,n||(n=z),!this.options.isClone){this.modules.logger?m.init(i(this.modules.logger),this.options):m.init(null,this.options);var o=new A(this.options);this.store=new N(this.options.resources,this.options);var s=this.services;s.logger=m,s.resourceStore=this.store,s.languageUtils=o,s.pluralResolver=new U(o,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),s.interpolator=new j(this.options),s.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},s.backendConnector=new V(i(this.modules.backend),s.resourceStore,s,this.options),s.backendConnector.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];e.emit.apply(e,[t].concat(r))})),this.modules.languageDetector&&(s.languageDetector=i(this.modules.languageDetector),s.languageDetector.init(s,this.options.detection,this.options)),this.modules.i18nFormat&&(s.i18nFormat=i(this.modules.i18nFormat),s.i18nFormat.init&&s.i18nFormat.init(this)),this.translator=new D(this.services,this.options),this.translator.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];e.emit.apply(e,[t].concat(r))})),this.modules.external.forEach((function(t){t.init&&t.init(e)}))}["getResource","addResource","addResources","addResourceBundle","removeResourceBundle","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments)}}));var l=S(),u=function(){e.changeLanguage(e.options.lng,(function(t,r){e.isInitialized=!0,e.logger.log("initialized",e.options),e.emit("initialized",e.options),l.resolve(r),n(t,r)}))};return this.options.resources||!this.options.initImmediate?u():setTimeout(u,0),l}},{key:"loadResources",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:z;if(!this.options.resources||this.options.partialBundledLanguages){if(this.language&&"cimode"===this.language.toLowerCase())return t();var n=[],r=function(t){t&&e.services.languageUtils.toResolveHierarchy(t).forEach((function(e){n.indexOf(e)<0&&n.push(e)}))};if(this.language)r(this.language);else this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((function(e){return r(e)}));this.options.preload&&this.options.preload.forEach((function(e){return r(e)})),this.services.backendConnector.load(n,this.options.ns,t)}else t(null)}},{key:"reloadResources",value:function(e,t,n){var r=S();return e||(e=this.languages),t||(t=this.options.ns),n||(n=z),this.services.backendConnector.reload(e,t,(function(e){r.resolve(),n(e)})),r}},{key:"use",value:function(e){return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&R.addPostProcessor(e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"changeLanguage",value:function(e,t){var n=this,r=S();this.emit("languageChanging",e);var i=function(e){e&&(n.language=e,n.languages=n.services.languageUtils.toResolveHierarchy(e),n.translator.language||n.translator.changeLanguage(e),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage(e)),n.loadResources((function(i){!function(e,i){n.translator.changeLanguage(i),i&&(n.emit("languageChanged",i),n.logger.log("languageChanged",i)),r.resolve((function(){return n.t.apply(n,arguments)})),t&&t(e,(function(){return n.t.apply(n,arguments)}))}(i,e)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(i):i(e):i(this.services.languageDetector.detect()),r}},{key:"getFixedT",value:function(e,t){var n=this,i=function e(t,i){var o;if("object"!==(0,r.A)(i)){for(var s=arguments.length,l=new Array(s>2?s-2:0),u=2;u<s;u++)l[u-2]=arguments[u];o=n.options.overloadTranslationOptionHandler([t,i].concat(l))}else o=a({},i);return o.lng=o.lng||e.lng,o.lngs=o.lngs||e.lngs,o.ns=o.ns||e.ns,n.t(t,o)};return"string"==typeof e?i.lng=e:i.lngs=e,i.ns=t,i}},{key:"t",value:function(){var e;return this.translator&&(e=this.translator).translate.apply(e,arguments)}},{key:"exists",value:function(){var e;return this.translator&&(e=this.translator).exists.apply(e,arguments)}},{key:"setDefaultNamespace",value:function(e){this.options.defaultNS=e}},{key:"hasLoadedNamespace",value:function(e){var t=this;if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var n=this.languages[0],r=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;var a=function(e,n){var r=t.services.backendConnector.state["".concat(e,"|").concat(n)];return-1===r||2===r};return!!this.hasResourceBundle(n,e)||(!this.services.backendConnector.backend||!(!a(n,e)||r&&!a(i,e)))}},{key:"loadNamespaces",value:function(e,t){var n=this,r=S();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach((function(e){n.options.ns.indexOf(e)<0&&n.options.ns.push(e)})),this.loadResources((function(e){r.resolve(),t&&t(e)})),r):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var n=S();"string"==typeof e&&(e=[e]);var r=this.options.preload||[],i=e.filter((function(e){return r.indexOf(e)<0}));return i.length?(this.options.preload=r.concat(i),this.loadResources((function(e){n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){if(e||(e=this.languages&&this.languages.length>0?this.languages[0]:this.language),!e)return"rtl";return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam"].indexOf(this.services.languageUtils.getLanguagePartFromCode(e))>=0?"rtl":"ltr"}},{key:"createInstance",value:function(){return new t(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}},{key:"cloneInstance",value:function(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:z,i=a({},this.options,n,{isClone:!0}),o=new t(i);return["store","services","language"].forEach((function(t){o[t]=e[t]})),o.translator=new D(o.services,o.options),o.translator.on("*",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];o.emit.apply(o,[e].concat(n))})),o.init(i,r),o.translator.options=o.options,o}}]),t}(b))},771:(e,t,n)=>{var r=NaN,i="[object Symbol]",a=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,l=/^0o[0-7]+$/i,u=parseInt,c="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,f="object"==typeof self&&self&&self.Object===Object&&self,d=c||f||Function("return this")(),p=Object.prototype.toString,h=Math.max,v=Math.min,g=function(){return d.Date.now()};function y(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function m(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&p.call(e)==i}(e))return r;if(y(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=y(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(a,"");var n=s.test(e);return n||l.test(e)?u(e.slice(2),n?2:8):o.test(e)?r:+e}e.exports=function(e,t,n){var r,i,a,o,s,l,u=0,c=!1,f=!1,d=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function p(t){var n=r,a=i;return r=i=void 0,u=t,o=e.apply(a,n)}function b(e){var n=e-l;return void 0===l||n>=t||n<0||f&&e-u>=a}function S(){var e=g();if(b(e))return w(e);s=setTimeout(S,function(e){var n=t-(e-l);return f?v(n,a-(e-u)):n}(e))}function w(e){return s=void 0,d&&r?p(e):(r=i=void 0,o)}function k(){var e=g(),n=b(e);if(r=arguments,i=this,l=e,n){if(void 0===s)return function(e){return u=e,s=setTimeout(S,t),c?p(e):o}(l);if(f)return s=setTimeout(S,t),p(l)}return void 0===s&&(s=setTimeout(S,t)),o}return t=m(t)||0,y(n)&&(c=!!n.leading,a=(f="maxWait"in n)?h(m(n.maxWait)||0,t):a,d="trailing"in n?!!n.trailing:d),k.cancel=function(){void 0!==s&&clearTimeout(s),u=0,r=l=i=s=void 0},k.flush=function(){return void 0===s?o:w(g())},k}},854:e=>{"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,i){for(var a,o,s=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),l=1;l<arguments.length;l++){for(var u in a=Object(arguments[l]))n.call(a,u)&&(s[u]=a[u]);if(t){o=t(a);for(var c=0;c<o.length;c++)r.call(a,o[c])&&(s[o[c]]=a[o[c]])}}return s}},216:(e,t,n)=>{"use strict";var r=n(151);function i(){}function a(){}a.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,a,o){if(o!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:i};return n.PropTypes=n,n}},374:(e,t,n)=>{e.exports=n(216)()},151:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},641:(e,t,n)=>{"use strict";var r=n(766),i=n(854),a=n(428);function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}if(!r)throw Error(o(227));var s=new Set,l={};function u(e,t){c(e,t),c(e+"Capture",t)}function c(e,t){for(l[e]=t,e=0;e<t.length;e++)s.add(t[e])}var f=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),d=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,p=Object.prototype.hasOwnProperty,h={},v={};function g(e,t,n,r,i,a,o){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var y={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){y[e]=new g(e,0,!1,e,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];y[t]=new g(t,1,!1,e[1],null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){y[e]=new g(e,2,!1,e.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){y[e]=new g(e,2,!1,e,null,!1,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){y[e]=new g(e,3,!1,e.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((function(e){y[e]=new g(e,3,!0,e,null,!1,!1)})),["capture","download"].forEach((function(e){y[e]=new g(e,4,!1,e,null,!1,!1)})),["cols","rows","size","span"].forEach((function(e){y[e]=new g(e,6,!1,e,null,!1,!1)})),["rowSpan","start"].forEach((function(e){y[e]=new g(e,5,!1,e.toLowerCase(),null,!1,!1)}));var m=/[\-:]([a-z])/g;function b(e){return e[1].toUpperCase()}function S(e,t,n,r){var i=y.hasOwnProperty(t)?y[t]:null;(null!==i?0===i.type:!r&&(2<t.length&&("o"===t[0]||"O"===t[0])&&("n"===t[1]||"N"===t[1])))||(function(e,t,n,r){if(null==t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,i,r)&&(n=null),r||null===i?function(e){return!!p.call(v,e)||!p.call(h,e)&&(d.test(e)?v[e]=!0:(h[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=null===n?3!==i.type&&"":n:(t=i.attributeName,r=i.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(i=i.type)||4===i&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(m,b);y[t]=new g(t,1,!1,e,null,!1,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(m,b);y[t]=new g(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(m,b);y[t]=new g(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((function(e){y[e]=new g(e,1,!1,e.toLowerCase(),null,!1,!1)})),y.xlinkHref=new g("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((function(e){y[e]=new g(e,1,!1,e.toLowerCase(),null,!0,!0)}));var w=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,k=60103,E=60106,x=60107,_=60108,I=60114,T=60109,C=60110,O=60112,N=60113,R=60120,D=60115,P=60116,A=60121,M=60128,L=60129,U=60130,j=60131;if("function"==typeof Symbol&&Symbol.for){var V=Symbol.for;k=V("react.element"),E=V("react.portal"),x=V("react.fragment"),_=V("react.strict_mode"),I=V("react.profiler"),T=V("react.provider"),C=V("react.context"),O=V("react.forward_ref"),N=V("react.suspense"),R=V("react.suspense_list"),D=V("react.memo"),P=V("react.lazy"),A=V("react.block"),V("react.scope"),M=V("react.opaque.id"),L=V("react.debug_trace_mode"),U=V("react.offscreen"),j=V("react.legacy_hidden")}var F,z="function"==typeof Symbol&&Symbol.iterator;function B(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=z&&e[z]||e["@@iterator"])?e:null}function H(e){if(void 0===F)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);F=t&&t[1]||""}return"\n"+F+e}var W=!1;function q(e,t){if(!e||W)return"";W=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var r=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){r=e}e.call(t.prototype)}else{try{throw Error()}catch(e){r=e}e()}}catch(e){if(e&&r&&"string"==typeof e.stack){for(var i=e.stack.split("\n"),a=r.stack.split("\n"),o=i.length-1,s=a.length-1;1<=o&&0<=s&&i[o]!==a[s];)s--;for(;1<=o&&0<=s;o--,s--)if(i[o]!==a[s]){if(1!==o||1!==s)do{if(o--,0>--s||i[o]!==a[s])return"\n"+i[o].replace(" at new "," at ")}while(1<=o&&0<=s);break}}}finally{W=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?H(e):""}function $(e){switch(e.tag){case 5:return H(e.type);case 16:return H("Lazy");case 13:return H("Suspense");case 19:return H("SuspenseList");case 0:case 2:case 15:return e=q(e.type,!1);case 11:return e=q(e.type.render,!1);case 22:return e=q(e.type._render,!1);case 1:return e=q(e.type,!0);default:return""}}function K(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case x:return"Fragment";case E:return"Portal";case I:return"Profiler";case _:return"StrictMode";case N:return"Suspense";case R:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case C:return(e.displayName||"Context")+".Consumer";case T:return(e._context.displayName||"Context")+".Provider";case O:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(""!==t?"ForwardRef("+t+")":"ForwardRef");case D:return K(e.type);case A:return K(e._render);case P:t=e._payload,e=e._init;try{return K(e(t))}catch(e){}}return null}function Y(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function Q(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function J(e){e._valueTracker||(e._valueTracker=function(e){var t=Q(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=""+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function G(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Q(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function X(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function Z(e,t){var n=t.checked;return i({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function ee(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=Y(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function te(e,t){null!=(t=t.checked)&&S(e,"checked",t,!1)}function ne(e,t){te(e,t);var n=Y(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?ie(e,t.type,n):t.hasOwnProperty("defaultValue")&&ie(e,t.type,Y(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function re(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function ie(e,t,n){"number"===t&&X(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}function ae(e,t){return e=i({children:void 0},t),(t=function(e){var t="";return r.Children.forEach(e,(function(e){null!=e&&(t+=e)})),t}(t.children))&&(e.children=t),e}function oe(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Y(n),t=null,i=0;i<e.length;i++){if(e[i].value===n)return e[i].selected=!0,void(r&&(e[i].defaultSelected=!0));null!==t||e[i].disabled||(t=e[i])}null!==t&&(t.selected=!0)}}function se(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(o(91));return i({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function le(e,t){var n=t.value;if(null==n){if(n=t.children,t=t.defaultValue,null!=n){if(null!=t)throw Error(o(92));if(Array.isArray(n)){if(!(1>=n.length))throw Error(o(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:Y(n)}}function ue(e,t){var n=Y(t.value),r=Y(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function ce(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}var fe={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function de(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function pe(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?de(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var he,ve,ge=(ve=function(e,t){if(e.namespaceURI!==fe.svg||"innerHTML"in e)e.innerHTML=t;else{for((he=he||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=he.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,r){MSApp.execUnsafeLocalFunction((function(){return ve(e,t)}))}:ve);function ye(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var me={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},be=["Webkit","ms","Moz","O"];function Se(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||me.hasOwnProperty(e)&&me[e]?(""+t).trim():t+"px"}function we(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),i=Se(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}Object.keys(me).forEach((function(e){be.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),me[t]=me[e]}))}));var ke=i({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ee(e,t){if(t){if(ke[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(o(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(o(60));if("object"!=typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(o(61))}if(null!=t.style&&"object"!=typeof t.style)throw Error(o(62))}}function xe(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}function _e(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var Ie=null,Te=null,Ce=null;function Oe(e){if(e=ni(e)){if("function"!=typeof Ie)throw Error(o(280));var t=e.stateNode;t&&(t=ii(t),Ie(e.stateNode,e.type,t))}}function Ne(e){Te?Ce?Ce.push(e):Ce=[e]:Te=e}function Re(){if(Te){var e=Te,t=Ce;if(Ce=Te=null,Oe(e),t)for(e=0;e<t.length;e++)Oe(t[e])}}function De(e,t){return e(t)}function Pe(e,t,n,r,i){return e(t,n,r,i)}function Ae(){}var Me=De,Le=!1,Ue=!1;function je(){null===Te&&null===Ce||(Ae(),Re())}function Ve(e,t){var n=e.stateNode;if(null===n)return null;var r=ii(n);if(null===r)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}if(e)return null;if(n&&"function"!=typeof n)throw Error(o(231,t,typeof n));return n}var Fe=!1;if(f)try{var ze={};Object.defineProperty(ze,"passive",{get:function(){Fe=!0}}),window.addEventListener("test",ze,ze),window.removeEventListener("test",ze,ze)}catch(ve){Fe=!1}function Be(e,t,n,r,i,a,o,s,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(e){this.onError(e)}}var He=!1,We=null,qe=!1,$e=null,Ke={onError:function(e){He=!0,We=e}};function Ye(e,t,n,r,i,a,o,s,l){He=!1,We=null,Be.apply(Ke,arguments)}function Qe(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{!!(1026&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function Je(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function Ge(e){if(Qe(e)!==e)throw Error(o(188))}function Xe(e){if(e=function(e){var t=e.alternate;if(!t){if(null===(t=Qe(e)))throw Error(o(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(null===i)break;var a=i.alternate;if(null===a){if(null!==(r=i.return)){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return Ge(i),e;if(a===r)return Ge(i),t;a=a.sibling}throw Error(o(188))}if(n.return!==r.return)n=i,r=a;else{for(var s=!1,l=i.child;l;){if(l===n){s=!0,n=i,r=a;break}if(l===r){s=!0,r=i,n=a;break}l=l.sibling}if(!s){for(l=a.child;l;){if(l===n){s=!0,n=a,r=i;break}if(l===r){s=!0,r=a,n=i;break}l=l.sibling}if(!s)throw Error(o(189))}}if(n.alternate!==r)throw Error(o(190))}if(3!==n.tag)throw Error(o(188));return n.stateNode.current===n?e:t}(e),!e)return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}function Ze(e,t){for(var n=e.alternate;null!==t;){if(t===e||t===n)return!0;t=t.return}return!1}var et,tt,nt,rt,it=!1,at=[],ot=null,st=null,lt=null,ut=new Map,ct=new Map,ft=[],dt="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function pt(e,t,n,r,i){return{blockedOn:e,domEventName:t,eventSystemFlags:16|n,nativeEvent:i,targetContainers:[r]}}function ht(e,t){switch(e){case"focusin":case"focusout":ot=null;break;case"dragenter":case"dragleave":st=null;break;case"mouseover":case"mouseout":lt=null;break;case"pointerover":case"pointerout":ut.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ct.delete(t.pointerId)}}function vt(e,t,n,r,i,a){return null===e||e.nativeEvent!==a?(e=pt(t,n,r,i,a),null!==t&&(null!==(t=ni(t))&&tt(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,null!==i&&-1===t.indexOf(i)&&t.push(i),e)}function gt(e){var t=ti(e.target);if(null!==t){var n=Qe(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=Je(n)))return e.blockedOn=t,void rt(e.lanePriority,(function(){a.unstable_runWithPriority(e.priority,(function(){nt(n)}))}))}else if(3===t&&n.stateNode.hydrate)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function yt(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=Xt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n)return null!==(t=ni(n))&&tt(t),e.blockedOn=n,!1;t.shift()}return!0}function mt(e,t,n){yt(e)&&n.delete(t)}function bt(){for(it=!1;0<at.length;){var e=at[0];if(null!==e.blockedOn){null!==(e=ni(e.blockedOn))&&et(e);break}for(var t=e.targetContainers;0<t.length;){var n=Xt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n){e.blockedOn=n;break}t.shift()}null===e.blockedOn&&at.shift()}null!==ot&&yt(ot)&&(ot=null),null!==st&&yt(st)&&(st=null),null!==lt&&yt(lt)&&(lt=null),ut.forEach(mt),ct.forEach(mt)}function St(e,t){e.blockedOn===t&&(e.blockedOn=null,it||(it=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,bt)))}function wt(e){function t(t){return St(t,e)}if(0<at.length){St(at[0],e);for(var n=1;n<at.length;n++){var r=at[n];r.blockedOn===e&&(r.blockedOn=null)}}for(null!==ot&&St(ot,e),null!==st&&St(st,e),null!==lt&&St(lt,e),ut.forEach(t),ct.forEach(t),n=0;n<ft.length;n++)(r=ft[n]).blockedOn===e&&(r.blockedOn=null);for(;0<ft.length&&null===(n=ft[0]).blockedOn;)gt(n),null===n.blockedOn&&ft.shift()}function kt(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Et={animationend:kt("Animation","AnimationEnd"),animationiteration:kt("Animation","AnimationIteration"),animationstart:kt("Animation","AnimationStart"),transitionend:kt("Transition","TransitionEnd")},xt={},_t={};function It(e){if(xt[e])return xt[e];if(!Et[e])return e;var t,n=Et[e];for(t in n)if(n.hasOwnProperty(t)&&t in _t)return xt[e]=n[t];return e}f&&(_t=document.createElement("div").style,"AnimationEvent"in window||(delete Et.animationend.animation,delete Et.animationiteration.animation,delete Et.animationstart.animation),"TransitionEvent"in window||delete Et.transitionend.transition);var Tt=It("animationend"),Ct=It("animationiteration"),Ot=It("animationstart"),Nt=It("transitionend"),Rt=new Map,Dt=new Map,Pt=["abort","abort",Tt,"animationEnd",Ct,"animationIteration",Ot,"animationStart","canplay","canPlay","canplaythrough","canPlayThrough","durationchange","durationChange","emptied","emptied","encrypted","encrypted","ended","ended","error","error","gotpointercapture","gotPointerCapture","load","load","loadeddata","loadedData","loadedmetadata","loadedMetadata","loadstart","loadStart","lostpointercapture","lostPointerCapture","playing","playing","progress","progress","seeking","seeking","stalled","stalled","suspend","suspend","timeupdate","timeUpdate",Nt,"transitionEnd","waiting","waiting"];function At(e,t){for(var n=0;n<e.length;n+=2){var r=e[n],i=e[n+1];i="on"+(i[0].toUpperCase()+i.slice(1)),Dt.set(r,t),Rt.set(r,i),u(i,[r])}}(0,a.unstable_now)();var Mt=8;function Lt(e){if(1&e)return Mt=15,1;if(2&e)return Mt=14,2;if(4&e)return Mt=13,4;var t=24&e;return 0!==t?(Mt=12,t):32&e?(Mt=11,32):0!==(t=192&e)?(Mt=10,t):256&e?(Mt=9,256):0!==(t=3584&e)?(Mt=8,t):4096&e?(Mt=7,4096):0!==(t=4186112&e)?(Mt=6,t):0!==(t=62914560&e)?(Mt=5,t):67108864&e?(Mt=4,67108864):134217728&e?(Mt=3,134217728):0!==(t=805306368&e)?(Mt=2,t):1073741824&e?(Mt=1,1073741824):(Mt=8,e)}function Ut(e,t){var n=e.pendingLanes;if(0===n)return Mt=0;var r=0,i=0,a=e.expiredLanes,o=e.suspendedLanes,s=e.pingedLanes;if(0!==a)r=a,i=Mt=15;else if(0!==(a=134217727&n)){var l=a&~o;0!==l?(r=Lt(l),i=Mt):0!==(s&=a)&&(r=Lt(s),i=Mt)}else 0!==(a=n&~o)?(r=Lt(a),i=Mt):0!==s&&(r=Lt(s),i=Mt);if(0===r)return 0;if(r=n&((0>(r=31-Ht(r))?0:1<<r)<<1)-1,0!==t&&t!==r&&!(t&o)){if(Lt(t),i<=Mt)return t;Mt=i}if(0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0<t;)i=1<<(n=31-Ht(t)),r|=e[n],t&=~i;return r}function jt(e){return 0!==(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function Vt(e,t){switch(e){case 15:return 1;case 14:return 2;case 12:return 0===(e=Ft(24&~t))?Vt(10,t):e;case 10:return 0===(e=Ft(192&~t))?Vt(8,t):e;case 8:return 0===(e=Ft(3584&~t))&&(0===(e=Ft(4186112&~t))&&(e=512)),e;case 2:return 0===(t=Ft(805306368&~t))&&(t=268435456),t}throw Error(o(358,e))}function Ft(e){return e&-e}function zt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Bt(e,t,n){e.pendingLanes|=t;var r=t-1;e.suspendedLanes&=r,e.pingedLanes&=r,(e=e.eventTimes)[t=31-Ht(t)]=n}var Ht=Math.clz32?Math.clz32:function(e){return 0===e?32:31-(Wt(e)/qt|0)|0},Wt=Math.log,qt=Math.LN2;var $t=a.unstable_UserBlockingPriority,Kt=a.unstable_runWithPriority,Yt=!0;function Qt(e,t,n,r){Le||Ae();var i=Gt,a=Le;Le=!0;try{Pe(i,e,t,n,r)}finally{(Le=a)||je()}}function Jt(e,t,n,r){Kt($t,Gt.bind(null,e,t,n,r))}function Gt(e,t,n,r){var i;if(Yt)if((i=!(4&t))&&0<at.length&&-1<dt.indexOf(e))e=pt(null,e,t,n,r),at.push(e);else{var a=Xt(e,t,n,r);if(null===a)i&&ht(e,r);else{if(i){if(-1<dt.indexOf(e))return e=pt(a,e,t,n,r),void at.push(e);if(function(e,t,n,r,i){switch(t){case"focusin":return ot=vt(ot,e,t,n,r,i),!0;case"dragenter":return st=vt(st,e,t,n,r,i),!0;case"mouseover":return lt=vt(lt,e,t,n,r,i),!0;case"pointerover":var a=i.pointerId;return ut.set(a,vt(ut.get(a)||null,e,t,n,r,i)),!0;case"gotpointercapture":return a=i.pointerId,ct.set(a,vt(ct.get(a)||null,e,t,n,r,i)),!0}return!1}(a,e,t,n,r))return;ht(e,r)}Ar(e,t,r,null,n)}}}function Xt(e,t,n,r){var i=_e(r);if(null!==(i=ti(i))){var a=Qe(i);if(null===a)i=null;else{var o=a.tag;if(13===o){if(null!==(i=Je(a)))return i;i=null}else if(3===o){if(a.stateNode.hydrate)return 3===a.tag?a.stateNode.containerInfo:null;i=null}else a!==i&&(i=null)}}return Ar(e,t,r,i,n),null}var Zt=null,en=null,tn=null;function nn(){if(tn)return tn;var e,t,n=en,r=n.length,i="value"in Zt?Zt.value:Zt.textContent,a=i.length;for(e=0;e<r&&n[e]===i[e];e++);var o=r-e;for(t=1;t<=o&&n[r-t]===i[a-t];t++);return tn=i.slice(e,1<t?1-t:void 0)}function rn(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function an(){return!0}function on(){return!1}function sn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(null!=i.defaultPrevented?i.defaultPrevented:!1===i.returnValue)?an:on,this.isPropagationStopped=on,this}return i(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=an)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=an)},persist:function(){},isPersistent:an}),t}var ln,un,cn,fn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},dn=sn(fn),pn=i({},fn,{view:0,detail:0}),hn=sn(pn),vn=i({},pn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Tn,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==cn&&(cn&&"mousemove"===e.type?(ln=e.screenX-cn.screenX,un=e.screenY-cn.screenY):un=ln=0,cn=e),ln)},movementY:function(e){return"movementY"in e?e.movementY:un}}),gn=sn(vn),yn=sn(i({},vn,{dataTransfer:0})),mn=sn(i({},pn,{relatedTarget:0})),bn=sn(i({},fn,{animationName:0,elapsedTime:0,pseudoElement:0})),Sn=i({},fn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),wn=sn(Sn),kn=sn(i({},fn,{data:0})),En={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},xn={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},_n={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function In(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=_n[e])&&!!t[e]}function Tn(){return In}var Cn=i({},pn,{key:function(e){if(e.key){var t=En[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=rn(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?xn[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Tn,charCode:function(e){return"keypress"===e.type?rn(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?rn(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),On=sn(Cn),Nn=sn(i({},vn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Rn=sn(i({},pn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Tn})),Dn=sn(i({},fn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Pn=i({},vn,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),An=sn(Pn),Mn=[9,13,27,32],Ln=f&&"CompositionEvent"in window,Un=null;f&&"documentMode"in document&&(Un=document.documentMode);var jn=f&&"TextEvent"in window&&!Un,Vn=f&&(!Ln||Un&&8<Un&&11>=Un),Fn=String.fromCharCode(32),zn=!1;function Bn(e,t){switch(e){case"keyup":return-1!==Mn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Hn(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Wn=!1;var qn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function $n(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!qn[e.type]:"textarea"===t}function Kn(e,t,n,r){Ne(r),0<(t=Lr(t,"onChange")).length&&(n=new dn("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Yn=null,Qn=null;function Jn(e){Cr(e,0)}function Gn(e){if(G(ri(e)))return e}function Xn(e,t){if("change"===e)return t}var Zn=!1;if(f){var er;if(f){var tr="oninput"in document;if(!tr){var nr=document.createElement("div");nr.setAttribute("oninput","return;"),tr="function"==typeof nr.oninput}er=tr}else er=!1;Zn=er&&(!document.documentMode||9<document.documentMode)}function rr(){Yn&&(Yn.detachEvent("onpropertychange",ir),Qn=Yn=null)}function ir(e){if("value"===e.propertyName&&Gn(Qn)){var t=[];if(Kn(t,Qn,e,_e(e)),e=Jn,Le)e(t);else{Le=!0;try{De(e,t)}finally{Le=!1,je()}}}}function ar(e,t,n){"focusin"===e?(rr(),Qn=n,(Yn=t).attachEvent("onpropertychange",ir)):"focusout"===e&&rr()}function or(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Gn(Qn)}function sr(e,t){if("click"===e)return Gn(t)}function lr(e,t){if("input"===e||"change"===e)return Gn(t)}var ur="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},cr=Object.prototype.hasOwnProperty;function fr(e,t){if(ur(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++)if(!cr.call(t,n[r])||!ur(e[n[r]],t[n[r]]))return!1;return!0}function dr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function pr(e,t){var n,r=dr(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=dr(r)}}function hr(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?hr(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function vr(){for(var e=window,t=X();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(!n)break;t=X((e=t.contentWindow).document)}return t}function gr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var yr=f&&"documentMode"in document&&11>=document.documentMode,mr=null,br=null,Sr=null,wr=!1;function kr(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;wr||null==mr||mr!==X(r)||("selectionStart"in(r=mr)&&gr(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},Sr&&fr(Sr,r)||(Sr=r,0<(r=Lr(br,"onSelect")).length&&(t=new dn("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=mr)))}At("cancel cancel click click close close contextmenu contextMenu copy copy cut cut auxclick auxClick dblclick doubleClick dragend dragEnd dragstart dragStart drop drop focusin focus focusout blur input input invalid invalid keydown keyDown keypress keyPress keyup keyUp mousedown mouseDown mouseup mouseUp paste paste pause pause play play pointercancel pointerCancel pointerdown pointerDown pointerup pointerUp ratechange rateChange reset reset seeked seeked submit submit touchcancel touchCancel touchend touchEnd touchstart touchStart volumechange volumeChange".split(" "),0),At("drag drag dragenter dragEnter dragexit dragExit dragleave dragLeave dragover dragOver mousemove mouseMove mouseout mouseOut mouseover mouseOver pointermove pointerMove pointerout pointerOut pointerover pointerOver scroll scroll toggle toggle touchmove touchMove wheel wheel".split(" "),1),At(Pt,2);for(var Er="change selectionchange textInput compositionstart compositionend compositionupdate".split(" "),xr=0;xr<Er.length;xr++)Dt.set(Er[xr],0);c("onMouseEnter",["mouseout","mouseover"]),c("onMouseLeave",["mouseout","mouseover"]),c("onPointerEnter",["pointerout","pointerover"]),c("onPointerLeave",["pointerout","pointerover"]),u("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),u("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),u("onBeforeInput",["compositionend","keypress","textInput","paste"]),u("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var _r="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Ir=new Set("cancel close invalid load scroll toggle".split(" ").concat(_r));function Tr(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,function(e,t,n,r,i,a,s,l,u){if(Ye.apply(this,arguments),He){if(!He)throw Error(o(198));var c=We;He=!1,We=null,qe||(qe=!0,$e=c)}}(r,t,void 0,e),e.currentTarget=null}function Cr(e,t){t=!!(4&t);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],l=s.instance,u=s.currentTarget;if(s=s.listener,l!==a&&i.isPropagationStopped())break e;Tr(i,s,u),a=l}else for(o=0;o<r.length;o++){if(l=(s=r[o]).instance,u=s.currentTarget,s=s.listener,l!==a&&i.isPropagationStopped())break e;Tr(i,s,u),a=l}}}if(qe)throw e=$e,qe=!1,$e=null,e}function Or(e,t){var n=ai(t),r=e+"__bubble";n.has(r)||(Pr(t,e,2,!1),n.add(r))}var Nr="_reactListening"+Math.random().toString(36).slice(2);function Rr(e){e[Nr]||(e[Nr]=!0,s.forEach((function(t){Ir.has(t)||Dr(t,!1,e,null),Dr(t,!0,e,null)})))}function Dr(e,t,n,r){var i=4<arguments.length&&void 0!==arguments[4]?arguments[4]:0,a=n;if("selectionchange"===e&&9!==n.nodeType&&(a=n.ownerDocument),null!==r&&!t&&Ir.has(e)){if("scroll"!==e)return;i|=2,a=r}var o=ai(a),s=e+"__"+(t?"capture":"bubble");o.has(s)||(t&&(i|=4),Pr(a,e,i,t),o.add(s))}function Pr(e,t,n,r){var i=Dt.get(t);switch(void 0===i?2:i){case 0:i=Qt;break;case 1:i=Jt;break;default:i=Gt}n=i.bind(null,t,n,e),i=void 0,!Fe||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(i=!0),r?void 0!==i?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):void 0!==i?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function Ar(e,t,n,r,i){var a=r;if(!(1&t||2&t||null===r))e:for(;;){if(null===r)return;var o=r.tag;if(3===o||4===o){var s=r.stateNode.containerInfo;if(s===i||8===s.nodeType&&s.parentNode===i)break;if(4===o)for(o=r.return;null!==o;){var l=o.tag;if((3===l||4===l)&&((l=o.stateNode.containerInfo)===i||8===l.nodeType&&l.parentNode===i))return;o=o.return}for(;null!==s;){if(null===(o=ti(s)))return;if(5===(l=o.tag)||6===l){r=a=o;continue e}s=s.parentNode}}r=r.return}!function(e,t,n){if(Ue)return e(t,n);Ue=!0;try{return Me(e,t,n)}finally{Ue=!1,je()}}((function(){var r=a,i=_e(n),o=[];e:{var s=Rt.get(e);if(void 0!==s){var l=dn,u=e;switch(e){case"keypress":if(0===rn(n))break e;case"keydown":case"keyup":l=On;break;case"focusin":u="focus",l=mn;break;case"focusout":u="blur",l=mn;break;case"beforeblur":case"afterblur":l=mn;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":l=gn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":l=yn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":l=Rn;break;case Tt:case Ct:case Ot:l=bn;break;case Nt:l=Dn;break;case"scroll":l=hn;break;case"wheel":l=An;break;case"copy":case"cut":case"paste":l=wn;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":l=Nn}var c=!!(4&t),f=!c&&"scroll"===e,d=c?null!==s?s+"Capture":null:s;c=[];for(var p,h=r;null!==h;){var v=(p=h).stateNode;if(5===p.tag&&null!==v&&(p=v,null!==d&&(null!=(v=Ve(h,d))&&c.push(Mr(h,v,p)))),f)break;h=h.return}0<c.length&&(s=new l(s,u,null,n,i),o.push({event:s,listeners:c}))}}if(!(7&t)){if(l="mouseout"===e||"pointerout"===e,(!(s="mouseover"===e||"pointerover"===e)||16&t||!(u=n.relatedTarget||n.fromElement)||!ti(u)&&!u[Zr])&&(l||s)&&(s=i.window===i?i:(s=i.ownerDocument)?s.defaultView||s.parentWindow:window,l?(l=r,null!==(u=(u=n.relatedTarget||n.toElement)?ti(u):null)&&(u!==(f=Qe(u))||5!==u.tag&&6!==u.tag)&&(u=null)):(l=null,u=r),l!==u)){if(c=gn,v="onMouseLeave",d="onMouseEnter",h="mouse","pointerout"!==e&&"pointerover"!==e||(c=Nn,v="onPointerLeave",d="onPointerEnter",h="pointer"),f=null==l?s:ri(l),p=null==u?s:ri(u),(s=new c(v,h+"leave",l,n,i)).target=f,s.relatedTarget=p,v=null,ti(i)===r&&((c=new c(d,h+"enter",u,n,i)).target=p,c.relatedTarget=f,v=c),f=v,l&&u)e:{for(d=u,h=0,p=c=l;p;p=Ur(p))h++;for(p=0,v=d;v;v=Ur(v))p++;for(;0<h-p;)c=Ur(c),h--;for(;0<p-h;)d=Ur(d),p--;for(;h--;){if(c===d||null!==d&&c===d.alternate)break e;c=Ur(c),d=Ur(d)}c=null}else c=null;null!==l&&jr(o,s,l,c,!1),null!==u&&null!==f&&jr(o,f,u,c,!0)}if("select"===(l=(s=r?ri(r):window).nodeName&&s.nodeName.toLowerCase())||"input"===l&&"file"===s.type)var g=Xn;else if($n(s))if(Zn)g=lr;else{g=or;var y=ar}else(l=s.nodeName)&&"input"===l.toLowerCase()&&("checkbox"===s.type||"radio"===s.type)&&(g=sr);switch(g&&(g=g(e,r))?Kn(o,g,n,i):(y&&y(e,s,r),"focusout"===e&&(y=s._wrapperState)&&y.controlled&&"number"===s.type&&ie(s,"number",s.value)),y=r?ri(r):window,e){case"focusin":($n(y)||"true"===y.contentEditable)&&(mr=y,br=r,Sr=null);break;case"focusout":Sr=br=mr=null;break;case"mousedown":wr=!0;break;case"contextmenu":case"mouseup":case"dragend":wr=!1,kr(o,n,i);break;case"selectionchange":if(yr)break;case"keydown":case"keyup":kr(o,n,i)}var m;if(Ln)e:{switch(e){case"compositionstart":var b="onCompositionStart";break e;case"compositionend":b="onCompositionEnd";break e;case"compositionupdate":b="onCompositionUpdate";break e}b=void 0}else Wn?Bn(e,n)&&(b="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(b="onCompositionStart");b&&(Vn&&"ko"!==n.locale&&(Wn||"onCompositionStart"!==b?"onCompositionEnd"===b&&Wn&&(m=nn()):(en="value"in(Zt=i)?Zt.value:Zt.textContent,Wn=!0)),0<(y=Lr(r,b)).length&&(b=new kn(b,e,null,n,i),o.push({event:b,listeners:y}),m?b.data=m:null!==(m=Hn(n))&&(b.data=m))),(m=jn?function(e,t){switch(e){case"compositionend":return Hn(t);case"keypress":return 32!==t.which?null:(zn=!0,Fn);case"textInput":return(e=t.data)===Fn&&zn?null:e;default:return null}}(e,n):function(e,t){if(Wn)return"compositionend"===e||!Ln&&Bn(e,t)?(e=nn(),tn=en=Zt=null,Wn=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Vn&&"ko"!==t.locale?null:t.data}}(e,n))&&(0<(r=Lr(r,"onBeforeInput")).length&&(i=new kn("onBeforeInput","beforeinput",null,n,i),o.push({event:i,listeners:r}),i.data=m))}Cr(o,t)}))}function Mr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Lr(e,t){for(var n=t+"Capture",r=[];null!==e;){var i=e,a=i.stateNode;5===i.tag&&null!==a&&(i=a,null!=(a=Ve(e,n))&&r.unshift(Mr(e,a,i)),null!=(a=Ve(e,t))&&r.push(Mr(e,a,i))),e=e.return}return r}function Ur(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function jr(e,t,n,r,i){for(var a=t._reactName,o=[];null!==n&&n!==r;){var s=n,l=s.alternate,u=s.stateNode;if(null!==l&&l===r)break;5===s.tag&&null!==u&&(s=u,i?null!=(l=Ve(n,a))&&o.unshift(Mr(n,l,s)):i||null!=(l=Ve(n,a))&&o.push(Mr(n,l,s))),n=n.return}0!==o.length&&e.push({event:t,listeners:o})}function Vr(){}var Fr=null,zr=null;function Br(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function Hr(e,t){return"textarea"===e||"option"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var Wr="function"==typeof setTimeout?setTimeout:void 0,qr="function"==typeof clearTimeout?clearTimeout:void 0;function $r(e){1===e.nodeType?e.textContent="":9===e.nodeType&&(null!=(e=e.body)&&(e.textContent=""))}function Kr(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break}return e}function Yr(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var Qr=0;var Jr=Math.random().toString(36).slice(2),Gr="__reactFiber$"+Jr,Xr="__reactProps$"+Jr,Zr="__reactContainer$"+Jr,ei="__reactEvents$"+Jr;function ti(e){var t=e[Gr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Zr]||n[Gr]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=Yr(e);null!==e;){if(n=e[Gr])return n;e=Yr(e)}return t}n=(e=n).parentNode}return null}function ni(e){return!(e=e[Gr]||e[Zr])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function ri(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(o(33))}function ii(e){return e[Xr]||null}function ai(e){var t=e[ei];return void 0===t&&(t=e[ei]=new Set),t}var oi=[],si=-1;function li(e){return{current:e}}function ui(e){0>si||(e.current=oi[si],oi[si]=null,si--)}function ci(e,t){si++,oi[si]=e.current,e.current=t}var fi={},di=li(fi),pi=li(!1),hi=fi;function vi(e,t){var n=e.type.contextTypes;if(!n)return fi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i,a={};for(i in n)a[i]=t[i];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function gi(e){return null!=(e=e.childContextTypes)}function yi(){ui(pi),ui(di)}function mi(e,t,n){if(di.current!==fi)throw Error(o(168));ci(di,t),ci(pi,n)}function bi(e,t,n){var r=e.stateNode;if(e=t.childContextTypes,"function"!=typeof r.getChildContext)return n;for(var a in r=r.getChildContext())if(!(a in e))throw Error(o(108,K(t)||"Unknown",a));return i({},n,r)}function Si(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||fi,hi=di.current,ci(di,e),ci(pi,pi.current),!0}function wi(e,t,n){var r=e.stateNode;if(!r)throw Error(o(169));n?(e=bi(e,t,hi),r.__reactInternalMemoizedMergedChildContext=e,ui(pi),ui(di),ci(di,e)):ui(pi),ci(pi,n)}var ki=null,Ei=null,xi=a.unstable_runWithPriority,_i=a.unstable_scheduleCallback,Ii=a.unstable_cancelCallback,Ti=a.unstable_shouldYield,Ci=a.unstable_requestPaint,Oi=a.unstable_now,Ni=a.unstable_getCurrentPriorityLevel,Ri=a.unstable_ImmediatePriority,Di=a.unstable_UserBlockingPriority,Pi=a.unstable_NormalPriority,Ai=a.unstable_LowPriority,Mi=a.unstable_IdlePriority,Li={},Ui=void 0!==Ci?Ci:function(){},ji=null,Vi=null,Fi=!1,zi=Oi(),Bi=1e4>zi?Oi:function(){return Oi()-zi};function Hi(){switch(Ni()){case Ri:return 99;case Di:return 98;case Pi:return 97;case Ai:return 96;case Mi:return 95;default:throw Error(o(332))}}function Wi(e){switch(e){case 99:return Ri;case 98:return Di;case 97:return Pi;case 96:return Ai;case 95:return Mi;default:throw Error(o(332))}}function qi(e,t){return e=Wi(e),xi(e,t)}function $i(e,t,n){return e=Wi(e),_i(e,t,n)}function Ki(){if(null!==Vi){var e=Vi;Vi=null,Ii(e)}Yi()}function Yi(){if(!Fi&&null!==ji){Fi=!0;var e=0;try{var t=ji;qi(99,(function(){for(;e<t.length;e++){var n=t[e];do{n=n(!0)}while(null!==n)}})),ji=null}catch(t){throw null!==ji&&(ji=ji.slice(e+1)),_i(Ri,Ki),t}finally{Fi=!1}}}var Qi=w.ReactCurrentBatchConfig;function Ji(e,t){if(e&&e.defaultProps){for(var n in t=i({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}return t}var Gi=li(null),Xi=null,Zi=null,ea=null;function ta(){ea=Zi=Xi=null}function na(e){var t=Gi.current;ui(Gi),e.type._context._currentValue=t}function ra(e,t){for(;null!==e;){var n=e.alternate;if((e.childLanes&t)===t){if(null===n||(n.childLanes&t)===t)break;n.childLanes|=t}else e.childLanes|=t,null!==n&&(n.childLanes|=t);e=e.return}}function ia(e,t){Xi=e,ea=Zi=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(!!(e.lanes&t)&&(Lo=!0),e.firstContext=null)}function aa(e,t){if(ea!==e&&!1!==t&&0!==t)if("number"==typeof t&&1073741823!==t||(ea=e,t=1073741823),t={context:e,observedBits:t,next:null},null===Zi){if(null===Xi)throw Error(o(308));Zi=t,Xi.dependencies={lanes:0,firstContext:t,responders:null}}else Zi=Zi.next=t;return e._currentValue}var oa=!1;function sa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null},effects:null}}function la(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function ua(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ca(e,t){if(null!==(e=e.updateQueue)){var n=(e=e.shared).pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}}function fa(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var i=null,a=null;if(null!==(n=n.firstBaseUpdate)){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===a?i=a=o:a=a.next=o,n=n.next}while(null!==n);null===a?i=a=t:a=a.next=t}else i=a=t;return n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,effects:r.effects},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function da(e,t,n,r){var a=e.updateQueue;oa=!1;var o=a.firstBaseUpdate,s=a.lastBaseUpdate,l=a.shared.pending;if(null!==l){a.shared.pending=null;var u=l,c=u.next;u.next=null,null===s?o=c:s.next=c,s=u;var f=e.alternate;if(null!==f){var d=(f=f.updateQueue).lastBaseUpdate;d!==s&&(null===d?f.firstBaseUpdate=c:d.next=c,f.lastBaseUpdate=u)}}if(null!==o){for(d=a.baseState,s=0,f=c=u=null;;){l=o.lane;var p=o.eventTime;if((r&l)===l){null!==f&&(f=f.next={eventTime:p,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var h=e,v=o;switch(l=t,p=n,v.tag){case 1:if("function"==typeof(h=v.payload)){d=h.call(p,d,l);break e}d=h;break e;case 3:h.flags=-4097&h.flags|64;case 0:if(null==(l="function"==typeof(h=v.payload)?h.call(p,d,l):h))break e;d=i({},d,l);break e;case 2:oa=!0}}null!==o.callback&&(e.flags|=32,null===(l=a.effects)?a.effects=[o]:l.push(o))}else p={eventTime:p,lane:l,tag:o.tag,payload:o.payload,callback:o.callback,next:null},null===f?(c=f=p,u=d):f=f.next=p,s|=l;if(null===(o=o.next)){if(null===(l=a.shared.pending))break;o=l.next,l.next=null,a.lastBaseUpdate=l,a.shared.pending=null}}null===f&&(u=d),a.baseState=u,a.firstBaseUpdate=c,a.lastBaseUpdate=f,zs|=s,e.lanes=s,e.memoizedState=d}}function pa(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(null!==i){if(r.callback=null,r=n,"function"!=typeof i)throw Error(o(191,i));i.call(r)}}}var ha=(new r.Component).refs;function va(e,t,n,r){n=null==(n=n(r,t=e.memoizedState))?t:i({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var ga={isMounted:function(e){return!!(e=e._reactInternals)&&Qe(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=dl(),i=pl(e),a=ua(r,i);a.payload=t,null!=n&&(a.callback=n),ca(e,a),hl(e,i,r)},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=dl(),i=pl(e),a=ua(r,i);a.tag=1,a.payload=t,null!=n&&(a.callback=n),ca(e,a),hl(e,i,r)},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=dl(),r=pl(e),i=ua(n,r);i.tag=2,null!=t&&(i.callback=t),ca(e,i),hl(e,r,n)}};function ya(e,t,n,r,i,a,o){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,a,o):!t.prototype||!t.prototype.isPureReactComponent||(!fr(n,r)||!fr(i,a))}function ma(e,t,n){var r=!1,i=fi,a=t.contextType;return"object"==typeof a&&null!==a?a=aa(a):(i=gi(t)?hi:di.current,a=(r=null!=(r=t.contextTypes))?vi(e,i):fi),t=new t(n,a),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=ga,e.stateNode=t,t._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function ba(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&ga.enqueueReplaceState(t,t.state,null)}function Sa(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs=ha,sa(e);var a=t.contextType;"object"==typeof a&&null!==a?i.context=aa(a):(a=gi(t)?hi:di.current,i.context=vi(e,a)),da(e,n,i,r),i.state=e.memoizedState,"function"==typeof(a=t.getDerivedStateFromProps)&&(va(e,t,a,n),i.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof i.getSnapshotBeforeUpdate||"function"!=typeof i.UNSAFE_componentWillMount&&"function"!=typeof i.componentWillMount||(t=i.state,"function"==typeof i.componentWillMount&&i.componentWillMount(),"function"==typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount(),t!==i.state&&ga.enqueueReplaceState(i,i.state,null),da(e,n,i,r),i.state=e.memoizedState),"function"==typeof i.componentDidMount&&(e.flags|=4)}var wa=Array.isArray;function ka(e,t,n){if(null!==(e=n.ref)&&"function"!=typeof e&&"object"!=typeof e){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(o(309));var r=n.stateNode}if(!r)throw Error(o(147,e));var i=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===i?t.ref:(t=function(e){var t=r.refs;t===ha&&(t=r.refs={}),null===e?delete t[i]:t[i]=e},t._stringRef=i,t)}if("string"!=typeof e)throw Error(o(284));if(!n._owner)throw Error(o(290,e))}return e}function Ea(e,t){if("textarea"!==e.type)throw Error(o(31,"[object Object]"===Object.prototype.toString.call(t)?"object with keys {"+Object.keys(t).join(", ")+"}":t))}function xa(e){function t(t,n){if(e){var r=t.lastEffect;null!==r?(r.nextEffect=n,t.lastEffect=n):t.firstEffect=t.lastEffect=n,n.nextEffect=null,n.flags=8}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function i(e,t){return(e=$l(e,t)).index=0,e.sibling=null,e}function a(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.flags=2,n):r:(t.flags=2,n):n}function s(t){return e&&null===t.alternate&&(t.flags=2),t}function l(e,t,n,r){return null===t||6!==t.tag?((t=Jl(n,e.mode,r)).return=e,t):((t=i(t,n)).return=e,t)}function u(e,t,n,r){return null!==t&&t.elementType===n.type?((r=i(t,n.props)).ref=ka(e,t,n),r.return=e,r):((r=Kl(n.type,n.key,n.props,null,e.mode,r)).ref=ka(e,t,n),r.return=e,r)}function c(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Gl(n,e.mode,r)).return=e,t):((t=i(t,n.children||[])).return=e,t)}function f(e,t,n,r,a){return null===t||7!==t.tag?((t=Yl(n,e.mode,r,a)).return=e,t):((t=i(t,n)).return=e,t)}function d(e,t,n){if("string"==typeof t||"number"==typeof t)return(t=Jl(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case k:return(n=Kl(t.type,t.key,t.props,null,e.mode,n)).ref=ka(e,null,t),n.return=e,n;case E:return(t=Gl(t,e.mode,n)).return=e,t}if(wa(t)||B(t))return(t=Yl(t,e.mode,n,null)).return=e,t;Ea(e,t)}return null}function p(e,t,n,r){var i=null!==t?t.key:null;if("string"==typeof n||"number"==typeof n)return null!==i?null:l(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case k:return n.key===i?n.type===x?f(e,t,n.props.children,r,i):u(e,t,n,r):null;case E:return n.key===i?c(e,t,n,r):null}if(wa(n)||B(n))return null!==i?null:f(e,t,n,r,null);Ea(e,n)}return null}function h(e,t,n,r,i){if("string"==typeof r||"number"==typeof r)return l(t,e=e.get(n)||null,""+r,i);if("object"==typeof r&&null!==r){switch(r.$$typeof){case k:return e=e.get(null===r.key?n:r.key)||null,r.type===x?f(t,e,r.props.children,i,r.key):u(t,e,r,i);case E:return c(t,e=e.get(null===r.key?n:r.key)||null,r,i)}if(wa(r)||B(r))return f(t,e=e.get(n)||null,r,i,null);Ea(t,r)}return null}function v(i,o,s,l){for(var u=null,c=null,f=o,v=o=0,g=null;null!==f&&v<s.length;v++){f.index>v?(g=f,f=null):g=f.sibling;var y=p(i,f,s[v],l);if(null===y){null===f&&(f=g);break}e&&f&&null===y.alternate&&t(i,f),o=a(y,o,v),null===c?u=y:c.sibling=y,c=y,f=g}if(v===s.length)return n(i,f),u;if(null===f){for(;v<s.length;v++)null!==(f=d(i,s[v],l))&&(o=a(f,o,v),null===c?u=f:c.sibling=f,c=f);return u}for(f=r(i,f);v<s.length;v++)null!==(g=h(f,i,v,s[v],l))&&(e&&null!==g.alternate&&f.delete(null===g.key?v:g.key),o=a(g,o,v),null===c?u=g:c.sibling=g,c=g);return e&&f.forEach((function(e){return t(i,e)})),u}function g(i,s,l,u){var c=B(l);if("function"!=typeof c)throw Error(o(150));if(null==(l=c.call(l)))throw Error(o(151));for(var f=c=null,v=s,g=s=0,y=null,m=l.next();null!==v&&!m.done;g++,m=l.next()){v.index>g?(y=v,v=null):y=v.sibling;var b=p(i,v,m.value,u);if(null===b){null===v&&(v=y);break}e&&v&&null===b.alternate&&t(i,v),s=a(b,s,g),null===f?c=b:f.sibling=b,f=b,v=y}if(m.done)return n(i,v),c;if(null===v){for(;!m.done;g++,m=l.next())null!==(m=d(i,m.value,u))&&(s=a(m,s,g),null===f?c=m:f.sibling=m,f=m);return c}for(v=r(i,v);!m.done;g++,m=l.next())null!==(m=h(v,i,g,m.value,u))&&(e&&null!==m.alternate&&v.delete(null===m.key?g:m.key),s=a(m,s,g),null===f?c=m:f.sibling=m,f=m);return e&&v.forEach((function(e){return t(i,e)})),c}return function(e,r,a,l){var u="object"==typeof a&&null!==a&&a.type===x&&null===a.key;u&&(a=a.props.children);var c="object"==typeof a&&null!==a;if(c)switch(a.$$typeof){case k:e:{for(c=a.key,u=r;null!==u;){if(u.key===c){if(7===u.tag){if(a.type===x){n(e,u.sibling),(r=i(u,a.props.children)).return=e,e=r;break e}}else if(u.elementType===a.type){n(e,u.sibling),(r=i(u,a.props)).ref=ka(e,u,a),r.return=e,e=r;break e}n(e,u);break}t(e,u),u=u.sibling}a.type===x?((r=Yl(a.props.children,e.mode,l,a.key)).return=e,e=r):((l=Kl(a.type,a.key,a.props,null,e.mode,l)).ref=ka(e,r,a),l.return=e,e=l)}return s(e);case E:e:{for(u=a.key;null!==r;){if(r.key===u){if(4===r.tag&&r.stateNode.containerInfo===a.containerInfo&&r.stateNode.implementation===a.implementation){n(e,r.sibling),(r=i(r,a.children||[])).return=e,e=r;break e}n(e,r);break}t(e,r),r=r.sibling}(r=Gl(a,e.mode,l)).return=e,e=r}return s(e)}if("string"==typeof a||"number"==typeof a)return a=""+a,null!==r&&6===r.tag?(n(e,r.sibling),(r=i(r,a)).return=e,e=r):(n(e,r),(r=Jl(a,e.mode,l)).return=e,e=r),s(e);if(wa(a))return v(e,r,a,l);if(B(a))return g(e,r,a,l);if(c&&Ea(e,a),void 0===a&&!u)switch(e.tag){case 1:case 22:case 0:case 11:case 15:throw Error(o(152,K(e.type)||"Component"))}return n(e,r)}}var _a=xa(!0),Ia=xa(!1),Ta={},Ca=li(Ta),Oa=li(Ta),Na=li(Ta);function Ra(e){if(e===Ta)throw Error(o(174));return e}function Da(e,t){switch(ci(Na,t),ci(Oa,e),ci(Ca,Ta),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:pe(null,"");break;default:t=pe(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}ui(Ca),ci(Ca,t)}function Pa(){ui(Ca),ui(Oa),ui(Na)}function Aa(e){Ra(Na.current);var t=Ra(Ca.current),n=pe(t,e.type);t!==n&&(ci(Oa,e),ci(Ca,n))}function Ma(e){Oa.current===e&&(ui(Ca),ui(Oa))}var La=li(0);function Ua(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(64&t.flags)return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ja=null,Va=null,Fa=!1;function za(e,t){var n=Wl(5,null,null,0);n.elementType="DELETED",n.type="DELETED",n.stateNode=t,n.return=e,n.flags=8,null!==e.lastEffect?(e.lastEffect.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n}function Ba(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,!0);default:return!1}}function Ha(e){if(Fa){var t=Va;if(t){var n=t;if(!Ba(e,t)){if(!(t=Kr(n.nextSibling))||!Ba(e,t))return e.flags=-1025&e.flags|2,Fa=!1,void(ja=e);za(ja,n)}ja=e,Va=Kr(t.firstChild)}else e.flags=-1025&e.flags|2,Fa=!1,ja=e}}function Wa(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;ja=e}function qa(e){if(e!==ja)return!1;if(!Fa)return Wa(e),Fa=!0,!1;var t=e.type;if(5!==e.tag||"head"!==t&&"body"!==t&&!Hr(t,e.memoizedProps))for(t=Va;t;)za(e,t),t=Kr(t.nextSibling);if(Wa(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(o(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n){if(0===t){Va=Kr(e.nextSibling);break e}t--}else"$"!==n&&"$!"!==n&&"$?"!==n||t++}e=e.nextSibling}Va=null}}else Va=ja?Kr(e.stateNode.nextSibling):null;return!0}function $a(){Va=ja=null,Fa=!1}var Ka=[];function Ya(){for(var e=0;e<Ka.length;e++)Ka[e]._workInProgressVersionPrimary=null;Ka.length=0}var Qa=w.ReactCurrentDispatcher,Ja=w.ReactCurrentBatchConfig,Ga=0,Xa=null,Za=null,eo=null,to=!1,no=!1;function ro(){throw Error(o(321))}function io(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!ur(e[n],t[n]))return!1;return!0}function ao(e,t,n,r,i,a){if(Ga=a,Xa=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Qa.current=null===e||null===e.memoizedState?Do:Po,e=n(r,i),no){a=0;do{if(no=!1,!(25>a))throw Error(o(301));a+=1,eo=Za=null,t.updateQueue=null,Qa.current=Ao,e=n(r,i)}while(no)}if(Qa.current=Ro,t=null!==Za&&null!==Za.next,Ga=0,eo=Za=Xa=null,to=!1,t)throw Error(o(300));return e}function oo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===eo?Xa.memoizedState=eo=e:eo=eo.next=e,eo}function so(){if(null===Za){var e=Xa.alternate;e=null!==e?e.memoizedState:null}else e=Za.next;var t=null===eo?Xa.memoizedState:eo.next;if(null!==t)eo=t,Za=e;else{if(null===e)throw Error(o(310));e={memoizedState:(Za=e).memoizedState,baseState:Za.baseState,baseQueue:Za.baseQueue,queue:Za.queue,next:null},null===eo?Xa.memoizedState=eo=e:eo=eo.next=e}return eo}function lo(e,t){return"function"==typeof t?t(e):t}function uo(e){var t=so(),n=t.queue;if(null===n)throw Error(o(311));n.lastRenderedReducer=e;var r=Za,i=r.baseQueue,a=n.pending;if(null!==a){if(null!==i){var s=i.next;i.next=a.next,a.next=s}r.baseQueue=i=a,n.pending=null}if(null!==i){i=i.next,r=r.baseState;var l=s=a=null,u=i;do{var c=u.lane;if((Ga&c)===c)null!==l&&(l=l.next={lane:0,action:u.action,eagerReducer:u.eagerReducer,eagerState:u.eagerState,next:null}),r=u.eagerReducer===e?u.eagerState:e(r,u.action);else{var f={lane:c,action:u.action,eagerReducer:u.eagerReducer,eagerState:u.eagerState,next:null};null===l?(s=l=f,a=r):l=l.next=f,Xa.lanes|=c,zs|=c}u=u.next}while(null!==u&&u!==i);null===l?a=r:l.next=s,ur(r,t.memoizedState)||(Lo=!0),t.memoizedState=r,t.baseState=a,t.baseQueue=l,n.lastRenderedState=r}return[t.memoizedState,n.dispatch]}function co(e){var t=so(),n=t.queue;if(null===n)throw Error(o(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,a=t.memoizedState;if(null!==i){n.pending=null;var s=i=i.next;do{a=e(a,s.action),s=s.next}while(s!==i);ur(a,t.memoizedState)||(Lo=!0),t.memoizedState=a,null===t.baseQueue&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function fo(e,t,n){var r=t._getVersion;r=r(t._source);var i=t._workInProgressVersionPrimary;if(null!==i?e=i===r:(e=e.mutableReadLanes,(e=(Ga&e)===e)&&(t._workInProgressVersionPrimary=r,Ka.push(t))),e)return n(t._source);throw Ka.push(t),Error(o(350))}function po(e,t,n,r){var i=Ps;if(null===i)throw Error(o(349));var a=t._getVersion,s=a(t._source),l=Qa.current,u=l.useState((function(){return fo(i,t,n)})),c=u[1],f=u[0];u=eo;var d=e.memoizedState,p=d.refs,h=p.getSnapshot,v=d.source;d=d.subscribe;var g=Xa;return e.memoizedState={refs:p,source:t,subscribe:r},l.useEffect((function(){p.getSnapshot=n,p.setSnapshot=c;var e=a(t._source);if(!ur(s,e)){e=n(t._source),ur(f,e)||(c(e),e=pl(g),i.mutableReadLanes|=e&i.pendingLanes),e=i.mutableReadLanes,i.entangledLanes|=e;for(var r=i.entanglements,o=e;0<o;){var l=31-Ht(o),u=1<<l;r[l]|=e,o&=~u}}}),[n,t,r]),l.useEffect((function(){return r(t._source,(function(){var e=p.getSnapshot,n=p.setSnapshot;try{n(e(t._source));var r=pl(g);i.mutableReadLanes|=r&i.pendingLanes}catch(e){n((function(){throw e}))}}))}),[t,r]),ur(h,n)&&ur(v,t)&&ur(d,r)||((e={pending:null,dispatch:null,lastRenderedReducer:lo,lastRenderedState:f}).dispatch=c=No.bind(null,Xa,e),u.queue=e,u.baseQueue=null,f=fo(i,t,n),u.memoizedState=u.baseState=f),f}function ho(e,t,n){return po(so(),e,t,n)}function vo(e){var t=oo();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={pending:null,dispatch:null,lastRenderedReducer:lo,lastRenderedState:e}).dispatch=No.bind(null,Xa,e),[t.memoizedState,e]}function go(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=Xa.updateQueue)?(t={lastEffect:null},Xa.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function yo(e){return e={current:e},oo().memoizedState=e}function mo(){return so().memoizedState}function bo(e,t,n,r){var i=oo();Xa.flags|=e,i.memoizedState=go(1|t,n,void 0,void 0===r?null:r)}function So(e,t,n,r){var i=so();r=void 0===r?null:r;var a=void 0;if(null!==Za){var o=Za.memoizedState;if(a=o.destroy,null!==r&&io(r,o.deps))return void go(t,n,a,r)}Xa.flags|=e,i.memoizedState=go(1|t,n,a,r)}function wo(e,t){return bo(516,4,e,t)}function ko(e,t){return So(516,4,e,t)}function Eo(e,t){return So(4,2,e,t)}function xo(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function _o(e,t,n){return n=null!=n?n.concat([e]):null,So(4,2,xo.bind(null,t,e),n)}function Io(){}function To(e,t){var n=so();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&io(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Co(e,t){var n=so();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&io(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Oo(e,t){var n=Hi();qi(98>n?98:n,(function(){e(!0)})),qi(97<n?97:n,(function(){var n=Ja.transition;Ja.transition=1;try{e(!1),t()}finally{Ja.transition=n}}))}function No(e,t,n){var r=dl(),i=pl(e),a={lane:i,action:n,eagerReducer:null,eagerState:null,next:null},o=t.pending;if(null===o?a.next=a:(a.next=o.next,o.next=a),t.pending=a,o=e.alternate,e===Xa||null!==o&&o===Xa)no=to=!0;else{if(0===e.lanes&&(null===o||0===o.lanes)&&null!==(o=t.lastRenderedReducer))try{var s=t.lastRenderedState,l=o(s,n);if(a.eagerReducer=o,a.eagerState=l,ur(l,s))return}catch(e){}hl(e,i,r)}}var Ro={readContext:aa,useCallback:ro,useContext:ro,useEffect:ro,useImperativeHandle:ro,useLayoutEffect:ro,useMemo:ro,useReducer:ro,useRef:ro,useState:ro,useDebugValue:ro,useDeferredValue:ro,useTransition:ro,useMutableSource:ro,useOpaqueIdentifier:ro,unstable_isNewReconciler:!1},Do={readContext:aa,useCallback:function(e,t){return oo().memoizedState=[e,void 0===t?null:t],e},useContext:aa,useEffect:wo,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,bo(4,2,xo.bind(null,t,e),n)},useLayoutEffect:function(e,t){return bo(4,2,e,t)},useMemo:function(e,t){var n=oo();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=oo();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e=(e=r.queue={pending:null,dispatch:null,lastRenderedReducer:e,lastRenderedState:t}).dispatch=No.bind(null,Xa,e),[r.memoizedState,e]},useRef:yo,useState:vo,useDebugValue:Io,useDeferredValue:function(e){var t=vo(e),n=t[0],r=t[1];return wo((function(){var t=Ja.transition;Ja.transition=1;try{r(e)}finally{Ja.transition=t}}),[e]),n},useTransition:function(){var e=vo(!1),t=e[0];return yo(e=Oo.bind(null,e[1])),[e,t]},useMutableSource:function(e,t,n){var r=oo();return r.memoizedState={refs:{getSnapshot:t,setSnapshot:null},source:e,subscribe:n},po(r,e,t,n)},useOpaqueIdentifier:function(){if(Fa){var e=!1,t=function(e){return{$$typeof:M,toString:e,valueOf:e}}((function(){throw e||(e=!0,n("r:"+(Qr++).toString(36))),Error(o(355))})),n=vo(t)[1];return!(2&Xa.mode)&&(Xa.flags|=516,go(5,(function(){n("r:"+(Qr++).toString(36))}),void 0,null)),t}return vo(t="r:"+(Qr++).toString(36)),t},unstable_isNewReconciler:!1},Po={readContext:aa,useCallback:To,useContext:aa,useEffect:ko,useImperativeHandle:_o,useLayoutEffect:Eo,useMemo:Co,useReducer:uo,useRef:mo,useState:function(){return uo(lo)},useDebugValue:Io,useDeferredValue:function(e){var t=uo(lo),n=t[0],r=t[1];return ko((function(){var t=Ja.transition;Ja.transition=1;try{r(e)}finally{Ja.transition=t}}),[e]),n},useTransition:function(){var e=uo(lo)[0];return[mo().current,e]},useMutableSource:ho,useOpaqueIdentifier:function(){return uo(lo)[0]},unstable_isNewReconciler:!1},Ao={readContext:aa,useCallback:To,useContext:aa,useEffect:ko,useImperativeHandle:_o,useLayoutEffect:Eo,useMemo:Co,useReducer:co,useRef:mo,useState:function(){return co(lo)},useDebugValue:Io,useDeferredValue:function(e){var t=co(lo),n=t[0],r=t[1];return ko((function(){var t=Ja.transition;Ja.transition=1;try{r(e)}finally{Ja.transition=t}}),[e]),n},useTransition:function(){var e=co(lo)[0];return[mo().current,e]},useMutableSource:ho,useOpaqueIdentifier:function(){return co(lo)[0]},unstable_isNewReconciler:!1},Mo=w.ReactCurrentOwner,Lo=!1;function Uo(e,t,n,r){t.child=null===e?Ia(t,null,n,r):_a(t,e.child,n,r)}function jo(e,t,n,r,i){n=n.render;var a=t.ref;return ia(t,i),r=ao(e,t,n,r,a,i),null===e||Lo?(t.flags|=1,Uo(e,t,r,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-517,e.lanes&=~i,as(e,t,i))}function Vo(e,t,n,r,i,a){if(null===e){var o=n.type;return"function"!=typeof o||ql(o)||void 0!==o.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=Kl(n.type,null,r,t,t.mode,a)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=o,Fo(e,t,o,r,i,a))}return o=e.child,i&a||(i=o.memoizedProps,!(n=null!==(n=n.compare)?n:fr)(i,r)||e.ref!==t.ref)?(t.flags|=1,(e=$l(o,r)).ref=t.ref,e.return=t,t.child=e):as(e,t,a)}function Fo(e,t,n,r,i,a){if(null!==e&&fr(e.memoizedProps,r)&&e.ref===t.ref){if(Lo=!1,!(a&i))return t.lanes=e.lanes,as(e,t,a);16384&e.flags&&(Lo=!0)}return Ho(e,t,n,r,a)}function zo(e,t,n){var r=t.pendingProps,i=r.children,a=null!==e?e.memoizedState:null;if("hidden"===r.mode||"unstable-defer-without-hiding"===r.mode)if(4&t.mode){if(!(1073741824&n))return e=null!==a?a.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e},kl(t,e),null;t.memoizedState={baseLanes:0},kl(t,null!==a?a.baseLanes:n)}else t.memoizedState={baseLanes:0},kl(t,n);else null!==a?(r=a.baseLanes|n,t.memoizedState=null):r=n,kl(t,r);return Uo(e,t,i,n),t.child}function Bo(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=128)}function Ho(e,t,n,r,i){var a=gi(n)?hi:di.current;return a=vi(t,a),ia(t,i),n=ao(e,t,n,r,a,i),null===e||Lo?(t.flags|=1,Uo(e,t,n,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-517,e.lanes&=~i,as(e,t,i))}function Wo(e,t,n,r,i){if(gi(n)){var a=!0;Si(t)}else a=!1;if(ia(t,i),null===t.stateNode)null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),ma(t,n,r),Sa(t,n,r,i),r=!0;else if(null===e){var o=t.stateNode,s=t.memoizedProps;o.props=s;var l=o.context,u=n.contextType;"object"==typeof u&&null!==u?u=aa(u):u=vi(t,u=gi(n)?hi:di.current);var c=n.getDerivedStateFromProps,f="function"==typeof c||"function"==typeof o.getSnapshotBeforeUpdate;f||"function"!=typeof o.UNSAFE_componentWillReceiveProps&&"function"!=typeof o.componentWillReceiveProps||(s!==r||l!==u)&&ba(t,o,r,u),oa=!1;var d=t.memoizedState;o.state=d,da(t,r,o,i),l=t.memoizedState,s!==r||d!==l||pi.current||oa?("function"==typeof c&&(va(t,n,c,r),l=t.memoizedState),(s=oa||ya(t,n,s,r,d,l,u))?(f||"function"!=typeof o.UNSAFE_componentWillMount&&"function"!=typeof o.componentWillMount||("function"==typeof o.componentWillMount&&o.componentWillMount(),"function"==typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount()),"function"==typeof o.componentDidMount&&(t.flags|=4)):("function"==typeof o.componentDidMount&&(t.flags|=4),t.memoizedProps=r,t.memoizedState=l),o.props=r,o.state=l,o.context=u,r=s):("function"==typeof o.componentDidMount&&(t.flags|=4),r=!1)}else{o=t.stateNode,la(e,t),s=t.memoizedProps,u=t.type===t.elementType?s:Ji(t.type,s),o.props=u,f=t.pendingProps,d=o.context,"object"==typeof(l=n.contextType)&&null!==l?l=aa(l):l=vi(t,l=gi(n)?hi:di.current);var p=n.getDerivedStateFromProps;(c="function"==typeof p||"function"==typeof o.getSnapshotBeforeUpdate)||"function"!=typeof o.UNSAFE_componentWillReceiveProps&&"function"!=typeof o.componentWillReceiveProps||(s!==f||d!==l)&&ba(t,o,r,l),oa=!1,d=t.memoizedState,o.state=d,da(t,r,o,i);var h=t.memoizedState;s!==f||d!==h||pi.current||oa?("function"==typeof p&&(va(t,n,p,r),h=t.memoizedState),(u=oa||ya(t,n,u,r,d,h,l))?(c||"function"!=typeof o.UNSAFE_componentWillUpdate&&"function"!=typeof o.componentWillUpdate||("function"==typeof o.componentWillUpdate&&o.componentWillUpdate(r,h,l),"function"==typeof o.UNSAFE_componentWillUpdate&&o.UNSAFE_componentWillUpdate(r,h,l)),"function"==typeof o.componentDidUpdate&&(t.flags|=4),"function"==typeof o.getSnapshotBeforeUpdate&&(t.flags|=256)):("function"!=typeof o.componentDidUpdate||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),"function"!=typeof o.getSnapshotBeforeUpdate||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=256),t.memoizedProps=r,t.memoizedState=h),o.props=r,o.state=h,o.context=l,r=u):("function"!=typeof o.componentDidUpdate||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),"function"!=typeof o.getSnapshotBeforeUpdate||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=256),r=!1)}return qo(e,t,n,r,a,i)}function qo(e,t,n,r,i,a){Bo(e,t);var o=!!(64&t.flags);if(!r&&!o)return i&&wi(t,n,!1),as(e,t,a);r=t.stateNode,Mo.current=t;var s=o&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&o?(t.child=_a(t,e.child,null,a),t.child=_a(t,null,s,a)):Uo(e,t,s,a),t.memoizedState=r.state,i&&wi(t,n,!0),t.child}function $o(e){var t=e.stateNode;t.pendingContext?mi(0,t.pendingContext,t.pendingContext!==t.context):t.context&&mi(0,t.context,!1),Da(e,t.containerInfo)}var Ko,Yo,Qo,Jo,Go={dehydrated:null,retryLane:0};function Xo(e,t,n){var r,i=t.pendingProps,a=La.current,o=!1;return(r=!!(64&t.flags))||(r=(null===e||null!==e.memoizedState)&&!!(2&a)),r?(o=!0,t.flags&=-65):null!==e&&null===e.memoizedState||void 0===i.fallback||!0===i.unstable_avoidThisFallback||(a|=1),ci(La,1&a),null===e?(void 0!==i.fallback&&Ha(t),e=i.children,a=i.fallback,o?(e=Zo(t,e,a,n),t.child.memoizedState={baseLanes:n},t.memoizedState=Go,e):"number"==typeof i.unstable_expectedLoadTime?(e=Zo(t,e,a,n),t.child.memoizedState={baseLanes:n},t.memoizedState=Go,t.lanes=33554432,e):((n=Ql({mode:"visible",children:e},t.mode,n,null)).return=t,t.child=n)):(e.memoizedState,o?(i=ts(e,t,i.children,i.fallback,n),o=t.child,a=e.child.memoizedState,o.memoizedState=null===a?{baseLanes:n}:{baseLanes:a.baseLanes|n},o.childLanes=e.childLanes&~n,t.memoizedState=Go,i):(n=es(e,t,i.children,n),t.memoizedState=null,n))}function Zo(e,t,n,r){var i=e.mode,a=e.child;return t={mode:"hidden",children:t},2&i||null===a?a=Ql(t,i,0,null):(a.childLanes=0,a.pendingProps=t),n=Yl(n,i,r,null),a.return=e,n.return=e,a.sibling=n,e.child=a,n}function es(e,t,n,r){var i=e.child;return e=i.sibling,n=$l(i,{mode:"visible",children:n}),!(2&t.mode)&&(n.lanes=r),n.return=t,n.sibling=null,null!==e&&(e.nextEffect=null,e.flags=8,t.firstEffect=t.lastEffect=e),t.child=n}function ts(e,t,n,r,i){var a=t.mode,o=e.child;e=o.sibling;var s={mode:"hidden",children:n};return 2&a||t.child===o?n=$l(o,s):((n=t.child).childLanes=0,n.pendingProps=s,null!==(o=n.lastEffect)?(t.firstEffect=n.firstEffect,t.lastEffect=o,o.nextEffect=null):t.firstEffect=t.lastEffect=null),null!==e?r=$l(e,r):(r=Yl(r,a,i,null)).flags|=2,r.return=t,n.return=t,n.sibling=r,t.child=n,r}function ns(e,t){e.lanes|=t;var n=e.alternate;null!==n&&(n.lanes|=t),ra(e.return,t)}function rs(e,t,n,r,i,a){var o=e.memoizedState;null===o?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,lastEffect:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.lastEffect=a)}function is(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(Uo(e,t,r.children,n),2&(r=La.current))r=1&r|2,t.flags|=64;else{if(null!==e&&64&e.flags)e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&ns(e,n);else if(19===e.tag)ns(e,n);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ci(La,r),2&t.mode)switch(i){case"forwards":for(n=t.child,i=null;null!==n;)null!==(e=n.alternate)&&null===Ua(e)&&(i=n),n=n.sibling;null===(n=i)?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),rs(t,!1,i,n,a,t.lastEffect);break;case"backwards":for(n=null,i=t.child,t.child=null;null!==i;){if(null!==(e=i.alternate)&&null===Ua(e)){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}rs(t,!0,n,null,a,t.lastEffect);break;case"together":rs(t,!1,null,null,void 0,t.lastEffect);break;default:t.memoizedState=null}else t.memoizedState=null;return t.child}function as(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),zs|=t.lanes,n&t.childLanes){if(null!==e&&t.child!==e.child)throw Error(o(153));if(null!==t.child){for(n=$l(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=$l(e,e.pendingProps)).return=t;n.sibling=null}return t.child}return null}function os(e,t){if(!Fa)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function ss(e,t,n){var r=t.pendingProps;switch(t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return null;case 1:case 17:return gi(t.type)&&yi(),null;case 3:return Pa(),ui(pi),ui(di),Ya(),(r=t.stateNode).pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==e&&null!==e.child||(qa(t)?t.flags|=4:r.hydrate||(t.flags|=256)),Yo(t),null;case 5:Ma(t);var a=Ra(Na.current);if(n=t.type,null!==e&&null!=t.stateNode)Qo(e,t,n,r,a),e.ref!==t.ref&&(t.flags|=128);else{if(!r){if(null===t.stateNode)throw Error(o(166));return null}if(e=Ra(Ca.current),qa(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[Gr]=t,r[Xr]=s,n){case"dialog":Or("cancel",r),Or("close",r);break;case"iframe":case"object":case"embed":Or("load",r);break;case"video":case"audio":for(e=0;e<_r.length;e++)Or(_r[e],r);break;case"source":Or("error",r);break;case"img":case"image":case"link":Or("error",r),Or("load",r);break;case"details":Or("toggle",r);break;case"input":ee(r,s),Or("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},Or("invalid",r);break;case"textarea":le(r,s),Or("invalid",r)}for(var u in Ee(n,s),e=null,s)s.hasOwnProperty(u)&&(a=s[u],"children"===u?"string"==typeof a?r.textContent!==a&&(e=["children",a]):"number"==typeof a&&r.textContent!==""+a&&(e=["children",""+a]):l.hasOwnProperty(u)&&null!=a&&"onScroll"===u&&Or("scroll",r));switch(n){case"input":J(r),re(r,s,!0);break;case"textarea":J(r),ce(r);break;case"select":case"option":break;default:"function"==typeof s.onClick&&(r.onclick=Vr)}r=e,t.updateQueue=r,null!==r&&(t.flags|=4)}else{switch(u=9===a.nodeType?a:a.ownerDocument,e===fe.html&&(e=de(n)),e===fe.html?"script"===n?((e=u.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"==typeof r.is?e=u.createElement(n,{is:r.is}):(e=u.createElement(n),"select"===n&&(u=e,r.multiple?u.multiple=!0:r.size&&(u.size=r.size))):e=u.createElementNS(e,n),e[Gr]=t,e[Xr]=r,Ko(e,t,!1,!1),t.stateNode=e,u=xe(n,r),n){case"dialog":Or("cancel",e),Or("close",e),a=r;break;case"iframe":case"object":case"embed":Or("load",e),a=r;break;case"video":case"audio":for(a=0;a<_r.length;a++)Or(_r[a],e);a=r;break;case"source":Or("error",e),a=r;break;case"img":case"image":case"link":Or("error",e),Or("load",e),a=r;break;case"details":Or("toggle",e),a=r;break;case"input":ee(e,r),a=Z(e,r),Or("invalid",e);break;case"option":a=ae(e,r);break;case"select":e._wrapperState={wasMultiple:!!r.multiple},a=i({},r,{value:void 0}),Or("invalid",e);break;case"textarea":le(e,r),a=se(e,r),Or("invalid",e);break;default:a=r}Ee(n,a);var c=a;for(s in c)if(c.hasOwnProperty(s)){var f=c[s];"style"===s?we(e,f):"dangerouslySetInnerHTML"===s?null!=(f=f?f.__html:void 0)&&ge(e,f):"children"===s?"string"==typeof f?("textarea"!==n||""!==f)&&ye(e,f):"number"==typeof f&&ye(e,""+f):"suppressContentEditableWarning"!==s&&"suppressHydrationWarning"!==s&&"autoFocus"!==s&&(l.hasOwnProperty(s)?null!=f&&"onScroll"===s&&Or("scroll",e):null!=f&&S(e,s,f,u))}switch(n){case"input":J(e),re(e,r,!1);break;case"textarea":J(e),ce(e);break;case"option":null!=r.value&&e.setAttribute("value",""+Y(r.value));break;case"select":e.multiple=!!r.multiple,null!=(s=r.value)?oe(e,!!r.multiple,s,!1):null!=r.defaultValue&&oe(e,!!r.multiple,r.defaultValue,!0);break;default:"function"==typeof a.onClick&&(e.onclick=Vr)}Br(n,r)&&(t.flags|=4)}null!==t.ref&&(t.flags|=128)}return null;case 6:if(e&&null!=t.stateNode)Jo(e,t,e.memoizedProps,r);else{if("string"!=typeof r&&null===t.stateNode)throw Error(o(166));n=Ra(Na.current),Ra(Ca.current),qa(t)?(r=t.stateNode,n=t.memoizedProps,r[Gr]=t,r.nodeValue!==n&&(t.flags|=4)):((r=(9===n.nodeType?n:n.ownerDocument).createTextNode(r))[Gr]=t,t.stateNode=r)}return null;case 13:return ui(La),r=t.memoizedState,64&t.flags?(t.lanes=n,t):(r=null!==r,n=!1,null===e?void 0!==t.memoizedProps.fallback&&qa(t):n=null!==e.memoizedState,r&&!n&&2&t.mode&&(null===e&&!0!==t.memoizedProps.unstable_avoidThisFallback||1&La.current?0===js&&(js=3):(0!==js&&3!==js||(js=4),null===Ps||!(134217727&zs)&&!(134217727&Bs)||ml(Ps,Ms))),(r||n)&&(t.flags|=4),null);case 4:return Pa(),Yo(t),null===e&&Rr(t.stateNode.containerInfo),null;case 10:return na(t),null;case 19:if(ui(La),null===(r=t.memoizedState))return null;if(s=!!(64&t.flags),null===(u=r.rendering))if(s)os(r,!1);else{if(0!==js||null!==e&&64&e.flags)for(e=t.child;null!==e;){if(null!==(u=Ua(e))){for(t.flags|=64,os(r,!1),null!==(s=u.updateQueue)&&(t.updateQueue=s,t.flags|=4),null===r.lastEffect&&(t.firstEffect=null),t.lastEffect=r.lastEffect,r=n,n=t.child;null!==n;)e=r,(s=n).flags&=2,s.nextEffect=null,s.firstEffect=null,s.lastEffect=null,null===(u=s.alternate)?(s.childLanes=0,s.lanes=e,s.child=null,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=u.childLanes,s.lanes=u.lanes,s.child=u.child,s.memoizedProps=u.memoizedProps,s.memoizedState=u.memoizedState,s.updateQueue=u.updateQueue,s.type=u.type,e=u.dependencies,s.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ci(La,1&La.current|2),t.child}e=e.sibling}null!==r.tail&&Bi()>$s&&(t.flags|=64,s=!0,os(r,!1),t.lanes=33554432)}else{if(!s)if(null!==(e=Ua(u))){if(t.flags|=64,s=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.flags|=4),os(r,!0),null===r.tail&&"hidden"===r.tailMode&&!u.alternate&&!Fa)return null!==(t=t.lastEffect=r.lastEffect)&&(t.nextEffect=null),null}else 2*Bi()-r.renderingStartTime>$s&&1073741824!==n&&(t.flags|=64,s=!0,os(r,!1),t.lanes=33554432);r.isBackwards?(u.sibling=t.child,t.child=u):(null!==(n=r.last)?n.sibling=u:t.child=u,r.last=u)}return null!==r.tail?(n=r.tail,r.rendering=n,r.tail=n.sibling,r.lastEffect=t.lastEffect,r.renderingStartTime=Bi(),n.sibling=null,t=La.current,ci(La,s?1&t|2:1&t),n):null;case 23:case 24:return El(),null!==e&&null!==e.memoizedState!=(null!==t.memoizedState)&&"unstable-defer-without-hiding"!==r.mode&&(t.flags|=4),null}throw Error(o(156,t.tag))}function ls(e){switch(e.tag){case 1:gi(e.type)&&yi();var t=e.flags;return 4096&t?(e.flags=-4097&t|64,e):null;case 3:if(Pa(),ui(pi),ui(di),Ya(),64&(t=e.flags))throw Error(o(285));return e.flags=-4097&t|64,e;case 5:return Ma(e),null;case 13:return ui(La),4096&(t=e.flags)?(e.flags=-4097&t|64,e):null;case 19:return ui(La),null;case 4:return Pa(),null;case 10:return na(e),null;case 23:case 24:return El(),null;default:return null}}function us(e,t){try{var n="",r=t;do{n+=$(r),r=r.return}while(r);var i=n}catch(e){i="\nError generating stack: "+e.message+"\n"+e.stack}return{value:e,source:t,stack:i}}function cs(e,t){try{console.error(t.value)}catch(e){setTimeout((function(){throw e}))}}Ko=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Yo=function(){},Qo=function(e,t,n,r){var a=e.memoizedProps;if(a!==r){e=t.stateNode,Ra(Ca.current);var o,s=null;switch(n){case"input":a=Z(e,a),r=Z(e,r),s=[];break;case"option":a=ae(e,a),r=ae(e,r),s=[];break;case"select":a=i({},a,{value:void 0}),r=i({},r,{value:void 0}),s=[];break;case"textarea":a=se(e,a),r=se(e,r),s=[];break;default:"function"!=typeof a.onClick&&"function"==typeof r.onClick&&(e.onclick=Vr)}for(f in Ee(n,r),n=null,a)if(!r.hasOwnProperty(f)&&a.hasOwnProperty(f)&&null!=a[f])if("style"===f){var u=a[f];for(o in u)u.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else"dangerouslySetInnerHTML"!==f&&"children"!==f&&"suppressContentEditableWarning"!==f&&"suppressHydrationWarning"!==f&&"autoFocus"!==f&&(l.hasOwnProperty(f)?s||(s=[]):(s=s||[]).push(f,null));for(f in r){var c=r[f];if(u=null!=a?a[f]:void 0,r.hasOwnProperty(f)&&c!==u&&(null!=c||null!=u))if("style"===f)if(u){for(o in u)!u.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in c)c.hasOwnProperty(o)&&u[o]!==c[o]&&(n||(n={}),n[o]=c[o])}else n||(s||(s=[]),s.push(f,n)),n=c;else"dangerouslySetInnerHTML"===f?(c=c?c.__html:void 0,u=u?u.__html:void 0,null!=c&&u!==c&&(s=s||[]).push(f,c)):"children"===f?"string"!=typeof c&&"number"!=typeof c||(s=s||[]).push(f,""+c):"suppressContentEditableWarning"!==f&&"suppressHydrationWarning"!==f&&(l.hasOwnProperty(f)?(null!=c&&"onScroll"===f&&Or("scroll",e),s||u===c||(s=[])):"object"==typeof c&&null!==c&&c.$$typeof===M?c.toString():(s=s||[]).push(f,c))}n&&(s=s||[]).push("style",n);var f=s;(t.updateQueue=f)&&(t.flags|=4)}},Jo=function(e,t,n,r){n!==r&&(t.flags|=4)};var fs="function"==typeof WeakMap?WeakMap:Map;function ds(e,t,n){(n=ua(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Js||(Js=!0,Gs=r),cs(0,t)},n}function ps(e,t,n){(n=ua(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var i=t.value;n.payload=function(){return cs(0,t),r(i)}}var a=e.stateNode;return null!==a&&"function"==typeof a.componentDidCatch&&(n.callback=function(){"function"!=typeof r&&(null===Xs?Xs=new Set([this]):Xs.add(this),cs(0,t));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}var hs="function"==typeof WeakSet?WeakSet:Set;function vs(e){var t=e.ref;if(null!==t)if("function"==typeof t)try{t(null)}catch(t){Fl(e,t)}else t.current=null}function gs(e,t){switch(t.tag){case 0:case 11:case 15:case 22:case 5:case 6:case 4:case 17:return;case 1:if(256&t.flags&&null!==e){var n=e.memoizedProps,r=e.memoizedState;t=(e=t.stateNode).getSnapshotBeforeUpdate(t.elementType===t.type?n:Ji(t.type,n),r),e.__reactInternalSnapshotBeforeUpdate=t}return;case 3:return void(256&t.flags&&$r(t.stateNode.containerInfo))}throw Error(o(163))}function ys(e,t,n){switch(n.tag){case 0:case 11:case 15:case 22:if(null!==(t=null!==(t=n.updateQueue)?t.lastEffect:null)){e=t=t.next;do{if(!(3&~e.tag)){var r=e.create;e.destroy=r()}e=e.next}while(e!==t)}if(null!==(t=null!==(t=n.updateQueue)?t.lastEffect:null)){e=t=t.next;do{var i=e;r=i.next,4&(i=i.tag)&&1&i&&(Ul(n,e),Ll(n,e)),e=r}while(e!==t)}return;case 1:return e=n.stateNode,4&n.flags&&(null===t?e.componentDidMount():(r=n.elementType===n.type?t.memoizedProps:Ji(n.type,t.memoizedProps),e.componentDidUpdate(r,t.memoizedState,e.__reactInternalSnapshotBeforeUpdate))),void(null!==(t=n.updateQueue)&&pa(n,t,e));case 3:if(null!==(t=n.updateQueue)){if(e=null,null!==n.child)switch(n.child.tag){case 5:case 1:e=n.child.stateNode}pa(n,t,e)}return;case 5:return e=n.stateNode,void(null===t&&4&n.flags&&Br(n.type,n.memoizedProps)&&e.focus());case 6:case 4:case 12:case 19:case 17:case 20:case 21:case 23:case 24:return;case 13:return void(null===n.memoizedState&&(n=n.alternate,null!==n&&(n=n.memoizedState,null!==n&&(n=n.dehydrated,null!==n&&wt(n)))))}throw Error(o(163))}function ms(e,t){for(var n=e;;){if(5===n.tag){var r=n.stateNode;if(t)"function"==typeof(r=r.style).setProperty?r.setProperty("display","none","important"):r.display="none";else{r=n.stateNode;var i=n.memoizedProps.style;i=null!=i&&i.hasOwnProperty("display")?i.display:null,r.style.display=Se("display",i)}}else if(6===n.tag)n.stateNode.nodeValue=t?"":n.memoizedProps;else if((23!==n.tag&&24!==n.tag||null===n.memoizedState||n===e)&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===e)break;for(;null===n.sibling;){if(null===n.return||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}}function bs(e,t){if(Ei&&"function"==typeof Ei.onCommitFiberUnmount)try{Ei.onCommitFiberUnmount(ki,t)}catch(e){}switch(t.tag){case 0:case 11:case 14:case 15:case 22:if(null!==(e=t.updateQueue)&&null!==(e=e.lastEffect)){var n=e=e.next;do{var r=n,i=r.destroy;if(r=r.tag,void 0!==i)if(4&r)Ul(t,n);else{r=t;try{i()}catch(e){Fl(r,e)}}n=n.next}while(n!==e)}break;case 1:if(vs(t),"function"==typeof(e=t.stateNode).componentWillUnmount)try{e.props=t.memoizedProps,e.state=t.memoizedState,e.componentWillUnmount()}catch(e){Fl(t,e)}break;case 5:vs(t);break;case 4:_s(e,t)}}function Ss(e){e.alternate=null,e.child=null,e.dependencies=null,e.firstEffect=null,e.lastEffect=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.return=null,e.updateQueue=null}function ws(e){return 5===e.tag||3===e.tag||4===e.tag}function ks(e){e:{for(var t=e.return;null!==t;){if(ws(t))break e;t=t.return}throw Error(o(160))}var n=t;switch(t=n.stateNode,n.tag){case 5:var r=!1;break;case 3:case 4:t=t.containerInfo,r=!0;break;default:throw Error(o(161))}16&n.flags&&(ye(t,""),n.flags&=-17);e:t:for(n=e;;){for(;null===n.sibling;){if(null===n.return||ws(n.return)){n=null;break e}n=n.return}for(n.sibling.return=n.return,n=n.sibling;5!==n.tag&&6!==n.tag&&18!==n.tag;){if(2&n.flags)continue t;if(null===n.child||4===n.tag)continue t;n.child.return=n,n=n.child}if(!(2&n.flags)){n=n.stateNode;break e}}r?Es(e,n,t):xs(e,n,t)}function Es(e,t,n){var r=e.tag,i=5===r||6===r;if(i)e=i?e.stateNode:e.stateNode.instance,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode).insertBefore(e,n):(t=n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=Vr));else if(4!==r&&null!==(e=e.child))for(Es(e,t,n),e=e.sibling;null!==e;)Es(e,t,n),e=e.sibling}function xs(e,t,n){var r=e.tag,i=5===r||6===r;if(i)e=i?e.stateNode:e.stateNode.instance,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&null!==(e=e.child))for(xs(e,t,n),e=e.sibling;null!==e;)xs(e,t,n),e=e.sibling}function _s(e,t){for(var n,r,i=t,a=!1;;){if(!a){a=i.return;e:for(;;){if(null===a)throw Error(o(160));switch(n=a.stateNode,a.tag){case 5:r=!1;break e;case 3:case 4:n=n.containerInfo,r=!0;break e}a=a.return}a=!0}if(5===i.tag||6===i.tag){e:for(var s=e,l=i,u=l;;)if(bs(s,u),null!==u.child&&4!==u.tag)u.child.return=u,u=u.child;else{if(u===l)break e;for(;null===u.sibling;){if(null===u.return||u.return===l)break e;u=u.return}u.sibling.return=u.return,u=u.sibling}r?(s=n,l=i.stateNode,8===s.nodeType?s.parentNode.removeChild(l):s.removeChild(l)):n.removeChild(i.stateNode)}else if(4===i.tag){if(null!==i.child){n=i.stateNode.containerInfo,r=!0,i.child.return=i,i=i.child;continue}}else if(bs(e,i),null!==i.child){i.child.return=i,i=i.child;continue}if(i===t)break;for(;null===i.sibling;){if(null===i.return||i.return===t)return;4===(i=i.return).tag&&(a=!1)}i.sibling.return=i.return,i=i.sibling}}function Is(e,t){switch(t.tag){case 0:case 11:case 14:case 15:case 22:var n=t.updateQueue;if(null!==(n=null!==n?n.lastEffect:null)){var r=n=n.next;do{!(3&~r.tag)&&(e=r.destroy,r.destroy=void 0,void 0!==e&&e()),r=r.next}while(r!==n)}return;case 1:case 12:case 17:return;case 5:if(null!=(n=t.stateNode)){r=t.memoizedProps;var i=null!==e?e.memoizedProps:r;e=t.type;var a=t.updateQueue;if(t.updateQueue=null,null!==a){for(n[Xr]=r,"input"===e&&"radio"===r.type&&null!=r.name&&te(n,r),xe(e,i),t=xe(e,r),i=0;i<a.length;i+=2){var s=a[i],l=a[i+1];"style"===s?we(n,l):"dangerouslySetInnerHTML"===s?ge(n,l):"children"===s?ye(n,l):S(n,s,l,t)}switch(e){case"input":ne(n,r);break;case"textarea":ue(n,r);break;case"select":e=n._wrapperState.wasMultiple,n._wrapperState.wasMultiple=!!r.multiple,null!=(a=r.value)?oe(n,!!r.multiple,a,!1):e!==!!r.multiple&&(null!=r.defaultValue?oe(n,!!r.multiple,r.defaultValue,!0):oe(n,!!r.multiple,r.multiple?[]:"",!1))}}}return;case 6:if(null===t.stateNode)throw Error(o(162));return void(t.stateNode.nodeValue=t.memoizedProps);case 3:return void((n=t.stateNode).hydrate&&(n.hydrate=!1,wt(n.containerInfo)));case 13:return null!==t.memoizedState&&(qs=Bi(),ms(t.child,!0)),void Ts(t);case 19:return void Ts(t);case 23:case 24:return void ms(t,null!==t.memoizedState)}throw Error(o(163))}function Ts(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new hs),t.forEach((function(t){var r=Bl.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}}function Cs(e,t){return null!==e&&(null===(e=e.memoizedState)||null!==e.dehydrated)&&(null!==(t=t.memoizedState)&&null===t.dehydrated)}var Os=Math.ceil,Ns=w.ReactCurrentDispatcher,Rs=w.ReactCurrentOwner,Ds=0,Ps=null,As=null,Ms=0,Ls=0,Us=li(0),js=0,Vs=null,Fs=0,zs=0,Bs=0,Hs=0,Ws=null,qs=0,$s=1/0;function Ks(){$s=Bi()+500}var Ys,Qs=null,Js=!1,Gs=null,Xs=null,Zs=!1,el=null,tl=90,nl=[],rl=[],il=null,al=0,ol=null,sl=-1,ll=0,ul=0,cl=null,fl=!1;function dl(){return 48&Ds?Bi():-1!==sl?sl:sl=Bi()}function pl(e){if(!(2&(e=e.mode)))return 1;if(!(4&e))return 99===Hi()?1:2;if(0===ll&&(ll=Fs),0!==Qi.transition){0!==ul&&(ul=null!==Ws?Ws.pendingLanes:0),e=ll;var t=4186112&~ul;return 0===(t&=-t)&&(0===(t=(e=4186112&~e)&-e)&&(t=8192)),t}return e=Hi(),4&Ds&&98===e?e=Vt(12,ll):e=Vt(e=function(e){switch(e){case 99:return 15;case 98:return 10;case 97:case 96:return 8;case 95:return 2;default:return 0}}(e),ll),e}function hl(e,t,n){if(50<al)throw al=0,ol=null,Error(o(185));if(null===(e=vl(e,t)))return null;Bt(e,t,n),e===Ps&&(Bs|=t,4===js&&ml(e,Ms));var r=Hi();1===t?8&Ds&&!(48&Ds)?bl(e):(gl(e,n),0===Ds&&(Ks(),Ki())):(!(4&Ds)||98!==r&&99!==r||(null===il?il=new Set([e]):il.add(e)),gl(e,n)),Ws=e}function vl(e,t){e.lanes|=t;var n=e.alternate;for(null!==n&&(n.lanes|=t),n=e,e=e.return;null!==e;)e.childLanes|=t,null!==(n=e.alternate)&&(n.childLanes|=t),n=e,e=e.return;return 3===n.tag?n.stateNode:null}function gl(e,t){for(var n=e.callbackNode,r=e.suspendedLanes,i=e.pingedLanes,a=e.expirationTimes,s=e.pendingLanes;0<s;){var l=31-Ht(s),u=1<<l,c=a[l];if(-1===c){if(!(u&r)||u&i){c=t,Lt(u);var f=Mt;a[l]=10<=f?c+250:6<=f?c+5e3:-1}}else c<=t&&(e.expiredLanes|=u);s&=~u}if(r=Ut(e,e===Ps?Ms:0),t=Mt,0===r)null!==n&&(n!==Li&&Ii(n),e.callbackNode=null,e.callbackPriority=0);else{if(null!==n){if(e.callbackPriority===t)return;n!==Li&&Ii(n)}15===t?(n=bl.bind(null,e),null===ji?(ji=[n],Vi=_i(Ri,Yi)):ji.push(n),n=Li):14===t?n=$i(99,bl.bind(null,e)):(n=function(e){switch(e){case 15:case 14:return 99;case 13:case 12:case 11:case 10:return 98;case 9:case 8:case 7:case 6:case 4:case 5:return 97;case 3:case 2:case 1:return 95;case 0:return 90;default:throw Error(o(358,e))}}(t),n=$i(n,yl.bind(null,e))),e.callbackPriority=t,e.callbackNode=n}}function yl(e){if(sl=-1,ul=ll=0,48&Ds)throw Error(o(327));var t=e.callbackNode;if(Ml()&&e.callbackNode!==t)return null;var n=Ut(e,e===Ps?Ms:0);if(0===n)return null;var r=n,i=Ds;Ds|=16;var a=Il();for(Ps===e&&Ms===r||(Ks(),xl(e,r));;)try{Ol();break}catch(t){_l(e,t)}if(ta(),Ns.current=a,Ds=i,null!==As?r=0:(Ps=null,Ms=0,r=js),Fs&Bs)xl(e,0);else if(0!==r){if(2===r&&(Ds|=64,e.hydrate&&(e.hydrate=!1,$r(e.containerInfo)),0!==(n=jt(e))&&(r=Tl(e,n))),1===r)throw t=Vs,xl(e,0),ml(e,n),gl(e,Bi()),t;switch(e.finishedWork=e.current.alternate,e.finishedLanes=n,r){case 0:case 1:throw Error(o(345));case 2:case 5:Dl(e);break;case 3:if(ml(e,n),(62914560&n)===n&&10<(r=qs+500-Bi())){if(0!==Ut(e,0))break;if(((i=e.suspendedLanes)&n)!==n){dl(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Wr(Dl.bind(null,e),r);break}Dl(e);break;case 4:if(ml(e,n),(4186112&n)===n)break;for(r=e.eventTimes,i=-1;0<n;){var s=31-Ht(n);a=1<<s,(s=r[s])>i&&(i=s),n&=~a}if(n=i,10<(n=(120>(n=Bi()-n)?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Os(n/1960))-n)){e.timeoutHandle=Wr(Dl.bind(null,e),n);break}Dl(e);break;default:throw Error(o(329))}}return gl(e,Bi()),e.callbackNode===t?yl.bind(null,e):null}function ml(e,t){for(t&=~Hs,t&=~Bs,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Ht(t),r=1<<n;e[n]=-1,t&=~r}}function bl(e){if(48&Ds)throw Error(o(327));if(Ml(),e===Ps&&e.expiredLanes&Ms){var t=Ms,n=Tl(e,t);Fs&Bs&&(n=Tl(e,t=Ut(e,t)))}else n=Tl(e,t=Ut(e,0));if(0!==e.tag&&2===n&&(Ds|=64,e.hydrate&&(e.hydrate=!1,$r(e.containerInfo)),0!==(t=jt(e))&&(n=Tl(e,t))),1===n)throw n=Vs,xl(e,0),ml(e,t),gl(e,Bi()),n;return e.finishedWork=e.current.alternate,e.finishedLanes=t,Dl(e),gl(e,Bi()),null}function Sl(e,t){var n=Ds;Ds|=1;try{return e(t)}finally{0===(Ds=n)&&(Ks(),Ki())}}function wl(e,t){var n=Ds;Ds&=-2,Ds|=8;try{return e(t)}finally{0===(Ds=n)&&(Ks(),Ki())}}function kl(e,t){ci(Us,Ls),Ls|=t,Fs|=t}function El(){Ls=Us.current,ui(Us)}function xl(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,qr(n)),null!==As)for(n=As.return;null!==n;){var r=n;switch(r.tag){case 1:null!=(r=r.type.childContextTypes)&&yi();break;case 3:Pa(),ui(pi),ui(di),Ya();break;case 5:Ma(r);break;case 4:Pa();break;case 13:case 19:ui(La);break;case 10:na(r);break;case 23:case 24:El()}n=n.return}Ps=e,As=$l(e.current,null),Ms=Ls=Fs=t,js=0,Vs=null,Hs=Bs=zs=0}function _l(e,t){for(;;){var n=As;try{if(ta(),Qa.current=Ro,to){for(var r=Xa.memoizedState;null!==r;){var i=r.queue;null!==i&&(i.pending=null),r=r.next}to=!1}if(Ga=0,eo=Za=Xa=null,no=!1,Rs.current=null,null===n||null===n.return){js=1,Vs=t,As=null;break}e:{var a=e,o=n.return,s=n,l=t;if(t=Ms,s.flags|=2048,s.firstEffect=s.lastEffect=null,null!==l&&"object"==typeof l&&"function"==typeof l.then){var u=l;if(!(2&s.mode)){var c=s.alternate;c?(s.updateQueue=c.updateQueue,s.memoizedState=c.memoizedState,s.lanes=c.lanes):(s.updateQueue=null,s.memoizedState=null)}var f=!!(1&La.current),d=o;do{var p;if(p=13===d.tag){var h=d.memoizedState;if(null!==h)p=null!==h.dehydrated;else{var v=d.memoizedProps;p=void 0!==v.fallback&&(!0!==v.unstable_avoidThisFallback||!f)}}if(p){var g=d.updateQueue;if(null===g){var y=new Set;y.add(u),d.updateQueue=y}else g.add(u);if(!(2&d.mode)){if(d.flags|=64,s.flags|=16384,s.flags&=-2981,1===s.tag)if(null===s.alternate)s.tag=17;else{var m=ua(-1,1);m.tag=2,ca(s,m)}s.lanes|=1;break e}l=void 0,s=t;var b=a.pingCache;if(null===b?(b=a.pingCache=new fs,l=new Set,b.set(u,l)):void 0===(l=b.get(u))&&(l=new Set,b.set(u,l)),!l.has(s)){l.add(s);var S=zl.bind(null,a,u,s);u.then(S,S)}d.flags|=4096,d.lanes=t;break e}d=d.return}while(null!==d);l=Error((K(s.type)||"A React component")+" suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.")}5!==js&&(js=2),l=us(l,s),d=o;do{switch(d.tag){case 3:a=l,d.flags|=4096,t&=-t,d.lanes|=t,fa(d,ds(0,a,t));break e;case 1:a=l;var w=d.type,k=d.stateNode;if(!(64&d.flags||"function"!=typeof w.getDerivedStateFromError&&(null===k||"function"!=typeof k.componentDidCatch||null!==Xs&&Xs.has(k)))){d.flags|=4096,t&=-t,d.lanes|=t,fa(d,ps(d,a,t));break e}}d=d.return}while(null!==d)}Rl(n)}catch(e){t=e,As===n&&null!==n&&(As=n=n.return);continue}break}}function Il(){var e=Ns.current;return Ns.current=Ro,null===e?Ro:e}function Tl(e,t){var n=Ds;Ds|=16;var r=Il();for(Ps===e&&Ms===t||xl(e,t);;)try{Cl();break}catch(t){_l(e,t)}if(ta(),Ds=n,Ns.current=r,null!==As)throw Error(o(261));return Ps=null,Ms=0,js}function Cl(){for(;null!==As;)Nl(As)}function Ol(){for(;null!==As&&!Ti();)Nl(As)}function Nl(e){var t=Ys(e.alternate,e,Ls);e.memoizedProps=e.pendingProps,null===t?Rl(e):As=t,Rs.current=null}function Rl(e){var t=e;do{var n=t.alternate;if(e=t.return,2048&t.flags){if(null!==(n=ls(t)))return n.flags&=2047,void(As=n);null!==e&&(e.firstEffect=e.lastEffect=null,e.flags|=2048)}else{if(null!==(n=ss(n,t,Ls)))return void(As=n);if(24!==(n=t).tag&&23!==n.tag||null===n.memoizedState||1073741824&Ls||!(4&n.mode)){for(var r=0,i=n.child;null!==i;)r|=i.lanes|i.childLanes,i=i.sibling;n.childLanes=r}null!==e&&!(2048&e.flags)&&(null===e.firstEffect&&(e.firstEffect=t.firstEffect),null!==t.lastEffect&&(null!==e.lastEffect&&(e.lastEffect.nextEffect=t.firstEffect),e.lastEffect=t.lastEffect),1<t.flags&&(null!==e.lastEffect?e.lastEffect.nextEffect=t:e.firstEffect=t,e.lastEffect=t))}if(null!==(t=t.sibling))return void(As=t);As=t=e}while(null!==t);0===js&&(js=5)}function Dl(e){var t=Hi();return qi(99,Pl.bind(null,e,t)),null}function Pl(e,t){do{Ml()}while(null!==el);if(48&Ds)throw Error(o(327));var n=e.finishedWork;if(null===n)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(o(177));e.callbackNode=null;var r=n.lanes|n.childLanes,i=r,a=e.pendingLanes&~i;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=i,e.mutableReadLanes&=i,e.entangledLanes&=i,i=e.entanglements;for(var s=e.eventTimes,l=e.expirationTimes;0<a;){var u=31-Ht(a),c=1<<u;i[u]=0,s[u]=-1,l[u]=-1,a&=~c}if(null!==il&&!(24&r)&&il.has(e)&&il.delete(e),e===Ps&&(As=Ps=null,Ms=0),1<n.flags?null!==n.lastEffect?(n.lastEffect.nextEffect=n,r=n.firstEffect):r=n:r=n.firstEffect,null!==r){if(i=Ds,Ds|=32,Rs.current=null,Fr=Yt,gr(s=vr())){if("selectionStart"in s)l={start:s.selectionStart,end:s.selectionEnd};else e:if(l=(l=s.ownerDocument)&&l.defaultView||window,(c=l.getSelection&&l.getSelection())&&0!==c.rangeCount){l=c.anchorNode,a=c.anchorOffset,u=c.focusNode,c=c.focusOffset;try{l.nodeType,u.nodeType}catch(e){l=null;break e}var f=0,d=-1,p=-1,h=0,v=0,g=s,y=null;t:for(;;){for(var m;g!==l||0!==a&&3!==g.nodeType||(d=f+a),g!==u||0!==c&&3!==g.nodeType||(p=f+c),3===g.nodeType&&(f+=g.nodeValue.length),null!==(m=g.firstChild);)y=g,g=m;for(;;){if(g===s)break t;if(y===l&&++h===a&&(d=f),y===u&&++v===c&&(p=f),null!==(m=g.nextSibling))break;y=(g=y).parentNode}g=m}l=-1===d||-1===p?null:{start:d,end:p}}else l=null;l=l||{start:0,end:0}}else l=null;zr={focusedElem:s,selectionRange:l},Yt=!1,cl=null,fl=!1,Qs=r;do{try{Al()}catch(e){if(null===Qs)throw Error(o(330));Fl(Qs,e),Qs=Qs.nextEffect}}while(null!==Qs);cl=null,Qs=r;do{try{for(s=e;null!==Qs;){var b=Qs.flags;if(16&b&&ye(Qs.stateNode,""),128&b){var S=Qs.alternate;if(null!==S){var w=S.ref;null!==w&&("function"==typeof w?w(null):w.current=null)}}switch(1038&b){case 2:ks(Qs),Qs.flags&=-3;break;case 6:ks(Qs),Qs.flags&=-3,Is(Qs.alternate,Qs);break;case 1024:Qs.flags&=-1025;break;case 1028:Qs.flags&=-1025,Is(Qs.alternate,Qs);break;case 4:Is(Qs.alternate,Qs);break;case 8:_s(s,l=Qs);var k=l.alternate;Ss(l),null!==k&&Ss(k)}Qs=Qs.nextEffect}}catch(e){if(null===Qs)throw Error(o(330));Fl(Qs,e),Qs=Qs.nextEffect}}while(null!==Qs);if(w=zr,S=vr(),b=w.focusedElem,s=w.selectionRange,S!==b&&b&&b.ownerDocument&&hr(b.ownerDocument.documentElement,b)){null!==s&&gr(b)&&(S=s.start,void 0===(w=s.end)&&(w=S),"selectionStart"in b?(b.selectionStart=S,b.selectionEnd=Math.min(w,b.value.length)):(w=(S=b.ownerDocument||document)&&S.defaultView||window).getSelection&&(w=w.getSelection(),l=b.textContent.length,k=Math.min(s.start,l),s=void 0===s.end?k:Math.min(s.end,l),!w.extend&&k>s&&(l=s,s=k,k=l),l=pr(b,k),a=pr(b,s),l&&a&&(1!==w.rangeCount||w.anchorNode!==l.node||w.anchorOffset!==l.offset||w.focusNode!==a.node||w.focusOffset!==a.offset)&&((S=S.createRange()).setStart(l.node,l.offset),w.removeAllRanges(),k>s?(w.addRange(S),w.extend(a.node,a.offset)):(S.setEnd(a.node,a.offset),w.addRange(S))))),S=[];for(w=b;w=w.parentNode;)1===w.nodeType&&S.push({element:w,left:w.scrollLeft,top:w.scrollTop});for("function"==typeof b.focus&&b.focus(),b=0;b<S.length;b++)(w=S[b]).element.scrollLeft=w.left,w.element.scrollTop=w.top}Yt=!!Fr,zr=Fr=null,e.current=n,Qs=r;do{try{for(b=e;null!==Qs;){var E=Qs.flags;if(36&E&&ys(b,Qs.alternate,Qs),128&E){S=void 0;var x=Qs.ref;if(null!==x){var _=Qs.stateNode;Qs.tag,S=_,"function"==typeof x?x(S):x.current=S}}Qs=Qs.nextEffect}}catch(e){if(null===Qs)throw Error(o(330));Fl(Qs,e),Qs=Qs.nextEffect}}while(null!==Qs);Qs=null,Ui(),Ds=i}else e.current=n;if(Zs)Zs=!1,el=e,tl=t;else for(Qs=r;null!==Qs;)t=Qs.nextEffect,Qs.nextEffect=null,8&Qs.flags&&((E=Qs).sibling=null,E.stateNode=null),Qs=t;if(0===(r=e.pendingLanes)&&(Xs=null),1===r?e===ol?al++:(al=0,ol=e):al=0,n=n.stateNode,Ei&&"function"==typeof Ei.onCommitFiberRoot)try{Ei.onCommitFiberRoot(ki,n,void 0,!(64&~n.current.flags))}catch(e){}if(gl(e,Bi()),Js)throw Js=!1,e=Gs,Gs=null,e;return 8&Ds||Ki(),null}function Al(){for(;null!==Qs;){var e=Qs.alternate;fl||null===cl||(8&Qs.flags?Ze(Qs,cl)&&(fl=!0):13===Qs.tag&&Cs(e,Qs)&&Ze(Qs,cl)&&(fl=!0));var t=Qs.flags;256&t&&gs(e,Qs),!(512&t)||Zs||(Zs=!0,$i(97,(function(){return Ml(),null}))),Qs=Qs.nextEffect}}function Ml(){if(90!==tl){var e=97<tl?97:tl;return tl=90,qi(e,jl)}return!1}function Ll(e,t){nl.push(t,e),Zs||(Zs=!0,$i(97,(function(){return Ml(),null})))}function Ul(e,t){rl.push(t,e),Zs||(Zs=!0,$i(97,(function(){return Ml(),null})))}function jl(){if(null===el)return!1;var e=el;if(el=null,48&Ds)throw Error(o(331));var t=Ds;Ds|=32;var n=rl;rl=[];for(var r=0;r<n.length;r+=2){var i=n[r],a=n[r+1],s=i.destroy;if(i.destroy=void 0,"function"==typeof s)try{s()}catch(e){if(null===a)throw Error(o(330));Fl(a,e)}}for(n=nl,nl=[],r=0;r<n.length;r+=2){i=n[r],a=n[r+1];try{var l=i.create;i.destroy=l()}catch(e){if(null===a)throw Error(o(330));Fl(a,e)}}for(l=e.current.firstEffect;null!==l;)e=l.nextEffect,l.nextEffect=null,8&l.flags&&(l.sibling=null,l.stateNode=null),l=e;return Ds=t,Ki(),!0}function Vl(e,t,n){ca(e,t=ds(0,t=us(n,t),1)),t=dl(),null!==(e=vl(e,1))&&(Bt(e,1,t),gl(e,t))}function Fl(e,t){if(3===e.tag)Vl(e,e,t);else for(var n=e.return;null!==n;){if(3===n.tag){Vl(n,e,t);break}if(1===n.tag){var r=n.stateNode;if("function"==typeof n.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===Xs||!Xs.has(r))){var i=ps(n,e=us(t,e),1);if(ca(n,i),i=dl(),null!==(n=vl(n,1)))Bt(n,1,i),gl(n,i);else if("function"==typeof r.componentDidCatch&&(null===Xs||!Xs.has(r)))try{r.componentDidCatch(t,e)}catch(e){}break}}n=n.return}}function zl(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),t=dl(),e.pingedLanes|=e.suspendedLanes&n,Ps===e&&(Ms&n)===n&&(4===js||3===js&&(62914560&Ms)===Ms&&500>Bi()-qs?xl(e,0):Hs|=n),gl(e,t)}function Bl(e,t){var n=e.stateNode;null!==n&&n.delete(t),0===(t=0)&&(2&(t=e.mode)?4&t?(0===ll&&(ll=Fs),0===(t=Ft(62914560&~ll))&&(t=4194304)):t=99===Hi()?1:2:t=1),n=dl(),null!==(e=vl(e,t))&&(Bt(e,t,n),gl(e,n))}function Hl(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.flags=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childLanes=this.lanes=0,this.alternate=null}function Wl(e,t,n,r){return new Hl(e,t,n,r)}function ql(e){return!(!(e=e.prototype)||!e.isReactComponent)}function $l(e,t){var n=e.alternate;return null===n?((n=Wl(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.nextEffect=null,n.firstEffect=null,n.lastEffect=null),n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Kl(e,t,n,r,i,a){var s=2;if(r=e,"function"==typeof e)ql(e)&&(s=1);else if("string"==typeof e)s=5;else e:switch(e){case x:return Yl(n.children,i,a,t);case L:s=8,i|=16;break;case _:s=8,i|=1;break;case I:return(e=Wl(12,n,t,8|i)).elementType=I,e.type=I,e.lanes=a,e;case N:return(e=Wl(13,n,t,i)).type=N,e.elementType=N,e.lanes=a,e;case R:return(e=Wl(19,n,t,i)).elementType=R,e.lanes=a,e;case U:return Ql(n,i,a,t);case j:return(e=Wl(24,n,t,i)).elementType=j,e.lanes=a,e;default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case T:s=10;break e;case C:s=9;break e;case O:s=11;break e;case D:s=14;break e;case P:s=16,r=null;break e;case A:s=22;break e}throw Error(o(130,null==e?e:typeof e,""))}return(t=Wl(s,n,t,i)).elementType=e,t.type=r,t.lanes=a,t}function Yl(e,t,n,r){return(e=Wl(7,e,r,t)).lanes=n,e}function Ql(e,t,n,r){return(e=Wl(23,e,r,t)).elementType=U,e.lanes=n,e}function Jl(e,t,n){return(e=Wl(6,e,null,t)).lanes=n,e}function Gl(e,t,n){return(t=Wl(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Xl(e,t,n){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.pendingContext=this.context=null,this.hydrate=n,this.callbackNode=null,this.callbackPriority=0,this.eventTimes=zt(0),this.expirationTimes=zt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zt(0),this.mutableSourceEagerHydrationData=null}function Zl(e,t,n,r){var i=t.current,a=dl(),s=pl(i);e:if(n){t:{if(Qe(n=n._reactInternals)!==n||1!==n.tag)throw Error(o(170));var l=n;do{switch(l.tag){case 3:l=l.stateNode.context;break t;case 1:if(gi(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break t}}l=l.return}while(null!==l);throw Error(o(171))}if(1===n.tag){var u=n.type;if(gi(u)){n=bi(n,u,l);break e}}n=l}else n=fi;return null===t.context?t.context=n:t.pendingContext=n,(t=ua(a,s)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),ca(i,t),hl(i,s,a),s}function eu(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function tu(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function nu(e,t){tu(e,t),(e=e.alternate)&&tu(e,t)}function ru(e,t,n){var r=null!=n&&null!=n.hydrationOptions&&n.hydrationOptions.mutableSources||null;if(n=new Xl(e,t,null!=n&&!0===n.hydrate),t=Wl(3,null,null,2===t?7:1===t?3:0),n.current=t,t.stateNode=n,sa(t),e[Zr]=n.current,Rr(8===e.nodeType?e.parentNode:e),r)for(e=0;e<r.length;e++){var i=(t=r[e])._getVersion;i=i(t._source),null==n.mutableSourceEagerHydrationData?n.mutableSourceEagerHydrationData=[t,i]:n.mutableSourceEagerHydrationData.push(t,i)}this._internalRoot=n}function iu(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function au(e,t,n,r,i){var a=n._reactRootContainer;if(a){var o=a._internalRoot;if("function"==typeof i){var s=i;i=function(){var e=eu(o);s.call(e)}}Zl(t,o,e,i)}else{if(a=n._reactRootContainer=function(e,t){if(t||(t=!(!(t=e?9===e.nodeType?e.documentElement:e.firstChild:null)||1!==t.nodeType||!t.hasAttribute("data-reactroot"))),!t)for(var n;n=e.lastChild;)e.removeChild(n);return new ru(e,0,t?{hydrate:!0}:void 0)}(n,r),o=a._internalRoot,"function"==typeof i){var l=i;i=function(){var e=eu(o);l.call(e)}}wl((function(){Zl(t,o,e,i)}))}return eu(o)}function ou(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!iu(t))throw Error(o(200));return function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:E,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,t,null,n)}Ys=function(e,t,n){var r=t.lanes;if(null!==e)if(e.memoizedProps!==t.pendingProps||pi.current)Lo=!0;else{if(!(n&r)){switch(Lo=!1,t.tag){case 3:$o(t),$a();break;case 5:Aa(t);break;case 1:gi(t.type)&&Si(t);break;case 4:Da(t,t.stateNode.containerInfo);break;case 10:r=t.memoizedProps.value;var i=t.type._context;ci(Gi,i._currentValue),i._currentValue=r;break;case 13:if(null!==t.memoizedState)return n&t.child.childLanes?Xo(e,t,n):(ci(La,1&La.current),null!==(t=as(e,t,n))?t.sibling:null);ci(La,1&La.current);break;case 19:if(r=!!(n&t.childLanes),64&e.flags){if(r)return is(e,t,n);t.flags|=64}if(null!==(i=t.memoizedState)&&(i.rendering=null,i.tail=null,i.lastEffect=null),ci(La,La.current),r)break;return null;case 23:case 24:return t.lanes=0,zo(e,t,n)}return as(e,t,n)}Lo=!!(16384&e.flags)}else Lo=!1;switch(t.lanes=0,t.tag){case 2:if(r=t.type,null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,i=vi(t,di.current),ia(t,n),i=ao(null,t,r,e,i,n),t.flags|=1,"object"==typeof i&&null!==i&&"function"==typeof i.render&&void 0===i.$$typeof){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,gi(r)){var a=!0;Si(t)}else a=!1;t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,sa(t);var s=r.getDerivedStateFromProps;"function"==typeof s&&va(t,r,s,e),i.updater=ga,t.stateNode=i,i._reactInternals=t,Sa(t,r,e,n),t=qo(null,t,r,!0,a,n)}else t.tag=0,Uo(null,t,i,n),t=t.child;return t;case 16:i=t.elementType;e:{switch(null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,i=(a=i._init)(i._payload),t.type=i,a=t.tag=function(e){if("function"==typeof e)return ql(e)?1:0;if(null!=e){if((e=e.$$typeof)===O)return 11;if(e===D)return 14}return 2}(i),e=Ji(i,e),a){case 0:t=Ho(null,t,i,e,n);break e;case 1:t=Wo(null,t,i,e,n);break e;case 11:t=jo(null,t,i,e,n);break e;case 14:t=Vo(null,t,i,Ji(i.type,e),r,n);break e}throw Error(o(306,i,""))}return t;case 0:return r=t.type,i=t.pendingProps,Ho(e,t,r,i=t.elementType===r?i:Ji(r,i),n);case 1:return r=t.type,i=t.pendingProps,Wo(e,t,r,i=t.elementType===r?i:Ji(r,i),n);case 3:if($o(t),r=t.updateQueue,null===e||null===r)throw Error(o(282));if(r=t.pendingProps,i=null!==(i=t.memoizedState)?i.element:null,la(e,t),da(t,r,null,n),(r=t.memoizedState.element)===i)$a(),t=as(e,t,n);else{if((a=(i=t.stateNode).hydrate)&&(Va=Kr(t.stateNode.containerInfo.firstChild),ja=t,a=Fa=!0),a){if(null!=(e=i.mutableSourceEagerHydrationData))for(i=0;i<e.length;i+=2)(a=e[i])._workInProgressVersionPrimary=e[i+1],Ka.push(a);for(n=Ia(t,null,r,n),t.child=n;n;)n.flags=-3&n.flags|1024,n=n.sibling}else Uo(e,t,r,n),$a();t=t.child}return t;case 5:return Aa(t),null===e&&Ha(t),r=t.type,i=t.pendingProps,a=null!==e?e.memoizedProps:null,s=i.children,Hr(r,i)?s=null:null!==a&&Hr(r,a)&&(t.flags|=16),Bo(e,t),Uo(e,t,s,n),t.child;case 6:return null===e&&Ha(t),null;case 13:return Xo(e,t,n);case 4:return Da(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=_a(t,null,r,n):Uo(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,jo(e,t,r,i=t.elementType===r?i:Ji(r,i),n);case 7:return Uo(e,t,t.pendingProps,n),t.child;case 8:case 12:return Uo(e,t,t.pendingProps.children,n),t.child;case 10:e:{r=t.type._context,i=t.pendingProps,s=t.memoizedProps,a=i.value;var l=t.type._context;if(ci(Gi,l._currentValue),l._currentValue=a,null!==s)if(l=s.value,0===(a=ur(l,a)?0:0|("function"==typeof r._calculateChangedBits?r._calculateChangedBits(l,a):1073741823))){if(s.children===i.children&&!pi.current){t=as(e,t,n);break e}}else for(null!==(l=t.child)&&(l.return=t);null!==l;){var u=l.dependencies;if(null!==u){s=l.child;for(var c=u.firstContext;null!==c;){if(c.context===r&&c.observedBits&a){1===l.tag&&((c=ua(-1,n&-n)).tag=2,ca(l,c)),l.lanes|=n,null!==(c=l.alternate)&&(c.lanes|=n),ra(l.return,n),u.lanes|=n;break}c=c.next}}else s=10===l.tag&&l.type===t.type?null:l.child;if(null!==s)s.return=l;else for(s=l;null!==s;){if(s===t){s=null;break}if(null!==(l=s.sibling)){l.return=s.return,s=l;break}s=s.return}l=s}Uo(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=(a=t.pendingProps).children,ia(t,n),r=r(i=aa(i,a.unstable_observedBits)),t.flags|=1,Uo(e,t,r,n),t.child;case 14:return a=Ji(i=t.type,t.pendingProps),Vo(e,t,i,a=Ji(i.type,a),r,n);case 15:return Fo(e,t,t.type,t.pendingProps,r,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ji(r,i),null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),t.tag=1,gi(r)?(e=!0,Si(t)):e=!1,ia(t,n),ma(t,r,i),Sa(t,r,i,n),qo(null,t,r,!0,e,n);case 19:return is(e,t,n);case 23:case 24:return zo(e,t,n)}throw Error(o(156,t.tag))},ru.prototype.render=function(e){Zl(e,this._internalRoot,null,null)},ru.prototype.unmount=function(){var e=this._internalRoot,t=e.containerInfo;Zl(null,e,null,(function(){t[Zr]=null}))},et=function(e){13===e.tag&&(hl(e,4,dl()),nu(e,4))},tt=function(e){13===e.tag&&(hl(e,67108864,dl()),nu(e,67108864))},nt=function(e){if(13===e.tag){var t=dl(),n=pl(e);hl(e,n,t),nu(e,n)}},rt=function(e,t){return t()},Ie=function(e,t,n){switch(t){case"input":if(ne(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=ii(r);if(!i)throw Error(o(90));G(r),ne(r,i)}}}break;case"textarea":ue(e,n);break;case"select":null!=(t=n.value)&&oe(e,!!n.multiple,t,!1)}},De=Sl,Pe=function(e,t,n,r,i){var a=Ds;Ds|=4;try{return qi(98,e.bind(null,t,n,r,i))}finally{0===(Ds=a)&&(Ks(),Ki())}},Ae=function(){!(49&Ds)&&(function(){if(null!==il){var e=il;il=null,e.forEach((function(e){e.expiredLanes|=24&e.pendingLanes,gl(e,Bi())}))}Ki()}(),Ml())},Me=function(e,t){var n=Ds;Ds|=2;try{return e(t)}finally{0===(Ds=n)&&(Ks(),Ki())}};var su={Events:[ni,ri,ii,Ne,Re,Ml,{current:!1}]},lu={findFiberByHostInstance:ti,bundleType:0,version:"17.0.2",rendererPackageName:"react-dom"},uu={bundleType:lu.bundleType,version:lu.version,rendererPackageName:lu.rendererPackageName,rendererConfig:lu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:w.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=Xe(e))?null:e.stateNode},findFiberByHostInstance:lu.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var cu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!cu.isDisabled&&cu.supportsFiber)try{ki=cu.inject(uu),Ei=cu}catch(ve){}}t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=su,t.createPortal=ou,t.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(o(188));throw Error(o(268,Object.keys(e)))}return e=null===(e=Xe(t))?null:e.stateNode},t.flushSync=function(e,t){var n=Ds;if(48&n)return e(t);Ds|=1;try{if(e)return qi(99,e.bind(null,t))}finally{Ds=n,Ki()}},t.hydrate=function(e,t,n){if(!iu(t))throw Error(o(200));return au(null,e,t,!0,n)},t.render=function(e,t,n){if(!iu(t))throw Error(o(200));return au(null,e,t,!1,n)},t.unmountComponentAtNode=function(e){if(!iu(e))throw Error(o(40));return!!e._reactRootContainer&&(wl((function(){au(null,null,e,!1,(function(){e._reactRootContainer=null,e[Zr]=null}))})),!0)},t.unstable_batchedUpdates=Sl,t.unstable_createPortal=function(e,t){return ou(e,t,2<arguments.length&&void 0!==arguments[2]?arguments[2]:null)},t.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!iu(n))throw Error(o(200));if(null==e||void 0===e._reactInternals)throw Error(o(38));return au(e,t,n,!1,r)},t.version="17.0.2"},887:(e,t,n)=>{"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),e.exports=n(641)},377:(e,t,n)=>{"use strict";var r=n(854),i=60103,a=60106;t.Fragment=60107,t.StrictMode=60108,t.Profiler=60114;var o=60109,s=60110,l=60112;t.Suspense=60113;var u=60115,c=60116;if("function"==typeof Symbol&&Symbol.for){var f=Symbol.for;i=f("react.element"),a=f("react.portal"),t.Fragment=f("react.fragment"),t.StrictMode=f("react.strict_mode"),t.Profiler=f("react.profiler"),o=f("react.provider"),s=f("react.context"),l=f("react.forward_ref"),t.Suspense=f("react.suspense"),u=f("react.memo"),c=f("react.lazy")}var d="function"==typeof Symbol&&Symbol.iterator;function p(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v={};function g(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||h}function y(){}function m(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||h}g.prototype.isReactComponent={},g.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error(p(85));this.updater.enqueueSetState(this,e,t,"setState")},g.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},y.prototype=g.prototype;var b=m.prototype=new y;b.constructor=m,r(b,g.prototype),b.isPureReactComponent=!0;var S={current:null},w=Object.prototype.hasOwnProperty,k={key:!0,ref:!0,__self:!0,__source:!0};function E(e,t,n){var r,a={},o=null,s=null;if(null!=t)for(r in void 0!==t.ref&&(s=t.ref),void 0!==t.key&&(o=""+t.key),t)w.call(t,r)&&!k.hasOwnProperty(r)&&(a[r]=t[r]);var l=arguments.length-2;if(1===l)a.children=n;else if(1<l){for(var u=Array(l),c=0;c<l;c++)u[c]=arguments[c+2];a.children=u}if(e&&e.defaultProps)for(r in l=e.defaultProps)void 0===a[r]&&(a[r]=l[r]);return{$$typeof:i,type:e,key:o,ref:s,props:a,_owner:S.current}}function x(e){return"object"==typeof e&&null!==e&&e.$$typeof===i}var _=/\/+/g;function I(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function T(e,t,n,r,o){var s=typeof e;"undefined"!==s&&"boolean"!==s||(e=null);var l=!1;if(null===e)l=!0;else switch(s){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case i:case a:l=!0}}if(l)return o=o(l=e),e=""===r?"."+I(l,0):r,Array.isArray(o)?(n="",null!=e&&(n=e.replace(_,"$&/")+"/"),T(o,t,n,"",(function(e){return e}))):null!=o&&(x(o)&&(o=function(e,t){return{$$typeof:i,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(o,n+(!o.key||l&&l.key===o.key?"":(""+o.key).replace(_,"$&/")+"/")+e)),t.push(o)),1;if(l=0,r=""===r?".":r+":",Array.isArray(e))for(var u=0;u<e.length;u++){var c=r+I(s=e[u],u);l+=T(s,t,n,c,o)}else if(c=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=d&&e[d]||e["@@iterator"])?e:null}(e),"function"==typeof c)for(e=c.call(e),u=0;!(s=e.next()).done;)l+=T(s=s.value,t,n,c=r+I(s,u++),o);else if("object"===s)throw t=""+e,Error(p(31,"[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t));return l}function C(e,t,n){if(null==e)return e;var r=[],i=0;return T(e,r,"","",(function(e){return t.call(n,e,i++)})),r}function O(e){if(-1===e._status){var t=e._result;t=t(),e._status=0,e._result=t,t.then((function(t){0===e._status&&(t=t.default,e._status=1,e._result=t)}),(function(t){0===e._status&&(e._status=2,e._result=t)}))}if(1===e._status)return e._result;throw e._result}var N={current:null};function R(){var e=N.current;if(null===e)throw Error(p(321));return e}var D={ReactCurrentDispatcher:N,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:S,IsSomeRendererActing:{current:!1},assign:r};t.Children={map:C,forEach:function(e,t,n){C(e,(function(){t.apply(this,arguments)}),n)},count:function(e){var t=0;return C(e,(function(){t++})),t},toArray:function(e){return C(e,(function(e){return e}))||[]},only:function(e){if(!x(e))throw Error(p(143));return e}},t.Component=g,t.PureComponent=m,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=D,t.cloneElement=function(e,t,n){if(null==e)throw Error(p(267,e));var a=r({},e.props),o=e.key,s=e.ref,l=e._owner;if(null!=t){if(void 0!==t.ref&&(s=t.ref,l=S.current),void 0!==t.key&&(o=""+t.key),e.type&&e.type.defaultProps)var u=e.type.defaultProps;for(c in t)w.call(t,c)&&!k.hasOwnProperty(c)&&(a[c]=void 0===t[c]&&void 0!==u?u[c]:t[c])}var c=arguments.length-2;if(1===c)a.children=n;else if(1<c){u=Array(c);for(var f=0;f<c;f++)u[f]=arguments[f+2];a.children=u}return{$$typeof:i,type:e.type,key:o,ref:s,props:a,_owner:l}},t.createContext=function(e,t){return void 0===t&&(t=null),(e={$$typeof:s,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:o,_context:e},e.Consumer=e},t.createElement=E,t.createFactory=function(e){var t=E.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:l,render:e}},t.isValidElement=x,t.lazy=function(e){return{$$typeof:c,_payload:{_status:-1,_result:e},_init:O}},t.memo=function(e,t){return{$$typeof:u,type:e,compare:void 0===t?null:t}},t.useCallback=function(e,t){return R().useCallback(e,t)},t.useContext=function(e,t){return R().useContext(e,t)},t.useDebugValue=function(){},t.useEffect=function(e,t){return R().useEffect(e,t)},t.useImperativeHandle=function(e,t,n){return R().useImperativeHandle(e,t,n)},t.useLayoutEffect=function(e,t){return R().useLayoutEffect(e,t)},t.useMemo=function(e,t){return R().useMemo(e,t)},t.useReducer=function(e,t,n){return R().useReducer(e,t,n)},t.useRef=function(e){return R().useRef(e)},t.useState=function(e){return R().useState(e)},t.version="17.0.2"},766:(e,t,n)=>{"use strict";e.exports=n(377)},449:(e,t)=>{"use strict";var n,r,i,a,o;if("undefined"==typeof window||"function"!=typeof MessageChannel){var s=null,l=null,u=function(){if(null!==s)try{var e=t.unstable_now();s(!0,e),s=null}catch(e){throw setTimeout(u,0),e}},c=Date.now();t.unstable_now=function(){return Date.now()-c},n=function(e){null!==s?setTimeout(n,0,e):(s=e,setTimeout(u,0))},r=function(e,t){l=setTimeout(e,t)},i=function(){clearTimeout(l)},a=function(){return!1},o=t.unstable_forceFrameRate=function(){}}else{var f=window.performance,d=window.Date,p=window.setTimeout,h=window.clearTimeout;if("undefined"!=typeof console){var v=window.cancelAnimationFrame;"function"!=typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!=typeof v&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")}if("object"==typeof f&&"function"==typeof f.now)t.unstable_now=function(){return f.now()};else{var g=d.now();t.unstable_now=function(){return d.now()-g}}var y=!1,m=null,b=-1,S=5,w=0;a=function(){return t.unstable_now()>=w},o=function(){},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing framerates higher than 125 fps is not unsupported"):S=0<e?Math.floor(1e3/e):5};var k=new MessageChannel,E=k.port2;k.port1.onmessage=function(){if(null!==m){var e=t.unstable_now();w=e+S;try{m(!0,e)?E.postMessage(null):(y=!1,m=null)}catch(e){throw E.postMessage(null),e}}else y=!1},n=function(e){m=e,y||(y=!0,E.postMessage(null))},r=function(e,n){b=p((function(){e(t.unstable_now())}),n)},i=function(){h(b),b=-1}}function x(e,t){var n=e.length;e.push(t);e:for(;;){var r=n-1>>>1,i=e[r];if(!(void 0!==i&&0<T(i,t)))break e;e[r]=t,e[n]=i,n=r}}function _(e){return void 0===(e=e[0])?null:e}function I(e){var t=e[0];if(void 0!==t){var n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,i=e.length;r<i;){var a=2*(r+1)-1,o=e[a],s=a+1,l=e[s];if(void 0!==o&&0>T(o,n))void 0!==l&&0>T(l,o)?(e[r]=l,e[s]=n,r=s):(e[r]=o,e[a]=n,r=a);else{if(!(void 0!==l&&0>T(l,n)))break e;e[r]=l,e[s]=n,r=s}}}return t}return null}function T(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var C=[],O=[],N=1,R=null,D=3,P=!1,A=!1,M=!1;function L(e){for(var t=_(O);null!==t;){if(null===t.callback)I(O);else{if(!(t.startTime<=e))break;I(O),t.sortIndex=t.expirationTime,x(C,t)}t=_(O)}}function U(e){if(M=!1,L(e),!A)if(null!==_(C))A=!0,n(j);else{var t=_(O);null!==t&&r(U,t.startTime-e)}}function j(e,n){A=!1,M&&(M=!1,i()),P=!0;var o=D;try{for(L(n),R=_(C);null!==R&&(!(R.expirationTime>n)||e&&!a());){var s=R.callback;if(null!==s){R.callback=null,D=R.priorityLevel;var l=s(R.expirationTime<=n);n=t.unstable_now(),"function"==typeof l?R.callback=l:R===_(C)&&I(C),L(n)}else I(C);R=_(C)}if(null!==R)var u=!0;else{var c=_(O);null!==c&&r(U,c.startTime-n),u=!1}return u}finally{R=null,D=o,P=!1}}function V(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var F=o;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){A||P||(A=!0,n(j))},t.unstable_getCurrentPriorityLevel=function(){return D},t.unstable_getFirstCallbackNode=function(){return _(C)},t.unstable_next=function(e){switch(D){case 1:case 2:case 3:var t=3;break;default:t=D}var n=D;D=t;try{return e()}finally{D=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=F,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=D;D=e;try{return t()}finally{D=n}},t.unstable_scheduleCallback=function(e,a,o){var s=t.unstable_now();if("object"==typeof o&&null!==o){var l=o.delay;l="number"==typeof l&&0<l?s+l:s,o="number"==typeof o.timeout?o.timeout:V(e)}else o=V(e),l=s;return e={id:N++,callback:a,priorityLevel:e,startTime:l,expirationTime:o=l+o,sortIndex:-1},l>s?(e.sortIndex=l,x(O,e),null===_(C)&&e===_(O)&&(M?i():M=!0,r(U,l-s))):(e.sortIndex=o,x(C,e),A||P||(A=!0,n(j))),e},t.unstable_shouldYield=function(){var e=t.unstable_now();L(e);var n=_(C);return n!==R&&null!==R&&null!==n&&null!==n.callback&&n.startTime<=e&&n.expirationTime<R.expirationTime||a()},t.unstable_wrapCallback=function(e){var t=D;return function(){var n=D;D=t;try{return e.apply(this,arguments)}finally{D=n}}}},428:(e,t,n)=>{"use strict";e.exports=n(449)},465:(e,t,n)=>{"use strict";var r=n(766);var i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},a=r.useState,o=r.useEffect,s=r.useLayoutEffect,l=r.useDebugValue;function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch(e){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,c=r[1];return s((function(){i.value=n,i.getSnapshot=t,u(i)&&c({inst:i})}),[e,n,t]),o((function(){return u(i)&&c({inst:i}),e((function(){u(i)&&c({inst:i})}))}),[e]),l(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:c},878:(e,t,n)=>{"use strict";var r=n(766),i=n(178);var a="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=i.useSyncExternalStore,s=r.useRef,l=r.useEffect,u=r.useMemo,c=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var f=s(null);if(null===f.current){var d={hasValue:!1,value:null};f.current=d}else d=f.current;f=u((function(){function e(e){if(!l){if(l=!0,o=e,e=r(e),void 0!==i&&d.hasValue){var t=d.value;if(i(t,e))return s=t}return s=e}if(t=s,a(o,e))return t;var n=r(e);return void 0!==i&&i(t,n)?t:(o=e,s=n)}var o,s,l=!1,u=void 0===n?null:n;return[function(){return e(t())},null===u?void 0:function(){return e(u())}]}),[t,n,r,i]);var p=o(e,f[0],f[1]);return l((function(){d.hasValue=!0,d.value=p}),[p]),c(p),p}},178:(e,t,n)=>{"use strict";e.exports=n(465)},724:(e,t,n)=>{"use strict";e.exports=n(878)},501:e=>{e.exports={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}},557:e=>{"use strict";e.exports=a},713:e=>{"use strict";e.exports=i},2:e=>{"use strict";e.exports=r},838:e=>{"use strict";e.exports=n},438:e=>{"use strict";e.exports=t},307:t=>{"use strict";t.exports=e},333:(e,t,n)=>{"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}n.d(t,{A:()=>r})},833:(e,t,n)=>{"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.d(t,{A:()=>r})},393:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(620);function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(0,r.A)(i.key),i)}}function a(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}},719:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(620);function i(e,t,n){return(t=(0,r.A)(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},757:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(860);function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a,o,s=[],l=!0,u=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return s}}(e,t)||(0,r.A)(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},620:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(888);function i(e){var t=function(e,t){if("object"!=(0,r.A)(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=(0,r.A)(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==(0,r.A)(t)?t:t+""}},888:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n.d(t,{A:()=>r})},860:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(333);function i(e,t){if(e){if("string"==typeof e)return(0,r.A)(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?(0,r.A)(e,t):void 0}}},871:(e,t,n)=>{"use strict";n.d(t,{Bd:()=>_});var r=n(719);var i=n(766),a=n(888);n(501);Object.create(null);function o(){if(console&&console.warn){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];"string"==typeof n[0]&&(n[0]="react-i18next:: ".concat(n[0])),(e=console).warn.apply(e,n)}}var s={};function l(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];"string"==typeof t[0]&&s[t[0]]||("string"==typeof t[0]&&(s[t[0]]=new Date),o.apply(void 0,t))}var u=function(e,t){return function(){if(e.isInitialized)t();else{e.on("initialized",(function n(){setTimeout((function(){e.off("initialized",n)}),0),t()}))}}};function c(e,t,n){e.loadNamespaces(t,u(e,n))}function f(e,t,n,r){"string"==typeof n&&(n=[n]),n.forEach((function(t){e.options.ns.indexOf(t)<0&&e.options.ns.push(t)})),e.loadLanguages(t,u(e,r))}var d=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,p={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},h=function(e){return p[e]};var v,g={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:function(e){return e.replace(d,h)}};var y=n(833),m=n(393);var b=(0,i.createContext)(),S=function(){function e(){(0,y.A)(this,e),this.usedNamespaces={}}return(0,m.A)(e,[{key:"addUsedNamespaces",value:function(e){var t=this;e.forEach((function(e){t.usedNamespaces[e]||(t.usedNamespaces[e]=!0)}))}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),e}();var w=n(757);function k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function E(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?k(Object(n),!0).forEach((function(t){(0,r.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var x=function(e,t){var n=(0,i.useRef)();return(0,i.useEffect)((function(){n.current=t?n.current:e}),[e,t]),n.current};function _(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.i18n,r=(0,i.useContext)(b)||{},o=r.i18n,s=r.defaultNS,u=n||o||v;if(u&&!u.reportNamespaces&&(u.reportNamespaces=new S),!u){l("You will need to pass in an i18next instance by using initReactI18next");var d=function(e,t){return"string"==typeof t?t:t&&"object"===(0,a.A)(t)&&"string"==typeof t.defaultValue?t.defaultValue:Array.isArray(e)?e[e.length-1]:e},p=[d,{},!1];return p.t=d,p.i18n={},p.ready=!1,p}u.options.react&&void 0!==u.options.react.wait&&l("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var h=E(E(E({},g),u.options.react),t),y=h.useSuspense,m=h.keyPrefix,k=e||s||u.options&&u.options.defaultNS;k="string"==typeof k?[k]:k||["translation"],u.reportNamespaces.addUsedNamespaces&&u.reportNamespaces.addUsedNamespaces(k);var _=(u.isInitialized||u.initializedStoreOnce)&&k.every((function(e){return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t.languages&&t.languages.length?void 0!==t.options.ignoreJSONStructure?t.hasLoadedNamespace(e,{lng:n.lng,precheck:function(t,r){if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!r(t.isLanguageChangingTo,e))return!1}}):function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=t.languages[0],i=!!t.options&&t.options.fallbackLng,a=t.languages[t.languages.length-1];if("cimode"===r.toLowerCase())return!0;var o=function(e,n){var r=t.services.backendConnector.state["".concat(e,"|").concat(n)];return-1===r||2===r};return!(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!o(t.isLanguageChangingTo,e)||!t.hasResourceBundle(r,e)&&t.services.backendConnector.backend&&(!t.options.resources||t.options.partialBundledLanguages)&&(!o(r,e)||i&&!o(a,e)))}(e,t,n):(l("i18n.languages were undefined or empty",t.languages),!0)}(e,u,h)}));function I(){return u.getFixedT(t.lng||null,"fallback"===h.nsMode?k:k[0],m)}var T=(0,i.useState)(I),C=(0,w.A)(T,2),O=C[0],N=C[1],R=k.join();t.lng&&(R="".concat(t.lng).concat(R));var D=x(R),P=(0,i.useRef)(!0);(0,i.useEffect)((function(){var e=h.bindI18n,n=h.bindI18nStore;function r(){P.current&&N(I)}return P.current=!0,_||y||(t.lng?f(u,t.lng,k,(function(){P.current&&N(I)})):c(u,k,(function(){P.current&&N(I)}))),_&&D&&D!==R&&P.current&&N(I),e&&u&&u.on(e,r),n&&u&&u.store.on(n,r),function(){P.current=!1,e&&u&&e.split(" ").forEach((function(e){return u.off(e,r)})),n&&u&&n.split(" ").forEach((function(e){return u.store.off(e,r)}))}}),[u,R]);var A=(0,i.useRef)(!0);(0,i.useEffect)((function(){P.current&&!A.current&&N(I),A.current=!1}),[u,m]);var M=[O,u,_];if(M.t=O,M.i18n=u,M.ready=_,_)return M;if(!_&&!y)return M;throw new Promise((function(e){t.lng?f(u,t.lng,k,(function(){return e()})):c(u,k,(function(){return e()}))}))}}},f={};function d(e){var t=f[e];if(void 0!==t)return t.exports;var n=f[e]={exports:{}};return c[e](n,n.exports,d),n.exports}d.m=c,o=[],d.O=(e,t,n,r)=>{if(!t){var i=1/0;for(u=0;u<o.length;u++){for(var[t,n,r]=o[u],a=!0,s=0;s<t.length;s++)(!1&r||i>=r)&&Object.keys(d.O).every((e=>d.O[e](t[s])))?t.splice(s--,1):(a=!1,r<i&&(i=r));if(a){o.splice(u--,1);var l=n();void 0!==l&&(e=l)}}return e}r=r||0;for(var u=o.length;u>0&&o[u-1][2]>r;u--)o[u]=o[u-1];o[u]=[t,n,r]},d.F={},d.E=e=>{Object.keys(d.F).map((t=>{d.F[t](e)}))},d.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return d.d(t,{a:t}),t},l=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,d.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var n=Object.create(null);d.r(n);var r={};s=s||[null,l({}),l([]),l(l)];for(var i=2&t&&e;"object"==typeof i&&!~s.indexOf(i);i=l(i))Object.getOwnPropertyNames(i).forEach((t=>r[t]=()=>e[t]));return r.default=()=>e,d.d(n,r),n},d.d=(e,t)=>{for(var n in t)d.o(t,n)&&!d.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},d.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),d.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),d.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},u={524:0},d.F.j=e=>{if(!d.o(u,e)||void 0===u[e]){u[e]=null;var t=document.createElement("link");d.nc&&t.setAttribute("nonce",d.nc),t.rel="prefetch",t.as="script",t.href=d.p+d.u(e),document.head.appendChild(t)}},d.O.j=e=>0===u[e],d.O(0,[524],(()=>{d.E(524)}),5);var p={};return(()=>{"use strict";d.r(p),d.d(p,{default:()=>fe});var e,t=d(597),n=d(766),r=d.t(n,2),i=d(374),a=d.n(i),o=d(887),s=d.t(o,2);function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l.apply(this,arguments)}!function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(e||(e={}));function u(e,t){if(!1===e||null==e)throw new Error(t)}function c(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}var f;!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(f||(f={}));new Set(["lazy","caseSensitive","path","id","index","children"]);function h(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the `to."+n+'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.'}function v(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}function g(e,t){let n=v(e);return t?n.map(((t,n)=>n===e.length-1?t.pathname:t.pathnameBase)):n.map((e=>e.pathnameBase))}function y(e,t,n,r){let i;void 0===r&&(r=!1),"string"==typeof e?i=c(e):(i=l({},e),u(!i.pathname||!i.pathname.includes("?"),h("?","pathname","search",i)),u(!i.pathname||!i.pathname.includes("#"),h("#","pathname","hash",i)),u(!i.search||!i.search.includes("#"),h("#","search","hash",i)));let a,o=""===e||""===i.pathname,s=o?"/":i.pathname;if(null==s)a=n;else{let e=t.length-1;if(!r&&s.startsWith("..")){let t=s.split("/");for(;".."===t[0];)t.shift(),e-=1;i.pathname=t.join("/")}a=e>=0?t[e]:"/"}let f=function(e,t){void 0===t&&(t="/");let{pathname:n,search:r="",hash:i=""}="string"==typeof e?c(e):e,a=n?n.startsWith("/")?n:function(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)})),n.length>1?n.join("/"):"/"}(n,t):t;return{pathname:a,search:b(r),hash:S(i)}}(i,a),d=s&&"/"!==s&&s.endsWith("/"),p=(o||"."===s)&&n.endsWith("/");return f.pathname.endsWith("/")||!d&&!p||(f.pathname+="/"),f}const m=e=>e.join("/").replace(/\/\/+/g,"/"),b=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",S=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";Error;const w=["post","put","patch","delete"],k=(new Set(w),["get",...w]);new Set(k),new Set([301,302,303,307,308]),new Set([307,308]);Symbol("deferred");function E(){return E=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},E.apply(this,arguments)}const x=n.createContext(null);const _=n.createContext(null);const I=n.createContext(null);const T=n.createContext({outlet:null,matches:[],isDataRoute:!1});function C(){return null!=n.useContext(I)}function O(){return C()||u(!1),n.useContext(I).location}function N(e){n.useContext(_).static||n.useLayoutEffect(e)}function R(){let{isDataRoute:e}=n.useContext(T);return e?function(){let{router:e}=A(D.UseNavigateStable),t=M(P.UseNavigateStable),r=n.useRef(!1);N((()=>{r.current=!0}));let i=n.useCallback((function(n,i){void 0===i&&(i={}),r.current&&("number"==typeof n?e.navigate(n):e.navigate(n,E({fromRouteId:t},i)))}),[e,t]);return i}():function(){C()||u(!1);let e=n.useContext(x),{basename:t,future:r,navigator:i}=n.useContext(_),{matches:a}=n.useContext(T),{pathname:o}=O(),s=JSON.stringify(g(a,r.v7_relativeSplatPath)),l=n.useRef(!1);return N((()=>{l.current=!0})),n.useCallback((function(n,r){if(void 0===r&&(r={}),!l.current)return;if("number"==typeof n)return void i.go(n);let a=y(n,JSON.parse(s),o,"path"===r.relative);null==e&&"/"!==t&&(a.pathname="/"===a.pathname?t:m([t,a.pathname])),(r.replace?i.replace:i.push)(a,r.state,r)}),[t,i,s,o,e])}()}n.Component;var D=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(D||{}),P=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(P||{});function A(e){let t=n.useContext(x);return t||u(!1),t}function M(e){let t=function(e){let t=n.useContext(T);return t||u(!1),t}(),r=t.matches[t.matches.length-1];return r.route.id||u(!1),r.route.id}r.startTransition;new Promise((()=>{}));n.Component;new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);try{window.__reactRouterVersion="6"}catch(e){}new Map;r.startTransition,s.flushSync,r.useId;"undefined"!=typeof window&&void 0!==window.document&&window.document.createElement;var L,U;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(L||(L={})),function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(U||(U={}));var j=d(871),V=d(2),F=d(307);const{formatDate:z}=V.utils;function B({servicesManager:e,getImageSrc:r,getStudiesForPatientByMRN:i,requestDisplaySetCreationForStudy:a,dataSource:o}){const{displaySetService:s,uiDialogService:l,hangingProtocolService:u,uiNotificationService:c,measurementService:f}=e.services,d=R(),{t:p}=(0,j.Bd)("Common"),{StudyInstanceUIDs:h}=(0,F.useImageViewer)(),[{activeViewportId:v,viewports:g,isHangingProtocolLayout:y},m]=(0,F.useViewportGrid)(),[b,S]=(0,t.B)(),[w,k]=(0,n.useState)("primary"),[E,x]=(0,n.useState)([...h]),[_,I]=(0,n.useState)([]),[T,C]=(0,n.useState)([]),[O,N]=(0,n.useState)({}),[D,P]=(0,n.useState)(null),A=g.get(v)?.displaySetInstanceUIDs,{trackedSeries:M}=b.context;(0,n.useEffect)((()=>{h.forEach((e=>async function(e){const t=await o.query.studies.search({studyInstanceUid:e});if(!t?.length)throw d("/notfoundstudy","_self"),new Error("Invalid study URL");let n=t;try{n=await i(t)}catch(e){console.warn(e)}const r=n.map((e=>({AccessionNumber:e.accession,StudyDate:e.date,StudyDescription:e.description,NumInstances:e.instances,ModalitiesInStudy:e.modalities,PatientID:e.mrn,PatientName:e.patientName,StudyInstanceUID:e.studyInstanceUid,StudyTime:e.time}))).map((e=>({studyInstanceUid:e.StudyInstanceUID,date:z(e.StudyDate)||p("NoStudyDate"),description:e.StudyDescription,modalities:e.ModalitiesInStudy,numInstances:e.NumInstances})));I((e=>{const t=[...e];for(const n of r)e.find((e=>e.studyInstanceUid===n.studyInstanceUid))||t.push(n);return t}))}(e)))}),[h,i]),(0,n.useEffect)((()=>{const e=s.activeDisplaySets;e.length&&e.forEach((async e=>{const t={},n=s.getDisplaySetByUID(e.displaySetInstanceUID),i=W(n,o.getImageIdsForDisplaySet(n));i&&!n?.unsupported&&(t[e.displaySetInstanceUID]=await r(i),N((e=>({...e,...t}))))}))}),[s,o,r]),(0,n.useEffect)((()=>{const e=s.activeDisplaySets;if(!e.length)return;const t=q(e,O,M,g,m,o,s,l,c);C(t)}),[s.activeDisplaySets,M,g,o,O]),(0,n.useEffect)((()=>{const e=s.subscribe(s.EVENTS.DISPLAY_SETS_ADDED,(e=>{const{displaySetsAdded:t,options:n}=e;t.forEach((async e=>{const t=e.displaySetInstanceUID,i={},a=s.getDisplaySetByUID(t);if(a?.unsupported)return;n.madeInClient&&P(t);const l=W(a,o.getImageIdsForDisplaySet(a));l&&(i[t]=await r(l),N((e=>({...e,...i}))))}))}));return()=>{e.unsubscribe()}}),[s,o,r,O,M,g]),(0,n.useEffect)((()=>{const e=s.subscribe(s.EVENTS.DISPLAY_SETS_CHANGED,(e=>{const t=q(e,O,M,g,m,o,s,l,c);C(t)})),t=s.subscribe(s.EVENTS.DISPLAY_SET_SERIES_METADATA_INVALIDATED,(()=>{const e=q(s.getActiveDisplaySets(),O,M,g,m,o,s,l,c);C(e)}));return()=>{e.unsubscribe(),t.unsubscribe()}}),[O,M,g,o,s]);const L=function(e,t,n,r){const i=[],a=[],o=[];t.forEach((t=>{const s=n.filter((e=>e.StudyInstanceUID===t.studyInstanceUid)),l=r.getDisplaySetSortFunction();s.sort(l);const u=Object.assign({},t,{displaySets:s});e.includes(t.studyInstanceUid)?(i.push(u),o.push(u)):(a.push(u),o.push(u))}));const s=(e,t)=>{const n=Date.parse(e);return Date.parse(t)-n},l=[{name:"primary",label:"Primary",studies:i.sort(((e,t)=>s(e.date,t.date)))},{name:"recent",label:"Recent",studies:a.sort(((e,t)=>s(e.date,t.date)))},{name:"all",label:"All",studies:o.sort(((e,t)=>s(e.date,t.date)))}];return l}(h,_,T,u);(0,n.useEffect)((()=>{if(D){const e=D,t=document.getElementById(`thumbnail-${e}`);t&&"function"==typeof t.scrollIntoView&&(t.scrollIntoView({behavior:"smooth"}),P(null))}}),[D,E,w]),(0,n.useEffect)((()=>{if(!D)return;const e=function(e,t){for(let n=0;n<t.length;n++){const{studies:r}=t[n];for(let i=0;i<r.length;i++){const{displaySets:a}=r[i];for(let o=0;o<a.length;o++){if(a[o].displaySetInstanceUID===e)return{tabName:t[n].name,StudyInstanceUID:r[i].studyInstanceUid}}}}}(D,L);if(!e)return void console.warn("jumpToThumbnail: displaySet thumbnail not found.");const{tabName:t,StudyInstanceUID:n}=e;k(t);if(!E.includes(n)){const e=[...E,n];x(e)}}),[E,D,L]);const U=e=>{l.create({id:"untrack-series",centralize:!0,isDraggable:!1,showOverlay:!0,content:F.Dialog,contentProps:{title:"Untrack Series",body:()=>n.createElement("div",{className:"bg-primary-dark p-4 text-white"},n.createElement("p",null,"Are you sure you want to untrack this series?"),n.createElement("p",{className:"mt-2"},"This action cannot be undone and will delete all your existing measurements.")),actions:[{id:"cancel",text:"Cancel",type:F.ButtonEnums.type.secondary},{id:"yes",text:"Yes",type:F.ButtonEnums.type.primary,classes:["untrack-yes-button"]}],onClose:()=>l.dismiss({id:"untrack-series"}),onSubmit:async({action:t})=>{switch(t.id){case"yes":(()=>{const t=s.getDisplaySetByUID(e);S("UNTRACK_SERIES",{SeriesInstanceUID:t.SeriesInstanceUID}),f.getMeasurements().forEach((e=>{e.referenceSeriesUID===t.SeriesInstanceUID&&f.remove(e.uid)}))})(),l.dismiss({id:"untrack-series"});break;case"cancel":l.dismiss({id:"untrack-series"})}}}})};return n.createElement(F.StudyBrowser,{tabs:L,servicesManager:e,activeTabName:w,expandedStudyInstanceUIDs:E,onClickStudy:function(e){const t=E.includes(e),n=t?[...E.filter((t=>t!==e))]:[...E,e];if(x(n),!t){a(s,e,!0)}},onClickTab:e=>{k(e)},onClickUntrack:e=>{U(e)},onClickThumbnail:()=>{},onDoubleClickThumbnail:e=>{let t=[];const n=v;try{t=u.getViewportsRequireUpdate(n,e,y)}catch(e){console.warn(e),c.show({title:"Thumbnail Double Click",message:"The selected display sets could not be added to the viewport due to a mismatch in the Hanging Protocol rules.",type:"info",duration:3e3})}m.setDisplaySetsForViewports(t)},activeDisplaySetInstanceUIDs:A})}B.propTypes={servicesManager:a().object.isRequired,dataSource:a().shape({getImageIdsForDisplaySet:a().func.isRequired}).isRequired,getImageSrc:a().func.isRequired,getStudiesForPatientByMRN:a().func.isRequired,requestDisplaySetCreationForStudy:a().func.isRequired};const H=B;function W(e,t){let n;if(e.isDynamicVolume){const t=e.dynamicVolumeInfo.timePoints,r=t[Math.floor(t.length/2)];n=r[Math.floor(r.length/2)]}else n=t[Math.floor(t.length/2)];return n}function q(e,t,r,i,a,o,s,l,u){const c=[],f=[];return e.filter((e=>!e.excludeFromThumbnailBrowser)).forEach((e=>{const i=t[e.displaySetInstanceUID],d=function(e){if($.includes(e.Modality)||e?.unsupported)return"thumbnailNoImage";return"thumbnailTracked"}(e),p=(a.getNumViewportPanes(),"thumbnailTracked"===d?c:f),{displaySetInstanceUID:h}=e,v={displaySetInstanceUID:h,description:e.SeriesDescription,seriesNumber:e.SeriesNumber,modality:e.Modality,seriesDate:z(e.SeriesDate),numInstances:e.numImageFrames,countIcon:e.countIcon,messages:e.messages,StudyInstanceUID:e.StudyInstanceUID,componentType:d,imageSrc:i,dragData:{type:"displayset",displaySetInstanceUID:h},isTracked:r.includes(e.SeriesInstanceUID),isHydratedForDerivedDisplaySet:e.isHydrated};"thumbnailNoImage"===d&&(o.reject&&o.reject.series?(v.canReject=!e?.unsupported,v.onReject=()=>{l.create({id:"ds-reject-sr",centralize:!0,isDraggable:!1,showOverlay:!0,content:F.Dialog,contentProps:{title:"Delete Report",body:()=>n.createElement("div",{className:"bg-primary-dark p-4 text-white"},n.createElement("p",null,"Are you sure you want to delete this report?"),n.createElement("p",{className:"mt-2"},"This action cannot be undone.")),actions:[{id:"cancel",text:"Cancel",type:F.ButtonEnums.type.secondary},{id:"yes",text:"Yes",type:F.ButtonEnums.type.primary,classes:["reject-yes-button"]}],onClose:()=>l.dismiss({id:"ds-reject-sr"}),onShow:()=>{document.querySelector(".reject-yes-button").focus()},onSubmit:async({action:t})=>{switch(t.id){case"yes":try{await o.reject.series(e.StudyInstanceUID,e.SeriesInstanceUID),s.deleteDisplaySet(h),l.dismiss({id:"ds-reject-sr"}),u.show({title:"Delete Report",message:"Report deleted successfully",type:"success"})}catch(e){l.dismiss({id:"ds-reject-sr"}),u.show({title:"Delete Report",message:"Failed to delete report",type:"error"})}break;case"cancel":l.dismiss({id:"ds-reject-sr"})}}}})}):v.canReject=!1),p.push(v)})),[...c,...f]}const $=["SR","SEG","SM","RTSTRUCT","RTPLAN","RTDOSE","DOC","OT"];const K=function(e,t){return new Promise(((n,r)=>{const i=document.createElement("canvas");e.utilities.loadImageToCanvas({canvas:i,imageId:t,thumbnail:!0}).then((e=>{n(i.toDataURL())})).catch(r)}))};const Y=function(e,t,n,r){t.activeDisplaySets.some((e=>e.StudyInstanceUID===n))||e.retrieve.series.metadata({StudyInstanceUID:n,madeInClient:r})};function Q({commandsManager:e,extensionManager:t,servicesManager:r}){const i=t.getActiveDataSource()[0],a=function(e){const t=e.getModuleEntry("@ohif/extension-default.utilityModule.common"),{getStudiesForPatientByMRN:n}=t.exports;return n}(t),o=a.bind(null,i),s=(0,n.useCallback)(function(e){const t=e.getModuleEntry("@ohif/extension-cornerstone.utilityModule.common");try{const{cornerstone:e}=t.exports.getCornerstoneLibraries();return K.bind(null,e)}catch(e){throw new Error("Required command not found")}}(t),[]),l=Y.bind(null,i);return n.createElement(H,{servicesManager:r,dataSource:i,getImageSrc:s,getStudiesForPatientByMRN:o,requestDisplaySetCreationForStudy:l})}Q.propTypes={commandsManager:a().object.isRequired,extensionManager:a().object.isRequired,servicesManager:a().object.isRequired};const J=Q;var G=d(497),X=d(771),Z=d.n(X);const{downloadCSVReport:ee}=V.utils,{formatDate:te}=V.utils,ne={key:void 0,date:"",modality:"",description:""};function re({servicesManager:e,extensionManager:r}){const[i]=(0,F.useViewportGrid)(),{t:a}=(0,j.Bd)("MeasurementTable"),[o,s]=(0,n.useState)(Date.now().toString()),l=function(e,t){const[r,i]=(0,n.useState)(e);return(0,n.useEffect)((()=>{const n=setTimeout((()=>{i(e)}),t);return()=>{clearTimeout(n)}}),[e,t]),r}(o,200),{measurementService:u,uiDialogService:c,displaySetService:f,customizationService:d}=e.services,[p,h]=(0,t.B)(),{trackedStudy:v,trackedSeries:g}=p.context,[y,m]=(0,n.useState)(ne),[b,S]=(0,n.useState)([]),w=(0,n.useRef)(null),[k]=(0,G.r)();(0,n.useEffect)((()=>{const e=u.getMeasurements().filter((e=>v===e.referenceStudyUID&&g.includes(e.referenceSeriesUID))).map((e=>function(e,t,n){const{referenceStudyUID:r,referenceSeriesUID:i,SOPInstanceUID:a}=e,o=(V.DicomMetadataStore.getInstance(r,i,a),n.getDisplaySetsForSeries(i));if(!o[0]||!o[0].images)throw new Error('The tracked measurements panel should only be tracking "stack" displaySets.');const{displayText:s,uid:l,label:u,type:c,selected:f,findingSites:d,finding:p}=e,h=d?.[0],v=u||p?.text||h?.text||"(empty)";let g=s||[];if(d){const e=[];d.forEach((t=>{t?.text!==v&&e.push(t.text)})),g=[...e,...g]}p&&p?.text!==v&&(g=[p.text,...g]);return{uid:l,label:v,baseLabel:u,measurementType:c,displayText:g,baseDisplayText:s,isActive:f,finding:p,findingSites:d}}(e,u.VALUE_TYPES,f)));S(e)}),[u,v,g,l]);const E=async()=>{if(p.matches("tracking")){const e=v,t=V.DicomMetadataStore.getStudy(e),n=t.series[0].instances[0],{StudyDate:r,StudyDescription:i}=n,a=new Set;t.series.forEach((e=>{g.includes(e.SeriesInstanceUID)&&a.add(e.instances[0].Modality)}));const o=Array.from(a).join("/");y.key!==e&&m({key:e,date:r,modality:o,description:i})}else""!==v&&void 0!==v||m(ne)};(0,n.useEffect)((()=>{E()}),[y.key,p,v,E]),(0,n.useEffect)((()=>{const e=u.EVENTS.MEASUREMENT_ADDED,t=u.EVENTS.RAW_MEASUREMENT_ADDED,n=u.EVENTS.MEASUREMENT_UPDATED,r=u.EVENTS.MEASUREMENT_REMOVED,i=u.EVENTS.MEASUREMENTS_CLEARED,a=[];return[e,t,n,r,i].forEach((t=>{a.push(u.subscribe(t,(()=>{s(Date.now().toString()),t===e&&Z()((()=>{w.current.scrollTop=w.current.scrollHeight}),300)()})).unsubscribe)})),()=>{a.forEach((e=>{e()}))}}),[u,h]);const x=({uid:e,isActive:t})=>{u.jumpToMeasurement(i.activeViewportId,e),I({uid:e,isActive:t})},_=({uid:e,isActive:t})=>{x({uid:e,isActive:t});const n=d.get("measurementLabels"),i=u.getMeasurement(e),a=r.getModuleEntry("@ohif/extension-cornerstone.utilityModule.common"),{showLabelAnnotationPopup:o}=a.exports;o(i,c,n).then((t=>{u.update(e,{...t},!0)}))},I=({uid:e,isActive:t})=>{if(!t){const t=[...b],n=t.find((t=>t.uid===e));t.forEach((t=>t.isActive=t.uid===e)),n.isActive=!0,S(t)}},T=b.filter((e=>e.measurementType!==u.VALUE_TYPES.POINT)),C=b.filter((e=>e.measurementType===u.VALUE_TYPES.POINT)),O=0===C.length&&0===T.length;return n.createElement(n.Fragment,null,n.createElement("div",{className:"invisible-scrollbar overflow-y-auto overflow-x-hidden",ref:w,"data-cy":"trackedMeasurements-panel"},y.key&&n.createElement(F.StudySummary,{date:te(y.date),modality:y.modality,description:y.description}),n.createElement(F.MeasurementTable,{title:"Measurements",data:T,servicesManager:e,onClick:x,onEdit:_}),0!==C.length&&n.createElement(F.MeasurementTable,{title:"Additional Findings",data:C,servicesManager:e,onClick:x,onEdit:_})),!k?.disableEditing&&n.createElement("div",{className:"flex justify-center p-4"},n.createElement(F.ActionButtons,{t:a,actions:[{label:"Export",onClick:async function(){const e=u.getMeasurements().filter((e=>v===e.referenceStudyUID&&g.includes(e.referenceSeriesUID)));ee(e,u)}},{label:"Create Report",onClick:()=>{h("SAVE_REPORT",{viewportId:i.activeViewportId,isBackupSave:!0})}}],disabled:O})))}re.propTypes={servicesManager:a().shape({services:a().shape({measurementService:a().shape({getMeasurements:a().func.isRequired,VALUE_TYPES:a().object.isRequired}).isRequired}).isRequired}).isRequired};const ie=re;var ae=d(625);const oe=function({commandsManager:e,extensionManager:t,servicesManager:n}){return[{name:"seriesList",iconName:"tab-studies",iconLabel:"Studies",label:ae.A.t("SidePanel:Studies"),component:J.bind(null,{commandsManager:e,extensionManager:t,servicesManager:n})},{name:"trackedMeasurements",iconName:"tab-linear",iconLabel:"Measure",label:ae.A.t("SidePanel:Measurements"),component:ie.bind(null,{commandsManager:e,extensionManager:t,servicesManager:n})}]};function se(){return se=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},se.apply(this,arguments)}const le=n.lazy((()=>Promise.resolve().then(d.bind(d,915)))),ue=e=>n.createElement(n.Suspense,{fallback:n.createElement("div",null,"Loading...")},n.createElement(le,e));const ce=function({servicesManager:e,commandsManager:t,extensionManager:r}){return[{name:"cornerstone-tracked",component:i=>n.createElement(ue,se({servicesManager:e,commandsManager:t,extensionManager:r},i))}]},fe={id:JSON.parse('{"UU":"@ohif/extension-measurement-tracking"}').UU,getContextModule:t.A,getPanelModule:oe,getViewportModule:ce}})(),p=d.O(p)})()));
2
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@ohif/ui"),require("@ohif/extension-default"),require("@ohif/extension-cornerstone-dicom-sr"),require("@ohif/core"),require("@cornerstonejs/tools"),require("@cornerstonejs/core")):"function"==typeof define&&define.amd?define(["@ohif/ui","@ohif/extension-default","@ohif/extension-cornerstone-dicom-sr","@ohif/core","@cornerstonejs/tools","@cornerstonejs/core"],t):"object"==typeof exports?exports["ohif-extension-measurement-tracking"]=t(require("@ohif/ui"),require("@ohif/extension-default"),require("@ohif/extension-cornerstone-dicom-sr"),require("@ohif/core"),require("@cornerstonejs/tools"),require("@cornerstonejs/core")):e["ohif-extension-measurement-tracking"]=t(e["@ohif/ui"],e["@ohif/extension-default"],e["@ohif/extension-cornerstone-dicom-sr"],e["@ohif/core"],e["@cornerstonejs/tools"],e["@cornerstonejs/core"])}(globalThis,((e,t,n,r,i,a)=>(()=>{var o,s,l,u,c={946:(e,t,n)=>{"use strict";n.d(t,{A:()=>Ft,B:()=>Ut});var r,i,a=n(766),o=n(374),s=n.n(o),l=function(){return l=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},l.apply(this,arguments)};function u(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function c(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function f(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,a=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o}function d(e,t,n){if(n||2===arguments.length)for(var r,i=0,a=t.length;i<a;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}!function(e){e.Start="xstate.start",e.Stop="xstate.stop",e.Raise="xstate.raise",e.Send="xstate.send",e.Cancel="xstate.cancel",e.NullEvent="",e.Assign="xstate.assign",e.After="xstate.after",e.DoneState="done.state",e.DoneInvoke="done.invoke",e.Log="xstate.log",e.Init="xstate.init",e.Invoke="xstate.invoke",e.ErrorExecution="error.execution",e.ErrorCommunication="error.communication",e.ErrorPlatform="error.platform",e.ErrorCustom="xstate.error",e.Update="xstate.update",e.Pure="xstate.pure",e.Choose="xstate.choose"}(r||(r={})),function(e){e.Parent="#_parent",e.Internal="#_internal"}(i||(i={}));var p,h=r.Start,v=r.Stop,g=r.Raise,y=r.Send,m=r.Cancel,b=r.NullEvent,S=r.Assign,w=(r.After,r.DoneState,r.Log),k=r.Init,E=r.Invoke,x=(r.ErrorExecution,r.ErrorPlatform),_=r.ErrorCustom,I=r.Update,T=r.Choose,C=r.Pure,O={},N="xstate.guard",R=!0;function D(e,t,n){void 0===n&&(n=".");var r=M(e,n),i=M(t,n);return G(i)?!!G(r)&&i===r:G(r)?r in i:Object.keys(r).every((function(e){return e in i&&D(r[e],i[e])}))}function P(e){try{return G(e)||"number"==typeof e?"".concat(e):e.type}catch(e){throw new Error("Events must be strings or objects with a string event.type property.")}}function A(e,t){try{return Q(e)?e:e.toString().split(t)}catch(t){throw new Error("'".concat(e,"' is not a valid state path."))}}function M(e,t){return function(e){return"object"==typeof e&&"value"in e&&"context"in e&&"event"in e&&"_event"in e}(e)?e.value:Q(e)?L(e):"string"!=typeof e?e:L(A(e,t))}function L(e){if(1===e.length)return e[0];for(var t={},n=t,r=0;r<e.length-1;r++)r===e.length-2?n[e[r]]=e[r+1]:(n[e[r]]={},n=n[e[r]]);return t}function U(e,t){for(var n={},r=Object.keys(e),i=0;i<r.length;i++){var a=r[i];n[a]=t(e[a],a,e,i)}return n}function j(e,t,n){var r,i,a={};try{for(var o=c(Object.keys(e)),s=o.next();!s.done;s=o.next()){var l=s.value,u=e[l];n(u)&&(a[l]=t(u,l,e))}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return a}var V=function(e){return function(t){var n,r,i=t;try{for(var a=c(e),o=a.next();!o.done;o=a.next()){i=i[o.value]}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i}};function F(e){return e?G(e)?[[e]]:z(Object.keys(e).map((function(t){var n=e[t];return"string"==typeof n||n&&Object.keys(n).length?F(e[t]).map((function(e){return[t].concat(e)})):[[t]]}))):[[]]}function z(e){var t;return(t=[]).concat.apply(t,d([],f(e),!1))}function B(e){return Q(e)?e:[e]}function H(e){return void 0===e?[]:B(e)}function W(e,t,n){var r,i;if(J(e))return e(t,n.data);var a={};try{for(var o=c(Object.keys(e)),s=o.next();!s.done;s=o.next()){var l=s.value,u=e[l];J(u)?a[l]=u(t,n.data):a[l]=u}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return a}function q(e){return e instanceof Promise||!(null===e||!J(e)&&"object"!=typeof e||!J(e.then))}function $(e,t){return U(e.states,(function(e,n){if(e){var r=(G(t)?void 0:t[n])||(e?e.current:void 0);if(r)return{current:r,states:$(e,r)}}}))}function K(e,t,n,r){R||Y(!!e,"Attempting to update undefined context");var i=e?n.reduce((function(e,n){var i,a,o=n.assignment,s={state:r,action:n,_event:t},l={};if(J(o))l=o(e,t.data,s);else try{for(var u=c(Object.keys(o)),f=u.next();!f.done;f=u.next()){var d=f.value,p=o[d];l[d]=J(p)?p(e,t.data,s):p}}catch(e){i={error:e}}finally{try{f&&!f.done&&(a=u.return)&&a.call(u)}finally{if(i)throw i.error}}return Object.assign({},e,l)}),e):e;return i}var Y=function(){};function Q(e){return Array.isArray(e)}function J(e){return"function"==typeof e}function G(e){return"string"==typeof e}function X(e,t){if(e)return G(e)?{type:N,name:e,predicate:t?t[e]:void 0}:J(e)?{type:N,name:e.name,predicate:e}:e}R||(Y=function(e,t){var n=e instanceof Error?e:void 0;if((n||!e)&&void 0!==console){var r=["Warning: ".concat(t)];n&&r.push(n),console.warn.apply(console,r)}});var Z=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}();(p={})[Z]=function(){return this},p[Symbol.observable]=function(){return this};function ee(e){return!!e&&"__xstatenode"in e}function te(e,t){return G(e)||"number"==typeof e?l({type:e},t):e}function ne(e,t){if(!G(e)&&"$$type"in e&&"scxml"===e.$$type)return e;var n=te(e);return l({name:n.type,data:n,$$type:"scxml",type:"external"},t)}function re(e,t){return B(t).map((function(t){return void 0===t||"string"==typeof t||ee(t)?{target:t,event:e}:l(l({},t),{event:e})}))}function ie(e,t,n,r,i){var a=e.options.guards,o={state:i,cond:t,_event:r};if(t.type===N)return((null==a?void 0:a[t.name])||t.predicate)(n,r.data,o);var s=null==a?void 0:a[t.type];if(!s)throw new Error("Guard '".concat(t.type,"' is not implemented on machine '").concat(e.id,"'."));return s(n,r.data,o)}function ae(e){return"string"==typeof e?{type:e}:e}function oe(e,t,n){var r=function(){},i="object"==typeof e,a=i?e:null;return{next:((i?e.next:e)||r).bind(a),error:((i?e.error:t)||r).bind(a),complete:((i?e.complete:n)||r).bind(a)}}function se(e,t){return"".concat(e,":invocation[").concat(t,"]")}function le(e){return(e.type===g||e.type===y&&e.to===i.Internal)&&"number"!=typeof e.delay}var ue=ne({type:k});function ce(e,t){return t&&t[e]||void 0}function fe(e,t){var n;if(G(e)||"number"==typeof e)n=J(r=ce(e,t))?{type:e,exec:r}:r||{type:e,exec:void 0};else if(J(e))n={type:e.name||e.toString(),exec:e};else{var r;if(J(r=ce(e.type,t)))n=l(l({},e),{exec:r});else if(r){var i=r.type||e.type;n=l(l(l({},r),e),{type:i})}else n=e}return n}var de=function(e,t){return e?(Q(e)?e:[e]).map((function(e){return fe(e,t)})):[]};function pe(e){var t=fe(e);return l(l({id:G(e)?e:t.id},t),{type:t.type})}function he(e,t){return{to:t?t.to:void 0,type:y,event:J(e)?e:te(e),delay:t?t.delay:void 0,id:t&&void 0!==t.id?t.id:J(e)?e.name:P(e)}}function ve(e,t){var n="".concat(r.DoneState,".").concat(e),i={type:n,data:t,toString:function(){return n}};return i}function ge(e,t){var n="".concat(r.DoneInvoke,".").concat(e),i={type:n,data:t,toString:function(){return n}};return i}function ye(e,t){var n="".concat(r.ErrorPlatform,".").concat(e),i={type:n,data:t,toString:function(){return n}};return i}function me(e,t,n,a,o,s,u){void 0===u&&(u=!1);var p=u?[]:function(e){var t,n,r=[];try{for(var i=c(e),a=i.next();!a.done;a=i.next())for(var o=a.value,s=0;s<o.actions.length;)o.actions[s].type!==S?s++:(r.push(o.actions[s]),o.actions.splice(s,1))}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r}(o),h=p.length?K(n,a,p,t):n,m=u?[n]:void 0,b=[];function k(o,c){var p;switch(c.type){case g:var k=function(e,t,n,r){var i,a={_event:n},o=ne(J(e.event)?e.event(t,n.data,a):e.event);if(G(e.delay)){var s=r&&r[e.delay];i=J(s)?s(t,n.data,a):s}else i=J(e.delay)?e.delay(t,n.data,a):e.delay;return l(l({},e),{type:g,_event:o,delay:i})}(c,h,a,e.options.delays);return s&&"number"==typeof k.delay&&s(k,h,a),k;case y:var E=function(e,t,n,r){var i,a={_event:n},o=ne(J(e.event)?e.event(t,n.data,a):e.event);if(G(e.delay)){var s=r&&r[e.delay];i=J(s)?s(t,n.data,a):s}else i=J(e.delay)?e.delay(t,n.data,a):e.delay;var u=J(e.to)?e.to(t,n.data,a):e.to;return l(l({},e),{to:u,_event:o,event:o.data,delay:i})}(c,h,a,e.options.delays);if(!R){var x=c.delay;Y(!G(x)||"number"==typeof E.delay,"No delay reference for delay expression '".concat(x,"' was found on machine '").concat(e.id,"'"))}return s&&E.to!==i.Internal&&("entry"===o?b.push(E):s(E,h,a)),E;case w:var _=function(e,t,n){return l(l({},e),{value:G(e.expr)?e.expr:e.expr(t,n.data,{_event:n})})}(c,h,a);return null==s||s(_,h,a),_;case T:if(!(D=null===(p=c.conds.find((function(n){var r=X(n.cond,e.options.guards);return!r||ie(e,r,h,a,s?void 0:t)})))||void 0===p?void 0:p.actions))return[];var I=f(me(e,t,h,a,[{type:o,actions:de(H(D),e.options.actions)}],s,u),2),O=I[0],N=I[1];return h=N,null==m||m.push(h),O;case C:var D;if(!(D=c.get(h,a.data)))return[];var P=f(me(e,t,h,a,[{type:o,actions:de(H(D),e.options.actions)}],s,u),2),A=P[0],M=P[1];return h=M,null==m||m.push(h),A;case v:_=function(e,t,n){var i=J(e.activity)?e.activity(t,n.data):e.activity,a="string"==typeof i?{id:i}:i;return{type:r.Stop,activity:a}}(c,h,a);return null==s||s(_,n,a),_;case S:h=K(h,a,[c],s?void 0:t),null==m||m.push(h);break;default:var L=fe(c,e.options.actions),U=L.exec;if(s)s(L,h,a);else if(U&&m){var j=m.length-1,V=l(l({},L),{exec:function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];U.apply(void 0,d([m[j]],f(t),!1))}});L=V}return L}}var E=z(o.map((function(e){var t,n,r=[];try{for(var i=c(e.actions),o=i.next();!o.done;o=i.next()){var l=o.value,u=k(e.type,l);u&&(r=r.concat(u))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return b.forEach((function(e){s(e,h,a)})),b.length=0,r})));return[E,h]}var be=[],Se=function(e,t){be.push(e);var n=t(e);return be.pop(),n};function we(e){var t;return(t={id:e,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},getSnapshot:function(){},toJSON:function(){return{id:e}}})[Z]=function(){return this},t}function ke(e,t,n){var r=we(t);if(r.deferred=!0,ee(e)){var i=r.state=Se(void 0,(function(){return(n?e.withContext(n):e).initialState}));r.getSnapshot=function(){return i}}return r}var Ee=function(e){return"atomic"===e.type||"final"===e.type};function xe(e){return Object.keys(e.states).map((function(t){return e.states[t]}))}function _e(e){return xe(e).filter((function(e){return"history"!==e.type}))}function Ie(e){var t=[e];return Ee(e)?t:t.concat(z(_e(e).map(Ie)))}function Te(e,t){var n,r,i,a,o,s,l,u,f=Oe(new Set(e)),d=new Set(t);try{for(var p=c(d),h=p.next();!h.done;h=p.next())for(var v=(x=h.value).parent;v&&!d.has(v);)d.add(v),v=v.parent}catch(e){n={error:e}}finally{try{h&&!h.done&&(r=p.return)&&r.call(p)}finally{if(n)throw n.error}}var g=Oe(d);try{for(var y=c(d),m=y.next();!m.done;m=y.next()){if("compound"!==(x=m.value).type||g.get(x)&&g.get(x).length){if("parallel"===x.type)try{for(var b=(o=void 0,c(_e(x))),S=b.next();!S.done;S=b.next()){var w=S.value;d.has(w)||(d.add(w),f.get(w)?f.get(w).forEach((function(e){return d.add(e)})):w.initialStateNodes.forEach((function(e){return d.add(e)})))}}catch(e){o={error:e}}finally{try{S&&!S.done&&(s=b.return)&&s.call(b)}finally{if(o)throw o.error}}}else f.get(x)?f.get(x).forEach((function(e){return d.add(e)})):x.initialStateNodes.forEach((function(e){return d.add(e)}))}}catch(e){i={error:e}}finally{try{m&&!m.done&&(a=y.return)&&a.call(y)}finally{if(i)throw i.error}}try{for(var k=c(d),E=k.next();!E.done;E=k.next()){var x;for(v=(x=E.value).parent;v&&!d.has(v);)d.add(v),v=v.parent}}catch(e){l={error:e}}finally{try{E&&!E.done&&(u=k.return)&&u.call(k)}finally{if(l)throw l.error}}return d}function Ce(e,t){var n=t.get(e);if(!n)return{};if("compound"===e.type){var r=n[0];if(!r)return{};if(Ee(r))return r.key}var i={};return n.forEach((function(e){i[e.key]=Ce(e,t)})),i}function Oe(e){var t,n,r=new Map;try{for(var i=c(e),a=i.next();!a.done;a=i.next()){var o=a.value;r.has(o)||r.set(o,[]),o.parent&&(r.has(o.parent)||r.set(o.parent,[]),r.get(o.parent).push(o))}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r}function Ne(e,t){return Ce(e,Oe(Te([e],t)))}function Re(e,t){return Array.isArray(e)?e.some((function(e){return e===t})):e instanceof Set&&e.has(t)}function De(e,t){return"compound"===t.type?_e(t).some((function(t){return"final"===t.type&&Re(e,t)})):"parallel"===t.type&&_e(t).every((function(t){return De(e,t)}))}function Pe(e){return new Set(z(e.map((function(e){return e.tags}))))}function Ae(e,t){if(e===t)return!0;if(void 0===e||void 0===t)return!1;if(G(e)||G(t))return e===t;var n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every((function(n){return Ae(e[n],t[n])}))}function Me(e){return"object"==typeof e&&null!==e&&("value"in e&&"_event"in e)}var Le=function(){function e(e){var t,n,r=this;this.actions=[],this.activities=O,this.meta={},this.events=[],this.value=e.value,this.context=e.context,this._event=e._event,this._sessionid=e._sessionid,this.event=this._event.data,this.historyValue=e.historyValue,this.history=e.history,this.actions=e.actions||[],this.activities=e.activities||O,this.meta=(void 0===(n=e.configuration)&&(n=[]),n.reduce((function(e,t){return void 0!==t.meta&&(e[t.id]=t.meta),e}),{})),this.events=e.events||[],this.matches=this.matches.bind(this),this.toStrings=this.toStrings.bind(this),this.configuration=e.configuration,this.transitions=e.transitions,this.children=e.children,this.done=!!e.done,this.tags=null!==(t=Array.isArray(e.tags)?new Set(e.tags):e.tags)&&void 0!==t?t:new Set,this.machine=e.machine,Object.defineProperty(this,"nextEvents",{get:function(){return function(e){return d([],f(new Set(z(d([],f(e.map((function(e){return e.ownEvents}))),!1)))),!1)}(r.configuration)}})}return e.from=function(t,n){return t instanceof e?t.context!==n?new e({value:t.value,context:n,_event:t._event,_sessionid:null,historyValue:t.historyValue,history:t.history,actions:[],activities:t.activities,meta:{},events:[],configuration:[],transitions:[],children:{}}):t:new e({value:t,context:n,_event:ue,_sessionid:null,historyValue:void 0,history:void 0,actions:[],activities:void 0,meta:void 0,events:[],configuration:[],transitions:[],children:{}})},e.create=function(t){return new e(t)},e.inert=function(t,n){if(t instanceof e){if(!t.actions.length)return t;var r=ue;return new e({value:t.value,context:n,_event:r,_sessionid:null,historyValue:t.historyValue,history:t.history,activities:t.activities,configuration:t.configuration,transitions:[],children:{}})}return e.from(t,n)},e.prototype.toStrings=function(e,t){var n=this;if(void 0===e&&(e=this.value),void 0===t&&(t="."),G(e))return[e];var r=Object.keys(e);return r.concat.apply(r,d([],f(r.map((function(r){return n.toStrings(e[r],t).map((function(e){return r+t+e}))}))),!1))},e.prototype.toJSON=function(){var e=this;e.configuration,e.transitions;var t=e.tags;e.machine;var n=u(e,["configuration","transitions","tags","machine"]);return l(l({},n),{tags:Array.from(t)})},e.prototype.matches=function(e){return D(e,this.value)},e.prototype.hasTag=function(e){return this.tags.has(e)},e.prototype.can=function(e){var t;R&&Y(!!this.machine,"state.can(...) used outside of a machine-created State object; this will always return false.");var n=null===(t=this.machine)||void 0===t?void 0:t.getTransitionData(this,e);return!!(null==n?void 0:n.transitions.length)&&n.transitions.some((function(e){return void 0!==e.target||e.actions.length}))},e}(),Ue={deferEvents:!1},je=function(){function e(e){this.processingEvent=!1,this.queue=[],this.initialized=!1,this.options=l(l({},Ue),e)}return e.prototype.initialize=function(e){if(this.initialized=!0,e){if(!this.options.deferEvents)return void this.schedule(e);this.process(e)}this.flushEvents()},e.prototype.schedule=function(e){if(this.initialized&&!this.processingEvent){if(0!==this.queue.length)throw new Error("Event queue should be empty when it is not processing events");this.process(e),this.flushEvents()}else this.queue.push(e)},e.prototype.clear=function(){this.queue=[]},e.prototype.flushEvents=function(){for(var e=this.queue.shift();e;)this.process(e),e=this.queue.shift()},e.prototype.process=function(e){this.processingEvent=!0;try{e()}catch(e){throw this.clear(),e}finally{this.processingEvent=!1}},e}(),Ve=new Map,Fe=0,ze=function(){return"x:".concat(Fe++)},Be=function(e,t){return Ve.set(e,t),e},He=function(e){return Ve.get(e)},We=function(e){Ve.delete(e)};function qe(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:void(R||console.warn("XState could not find a global object in this environment. Please let the maintainers know and raise an issue here: https://github.com/statelyai/xstate/issues"))}function $e(e){if(qe()){var t=function(){var e=qe();if(e&&"__xstate__"in e)return e.__xstate__}();t&&t.register(e)}}function Ke(e,t){void 0===t&&(t={});var n=e.initialState,r=new Set,i=[],a=!1,o=function(e){var t;return l(((t={subscribe:function(){return{unsubscribe:function(){}}},id:"anonymous",getSnapshot:function(){}})[Z]=function(){return this},t),e)}({id:t.id,send:function(t){i.push(t),function(){if(!a){for(a=!0;i.length>0;){var t=i.shift();n=e.transition(n,t,s),r.forEach((function(e){return e.next(n)}))}a=!1}}()},getSnapshot:function(){return n},subscribe:function(e,t,i){var a=oe(e,t,i);return r.add(a),a.next(n),{unsubscribe:function(){r.delete(a)}}}}),s={parent:t.parent,self:o,id:t.id||"anonymous",observers:r};return n=e.start?e.start(s):n,o}var Ye,Qe={sync:!1,autoForward:!1};!function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(Ye||(Ye={}));var Je=function(){function e(t,n){void 0===n&&(n=e.defaultOptions);var a=this;this.machine=t,this.delayedEventsMap={},this.listeners=new Set,this.contextListeners=new Set,this.stopListeners=new Set,this.doneListeners=new Set,this.eventListeners=new Set,this.sendListeners=new Set,this.initialized=!1,this.status=Ye.NotStarted,this.children=new Map,this.forwardTo=new Set,this._outgoingQueue=[],this.init=this.start,this.send=function(e,t){if(Q(e))return a.batch(e),a.state;var n=ne(te(e,t));if(a.status===Ye.Stopped)return R||Y(!1,'Event "'.concat(n.name,'" was sent to stopped service "').concat(a.machine.id,'". This service has already reached its final state, and will not transition.\nEvent: ').concat(JSON.stringify(n.data))),a.state;if(a.status!==Ye.Running&&!a.options.deferEvents)throw new Error('Event "'.concat(n.name,'" was sent to uninitialized service "').concat(a.machine.id,'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.\nEvent: ').concat(JSON.stringify(n.data)));return a.scheduler.schedule((function(){a.forward(n);var e=a._nextState(n);a.update(e,n)})),a._state},this.sendTo=function(e,t,n){var r,o=a.parent&&(t===i.Parent||a.parent.id===t),s=o?a.parent:G(t)?t===i.Internal?a:a.children.get(t)||He(t):(r=t)&&"function"==typeof r.send?t:void 0;if(s)if("machine"in s){if(a.status!==Ye.Stopped||a.parent!==s||a.state.done){var u=l(l({},e),{name:e.name===_?"".concat(ye(a.id)):e.name,origin:a.sessionId});!n&&a.machine.config.predictableActionArguments?a._outgoingQueue.push([s,u]):s.send(u)}}else!n&&a.machine.config.predictableActionArguments?a._outgoingQueue.push([s,e.data]):s.send(e.data);else{if(!o)throw new Error("Unable to send event to child '".concat(t,"' from service '").concat(a.id,"'."));R||Y(!1,"Service '".concat(a.id,"' has no parent: unable to send event ").concat(e.type))}},this._exec=function(e,t,n,i){void 0===i&&(i=a.machine.options.actions);var o=e.exec||ce(e.type,i),s=J(o)?o:o?o.exec:e.exec;if(s)try{return s(t,n.data,a.machine.config.predictableActionArguments?{action:e,_event:n}:{action:e,state:a.state,_event:n})}catch(e){throw a.parent&&a.parent.send({type:"xstate.error",data:e}),e}switch(e.type){case g:var l=e;a.defer(l);break;case y:var u=e;if("number"==typeof u.delay)return void a.defer(u);u.to?a.sendTo(u._event,u.to,n===ue):a.send(u._event);break;case m:a.cancel(e.sendId);break;case h:if(a.status!==Ye.Running)return;var c=e.activity;if(!a.machine.config.predictableActionArguments&&!a.state.activities[c.id||c.type])break;if(c.type===r.Invoke){var f=ae(c.src),d=a.machine.options.services?a.machine.options.services[f.type]:void 0,p=c.id,b=c.data;R||Y(!("forward"in c),"`forward` property is deprecated (found in invocation of '".concat(c.src,"' in in machine '").concat(a.machine.id,"'). ")+"Please use `autoForward` instead.");var S="autoForward"in c?c.autoForward:!!c.forward;if(!d)return void(R||Y(!1,"No service found for invocation '".concat(c.src,"' in machine '").concat(a.machine.id,"'.")));var k=b?W(b,t,n):void 0;if("string"==typeof d)return;var E=J(d)?d(t,n.data,{data:k,src:f,meta:c.meta}):d;if(!E)return;var x=void 0;ee(E)&&(E=k?E.withContext(k):E,x={autoForward:S}),a.spawn(E,p,x)}else a.spawnActivity(c);break;case v:a.stopChild(e.activity.id);break;case w:var _=e,I=_.label,T=_.value;I?a.logger(I,T):a.logger(T);break;default:R||Y(!1,"No implementation found for action type '".concat(e.type,"'"))}};var o=l(l({},e.defaultOptions),n),s=o.clock,u=o.logger,c=o.parent,f=o.id,d=void 0!==f?f:t.id;this.id=d,this.logger=u,this.clock=s,this.parent=c,this.options=o,this.scheduler=new je({deferEvents:this.options.deferEvents}),this.sessionId=ze()}return Object.defineProperty(e.prototype,"initialState",{get:function(){var e=this;return this._initialState?this._initialState:Se(this,(function(){return e._initialState=e.machine.initialState,e._initialState}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return R||Y(this.status!==Ye.NotStarted,"Attempted to read state from uninitialized service '".concat(this.id,"'. Make sure the service is started first.")),this._state},enumerable:!1,configurable:!0}),e.prototype.execute=function(e,t){var n,r;try{for(var i=c(e.actions),a=i.next();!a.done;a=i.next()){var o=a.value;this.exec(o,e,t)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}},e.prototype.update=function(e,t){var n,r,i,a,o,s,l,u,f=this;if(e._sessionid=this.sessionId,this._state=e,this.machine.config.predictableActionArguments&&t!==ue||!this.options.execute)for(var d=void 0;d=this._outgoingQueue.shift();)d[0].send(d[1]);else this.execute(this.state);if(this.children.forEach((function(e){f.state.children[e.id]=e})),this.devTools&&this.devTools.send(t.data,e),e.event)try{for(var p=c(this.eventListeners),h=p.next();!h.done;h=p.next()){(0,h.value)(e.event)}}catch(e){n={error:e}}finally{try{h&&!h.done&&(r=p.return)&&r.call(p)}finally{if(n)throw n.error}}try{for(var v=c(this.listeners),g=v.next();!g.done;g=v.next()){(0,g.value)(e,e.event)}}catch(e){i={error:e}}finally{try{g&&!g.done&&(a=v.return)&&a.call(v)}finally{if(i)throw i.error}}try{for(var y=c(this.contextListeners),m=y.next();!m.done;m=y.next()){(0,m.value)(this.state.context,this.state.history?this.state.history.context:void 0)}}catch(e){o={error:e}}finally{try{m&&!m.done&&(s=y.return)&&s.call(y)}finally{if(o)throw o.error}}if(this.state.done){var b=e.configuration.find((function(e){return"final"===e.type&&e.parent===f.machine})),S=b&&b.doneData?W(b.doneData,e.context,t):void 0;this._doneEvent=ge(this.id,S);try{for(var w=c(this.doneListeners),k=w.next();!k.done;k=w.next()){(0,k.value)(this._doneEvent)}}catch(e){l={error:e}}finally{try{k&&!k.done&&(u=w.return)&&u.call(w)}finally{if(l)throw l.error}}this._stop(),this._stopChildren(),We(this.sessionId)}},e.prototype.onTransition=function(e){return this.listeners.add(e),this.status===Ye.Running&&e(this.state,this.state.event),this},e.prototype.subscribe=function(e,t,n){var r=this,i=oe(e,t,n);this.listeners.add(i.next),this.status!==Ye.NotStarted&&i.next(this.state);var a=function(){r.doneListeners.delete(a),r.stopListeners.delete(a),i.complete()};return this.status===Ye.Stopped?i.complete():(this.onDone(a),this.onStop(a)),{unsubscribe:function(){r.listeners.delete(i.next),r.doneListeners.delete(a),r.stopListeners.delete(a)}}},e.prototype.onEvent=function(e){return this.eventListeners.add(e),this},e.prototype.onSend=function(e){return this.sendListeners.add(e),this},e.prototype.onChange=function(e){return this.contextListeners.add(e),this},e.prototype.onStop=function(e){return this.stopListeners.add(e),this},e.prototype.onDone=function(e){return this.status===Ye.Stopped&&this._doneEvent?e(this._doneEvent):this.doneListeners.add(e),this},e.prototype.off=function(e){return this.listeners.delete(e),this.eventListeners.delete(e),this.sendListeners.delete(e),this.stopListeners.delete(e),this.doneListeners.delete(e),this.contextListeners.delete(e),this},e.prototype.start=function(e){var t=this;if(this.status===Ye.Running)return this;this.machine._init(),Be(this.sessionId,this),this.initialized=!0,this.status=Ye.Running;var n=void 0===e?this.initialState:Se(this,(function(){return Me(e)?t.machine.resolveState(e):t.machine.resolveState(Le.from(e,t.machine.context))}));return this.options.devTools&&this.attachDev(),this.scheduler.initialize((function(){t.update(n,ue)})),this},e.prototype._stopChildren=function(){this.children.forEach((function(e){J(e.stop)&&e.stop()})),this.children.clear()},e.prototype._stop=function(){var e,t,n,r,i,a,o,s,l,u;try{for(var f=c(this.listeners),d=f.next();!d.done;d=f.next()){var p=d.value;this.listeners.delete(p)}}catch(t){e={error:t}}finally{try{d&&!d.done&&(t=f.return)&&t.call(f)}finally{if(e)throw e.error}}try{for(var h=c(this.stopListeners),v=h.next();!v.done;v=h.next()){(p=v.value)(),this.stopListeners.delete(p)}}catch(e){n={error:e}}finally{try{v&&!v.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}try{for(var g=c(this.contextListeners),y=g.next();!y.done;y=g.next()){p=y.value;this.contextListeners.delete(p)}}catch(e){i={error:e}}finally{try{y&&!y.done&&(a=g.return)&&a.call(g)}finally{if(i)throw i.error}}try{for(var m=c(this.doneListeners),b=m.next();!b.done;b=m.next()){p=b.value;this.doneListeners.delete(p)}}catch(e){o={error:e}}finally{try{b&&!b.done&&(s=m.return)&&s.call(m)}finally{if(o)throw o.error}}if(!this.initialized)return this;this.initialized=!1,this.status=Ye.Stopped,this._initialState=void 0;try{for(var S=c(Object.keys(this.delayedEventsMap)),w=S.next();!w.done;w=S.next()){var k=w.value;this.clock.clearTimeout(this.delayedEventsMap[k])}}catch(e){l={error:e}}finally{try{w&&!w.done&&(u=S.return)&&u.call(S)}finally{if(l)throw l.error}}this.scheduler.clear(),this.scheduler=new je({deferEvents:this.options.deferEvents})},e.prototype.stop=function(){var e=this,t=this.scheduler;return this._stop(),t.schedule((function(){var t;if(!(null===(t=e._state)||void 0===t?void 0:t.done)){var n=ne({type:"xstate.stop"}),r=Se(e,(function(){var t=z(d([],f(e.state.configuration),!1).sort((function(e,t){return t.order-e.order})).map((function(t){return de(t.onExit,e.machine.options.actions)}))),r=f(me(e.machine,e.state,e.state.context,n,[{type:"exit",actions:t}],e.machine.config.predictableActionArguments?e._exec:void 0,e.machine.config.predictableActionArguments||e.machine.config.preserveActionOrder),2),i=r[0],a=r[1],o=new Le({value:e.state.value,context:a,_event:n,_sessionid:e.sessionId,historyValue:void 0,history:e.state,actions:i.filter((function(e){return!le(e)})),activities:{},events:[],configuration:[],transitions:[],children:{},done:e.state.done,tags:e.state.tags,machine:e.machine});return o.changed=!0,o}));e.update(r,n),e._stopChildren(),We(e.sessionId)}})),this},e.prototype.batch=function(e){var t=this;if(this.status===Ye.NotStarted&&this.options.deferEvents)R||Y(!1,"".concat(e.length,' event(s) were sent to uninitialized service "').concat(this.machine.id,'" and are deferred. Make sure .start() is called for this service.\nEvent: ').concat(JSON.stringify(event)));else if(this.status!==Ye.Running)throw new Error("".concat(e.length,' event(s) were sent to uninitialized service "').concat(this.machine.id,'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.'));if(e.length){var n=!!this.machine.config.predictableActionArguments&&this._exec;this.scheduler.schedule((function(){var r,i,a=t.state,o=!1,s=[],u=function(e){var r=ne(e);t.forward(r),a=Se(t,(function(){return t.machine.transition(a,r,void 0,n||void 0)})),s.push.apply(s,d([],f(t.machine.config.predictableActionArguments?a.actions:a.actions.map((function(e){return function(e,t){var n=e.exec;return l(l({},e),{exec:void 0!==n?function(){return n(t.context,t.event,{action:e,state:t,_event:t._event})}:void 0})}(e,a)}))),!1)),o=o||!!a.changed};try{for(var p=c(e),h=p.next();!h.done;h=p.next()){u(h.value)}}catch(e){r={error:e}}finally{try{h&&!h.done&&(i=p.return)&&i.call(p)}finally{if(r)throw r.error}}a.changed=o,a.actions=s,t.update(a,ne(e[e.length-1]))}))}},e.prototype.sender=function(e){return this.send.bind(this,e)},e.prototype._nextState=function(e,t){var n=this;void 0===t&&(t=!!this.machine.config.predictableActionArguments&&this._exec);var r=ne(e);if(0===r.name.indexOf(x)&&!this.state.nextEvents.some((function(e){return 0===e.indexOf(x)})))throw r.data.data;return Se(this,(function(){return n.machine.transition(n.state,r,void 0,t||void 0)}))},e.prototype.nextState=function(e){return this._nextState(e,!1)},e.prototype.forward=function(e){var t,n;try{for(var r=c(this.forwardTo),i=r.next();!i.done;i=r.next()){var a=i.value,o=this.children.get(a);if(!o)throw new Error("Unable to forward event '".concat(e,"' from interpreter '").concat(this.id,"' to nonexistant child '").concat(a,"'."));o.send(e)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}},e.prototype.defer=function(e){var t=this,n=this.clock.setTimeout((function(){"to"in e&&e.to?t.sendTo(e._event,e.to,!0):t.send(e._event)}),e.delay);e.id&&(this.delayedEventsMap[e.id]=n)},e.prototype.cancel=function(e){this.clock.clearTimeout(this.delayedEventsMap[e]),delete this.delayedEventsMap[e]},e.prototype.exec=function(e,t,n){void 0===n&&(n=this.machine.options.actions),this._exec(e,t.context,t._event,n)},e.prototype.removeChild=function(e){var t;this.children.delete(e),this.forwardTo.delete(e),null===(t=this.state)||void 0===t||delete t.children[e]},e.prototype.stopChild=function(e){var t=this.children.get(e);t&&(this.removeChild(e),J(t.stop)&&t.stop())},e.prototype.spawn=function(e,t,n){if(this.status!==Ye.Running)return ke(e,t);if(q(e))return this.spawnPromise(Promise.resolve(e),t);if(J(e))return this.spawnCallback(e,t);if(function(e){try{return"function"==typeof e.send}catch(e){return!1}}(i=e)&&"id"in i)return this.spawnActor(e,t);if(function(e){try{return"subscribe"in e&&J(e.subscribe)}catch(e){return!1}}(e))return this.spawnObservable(e,t);if(ee(e))return this.spawnMachine(e,l(l({},n),{id:t}));if(null!==(r=e)&&"object"==typeof r&&"transition"in r&&"function"==typeof r.transition)return this.spawnBehavior(e,t);throw new Error('Unable to spawn entity "'.concat(t,'" of type "').concat(typeof e,'".'));var r,i},e.prototype.spawnMachine=function(t,n){var r=this;void 0===n&&(n={});var i=new e(t,l(l({},this.options),{parent:this,id:n.id||t.id})),a=l(l({},Qe),n);a.sync&&i.onTransition((function(e){r.send(I,{state:e,id:i.id})}));var o=i;return this.children.set(i.id,o),a.autoForward&&this.forwardTo.add(i.id),i.onDone((function(e){r.removeChild(i.id),r.send(ne(e,{origin:i.id}))})).start(),o},e.prototype.spawnBehavior=function(e,t){var n=Ke(e,{id:t,parent:this});return this.children.set(t,n),n},e.prototype.spawnPromise=function(e,t){var n,r,i=this,a=!1;e.then((function(e){a||(r=e,i.removeChild(t),i.send(ne(ge(t,e),{origin:t})))}),(function(e){if(!a){i.removeChild(t);var n=ye(t,e);try{i.send(ne(n,{origin:t}))}catch(r){!function(e,t,n){if(!R){var r=e.stack?" Stacktrace was '".concat(e.stack,"'"):"";if(e===t)console.error("Missing onError handler for invocation '".concat(n,"', error was '").concat(e,"'.").concat(r));else{var i=t.stack?" Stacktrace was '".concat(t.stack,"'"):"";console.error("Missing onError handler and/or unhandled exception/promise rejection for invocation '".concat(n,"'. ")+"Original error: '".concat(e,"'. ").concat(r," Current error is '").concat(t,"'.").concat(i))}}}(e,r,t),i.devTools&&i.devTools.send(n,i.state),i.machine.strict&&i.stop()}}}));var o=((n={id:t,send:function(){},subscribe:function(t,n,r){var i=oe(t,n,r),a=!1;return e.then((function(e){a||(i.next(e),a||i.complete())}),(function(e){a||i.error(e)})),{unsubscribe:function(){return a=!0}}},stop:function(){a=!0},toJSON:function(){return{id:t}},getSnapshot:function(){return r}})[Z]=function(){return this},n);return this.children.set(t,o),o},e.prototype.spawnCallback=function(e,t){var n,r,i,a=this,o=!1,s=new Set,l=new Set;try{i=e((function(e){r=e,l.forEach((function(t){return t(e)})),o||a.send(ne(e,{origin:t}))}),(function(e){s.add(e)}))}catch(e){this.send(ye(t,e))}if(q(i))return this.spawnPromise(i,t);var u=((n={id:t,send:function(e){return s.forEach((function(t){return t(e)}))},subscribe:function(e){var t=oe(e);return l.add(t.next),{unsubscribe:function(){l.delete(t.next)}}},stop:function(){o=!0,J(i)&&i()},toJSON:function(){return{id:t}},getSnapshot:function(){return r}})[Z]=function(){return this},n);return this.children.set(t,u),u},e.prototype.spawnObservable=function(e,t){var n,r,i=this,a=e.subscribe((function(e){r=e,i.send(ne(e,{origin:t}))}),(function(e){i.removeChild(t),i.send(ne(ye(t,e),{origin:t}))}),(function(){i.removeChild(t),i.send(ne(ge(t),{origin:t}))})),o=((n={id:t,send:function(){},subscribe:function(t,n,r){return e.subscribe(t,n,r)},stop:function(){return a.unsubscribe()},getSnapshot:function(){return r},toJSON:function(){return{id:t}}})[Z]=function(){return this},n);return this.children.set(t,o),o},e.prototype.spawnActor=function(e,t){return this.children.set(t,e),e},e.prototype.spawnActivity=function(e){var t=this.machine.options&&this.machine.options.activities?this.machine.options.activities[e.type]:void 0;if(t){var n=t(this.state.context,e);this.spawnEffect(e.id,n)}else R||Y(!1,"No implementation found for activity '".concat(e.type,"'"))},e.prototype.spawnEffect=function(e,t){var n;this.children.set(e,((n={id:e,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},stop:t||void 0,getSnapshot:function(){},toJSON:function(){return{id:e}}})[Z]=function(){return this},n))},e.prototype.attachDev=function(){var e=qe();if(this.options.devTools&&e){if(e.__REDUX_DEVTOOLS_EXTENSION__){var t="object"==typeof this.options.devTools?this.options.devTools:void 0;this.devTools=e.__REDUX_DEVTOOLS_EXTENSION__.connect(l(l({name:this.id,autoPause:!0,stateSanitizer:function(e){return{value:e.value,context:e.context,actions:e.actions}}},t),{features:l({jump:!1,skip:!1},t?t.features:void 0)}),this.machine),this.devTools.init(this.state)}$e(this)}},e.prototype.toJSON=function(){return{id:this.id}},e.prototype[Z]=function(){return this},e.prototype.getSnapshot=function(){return this.status===Ye.NotStarted?this.initialState:this._state},e.defaultOptions={execute:!0,deferEvents:!0,clock:{setTimeout:function(e,t){return setTimeout(e,t)},clearTimeout:function(e){return clearTimeout(e)}},logger:console.log.bind(console),devTools:!1},e.interpret=Ge,e}();function Ge(e,t){return new Je(e,t)}function Xe(e){if("string"==typeof e){var t={type:e,toString:function(){return e}};return t}return e}function Ze(e){return l(l({type:E},e),{toJSON:function(){e.onDone,e.onError;var t=u(e,["onDone","onError"]);return l(l({},t),{type:E,src:Xe(e.src)})}})}var et="",tt="*",nt={},rt=function(e){return"#"===e[0]},it=function(){function e(t,n,r,i){void 0===r&&(r="context"in t?t.context:void 0);var a,o=this;this.config=t,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=null==i?void 0:i.parent,this.key=this.config.key||(null==i?void 0:i.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||d([this.machine.key],f(this.path),!1).join(this.delimiter),this.version=this.parent?this.parent.version:this.config.version,this.type=this.config.type||(this.config.parallel?"parallel":this.config.states&&Object.keys(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.schema=this.parent?this.machine.schema:null!==(a=this.config.schema)&&void 0!==a?a:{},this.description=this.config.description,R||Y(!("parallel"in this.config),'The "parallel" property is deprecated and will be removed in version 4.1. '.concat(this.config.parallel?"Replace with `type: 'parallel'`":"Use `type: '".concat(this.type,"'`")," in the config for state node '").concat(this.id,"' instead.")),this.initial=this.config.initial,this.states=this.config.states?U(this.config.states,(function(t,n){var r,i=new e(t,{},void 0,{parent:o,key:n});return Object.assign(o.idMap,l(((r={})[i.id]=i,r),i.idMap)),i})):nt;var s=0;!function e(t){var n,r;t.order=s++;try{for(var i=c(xe(t)),a=i.next();!a.done;a=i.next()){e(a.value)}}catch(e){n={error:e}}finally{try{a&&!a.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(e){return e.event===et})):et in this.config.on),this.strict=!!this.config.strict,this.onEntry=H(this.config.entry||this.config.onEntry).map((function(e){return fe(e)})),this.onExit=H(this.config.exit||this.config.onExit).map((function(e){return fe(e)})),this.meta=this.config.meta,this.doneData="final"===this.type?this.config.data:void 0,this.invoke=H(this.config.invoke).map((function(e,t){var n,r;if(ee(e)){var i=se(o.id,t);return o.machine.options.services=l(((n={})[i]=e,n),o.machine.options.services),Ze({src:i,id:i})}if(G(e.src)){i=e.id||se(o.id,t);return Ze(l(l({},e),{id:i,src:e.src}))}if(ee(e.src)||J(e.src)){i=e.id||se(o.id,t);return o.machine.options.services=l(((r={})[i]=e.src,r),o.machine.options.services),Ze(l(l({id:i},e),{src:i}))}var a=e.src;return Ze(l(l({id:se(o.id,t)},e),{src:a}))})),this.activities=H(this.config.activities).concat(this.invoke).map((function(e){return pe(e)})),this.transition=this.transition.bind(this),this.tags=H(this.config.tags)}return e.prototype._init=function(){this.__cache.transitions||Ie(this).forEach((function(e){return e.on}))},e.prototype.withConfig=function(t,n){var r=this.options,i=r.actions,a=r.activities,o=r.guards,s=r.services,u=r.delays;return new e(this.config,{actions:l(l({},i),t.actions),activities:l(l({},a),t.activities),guards:l(l({},o),t.guards),services:l(l({},s),t.services),delays:l(l({},u),t.delays)},null!=n?n:this.context)},e.prototype.withContext=function(t){return new e(this.config,this.options,t)},Object.defineProperty(e.prototype,"context",{get:function(){return J(this._context)?this._context():this._context},enumerable:!1,configurable:!0}),Object.defineProperty(e.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:U(this.states,(function(e){return e.definition})),on:this.on,transitions:this.transitions,entry:this.onEntry,exit:this.onExit,activities:this.activities||[],meta:this.meta,order:this.order||-1,data:this.doneData,invoke:this.invoke,description:this.description,tags:this.tags}},enumerable:!1,configurable:!0}),e.prototype.toJSON=function(){return this.definition},Object.defineProperty(e.prototype,"on",{get:function(){if(this.__cache.on)return this.__cache.on;var e=this.transitions;return this.__cache.on=e.reduce((function(e,t){return e[t.eventType]=e[t.eventType]||[],e[t.eventType].push(t),e}),{})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"after",{get:function(){return this.__cache.delayedTransitions||(this.__cache.delayedTransitions=this.getDelayedTransitions(),this.__cache.delayedTransitions)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transitions",{get:function(){return this.__cache.transitions||(this.__cache.transitions=this.formatTransitions(),this.__cache.transitions)},enumerable:!1,configurable:!0}),e.prototype.getCandidates=function(e){if(this.__cache.candidates[e])return this.__cache.candidates[e];var t=e===et,n=this.transitions.filter((function(n){var r=n.eventType===e;return t?r:r||n.eventType===tt}));return this.__cache.candidates[e]=n,n},e.prototype.getDelayedTransitions=function(){var e=this,t=this.config.after;if(!t)return[];var n=function(t,n){var i=function(e,t){var n=t?"#".concat(t):"";return"".concat(r.After,"(").concat(e,")").concat(n)}(J(t)?"".concat(e.id,":delay[").concat(n,"]"):t,e.id);return e.onEntry.push(he(i,{delay:t})),e.onExit.push({type:m,sendId:i}),i};return(Q(t)?t.map((function(e,t){var r=n(e.delay,t);return l(l({},e),{event:r})})):z(Object.keys(t).map((function(e,r){var i=t[e],a=G(i)?{target:i}:i,o=isNaN(+e)?e:+e,s=n(o,r);return H(a).map((function(e){return l(l({},e),{event:s,delay:o})}))})))).map((function(t){var n=t.delay;return l(l({},e.formatTransition(t)),{delay:n})}))},e.prototype.getStateNodes=function(e){var t,n=this;if(!e)return[];var r=e instanceof Le?e.value:M(e,this.delimiter);if(G(r)){var i=this.getStateNode(r).initial;return void 0!==i?this.getStateNodes(((t={})[r]=i,t)):[this,this.states[r]]}var a=Object.keys(r),o=[this];return o.push.apply(o,d([],f(z(a.map((function(e){return n.getStateNode(e).getStateNodes(r[e])})))),!1)),o},e.prototype.handles=function(e){var t=P(e);return this.events.includes(t)},e.prototype.resolveState=function(e){var t=e instanceof Le?e:Le.create(e),n=Array.from(Te([],this.getStateNodes(t.value)));return new Le(l(l({},t),{value:this.resolve(t.value),configuration:n,done:De(n,this),tags:Pe(n),machine:this.machine}))},e.prototype.transitionLeafNode=function(e,t,n){var r=this.getStateNode(e).next(t,n);return r&&r.transitions.length?r:this.next(t,n)},e.prototype.transitionCompoundNode=function(e,t,n){var r=Object.keys(e),i=this.getStateNode(r[0])._transition(e[r[0]],t,n);return i&&i.transitions.length?i:this.next(t,n)},e.prototype.transitionParallelNode=function(e,t,n){var r,i,a={};try{for(var o=c(Object.keys(e)),s=o.next();!s.done;s=o.next()){var l=s.value,u=e[l];if(u){var f=this.getStateNode(l)._transition(u,t,n);f&&(a[l]=f)}}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}var d=Object.keys(a).map((function(e){return a[e]})),p=z(d.map((function(e){return e.transitions})));if(!d.some((function(e){return e.transitions.length>0})))return this.next(t,n);var h=z(Object.keys(a).map((function(e){return a[e].configuration})));return{transitions:p,exitSet:z(d.map((function(e){return e.exitSet}))),configuration:h,source:t,actions:z(Object.keys(a).map((function(e){return a[e].actions})))}},e.prototype._transition=function(e,t,n){return G(e)?this.transitionLeafNode(e,t,n):1===Object.keys(e).length?this.transitionCompoundNode(e,t,n):this.transitionParallelNode(e,t,n)},e.prototype.getTransitionData=function(e,t){return this._transition(e.value,e,ne(t))},e.prototype.next=function(e,t){var n,r,i,a=this,o=t.name,s=[],l=[];try{for(var u=c(this.getCandidates(o)),p=u.next();!p.done;p=u.next()){var h=p.value,v=h.cond,g=h.in,y=e.context,m=!g||(G(g)&&rt(g)?e.matches(M(this.getStateNodeById(g).path,this.delimiter)):D(M(g,this.delimiter),V(this.path.slice(0,-2))(e.value))),b=!1;try{b=!v||ie(this.machine,v,y,t,e)}catch(e){throw new Error("Unable to evaluate guard '".concat(v.name||v.type,"' in transition for event '").concat(o,"' in state node '").concat(this.id,"':\n").concat(e.message))}if(b&&m){void 0!==h.target&&(l=h.target),s.push.apply(s,d([],f(h.actions),!1)),i=h;break}}}catch(e){n={error:e}}finally{try{p&&!p.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}if(i){if(!l.length)return{transitions:[i],exitSet:[],configuration:e.value?[this]:[],source:e,actions:s};var S=z(l.map((function(t){return a.getRelativeStateNodes(t,e.historyValue)})));return{transitions:[i],exitSet:!!i.internal?[]:z(l.map((function(e){return a.getPotentiallyReenteringNodes(e)}))),configuration:S,source:e,actions:s}}},e.prototype.getPotentiallyReenteringNodes=function(e){if(this.order<e.order)return[this];for(var t=[],n=this,r=e;n&&n!==r;)t.push(n),n=n.parent;return n!==r?[]:(t.push(r),t)},e.prototype.getActions=function(e,t,n,i,a,o,s){var l,u,p,h,v=this,y=o?Te([],this.getStateNodes(o.value)):[],m=new Set;try{for(var b=c(Array.from(e).sort((function(e,t){return e.order-t.order}))),S=b.next();!S.done;S=b.next()){(!Re(y,E=S.value)||Re(n.exitSet,E)||E.parent&&m.has(E.parent))&&m.add(E)}}catch(e){l={error:e}}finally{try{S&&!S.done&&(u=b.return)&&u.call(b)}finally{if(l)throw l.error}}try{for(var w=c(y),k=w.next();!k.done;k=w.next()){var E;Re(e,E=k.value)&&!Re(n.exitSet,E.parent)||n.exitSet.push(E)}}catch(e){p={error:e}}finally{try{k&&!k.done&&(h=w.return)&&h.call(w)}finally{if(p)throw p.error}}n.exitSet.sort((function(e,t){return t.order-e.order}));var x=Array.from(m).sort((function(e,t){return e.order-t.order})),_=new Set(n.exitSet),I=z(x.map((function(e){var t=[];if("final"!==e.type)return t;var r=e.parent;if(!r.parent)return t;t.push(ve(e.id,e.doneData),ve(r.id,e.doneData?W(e.doneData,i,a):void 0));var o=r.parent;return"parallel"===o.type&&_e(o).every((function(e){return De(n.configuration,e)}))&&t.push(ve(o.id)),t}))),T=x.map((function(e){var t=e.onEntry,n=e.activities.map((function(e){return function(e){var t=pe(e);return{type:r.Start,activity:t,exec:void 0}}(e)}));return{type:"entry",actions:de(s?d(d([],f(t),!1),f(n),!1):d(d([],f(n),!1),f(t),!1),v.machine.options.actions)}})).concat({type:"state_done",actions:I.map((function(e){return function(e,t){return{type:g,event:"function"==typeof e?e:te(e),delay:t?t.delay:void 0,id:null==t?void 0:t.id}}(e)}))}),C=Array.from(_).map((function(e){return{type:"exit",actions:de(d(d([],f(e.onExit),!1),f(e.activities.map((function(e){return function(e){var t=J(e)?e:pe(e);return{type:r.Stop,activity:t,exec:void 0}}(e)}))),!1),v.machine.options.actions)}})).concat({type:"transition",actions:de(n.actions,this.machine.options.actions)}).concat(T);if(t){var O=de(z(d([],f(e),!1).sort((function(e,t){return t.order-e.order})).map((function(e){return e.onExit}))),this.machine.options.actions).filter((function(e){return!le(e)}));return C.concat({type:"stop",actions:O})}return C},e.prototype.transition=function(e,t,n,r){void 0===e&&(e=this.initialState);var i,a,o=ne(t);if(e instanceof Le)i=void 0===n?e:this.resolveState(Le.from(e,n));else{var s=G(e)?this.resolve(L(this.getResolvedPath(e))):this.resolve(e),l=null!=n?n:this.machine.context;i=this.resolveState(Le.from(s,l))}if(!R&&o.name===tt)throw new Error("An event cannot have the wildcard type ('".concat(tt,"')"));if(this.strict&&!this.events.includes(o.name)&&(a=o.name,!/^(done|error)\./.test(a)))throw new Error("Machine '".concat(this.id,"' does not accept event '").concat(o.name,"'"));var u=this._transition(i.value,i,o)||{transitions:[],configuration:[],exitSet:[],source:i,actions:[]},c=Te([],this.getStateNodes(i.value)),p=u.configuration.length?Te(c,u.configuration):c;return u.configuration=d([],f(p),!1),this.resolveTransition(u,i,i.context,r,o)},e.prototype.resolveRaisedTransition=function(e,t,n,r){var i,a=e.actions;return(e=this.transition(e,t,void 0,r))._event=n,e.event=n.data,(i=e.actions).unshift.apply(i,d([],f(a),!1)),e},e.prototype.resolveTransition=function(e,t,n,r,i){var a,o,s,u,d=this;void 0===i&&(i=ue);var p=e.configuration,g=!t||e.transitions.length>0,y=g?e.configuration:t?t.configuration:[],m=De(y,this),S=g?Ne(this.machine,p):void 0,w=t?t.historyValue?t.historyValue:e.source?this.machine.historyValue(t.value):void 0:void 0,k=this.getActions(new Set(y),m,e,n,i,t,r),x=t?l({},t.activities):{};try{for(var _=c(k),T=_.next();!T.done;T=_.next()){var C=T.value;try{for(var O=(s=void 0,c(C.actions)),N=O.next();!N.done;N=O.next()){var R=N.value;R.type===h?x[R.activity.id||R.activity.type]=R:R.type===v&&(x[R.activity.id||R.activity.type]=!1)}}catch(e){s={error:e}}finally{try{N&&!N.done&&(u=O.return)&&u.call(O)}finally{if(s)throw s.error}}}}catch(e){a={error:e}}finally{try{T&&!T.done&&(o=_.return)&&o.call(_)}finally{if(a)throw a.error}}var D,P,A=f(me(this,t,n,i,k,r,this.machine.config.predictableActionArguments||this.machine.config.preserveActionOrder),2),M=A[0],L=A[1],U=f(function(e,t){var n,r,i=f([[],[]],2),a=i[0],o=i[1];try{for(var s=c(e),l=s.next();!l.done;l=s.next()){var u=l.value;t(u)?a.push(u):o.push(u)}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return[a,o]}(M,le),2),j=U[0],V=U[1],F=M.filter((function(e){var t;return e.type===h&&(null===(t=e.activity)||void 0===t?void 0:t.type)===E})),z=F.reduce((function(e,t){return e[t.activity.id]=function(e,t,n,r){var i,a=ae(e.src),o=null===(i=null==t?void 0:t.options.services)||void 0===i?void 0:i[a.type],s=e.data?W(e.data,n,r):void 0,l=o?ke(o,e.id,s):we(e.id);return l.meta=e,l}(t.activity,d.machine,L,i),e}),t?l({},t.children):{}),B=new Le({value:S||t.value,context:L,_event:i,_sessionid:t?t._sessionid:null,historyValue:S?w?(D=w,P=S,{current:P,states:$(D,P)}):void 0:t?t.historyValue:void 0,history:!S||e.source?t:void 0,actions:S?V:[],activities:S?x:t?t.activities:{},events:[],configuration:y,transitions:e.transitions,children:z,done:m,tags:Pe(y),machine:this}),H=n!==L;B.changed=i.name===I||H;var q=B.history;q&&delete q.history;var K=!m&&(this._transient||p.some((function(e){return e._transient})));if(!(g||K&&i.name!==et))return B;var Y=B;if(!m)for(K&&(Y=this.resolveRaisedTransition(Y,{type:b},i,r));j.length;){var Q=j.shift();Y=this.resolveRaisedTransition(Y,Q._event,i,r)}var J=Y.changed||(q?!!Y.actions.length||H||typeof q.value!=typeof Y.value||!Ae(Y.value,q.value):void 0);return Y.changed=J,Y.history=q,Y},e.prototype.getStateNode=function(e){if(rt(e))return this.machine.getStateNodeById(e);if(!this.states)throw new Error("Unable to retrieve child state '".concat(e,"' from '").concat(this.id,"'; no child states exist."));var t=this.states[e];if(!t)throw new Error("Child state '".concat(e,"' does not exist on '").concat(this.id,"'"));return t},e.prototype.getStateNodeById=function(e){var t=rt(e)?e.slice(1):e;if(t===this.id)return this;var n=this.machine.idMap[t];if(!n)throw new Error("Child state node '#".concat(t,"' does not exist on machine '").concat(this.id,"'"));return n},e.prototype.getStateNodeByPath=function(e){if("string"==typeof e&&rt(e))try{return this.getStateNodeById(e.slice(1))}catch(e){}for(var t=A(e,this.delimiter).slice(),n=this;t.length;){var r=t.shift();if(!r.length)break;n=n.getStateNode(r)}return n},e.prototype.resolve=function(e){var t,n=this;if(!e)return this.initialStateValue||nt;switch(this.type){case"parallel":return U(this.initialStateValue,(function(t,r){return t?n.getStateNode(r).resolve(e[r]||t):nt}));case"compound":if(G(e)){var r=this.getStateNode(e);return"parallel"===r.type||"compound"===r.type?((t={})[e]=r.initialStateValue,t):e}return Object.keys(e).length?U(e,(function(e,t){return e?n.getStateNode(t).resolve(e):nt})):this.initialStateValue||{};default:return e||nt}},e.prototype.getResolvedPath=function(e){if(rt(e)){var t=this.machine.idMap[e.slice(1)];if(!t)throw new Error("Unable to find state node '".concat(e,"'"));return t.path}return A(e,this.delimiter)},Object.defineProperty(e.prototype,"initialStateValue",{get:function(){var e,t;if(this.__cache.initialStateValue)return this.__cache.initialStateValue;if("parallel"===this.type)t=j(this.states,(function(e){return e.initialStateValue||nt}),(function(e){return!("history"===e.type)}));else if(void 0!==this.initial){if(!this.states[this.initial])throw new Error("Initial state '".concat(this.initial,"' not found on '").concat(this.key,"'"));t=Ee(this.states[this.initial])?this.initial:((e={})[this.initial]=this.states[this.initial].initialStateValue,e)}else t={};return this.__cache.initialStateValue=t,this.__cache.initialStateValue},enumerable:!1,configurable:!0}),e.prototype.getInitialState=function(e,t){this._init();var n=this.getStateNodes(e);return this.resolveTransition({configuration:n,exitSet:[],transitions:[],source:void 0,actions:[]},void 0,null!=t?t:this.machine.context,void 0)},Object.defineProperty(e.prototype,"initialState",{get:function(){var e=this.initialStateValue;if(!e)throw new Error("Cannot retrieve initial state from simple state '".concat(this.id,"'."));return this.getInitialState(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"target",{get:function(){var e;if("history"===this.type){var t=this.config;e=G(t.target)&&rt(t.target)?L(this.machine.getStateNodeById(t.target).path.slice(this.path.length-1)):t.target}return e},enumerable:!1,configurable:!0}),e.prototype.getRelativeStateNodes=function(e,t,n){return void 0===n&&(n=!0),n?"history"===e.type?e.resolveHistory(t):e.initialStateNodes:[e]},Object.defineProperty(e.prototype,"initialStateNodes",{get:function(){var e=this;return Ee(this)?[this]:"compound"!==this.type||this.initial?z(F(this.initialStateValue).map((function(t){return e.getFromRelativePath(t)}))):(R||Y(!1,"Compound state node '".concat(this.id,"' has no initial state.")),[this])},enumerable:!1,configurable:!0}),e.prototype.getFromRelativePath=function(e){if(!e.length)return[this];var t=f(e),n=t[0],r=t.slice(1);if(!this.states)throw new Error("Cannot retrieve subPath '".concat(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 '".concat(n,"' does not exist on '").concat(this.id,"'"));return this.states[n].getFromRelativePath(r)},e.prototype.historyValue=function(e){if(Object.keys(this.states).length)return{current:e||this.initialStateValue,states:j(this.states,(function(t,n){if(!e)return t.historyValue();var r=G(e)?void 0:e[n];return t.historyValue(r||t.initialStateValue)}),(function(e){return!e.history}))}},e.prototype.resolveHistory=function(e){var t=this;if("history"!==this.type)return[this];var n=this.parent;if(!e){var r=this.target;return r?z(F(r).map((function(e){return n.getFromRelativePath(e)}))):n.initialStateNodes}var i,a,o=(i=n.path,a="states",function(e){var t,n,r=e;try{for(var o=c(i),s=o.next();!s.done;s=o.next()){var l=s.value;r=r[a][l]}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return r})(e).current;return G(o)?[n.getStateNode(o)]:z(F(o).map((function(e){return"deep"===t.history?n.getFromRelativePath(e):[n.states[e[0]]]})))},Object.defineProperty(e.prototype,"stateIds",{get:function(){var e=this,t=z(Object.keys(this.states).map((function(t){return e.states[t].stateIds})));return[this.id].concat(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"events",{get:function(){var e,t,n,r;if(this.__cache.events)return this.__cache.events;var i=this.states,a=new Set(this.ownEvents);if(i)try{for(var o=c(Object.keys(i)),s=o.next();!s.done;s=o.next()){var l=i[s.value];if(l.states)try{for(var u=(n=void 0,c(l.events)),f=u.next();!f.done;f=u.next()){var d=f.value;a.add("".concat(d))}}catch(e){n={error:e}}finally{try{f&&!f.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}return this.__cache.events=Array.from(a)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ownEvents",{get:function(){var e=new Set(this.transitions.filter((function(e){return!(!e.target&&!e.actions.length&&e.internal)})).map((function(e){return e.eventType})));return Array.from(e)},enumerable:!1,configurable:!0}),e.prototype.resolveTarget=function(e){var t=this;if(void 0!==e)return e.map((function(e){if(!G(e))return e;var n=e[0]===t.delimiter;if(n&&!t.parent)return t.getStateNodeByPath(e.slice(1));var r=n?t.key+e:e;if(!t.parent)return t.getStateNodeByPath(r);try{return t.parent.getStateNodeByPath(r)}catch(e){throw new Error("Invalid transition definition for state node '".concat(t.id,"':\n").concat(e.message))}}))},e.prototype.formatTransition=function(e){var t=this,n=function(e){if(void 0!==e&&""!==e)return H(e)}(e.target),r="internal"in e?e.internal:!n||n.some((function(e){return G(e)&&e[0]===t.delimiter})),i=this.machine.options.guards,a=this.resolveTarget(n),o=l(l({},e),{actions:de(H(e.actions)),cond:X(e.cond,i),target:a,source:this,internal:r,eventType:e.event,toJSON:function(){return l(l({},o),{target:o.target?o.target.map((function(e){return"#".concat(e.id)})):void 0,source:"#".concat(t.id)})}});return o},e.prototype.formatTransitions=function(){var e,t,n,r=this;if(this.config.on)if(Array.isArray(this.config.on))n=this.config.on;else{var i=this.config.on,a=tt,o=i[a],s=void 0===o?[]:o,l=u(i,["*"]);n=z(Object.keys(l).map((function(e){R||e!==et||Y(!1,"Empty string transition configs (e.g., `{ on: { '': ... }}`) for transient transitions are deprecated. Specify the transition in the `{ always: ... }` property instead. "+'Please check the `on` configuration for "#'.concat(r.id,'".'));var t=re(e,l[e]);return R||function(e,t,n){var r=n.slice(0,-1).some((function(e){return!("cond"in e)&&!("in"in e)&&(G(e.target)||ee(e.target))})),i=t===et?"the transient event":"event '".concat(t,"'");Y(!r,"One or more transitions for ".concat(i," on state '").concat(e.id,"' are unreachable. ")+"Make sure that the default transition is the last one defined.")}(r,e,t),t})).concat(re(tt,s)))}else n=[];var p=this.config.always?re("",this.config.always):[],h=this.config.onDone?re(String(ve(this.id)),this.config.onDone):[];R||Y(!(this.config.onDone&&!this.parent),'Root nodes cannot have an ".onDone" transition. Please check the config of "'.concat(this.id,'".'));var v=z(this.invoke.map((function(e){var t=[];return e.onDone&&t.push.apply(t,d([],f(re(String(ge(e.id)),e.onDone)),!1)),e.onError&&t.push.apply(t,d([],f(re(String(ye(e.id)),e.onError)),!1)),t}))),g=this.after,y=z(d(d(d(d([],f(h),!1),f(v),!1),f(n),!1),f(p),!1).map((function(e){return H(e).map((function(e){return r.formatTransition(e)}))})));try{for(var m=c(g),b=m.next();!b.done;b=m.next()){var S=b.value;y.push(S)}}catch(t){e={error:t}}finally{try{b&&!b.done&&(t=m.return)&&t.call(m)}finally{if(e)throw e.error}}return y},e}();var at=function(e){return{type:S,assignment:e}},ot=n(724);const st=a.useLayoutEffect;function lt(e){var t=a.useRef();return t.current||(t.current={v:e()}),t.current.v}var ut=function(){return ut=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},ut.apply(this,arguments)},ct=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function ft(e,t){var n=lt((function(){return"function"==typeof e?e():e})),r=t.context,i=t.guards,a=t.actions,o=t.activities,s=t.services,l=t.delays,u=(t.state,ct(t,["context","guards","actions","activities","services","delays","state"])),c=lt((function(){var e={context:r,guards:i,actions:a,activities:o,services:s,delays:l};return Ge(n.withConfig(e,(function(){return ut(ut({},n.context),r)})),u)}));return st((function(){Object.assign(c.machine.options.actions,a),Object.assign(c.machine.options.guards,i),Object.assign(c.machine.options.activities,o),Object.assign(c.machine.options.services,s),Object.assign(c.machine.options.delays,l)}),[a,i,o,s,l]),c}var dt=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,a=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o};function pt(e){return e}function ht(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=dt(t,1)[0],i=void 0===r?{}:r,o=ft(e,i),s=(0,a.useCallback)((function(){return o.status===Ye.NotStarted?i.state?Le.create(i.state):o.machine.initialState:o.getSnapshot()}),[o]),l=(0,a.useCallback)((function(e,t){return function(e,t,n){if(e.status===Ye.NotStarted)return!0;var r=void 0===n.changed&&(Object.keys(n.children).length>0||"boolean"==typeof t.changed);return!(n.changed||r)}(o,e,t)}),[o]),u=(0,a.useCallback)((function(e){return o.subscribe(e).unsubscribe}),[o]),c=(0,ot.useSyncExternalStoreWithSelector)(u,s,s,pt,l);return(0,a.useEffect)((function(){var e=i.state;return o.start(e?Le.create(e):void 0),function(){o.stop(),o.status=Ye.NotStarted}}),[]),[c,o.send,o]}var vt=n(307);const gt={NO_NEVER:-1,CANCEL:0,CREATE_REPORT:1,ADD_SERIES:2,SET_STUDY_AND_SERIES:3,NO_NOT_FOR_SERIES:4,HYDRATE_REPORT:5},yt={id:"measurementTracking",initial:"idle",context:{activeViewportId:null,trackedStudy:"",trackedSeries:[],ignoredSeries:[],prevTrackedStudy:"",prevTrackedSeries:[],prevIgnoredSeries:[],ignoredSRSeriesForHydration:[],isDirty:!1},states:{off:{type:"final"},labellingOnly:{on:{TRACK_SERIES:[{target:"promptLabelAnnotation",actions:["setPreviousState"]},{target:"off"}]}},idle:{entry:"clearContext",on:{TRACK_SERIES:[{target:"promptLabelAnnotation",cond:"isLabelOnMeasure",actions:["setPreviousState"]},{target:"promptBeginTracking",actions:["setPreviousState"]}],SET_TRACKED_SERIES:[{target:"tracking",actions:["setTrackedStudyAndMultipleSeries","setIsDirtyToClean"]}],PROMPT_HYDRATE_SR:{target:"promptHydrateStructuredReport",cond:"hasNotIgnoredSRSeriesForHydration"},RESTORE_PROMPT_HYDRATE_SR:"promptHydrateStructuredReport",HYDRATE_SR:"hydrateStructuredReport",UPDATE_ACTIVE_VIEWPORT_ID:{actions:at({activeViewportId:(e,t)=>t.activeViewportId})}}},promptBeginTracking:{invoke:{src:"promptBeginTracking",onDone:[{target:"tracking",actions:["setTrackedStudyAndSeries","setIsDirty"],cond:"shouldSetStudyAndSeries"},{target:"labellingOnly",cond:"isLabelOnMeasureAndShouldKillMachine"},{target:"off",cond:"shouldKillMachine"},{target:"idle"}],onError:{target:"idle"}}},tracking:{on:{TRACK_SERIES:[{target:"promptLabelAnnotation",cond:"isLabelOnMeasure",actions:["setPreviousState"]},{target:"promptTrackNewStudy",cond:"isNewStudy"},{target:"promptTrackNewSeries",cond:"isNewSeries"}],UNTRACK_SERIES:[{target:"tracking",actions:["removeTrackedSeries","setIsDirty"],cond:"hasRemainingTrackedSeries"},{target:"idle"}],SET_TRACKED_SERIES:[{target:"tracking",actions:["setTrackedStudyAndMultipleSeries"]}],SAVE_REPORT:"promptSaveReport",SET_DIRTY:[{target:"tracking",actions:["setIsDirty"],cond:"shouldSetDirty"},{target:"tracking"}]}},promptTrackNewSeries:{invoke:{src:"promptTrackNewSeries",onDone:[{target:"tracking",actions:["addTrackedSeries","setIsDirty"],cond:"shouldAddSeries"},{target:"tracking",actions:["discardPreviouslyTrackedMeasurements","setTrackedStudyAndSeries","setIsDirty"],cond:"shouldSetStudyAndSeries"},{target:"promptSaveReport",cond:"shouldPromptSaveReport"},{target:"tracking"}],onError:{target:"idle"}}},promptTrackNewStudy:{invoke:{src:"promptTrackNewStudy",onDone:[{target:"tracking",actions:["discardPreviouslyTrackedMeasurements","setTrackedStudyAndSeries","setIsDirty"],cond:"shouldSetStudyAndSeries"},{target:"tracking",actions:["ignoreSeries"],cond:"shouldAddIgnoredSeries"},{target:"promptSaveReport",cond:"shouldPromptSaveReport"},{target:"tracking"}],onError:{target:"idle"}}},promptSaveReport:{invoke:{src:"promptSaveReport",onDone:[{target:"idle",actions:["clearAllMeasurements","showStructuredReportDisplaySetInActiveViewport"],cond:"shouldSaveAndContinueWithSameReport"},{target:"tracking",actions:["discardPreviouslyTrackedMeasurements","setTrackedStudyAndSeries"],cond:"shouldSaveAndStartNewReport"},{target:"tracking"}],onError:{target:"idle"}}},promptHydrateStructuredReport:{invoke:{src:"promptHydrateStructuredReport",onDone:[{target:"tracking",actions:["setTrackedStudyAndMultipleSeries","jumpToFirstMeasurementInActiveViewport","setIsDirtyToClean"],cond:"shouldHydrateStructuredReport"},{target:"idle",actions:["ignoreHydrationForSRSeries"],cond:"shouldIgnoreHydrationForSR"}],onError:{target:"idle"}}},hydrateStructuredReport:{invoke:{src:"hydrateStructuredReport",onDone:[{target:"tracking",actions:["setTrackedStudyAndMultipleSeries","jumpToFirstMeasurementInActiveViewport","setIsDirtyToClean"]}],onError:{target:"idle"}}},promptLabelAnnotation:{invoke:{src:"promptLabelAnnotation",onDone:[{target:"labellingOnly",cond:"wasLabellingOnly"},{target:"promptBeginTracking",cond:"wasIdle"},{target:"promptTrackNewStudy",cond:"wasTrackingAndIsNewStudy"},{target:"promptTrackNewSeries",cond:"wasTrackingAndIsNewSeries"},{target:"tracking",cond:"wasTracking"},{target:"off"}]}}},strict:!0},mt={services:{promptBeginTracking:(e,t)=>{},promptTrackNewStudy:(e,t)=>{},promptTrackNewSeries:(e,t)=>{}},actions:{discardPreviouslyTrackedMeasurements:(e,t)=>{console.log("discardPreviouslyTrackedMeasurements: not implemented")},clearAllMeasurements:(e,t)=>{console.log("clearAllMeasurements: not implemented")},jumpToFirstMeasurementInActiveViewport:(e,t)=>{console.warn("jumpToFirstMeasurementInActiveViewport: not implemented")},showStructuredReportDisplaySetInActiveViewport:(e,t)=>{console.warn("showStructuredReportDisplaySetInActiveViewport: not implemented")},clearContext:at({trackedStudy:"",trackedSeries:[],ignoredSeries:[],prevTrackedStudy:"",prevTrackedSeries:[],prevIgnoredSeries:[]}),setTrackedStudyAndSeries:at(((e,t)=>({prevTrackedStudy:e.trackedStudy,prevTrackedSeries:e.trackedSeries.slice(),prevIgnoredSeries:e.ignoredSeries.slice(),trackedStudy:t.data.StudyInstanceUID,trackedSeries:[t.data.SeriesInstanceUID],ignoredSeries:[]}))),setTrackedStudyAndMultipleSeries:at(((e,t)=>{const n=t.StudyInstanceUID||t.data.StudyInstanceUID,r=t.SeriesInstanceUIDs||t.data.SeriesInstanceUIDs;return{prevTrackedStudy:e.trackedStudy,prevTrackedSeries:e.trackedSeries.slice(),prevIgnoredSeries:e.ignoredSeries.slice(),trackedStudy:n,trackedSeries:[...e.trackedSeries,...r],ignoredSeries:[]}})),setIsDirtyToClean:at(((e,t)=>({isDirty:!1}))),setIsDirty:at(((e,t)=>({isDirty:!0}))),ignoreSeries:at(((e,t)=>({prevIgnoredSeries:[...e.ignoredSeries],ignoredSeries:[...e.ignoredSeries,t.data.SeriesInstanceUID]}))),ignoreHydrationForSRSeries:at(((e,t)=>({ignoredSRSeriesForHydration:[...e.ignoredSRSeriesForHydration,t.data.srSeriesInstanceUID]}))),addTrackedSeries:at(((e,t)=>({prevTrackedSeries:[...e.trackedSeries],trackedSeries:[...e.trackedSeries,t.data.SeriesInstanceUID]}))),removeTrackedSeries:at(((e,t)=>({prevTrackedSeries:e.trackedSeries.slice().filter((e=>e!==t.SeriesInstanceUID)),trackedSeries:e.trackedSeries.slice().filter((e=>e!==t.SeriesInstanceUID))}))),setPreviousState:at(((e,t,n)=>({prevState:n.state.value})))},guards:{shouldSetDirty:(e,t)=>void 0===t.SeriesInstanceUID||e.trackedSeries.includes(t.SeriesInstanceUID),wasLabellingOnly:(e,t,n)=>"labellingOnly"===e.prevState,wasIdle:(e,t,n)=>"idle"===e.prevState,wasTracking:(e,t,n)=>"tracking"===e.prevState,wasTrackingAndIsNewStudy:(e,t,n)=>"tracking"===e.prevState&&!e.ignoredSeries.includes(t.data.SeriesInstanceUID)&&e.trackedStudy!==t.data.StudyInstanceUID,wasTrackingAndIsNewSeries:(e,t,n)=>"tracking"===e.prevState&&!e.ignoredSeries.includes(t.data.SeriesInstanceUID)&&!e.trackedSeries.includes(t.data.SeriesInstanceUID),shouldKillMachine:(e,t)=>t.data&&t.data.userResponse===gt.NO_NEVER,shouldAddSeries:(e,t)=>t.data&&t.data.userResponse===gt.ADD_SERIES,shouldSetStudyAndSeries:(e,t)=>t.data&&t.data.userResponse===gt.SET_STUDY_AND_SERIES,shouldAddIgnoredSeries:(e,t)=>t.data&&t.data.userResponse===gt.NO_NOT_FOR_SERIES,shouldPromptSaveReport:(e,t)=>t.data&&t.data.userResponse===gt.CREATE_REPORT,shouldIgnoreHydrationForSR:(e,t)=>t.data&&t.data.userResponse===gt.CANCEL,shouldSaveAndContinueWithSameReport:(e,t)=>t.data&&t.data.userResponse===gt.CREATE_REPORT&&!0===t.data.isBackupSave,shouldSaveAndStartNewReport:(e,t)=>t.data&&t.data.userResponse===gt.CREATE_REPORT&&!1===t.data.isBackupSave,shouldHydrateStructuredReport:(e,t)=>t.data&&t.data.userResponse===gt.HYDRATE_REPORT,hasRemainingTrackedSeries:(e,t)=>e.trackedSeries.length>1||!e.trackedSeries.includes(t.SeriesInstanceUID),hasNotIgnoredSRSeriesForHydration:(e,t)=>!e.ignoredSRSeriesForHydration.includes(t.SeriesInstanceUID),isNewStudy:(e,t)=>!e.ignoredSeries.includes(t.SeriesInstanceUID)&&e.trackedStudy!==t.StudyInstanceUID,isNewSeries:(e,t)=>!e.ignoredSeries.includes(t.SeriesInstanceUID)&&!e.trackedSeries.includes(t.SeriesInstanceUID)}};var bt=n(625);const St={NO_NEVER:-1,CANCEL:0,CREATE_REPORT:1,ADD_SERIES:2,SET_STUDY_AND_SERIES:3};const wt=function({servicesManager:e,extensionManager:t},n,r){const{uiViewportDialogService:i}=e.services,{viewportId:a,StudyInstanceUID:o,SeriesInstanceUID:s}=r.data||r;return new Promise((async function(e,t){let n=await function(e,t){return new Promise((function(n,r){const i=bt.A.t("MeasurementTable:Track measurements for this series?"),a=[{id:"prompt-begin-tracking-cancel",type:vt.ButtonEnums.type.secondary,text:bt.A.t("Common:No"),value:St.CANCEL},{id:"prompt-begin-tracking-no-do-not-ask-again",type:vt.ButtonEnums.type.secondary,text:bt.A.t("MeasurementTable:No, do not ask again"),value:St.NO_NEVER},{id:"prompt-begin-tracking-yes",type:vt.ButtonEnums.type.primary,text:bt.A.t("Common:Yes"),value:St.SET_STUDY_AND_SERIES}],o=t=>{e.hide(),n(t)};e.show({viewportId:t,id:"measurement-tracking-prompt-begin-tracking",type:"info",message:i,actions:a,onSubmit:o,onOutsideClick:()=>{e.hide(),n(St.CANCEL)},onKeyPress:e=>{if("Enter"===e.key){const e=a.find((e=>"prompt-begin-tracking-yes"===e.id));o(e.value)}}})}))}(i,a);e({userResponse:n,StudyInstanceUID:o,SeriesInstanceUID:s,viewportId:a})}))},kt={NO_NEVER:-1,CANCEL:0,CREATE_REPORT:1,ADD_SERIES:2,SET_STUDY_AND_SERIES:3,NO_NOT_FOR_SERIES:4};const Et=function({servicesManager:e,extensionManager:t},n,r){const{UIViewportDialogService:i}=e.services,{viewportId:a,StudyInstanceUID:o,SeriesInstanceUID:s}=r.data||r;return new Promise((async function(e,t){let r=await function(e,t){return new Promise((function(n,r){const i="Do you want to add this measurement to the existing report?",a=[{type:vt.ButtonEnums.type.secondary,text:"Cancel",value:kt.CANCEL},{type:vt.ButtonEnums.type.primary,text:"Create new report",value:kt.CREATE_REPORT},{type:vt.ButtonEnums.type.primary,text:"Add to existing report",value:kt.ADD_SERIES}],o=t=>{e.hide(),n(t)};e.show({viewportId:t,type:"info",message:i,actions:a,onSubmit:o,onOutsideClick:()=>{e.hide(),n(kt.CANCEL)}})}))}(i,a);r===kt.CREATE_REPORT&&(r=n.isDirty?await function(e,t){return new Promise((function(n,r){const i="You have existing tracked measurements. What would you like to do with your existing tracked measurements?",a=[{type:"cancel",text:"Cancel",value:kt.CANCEL},{type:"secondary",text:"Save",value:kt.CREATE_REPORT},{type:"primary",text:"Discard",value:kt.SET_STUDY_AND_SERIES}],o=t=>{e.hide(),n(t)};e.show({viewportId:t,type:"warning",message:i,actions:a,onSubmit:o,onOutsideClick:()=>{e.hide(),n(kt.CANCEL)}})}))}(i,a):kt.SET_STUDY_AND_SERIES),e({userResponse:r,StudyInstanceUID:o,SeriesInstanceUID:s,viewportId:a,isBackupSave:!1})}))},xt={NO_NEVER:-1,CANCEL:0,CREATE_REPORT:1,ADD_SERIES:2,SET_STUDY_AND_SERIES:3,NO_NOT_FOR_SERIES:4};const _t=function({servicesManager:e,extensionManager:t},n,r){const{uiViewportDialogService:i}=e.services,{viewportId:a,StudyInstanceUID:o,SeriesInstanceUID:s}=r.data||r;return new Promise((async function(e,t){let r=await function(e,t){return new Promise((function(n,r){const i=bt.A.t("MeasurementTable:Track measurements for this series?"),a=[{type:"cancel",text:bt.A.t("MeasurementTable:No"),value:xt.CANCEL},{type:"secondary",text:bt.A.t("MeasurementTable:No, do not ask again"),value:xt.NO_NOT_FOR_SERIES},{type:"primary",text:bt.A.t("MeasurementTable:Yes"),value:xt.SET_STUDY_AND_SERIES}],o=t=>{e.hide(),n(t)};e.show({viewportId:t,type:"info",message:i,actions:a,onSubmit:o,onOutsideClick:()=>{e.hide(),n(xt.CANCEL)},onKeyPress:e=>{if("Enter"===e.key){const e=a.find((e=>e.value===xt.SET_STUDY_AND_SERIES));o(e.value)}}})}))}(i,a);r===xt.SET_STUDY_AND_SERIES&&(r=n.isDirty?await function(e,t){return new Promise((function(n,r){const i="Measurements cannot span across multiple studies. Do you want to save your tracked measurements?",a=[{type:"cancel",text:"Cancel",value:xt.CANCEL},{type:"secondary",text:"No, discard previously tracked series & measurements",value:xt.SET_STUDY_AND_SERIES},{type:"primary",text:"Yes",value:xt.CREATE_REPORT}],o=t=>{e.hide(),n(t)};e.show({viewportId:t,type:"warning",message:i,actions:a,onSubmit:o,onOutsideClick:()=>{e.hide(),n(xt.CANCEL)}})}))}(i,a):xt.SET_STUDY_AND_SERIES),e({userResponse:r,StudyInstanceUID:o,SeriesInstanceUID:s,viewportId:a,isBackupSave:!1})}))};var It=n(438);const Tt=4700;const Ct={NO_NEVER:-1,CANCEL:0,CREATE_REPORT:1,ADD_SERIES:2,SET_STUDY_AND_SERIES:3,NO_NOT_FOR_SERIES:4};const Ot=function({servicesManager:e,commandsManager:t,extensionManager:n},r,i){const{uiDialogService:a,measurementService:o,displaySetService:s}=e.services,l=void 0===i.viewportId?i.data.viewportId:i.viewportId,u=void 0===i.isBackupSave?i.data.isBackupSave:i.isBackupSave,c=i?.data?.StudyInstanceUID,f=i?.data?.SeriesInstanceUID,{trackedStudy:d,trackedSeries:p}=r;let h;return new Promise((async function(r,i){const v=await(0,It.createReportDialogPrompt)(a,{extensionManager:n});if(v.action===Ct.CREATE_REPORT){const r=n.getDataSources()[0],i=o.getMeasurements().filter((e=>d===e.referenceStudyUID&&p.includes(e.referenceSeriesUID))),a=void 0===v.value||""===v.value?"Research Derived Series":v.value,l=function(e){const t=e.getActiveDisplaySets().filter((e=>"SR"===e.Modality)).map((e=>e.SeriesNumber));return Math.max(...t,Tt)+1}(s),u=async()=>t.runCommand("storeMeasurements",{measurementData:i,dataSource:r,additionalFindingTypes:["ArrowAnnotate"],options:{SeriesDescription:a,SeriesNumber:l}},"CORNERSTONE_STRUCTURED_REPORT");h=await(0,It.createReportAsync)({servicesManager:e,getReport:u})}else v.action;r({userResponse:v.action,createdDisplaySetInstanceUIDs:h,StudyInstanceUID:c,SeriesInstanceUID:f,viewportId:l,isBackupSave:u})}))};var Nt=n(838);const Rt={NO_NEVER:-1,CANCEL:0,CREATE_REPORT:1,ADD_SERIES:2,SET_STUDY_AND_SERIES:3,NO_NOT_FOR_SERIES:4,HYDRATE_REPORT:5};const Dt=function({servicesManager:e,extensionManager:t,appConfig:n},r,i){const{uiViewportDialogService:a,displaySetService:o}=e.services,{viewportId:s,displaySetInstanceUID:l}=i,u=o.getDisplaySetByUID(l);return new Promise((async function(r,o){const c=await function(e,t){return new Promise((function(n,r){const i="Do you want to continue tracking measurements for this study?",a=[{type:vt.ButtonEnums.type.secondary,text:"No",value:Rt.CANCEL},{type:vt.ButtonEnums.type.primary,text:"Yes",value:Rt.HYDRATE_REPORT}],o=t=>{e.hide(),n(t)};e.show({viewportId:t,type:"info",message:i,actions:a,onSubmit:o,onOutsideClick:()=>{e.hide(),n(Rt.CANCEL)},onKeyPress:e=>{if("Enter"===e.key){const e=a.find((e=>e.value===Rt.HYDRATE_REPORT));o(e.value)}}})}))}(a,s);let f,d;if(c===Rt.HYDRATE_REPORT){console.warn("!! HYDRATING STRUCTURED REPORT");const r=(0,Nt.hydrateStructuredReport)({servicesManager:e,extensionManager:t,appConfig:n},l);f=r.StudyInstanceUID,d=r.SeriesInstanceUIDs}r({userResponse:c,displaySetInstanceUID:i.displaySetInstanceUID,srSeriesInstanceUID:u.SeriesInstanceUID,viewportId:s,StudyInstanceUID:f,SeriesInstanceUIDs:d})}))};const Pt=function({servicesManager:e,extensionManager:t,appConfig:n},r,i){const{displaySetService:a}=e.services,{viewportId:o,displaySetInstanceUID:s}=i,l=a.getDisplaySetByUID(s);return new Promise(((r,a)=>{const u=(0,Nt.hydrateStructuredReport)({servicesManager:e,extensionManager:t,appConfig:n},s),c=u.StudyInstanceUID,f=u.SeriesInstanceUIDs;r({displaySetInstanceUID:i.displaySetInstanceUID,srSeriesInstanceUID:l.SeriesInstanceUID,viewportId:o,StudyInstanceUID:c,SeriesInstanceUIDs:f})}))};var At=n(497);const Mt=function({servicesManager:e,extensionManager:t},n,r){const{measurementService:i,customizationService:a}=e.services,{viewportId:o,StudyInstanceUID:s,SeriesInstanceUID:l,measurementId:u}=r,c=t.getModuleEntry("@ohif/extension-cornerstone.utilityModule.common"),{showLabelAnnotationPopup:f}=c.exports;return new Promise((async function(t){const n=a.get("measurementLabels"),r=i.getMeasurement(u),c=await f(r,e.services.uiDialogService,n);i.update(u,{...c},!0),t({StudyInstanceUID:s,SeriesInstanceUID:l,viewportId:o})}))},Lt=a.createContext();Lt.displayName="TrackedMeasurementsContext";const Ut=()=>(0,a.useContext)(Lt),jt="@ohif/extension-cornerstone-dicom-sr.sopClassHandlerModule.dicom-sr";function Vt({servicesManager:e,commandsManager:t,extensionManager:n},{children:r}){const[i]=(0,At.r)(),[o,s]=(0,vt.useViewportGrid)(),{activeViewportId:l,viewports:u}=o,{measurementService:c,displaySetService:f,customizationService:d}=e.services,p=Object.assign({},mt);p.actions=Object.assign({},p.actions,{jumpToFirstMeasurementInActiveViewport:(e,t)=>{const{trackedStudy:n,trackedSeries:r,activeViewportId:i}=e,a=c.getMeasurements().filter((e=>n===e.referenceStudyUID&&r.includes(e.referenceSeriesUID)));console.log("jumping to measurement reset viewport",i,a[0]);const o=a[0].displaySetInstanceUID,l=f.getDisplaySetByUID(o).images,u=l[0].imageId.startsWith("volumeId"),d=a[0].data;let p=0;!u&&d&&(p=l.findIndex((e=>{const t=Object.keys(d)[0].substring(8);return e.imageId===t})),-1===p&&(console.warn("Could not find image index for tracked measurement, using 0"),p=0)),s.setDisplaySetsForViewport({viewportId:i,displaySetInstanceUIDs:[o],viewportOptions:{initialImageOptions:{index:p}}})},showStructuredReportDisplaySetInActiveViewport:(e,t)=>{if(t.data.createdDisplaySetInstanceUIDs.length>0){const e=t.data.createdDisplaySetInstanceUIDs[0];s.setDisplaySetsForViewport({viewportId:t.data.viewportId,displaySetInstanceUIDs:[e]})}},discardPreviouslyTrackedMeasurements:(e,t)=>{const n=c.getMeasurements().filter((t=>e.prevTrackedSeries.includes(t.referenceSeriesUID))).map((e=>e.id));for(let e=0;e<n.length;e++)c.remove(n[e])},clearAllMeasurements:(e,t)=>{const n=c.getMeasurements().map((e=>e.uid));for(let e=0;e<n.length;e++)c.remove(n[e])}}),p.services=Object.assign({},p.services,{promptBeginTracking:wt.bind(null,{servicesManager:e,extensionManager:n,appConfig:i}),promptTrackNewSeries:Et.bind(null,{servicesManager:e,extensionManager:n,appConfig:i}),promptTrackNewStudy:_t.bind(null,{servicesManager:e,extensionManager:n,appConfig:i}),promptSaveReport:Ot.bind(null,{servicesManager:e,commandsManager:t,extensionManager:n,appConfig:i}),promptHydrateStructuredReport:Dt.bind(null,{servicesManager:e,extensionManager:n,appConfig:i}),hydrateStructuredReport:Pt.bind(null,{servicesManager:e,extensionManager:n,appConfig:i}),promptLabelAnnotation:Mt.bind(null,{servicesManager:e,extensionManager:n})}),p.guards=Object.assign({},p.guards,{isLabelOnMeasure:(e,t,n)=>{const r=d.get("measurementLabels");return r?.labelOnMeasure},isLabelOnMeasureAndShouldKillMachine:(e,t,n)=>{const r=d.get("measurementLabels");return t.data&&t.data.userResponse===gt.NO_NEVER&&r?.labelOnMeasure}});const h=(v=yt,g=p,void 0===y&&(y=v.context),new it(v,g,y));var v,g,y;const[m,b]=ht(h);return(0,a.useEffect)((()=>{b("UPDATE_ACTIVE_VIEWPORT_ID",{activeViewportId:l})}),[l,b]),(0,a.useEffect)((()=>{(async()=>{if(u.size>0){const t=u.get(l);if(!t||!t?.displaySetInstanceUIDs?.length)return;const{displaySetService:n}=e.services,r=n.getDisplaySetByUID(t.displaySetInstanceUIDs[0]);if(!r)return;r.SOPClassHandlerId===jt&&!r.isLoaded&&r.load&&await r.load(),r.SOPClassHandlerId===jt&&!0===r.isRehydratable&&(console.log("sending event...",m),b("PROMPT_HYDRATE_SR",{displaySetInstanceUID:r.displaySetInstanceUID,SeriesInstanceUID:r.SeriesInstanceUID,viewportId:l}))}})()}),[m,l,b,e.services,u]),a.createElement(Lt.Provider,{value:[m,b]},r)}Vt.propTypes={children:s().oneOf([s().func,s().node]),servicesManager:s().object.isRequired,commandsManager:s().object.isRequired,extensionManager:s().object.isRequired,appConfig:s().object};const Ft=function({servicesManager:e,extensionManager:t,commandsManager:n}){const r=Vt.bind(null,{servicesManager:e,extensionManager:t,commandsManager:n});return[{name:"TrackedMeasurementsContext",context:Lt,provider:r}]}},915:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>h});var r=n(766),i=n(374),a=n.n(i),o=n(307),s=n(713),l=n(946),u=n(557),c=n(871);function f(){return f=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},f.apply(this,arguments)}function d(e){const{displaySets:t,viewportId:n,servicesManager:i,extensionManager:a}=e,{measurementService:d,cornerstoneViewportService:h,viewportGridService:v,viewportActionCornersService:g}=i.services,y=t[0],{t:m}=(0,c.Bd)("Common"),[b]=(0,o.useViewportGrid)(),{activeViewportId:S}=b,[w,k]=(0,l.B)(),[E,x]=(0,r.useState)(!1),[_,I]=(0,r.useState)(null),[T,C]=(0,r.useState)(null),{trackedSeries:O}=w.context,{SeriesInstanceUID:N}=y,R=(0,r.useCallback)((()=>{const e=h.getCornerstoneViewport(n);if(e instanceof u.BaseVolumeViewport){const t=e?.getCurrentImageId();if(!t)return void(E&&x(!1))}O.includes(N)!==E&&x(!E)}),[E,w,n,N]),D=(0,r.useCallback)((e=>{e.detail.element!==T&&(e.detail.element?.addEventListener(u.Enums.Events.VOLUME_VIEWPORT_NEW_VOLUME,R),C(e.detail.element))}),[R,T]),P=(0,r.useCallback)((()=>{T?.removeEventListener(u.Enums.Events.VOLUME_VIEWPORT_NEW_VOLUME,R)}),[R,T]);(0,r.useEffect)(R,[R]),(0,r.useEffect)((()=>{const{unsubscribe:e}=h.subscribe(h.EVENTS.VIEWPORT_DATA_CHANGED,(e=>{e.viewportId===n&&R()}));return()=>{e()}}),[R,n]),(0,r.useEffect)((()=>E?(s.annotation.config.style.setViewportToolStyles(n,{global:{lineDash:""}}),void h.getRenderingEngine().renderViewport(n)):(s.annotation.config.style.setViewportToolStyles(n,{global:{lineDash:"4,4"}}),h.getRenderingEngine().renderViewport(n),()=>{s.annotation.config.style.setViewportToolStyles(n,{})})),[E]),(0,r.useEffect)((()=>{const e=d.EVENTS.MEASUREMENT_ADDED,t=d.EVENTS.RAW_MEASUREMENT_ADDED,r=[];return[e,t].forEach((e=>{r.push(d.subscribe(e,(({source:e,measurement:t})=>{const{activeViewportId:r}=v.getState();if(n===r){const{referenceStudyUID:e,referenceSeriesUID:r,uid:i}=t;k("SET_DIRTY",{SeriesInstanceUID:r}),k("TRACK_SERIES",{viewportId:n,StudyInstanceUID:e,SeriesInstanceUID:r,measurementId:i})}})).unsubscribe)})),()=>{r.forEach((e=>{e()}))}}),[d,k,n,v]);const A=(0,r.useCallback)((e=>{const t=function(e,t,n,r){const{measurementService:i,viewportGridService:a}=t.services,o=i.getMeasurements(),{activeViewportId:s,viewports:l}=a.getState(),{displaySetInstanceUIDs:u}=l.get(s),{trackedSeries:c}=r.context,f=o.filter((e=>c.includes(e.referenceSeriesUID)&&u.includes(e.displaySetInstanceUID)));if(!f.length)return;const d=f.length,p=f.map((e=>e.uid));let h=p.findIndex((e=>e===n));-1===h?h=0:(h+=e,h<0?h=d-1:h===d&&(h=0));return p[h]}(e,i,_,w);t&&(I(t),d.jumpToMeasurement(n,t))}),[d,i,_,w,n]);(0,r.useEffect)((()=>{const e=function(e,t){if(!e)return null;return r.createElement("div",{className:"relative"},r.createElement(o.Tooltip,{position:"bottom-left",content:r.createElement("div",{className:"flex py-2"},r.createElement("div",{className:"flex pt-1"},r.createElement(o.Icon,{name:"info-link",className:"text-primary-main w-4"})),r.createElement("div",{className:"ml-4 flex"},r.createElement("span",{className:"text-common-light text-base"},e?r.createElement(r.Fragment,null,t("Series is tracked and can be viewed in the measurement panel")):r.createElement(r.Fragment,null,t("Measurements for untracked series will not be shown in the measurements panel")))))},r.createElement(o.Icon,{name:"viewport-status-tracked",className:"text-aqua-pale"})))}(E,m),t=p(E,A,n===S);g.setComponents([{viewportId:n,id:"viewportStatusComponent",component:e,indexPriority:-100,location:g.LOCATIONS.topLeft},{viewportId:n,id:"viewportActionArrowsComponent",component:t,indexPriority:0,location:g.LOCATIONS.topRight}])}),[S,E,A,g,n]);return r.createElement(r.Fragment,null,r.createElement("div",{className:"relative flex h-full w-full flex-row overflow-hidden"},(()=>{const{component:t}=a.getModuleEntry("@ohif/extension-cornerstone.viewportModule.cornerstone");return r.createElement(t,f({},e,{onElementEnabled:t=>{e.onElementEnabled?.(t),D(t)},onElementDisabled:P}))})()))}d.propTypes={displaySets:a().arrayOf(a().object.isRequired).isRequired,viewportId:a().string.isRequired,dataSource:a().object,children:a().node,customProps:a().object},d.defaultProps={customProps:{}};const p=(e,t,n)=>e?r.createElement(o.ViewportActionArrows,{onArrowsClick:e=>t(e),className:n?"visible":"invisible group-hover:visible"}):null;const h=d},497:(e,t,n)=>{"use strict";n.d(t,{r:()=>l});var r=n(766),i=n(374),a=n.n(i);const o=(0,r.createContext)(null),{Provider:s}=o,l=()=>(0,r.useContext)(o);function u({children:e,value:t}){const[n,i]=(0,r.useState)(t);return r.createElement(s,{value:[n]},e)}u.propTypes={children:a().any,value:a().any}},625:(e,t,n)=>{"use strict";n.d(t,{A:()=>B});var r=n(888),i=n(719);function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&r.push.apply(r,Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach((function(t){(0,i.A)(e,t,n[t])}))}return e}var o=n(833),s=n(393);function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u(e,t){if(t&&("object"===(0,r.A)(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return l(e)}function c(e){return c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},c(e)}function f(e,t){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},f(e,t)}function d(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&f(e,t)}var p=n(333);var h=n(860);function v(e){return function(e){if(Array.isArray(e))return(0,p.A)(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||(0,h.A)(e)||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.")}()}var g=n(757),y={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,t){var n;console&&console[e]&&(n=console)[e].apply(n,v(t))}},m=new(function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,o.A)(this,e),this.init(t,n)}return(0,s.A)(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||y,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"log","",!0)}},{key:"warn",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","",!0)}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"error","")}},{key:"deprecate",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(e,t,n,r){return r&&!this.debug?null:("string"==typeof e[0]&&(e[0]="".concat(n).concat(this.prefix," ").concat(e[0])),this.logger[t](e))}},{key:"create",value:function(t){return new e(this.logger,a({},{prefix:"".concat(this.prefix,":").concat(t,":")},this.options))}}]),e}()),b=function(){function e(){(0,o.A)(this,e),this.observers={}}return(0,s.A)(e,[{key:"on",value:function(e,t){var n=this;return e.split(" ").forEach((function(e){n.observers[e]=n.observers[e]||[],n.observers[e].push(t)})),this}},{key:"off",value:function(e,t){this.observers[e]&&(t?this.observers[e]=this.observers[e].filter((function(e){return e!==t})):delete this.observers[e])}},{key:"emit",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];this.observers[e]&&[].concat(this.observers[e]).forEach((function(e){e.apply(void 0,n)}));this.observers["*"]&&[].concat(this.observers["*"]).forEach((function(t){t.apply(t,[e].concat(n))}))}}]),e}();function S(){var e,t,n=new Promise((function(n,r){e=n,t=r}));return n.resolve=e,n.reject=t,n}function w(e){return null==e?"":""+e}function k(e,t,n){function r(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function i(){return!e||"string"==typeof e}for(var a="string"!=typeof t?[].concat(t):t.split(".");a.length>1;){if(i())return{};var o=r(a.shift());!e[o]&&n&&(e[o]=new n),e=e[o]}return i()?{}:{obj:e,k:r(a.shift())}}function E(e,t,n){var r=k(e,t,Object);r.obj[r.k]=n}function x(e,t){var n=k(e,t),r=n.obj,i=n.k;if(r)return r[i]}function _(e,t,n){var r=x(e,n);return void 0!==r?r:x(t,n)}function I(e,t,n){for(var r in t)r in e?"string"==typeof e[r]||e[r]instanceof String||"string"==typeof t[r]||t[r]instanceof String?n&&(e[r]=t[r]):I(e[r],t[r],n):e[r]=t[r];return e}function T(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var C={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function O(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return C[e]})):e}var N=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return(0,o.A)(this,t),n=u(this,c(t).call(this)),b.call(l(n)),n.data=e||{},n.options=r,void 0===n.options.keySeparator&&(n.options.keySeparator="."),n}return d(t,e),(0,s.A)(t,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,a=[e,t];return n&&"string"!=typeof n&&(a=a.concat(n)),n&&"string"==typeof n&&(a=a.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(a=e.split(".")),x(this.data,a)}},{key:"addResource",value:function(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},a=this.options.keySeparator;void 0===a&&(a=".");var o=[e,t];n&&(o=o.concat(a?n.split(a):n)),e.indexOf(".")>-1&&(r=t,t=(o=e.split("."))[1]),this.addNamespaces(t),E(this.data,o,r),i.silent||this.emit("added",e,t,n,r)}},{key:"addResources",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var i in n)"string"!=typeof n[i]&&"[object Array]"!==Object.prototype.toString.apply(n[i])||this.addResource(e,t,i,n[i],{silent:!0});r.silent||this.emit("added",e,t,n)}},{key:"addResourceBundle",value:function(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},s=[e,t];e.indexOf(".")>-1&&(r=n,n=t,t=(s=e.split("."))[1]),this.addNamespaces(t);var l=x(this.data,s)||{};r?I(l,n,i):l=a({},l,n),E(this.data,s,l),o.silent||this.emit("added",e,t,n)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?a({},{},this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"toJSON",value:function(){return this.data}}]),t}(b),R={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,n,r,i){var a=this;return e.forEach((function(e){a.processors[e]&&(t=a.processors[e].process(t,n,r,i))})),t}},D=function(e){function t(e){var n,r,i,a,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,o.A)(this,t),n=u(this,c(t).call(this)),b.call(l(n)),r=["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],i=e,a=l(n),r.forEach((function(e){i[e]&&(a[e]=i[e])})),n.options=s,void 0===n.options.keySeparator&&(n.options.keySeparator="."),n.logger=m.create("translator"),n}return d(t,e),(0,s.A)(t,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},n=this.resolve(e,t);return n&&void 0!==n.res}},{key:"extractFromKey",value:function(e,t){var n=t.nsSeparator||this.options.nsSeparator;void 0===n&&(n=":");var r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,i=t.ns||this.options.defaultNS;if(n&&e.indexOf(n)>-1){var a=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(a[0])>-1)&&(i=a.shift()),e=a.join(r)}return"string"==typeof i&&(i=[i]),{key:e,namespaces:i}}},{key:"translate",value:function(e,t){var n=this;if("object"!==(0,r.A)(t)&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var i=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,o=this.extractFromKey(e[e.length-1],t),s=o.key,l=o.namespaces,u=l[l.length-1],c=t.lng||this.language,f=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(c&&"cimode"===c.toLowerCase()){if(f){var d=t.nsSeparator||this.options.nsSeparator;return u+d+s}return s}var p=this.resolve(e,t),h=p&&p.res,v=p&&p.usedKey||s,g=p&&p.exactUsedKey||s,y=Object.prototype.toString.apply(h),m=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject;if(b&&h&&("string"!=typeof h&&"boolean"!=typeof h&&"number"!=typeof h)&&["[object Number]","[object Function]","[object RegExp]"].indexOf(y)<0&&("string"!=typeof m||"[object Array]"!==y)){if(!t.returnObjects&&!this.options.returnObjects)return this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.options.returnedObjectHandler?this.options.returnedObjectHandler(v,h,t):"key '".concat(s," (").concat(this.language,")' returned an object instead of string.");if(i){var S="[object Array]"===y,w=S?[]:{},k=S?g:v;for(var E in h)if(Object.prototype.hasOwnProperty.call(h,E)){var x="".concat(k).concat(i).concat(E);w[E]=this.translate(x,a({},t,{joinArrays:!1,ns:l})),w[E]===x&&(w[E]=h[E])}h=w}}else if(b&&"string"==typeof m&&"[object Array]"===y)(h=h.join(m))&&(h=this.extendTranslation(h,e,t));else{var _=!1,I=!1;if(!this.isValidLookup(h)&&void 0!==t.defaultValue){if(_=!0,void 0!==t.count){var T=this.pluralResolver.getSuffix(c,t.count);h=t["defaultValue".concat(T)]}h||(h=t.defaultValue)}this.isValidLookup(h)||(I=!0,h=s);var C=t.defaultValue&&t.defaultValue!==h&&this.options.updateMissing;if(I||_||C){this.logger.log(C?"updateKey":"missingKey",c,u,s,C?t.defaultValue:h);var O=[],N=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&N&&N[0])for(var R=0;R<N.length;R++)O.push(N[R]);else"all"===this.options.saveMissingTo?O=this.languageUtils.toResolveHierarchy(t.lng||this.language):O.push(t.lng||this.language);var D=function(e,r){n.options.missingKeyHandler?n.options.missingKeyHandler(e,u,r,C?t.defaultValue:h,C,t):n.backendConnector&&n.backendConnector.saveMissing&&n.backendConnector.saveMissing(e,u,r,C?t.defaultValue:h,C,t),n.emit("missingKey",e,u,r,h)};if(this.options.saveMissing){var P=void 0!==t.count&&"string"!=typeof t.count;this.options.saveMissingPlurals&&P?O.forEach((function(e){n.pluralResolver.getPluralFormsOfKey(e,s).forEach((function(t){return D([e],t)}))})):D(O,s)}}h=this.extendTranslation(h,e,t,p),I&&h===s&&this.options.appendNamespaceToMissingKey&&(h="".concat(u,":").concat(s)),I&&this.options.parseMissingKeyHandler&&(h=this.options.parseMissingKeyHandler(h))}return h}},{key:"extendTranslation",value:function(e,t,n,r){var i=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,n,r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(a({},n,{interpolation:a({},this.options.interpolation,n.interpolation)}));var o=n.replace&&"string"!=typeof n.replace?n.replace:n;this.options.interpolation.defaultVariables&&(o=a({},this.options.interpolation.defaultVariables,o)),e=this.interpolator.interpolate(e,o,n.lng||this.language,n),!1!==n.nest&&(e=this.interpolator.nest(e,(function(){return i.translate.apply(i,arguments)}),n)),n.interpolation&&this.interpolator.reset()}var s=n.postProcess||this.options.postProcess,l="string"==typeof s?[s]:s;return null!=e&&l&&l.length&&!1!==n.applyPostProcessor&&(e=R.handle(l,e,t,this.options&&this.options.postProcessPassResolved?a({i18nResolved:r},n):n,this)),e}},{key:"resolve",value:function(e){var t,n,r,i,a,o=this,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!o.isValidLookup(t)){var l=o.extractFromKey(e,s),u=l.key;n=u;var c=l.namespaces;o.options.fallbackNS&&(c=c.concat(o.options.fallbackNS));var f=void 0!==s.count&&"string"!=typeof s.count,d=void 0!==s.context&&"string"==typeof s.context&&""!==s.context,p=s.lngs?s.lngs:o.languageUtils.toResolveHierarchy(s.lng||o.language,s.fallbackLng);c.forEach((function(e){o.isValidLookup(t)||(a=e,o.utils&&o.utils.hasLoadedNamespace&&!o.utils.hasLoadedNamespace(a)&&o.logger.warn('key "'.concat(n,'" for namespace "').concat(a,"\" won't get resolved as namespace was not yet loaded"),"This means something IS WRONG in your application setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"),p.forEach((function(n){if(!o.isValidLookup(t)){i=n;var a,l,c=u,p=[c];if(o.i18nFormat&&o.i18nFormat.addLookupKeys)o.i18nFormat.addLookupKeys(p,u,n,e,s);else f&&(a=o.pluralResolver.getSuffix(n,s.count)),f&&d&&p.push(c+a),d&&p.push(c+="".concat(o.options.contextSeparator).concat(s.context)),f&&p.push(c+=a);for(;l=p.pop();)o.isValidLookup(t)||(r=l,t=o.getResource(n,e,l,s))}})))}))}})),{res:t,usedKey:n,exactUsedKey:r,usedLng:i,usedNS:a}}},{key:"isValidLookup",value:function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}}]),t}(b);function P(e){return e.charAt(0).toUpperCase()+e.slice(1)}var A=function(){function e(t){(0,o.A)(this,e),this.options=t,this.whitelist=this.options.whitelist||!1,this.logger=m.create("languageUtils")}return(0,s.A)(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),this.formatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],n=e.split("-");return this.options.lowerCaseLng?n=n.map((function(e){return e.toLowerCase()})):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=P(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=P(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=P(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isWhitelisted",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitWhitelist)&&(e=this.getLanguagePartFromCode(e)),!this.whitelist||!this.whitelist.length||this.whitelist.indexOf(e)>-1}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e.default),n||[]}},{key:"toResolveHierarchy",value:function(e,t){var n=this,r=this.getFallbackCodes(t||this.options.fallbackLng||[],e),i=[],a=function(e){e&&(n.isWhitelisted(e)?i.push(e):n.logger.warn("rejecting non-whitelisted language code: ".concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&a(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&a(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&a(this.getLanguagePartFromCode(e))):"string"==typeof e&&a(this.formatLanguageCode(e)),r.forEach((function(e){i.indexOf(e)<0&&a(n.formatLanguageCode(e))})),i}}]),e}(),M=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","id","ja","jbo","ka","kk","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he"],nr:[1,2,20,21],fc:22}],L={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0===e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0===e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0===e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1===e?0:2===e?1:(e<0||e>10)&&e%10==0?2:3)}};var U=function(){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,o.A)(this,e),this.languageUtils=t,this.options=r,this.logger=m.create("pluralResolver"),this.rules=(n={},M.forEach((function(e){e.lngs.forEach((function(t){n[t]={numbers:e.nr,plurals:L[e.fc]}}))})),n)}return(0,s.A)(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=this.getRule(e);return t&&t.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){var n=this,r=[],i=this.getRule(e);return i?(i.numbers.forEach((function(i){var a=n.getSuffix(e,i);r.push("".concat(t).concat(a))})),r):r}},{key:"getSuffix",value:function(e,t){var n=this,r=this.getRule(e);if(r){var i=r.noAbs?r.plurals(t):r.plurals(Math.abs(t)),a=r.numbers[i];this.options.simplifyPluralSuffix&&2===r.numbers.length&&1===r.numbers[0]&&(2===a?a="plural":1===a&&(a=""));var o=function(){return n.options.prepend&&a.toString()?n.options.prepend+a.toString():a.toString()};return"v1"===this.options.compatibilityJSON?1===a?"":"number"==typeof a?"_plural_".concat(a.toString()):o():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===r.numbers.length&&1===r.numbers[0]?o():this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString()}return this.logger.warn("no plural rule found for: ".concat(e)),""}}]),e}(),j=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,o.A)(this,e),this.logger=m.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return(0,s.A)(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:O,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?T(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?T(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?T(t.nestingPrefix):t.nestingPrefixEscaped||T("$t("),this.nestingSuffix=t.nestingSuffix?T(t.nestingSuffix):t.nestingSuffixEscaped||T(")"),this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(t,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")}},{key:"interpolate",value:function(e,t,n,r){var i,a,o,s=this,l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function u(e){return e.replace(/\$/g,"$$$$")}var c=function(e){if(e.indexOf(s.formatSeparator)<0)return _(t,l,e);var r=e.split(s.formatSeparator),i=r.shift().trim(),a=r.join(s.formatSeparator).trim();return s.format(_(t,l,i),a,n)};this.resetRegExp();var f=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler;for(o=0;i=this.regexpUnescape.exec(e);){if(void 0===(a=c(i[1].trim())))if("function"==typeof f){var d=f(e,i,r);a="string"==typeof d?d:""}else this.logger.warn("missed to pass in variable ".concat(i[1]," for interpolating ").concat(e)),a="";else"string"==typeof a||this.useRawValueToEscape||(a=w(a));if(e=e.replace(i[0],u(a)),this.regexpUnescape.lastIndex=0,++o>=this.maxReplaces)break}for(o=0;i=this.regexp.exec(e);){if(void 0===(a=c(i[1].trim())))if("function"==typeof f){var p=f(e,i,r);a="string"==typeof p?p:""}else this.logger.warn("missed to pass in variable ".concat(i[1]," for interpolating ").concat(e)),a="";else"string"==typeof a||this.useRawValueToEscape||(a=w(a));if(a=this.escapeValue?u(this.escape(a)):u(a),e=e.replace(i[0],a),this.regexp.lastIndex=0,++o>=this.maxReplaces)break}return e}},{key:"nest",value:function(e,t){var n,r,i=a({},arguments.length>2&&void 0!==arguments[2]?arguments[2]:{});function o(e,t){if(e.indexOf(",")<0)return e;var n=e.split(",");e=n.shift();var r=n.join(",");r=(r=this.interpolate(r,i)).replace(/'/g,'"');try{i=JSON.parse(r),t&&(i=a({},t,i))}catch(t){this.logger.error("failed parsing options string in nesting for key ".concat(e),t)}return delete i.defaultValue,e}for(i.applyPostProcessor=!1,delete i.defaultValue;n=this.nestingRegexp.exec(e);){if((r=t(o.call(this,n[1].trim(),i),i))&&n[0]===e&&"string"!=typeof r)return r;"string"!=typeof r&&(r=w(r)),r||(this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(e)),r=""),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}]),e}();var V=function(e){function t(e,n,r){var i,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return(0,o.A)(this,t),i=u(this,c(t).call(this)),b.call(l(i)),i.backend=e,i.store=n,i.services=r,i.languageUtils=r.languageUtils,i.options=a,i.logger=m.create("backendConnector"),i.state={},i.queue=[],i.backend&&i.backend.init&&i.backend.init(r,a.backend,a),i}return d(t,e),(0,s.A)(t,[{key:"queueLoad",value:function(e,t,n,r){var i=this,a=[],o=[],s=[],l=[];return e.forEach((function(e){var r=!0;t.forEach((function(t){var s="".concat(e,"|").concat(t);!n.reload&&i.store.hasResourceBundle(e,t)?i.state[s]=2:i.state[s]<0||(1===i.state[s]?o.indexOf(s)<0&&o.push(s):(i.state[s]=1,r=!1,o.indexOf(s)<0&&o.push(s),a.indexOf(s)<0&&a.push(s),l.indexOf(t)<0&&l.push(t)))})),r||s.push(e)})),(a.length||o.length)&&this.queue.push({pending:o,loaded:{},errors:[],callback:r}),{toLoad:a,pending:o,toLoadLanguages:s,toLoadNamespaces:l}}},{key:"loaded",value:function(e,t,n){var r=e.split("|"),i=(0,g.A)(r,2),a=i[0],o=i[1];t&&this.emit("failedLoading",a,o,t),n&&this.store.addResourceBundle(a,o,n),this.state[e]=t?-1:2;var s={};this.queue.forEach((function(n){var r,i,l,u,c,f;r=n.loaded,i=o,u=k(r,[a],Object),c=u.obj,f=u.k,c[f]=c[f]||[],l&&(c[f]=c[f].concat(i)),l||c[f].push(i),function(e,t){for(var n=e.indexOf(t);-1!==n;)e.splice(n,1),n=e.indexOf(t)}(n.pending,e),t&&n.errors.push(t),0!==n.pending.length||n.done||(Object.keys(n.loaded).forEach((function(e){s[e]||(s[e]=[]),n.loaded[e].length&&n.loaded[e].forEach((function(t){s[e].indexOf(t)<0&&s[e].push(t)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",s),this.queue=this.queue.filter((function(e){return!e.done}))}},{key:"read",value:function(e,t,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:250,o=arguments.length>5?arguments[5]:void 0;return e.length?this.backend[n](e,t,(function(s,l){s&&l&&i<5?setTimeout((function(){r.read.call(r,e,t,n,i+1,2*a,o)}),a):o(s,l)})):o(null,{})}},{key:"prepareLoading",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var a=this.queueLoad(e,t,r,i);if(!a.toLoad.length)return a.pending.length||i(),null;a.toLoad.forEach((function(e){n.loadOne(e)}))}},{key:"load",value:function(e,t,n){this.prepareLoading(e,t,{},n)}},{key:"reload",value:function(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}},{key:"loadOne",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=e.split("|"),i=(0,g.A)(r,2),a=i[0],o=i[1];this.read(a,o,"read",null,null,(function(r,i){r&&t.logger.warn("".concat(n,"loading namespace ").concat(o," for language ").concat(a," failed"),r),!r&&i&&t.logger.log("".concat(n,"loaded namespace ").concat(o," for language ").concat(a),i),t.loaded(e,r,i)}))}},{key:"saveMissing",value:function(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)?this.logger.warn('did not save key "'.concat(n,'" for namespace "').concat(t,'" as the namespace was not yet loaded'),"This means something IS WRONG in your application setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"):(this.backend&&this.backend.create&&this.backend.create(e,t,n,r,null,a({},o,{isUpdate:i})),e&&e[0]&&this.store.addResource(e[0],t,n,r))}}]),t}(b);function F(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.whitelist&&e.whitelist.indexOf("cimode")<0&&(e.whitelist=e.whitelist.concat(["cimode"])),e}function z(){}const B=new(function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;if((0,o.A)(this,t),e=u(this,c(t).call(this)),b.call(l(e)),e.options=F(n),e.services={},e.logger=m,e.modules={external:[]},r&&!e.isInitialized&&!n.isClone){if(!e.options.initImmediate)return e.init(n,r),u(e,l(e));setTimeout((function(){e.init(n,r)}),0)}return e}return d(t,e),(0,s.A)(t,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;function i(e){return e?"function"==typeof e?new e:e:null}if("function"==typeof t&&(n=t,t={}),this.options=a({},{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,whitelist:!1,nonExplicitWhitelist:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===(0,r.A)(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===(0,r.A)(e[2])||"object"===(0,r.A)(e[3])){var n=e[3]||e[2];Object.keys(n).forEach((function(e){t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:function(e,t,n){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",maxReplaces:1e3}},this.options,F(t)),this.format=this.options.interpolation.format,n||(n=z),!this.options.isClone){this.modules.logger?m.init(i(this.modules.logger),this.options):m.init(null,this.options);var o=new A(this.options);this.store=new N(this.options.resources,this.options);var s=this.services;s.logger=m,s.resourceStore=this.store,s.languageUtils=o,s.pluralResolver=new U(o,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),s.interpolator=new j(this.options),s.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},s.backendConnector=new V(i(this.modules.backend),s.resourceStore,s,this.options),s.backendConnector.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];e.emit.apply(e,[t].concat(r))})),this.modules.languageDetector&&(s.languageDetector=i(this.modules.languageDetector),s.languageDetector.init(s,this.options.detection,this.options)),this.modules.i18nFormat&&(s.i18nFormat=i(this.modules.i18nFormat),s.i18nFormat.init&&s.i18nFormat.init(this)),this.translator=new D(this.services,this.options),this.translator.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];e.emit.apply(e,[t].concat(r))})),this.modules.external.forEach((function(t){t.init&&t.init(e)}))}["getResource","addResource","addResources","addResourceBundle","removeResourceBundle","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments)}}));var l=S(),u=function(){e.changeLanguage(e.options.lng,(function(t,r){e.isInitialized=!0,e.logger.log("initialized",e.options),e.emit("initialized",e.options),l.resolve(r),n(t,r)}))};return this.options.resources||!this.options.initImmediate?u():setTimeout(u,0),l}},{key:"loadResources",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:z;if(!this.options.resources||this.options.partialBundledLanguages){if(this.language&&"cimode"===this.language.toLowerCase())return t();var n=[],r=function(t){t&&e.services.languageUtils.toResolveHierarchy(t).forEach((function(e){n.indexOf(e)<0&&n.push(e)}))};if(this.language)r(this.language);else this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((function(e){return r(e)}));this.options.preload&&this.options.preload.forEach((function(e){return r(e)})),this.services.backendConnector.load(n,this.options.ns,t)}else t(null)}},{key:"reloadResources",value:function(e,t,n){var r=S();return e||(e=this.languages),t||(t=this.options.ns),n||(n=z),this.services.backendConnector.reload(e,t,(function(e){r.resolve(),n(e)})),r}},{key:"use",value:function(e){return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&R.addPostProcessor(e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"changeLanguage",value:function(e,t){var n=this,r=S();this.emit("languageChanging",e);var i=function(e){e&&(n.language=e,n.languages=n.services.languageUtils.toResolveHierarchy(e),n.translator.language||n.translator.changeLanguage(e),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage(e)),n.loadResources((function(i){!function(e,i){n.translator.changeLanguage(i),i&&(n.emit("languageChanged",i),n.logger.log("languageChanged",i)),r.resolve((function(){return n.t.apply(n,arguments)})),t&&t(e,(function(){return n.t.apply(n,arguments)}))}(i,e)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(i):i(e):i(this.services.languageDetector.detect()),r}},{key:"getFixedT",value:function(e,t){var n=this,i=function e(t,i){var o;if("object"!==(0,r.A)(i)){for(var s=arguments.length,l=new Array(s>2?s-2:0),u=2;u<s;u++)l[u-2]=arguments[u];o=n.options.overloadTranslationOptionHandler([t,i].concat(l))}else o=a({},i);return o.lng=o.lng||e.lng,o.lngs=o.lngs||e.lngs,o.ns=o.ns||e.ns,n.t(t,o)};return"string"==typeof e?i.lng=e:i.lngs=e,i.ns=t,i}},{key:"t",value:function(){var e;return this.translator&&(e=this.translator).translate.apply(e,arguments)}},{key:"exists",value:function(){var e;return this.translator&&(e=this.translator).exists.apply(e,arguments)}},{key:"setDefaultNamespace",value:function(e){this.options.defaultNS=e}},{key:"hasLoadedNamespace",value:function(e){var t=this;if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var n=this.languages[0],r=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;var a=function(e,n){var r=t.services.backendConnector.state["".concat(e,"|").concat(n)];return-1===r||2===r};return!!this.hasResourceBundle(n,e)||(!this.services.backendConnector.backend||!(!a(n,e)||r&&!a(i,e)))}},{key:"loadNamespaces",value:function(e,t){var n=this,r=S();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach((function(e){n.options.ns.indexOf(e)<0&&n.options.ns.push(e)})),this.loadResources((function(e){r.resolve(),t&&t(e)})),r):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var n=S();"string"==typeof e&&(e=[e]);var r=this.options.preload||[],i=e.filter((function(e){return r.indexOf(e)<0}));return i.length?(this.options.preload=r.concat(i),this.loadResources((function(e){n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){if(e||(e=this.languages&&this.languages.length>0?this.languages[0]:this.language),!e)return"rtl";return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam"].indexOf(this.services.languageUtils.getLanguagePartFromCode(e))>=0?"rtl":"ltr"}},{key:"createInstance",value:function(){return new t(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}},{key:"cloneInstance",value:function(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:z,i=a({},this.options,n,{isClone:!0}),o=new t(i);return["store","services","language"].forEach((function(t){o[t]=e[t]})),o.translator=new D(o.services,o.options),o.translator.on("*",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];o.emit.apply(o,[e].concat(n))})),o.init(i,r),o.translator.options=o.options,o}}]),t}(b))},771:(e,t,n)=>{var r=NaN,i="[object Symbol]",a=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,l=/^0o[0-7]+$/i,u=parseInt,c="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,f="object"==typeof self&&self&&self.Object===Object&&self,d=c||f||Function("return this")(),p=Object.prototype.toString,h=Math.max,v=Math.min,g=function(){return d.Date.now()};function y(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function m(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&p.call(e)==i}(e))return r;if(y(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=y(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(a,"");var n=s.test(e);return n||l.test(e)?u(e.slice(2),n?2:8):o.test(e)?r:+e}e.exports=function(e,t,n){var r,i,a,o,s,l,u=0,c=!1,f=!1,d=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function p(t){var n=r,a=i;return r=i=void 0,u=t,o=e.apply(a,n)}function b(e){var n=e-l;return void 0===l||n>=t||n<0||f&&e-u>=a}function S(){var e=g();if(b(e))return w(e);s=setTimeout(S,function(e){var n=t-(e-l);return f?v(n,a-(e-u)):n}(e))}function w(e){return s=void 0,d&&r?p(e):(r=i=void 0,o)}function k(){var e=g(),n=b(e);if(r=arguments,i=this,l=e,n){if(void 0===s)return function(e){return u=e,s=setTimeout(S,t),c?p(e):o}(l);if(f)return s=setTimeout(S,t),p(l)}return void 0===s&&(s=setTimeout(S,t)),o}return t=m(t)||0,y(n)&&(c=!!n.leading,a=(f="maxWait"in n)?h(m(n.maxWait)||0,t):a,d="trailing"in n?!!n.trailing:d),k.cancel=function(){void 0!==s&&clearTimeout(s),u=0,r=l=i=s=void 0},k.flush=function(){return void 0===s?o:w(g())},k}},854:e=>{"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,i){for(var a,o,s=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),l=1;l<arguments.length;l++){for(var u in a=Object(arguments[l]))n.call(a,u)&&(s[u]=a[u]);if(t){o=t(a);for(var c=0;c<o.length;c++)r.call(a,o[c])&&(s[o[c]]=a[o[c]])}}return s}},216:(e,t,n)=>{"use strict";var r=n(151);function i(){}function a(){}a.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,a,o){if(o!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:i};return n.PropTypes=n,n}},374:(e,t,n)=>{e.exports=n(216)()},151:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},641:(e,t,n)=>{"use strict";var r=n(766),i=n(854),a=n(428);function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}if(!r)throw Error(o(227));var s=new Set,l={};function u(e,t){c(e,t),c(e+"Capture",t)}function c(e,t){for(l[e]=t,e=0;e<t.length;e++)s.add(t[e])}var f=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),d=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,p=Object.prototype.hasOwnProperty,h={},v={};function g(e,t,n,r,i,a,o){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var y={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){y[e]=new g(e,0,!1,e,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];y[t]=new g(t,1,!1,e[1],null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){y[e]=new g(e,2,!1,e.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){y[e]=new g(e,2,!1,e,null,!1,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){y[e]=new g(e,3,!1,e.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((function(e){y[e]=new g(e,3,!0,e,null,!1,!1)})),["capture","download"].forEach((function(e){y[e]=new g(e,4,!1,e,null,!1,!1)})),["cols","rows","size","span"].forEach((function(e){y[e]=new g(e,6,!1,e,null,!1,!1)})),["rowSpan","start"].forEach((function(e){y[e]=new g(e,5,!1,e.toLowerCase(),null,!1,!1)}));var m=/[\-:]([a-z])/g;function b(e){return e[1].toUpperCase()}function S(e,t,n,r){var i=y.hasOwnProperty(t)?y[t]:null;(null!==i?0===i.type:!r&&(2<t.length&&("o"===t[0]||"O"===t[0])&&("n"===t[1]||"N"===t[1])))||(function(e,t,n,r){if(null==t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,i,r)&&(n=null),r||null===i?function(e){return!!p.call(v,e)||!p.call(h,e)&&(d.test(e)?v[e]=!0:(h[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=null===n?3!==i.type&&"":n:(t=i.attributeName,r=i.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(i=i.type)||4===i&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(m,b);y[t]=new g(t,1,!1,e,null,!1,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(m,b);y[t]=new g(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(m,b);y[t]=new g(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((function(e){y[e]=new g(e,1,!1,e.toLowerCase(),null,!1,!1)})),y.xlinkHref=new g("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((function(e){y[e]=new g(e,1,!1,e.toLowerCase(),null,!0,!0)}));var w=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,k=60103,E=60106,x=60107,_=60108,I=60114,T=60109,C=60110,O=60112,N=60113,R=60120,D=60115,P=60116,A=60121,M=60128,L=60129,U=60130,j=60131;if("function"==typeof Symbol&&Symbol.for){var V=Symbol.for;k=V("react.element"),E=V("react.portal"),x=V("react.fragment"),_=V("react.strict_mode"),I=V("react.profiler"),T=V("react.provider"),C=V("react.context"),O=V("react.forward_ref"),N=V("react.suspense"),R=V("react.suspense_list"),D=V("react.memo"),P=V("react.lazy"),A=V("react.block"),V("react.scope"),M=V("react.opaque.id"),L=V("react.debug_trace_mode"),U=V("react.offscreen"),j=V("react.legacy_hidden")}var F,z="function"==typeof Symbol&&Symbol.iterator;function B(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=z&&e[z]||e["@@iterator"])?e:null}function H(e){if(void 0===F)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);F=t&&t[1]||""}return"\n"+F+e}var W=!1;function q(e,t){if(!e||W)return"";W=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var r=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){r=e}e.call(t.prototype)}else{try{throw Error()}catch(e){r=e}e()}}catch(e){if(e&&r&&"string"==typeof e.stack){for(var i=e.stack.split("\n"),a=r.stack.split("\n"),o=i.length-1,s=a.length-1;1<=o&&0<=s&&i[o]!==a[s];)s--;for(;1<=o&&0<=s;o--,s--)if(i[o]!==a[s]){if(1!==o||1!==s)do{if(o--,0>--s||i[o]!==a[s])return"\n"+i[o].replace(" at new "," at ")}while(1<=o&&0<=s);break}}}finally{W=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?H(e):""}function $(e){switch(e.tag){case 5:return H(e.type);case 16:return H("Lazy");case 13:return H("Suspense");case 19:return H("SuspenseList");case 0:case 2:case 15:return e=q(e.type,!1);case 11:return e=q(e.type.render,!1);case 22:return e=q(e.type._render,!1);case 1:return e=q(e.type,!0);default:return""}}function K(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case x:return"Fragment";case E:return"Portal";case I:return"Profiler";case _:return"StrictMode";case N:return"Suspense";case R:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case C:return(e.displayName||"Context")+".Consumer";case T:return(e._context.displayName||"Context")+".Provider";case O:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(""!==t?"ForwardRef("+t+")":"ForwardRef");case D:return K(e.type);case A:return K(e._render);case P:t=e._payload,e=e._init;try{return K(e(t))}catch(e){}}return null}function Y(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function Q(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function J(e){e._valueTracker||(e._valueTracker=function(e){var t=Q(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=""+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function G(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Q(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function X(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function Z(e,t){var n=t.checked;return i({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function ee(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=Y(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function te(e,t){null!=(t=t.checked)&&S(e,"checked",t,!1)}function ne(e,t){te(e,t);var n=Y(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?ie(e,t.type,n):t.hasOwnProperty("defaultValue")&&ie(e,t.type,Y(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function re(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function ie(e,t,n){"number"===t&&X(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}function ae(e,t){return e=i({children:void 0},t),(t=function(e){var t="";return r.Children.forEach(e,(function(e){null!=e&&(t+=e)})),t}(t.children))&&(e.children=t),e}function oe(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Y(n),t=null,i=0;i<e.length;i++){if(e[i].value===n)return e[i].selected=!0,void(r&&(e[i].defaultSelected=!0));null!==t||e[i].disabled||(t=e[i])}null!==t&&(t.selected=!0)}}function se(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(o(91));return i({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function le(e,t){var n=t.value;if(null==n){if(n=t.children,t=t.defaultValue,null!=n){if(null!=t)throw Error(o(92));if(Array.isArray(n)){if(!(1>=n.length))throw Error(o(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:Y(n)}}function ue(e,t){var n=Y(t.value),r=Y(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function ce(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}var fe={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function de(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function pe(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?de(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var he,ve,ge=(ve=function(e,t){if(e.namespaceURI!==fe.svg||"innerHTML"in e)e.innerHTML=t;else{for((he=he||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=he.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,r){MSApp.execUnsafeLocalFunction((function(){return ve(e,t)}))}:ve);function ye(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var me={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},be=["Webkit","ms","Moz","O"];function Se(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||me.hasOwnProperty(e)&&me[e]?(""+t).trim():t+"px"}function we(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),i=Se(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}Object.keys(me).forEach((function(e){be.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),me[t]=me[e]}))}));var ke=i({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ee(e,t){if(t){if(ke[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(o(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(o(60));if("object"!=typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(o(61))}if(null!=t.style&&"object"!=typeof t.style)throw Error(o(62))}}function xe(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}function _e(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var Ie=null,Te=null,Ce=null;function Oe(e){if(e=ni(e)){if("function"!=typeof Ie)throw Error(o(280));var t=e.stateNode;t&&(t=ii(t),Ie(e.stateNode,e.type,t))}}function Ne(e){Te?Ce?Ce.push(e):Ce=[e]:Te=e}function Re(){if(Te){var e=Te,t=Ce;if(Ce=Te=null,Oe(e),t)for(e=0;e<t.length;e++)Oe(t[e])}}function De(e,t){return e(t)}function Pe(e,t,n,r,i){return e(t,n,r,i)}function Ae(){}var Me=De,Le=!1,Ue=!1;function je(){null===Te&&null===Ce||(Ae(),Re())}function Ve(e,t){var n=e.stateNode;if(null===n)return null;var r=ii(n);if(null===r)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}if(e)return null;if(n&&"function"!=typeof n)throw Error(o(231,t,typeof n));return n}var Fe=!1;if(f)try{var ze={};Object.defineProperty(ze,"passive",{get:function(){Fe=!0}}),window.addEventListener("test",ze,ze),window.removeEventListener("test",ze,ze)}catch(ve){Fe=!1}function Be(e,t,n,r,i,a,o,s,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(e){this.onError(e)}}var He=!1,We=null,qe=!1,$e=null,Ke={onError:function(e){He=!0,We=e}};function Ye(e,t,n,r,i,a,o,s,l){He=!1,We=null,Be.apply(Ke,arguments)}function Qe(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{!!(1026&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function Je(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function Ge(e){if(Qe(e)!==e)throw Error(o(188))}function Xe(e){if(e=function(e){var t=e.alternate;if(!t){if(null===(t=Qe(e)))throw Error(o(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(null===i)break;var a=i.alternate;if(null===a){if(null!==(r=i.return)){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return Ge(i),e;if(a===r)return Ge(i),t;a=a.sibling}throw Error(o(188))}if(n.return!==r.return)n=i,r=a;else{for(var s=!1,l=i.child;l;){if(l===n){s=!0,n=i,r=a;break}if(l===r){s=!0,r=i,n=a;break}l=l.sibling}if(!s){for(l=a.child;l;){if(l===n){s=!0,n=a,r=i;break}if(l===r){s=!0,r=a,n=i;break}l=l.sibling}if(!s)throw Error(o(189))}}if(n.alternate!==r)throw Error(o(190))}if(3!==n.tag)throw Error(o(188));return n.stateNode.current===n?e:t}(e),!e)return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}function Ze(e,t){for(var n=e.alternate;null!==t;){if(t===e||t===n)return!0;t=t.return}return!1}var et,tt,nt,rt,it=!1,at=[],ot=null,st=null,lt=null,ut=new Map,ct=new Map,ft=[],dt="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function pt(e,t,n,r,i){return{blockedOn:e,domEventName:t,eventSystemFlags:16|n,nativeEvent:i,targetContainers:[r]}}function ht(e,t){switch(e){case"focusin":case"focusout":ot=null;break;case"dragenter":case"dragleave":st=null;break;case"mouseover":case"mouseout":lt=null;break;case"pointerover":case"pointerout":ut.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ct.delete(t.pointerId)}}function vt(e,t,n,r,i,a){return null===e||e.nativeEvent!==a?(e=pt(t,n,r,i,a),null!==t&&(null!==(t=ni(t))&&tt(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,null!==i&&-1===t.indexOf(i)&&t.push(i),e)}function gt(e){var t=ti(e.target);if(null!==t){var n=Qe(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=Je(n)))return e.blockedOn=t,void rt(e.lanePriority,(function(){a.unstable_runWithPriority(e.priority,(function(){nt(n)}))}))}else if(3===t&&n.stateNode.hydrate)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function yt(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=Xt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n)return null!==(t=ni(n))&&tt(t),e.blockedOn=n,!1;t.shift()}return!0}function mt(e,t,n){yt(e)&&n.delete(t)}function bt(){for(it=!1;0<at.length;){var e=at[0];if(null!==e.blockedOn){null!==(e=ni(e.blockedOn))&&et(e);break}for(var t=e.targetContainers;0<t.length;){var n=Xt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n){e.blockedOn=n;break}t.shift()}null===e.blockedOn&&at.shift()}null!==ot&&yt(ot)&&(ot=null),null!==st&&yt(st)&&(st=null),null!==lt&&yt(lt)&&(lt=null),ut.forEach(mt),ct.forEach(mt)}function St(e,t){e.blockedOn===t&&(e.blockedOn=null,it||(it=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,bt)))}function wt(e){function t(t){return St(t,e)}if(0<at.length){St(at[0],e);for(var n=1;n<at.length;n++){var r=at[n];r.blockedOn===e&&(r.blockedOn=null)}}for(null!==ot&&St(ot,e),null!==st&&St(st,e),null!==lt&&St(lt,e),ut.forEach(t),ct.forEach(t),n=0;n<ft.length;n++)(r=ft[n]).blockedOn===e&&(r.blockedOn=null);for(;0<ft.length&&null===(n=ft[0]).blockedOn;)gt(n),null===n.blockedOn&&ft.shift()}function kt(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Et={animationend:kt("Animation","AnimationEnd"),animationiteration:kt("Animation","AnimationIteration"),animationstart:kt("Animation","AnimationStart"),transitionend:kt("Transition","TransitionEnd")},xt={},_t={};function It(e){if(xt[e])return xt[e];if(!Et[e])return e;var t,n=Et[e];for(t in n)if(n.hasOwnProperty(t)&&t in _t)return xt[e]=n[t];return e}f&&(_t=document.createElement("div").style,"AnimationEvent"in window||(delete Et.animationend.animation,delete Et.animationiteration.animation,delete Et.animationstart.animation),"TransitionEvent"in window||delete Et.transitionend.transition);var Tt=It("animationend"),Ct=It("animationiteration"),Ot=It("animationstart"),Nt=It("transitionend"),Rt=new Map,Dt=new Map,Pt=["abort","abort",Tt,"animationEnd",Ct,"animationIteration",Ot,"animationStart","canplay","canPlay","canplaythrough","canPlayThrough","durationchange","durationChange","emptied","emptied","encrypted","encrypted","ended","ended","error","error","gotpointercapture","gotPointerCapture","load","load","loadeddata","loadedData","loadedmetadata","loadedMetadata","loadstart","loadStart","lostpointercapture","lostPointerCapture","playing","playing","progress","progress","seeking","seeking","stalled","stalled","suspend","suspend","timeupdate","timeUpdate",Nt,"transitionEnd","waiting","waiting"];function At(e,t){for(var n=0;n<e.length;n+=2){var r=e[n],i=e[n+1];i="on"+(i[0].toUpperCase()+i.slice(1)),Dt.set(r,t),Rt.set(r,i),u(i,[r])}}(0,a.unstable_now)();var Mt=8;function Lt(e){if(1&e)return Mt=15,1;if(2&e)return Mt=14,2;if(4&e)return Mt=13,4;var t=24&e;return 0!==t?(Mt=12,t):32&e?(Mt=11,32):0!==(t=192&e)?(Mt=10,t):256&e?(Mt=9,256):0!==(t=3584&e)?(Mt=8,t):4096&e?(Mt=7,4096):0!==(t=4186112&e)?(Mt=6,t):0!==(t=62914560&e)?(Mt=5,t):67108864&e?(Mt=4,67108864):134217728&e?(Mt=3,134217728):0!==(t=805306368&e)?(Mt=2,t):1073741824&e?(Mt=1,1073741824):(Mt=8,e)}function Ut(e,t){var n=e.pendingLanes;if(0===n)return Mt=0;var r=0,i=0,a=e.expiredLanes,o=e.suspendedLanes,s=e.pingedLanes;if(0!==a)r=a,i=Mt=15;else if(0!==(a=134217727&n)){var l=a&~o;0!==l?(r=Lt(l),i=Mt):0!==(s&=a)&&(r=Lt(s),i=Mt)}else 0!==(a=n&~o)?(r=Lt(a),i=Mt):0!==s&&(r=Lt(s),i=Mt);if(0===r)return 0;if(r=n&((0>(r=31-Ht(r))?0:1<<r)<<1)-1,0!==t&&t!==r&&!(t&o)){if(Lt(t),i<=Mt)return t;Mt=i}if(0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0<t;)i=1<<(n=31-Ht(t)),r|=e[n],t&=~i;return r}function jt(e){return 0!==(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function Vt(e,t){switch(e){case 15:return 1;case 14:return 2;case 12:return 0===(e=Ft(24&~t))?Vt(10,t):e;case 10:return 0===(e=Ft(192&~t))?Vt(8,t):e;case 8:return 0===(e=Ft(3584&~t))&&(0===(e=Ft(4186112&~t))&&(e=512)),e;case 2:return 0===(t=Ft(805306368&~t))&&(t=268435456),t}throw Error(o(358,e))}function Ft(e){return e&-e}function zt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Bt(e,t,n){e.pendingLanes|=t;var r=t-1;e.suspendedLanes&=r,e.pingedLanes&=r,(e=e.eventTimes)[t=31-Ht(t)]=n}var Ht=Math.clz32?Math.clz32:function(e){return 0===e?32:31-(Wt(e)/qt|0)|0},Wt=Math.log,qt=Math.LN2;var $t=a.unstable_UserBlockingPriority,Kt=a.unstable_runWithPriority,Yt=!0;function Qt(e,t,n,r){Le||Ae();var i=Gt,a=Le;Le=!0;try{Pe(i,e,t,n,r)}finally{(Le=a)||je()}}function Jt(e,t,n,r){Kt($t,Gt.bind(null,e,t,n,r))}function Gt(e,t,n,r){var i;if(Yt)if((i=!(4&t))&&0<at.length&&-1<dt.indexOf(e))e=pt(null,e,t,n,r),at.push(e);else{var a=Xt(e,t,n,r);if(null===a)i&&ht(e,r);else{if(i){if(-1<dt.indexOf(e))return e=pt(a,e,t,n,r),void at.push(e);if(function(e,t,n,r,i){switch(t){case"focusin":return ot=vt(ot,e,t,n,r,i),!0;case"dragenter":return st=vt(st,e,t,n,r,i),!0;case"mouseover":return lt=vt(lt,e,t,n,r,i),!0;case"pointerover":var a=i.pointerId;return ut.set(a,vt(ut.get(a)||null,e,t,n,r,i)),!0;case"gotpointercapture":return a=i.pointerId,ct.set(a,vt(ct.get(a)||null,e,t,n,r,i)),!0}return!1}(a,e,t,n,r))return;ht(e,r)}Ar(e,t,r,null,n)}}}function Xt(e,t,n,r){var i=_e(r);if(null!==(i=ti(i))){var a=Qe(i);if(null===a)i=null;else{var o=a.tag;if(13===o){if(null!==(i=Je(a)))return i;i=null}else if(3===o){if(a.stateNode.hydrate)return 3===a.tag?a.stateNode.containerInfo:null;i=null}else a!==i&&(i=null)}}return Ar(e,t,r,i,n),null}var Zt=null,en=null,tn=null;function nn(){if(tn)return tn;var e,t,n=en,r=n.length,i="value"in Zt?Zt.value:Zt.textContent,a=i.length;for(e=0;e<r&&n[e]===i[e];e++);var o=r-e;for(t=1;t<=o&&n[r-t]===i[a-t];t++);return tn=i.slice(e,1<t?1-t:void 0)}function rn(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function an(){return!0}function on(){return!1}function sn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(null!=i.defaultPrevented?i.defaultPrevented:!1===i.returnValue)?an:on,this.isPropagationStopped=on,this}return i(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=an)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=an)},persist:function(){},isPersistent:an}),t}var ln,un,cn,fn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},dn=sn(fn),pn=i({},fn,{view:0,detail:0}),hn=sn(pn),vn=i({},pn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Tn,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==cn&&(cn&&"mousemove"===e.type?(ln=e.screenX-cn.screenX,un=e.screenY-cn.screenY):un=ln=0,cn=e),ln)},movementY:function(e){return"movementY"in e?e.movementY:un}}),gn=sn(vn),yn=sn(i({},vn,{dataTransfer:0})),mn=sn(i({},pn,{relatedTarget:0})),bn=sn(i({},fn,{animationName:0,elapsedTime:0,pseudoElement:0})),Sn=i({},fn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),wn=sn(Sn),kn=sn(i({},fn,{data:0})),En={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},xn={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},_n={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function In(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=_n[e])&&!!t[e]}function Tn(){return In}var Cn=i({},pn,{key:function(e){if(e.key){var t=En[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=rn(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?xn[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Tn,charCode:function(e){return"keypress"===e.type?rn(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?rn(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),On=sn(Cn),Nn=sn(i({},vn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Rn=sn(i({},pn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Tn})),Dn=sn(i({},fn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Pn=i({},vn,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),An=sn(Pn),Mn=[9,13,27,32],Ln=f&&"CompositionEvent"in window,Un=null;f&&"documentMode"in document&&(Un=document.documentMode);var jn=f&&"TextEvent"in window&&!Un,Vn=f&&(!Ln||Un&&8<Un&&11>=Un),Fn=String.fromCharCode(32),zn=!1;function Bn(e,t){switch(e){case"keyup":return-1!==Mn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Hn(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Wn=!1;var qn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function $n(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!qn[e.type]:"textarea"===t}function Kn(e,t,n,r){Ne(r),0<(t=Lr(t,"onChange")).length&&(n=new dn("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Yn=null,Qn=null;function Jn(e){Cr(e,0)}function Gn(e){if(G(ri(e)))return e}function Xn(e,t){if("change"===e)return t}var Zn=!1;if(f){var er;if(f){var tr="oninput"in document;if(!tr){var nr=document.createElement("div");nr.setAttribute("oninput","return;"),tr="function"==typeof nr.oninput}er=tr}else er=!1;Zn=er&&(!document.documentMode||9<document.documentMode)}function rr(){Yn&&(Yn.detachEvent("onpropertychange",ir),Qn=Yn=null)}function ir(e){if("value"===e.propertyName&&Gn(Qn)){var t=[];if(Kn(t,Qn,e,_e(e)),e=Jn,Le)e(t);else{Le=!0;try{De(e,t)}finally{Le=!1,je()}}}}function ar(e,t,n){"focusin"===e?(rr(),Qn=n,(Yn=t).attachEvent("onpropertychange",ir)):"focusout"===e&&rr()}function or(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Gn(Qn)}function sr(e,t){if("click"===e)return Gn(t)}function lr(e,t){if("input"===e||"change"===e)return Gn(t)}var ur="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},cr=Object.prototype.hasOwnProperty;function fr(e,t){if(ur(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++)if(!cr.call(t,n[r])||!ur(e[n[r]],t[n[r]]))return!1;return!0}function dr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function pr(e,t){var n,r=dr(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=dr(r)}}function hr(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?hr(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function vr(){for(var e=window,t=X();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(!n)break;t=X((e=t.contentWindow).document)}return t}function gr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var yr=f&&"documentMode"in document&&11>=document.documentMode,mr=null,br=null,Sr=null,wr=!1;function kr(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;wr||null==mr||mr!==X(r)||("selectionStart"in(r=mr)&&gr(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},Sr&&fr(Sr,r)||(Sr=r,0<(r=Lr(br,"onSelect")).length&&(t=new dn("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=mr)))}At("cancel cancel click click close close contextmenu contextMenu copy copy cut cut auxclick auxClick dblclick doubleClick dragend dragEnd dragstart dragStart drop drop focusin focus focusout blur input input invalid invalid keydown keyDown keypress keyPress keyup keyUp mousedown mouseDown mouseup mouseUp paste paste pause pause play play pointercancel pointerCancel pointerdown pointerDown pointerup pointerUp ratechange rateChange reset reset seeked seeked submit submit touchcancel touchCancel touchend touchEnd touchstart touchStart volumechange volumeChange".split(" "),0),At("drag drag dragenter dragEnter dragexit dragExit dragleave dragLeave dragover dragOver mousemove mouseMove mouseout mouseOut mouseover mouseOver pointermove pointerMove pointerout pointerOut pointerover pointerOver scroll scroll toggle toggle touchmove touchMove wheel wheel".split(" "),1),At(Pt,2);for(var Er="change selectionchange textInput compositionstart compositionend compositionupdate".split(" "),xr=0;xr<Er.length;xr++)Dt.set(Er[xr],0);c("onMouseEnter",["mouseout","mouseover"]),c("onMouseLeave",["mouseout","mouseover"]),c("onPointerEnter",["pointerout","pointerover"]),c("onPointerLeave",["pointerout","pointerover"]),u("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),u("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),u("onBeforeInput",["compositionend","keypress","textInput","paste"]),u("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var _r="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Ir=new Set("cancel close invalid load scroll toggle".split(" ").concat(_r));function Tr(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,function(e,t,n,r,i,a,s,l,u){if(Ye.apply(this,arguments),He){if(!He)throw Error(o(198));var c=We;He=!1,We=null,qe||(qe=!0,$e=c)}}(r,t,void 0,e),e.currentTarget=null}function Cr(e,t){t=!!(4&t);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],l=s.instance,u=s.currentTarget;if(s=s.listener,l!==a&&i.isPropagationStopped())break e;Tr(i,s,u),a=l}else for(o=0;o<r.length;o++){if(l=(s=r[o]).instance,u=s.currentTarget,s=s.listener,l!==a&&i.isPropagationStopped())break e;Tr(i,s,u),a=l}}}if(qe)throw e=$e,qe=!1,$e=null,e}function Or(e,t){var n=ai(t),r=e+"__bubble";n.has(r)||(Pr(t,e,2,!1),n.add(r))}var Nr="_reactListening"+Math.random().toString(36).slice(2);function Rr(e){e[Nr]||(e[Nr]=!0,s.forEach((function(t){Ir.has(t)||Dr(t,!1,e,null),Dr(t,!0,e,null)})))}function Dr(e,t,n,r){var i=4<arguments.length&&void 0!==arguments[4]?arguments[4]:0,a=n;if("selectionchange"===e&&9!==n.nodeType&&(a=n.ownerDocument),null!==r&&!t&&Ir.has(e)){if("scroll"!==e)return;i|=2,a=r}var o=ai(a),s=e+"__"+(t?"capture":"bubble");o.has(s)||(t&&(i|=4),Pr(a,e,i,t),o.add(s))}function Pr(e,t,n,r){var i=Dt.get(t);switch(void 0===i?2:i){case 0:i=Qt;break;case 1:i=Jt;break;default:i=Gt}n=i.bind(null,t,n,e),i=void 0,!Fe||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(i=!0),r?void 0!==i?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):void 0!==i?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function Ar(e,t,n,r,i){var a=r;if(!(1&t||2&t||null===r))e:for(;;){if(null===r)return;var o=r.tag;if(3===o||4===o){var s=r.stateNode.containerInfo;if(s===i||8===s.nodeType&&s.parentNode===i)break;if(4===o)for(o=r.return;null!==o;){var l=o.tag;if((3===l||4===l)&&((l=o.stateNode.containerInfo)===i||8===l.nodeType&&l.parentNode===i))return;o=o.return}for(;null!==s;){if(null===(o=ti(s)))return;if(5===(l=o.tag)||6===l){r=a=o;continue e}s=s.parentNode}}r=r.return}!function(e,t,n){if(Ue)return e(t,n);Ue=!0;try{return Me(e,t,n)}finally{Ue=!1,je()}}((function(){var r=a,i=_e(n),o=[];e:{var s=Rt.get(e);if(void 0!==s){var l=dn,u=e;switch(e){case"keypress":if(0===rn(n))break e;case"keydown":case"keyup":l=On;break;case"focusin":u="focus",l=mn;break;case"focusout":u="blur",l=mn;break;case"beforeblur":case"afterblur":l=mn;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":l=gn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":l=yn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":l=Rn;break;case Tt:case Ct:case Ot:l=bn;break;case Nt:l=Dn;break;case"scroll":l=hn;break;case"wheel":l=An;break;case"copy":case"cut":case"paste":l=wn;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":l=Nn}var c=!!(4&t),f=!c&&"scroll"===e,d=c?null!==s?s+"Capture":null:s;c=[];for(var p,h=r;null!==h;){var v=(p=h).stateNode;if(5===p.tag&&null!==v&&(p=v,null!==d&&(null!=(v=Ve(h,d))&&c.push(Mr(h,v,p)))),f)break;h=h.return}0<c.length&&(s=new l(s,u,null,n,i),o.push({event:s,listeners:c}))}}if(!(7&t)){if(l="mouseout"===e||"pointerout"===e,(!(s="mouseover"===e||"pointerover"===e)||16&t||!(u=n.relatedTarget||n.fromElement)||!ti(u)&&!u[Zr])&&(l||s)&&(s=i.window===i?i:(s=i.ownerDocument)?s.defaultView||s.parentWindow:window,l?(l=r,null!==(u=(u=n.relatedTarget||n.toElement)?ti(u):null)&&(u!==(f=Qe(u))||5!==u.tag&&6!==u.tag)&&(u=null)):(l=null,u=r),l!==u)){if(c=gn,v="onMouseLeave",d="onMouseEnter",h="mouse","pointerout"!==e&&"pointerover"!==e||(c=Nn,v="onPointerLeave",d="onPointerEnter",h="pointer"),f=null==l?s:ri(l),p=null==u?s:ri(u),(s=new c(v,h+"leave",l,n,i)).target=f,s.relatedTarget=p,v=null,ti(i)===r&&((c=new c(d,h+"enter",u,n,i)).target=p,c.relatedTarget=f,v=c),f=v,l&&u)e:{for(d=u,h=0,p=c=l;p;p=Ur(p))h++;for(p=0,v=d;v;v=Ur(v))p++;for(;0<h-p;)c=Ur(c),h--;for(;0<p-h;)d=Ur(d),p--;for(;h--;){if(c===d||null!==d&&c===d.alternate)break e;c=Ur(c),d=Ur(d)}c=null}else c=null;null!==l&&jr(o,s,l,c,!1),null!==u&&null!==f&&jr(o,f,u,c,!0)}if("select"===(l=(s=r?ri(r):window).nodeName&&s.nodeName.toLowerCase())||"input"===l&&"file"===s.type)var g=Xn;else if($n(s))if(Zn)g=lr;else{g=or;var y=ar}else(l=s.nodeName)&&"input"===l.toLowerCase()&&("checkbox"===s.type||"radio"===s.type)&&(g=sr);switch(g&&(g=g(e,r))?Kn(o,g,n,i):(y&&y(e,s,r),"focusout"===e&&(y=s._wrapperState)&&y.controlled&&"number"===s.type&&ie(s,"number",s.value)),y=r?ri(r):window,e){case"focusin":($n(y)||"true"===y.contentEditable)&&(mr=y,br=r,Sr=null);break;case"focusout":Sr=br=mr=null;break;case"mousedown":wr=!0;break;case"contextmenu":case"mouseup":case"dragend":wr=!1,kr(o,n,i);break;case"selectionchange":if(yr)break;case"keydown":case"keyup":kr(o,n,i)}var m;if(Ln)e:{switch(e){case"compositionstart":var b="onCompositionStart";break e;case"compositionend":b="onCompositionEnd";break e;case"compositionupdate":b="onCompositionUpdate";break e}b=void 0}else Wn?Bn(e,n)&&(b="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(b="onCompositionStart");b&&(Vn&&"ko"!==n.locale&&(Wn||"onCompositionStart"!==b?"onCompositionEnd"===b&&Wn&&(m=nn()):(en="value"in(Zt=i)?Zt.value:Zt.textContent,Wn=!0)),0<(y=Lr(r,b)).length&&(b=new kn(b,e,null,n,i),o.push({event:b,listeners:y}),m?b.data=m:null!==(m=Hn(n))&&(b.data=m))),(m=jn?function(e,t){switch(e){case"compositionend":return Hn(t);case"keypress":return 32!==t.which?null:(zn=!0,Fn);case"textInput":return(e=t.data)===Fn&&zn?null:e;default:return null}}(e,n):function(e,t){if(Wn)return"compositionend"===e||!Ln&&Bn(e,t)?(e=nn(),tn=en=Zt=null,Wn=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Vn&&"ko"!==t.locale?null:t.data}}(e,n))&&(0<(r=Lr(r,"onBeforeInput")).length&&(i=new kn("onBeforeInput","beforeinput",null,n,i),o.push({event:i,listeners:r}),i.data=m))}Cr(o,t)}))}function Mr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Lr(e,t){for(var n=t+"Capture",r=[];null!==e;){var i=e,a=i.stateNode;5===i.tag&&null!==a&&(i=a,null!=(a=Ve(e,n))&&r.unshift(Mr(e,a,i)),null!=(a=Ve(e,t))&&r.push(Mr(e,a,i))),e=e.return}return r}function Ur(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function jr(e,t,n,r,i){for(var a=t._reactName,o=[];null!==n&&n!==r;){var s=n,l=s.alternate,u=s.stateNode;if(null!==l&&l===r)break;5===s.tag&&null!==u&&(s=u,i?null!=(l=Ve(n,a))&&o.unshift(Mr(n,l,s)):i||null!=(l=Ve(n,a))&&o.push(Mr(n,l,s))),n=n.return}0!==o.length&&e.push({event:t,listeners:o})}function Vr(){}var Fr=null,zr=null;function Br(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function Hr(e,t){return"textarea"===e||"option"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var Wr="function"==typeof setTimeout?setTimeout:void 0,qr="function"==typeof clearTimeout?clearTimeout:void 0;function $r(e){1===e.nodeType?e.textContent="":9===e.nodeType&&(null!=(e=e.body)&&(e.textContent=""))}function Kr(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break}return e}function Yr(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var Qr=0;var Jr=Math.random().toString(36).slice(2),Gr="__reactFiber$"+Jr,Xr="__reactProps$"+Jr,Zr="__reactContainer$"+Jr,ei="__reactEvents$"+Jr;function ti(e){var t=e[Gr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Zr]||n[Gr]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=Yr(e);null!==e;){if(n=e[Gr])return n;e=Yr(e)}return t}n=(e=n).parentNode}return null}function ni(e){return!(e=e[Gr]||e[Zr])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function ri(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(o(33))}function ii(e){return e[Xr]||null}function ai(e){var t=e[ei];return void 0===t&&(t=e[ei]=new Set),t}var oi=[],si=-1;function li(e){return{current:e}}function ui(e){0>si||(e.current=oi[si],oi[si]=null,si--)}function ci(e,t){si++,oi[si]=e.current,e.current=t}var fi={},di=li(fi),pi=li(!1),hi=fi;function vi(e,t){var n=e.type.contextTypes;if(!n)return fi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i,a={};for(i in n)a[i]=t[i];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function gi(e){return null!=(e=e.childContextTypes)}function yi(){ui(pi),ui(di)}function mi(e,t,n){if(di.current!==fi)throw Error(o(168));ci(di,t),ci(pi,n)}function bi(e,t,n){var r=e.stateNode;if(e=t.childContextTypes,"function"!=typeof r.getChildContext)return n;for(var a in r=r.getChildContext())if(!(a in e))throw Error(o(108,K(t)||"Unknown",a));return i({},n,r)}function Si(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||fi,hi=di.current,ci(di,e),ci(pi,pi.current),!0}function wi(e,t,n){var r=e.stateNode;if(!r)throw Error(o(169));n?(e=bi(e,t,hi),r.__reactInternalMemoizedMergedChildContext=e,ui(pi),ui(di),ci(di,e)):ui(pi),ci(pi,n)}var ki=null,Ei=null,xi=a.unstable_runWithPriority,_i=a.unstable_scheduleCallback,Ii=a.unstable_cancelCallback,Ti=a.unstable_shouldYield,Ci=a.unstable_requestPaint,Oi=a.unstable_now,Ni=a.unstable_getCurrentPriorityLevel,Ri=a.unstable_ImmediatePriority,Di=a.unstable_UserBlockingPriority,Pi=a.unstable_NormalPriority,Ai=a.unstable_LowPriority,Mi=a.unstable_IdlePriority,Li={},Ui=void 0!==Ci?Ci:function(){},ji=null,Vi=null,Fi=!1,zi=Oi(),Bi=1e4>zi?Oi:function(){return Oi()-zi};function Hi(){switch(Ni()){case Ri:return 99;case Di:return 98;case Pi:return 97;case Ai:return 96;case Mi:return 95;default:throw Error(o(332))}}function Wi(e){switch(e){case 99:return Ri;case 98:return Di;case 97:return Pi;case 96:return Ai;case 95:return Mi;default:throw Error(o(332))}}function qi(e,t){return e=Wi(e),xi(e,t)}function $i(e,t,n){return e=Wi(e),_i(e,t,n)}function Ki(){if(null!==Vi){var e=Vi;Vi=null,Ii(e)}Yi()}function Yi(){if(!Fi&&null!==ji){Fi=!0;var e=0;try{var t=ji;qi(99,(function(){for(;e<t.length;e++){var n=t[e];do{n=n(!0)}while(null!==n)}})),ji=null}catch(t){throw null!==ji&&(ji=ji.slice(e+1)),_i(Ri,Ki),t}finally{Fi=!1}}}var Qi=w.ReactCurrentBatchConfig;function Ji(e,t){if(e&&e.defaultProps){for(var n in t=i({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}return t}var Gi=li(null),Xi=null,Zi=null,ea=null;function ta(){ea=Zi=Xi=null}function na(e){var t=Gi.current;ui(Gi),e.type._context._currentValue=t}function ra(e,t){for(;null!==e;){var n=e.alternate;if((e.childLanes&t)===t){if(null===n||(n.childLanes&t)===t)break;n.childLanes|=t}else e.childLanes|=t,null!==n&&(n.childLanes|=t);e=e.return}}function ia(e,t){Xi=e,ea=Zi=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(!!(e.lanes&t)&&(Lo=!0),e.firstContext=null)}function aa(e,t){if(ea!==e&&!1!==t&&0!==t)if("number"==typeof t&&1073741823!==t||(ea=e,t=1073741823),t={context:e,observedBits:t,next:null},null===Zi){if(null===Xi)throw Error(o(308));Zi=t,Xi.dependencies={lanes:0,firstContext:t,responders:null}}else Zi=Zi.next=t;return e._currentValue}var oa=!1;function sa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null},effects:null}}function la(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function ua(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ca(e,t){if(null!==(e=e.updateQueue)){var n=(e=e.shared).pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}}function fa(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var i=null,a=null;if(null!==(n=n.firstBaseUpdate)){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===a?i=a=o:a=a.next=o,n=n.next}while(null!==n);null===a?i=a=t:a=a.next=t}else i=a=t;return n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,effects:r.effects},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function da(e,t,n,r){var a=e.updateQueue;oa=!1;var o=a.firstBaseUpdate,s=a.lastBaseUpdate,l=a.shared.pending;if(null!==l){a.shared.pending=null;var u=l,c=u.next;u.next=null,null===s?o=c:s.next=c,s=u;var f=e.alternate;if(null!==f){var d=(f=f.updateQueue).lastBaseUpdate;d!==s&&(null===d?f.firstBaseUpdate=c:d.next=c,f.lastBaseUpdate=u)}}if(null!==o){for(d=a.baseState,s=0,f=c=u=null;;){l=o.lane;var p=o.eventTime;if((r&l)===l){null!==f&&(f=f.next={eventTime:p,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var h=e,v=o;switch(l=t,p=n,v.tag){case 1:if("function"==typeof(h=v.payload)){d=h.call(p,d,l);break e}d=h;break e;case 3:h.flags=-4097&h.flags|64;case 0:if(null==(l="function"==typeof(h=v.payload)?h.call(p,d,l):h))break e;d=i({},d,l);break e;case 2:oa=!0}}null!==o.callback&&(e.flags|=32,null===(l=a.effects)?a.effects=[o]:l.push(o))}else p={eventTime:p,lane:l,tag:o.tag,payload:o.payload,callback:o.callback,next:null},null===f?(c=f=p,u=d):f=f.next=p,s|=l;if(null===(o=o.next)){if(null===(l=a.shared.pending))break;o=l.next,l.next=null,a.lastBaseUpdate=l,a.shared.pending=null}}null===f&&(u=d),a.baseState=u,a.firstBaseUpdate=c,a.lastBaseUpdate=f,zs|=s,e.lanes=s,e.memoizedState=d}}function pa(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(null!==i){if(r.callback=null,r=n,"function"!=typeof i)throw Error(o(191,i));i.call(r)}}}var ha=(new r.Component).refs;function va(e,t,n,r){n=null==(n=n(r,t=e.memoizedState))?t:i({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var ga={isMounted:function(e){return!!(e=e._reactInternals)&&Qe(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=dl(),i=pl(e),a=ua(r,i);a.payload=t,null!=n&&(a.callback=n),ca(e,a),hl(e,i,r)},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=dl(),i=pl(e),a=ua(r,i);a.tag=1,a.payload=t,null!=n&&(a.callback=n),ca(e,a),hl(e,i,r)},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=dl(),r=pl(e),i=ua(n,r);i.tag=2,null!=t&&(i.callback=t),ca(e,i),hl(e,r,n)}};function ya(e,t,n,r,i,a,o){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,a,o):!t.prototype||!t.prototype.isPureReactComponent||(!fr(n,r)||!fr(i,a))}function ma(e,t,n){var r=!1,i=fi,a=t.contextType;return"object"==typeof a&&null!==a?a=aa(a):(i=gi(t)?hi:di.current,a=(r=null!=(r=t.contextTypes))?vi(e,i):fi),t=new t(n,a),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=ga,e.stateNode=t,t._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function ba(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&ga.enqueueReplaceState(t,t.state,null)}function Sa(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs=ha,sa(e);var a=t.contextType;"object"==typeof a&&null!==a?i.context=aa(a):(a=gi(t)?hi:di.current,i.context=vi(e,a)),da(e,n,i,r),i.state=e.memoizedState,"function"==typeof(a=t.getDerivedStateFromProps)&&(va(e,t,a,n),i.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof i.getSnapshotBeforeUpdate||"function"!=typeof i.UNSAFE_componentWillMount&&"function"!=typeof i.componentWillMount||(t=i.state,"function"==typeof i.componentWillMount&&i.componentWillMount(),"function"==typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount(),t!==i.state&&ga.enqueueReplaceState(i,i.state,null),da(e,n,i,r),i.state=e.memoizedState),"function"==typeof i.componentDidMount&&(e.flags|=4)}var wa=Array.isArray;function ka(e,t,n){if(null!==(e=n.ref)&&"function"!=typeof e&&"object"!=typeof e){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(o(309));var r=n.stateNode}if(!r)throw Error(o(147,e));var i=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===i?t.ref:(t=function(e){var t=r.refs;t===ha&&(t=r.refs={}),null===e?delete t[i]:t[i]=e},t._stringRef=i,t)}if("string"!=typeof e)throw Error(o(284));if(!n._owner)throw Error(o(290,e))}return e}function Ea(e,t){if("textarea"!==e.type)throw Error(o(31,"[object Object]"===Object.prototype.toString.call(t)?"object with keys {"+Object.keys(t).join(", ")+"}":t))}function xa(e){function t(t,n){if(e){var r=t.lastEffect;null!==r?(r.nextEffect=n,t.lastEffect=n):t.firstEffect=t.lastEffect=n,n.nextEffect=null,n.flags=8}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function i(e,t){return(e=$l(e,t)).index=0,e.sibling=null,e}function a(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.flags=2,n):r:(t.flags=2,n):n}function s(t){return e&&null===t.alternate&&(t.flags=2),t}function l(e,t,n,r){return null===t||6!==t.tag?((t=Jl(n,e.mode,r)).return=e,t):((t=i(t,n)).return=e,t)}function u(e,t,n,r){return null!==t&&t.elementType===n.type?((r=i(t,n.props)).ref=ka(e,t,n),r.return=e,r):((r=Kl(n.type,n.key,n.props,null,e.mode,r)).ref=ka(e,t,n),r.return=e,r)}function c(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Gl(n,e.mode,r)).return=e,t):((t=i(t,n.children||[])).return=e,t)}function f(e,t,n,r,a){return null===t||7!==t.tag?((t=Yl(n,e.mode,r,a)).return=e,t):((t=i(t,n)).return=e,t)}function d(e,t,n){if("string"==typeof t||"number"==typeof t)return(t=Jl(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case k:return(n=Kl(t.type,t.key,t.props,null,e.mode,n)).ref=ka(e,null,t),n.return=e,n;case E:return(t=Gl(t,e.mode,n)).return=e,t}if(wa(t)||B(t))return(t=Yl(t,e.mode,n,null)).return=e,t;Ea(e,t)}return null}function p(e,t,n,r){var i=null!==t?t.key:null;if("string"==typeof n||"number"==typeof n)return null!==i?null:l(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case k:return n.key===i?n.type===x?f(e,t,n.props.children,r,i):u(e,t,n,r):null;case E:return n.key===i?c(e,t,n,r):null}if(wa(n)||B(n))return null!==i?null:f(e,t,n,r,null);Ea(e,n)}return null}function h(e,t,n,r,i){if("string"==typeof r||"number"==typeof r)return l(t,e=e.get(n)||null,""+r,i);if("object"==typeof r&&null!==r){switch(r.$$typeof){case k:return e=e.get(null===r.key?n:r.key)||null,r.type===x?f(t,e,r.props.children,i,r.key):u(t,e,r,i);case E:return c(t,e=e.get(null===r.key?n:r.key)||null,r,i)}if(wa(r)||B(r))return f(t,e=e.get(n)||null,r,i,null);Ea(t,r)}return null}function v(i,o,s,l){for(var u=null,c=null,f=o,v=o=0,g=null;null!==f&&v<s.length;v++){f.index>v?(g=f,f=null):g=f.sibling;var y=p(i,f,s[v],l);if(null===y){null===f&&(f=g);break}e&&f&&null===y.alternate&&t(i,f),o=a(y,o,v),null===c?u=y:c.sibling=y,c=y,f=g}if(v===s.length)return n(i,f),u;if(null===f){for(;v<s.length;v++)null!==(f=d(i,s[v],l))&&(o=a(f,o,v),null===c?u=f:c.sibling=f,c=f);return u}for(f=r(i,f);v<s.length;v++)null!==(g=h(f,i,v,s[v],l))&&(e&&null!==g.alternate&&f.delete(null===g.key?v:g.key),o=a(g,o,v),null===c?u=g:c.sibling=g,c=g);return e&&f.forEach((function(e){return t(i,e)})),u}function g(i,s,l,u){var c=B(l);if("function"!=typeof c)throw Error(o(150));if(null==(l=c.call(l)))throw Error(o(151));for(var f=c=null,v=s,g=s=0,y=null,m=l.next();null!==v&&!m.done;g++,m=l.next()){v.index>g?(y=v,v=null):y=v.sibling;var b=p(i,v,m.value,u);if(null===b){null===v&&(v=y);break}e&&v&&null===b.alternate&&t(i,v),s=a(b,s,g),null===f?c=b:f.sibling=b,f=b,v=y}if(m.done)return n(i,v),c;if(null===v){for(;!m.done;g++,m=l.next())null!==(m=d(i,m.value,u))&&(s=a(m,s,g),null===f?c=m:f.sibling=m,f=m);return c}for(v=r(i,v);!m.done;g++,m=l.next())null!==(m=h(v,i,g,m.value,u))&&(e&&null!==m.alternate&&v.delete(null===m.key?g:m.key),s=a(m,s,g),null===f?c=m:f.sibling=m,f=m);return e&&v.forEach((function(e){return t(i,e)})),c}return function(e,r,a,l){var u="object"==typeof a&&null!==a&&a.type===x&&null===a.key;u&&(a=a.props.children);var c="object"==typeof a&&null!==a;if(c)switch(a.$$typeof){case k:e:{for(c=a.key,u=r;null!==u;){if(u.key===c){if(7===u.tag){if(a.type===x){n(e,u.sibling),(r=i(u,a.props.children)).return=e,e=r;break e}}else if(u.elementType===a.type){n(e,u.sibling),(r=i(u,a.props)).ref=ka(e,u,a),r.return=e,e=r;break e}n(e,u);break}t(e,u),u=u.sibling}a.type===x?((r=Yl(a.props.children,e.mode,l,a.key)).return=e,e=r):((l=Kl(a.type,a.key,a.props,null,e.mode,l)).ref=ka(e,r,a),l.return=e,e=l)}return s(e);case E:e:{for(u=a.key;null!==r;){if(r.key===u){if(4===r.tag&&r.stateNode.containerInfo===a.containerInfo&&r.stateNode.implementation===a.implementation){n(e,r.sibling),(r=i(r,a.children||[])).return=e,e=r;break e}n(e,r);break}t(e,r),r=r.sibling}(r=Gl(a,e.mode,l)).return=e,e=r}return s(e)}if("string"==typeof a||"number"==typeof a)return a=""+a,null!==r&&6===r.tag?(n(e,r.sibling),(r=i(r,a)).return=e,e=r):(n(e,r),(r=Jl(a,e.mode,l)).return=e,e=r),s(e);if(wa(a))return v(e,r,a,l);if(B(a))return g(e,r,a,l);if(c&&Ea(e,a),void 0===a&&!u)switch(e.tag){case 1:case 22:case 0:case 11:case 15:throw Error(o(152,K(e.type)||"Component"))}return n(e,r)}}var _a=xa(!0),Ia=xa(!1),Ta={},Ca=li(Ta),Oa=li(Ta),Na=li(Ta);function Ra(e){if(e===Ta)throw Error(o(174));return e}function Da(e,t){switch(ci(Na,t),ci(Oa,e),ci(Ca,Ta),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:pe(null,"");break;default:t=pe(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}ui(Ca),ci(Ca,t)}function Pa(){ui(Ca),ui(Oa),ui(Na)}function Aa(e){Ra(Na.current);var t=Ra(Ca.current),n=pe(t,e.type);t!==n&&(ci(Oa,e),ci(Ca,n))}function Ma(e){Oa.current===e&&(ui(Ca),ui(Oa))}var La=li(0);function Ua(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(64&t.flags)return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ja=null,Va=null,Fa=!1;function za(e,t){var n=Wl(5,null,null,0);n.elementType="DELETED",n.type="DELETED",n.stateNode=t,n.return=e,n.flags=8,null!==e.lastEffect?(e.lastEffect.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n}function Ba(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,!0);default:return!1}}function Ha(e){if(Fa){var t=Va;if(t){var n=t;if(!Ba(e,t)){if(!(t=Kr(n.nextSibling))||!Ba(e,t))return e.flags=-1025&e.flags|2,Fa=!1,void(ja=e);za(ja,n)}ja=e,Va=Kr(t.firstChild)}else e.flags=-1025&e.flags|2,Fa=!1,ja=e}}function Wa(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;ja=e}function qa(e){if(e!==ja)return!1;if(!Fa)return Wa(e),Fa=!0,!1;var t=e.type;if(5!==e.tag||"head"!==t&&"body"!==t&&!Hr(t,e.memoizedProps))for(t=Va;t;)za(e,t),t=Kr(t.nextSibling);if(Wa(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(o(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n){if(0===t){Va=Kr(e.nextSibling);break e}t--}else"$"!==n&&"$!"!==n&&"$?"!==n||t++}e=e.nextSibling}Va=null}}else Va=ja?Kr(e.stateNode.nextSibling):null;return!0}function $a(){Va=ja=null,Fa=!1}var Ka=[];function Ya(){for(var e=0;e<Ka.length;e++)Ka[e]._workInProgressVersionPrimary=null;Ka.length=0}var Qa=w.ReactCurrentDispatcher,Ja=w.ReactCurrentBatchConfig,Ga=0,Xa=null,Za=null,eo=null,to=!1,no=!1;function ro(){throw Error(o(321))}function io(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!ur(e[n],t[n]))return!1;return!0}function ao(e,t,n,r,i,a){if(Ga=a,Xa=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Qa.current=null===e||null===e.memoizedState?Do:Po,e=n(r,i),no){a=0;do{if(no=!1,!(25>a))throw Error(o(301));a+=1,eo=Za=null,t.updateQueue=null,Qa.current=Ao,e=n(r,i)}while(no)}if(Qa.current=Ro,t=null!==Za&&null!==Za.next,Ga=0,eo=Za=Xa=null,to=!1,t)throw Error(o(300));return e}function oo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===eo?Xa.memoizedState=eo=e:eo=eo.next=e,eo}function so(){if(null===Za){var e=Xa.alternate;e=null!==e?e.memoizedState:null}else e=Za.next;var t=null===eo?Xa.memoizedState:eo.next;if(null!==t)eo=t,Za=e;else{if(null===e)throw Error(o(310));e={memoizedState:(Za=e).memoizedState,baseState:Za.baseState,baseQueue:Za.baseQueue,queue:Za.queue,next:null},null===eo?Xa.memoizedState=eo=e:eo=eo.next=e}return eo}function lo(e,t){return"function"==typeof t?t(e):t}function uo(e){var t=so(),n=t.queue;if(null===n)throw Error(o(311));n.lastRenderedReducer=e;var r=Za,i=r.baseQueue,a=n.pending;if(null!==a){if(null!==i){var s=i.next;i.next=a.next,a.next=s}r.baseQueue=i=a,n.pending=null}if(null!==i){i=i.next,r=r.baseState;var l=s=a=null,u=i;do{var c=u.lane;if((Ga&c)===c)null!==l&&(l=l.next={lane:0,action:u.action,eagerReducer:u.eagerReducer,eagerState:u.eagerState,next:null}),r=u.eagerReducer===e?u.eagerState:e(r,u.action);else{var f={lane:c,action:u.action,eagerReducer:u.eagerReducer,eagerState:u.eagerState,next:null};null===l?(s=l=f,a=r):l=l.next=f,Xa.lanes|=c,zs|=c}u=u.next}while(null!==u&&u!==i);null===l?a=r:l.next=s,ur(r,t.memoizedState)||(Lo=!0),t.memoizedState=r,t.baseState=a,t.baseQueue=l,n.lastRenderedState=r}return[t.memoizedState,n.dispatch]}function co(e){var t=so(),n=t.queue;if(null===n)throw Error(o(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,a=t.memoizedState;if(null!==i){n.pending=null;var s=i=i.next;do{a=e(a,s.action),s=s.next}while(s!==i);ur(a,t.memoizedState)||(Lo=!0),t.memoizedState=a,null===t.baseQueue&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function fo(e,t,n){var r=t._getVersion;r=r(t._source);var i=t._workInProgressVersionPrimary;if(null!==i?e=i===r:(e=e.mutableReadLanes,(e=(Ga&e)===e)&&(t._workInProgressVersionPrimary=r,Ka.push(t))),e)return n(t._source);throw Ka.push(t),Error(o(350))}function po(e,t,n,r){var i=Ps;if(null===i)throw Error(o(349));var a=t._getVersion,s=a(t._source),l=Qa.current,u=l.useState((function(){return fo(i,t,n)})),c=u[1],f=u[0];u=eo;var d=e.memoizedState,p=d.refs,h=p.getSnapshot,v=d.source;d=d.subscribe;var g=Xa;return e.memoizedState={refs:p,source:t,subscribe:r},l.useEffect((function(){p.getSnapshot=n,p.setSnapshot=c;var e=a(t._source);if(!ur(s,e)){e=n(t._source),ur(f,e)||(c(e),e=pl(g),i.mutableReadLanes|=e&i.pendingLanes),e=i.mutableReadLanes,i.entangledLanes|=e;for(var r=i.entanglements,o=e;0<o;){var l=31-Ht(o),u=1<<l;r[l]|=e,o&=~u}}}),[n,t,r]),l.useEffect((function(){return r(t._source,(function(){var e=p.getSnapshot,n=p.setSnapshot;try{n(e(t._source));var r=pl(g);i.mutableReadLanes|=r&i.pendingLanes}catch(e){n((function(){throw e}))}}))}),[t,r]),ur(h,n)&&ur(v,t)&&ur(d,r)||((e={pending:null,dispatch:null,lastRenderedReducer:lo,lastRenderedState:f}).dispatch=c=No.bind(null,Xa,e),u.queue=e,u.baseQueue=null,f=fo(i,t,n),u.memoizedState=u.baseState=f),f}function ho(e,t,n){return po(so(),e,t,n)}function vo(e){var t=oo();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={pending:null,dispatch:null,lastRenderedReducer:lo,lastRenderedState:e}).dispatch=No.bind(null,Xa,e),[t.memoizedState,e]}function go(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=Xa.updateQueue)?(t={lastEffect:null},Xa.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function yo(e){return e={current:e},oo().memoizedState=e}function mo(){return so().memoizedState}function bo(e,t,n,r){var i=oo();Xa.flags|=e,i.memoizedState=go(1|t,n,void 0,void 0===r?null:r)}function So(e,t,n,r){var i=so();r=void 0===r?null:r;var a=void 0;if(null!==Za){var o=Za.memoizedState;if(a=o.destroy,null!==r&&io(r,o.deps))return void go(t,n,a,r)}Xa.flags|=e,i.memoizedState=go(1|t,n,a,r)}function wo(e,t){return bo(516,4,e,t)}function ko(e,t){return So(516,4,e,t)}function Eo(e,t){return So(4,2,e,t)}function xo(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function _o(e,t,n){return n=null!=n?n.concat([e]):null,So(4,2,xo.bind(null,t,e),n)}function Io(){}function To(e,t){var n=so();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&io(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Co(e,t){var n=so();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&io(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Oo(e,t){var n=Hi();qi(98>n?98:n,(function(){e(!0)})),qi(97<n?97:n,(function(){var n=Ja.transition;Ja.transition=1;try{e(!1),t()}finally{Ja.transition=n}}))}function No(e,t,n){var r=dl(),i=pl(e),a={lane:i,action:n,eagerReducer:null,eagerState:null,next:null},o=t.pending;if(null===o?a.next=a:(a.next=o.next,o.next=a),t.pending=a,o=e.alternate,e===Xa||null!==o&&o===Xa)no=to=!0;else{if(0===e.lanes&&(null===o||0===o.lanes)&&null!==(o=t.lastRenderedReducer))try{var s=t.lastRenderedState,l=o(s,n);if(a.eagerReducer=o,a.eagerState=l,ur(l,s))return}catch(e){}hl(e,i,r)}}var Ro={readContext:aa,useCallback:ro,useContext:ro,useEffect:ro,useImperativeHandle:ro,useLayoutEffect:ro,useMemo:ro,useReducer:ro,useRef:ro,useState:ro,useDebugValue:ro,useDeferredValue:ro,useTransition:ro,useMutableSource:ro,useOpaqueIdentifier:ro,unstable_isNewReconciler:!1},Do={readContext:aa,useCallback:function(e,t){return oo().memoizedState=[e,void 0===t?null:t],e},useContext:aa,useEffect:wo,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,bo(4,2,xo.bind(null,t,e),n)},useLayoutEffect:function(e,t){return bo(4,2,e,t)},useMemo:function(e,t){var n=oo();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=oo();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e=(e=r.queue={pending:null,dispatch:null,lastRenderedReducer:e,lastRenderedState:t}).dispatch=No.bind(null,Xa,e),[r.memoizedState,e]},useRef:yo,useState:vo,useDebugValue:Io,useDeferredValue:function(e){var t=vo(e),n=t[0],r=t[1];return wo((function(){var t=Ja.transition;Ja.transition=1;try{r(e)}finally{Ja.transition=t}}),[e]),n},useTransition:function(){var e=vo(!1),t=e[0];return yo(e=Oo.bind(null,e[1])),[e,t]},useMutableSource:function(e,t,n){var r=oo();return r.memoizedState={refs:{getSnapshot:t,setSnapshot:null},source:e,subscribe:n},po(r,e,t,n)},useOpaqueIdentifier:function(){if(Fa){var e=!1,t=function(e){return{$$typeof:M,toString:e,valueOf:e}}((function(){throw e||(e=!0,n("r:"+(Qr++).toString(36))),Error(o(355))})),n=vo(t)[1];return!(2&Xa.mode)&&(Xa.flags|=516,go(5,(function(){n("r:"+(Qr++).toString(36))}),void 0,null)),t}return vo(t="r:"+(Qr++).toString(36)),t},unstable_isNewReconciler:!1},Po={readContext:aa,useCallback:To,useContext:aa,useEffect:ko,useImperativeHandle:_o,useLayoutEffect:Eo,useMemo:Co,useReducer:uo,useRef:mo,useState:function(){return uo(lo)},useDebugValue:Io,useDeferredValue:function(e){var t=uo(lo),n=t[0],r=t[1];return ko((function(){var t=Ja.transition;Ja.transition=1;try{r(e)}finally{Ja.transition=t}}),[e]),n},useTransition:function(){var e=uo(lo)[0];return[mo().current,e]},useMutableSource:ho,useOpaqueIdentifier:function(){return uo(lo)[0]},unstable_isNewReconciler:!1},Ao={readContext:aa,useCallback:To,useContext:aa,useEffect:ko,useImperativeHandle:_o,useLayoutEffect:Eo,useMemo:Co,useReducer:co,useRef:mo,useState:function(){return co(lo)},useDebugValue:Io,useDeferredValue:function(e){var t=co(lo),n=t[0],r=t[1];return ko((function(){var t=Ja.transition;Ja.transition=1;try{r(e)}finally{Ja.transition=t}}),[e]),n},useTransition:function(){var e=co(lo)[0];return[mo().current,e]},useMutableSource:ho,useOpaqueIdentifier:function(){return co(lo)[0]},unstable_isNewReconciler:!1},Mo=w.ReactCurrentOwner,Lo=!1;function Uo(e,t,n,r){t.child=null===e?Ia(t,null,n,r):_a(t,e.child,n,r)}function jo(e,t,n,r,i){n=n.render;var a=t.ref;return ia(t,i),r=ao(e,t,n,r,a,i),null===e||Lo?(t.flags|=1,Uo(e,t,r,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-517,e.lanes&=~i,as(e,t,i))}function Vo(e,t,n,r,i,a){if(null===e){var o=n.type;return"function"!=typeof o||ql(o)||void 0!==o.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=Kl(n.type,null,r,t,t.mode,a)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=o,Fo(e,t,o,r,i,a))}return o=e.child,i&a||(i=o.memoizedProps,!(n=null!==(n=n.compare)?n:fr)(i,r)||e.ref!==t.ref)?(t.flags|=1,(e=$l(o,r)).ref=t.ref,e.return=t,t.child=e):as(e,t,a)}function Fo(e,t,n,r,i,a){if(null!==e&&fr(e.memoizedProps,r)&&e.ref===t.ref){if(Lo=!1,!(a&i))return t.lanes=e.lanes,as(e,t,a);16384&e.flags&&(Lo=!0)}return Ho(e,t,n,r,a)}function zo(e,t,n){var r=t.pendingProps,i=r.children,a=null!==e?e.memoizedState:null;if("hidden"===r.mode||"unstable-defer-without-hiding"===r.mode)if(4&t.mode){if(!(1073741824&n))return e=null!==a?a.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e},kl(t,e),null;t.memoizedState={baseLanes:0},kl(t,null!==a?a.baseLanes:n)}else t.memoizedState={baseLanes:0},kl(t,n);else null!==a?(r=a.baseLanes|n,t.memoizedState=null):r=n,kl(t,r);return Uo(e,t,i,n),t.child}function Bo(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=128)}function Ho(e,t,n,r,i){var a=gi(n)?hi:di.current;return a=vi(t,a),ia(t,i),n=ao(e,t,n,r,a,i),null===e||Lo?(t.flags|=1,Uo(e,t,n,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-517,e.lanes&=~i,as(e,t,i))}function Wo(e,t,n,r,i){if(gi(n)){var a=!0;Si(t)}else a=!1;if(ia(t,i),null===t.stateNode)null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),ma(t,n,r),Sa(t,n,r,i),r=!0;else if(null===e){var o=t.stateNode,s=t.memoizedProps;o.props=s;var l=o.context,u=n.contextType;"object"==typeof u&&null!==u?u=aa(u):u=vi(t,u=gi(n)?hi:di.current);var c=n.getDerivedStateFromProps,f="function"==typeof c||"function"==typeof o.getSnapshotBeforeUpdate;f||"function"!=typeof o.UNSAFE_componentWillReceiveProps&&"function"!=typeof o.componentWillReceiveProps||(s!==r||l!==u)&&ba(t,o,r,u),oa=!1;var d=t.memoizedState;o.state=d,da(t,r,o,i),l=t.memoizedState,s!==r||d!==l||pi.current||oa?("function"==typeof c&&(va(t,n,c,r),l=t.memoizedState),(s=oa||ya(t,n,s,r,d,l,u))?(f||"function"!=typeof o.UNSAFE_componentWillMount&&"function"!=typeof o.componentWillMount||("function"==typeof o.componentWillMount&&o.componentWillMount(),"function"==typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount()),"function"==typeof o.componentDidMount&&(t.flags|=4)):("function"==typeof o.componentDidMount&&(t.flags|=4),t.memoizedProps=r,t.memoizedState=l),o.props=r,o.state=l,o.context=u,r=s):("function"==typeof o.componentDidMount&&(t.flags|=4),r=!1)}else{o=t.stateNode,la(e,t),s=t.memoizedProps,u=t.type===t.elementType?s:Ji(t.type,s),o.props=u,f=t.pendingProps,d=o.context,"object"==typeof(l=n.contextType)&&null!==l?l=aa(l):l=vi(t,l=gi(n)?hi:di.current);var p=n.getDerivedStateFromProps;(c="function"==typeof p||"function"==typeof o.getSnapshotBeforeUpdate)||"function"!=typeof o.UNSAFE_componentWillReceiveProps&&"function"!=typeof o.componentWillReceiveProps||(s!==f||d!==l)&&ba(t,o,r,l),oa=!1,d=t.memoizedState,o.state=d,da(t,r,o,i);var h=t.memoizedState;s!==f||d!==h||pi.current||oa?("function"==typeof p&&(va(t,n,p,r),h=t.memoizedState),(u=oa||ya(t,n,u,r,d,h,l))?(c||"function"!=typeof o.UNSAFE_componentWillUpdate&&"function"!=typeof o.componentWillUpdate||("function"==typeof o.componentWillUpdate&&o.componentWillUpdate(r,h,l),"function"==typeof o.UNSAFE_componentWillUpdate&&o.UNSAFE_componentWillUpdate(r,h,l)),"function"==typeof o.componentDidUpdate&&(t.flags|=4),"function"==typeof o.getSnapshotBeforeUpdate&&(t.flags|=256)):("function"!=typeof o.componentDidUpdate||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),"function"!=typeof o.getSnapshotBeforeUpdate||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=256),t.memoizedProps=r,t.memoizedState=h),o.props=r,o.state=h,o.context=l,r=u):("function"!=typeof o.componentDidUpdate||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),"function"!=typeof o.getSnapshotBeforeUpdate||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=256),r=!1)}return qo(e,t,n,r,a,i)}function qo(e,t,n,r,i,a){Bo(e,t);var o=!!(64&t.flags);if(!r&&!o)return i&&wi(t,n,!1),as(e,t,a);r=t.stateNode,Mo.current=t;var s=o&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&o?(t.child=_a(t,e.child,null,a),t.child=_a(t,null,s,a)):Uo(e,t,s,a),t.memoizedState=r.state,i&&wi(t,n,!0),t.child}function $o(e){var t=e.stateNode;t.pendingContext?mi(0,t.pendingContext,t.pendingContext!==t.context):t.context&&mi(0,t.context,!1),Da(e,t.containerInfo)}var Ko,Yo,Qo,Jo,Go={dehydrated:null,retryLane:0};function Xo(e,t,n){var r,i=t.pendingProps,a=La.current,o=!1;return(r=!!(64&t.flags))||(r=(null===e||null!==e.memoizedState)&&!!(2&a)),r?(o=!0,t.flags&=-65):null!==e&&null===e.memoizedState||void 0===i.fallback||!0===i.unstable_avoidThisFallback||(a|=1),ci(La,1&a),null===e?(void 0!==i.fallback&&Ha(t),e=i.children,a=i.fallback,o?(e=Zo(t,e,a,n),t.child.memoizedState={baseLanes:n},t.memoizedState=Go,e):"number"==typeof i.unstable_expectedLoadTime?(e=Zo(t,e,a,n),t.child.memoizedState={baseLanes:n},t.memoizedState=Go,t.lanes=33554432,e):((n=Ql({mode:"visible",children:e},t.mode,n,null)).return=t,t.child=n)):(e.memoizedState,o?(i=ts(e,t,i.children,i.fallback,n),o=t.child,a=e.child.memoizedState,o.memoizedState=null===a?{baseLanes:n}:{baseLanes:a.baseLanes|n},o.childLanes=e.childLanes&~n,t.memoizedState=Go,i):(n=es(e,t,i.children,n),t.memoizedState=null,n))}function Zo(e,t,n,r){var i=e.mode,a=e.child;return t={mode:"hidden",children:t},2&i||null===a?a=Ql(t,i,0,null):(a.childLanes=0,a.pendingProps=t),n=Yl(n,i,r,null),a.return=e,n.return=e,a.sibling=n,e.child=a,n}function es(e,t,n,r){var i=e.child;return e=i.sibling,n=$l(i,{mode:"visible",children:n}),!(2&t.mode)&&(n.lanes=r),n.return=t,n.sibling=null,null!==e&&(e.nextEffect=null,e.flags=8,t.firstEffect=t.lastEffect=e),t.child=n}function ts(e,t,n,r,i){var a=t.mode,o=e.child;e=o.sibling;var s={mode:"hidden",children:n};return 2&a||t.child===o?n=$l(o,s):((n=t.child).childLanes=0,n.pendingProps=s,null!==(o=n.lastEffect)?(t.firstEffect=n.firstEffect,t.lastEffect=o,o.nextEffect=null):t.firstEffect=t.lastEffect=null),null!==e?r=$l(e,r):(r=Yl(r,a,i,null)).flags|=2,r.return=t,n.return=t,n.sibling=r,t.child=n,r}function ns(e,t){e.lanes|=t;var n=e.alternate;null!==n&&(n.lanes|=t),ra(e.return,t)}function rs(e,t,n,r,i,a){var o=e.memoizedState;null===o?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,lastEffect:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.lastEffect=a)}function is(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(Uo(e,t,r.children,n),2&(r=La.current))r=1&r|2,t.flags|=64;else{if(null!==e&&64&e.flags)e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&ns(e,n);else if(19===e.tag)ns(e,n);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ci(La,r),2&t.mode)switch(i){case"forwards":for(n=t.child,i=null;null!==n;)null!==(e=n.alternate)&&null===Ua(e)&&(i=n),n=n.sibling;null===(n=i)?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),rs(t,!1,i,n,a,t.lastEffect);break;case"backwards":for(n=null,i=t.child,t.child=null;null!==i;){if(null!==(e=i.alternate)&&null===Ua(e)){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}rs(t,!0,n,null,a,t.lastEffect);break;case"together":rs(t,!1,null,null,void 0,t.lastEffect);break;default:t.memoizedState=null}else t.memoizedState=null;return t.child}function as(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),zs|=t.lanes,n&t.childLanes){if(null!==e&&t.child!==e.child)throw Error(o(153));if(null!==t.child){for(n=$l(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=$l(e,e.pendingProps)).return=t;n.sibling=null}return t.child}return null}function os(e,t){if(!Fa)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function ss(e,t,n){var r=t.pendingProps;switch(t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return null;case 1:case 17:return gi(t.type)&&yi(),null;case 3:return Pa(),ui(pi),ui(di),Ya(),(r=t.stateNode).pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==e&&null!==e.child||(qa(t)?t.flags|=4:r.hydrate||(t.flags|=256)),Yo(t),null;case 5:Ma(t);var a=Ra(Na.current);if(n=t.type,null!==e&&null!=t.stateNode)Qo(e,t,n,r,a),e.ref!==t.ref&&(t.flags|=128);else{if(!r){if(null===t.stateNode)throw Error(o(166));return null}if(e=Ra(Ca.current),qa(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[Gr]=t,r[Xr]=s,n){case"dialog":Or("cancel",r),Or("close",r);break;case"iframe":case"object":case"embed":Or("load",r);break;case"video":case"audio":for(e=0;e<_r.length;e++)Or(_r[e],r);break;case"source":Or("error",r);break;case"img":case"image":case"link":Or("error",r),Or("load",r);break;case"details":Or("toggle",r);break;case"input":ee(r,s),Or("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},Or("invalid",r);break;case"textarea":le(r,s),Or("invalid",r)}for(var u in Ee(n,s),e=null,s)s.hasOwnProperty(u)&&(a=s[u],"children"===u?"string"==typeof a?r.textContent!==a&&(e=["children",a]):"number"==typeof a&&r.textContent!==""+a&&(e=["children",""+a]):l.hasOwnProperty(u)&&null!=a&&"onScroll"===u&&Or("scroll",r));switch(n){case"input":J(r),re(r,s,!0);break;case"textarea":J(r),ce(r);break;case"select":case"option":break;default:"function"==typeof s.onClick&&(r.onclick=Vr)}r=e,t.updateQueue=r,null!==r&&(t.flags|=4)}else{switch(u=9===a.nodeType?a:a.ownerDocument,e===fe.html&&(e=de(n)),e===fe.html?"script"===n?((e=u.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"==typeof r.is?e=u.createElement(n,{is:r.is}):(e=u.createElement(n),"select"===n&&(u=e,r.multiple?u.multiple=!0:r.size&&(u.size=r.size))):e=u.createElementNS(e,n),e[Gr]=t,e[Xr]=r,Ko(e,t,!1,!1),t.stateNode=e,u=xe(n,r),n){case"dialog":Or("cancel",e),Or("close",e),a=r;break;case"iframe":case"object":case"embed":Or("load",e),a=r;break;case"video":case"audio":for(a=0;a<_r.length;a++)Or(_r[a],e);a=r;break;case"source":Or("error",e),a=r;break;case"img":case"image":case"link":Or("error",e),Or("load",e),a=r;break;case"details":Or("toggle",e),a=r;break;case"input":ee(e,r),a=Z(e,r),Or("invalid",e);break;case"option":a=ae(e,r);break;case"select":e._wrapperState={wasMultiple:!!r.multiple},a=i({},r,{value:void 0}),Or("invalid",e);break;case"textarea":le(e,r),a=se(e,r),Or("invalid",e);break;default:a=r}Ee(n,a);var c=a;for(s in c)if(c.hasOwnProperty(s)){var f=c[s];"style"===s?we(e,f):"dangerouslySetInnerHTML"===s?null!=(f=f?f.__html:void 0)&&ge(e,f):"children"===s?"string"==typeof f?("textarea"!==n||""!==f)&&ye(e,f):"number"==typeof f&&ye(e,""+f):"suppressContentEditableWarning"!==s&&"suppressHydrationWarning"!==s&&"autoFocus"!==s&&(l.hasOwnProperty(s)?null!=f&&"onScroll"===s&&Or("scroll",e):null!=f&&S(e,s,f,u))}switch(n){case"input":J(e),re(e,r,!1);break;case"textarea":J(e),ce(e);break;case"option":null!=r.value&&e.setAttribute("value",""+Y(r.value));break;case"select":e.multiple=!!r.multiple,null!=(s=r.value)?oe(e,!!r.multiple,s,!1):null!=r.defaultValue&&oe(e,!!r.multiple,r.defaultValue,!0);break;default:"function"==typeof a.onClick&&(e.onclick=Vr)}Br(n,r)&&(t.flags|=4)}null!==t.ref&&(t.flags|=128)}return null;case 6:if(e&&null!=t.stateNode)Jo(e,t,e.memoizedProps,r);else{if("string"!=typeof r&&null===t.stateNode)throw Error(o(166));n=Ra(Na.current),Ra(Ca.current),qa(t)?(r=t.stateNode,n=t.memoizedProps,r[Gr]=t,r.nodeValue!==n&&(t.flags|=4)):((r=(9===n.nodeType?n:n.ownerDocument).createTextNode(r))[Gr]=t,t.stateNode=r)}return null;case 13:return ui(La),r=t.memoizedState,64&t.flags?(t.lanes=n,t):(r=null!==r,n=!1,null===e?void 0!==t.memoizedProps.fallback&&qa(t):n=null!==e.memoizedState,r&&!n&&2&t.mode&&(null===e&&!0!==t.memoizedProps.unstable_avoidThisFallback||1&La.current?0===js&&(js=3):(0!==js&&3!==js||(js=4),null===Ps||!(134217727&zs)&&!(134217727&Bs)||ml(Ps,Ms))),(r||n)&&(t.flags|=4),null);case 4:return Pa(),Yo(t),null===e&&Rr(t.stateNode.containerInfo),null;case 10:return na(t),null;case 19:if(ui(La),null===(r=t.memoizedState))return null;if(s=!!(64&t.flags),null===(u=r.rendering))if(s)os(r,!1);else{if(0!==js||null!==e&&64&e.flags)for(e=t.child;null!==e;){if(null!==(u=Ua(e))){for(t.flags|=64,os(r,!1),null!==(s=u.updateQueue)&&(t.updateQueue=s,t.flags|=4),null===r.lastEffect&&(t.firstEffect=null),t.lastEffect=r.lastEffect,r=n,n=t.child;null!==n;)e=r,(s=n).flags&=2,s.nextEffect=null,s.firstEffect=null,s.lastEffect=null,null===(u=s.alternate)?(s.childLanes=0,s.lanes=e,s.child=null,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=u.childLanes,s.lanes=u.lanes,s.child=u.child,s.memoizedProps=u.memoizedProps,s.memoizedState=u.memoizedState,s.updateQueue=u.updateQueue,s.type=u.type,e=u.dependencies,s.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ci(La,1&La.current|2),t.child}e=e.sibling}null!==r.tail&&Bi()>$s&&(t.flags|=64,s=!0,os(r,!1),t.lanes=33554432)}else{if(!s)if(null!==(e=Ua(u))){if(t.flags|=64,s=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.flags|=4),os(r,!0),null===r.tail&&"hidden"===r.tailMode&&!u.alternate&&!Fa)return null!==(t=t.lastEffect=r.lastEffect)&&(t.nextEffect=null),null}else 2*Bi()-r.renderingStartTime>$s&&1073741824!==n&&(t.flags|=64,s=!0,os(r,!1),t.lanes=33554432);r.isBackwards?(u.sibling=t.child,t.child=u):(null!==(n=r.last)?n.sibling=u:t.child=u,r.last=u)}return null!==r.tail?(n=r.tail,r.rendering=n,r.tail=n.sibling,r.lastEffect=t.lastEffect,r.renderingStartTime=Bi(),n.sibling=null,t=La.current,ci(La,s?1&t|2:1&t),n):null;case 23:case 24:return El(),null!==e&&null!==e.memoizedState!=(null!==t.memoizedState)&&"unstable-defer-without-hiding"!==r.mode&&(t.flags|=4),null}throw Error(o(156,t.tag))}function ls(e){switch(e.tag){case 1:gi(e.type)&&yi();var t=e.flags;return 4096&t?(e.flags=-4097&t|64,e):null;case 3:if(Pa(),ui(pi),ui(di),Ya(),64&(t=e.flags))throw Error(o(285));return e.flags=-4097&t|64,e;case 5:return Ma(e),null;case 13:return ui(La),4096&(t=e.flags)?(e.flags=-4097&t|64,e):null;case 19:return ui(La),null;case 4:return Pa(),null;case 10:return na(e),null;case 23:case 24:return El(),null;default:return null}}function us(e,t){try{var n="",r=t;do{n+=$(r),r=r.return}while(r);var i=n}catch(e){i="\nError generating stack: "+e.message+"\n"+e.stack}return{value:e,source:t,stack:i}}function cs(e,t){try{console.error(t.value)}catch(e){setTimeout((function(){throw e}))}}Ko=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Yo=function(){},Qo=function(e,t,n,r){var a=e.memoizedProps;if(a!==r){e=t.stateNode,Ra(Ca.current);var o,s=null;switch(n){case"input":a=Z(e,a),r=Z(e,r),s=[];break;case"option":a=ae(e,a),r=ae(e,r),s=[];break;case"select":a=i({},a,{value:void 0}),r=i({},r,{value:void 0}),s=[];break;case"textarea":a=se(e,a),r=se(e,r),s=[];break;default:"function"!=typeof a.onClick&&"function"==typeof r.onClick&&(e.onclick=Vr)}for(f in Ee(n,r),n=null,a)if(!r.hasOwnProperty(f)&&a.hasOwnProperty(f)&&null!=a[f])if("style"===f){var u=a[f];for(o in u)u.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else"dangerouslySetInnerHTML"!==f&&"children"!==f&&"suppressContentEditableWarning"!==f&&"suppressHydrationWarning"!==f&&"autoFocus"!==f&&(l.hasOwnProperty(f)?s||(s=[]):(s=s||[]).push(f,null));for(f in r){var c=r[f];if(u=null!=a?a[f]:void 0,r.hasOwnProperty(f)&&c!==u&&(null!=c||null!=u))if("style"===f)if(u){for(o in u)!u.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in c)c.hasOwnProperty(o)&&u[o]!==c[o]&&(n||(n={}),n[o]=c[o])}else n||(s||(s=[]),s.push(f,n)),n=c;else"dangerouslySetInnerHTML"===f?(c=c?c.__html:void 0,u=u?u.__html:void 0,null!=c&&u!==c&&(s=s||[]).push(f,c)):"children"===f?"string"!=typeof c&&"number"!=typeof c||(s=s||[]).push(f,""+c):"suppressContentEditableWarning"!==f&&"suppressHydrationWarning"!==f&&(l.hasOwnProperty(f)?(null!=c&&"onScroll"===f&&Or("scroll",e),s||u===c||(s=[])):"object"==typeof c&&null!==c&&c.$$typeof===M?c.toString():(s=s||[]).push(f,c))}n&&(s=s||[]).push("style",n);var f=s;(t.updateQueue=f)&&(t.flags|=4)}},Jo=function(e,t,n,r){n!==r&&(t.flags|=4)};var fs="function"==typeof WeakMap?WeakMap:Map;function ds(e,t,n){(n=ua(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Js||(Js=!0,Gs=r),cs(0,t)},n}function ps(e,t,n){(n=ua(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var i=t.value;n.payload=function(){return cs(0,t),r(i)}}var a=e.stateNode;return null!==a&&"function"==typeof a.componentDidCatch&&(n.callback=function(){"function"!=typeof r&&(null===Xs?Xs=new Set([this]):Xs.add(this),cs(0,t));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}var hs="function"==typeof WeakSet?WeakSet:Set;function vs(e){var t=e.ref;if(null!==t)if("function"==typeof t)try{t(null)}catch(t){Fl(e,t)}else t.current=null}function gs(e,t){switch(t.tag){case 0:case 11:case 15:case 22:case 5:case 6:case 4:case 17:return;case 1:if(256&t.flags&&null!==e){var n=e.memoizedProps,r=e.memoizedState;t=(e=t.stateNode).getSnapshotBeforeUpdate(t.elementType===t.type?n:Ji(t.type,n),r),e.__reactInternalSnapshotBeforeUpdate=t}return;case 3:return void(256&t.flags&&$r(t.stateNode.containerInfo))}throw Error(o(163))}function ys(e,t,n){switch(n.tag){case 0:case 11:case 15:case 22:if(null!==(t=null!==(t=n.updateQueue)?t.lastEffect:null)){e=t=t.next;do{if(!(3&~e.tag)){var r=e.create;e.destroy=r()}e=e.next}while(e!==t)}if(null!==(t=null!==(t=n.updateQueue)?t.lastEffect:null)){e=t=t.next;do{var i=e;r=i.next,4&(i=i.tag)&&1&i&&(Ul(n,e),Ll(n,e)),e=r}while(e!==t)}return;case 1:return e=n.stateNode,4&n.flags&&(null===t?e.componentDidMount():(r=n.elementType===n.type?t.memoizedProps:Ji(n.type,t.memoizedProps),e.componentDidUpdate(r,t.memoizedState,e.__reactInternalSnapshotBeforeUpdate))),void(null!==(t=n.updateQueue)&&pa(n,t,e));case 3:if(null!==(t=n.updateQueue)){if(e=null,null!==n.child)switch(n.child.tag){case 5:case 1:e=n.child.stateNode}pa(n,t,e)}return;case 5:return e=n.stateNode,void(null===t&&4&n.flags&&Br(n.type,n.memoizedProps)&&e.focus());case 6:case 4:case 12:case 19:case 17:case 20:case 21:case 23:case 24:return;case 13:return void(null===n.memoizedState&&(n=n.alternate,null!==n&&(n=n.memoizedState,null!==n&&(n=n.dehydrated,null!==n&&wt(n)))))}throw Error(o(163))}function ms(e,t){for(var n=e;;){if(5===n.tag){var r=n.stateNode;if(t)"function"==typeof(r=r.style).setProperty?r.setProperty("display","none","important"):r.display="none";else{r=n.stateNode;var i=n.memoizedProps.style;i=null!=i&&i.hasOwnProperty("display")?i.display:null,r.style.display=Se("display",i)}}else if(6===n.tag)n.stateNode.nodeValue=t?"":n.memoizedProps;else if((23!==n.tag&&24!==n.tag||null===n.memoizedState||n===e)&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===e)break;for(;null===n.sibling;){if(null===n.return||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}}function bs(e,t){if(Ei&&"function"==typeof Ei.onCommitFiberUnmount)try{Ei.onCommitFiberUnmount(ki,t)}catch(e){}switch(t.tag){case 0:case 11:case 14:case 15:case 22:if(null!==(e=t.updateQueue)&&null!==(e=e.lastEffect)){var n=e=e.next;do{var r=n,i=r.destroy;if(r=r.tag,void 0!==i)if(4&r)Ul(t,n);else{r=t;try{i()}catch(e){Fl(r,e)}}n=n.next}while(n!==e)}break;case 1:if(vs(t),"function"==typeof(e=t.stateNode).componentWillUnmount)try{e.props=t.memoizedProps,e.state=t.memoizedState,e.componentWillUnmount()}catch(e){Fl(t,e)}break;case 5:vs(t);break;case 4:_s(e,t)}}function Ss(e){e.alternate=null,e.child=null,e.dependencies=null,e.firstEffect=null,e.lastEffect=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.return=null,e.updateQueue=null}function ws(e){return 5===e.tag||3===e.tag||4===e.tag}function ks(e){e:{for(var t=e.return;null!==t;){if(ws(t))break e;t=t.return}throw Error(o(160))}var n=t;switch(t=n.stateNode,n.tag){case 5:var r=!1;break;case 3:case 4:t=t.containerInfo,r=!0;break;default:throw Error(o(161))}16&n.flags&&(ye(t,""),n.flags&=-17);e:t:for(n=e;;){for(;null===n.sibling;){if(null===n.return||ws(n.return)){n=null;break e}n=n.return}for(n.sibling.return=n.return,n=n.sibling;5!==n.tag&&6!==n.tag&&18!==n.tag;){if(2&n.flags)continue t;if(null===n.child||4===n.tag)continue t;n.child.return=n,n=n.child}if(!(2&n.flags)){n=n.stateNode;break e}}r?Es(e,n,t):xs(e,n,t)}function Es(e,t,n){var r=e.tag,i=5===r||6===r;if(i)e=i?e.stateNode:e.stateNode.instance,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode).insertBefore(e,n):(t=n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=Vr));else if(4!==r&&null!==(e=e.child))for(Es(e,t,n),e=e.sibling;null!==e;)Es(e,t,n),e=e.sibling}function xs(e,t,n){var r=e.tag,i=5===r||6===r;if(i)e=i?e.stateNode:e.stateNode.instance,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&null!==(e=e.child))for(xs(e,t,n),e=e.sibling;null!==e;)xs(e,t,n),e=e.sibling}function _s(e,t){for(var n,r,i=t,a=!1;;){if(!a){a=i.return;e:for(;;){if(null===a)throw Error(o(160));switch(n=a.stateNode,a.tag){case 5:r=!1;break e;case 3:case 4:n=n.containerInfo,r=!0;break e}a=a.return}a=!0}if(5===i.tag||6===i.tag){e:for(var s=e,l=i,u=l;;)if(bs(s,u),null!==u.child&&4!==u.tag)u.child.return=u,u=u.child;else{if(u===l)break e;for(;null===u.sibling;){if(null===u.return||u.return===l)break e;u=u.return}u.sibling.return=u.return,u=u.sibling}r?(s=n,l=i.stateNode,8===s.nodeType?s.parentNode.removeChild(l):s.removeChild(l)):n.removeChild(i.stateNode)}else if(4===i.tag){if(null!==i.child){n=i.stateNode.containerInfo,r=!0,i.child.return=i,i=i.child;continue}}else if(bs(e,i),null!==i.child){i.child.return=i,i=i.child;continue}if(i===t)break;for(;null===i.sibling;){if(null===i.return||i.return===t)return;4===(i=i.return).tag&&(a=!1)}i.sibling.return=i.return,i=i.sibling}}function Is(e,t){switch(t.tag){case 0:case 11:case 14:case 15:case 22:var n=t.updateQueue;if(null!==(n=null!==n?n.lastEffect:null)){var r=n=n.next;do{!(3&~r.tag)&&(e=r.destroy,r.destroy=void 0,void 0!==e&&e()),r=r.next}while(r!==n)}return;case 1:case 12:case 17:return;case 5:if(null!=(n=t.stateNode)){r=t.memoizedProps;var i=null!==e?e.memoizedProps:r;e=t.type;var a=t.updateQueue;if(t.updateQueue=null,null!==a){for(n[Xr]=r,"input"===e&&"radio"===r.type&&null!=r.name&&te(n,r),xe(e,i),t=xe(e,r),i=0;i<a.length;i+=2){var s=a[i],l=a[i+1];"style"===s?we(n,l):"dangerouslySetInnerHTML"===s?ge(n,l):"children"===s?ye(n,l):S(n,s,l,t)}switch(e){case"input":ne(n,r);break;case"textarea":ue(n,r);break;case"select":e=n._wrapperState.wasMultiple,n._wrapperState.wasMultiple=!!r.multiple,null!=(a=r.value)?oe(n,!!r.multiple,a,!1):e!==!!r.multiple&&(null!=r.defaultValue?oe(n,!!r.multiple,r.defaultValue,!0):oe(n,!!r.multiple,r.multiple?[]:"",!1))}}}return;case 6:if(null===t.stateNode)throw Error(o(162));return void(t.stateNode.nodeValue=t.memoizedProps);case 3:return void((n=t.stateNode).hydrate&&(n.hydrate=!1,wt(n.containerInfo)));case 13:return null!==t.memoizedState&&(qs=Bi(),ms(t.child,!0)),void Ts(t);case 19:return void Ts(t);case 23:case 24:return void ms(t,null!==t.memoizedState)}throw Error(o(163))}function Ts(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new hs),t.forEach((function(t){var r=Bl.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}}function Cs(e,t){return null!==e&&(null===(e=e.memoizedState)||null!==e.dehydrated)&&(null!==(t=t.memoizedState)&&null===t.dehydrated)}var Os=Math.ceil,Ns=w.ReactCurrentDispatcher,Rs=w.ReactCurrentOwner,Ds=0,Ps=null,As=null,Ms=0,Ls=0,Us=li(0),js=0,Vs=null,Fs=0,zs=0,Bs=0,Hs=0,Ws=null,qs=0,$s=1/0;function Ks(){$s=Bi()+500}var Ys,Qs=null,Js=!1,Gs=null,Xs=null,Zs=!1,el=null,tl=90,nl=[],rl=[],il=null,al=0,ol=null,sl=-1,ll=0,ul=0,cl=null,fl=!1;function dl(){return 48&Ds?Bi():-1!==sl?sl:sl=Bi()}function pl(e){if(!(2&(e=e.mode)))return 1;if(!(4&e))return 99===Hi()?1:2;if(0===ll&&(ll=Fs),0!==Qi.transition){0!==ul&&(ul=null!==Ws?Ws.pendingLanes:0),e=ll;var t=4186112&~ul;return 0===(t&=-t)&&(0===(t=(e=4186112&~e)&-e)&&(t=8192)),t}return e=Hi(),4&Ds&&98===e?e=Vt(12,ll):e=Vt(e=function(e){switch(e){case 99:return 15;case 98:return 10;case 97:case 96:return 8;case 95:return 2;default:return 0}}(e),ll),e}function hl(e,t,n){if(50<al)throw al=0,ol=null,Error(o(185));if(null===(e=vl(e,t)))return null;Bt(e,t,n),e===Ps&&(Bs|=t,4===js&&ml(e,Ms));var r=Hi();1===t?8&Ds&&!(48&Ds)?bl(e):(gl(e,n),0===Ds&&(Ks(),Ki())):(!(4&Ds)||98!==r&&99!==r||(null===il?il=new Set([e]):il.add(e)),gl(e,n)),Ws=e}function vl(e,t){e.lanes|=t;var n=e.alternate;for(null!==n&&(n.lanes|=t),n=e,e=e.return;null!==e;)e.childLanes|=t,null!==(n=e.alternate)&&(n.childLanes|=t),n=e,e=e.return;return 3===n.tag?n.stateNode:null}function gl(e,t){for(var n=e.callbackNode,r=e.suspendedLanes,i=e.pingedLanes,a=e.expirationTimes,s=e.pendingLanes;0<s;){var l=31-Ht(s),u=1<<l,c=a[l];if(-1===c){if(!(u&r)||u&i){c=t,Lt(u);var f=Mt;a[l]=10<=f?c+250:6<=f?c+5e3:-1}}else c<=t&&(e.expiredLanes|=u);s&=~u}if(r=Ut(e,e===Ps?Ms:0),t=Mt,0===r)null!==n&&(n!==Li&&Ii(n),e.callbackNode=null,e.callbackPriority=0);else{if(null!==n){if(e.callbackPriority===t)return;n!==Li&&Ii(n)}15===t?(n=bl.bind(null,e),null===ji?(ji=[n],Vi=_i(Ri,Yi)):ji.push(n),n=Li):14===t?n=$i(99,bl.bind(null,e)):(n=function(e){switch(e){case 15:case 14:return 99;case 13:case 12:case 11:case 10:return 98;case 9:case 8:case 7:case 6:case 4:case 5:return 97;case 3:case 2:case 1:return 95;case 0:return 90;default:throw Error(o(358,e))}}(t),n=$i(n,yl.bind(null,e))),e.callbackPriority=t,e.callbackNode=n}}function yl(e){if(sl=-1,ul=ll=0,48&Ds)throw Error(o(327));var t=e.callbackNode;if(Ml()&&e.callbackNode!==t)return null;var n=Ut(e,e===Ps?Ms:0);if(0===n)return null;var r=n,i=Ds;Ds|=16;var a=Il();for(Ps===e&&Ms===r||(Ks(),xl(e,r));;)try{Ol();break}catch(t){_l(e,t)}if(ta(),Ns.current=a,Ds=i,null!==As?r=0:(Ps=null,Ms=0,r=js),Fs&Bs)xl(e,0);else if(0!==r){if(2===r&&(Ds|=64,e.hydrate&&(e.hydrate=!1,$r(e.containerInfo)),0!==(n=jt(e))&&(r=Tl(e,n))),1===r)throw t=Vs,xl(e,0),ml(e,n),gl(e,Bi()),t;switch(e.finishedWork=e.current.alternate,e.finishedLanes=n,r){case 0:case 1:throw Error(o(345));case 2:case 5:Dl(e);break;case 3:if(ml(e,n),(62914560&n)===n&&10<(r=qs+500-Bi())){if(0!==Ut(e,0))break;if(((i=e.suspendedLanes)&n)!==n){dl(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Wr(Dl.bind(null,e),r);break}Dl(e);break;case 4:if(ml(e,n),(4186112&n)===n)break;for(r=e.eventTimes,i=-1;0<n;){var s=31-Ht(n);a=1<<s,(s=r[s])>i&&(i=s),n&=~a}if(n=i,10<(n=(120>(n=Bi()-n)?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Os(n/1960))-n)){e.timeoutHandle=Wr(Dl.bind(null,e),n);break}Dl(e);break;default:throw Error(o(329))}}return gl(e,Bi()),e.callbackNode===t?yl.bind(null,e):null}function ml(e,t){for(t&=~Hs,t&=~Bs,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Ht(t),r=1<<n;e[n]=-1,t&=~r}}function bl(e){if(48&Ds)throw Error(o(327));if(Ml(),e===Ps&&e.expiredLanes&Ms){var t=Ms,n=Tl(e,t);Fs&Bs&&(n=Tl(e,t=Ut(e,t)))}else n=Tl(e,t=Ut(e,0));if(0!==e.tag&&2===n&&(Ds|=64,e.hydrate&&(e.hydrate=!1,$r(e.containerInfo)),0!==(t=jt(e))&&(n=Tl(e,t))),1===n)throw n=Vs,xl(e,0),ml(e,t),gl(e,Bi()),n;return e.finishedWork=e.current.alternate,e.finishedLanes=t,Dl(e),gl(e,Bi()),null}function Sl(e,t){var n=Ds;Ds|=1;try{return e(t)}finally{0===(Ds=n)&&(Ks(),Ki())}}function wl(e,t){var n=Ds;Ds&=-2,Ds|=8;try{return e(t)}finally{0===(Ds=n)&&(Ks(),Ki())}}function kl(e,t){ci(Us,Ls),Ls|=t,Fs|=t}function El(){Ls=Us.current,ui(Us)}function xl(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,qr(n)),null!==As)for(n=As.return;null!==n;){var r=n;switch(r.tag){case 1:null!=(r=r.type.childContextTypes)&&yi();break;case 3:Pa(),ui(pi),ui(di),Ya();break;case 5:Ma(r);break;case 4:Pa();break;case 13:case 19:ui(La);break;case 10:na(r);break;case 23:case 24:El()}n=n.return}Ps=e,As=$l(e.current,null),Ms=Ls=Fs=t,js=0,Vs=null,Hs=Bs=zs=0}function _l(e,t){for(;;){var n=As;try{if(ta(),Qa.current=Ro,to){for(var r=Xa.memoizedState;null!==r;){var i=r.queue;null!==i&&(i.pending=null),r=r.next}to=!1}if(Ga=0,eo=Za=Xa=null,no=!1,Rs.current=null,null===n||null===n.return){js=1,Vs=t,As=null;break}e:{var a=e,o=n.return,s=n,l=t;if(t=Ms,s.flags|=2048,s.firstEffect=s.lastEffect=null,null!==l&&"object"==typeof l&&"function"==typeof l.then){var u=l;if(!(2&s.mode)){var c=s.alternate;c?(s.updateQueue=c.updateQueue,s.memoizedState=c.memoizedState,s.lanes=c.lanes):(s.updateQueue=null,s.memoizedState=null)}var f=!!(1&La.current),d=o;do{var p;if(p=13===d.tag){var h=d.memoizedState;if(null!==h)p=null!==h.dehydrated;else{var v=d.memoizedProps;p=void 0!==v.fallback&&(!0!==v.unstable_avoidThisFallback||!f)}}if(p){var g=d.updateQueue;if(null===g){var y=new Set;y.add(u),d.updateQueue=y}else g.add(u);if(!(2&d.mode)){if(d.flags|=64,s.flags|=16384,s.flags&=-2981,1===s.tag)if(null===s.alternate)s.tag=17;else{var m=ua(-1,1);m.tag=2,ca(s,m)}s.lanes|=1;break e}l=void 0,s=t;var b=a.pingCache;if(null===b?(b=a.pingCache=new fs,l=new Set,b.set(u,l)):void 0===(l=b.get(u))&&(l=new Set,b.set(u,l)),!l.has(s)){l.add(s);var S=zl.bind(null,a,u,s);u.then(S,S)}d.flags|=4096,d.lanes=t;break e}d=d.return}while(null!==d);l=Error((K(s.type)||"A React component")+" suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.")}5!==js&&(js=2),l=us(l,s),d=o;do{switch(d.tag){case 3:a=l,d.flags|=4096,t&=-t,d.lanes|=t,fa(d,ds(0,a,t));break e;case 1:a=l;var w=d.type,k=d.stateNode;if(!(64&d.flags||"function"!=typeof w.getDerivedStateFromError&&(null===k||"function"!=typeof k.componentDidCatch||null!==Xs&&Xs.has(k)))){d.flags|=4096,t&=-t,d.lanes|=t,fa(d,ps(d,a,t));break e}}d=d.return}while(null!==d)}Rl(n)}catch(e){t=e,As===n&&null!==n&&(As=n=n.return);continue}break}}function Il(){var e=Ns.current;return Ns.current=Ro,null===e?Ro:e}function Tl(e,t){var n=Ds;Ds|=16;var r=Il();for(Ps===e&&Ms===t||xl(e,t);;)try{Cl();break}catch(t){_l(e,t)}if(ta(),Ds=n,Ns.current=r,null!==As)throw Error(o(261));return Ps=null,Ms=0,js}function Cl(){for(;null!==As;)Nl(As)}function Ol(){for(;null!==As&&!Ti();)Nl(As)}function Nl(e){var t=Ys(e.alternate,e,Ls);e.memoizedProps=e.pendingProps,null===t?Rl(e):As=t,Rs.current=null}function Rl(e){var t=e;do{var n=t.alternate;if(e=t.return,2048&t.flags){if(null!==(n=ls(t)))return n.flags&=2047,void(As=n);null!==e&&(e.firstEffect=e.lastEffect=null,e.flags|=2048)}else{if(null!==(n=ss(n,t,Ls)))return void(As=n);if(24!==(n=t).tag&&23!==n.tag||null===n.memoizedState||1073741824&Ls||!(4&n.mode)){for(var r=0,i=n.child;null!==i;)r|=i.lanes|i.childLanes,i=i.sibling;n.childLanes=r}null!==e&&!(2048&e.flags)&&(null===e.firstEffect&&(e.firstEffect=t.firstEffect),null!==t.lastEffect&&(null!==e.lastEffect&&(e.lastEffect.nextEffect=t.firstEffect),e.lastEffect=t.lastEffect),1<t.flags&&(null!==e.lastEffect?e.lastEffect.nextEffect=t:e.firstEffect=t,e.lastEffect=t))}if(null!==(t=t.sibling))return void(As=t);As=t=e}while(null!==t);0===js&&(js=5)}function Dl(e){var t=Hi();return qi(99,Pl.bind(null,e,t)),null}function Pl(e,t){do{Ml()}while(null!==el);if(48&Ds)throw Error(o(327));var n=e.finishedWork;if(null===n)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(o(177));e.callbackNode=null;var r=n.lanes|n.childLanes,i=r,a=e.pendingLanes&~i;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=i,e.mutableReadLanes&=i,e.entangledLanes&=i,i=e.entanglements;for(var s=e.eventTimes,l=e.expirationTimes;0<a;){var u=31-Ht(a),c=1<<u;i[u]=0,s[u]=-1,l[u]=-1,a&=~c}if(null!==il&&!(24&r)&&il.has(e)&&il.delete(e),e===Ps&&(As=Ps=null,Ms=0),1<n.flags?null!==n.lastEffect?(n.lastEffect.nextEffect=n,r=n.firstEffect):r=n:r=n.firstEffect,null!==r){if(i=Ds,Ds|=32,Rs.current=null,Fr=Yt,gr(s=vr())){if("selectionStart"in s)l={start:s.selectionStart,end:s.selectionEnd};else e:if(l=(l=s.ownerDocument)&&l.defaultView||window,(c=l.getSelection&&l.getSelection())&&0!==c.rangeCount){l=c.anchorNode,a=c.anchorOffset,u=c.focusNode,c=c.focusOffset;try{l.nodeType,u.nodeType}catch(e){l=null;break e}var f=0,d=-1,p=-1,h=0,v=0,g=s,y=null;t:for(;;){for(var m;g!==l||0!==a&&3!==g.nodeType||(d=f+a),g!==u||0!==c&&3!==g.nodeType||(p=f+c),3===g.nodeType&&(f+=g.nodeValue.length),null!==(m=g.firstChild);)y=g,g=m;for(;;){if(g===s)break t;if(y===l&&++h===a&&(d=f),y===u&&++v===c&&(p=f),null!==(m=g.nextSibling))break;y=(g=y).parentNode}g=m}l=-1===d||-1===p?null:{start:d,end:p}}else l=null;l=l||{start:0,end:0}}else l=null;zr={focusedElem:s,selectionRange:l},Yt=!1,cl=null,fl=!1,Qs=r;do{try{Al()}catch(e){if(null===Qs)throw Error(o(330));Fl(Qs,e),Qs=Qs.nextEffect}}while(null!==Qs);cl=null,Qs=r;do{try{for(s=e;null!==Qs;){var b=Qs.flags;if(16&b&&ye(Qs.stateNode,""),128&b){var S=Qs.alternate;if(null!==S){var w=S.ref;null!==w&&("function"==typeof w?w(null):w.current=null)}}switch(1038&b){case 2:ks(Qs),Qs.flags&=-3;break;case 6:ks(Qs),Qs.flags&=-3,Is(Qs.alternate,Qs);break;case 1024:Qs.flags&=-1025;break;case 1028:Qs.flags&=-1025,Is(Qs.alternate,Qs);break;case 4:Is(Qs.alternate,Qs);break;case 8:_s(s,l=Qs);var k=l.alternate;Ss(l),null!==k&&Ss(k)}Qs=Qs.nextEffect}}catch(e){if(null===Qs)throw Error(o(330));Fl(Qs,e),Qs=Qs.nextEffect}}while(null!==Qs);if(w=zr,S=vr(),b=w.focusedElem,s=w.selectionRange,S!==b&&b&&b.ownerDocument&&hr(b.ownerDocument.documentElement,b)){null!==s&&gr(b)&&(S=s.start,void 0===(w=s.end)&&(w=S),"selectionStart"in b?(b.selectionStart=S,b.selectionEnd=Math.min(w,b.value.length)):(w=(S=b.ownerDocument||document)&&S.defaultView||window).getSelection&&(w=w.getSelection(),l=b.textContent.length,k=Math.min(s.start,l),s=void 0===s.end?k:Math.min(s.end,l),!w.extend&&k>s&&(l=s,s=k,k=l),l=pr(b,k),a=pr(b,s),l&&a&&(1!==w.rangeCount||w.anchorNode!==l.node||w.anchorOffset!==l.offset||w.focusNode!==a.node||w.focusOffset!==a.offset)&&((S=S.createRange()).setStart(l.node,l.offset),w.removeAllRanges(),k>s?(w.addRange(S),w.extend(a.node,a.offset)):(S.setEnd(a.node,a.offset),w.addRange(S))))),S=[];for(w=b;w=w.parentNode;)1===w.nodeType&&S.push({element:w,left:w.scrollLeft,top:w.scrollTop});for("function"==typeof b.focus&&b.focus(),b=0;b<S.length;b++)(w=S[b]).element.scrollLeft=w.left,w.element.scrollTop=w.top}Yt=!!Fr,zr=Fr=null,e.current=n,Qs=r;do{try{for(b=e;null!==Qs;){var E=Qs.flags;if(36&E&&ys(b,Qs.alternate,Qs),128&E){S=void 0;var x=Qs.ref;if(null!==x){var _=Qs.stateNode;Qs.tag,S=_,"function"==typeof x?x(S):x.current=S}}Qs=Qs.nextEffect}}catch(e){if(null===Qs)throw Error(o(330));Fl(Qs,e),Qs=Qs.nextEffect}}while(null!==Qs);Qs=null,Ui(),Ds=i}else e.current=n;if(Zs)Zs=!1,el=e,tl=t;else for(Qs=r;null!==Qs;)t=Qs.nextEffect,Qs.nextEffect=null,8&Qs.flags&&((E=Qs).sibling=null,E.stateNode=null),Qs=t;if(0===(r=e.pendingLanes)&&(Xs=null),1===r?e===ol?al++:(al=0,ol=e):al=0,n=n.stateNode,Ei&&"function"==typeof Ei.onCommitFiberRoot)try{Ei.onCommitFiberRoot(ki,n,void 0,!(64&~n.current.flags))}catch(e){}if(gl(e,Bi()),Js)throw Js=!1,e=Gs,Gs=null,e;return 8&Ds||Ki(),null}function Al(){for(;null!==Qs;){var e=Qs.alternate;fl||null===cl||(8&Qs.flags?Ze(Qs,cl)&&(fl=!0):13===Qs.tag&&Cs(e,Qs)&&Ze(Qs,cl)&&(fl=!0));var t=Qs.flags;256&t&&gs(e,Qs),!(512&t)||Zs||(Zs=!0,$i(97,(function(){return Ml(),null}))),Qs=Qs.nextEffect}}function Ml(){if(90!==tl){var e=97<tl?97:tl;return tl=90,qi(e,jl)}return!1}function Ll(e,t){nl.push(t,e),Zs||(Zs=!0,$i(97,(function(){return Ml(),null})))}function Ul(e,t){rl.push(t,e),Zs||(Zs=!0,$i(97,(function(){return Ml(),null})))}function jl(){if(null===el)return!1;var e=el;if(el=null,48&Ds)throw Error(o(331));var t=Ds;Ds|=32;var n=rl;rl=[];for(var r=0;r<n.length;r+=2){var i=n[r],a=n[r+1],s=i.destroy;if(i.destroy=void 0,"function"==typeof s)try{s()}catch(e){if(null===a)throw Error(o(330));Fl(a,e)}}for(n=nl,nl=[],r=0;r<n.length;r+=2){i=n[r],a=n[r+1];try{var l=i.create;i.destroy=l()}catch(e){if(null===a)throw Error(o(330));Fl(a,e)}}for(l=e.current.firstEffect;null!==l;)e=l.nextEffect,l.nextEffect=null,8&l.flags&&(l.sibling=null,l.stateNode=null),l=e;return Ds=t,Ki(),!0}function Vl(e,t,n){ca(e,t=ds(0,t=us(n,t),1)),t=dl(),null!==(e=vl(e,1))&&(Bt(e,1,t),gl(e,t))}function Fl(e,t){if(3===e.tag)Vl(e,e,t);else for(var n=e.return;null!==n;){if(3===n.tag){Vl(n,e,t);break}if(1===n.tag){var r=n.stateNode;if("function"==typeof n.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===Xs||!Xs.has(r))){var i=ps(n,e=us(t,e),1);if(ca(n,i),i=dl(),null!==(n=vl(n,1)))Bt(n,1,i),gl(n,i);else if("function"==typeof r.componentDidCatch&&(null===Xs||!Xs.has(r)))try{r.componentDidCatch(t,e)}catch(e){}break}}n=n.return}}function zl(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),t=dl(),e.pingedLanes|=e.suspendedLanes&n,Ps===e&&(Ms&n)===n&&(4===js||3===js&&(62914560&Ms)===Ms&&500>Bi()-qs?xl(e,0):Hs|=n),gl(e,t)}function Bl(e,t){var n=e.stateNode;null!==n&&n.delete(t),0===(t=0)&&(2&(t=e.mode)?4&t?(0===ll&&(ll=Fs),0===(t=Ft(62914560&~ll))&&(t=4194304)):t=99===Hi()?1:2:t=1),n=dl(),null!==(e=vl(e,t))&&(Bt(e,t,n),gl(e,n))}function Hl(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.flags=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childLanes=this.lanes=0,this.alternate=null}function Wl(e,t,n,r){return new Hl(e,t,n,r)}function ql(e){return!(!(e=e.prototype)||!e.isReactComponent)}function $l(e,t){var n=e.alternate;return null===n?((n=Wl(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.nextEffect=null,n.firstEffect=null,n.lastEffect=null),n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Kl(e,t,n,r,i,a){var s=2;if(r=e,"function"==typeof e)ql(e)&&(s=1);else if("string"==typeof e)s=5;else e:switch(e){case x:return Yl(n.children,i,a,t);case L:s=8,i|=16;break;case _:s=8,i|=1;break;case I:return(e=Wl(12,n,t,8|i)).elementType=I,e.type=I,e.lanes=a,e;case N:return(e=Wl(13,n,t,i)).type=N,e.elementType=N,e.lanes=a,e;case R:return(e=Wl(19,n,t,i)).elementType=R,e.lanes=a,e;case U:return Ql(n,i,a,t);case j:return(e=Wl(24,n,t,i)).elementType=j,e.lanes=a,e;default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case T:s=10;break e;case C:s=9;break e;case O:s=11;break e;case D:s=14;break e;case P:s=16,r=null;break e;case A:s=22;break e}throw Error(o(130,null==e?e:typeof e,""))}return(t=Wl(s,n,t,i)).elementType=e,t.type=r,t.lanes=a,t}function Yl(e,t,n,r){return(e=Wl(7,e,r,t)).lanes=n,e}function Ql(e,t,n,r){return(e=Wl(23,e,r,t)).elementType=U,e.lanes=n,e}function Jl(e,t,n){return(e=Wl(6,e,null,t)).lanes=n,e}function Gl(e,t,n){return(t=Wl(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Xl(e,t,n){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.pendingContext=this.context=null,this.hydrate=n,this.callbackNode=null,this.callbackPriority=0,this.eventTimes=zt(0),this.expirationTimes=zt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zt(0),this.mutableSourceEagerHydrationData=null}function Zl(e,t,n,r){var i=t.current,a=dl(),s=pl(i);e:if(n){t:{if(Qe(n=n._reactInternals)!==n||1!==n.tag)throw Error(o(170));var l=n;do{switch(l.tag){case 3:l=l.stateNode.context;break t;case 1:if(gi(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break t}}l=l.return}while(null!==l);throw Error(o(171))}if(1===n.tag){var u=n.type;if(gi(u)){n=bi(n,u,l);break e}}n=l}else n=fi;return null===t.context?t.context=n:t.pendingContext=n,(t=ua(a,s)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),ca(i,t),hl(i,s,a),s}function eu(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function tu(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function nu(e,t){tu(e,t),(e=e.alternate)&&tu(e,t)}function ru(e,t,n){var r=null!=n&&null!=n.hydrationOptions&&n.hydrationOptions.mutableSources||null;if(n=new Xl(e,t,null!=n&&!0===n.hydrate),t=Wl(3,null,null,2===t?7:1===t?3:0),n.current=t,t.stateNode=n,sa(t),e[Zr]=n.current,Rr(8===e.nodeType?e.parentNode:e),r)for(e=0;e<r.length;e++){var i=(t=r[e])._getVersion;i=i(t._source),null==n.mutableSourceEagerHydrationData?n.mutableSourceEagerHydrationData=[t,i]:n.mutableSourceEagerHydrationData.push(t,i)}this._internalRoot=n}function iu(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function au(e,t,n,r,i){var a=n._reactRootContainer;if(a){var o=a._internalRoot;if("function"==typeof i){var s=i;i=function(){var e=eu(o);s.call(e)}}Zl(t,o,e,i)}else{if(a=n._reactRootContainer=function(e,t){if(t||(t=!(!(t=e?9===e.nodeType?e.documentElement:e.firstChild:null)||1!==t.nodeType||!t.hasAttribute("data-reactroot"))),!t)for(var n;n=e.lastChild;)e.removeChild(n);return new ru(e,0,t?{hydrate:!0}:void 0)}(n,r),o=a._internalRoot,"function"==typeof i){var l=i;i=function(){var e=eu(o);l.call(e)}}wl((function(){Zl(t,o,e,i)}))}return eu(o)}function ou(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!iu(t))throw Error(o(200));return function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:E,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,t,null,n)}Ys=function(e,t,n){var r=t.lanes;if(null!==e)if(e.memoizedProps!==t.pendingProps||pi.current)Lo=!0;else{if(!(n&r)){switch(Lo=!1,t.tag){case 3:$o(t),$a();break;case 5:Aa(t);break;case 1:gi(t.type)&&Si(t);break;case 4:Da(t,t.stateNode.containerInfo);break;case 10:r=t.memoizedProps.value;var i=t.type._context;ci(Gi,i._currentValue),i._currentValue=r;break;case 13:if(null!==t.memoizedState)return n&t.child.childLanes?Xo(e,t,n):(ci(La,1&La.current),null!==(t=as(e,t,n))?t.sibling:null);ci(La,1&La.current);break;case 19:if(r=!!(n&t.childLanes),64&e.flags){if(r)return is(e,t,n);t.flags|=64}if(null!==(i=t.memoizedState)&&(i.rendering=null,i.tail=null,i.lastEffect=null),ci(La,La.current),r)break;return null;case 23:case 24:return t.lanes=0,zo(e,t,n)}return as(e,t,n)}Lo=!!(16384&e.flags)}else Lo=!1;switch(t.lanes=0,t.tag){case 2:if(r=t.type,null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,i=vi(t,di.current),ia(t,n),i=ao(null,t,r,e,i,n),t.flags|=1,"object"==typeof i&&null!==i&&"function"==typeof i.render&&void 0===i.$$typeof){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,gi(r)){var a=!0;Si(t)}else a=!1;t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,sa(t);var s=r.getDerivedStateFromProps;"function"==typeof s&&va(t,r,s,e),i.updater=ga,t.stateNode=i,i._reactInternals=t,Sa(t,r,e,n),t=qo(null,t,r,!0,a,n)}else t.tag=0,Uo(null,t,i,n),t=t.child;return t;case 16:i=t.elementType;e:{switch(null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,i=(a=i._init)(i._payload),t.type=i,a=t.tag=function(e){if("function"==typeof e)return ql(e)?1:0;if(null!=e){if((e=e.$$typeof)===O)return 11;if(e===D)return 14}return 2}(i),e=Ji(i,e),a){case 0:t=Ho(null,t,i,e,n);break e;case 1:t=Wo(null,t,i,e,n);break e;case 11:t=jo(null,t,i,e,n);break e;case 14:t=Vo(null,t,i,Ji(i.type,e),r,n);break e}throw Error(o(306,i,""))}return t;case 0:return r=t.type,i=t.pendingProps,Ho(e,t,r,i=t.elementType===r?i:Ji(r,i),n);case 1:return r=t.type,i=t.pendingProps,Wo(e,t,r,i=t.elementType===r?i:Ji(r,i),n);case 3:if($o(t),r=t.updateQueue,null===e||null===r)throw Error(o(282));if(r=t.pendingProps,i=null!==(i=t.memoizedState)?i.element:null,la(e,t),da(t,r,null,n),(r=t.memoizedState.element)===i)$a(),t=as(e,t,n);else{if((a=(i=t.stateNode).hydrate)&&(Va=Kr(t.stateNode.containerInfo.firstChild),ja=t,a=Fa=!0),a){if(null!=(e=i.mutableSourceEagerHydrationData))for(i=0;i<e.length;i+=2)(a=e[i])._workInProgressVersionPrimary=e[i+1],Ka.push(a);for(n=Ia(t,null,r,n),t.child=n;n;)n.flags=-3&n.flags|1024,n=n.sibling}else Uo(e,t,r,n),$a();t=t.child}return t;case 5:return Aa(t),null===e&&Ha(t),r=t.type,i=t.pendingProps,a=null!==e?e.memoizedProps:null,s=i.children,Hr(r,i)?s=null:null!==a&&Hr(r,a)&&(t.flags|=16),Bo(e,t),Uo(e,t,s,n),t.child;case 6:return null===e&&Ha(t),null;case 13:return Xo(e,t,n);case 4:return Da(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=_a(t,null,r,n):Uo(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,jo(e,t,r,i=t.elementType===r?i:Ji(r,i),n);case 7:return Uo(e,t,t.pendingProps,n),t.child;case 8:case 12:return Uo(e,t,t.pendingProps.children,n),t.child;case 10:e:{r=t.type._context,i=t.pendingProps,s=t.memoizedProps,a=i.value;var l=t.type._context;if(ci(Gi,l._currentValue),l._currentValue=a,null!==s)if(l=s.value,0===(a=ur(l,a)?0:0|("function"==typeof r._calculateChangedBits?r._calculateChangedBits(l,a):1073741823))){if(s.children===i.children&&!pi.current){t=as(e,t,n);break e}}else for(null!==(l=t.child)&&(l.return=t);null!==l;){var u=l.dependencies;if(null!==u){s=l.child;for(var c=u.firstContext;null!==c;){if(c.context===r&&c.observedBits&a){1===l.tag&&((c=ua(-1,n&-n)).tag=2,ca(l,c)),l.lanes|=n,null!==(c=l.alternate)&&(c.lanes|=n),ra(l.return,n),u.lanes|=n;break}c=c.next}}else s=10===l.tag&&l.type===t.type?null:l.child;if(null!==s)s.return=l;else for(s=l;null!==s;){if(s===t){s=null;break}if(null!==(l=s.sibling)){l.return=s.return,s=l;break}s=s.return}l=s}Uo(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=(a=t.pendingProps).children,ia(t,n),r=r(i=aa(i,a.unstable_observedBits)),t.flags|=1,Uo(e,t,r,n),t.child;case 14:return a=Ji(i=t.type,t.pendingProps),Vo(e,t,i,a=Ji(i.type,a),r,n);case 15:return Fo(e,t,t.type,t.pendingProps,r,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ji(r,i),null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),t.tag=1,gi(r)?(e=!0,Si(t)):e=!1,ia(t,n),ma(t,r,i),Sa(t,r,i,n),qo(null,t,r,!0,e,n);case 19:return is(e,t,n);case 23:case 24:return zo(e,t,n)}throw Error(o(156,t.tag))},ru.prototype.render=function(e){Zl(e,this._internalRoot,null,null)},ru.prototype.unmount=function(){var e=this._internalRoot,t=e.containerInfo;Zl(null,e,null,(function(){t[Zr]=null}))},et=function(e){13===e.tag&&(hl(e,4,dl()),nu(e,4))},tt=function(e){13===e.tag&&(hl(e,67108864,dl()),nu(e,67108864))},nt=function(e){if(13===e.tag){var t=dl(),n=pl(e);hl(e,n,t),nu(e,n)}},rt=function(e,t){return t()},Ie=function(e,t,n){switch(t){case"input":if(ne(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=ii(r);if(!i)throw Error(o(90));G(r),ne(r,i)}}}break;case"textarea":ue(e,n);break;case"select":null!=(t=n.value)&&oe(e,!!n.multiple,t,!1)}},De=Sl,Pe=function(e,t,n,r,i){var a=Ds;Ds|=4;try{return qi(98,e.bind(null,t,n,r,i))}finally{0===(Ds=a)&&(Ks(),Ki())}},Ae=function(){!(49&Ds)&&(function(){if(null!==il){var e=il;il=null,e.forEach((function(e){e.expiredLanes|=24&e.pendingLanes,gl(e,Bi())}))}Ki()}(),Ml())},Me=function(e,t){var n=Ds;Ds|=2;try{return e(t)}finally{0===(Ds=n)&&(Ks(),Ki())}};var su={Events:[ni,ri,ii,Ne,Re,Ml,{current:!1}]},lu={findFiberByHostInstance:ti,bundleType:0,version:"17.0.2",rendererPackageName:"react-dom"},uu={bundleType:lu.bundleType,version:lu.version,rendererPackageName:lu.rendererPackageName,rendererConfig:lu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:w.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=Xe(e))?null:e.stateNode},findFiberByHostInstance:lu.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var cu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!cu.isDisabled&&cu.supportsFiber)try{ki=cu.inject(uu),Ei=cu}catch(ve){}}t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=su,t.createPortal=ou,t.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(o(188));throw Error(o(268,Object.keys(e)))}return e=null===(e=Xe(t))?null:e.stateNode},t.flushSync=function(e,t){var n=Ds;if(48&n)return e(t);Ds|=1;try{if(e)return qi(99,e.bind(null,t))}finally{Ds=n,Ki()}},t.hydrate=function(e,t,n){if(!iu(t))throw Error(o(200));return au(null,e,t,!0,n)},t.render=function(e,t,n){if(!iu(t))throw Error(o(200));return au(null,e,t,!1,n)},t.unmountComponentAtNode=function(e){if(!iu(e))throw Error(o(40));return!!e._reactRootContainer&&(wl((function(){au(null,null,e,!1,(function(){e._reactRootContainer=null,e[Zr]=null}))})),!0)},t.unstable_batchedUpdates=Sl,t.unstable_createPortal=function(e,t){return ou(e,t,2<arguments.length&&void 0!==arguments[2]?arguments[2]:null)},t.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!iu(n))throw Error(o(200));if(null==e||void 0===e._reactInternals)throw Error(o(38));return au(e,t,n,!1,r)},t.version="17.0.2"},887:(e,t,n)=>{"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),e.exports=n(641)},377:(e,t,n)=>{"use strict";var r=n(854),i=60103,a=60106;t.Fragment=60107,t.StrictMode=60108,t.Profiler=60114;var o=60109,s=60110,l=60112;t.Suspense=60113;var u=60115,c=60116;if("function"==typeof Symbol&&Symbol.for){var f=Symbol.for;i=f("react.element"),a=f("react.portal"),t.Fragment=f("react.fragment"),t.StrictMode=f("react.strict_mode"),t.Profiler=f("react.profiler"),o=f("react.provider"),s=f("react.context"),l=f("react.forward_ref"),t.Suspense=f("react.suspense"),u=f("react.memo"),c=f("react.lazy")}var d="function"==typeof Symbol&&Symbol.iterator;function p(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v={};function g(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||h}function y(){}function m(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||h}g.prototype.isReactComponent={},g.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error(p(85));this.updater.enqueueSetState(this,e,t,"setState")},g.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},y.prototype=g.prototype;var b=m.prototype=new y;b.constructor=m,r(b,g.prototype),b.isPureReactComponent=!0;var S={current:null},w=Object.prototype.hasOwnProperty,k={key:!0,ref:!0,__self:!0,__source:!0};function E(e,t,n){var r,a={},o=null,s=null;if(null!=t)for(r in void 0!==t.ref&&(s=t.ref),void 0!==t.key&&(o=""+t.key),t)w.call(t,r)&&!k.hasOwnProperty(r)&&(a[r]=t[r]);var l=arguments.length-2;if(1===l)a.children=n;else if(1<l){for(var u=Array(l),c=0;c<l;c++)u[c]=arguments[c+2];a.children=u}if(e&&e.defaultProps)for(r in l=e.defaultProps)void 0===a[r]&&(a[r]=l[r]);return{$$typeof:i,type:e,key:o,ref:s,props:a,_owner:S.current}}function x(e){return"object"==typeof e&&null!==e&&e.$$typeof===i}var _=/\/+/g;function I(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function T(e,t,n,r,o){var s=typeof e;"undefined"!==s&&"boolean"!==s||(e=null);var l=!1;if(null===e)l=!0;else switch(s){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case i:case a:l=!0}}if(l)return o=o(l=e),e=""===r?"."+I(l,0):r,Array.isArray(o)?(n="",null!=e&&(n=e.replace(_,"$&/")+"/"),T(o,t,n,"",(function(e){return e}))):null!=o&&(x(o)&&(o=function(e,t){return{$$typeof:i,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(o,n+(!o.key||l&&l.key===o.key?"":(""+o.key).replace(_,"$&/")+"/")+e)),t.push(o)),1;if(l=0,r=""===r?".":r+":",Array.isArray(e))for(var u=0;u<e.length;u++){var c=r+I(s=e[u],u);l+=T(s,t,n,c,o)}else if(c=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=d&&e[d]||e["@@iterator"])?e:null}(e),"function"==typeof c)for(e=c.call(e),u=0;!(s=e.next()).done;)l+=T(s=s.value,t,n,c=r+I(s,u++),o);else if("object"===s)throw t=""+e,Error(p(31,"[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t));return l}function C(e,t,n){if(null==e)return e;var r=[],i=0;return T(e,r,"","",(function(e){return t.call(n,e,i++)})),r}function O(e){if(-1===e._status){var t=e._result;t=t(),e._status=0,e._result=t,t.then((function(t){0===e._status&&(t=t.default,e._status=1,e._result=t)}),(function(t){0===e._status&&(e._status=2,e._result=t)}))}if(1===e._status)return e._result;throw e._result}var N={current:null};function R(){var e=N.current;if(null===e)throw Error(p(321));return e}var D={ReactCurrentDispatcher:N,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:S,IsSomeRendererActing:{current:!1},assign:r};t.Children={map:C,forEach:function(e,t,n){C(e,(function(){t.apply(this,arguments)}),n)},count:function(e){var t=0;return C(e,(function(){t++})),t},toArray:function(e){return C(e,(function(e){return e}))||[]},only:function(e){if(!x(e))throw Error(p(143));return e}},t.Component=g,t.PureComponent=m,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=D,t.cloneElement=function(e,t,n){if(null==e)throw Error(p(267,e));var a=r({},e.props),o=e.key,s=e.ref,l=e._owner;if(null!=t){if(void 0!==t.ref&&(s=t.ref,l=S.current),void 0!==t.key&&(o=""+t.key),e.type&&e.type.defaultProps)var u=e.type.defaultProps;for(c in t)w.call(t,c)&&!k.hasOwnProperty(c)&&(a[c]=void 0===t[c]&&void 0!==u?u[c]:t[c])}var c=arguments.length-2;if(1===c)a.children=n;else if(1<c){u=Array(c);for(var f=0;f<c;f++)u[f]=arguments[f+2];a.children=u}return{$$typeof:i,type:e.type,key:o,ref:s,props:a,_owner:l}},t.createContext=function(e,t){return void 0===t&&(t=null),(e={$$typeof:s,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:o,_context:e},e.Consumer=e},t.createElement=E,t.createFactory=function(e){var t=E.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:l,render:e}},t.isValidElement=x,t.lazy=function(e){return{$$typeof:c,_payload:{_status:-1,_result:e},_init:O}},t.memo=function(e,t){return{$$typeof:u,type:e,compare:void 0===t?null:t}},t.useCallback=function(e,t){return R().useCallback(e,t)},t.useContext=function(e,t){return R().useContext(e,t)},t.useDebugValue=function(){},t.useEffect=function(e,t){return R().useEffect(e,t)},t.useImperativeHandle=function(e,t,n){return R().useImperativeHandle(e,t,n)},t.useLayoutEffect=function(e,t){return R().useLayoutEffect(e,t)},t.useMemo=function(e,t){return R().useMemo(e,t)},t.useReducer=function(e,t,n){return R().useReducer(e,t,n)},t.useRef=function(e){return R().useRef(e)},t.useState=function(e){return R().useState(e)},t.version="17.0.2"},766:(e,t,n)=>{"use strict";e.exports=n(377)},449:(e,t)=>{"use strict";var n,r,i,a,o;if("undefined"==typeof window||"function"!=typeof MessageChannel){var s=null,l=null,u=function(){if(null!==s)try{var e=t.unstable_now();s(!0,e),s=null}catch(e){throw setTimeout(u,0),e}},c=Date.now();t.unstable_now=function(){return Date.now()-c},n=function(e){null!==s?setTimeout(n,0,e):(s=e,setTimeout(u,0))},r=function(e,t){l=setTimeout(e,t)},i=function(){clearTimeout(l)},a=function(){return!1},o=t.unstable_forceFrameRate=function(){}}else{var f=window.performance,d=window.Date,p=window.setTimeout,h=window.clearTimeout;if("undefined"!=typeof console){var v=window.cancelAnimationFrame;"function"!=typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!=typeof v&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")}if("object"==typeof f&&"function"==typeof f.now)t.unstable_now=function(){return f.now()};else{var g=d.now();t.unstable_now=function(){return d.now()-g}}var y=!1,m=null,b=-1,S=5,w=0;a=function(){return t.unstable_now()>=w},o=function(){},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing framerates higher than 125 fps is not unsupported"):S=0<e?Math.floor(1e3/e):5};var k=new MessageChannel,E=k.port2;k.port1.onmessage=function(){if(null!==m){var e=t.unstable_now();w=e+S;try{m(!0,e)?E.postMessage(null):(y=!1,m=null)}catch(e){throw E.postMessage(null),e}}else y=!1},n=function(e){m=e,y||(y=!0,E.postMessage(null))},r=function(e,n){b=p((function(){e(t.unstable_now())}),n)},i=function(){h(b),b=-1}}function x(e,t){var n=e.length;e.push(t);e:for(;;){var r=n-1>>>1,i=e[r];if(!(void 0!==i&&0<T(i,t)))break e;e[r]=t,e[n]=i,n=r}}function _(e){return void 0===(e=e[0])?null:e}function I(e){var t=e[0];if(void 0!==t){var n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,i=e.length;r<i;){var a=2*(r+1)-1,o=e[a],s=a+1,l=e[s];if(void 0!==o&&0>T(o,n))void 0!==l&&0>T(l,o)?(e[r]=l,e[s]=n,r=s):(e[r]=o,e[a]=n,r=a);else{if(!(void 0!==l&&0>T(l,n)))break e;e[r]=l,e[s]=n,r=s}}}return t}return null}function T(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var C=[],O=[],N=1,R=null,D=3,P=!1,A=!1,M=!1;function L(e){for(var t=_(O);null!==t;){if(null===t.callback)I(O);else{if(!(t.startTime<=e))break;I(O),t.sortIndex=t.expirationTime,x(C,t)}t=_(O)}}function U(e){if(M=!1,L(e),!A)if(null!==_(C))A=!0,n(j);else{var t=_(O);null!==t&&r(U,t.startTime-e)}}function j(e,n){A=!1,M&&(M=!1,i()),P=!0;var o=D;try{for(L(n),R=_(C);null!==R&&(!(R.expirationTime>n)||e&&!a());){var s=R.callback;if(null!==s){R.callback=null,D=R.priorityLevel;var l=s(R.expirationTime<=n);n=t.unstable_now(),"function"==typeof l?R.callback=l:R===_(C)&&I(C),L(n)}else I(C);R=_(C)}if(null!==R)var u=!0;else{var c=_(O);null!==c&&r(U,c.startTime-n),u=!1}return u}finally{R=null,D=o,P=!1}}function V(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var F=o;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){A||P||(A=!0,n(j))},t.unstable_getCurrentPriorityLevel=function(){return D},t.unstable_getFirstCallbackNode=function(){return _(C)},t.unstable_next=function(e){switch(D){case 1:case 2:case 3:var t=3;break;default:t=D}var n=D;D=t;try{return e()}finally{D=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=F,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=D;D=e;try{return t()}finally{D=n}},t.unstable_scheduleCallback=function(e,a,o){var s=t.unstable_now();if("object"==typeof o&&null!==o){var l=o.delay;l="number"==typeof l&&0<l?s+l:s,o="number"==typeof o.timeout?o.timeout:V(e)}else o=V(e),l=s;return e={id:N++,callback:a,priorityLevel:e,startTime:l,expirationTime:o=l+o,sortIndex:-1},l>s?(e.sortIndex=l,x(O,e),null===_(C)&&e===_(O)&&(M?i():M=!0,r(U,l-s))):(e.sortIndex=o,x(C,e),A||P||(A=!0,n(j))),e},t.unstable_shouldYield=function(){var e=t.unstable_now();L(e);var n=_(C);return n!==R&&null!==R&&null!==n&&null!==n.callback&&n.startTime<=e&&n.expirationTime<R.expirationTime||a()},t.unstable_wrapCallback=function(e){var t=D;return function(){var n=D;D=t;try{return e.apply(this,arguments)}finally{D=n}}}},428:(e,t,n)=>{"use strict";e.exports=n(449)},465:(e,t,n)=>{"use strict";var r=n(766);var i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},a=r.useState,o=r.useEffect,s=r.useLayoutEffect,l=r.useDebugValue;function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch(e){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,c=r[1];return s((function(){i.value=n,i.getSnapshot=t,u(i)&&c({inst:i})}),[e,n,t]),o((function(){return u(i)&&c({inst:i}),e((function(){u(i)&&c({inst:i})}))}),[e]),l(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:c},878:(e,t,n)=>{"use strict";var r=n(766),i=n(178);var a="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=i.useSyncExternalStore,s=r.useRef,l=r.useEffect,u=r.useMemo,c=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var f=s(null);if(null===f.current){var d={hasValue:!1,value:null};f.current=d}else d=f.current;f=u((function(){function e(e){if(!l){if(l=!0,o=e,e=r(e),void 0!==i&&d.hasValue){var t=d.value;if(i(t,e))return s=t}return s=e}if(t=s,a(o,e))return t;var n=r(e);return void 0!==i&&i(t,n)?t:(o=e,s=n)}var o,s,l=!1,u=void 0===n?null:n;return[function(){return e(t())},null===u?void 0:function(){return e(u())}]}),[t,n,r,i]);var p=o(e,f[0],f[1]);return l((function(){d.hasValue=!0,d.value=p}),[p]),c(p),p}},178:(e,t,n)=>{"use strict";e.exports=n(465)},724:(e,t,n)=>{"use strict";e.exports=n(878)},501:e=>{e.exports={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}},557:e=>{"use strict";e.exports=a},713:e=>{"use strict";e.exports=i},2:e=>{"use strict";e.exports=r},838:e=>{"use strict";e.exports=n},438:e=>{"use strict";e.exports=t},307:t=>{"use strict";t.exports=e},333:(e,t,n)=>{"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}n.d(t,{A:()=>r})},833:(e,t,n)=>{"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.d(t,{A:()=>r})},393:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(620);function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(0,r.A)(i.key),i)}}function a(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}},719:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(620);function i(e,t,n){return(t=(0,r.A)(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},757:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(860);function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a,o,s=[],l=!0,u=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return s}}(e,t)||(0,r.A)(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},620:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(888);function i(e){var t=function(e,t){if("object"!=(0,r.A)(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=(0,r.A)(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==(0,r.A)(t)?t:t+""}},888:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n.d(t,{A:()=>r})},860:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(333);function i(e,t){if(e){if("string"==typeof e)return(0,r.A)(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?(0,r.A)(e,t):void 0}}},871:(e,t,n)=>{"use strict";n.d(t,{Bd:()=>_});var r=n(719);var i=n(766),a=n(888);n(501);Object.create(null);function o(){if(console&&console.warn){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];"string"==typeof n[0]&&(n[0]="react-i18next:: ".concat(n[0])),(e=console).warn.apply(e,n)}}var s={};function l(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];"string"==typeof t[0]&&s[t[0]]||("string"==typeof t[0]&&(s[t[0]]=new Date),o.apply(void 0,t))}var u=function(e,t){return function(){if(e.isInitialized)t();else{e.on("initialized",(function n(){setTimeout((function(){e.off("initialized",n)}),0),t()}))}}};function c(e,t,n){e.loadNamespaces(t,u(e,n))}function f(e,t,n,r){"string"==typeof n&&(n=[n]),n.forEach((function(t){e.options.ns.indexOf(t)<0&&e.options.ns.push(t)})),e.loadLanguages(t,u(e,r))}var d=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,p={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},h=function(e){return p[e]};var v,g={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:function(e){return e.replace(d,h)}};var y=n(833),m=n(393);var b=(0,i.createContext)(),S=function(){function e(){(0,y.A)(this,e),this.usedNamespaces={}}return(0,m.A)(e,[{key:"addUsedNamespaces",value:function(e){var t=this;e.forEach((function(e){t.usedNamespaces[e]||(t.usedNamespaces[e]=!0)}))}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),e}();var w=n(757);function k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function E(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?k(Object(n),!0).forEach((function(t){(0,r.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var x=function(e,t){var n=(0,i.useRef)();return(0,i.useEffect)((function(){n.current=t?n.current:e}),[e,t]),n.current};function _(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.i18n,r=(0,i.useContext)(b)||{},o=r.i18n,s=r.defaultNS,u=n||o||v;if(u&&!u.reportNamespaces&&(u.reportNamespaces=new S),!u){l("You will need to pass in an i18next instance by using initReactI18next");var d=function(e,t){return"string"==typeof t?t:t&&"object"===(0,a.A)(t)&&"string"==typeof t.defaultValue?t.defaultValue:Array.isArray(e)?e[e.length-1]:e},p=[d,{},!1];return p.t=d,p.i18n={},p.ready=!1,p}u.options.react&&void 0!==u.options.react.wait&&l("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var h=E(E(E({},g),u.options.react),t),y=h.useSuspense,m=h.keyPrefix,k=e||s||u.options&&u.options.defaultNS;k="string"==typeof k?[k]:k||["translation"],u.reportNamespaces.addUsedNamespaces&&u.reportNamespaces.addUsedNamespaces(k);var _=(u.isInitialized||u.initializedStoreOnce)&&k.every((function(e){return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t.languages&&t.languages.length?void 0!==t.options.ignoreJSONStructure?t.hasLoadedNamespace(e,{lng:n.lng,precheck:function(t,r){if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!r(t.isLanguageChangingTo,e))return!1}}):function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=t.languages[0],i=!!t.options&&t.options.fallbackLng,a=t.languages[t.languages.length-1];if("cimode"===r.toLowerCase())return!0;var o=function(e,n){var r=t.services.backendConnector.state["".concat(e,"|").concat(n)];return-1===r||2===r};return!(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!o(t.isLanguageChangingTo,e)||!t.hasResourceBundle(r,e)&&t.services.backendConnector.backend&&(!t.options.resources||t.options.partialBundledLanguages)&&(!o(r,e)||i&&!o(a,e)))}(e,t,n):(l("i18n.languages were undefined or empty",t.languages),!0)}(e,u,h)}));function I(){return u.getFixedT(t.lng||null,"fallback"===h.nsMode?k:k[0],m)}var T=(0,i.useState)(I),C=(0,w.A)(T,2),O=C[0],N=C[1],R=k.join();t.lng&&(R="".concat(t.lng).concat(R));var D=x(R),P=(0,i.useRef)(!0);(0,i.useEffect)((function(){var e=h.bindI18n,n=h.bindI18nStore;function r(){P.current&&N(I)}return P.current=!0,_||y||(t.lng?f(u,t.lng,k,(function(){P.current&&N(I)})):c(u,k,(function(){P.current&&N(I)}))),_&&D&&D!==R&&P.current&&N(I),e&&u&&u.on(e,r),n&&u&&u.store.on(n,r),function(){P.current=!1,e&&u&&e.split(" ").forEach((function(e){return u.off(e,r)})),n&&u&&n.split(" ").forEach((function(e){return u.store.off(e,r)}))}}),[u,R]);var A=(0,i.useRef)(!0);(0,i.useEffect)((function(){P.current&&!A.current&&N(I),A.current=!1}),[u,m]);var M=[O,u,_];if(M.t=O,M.i18n=u,M.ready=_,_)return M;if(!_&&!y)return M;throw new Promise((function(e){t.lng?f(u,t.lng,k,(function(){return e()})):c(u,k,(function(){return e()}))}))}}},f={};function d(e){var t=f[e];if(void 0!==t)return t.exports;var n=f[e]={exports:{}};return c[e](n,n.exports,d),n.exports}d.m=c,o=[],d.O=(e,t,n,r)=>{if(!t){var i=1/0;for(u=0;u<o.length;u++){for(var[t,n,r]=o[u],a=!0,s=0;s<t.length;s++)(!1&r||i>=r)&&Object.keys(d.O).every((e=>d.O[e](t[s])))?t.splice(s--,1):(a=!1,r<i&&(i=r));if(a){o.splice(u--,1);var l=n();void 0!==l&&(e=l)}}return e}r=r||0;for(var u=o.length;u>0&&o[u-1][2]>r;u--)o[u]=o[u-1];o[u]=[t,n,r]},d.F={},d.E=e=>{Object.keys(d.F).map((t=>{d.F[t](e)}))},d.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return d.d(t,{a:t}),t},l=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,d.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var n=Object.create(null);d.r(n);var r={};s=s||[null,l({}),l([]),l(l)];for(var i=2&t&&e;"object"==typeof i&&!~s.indexOf(i);i=l(i))Object.getOwnPropertyNames(i).forEach((t=>r[t]=()=>e[t]));return r.default=()=>e,d.d(n,r),n},d.d=(e,t)=>{for(var n in t)d.o(t,n)&&!d.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},d.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),d.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),d.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},u={524:0},d.F.j=e=>{if(!d.o(u,e)||void 0===u[e]){u[e]=null;var t=document.createElement("link");d.nc&&t.setAttribute("nonce",d.nc),t.rel="prefetch",t.as="script",t.href=d.p+d.u(e),document.head.appendChild(t)}},d.O.j=e=>0===u[e],d.O(0,[524],(()=>{d.E(524)}),5);var p={};return(()=>{"use strict";d.r(p),d.d(p,{default:()=>fe});var e,t=d(946),n=d(766),r=d.t(n,2),i=d(374),a=d.n(i),o=d(887),s=d.t(o,2);function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l.apply(this,arguments)}!function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(e||(e={}));function u(e,t){if(!1===e||null==e)throw new Error(t)}function c(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}var f;!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(f||(f={}));new Set(["lazy","caseSensitive","path","id","index","children"]);function h(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the `to."+n+'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.'}function v(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}function g(e,t){let n=v(e);return t?n.map(((t,n)=>n===e.length-1?t.pathname:t.pathnameBase)):n.map((e=>e.pathnameBase))}function y(e,t,n,r){let i;void 0===r&&(r=!1),"string"==typeof e?i=c(e):(i=l({},e),u(!i.pathname||!i.pathname.includes("?"),h("?","pathname","search",i)),u(!i.pathname||!i.pathname.includes("#"),h("#","pathname","hash",i)),u(!i.search||!i.search.includes("#"),h("#","search","hash",i)));let a,o=""===e||""===i.pathname,s=o?"/":i.pathname;if(null==s)a=n;else{let e=t.length-1;if(!r&&s.startsWith("..")){let t=s.split("/");for(;".."===t[0];)t.shift(),e-=1;i.pathname=t.join("/")}a=e>=0?t[e]:"/"}let f=function(e,t){void 0===t&&(t="/");let{pathname:n,search:r="",hash:i=""}="string"==typeof e?c(e):e,a=n?n.startsWith("/")?n:function(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)})),n.length>1?n.join("/"):"/"}(n,t):t;return{pathname:a,search:b(r),hash:S(i)}}(i,a),d=s&&"/"!==s&&s.endsWith("/"),p=(o||"."===s)&&n.endsWith("/");return f.pathname.endsWith("/")||!d&&!p||(f.pathname+="/"),f}const m=e=>e.join("/").replace(/\/\/+/g,"/"),b=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",S=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";Error;const w=["post","put","patch","delete"],k=(new Set(w),["get",...w]);new Set(k),new Set([301,302,303,307,308]),new Set([307,308]);Symbol("deferred");function E(){return E=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},E.apply(this,arguments)}const x=n.createContext(null);const _=n.createContext(null);const I=n.createContext(null);const T=n.createContext({outlet:null,matches:[],isDataRoute:!1});function C(){return null!=n.useContext(I)}function O(){return C()||u(!1),n.useContext(I).location}function N(e){n.useContext(_).static||n.useLayoutEffect(e)}function R(){let{isDataRoute:e}=n.useContext(T);return e?function(){let{router:e}=A(D.UseNavigateStable),t=M(P.UseNavigateStable),r=n.useRef(!1);N((()=>{r.current=!0}));let i=n.useCallback((function(n,i){void 0===i&&(i={}),r.current&&("number"==typeof n?e.navigate(n):e.navigate(n,E({fromRouteId:t},i)))}),[e,t]);return i}():function(){C()||u(!1);let e=n.useContext(x),{basename:t,future:r,navigator:i}=n.useContext(_),{matches:a}=n.useContext(T),{pathname:o}=O(),s=JSON.stringify(g(a,r.v7_relativeSplatPath)),l=n.useRef(!1);return N((()=>{l.current=!0})),n.useCallback((function(n,r){if(void 0===r&&(r={}),!l.current)return;if("number"==typeof n)return void i.go(n);let a=y(n,JSON.parse(s),o,"path"===r.relative);null==e&&"/"!==t&&(a.pathname="/"===a.pathname?t:m([t,a.pathname])),(r.replace?i.replace:i.push)(a,r.state,r)}),[t,i,s,o,e])}()}n.Component;var D=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(D||{}),P=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(P||{});function A(e){let t=n.useContext(x);return t||u(!1),t}function M(e){let t=function(e){let t=n.useContext(T);return t||u(!1),t}(),r=t.matches[t.matches.length-1];return r.route.id||u(!1),r.route.id}r.startTransition;new Promise((()=>{}));n.Component;new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);try{window.__reactRouterVersion="6"}catch(e){}new Map;r.startTransition,s.flushSync,r.useId;"undefined"!=typeof window&&void 0!==window.document&&window.document.createElement;var L,U;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(L||(L={})),function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(U||(U={}));var j=d(871),V=d(2),F=d(307);const{formatDate:z}=V.utils;function B({servicesManager:e,getImageSrc:r,getStudiesForPatientByMRN:i,requestDisplaySetCreationForStudy:a,dataSource:o}){const{displaySetService:s,uiDialogService:l,hangingProtocolService:u,uiNotificationService:c,measurementService:f}=e.services,d=R(),{t:p}=(0,j.Bd)("Common"),{StudyInstanceUIDs:h}=(0,F.useImageViewer)(),[{activeViewportId:v,viewports:g,isHangingProtocolLayout:y},m]=(0,F.useViewportGrid)(),[b,S]=(0,t.B)(),[w,k]=(0,n.useState)("primary"),[E,x]=(0,n.useState)([...h]),[_,I]=(0,n.useState)([]),[T,C]=(0,n.useState)([]),[O,N]=(0,n.useState)({}),[D,P]=(0,n.useState)(null),A=g.get(v)?.displaySetInstanceUIDs,{trackedSeries:M}=b.context;(0,n.useEffect)((()=>{h.forEach((e=>async function(e){const t=await o.query.studies.search({studyInstanceUid:e});if(!t?.length)throw d("/notfoundstudy","_self"),new Error("Invalid study URL");let n=t;try{n=await i(t)}catch(e){console.warn(e)}const r=n.map((e=>({AccessionNumber:e.accession,StudyDate:e.date,StudyDescription:e.description,NumInstances:e.instances,ModalitiesInStudy:e.modalities,PatientID:e.mrn,PatientName:e.patientName,StudyInstanceUID:e.studyInstanceUid,StudyTime:e.time}))).map((e=>({studyInstanceUid:e.StudyInstanceUID,date:z(e.StudyDate)||p("NoStudyDate"),description:e.StudyDescription,modalities:e.ModalitiesInStudy,numInstances:e.NumInstances})));I((e=>{const t=[...e];for(const n of r)e.find((e=>e.studyInstanceUid===n.studyInstanceUid))||t.push(n);return t}))}(e)))}),[h,i]),(0,n.useEffect)((()=>{const e=s.activeDisplaySets;e.length&&e.forEach((async e=>{const t={},n=s.getDisplaySetByUID(e.displaySetInstanceUID),i=W(n,o.getImageIdsForDisplaySet(n));i&&!n?.unsupported&&(t[e.displaySetInstanceUID]=await r(i),N((e=>({...e,...t}))))}))}),[s,o,r]),(0,n.useEffect)((()=>{const e=s.activeDisplaySets;if(!e.length)return;const t=q(e,O,M,g,m,o,s,l,c);C(t)}),[s.activeDisplaySets,M,g,o,O]),(0,n.useEffect)((()=>{const e=s.subscribe(s.EVENTS.DISPLAY_SETS_ADDED,(e=>{const{displaySetsAdded:t,options:n}=e;t.forEach((async e=>{const t=e.displaySetInstanceUID,i={},a=s.getDisplaySetByUID(t);if(a?.unsupported)return;n.madeInClient&&P(t);const l=W(a,o.getImageIdsForDisplaySet(a));l&&(i[t]=await r(l),N((e=>({...e,...i}))))}))}));return()=>{e.unsubscribe()}}),[s,o,r,O,M,g]),(0,n.useEffect)((()=>{const e=s.subscribe(s.EVENTS.DISPLAY_SETS_CHANGED,(e=>{const t=q(e,O,M,g,m,o,s,l,c);C(t)})),t=s.subscribe(s.EVENTS.DISPLAY_SET_SERIES_METADATA_INVALIDATED,(()=>{const e=q(s.getActiveDisplaySets(),O,M,g,m,o,s,l,c);C(e)}));return()=>{e.unsubscribe(),t.unsubscribe()}}),[O,M,g,o,s]);const L=function(e,t,n,r){const i=[],a=[],o=[];t.forEach((t=>{const s=n.filter((e=>e.StudyInstanceUID===t.studyInstanceUid)),l=r.getDisplaySetSortFunction();s.sort(l);const u=Object.assign({},t,{displaySets:s});e.includes(t.studyInstanceUid)?(i.push(u),o.push(u)):(a.push(u),o.push(u))}));const s=(e,t)=>{const n=Date.parse(e);return Date.parse(t)-n},l=[{name:"primary",label:"Primary",studies:i.sort(((e,t)=>s(e.date,t.date)))},{name:"recent",label:"Recent",studies:a.sort(((e,t)=>s(e.date,t.date)))},{name:"all",label:"All",studies:o.sort(((e,t)=>s(e.date,t.date)))}];return l}(h,_,T,u);(0,n.useEffect)((()=>{if(D){const e=D,t=document.getElementById(`thumbnail-${e}`);t&&"function"==typeof t.scrollIntoView&&(t.scrollIntoView({behavior:"smooth"}),P(null))}}),[D,E,w]),(0,n.useEffect)((()=>{if(!D)return;const e=function(e,t){for(let n=0;n<t.length;n++){const{studies:r}=t[n];for(let i=0;i<r.length;i++){const{displaySets:a}=r[i];for(let o=0;o<a.length;o++){if(a[o].displaySetInstanceUID===e)return{tabName:t[n].name,StudyInstanceUID:r[i].studyInstanceUid}}}}}(D,L);if(!e)return void console.warn("jumpToThumbnail: displaySet thumbnail not found.");const{tabName:t,StudyInstanceUID:n}=e;k(t);if(!E.includes(n)){const e=[...E,n];x(e)}}),[E,D,L]);const U=e=>{l.create({id:"untrack-series",centralize:!0,isDraggable:!1,showOverlay:!0,content:F.Dialog,contentProps:{title:"Untrack Series",body:()=>n.createElement("div",{className:"bg-primary-dark p-4 text-white"},n.createElement("p",null,"Are you sure you want to untrack this series?"),n.createElement("p",{className:"mt-2"},"This action cannot be undone and will delete all your existing measurements.")),actions:[{id:"cancel",text:"Cancel",type:F.ButtonEnums.type.secondary},{id:"yes",text:"Yes",type:F.ButtonEnums.type.primary,classes:["untrack-yes-button"]}],onClose:()=>l.dismiss({id:"untrack-series"}),onSubmit:async({action:t})=>{switch(t.id){case"yes":(()=>{const t=s.getDisplaySetByUID(e);S("UNTRACK_SERIES",{SeriesInstanceUID:t.SeriesInstanceUID}),f.getMeasurements().forEach((e=>{e.referenceSeriesUID===t.SeriesInstanceUID&&f.remove(e.uid)}))})(),l.dismiss({id:"untrack-series"});break;case"cancel":l.dismiss({id:"untrack-series"})}}}})};return n.createElement(F.StudyBrowser,{tabs:L,servicesManager:e,activeTabName:w,expandedStudyInstanceUIDs:E,onClickStudy:function(e){const t=E.includes(e),n=t?[...E.filter((t=>t!==e))]:[...E,e];if(x(n),!t){a(s,e,!0)}},onClickTab:e=>{k(e)},onClickUntrack:e=>{U(e)},onClickThumbnail:()=>{},onDoubleClickThumbnail:e=>{let t=[];const n=v;try{t=u.getViewportsRequireUpdate(n,e,y)}catch(e){console.warn(e),c.show({title:"Thumbnail Double Click",message:"The selected display sets could not be added to the viewport due to a mismatch in the Hanging Protocol rules.",type:"info",duration:3e3})}m.setDisplaySetsForViewports(t)},activeDisplaySetInstanceUIDs:A})}B.propTypes={servicesManager:a().object.isRequired,dataSource:a().shape({getImageIdsForDisplaySet:a().func.isRequired}).isRequired,getImageSrc:a().func.isRequired,getStudiesForPatientByMRN:a().func.isRequired,requestDisplaySetCreationForStudy:a().func.isRequired};const H=B;function W(e,t){let n;if(e.isDynamicVolume){const t=e.dynamicVolumeInfo.timePoints,r=t[Math.floor(t.length/2)];n=r[Math.floor(r.length/2)]}else n=t[Math.floor(t.length/2)];return n}function q(e,t,r,i,a,o,s,l,u){const c=[],f=[];return e.filter((e=>!e.excludeFromThumbnailBrowser)).forEach((e=>{const i=t[e.displaySetInstanceUID],d=function(e){if($.includes(e.Modality)||e?.unsupported)return"thumbnailNoImage";return"thumbnailTracked"}(e),p=(a.getNumViewportPanes(),"thumbnailTracked"===d?c:f),{displaySetInstanceUID:h}=e,v={displaySetInstanceUID:h,description:e.SeriesDescription,seriesNumber:e.SeriesNumber,modality:e.Modality,seriesDate:z(e.SeriesDate),numInstances:e.numImageFrames,countIcon:e.countIcon,messages:e.messages,StudyInstanceUID:e.StudyInstanceUID,componentType:d,imageSrc:i,dragData:{type:"displayset",displaySetInstanceUID:h},isTracked:r.includes(e.SeriesInstanceUID),isHydratedForDerivedDisplaySet:e.isHydrated};"thumbnailNoImage"===d&&(o.reject&&o.reject.series?(v.canReject=!e?.unsupported,v.onReject=()=>{l.create({id:"ds-reject-sr",centralize:!0,isDraggable:!1,showOverlay:!0,content:F.Dialog,contentProps:{title:"Delete Report",body:()=>n.createElement("div",{className:"bg-primary-dark p-4 text-white"},n.createElement("p",null,"Are you sure you want to delete this report?"),n.createElement("p",{className:"mt-2"},"This action cannot be undone.")),actions:[{id:"cancel",text:"Cancel",type:F.ButtonEnums.type.secondary},{id:"yes",text:"Yes",type:F.ButtonEnums.type.primary,classes:["reject-yes-button"]}],onClose:()=>l.dismiss({id:"ds-reject-sr"}),onShow:()=>{document.querySelector(".reject-yes-button").focus()},onSubmit:async({action:t})=>{switch(t.id){case"yes":try{await o.reject.series(e.StudyInstanceUID,e.SeriesInstanceUID),s.deleteDisplaySet(h),l.dismiss({id:"ds-reject-sr"}),u.show({title:"Delete Report",message:"Report deleted successfully",type:"success"})}catch(e){l.dismiss({id:"ds-reject-sr"}),u.show({title:"Delete Report",message:"Failed to delete report",type:"error"})}break;case"cancel":l.dismiss({id:"ds-reject-sr"})}}}})}):v.canReject=!1),p.push(v)})),[...c,...f]}const $=["SR","SEG","SM","RTSTRUCT","RTPLAN","RTDOSE","DOC","OT"];const K=function(e,t){return new Promise(((n,r)=>{const i=document.createElement("canvas");e.utilities.loadImageToCanvas({canvas:i,imageId:t,thumbnail:!0}).then((e=>{n(i.toDataURL())})).catch(r)}))};const Y=function(e,t,n,r){t.activeDisplaySets.some((e=>e.StudyInstanceUID===n))||e.retrieve.series.metadata({StudyInstanceUID:n,madeInClient:r})};function Q({commandsManager:e,extensionManager:t,servicesManager:r}){const i=t.getActiveDataSource()[0],a=function(e){const t=e.getModuleEntry("@ohif/extension-default.utilityModule.common"),{getStudiesForPatientByMRN:n}=t.exports;return n}(t),o=a.bind(null,i),s=(0,n.useCallback)(function(e){const t=e.getModuleEntry("@ohif/extension-cornerstone.utilityModule.common");try{const{cornerstone:e}=t.exports.getCornerstoneLibraries();return K.bind(null,e)}catch(e){throw new Error("Required command not found")}}(t),[]),l=Y.bind(null,i);return n.createElement(H,{servicesManager:r,dataSource:i,getImageSrc:s,getStudiesForPatientByMRN:o,requestDisplaySetCreationForStudy:l})}Q.propTypes={commandsManager:a().object.isRequired,extensionManager:a().object.isRequired,servicesManager:a().object.isRequired};const J=Q;var G=d(497),X=d(771),Z=d.n(X);const{downloadCSVReport:ee}=V.utils,{formatDate:te}=V.utils,ne={key:void 0,date:"",modality:"",description:""};function re({servicesManager:e,extensionManager:r}){const[i]=(0,F.useViewportGrid)(),{t:a}=(0,j.Bd)("MeasurementTable"),[o,s]=(0,n.useState)(Date.now().toString()),l=function(e,t){const[r,i]=(0,n.useState)(e);return(0,n.useEffect)((()=>{const n=setTimeout((()=>{i(e)}),t);return()=>{clearTimeout(n)}}),[e,t]),r}(o,200),{measurementService:u,uiDialogService:c,displaySetService:f,customizationService:d}=e.services,[p,h]=(0,t.B)(),{trackedStudy:v,trackedSeries:g}=p.context,[y,m]=(0,n.useState)(ne),[b,S]=(0,n.useState)([]),w=(0,n.useRef)(null),[k]=(0,G.r)();(0,n.useEffect)((()=>{const e=u.getMeasurements().filter((e=>v===e.referenceStudyUID&&g.includes(e.referenceSeriesUID))).map((e=>function(e,t,n){const{referenceStudyUID:r,referenceSeriesUID:i,SOPInstanceUID:a}=e,o=(V.DicomMetadataStore.getInstance(r,i,a),n.getDisplaySetsForSeries(i));if(!o[0]||!o[0].images)throw new Error('The tracked measurements panel should only be tracking "stack" displaySets.');const{displayText:s,uid:l,label:u,type:c,selected:f,findingSites:d,finding:p}=e,h=d?.[0],v=u||p?.text||h?.text||"(empty)";let g=s||[];if(d){const e=[];d.forEach((t=>{t?.text!==v&&e.push(t.text)})),g=[...e,...g]}p&&p?.text!==v&&(g=[p.text,...g]);return{uid:l,label:v,baseLabel:u,measurementType:c,displayText:g,baseDisplayText:s,isActive:f,finding:p,findingSites:d}}(e,u.VALUE_TYPES,f)));S(e)}),[u,v,g,l]);const E=async()=>{if(p.matches("tracking")){const e=v,t=V.DicomMetadataStore.getStudy(e),n=t.series[0].instances[0],{StudyDate:r,StudyDescription:i}=n,a=new Set;t.series.forEach((e=>{g.includes(e.SeriesInstanceUID)&&a.add(e.instances[0].Modality)}));const o=Array.from(a).join("/");y.key!==e&&m({key:e,date:r,modality:o,description:i})}else""!==v&&void 0!==v||m(ne)};(0,n.useEffect)((()=>{E()}),[y.key,p,v,E]),(0,n.useEffect)((()=>{const e=u.EVENTS.MEASUREMENT_ADDED,t=u.EVENTS.RAW_MEASUREMENT_ADDED,n=u.EVENTS.MEASUREMENT_UPDATED,r=u.EVENTS.MEASUREMENT_REMOVED,i=u.EVENTS.MEASUREMENTS_CLEARED,a=[];return[e,t,n,r,i].forEach((t=>{a.push(u.subscribe(t,(()=>{s(Date.now().toString()),t===e&&Z()((()=>{w.current.scrollTop=w.current.scrollHeight}),300)()})).unsubscribe)})),()=>{a.forEach((e=>{e()}))}}),[u,h]);const x=({uid:e,isActive:t})=>{u.jumpToMeasurement(i.activeViewportId,e),I({uid:e,isActive:t})},_=({uid:e,isActive:t})=>{x({uid:e,isActive:t});const n=d.get("measurementLabels"),i=u.getMeasurement(e),a=r.getModuleEntry("@ohif/extension-cornerstone.utilityModule.common"),{showLabelAnnotationPopup:o}=a.exports;o(i,c,n).then((t=>{u.update(e,{...t},!0)}))},I=({uid:e,isActive:t})=>{if(!t){const t=[...b],n=t.find((t=>t.uid===e));t.forEach((t=>t.isActive=t.uid===e)),n.isActive=!0,S(t)}},T=b.filter((e=>e.measurementType!==u.VALUE_TYPES.POINT)),C=b.filter((e=>e.measurementType===u.VALUE_TYPES.POINT)),O=0===C.length&&0===T.length;return n.createElement(n.Fragment,null,n.createElement("div",{className:"invisible-scrollbar overflow-y-auto overflow-x-hidden",ref:w,"data-cy":"trackedMeasurements-panel"},y.key&&n.createElement(F.StudySummary,{date:te(y.date),modality:y.modality,description:y.description}),n.createElement(F.MeasurementTable,{title:"Measurements",data:T,servicesManager:e,onClick:x,onEdit:_}),0!==C.length&&n.createElement(F.MeasurementTable,{title:"Additional Findings",data:C,servicesManager:e,onClick:x,onEdit:_})),!k?.disableEditing&&n.createElement("div",{className:"flex justify-center p-4"},n.createElement(F.ActionButtons,{t:a,actions:[{label:"Export",onClick:async function(){const e=u.getMeasurements().filter((e=>v===e.referenceStudyUID&&g.includes(e.referenceSeriesUID)));ee(e,u)}},{label:"Create Report",onClick:()=>{h("SAVE_REPORT",{viewportId:i.activeViewportId,isBackupSave:!0})}}],disabled:O})))}re.propTypes={servicesManager:a().shape({services:a().shape({measurementService:a().shape({getMeasurements:a().func.isRequired,VALUE_TYPES:a().object.isRequired}).isRequired}).isRequired}).isRequired};const ie=re;var ae=d(625);const oe=function({commandsManager:e,extensionManager:t,servicesManager:n}){return[{name:"seriesList",iconName:"tab-studies",iconLabel:"Studies",label:ae.A.t("SidePanel:Studies"),component:J.bind(null,{commandsManager:e,extensionManager:t,servicesManager:n})},{name:"trackedMeasurements",iconName:"tab-linear",iconLabel:"Measure",label:ae.A.t("SidePanel:Measurements"),component:ie.bind(null,{commandsManager:e,extensionManager:t,servicesManager:n})}]};function se(){return se=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},se.apply(this,arguments)}const le=n.lazy((()=>Promise.resolve().then(d.bind(d,915)))),ue=e=>n.createElement(n.Suspense,{fallback:n.createElement("div",null,"Loading...")},n.createElement(le,e));const ce=function({servicesManager:e,commandsManager:t,extensionManager:r}){return[{name:"cornerstone-tracked",component:i=>n.createElement(ue,se({servicesManager:e,commandsManager:t,extensionManager:r},i))}]},fe={id:JSON.parse('{"UU":"@ohif/extension-measurement-tracking"}').UU,getContextModule:t.A,getPanelModule:oe,getViewportModule:ce}})(),p=d.O(p)})()));