text: /*! For license information please see index.js.LICENSE.txt */
  (()=>{var e={2162:(e,t,n)=>{"use strict";n.d(t,{Xb:()=>f,Gd:()=>m,cu:()=>p});var r=n(655),i=n(7199),o=n(2844),a=n(1170),s=n(2343),l=n(1422),u=n(6769),c=n(2470),d=function(){function e(e){this.errors=0,this.sid=(0,o.DM)(),this.duration=0,this.status=i.$.Ok,this.init=!0,this.ignoreDuration=!1;var t=(0,a.ph)();this.timestamp=t,this.started=t,e&&this.update(e)}return e.prototype.update=function(e){if(void 0===e&&(e={}),e.user&&(!this.ipAddress&&e.user.ip_address&&(this.ipAddress=e.user.ip_address),this.did||e.did||(this.did=e.user.id||e.user.email||e.user.username)),this.timestamp=e.timestamp||(0,a.ph)(),e.ignoreDuration&&(this.ignoreDuration=e.ignoreDuration),e.sid&&(this.sid=32===e.sid.length?e.sid:(0,o.DM)()),void 0!==e.init&&(this.init=e.init),!this.did&&e.did&&(this.did=""+e.did),"number"==typeof e.started&&(this.started=e.started),this.ignoreDuration)this.duration=void 0;else if("number"==typeof e.duration)this.duration=e.duration;else{var t=this.timestamp-this.started;this.duration=t>=0?t:0}e.release&&(this.release=e.release),e.environment&&(this.environment=e.environment),!this.ipAddress&&e.ipAddress&&(this.ipAddress=e.ipAddress),!this.userAgent&&e.userAgent&&(this.userAgent=e.userAgent),"number"==typeof e.errors&&(this.errors=e.errors),e.status&&(this.status=e.status)},e.prototype.close=function(e){e?this.update({status:e}):this.status===i.$.Ok?this.update({status:i.$.Exited}):this.update()},e.prototype.toJSON=function(){return(0,c.Jr)({sid:""+this.sid,init:this.init,started:new Date(1e3*this.started).toISOString(),timestamp:new Date(1e3*this.timestamp).toISOString(),status:this.status,errors:this.errors,did:"number"==typeof this.did||"string"==typeof this.did?""+this.did:void 0,duration:this.duration,attrs:(0,c.Jr)({release:this.release,environment:this.environment,ip_address:this.ipAddress,user_agent:this.userAgent})})},e}(),f=function(){function e(e,t,n){void 0===t&&(t=new u.s),void 0===n&&(n=4),this._version=n,this._stack=[{}],this.getStackTop().scope=t,this.bindClient(e)}return e.prototype.isOlderThan=function(e){return this._version<e},e.prototype.bindClient=function(e){this.getStackTop().client=e,e&&e.setupIntegrations&&e.setupIntegrations()},e.prototype.pushScope=function(){var e=u.s.clone(this.getScope());return this.getStack().push({client:this.getClient(),scope:e}),e},e.prototype.popScope=function(){return!(this.getStack().length<=1)&&!!this.getStack().pop()},e.prototype.withScope=function(e){var t=this.pushScope();try{e(t)}finally{this.popScope()}},e.prototype.getClient=function(){return this.getStackTop().client},e.prototype.getScope=function(){return this.getStackTop().scope},e.prototype.getStack=function(){return this._stack},e.prototype.getStackTop=function(){return this._stack[this._stack.length-1]},e.prototype.captureException=function(e,t){var n=this._lastEventId=(0,o.DM)(),i=t;if(!t){var a=void 0;try{throw new Error("Sentry syntheticException")}catch(e){a=e}i={originalException:e,syntheticException:a}}return this._invokeClient("captureException",e,(0,r.pi)((0,r.pi)({},i),{event_id:n})),n},e.prototype.captureMessage=function(e,t,n){var i=this._lastEventId=(0,o.DM)(),a=n;if(!n){var s=void 0;try{throw new Error(e)}catch(e){s=e}a={originalException:e,syntheticException:s}}return this._invokeClient("captureMessage",e,t,(0,r.pi)((0,r.pi)({},a),{event_id:i})),i},e.prototype.captureEvent=function(e,t){var n=this._lastEventId=(0,o.DM)();return this._invokeClient("captureEvent",e,(0,r.pi)((0,r.pi)({},t),{event_id:n})),n},e.prototype.lastEventId=function(){return this._lastEventId},e.prototype.addBreadcrumb=function(e,t){var n=this.getStackTop(),i=n.scope,s=n.client;if(i&&s){var l=s.getOptions&&s.getOptions()||{},u=l.beforeBreadcrumb,c=void 0===u?null:u,d=l.maxBreadcrumbs,f=void 0===d?100:d;if(!(f<=0)){var p=(0,a.yW)(),h=(0,r.pi)({timestamp:p},e),m=c?(0,o.Cf)((function(){return c(h,t)})):h;null!==m&&i.addBreadcrumb(m,f)}}},e.prototype.setUser=function(e){var t=this.getScope();t&&t.setUser(e)},e.prototype.setTags=function(e){var t=this.getScope();t&&t.setTags(e)},e.prototype.setExtras=function(e){var t=this.getScope();t&&t.setExtras(e)},e.prototype.setTag=function(e,t){var n=this.getScope();n&&n.setTag(e,t)},e.prototype.setExtra=function(e,t){var n=this.getScope();n&&n.setExtra(e,t)},e.prototype.setContext=function(e,t){var n=this.getScope();n&&n.setContext(e,t)},e.prototype.configureScope=function(e){var t=this.getStackTop(),n=t.scope,r=t.client;n&&r&&e(n)},e.prototype.run=function(e){var t=h(this);try{e(this)}finally{h(t)}},e.prototype.getIntegration=function(e){var t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch(t){return s.k.warn("Cannot retrieve integration "+e.id+" from the current Hub"),null}},e.prototype.startSpan=function(e){return this._callExtensionMethod("startSpan",e)},e.prototype.startTransaction=function(e,t){return this._callExtensionMethod("startTransaction",e,t)},e.prototype.traceHeaders=function(){return this._callExtensionMethod("traceHeaders")},e.prototype.captureSession=function(e){if(void 0===e&&(e=!1),e)return this.endSession();this._sendSessionUpdate()},e.prototype.endSession=function(){var e,t,n,r,i;null===(n=null===(t=null===(e=this.getStackTop())||void 0===e?void 0:e.scope)||void 0===t?void 0:t.getSession())||void 0===n||n.close(),this._sendSessionUpdate(),null===(i=null===(r=this.getStackTop())||void 0===r?void 0:r.scope)||void 0===i||i.setSession()},e.prototype.startSession=function(e){var t=this.getStackTop(),n=t.scope,a=t.client,s=a&&a.getOptions()||{},l=s.release,u=s.environment,c=((0,o.Rf)().navigator||{}).userAgent,f=new d((0,r.pi)((0,r.pi)((0,r.pi)({release:l,environment:u},n&&{user:n.getUser()}),c&&{userAgent:c}),e));if(n){var p=n.getSession&&n.getSession();p&&p.status===i.$.Ok&&p.update({status:i.$.Exited}),this.endSession(),n.setSession(f)}return f},e.prototype._sendSessionUpdate=function(){var e=this.getStackTop(),t=e.scope,n=e.client;if(t){var r=t.getSession&&t.getSession();r&&n&&n.captureSession&&n.captureSession(r)}},e.prototype._invokeClient=function(e){for(var t,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];var o=this.getStackTop(),a=o.scope,s=o.client;s&&s[e]&&(t=s)[e].apply(t,(0,r.fl)(n,[a]))},e.prototype._callExtensionMethod=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=p(),i=r.__SENTRY__;if(i&&i.extensions&&"function"==typeof i.extensions[e])return i.extensions[e].apply(this,t);s.k.warn("Extension method "+e+" couldn't be found, doing nothing.")},e}();function p(){var e=(0,o.Rf)();return e.__SENTRY__=e.__SENTRY__||{extensions:{},hub:void 0},e}function h(e){var t=p(),n=g(t);return y(t,e),n}function m(){var e=p();return v(e)&&!g(e).isOlderThan(4)||y(e,new f),(0,l.KV)()?function(e){var t,n,r;try{var i=null===(r=null===(n=null===(t=p().__SENTRY__)||void 0===t?void 0:t.extensions)||void 0===n?void 0:n.domain)||void 0===r?void 0:r.active;if(!i)return g(e);if(!v(i)||g(i).isOlderThan(4)){var o=g(e).getStackTop();y(i,new f(o.client,u.s.clone(o.scope)))}return g(i)}catch(t){return g(e)}}(e):g(e)}function v(e){return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}function g(e){return e&&e.__SENTRY__&&e.__SENTRY__.hub||(e.__SENTRY__=e.__SENTRY__||{},e.__SENTRY__.hub=new f),e.__SENTRY__.hub}function y(e,t){return!!e&&(e.__SENTRY__=e.__SENTRY__||{},e.__SENTRY__.hub=t,!0)}},6769:(e,t,n)=>{"use strict";n.d(t,{s:()=>l,c:()=>c});var r=n(655),i=n(7597),o=n(1170),a=n(6893),s=n(2844),l=function(){function e(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._user={},this._tags={},this._extra={},this._contexts={}}return e.clone=function(t){var n=new e;return t&&(n._breadcrumbs=(0,r.fl)(t._breadcrumbs),n._tags=(0,r.pi)({},t._tags),n._extra=(0,r.pi)({},t._extra),n._contexts=(0,r.pi)({},t._contexts),n._user=t._user,n._level=t._level,n._span=t._span,n._session=t._session,n._transactionName=t._transactionName,n._fingerprint=t._fingerprint,n._eventProcessors=(0,r.fl)(t._eventProcessors),n._requestSession=t._requestSession),n},e.prototype.addScopeListener=function(e){this._scopeListeners.push(e)},e.prototype.addEventProcessor=function(e){return this._eventProcessors.push(e),this},e.prototype.setUser=function(e){return this._user=e||{},this._session&&this._session.update({user:e}),this._notifyScopeListeners(),this},e.prototype.getUser=function(){return this._user},e.prototype.getRequestSession=function(){return this._requestSession},e.prototype.setRequestSession=function(e){return this._requestSession=e,this},e.prototype.setTags=function(e){return this._tags=(0,r.pi)((0,r.pi)({},this._tags),e),this._notifyScopeListeners(),this},e.prototype.setTag=function(e,t){var n;return this._tags=(0,r.pi)((0,r.pi)({},this._tags),((n={})[e]=t,n)),this._notifyScopeListeners(),this},e.prototype.setExtras=function(e){return this._extra=(0,r.pi)((0,r.pi)({},this._extra),e),this._notifyScopeListeners(),this},e.prototype.setExtra=function(e,t){var n;return this._extra=(0,r.pi)((0,r.pi)({},this._extra),((n={})[e]=t,n)),this._notifyScopeListeners(),this},e.prototype.setFingerprint=function(e){return this._fingerprint=e,this._notifyScopeListeners(),this},e.prototype.setLevel=function(e){return this._level=e,this._notifyScopeListeners(),this},e.prototype.setTransactionName=function(e){return this._transactionName=e,this._notifyScopeListeners(),this},e.prototype.setTransaction=function(e){return this.setTransactionName(e)},e.prototype.setContext=function(e,t){var n;return null===t?delete this._contexts[e]:this._contexts=(0,r.pi)((0,r.pi)({},this._contexts),((n={})[e]=t,n)),this._notifyScopeListeners(),this},e.prototype.setSpan=function(e){return this._span=e,this._notifyScopeListeners(),this},e.prototype.getSpan=function(){return this._span},e.prototype.getTransaction=function(){var e,t,n,r,i=this.getSpan();return(null===(e=i)||void 0===e?void 0:e.transaction)?null===(t=i)||void 0===t?void 0:t.transaction:(null===(r=null===(n=i)||void 0===n?void 0:n.spanRecorder)||void 0===r?void 0:r.spans[0])?i.spanRecorder.spans[0]:void 0},e.prototype.setSession=function(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this},e.prototype.getSession=function(){return this._session},e.prototype.update=function(t){if(!t)return this;if("function"==typeof t){var n=t(this);return n instanceof e?n:this}return t instanceof e?(this._tags=(0,r.pi)((0,r.pi)({},this._tags),t._tags),this._extra=(0,r.pi)((0,r.pi)({},this._extra),t._extra),this._contexts=(0,r.pi)((0,r.pi)({},this._contexts),t._contexts),t._user&&Object.keys(t._user).length&&(this._user=t._user),t._level&&(this._level=t._level),t._fingerprint&&(this._fingerprint=t._fingerprint),t._requestSession&&(this._requestSession=t._requestSession)):(0,i.PO)(t)&&(t=t,this._tags=(0,r.pi)((0,r.pi)({},this._tags),t.tags),this._extra=(0,r.pi)((0,r.pi)({},this._extra),t.extra),this._contexts=(0,r.pi)((0,r.pi)({},this._contexts),t.contexts),t.user&&(this._user=t.user),t.level&&(this._level=t.level),t.fingerprint&&(this._fingerprint=t.fingerprint),t.requestSession&&(this._requestSession=t.requestSession)),this},e.prototype.clear=function(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this},e.prototype.addBreadcrumb=function(e,t){var n="number"==typeof t?Math.min(t,100):100;if(n<=0)return this;var i=(0,r.pi)({timestamp:(0,o.yW)()},e);return this._breadcrumbs=(0,r.fl)(this._breadcrumbs,[i]).slice(-n),this._notifyScopeListeners(),this},e.prototype.clearBreadcrumbs=function(){return this._breadcrumbs=[],this._notifyScopeListeners(),this},e.prototype.applyToEvent=function(e,t){var n;if(this._extra&&Object.keys(this._extra).length&&(e.extra=(0,r.pi)((0,r.pi)({},this._extra),e.extra)),this._tags&&Object.keys(this._tags).length&&(e.tags=(0,r.pi)((0,r.pi)({},this._tags),e.tags)),this._user&&Object.keys(this._user).length&&(e.user=(0,r.pi)((0,r.pi)({},this._user),e.user)),this._contexts&&Object.keys(this._contexts).length&&(e.contexts=(0,r.pi)((0,r.pi)({},this._contexts),e.contexts)),this._level&&(e.level=this._level),this._transactionName&&(e.transaction=this._transactionName),this._span){e.contexts=(0,r.pi)({trace:this._span.getTraceContext()},e.contexts);var i=null===(n=this._span.transaction)||void 0===n?void 0:n.name;i&&(e.tags=(0,r.pi)({transaction:i},e.tags))}return this._applyFingerprint(e),e.breadcrumbs=(0,r.fl)(e.breadcrumbs||[],this._breadcrumbs),e.breadcrumbs=e.breadcrumbs.length>0?e.breadcrumbs:void 0,this._notifyEventProcessors((0,r.fl)(u(),this._eventProcessors),e,t)},e.prototype._notifyEventProcessors=function(e,t,n,o){var s=this;return void 0===o&&(o=0),new a.c((function(a,l){var u=e[o];if(null===t||"function"!=typeof u)a(t);else{var c=u((0,r.pi)({},t),n);(0,i.J8)(c)?c.then((function(t){return s._notifyEventProcessors(e,t,n,o+1).then(a)})).then(null,l):s._notifyEventProcessors(e,c,n,o+1).then(a).then(null,l)}}))},e.prototype._notifyScopeListeners=function(){var e=this;this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((function(t){t(e)})),this._notifyingListeners=!1)},e.prototype._applyFingerprint=function(e){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],this._fingerprint&&(e.fingerprint=e.fingerprint.concat(this._fingerprint)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint},e}();function u(){var e=(0,s.Rf)();return e.__SENTRY__=e.__SENTRY__||{},e.__SENTRY__.globalEventProcessors=e.__SENTRY__.globalEventProcessors||[],e.__SENTRY__.globalEventProcessors}function c(e){u().push(e)}},1109:(e,t,n)=>{"use strict";n.d(t,{ro:()=>y,lb:()=>g});var r,i=n(655),o=n(2162);!function(e){e.Explicit="explicitly_set",e.Sampler="client_sampler",e.Rate="client_rate",e.Inheritance="inheritance"}(r||(r={}));var a=n(2343),s=n(1422),l=n(9732),u=n(5734),c=n(3233);function d(){var e=(0,c.x1)();e&&(a.k.log("[Tracing] Transaction: "+u.p.InternalError+" -> Global error occured"),e.setStatus(u.p.InternalError))}var f=n(6458),p=n(3391);function h(){var e=this.getScope();if(e){var t=e.getSpan();if(t)return{"sentry-trace":t.toTraceparent()}}return{}}function m(e,t,n){return(0,c.zu)()?void 0!==e.sampled?(e.setMetadata({transactionSampling:{method:r.Explicit}}),e):("function"==typeof t.tracesSampler?(i=t.tracesSampler(n),e.setMetadata({transactionSampling:{method:r.Sampler,rate:Number(i)}})):void 0!==n.parentSampled?(i=n.parentSampled,e.setMetadata({transactionSampling:{method:r.Inheritance}})):(i=t.tracesSampleRate,e.setMetadata({transactionSampling:{method:r.Rate,rate:Number(i)}})),function(e){if(isNaN(e)||"number"!=typeof e&&"boolean"!=typeof e)return a.k.warn("[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got "+JSON.stringify(e)+" of type "+JSON.stringify(typeof e)+"."),!1;if(e<0||e>1)return a.k.warn("[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got "+e+"."),!1;return!0}(i)?i?(e.sampled=Math.random()<i,e.sampled?(a.k.log("[Tracing] starting "+e.op+" transaction - "+e.name),e):(a.k.log("[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = "+Number(i)+")"),e)):(a.k.log("[Tracing] Discarding transaction because "+("function"==typeof t.tracesSampler?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0")),e.sampled=!1,e):(a.k.warn("[Tracing] Discarding transaction because of invalid sample rate."),e.sampled=!1,e)):(e.sampled=!1,e);var i}function v(e,t){var n,r,o=(null===(n=this.getClient())||void 0===n?void 0:n.getOptions())||{},a=new p.Y(e,this);return(a=m(a,o,(0,i.pi)({parentSampled:e.parentSampled,transactionContext:e},t))).sampled&&a.initSpanRecorder(null===(r=o._experiments)||void 0===r?void 0:r.maxSpans),a}function g(e,t,n,r,o){var a,s,l=(null===(a=e.getClient())||void 0===a?void 0:a.getOptions())||{},u=new f.io(t,e,n,r);return(u=m(u,l,(0,i.pi)({parentSampled:t.parentSampled,transactionContext:t},o))).sampled&&u.initSpanRecorder(null===(s=l._experiments)||void 0===s?void 0:s.maxSpans),u}function y(){var t;(t=(0,o.cu)()).__SENTRY__&&(t.__SENTRY__.extensions=t.__SENTRY__.extensions||{},t.__SENTRY__.extensions.startTransaction||(t.__SENTRY__.extensions.startTransaction=v),t.__SENTRY__.extensions.traceHeaders||(t.__SENTRY__.extensions.traceHeaders=h)),(0,s.KV)()&&function(){var t=(0,o.cu)();if(t.__SENTRY__){var n={mongodb:function(){return new((0,s.l$)(e,"./integrations/mongo").Mongo)},mongoose:function(){return new((0,s.l$)(e,"./integrations/mongo").Mongo)({mongoose:!0})},mysql:function(){return new((0,s.l$)(e,"./integrations/mysql").Mysql)},pg:function(){return new((0,s.l$)(e,"./integrations/postgres").Postgres)}},r=Object.keys(n).filter((function(e){return!!(0,s.$y)(e)})).map((function(e){try{return n[e]()}catch(e){return}})).filter((function(e){return e}));r.length>0&&(t.__SENTRY__.integrations=(0,i.fl)(t.__SENTRY__.integrations||[],r))}}(),(0,l.o)({callback:d,type:"error"}),(0,l.o)({callback:d,type:"unhandledrejection"})}e=n.hmd(e)},6458:(e,t,n)=>{"use strict";n.d(t,{nT:()=>u,io:()=>d});var r=n(655),i=n(1170),o=n(2343),a=n(5334),s=n(5734),l=n(3391),u=1e3,c=function(e){function t(t,n,r,i){void 0===r&&(r="");var o=e.call(this,i)||this;return o._pushActivity=t,o._popActivity=n,o.transactionSpanId=r,o}return(0,r.ZT)(t,e),t.prototype.add=function(t){var n=this;t.spanId!==this.transactionSpanId&&(t.finish=function(e){t.endTimestamp="number"==typeof e?e:(0,i._I)(),n._popActivity(t.spanId)},void 0===t.endTimestamp&&this._pushActivity(t.spanId)),e.prototype.add.call(this,t)},t}(a.g),d=function(e){function t(t,n,r,i){void 0===r&&(r=u),void 0===i&&(i=!1);var a=e.call(this,t,n)||this;return a._idleHub=n,a._idleTimeout=r,a._onScope=i,a.activities={},a._heartbeatTimer=0,a._heartbeatCounter=0,a._finished=!1,a._beforeFinishCallbacks=[],n&&i&&(f(n),o.k.log("Setting idle transaction on scope. Span ID: "+a.spanId),n.configureScope((function(e){return e.setSpan(a)}))),a._initTimeout=setTimeout((function(){a._finished||a.finish()}),a._idleTimeout),a}return(0,r.ZT)(t,e),t.prototype.finish=function(t){var n,a,l=this;if(void 0===t&&(t=(0,i._I)()),this._finished=!0,this.activities={},this.spanRecorder){o.k.log("[Tracing] finishing IdleTransaction",new Date(1e3*t).toISOString(),this.op);try{for(var u=(0,r.XA)(this._beforeFinishCallbacks),c=u.next();!c.done;c=u.next()){(0,c.value)(this,t)}}catch(e){n={error:e}}finally{try{c&&!c.done&&(a=u.return)&&a.call(u)}finally{if(n)throw n.error}}this.spanRecorder.spans=this.spanRecorder.spans.filter((function(e){if(e.spanId===l.spanId)return!0;e.endTimestamp||(e.endTimestamp=t,e.setStatus(s.p.Cancelled),o.k.log("[Tracing] cancelling span since transaction ended early",JSON.stringify(e,void 0,2)));var n=e.startTimestamp<t;return n||o.k.log("[Tracing] discarding Span since it happened after Transaction was finished",JSON.stringify(e,void 0,2)),n})),o.k.log("[Tracing] flushing IdleTransaction")}else o.k.log("[Tracing] No active IdleTransaction");return this._onScope&&f(this._idleHub),e.prototype.finish.call(this,t)},t.prototype.registerBeforeFinishCallback=function(e){this._beforeFinishCallbacks.push(e)},t.prototype.initSpanRecorder=function(e){var t=this;if(!this.spanRecorder){this.spanRecorder=new c((function(e){t._finished||t._pushActivity(e)}),(function(e){t._finished||t._popActivity(e)}),this.spanId,e),o.k.log("Starting heartbeat"),this._pingHeartbeat()}this.spanRecorder.add(this)},t.prototype._pushActivity=function(e){this._initTimeout&&(clearTimeout(this._initTimeout),this._initTimeout=void 0),o.k.log("[Tracing] pushActivity: "+e),this.activities[e]=!0,o.k.log("[Tracing] new activities count",Object.keys(this.activities).length)},t.prototype._popActivity=function(e){var t=this;if(this.activities[e]&&(o.k.log("[Tracing] popActivity "+e),delete this.activities[e],o.k.log("[Tracing] new activities count",Object.keys(this.activities).length)),0===Object.keys(this.activities).length){var n=this._idleTimeout,r=(0,i._I)()+n/1e3;setTimeout((function(){t._finished||t.finish(r)}),n)}},t.prototype._beat=function(){if(clearTimeout(this._heartbeatTimer),!this._finished){var e=Object.keys(this.activities),t=e.length?e.reduce((function(e,t){return e+t})):"";t===this._prevHeartbeatString?this._heartbeatCounter+=1:this._heartbeatCounter=1,this._prevHeartbeatString=t,this._heartbeatCounter>=3?(o.k.log("[Tracing] Transaction finished because of no change for 3 heart beats"),this.setStatus(s.p.DeadlineExceeded),this.setTag("heartbeat","failed"),this.finish()):this._pingHeartbeat()}},t.prototype._pingHeartbeat=function(){var e=this;o.k.log("pinging Heartbeat -> current counter: "+this._heartbeatCounter),this._heartbeatTimer=setTimeout((function(){e._beat()}),5e3)},t}(l.Y);function f(e){if(e){var t=e.getScope();if(t)t.getTransaction()&&t.setSpan(void 0)}}},5334:(e,t,n)=>{"use strict";n.d(t,{g:()=>l,D:()=>u});var r=n(655),i=n(2844),o=n(1170),a=n(2470),s=n(5734),l=function(){function e(e){void 0===e&&(e=1e3),this.spans=[],this._maxlen=e}return e.prototype.add=function(e){this.spans.length>this._maxlen?e.spanRecorder=void 0:this.spans.push(e)},e}(),u=function(){function e(e){if(this.traceId=(0,i.DM)(),this.spanId=(0,i.DM)().substring(16),this.startTimestamp=(0,o._I)(),this.tags={},this.data={},!e)return this;e.traceId&&(this.traceId=e.traceId),e.spanId&&(this.spanId=e.spanId),e.parentSpanId&&(this.parentSpanId=e.parentSpanId),"sampled"in e&&(this.sampled=e.sampled),e.op&&(this.op=e.op),e.description&&(this.description=e.description),e.data&&(this.data=e.data),e.tags&&(this.tags=e.tags),e.status&&(this.status=e.status),e.startTimestamp&&(this.startTimestamp=e.startTimestamp),e.endTimestamp&&(this.endTimestamp=e.endTimestamp)}return e.prototype.child=function(e){return this.startChild(e)},e.prototype.startChild=function(t){var n=new e((0,r.pi)((0,r.pi)({},t),{parentSpanId:this.spanId,sampled:this.sampled,traceId:this.traceId}));return n.spanRecorder=this.spanRecorder,n.spanRecorder&&n.spanRecorder.add(n),n.transaction=this.transaction,n},e.prototype.setTag=function(e,t){var n;return this.tags=(0,r.pi)((0,r.pi)({},this.tags),((n={})[e]=t,n)),this},e.prototype.setData=function(e,t){var n;return this.data=(0,r.pi)((0,r.pi)({},this.data),((n={})[e]=t,n)),this},e.prototype.setStatus=function(e){return this.status=e,this},e.prototype.setHttpStatus=function(e){this.setTag("http.status_code",String(e));var t=s.p.fromHttpCode(e);return t!==s.p.UnknownError&&this.setStatus(t),this},e.prototype.isSuccess=function(){return this.status===s.p.Ok},e.prototype.finish=function(e){this.endTimestamp="number"==typeof e?e:(0,o._I)()},e.prototype.toTraceparent=function(){var e="";return void 0!==this.sampled&&(e=this.sampled?"-1":"-0"),this.traceId+"-"+this.spanId+e},e.prototype.toContext=function(){return(0,a.Jr)({data:this.data,description:this.description,endTimestamp:this.endTimestamp,op:this.op,parentSpanId:this.parentSpanId,sampled:this.sampled,spanId:this.spanId,startTimestamp:this.startTimestamp,status:this.status,tags:this.tags,traceId:this.traceId})},e.prototype.updateWithContext=function(e){var t,n,r,i,o;return this.data=null!=(t=e.data)?t:{},this.description=e.description,this.endTimestamp=e.endTimestamp,this.op=e.op,this.parentSpanId=e.parentSpanId,this.sampled=e.sampled,this.spanId=null!=(n=e.spanId)?n:this.spanId,this.startTimestamp=null!=(r=e.startTimestamp)?r:this.startTimestamp,this.status=e.status,this.tags=null!=(i=e.tags)?i:{},this.traceId=null!=(o=e.traceId)?o:this.traceId,this},e.prototype.getTraceContext=function(){return(0,a.Jr)({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,trace_id:this.traceId})},e.prototype.toJSON=function(){return(0,a.Jr)({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,start_timestamp:this.startTimestamp,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,timestamp:this.endTimestamp,trace_id:this.traceId})},e}()},5734:(e,t,n)=>{"use strict";var r;n.d(t,{p:()=>r}),function(e){e.Ok="ok",e.DeadlineExceeded="deadline_exceeded",e.Unauthenticated="unauthenticated",e.PermissionDenied="permission_denied",e.NotFound="not_found",e.ResourceExhausted="resource_exhausted",e.InvalidArgument="invalid_argument",e.Unimplemented="unimplemented",e.Unavailable="unavailable",e.InternalError="internal_error",e.UnknownError="unknown_error",e.Cancelled="cancelled",e.AlreadyExists="already_exists",e.FailedPrecondition="failed_precondition",e.Aborted="aborted",e.OutOfRange="out_of_range",e.DataLoss="data_loss"}(r||(r={})),function(e){e.fromHttpCode=function(t){if(t<400)return e.Ok;if(t>=400&&t<500)switch(t){case 401:return e.Unauthenticated;case 403:return e.PermissionDenied;case 404:return e.NotFound;case 409:return e.AlreadyExists;case 413:return e.FailedPrecondition;case 429:return e.ResourceExhausted;default:return e.InvalidArgument}if(t>=500&&t<600)switch(t){case 501:return e.Unimplemented;case 503:return e.Unavailable;case 504:return e.DeadlineExceeded;default:return e.InternalError}return e.UnknownError}}(r||(r={}))},3391:(e,t,n)=>{"use strict";n.d(t,{Y:()=>u});var r=n(655),i=n(2162),o=n(7597),a=n(2343),s=n(2470),l=n(5334),u=function(e){function t(t,n){var r=e.call(this,t)||this;return r._measurements={},r._hub=(0,i.Gd)(),(0,o.V9)(n,i.Xb)&&(r._hub=n),r.name=t.name||"",r.metadata=t.metadata||{},r._trimEnd=t.trimEnd,r.transaction=r,r}return(0,r.ZT)(t,e),t.prototype.setName=function(e){this.name=e},t.prototype.initSpanRecorder=function(e){void 0===e&&(e=1e3),this.spanRecorder||(this.spanRecorder=new l.g(e)),this.spanRecorder.add(this)},t.prototype.setMeasurements=function(e){this._measurements=(0,r.pi)({},e)},t.prototype.setMetadata=function(e){this.metadata=(0,r.pi)((0,r.pi)({},this.metadata),e)},t.prototype.finish=function(t){var n=this;if(void 0===this.endTimestamp){if(this.name||(a.k.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this.name="<unlabeled transaction>"),e.prototype.finish.call(this,t),!0===this.sampled){var r=this.spanRecorder?this.spanRecorder.spans.filter((function(e){return e!==n&&e.endTimestamp})):[];this._trimEnd&&r.length>0&&(this.endTimestamp=r.reduce((function(e,t){return e.endTimestamp&&t.endTimestamp?e.endTimestamp>t.endTimestamp?e:t:e})).endTimestamp);var i={contexts:{trace:this.getTraceContext()},spans:r,start_timestamp:this.startTimestamp,tags:this.tags,timestamp:this.endTimestamp,transaction:this.name,type:"transaction",debug_meta:this.metadata};return Object.keys(this._measurements).length>0&&(a.k.log("[Measurements] Adding measurements to transaction",JSON.stringify(this._measurements,void 0,2)),i.measurements=this._measurements),a.k.log("[Tracing] Finishing "+this.op+" transaction: "+this.name+"."),this._hub.captureEvent(i)}a.k.log("[Tracing] Discarding transaction because its trace was not chosen to be sampled.")}},t.prototype.toContext=function(){var t=e.prototype.toContext.call(this);return(0,s.Jr)((0,r.pi)((0,r.pi)({},t),{name:this.name,trimEnd:this._trimEnd}))},t.prototype.updateWithContext=function(t){var n;return e.prototype.updateWithContext.call(this,t),this.name=null!=(n=t.name)?n:"",this._trimEnd=t.trimEnd,this},t}(l.D)},3233:(e,t,n)=>{"use strict";n.d(t,{zu:()=>o,qG:()=>a,x1:()=>s,XL:()=>l,WB:()=>u});var r=n(2162),i=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function o(e){var t;return void 0===e&&(e=null===(t=(0,r.Gd)().getClient())||void 0===t?void 0:t.getOptions()),!!e&&("tracesSampleRate"in e||"tracesSampler"in e)}function a(e){var t=e.match(i);if(t){var n=void 0;return"1"===t[3]?n=!0:"0"===t[3]&&(n=!1),{traceId:t[1],parentSampled:n,parentSpanId:t[2]}}}function s(e){var t,n;return void 0===e&&(e=(0,r.Gd)()),null===(n=null===(t=e)||void 0===t?void 0:t.getScope())||void 0===n?void 0:n.getTransaction()}function l(e){return e/1e3}function u(e){return 1e3*e}},7199:(e,t,n)=>{"use strict";var r,i;n.d(t,{$:()=>r}),function(e){e.Ok="ok",e.Exited="exited",e.Crashed="crashed",e.Abnormal="abnormal"}(r||(r={})),function(e){e.Ok="ok",e.Errored="errored",e.Crashed="crashed"}(i||(i={}))},8464:(e,t,n)=>{"use strict";n.d(t,{R:()=>i});var r=n(7597);function i(e,t){try{for(var n=e,r=[],i=0,a=0,s=" > ".length,l=void 0;n&&i++<5&&!("html"===(l=o(n,t))||i>1&&a+r.length*s+l.length>=80);)r.push(l),a+=l.length,n=n.parentNode;return r.reverse().join(" > ")}catch(e){return"<unknown>"}}function o(e,t){var n,i,o,a,s,l,u,c=e,d=[];if(!c||!c.tagName)return"";d.push(c.tagName.toLowerCase());var f=(null===(n=t)||void 0===n?void 0:n.length)?t.filter((function(e){return c.getAttribute(e)})).map((function(e){return[e,c.getAttribute(e)]})):null;if(null===(i=f)||void 0===i?void 0:i.length)f.forEach((function(e){d.push("["+e[0]+'="'+e[1]+'"]')}));else if(c.id&&d.push("#"+c.id),(o=c.className)&&(0,r.HD)(o))for(a=o.split(/\s+/),u=0;u<a.length;u++)d.push("."+a[u]);var p=["type","name","title","alt"];for(u=0;u<p.length;u++)s=p[u],(l=c.getAttribute(s))&&d.push("["+s+'="'+l+'"]');return d.join("")}},9732:(e,t,n)=>{"use strict";n.d(t,{o:()=>m});var r,i=n(655),o=n(7597),a=n(2343),s=n(2844),l=n(2470),u=n(360),c=n(8823),d=(0,s.Rf)(),f={},p={};function h(e){if(!p[e])switch(p[e]=!0,e){case"console":!function(){if(!("console"in d))return;["debug","info","warn","error","log","assert"].forEach((function(e){e in d.console&&(0,l.hl)(d.console,e,(function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];v("console",{args:n,level:e}),t&&Function.prototype.apply.call(t,d.console,n)}}))}))}();break;case"dom":!function(){if(!("document"in d))return;var e=v.bind(null,"dom"),t=x(e,!0);d.document.addEventListener("click",t,!1),d.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach((function(t){var n=d[t]&&d[t].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&((0,l.hl)(n,"addEventListener",(function(t){return function(n,r,i){if("click"===n||"keypress"==n)try{var o=this,a=o.__sentry_instrumentation_handlers__=o.__sentry_instrumentation_handlers__||{},s=a[n]=a[n]||{refCount:0};if(!s.handler){var l=x(e);s.handler=l,t.call(this,n,l,i)}s.refCount+=1}catch(e){}return t.call(this,n,r,i)}})),(0,l.hl)(n,"removeEventListener",(function(e){return function(t,n,r){if("click"===t||"keypress"==t)try{var i=this,o=i.__sentry_instrumentation_handlers__||{},a=o[t];a&&(a.refCount-=1,a.refCount<=0&&(e.call(this,t,a.handler,r),a.handler=void 0,delete o[t]),0===Object.keys(o).length&&delete i.__sentry_instrumentation_handlers__)}catch(e){}return e.call(this,t,n,r)}})))}))}();break;case"xhr":!function(){if(!("XMLHttpRequest"in d))return;var e=[],t=[],n=XMLHttpRequest.prototype;(0,l.hl)(n,"open",(function(n){return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var a=this,s=r[1];a.__sentry_xhr__={method:(0,o.HD)(r[0])?r[0].toUpperCase():r[0],url:r[1]},(0,o.HD)(s)&&"POST"===a.__sentry_xhr__.method&&s.match(/sentry_key/)&&(a.__sentry_own_request__=!0);var u=function(){if(4===a.readyState){try{a.__sentry_xhr__&&(a.__sentry_xhr__.status_code=a.status)}catch(e){}try{var n=e.indexOf(a);if(-1!==n){e.splice(n);var i=t.splice(n)[0];a.__sentry_xhr__&&void 0!==i[0]&&(a.__sentry_xhr__.body=i[0])}}catch(e){}v("xhr",{args:r,endTimestamp:Date.now(),startTimestamp:Date.now(),xhr:a})}};return"onreadystatechange"in a&&"function"==typeof a.onreadystatechange?(0,l.hl)(a,"onreadystatechange",(function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return u(),e.apply(a,t)}})):a.addEventListener("readystatechange",u),n.apply(a,r)}})),(0,l.hl)(n,"send",(function(n){return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return e.push(this),t.push(r),v("xhr",{args:r,startTimestamp:Date.now(),xhr:this}),n.apply(this,r)}}))}();break;case"fetch":!function(){if(!(0,c.t$)())return;(0,l.hl)(d,"fetch",(function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r={args:t,fetchData:{method:g(t),url:y(t)},startTimestamp:Date.now()};return v("fetch",(0,i.pi)({},r)),e.apply(d,t).then((function(e){return v("fetch",(0,i.pi)((0,i.pi)({},r),{endTimestamp:Date.now(),response:e})),e}),(function(e){throw v("fetch",(0,i.pi)((0,i.pi)({},r),{endTimestamp:Date.now(),error:e})),e}))}}))}();break;case"history":!function(){if(!(0,c.Bf)())return;var e=d.onpopstate;function t(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var i=t.length>2?t[2]:void 0;if(i){var o=r,a=String(i);r=a,v("history",{from:o,to:a})}return e.apply(this,t)}}d.onpopstate=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var i=d.location.href,o=r;if(r=i,v("history",{from:o,to:i}),e)try{return e.apply(this,t)}catch(e){}},(0,l.hl)(d.history,"pushState",t),(0,l.hl)(d.history,"replaceState",t)}();break;case"error":k=d.onerror,d.onerror=function(e,t,n,r,i){return v("error",{column:r,error:i,line:n,msg:e,url:t}),!!k&&k.apply(this,arguments)};break;case"unhandledrejection":S=d.onunhandledrejection,d.onunhandledrejection=function(e){return v("unhandledrejection",e),!S||S.apply(this,arguments)};break;default:a.k.warn("unknown instrumentation type:",e)}}function m(e){e&&"string"==typeof e.type&&"function"==typeof e.callback&&(f[e.type]=f[e.type]||[],f[e.type].push(e.callback),h(e.type))}function v(e,t){var n,r;if(e&&f[e])try{for(var o=(0,i.XA)(f[e]||[]),s=o.next();!s.done;s=o.next()){var l=s.value;try{l(t)}catch(t){a.k.error("Error while triggering instrumentation handler.\nType: "+e+"\nName: "+(0,u.$)(l)+"\nError: "+t)}}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}function g(e){return void 0===e&&(e=[]),"Request"in d&&(0,o.V9)(e[0],Request)&&e[0].method?String(e[0].method).toUpperCase():e[1]&&e[1].method?String(e[1].method).toUpperCase():"GET"}function y(e){return void 0===e&&(e=[]),"string"==typeof e[0]?e[0]:"Request"in d&&(0,o.V9)(e[0],Request)?e[0].url:String(e[0])}var b,w;function x(e,t){return void 0===t&&(t=!1),function(n){if(n&&w!==n&&!function(e){if("keypress"!==e.type)return!1;try{var t=e.target;if(!t||!t.tagName)return!0;if("INPUT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable)return!1}catch(e){}return!0}(n)){var r="keypress"===n.type?"input":n.type;(void 0===b||function(e,t){if(!e)return!0;if(e.type!==t.type)return!0;try{if(e.target!==t.target)return!0}catch(e){}return!1}(w,n))&&(e({event:n,name:r,global:t}),w=n),clearTimeout(b),b=d.setTimeout((function(){b=void 0}),1e3)}}}var k=null;var S=null},7597:(e,t,n)=>{"use strict";function r(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return m(e,Error)}}function i(e){return"[object ErrorEvent]"===Object.prototype.toString.call(e)}function o(e){return"[object DOMError]"===Object.prototype.toString.call(e)}function a(e){return"[object DOMException]"===Object.prototype.toString.call(e)}function s(e){return"[object String]"===Object.prototype.toString.call(e)}function l(e){return null===e||"object"!=typeof e&&"function"!=typeof e}function u(e){return"[object Object]"===Object.prototype.toString.call(e)}function c(e){return"undefined"!=typeof Event&&m(e,Event)}function d(e){return"undefined"!=typeof Element&&m(e,Element)}function f(e){return"[object RegExp]"===Object.prototype.toString.call(e)}function p(e){return Boolean(e&&e.then&&"function"==typeof e.then)}function h(e){return u(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function m(e,t){try{return e instanceof t}catch(e){return!1}}n.d(t,{VZ:()=>r,VW:()=>i,TX:()=>o,fm:()=>a,HD:()=>s,pt:()=>l,PO:()=>u,cO:()=>c,kK:()=>d,Kj:()=>f,J8:()=>p,Cy:()=>h,V9:()=>m})},2343:(e,t,n)=>{"use strict";n.d(t,{k:()=>s});var r=n(2844),i=(0,r.Rf)(),o="Sentry Logger ",a=function(){function e(){this._enabled=!1}return e.prototype.disable=function(){this._enabled=!1},e.prototype.enable=function(){this._enabled=!0},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._enabled&&(0,r.Cf)((function(){i.console.log(o+"[Log]: "+e.join(" "))}))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._enabled&&(0,r.Cf)((function(){i.console.warn(o+"[Warn]: "+e.join(" "))}))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._enabled&&(0,r.Cf)((function(){i.console.error(o+"[Error]: "+e.join(" "))}))},e}();i.__SENTRY__=i.__SENTRY__||{};var s=i.__SENTRY__.logger||(i.__SENTRY__.logger=new a)},2844:(e,t,n)=>{"use strict";n.d(t,{Rf:()=>o,DM:()=>a,en:()=>s,jH:()=>l,Cf:()=>u,Db:()=>c,EG:()=>d,l4:()=>f,JY:()=>p});var r=n(1422),i={};function o(){return(0,r.KV)()?n.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:i}function a(){var e=o(),t=e.crypto||e.msCrypto;if(void 0!==t&&t.getRandomValues){var n=new Uint16Array(8);t.getRandomValues(n),n[3]=4095&n[3]|16384,n[4]=16383&n[4]|32768;var r=function(e){for(var t=e.toString(16);t.length<4;)t="0"+t;return t};return r(n[0])+r(n[1])+r(n[2])+r(n[3])+r(n[4])+r(n[5])+r(n[6])+r(n[7])}return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}function s(e){if(!e)return{};var t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};var n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],relative:t[5]+n+r}}function l(e){if(e.message)return e.message;if(e.exception&&e.exception.values&&e.exception.values[0]){var t=e.exception.values[0];return t.type&&t.value?t.type+": "+t.value:t.type||t.value||e.event_id||"<unknown>"}return e.event_id||"<unknown>"}function u(e){var t=o();if(!("console"in t))return e();var n=t.console,r={};["debug","info","warn","error","log","assert"].forEach((function(e){e in t.console&&n[e].__sentry_original__&&(r[e]=n[e],n[e]=n[e].__sentry_original__)}));var i=e();return Object.keys(r).forEach((function(e){n[e]=r[e]})),i}function c(e,t,n){e.exception=e.exception||{},e.exception.values=e.exception.values||[],e.exception.values[0]=e.exception.values[0]||{},e.exception.values[0].value=e.exception.values[0].value||t||"",e.exception.values[0].type=e.exception.values[0].type||n||"Error"}function d(e,t){void 0===t&&(t={});try{e.exception.values[0].mechanism=e.exception.values[0].mechanism||{},Object.keys(t).forEach((function(n){e.exception.values[0].mechanism[n]=t[n]}))}catch(e){}}function f(){try{return document.location.href}catch(e){return""}}function p(e,t){if(!t)return 6e4;var n=parseInt(""+t,10);if(!isNaN(n))return 1e3*n;var r=Date.parse(""+t);return isNaN(r)?6e4:r-e}},1422:(e,t,n)=>{"use strict";function r(){return"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)}function i(e,t){return e.require(t)}function o(t){var n;try{n=i(e,t)}catch(e){}try{var r=i(e,"process").cwd;n=i(e,r()+"/node_modules/"+t)}catch(e){}return n}n.d(t,{KV:()=>r,l$:()=>i,$y:()=>o}),e=n.hmd(e)},2470:(e,t,n)=>{"use strict";n.d(t,{Jr:()=>y,zf:()=>g,hl:()=>u,Fv:()=>v,Qy:()=>p,_j:()=>c});var r=n(655),i=n(8464),o=n(7597),a=function(){function e(){this._hasWeakSet="function"==typeof WeakSet,this._inner=this._hasWeakSet?new WeakSet:[]}return e.prototype.memoize=function(e){if(this._hasWeakSet)return!!this._inner.has(e)||(this._inner.add(e),!1);for(var t=0;t<this._inner.length;t++){if(this._inner[t]===e)return!0}return this._inner.push(e),!1},e.prototype.unmemoize=function(e){if(this._hasWeakSet)this._inner.delete(e);else for(var t=0;t<this._inner.length;t++)if(this._inner[t]===e){this._inner.splice(t,1);break}},e}(),s=n(360),l=n(7321);function u(e,t,n){if(t in e){var r=e[t],i=n(r);if("function"==typeof i)try{i.prototype=i.prototype||{},Object.defineProperties(i,{__sentry_original__:{enumerable:!1,value:r}})}catch(e){}e[t]=i}}function c(e){return Object.keys(e).map((function(t){return encodeURIComponent(t)+"="+encodeURIComponent(e[t])})).join("&")}function d(e){if((0,o.VZ)(e)){var t=e,n={message:t.message,name:t.name,stack:t.stack};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}if((0,o.cO)(e)){var a=e,s={};s.type=a.type;try{s.target=(0,o.kK)(a.target)?(0,i.R)(a.target):Object.prototype.toString.call(a.target)}catch(e){s.target="<unknown>"}try{s.currentTarget=(0,o.kK)(a.currentTarget)?(0,i.R)(a.currentTarget):Object.prototype.toString.call(a.currentTarget)}catch(e){s.currentTarget="<unknown>"}for(var r in"undefined"!=typeof CustomEvent&&(0,o.V9)(e,CustomEvent)&&(s.detail=a.detail),a)Object.prototype.hasOwnProperty.call(a,r)&&(s[r]=a);return s}return e}function f(e){return function(e){return~-encodeURI(e).split(/%..|./).length}(JSON.stringify(e))}function p(e,t,n){void 0===t&&(t=3),void 0===n&&(n=102400);var r=v(e,t);return f(r)>n?p(e,t-1,n):r}function h(e,t){return"domain"===t&&e&&"object"==typeof e&&e._events?"[Domain]":"domainEmitter"===t?"[DomainEmitter]":void 0!==n.g&&e===n.g?"[Global]":"undefined"!=typeof window&&e===window?"[Window]":"undefined"!=typeof document&&e===document?"[Document]":(0,o.Cy)(e)?"[SyntheticEvent]":"number"==typeof e&&e!=e?"[NaN]":void 0===e?"[undefined]":"function"==typeof e?"[Function: "+(0,s.$)(e)+"]":"symbol"==typeof e?"["+String(e)+"]":"bigint"==typeof e?"[BigInt: "+String(e)+"]":e}function m(e,t,n,r){if(void 0===n&&(n=1/0),void 0===r&&(r=new a),0===n)return function(e){var t=Object.prototype.toString.call(e);if("string"==typeof e)return e;if("[object Object]"===t)return"[Object]";if("[object Array]"===t)return"[Array]";var n=h(e);return(0,o.pt)(n)?n:t}(t);if(null!=t&&"function"==typeof t.toJSON)return t.toJSON();var i=h(t,e);if((0,o.pt)(i))return i;var s=d(t),l=Array.isArray(t)?[]:{};if(r.memoize(t))return"[Circular ~]";for(var u in s)Object.prototype.hasOwnProperty.call(s,u)&&(l[u]=m(u,s[u],n-1,r));return r.unmemoize(t),l}function v(e,t){try{return JSON.parse(JSON.stringify(e,(function(e,n){return m(e,n,t)})))}catch(e){return"**non-serializable**"}}function g(e,t){void 0===t&&(t=40);var n=Object.keys(d(e));if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=t)return(0,l.$G)(n[0],t);for(var r=n.length;r>0;r--){var i=n.slice(0,r).join(", ");if(!(i.length>t))return r===n.length?i:(0,l.$G)(i,t)}return""}function y(e){var t,n;if((0,o.PO)(e)){var i=e,a={};try{for(var s=(0,r.XA)(Object.keys(i)),l=s.next();!l.done;l=s.next()){var u=l.value;void 0!==i[u]&&(a[u]=y(i[u]))}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return a}return Array.isArray(e)?e.map(y):e}},360:(e,t,n)=>{"use strict";n.d(t,{$:()=>i});var r="<anonymous>";function i(e){try{return e&&"function"==typeof e&&e.name||r}catch(e){return r}}},7321:(e,t,n)=>{"use strict";n.d(t,{$G:()=>i,nK:()=>o,zC:()=>a});var r=n(7597);function i(e,t){return void 0===t&&(t=0),"string"!=typeof e||0===t||e.length<=t?e:e.substr(0,t)+"..."}function o(e,t){if(!Array.isArray(e))return"";for(var n=[],r=0;r<e.length;r++){var i=e[r];try{n.push(String(i))}catch(e){n.push("[value cannot be serialized]")}}return n.join(t)}function a(e,t){return!!(0,r.HD)(e)&&((0,r.Kj)(t)?t.test(e):"string"==typeof t&&-1!==e.indexOf(t))}},8823:(e,t,n)=>{"use strict";n.d(t,{Ak:()=>o,Du:()=>a,t$:()=>s,hv:()=>l,Bf:()=>u});var r=n(2343),i=n(2844);function o(){if(!("fetch"in(0,i.Rf)()))return!1;try{return new Headers,new Request(""),new Response,!0}catch(e){return!1}}function a(e){return e&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function s(){if(!o())return!1;var e=(0,i.Rf)();if(a(e.fetch))return!0;var t=!1,n=e.document;if(n&&"function"==typeof n.createElement)try{var s=n.createElement("iframe");s.hidden=!0,n.head.appendChild(s),s.contentWindow&&s.contentWindow.fetch&&(t=a(s.contentWindow.fetch)),n.head.removeChild(s)}catch(e){r.k.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return t}function l(){if(!o())return!1;try{return new Request("_",{referrerPolicy:"origin"}),!0}catch(e){return!1}}function u(){var e=(0,i.Rf)(),t=e.chrome,n=t&&t.app&&t.app.runtime,r="history"in e&&!!e.history.pushState&&!!e.history.replaceState;return!n&&r}},6893:(e,t,n)=>{"use strict";n.d(t,{c:()=>o});var r,i=n(7597);!function(e){e.PENDING="PENDING",e.RESOLVED="RESOLVED",e.REJECTED="REJECTED"}(r||(r={}));var o=function(){function e(e){var t=this;this._state=r.PENDING,this._handlers=[],this._resolve=function(e){t._setResult(r.RESOLVED,e)},this._reject=function(e){t._setResult(r.REJECTED,e)},this._setResult=function(e,n){t._state===r.PENDING&&((0,i.J8)(n)?n.then(t._resolve,t._reject):(t._state=e,t._value=n,t._executeHandlers()))},this._attachHandler=function(e){t._handlers=t._handlers.concat(e),t._executeHandlers()},this._executeHandlers=function(){if(t._state!==r.PENDING){var e=t._handlers.slice();t._handlers=[],e.forEach((function(e){e.done||(t._state===r.RESOLVED&&e.onfulfilled&&e.onfulfilled(t._value),t._state===r.REJECTED&&e.onrejected&&e.onrejected(t._value),e.done=!0)}))}};try{e(this._resolve,this._reject)}catch(e){this._reject(e)}}return e.resolve=function(t){return new e((function(e){e(t)}))},e.reject=function(t){return new e((function(e,n){n(t)}))},e.all=function(t){return new e((function(n,r){if(Array.isArray(t))if(0!==t.length){var i=t.length,o=[];t.forEach((function(t,a){e.resolve(t).then((function(e){o[a]=e,0===(i-=1)&&n(o)})).then(null,r)}))}else n([]);else r(new TypeError("Promise.all requires an array as input."))}))},e.prototype.then=function(t,n){var r=this;return new e((function(e,i){r._attachHandler({done:!1,onfulfilled:function(n){if(t)try{return void e(t(n))}catch(e){return void i(e)}else e(n)},onrejected:function(t){if(n)try{return void e(n(t))}catch(e){return void i(e)}else i(t)}})}))},e.prototype.catch=function(e){return this.then((function(e){return e}),e)},e.prototype.finally=function(t){var n=this;return new e((function(e,r){var i,o;return n.then((function(e){o=!1,i=e,t&&t()}),(function(e){o=!0,i=e,t&&t()})).then((function(){o?r(i):e(i)}))}))},e.prototype.toString=function(){return"[object SyncPromise]"},e}()},1170:(e,t,n)=>{"use strict";n.d(t,{yW:()=>l,ph:()=>u,_I:()=>c,Z1:()=>d});var r=n(2844),i=n(1422);e=n.hmd(e);var o={nowSeconds:function(){return Date.now()/1e3}};var a=(0,i.KV)()?function(){try{return(0,i.l$)(e,"perf_hooks").performance}catch(e){return}}():function(){var e=(0,r.Rf)().performance;if(e&&e.now)return{now:function(){return e.now()},timeOrigin:Date.now()-e.now()}}(),s=void 0===a?o:{nowSeconds:function(){return(a.timeOrigin+a.now())/1e3}},l=o.nowSeconds.bind(o),u=s.nowSeconds.bind(s),c=u,d=function(){var e=(0,r.Rf)().performance;if(e&&e.now){var t=36e5,n=e.now(),i=Date.now(),o=e.timeOrigin?Math.abs(e.timeOrigin+n-i):t,a=o<t,s=e.timing&&e.timing.navigationStart,l="number"==typeof s?Math.abs(s+n-i):t;return a||l<t?o<=l?("timeOrigin",e.timeOrigin):("navigationStart",s):("dateNow",i)}"none"}()},5792:function(e){e.exports=function(){"use strict";for(var e=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e<t?t:e>n?n:e},t=function(t){t._clipped=!1,t._unclipped=t.slice(0);for(var n=0;n<=3;n++)n<3?((t[n]<0||t[n]>255)&&(t._clipped=!0),t[n]=e(t[n],0,255)):3===n&&(t[n]=e(t[n],0,1));return t},n={},r=0,i=["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"];r<i.length;r+=1){var o=i[r];n["[object "+o+"]"]=o.toLowerCase()}var a=function(e){return n[Object.prototype.toString.call(e)]||"object"},s=function(e,t){return void 0===t&&(t=null),e.length>=3?Array.prototype.slice.call(e):"object"==a(e[0])&&t?t.split("").filter((function(t){return void 0!==e[0][t]})).map((function(t){return e[0][t]})):e[0]},l=function(e){if(e.length<2)return null;var t=e.length-1;return"string"==a(e[t])?e[t].toLowerCase():null},u=Math.PI,c={clip_rgb:t,limit:e,type:a,unpack:s,last:l,PI:u,TWOPI:2*u,PITHIRD:u/3,DEG2RAD:u/180,RAD2DEG:180/u},d={format:{},autodetect:[]},f=c.last,p=c.clip_rgb,h=c.type,m=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=this;if("object"===h(e[0])&&e[0].constructor&&e[0].constructor===this.constructor)return e[0];var r=f(e),i=!1;if(!r){i=!0,d.sorted||(d.autodetect=d.autodetect.sort((function(e,t){return t.p-e.p})),d.sorted=!0);for(var o=0,a=d.autodetect;o<a.length;o+=1){var s=a[o];if(r=s.test.apply(s,e))break}}if(!d.format[r])throw new Error("unknown format: "+e);var l=d.format[r].apply(null,i?e:e.slice(0,-1));n._rgb=p(l),3===n._rgb.length&&n._rgb.push(1)};m.prototype.toString=function(){return"function"==h(this.hex)?this.hex():"["+this._rgb.join(",")+"]"};var v=m,g=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(g.Color,[null].concat(e)))};g.Color=v,g.version="2.1.1";var y=g,b=c.unpack,w=Math.max,x=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=b(e,"rgb"),r=n[0],i=n[1],o=n[2],a=1-w(r/=255,w(i/=255,o/=255)),s=a<1?1/(1-a):0;return[(1-r-a)*s,(1-i-a)*s,(1-o-a)*s,a]},k=c.unpack,S=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=(e=k(e,"cmyk"))[0],r=e[1],i=e[2],o=e[3],a=e.length>4?e[4]:1;return 1===o?[0,0,0,a]:[n>=1?0:255*(1-n)*(1-o),r>=1?0:255*(1-r)*(1-o),i>=1?0:255*(1-i)*(1-o),a]},C=c.unpack,_=c.type;v.prototype.cmyk=function(){return x(this._rgb)},y.cmyk=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(v,[null].concat(e,["cmyk"])))},d.format.cmyk=S,d.autodetect.push({p:2,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=C(e,"cmyk"),"array"===_(e)&&4===e.length)return"cmyk"}});var E=c.unpack,T=c.last,j=function(e){return Math.round(100*e)/100},O=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=E(e,"hsla"),r=T(e)||"lsa";return n[0]=j(n[0]||0),n[1]=j(100*n[1])+"%",n[2]=j(100*n[2])+"%","hsla"===r||n.length>3&&n[3]<1?(n[3]=n.length>3?n[3]:1,r="hsla"):n.length=3,r+"("+n.join(",")+")"},N=c.unpack,M=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=(e=N(e,"rgba"))[0],r=e[1],i=e[2];n/=255,r/=255,i/=255;var o,a,s=Math.min(n,r,i),l=Math.max(n,r,i),u=(l+s)/2;return l===s?(o=0,a=Number.NaN):o=u<.5?(l-s)/(l+s):(l-s)/(2-l-s),n==l?a=(r-i)/(l-s):r==l?a=2+(i-n)/(l-s):i==l&&(a=4+(n-r)/(l-s)),(a*=60)<0&&(a+=360),e.length>3&&void 0!==e[3]?[a,o,u,e[3]]:[a,o,u]},L=c.unpack,P=c.last,A=Math.round,D=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=L(e,"rgba"),r=P(e)||"rgb";return"hsl"==r.substr(0,3)?O(M(n),r):(n[0]=A(n[0]),n[1]=A(n[1]),n[2]=A(n[2]),("rgba"===r||n.length>3&&n[3]<1)&&(n[3]=n.length>3?n[3]:1,r="rgba"),r+"("+n.slice(0,"rgb"===r?3:4).join(",")+")")},R=c.unpack,I=Math.round,F=function(){for(var e,t=[],n=arguments.length;n--;)t[n]=arguments[n];var r,i,o,a=(t=R(t,"hsl"))[0],s=t[1],l=t[2];if(0===s)r=i=o=255*l;else{var u=[0,0,0],c=[0,0,0],d=l<.5?l*(1+s):l+s-l*s,f=2*l-d,p=a/360;u[0]=p+1/3,u[1]=p,u[2]=p-1/3;for(var h=0;h<3;h++)u[h]<0&&(u[h]+=1),u[h]>1&&(u[h]-=1),6*u[h]<1?c[h]=f+6*(d-f)*u[h]:2*u[h]<1?c[h]=d:3*u[h]<2?c[h]=f+(d-f)*(2/3-u[h])*6:c[h]=f;r=(e=[I(255*c[0]),I(255*c[1]),I(255*c[2])])[0],i=e[1],o=e[2]}return t.length>3?[r,i,o,t[3]]:[r,i,o,1]},z=/^rgb\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*\)$/,H=/^rgba\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*,\s*([01]|[01]?\.\d+)\)$/,U=/^rgb\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,B=/^rgba\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,W=/^hsl\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,$=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,V=Math.round,q=function(e){var t;if(e=e.toLowerCase().trim(),d.format.named)try{return d.format.named(e)}catch(e){}if(t=e.match(z)){for(var n=t.slice(1,4),r=0;r<3;r++)n[r]=+n[r];return n[3]=1,n}if(t=e.match(H)){for(var i=t.slice(1,5),o=0;o<4;o++)i[o]=+i[o];return i}if(t=e.match(U)){for(var a=t.slice(1,4),s=0;s<3;s++)a[s]=V(2.55*a[s]);return a[3]=1,a}if(t=e.match(B)){for(var l=t.slice(1,5),u=0;u<3;u++)l[u]=V(2.55*l[u]);return l[3]=+l[3],l}if(t=e.match(W)){var c=t.slice(1,4);c[1]*=.01,c[2]*=.01;var f=F(c);return f[3]=1,f}if(t=e.match($)){var p=t.slice(1,4);p[1]*=.01,p[2]*=.01;var h=F(p);return h[3]=+t[4],h}};q.test=function(e){return z.test(e)||H.test(e)||U.test(e)||B.test(e)||W.test(e)||$.test(e)};var G=q,Y=c.type;v.prototype.css=function(e){return D(this._rgb,e)},y.css=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(v,[null].concat(e,["css"])))},d.format.css=G,d.autodetect.push({p:5,test:function(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];if(!t.length&&"string"===Y(e)&&G.test(e))return"css"}});var X=c.unpack;d.format.gl=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=X(e,"rgba");return n[0]*=255,n[1]*=255,n[2]*=255,n},y.gl=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(v,[null].concat(e,["gl"])))},v.prototype.gl=function(){var e=this._rgb;return[e[0]/255,e[1]/255,e[2]/255,e[3]]};var K=c.unpack,Q=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n,r=K(e,"rgb"),i=r[0],o=r[1],a=r[2],s=Math.min(i,o,a),l=Math.max(i,o,a),u=l-s,c=100*u/255,d=s/(255-u)*100;return 0===u?n=Number.NaN:(i===l&&(n=(o-a)/u),o===l&&(n=2+(a-i)/u),a===l&&(n=4+(i-o)/u),(n*=60)<0&&(n+=360)),[n,c,d]},J=c.unpack,Z=Math.floor,ee=function(){for(var e,t,n,r,i,o,a=[],s=arguments.length;s--;)a[s]=arguments[s];var l,u,c,d=(a=J(a,"hcg"))[0],f=a[1],p=a[2];p*=255;var h=255*f;if(0===f)l=u=c=p;else{360===d&&(d=0),d>360&&(d-=360),d<0&&(d+=360);var m=Z(d/=60),v=d-m,g=p*(1-f),y=g+h*(1-v),b=g+h*v,w=g+h;switch(m){case 0:l=(e=[w,b,g])[0],u=e[1],c=e[2];break;case 1:l=(t=[y,w,g])[0],u=t[1],c=t[2];break;case 2:l=(n=[g,w,b])[0],u=n[1],c=n[2];break;case 3:l=(r=[g,y,w])[0],u=r[1],c=r[2];break;case 4:l=(i=[b,g,w])[0],u=i[1],c=i[2];break;case 5:l=(o=[w,g,y])[0],u=o[1],c=o[2]}}return[l,u,c,a.length>3?a[3]:1]},te=c.unpack,ne=c.type;v.prototype.hcg=function(){return Q(this._rgb)},y.hcg=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(v,[null].concat(e,["hcg"])))},d.format.hcg=ee,d.autodetect.push({p:1,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=te(e,"hcg"),"array"===ne(e)&&3===e.length)return"hcg"}});var re=c.unpack,ie=c.last,oe=Math.round,ae=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=re(e,"rgba"),r=n[0],i=n[1],o=n[2],a=n[3],s=ie(e)||"auto";void 0===a&&(a=1),"auto"===s&&(s=a<1?"rgba":"rgb");var l="000000"+((r=oe(r))<<16|(i=oe(i))<<8|(o=oe(o))).toString(16);l=l.substr(l.length-6);var u="0"+oe(255*a).toString(16);switch(u=u.substr(u.length-2),s.toLowerCase()){case"rgba":return"#"+l+u;case"argb":return"#"+u+l;default:return"#"+l}},se=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,le=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,ue=function(e){if(e.match(se)){4!==e.length&&7!==e.length||(e=e.substr(1)),3===e.length&&(e=(e=e.split(""))[0]+e[0]+e[1]+e[1]+e[2]+e[2]);var t=parseInt(e,16);return[t>>16,t>>8&255,255&t,1]}if(e.match(le)){5!==e.length&&9!==e.length||(e=e.substr(1)),4===e.length&&(e=(e=e.split(""))[0]+e[0]+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]);var n=parseInt(e,16);return[n>>24&255,n>>16&255,n>>8&255,Math.round((255&n)/255*100)/100]}throw new Error("unknown hex color: "+e)},ce=c.type;v.prototype.hex=function(e){return ae(this._rgb,e)},y.hex=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(v,[null].concat(e,["hex"])))},d.format.hex=ue,d.autodetect.push({p:4,test:function(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];if(!t.length&&"string"===ce(e)&&[3,4,5,6,7,8,9].indexOf(e.length)>=0)return"hex"}});var de=c.unpack,fe=c.TWOPI,pe=Math.min,he=Math.sqrt,me=Math.acos,ve=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n,r=de(e,"rgb"),i=r[0],o=r[1],a=r[2],s=pe(i/=255,o/=255,a/=255),l=(i+o+a)/3,u=l>0?1-s/l:0;return 0===u?n=NaN:(n=(i-o+(i-a))/2,n/=he((i-o)*(i-o)+(i-a)*(o-a)),n=me(n),a>o&&(n=fe-n),n/=fe),[360*n,u,l]},ge=c.unpack,ye=c.limit,be=c.TWOPI,we=c.PITHIRD,xe=Math.cos,ke=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n,r,i,o=(e=ge(e,"hsi"))[0],a=e[1],s=e[2];return isNaN(o)&&(o=0),isNaN(a)&&(a=0),o>360&&(o-=360),o<0&&(o+=360),(o/=360)<1/3?r=1-((i=(1-a)/3)+(n=(1+a*xe(be*o)/xe(we-be*o))/3)):o<2/3?i=1-((n=(1-a)/3)+(r=(1+a*xe(be*(o-=1/3))/xe(we-be*o))/3)):n=1-((r=(1-a)/3)+(i=(1+a*xe(be*(o-=2/3))/xe(we-be*o))/3)),[255*(n=ye(s*n*3)),255*(r=ye(s*r*3)),255*(i=ye(s*i*3)),e.length>3?e[3]:1]},Se=c.unpack,Ce=c.type;v.prototype.hsi=function(){return ve(this._rgb)},y.hsi=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(v,[null].concat(e,["hsi"])))},d.format.hsi=ke,d.autodetect.push({p:2,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=Se(e,"hsi"),"array"===Ce(e)&&3===e.length)return"hsi"}});var _e=c.unpack,Ee=c.type;v.prototype.hsl=function(){return M(this._rgb)},y.hsl=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(v,[null].concat(e,["hsl"])))},d.format.hsl=F,d.autodetect.push({p:2,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=_e(e,"hsl"),"array"===Ee(e)&&3===e.length)return"hsl"}});var Te=c.unpack,je=Math.min,Oe=Math.max,Ne=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n,r,i,o=(e=Te(e,"rgb"))[0],a=e[1],s=e[2],l=je(o,a,s),u=Oe(o,a,s),c=u-l;return i=u/255,0===u?(n=Number.NaN,r=0):(r=c/u,o===u&&(n=(a-s)/c),a===u&&(n=2+(s-o)/c),s===u&&(n=4+(o-a)/c),(n*=60)<0&&(n+=360)),[n,r,i]},Me=c.unpack,Le=Math.floor,Pe=function(){for(var e,t,n,r,i,o,a=[],s=arguments.length;s--;)a[s]=arguments[s];var l,u,c,d=(a=Me(a,"hsv"))[0],f=a[1],p=a[2];if(p*=255,0===f)l=u=c=p;else{360===d&&(d=0),d>360&&(d-=360),d<0&&(d+=360);var h=Le(d/=60),m=d-h,v=p*(1-f),g=p*(1-f*m),y=p*(1-f*(1-m));switch(h){case 0:l=(e=[p,y,v])[0],u=e[1],c=e[2];break;case 1:l=(t=[g,p,v])[0],u=t[1],c=t[2];break;case 2:l=(n=[v,p,y])[0],u=n[1],c=n[2];break;case 3:l=(r=[v,g,p])[0],u=r[1],c=r[2];break;case 4:l=(i=[y,v,p])[0],u=i[1],c=i[2];break;case 5:l=(o=[p,v,g])[0],u=o[1],c=o[2]}}return[l,u,c,a.length>3?a[3]:1]},Ae=c.unpack,De=c.type;v.prototype.hsv=function(){return Ne(this._rgb)},y.hsv=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(v,[null].concat(e,["hsv"])))},d.format.hsv=Pe,d.autodetect.push({p:2,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=Ae(e,"hsv"),"array"===De(e)&&3===e.length)return"hsv"}});var Re={Kn:18,Xn:.95047,Yn:1,Zn:1.08883,t0:.137931034,t1:.206896552,t2:.12841855,t3:.008856452},Ie=c.unpack,Fe=Math.pow,ze=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=Ie(e,"rgb"),r=n[0],i=n[1],o=n[2],a=Be(r,i,o),s=a[0],l=a[1],u=116*l-16;return[u<0?0:u,500*(s-l),200*(l-a[2])]},He=function(e){return(e/=255)<=.04045?e/12.92:Fe((e+.055)/1.055,2.4)},Ue=function(e){return e>Re.t3?Fe(e,1/3):e/Re.t2+Re.t0},Be=function(e,t,n){return e=He(e),t=He(t),n=He(n),[Ue((.4124564*e+.3575761*t+.1804375*n)/Re.Xn),Ue((.2126729*e+.7151522*t+.072175*n)/Re.Yn),Ue((.0193339*e+.119192*t+.9503041*n)/Re.Zn)]},We=ze,$e=c.unpack,Ve=Math.pow,qe=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n,r,i,o=(e=$e(e,"lab"))[0],a=e[1],s=e[2];return r=(o+16)/116,n=isNaN(a)?r:r+a/500,i=isNaN(s)?r:r-s/200,r=Re.Yn*Ye(r),n=Re.Xn*Ye(n),i=Re.Zn*Ye(i),[Ge(3.2404542*n-1.5371385*r-.4985314*i),Ge(-.969266*n+1.8760108*r+.041556*i),Ge(.0556434*n-.2040259*r+1.0572252*i),e.length>3?e[3]:1]},Ge=function(e){return 255*(e<=.00304?12.92*e:1.055*Ve(e,1/2.4)-.055)},Ye=function(e){return e>Re.t1?e*e*e:Re.t2*(e-Re.t0)},Xe=qe,Ke=c.unpack,Qe=c.type;v.prototype.lab=function(){return We(this._rgb)},y.lab=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(v,[null].concat(e,["lab"])))},d.format.lab=Xe,d.autodetect.push({p:2,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=Ke(e,"lab"),"array"===Qe(e)&&3===e.length)return"lab"}});var Je=c.unpack,Ze=c.RAD2DEG,et=Math.sqrt,tt=Math.atan2,nt=Math.round,rt=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=Je(e,"lab"),r=n[0],i=n[1],o=n[2],a=et(i*i+o*o),s=(tt(o,i)*Ze+360)%360;return 0===nt(1e4*a)&&(s=Number.NaN),[r,a,s]},it=c.unpack,ot=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=it(e,"rgb"),r=n[0],i=n[1],o=n[2],a=We(r,i,o),s=a[0],l=a[1],u=a[2];return rt(s,l,u)},at=c.unpack,st=c.DEG2RAD,lt=Math.sin,ut=Math.cos,ct=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=at(e,"lch"),r=n[0],i=n[1],o=n[2];return isNaN(o)&&(o=0),[r,ut(o*=st)*i,lt(o)*i]},dt=c.unpack,ft=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=(e=dt(e,"lch"))[0],r=e[1],i=e[2],o=ct(n,r,i),a=o[0],s=o[1],l=o[2],u=Xe(a,s,l);return[u[0],u[1],u[2],e.length>3?e[3]:1]},pt=c.unpack,ht=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=pt(e,"hcl").reverse();return ft.apply(void 0,n)},mt=c.unpack,vt=c.type;v.prototype.lch=function(){return ot(this._rgb)},v.prototype.hcl=function(){return ot(this._rgb).reverse()},y.lch=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(v,[null].concat(e,["lch"])))},y.hcl=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(v,[null].concat(e,["hcl"])))},d.format.lch=ft,d.format.hcl=ht,["lch","hcl"].forEach((function(e){return d.autodetect.push({p:2,test:function(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];if(t=mt(t,e),"array"===vt(t)&&3===t.length)return e}})}));var gt={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflower:"#6495ed",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",laserlemon:"#ffff54",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrod:"#fafad2",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",maroon2:"#7f0000",maroon3:"#b03060",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",purple2:"#7f007f",purple3:"#a020f0",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},yt=c.type;v.prototype.name=function(){for(var e=ae(this._rgb,"rgb"),t=0,n=Object.keys(gt);t<n.length;t+=1){var r=n[t];if(gt[r]===e)return r.toLowerCase()}return e},d.format.named=function(e){if(e=e.toLowerCase(),gt[e])return ue(gt[e]);throw new Error("unknown color name: "+e)},d.autodetect.push({p:5,test:function(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];if(!t.length&&"string"===yt(e)&&gt[e.toLowerCase()])return"named"}});var bt=c.unpack,wt=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=bt(e,"rgb");return(n[0]<<16)+(n[1]<<8)+n[2]},xt=c.type,kt=function(e){if("number"==xt(e)&&e>=0&&e<=16777215)return[e>>16,e>>8&255,255&e,1];throw new Error("unknown num color: "+e)},St=c.type;v.prototype.num=function(){return wt(this._rgb)},y.num=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(v,[null].concat(e,["num"])))},d.format.num=kt,d.autodetect.push({p:5,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(1===e.length&&"number"===St(e[0])&&e[0]>=0&&e[0]<=16777215)return"num"}});var Ct=c.unpack,_t=c.type,Et=Math.round;v.prototype.rgb=function(e){return void 0===e&&(e=!0),!1===e?this._rgb.slice(0,3):this._rgb.slice(0,3).map(Et)},v.prototype.rgba=function(e){return void 0===e&&(e=!0),this._rgb.slice(0,4).map((function(t,n){return n<3?!1===e?t:Et(t):t}))},y.rgb=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(v,[null].concat(e,["rgb"])))},d.format.rgb=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=Ct(e,"rgba");return void 0===n[3]&&(n[3]=1),n},d.autodetect.push({p:3,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=Ct(e,"rgba"),"array"===_t(e)&&(3===e.length||4===e.length&&"number"==_t(e[3])&&e[3]>=0&&e[3]<=1))return"rgb"}});var Tt=Math.log,jt=function(e){var t,n,r,i=e/100;return i<66?(t=255,n=-155.25485562709179-.44596950469579133*(n=i-2)+104.49216199393888*Tt(n),r=i<20?0:.8274096064007395*(r=i-10)-254.76935184120902+115.67994401066147*Tt(r)):(t=351.97690566805693+.114206453784165*(t=i-55)-40.25366309332127*Tt(t),n=325.4494125711974+.07943456536662342*(n=i-50)-28.0852963507957*Tt(n),r=255),[t,n,r,1]},Ot=c.unpack,Nt=Math.round,Mt=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var n,r=Ot(e,"rgb"),i=r[0],o=r[2],a=1e3,s=4e4,l=.4;s-a>l;){var u=jt(n=.5*(s+a));u[2]/u[0]>=o/i?s=n:a=n}return Nt(n)};v.prototype.temp=v.prototype.kelvin=v.prototype.temperature=function(){return Mt(this._rgb)},y.temp=y.kelvin=y.temperature=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(v,[null].concat(e,["temp"])))},d.format.temp=d.format.kelvin=d.format.temperature=jt;var Lt=c.type;v.prototype.alpha=function(e,t){return void 0===t&&(t=!1),void 0!==e&&"number"===Lt(e)?t?(this._rgb[3]=e,this):new v([this._rgb[0],this._rgb[1],this._rgb[2],e],"rgb"):this._rgb[3]},v.prototype.clipped=function(){return this._rgb._clipped||!1},v.prototype.darken=function(e){void 0===e&&(e=1);var t=this,n=t.lab();return n[0]-=Re.Kn*e,new v(n,"lab").alpha(t.alpha(),!0)},v.prototype.brighten=function(e){return void 0===e&&(e=1),this.darken(-e)},v.prototype.darker=v.prototype.darken,v.prototype.brighter=v.prototype.brighten,v.prototype.get=function(e){var t=e.split("."),n=t[0],r=t[1],i=this[n]();if(r){var o=n.indexOf(r);if(o>-1)return i[o];throw new Error("unknown channel "+r+" in mode "+n)}return i};var Pt=c.type,At=Math.pow,Dt=1e-7,Rt=20;v.prototype.luminance=function(e){if(void 0!==e&&"number"===Pt(e)){if(0===e)return new v([0,0,0,this._rgb[3]],"rgb");if(1===e)return new v([255,255,255,this._rgb[3]],"rgb");var t=this.luminance(),n="rgb",r=Rt,i=function(t,o){var a=t.interpolate(o,.5,n),s=a.luminance();return Math.abs(e-s)<Dt||!r--?a:s>e?i(t,a):i(a,o)},o=(t>e?i(new v([0,0,0]),this):i(this,new v([255,255,255]))).rgb();return new v(o.concat([this._rgb[3]]))}return It.apply(void 0,this._rgb.slice(0,3))};var It=function(e,t,n){return.2126*(e=Ft(e))+.7152*(t=Ft(t))+.0722*(n=Ft(n))},Ft=function(e){return(e/=255)<=.03928?e/12.92:At((e+.055)/1.055,2.4)},zt={},Ht=c.type,Ut=function(e,t,n){void 0===n&&(n=.5);for(var r=[],i=arguments.length-3;i-- >0;)r[i]=arguments[i+3];var o=r[0]||"lrgb";if(zt[o]||r.length||(o=Object.keys(zt)[0]),!zt[o])throw new Error("interpolation mode "+o+" is not defined");return"object"!==Ht(e)&&(e=new v(e)),"object"!==Ht(t)&&(t=new v(t)),zt[o](e,t,n).alpha(e.alpha()+n*(t.alpha()-e.alpha()))};v.prototype.mix=v.prototype.interpolate=function(e,t){void 0===t&&(t=.5);for(var n=[],r=arguments.length-2;r-- >0;)n[r]=arguments[r+2];return Ut.apply(void 0,[this,e,t].concat(n))},v.prototype.premultiply=function(e){void 0===e&&(e=!1);var t=this._rgb,n=t[3];return e?(this._rgb=[t[0]*n,t[1]*n,t[2]*n,n],this):new v([t[0]*n,t[1]*n,t[2]*n,n],"rgb")},v.prototype.saturate=function(e){void 0===e&&(e=1);var t=this,n=t.lch();return n[1]+=Re.Kn*e,n[1]<0&&(n[1]=0),new v(n,"lch").alpha(t.alpha(),!0)},v.prototype.desaturate=function(e){return void 0===e&&(e=1),this.saturate(-e)};var Bt=c.type;v.prototype.set=function(e,t,n){void 0===n&&(n=!1);var r=e.split("."),i=r[0],o=r[1],a=this[i]();if(o){var s=i.indexOf(o);if(s>-1){if("string"==Bt(t))switch(t.charAt(0)){case"+":case"-":a[s]+=+t;break;case"*":a[s]*=+t.substr(1);break;case"/":a[s]/=+t.substr(1);break;default:a[s]=+t}else{if("number"!==Bt(t))throw new Error("unsupported value for Color.set");a[s]=t}var l=new v(a,i);return n?(this._rgb=l._rgb,this):l}throw new Error("unknown channel "+o+" in mode "+i)}return a};var Wt=function(e,t,n){var r=e._rgb,i=t._rgb;return new v(r[0]+n*(i[0]-r[0]),r[1]+n*(i[1]-r[1]),r[2]+n*(i[2]-r[2]),"rgb")};zt.rgb=Wt;var $t=Math.sqrt,Vt=Math.pow,qt=function(e,t,n){var r=e._rgb,i=r[0],o=r[1],a=r[2],s=t._rgb,l=s[0],u=s[1],c=s[2];return new v($t(Vt(i,2)*(1-n)+Vt(l,2)*n),$t(Vt(o,2)*(1-n)+Vt(u,2)*n),$t(Vt(a,2)*(1-n)+Vt(c,2)*n),"rgb")};zt.lrgb=qt;var Gt=function(e,t,n){var r=e.lab(),i=t.lab();return new v(r[0]+n*(i[0]-r[0]),r[1]+n*(i[1]-r[1]),r[2]+n*(i[2]-r[2]),"lab")};zt.lab=Gt;var Yt=function(e,t,n,r){var i,o,a,s,l,u,c,d,f,p,h,m;return"hsl"===r?(a=e.hsl(),s=t.hsl()):"hsv"===r?(a=e.hsv(),s=t.hsv()):"hcg"===r?(a=e.hcg(),s=t.hcg()):"hsi"===r?(a=e.hsi(),s=t.hsi()):"lch"!==r&&"hcl"!==r||(r="hcl",a=e.hcl(),s=t.hcl()),"h"===r.substr(0,1)&&(l=(i=a)[0],c=i[1],f=i[2],u=(o=s)[0],d=o[1],p=o[2]),isNaN(l)||isNaN(u)?isNaN(l)?isNaN(u)?m=Number.NaN:(m=u,1!=f&&0!=f||"hsv"==r||(h=d)):(m=l,1!=p&&0!=p||"hsv"==r||(h=c)):m=l+n*(u>l&&u-l>180?u-(l+360):u<l&&l-u>180?u+360-l:u-l),void 0===h&&(h=c+n*(d-c)),new v([m,h,f+n*(p-f)],r)},Xt=function(e,t,n){return Yt(e,t,n,"lch")};zt.lch=Xt,zt.hcl=Xt;var Kt=function(e,t,n){var r=e.num(),i=t.num();return new v(r+n*(i-r),"num")};zt.num=Kt;var Qt=function(e,t,n){return Yt(e,t,n,"hcg")};zt.hcg=Qt;var Jt=function(e,t,n){return Yt(e,t,n,"hsi")};zt.hsi=Jt;var Zt=function(e,t,n){return Yt(e,t,n,"hsl")};zt.hsl=Zt;var en=function(e,t,n){return Yt(e,t,n,"hsv")};zt.hsv=en;var tn=c.clip_rgb,nn=Math.pow,rn=Math.sqrt,on=Math.PI,an=Math.cos,sn=Math.sin,ln=Math.atan2,un=function(e,t,n){void 0===t&&(t="lrgb"),void 0===n&&(n=null);var r=e.length;n||(n=Array.from(new Array(r)).map((function(){return 1})));var i=r/n.reduce((function(e,t){return e+t}));if(n.forEach((function(e,t){n[t]*=i})),e=e.map((function(e){return new v(e)})),"lrgb"===t)return cn(e,n);for(var o=e.shift(),a=o.get(t),s=[],l=0,u=0,c=0;c<a.length;c++)if(a[c]=(a[c]||0)*n[0],s.push(isNaN(a[c])?0:n[0]),"h"===t.charAt(c)&&!isNaN(a[c])){var d=a[c]/180*on;l+=an(d)*n[0],u+=sn(d)*n[0]}var f=o.alpha()*n[0];e.forEach((function(e,r){var i=e.get(t);f+=e.alpha()*n[r+1];for(var o=0;o<a.length;o++)if(!isNaN(i[o]))if(s[o]+=n[r+1],"h"===t.charAt(o)){var c=i[o]/180*on;l+=an(c)*n[r+1],u+=sn(c)*n[r+1]}else a[o]+=i[o]*n[r+1]}));for(var p=0;p<a.length;p++)if("h"===t.charAt(p)){for(var h=ln(u/s[p],l/s[p])/on*180;h<0;)h+=360;for(;h>=360;)h-=360;a[p]=h}else a[p]=a[p]/s[p];return f/=r,new v(a,t).alpha(f>.99999?1:f,!0)},cn=function(e,t){for(var n=e.length,r=[0,0,0,0],i=0;i<e.length;i++){var o=e[i],a=t[i]/n,s=o._rgb;r[0]+=nn(s[0],2)*a,r[1]+=nn(s[1],2)*a,r[2]+=nn(s[2],2)*a,r[3]+=s[3]*a}return r[0]=rn(r[0]),r[1]=rn(r[1]),r[2]=rn(r[2]),r[3]>.9999999&&(r[3]=1),new v(tn(r))},dn=c.type,fn=Math.pow,pn=function(e){var t="rgb",n=y("#ccc"),r=0,i=[0,1],o=[],a=[0,0],s=!1,l=[],u=!1,c=0,d=1,f=!1,p={},h=!0,m=1,v=function(e){if((e=e||["#fff","#000"])&&"string"===dn(e)&&y.brewer&&y.brewer[e.toLowerCase()]&&(e=y.brewer[e.toLowerCase()]),"array"===dn(e)){1===e.length&&(e=[e[0],e[0]]),e=e.slice(0);for(var t=0;t<e.length;t++)e[t]=y(e[t]);o.length=0;for(var n=0;n<e.length;n++)o.push(n/(e.length-1))}return k(),l=e},g=function(e){if(null!=s){for(var t=s.length-1,n=0;n<t&&e>=s[n];)n++;return n-1}return 0},b=function(e){return e},w=function(e){return e},x=function(e,r){var i,u;if(null==r&&(r=!1),isNaN(e)||null===e)return n;u=r?e:s&&s.length>2?g(e)/(s.length-2):d!==c?(e-c)/(d-c):1,u=w(u),r||(u=b(u)),1!==m&&(u=fn(u,m)),u=a[0]+u*(1-a[0]-a[1]),u=Math.min(1,Math.max(0,u));var f=Math.floor(1e4*u);if(h&&p[f])i=p[f];else{if("array"===dn(l))for(var v=0;v<o.length;v++){var x=o[v];if(u<=x){i=l[v];break}if(u>=x&&v===o.length-1){i=l[v];break}if(u>x&&u<o[v+1]){u=(u-x)/(o[v+1]-x),i=y.interpolate(l[v],l[v+1],u,t);break}}else"function"===dn(l)&&(i=l(u));h&&(p[f]=i)}return i},k=function(){return p={}};v(e);var S=function(e){var t=y(x(e));return u&&t[u]?t[u]():t};return S.classes=function(e){if(null!=e){if("array"===dn(e))s=e,i=[e[0],e[e.length-1]];else{var t=y.analyze(i);s=0===e?[t.min,t.max]:y.limits(t,"e",e)}return S}return s},S.domain=function(e){if(!arguments.length)return i;c=e[0],d=e[e.length-1],o=[];var t=l.length;if(e.length===t&&c!==d)for(var n=0,r=Array.from(e);n<r.length;n+=1){var a=r[n];o.push((a-c)/(d-c))}else{for(var s=0;s<t;s++)o.push(s/(t-1));if(e.length>2){var u=e.map((function(t,n){return n/(e.length-1)})),f=e.map((function(e){return(e-c)/(d-c)}));f.every((function(e,t){return u[t]===e}))||(w=function(e){if(e<=0||e>=1)return e;for(var t=0;e>=f[t+1];)t++;var n=(e-f[t])/(f[t+1]-f[t]);return u[t]+n*(u[t+1]-u[t])})}}return i=[c,d],S},S.mode=function(e){return arguments.length?(t=e,k(),S):t},S.range=function(e,t){return v(e,t),S},S.out=function(e){return u=e,S},S.spread=function(e){return arguments.length?(r=e,S):r},S.correctLightness=function(e){return null==e&&(e=!0),f=e,k(),b=f?function(e){for(var t=x(0,!0).lab()[0],n=x(1,!0).lab()[0],r=t>n,i=x(e,!0).lab()[0],o=t+(n-t)*e,a=i-o,s=0,l=1,u=20;Math.abs(a)>.01&&u-- >0;)r&&(a*=-1),a<0?(s=e,e+=.5*(l-e)):(l=e,e+=.5*(s-e)),i=x(e,!0).lab()[0],a=i-o;return e}:function(e){return e},S},S.padding=function(e){return null!=e?("number"===dn(e)&&(e=[e,e]),a=e,S):a},S.colors=function(t,n){arguments.length<2&&(n="hex");var r=[];if(0===arguments.length)r=l.slice(0);else if(1===t)r=[S(.5)];else if(t>1){var o=i[0],a=i[1]-o;r=hn(0,t,!1).map((function(e){return S(o+e/(t-1)*a)}))}else{e=[];var u=[];if(s&&s.length>2)for(var c=1,d=s.length,f=1<=d;f?c<d:c>d;f?c++:c--)u.push(.5*(s[c-1]+s[c]));else u=i;r=u.map((function(e){return S(e)}))}return y[n]&&(r=r.map((function(e){return e[n]()}))),r},S.cache=function(e){return null!=e?(h=e,S):h},S.gamma=function(e){return null!=e?(m=e,S):m},S.nodata=function(e){return null!=e?(n=y(e),S):n},S};function hn(e,t,n){for(var r=[],i=e<t,o=n?i?t+1:t-1:t,a=e;i?a<o:a>o;i?a++:a--)r.push(a);return r}var mn=function(e){var t,n,r,i,o,a,s;if(2===(e=e.map((function(e){return new v(e)}))).length)t=e.map((function(e){return e.lab()})),o=t[0],a=t[1],i=function(e){var t=[0,1,2].map((function(t){return o[t]+e*(a[t]-o[t])}));return new v(t,"lab")};else if(3===e.length)n=e.map((function(e){return e.lab()})),o=n[0],a=n[1],s=n[2],i=function(e){var t=[0,1,2].map((function(t){return(1-e)*(1-e)*o[t]+2*(1-e)*e*a[t]+e*e*s[t]}));return new v(t,"lab")};else if(4===e.length){var l;r=e.map((function(e){return e.lab()})),o=r[0],a=r[1],s=r[2],l=r[3],i=function(e){var t=[0,1,2].map((function(t){return(1-e)*(1-e)*(1-e)*o[t]+3*(1-e)*(1-e)*e*a[t]+3*(1-e)*e*e*s[t]+e*e*e*l[t]}));return new v(t,"lab")}}else if(5===e.length){var u=mn(e.slice(0,3)),c=mn(e.slice(2,5));i=function(e){return e<.5?u(2*e):c(2*(e-.5))}}return i},vn=function(e){var t=mn(e);return t.scale=function(){return pn(t)},t},gn=function(e,t,n){if(!gn[n])throw new Error("unknown blend mode "+n);return gn[n](e,t)},yn=function(e){return function(t,n){var r=y(n).rgb(),i=y(t).rgb();return y.rgb(e(r,i))}},bn=function(e){return function(t,n){var r=[];return r[0]=e(t[0],n[0]),r[1]=e(t[1],n[1]),r[2]=e(t[2],n[2]),r}},wn=function(e){return e},xn=function(e,t){return e*t/255},kn=function(e,t){return e>t?t:e},Sn=function(e,t){return e>t?e:t},Cn=function(e,t){return 255*(1-(1-e/255)*(1-t/255))},_n=function(e,t){return t<128?2*e*t/255:255*(1-2*(1-e/255)*(1-t/255))},En=function(e,t){return 255*(1-(1-t/255)/(e/255))},Tn=function(e,t){return 255===e||(e=t/255*255/(1-e/255))>255?255:e};gn.normal=yn(bn(wn)),gn.multiply=yn(bn(xn)),gn.screen=yn(bn(Cn)),gn.overlay=yn(bn(_n)),gn.darken=yn(bn(kn)),gn.lighten=yn(bn(Sn)),gn.dodge=yn(bn(Tn)),gn.burn=yn(bn(En));for(var jn=gn,On=c.type,Nn=c.clip_rgb,Mn=c.TWOPI,Ln=Math.pow,Pn=Math.sin,An=Math.cos,Dn=function(e,t,n,r,i){void 0===e&&(e=300),void 0===t&&(t=-1.5),void 0===n&&(n=1),void 0===r&&(r=1),void 0===i&&(i=[0,1]);var o,a=0;"array"===On(i)?o=i[1]-i[0]:(o=0,i=[i,i]);var s=function(s){var l=Mn*((e+120)/360+t*s),u=Ln(i[0]+o*s,r),c=(0!==a?n[0]+s*a:n)*u*(1-u)/2,d=An(l),f=Pn(l);return y(Nn([255*(u+c*(-.14861*d+1.78277*f)),255*(u+c*(-.29227*d-.90649*f)),255*(u+c*(1.97294*d)),1]))};return s.start=function(t){return null==t?e:(e=t,s)},s.rotations=function(e){return null==e?t:(t=e,s)},s.gamma=function(e){return null==e?r:(r=e,s)},s.hue=function(e){return null==e?n:("array"===On(n=e)?0==(a=n[1]-n[0])&&(n=n[1]):a=0,s)},s.lightness=function(e){return null==e?i:("array"===On(e)?(i=e,o=e[1]-e[0]):(i=[e,e],o=0),s)},s.scale=function(){return y.scale(s)},s.hue(n),s},Rn="0123456789abcdef",In=Math.floor,Fn=Math.random,zn=function(){for(var e="#",t=0;t<6;t++)e+=Rn.charAt(In(16*Fn()));return new v(e,"hex")},Hn=Math.log,Un=Math.pow,Bn=Math.floor,Wn=Math.abs,$n=function(e,t){void 0===t&&(t=null);var n={min:Number.MAX_VALUE,max:-1*Number.MAX_VALUE,sum:0,values:[],count:0};return"object"===a(e)&&(e=Object.values(e)),e.forEach((function(e){t&&"object"===a(e)&&(e=e[t]),null==e||isNaN(e)||(n.values.push(e),n.sum+=e,e<n.min&&(n.min=e),e>n.max&&(n.max=e),n.count+=1)})),n.domain=[n.min,n.max],n.limits=function(e,t){return Vn(n,e,t)},n},Vn=function(e,t,n){void 0===t&&(t="equal"),void 0===n&&(n=7),"array"==a(e)&&(e=$n(e));var r=e.min,i=e.max,o=e.values.sort((function(e,t){return e-t}));if(1===n)return[r,i];var s=[];if("c"===t.substr(0,1)&&(s.push(r),s.push(i)),"e"===t.substr(0,1)){s.push(r);for(var l=1;l<n;l++)s.push(r+l/n*(i-r));s.push(i)}else if("l"===t.substr(0,1)){if(r<=0)throw new Error("Logarithmic scales are only possible for values > 0");var u=Math.LOG10E*Hn(r),c=Math.LOG10E*Hn(i);s.push(r);for(var d=1;d<n;d++)s.push(Un(10,u+d/n*(c-u)));s.push(i)}else if("q"===t.substr(0,1)){s.push(r);for(var f=1;f<n;f++){var p=(o.length-1)*f/n,h=Bn(p);if(h===p)s.push(o[h]);else{var m=p-h;s.push(o[h]*(1-m)+o[h+1]*m)}}s.push(i)}else if("k"===t.substr(0,1)){var v,g=o.length,y=new Array(g),b=new Array(n),w=!0,x=0,k=null;(k=[]).push(r);for(var S=1;S<n;S++)k.push(r+S/n*(i-r));for(k.push(i);w;){for(var C=0;C<n;C++)b[C]=0;for(var _=0;_<g;_++)for(var E=o[_],T=Number.MAX_VALUE,j=void 0,O=0;O<n;O++){var N=Wn(k[O]-E);N<T&&(T=N,j=O),b[j]++,y[_]=j}for(var M=new Array(n),L=0;L<n;L++)M[L]=null;for(var P=0;P<g;P++)null===M[v=y[P]]?M[v]=o[P]:M[v]+=o[P];for(var A=0;A<n;A++)M[A]*=1/b[A];w=!1;for(var D=0;D<n;D++)if(M[D]!==k[D]){w=!0;break}k=M,++x>200&&(w=!1)}for(var R={},I=0;I<n;I++)R[I]=[];for(var F=0;F<g;F++)R[v=y[F]].push(o[F]);for(var z=[],H=0;H<n;H++)z.push(R[H][0]),z.push(R[H][R[H].length-1]);z=z.sort((function(e,t){return e-t})),s.push(z[0]);for(var U=1;U<z.length;U+=2){var B=z[U];isNaN(B)||-1!==s.indexOf(B)||s.push(B)}}return s},qn={analyze:$n,limits:Vn},Gn=function(e,t){e=new v(e),t=new v(t);var n=e.luminance(),r=t.luminance();return n>r?(n+.05)/(r+.05):(r+.05)/(n+.05)},Yn=Math.sqrt,Xn=Math.atan2,Kn=Math.abs,Qn=Math.cos,Jn=Math.PI,Zn=function(e,t,n,r){void 0===n&&(n=1),void 0===r&&(r=1),e=new v(e),t=new v(t);for(var i=Array.from(e.lab()),o=i[0],a=i[1],s=i[2],l=Array.from(t.lab()),u=l[0],c=l[1],d=l[2],f=Yn(a*a+s*s),p=Yn(c*c+d*d),h=o<16?.511:.040975*o/(1+.01765*o),m=.0638*f/(1+.0131*f)+.638,g=f<1e-6?0:180*Xn(s,a)/Jn;g<0;)g+=360;for(;g>=360;)g-=360;var y=g>=164&&g<=345?.56+Kn(.2*Qn(Jn*(g+168)/180)):.36+Kn(.4*Qn(Jn*(g+35)/180)),b=f*f*f*f,w=Yn(b/(b+1900)),x=m*(w*y+1-w),k=f-p,S=a-c,C=s-d,_=(o-u)/(n*h),E=k/(r*m);return Yn(_*_+E*E+(S*S+C*C-k*k)/(x*x))},er=function(e,t,n){void 0===n&&(n="lab"),e=new v(e),t=new v(t);var r=e.get(n),i=t.get(n),o=0;for(var a in r){var s=(r[a]||0)-(i[a]||0);o+=s*s}return Math.sqrt(o)},tr=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];try{return new(Function.prototype.bind.apply(v,[null].concat(e))),!0}catch(e){return!1}},nr={cool:function(){return pn([y.hsl(180,1,.9),y.hsl(250,.7,.4)])},hot:function(){return pn(["#000","#f00","#ff0","#fff"],[0,.25,.75,1]).mode("rgb")}},rr={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Viridis:["#440154","#482777","#3f4a8a","#31678e","#26838f","#1f9d8a","#6cce5a","#b6de2b","#fee825"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},ir=0,or=Object.keys(rr);ir<or.length;ir+=1){var ar=or[ir];rr[ar.toLowerCase()]=rr[ar]}var sr=rr;return y.average=un,y.bezier=vn,y.blend=jn,y.cubehelix=Dn,y.mix=y.interpolate=Ut,y.random=zn,y.scale=pn,y.analyze=qn.analyze,y.contrast=Gn,y.deltaE=Zn,y.distance=er,y.limits=qn.limits,y.valid=tr,y.scales=nr,y.colors=gt,y.brewer=sr,y}()},4631:function(e){e.exports=function(){"use strict";var e=navigator.userAgent,t=navigator.platform,n=/gecko\/\d/i.test(e),r=/MSIE \d/.test(e),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),o=/Edge\/(\d+)/.exec(e),a=r||i||o,s=a&&(r?document.documentMode||6:+(o||i)[1]),l=!o&&/WebKit\//.test(e),u=l&&/Qt\/\d+\.\d+/.test(e),c=!o&&/Chrome\//.test(e),d=/Opera\//.test(e),f=/Apple Computer/.test(navigator.vendor),p=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),h=/PhantomJS/.test(e),m=f&&(/Mobile\/\w+/.test(e)||navigator.maxTouchPoints>2),v=/Android/.test(e),g=m||v||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),y=m||/Mac/.test(t),b=/\bCrOS\b/.test(e),w=/win/i.test(t),x=d&&e.match(/Version\/(\d*\.\d*)/);x&&(x=Number(x[1])),x&&x>=15&&(d=!1,l=!0);var k=y&&(u||d&&(null==x||x<12.11)),S=n||a&&s>=9;function C(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var _,E=function(e,t){var n=e.className,r=C(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function T(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function j(e,t){return T(e).appendChild(t)}function O(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function N(e,t,n,r){var i=O(e,t,n,r);return i.setAttribute("role","presentation"),i}function M(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do{if(11==t.nodeType&&(t=t.host),t==e)return!0}while(t=t.parentNode)}function L(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function P(e,t){var n=e.className;C(t).test(n)||(e.className+=(n?" ":"")+t)}function A(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!C(n[r]).test(t)&&(t+=" "+n[r]);return t}_=document.createRange?function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(e){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};var D=function(e){e.select()};function R(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function I(e,t,n){for(var r in t||(t={}),e)!e.hasOwnProperty(r)||!1===n&&t.hasOwnProperty(r)||(t[r]=e[r]);return t}function F(e,t,n,r,i){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var o=r||0,a=i||0;;){var s=e.indexOf("\t",o);if(s<0||s>=t)return a+(t-o);a+=s-o,a+=n-a%n,o=s+1}}m?D=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:a&&(D=function(e){try{e.select()}catch(e){}});var z=function(){this.id=null,this.f=null,this.time=0,this.handler=R(this.onTimeout,this)};function H(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}z.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},z.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};var U=50,B={toString:function(){return"CodeMirror.Pass"}},W={scroll:!1},$={origin:"*mouse"},V={origin:"+move"};function q(e,t,n){for(var r=0,i=0;;){var o=e.indexOf("\t",r);-1==o&&(o=e.length);var a=o-r;if(o==e.length||i+a>=t)return r+Math.min(a,t-i);if(i+=o-r,r=o+1,(i+=n-i%n)>=t)return r}}var G=[""];function Y(e){for(;G.length<=e;)G.push(X(G)+" ");return G[e]}function X(e){return e[e.length-1]}function K(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function Q(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}function J(){}function Z(e,t){var n;return Object.create?n=Object.create(e):(J.prototype=e,n=new J),t&&I(t,n),n}var ee=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function te(e){return/\w/.test(e)||e>""&&(e.toUpperCase()!=e.toLowerCase()||ee.test(e))}function ne(e,t){return t?!!(t.source.indexOf("\\w")>-1&&te(e))||t.test(e):te(e)}function re(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ie=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function oe(e){return e.charCodeAt(0)>=768&&ie.test(e)}function ae(e,t,n){for(;(n<0?t>0:t<e.length)&&oe(e.charAt(t));)t+=n;return t}function se(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}function le(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;o<e.length;++o){var a=e[o];(a.from<n&&a.to>t||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),1==a.level?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}var ue=null;function ce(e,t,n){var r;ue=null;for(var i=0;i<e.length;++i){var o=e[i];if(o.from<t&&o.to>t)return i;o.to==t&&(o.from!=o.to&&"before"==n?r=i:ue=i),o.from==t&&(o.from!=o.to&&"before"!=n?r=i:ue=i)}return null!=r?r:ue}var de=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(n){return n<=247?e.charAt(n):1424<=n&&n<=1524?"R":1536<=n&&n<=1785?t.charAt(n-1536):1774<=n&&n<=2220?"r":8192<=n&&n<=8203?"w":8204==n?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,o=/[LRr]/,a=/[Lb1n]/,s=/[1n]/;function l(e,t,n){this.level=e,this.from=t,this.to=n}return function(e,t){var u="ltr"==t?"L":"R";if(0==e.length||"ltr"==t&&!r.test(e))return!1;for(var c=e.length,d=[],f=0;f<c;++f)d.push(n(e.charCodeAt(f)));for(var p=0,h=u;p<c;++p){var m=d[p];"m"==m?d[p]=h:h=m}for(var v=0,g=u;v<c;++v){var y=d[v];"1"==y&&"r"==g?d[v]="n":o.test(y)&&(g=y,"r"==y&&(d[v]="R"))}for(var b=1,w=d[0];b<c-1;++b){var x=d[b];"+"==x&&"1"==w&&"1"==d[b+1]?d[b]="1":","!=x||w!=d[b+1]||"1"!=w&&"n"!=w||(d[b]=w),w=x}for(var k=0;k<c;++k){var S=d[k];if(","==S)d[k]="N";else if("%"==S){var C=void 0;for(C=k+1;C<c&&"%"==d[C];++C);for(var _=k&&"!"==d[k-1]||C<c&&"1"==d[C]?"1":"N",E=k;E<C;++E)d[E]=_;k=C-1}}for(var T=0,j=u;T<c;++T){var O=d[T];"L"==j&&"1"==O?d[T]="L":o.test(O)&&(j=O)}for(var N=0;N<c;++N)if(i.test(d[N])){var M=void 0;for(M=N+1;M<c&&i.test(d[M]);++M);for(var L="L"==(N?d[N-1]:u),P=L==("L"==(M<c?d[M]:u))?L?"L":"R":u,A=N;A<M;++A)d[A]=P;N=M-1}for(var D,R=[],I=0;I<c;)if(a.test(d[I])){var F=I;for(++I;I<c&&a.test(d[I]);++I);R.push(new l(0,F,I))}else{var z=I,H=R.length,U="rtl"==t?1:0;for(++I;I<c&&"L"!=d[I];++I);for(var B=z;B<I;)if(s.test(d[B])){z<B&&(R.splice(H,0,new l(1,z,B)),H+=U);var W=B;for(++B;B<I&&s.test(d[B]);++B);R.splice(H,0,new l(2,W,B)),H+=U,z=B}else++B;z<I&&R.splice(H,0,new l(1,z,I))}return"ltr"==t&&(1==R[0].level&&(D=e.match(/^\s+/))&&(R[0].from=D[0].length,R.unshift(new l(0,0,D[0].length))),1==X(R).level&&(D=e.match(/\s+$/))&&(X(R).to-=D[0].length,R.push(new l(0,c-D[0].length,c)))),"rtl"==t?R.reverse():R}}();function fe(e,t){var n=e.order;return null==n&&(n=e.order=de(e.text,t)),n}var pe=[],he=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||pe).concat(n)}};function me(e,t){return e._handlers&&e._handlers[t]||pe}function ve(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,i=r&&r[t];if(i){var o=H(i,n);o>-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function ge(e,t){var n=me(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function ye(e,t,n){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),ge(e,n||t.type,e,t),Ce(t)||t.codemirrorIgnore}function be(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)-1==H(n,t[r])&&n.push(t[r])}function we(e,t){return me(e,t).length>0}function xe(e){e.prototype.on=function(e,t){he(this,e,t)},e.prototype.off=function(e,t){ve(this,e,t)}}function ke(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Se(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Ce(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function _e(e){ke(e),Se(e)}function Ee(e){return e.target||e.srcElement}function Te(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),y&&e.ctrlKey&&1==t&&(t=3),t}var je,Oe,Ne=function(){if(a&&s<9)return!1;var e=O("div");return"draggable"in e||"dragDrop"in e}();function Me(e){if(null==je){var t=O("span","​");j(e,O("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(je=t.offsetWidth<=1&&t.offsetHeight>2&&!(a&&s<8))}var n=je?O("span","​"):O("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Le(e){if(null!=Oe)return Oe;var t=j(e,document.createTextNode("AخA")),n=_(t,0,1).getBoundingClientRect(),r=_(t,1,2).getBoundingClientRect();return T(e),!(!n||n.left==n.right)&&(Oe=r.right-n.right<3)}var Pe,Ae=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(n.push(o.slice(0,a)),t+=a+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},De=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Re="oncopy"in(Pe=O("div"))||(Pe.setAttribute("oncopy","return;"),"function"==typeof Pe.oncopy),Ie=null;function Fe(e){if(null!=Ie)return Ie;var t=j(e,O("span","x")),n=t.getBoundingClientRect(),r=_(t,0,1).getBoundingClientRect();return Ie=Math.abs(n.left-r.left)>1}var ze={},He={};function Ue(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),ze[e]=t}function Be(e,t){He[e]=t}function We(e){if("string"==typeof e&&He.hasOwnProperty(e))e=He[e];else if(e&&"string"==typeof e.name&&He.hasOwnProperty(e.name)){var t=He[e.name];"string"==typeof t&&(t={name:t}),(e=Z(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return We("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return We("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function $e(e,t){t=We(t);var n=ze[t.name];if(!n)return $e(e,"text/plain");var r=n(e,t);if(Ve.hasOwnProperty(t.name)){var i=Ve[t.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)r[a]=t.modeProps[a];return r}var Ve={};function qe(e,t){I(t,Ve.hasOwnProperty(e)?Ve[e]:Ve[e]={})}function Ge(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function Ye(e,t){for(var n;e.innerMode&&(n=e.innerMode(t))&&n.mode!=e;)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Xe(e,t,n){return!e.startState||e.startState(t,n)}var Ke=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function Qe(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t<o){n=i;break}t-=o}return n.lines[t]}function Je(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,(function(e){var o=e.text;i==n.line&&(o=o.slice(0,n.ch)),i==t.line&&(o=o.slice(t.ch)),r.push(o),++i})),r}function Ze(e,t,n){var r=[];return e.iter(t,n,(function(e){r.push(e.text)})),r}function et(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function tt(e){if(null==e.parent)return null;for(var t=e.parent,n=H(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function nt(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],o=i.height;if(t<o){e=i;continue e}t-=o,n+=i.chunkSize()}return n}while(!e.lines);for(var a=0;a<e.lines.length;++a){var s=e.lines[a].height;if(t<s)break;t-=s}return n+a}function rt(e,t){return t>=e.first&&t<e.first+e.size}function it(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function ot(e,t,n){if(void 0===n&&(n=null),!(this instanceof ot))return new ot(e,t,n);this.line=e,this.ch=t,this.sticky=n}function at(e,t){return e.line-t.line||e.ch-t.ch}function st(e,t){return e.sticky==t.sticky&&0==at(e,t)}function lt(e){return ot(e.line,e.ch)}function ut(e,t){return at(e,t)<0?t:e}function ct(e,t){return at(e,t)<0?e:t}function dt(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function ft(e,t){if(t.line<e.first)return ot(e.first,0);var n=e.first+e.size-1;return t.line>n?ot(n,Qe(e,n).text.length):pt(t,Qe(e,t.line).text.length)}function pt(e,t){var n=e.ch;return null==n||n>t?ot(e.line,t):n<0?ot(e.line,0):e}function ht(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=ft(e,t[r]);return n}Ke.prototype.eol=function(){return this.pos>=this.string.length},Ke.prototype.sol=function(){return this.pos==this.lineStart},Ke.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ke.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Ke.prototype.eat=function(e){var t=this.string.charAt(this.pos);if("string"==typeof e?t==e:t&&(e.test?e.test(t):e(t)))return++this.pos,t},Ke.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Ke.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ke.prototype.skipToEnd=function(){this.pos=this.string.length},Ke.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ke.prototype.backUp=function(e){this.pos-=e},Ke.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=F(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?F(this.string,this.lineStart,this.tabSize):0)},Ke.prototype.indentation=function(){return F(this.string,null,this.tabSize)-(this.lineStart?F(this.string,this.lineStart,this.tabSize):0)},Ke.prototype.match=function(e,t,n){if("string"!=typeof e){var r=this.string.slice(this.pos).match(e);return r&&r.index>0?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}var i=function(e){return n?e.toLowerCase():e};if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(this.pos+=e.length),!0},Ke.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ke.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ke.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ke.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var mt=function(e,t){this.state=e,this.lookAhead=t},vt=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};function gt(e,t,n,r){var i=[e.state.modeGen],o={};Et(e,t.text,e.doc.mode,n,(function(e,t){return i.push(e,t)}),o,r);for(var a=n.state,s=function(r){n.baseTokens=i;var s=e.state.overlays[r],l=1,u=0;n.state=!0,Et(e,t.text,s.mode,n,(function(e,t){for(var n=l;u<e;){var r=i[l];r>e&&i.splice(l,1,e,i[l+1],r),l+=2,u=Math.min(e,r)}if(t)if(s.opaque)i.splice(n,l-n,e,"overlay "+t),l=n+2;else for(;n<l;n+=2){var o=i[n+1];i[n+1]=(o?o+" ":"")+"overlay "+t}}),o),n.state=a,n.baseTokens=null,n.baseTokenPos=1},l=0;l<e.state.overlays.length;++l)s(l);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function yt(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=bt(e,tt(t)),i=t.text.length>e.options.maxHighlightLength&&Ge(e.doc.mode,r.state),o=gt(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function bt(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new vt(r,!0,t);var o=Tt(e,t,n),a=o>r.first&&Qe(r,o-1).stateAfter,s=a?vt.fromSaved(r,a,o):new vt(r,Xe(r.mode),o);return r.iter(o,t,(function(n){wt(e,n.text,s);var r=s.line;n.stateAfter=r==t-1||r%5==0||r>=i.viewFrom&&r<i.viewTo?s.save():null,s.nextLine()})),n&&(r.modeFrontier=s.line),s}function wt(e,t,n,r){var i=e.doc.mode,o=new Ke(t,e.options.tabSize,n);for(o.start=o.pos=r||0,""==t&&xt(i,n.state);!o.eol();)kt(i,o,n.state),o.start=o.pos}function xt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=Ye(e,t);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function kt(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=Ye(e,n).mode);var o=e.token(t,n);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}vt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},vt.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},vt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},vt.fromSaved=function(e,t,n){return t instanceof mt?new vt(e,Ge(e.mode,t.state),n,t.lookAhead):new vt(e,Ge(e.mode,t),n)},vt.prototype.save=function(e){var t=!1!==e?Ge(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new mt(t,this.maxLookAhead):t};var St=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function Ct(e,t,n,r){var i,o,a=e.doc,s=a.mode,l=Qe(a,(t=ft(a,t)).line),u=bt(e,t.line,n),c=new Ke(l.text,e.options.tabSize,u);for(r&&(o=[]);(r||c.pos<t.ch)&&!c.eol();)c.start=c.pos,i=kt(s,c,u.state),r&&o.push(new St(c,i,Ge(a.mode,u.state)));return r?o:new St(c,i,u.state)}function _t(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";null==t[r]?t[r]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+n[2])}return e}function Et(e,t,n,r,i,o,a){var s=n.flattenSpans;null==s&&(s=e.options.flattenSpans);var l,u=0,c=null,d=new Ke(t,e.options.tabSize,r),f=e.options.addModeClass&&[null];for(""==t&&_t(xt(n,r.state),o);!d.eol();){if(d.pos>e.options.maxHighlightLength?(s=!1,a&&wt(e,t,r,d.pos),d.pos=t.length,l=null):l=_t(kt(n,d,r.state,f),o),f){var p=f[0].name;p&&(l="m-"+(l?p+" "+l:p))}if(!s||c!=l){for(;u<d.start;)i(u=Math.min(d.start,u+5e3),c);c=l}d.start=d.pos}for(;u<d.pos;){var h=Math.min(d.pos,u+5e3);i(h,c),u=h}}function Tt(e,t,n){for(var r,i,o=e.doc,a=n?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>a;--s){if(s<=o.first)return o.first;var l=Qe(o,s-1),u=l.stateAfter;if(u&&(!n||s+(u instanceof mt?u.lookAhead:0)<=o.modeFrontier))return s;var c=F(l.text,null,e.options.tabSize);(null==i||r>c)&&(i=s-1,r=c)}return i}function jt(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var n=e.first,r=t-1;r>n;r--){var i=Qe(e,r).stateAfter;if(i&&(!(i instanceof mt)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}var Ot=!1,Nt=!1;function Mt(){Ot=!0}function Lt(){Nt=!0}function Pt(e,t,n){this.marker=e,this.from=t,this.to=n}function At(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function Dt(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function Rt(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function It(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker;if(null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t)||o.from==t&&"bookmark"==a.type&&(!n||!o.marker.insertLeft)){var s=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);(r||(r=[])).push(new Pt(a,o.from,s?null:o.to))}}return r}function Ft(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker;if(null==o.to||(a.inclusiveRight?o.to>=t:o.to>t)||o.from==t&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);(r||(r=[])).push(new Pt(a,s?null:o.from-t,null==o.to?null:o.to-t))}}return r}function zt(e,t){if(t.full)return null;var n=rt(e,t.from.line)&&Qe(e,t.from.line).markedSpans,r=rt(e,t.to.line)&&Qe(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,o=t.to.ch,a=0==at(t.from,t.to),s=It(n,i,a),l=Ft(r,o,a),u=1==t.text.length,c=X(t.text).length+(u?i:0);if(s)for(var d=0;d<s.length;++d){var f=s[d];if(null==f.to){var p=At(l,f.marker);p?u&&(f.to=null==p.to?null:p.to+c):f.to=i}}if(l)for(var h=0;h<l.length;++h){var m=l[h];null!=m.to&&(m.to+=c),null==m.from?At(s,m.marker)||(m.from=c,u&&(s||(s=[])).push(m)):(m.from+=c,u&&(s||(s=[])).push(m))}s&&(s=Ht(s)),l&&l!=s&&(l=Ht(l));var v=[s];if(!u){var g,y=t.text.length-2;if(y>0&&s)for(var b=0;b<s.length;++b)null==s[b].to&&(g||(g=[])).push(new Pt(s[b].marker,null,null));for(var w=0;w<y;++w)v.push(g);v.push(l)}return v}function Ht(e){for(var t=0;t<e.length;++t){var n=e[t];null!=n.from&&n.from==n.to&&!1!==n.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function Ut(e,t,n){var r=null;if(e.iter(t.line,n.line+1,(function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var n=e.markedSpans[t].marker;!n.readOnly||r&&-1!=H(r,n)||(r||(r=[])).push(n)}})),!r)return null;for(var i=[{from:t,to:n}],o=0;o<r.length;++o)for(var a=r[o],s=a.find(0),l=0;l<i.length;++l){var u=i[l];if(!(at(u.to,s.from)<0||at(u.from,s.to)>0)){var c=[l,1],d=at(u.from,s.from),f=at(u.to,s.to);(d<0||!a.inclusiveLeft&&!d)&&c.push({from:u.from,to:s.from}),(f>0||!a.inclusiveRight&&!f)&&c.push({from:s.to,to:u.to}),i.splice.apply(i,c),l+=c.length-3}}return i}function Bt(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function Wt(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function $t(e){return e.inclusiveLeft?-1:0}function Vt(e){return e.inclusiveRight?1:0}function qt(e,t){var n=e.lines.length-t.lines.length;if(0!=n)return n;var r=e.find(),i=t.find(),o=at(r.from,i.from)||$t(e)-$t(t);if(o)return-o;var a=at(r.to,i.to)||Vt(e)-Vt(t);return a||t.id-e.id}function Gt(e,t){var n,r=Nt&&e.markedSpans;if(r)for(var i=void 0,o=0;o<r.length;++o)(i=r[o]).marker.collapsed&&null==(t?i.from:i.to)&&(!n||qt(n,i.marker)<0)&&(n=i.marker);return n}function Yt(e){return Gt(e,!0)}function Xt(e){return Gt(e,!1)}function Kt(e,t){var n,r=Nt&&e.markedSpans;if(r)for(var i=0;i<r.length;++i){var o=r[i];o.marker.collapsed&&(null==o.from||o.from<t)&&(null==o.to||o.to>t)&&(!n||qt(n,o.marker)<0)&&(n=o.marker)}return n}function Qt(e,t,n,r,i){var o=Qe(e,t),a=Nt&&o.markedSpans;if(a)for(var s=0;s<a.length;++s){var l=a[s];if(l.marker.collapsed){var u=l.marker.find(0),c=at(u.from,n)||$t(l.marker)-$t(i),d=at(u.to,r)||Vt(l.marker)-Vt(i);if(!(c>=0&&d<=0||c<=0&&d>=0)&&(c<=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?at(u.to,n)>=0:at(u.to,n)>0)||c>=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?at(u.from,r)<=0:at(u.from,r)<0)))return!0}}}function Jt(e){for(var t;t=Yt(e);)e=t.find(-1,!0).line;return e}function Zt(e){for(var t;t=Xt(e);)e=t.find(1,!0).line;return e}function en(e){for(var t,n;t=Xt(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function tn(e,t){var n=Qe(e,t),r=Jt(n);return n==r?t:tt(r)}function nn(e,t){if(t>e.lastLine())return t;var n,r=Qe(e,t);if(!rn(e,r))return t;for(;n=Xt(r);)r=n.find(1,!0).line;return tt(r)+1}function rn(e,t){var n=Nt&&t.markedSpans;if(n)for(var r=void 0,i=0;i<n.length;++i)if((r=n[i]).marker.collapsed){if(null==r.from)return!0;if(!r.marker.widgetNode&&0==r.from&&r.marker.inclusiveLeft&&on(e,t,r))return!0}}function on(e,t,n){if(null==n.to){var r=n.marker.find(1,!0);return on(e,r.line,At(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if((i=t.markedSpans[o]).marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(null==i.to||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&on(e,t,i))return!0}function an(e){for(var t=0,n=(e=Jt(e)).parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var o=n.parent;o;o=(n=o).parent)for(var a=0;a<o.children.length;++a){var s=o.children[a];if(s==n)break;t+=s.height}return t}function sn(e){if(0==e.height)return 0;for(var t,n=e.text.length,r=e;t=Yt(r);){var i=t.find(0,!0);r=i.from.line,n+=i.from.ch-i.to.ch}for(r=e;t=Xt(r);){var o=t.find(0,!0);n-=r.text.length-o.from.ch,n+=(r=o.to.line).text.length-o.to.ch}return n}function ln(e){var t=e.display,n=e.doc;t.maxLine=Qe(n,n.first),t.maxLineLength=sn(t.maxLine),t.maxLineChanged=!0,n.iter((function(e){var n=sn(e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)}))}var un=function(e,t,n){this.text=e,Wt(this,t),this.height=n?n(this):1};function cn(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Bt(e),Wt(e,n);var i=r?r(e):1;i!=e.height&&et(e,i)}function dn(e){e.parent=null,Bt(e)}un.prototype.lineNo=function(){return tt(this)},xe(un);var fn={},pn={};function hn(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?pn:fn;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function mn(e,t){var n=N("span",null,null,l?"padding-right: .1px":null),r={pre:N("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,a=void 0;r.pos=0,r.addToken=gn,Le(e.display.measure)&&(a=fe(o,e.doc.direction))&&(r.addToken=bn(r.addToken,a)),r.map=[],xn(o,r,yt(e,o,t!=e.display.externalMeasured&&tt(o))),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=A(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=A(o.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Me(e.display.measure))),0==i?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(l){var s=r.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return ge(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=A(r.pre.className,r.textClass||"")),r}function vn(e){var t=O("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function gn(e,t,n,r,i,o,l){if(t){var u,c=e.splitSpaces?yn(t,e.trailingSpace):t,d=e.cm.state.specialChars,f=!1;if(d.test(t)){u=document.createDocumentFragment();for(var p=0;;){d.lastIndex=p;var h=d.exec(t),m=h?h.index-p:t.length-p;if(m){var v=document.createTextNode(c.slice(p,p+m));a&&s<9?u.appendChild(O("span",[v])):u.appendChild(v),e.map.push(e.pos,e.pos+m,v),e.col+=m,e.pos+=m}if(!h)break;p+=m+1;var g=void 0;if("\t"==h[0]){var y=e.cm.options.tabSize,b=y-e.col%y;(g=u.appendChild(O("span",Y(b),"cm-tab"))).setAttribute("role","presentation"),g.setAttribute("cm-text","\t"),e.col+=b}else"\r"==h[0]||"\n"==h[0]?((g=u.appendChild(O("span","\r"==h[0]?"␍":"␤","cm-invalidchar"))).setAttribute("cm-text",h[0]),e.col+=1):((g=e.cm.options.specialCharPlaceholder(h[0])).setAttribute("cm-text",h[0]),a&&s<9?u.appendChild(O("span",[g])):u.appendChild(g),e.col+=1);e.map.push(e.pos,e.pos+1,g),e.pos++}}else e.col+=t.length,u=document.createTextNode(c),e.map.push(e.pos,e.pos+t.length,u),a&&s<9&&(f=!0),e.pos+=t.length;if(e.trailingSpace=32==c.charCodeAt(t.length-1),n||r||i||f||o||l){var w=n||"";r&&(w+=r),i&&(w+=i);var x=O("span",[u],w,o);if(l)for(var k in l)l.hasOwnProperty(k)&&"style"!=k&&"class"!=k&&x.setAttribute(k,l[k]);return e.content.appendChild(x)}e.content.appendChild(u)}}function yn(e,t){if(e.length>1&&!/  /.test(e))return e;for(var n=t,r="",i=0;i<e.length;i++){var o=e.charAt(i);" "!=o||!n||i!=e.length-1&&32!=e.charCodeAt(i+1)||(o=" "),r+=o,n=" "==o}return r}function bn(e,t){return function(n,r,i,o,a,s,l){i=i?i+" cm-force-border":"cm-force-border";for(var u=n.pos,c=u+r.length;;){for(var d=void 0,f=0;f<t.length&&!((d=t[f]).to>u&&d.from<=u);f++);if(d.to>=c)return e(n,r,i,o,a,s,l);e(n,r.slice(0,d.to-u),i,o,null,s,l),o=null,r=r.slice(d.to-u),u=d.to}}}function wn(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function xn(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var a,s,l,u,c,d,f,p=i.length,h=0,m=1,v="",g=0;;){if(g==h){l=u=c=s="",f=null,d=null,g=1/0;for(var y=[],b=void 0,w=0;w<r.length;++w){var x=r[w],k=x.marker;if("bookmark"==k.type&&x.from==h&&k.widgetNode)y.push(k);else if(x.from<=h&&(null==x.to||x.to>h||k.collapsed&&x.to==h&&x.from==h)){if(null!=x.to&&x.to!=h&&g>x.to&&(g=x.to,u=""),k.className&&(l+=" "+k.className),k.css&&(s=(s?s+";":"")+k.css),k.startStyle&&x.from==h&&(c+=" "+k.startStyle),k.endStyle&&x.to==g&&(b||(b=[])).push(k.endStyle,x.to),k.title&&((f||(f={})).title=k.title),k.attributes)for(var S in k.attributes)(f||(f={}))[S]=k.attributes[S];k.collapsed&&(!d||qt(d.marker,k)<0)&&(d=x)}else x.from>h&&g>x.from&&(g=x.from)}if(b)for(var C=0;C<b.length;C+=2)b[C+1]==g&&(u+=" "+b[C]);if(!d||d.from==h)for(var _=0;_<y.length;++_)wn(t,0,y[_]);if(d&&(d.from||0)==h){if(wn(t,(null==d.to?p+1:d.to)-h,d.marker,null==d.from),null==d.to)return;d.to==h&&(d=!1)}}if(h>=p)break;for(var E=Math.min(p,g);;){if(v){var T=h+v.length;if(!d){var j=T>E?v.slice(0,E-h):v;t.addToken(t,j,a?a+l:l,c,h+j.length==g?u:"",s,f)}if(T>=E){v=v.slice(E-h),h=E;break}h=T,c=""}v=i.slice(o,o=n[m++]),a=hn(n[m++],t.cm.options)}}else for(var O=1;O<n.length;O+=2)t.addToken(t,i.slice(o,o=n[O]),hn(n[O+1],t.cm.options))}function kn(e,t,n){this.line=t,this.rest=en(t),this.size=this.rest?tt(X(this.rest))-n+1:1,this.node=this.text=null,this.hidden=rn(e,t)}function Sn(e,t,n){for(var r,i=[],o=t;o<n;o=r){var a=new kn(e.doc,Qe(e.doc,o),o);r=o+a.size,i.push(a)}return i}var Cn=null;function _n(e){Cn?Cn.ops.push(e):e.ownsGroup=Cn={ops:[e],delayedCallbacks:[]}}function En(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}function Tn(e,t){var n=e.ownsGroup;if(n)try{En(n)}finally{Cn=null,t(n)}}var jn=null;function On(e,t){var n=me(e,t);if(n.length){var r,i=Array.prototype.slice.call(arguments,2);Cn?r=Cn.delayedCallbacks:jn?r=jn:(r=jn=[],setTimeout(Nn,0));for(var o=function(e){r.push((function(){return n[e].apply(null,i)}))},a=0;a<n.length;++a)o(a)}}function Nn(){var e=jn;jn=null;for(var t=0;t<e.length;++t)e[t]()}function Mn(e,t,n,r){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?Dn(e,t):"gutter"==o?In(e,t,n,r):"class"==o?Rn(e,t):"widget"==o&&Fn(e,t,r)}t.changes=null}function Ln(e){return e.node==e.text&&(e.node=O("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),a&&s<8&&(e.node.style.zIndex=2)),e.node}function Pn(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var r=Ln(t);t.background=r.insertBefore(O("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}}function An(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):mn(e,t)}function Dn(e,t){var n=t.text.className,r=An(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,Rn(e,t)):n&&(t.text.className=n)}function Rn(e,t){Pn(e,t),t.line.wrapClass?Ln(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var n=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=n||""}function In(e,t,n,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=Ln(t);t.gutterBackground=O("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var a=Ln(t),s=t.gutter=O("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(e.display.input.setUneditable(s),a.insertBefore(s,t.text),t.line.gutterClass&&(s.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=s.appendChild(O("div",it(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var l=0;l<e.display.gutterSpecs.length;++l){var u=e.display.gutterSpecs[l].className,c=o.hasOwnProperty(u)&&o[u];c&&s.appendChild(O("div",[c],"CodeMirror-gutter-elt","left: "+r.gutterLeft[u]+"px; width: "+r.gutterWidth[u]+"px"))}}}function Fn(e,t,n){t.alignable&&(t.alignable=null);for(var r=C("CodeMirror-linewidget"),i=t.node.firstChild,o=void 0;i;i=o)o=i.nextSibling,r.test(i.className)&&t.node.removeChild(i);Hn(e,t,n)}function zn(e,t,n,r){var i=An(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),Rn(e,t),In(e,t,n,r),Hn(e,t,r),t.node}function Hn(e,t,n){if(Un(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)Un(e,t.rest[r],t,n,!1)}function Un(e,t,n,r,i){if(t.widgets)for(var o=Ln(n),a=0,s=t.widgets;a<s.length;++a){var l=s[a],u=O("div",[l.node],"CodeMirror-linewidget"+(l.className?" "+l.className:""));l.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),Bn(l,u,n,r),e.display.input.setUneditable(u),i&&l.above?o.insertBefore(u,n.gutter||n.text):o.appendChild(u),On(l,"redraw")}}function Bn(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function Wn(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!M(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),j(t.display.measure,O("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function $n(e,t){for(var n=Ee(t);n!=e.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==e.sizer&&n!=e.mover)return!0}function Vn(e){return e.lineSpace.offsetTop}function qn(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Gn(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=j(e.measure,O("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return isNaN(r.left)||isNaN(r.right)||(e.cachedPaddingH=r),r}function Yn(e){return U-e.display.nativeBarWidth}function Xn(e){return e.display.scroller.clientWidth-Yn(e)-e.display.barWidth}function Kn(e){return e.display.scroller.clientHeight-Yn(e)-e.display.barHeight}function Qn(e,t,n){var r=e.options.lineWrapping,i=r&&Xn(e);if(!t.measure.heights||r&&t.measure.width!=i){var o=t.measure.heights=[];if(r){t.measure.width=i;for(var a=t.text.firstChild.getClientRects(),s=0;s<a.length-1;s++){var l=a[s],u=a[s+1];Math.abs(l.bottom-u.bottom)>2&&o.push((l.bottom+u.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Jn(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var i=0;i<e.rest.length;i++)if(tt(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Zn(e,t){var n=tt(t=Jt(t)),r=e.display.externalMeasured=new kn(e.doc,t,n);r.lineN=n;var i=r.built=mn(e,r);return r.text=i.pre,j(e.display.lineMeasure,i.pre),r}function er(e,t,n,r){return rr(e,nr(e,t),n,r)}function tr(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Rr(e,t)];var n=e.display.externalMeasured;return n&&t>=n.lineN&&t<n.lineN+n.size?n:void 0}function nr(e,t){var n=tt(t),r=tr(e,n);r&&!r.text?r=null:r&&r.changes&&(Mn(e,r,n,Mr(e)),e.curOp.forceUpdate=!0),r||(r=Zn(e,t));var i=Jn(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function rr(e,t,n,r,i){t.before&&(n=-1);var o,a=n+(r||"");return t.cache.hasOwnProperty(a)?o=t.cache[a]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Qn(e,t.view,t.rect),t.hasHeights=!0),(o=lr(e,t,n,r)).bogus||(t.cache[a]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}var ir,or={left:0,right:0,top:0,bottom:0};function ar(e,t,n){for(var r,i,o,a,s,l,u=0;u<e.length;u+=3)if(s=e[u],l=e[u+1],t<s?(i=0,o=1,a="left"):t<l?o=1+(i=t-s):(u==e.length-3||t==l&&e[u+3]>t)&&(i=(o=l-s)-1,t>=l&&(a="right")),null!=i){if(r=e[u+2],s==l&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==i)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)r=e[2+(u-=3)],a="left";if("right"==n&&i==l-s)for(;u<e.length-3&&e[u+3]==e[u+4]&&!e[u+5].insertLeft;)r=e[(u+=3)+2],a="right";break}return{node:r,start:i,end:o,collapse:a,coverStart:s,coverEnd:l}}function sr(e,t){var n=or;if("left"==t)for(var r=0;r<e.length&&(n=e[r]).left==n.right;r++);else for(var i=e.length-1;i>=0&&(n=e[i]).left==n.right;i--);return n}function lr(e,t,n,r){var i,o=ar(t.map,n,r),l=o.node,u=o.start,c=o.end,d=o.collapse;if(3==l.nodeType){for(var f=0;f<4;f++){for(;u&&oe(t.line.text.charAt(o.coverStart+u));)--u;for(;o.coverStart+c<o.coverEnd&&oe(t.line.text.charAt(o.coverStart+c));)++c;if((i=a&&s<9&&0==u&&c==o.coverEnd-o.coverStart?l.parentNode.getBoundingClientRect():sr(_(l,u,c).getClientRects(),r)).left||i.right||0==u)break;c=u,u-=1,d="right"}a&&s<11&&(i=ur(e.display.measure,i))}else{var p;u>0&&(d=r="right"),i=e.options.lineWrapping&&(p=l.getClientRects()).length>1?p["right"==r?p.length-1:0]:l.getBoundingClientRect()}if(a&&s<9&&!u&&(!i||!i.left&&!i.right)){var h=l.parentNode.getClientRects()[0];i=h?{left:h.left,right:h.left+Nr(e.display),top:h.top,bottom:h.bottom}:or}for(var m=i.top-t.rect.top,v=i.bottom-t.rect.top,g=(m+v)/2,y=t.view.measure.heights,b=0;b<y.length-1&&!(g<y[b]);b++);var w=b?y[b-1]:0,x=y[b],k={left:("right"==d?i.right:i.left)-t.rect.left,right:("left"==d?i.left:i.right)-t.rect.left,top:w,bottom:x};return i.left||i.right||(k.bogus=!0),e.options.singleCursorHeightPerLine||(k.rtop=m,k.rbottom=v),k}function ur(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!Fe(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}function cr(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function dr(e){e.display.externalMeasure=null,T(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)cr(e.display.view[t])}function fr(e){dr(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function pr(){return c&&v?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function hr(){return c&&v?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function mr(e){var t=0;if(e.widgets)for(var n=0;n<e.widgets.length;++n)e.widgets[n].above&&(t+=Wn(e.widgets[n]));return t}function vr(e,t,n,r,i){if(!i){var o=mr(t);n.top+=o,n.bottom+=o}if("line"==r)return n;r||(r="local");var a=an(t);if("local"==r?a+=Vn(e.display):a-=e.display.viewOffset,"page"==r||"window"==r){var s=e.display.lineSpace.getBoundingClientRect();a+=s.top+("window"==r?0:hr());var l=s.left+("window"==r?0:pr());n.left+=l,n.right+=l}return n.top+=a,n.bottom+=a,n}function gr(e,t,n){if("div"==n)return t;var r=t.left,i=t.top;if("page"==n)r-=pr(),i-=hr();else if("local"==n||!n){var o=e.display.sizer.getBoundingClientRect();r+=o.left,i+=o.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:r-a.left,top:i-a.top}}function yr(e,t,n,r,i){return r||(r=Qe(e.doc,t.line)),vr(e,r,er(e,r,t.ch,i),n)}function br(e,t,n,r,i,o){function a(t,a){var s=rr(e,i,t,a?"right":"left",o);return a?s.left=s.right:s.right=s.left,vr(e,r,s,n)}r=r||Qe(e.doc,t.line),i||(i=nr(e,r));var s=fe(r,e.doc.direction),l=t.ch,u=t.sticky;if(l>=r.text.length?(l=r.text.length,u="before"):l<=0&&(l=0,u="after"),!s)return a("before"==u?l-1:l,"before"==u);function c(e,t,n){return a(n?e-1:e,1==s[t].level!=n)}var d=ce(s,l,u),f=ue,p=c(l,d,"before"==u);return null!=f&&(p.other=c(l,f,"before"!=u)),p}function wr(e,t){var n=0;t=ft(e.doc,t),e.options.lineWrapping||(n=Nr(e.display)*t.ch);var r=Qe(e.doc,t.line),i=an(r)+Vn(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function xr(e,t,n,r,i){var o=ot(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function kr(e,t,n){var r=e.doc;if((n+=e.display.viewOffset)<0)return xr(r.first,0,null,-1,-1);var i=nt(r,n),o=r.first+r.size-1;if(i>o)return xr(r.first+r.size-1,Qe(r,o).text.length,null,1,1);t<0&&(t=0);for(var a=Qe(r,i);;){var s=Er(e,a,i,t,n),l=Kt(a,s.ch+(s.xRel>0||s.outside>0?1:0));if(!l)return s;var u=l.find(1);if(u.line==i)return u;a=Qe(r,i=u.line)}}function Sr(e,t,n,r){r-=mr(t);var i=t.text.length,o=se((function(t){return rr(e,n,t-1).bottom<=r}),i,0);return{begin:o,end:i=se((function(t){return rr(e,n,t).top>r}),o,i)}}function Cr(e,t,n,r){return n||(n=nr(e,t)),Sr(e,t,n,vr(e,t,rr(e,n,r),"line").top)}function _r(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function Er(e,t,n,r,i){i-=an(t);var o=nr(e,t),a=mr(t),s=0,l=t.text.length,u=!0,c=fe(t,e.doc.direction);if(c){var d=(e.options.lineWrapping?jr:Tr)(e,t,n,o,c,r,i);s=(u=1!=d.level)?d.from:d.to-1,l=u?d.to:d.from-1}var f,p,h=null,m=null,v=se((function(t){var n=rr(e,o,t);return n.top+=a,n.bottom+=a,!!_r(n,r,i,!1)&&(n.top<=i&&n.left<=r&&(h=t,m=n),!0)}),s,l),g=!1;if(m){var y=r-m.left<m.right-r,b=y==u;v=h+(b?0:1),p=b?"after":"before",f=y?m.left:m.right}else{u||v!=l&&v!=s||v++,p=0==v?"after":v==t.text.length?"before":rr(e,o,v-(u?1:0)).bottom+a<=i==u?"after":"before";var w=br(e,ot(n,v,p),"line",t,o);f=w.left,g=i<w.top?-1:i>=w.bottom?1:0}return xr(n,v=ae(t.text,v,1),p,g,r-f)}function Tr(e,t,n,r,i,o,a){var s=se((function(s){var l=i[s],u=1!=l.level;return _r(br(e,ot(n,u?l.to:l.from,u?"before":"after"),"line",t,r),o,a,!0)}),0,i.length-1),l=i[s];if(s>0){var u=1!=l.level,c=br(e,ot(n,u?l.from:l.to,u?"after":"before"),"line",t,r);_r(c,o,a,!0)&&c.top>a&&(l=i[s-1])}return l}function jr(e,t,n,r,i,o,a){var s=Sr(e,t,r,a),l=s.begin,u=s.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var c=null,d=null,f=0;f<i.length;f++){var p=i[f];if(!(p.from>=u||p.to<=l)){var h=rr(e,r,1!=p.level?Math.min(u,p.to)-1:Math.max(l,p.from)).right,m=h<o?o-h+1e9:h-o;(!c||d>m)&&(c=p,d=m)}}return c||(c=i[i.length-1]),c.from<l&&(c={from:l,to:c.to,level:c.level}),c.to>u&&(c={from:c.from,to:u,level:c.level}),c}function Or(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==ir){ir=O("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)ir.appendChild(document.createTextNode("x")),ir.appendChild(O("br"));ir.appendChild(document.createTextNode("x"))}j(e.measure,ir);var n=ir.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),T(e.measure),n||1}function Nr(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=O("span","xxxxxxxxxx"),n=O("pre",[t],"CodeMirror-line-like");j(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function Mr(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var s=e.display.gutterSpecs[a].className;n[s]=o.offsetLeft+o.clientLeft+i,r[s]=o.clientWidth}return{fixedPos:Lr(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Lr(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Pr(e){var t=Or(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Nr(e.display)-3);return function(i){if(rn(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a<i.widgets.length;a++)i.widgets[a].height&&(o+=i.widgets[a].height);return n?o+(Math.ceil(i.text.length/r)||1)*t:o+t}}function Ar(e){var t=e.doc,n=Pr(e);t.iter((function(e){var t=n(e);t!=e.height&&et(e,t)}))}function Dr(e,t,n,r){var i=e.display;if(!n&&"true"==Ee(t).getAttribute("cm-not-content"))return null;var o,a,s=i.lineSpace.getBoundingClientRect();try{o=t.clientX-s.left,a=t.clientY-s.top}catch(e){return null}var l,u=kr(e,o,a);if(r&&u.xRel>0&&(l=Qe(e.doc,u.line).text).length==u.ch){var c=F(l,l.length,e.options.tabSize)-l.length;u=ot(u.line,Math.max(0,Math.round((o-Gn(e.display).left)/Nr(e.display))-c))}return u}function Rr(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,r=0;r<n.length;r++)if((t-=n[r].size)<0)return r}function Ir(e,t,n,r){null==t&&(t=e.doc.first),null==n&&(n=e.doc.first+e.doc.size),r||(r=0);var i=e.display;if(r&&n<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Nt&&tn(e.doc,t)<i.viewTo&&zr(e);else if(n<=i.viewFrom)Nt&&nn(e.doc,n+r)>i.viewFrom?zr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)zr(e);else if(t<=i.viewFrom){var o=Hr(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):zr(e)}else if(n>=i.viewTo){var a=Hr(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):zr(e)}else{var s=Hr(e,t,t,-1),l=Hr(e,n,n+r,1);s&&l?(i.view=i.view.slice(0,s.index).concat(Sn(e,s.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=r):zr(e)}var u=i.externalMeasured;u&&(n<u.lineN?u.lineN+=r:t<u.lineN+u.size&&(i.externalMeasured=null))}function Fr(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var o=r.view[Rr(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==H(a,n)&&a.push(n)}}}function zr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Hr(e,t,n,r){var i,o=Rr(e,t),a=e.display.view;if(!Nt||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var s=e.display.viewFrom,l=0;l<o;l++)s+=a[l].size;if(s!=t){if(r>0){if(o==a.length-1)return null;i=s+a[o].size-t,o++}else i=s-t;t+=i,n+=i}for(;tn(e.doc,n)!=n;){if(o==(r<0?0:a.length-1))return null;n+=r*a[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}function Ur(e,t,n){var r=e.display;0==r.view.length||t>=r.viewTo||n<=r.viewFrom?(r.view=Sn(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=Sn(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(Rr(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(Sn(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,Rr(e,n)))),r.viewTo=n}function Br(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];i.hidden||i.node&&!i.changes||++n}return n}function Wr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function $r(e,t){void 0===t&&(t=!0);for(var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),o=r.selection=document.createDocumentFragment(),a=0;a<n.sel.ranges.length;a++)if(t||a!=n.sel.primIndex){var s=n.sel.ranges[a];if(!(s.from().line>=e.display.viewTo||s.to().line<e.display.viewFrom)){var l=s.empty();(l||e.options.showCursorWhenSelecting)&&Vr(e,s.head,i),l||Gr(e,s,o)}}return r}function Vr(e,t,n){var r=br(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(O("div"," ","CodeMirror-cursor"));if(i.style.left=r.left+"px",i.style.top=r.top+"px",i.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",r.other){var o=n.appendChild(O("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=r.other.left+"px",o.style.top=r.other.top+"px",o.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function qr(e,t){return e.top-t.top||e.left-t.left}function Gr(e,t,n){var r=e.display,i=e.doc,o=document.createDocumentFragment(),a=Gn(e.display),s=a.left,l=Math.max(r.sizerWidth,Xn(e)-r.sizer.offsetLeft)-a.right,u="ltr"==i.direction;function c(e,t,n,r){t<0&&(t=0),t=Math.round(t),r=Math.round(r),o.appendChild(O("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n                             top: "+t+"px; width: "+(null==n?l-e:n)+"px;\n                             height: "+(r-t)+"px"))}function d(t,n,r){var o,a,d=Qe(i,t),f=d.text.length;function p(n,r){return yr(e,ot(t,n),"div",d,r)}function h(t,n,r){var i=Cr(e,d,null,t),o="ltr"==n==("after"==r)?"left":"right";return p("after"==r?i.begin:i.end-(/\s/.test(d.text.charAt(i.end-1))?2:1),o)[o]}var m=fe(d,i.direction);return le(m,n||0,null==r?f:r,(function(e,t,i,d){var v="ltr"==i,g=p(e,v?"left":"right"),y=p(t-1,v?"right":"left"),b=null==n&&0==e,w=null==r&&t==f,x=0==d,k=!m||d==m.length-1;if(y.top-g.top<=3){var S=(u?w:b)&&k,C=(u?b:w)&&x?s:(v?g:y).left,_=S?l:(v?y:g).right;c(C,g.top,_-C,g.bottom)}else{var E,T,j,O;v?(E=u&&b&&x?s:g.left,T=u?l:h(e,i,"before"),j=u?s:h(t,i,"after"),O=u&&w&&k?l:y.right):(E=u?h(e,i,"before"):s,T=!u&&b&&x?l:g.right,j=!u&&w&&k?s:y.left,O=u?h(t,i,"after"):l),c(E,g.top,T-E,g.bottom),g.bottom<y.top&&c(s,g.bottom,null,y.top),c(j,y.top,O-j,y.bottom)}(!o||qr(g,o)<0)&&(o=g),qr(y,o)<0&&(o=y),(!a||qr(g,a)<0)&&(a=g),qr(y,a)<0&&(a=y)})),{start:o,end:a}}var f=t.from(),p=t.to();if(f.line==p.line)d(f.line,f.ch,p.ch);else{var h=Qe(i,f.line),m=Qe(i,p.line),v=Jt(h)==Jt(m),g=d(f.line,f.ch,v?h.text.length+1:null).end,y=d(p.line,v?0:null,p.ch).start;v&&(g.top<y.top-2?(c(g.right,g.top,null,g.bottom),c(s,y.top,y.left,y.bottom)):c(g.right,g.top,y.left-g.right,g.bottom)),g.bottom<y.top&&c(s,g.bottom,null,y.top)}n.appendChild(o)}function Yr(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval((function(){e.hasFocus()||Jr(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Xr(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||Qr(e))}function Kr(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Jr(e))}),100)}function Qr(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(ge(e,"focus",e,t),e.state.focused=!0,P(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),l&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),Yr(e))}function Jr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(ge(e,"blur",e,t),e.state.focused=!1,E(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function Zr(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var i=t.view[r],o=e.options.lineWrapping,l=void 0,u=0;if(!i.hidden){if(a&&s<8){var c=i.node.offsetTop+i.node.offsetHeight;l=c-n,n=c}else{var d=i.node.getBoundingClientRect();l=d.bottom-d.top,!o&&i.text.firstChild&&(u=i.text.firstChild.getBoundingClientRect().right-d.left-1)}var f=i.line.height-l;if((f>.005||f<-.005)&&(et(i.line,l),ei(i.line),i.rest))for(var p=0;p<i.rest.length;p++)ei(i.rest[p]);if(u>e.display.sizerWidth){var h=Math.ceil(u/Nr(e.display));h>e.display.maxLineLength&&(e.display.maxLineLength=h,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}}function ei(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function ti(e,t,n){var r=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-Vn(e));var i=n&&null!=n.bottom?n.bottom:r+e.wrapper.clientHeight,o=nt(t,r),a=nt(t,i);if(n&&n.ensure){var s=n.ensure.from.line,l=n.ensure.to.line;s<o?(o=s,a=nt(t,an(Qe(t,s))+e.wrapper.clientHeight)):Math.min(l,t.lastLine())>=a&&(o=nt(t,an(Qe(t,l))-e.wrapper.clientHeight),a=l)}return{from:o,to:Math.max(a,o+1)}}function ni(e,t){if(!ye(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null;if(t.top+r.top<0?i=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!h){var o=O("div","​",null,"position: absolute;\n                         top: "+(t.top-n.viewOffset-Vn(e.display))+"px;\n                         height: "+(t.bottom-t.top+Yn(e)+n.barHeight)+"px;\n                         left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}function ri(e,t,n,r){var i;null==r&&(r=0),e.options.lineWrapping||t!=n||(n="before"==(t=t.ch?ot(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t).sticky?ot(t.line,t.ch+1,"before"):t);for(var o=0;o<5;o++){var a=!1,s=br(e,t),l=n&&n!=t?br(e,n):s,u=oi(e,i={left:Math.min(s.left,l.left),top:Math.min(s.top,l.top)-r,right:Math.max(s.left,l.left),bottom:Math.max(s.bottom,l.bottom)+r}),c=e.doc.scrollTop,d=e.doc.scrollLeft;if(null!=u.scrollTop&&(fi(e,u.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(a=!0)),null!=u.scrollLeft&&(hi(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-d)>1&&(a=!0)),!a)break}return i}function ii(e,t){var n=oi(e,t);null!=n.scrollTop&&fi(e,n.scrollTop),null!=n.scrollLeft&&hi(e,n.scrollLeft)}function oi(e,t){var n=e.display,r=Or(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,o=Kn(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var s=e.doc.height+qn(n),l=t.top<r,u=t.bottom>s-r;if(t.top<i)a.scrollTop=l?0:t.top;else if(t.bottom>i+o){var c=Math.min(t.top,(u?s:t.bottom)-o);c!=i&&(a.scrollTop=c)}var d=e.options.fixedGutter?0:n.gutters.offsetWidth,f=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft-d,p=Xn(e)-n.gutters.offsetWidth,h=t.right-t.left>p;return h&&(t.right=t.left+p),t.left<10?a.scrollLeft=0:t.left<f?a.scrollLeft=Math.max(0,t.left+d-(h?0:10)):t.right>p+f-3&&(a.scrollLeft=t.right+(h?0:10)-p),a}function ai(e,t){null!=t&&(ci(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function si(e){ci(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function li(e,t,n){null==t&&null==n||ci(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function ui(e,t){ci(e),e.curOp.scrollToPos=t}function ci(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,di(e,wr(e,t.from),wr(e,t.to),t.margin))}function di(e,t,n,r){var i=oi(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});li(e,i.scrollLeft,i.scrollTop)}function fi(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||Wi(e,{top:t}),pi(e,t,!0),n&&Wi(e),Di(e,100))}function pi(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function hi(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r||(e.doc.scrollLeft=t,Gi(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function mi(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+qn(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Yn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var vi=function(e,t,n){this.cm=n;var r=this.vert=O("div",[O("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=O("div",[O("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),he(r,"scroll",(function(){r.clientHeight&&t(r.scrollTop,"vertical")})),he(i,"scroll",(function(){i.clientWidth&&t(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,a&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};vi.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},vi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},vi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},vi.prototype.zeroWidthHack=function(){var e=y&&!p?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new z,this.disableVert=new z},vi.prototype.enableZeroWidthBar=function(e,t,n){function r(){var i=e.getBoundingClientRect();("vert"==n?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,r)}e.style.pointerEvents="auto",t.set(1e3,r)},vi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var gi=function(){};function yi(e,t){t||(t=mi(e));var n=e.display.barWidth,r=e.display.barHeight;bi(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&Zr(e),bi(e,mi(e)),n=e.display.barWidth,r=e.display.barHeight}function bi(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}gi.prototype.update=function(){return{bottom:0,right:0}},gi.prototype.setScrollLeft=function(){},gi.prototype.setScrollTop=function(){},gi.prototype.clear=function(){};var wi={native:vi,null:gi};function xi(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&E(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new wi[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),he(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,n){"horizontal"==n?hi(e,t):fi(e,t)}),e),e.display.scrollbars.addClass&&P(e.display.wrapper,e.display.scrollbars.addClass)}var ki=0;function Si(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++ki},_n(e.curOp)}function Ci(e){var t=e.curOp;t&&Tn(t,(function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;_i(e)}))}function _i(e){for(var t=e.ops,n=0;n<t.length;n++)Ei(t[n]);for(var r=0;r<t.length;r++)Ti(t[r]);for(var i=0;i<t.length;i++)ji(t[i]);for(var o=0;o<t.length;o++)Oi(t[o]);for(var a=0;a<t.length;a++)Ni(t[a])}function Ei(e){var t=e.cm,n=t.display;Fi(t),e.updateMaxLine&&ln(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Ii(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Ti(e){e.updatedDisplay=e.mustUpdate&&Ui(e.cm,e.update)}function ji(e){var t=e.cm,n=t.display;e.updatedDisplay&&Zr(t),e.barMeasure=mi(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=er(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Yn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Xn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Oi(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&hi(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==L();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&yi(t,e.barMeasure),e.updatedDisplay&&qi(t,e.barMeasure),e.selectionChanged&&Yr(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&Xr(e.cm)}function Ni(e){var t=e.cm,n=t.display,r=t.doc;e.updatedDisplay&&Bi(t,e.update),null==n.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null!=e.scrollTop&&pi(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&hi(t,e.scrollLeft,!0,!0),e.scrollToPos&&ni(t,ri(t,ft(r,e.scrollToPos.from),ft(r,e.scrollToPos.to),e.scrollToPos.margin));var i=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(i)for(var a=0;a<i.length;++a)i[a].lines.length||ge(i[a],"hide");if(o)for(var s=0;s<o.length;++s)o[s].lines.length&&ge(o[s],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&ge(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Mi(e,t){if(e.curOp)return t();Si(e);try{return t()}finally{Ci(e)}}function Li(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Si(e);try{return t.apply(e,arguments)}finally{Ci(e)}}}function Pi(e){return function(){if(this.curOp)return e.apply(this,arguments);Si(this);try{return e.apply(this,arguments)}finally{Ci(this)}}}function Ai(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Si(t);try{return e.apply(this,arguments)}finally{Ci(t)}}}function Di(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,R(Ri,e))}function Ri(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=bt(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(o){if(r.line>=e.display.viewFrom){var a=o.styles,s=o.text.length>e.options.maxHighlightLength?Ge(t.mode,r.state):null,l=gt(e,o,r,!0);s&&(r.state=s),o.styles=l.styles;var u=o.styleClasses,c=l.classes;c?o.styleClasses=c:u&&(o.styleClasses=null);for(var d=!a||a.length!=o.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),f=0;!d&&f<a.length;++f)d=a[f]!=o.styles[f];d&&i.push(r.line),o.stateAfter=r.save(),r.nextLine()}else o.text.length<=e.options.maxHighlightLength&&wt(e,o.text,r),o.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return Di(e,e.options.workDelay),!0})),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&Mi(e,(function(){for(var t=0;t<i.length;t++)Fr(e,i[t],"text")}))}}var Ii=function(e,t,n){var r=e.display;this.viewport=t,this.visible=ti(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=Xn(e),this.force=n,this.dims=Mr(e),this.events=[]};function Fi(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Yn(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Yn(e)+"px",t.scrollbarsClipped=!0)}function zi(e){if(e.hasFocus())return null;var t=L();if(!t||!M(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&M(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}function Hi(e){if(e&&e.activeElt&&e.activeElt!=L()&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&M(document.body,e.anchorNode)&&M(document.body,e.focusNode))){var t=window.getSelection(),n=document.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t.extend(e.focusNode,e.focusOffset)}}function Ui(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return zr(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==Br(e))return!1;Yi(e)&&(zr(e),t.dims=Mr(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(r.first,n.viewFrom)),n.viewTo>a&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),Nt&&(o=tn(e.doc,o),a=nn(e.doc,a));var s=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Ur(e,o,a),n.viewOffset=an(Qe(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var l=Br(e);if(!s&&0==l&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var u=zi(e);return l>4&&(n.lineDiv.style.display="none"),$i(e,n.updateLineNumbers,t.dims),l>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,Hi(u),T(n.cursorDiv),T(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,Di(e,400)),n.updateLineNumbers=null,!0}function Bi(e,t){for(var n=t.viewport,r=!0;;r=!1){if(r&&e.options.lineWrapping&&t.oldDisplayWidth!=Xn(e))r&&(t.visible=ti(e.display,e.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(e.doc.height+qn(e.display)-Kn(e),n.top)}),t.visible=ti(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!Ui(e,t))break;Zr(e);var i=mi(e);Wr(e),yi(e,i),qi(e,i),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Wi(e,t){var n=new Ii(e,t);if(Ui(e,n)){Zr(e),Bi(e,n);var r=mi(e);Wr(e),yi(e,r),qi(e,r),n.finish()}}function $i(e,t,n){var r=e.display,i=e.options.lineNumbers,o=r.lineDiv,a=o.firstChild;function s(t){var n=t.nextSibling;return l&&y&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var u=r.view,c=r.viewFrom,d=0;d<u.length;d++){var f=u[d];if(f.hidden);else if(f.node&&f.node.parentNode==o){for(;a!=f.node;)a=s(a);var p=i&&null!=t&&t<=c&&f.lineNumber;f.changes&&(H(f.changes,"gutter")>-1&&(p=!1),Mn(e,f,c,n)),p&&(T(f.lineNumber),f.lineNumber.appendChild(document.createTextNode(it(e.options,c)))),a=f.node.nextSibling}else{var h=zn(e,f,c,n);o.insertBefore(h,a)}c+=f.size}for(;a;)a=s(a)}function Vi(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function qi(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Yn(e)+"px"}function Gi(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=Lr(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",a=0;a<n.length;a++)if(!n[a].hidden){e.options.fixedGutter&&(n[a].gutter&&(n[a].gutter.style.left=o),n[a].gutterBackground&&(n[a].gutterBackground.style.left=o));var s=n[a].alignable;if(s)for(var l=0;l<s.length;l++)s[l].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}}function Yi(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=it(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(O("div",[O("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,a=i.offsetWidth-o;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-a)+1,r.lineNumWidth=r.lineNumInnerWidth+a,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",Vi(e.display),!0}return!1}function Xi(e,t){for(var n=[],r=!1,i=0;i<e.length;i++){var o=e[i],a=null;if("string"!=typeof o&&(a=o.style,o=o.className),"CodeMirror-linenumbers"==o){if(!t)continue;r=!0}n.push({className:o,style:a})}return t&&!r&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function Ki(e){var t=e.gutters,n=e.gutterSpecs;T(t),e.lineGutter=null;for(var r=0;r<n.length;++r){var i=n[r],o=i.className,a=i.style,s=t.appendChild(O("div",null,"CodeMirror-gutter "+o));a&&(s.style.cssText=a),"CodeMirror-linenumbers"==o&&(e.lineGutter=s,s.style.width=(e.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",Vi(e)}function Qi(e){Ki(e.display),Ir(e),Gi(e)}function Ji(e,t,r,i){var o=this;this.input=r,o.scrollbarFiller=O("div",null,"CodeMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=O("div",null,"CodeMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=N("div",null,"CodeMirror-code"),o.selectionDiv=O("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=O("div",null,"CodeMirror-cursors"),o.measure=O("div",null,"CodeMirror-measure"),o.lineMeasure=O("div",null,"CodeMirror-measure"),o.lineSpace=N("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var u=N("div",[o.lineSpace],"CodeMirror-lines");o.mover=O("div",[u],null,"position: relative"),o.sizer=O("div",[o.mover],"CodeMirror-sizer"),o.sizerWidth=null,o.heightForcer=O("div",null,null,"position: absolute; height: "+U+"px; width: 1px;"),o.gutters=O("div",null,"CodeMirror-gutters"),o.lineGutter=null,o.scroller=O("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=O("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror"),a&&s<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),l||n&&g||(o.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(o.wrapper):e(o.wrapper)),o.viewFrom=o.viewTo=t.first,o.reportedViewFrom=o.reportedViewTo=t.first,o.view=[],o.renderedView=null,o.externalMeasured=null,o.viewOffset=0,o.lastWrapHeight=o.lastWrapWidth=0,o.updateLineNumbers=null,o.nativeBarWidth=o.barHeight=o.barWidth=0,o.scrollbarsClipped=!1,o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null,o.alignWidgets=!1,o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null,o.maxLine=null,o.maxLineLength=0,o.maxLineChanged=!1,o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null,o.shift=!1,o.selForContextMenu=null,o.activeTouch=null,o.gutterSpecs=Xi(i.gutters,i.lineNumbers),Ki(o),r.init(o)}Ii.prototype.signal=function(e,t){we(e,t)&&this.events.push(arguments)},Ii.prototype.finish=function(){for(var e=0;e<this.events.length;e++)ge.apply(null,this.events[e])};var Zi=0,eo=null;function to(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==n&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:null==n&&(n=e.wheelDelta),{x:t,y:n}}function no(e){var t=to(e);return t.x*=eo,t.y*=eo,t}function ro(e,t){var r=to(t),i=r.x,o=r.y,a=e.display,s=a.scroller,u=s.scrollWidth>s.clientWidth,c=s.scrollHeight>s.clientHeight;if(i&&u||o&&c){if(o&&y&&l)e:for(var f=t.target,p=a.view;f!=s;f=f.parentNode)for(var h=0;h<p.length;h++)if(p[h].node==f){e.display.currentWheelTarget=f;break e}if(i&&!n&&!d&&null!=eo)return o&&c&&fi(e,Math.max(0,s.scrollTop+o*eo)),hi(e,Math.max(0,s.scrollLeft+i*eo)),(!o||o&&c)&&ke(t),void(a.wheelStartX=null);if(o&&null!=eo){var m=o*eo,v=e.doc.scrollTop,g=v+a.wrapper.clientHeight;m<0?v=Math.max(0,v+m-50):g=Math.min(e.doc.height,g+m+50),Wi(e,{top:v,bottom:g})}Zi<20&&(null==a.wheelStartX?(a.wheelStartX=s.scrollLeft,a.wheelStartY=s.scrollTop,a.wheelDX=i,a.wheelDY=o,setTimeout((function(){if(null!=a.wheelStartX){var e=s.scrollLeft-a.wheelStartX,t=s.scrollTop-a.wheelStartY,n=t&&a.wheelDY&&t/a.wheelDY||e&&a.wheelDX&&e/a.wheelDX;a.wheelStartX=a.wheelStartY=null,n&&(eo=(eo*Zi+n)/(Zi+1),++Zi)}}),200)):(a.wheelDX+=i,a.wheelDY+=o))}}a?eo=-.53:n?eo=15:c?eo=-.7:f&&(eo=-1/3);var io=function(e,t){this.ranges=e,this.primIndex=t};io.prototype.primary=function(){return this.ranges[this.primIndex]},io.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],r=e.ranges[t];if(!st(n.anchor,r.anchor)||!st(n.head,r.head))return!1}return!0},io.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new oo(lt(this.ranges[t].anchor),lt(this.ranges[t].head));return new io(e,this.primIndex)},io.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},io.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(at(t,r.from())>=0&&at(e,r.to())<=0)return n}return-1};var oo=function(e,t){this.anchor=e,this.head=t};function ao(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort((function(e,t){return at(e.from(),t.from())})),n=H(t,i);for(var o=1;o<t.length;o++){var a=t[o],s=t[o-1],l=at(s.to(),a.from());if(r&&!a.empty()?l>0:l>=0){var u=ct(s.from(),a.from()),c=ut(s.to(),a.to()),d=s.empty()?a.from()==a.head:s.from()==s.head;o<=n&&--n,t.splice(--o,2,new oo(d?c:u,d?u:c))}}return new io(t,n)}function so(e,t){return new io([new oo(e,t||e)],0)}function lo(e){return e.text?ot(e.from.line+e.text.length-1,X(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function uo(e,t){if(at(e,t.from)<0)return e;if(at(e,t.to)<=0)return lo(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=lo(t).ch-t.to.ch),ot(n,r)}function co(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new oo(uo(i.anchor,t),uo(i.head,t)))}return ao(e.cm,n,e.sel.primIndex)}function fo(e,t,n){return e.line==t.line?ot(n.line,e.ch-t.ch+n.ch):ot(n.line+(e.line-t.line),e.ch)}function po(e,t,n){for(var r=[],i=ot(e.first,0),o=i,a=0;a<t.length;a++){var s=t[a],l=fo(s.from,i,o),u=fo(lo(s),i,o);if(i=s.to,o=u,"around"==n){var c=e.sel.ranges[a],d=at(c.head,c.anchor)<0;r[a]=new oo(d?u:l,d?l:u)}else r[a]=new oo(l,l)}return new io(r,e.sel.primIndex)}function ho(e){e.doc.mode=$e(e.options,e.doc.modeOption),mo(e)}function mo(e){e.doc.iter((function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)})),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,Di(e,100),e.state.modeGen++,e.curOp&&Ir(e)}function vo(e,t){return 0==t.from.ch&&0==t.to.ch&&""==X(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function go(e,t,n,r){function i(e){return n?n[e]:null}function o(e,n,i){cn(e,n,i,r),On(e,"change",e,t)}function a(e,t){for(var n=[],o=e;o<t;++o)n.push(new un(u[o],i(o),r));return n}var s=t.from,l=t.to,u=t.text,c=Qe(e,s.line),d=Qe(e,l.line),f=X(u),p=i(u.length-1),h=l.line-s.line;if(t.full)e.insert(0,a(0,u.length)),e.remove(u.length,e.size-u.length);else if(vo(e,t)){var m=a(0,u.length-1);o(d,d.text,p),h&&e.remove(s.line,h),m.length&&e.insert(s.line,m)}else if(c==d)if(1==u.length)o(c,c.text.slice(0,s.ch)+f+c.text.slice(l.ch),p);else{var v=a(1,u.length-1);v.push(new un(f+c.text.slice(l.ch),p,r)),o(c,c.text.slice(0,s.ch)+u[0],i(0)),e.insert(s.line+1,v)}else if(1==u.length)o(c,c.text.slice(0,s.ch)+u[0]+d.text.slice(l.ch),i(0)),e.remove(s.line+1,h);else{o(c,c.text.slice(0,s.ch)+u[0],i(0)),o(d,f+d.text.slice(l.ch),p);var g=a(1,u.length-1);h>1&&e.remove(s.line+1,h-1),e.insert(s.line+1,g)}On(e,"change",e,t)}function yo(e,t,n){function r(e,i,o){if(e.linked)for(var a=0;a<e.linked.length;++a){var s=e.linked[a];if(s.doc!=i){var l=o&&s.sharedHist;n&&!l||(t(s.doc,l),r(s.doc,e,l))}}}r(e,null,!0)}function bo(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Ar(e),ho(e),wo(e),e.options.lineWrapping||ln(e),e.options.mode=t.modeOption,Ir(e)}function wo(e){("rtl"==e.doc.direction?P:E)(e.display.lineDiv,"CodeMirror-rtl")}function xo(e){Mi(e,(function(){wo(e),Ir(e)}))}function ko(e){this.done=[],this.undone=[],this.undoDepth=e?e.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e?e.maxGeneration:1}function So(e,t){var n={from:lt(t.from),to:lo(t),text:Je(e,t.from,t.to)};return No(e,n,t.from.line,t.to.line+1),yo(e,(function(e){return No(e,n,t.from.line,t.to.line+1)}),!0),n}function Co(e){for(;e.length&&X(e).ranges;)e.pop()}function _o(e,t){return t?(Co(e.done),X(e.done)):e.done.length&&!X(e.done).ranges?X(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),X(e.done)):void 0}function Eo(e,t,n,r){var i=e.history;i.undone.length=0;var o,a,s=+new Date;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&i.lastModTime>s-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=_o(i,i.lastOp==r)))a=X(o.changes),0==at(t.from,t.to)&&0==at(t.from,a.to)?a.to=lo(t):o.changes.push(So(e,t));else{var l=X(i.done);for(l&&l.ranges||Oo(e.sel,i.done),o={changes:[So(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=s,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,a||ge(e,"historyAdded")}function To(e,t,n,r){var i=t.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function jo(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||To(e,o,X(i.done),t))?i.done[i.done.length-1]=t:Oo(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&!1!==r.clearRedo&&Co(i.undone)}function Oo(e,t){var n=X(t);n&&n.ranges&&n.equals(e)||t.push(e)}function No(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),(function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=n.markedSpans),++o}))}function Mo(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function Lo(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=[],i=0;i<t.text.length;++i)r.push(Mo(n[i]));return r}function Po(e,t){var n=Lo(e,t),r=zt(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var o=n[i],a=r[i];if(o&&a)e:for(var s=0;s<a.length;++s){for(var l=a[s],u=0;u<o.length;++u)if(o[u].marker==l.marker)continue e;o.push(l)}else a&&(n[i]=a)}return n}function Ao(e,t,n){for(var r=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges)r.push(n?io.prototype.deepCopy.call(o):o);else{var a=o.changes,s=[];r.push({changes:s});for(var l=0;l<a.length;++l){var u=a[l],c=void 0;if(s.push({from:u.from,to:u.to,text:u.text}),t)for(var d in u)(c=d.match(/^spans_(\d+)$/))&&H(t,Number(c[1]))>-1&&(X(s)[d]=u[d],delete u[d])}}}return r}function Do(e,t,n,r){if(r){var i=e.anchor;if(n){var o=at(t,i)<0;o!=at(n,i)<0?(i=t,t=n):o!=at(t,n)<0&&(t=n)}return new oo(i,t)}return new oo(n||t,t)}function Ro(e,t,n,r,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),Bo(e,new io([Do(e.sel.primary(),t,n,i)],0),r)}function Io(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o<e.sel.ranges.length;o++)r[o]=Do(e.sel.ranges[o],t[o],null,i);Bo(e,ao(e.cm,r,e.sel.primIndex),n)}function Fo(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,Bo(e,ao(e.cm,i,e.sel.primIndex),r)}function zo(e,t,n,r){Bo(e,so(t,n),r)}function Ho(e,t,n){var r={ranges:t.ranges,update:function(t){this.ranges=[];for(var n=0;n<t.length;n++)this.ranges[n]=new oo(ft(e,t[n].anchor),ft(e,t[n].head))},origin:n&&n.origin};return ge(e,"beforeSelectionChange",e,r),e.cm&&ge(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?ao(e.cm,r.ranges,r.ranges.length-1):t}function Uo(e,t,n){var r=e.history.done,i=X(r);i&&i.ranges?(r[r.length-1]=t,Wo(e,t,n)):Bo(e,t,n)}function Bo(e,t,n){Wo(e,t,n),jo(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function Wo(e,t,n){(we(e,"beforeSelectionChange")||e.cm&&we(e.cm,"beforeSelectionChange"))&&(t=Ho(e,t,n));var r=n&&n.bias||(at(t.primary().head,e.sel.primary().head)<0?-1:1);$o(e,qo(e,t,r,!0)),n&&!1===n.scroll||!e.cm||"nocursor"==e.cm.getOption("readOnly")||si(e.cm)}function $o(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,be(e.cm)),On(e,"cursorActivity",e))}function Vo(e){$o(e,qo(e,e.sel,null,!1))}function qo(e,t,n,r){for(var i,o=0;o<t.ranges.length;o++){var a=t.ranges[o],s=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],l=Yo(e,a.anchor,s&&s.anchor,n,r),u=Yo(e,a.head,s&&s.head,n,r);(i||l!=a.anchor||u!=a.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new oo(l,u))}return i?ao(e.cm,i,t.primIndex):t}function Go(e,t,n,r,i){var o=Qe(e,t.line);if(o.markedSpans)for(var a=0;a<o.markedSpans.length;++a){var s=o.markedSpans[a],l=s.marker,u="selectLeft"in l?!l.selectLeft:l.inclusiveLeft,c="selectRight"in l?!l.selectRight:l.inclusiveRight;if((null==s.from||(u?s.from<=t.ch:s.from<t.ch))&&(null==s.to||(c?s.to>=t.ch:s.to>t.ch))){if(i&&(ge(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!l.atomic)continue;if(n){var d=l.find(r<0?1:-1),f=void 0;if((r<0?c:u)&&(d=Xo(e,d,-r,d&&d.line==t.line?o:null)),d&&d.line==t.line&&(f=at(d,n))&&(r<0?f<0:f>0))return Go(e,d,t,r,i)}var p=l.find(r<0?-1:1);return(r<0?u:c)&&(p=Xo(e,p,r,p.line==t.line?o:null)),p?Go(e,p,t,r,i):null}}return t}function Yo(e,t,n,r,i){var o=r||1,a=Go(e,t,n,o,i)||!i&&Go(e,t,n,o,!0)||Go(e,t,n,-o,i)||!i&&Go(e,t,n,-o,!0);return a||(e.cantEdit=!0,ot(e.first,0))}function Xo(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?ft(e,ot(t.line-1)):null:n>0&&t.ch==(r||Qe(e,t.line)).text.length?t.line<e.first+e.size-1?ot(t.line+1,0):null:new ot(t.line,t.ch+n)}function Ko(e){e.setSelection(ot(e.firstLine(),0),ot(e.lastLine()),W)}function Qo(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(t,n,i,o){t&&(r.from=ft(e,t)),n&&(r.to=ft(e,n)),i&&(r.text=i),void 0!==o&&(r.origin=o)}),ge(e,"beforeChange",e,r),e.cm&&ge(e.cm,"beforeChange",e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function Jo(e,t,n){if(e.cm){if(!e.cm.curOp)return Li(e.cm,Jo)(e,t,n);if(e.cm.state.suppressEdits)return}if(!(we(e,"beforeChange")||e.cm&&we(e.cm,"beforeChange"))||(t=Qo(e,t,!0))){var r=Ot&&!n&&Ut(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)Zo(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else Zo(e,t)}}function Zo(e,t){if(1!=t.text.length||""!=t.text[0]||0!=at(t.from,t.to)){var n=co(e,t);Eo(e,t,n,e.cm?e.cm.curOp.id:NaN),na(e,t,n,zt(e,t));var r=[];yo(e,(function(e,n){n||-1!=H(r,e.history)||(sa(e.history,t),r.push(e.history)),na(e,t,null,zt(e,t))}))}}function ea(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!r||n){for(var i,o=e.history,a=e.sel,s="undo"==t?o.done:o.undone,l="undo"==t?o.undone:o.done,u=0;u<s.length&&(i=s[u],n?!i.ranges||i.equals(e.sel):i.ranges);u++);if(u!=s.length){for(o.lastOrigin=o.lastSelOrigin=null;;){if(!(i=s.pop()).ranges){if(r)return void s.push(i);break}if(Oo(i,l),n&&!i.equals(e.sel))return void Bo(e,i,{clearRedo:!1});a=i}var c=[];Oo(a,l),l.push({changes:c,generation:o.generation}),o.generation=i.generation||++o.maxGeneration;for(var d=we(e,"beforeChange")||e.cm&&we(e.cm,"beforeChange"),f=function(n){var r=i.changes[n];if(r.origin=t,d&&!Qo(e,r,!1))return s.length=0,{};c.push(So(e,r));var o=n?co(e,r):X(s);na(e,r,o,Po(e,r)),!n&&e.cm&&e.cm.scrollIntoView({from:r.from,to:lo(r)});var a=[];yo(e,(function(e,t){t||-1!=H(a,e.history)||(sa(e.history,r),a.push(e.history)),na(e,r,null,Po(e,r))}))},p=i.changes.length-1;p>=0;--p){var h=f(p);if(h)return h.v}}}}function ta(e,t){if(0!=t&&(e.first+=t,e.sel=new io(K(e.sel.ranges,(function(e){return new oo(ot(e.anchor.line+t,e.anchor.ch),ot(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){Ir(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)Fr(e.cm,r,"gutter")}}function na(e,t,n,r){if(e.cm&&!e.cm.curOp)return Li(e.cm,na)(e,t,n,r);if(t.to.line<e.first)ta(e,t.text.length-1-(t.to.line-t.from.line));else if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);ta(e,i),t={from:ot(e.first,0),to:ot(t.to.line+i,t.to.ch),text:[X(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:ot(o,Qe(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Je(e,t.from,t.to),n||(n=co(e,t)),e.cm?ra(e.cm,t,r):go(e,t,r),Wo(e,n,W),e.cantEdit&&Yo(e,ot(e.firstLine(),0))&&(e.cantEdit=!1)}}function ra(e,t,n){var r=e.doc,i=e.display,o=t.from,a=t.to,s=!1,l=o.line;e.options.lineWrapping||(l=tt(Jt(Qe(r,o.line))),r.iter(l,a.line+1,(function(e){if(e==i.maxLine)return s=!0,!0}))),r.sel.contains(t.from,t.to)>-1&&be(e),go(r,t,n,Pr(e)),e.options.lineWrapping||(r.iter(l,o.line+t.text.length,(function(e){var t=sn(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)})),s&&(e.curOp.updateMaxLine=!0)),jt(r,o.line),Di(e,400);var u=t.text.length-(a.line-o.line)-1;t.full?Ir(e):o.line!=a.line||1!=t.text.length||vo(e.doc,t)?Ir(e,o.line,a.line+1,u):Fr(e,o.line,"text");var c=we(e,"changes"),d=we(e,"change");if(d||c){var f={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};d&&On(e,"change",e,f),c&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(f)}e.display.selForContextMenu=null}function ia(e,t,n,r,i){var o;r||(r=n),at(r,n)<0&&(n=(o=[r,n])[0],r=o[1]),"string"==typeof t&&(t=e.splitLines(t)),Jo(e,{from:n,to:r,text:t,origin:i})}function oa(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function aa(e,t,n,r){for(var i=0;i<e.length;++i){var o=e[i],a=!0;if(o.ranges){o.copied||((o=e[i]=o.deepCopy()).copied=!0);for(var s=0;s<o.ranges.length;s++)oa(o.ranges[s].anchor,t,n,r),oa(o.ranges[s].head,t,n,r)}else{for(var l=0;l<o.changes.length;++l){var u=o.changes[l];if(n<u.from.line)u.from=ot(u.from.line+r,u.from.ch),u.to=ot(u.to.line+r,u.to.ch);else if(t<=u.to.line){a=!1;break}}a||(e.splice(0,i+1),i=0)}}}function sa(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;aa(e.done,n,r,i),aa(e.undone,n,r,i)}function la(e,t,n,r){var i=t,o=t;return"number"==typeof t?o=Qe(e,dt(e,t)):i=tt(t),null==i?null:(r(o,i)&&e.cm&&Fr(e.cm,i,n),o)}function ua(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}function ca(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var i=e[r];t+=i.chunkSize(),n+=i.height,i.parent=this}this.size=t,this.height=n,this.parent=null}oo.prototype.from=function(){return ct(this.anchor,this.head)},oo.prototype.to=function(){return ut(this.anchor,this.head)},oo.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},ua.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n<r;++n){var i=this.lines[n];this.height-=i.height,dn(i),On(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}},ca.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(e<i){var o=Math.min(t,i-e),a=r.height;if(r.removeInner(e,o),this.height-=a-r.height,i==o&&(this.children.splice(n--,1),r.parent=null),0==(t-=o))break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof ua))){var s=[];this.collapse(s),this.children=[new ua(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<=o){if(i.insertInner(e,t,n),i.lines&&i.lines.length>50){for(var a=i.lines.length%25+25,s=a;s<i.lines.length;){var l=new ua(i.lines.slice(s,s+=25));i.height-=l.height,this.children.splice(++r,0,l),l.parent=this}i.lines=i.lines.slice(0,a),this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=new ca(e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var n=H(e.parent.children,e);e.parent.children.splice(n+1,0,t)}else{var r=new ca(e.children);r.parent=e,e.children=[r,t],e=r}t.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<o){var a=Math.min(t,o-e);if(i.iterN(e,a,n))return!0;if(0==(t-=a))break;e=0}else e-=o}}};var da=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};function fa(e,t,n){an(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&ai(e,n)}function pa(e,t,n,r){var i=new da(e,n,r),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),la(e,t,"widget",(function(t){var n=t.widgets||(t.widgets=[]);if(null==i.insertAt?n.push(i):n.splice(Math.min(n.length,Math.max(0,i.insertAt)),0,i),i.line=t,o&&!rn(e,t)){var r=an(t)<e.scrollTop;et(t,t.height+Wn(i)),r&&ai(o,i.height),o.curOp.forceUpdate=!0}return!0})),o&&On(o,"lineWidgetAdded",o,i,"number"==typeof t?t:tt(t)),i}da.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=tt(n);if(null!=r&&t){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var o=Wn(this);et(n,Math.max(0,n.height-o)),e&&(Mi(e,(function(){fa(e,n,-o),Fr(e,r,"widget")})),On(e,"lineWidgetCleared",e,this,r))}},da.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=Wn(this)-t;i&&(rn(this.doc,r)||et(r,r.height+i),n&&Mi(n,(function(){n.curOp.forceUpdate=!0,fa(n,r,i),On(n,"lineWidgetChanged",n,e,tt(r))})))},xe(da);var ha=0,ma=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++ha};function va(e,t,n,r,i){if(r&&r.shared)return ya(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return Li(e.cm,va)(e,t,n,r,i);var o=new ma(e,i),a=at(t,n);if(r&&I(r,o,!1),a>0||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=N("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Qt(e,t.line,t,n,o)||t.line!=n.line&&Qt(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Lt()}o.addToHistory&&Eo(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var s,l=t.line,u=e.cm;if(e.iter(l,n.line+1,(function(e){u&&o.collapsed&&!u.options.lineWrapping&&Jt(e)==u.display.maxLine&&(s=!0),o.collapsed&&l!=t.line&&et(e,0),Rt(e,new Pt(o,l==t.line?t.ch:null,l==n.line?n.ch:null)),++l})),o.collapsed&&e.iter(t.line,n.line+1,(function(t){rn(e,t)&&et(t,0)})),o.clearOnEnter&&he(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(Mt(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++ha,o.atomic=!0),u){if(s&&(u.curOp.updateMaxLine=!0),o.collapsed)Ir(u,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var c=t.line;c<=n.line;c++)Fr(u,c,"text");o.atomic&&Vo(u.doc),On(u,"markerAdded",u,o)}return o}ma.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Si(e),we(this,"clear")){var n=this.find();n&&On(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;o<this.lines.length;++o){var a=this.lines[o],s=At(a.markedSpans,this);e&&!this.collapsed?Fr(e,tt(a),"text"):e&&(null!=s.to&&(i=tt(a)),null!=s.from&&(r=tt(a))),a.markedSpans=Dt(a.markedSpans,s),null==s.from&&this.collapsed&&!rn(this.doc,a)&&e&&et(a,Or(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var l=0;l<this.lines.length;++l){var u=Jt(this.lines[l]),c=sn(u);c>e.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=c,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&Ir(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Vo(e.doc)),e&&On(e,"markerCleared",e,this,r,i),t&&Ci(e),this.parent&&this.parent.clear()}},ma.prototype.find=function(e,t){var n,r;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i<this.lines.length;++i){var o=this.lines[i],a=At(o.markedSpans,this);if(null!=a.from&&(n=ot(t?o:tt(o),a.from),-1==e))return n;if(null!=a.to&&(r=ot(t?o:tt(o),a.to),1==e))return r}return n&&{from:n,to:r}},ma.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;t&&r&&Mi(r,(function(){var i=t.line,o=tt(t.line),a=tr(r,o);if(a&&(cr(a),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!rn(n.doc,i)&&null!=n.height){var s=n.height;n.height=null;var l=Wn(n)-s;l&&et(i,i.height+l)}On(r,"markerChanged",r,e)}))},ma.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=H(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},ma.prototype.detachLine=function(e){if(this.lines.splice(H(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},xe(ma);var ga=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};function ya(e,t,n,r,i){(r=I(r)).shared=!1;var o=[va(e,t,n,r,i)],a=o[0],s=r.widgetNode;return yo(e,(function(e){s&&(r.widgetNode=s.cloneNode(!0)),o.push(va(e,ft(e,t),ft(e,n),r,i));for(var l=0;l<e.linked.length;++l)if(e.linked[l].isParent)return;a=X(o)})),new ga(o,a)}function ba(e){return e.findMarks(ot(e.first,0),e.clipPos(ot(e.lastLine())),(function(e){return e.parent}))}function wa(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),o=e.clipPos(i.from),a=e.clipPos(i.to);if(at(o,a)){var s=va(e,o,a,r.primary,r.primary.type);r.markers.push(s),s.parent=r}}}function xa(e){for(var t=function(t){var n=e[t],r=[n.primary.doc];yo(n.primary.doc,(function(e){return r.push(e)}));for(var i=0;i<n.markers.length;i++){var o=n.markers[i];-1==H(r,o.doc)&&(o.parent=null,n.markers.splice(i--,1))}},n=0;n<e.length;n++)t(n)}ga.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();On(this,"clear")}},ga.prototype.find=function(e,t){return this.primary.find(e,t)},xe(ga);var ka=0,Sa=function(e,t,n,r,i){if(!(this instanceof Sa))return new Sa(e,t,n,r,i);null==n&&(n=0),ca.call(this,[new ua([new un("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var o=ot(n,0);this.sel=so(o),this.history=new ko(null),this.id=++ka,this.modeOption=t,this.lineSep=r,this.direction="rtl"==i?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),go(this,{from:o,to:o,text:e}),Bo(this,so(o),W)};Sa.prototype=Z(ca.prototype,{constructor:Sa,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Ze(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:Ai((function(e){var t=ot(this.first,0),n=this.first+this.size-1;Jo(this,{from:t,to:ot(n,Qe(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&li(this.cm,0,0),Bo(this,so(t),W)})),replaceRange:function(e,t,n,r){ia(this,e,t=ft(this,t),n=n?ft(this,n):t,r)},getRange:function(e,t,n){var r=Je(this,ft(this,e),ft(this,t));return!1===n?r:r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(rt(this,e))return Qe(this,e)},getLineNumber:function(e){return tt(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=Qe(this,e)),Jt(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return ft(this,e)},getCursor:function(e){var t=this.sel.primary();return null==e||"head"==e?t.head:"anchor"==e?t.anchor:"end"==e||"to"==e||!1===e?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Ai((function(e,t,n){zo(this,ft(this,"number"==typeof e?ot(e,t||0):e),null,n)})),setSelection:Ai((function(e,t,n){zo(this,ft(this,e),ft(this,t||e),n)})),extendSelection:Ai((function(e,t,n){Ro(this,ft(this,e),t&&ft(this,t),n)})),extendSelections:Ai((function(e,t){Io(this,ht(this,e),t)})),extendSelectionsBy:Ai((function(e,t){Io(this,ht(this,K(this.sel.ranges,e)),t)})),setSelections:Ai((function(e,t,n){if(e.length){for(var r=[],i=0;i<e.length;i++)r[i]=new oo(ft(this,e[i].anchor),ft(this,e[i].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),Bo(this,ao(this.cm,r,t),n)}})),addSelection:Ai((function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new oo(ft(this,e),ft(this,t||e))),Bo(this,ao(this.cm,r,r.length-1),n)})),getSelection:function(e){for(var t,n=this.sel.ranges,r=0;r<n.length;r++){var i=Je(this,n[r].from(),n[r].to());t=t?t.concat(i):i}return!1===e?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=Je(this,n[r].from(),n[r].to());!1!==e&&(i=i.join(e||this.lineSeparator())),t[r]=i}return t},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:Ai((function(e,t,n){for(var r=[],i=this.sel,o=0;o<i.ranges.length;o++){var a=i.ranges[o];r[o]={from:a.from(),to:a.to(),text:this.splitLines(e[o]),origin:n}}for(var s=t&&"end"!=t&&po(this,r,t),l=r.length-1;l>=0;l--)Jo(this,r[l]);s?Uo(this,s):this.cm&&si(this.cm)})),undo:Ai((function(){ea(this,"undo")})),redo:Ai((function(){ea(this,"redo")})),undoSelection:Ai((function(){ea(this,"undo",!0)})),redoSelection:Ai((function(){ea(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){var e=this;this.history=new ko(this.history),yo(this,(function(t){return t.history=e.history}),!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Ao(this.history.done),undone:Ao(this.history.undone)}},setHistory:function(e){var t=this.history=new ko(this.history);t.done=Ao(e.done.slice(0),null,!0),t.undone=Ao(e.undone.slice(0),null,!0)},setGutterMarker:Ai((function(e,t,n){return la(this,e,"gutter",(function(e){var r=e.gutterMarkers||(e.gutterMarkers={});return r[t]=n,!n&&re(r)&&(e.gutterMarkers=null),!0}))})),clearGutter:Ai((function(e){var t=this;this.iter((function(n){n.gutterMarkers&&n.gutterMarkers[e]&&la(t,n,"gutter",(function(){return n.gutterMarkers[e]=null,re(n.gutterMarkers)&&(n.gutterMarkers=null),!0}))}))})),lineInfo:function(e){var t;if("number"==typeof e){if(!rt(this,e))return null;if(t=e,!(e=Qe(this,e)))return null}else if(null==(t=tt(e)))return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:Ai((function(e,t,n){return la(this,e,"gutter"==t?"gutter":"class",(function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[r]){if(C(n).test(e[r]))return!1;e[r]+=" "+n}else e[r]=n;return!0}))})),removeLineClass:Ai((function(e,t,n){return la(this,e,"gutter"==t?"gutter":"class",(function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",i=e[r];if(!i)return!1;if(null==n)e[r]=null;else{var o=i.match(C(n));if(!o)return!1;var a=o.index+o[0].length;e[r]=i.slice(0,o.index)+(o.index&&a!=i.length?" ":"")+i.slice(a)||null}return!0}))})),addLineWidget:Ai((function(e,t,n){return pa(this,e,t,n)})),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return va(this,ft(this,e),ft(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return va(this,e=ft(this,e),e,n,"bookmark")},findMarksAt:function(e){var t=[],n=Qe(this,(e=ft(this,e)).line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(null==i.from||i.from<=e.ch)&&(null==i.to||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=ft(this,e),t=ft(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,(function(o){var a=o.markedSpans;if(a)for(var s=0;s<a.length;s++){var l=a[s];null!=l.to&&i==e.line&&e.ch>=l.to||null==l.from&&i!=e.line||null!=l.from&&i==t.line&&l.from>=t.ch||n&&!n(l.marker)||r.push(l.marker.parent||l.marker)}++i})),r},getAllMarks:function(){var e=[];return this.iter((function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)null!=n[r].from&&e.push(n[r].marker)})),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter((function(i){var o=i.text.length+r;if(o>e)return t=e,!0;e-=o,++n})),ft(this,ot(n,t))},indexFromPos:function(e){var t=(e=ft(this,e)).ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,(function(e){t+=e.text.length+n})),t},copy:function(e){var t=new Sa(Ze(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<n&&(n=e.to);var r=new Sa(Ze(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],wa(r,ba(this)),r},unlinkDoc:function(e){if(e instanceof Is&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t)if(this.linked[t].doc==e){this.linked.splice(t,1),e.unlinkDoc(this),xa(ba(this));break}if(e.history==this.history){var n=[e.id];yo(e,(function(e){return n.push(e.id)}),!0),e.history=new ko(null),e.history.done=Ao(this.history.done,n),e.history.undone=Ao(this.history.undone,n)}},iterLinkedDocs:function(e){yo(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Ae(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:Ai((function(e){"rtl"!=e&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter((function(e){return e.order=null})),this.cm&&xo(this.cm))}))}),Sa.prototype.eachLine=Sa.prototype.iter;var Ca=0;function _a(e){var t=this;if(ja(t),!ye(t,e)&&!$n(t.display,e)){ke(e),a&&(Ca=+new Date);var n=Dr(t,e,!0),r=e.dataTransfer.files;if(n&&!t.isReadOnly())if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,o=Array(i),s=0,l=function(){++s==i&&Li(t,(function(){var e={from:n=ft(t.doc,n),to:n,text:t.doc.splitLines(o.filter((function(e){return null!=e})).join(t.doc.lineSeparator())),origin:"paste"};Jo(t.doc,e),Uo(t.doc,so(ft(t.doc,n),ft(t.doc,lo(e))))}))()},u=function(e,n){if(t.options.allowDropFileTypes&&-1==H(t.options.allowDropFileTypes,e.type))l();else{var r=new FileReader;r.onerror=function(){return l()},r.onload=function(){var e=r.result;/[\x00-\x08\x0e-\x1f]{2}/.test(e)||(o[n]=e),l()},r.readAsText(e)}},c=0;c<r.length;c++)u(r[c],c);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var d=e.dataTransfer.getData("Text");if(d){var f;if(t.state.draggingText&&!t.state.draggingText.copy&&(f=t.listSelections()),Wo(t.doc,so(n,n)),f)for(var p=0;p<f.length;++p)ia(t.doc,"",f[p].anchor,f[p].head,"drag");t.replaceSelection(d,"around","paste"),t.display.input.focus()}}catch(e){}}}}function Ea(e,t){if(a&&(!e.state.draggingText||+new Date-Ca<100))_e(t);else if(!ye(e,t)&&!$n(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!f)){var n=O("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",d&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),d&&n.parentNode.removeChild(n)}}function Ta(e,t){var n=Dr(e,t);if(n){var r=document.createDocumentFragment();Vr(e,n,r),e.display.dragCursor||(e.display.dragCursor=O("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),j(e.display.dragCursor,r)}}function ja(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Oa(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<t.length;r++){var i=t[r].CodeMirror;i&&n.push(i)}n.length&&n[0].operation((function(){for(var t=0;t<n.length;t++)e(n[t])}))}}var Na=!1;function Ma(){Na||(La(),Na=!0)}function La(){var e;he(window,"resize",(function(){null==e&&(e=setTimeout((function(){e=null,Oa(Pa)}),100))})),he(window,"blur",(function(){return Oa(Jr)}))}function Pa(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Aa={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Da=0;Da<10;Da++)Aa[Da+48]=Aa[Da+96]=String(Da);for(var Ra=65;Ra<=90;Ra++)Aa[Ra]=String.fromCharCode(Ra);for(var Ia=1;Ia<=12;Ia++)Aa[Ia+111]=Aa[Ia+63235]="F"+Ia;var Fa={};function za(e){var t,n,r,i,o=e.split(/-(?!$)/);e=o[o.length-1];for(var a=0;a<o.length-1;a++){var s=o[a];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else{if(!/^s(hift)?$/i.test(s))throw new Error("Unrecognized modifier name: "+s);r=!0}}return t&&(e="Alt-"+e),n&&(e="Ctrl-"+e),i&&(e="Cmd-"+e),r&&(e="Shift-"+e),e}function Ha(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==r){delete e[n];continue}for(var i=K(n.split(" "),za),o=0;o<i.length;o++){var a=void 0,s=void 0;o==i.length-1?(s=i.join(" "),a=r):(s=i.slice(0,o+1).join(" "),a="...");var l=t[s];if(l){if(l!=a)throw new Error("Inconsistent bindings for "+s)}else t[s]=a}delete e[n]}for(var u in t)e[u]=t[u];return e}function Ua(e,t,n,r){var i=(t=Va(t)).call?t.call(e,r):t[e];if(!1===i)return"nothing";if("..."===i)return"multi";if(null!=i&&n(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return Ua(e,t.fallthrough,n,r);for(var o=0;o<t.fallthrough.length;o++){var a=Ua(e,t.fallthrough[o],n,r);if(a)return a}}}function Ba(e){var t="string"==typeof e?e:Aa[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function Wa(e,t,n){var r=e;return t.altKey&&"Alt"!=r&&(e="Alt-"+e),(k?t.metaKey:t.ctrlKey)&&"Ctrl"!=r&&(e="Ctrl-"+e),(k?t.ctrlKey:t.metaKey)&&"Mod"!=r&&(e="Cmd-"+e),!n&&t.shiftKey&&"Shift"!=r&&(e="Shift-"+e),e}function $a(e,t){if(d&&34==e.keyCode&&e.char)return!1;var n=Aa[e.keyCode];return null!=n&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(n=e.code),Wa(n,e,t))}function Va(e){return"string"==typeof e?Fa[e]:e}function qa(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var o=t(n[i]);r.length&&at(o.from,X(r).to)<=0;){var a=r.pop();if(at(a.from,o.from)<0){o.from=a.from;break}}r.push(o)}Mi(e,(function(){for(var t=r.length-1;t>=0;t--)ia(e.doc,"",r[t].from,r[t].to,"+delete");si(e)}))}function Ga(e,t,n){var r=ae(e.text,t+n,n);return r<0||r>e.text.length?null:r}function Ya(e,t,n){var r=Ga(e,t.ch,n);return null==r?null:new ot(t.line,r,n<0?"after":"before")}function Xa(e,t,n,r,i){if(e){"rtl"==t.doc.direction&&(i=-i);var o=fe(n,t.doc.direction);if(o){var a,s=i<0?X(o):o[0],l=i<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==t.doc.direction){var u=nr(t,n);a=i<0?n.text.length-1:0;var c=rr(t,u,a).top;a=se((function(e){return rr(t,u,e).top==c}),i<0==(1==s.level)?s.from:s.to-1,a),"before"==l&&(a=Ga(n,a,1))}else a=i<0?s.to:s.from;return new ot(r,a,l)}}return new ot(r,i<0?n.text.length:0,i<0?"before":"after")}function Ka(e,t,n,r){var i=fe(t,e.doc.direction);if(!i)return Ya(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=ce(i,n.ch,n.sticky),a=i[o];if("ltr"==e.doc.direction&&a.level%2==0&&(r>0?a.to>n.ch:a.from<n.ch))return Ya(t,n,r);var s,l=function(e,n){return Ga(t,e instanceof ot?e.ch:e,n)},u=function(n){return e.options.lineWrapping?(s=s||nr(e,t),Cr(e,t,s,n)):{begin:0,end:t.text.length}},c=u("before"==n.sticky?l(n,-1):n.ch);if("rtl"==e.doc.direction||1==a.level){var d=1==a.level==r<0,f=l(n,d?1:-1);if(null!=f&&(d?f<=a.to&&f<=c.end:f>=a.from&&f>=c.begin)){var p=d?"before":"after";return new ot(n.line,f,p)}}var h=function(e,t,r){for(var o=function(e,t){return t?new ot(n.line,l(e,1),"before"):new ot(n.line,e,"after")};e>=0&&e<i.length;e+=t){var a=i[e],s=t>0==(1!=a.level),u=s?r.begin:l(r.end,-1);if(a.from<=u&&u<a.to)return o(u,s);if(u=s?a.from:l(a.to,-1),r.begin<=u&&u<r.end)return o(u,s)}},m=h(o+r,r,c);if(m)return m;var v=r>0?c.end:l(c.begin,-1);return null==v||r>0&&v==t.text.length||!(m=h(r>0?0:i.length-1,r,u(v)))?null:m}Fa.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Fa.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Fa.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Fa.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Fa.default=y?Fa.macDefault:Fa.pcDefault;var Qa={selectAll:Ko,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),W)},killLine:function(e){return qa(e,(function(t){if(t.empty()){var n=Qe(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:ot(t.head.line+1,0)}:{from:t.head,to:ot(t.head.line,n)}}return{from:t.from(),to:t.to()}}))},deleteLine:function(e){return qa(e,(function(t){return{from:ot(t.from().line,0),to:ft(e.doc,ot(t.to().line+1,0))}}))},delLineLeft:function(e){return qa(e,(function(e){return{from:ot(e.from().line,0),to:e.from()}}))},delWrappedLineLeft:function(e){return qa(e,(function(t){var n=e.charCoords(t.head,"div").top+5;return{from:e.coordsChar({left:0,top:n},"div"),to:t.from()}}))},delWrappedLineRight:function(e){return qa(e,(function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:r}}))},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(ot(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(ot(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy((function(t){return Ja(e,t.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy((function(t){return es(e,t.head)}),{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy((function(t){return Za(e,t.head.line)}),{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")}),V)},goLineLeft:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")}),V)},goLineLeftSmart:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?es(e,t.head):r}),V)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection("\t")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,i=0;i<n.length;i++){var o=n[i].from(),a=F(e.getLine(o.line),o.ch,r);t.push(Y(r-a%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Mi(e,(function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)if(t[r].empty()){var i=t[r].head,o=Qe(e.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new ot(i.line,i.ch-1)),i.ch>0)i=new ot(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),ot(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=Qe(e.doc,i.line-1).text;a&&(i=new ot(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),ot(i.line-1,a.length-1),i,"+transpose"))}n.push(new oo(i,i))}e.setSelections(n)}))},newlineAndIndent:function(e){return Mi(e,(function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);si(e)}))},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Ja(e,t){var n=Qe(e.doc,t),r=Jt(n);return r!=n&&(t=tt(r)),Xa(!0,e,r,t,1)}function Za(e,t){var n=Qe(e.doc,t),r=Zt(n);return r!=n&&(t=tt(r)),Xa(!0,e,n,t,-1)}function es(e,t){var n=Ja(e,t.line),r=Qe(e.doc,n.line),i=fe(r,e.doc.direction);if(!i||0==i[0].level){var o=Math.max(n.ch,r.text.search(/\S/)),a=t.line==n.line&&t.ch<=o&&t.ch;return ot(n.line,a?0:o,n.sticky)}return n}function ts(e,t,n){if("string"==typeof t&&!(t=Qa[t]))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=B}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function ns(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=Ua(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&Ua(t,e.options.extraKeys,n,e)||Ua(t,e.options.keyMap,n,e)}var rs=new z;function is(e,t,n,r){var i=e.state.keySeq;if(i){if(Ba(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:rs.set(50,(function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())})),os(e,i+" "+t,n,r))return!0}return os(e,t,n,r)}function os(e,t,n,r){var i=ns(e,t,r);return"multi"==i&&(e.state.keySeq=t),"handled"==i&&On(e,"keyHandled",e,t,n),"handled"!=i&&"multi"!=i||(ke(n),Yr(e)),!!i}function as(e,t){var n=$a(t,!0);return!!n&&(t.shiftKey&&!e.state.keySeq?is(e,"Shift-"+n,t,(function(t){return ts(e,t,!0)}))||is(e,n,t,(function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return ts(e,t)})):is(e,n,t,(function(t){return ts(e,t)})))}function ss(e,t,n){return is(e,"'"+n+"'",t,(function(t){return ts(e,t,!0)}))}var ls=null;function us(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||(t.curOp.focus=L(),ye(t,e)))){a&&s<11&&27==e.keyCode&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=16==r||e.shiftKey;var i=as(t,e);d&&(ls=i?r:null,i||88!=r||Re||!(y?e.metaKey:e.ctrlKey)||t.replaceSelection("",null,"cut")),n&&!y&&!i&&46==r&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),18!=r||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||cs(t)}}function cs(e){var t=e.display.lineDiv;function n(e){18!=e.keyCode&&e.altKey||(E(t,"CodeMirror-crosshair"),ve(document,"keyup",n),ve(document,"mouseover",n))}P(t,"CodeMirror-crosshair"),he(document,"keyup",n),he(document,"mouseover",n)}function ds(e){16==e.keyCode&&(this.doc.sel.shift=!1),ye(this,e)}function fs(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||$n(t.display,e)||ye(t,e)||e.ctrlKey&&!e.altKey||y&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(d&&n==ls)return ls=null,void ke(e);if(!d||e.which&&!(e.which<10)||!as(t,e)){var i=String.fromCharCode(null==r?n:r);"\b"!=i&&(ss(t,e,i)||t.display.input.onKeyPress(e))}}}var ps,hs,ms=400,vs=function(e,t,n){this.time=e,this.pos=t,this.button=n};function gs(e,t){var n=+new Date;return hs&&hs.compare(n,e,t)?(ps=hs=null,"triple"):ps&&ps.compare(n,e,t)?(hs=new vs(n,e,t),ps=null,"double"):(ps=new vs(n,e,t),hs=null,"single")}function ys(e){var t=this,n=t.display;if(!(ye(t,e)||n.activeTouch&&n.input.supportsTouch()))if(n.input.ensurePolled(),n.shift=e.shiftKey,$n(n,e))l||(n.scroller.draggable=!1,setTimeout((function(){return n.scroller.draggable=!0}),100));else if(!Ts(t,e)){var r=Dr(t,e),i=Te(e),o=r?gs(r,i):"single";window.focus(),1==i&&t.state.selectingText&&t.state.selectingText(e),r&&bs(t,i,r,o,e)||(1==i?r?xs(t,r,o,e):Ee(e)==n.scroller&&ke(e):2==i?(r&&Ro(t.doc,r),setTimeout((function(){return n.input.focus()}),20)):3==i&&(S?t.display.input.onContextMenu(e):Kr(t)))}}function bs(e,t,n,r,i){var o="Click";return"double"==r?o="Double"+o:"triple"==r&&(o="Triple"+o),is(e,Wa(o=(1==t?"Left":2==t?"Middle":"Right")+o,i),i,(function(t){if("string"==typeof t&&(t=Qa[t]),!t)return!1;var r=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r=t(e,n)!=B}finally{e.state.suppressEdits=!1}return r}))}function ws(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(null==i.unit){var o=b?n.shiftKey&&n.metaKey:n.altKey;i.unit=o?"rectangle":"single"==t?"char":"double"==t?"word":"line"}return(null==i.extend||e.doc.extend)&&(i.extend=e.doc.extend||n.shiftKey),null==i.addNew&&(i.addNew=y?n.metaKey:n.ctrlKey),null==i.moveOnDrag&&(i.moveOnDrag=!(y?n.altKey:n.ctrlKey)),i}function xs(e,t,n,r){a?setTimeout(R(Xr,e),0):e.curOp.focus=L();var i,o=ws(e,n,r),s=e.doc.sel;e.options.dragDrop&&Ne&&!e.isReadOnly()&&"single"==n&&(i=s.contains(t))>-1&&(at((i=s.ranges[i]).from(),t)<0||t.xRel>0)&&(at(i.to(),t)>0||t.xRel<0)?ks(e,r,t,o):Cs(e,r,t,o)}function ks(e,t,n,r){var i=e.display,o=!1,u=Li(e,(function(t){l&&(i.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:Kr(e)),ve(i.wrapper.ownerDocument,"mouseup",u),ve(i.wrapper.ownerDocument,"mousemove",c),ve(i.scroller,"dragstart",d),ve(i.scroller,"drop",u),o||(ke(t),r.addNew||Ro(e.doc,n,null,null,r.extend),l&&!f||a&&9==s?setTimeout((function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()}),20):i.input.focus())})),c=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},d=function(){return o=!0};l&&(i.scroller.draggable=!0),e.state.draggingText=u,u.copy=!r.moveOnDrag,he(i.wrapper.ownerDocument,"mouseup",u),he(i.wrapper.ownerDocument,"mousemove",c),he(i.scroller,"dragstart",d),he(i.scroller,"drop",u),e.state.delayingBlurEvent=!0,setTimeout((function(){return i.input.focus()}),20),i.scroller.dragDrop&&i.scroller.dragDrop()}function Ss(e,t,n){if("char"==n)return new oo(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new oo(ot(t.line,0),ft(e.doc,ot(t.line+1,0)));var r=n(e,t);return new oo(r.from,r.to)}function Cs(e,t,n,r){a&&Kr(e);var i=e.display,o=e.doc;ke(t);var s,l,u=o.sel,c=u.ranges;if(r.addNew&&!r.extend?(l=o.sel.contains(n),s=l>-1?c[l]:new oo(n,n)):(s=o.sel.primary(),l=o.sel.primIndex),"rectangle"==r.unit)r.addNew||(s=new oo(n,n)),n=Dr(e,t,!0,!0),l=-1;else{var d=Ss(e,n,r.unit);s=r.extend?Do(s,d.anchor,d.head,r.extend):d}r.addNew?-1==l?(l=c.length,Bo(o,ao(e,c.concat([s]),l),{scroll:!1,origin:"*mouse"})):c.length>1&&c[l].empty()&&"char"==r.unit&&!r.extend?(Bo(o,ao(e,c.slice(0,l).concat(c.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),u=o.sel):Fo(o,l,s,$):(l=0,Bo(o,new io([s],0),$),u=o.sel);var f=n;function p(t){if(0!=at(f,t))if(f=t,"rectangle"==r.unit){for(var i=[],a=e.options.tabSize,c=F(Qe(o,n.line).text,n.ch,a),d=F(Qe(o,t.line).text,t.ch,a),p=Math.min(c,d),h=Math.max(c,d),m=Math.min(n.line,t.line),v=Math.min(e.lastLine(),Math.max(n.line,t.line));m<=v;m++){var g=Qe(o,m).text,y=q(g,p,a);p==h?i.push(new oo(ot(m,y),ot(m,y))):g.length>y&&i.push(new oo(ot(m,y),ot(m,q(g,h,a))))}i.length||i.push(new oo(n,n)),Bo(o,ao(e,u.ranges.slice(0,l).concat(i),l),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b,w=s,x=Ss(e,t,r.unit),k=w.anchor;at(x.anchor,k)>0?(b=x.head,k=ct(w.from(),x.anchor)):(b=x.anchor,k=ut(w.to(),x.head));var S=u.ranges.slice(0);S[l]=_s(e,new oo(ft(o,k),b)),Bo(o,ao(e,S,l),$)}}var h=i.wrapper.getBoundingClientRect(),m=0;function v(t){var n=++m,a=Dr(e,t,!0,"rectangle"==r.unit);if(a)if(0!=at(a,f)){e.curOp.focus=L(),p(a);var s=ti(i,o);(a.line>=s.to||a.line<s.from)&&setTimeout(Li(e,(function(){m==n&&v(t)})),150)}else{var l=t.clientY<h.top?-20:t.clientY>h.bottom?20:0;l&&setTimeout(Li(e,(function(){m==n&&(i.scroller.scrollTop+=l,v(t))})),50)}}function g(t){e.state.selectingText=!1,m=1/0,t&&(ke(t),i.input.focus()),ve(i.wrapper.ownerDocument,"mousemove",y),ve(i.wrapper.ownerDocument,"mouseup",b),o.history.lastSelOrigin=null}var y=Li(e,(function(e){0!==e.buttons&&Te(e)?v(e):g(e)})),b=Li(e,g);e.state.selectingText=b,he(i.wrapper.ownerDocument,"mousemove",y),he(i.wrapper.ownerDocument,"mouseup",b)}function _s(e,t){var n=t.anchor,r=t.head,i=Qe(e.doc,n.line);if(0==at(n,r)&&n.sticky==r.sticky)return t;var o=fe(i);if(!o)return t;var a=ce(o,n.ch,n.sticky),s=o[a];if(s.from!=n.ch&&s.to!=n.ch)return t;var l,u=a+(s.from==n.ch==(1!=s.level)?0:1);if(0==u||u==o.length)return t;if(r.line!=n.line)l=(r.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var c=ce(o,r.ch,r.sticky),d=c-a||(r.ch-n.ch)*(1==s.level?-1:1);l=c==u-1||c==u?d<0:d>0}var f=o[u+(l?-1:0)],p=l==(1==f.level),h=p?f.from:f.to,m=p?"after":"before";return n.ch==h&&n.sticky==m?t:new oo(new ot(n.line,h,m),r)}function Es(e,t,n,r){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(e){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&ke(t);var a=e.display,s=a.lineDiv.getBoundingClientRect();if(o>s.bottom||!we(e,n))return Ce(t);o-=s.top-a.viewOffset;for(var l=0;l<e.display.gutterSpecs.length;++l){var u=a.gutters.childNodes[l];if(u&&u.getBoundingClientRect().right>=i)return ge(e,n,e,nt(e.doc,o),e.display.gutterSpecs[l].className,t),Ce(t)}}function Ts(e,t){return Es(e,t,"gutterClick",!0)}function js(e,t){$n(e.display,t)||Os(e,t)||ye(e,t,"contextmenu")||S||e.display.input.onContextMenu(t)}function Os(e,t){return!!we(e,"gutterContextMenu")&&Es(e,t,"gutterContextMenu",!1)}function Ns(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),fr(e)}vs.prototype.compare=function(e,t,n){return this.time+ms>e&&0==at(t,this.pos)&&n==this.button};var Ms={toString:function(){return"CodeMirror.Init"}},Ls={},Ps={};function As(e){var t=e.optionHandlers;function n(n,r,i,o){e.defaults[n]=r,i&&(t[n]=o?function(e,t,n){n!=Ms&&i(e,t,n)}:i)}e.defineOption=n,e.Init=Ms,n("value","",(function(e,t){return e.setValue(t)}),!0),n("mode",null,(function(e,t){e.doc.modeOption=t,ho(e)}),!0),n("indentUnit",2,ho,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(e){mo(e),fr(e),Ir(e)}),!0),n("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter((function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,n.push(ot(r,o))}r++}));for(var i=n.length-1;i>=0;i--)ia(e.doc,t,n[i],ot(n[i].line,n[i].ch+t.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=Ms&&e.refresh()})),n("specialCharPlaceholder",vn,(function(e){return e.refresh()}),!0),n("electricChars",!0),n("inputStyle",g?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),n("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),n("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),n("rtlMoveVisually",!w),n("wholeLineUpdateBefore",!0),n("theme","default",(function(e){Ns(e),Qi(e)}),!0),n("keyMap","default",(function(e,t,n){var r=Va(t),i=n!=Ms&&Va(n);i&&i.detach&&i.detach(e,r),r.attach&&r.attach(e,i||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Rs,!0),n("gutters",[],(function(e,t){e.display.gutterSpecs=Xi(t,e.options.lineNumbers),Qi(e)}),!0),n("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?Lr(e.display)+"px":"0",e.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(e){return yi(e)}),!0),n("scrollbarStyle","native",(function(e){xi(e),yi(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=Xi(e.options.gutters,t),Qi(e)}),!0),n("firstLineNumber",1,Qi,!0),n("lineNumberFormatter",(function(e){return e}),Qi,!0),n("showCursorWhenSelecting",!1,Wr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(e,t){"nocursor"==t&&(Jr(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),n("screenReaderLabel",null,(function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)})),n("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),n("dragDrop",!0,Ds),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,Wr,!0),n("singleCursorHeightPerLine",!0,Wr,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,mo,!0),n("addModeClass",!1,mo,!0),n("pollInterval",100),n("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),n("historyEventDelay",1250),n("viewportMargin",10,(function(e){return e.refresh()}),!0),n("maxHighlightLength",1e4,mo,!0),n("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),n("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),n("autofocus",null),n("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),n("phrases",null)}function Ds(e,t,n){if(!t!=!(n&&n!=Ms)){var r=e.display.dragFunctions,i=t?he:ve;i(e.display.scroller,"dragstart",r.start),i(e.display.scroller,"dragenter",r.enter),i(e.display.scroller,"dragover",r.over),i(e.display.scroller,"dragleave",r.leave),i(e.display.scroller,"drop",r.drop)}}function Rs(e){e.options.lineWrapping?(P(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(E(e.display.wrapper,"CodeMirror-wrap"),ln(e)),Ar(e),Ir(e),fr(e),setTimeout((function(){return yi(e)}),100)}function Is(e,t){var n=this;if(!(this instanceof Is))return new Is(e,t);this.options=t=t?I(t):{},I(Ls,t,!1);var r=t.value;"string"==typeof r?r=new Sa(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new Is.inputStyles[t.inputStyle](this),o=this.display=new Ji(e,r,i,t);for(var u in o.wrapper.CodeMirror=this,Ns(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),xi(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new z,keySeq:null,specialChars:null},t.autofocus&&!g&&o.input.focus(),a&&s<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),Fs(this),Ma(),Si(this),this.curOp.forceUpdate=!0,bo(this,r),t.autofocus&&!g||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&Qr(n)}),20):Jr(this),Ps)Ps.hasOwnProperty(u)&&Ps[u](this,t[u],Ms);Yi(this),t.finishInit&&t.finishInit(this);for(var c=0;c<zs.length;++c)zs[c](this);Ci(this),l&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}function Fs(e){var t=e.display;he(t.scroller,"mousedown",Li(e,ys)),he(t.scroller,"dblclick",a&&s<11?Li(e,(function(t){if(!ye(e,t)){var n=Dr(e,t);if(n&&!Ts(e,t)&&!$n(e.display,t)){ke(t);var r=e.findWordAt(n);Ro(e.doc,r.anchor,r.head)}}})):function(t){return ye(e,t)||ke(t)}),he(t.scroller,"contextmenu",(function(t){return js(e,t)})),he(t.input.getField(),"contextmenu",(function(n){t.scroller.contains(n.target)||js(e,n)}));var n,r={end:0};function i(){t.activeTouch&&(n=setTimeout((function(){return t.activeTouch=null}),1e3),(r=t.activeTouch).end=+new Date)}function o(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}function l(e,t){if(null==t.left)return!0;var n=t.left-e.left,r=t.top-e.top;return n*n+r*r>400}he(t.scroller,"touchstart",(function(i){if(!ye(e,i)&&!o(i)&&!Ts(e,i)){t.input.ensurePolled(),clearTimeout(n);var a=+new Date;t.activeTouch={start:a,moved:!1,prev:a-r.end<=300?r:null},1==i.touches.length&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}})),he(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),he(t.scroller,"touchend",(function(n){var r=t.activeTouch;if(r&&!$n(t,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var o,a=e.coordsChar(t.activeTouch,"page");o=!r.prev||l(r,r.prev)?new oo(a,a):!r.prev.prev||l(r,r.prev.prev)?e.findWordAt(a):new oo(ot(a.line,0),ft(e.doc,ot(a.line+1,0))),e.setSelection(o.anchor,o.head),e.focus(),ke(n)}i()})),he(t.scroller,"touchcancel",i),he(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(fi(e,t.scroller.scrollTop),hi(e,t.scroller.scrollLeft,!0),ge(e,"scroll",e))})),he(t.scroller,"mousewheel",(function(t){return ro(e,t)})),he(t.scroller,"DOMMouseScroll",(function(t){return ro(e,t)})),he(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){ye(e,t)||_e(t)},over:function(t){ye(e,t)||(Ta(e,t),_e(t))},start:function(t){return Ea(e,t)},drop:Li(e,_a),leave:function(t){ye(e,t)||ja(e)}};var u=t.input.getField();he(u,"keyup",(function(t){return ds.call(e,t)})),he(u,"keydown",Li(e,us)),he(u,"keypress",Li(e,fs)),he(u,"focus",(function(t){return Qr(e,t)})),he(u,"blur",(function(t){return Jr(e,t)}))}Is.defaults=Ls,Is.optionHandlers=Ps;var zs=[];function Hs(e,t,n,r){var i,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=bt(e,t).state:n="prev");var a=e.options.tabSize,s=Qe(o,t),l=F(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var u,c=s.text.match(/^\s*/)[0];if(r||/\S/.test(s.text)){if("smart"==n&&((u=o.mode.indent(i,s.text.slice(c.length),s.text))==B||u>150)){if(!r)return;n="prev"}}else u=0,n="not";"prev"==n?u=t>o.first?F(Qe(o,t-1).text,null,a):0:"add"==n?u=l+e.options.indentUnit:"subtract"==n?u=l-e.options.indentUnit:"number"==typeof n&&(u=l+n),u=Math.max(0,u);var d="",f=0;if(e.options.indentWithTabs)for(var p=Math.floor(u/a);p;--p)f+=a,d+="\t";if(f<u&&(d+=Y(u-f)),d!=c)return ia(o,d,ot(t,0),ot(t,c.length),"+input"),s.stateAfter=null,!0;for(var h=0;h<o.sel.ranges.length;h++){var m=o.sel.ranges[h];if(m.head.line==t&&m.head.ch<c.length){var v=ot(t,c.length);Fo(o,h,new oo(v,v));break}}}Is.defineInitHook=function(e){return zs.push(e)};var Us=null;function Bs(e){Us=e}function Ws(e,t,n,r,i){var o=e.doc;e.display.shift=!1,r||(r=o.sel);var a=+new Date-200,s="paste"==i||e.state.pasteIncoming>a,l=Ae(t),u=null;if(s&&r.ranges.length>1)if(Us&&Us.text.join("\n")==t){if(r.ranges.length%Us.text.length==0){u=[];for(var c=0;c<Us.text.length;c++)u.push(o.splitLines(Us.text[c]))}}else l.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(u=K(l,(function(e){return[e]})));for(var d=e.curOp.updateInput,f=r.ranges.length-1;f>=0;f--){var p=r.ranges[f],h=p.from(),m=p.to();p.empty()&&(n&&n>0?h=ot(h.line,h.ch-n):e.state.overwrite&&!s?m=ot(m.line,Math.min(Qe(o,m.line).text.length,m.ch+X(l).length)):s&&Us&&Us.lineWise&&Us.text.join("\n")==l.join("\n")&&(h=m=ot(h.line,0)));var v={from:h,to:m,text:u?u[f%u.length]:l,origin:i||(s?"paste":e.state.cutIncoming>a?"cut":"+input")};Jo(e.doc,v),On(e,"inputRead",e,v)}t&&!s&&Vs(e,t),si(e),e.curOp.updateInput<2&&(e.curOp.updateInput=d),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function $s(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||Mi(t,(function(){return Ws(t,n,0,null,"paste")})),!0}function Vs(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var s=0;s<o.electricChars.length;s++)if(t.indexOf(o.electricChars.charAt(s))>-1){a=Hs(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Qe(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Hs(e,i.head.line,"smart"));a&&On(e,"electricInput",e,i.head.line)}}}function qs(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,o={anchor:ot(i,0),head:ot(i+1,0)};n.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:n}}function Gs(e,t,n,r){e.setAttribute("autocorrect",n?"":"off"),e.setAttribute("autocapitalize",r?"":"off"),e.setAttribute("spellcheck",!!t)}function Ys(){var e=O("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=O("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return l?e.style.width="1000px":e.setAttribute("wrap","off"),m&&(e.style.border="1px solid black"),Gs(e),t}function Xs(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,n){var r=this.options,i=r[e];r[e]==n&&"mode"!=e||(r[e]=n,t.hasOwnProperty(e)&&Li(this,t[e])(this,n,i),ge(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Va(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;n<t.length;++n)if(t[n]==e||t[n].name==e)return t.splice(n,1),!0},addOverlay:Pi((function(t,n){var r=t.token?t:e.getMode(this.options,t);if(r.startState)throw new Error("Overlays may not be stateful.");Q(this.state.overlays,{mode:r,modeSpec:t,opaque:n&&n.opaque,priority:n&&n.priority||0},(function(e){return e.priority})),this.state.modeGen++,Ir(this)})),removeOverlay:Pi((function(e){for(var t=this.state.overlays,n=0;n<t.length;++n){var r=t[n].modeSpec;if(r==e||"string"==typeof e&&r.name==e)return t.splice(n,1),this.state.modeGen++,void Ir(this)}})),indentLine:Pi((function(e,t,n){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),rt(this.doc,e)&&Hs(this,e,t,n)})),indentSelection:Pi((function(e){for(var t=this.doc.sel.ranges,n=-1,r=0;r<t.length;r++){var i=t[r];if(i.empty())i.head.line>n&&(Hs(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&si(this));else{var o=i.from(),a=i.to(),s=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var l=s;l<n;++l)Hs(this,l,e);var u=this.doc.sel.ranges;0==o.ch&&t.length==u.length&&u[r].from().ch>0&&Fo(this.doc,r,new oo(o,u[r].to()),W)}}})),getTokenAt:function(e,t){return Ct(this,e,t)},getLineTokens:function(e,t){return Ct(this,ot(e),t,!0)},getTokenTypeAt:function(e){e=ft(this.doc,e);var t,n=yt(this,Qe(this.doc,e.line)),r=0,i=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var a=r+i>>1;if((a?n[2*a-1]:0)>=o)i=a;else{if(!(n[2*a+1]<o)){t=n[2*a+2];break}r=a+1}}var s=t?t.indexOf("overlay "):-1;return s<0?t:0==s?null:t.slice(0,s-1)},getModeAt:function(t){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(t).state).mode:n},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var r=[];if(!n.hasOwnProperty(t))return r;var i=n[t],o=this.getModeAt(e);if("string"==typeof o[t])i[o[t]]&&r.push(i[o[t]]);else if(o[t])for(var a=0;a<o[t].length;a++){var s=i[o[t][a]];s&&r.push(s)}else o.helperType&&i[o.helperType]?r.push(i[o.helperType]):i[o.name]&&r.push(i[o.name]);for(var l=0;l<i._global.length;l++){var u=i._global[l];u.pred(o,this)&&-1==H(r,u.val)&&r.push(u.val)}return r},getStateAfter:function(e,t){var n=this.doc;return bt(this,(e=dt(n,null==e?n.first+n.size-1:e))+1,t).state},cursorCoords:function(e,t){var n=this.doc.sel.primary();return br(this,null==e?n.head:"object"==typeof e?ft(this.doc,e):e?n.from():n.to(),t||"page")},charCoords:function(e,t){return yr(this,ft(this.doc,e),t||"page")},coordsChar:function(e,t){return kr(this,(e=gr(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=gr(this,{top:e,left:0},t||"page").top,nt(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,n){var r,i=!1;if("number"==typeof e){var o=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>o&&(e=o,i=!0),r=Qe(this.doc,e)}else r=e;return vr(this,r,{top:0,left:0},t||"page",n||i).top+(i?this.doc.height-an(r):0)},defaultTextHeight:function(){return Or(this.display)},defaultCharWidth:function(){return Nr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var o=this.display,a=(e=br(this,ft(this.doc,e))).bottom,s=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==r)a=e.top;else if("above"==r||"near"==r){var l=Math.max(o.wrapper.clientHeight,this.doc.height),u=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>l)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=l&&(a=e.bottom),s+t.offsetWidth>u&&(s=u-t.offsetWidth)}t.style.top=a+"px",t.style.left=t.style.right="","right"==i?(s=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?s=0:"middle"==i&&(s=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=s+"px"),n&&ii(this,{left:s,top:a,right:s+t.offsetWidth,bottom:a+t.offsetHeight})},triggerOnKeyDown:Pi(us),triggerOnKeyPress:Pi(fs),triggerOnKeyUp:ds,triggerOnMouseDown:Pi(ys),execCommand:function(e){if(Qa.hasOwnProperty(e))return Qa[e].call(null,this)},triggerElectric:Pi((function(e){Vs(this,e)})),findPosH:function(e,t,n,r){var i=1;t<0&&(i=-1,t=-t);for(var o=ft(this.doc,e),a=0;a<t&&!(o=Ks(this.doc,o,i,n,r)).hitSide;++a);return o},moveH:Pi((function(e,t){var n=this;this.extendSelectionsBy((function(r){return n.display.shift||n.doc.extend||r.empty()?Ks(n.doc,r.head,e,t,n.options.rtlMoveVisually):e<0?r.from():r.to()}),V)})),deleteH:Pi((function(e,t){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):qa(this,(function(n){var i=Ks(r,n.head,e,t,!1);return e<0?{from:i,to:n.head}:{from:n.head,to:i}}))})),findPosV:function(e,t,n,r){var i=1,o=r;t<0&&(i=-1,t=-t);for(var a=ft(this.doc,e),s=0;s<t;++s){var l=br(this,a,"div");if(null==o?o=l.left:l.left=o,(a=Qs(this,l,i,n)).hitSide)break}return a},moveV:Pi((function(e,t){var n=this,r=this.doc,i=[],o=!this.display.shift&&!r.extend&&r.sel.somethingSelected();if(r.extendSelectionsBy((function(a){if(o)return e<0?a.from():a.to();var s=br(n,a.head,"div");null!=a.goalColumn&&(s.left=a.goalColumn),i.push(s.left);var l=Qs(n,s,e,t);return"page"==t&&a==r.sel.primary()&&ai(n,yr(n,l,"div").top-s.top),l}),V),i.length)for(var a=0;a<r.sel.ranges.length;a++)r.sel.ranges[a].goalColumn=i[a]})),findWordAt:function(e){var t=Qe(this.doc,e.line).text,n=e.ch,r=e.ch;if(t){var i=this.getHelper(e,"wordChars");"before"!=e.sticky&&r!=t.length||!n?++r:--n;for(var o=t.charAt(n),a=ne(o,i)?function(e){return ne(e,i)}:/\s/.test(o)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!ne(e)};n>0&&a(t.charAt(n-1));)--n;for(;r<t.length&&a(t.charAt(r));)++r}return new oo(ot(e.line,n),ot(e.line,r))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?P(this.display.cursorDiv,"CodeMirror-overwrite"):E(this.display.cursorDiv,"CodeMirror-overwrite"),ge(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==L()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:Pi((function(e,t){li(this,e,t)})),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Yn(this)-this.display.barHeight,width:e.scrollWidth-Yn(this)-this.display.barWidth,clientHeight:Kn(this),clientWidth:Xn(this)}},scrollIntoView:Pi((function(e,t){null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:ot(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line?ui(this,e):di(this,e.from,e.to,e.margin)})),setSize:Pi((function(e,t){var n=this,r=function(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e};null!=e&&(this.display.wrapper.style.width=r(e)),null!=t&&(this.display.wrapper.style.height=r(t)),this.options.lineWrapping&&dr(this);var i=this.display.viewFrom;this.doc.iter(i,this.display.viewTo,(function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){Fr(n,i,"widget");break}++i})),this.curOp.forceUpdate=!0,ge(this,"refresh",this)})),operation:function(e){return Mi(this,e)},startOperation:function(){return Si(this)},endOperation:function(){return Ci(this)},refresh:Pi((function(){var e=this.display.cachedTextHeight;Ir(this),this.curOp.forceUpdate=!0,fr(this),li(this,this.doc.scrollLeft,this.doc.scrollTop),Vi(this.display),(null==e||Math.abs(e-Or(this.display))>.5||this.options.lineWrapping)&&Ar(this),ge(this,"refresh",this)})),swapDoc:Pi((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),bo(this,e),fr(this),this.display.input.reset(),li(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,On(this,"swapDoc",this,t),t})),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},xe(e),e.registerHelper=function(t,r,i){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][r]=i},e.registerGlobalHelper=function(t,r,i,o){e.registerHelper(t,r,o),n[t]._global.push({pred:i,val:o})}}function Ks(e,t,n,r,i){var o=t,a=n,s=Qe(e,t.line),l=i&&"rtl"==e.direction?-n:n;function u(){var n=t.line+l;return!(n<e.first||n>=e.first+e.size)&&(t=new ot(n,t.ch,t.sticky),s=Qe(e,n))}function c(o){var a;if("codepoint"==r){var c=s.text.charCodeAt(t.ch+(n>0?0:-1));if(isNaN(c))a=null;else{var d=n>0?c>=55296&&c<56320:c>=56320&&c<57343;a=new ot(t.line,Math.max(0,Math.min(s.text.length,t.ch+n*(d?2:1))),-n)}}else a=i?Ka(e.cm,s,t,n):Ya(s,t,n);if(null==a){if(o||!u())return!1;t=Xa(i,e.cm,s,t.line,l)}else t=a;return!0}if("char"==r||"codepoint"==r)c();else if("column"==r)c(!0);else if("word"==r||"group"==r)for(var d=null,f="group"==r,p=e.cm&&e.cm.getHelper(t,"wordChars"),h=!0;!(n<0)||c(!h);h=!1){var m=s.text.charAt(t.ch)||"\n",v=ne(m,p)?"w":f&&"\n"==m?"n":!f||/\s/.test(m)?null:"p";if(!f||h||v||(v="s"),d&&d!=v){n<0&&(n=1,c(),t.sticky="after");break}if(v&&(d=v),n>0&&!c(!h))break}var g=Yo(e,t,o,a,!0);return st(o,g)&&(g.hitSide=!0),g}function Qs(e,t,n,r){var i,o,a=e.doc,s=t.left;if("page"==r){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),u=Math.max(l-.5*Or(e.display),3);i=(n>0?t.bottom:t.top)+n*u}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(;(o=kr(e,s,i)).outside;){if(n<0?i<=0:i>=a.height){o.hitSide=!0;break}i+=5*n}return o}var Js=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new z,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Zs(e,t){var n=tr(e,t.line);if(!n||n.hidden)return null;var r=Qe(e.doc,t.line),i=Jn(n,r,t.line),o=fe(r,e.doc.direction),a="left";o&&(a=ce(o,t.ch)%2?"right":"left");var s=ar(i.map,t.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function el(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function tl(e,t){return t&&(e.bad=!0),e}function nl(e,t,n,r,i){var o="",a=!1,s=e.doc.lineSeparator(),l=!1;function u(e){return function(t){return t.id==e}}function c(){a&&(o+=s,l&&(o+=s),a=l=!1)}function d(e){e&&(c(),o+=e)}function f(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void d(n);var o,p=t.getAttribute("cm-marker");if(p){var h=e.findMarks(ot(r,0),ot(i+1,0),u(+p));return void(h.length&&(o=h[0].find(0))&&d(Je(e.doc,o.from,o.to).join(s)))}if("false"==t.getAttribute("contenteditable"))return;var m=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;m&&c();for(var v=0;v<t.childNodes.length;v++)f(t.childNodes[v]);/^(pre|p)$/i.test(t.nodeName)&&(l=!0),m&&(a=!0)}else 3==t.nodeType&&d(t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;f(t),t!=n;)t=t.nextSibling,l=!1;return o}function rl(e,t,n){var r;if(t==e.display.lineDiv){if(!(r=e.display.lineDiv.childNodes[n]))return tl(e.clipPos(ot(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==r)return il(o,t,n)}}function il(e,t,n){var r=e.text.firstChild,i=!1;if(!t||!M(r,t))return tl(ot(tt(e.line),0),!0);if(t==r&&(i=!0,t=r.childNodes[n],n=0,!t)){var o=e.rest?X(e.rest):e.line;return tl(ot(tt(o),o.text.length),i)}var a=3==t.nodeType?t:null,s=t;for(a||1!=t.childNodes.length||3!=t.firstChild.nodeType||(a=t.firstChild,n&&(n=a.nodeValue.length));s.parentNode!=r;)s=s.parentNode;var l=e.measure,u=l.maps;function c(t,n,r){for(var i=-1;i<(u?u.length:0);i++)for(var o=i<0?l.map:u[i],a=0;a<o.length;a+=3){var s=o[a+2];if(s==t||s==n){var c=tt(i<0?e.line:e.rest[i]),d=o[a]+r;return(r<0||s!=t)&&(d=o[a+(r?1:0)]),ot(c,d)}}}var d=c(a,s,n);if(d)return tl(d,i);for(var f=s.nextSibling,p=a?a.nodeValue.length-n:0;f;f=f.nextSibling){if(d=c(f,f.firstChild,0))return tl(ot(d.line,d.ch-p),i);p+=f.textContent.length}for(var h=s.previousSibling,m=n;h;h=h.previousSibling){if(d=c(h,h.firstChild,-1))return tl(ot(d.line,d.ch+m),i);m+=h.textContent.length}}Js.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;function o(e){for(var t=e.target;t;t=t.parentNode){if(t==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(t.className))break}return!1}function a(e){if(o(e)&&!ye(r,e)){if(r.somethingSelected())Bs({lineWise:!1,text:r.getSelections()}),"cut"==e.type&&r.replaceSelection("",null,"cut");else{if(!r.options.lineWiseCopyCut)return;var t=qs(r);Bs({lineWise:!0,text:t.text}),"cut"==e.type&&r.operation((function(){r.setSelections(t.ranges,0,W),r.replaceSelection("",null,"cut")}))}if(e.clipboardData){e.clipboardData.clearData();var a=Us.text.join("\n");if(e.clipboardData.setData("Text",a),e.clipboardData.getData("Text")==a)return void e.preventDefault()}var s=Ys(),l=s.firstChild;r.display.lineSpace.insertBefore(s,r.display.lineSpace.firstChild),l.value=Us.text.join("\n");var u=document.activeElement;D(l),setTimeout((function(){r.display.lineSpace.removeChild(s),u.focus(),u==i&&n.showPrimarySelection()}),50)}}Gs(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize),he(i,"paste",(function(e){!o(e)||ye(r,e)||$s(e,r)||s<=11&&setTimeout(Li(r,(function(){return t.updateFromDOM()})),20)})),he(i,"compositionstart",(function(e){t.composing={data:e.data,done:!1}})),he(i,"compositionupdate",(function(e){t.composing||(t.composing={data:e.data,done:!1})})),he(i,"compositionend",(function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)})),he(i,"touchstart",(function(){return n.forceCompositionEnd()})),he(i,"input",(function(){t.composing||t.readFromDOMSoon()})),he(i,"copy",a),he(i,"cut",a)},Js.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Js.prototype.prepareSelection=function(){var e=$r(this.cm,!1);return e.focus=document.activeElement==this.div,e},Js.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Js.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Js.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),i=r.from(),o=r.to();if(t.display.viewTo==t.display.viewFrom||i.line>=t.display.viewTo||o.line<t.display.viewFrom)e.removeAllRanges();else{var a=rl(t,e.anchorNode,e.anchorOffset),s=rl(t,e.focusNode,e.focusOffset);if(!a||a.bad||!s||s.bad||0!=at(ct(a,s),i)||0!=at(ut(a,s),o)){var l=t.display.view,u=i.line>=t.display.viewFrom&&Zs(t,i)||{node:l[0].measure.map[2],offset:0},c=o.line<t.display.viewTo&&Zs(t,o);if(!c){var d=l[l.length-1].measure,f=d.maps?d.maps[d.maps.length-1]:d.map;c={node:f[f.length-1],offset:f[f.length-2]-f[f.length-3]}}if(u&&c){var p,h=e.rangeCount&&e.getRangeAt(0);try{p=_(u.node,u.offset,c.offset,c.node)}catch(e){}p&&(!n&&t.state.focused?(e.collapse(u.node,u.offset),p.collapsed||(e.removeAllRanges(),e.addRange(p))):(e.removeAllRanges(),e.addRange(p)),h&&null==e.anchorNode?e.addRange(h):n&&this.startGracePeriod()),this.rememberSelection()}else e.removeAllRanges()}}},Js.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout((function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation((function(){return e.cm.curOp.selectionChanged=!0}))}),20)},Js.prototype.showMultipleSelections=function(e){j(this.cm.display.cursorDiv,e.cursors),j(this.cm.display.selectionDiv,e.selection)},Js.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Js.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return M(this.div,t)},Js.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()&&document.activeElement==this.div||this.showSelection(this.prepareSelection(),!0),this.div.focus())},Js.prototype.blur=function(){this.div.blur()},Js.prototype.getField=function(){return this.div},Js.prototype.supportsTouch=function(){return!0},Js.prototype.receivedFocus=function(){var e=this;function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}this.selectionInEditor()?this.pollSelection():Mi(this.cm,(function(){return e.cm.curOp.selectionChanged=!0})),this.polling.set(this.cm.options.pollInterval,t)},Js.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Js.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=this.getSelection(),t=this.cm;if(v&&c&&this.cm.display.gutterSpecs.length&&el(e.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var n=rl(t,e.anchorNode,e.anchorOffset),r=rl(t,e.focusNode,e.focusOffset);n&&r&&Mi(t,(function(){Bo(t.doc,so(n,r),W),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)}))}}},Js.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e,t,n,r=this.cm,i=r.display,o=r.doc.sel.primary(),a=o.from(),s=o.to();if(0==a.ch&&a.line>r.firstLine()&&(a=ot(a.line-1,Qe(r.doc,a.line-1).length)),s.ch==Qe(r.doc,s.line).text.length&&s.line<r.lastLine()&&(s=ot(s.line+1,0)),a.line<i.viewFrom||s.line>i.viewTo-1)return!1;a.line==i.viewFrom||0==(e=Rr(r,a.line))?(t=tt(i.view[0].line),n=i.view[0].node):(t=tt(i.view[e].line),n=i.view[e-1].node.nextSibling);var l,u,c=Rr(r,s.line);if(c==i.view.length-1?(l=i.viewTo-1,u=i.lineDiv.lastChild):(l=tt(i.view[c+1].line)-1,u=i.view[c+1].node.previousSibling),!n)return!1;for(var d=r.doc.splitLines(nl(r,n,u,t,l)),f=Je(r.doc,ot(t,0),ot(l,Qe(r.doc,l).text.length));d.length>1&&f.length>1;)if(X(d)==X(f))d.pop(),f.pop(),l--;else{if(d[0]!=f[0])break;d.shift(),f.shift(),t++}for(var p=0,h=0,m=d[0],v=f[0],g=Math.min(m.length,v.length);p<g&&m.charCodeAt(p)==v.charCodeAt(p);)++p;for(var y=X(d),b=X(f),w=Math.min(y.length-(1==d.length?p:0),b.length-(1==f.length?p:0));h<w&&y.charCodeAt(y.length-h-1)==b.charCodeAt(b.length-h-1);)++h;if(1==d.length&&1==f.length&&t==a.line)for(;p&&p>a.ch&&y.charCodeAt(y.length-h-1)==b.charCodeAt(b.length-h-1);)p--,h++;d[d.length-1]=y.slice(0,y.length-h).replace(/^\u200b+/,""),d[0]=d[0].slice(p).replace(/\u200b+$/,"");var x=ot(t,p),k=ot(l,f.length?X(f).length-h:0);return d.length>1||d[0]||at(x,k)?(ia(r.doc,d,x,k,"+input"),!0):void 0},Js.prototype.ensurePolled=function(){this.forceCompositionEnd()},Js.prototype.reset=function(){this.forceCompositionEnd()},Js.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Js.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()}),80))},Js.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Mi(this.cm,(function(){return Ir(e.cm)}))},Js.prototype.setUneditable=function(e){e.contentEditable="false"},Js.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Li(this.cm,Ws)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Js.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Js.prototype.onContextMenu=function(){},Js.prototype.resetPosition=function(){},Js.prototype.needsContentAttribute=!0;var ol=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new z,this.hasSelection=!1,this.composing=null};function al(e,t){if((t=t?I(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=L();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function r(){e.value=s.getValue()}var i;if(e.form&&(he(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var a=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=a}}catch(e){}}t.finishInit=function(n){n.save=r,n.getTextArea=function(){return e},n.toTextArea=function(){n.toTextArea=isNaN,r(),e.parentNode.removeChild(n.getWrapperElement()),e.style.display="",e.form&&(ve(e.form,"submit",r),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=i))}},e.style.display="none";var s=Is((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return s}function sl(e){e.off=ve,e.on=he,e.wheelEventPixels=no,e.Doc=Sa,e.splitLines=Ae,e.countColumn=F,e.findColumn=q,e.isWordChar=te,e.Pass=B,e.signal=ge,e.Line=un,e.changeEnd=lo,e.scrollbarModel=wi,e.Pos=ot,e.cmpPos=at,e.modes=ze,e.mimeModes=He,e.resolveMode=We,e.getMode=$e,e.modeExtensions=Ve,e.extendMode=qe,e.copyState=Ge,e.startState=Xe,e.innerMode=Ye,e.commands=Qa,e.keyMap=Fa,e.keyName=$a,e.isModifierKey=Ba,e.lookupKey=Ua,e.normalizeKeyMap=Ha,e.StringStream=Ke,e.SharedTextMarker=ga,e.TextMarker=ma,e.LineWidget=da,e.e_preventDefault=ke,e.e_stopPropagation=Se,e.e_stop=_e,e.addClass=P,e.contains=M,e.rmClass=E,e.keyNames=Aa}ol.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var i=this.textarea;function o(e){if(!ye(r,e)){if(r.somethingSelected())Bs({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var t=qs(r);Bs({lineWise:!0,text:t.text}),"cut"==e.type?r.setSelections(t.ranges,null,W):(n.prevInput="",i.value=t.text.join("\n"),D(i))}"cut"==e.type&&(r.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),m&&(i.style.width="0px"),he(i,"input",(function(){a&&s>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()})),he(i,"paste",(function(e){ye(r,e)||$s(e,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())})),he(i,"cut",o),he(i,"copy",o),he(e.scroller,"paste",(function(t){if(!$n(e,t)&&!ye(r,t)){if(!i.dispatchEvent)return r.state.pasteIncoming=+new Date,void n.focus();var o=new Event("paste");o.clipboardData=t.clipboardData,i.dispatchEvent(o)}})),he(e.lineSpace,"selectstart",(function(t){$n(e,t)||ke(t)})),he(i,"compositionstart",(function(){var e=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}})),he(i,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},ol.prototype.createField=function(e){this.wrapper=Ys(),this.textarea=this.wrapper.firstChild},ol.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},ol.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=$r(e);if(e.options.moveInputWithCursor){var i=br(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},ol.prototype.showSelection=function(e){var t=this.cm.display;j(t.cursorDiv,e.cursors),j(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},ol.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&D(this.textarea),a&&s>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",a&&s>=9&&(this.hasSelection=null))}},ol.prototype.getField=function(){return this.textarea},ol.prototype.supportsTouch=function(){return!1},ol.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!g||L()!=this.textarea))try{this.textarea.focus()}catch(e){}},ol.prototype.blur=function(){this.textarea.blur()},ol.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},ol.prototype.receivedFocus=function(){this.slowPoll()},ol.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},ol.prototype.fastPoll=function(){var e=!1,t=this;function n(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,n))}t.pollingFast=!0,t.polling.set(20,n)},ol.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||De(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(a&&s>=9&&this.hasSelection===i||y&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||r||(r="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var l=0,u=Math.min(r.length,i.length);l<u&&r.charCodeAt(l)==i.charCodeAt(l);)++l;return Mi(t,(function(){Ws(t,i.slice(l),r.length-l,null,e.composing?"*compose":null),i.length>1e3||i.indexOf("\n")>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},ol.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},ol.prototype.onKeyPress=function(){a&&s>=9&&(this.hasSelection=null),this.fastPoll()},ol.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=Dr(n,e),u=r.scroller.scrollTop;if(o&&!d){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(o)&&Li(n,Bo)(n.doc,so(o),W);var c,f=i.style.cssText,p=t.wrapper.style.cssText,h=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",i.style.cssText="position: absolute; width: 30px; height: 30px;\n      top: "+(e.clientY-h.top-5)+"px; left: "+(e.clientX-h.left-5)+"px;\n      z-index: 1000; background: "+(a?"rgba(255, 255, 255, .05)":"transparent")+";\n      outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",l&&(c=window.scrollY),r.input.focus(),l&&window.scrollTo(null,c),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=g,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),a&&s>=9&&v(),S){_e(e);var m=function(){ve(window,"mouseup",m),setTimeout(g,20)};he(window,"mouseup",m)}else setTimeout(g,50)}function v(){if(null!=i.selectionStart){var e=n.somethingSelected(),o="​"+(e?i.value:"");i.value="⇚",i.value=o,t.prevInput=e?"":"​",i.selectionStart=1,i.selectionEnd=o.length,r.selForContextMenu=n.doc.sel}}function g(){if(t.contextMenuPending==g&&(t.contextMenuPending=!1,t.wrapper.style.cssText=p,i.style.cssText=f,a&&s<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=u),null!=i.selectionStart)){(!a||a&&s<9)&&v();var e=0,o=function(){r.selForContextMenu==n.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&"​"==t.prevInput?Li(n,Ko)(n):e++<10?r.detectingSelectAll=setTimeout(o,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(o,200)}}},ol.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},ol.prototype.setUneditable=function(){},ol.prototype.needsContentAttribute=!1,As(Is),Xs(Is);var ll="iter insert remove copy getEditor constructor".split(" ");for(var ul in Sa.prototype)Sa.prototype.hasOwnProperty(ul)&&H(ll,ul)<0&&(Is.prototype[ul]=function(e){return function(){return e.apply(this.doc,arguments)}}(Sa.prototype[ul]));return xe(Sa),Is.inputStyles={textarea:ol,contenteditable:Js},Is.defineMode=function(e){Is.defaults.mode||"null"==e||(Is.defaults.mode=e),Ue.apply(this,arguments)},Is.defineMIME=Be,Is.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),Is.defineMIME("text/plain","null"),Is.defineExtension=function(e,t){Is.prototype[e]=t},Is.defineDocExtension=function(e,t){Sa.prototype[e]=t},Is.fromTextArea=al,sl(Is),Is.version="5.59.4",Is}()},9589:(e,t,n)=>{!function(e){"use strict";var t={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},n={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};e.defineMode("xml",(function(r,i){var o,a,s=r.indentUnit,l={},u=i.htmlMode?t:n;for(var c in u)l[c]=u[c];for(var c in i)l[c]=i[c];function d(e,t){function n(n){return t.tokenize=n,n(e,t)}var r=e.next();return"<"==r?e.eat("!")?e.eat("[")?e.match("CDATA[")?n(h("atom","]]>")):null:e.match("--")?n(h("comment","--\x3e")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),n(m(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=h("meta","?>"),"meta"):(o=e.eat("/")?"closeTag":"openTag",t.tokenize=f,"tag bracket"):"&"==r?(e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"))?"atom":"error":(e.eatWhile(/[^&<]/),null)}function f(e,t){var n=e.next();if(">"==n||"/"==n&&e.eat(">"))return t.tokenize=d,o=">"==n?"endTag":"selfcloseTag","tag bracket";if("="==n)return o="equals",null;if("<"==n){t.tokenize=d,t.state=b,t.tagName=t.tagStart=null;var r=t.tokenize(e,t);return r?r+" tag error":"tag error"}return/[\'\"]/.test(n)?(t.tokenize=p(n),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function p(e){var t=function(t,n){for(;!t.eol();)if(t.next()==e){n.tokenize=f;break}return"string"};return t.isInAttribute=!0,t}function h(e,t){return function(n,r){for(;!n.eol();){if(n.match(t)){r.tokenize=d;break}n.next()}return e}}function m(e){return function(t,n){for(var r;null!=(r=t.next());){if("<"==r)return n.tokenize=m(e+1),n.tokenize(t,n);if(">"==r){if(1==e){n.tokenize=d;break}return n.tokenize=m(e-1),n.tokenize(t,n)}}return"meta"}}function v(e,t,n){this.prev=e.context,this.tagName=t||"",this.indent=e.indented,this.startOfLine=n,(l.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function g(e){e.context&&(e.context=e.context.prev)}function y(e,t){for(var n;;){if(!e.context)return;if(n=e.context.tagName,!l.contextGrabbers.hasOwnProperty(n)||!l.contextGrabbers[n].hasOwnProperty(t))return;g(e)}}function b(e,t,n){return"openTag"==e?(n.tagStart=t.column(),w):"closeTag"==e?x:b}function w(e,t,n){return"word"==e?(n.tagName=t.current(),a="tag",C):l.allowMissingTagName&&"endTag"==e?(a="tag bracket",C(e,t,n)):(a="error",w)}function x(e,t,n){if("word"==e){var r=t.current();return n.context&&n.context.tagName!=r&&l.implicitlyClosed.hasOwnProperty(n.context.tagName)&&g(n),n.context&&n.context.tagName==r||!1===l.matchClosing?(a="tag",k):(a="tag error",S)}return l.allowMissingTagName&&"endTag"==e?(a="tag bracket",k(e,t,n)):(a="error",S)}function k(e,t,n){return"endTag"!=e?(a="error",k):(g(n),b)}function S(e,t,n){return a="error",k(e,t,n)}function C(e,t,n){if("word"==e)return a="attribute",_;if("endTag"==e||"selfcloseTag"==e){var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==e||l.autoSelfClosers.hasOwnProperty(r)?y(n,r):(y(n,r),n.context=new v(n,r,i==n.indented)),b}return a="error",C}function _(e,t,n){return"equals"==e?E:(l.allowMissing||(a="error"),C(e,t,n))}function E(e,t,n){return"string"==e?T:"word"==e&&l.allowUnquoted?(a="string",C):(a="error",C(e,t,n))}function T(e,t,n){return"string"==e?T:C(e,t,n)}return d.isInText=!0,{startState:function(e){var t={tokenize:d,state:b,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;o=null;var n=t.tokenize(e,t);return(n||o)&&"comment"!=n&&(a=null,t.state=t.state(o||n,e,t),a&&(n="error"==a?n+" error":a)),n},indent:function(t,n,r){var i=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+s;if(i&&i.noIndent)return e.Pass;if(t.tokenize!=f&&t.tokenize!=d)return r?r.match(/^(\s*)/)[0].length:0;if(t.tagName)return!1!==l.multilineTagIndentPastTag?t.tagStart+t.tagName.length+2:t.tagStart+s*(l.multilineTagIndentFactor||1);if(l.alignCDATA&&/<!\[CDATA\[/.test(n))return 0;var o=n&&/^<(\/)?([\w_:\.-]*)/.exec(n);if(o&&o[1])for(;i;){if(i.tagName==o[2]){i=i.prev;break}if(!l.implicitlyClosed.hasOwnProperty(i.tagName))break;i=i.prev}else if(o)for(;i;){var a=l.contextGrabbers[i.tagName];if(!a||!a.hasOwnProperty(o[2]))break;i=i.prev}for(;i&&i.prev&&!i.startOfLine;)i=i.prev;return i?i.indent+s:t.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:l.htmlMode?"html":"xml",helperType:l.htmlMode?"html":"xml",skipAttribute:function(e){e.state==E&&(e.state=C)},xmlCurrentTag:function(e){return e.tagName?{name:e.tagName,close:"closeTag"==e.type}:null},xmlCurrentContext:function(e){for(var t=[],n=e.context;n;n=n.prev)t.push(n.tagName);return t.reverse()}}})),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})}(n(4631))},7790:function(e,t){"use strict";var n,r=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__assign||function(){return(i=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}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.cloneNode=t.Element=t.Document=t.NodeWithChildren=t.ProcessingInstruction=t.Comment=t.Text=t.DataNode=t.Node=void 0;var o=new Map([["tag",1],["script",1],["style",1],["directive",1],["text",3],["cdata",4],["comment",8],["root",9]]),a=function(){function e(e){this.type=e,this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty(e.prototype,"nodeType",{get:function(){var e;return null!==(e=o.get(this.type))&&void 0!==e?e:1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentNode",{get:function(){return this.parent},set:function(e){this.parent=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"previousSibling",{get:function(){return this.prev},set:function(e){this.prev=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextSibling",{get:function(){return this.next},set:function(e){this.next=e},enumerable:!1,configurable:!0}),e.prototype.cloneNode=function(e){return void 0===e&&(e=!1),h(this,e)},e}();t.Node=a;var s=function(e){function t(t,n){var r=e.call(this,t)||this;return r.data=n,r}return r(t,e),Object.defineProperty(t.prototype,"nodeValue",{get:function(){return this.data},set:function(e){this.data=e},enumerable:!1,configurable:!0}),t}(a);t.DataNode=s;var l=function(e){function t(t){return e.call(this,"text",t)||this}return r(t,e),t}(s);t.Text=l;var u=function(e){function t(t){return e.call(this,"comment",t)||this}return r(t,e),t}(s);t.Comment=u;var c=function(e){function t(t,n){var r=e.call(this,"directive",n)||this;return r.name=t,r}return r(t,e),t}(s);t.ProcessingInstruction=c;var d=function(e){function t(t,n){var r=e.call(this,t)||this;return r.children=n,r}return r(t,e),Object.defineProperty(t.prototype,"firstChild",{get:function(){var e;return null!==(e=this.children[0])&&void 0!==e?e:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastChild",{get:function(){return this.children.length>0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"childNodes",{get:function(){return this.children},set:function(e){this.children=e},enumerable:!1,configurable:!0}),t}(a);t.NodeWithChildren=d;var f=function(e){function t(t){return e.call(this,"root",t)||this}return r(t,e),t}(d);t.Document=f;var p=function(e){function t(t,n,r){void 0===r&&(r=[]);var i=e.call(this,"script"===t?"script":"style"===t?"style":"tag",r)||this;return i.name=t,i.attribs=n,i.attribs=n,i}return r(t,e),Object.defineProperty(t.prototype,"tagName",{get:function(){return this.name},set:function(e){this.name=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"attributes",{get:function(){var e=this;return Object.keys(this.attribs).map((function(t){var n,r;return{name:t,value:e.attribs[t],namespace:null===(n=e["x-attribsNamespace"])||void 0===n?void 0:n[t],prefix:null===(r=e["x-attribsPrefix"])||void 0===r?void 0:r[t]}}))},enumerable:!1,configurable:!0}),t}(d);function h(e,t){var n;switch(void 0===t&&(t=!1),e.type){case"text":n=new l(e.data);break;case"directive":var r=e;n=new c(r.name,r.data),null!=r["x-name"]&&(n["x-name"]=r["x-name"],n["x-publicId"]=r["x-publicId"],n["x-systemId"]=r["x-systemId"]);break;case"comment":n=new u(e.data);break;case"tag":case"script":case"style":var o=e,a=t?m(o.children):[],s=new p(o.name,i({},o.attribs),a);a.forEach((function(e){return e.parent=s})),o["x-attribsNamespace"]&&(s["x-attribsNamespace"]=i({},o["x-attribsNamespace"])),o["x-attribsPrefix"]&&(s["x-attribsPrefix"]=i({},o["x-attribsPrefix"])),n=s;break;case"cdata":a=t?m(e.children):[];var h=new d(e.type,a);a.forEach((function(e){return e.parent=h})),n=h;break;case"root":var v=e,g=(a=t?m(v.children):[],new f(a));a.forEach((function(e){return e.parent=g})),v["x-mode"]&&(g["x-mode"]=v["x-mode"]),n=g;break;case"doctype":throw new Error("Not implemented yet: ElementType.Doctype case")}return n.startIndex=e.startIndex,n.endIndex=e.endIndex,n}function m(e){for(var t=e.map((function(e){return h(e,!0)})),n=1;n<t.length;n++)t[n].prev=t[n-1],t[n-1].next=t[n];return t}t.Element=p,t.cloneNode=h},8679:(e,t,n)=>{"use strict";var r=n(9864),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function l(e){return r.isMemo(e)?a:s[e.$$typeof]||i}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=a;var u=Object.defineProperty,c=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,h=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(h){var i=p(n);i&&i!==h&&e(t,i,r)}var a=c(n);d&&(a=a.concat(d(n)));for(var s=l(t),m=l(n),v=0;v<a.length;++v){var g=a[v];if(!(o[g]||r&&r[g]||m&&m[g]||s&&s[g])){var y=f(n,g);try{u(t,g,y)}catch(e){}}}}return t}},885:e=>{e.exports={CASE_SENSITIVE_TAG_NAMES:["animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussainBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","linearGradient","radialGradient","textPath"]}},8276:(e,t,n)=>{var r="html",i="head",o="body",a=/<([a-zA-Z]+[0-9]?)/,s=/<head.*>/i,l=/<body.*>/i,u=function(){throw new Error("This browser does not support `document.implementation.createHTMLDocument`")},c=function(){throw new Error("This browser does not support `DOMParser.prototype.parseFromString`")};if("function"==typeof window.DOMParser){var d=new window.DOMParser;u=c=function(e,t){return t&&(e="<"+t+">"+e+"</"+t+">"),d.parseFromString(e,"text/html")}}if(document.implementation){var f=n(1507).isIE,p=document.implementation.createHTMLDocument(f()?"html-dom-parser":void 0);u=function(e,t){return t?(p.documentElement.getElementsByTagName(t)[0].innerHTML=e,p):(p.documentElement.innerHTML=e,p)}}var h,m=document.createElement("template");m.content&&(h=function(e){return m.innerHTML=e,m.content.childNodes}),e.exports=function(e){var t,n,d,f,p=e.match(a);switch(p&&p[1]&&(t=p[1].toLowerCase()),t){case r:return n=c(e),s.test(e)||(d=n.getElementsByTagName(i)[0])&&d.parentNode.removeChild(d),l.test(e)||(d=n.getElementsByTagName(o)[0])&&d.parentNode.removeChild(d),n.getElementsByTagName(r);case i:case o:return f=u(e).getElementsByTagName(t),l.test(e)&&s.test(e)?f[0].parentNode.childNodes:f;default:return h?h(e):u(e,o).getElementsByTagName(o)[0].childNodes}}},4152:(e,t,n)=>{var r=n(8276),i=n(1507).formatDOM,o=/<(![a-zA-Z\s]+)>/;e.exports=function(e){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(""===e)return[];var t,n=e.match(o);return n&&n[1]&&(t=n[1]),i(r(e),null,t)}},1507:(e,t,n)=>{for(var r,i=n(885),o=n(7790),a=i.CASE_SENSITIVE_TAG_NAMES,s=o.Comment,l=o.Element,u=o.ProcessingInstruction,c=o.Text,d={},f=0,p=a.length;f<p;f++)r=a[f],d[r.toLowerCase()]=r;function h(e){for(var t,n={},r=0,i=e.length;r<i;r++)n[(t=e[r]).name]=t.value;return n}function m(e){var t=function(e){return d[e]}(e=e.toLowerCase());return t||e}e.exports={formatAttributes:h,formatDOM:function e(t,n,r){n=n||null;for(var i=[],o=0,a=t.length;o<a;o++){var d,f=t[o];switch(f.nodeType){case 1:(d=new l(m(f.nodeName),h(f.attributes))).children=e(f.childNodes,d);break;case 3:d=new c(f.nodeValue);break;case 8:d=new s(f.nodeValue);break;default:continue}var p=i[o-1]||null;p&&(p.next=d),d.parent=n,d.prev=p,d.next=null,i.push(d)}return r&&((d=new u(r.substring(0,r.indexOf(" ")).toLowerCase(),r)).next=i[0]||null,d.parent=n,i.unshift(d),i[1]&&(i[1].prev=i[0])),i},isIE:function(){return/(MSIE |Trident\/|Edge\/)/.test(navigator.userAgent)}}},488:(e,t,n)=>{var r=n(3670),i=n(484),o=n(4152),a={lowerCaseAttributeNames:!1};function s(e,t){if("string"!=typeof e)throw new TypeError("First argument must be a string");return""===e?[]:r(o(e,(t=t||{}).htmlparser2||a),t)}s.domToReact=r,s.htmlToDOM=o,s.attributesToProps=i,e.exports=s,e.exports.default=s},484:(e,t,n)=>{var r=n(2686),i=n(4606),o=i.setStyleProp,a=r.html,s=r.svg,l=r.isCustomAttribute,u=Object.prototype.hasOwnProperty;e.exports=function(e){var t,n,r,c;e=e||{};var d={};for(t in e)r=e[t],l(t)?d[t]=r:(n=t.toLowerCase(),u.call(a,n)?d[(c=a[n]).propertyName]=!!(c.hasBooleanValue||c.hasOverloadedBooleanValue&&!r)||r:u.call(s,t)?d[(c=s[t]).propertyName]=r:i.PRESERVE_CUSTOM_ATTRIBUTES&&(d[t]=r));return o(e.style,d),d}},3670:(e,t,n)=>{var r=n(7294),i=n(484),o=n(4606),a=o.setStyleProp;function s(e){return o.PRESERVE_CUSTOM_ATTRIBUTES&&"tag"===e.type&&o.isCustomComponent(e.name,e.attribs)}e.exports=function e(t,n){for(var o,l,u,c,d=(n=n||{}).library||r,f=d.cloneElement,p=d.createElement,h=d.isValidElement,m=[],v="function"==typeof n.replace,g=n.trim,y=0,b=t.length;y<b;y++)if(o=t[y],v&&h(l=n.replace(o)))b>1&&(l=f(l,{key:l.key||y})),m.push(l);else if("text"!==o.type){switch(u=o.attribs,s(o)?a(u.style,u):u&&(u=i(u)),c=null,o.type){case"script":case"style":o.children[0]&&(u.dangerouslySetInnerHTML={__html:o.children[0].data});break;case"tag":"textarea"===o.name&&o.children[0]?u.defaultValue=o.children[0].data:o.children&&o.children.length&&(c=e(o.children,n));break;default:continue}b>1&&(u.key=y),m.push(p(o.name,u,c))}else g?o.data.trim()&&m.push(o.data):m.push(o.data);return 1===m.length?m[0]:m}},4606:(e,t,n)=>{var r=n(7294),i=n(1476).default;var o={reactCompat:!0};var a=r.version.split(".")[0]>=16;e.exports={PRESERVE_CUSTOM_ATTRIBUTES:a,invertObject:function(e,t){if(!e||"object"!=typeof e)throw new TypeError("First argument must be an object");var n,r,i="function"==typeof t,o={},a={};for(n in e)r=e[n],i&&(o=t(n,r))&&2===o.length?a[o[0]]=o[1]:"string"==typeof r&&(a[r]=n);return a},isCustomComponent:function(e,t){if(-1===e.indexOf("-"))return t&&"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}},setStyleProp:function(e,t){null!=e&&(t.style=i(e,o))}}},8139:e=>{var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,r=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,l=/^\s+|\s+$/g,u="";function c(e){return e?e.replace(l,u):u}e.exports=function(e,l){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];l=l||{};var d=1,f=1;function p(e){var t=e.match(n);t&&(d+=t.length);var r=e.lastIndexOf("\n");f=~r?e.length-r:f+e.length}function h(){var e={line:d,column:f};return function(t){return t.position=new m(e),b(),t}}function m(e){this.start=e,this.end={line:d,column:f},this.source=l.source}m.prototype.content=e;var v=[];function g(t){var n=new Error(l.source+":"+d+":"+f+": "+t);if(n.reason=t,n.filename=l.source,n.line=d,n.column=f,n.source=e,!l.silent)throw n;v.push(n)}function y(t){var n=t.exec(e);if(n){var r=n[0];return p(r),e=e.slice(r.length),n}}function b(){y(r)}function w(e){var t;for(e=e||[];t=x();)!1!==t&&e.push(t);return e}function x(){var t=h();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;u!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,u===e.charAt(n-1))return g("End of comment missing");var r=e.slice(2,n-2);return f+=2,p(r),e=e.slice(n),f+=2,t({type:"comment",comment:r})}}function k(){var e=h(),n=y(i);if(n){if(x(),!y(o))return g("property missing ':'");var r=y(a),l=e({type:"declaration",property:c(n[0].replace(t,u)),value:r?c(r[0].replace(t,u)):u});return y(s),l}}return b(),function(){var e,t=[];for(w(t);e=k();)!1!==e&&(t.push(e),w(t));return t}()}},5826:e=>{e.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},7418:e=>{"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function i(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}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,o){for(var a,s,l=i(e),u=1;u<arguments.length;u++){for(var c in a=Object(arguments[u]))n.call(a,c)&&(l[c]=a[c]);if(t){s=t(a);for(var d=0;d<s.length;d++)r.call(a,s[d])&&(l[s[d]]=a[s[d]])}}return l}},4779:(e,t,n)=>{var r=n(5826);e.exports=p,e.exports.parse=o,e.exports.compile=function(e,t){return s(o(e,t),t)},e.exports.tokensToFunction=s,e.exports.tokensToRegExp=f;var i=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function o(e,t){for(var n,r=[],o=0,a=0,s="",c=t&&t.delimiter||"/";null!=(n=i.exec(e));){var d=n[0],f=n[1],p=n.index;if(s+=e.slice(a,p),a=p+d.length,f)s+=f[1];else{var h=e[a],m=n[2],v=n[3],g=n[4],y=n[5],b=n[6],w=n[7];s&&(r.push(s),s="");var x=null!=m&&null!=h&&h!==m,k="+"===b||"*"===b,S="?"===b||"*"===b,C=n[2]||c,_=g||y;r.push({name:v||o++,prefix:m||"",delimiter:C,optional:S,repeat:k,partial:x,asterisk:!!w,pattern:_?u(_):w?".*":"[^"+l(C)+"]+?"})}}return a<e.length&&(s+=e.substr(a)),s&&r.push(s),r}function a(e){return encodeURI(e).replace(/[\/?#]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}))}function s(e,t){for(var n=new Array(e.length),i=0;i<e.length;i++)"object"==typeof e[i]&&(n[i]=new RegExp("^(?:"+e[i].pattern+")$",d(t)));return function(t,i){for(var o="",s=t||{},l=(i||{}).pretty?a:encodeURIComponent,u=0;u<e.length;u++){var c=e[u];if("string"!=typeof c){var d,f=s[c.name];if(null==f){if(c.optional){c.partial&&(o+=c.prefix);continue}throw new TypeError('Expected "'+c.name+'" to be defined')}if(r(f)){if(!c.repeat)throw new TypeError('Expected "'+c.name+'" to not repeat, but received `'+JSON.stringify(f)+"`");if(0===f.length){if(c.optional)continue;throw new TypeError('Expected "'+c.name+'" to not be empty')}for(var p=0;p<f.length;p++){if(d=l(f[p]),!n[u].test(d))throw new TypeError('Expected all "'+c.name+'" to match "'+c.pattern+'", but received `'+JSON.stringify(d)+"`");o+=(0===p?c.prefix:c.delimiter)+d}}else{if(d=c.asterisk?encodeURI(f).replace(/[?#]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})):l(f),!n[u].test(d))throw new TypeError('Expected "'+c.name+'" to match "'+c.pattern+'", but received "'+d+'"');o+=c.prefix+d}}else o+=c}return o}}function l(e){return e.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function u(e){return e.replace(/([=!:$\/()])/g,"\\$1")}function c(e,t){return e.keys=t,e}function d(e){return e&&e.sensitive?"":"i"}function f(e,t,n){r(t)||(n=t||n,t=[]);for(var i=(n=n||{}).strict,o=!1!==n.end,a="",s=0;s<e.length;s++){var u=e[s];if("string"==typeof u)a+=l(u);else{var f=l(u.prefix),p="(?:"+u.pattern+")";t.push(u),u.repeat&&(p+="(?:"+f+p+")*"),a+=p=u.optional?u.partial?f+"("+p+")?":"(?:"+f+"("+p+"))?":f+"("+p+")"}}var h=l(n.delimiter||"/"),m=a.slice(-h.length)===h;return i||(a=(m?a.slice(0,-h.length):a)+"(?:"+h+"(?=$))?"),a+=o?"$":i&&m?"":"(?="+h+"|$)",c(new RegExp("^"+a,d(n)),t)}function p(e,t,n){return r(t)||(n=t||n,t=[]),n=n||{},e instanceof RegExp?function(e,t){var n=e.source.match(/\((?!\?)/g);if(n)for(var r=0;r<n.length;r++)t.push({name:r,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,asterisk:!1,pattern:null});return c(e,t)}(e,t):r(e)?function(e,t,n){for(var r=[],i=0;i<e.length;i++)r.push(p(e[i],t,n).source);return c(new RegExp("(?:"+r.join("|")+")",d(n)),t)}(e,t,n):function(e,t,n){return f(o(e,n),t,n)}(e,t,n)}},2703:(e,t,n)=>{"use strict";var r=n(414);function i(){}function o(){}o.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,o,a){if(a!==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,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:o,resetWarningCache:i};return n.PropTypes=n,n}},5697:(e,t,n)=>{e.exports=n(2703)()},414:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},9656:(e,t,n)=>{"use strict";function r(){return(r=Object.assign||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}).apply(this,arguments)}function i(e){return(i="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})(e)}var o,a=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});t.Rt=void 0;var s,l=n(7294),u="undefined"==typeof navigator||!0===n.g.PREVENT_CODEMIRROR_RENDER;u||(s=n(4631));var c=function(){function e(){}return e.equals=function(e,t){var n=this,r=Object.keys,o=i(e),a=i(t);return e&&t&&"object"===o&&o===a?r(e).length===r(t).length&&r(e).every((function(r){return n.equals(e[r],t[r])})):e===t},e}(),d=function(){function e(e,t){this.editor=e,this.props=t}return e.prototype.delegateCursor=function(e,t,n){var r=this.editor.getDoc();n&&this.editor.focus(),t?r.setCursor(e):r.setCursor(e,null,{scroll:!1})},e.prototype.delegateScroll=function(e){this.editor.scrollTo(e.x,e.y)},e.prototype.delegateSelection=function(e,t){this.editor.getDoc().setSelections(e),t&&this.editor.focus()},e.prototype.apply=function(e){e&&e.selection&&e.selection.ranges&&this.delegateSelection(e.selection.ranges,e.selection.focus||!1),e&&e.cursor&&this.delegateCursor(e.cursor,e.autoScroll||!1,this.editor.getOption("autofocus")||!1),e&&e.scroll&&this.delegateScroll(e.scroll)},e.prototype.applyNext=function(e,t,n){e&&e.selection&&e.selection.ranges&&t&&t.selection&&t.selection.ranges&&!c.equals(e.selection.ranges,t.selection.ranges)&&this.delegateSelection(t.selection.ranges,t.selection.focus||!1),e&&e.cursor&&t&&t.cursor&&!c.equals(e.cursor,t.cursor)&&this.delegateCursor(n.cursor||t.cursor,t.autoScroll||!1,t.autoCursor||!1),e&&e.scroll&&t&&t.scroll&&!c.equals(e.scroll,t.scroll)&&this.delegateScroll(t.scroll)},e.prototype.applyUserDefined=function(e,t){t&&t.cursor&&this.delegateCursor(t.cursor,e.autoScroll||!1,this.editor.getOption("autofocus")||!1)},e.prototype.wire=function(e){var t=this;Object.keys(e||{}).filter((function(e){return/^on/.test(e)})).forEach((function(e){switch(e){case"onBlur":t.editor.on("blur",(function(e,n){t.props.onBlur(t.editor,n)}));break;case"onContextMenu":t.editor.on("contextmenu",(function(e,n){t.props.onContextMenu(t.editor,n)}));break;case"onCopy":t.editor.on("copy",(function(e,n){t.props.onCopy(t.editor,n)}));break;case"onCursor":t.editor.on("cursorActivity",(function(e){t.props.onCursor(t.editor,t.editor.getDoc().getCursor())}));break;case"onCursorActivity":t.editor.on("cursorActivity",(function(e){t.props.onCursorActivity(t.editor)}));break;case"onCut":t.editor.on("cut",(function(e,n){t.props.onCut(t.editor,n)}));break;case"onDblClick":t.editor.on("dblclick",(function(e,n){t.props.onDblClick(t.editor,n)}));break;case"onDragEnter":t.editor.on("dragenter",(function(e,n){t.props.onDragEnter(t.editor,n)}));break;case"onDragLeave":t.editor.on("dragleave",(function(e,n){t.props.onDragLeave(t.editor,n)}));break;case"onDragOver":t.editor.on("dragover",(function(e,n){t.props.onDragOver(t.editor,n)}));break;case"onDragStart":t.editor.on("dragstart",(function(e,n){t.props.onDragStart(t.editor,n)}));break;case"onDrop":t.editor.on("drop",(function(e,n){t.props.onDrop(t.editor,n)}));break;case"onFocus":t.editor.on("focus",(function(e,n){t.props.onFocus(t.editor,n)}));break;case"onGutterClick":t.editor.on("gutterClick",(function(e,n,r,i){t.props.onGutterClick(t.editor,n,r,i)}));break;case"onInputRead":t.editor.on("inputRead",(function(e,n){t.props.onInputRead(t.editor,n)}));break;case"onKeyDown":t.editor.on("keydown",(function(e,n){t.props.onKeyDown(t.editor,n)}));break;case"onKeyHandled":t.editor.on("keyHandled",(function(e,n,r){t.props.onKeyHandled(t.editor,n,r)}));break;case"onKeyPress":t.editor.on("keypress",(function(e,n){t.props.onKeyPress(t.editor,n)}));break;case"onKeyUp":t.editor.on("keyup",(function(e,n){t.props.onKeyUp(t.editor,n)}));break;case"onMouseDown":t.editor.on("mousedown",(function(e,n){t.props.onMouseDown(t.editor,n)}));break;case"onPaste":t.editor.on("paste",(function(e,n){t.props.onPaste(t.editor,n)}));break;case"onRenderLine":t.editor.on("renderLine",(function(e,n,r){t.props.onRenderLine(t.editor,n,r)}));break;case"onScroll":t.editor.on("scroll",(function(e){t.props.onScroll(t.editor,t.editor.getScrollInfo())}));break;case"onSelection":t.editor.on("beforeSelectionChange",(function(e,n){t.props.onSelection(t.editor,n)}));break;case"onTouchStart":t.editor.on("touchstart",(function(e,n){t.props.onTouchStart(t.editor,n)}));break;case"onUpdate":t.editor.on("update",(function(e){t.props.onUpdate(t.editor)}));break;case"onViewportChange":t.editor.on("viewportChange",(function(e,n,r){t.props.onViewportChange(t.editor,n,r)}))}}))},e}();(function(e){function t(t){var n=e.call(this,t)||this;return u||(n.applied=!1,n.appliedNext=!1,n.appliedUserDefined=!1,n.deferred=null,n.emulating=!1,n.hydrated=!1,n.initCb=function(){n.props.editorDidConfigure&&n.props.editorDidConfigure(n.editor)},n.mounted=!1),n}a(t,e),t.prototype.hydrate=function(e){var t=this,n=e&&e.options?e.options:{},i=r({},s.defaults,this.editor.options,n);Object.keys(i).some((function(e){return t.editor.getOption(e)!==i[e]}))&&Object.keys(i).forEach((function(e){n.hasOwnProperty(e)&&t.editor.getOption(e)!==i[e]&&(t.editor.setOption(e,i[e]),t.mirror.setOption(e,i[e]))})),this.hydrated||(this.deferred?this.resolveChange(e.value):this.initChange(e.value||"")),this.hydrated=!0},t.prototype.initChange=function(e){this.emulating=!0;var t=this.editor.getDoc(),n=t.lastLine(),r=t.getLine(t.lastLine()).length;t.replaceRange(e||"",{line:0,ch:0},{line:n,ch:r}),this.mirror.setValue(e),t.clearHistory(),this.mirror.clearHistory(),this.emulating=!1},t.prototype.resolveChange=function(e){this.emulating=!0;var t=this.editor.getDoc();if("undo"===this.deferred.origin?t.undo():"redo"===this.deferred.origin?t.redo():t.replaceRange(this.deferred.text,this.deferred.from,this.deferred.to,this.deferred.origin),e&&e!==t.getValue()){var n=t.getCursor();t.setValue(e),t.setCursor(n)}this.emulating=!1,this.deferred=null},t.prototype.mirrorChange=function(e){var t=this.editor.getDoc();return"undo"===e.origin?(t.setHistory(this.mirror.getHistory()),this.mirror.undo()):"redo"===e.origin?(t.setHistory(this.mirror.getHistory()),this.mirror.redo()):this.mirror.replaceRange(e.text,e.from,e.to,e.origin),this.mirror.getValue()},t.prototype.componentDidMount=function(){var e=this;u||(this.props.defineMode&&this.props.defineMode.name&&this.props.defineMode.fn&&s.defineMode(this.props.defineMode.name,this.props.defineMode.fn),this.editor=s(this.ref,this.props.options),this.shared=new d(this.editor,this.props),this.mirror=s((function(){}),this.props.options),this.editor.on("electricInput",(function(){e.mirror.setHistory(e.editor.getDoc().getHistory())})),this.editor.on("cursorActivity",(function(){e.mirror.setCursor(e.editor.getDoc().getCursor())})),this.editor.on("beforeChange",(function(t,n){if(!e.emulating){n.cancel(),e.deferred=n;var r=e.mirrorChange(e.deferred);e.props.onBeforeChange&&e.props.onBeforeChange(e.editor,e.deferred,r)}})),this.editor.on("change",(function(t,n){e.mounted&&e.props.onChange&&e.props.onChange(e.editor,n,e.editor.getValue())})),this.hydrate(this.props),this.shared.apply(this.props),this.applied=!0,this.mounted=!0,this.shared.wire(this.props),this.editor.getOption("autofocus")&&this.editor.focus(),this.props.editorDidMount&&this.props.editorDidMount(this.editor,this.editor.getValue(),this.initCb))},t.prototype.componentDidUpdate=function(e){if(!u){var t={cursor:null};this.props.value!==e.value&&(this.hydrated=!1),this.props.autoCursor||void 0===this.props.autoCursor||(t.cursor=this.editor.getDoc().getCursor()),this.hydrate(this.props),this.appliedNext||(this.shared.applyNext(e,this.props,t),this.appliedNext=!0),this.shared.applyUserDefined(e,t),this.appliedUserDefined=!0}},t.prototype.componentWillUnmount=function(){u||this.props.editorWillUnmount&&this.props.editorWillUnmount(s)},t.prototype.shouldComponentUpdate=function(e,t){return!u},t.prototype.render=function(){var e=this;if(u)return null;var t=this.props.className?"react-codemirror2 "+this.props.className:"react-codemirror2";return l.createElement("div",{className:t,ref:function(t){return e.ref=t}})}})(l.Component);var f=function(e){function t(t){var n=e.call(this,t)||this;return u||(n.applied=!1,n.appliedUserDefined=!1,n.continueChange=!1,n.detached=!1,n.hydrated=!1,n.initCb=function(){n.props.editorDidConfigure&&n.props.editorDidConfigure(n.editor)},n.mounted=!1,n.onBeforeChangeCb=function(){n.continueChange=!0}),n}return a(t,e),t.prototype.hydrate=function(e){var t=this,n=e&&e.options?e.options:{},i=r({},s.defaults,this.editor.options,n);if(Object.keys(i).some((function(e){return t.editor.getOption(e)!==i[e]}))&&Object.keys(i).forEach((function(e){n.hasOwnProperty(e)&&t.editor.getOption(e)!==i[e]&&t.editor.setOption(e,i[e])})),!this.hydrated){var o=this.editor.getDoc(),a=o.lastLine(),l=o.getLine(o.lastLine()).length;o.replaceRange(e.value||"",{line:0,ch:0},{line:a,ch:l})}this.hydrated=!0},t.prototype.componentDidMount=function(){var e=this;u||(this.detached=!0===this.props.detach,this.props.defineMode&&this.props.defineMode.name&&this.props.defineMode.fn&&s.defineMode(this.props.defineMode.name,this.props.defineMode.fn),this.editor=s(this.ref,this.props.options),this.shared=new d(this.editor,this.props),this.editor.on("beforeChange",(function(t,n){e.props.onBeforeChange&&e.props.onBeforeChange(e.editor,n,e.editor.getValue(),e.onBeforeChangeCb)})),this.editor.on("change",(function(t,n){e.mounted&&e.props.onChange&&(e.props.onBeforeChange?e.continueChange&&e.props.onChange(e.editor,n,e.editor.getValue()):e.props.onChange(e.editor,n,e.editor.getValue()))})),this.hydrate(this.props),this.shared.apply(this.props),this.applied=!0,this.mounted=!0,this.shared.wire(this.props),this.editor.getDoc().clearHistory(),this.props.editorDidMount&&this.props.editorDidMount(this.editor,this.editor.getValue(),this.initCb))},t.prototype.componentDidUpdate=function(e){if(this.detached&&!1===this.props.detach&&(this.detached=!1,e.editorDidAttach&&e.editorDidAttach(this.editor)),this.detached||!0!==this.props.detach||(this.detached=!0,e.editorDidDetach&&e.editorDidDetach(this.editor)),!u&&!this.detached){var t={cursor:null};this.props.value!==e.value&&(this.hydrated=!1,this.applied=!1,this.appliedUserDefined=!1),e.autoCursor||void 0===e.autoCursor||(t.cursor=this.editor.getDoc().getCursor()),this.hydrate(this.props),this.applied||(this.shared.apply(e),this.applied=!0),this.appliedUserDefined||(this.shared.applyUserDefined(e,t),this.appliedUserDefined=!0)}},t.prototype.componentWillUnmount=function(){u||this.props.editorWillUnmount&&this.props.editorWillUnmount(s)},t.prototype.shouldComponentUpdate=function(e,t){var n=!0;return u&&(n=!1),this.detached&&e.detach&&(n=!1),n},t.prototype.render=function(){var e=this;if(u)return null;var t=this.props.className?"react-codemirror2 "+this.props.className:"react-codemirror2";return l.createElement("div",{className:t,ref:function(t){return e.ref=t}})},t}(l.Component);t.Rt=f},4448:(e,t,n)=>{"use strict";var r=n(7294),i=n(7418),o=n(3840);function a(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(a(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 d=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),f=/^[: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={},m={};function v(e,t,n,r,i,o,a){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=o,this.removeEmptyString=a}var g={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){g[e]=new v(e,0,!1,e,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];g[t]=new v(t,1,!1,e[1],null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){g[e]=new v(e,2,!1,e.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){g[e]=new v(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){g[e]=new v(e,3,!1,e.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((function(e){g[e]=new v(e,3,!0,e,null,!1,!1)})),["capture","download"].forEach((function(e){g[e]=new v(e,4,!1,e,null,!1,!1)})),["cols","rows","size","span"].forEach((function(e){g[e]=new v(e,6,!1,e,null,!1,!1)})),["rowSpan","start"].forEach((function(e){g[e]=new v(e,5,!1,e.toLowerCase(),null,!1,!1)}));var y=/[\-:]([a-z])/g;function b(e){return e[1].toUpperCase()}function w(e,t,n,r){var i=g.hasOwnProperty(t)?g[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(m,e)||!p.call(h,e)&&(f.test(e)?m[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(y,b);g[t]=new v(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(y,b);g[t]=new v(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(y,b);g[t]=new v(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((function(e){g[e]=new v(e,1,!1,e.toLowerCase(),null,!1,!1)})),g.xlinkHref=new v("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((function(e){g[e]=new v(e,1,!1,e.toLowerCase(),null,!0,!0)}));var x=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,k=60103,S=60106,C=60107,_=60108,E=60114,T=60109,j=60110,O=60112,N=60113,M=60120,L=60115,P=60116,A=60121,D=60128,R=60129,I=60130,F=60131;if("function"==typeof Symbol&&Symbol.for){var z=Symbol.for;k=z("react.element"),S=z("react.portal"),C=z("react.fragment"),_=z("react.strict_mode"),E=z("react.profiler"),T=z("react.provider"),j=z("react.context"),O=z("react.forward_ref"),N=z("react.suspense"),M=z("react.suspense_list"),L=z("react.memo"),P=z("react.lazy"),A=z("react.block"),z("react.scope"),D=z("react.opaque.id"),R=z("react.debug_trace_mode"),I=z("react.offscreen"),F=z("react.legacy_hidden")}var H,U="function"==typeof Symbol&&Symbol.iterator;function B(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=U&&e[U]||e["@@iterator"])?e:null}function W(e){if(void 0===H)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);H=t&&t[1]||""}return"\n"+H+e}var $=!1;function V(e,t){if(!e||$)return"";$=!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"),o=r.stack.split("\n"),a=i.length-1,s=o.length-1;1<=a&&0<=s&&i[a]!==o[s];)s--;for(;1<=a&&0<=s;a--,s--)if(i[a]!==o[s]){if(1!==a||1!==s)do{if(a--,0>--s||i[a]!==o[s])return"\n"+i[a].replace(" at new "," at ")}while(1<=a&&0<=s);break}}}finally{$=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?W(e):""}function q(e){switch(e.tag){case 5:return W(e.type);case 16:return W("Lazy");case 13:return W("Suspense");case 19:return W("SuspenseList");case 0:case 2:case 15:return e=V(e.type,!1);case 11:return e=V(e.type.render,!1);case 22:return e=V(e.type._render,!1);case 1:return e=V(e.type,!0);default:return""}}function G(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 C:return"Fragment";case S:return"Portal";case E:return"Profiler";case _:return"StrictMode";case N:return"Suspense";case M:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case j: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 L:return G(e.type);case A:return G(e._render);case P:t=e._payload,e=e._init;try{return G(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 X(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function K(e){e._valueTracker||(e._valueTracker=function(e){var t=X(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,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=""+e,o.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 Q(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=X(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function J(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)&&w(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&&J(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}function oe(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 ae(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(a(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(a(92));if(Array.isArray(n)){if(!(1>=n.length))throw Error(a(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 de="http://www.w3.org/1999/xhtml",fe="http://www.w3.org/2000/svg";function pe(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 he(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?pe(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var me,ve,ge=(ve=function(e,t){if(e.namespaceURI!==fe||"innerHTML"in e)e.innerHTML=t;else{for((me=me||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=me.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 be={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},we=["Webkit","ms","Moz","O"];function xe(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||be.hasOwnProperty(e)&&be[e]?(""+t).trim():t+"px"}function ke(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),i=xe(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}Object.keys(be).forEach((function(e){we.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),be[t]=be[e]}))}));var Se=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 Ce(e,t){if(t){if(Se[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(a(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(a(60));if("object"!=typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(a(61))}if(null!=t.style&&"object"!=typeof t.style)throw Error(a(62))}}function _e(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 Ee(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var Te=null,je=null,Oe=null;function Ne(e){if(e=ei(e)){if("function"!=typeof Te)throw Error(a(280));var t=e.stateNode;t&&(t=ni(t),Te(e.stateNode,e.type,t))}}function Me(e){je?Oe?Oe.push(e):Oe=[e]:je=e}function Le(){if(je){var e=je,t=Oe;if(Oe=je=null,Ne(e),t)for(e=0;e<t.length;e++)Ne(t[e])}}function Pe(e,t){return e(t)}function Ae(e,t,n,r,i){return e(t,n,r,i)}function De(){}var Re=Pe,Ie=!1,Fe=!1;function ze(){null===je&&null===Oe||(De(),Le())}function He(e,t){var n=e.stateNode;if(null===n)return null;var r=ni(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(a(231,t,typeof n));return n}var Ue=!1;if(d)try{var Be={};Object.defineProperty(Be,"passive",{get:function(){Ue=!0}}),window.addEventListener("test",Be,Be),window.removeEventListener("test",Be,Be)}catch(ve){Ue=!1}function We(e,t,n,r,i,o,a,s,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(e){this.onError(e)}}var $e=!1,Ve=null,qe=!1,Ge=null,Ye={onError:function(e){$e=!0,Ve=e}};function Xe(e,t,n,r,i,o,a,s,l){$e=!1,Ve=null,We.apply(Ye,arguments)}function Ke(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!=(1026&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function Qe(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 Je(e){if(Ke(e)!==e)throw Error(a(188))}function Ze(e){if(!(e=function(e){var t=e.alternate;if(!t){if(null===(t=Ke(e)))throw Error(a(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(null===i)break;var o=i.alternate;if(null===o){if(null!==(r=i.return)){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return Je(i),e;if(o===r)return Je(i),t;o=o.sibling}throw Error(a(188))}if(n.return!==r.return)n=i,r=o;else{for(var s=!1,l=i.child;l;){if(l===n){s=!0,n=i,r=o;break}if(l===r){s=!0,r=i,n=o;break}l=l.sibling}if(!s){for(l=o.child;l;){if(l===n){s=!0,n=o,r=i;break}if(l===r){s=!0,r=o,n=i;break}l=l.sibling}if(!s)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(3!==n.tag)throw Error(a(188));return n.stateNode.current===n?e:t}(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 et(e,t){for(var n=e.alternate;null!==t;){if(t===e||t===n)return!0;t=t.return}return!1}var tt,nt,rt,it,ot=!1,at=[],st=null,lt=null,ut=null,ct=new Map,dt=new Map,ft=[],pt="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 ht(e,t,n,r,i){return{blockedOn:e,domEventName:t,eventSystemFlags:16|n,nativeEvent:i,targetContainers:[r]}}function mt(e,t){switch(e){case"focusin":case"focusout":st=null;break;case"dragenter":case"dragleave":lt=null;break;case"mouseover":case"mouseout":ut=null;break;case"pointerover":case"pointerout":ct.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":dt.delete(t.pointerId)}}function vt(e,t,n,r,i,o){return null===e||e.nativeEvent!==o?(e=ht(t,n,r,i,o),null!==t&&(null!==(t=ei(t))&&nt(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,null!==i&&-1===t.indexOf(i)&&t.push(i),e)}function gt(e){var t=Zr(e.target);if(null!==t){var n=Ke(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=Qe(n)))return e.blockedOn=t,void it(e.lanePriority,(function(){o.unstable_runWithPriority(e.priority,(function(){rt(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=Zt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n)return null!==(t=ei(n))&&nt(t),e.blockedOn=n,!1;t.shift()}return!0}function bt(e,t,n){yt(e)&&n.delete(t)}function wt(){for(ot=!1;0<at.length;){var e=at[0];if(null!==e.blockedOn){null!==(e=ei(e.blockedOn))&&tt(e);break}for(var t=e.targetContainers;0<t.length;){var n=Zt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n){e.blockedOn=n;break}t.shift()}null===e.blockedOn&&at.shift()}null!==st&&yt(st)&&(st=null),null!==lt&&yt(lt)&&(lt=null),null!==ut&&yt(ut)&&(ut=null),ct.forEach(bt),dt.forEach(bt)}function xt(e,t){e.blockedOn===t&&(e.blockedOn=null,ot||(ot=!0,o.unstable_scheduleCallback(o.unstable_NormalPriority,wt)))}function kt(e){function t(t){return xt(t,e)}if(0<at.length){xt(at[0],e);for(var n=1;n<at.length;n++){var r=at[n];r.blockedOn===e&&(r.blockedOn=null)}}for(null!==st&&xt(st,e),null!==lt&&xt(lt,e),null!==ut&&xt(ut,e),ct.forEach(t),dt.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 St(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ct={animationend:St("Animation","AnimationEnd"),animationiteration:St("Animation","AnimationIteration"),animationstart:St("Animation","AnimationStart"),transitionend:St("Transition","TransitionEnd")},_t={},Et={};function Tt(e){if(_t[e])return _t[e];if(!Ct[e])return e;var t,n=Ct[e];for(t in n)if(n.hasOwnProperty(t)&&t in Et)return _t[e]=n[t];return e}d&&(Et=document.createElement("div").style,"AnimationEvent"in window||(delete Ct.animationend.animation,delete Ct.animationiteration.animation,delete Ct.animationstart.animation),"TransitionEvent"in window||delete Ct.transitionend.transition);var jt=Tt("animationend"),Ot=Tt("animationiteration"),Nt=Tt("animationstart"),Mt=Tt("transitionend"),Lt=new Map,Pt=new Map,At=["abort","abort",jt,"animationEnd",Ot,"animationIteration",Nt,"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",Mt,"transitionEnd","waiting","waiting"];function Dt(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)),Pt.set(r,t),Lt.set(r,i),u(i,[r])}}(0,o.unstable_now)();var Rt=8;function It(e){if(0!=(1&e))return Rt=15,1;if(0!=(2&e))return Rt=14,2;if(0!=(4&e))return Rt=13,4;var t=24&e;return 0!==t?(Rt=12,t):0!=(32&e)?(Rt=11,32):0!==(t=192&e)?(Rt=10,t):0!=(256&e)?(Rt=9,256):0!==(t=3584&e)?(Rt=8,t):0!=(4096&e)?(Rt=7,4096):0!==(t=4186112&e)?(Rt=6,t):0!==(t=62914560&e)?(Rt=5,t):67108864&e?(Rt=4,67108864):0!=(134217728&e)?(Rt=3,134217728):0!==(t=805306368&e)?(Rt=2,t):0!=(1073741824&e)?(Rt=1,1073741824):(Rt=8,e)}function Ft(e,t){var n=e.pendingLanes;if(0===n)return Rt=0;var r=0,i=0,o=e.expiredLanes,a=e.suspendedLanes,s=e.pingedLanes;if(0!==o)r=o,i=Rt=15;else if(0!==(o=134217727&n)){var l=o&~a;0!==l?(r=It(l),i=Rt):0!==(s&=o)&&(r=It(s),i=Rt)}else 0!==(o=n&~a)?(r=It(o),i=Rt):0!==s&&(r=It(s),i=Rt);if(0===r)return 0;if(r=n&((0>(r=31-$t(r))?0:1<<r)<<1)-1,0!==t&&t!==r&&0==(t&a)){if(It(t),i<=Rt)return t;Rt=i}if(0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0<t;)i=1<<(n=31-$t(t)),r|=e[n],t&=~i;return r}function zt(e){return 0!==(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function Ht(e,t){switch(e){case 15:return 1;case 14:return 2;case 12:return 0===(e=Ut(24&~t))?Ht(10,t):e;case 10:return 0===(e=Ut(192&~t))?Ht(8,t):e;case 8:return 0===(e=Ut(3584&~t))&&(0===(e=Ut(4186112&~t))&&(e=512)),e;case 2:return 0===(t=Ut(805306368&~t))&&(t=268435456),t}throw Error(a(358,e))}function Ut(e){return e&-e}function Bt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Wt(e,t,n){e.pendingLanes|=t;var r=t-1;e.suspendedLanes&=r,e.pingedLanes&=r,(e=e.eventTimes)[t=31-$t(t)]=n}var $t=Math.clz32?Math.clz32:function(e){return 0===e?32:31-(Vt(e)/qt|0)|0},Vt=Math.log,qt=Math.LN2;var Gt=o.unstable_UserBlockingPriority,Yt=o.unstable_runWithPriority,Xt=!0;function Kt(e,t,n,r){Ie||De();var i=Jt,o=Ie;Ie=!0;try{Ae(i,e,t,n,r)}finally{(Ie=o)||ze()}}function Qt(e,t,n,r){Yt(Gt,Jt.bind(null,e,t,n,r))}function Jt(e,t,n,r){var i;if(Xt)if((i=0==(4&t))&&0<at.length&&-1<pt.indexOf(e))e=ht(null,e,t,n,r),at.push(e);else{var o=Zt(e,t,n,r);if(null===o)i&&mt(e,r);else{if(i){if(-1<pt.indexOf(e))return e=ht(o,e,t,n,r),void at.push(e);if(function(e,t,n,r,i){switch(t){case"focusin":return st=vt(st,e,t,n,r,i),!0;case"dragenter":return lt=vt(lt,e,t,n,r,i),!0;case"mouseover":return ut=vt(ut,e,t,n,r,i),!0;case"pointerover":var o=i.pointerId;return ct.set(o,vt(ct.get(o)||null,e,t,n,r,i)),!0;case"gotpointercapture":return o=i.pointerId,dt.set(o,vt(dt.get(o)||null,e,t,n,r,i)),!0}return!1}(o,e,t,n,r))return;mt(e,r)}Lr(e,t,r,null,n)}}}function Zt(e,t,n,r){var i=Ee(r);if(null!==(i=Zr(i))){var o=Ke(i);if(null===o)i=null;else{var a=o.tag;if(13===a){if(null!==(i=Qe(o)))return i;i=null}else if(3===a){if(o.stateNode.hydrate)return 3===o.tag?o.stateNode.containerInfo:null;i=null}else o!==i&&(i=null)}}return Lr(e,t,r,i,n),null}var en=null,tn=null,nn=null;function rn(){if(nn)return nn;var e,t,n=tn,r=n.length,i="value"in en?en.value:en.textContent,o=i.length;for(e=0;e<r&&n[e]===i[e];e++);var a=r-e;for(t=1;t<=a&&n[r-t]===i[o-t];t++);return nn=i.slice(e,1<t?1-t:void 0)}function on(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 sn(){return!1}function ln(e){function t(t,n,r,i,o){for(var a in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=o,this.currentTarget=null,e)e.hasOwnProperty(a)&&(t=e[a],this[a]=t?t(i):i[a]);return this.isDefaultPrevented=(null!=i.defaultPrevented?i.defaultPrevented:!1===i.returnValue)?an:sn,this.isPropagationStopped=sn,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 un,cn,dn,fn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},pn=ln(fn),hn=i({},fn,{view:0,detail:0}),mn=ln(hn),vn=i({},hn,{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!==dn&&(dn&&"mousemove"===e.type?(un=e.screenX-dn.screenX,cn=e.screenY-dn.screenY):cn=un=0,dn=e),un)},movementY:function(e){return"movementY"in e?e.movementY:cn}}),gn=ln(vn),yn=ln(i({},vn,{dataTransfer:0})),bn=ln(i({},hn,{relatedTarget:0})),wn=ln(i({},fn,{animationName:0,elapsedTime:0,pseudoElement:0})),xn=ln(i({},fn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}})),kn=ln(i({},fn,{data:0})),Sn={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Cn={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 En(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=_n[e])&&!!t[e]}function Tn(){return En}var jn=ln(i({},hn,{key:function(e){if(e.key){var t=Sn[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=on(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?Cn[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?on(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?on(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}})),On=ln(i({},vn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Nn=ln(i({},hn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Tn})),Mn=ln(i({},fn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Ln=ln(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})),Pn=[9,13,27,32],An=d&&"CompositionEvent"in window,Dn=null;d&&"documentMode"in document&&(Dn=document.documentMode);var Rn=d&&"TextEvent"in window&&!Dn,In=d&&(!An||Dn&&8<Dn&&11>=Dn),Fn=String.fromCharCode(32),zn=!1;function Hn(e,t){switch(e){case"keyup":return-1!==Pn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Un(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Bn=!1;var Wn={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?!!Wn[e.type]:"textarea"===t}function Vn(e,t,n,r){Me(r),0<(t=Ar(t,"onChange")).length&&(n=new pn("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var qn=null,Gn=null;function Yn(e){Er(e,0)}function Xn(e){if(Q(ti(e)))return e}function Kn(e,t){if("change"===e)return t}var Qn=!1;if(d){var Jn;if(d){var Zn="oninput"in document;if(!Zn){var er=document.createElement("div");er.setAttribute("oninput","return;"),Zn="function"==typeof er.oninput}Jn=Zn}else Jn=!1;Qn=Jn&&(!document.documentMode||9<document.documentMode)}function tr(){qn&&(qn.detachEvent("onpropertychange",nr),Gn=qn=null)}function nr(e){if("value"===e.propertyName&&Xn(Gn)){var t=[];if(Vn(t,Gn,e,Ee(e)),e=Yn,Ie)e(t);else{Ie=!0;try{Pe(e,t)}finally{Ie=!1,ze()}}}}function rr(e,t,n){"focusin"===e?(tr(),Gn=n,(qn=t).attachEvent("onpropertychange",nr)):"focusout"===e&&tr()}function ir(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Xn(Gn)}function or(e,t){if("click"===e)return Xn(t)}function ar(e,t){if("input"===e||"change"===e)return Xn(t)}var sr="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},lr=Object.prototype.hasOwnProperty;function ur(e,t){if(sr(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(!lr.call(t,n[r])||!sr(e[n[r]],t[n[r]]))return!1;return!0}function cr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function dr(e,t){var n,r=cr(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=cr(r)}}function fr(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?fr(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function pr(){for(var e=window,t=J();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(!n)break;t=J((e=t.contentWindow).document)}return t}function hr(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 mr=d&&"documentMode"in document&&11>=document.documentMode,vr=null,gr=null,yr=null,br=!1;function wr(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;br||null==vr||vr!==J(r)||("selectionStart"in(r=vr)&&hr(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},yr&&ur(yr,r)||(yr=r,0<(r=Ar(gr,"onSelect")).length&&(t=new pn("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=vr)))}Dt("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),Dt("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),Dt(At,2);for(var xr="change selectionchange textInput compositionstart compositionend compositionupdate".split(" "),kr=0;kr<xr.length;kr++)Pt.set(xr[kr],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 Sr="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Cr=new Set("cancel close invalid load scroll toggle".split(" ").concat(Sr));function _r(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,function(e,t,n,r,i,o,s,l,u){if(Xe.apply(this,arguments),$e){if(!$e)throw Error(a(198));var c=Ve;$e=!1,Ve=null,qe||(qe=!0,Ge=c)}}(r,t,void 0,e),e.currentTarget=null}function Er(e,t){t=0!=(4&t);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var o=void 0;if(t)for(var a=r.length-1;0<=a;a--){var s=r[a],l=s.instance,u=s.currentTarget;if(s=s.listener,l!==o&&i.isPropagationStopped())break e;_r(i,s,u),o=l}else for(a=0;a<r.length;a++){if(l=(s=r[a]).instance,u=s.currentTarget,s=s.listener,l!==o&&i.isPropagationStopped())break e;_r(i,s,u),o=l}}}if(qe)throw e=Ge,qe=!1,Ge=null,e}function Tr(e,t){var n=ri(t),r=e+"__bubble";n.has(r)||(Mr(t,e,2,!1),n.add(r))}var jr="_reactListening"+Math.random().toString(36).slice(2);function Or(e){e[jr]||(e[jr]=!0,s.forEach((function(t){Cr.has(t)||Nr(t,!1,e,null),Nr(t,!0,e,null)})))}function Nr(e,t,n,r){var i=4<arguments.length&&void 0!==arguments[4]?arguments[4]:0,o=n;if("selectionchange"===e&&9!==n.nodeType&&(o=n.ownerDocument),null!==r&&!t&&Cr.has(e)){if("scroll"!==e)return;i|=2,o=r}var a=ri(o),s=e+"__"+(t?"capture":"bubble");a.has(s)||(t&&(i|=4),Mr(o,e,i,t),a.add(s))}function Mr(e,t,n,r){var i=Pt.get(t);switch(void 0===i?2:i){case 0:i=Kt;break;case 1:i=Qt;break;default:i=Jt}n=i.bind(null,t,n,e),i=void 0,!Ue||"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 Lr(e,t,n,r,i){var o=r;if(0==(1&t)&&0==(2&t)&&null!==r)e:for(;;){if(null===r)return;var a=r.tag;if(3===a||4===a){var s=r.stateNode.containerInfo;if(s===i||8===s.nodeType&&s.parentNode===i)break;if(4===a)for(a=r.return;null!==a;){var l=a.tag;if((3===l||4===l)&&((l=a.stateNode.containerInfo)===i||8===l.nodeType&&l.parentNode===i))return;a=a.return}for(;null!==s;){if(null===(a=Zr(s)))return;if(5===(l=a.tag)||6===l){r=o=a;continue e}s=s.parentNode}}r=r.return}!function(e,t,n){if(Fe)return e(t,n);Fe=!0;try{Re(e,t,n)}finally{Fe=!1,ze()}}((function(){var r=o,i=Ee(n),a=[];e:{var s=Lt.get(e);if(void 0!==s){var l=pn,u=e;switch(e){case"keypress":if(0===on(n))break e;case"keydown":case"keyup":l=jn;break;case"focusin":u="focus",l=bn;break;case"focusout":u="blur",l=bn;break;case"beforeblur":case"afterblur":l=bn;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=Nn;break;case jt:case Ot:case Nt:l=wn;break;case Mt:l=Mn;break;case"scroll":l=mn;break;case"wheel":l=Ln;break;case"copy":case"cut":case"paste":l=xn;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":l=On}var c=0!=(4&t),d=!c&&"scroll"===e,f=c?null!==s?s+"Capture":null:s;c=[];for(var p,h=r;null!==h;){var m=(p=h).stateNode;if(5===p.tag&&null!==m&&(p=m,null!==f&&(null!=(m=He(h,f))&&c.push(Pr(h,m,p)))),d)break;h=h.return}0<c.length&&(s=new l(s,u,null,n,i),a.push({event:s,listeners:c}))}}if(0==(7&t)){if(l="mouseout"===e||"pointerout"===e,(!(s="mouseover"===e||"pointerover"===e)||0!=(16&t)||!(u=n.relatedTarget||n.fromElement)||!Zr(u)&&!u[Qr])&&(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)?Zr(u):null)&&(u!==(d=Ke(u))||5!==u.tag&&6!==u.tag)&&(u=null)):(l=null,u=r),l!==u)){if(c=gn,m="onMouseLeave",f="onMouseEnter",h="mouse","pointerout"!==e&&"pointerover"!==e||(c=On,m="onPointerLeave",f="onPointerEnter",h="pointer"),d=null==l?s:ti(l),p=null==u?s:ti(u),(s=new c(m,h+"leave",l,n,i)).target=d,s.relatedTarget=p,m=null,Zr(i)===r&&((c=new c(f,h+"enter",u,n,i)).target=p,c.relatedTarget=d,m=c),d=m,l&&u)e:{for(f=u,h=0,p=c=l;p;p=Dr(p))h++;for(p=0,m=f;m;m=Dr(m))p++;for(;0<h-p;)c=Dr(c),h--;for(;0<p-h;)f=Dr(f),p--;for(;h--;){if(c===f||null!==f&&c===f.alternate)break e;c=Dr(c),f=Dr(f)}c=null}else c=null;null!==l&&Rr(a,s,l,c,!1),null!==u&&null!==d&&Rr(a,d,u,c,!0)}if("select"===(l=(s=r?ti(r):window).nodeName&&s.nodeName.toLowerCase())||"input"===l&&"file"===s.type)var v=Kn;else if($n(s))if(Qn)v=ar;else{v=ir;var g=rr}else(l=s.nodeName)&&"input"===l.toLowerCase()&&("checkbox"===s.type||"radio"===s.type)&&(v=or);switch(v&&(v=v(e,r))?Vn(a,v,n,i):(g&&g(e,s,r),"focusout"===e&&(g=s._wrapperState)&&g.controlled&&"number"===s.type&&ie(s,"number",s.value)),g=r?ti(r):window,e){case"focusin":($n(g)||"true"===g.contentEditable)&&(vr=g,gr=r,yr=null);break;case"focusout":yr=gr=vr=null;break;case"mousedown":br=!0;break;case"contextmenu":case"mouseup":case"dragend":br=!1,wr(a,n,i);break;case"selectionchange":if(mr)break;case"keydown":case"keyup":wr(a,n,i)}var y;if(An)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 Bn?Hn(e,n)&&(b="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(b="onCompositionStart");b&&(In&&"ko"!==n.locale&&(Bn||"onCompositionStart"!==b?"onCompositionEnd"===b&&Bn&&(y=rn()):(tn="value"in(en=i)?en.value:en.textContent,Bn=!0)),0<(g=Ar(r,b)).length&&(b=new kn(b,e,null,n,i),a.push({event:b,listeners:g}),y?b.data=y:null!==(y=Un(n))&&(b.data=y))),(y=Rn?function(e,t){switch(e){case"compositionend":return Un(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(Bn)return"compositionend"===e||!An&&Hn(e,t)?(e=rn(),nn=tn=en=null,Bn=!1,e):null;switch(e){case"paste":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 In&&"ko"!==t.locale?null:t.data;default:return null}}(e,n))&&(0<(r=Ar(r,"onBeforeInput")).length&&(i=new kn("onBeforeInput","beforeinput",null,n,i),a.push({event:i,listeners:r}),i.data=y))}Er(a,t)}))}function Pr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ar(e,t){for(var n=t+"Capture",r=[];null!==e;){var i=e,o=i.stateNode;5===i.tag&&null!==o&&(i=o,null!=(o=He(e,n))&&r.unshift(Pr(e,o,i)),null!=(o=He(e,t))&&r.push(Pr(e,o,i))),e=e.return}return r}function Dr(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function Rr(e,t,n,r,i){for(var o=t._reactName,a=[];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=He(n,o))&&a.unshift(Pr(n,l,s)):i||null!=(l=He(n,o))&&a.push(Pr(n,l,s))),n=n.return}0!==a.length&&e.push({event:t,listeners:a})}function Ir(){}var Fr=null,zr=null;function Hr(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function Ur(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 Br="function"==typeof setTimeout?setTimeout:void 0,Wr="function"==typeof clearTimeout?clearTimeout:void 0;function $r(e){1===e.nodeType?e.textContent="":9===e.nodeType&&(null!=(e=e.body)&&(e.textContent=""))}function Vr(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break}return e}function qr(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 Gr=0;var Yr=Math.random().toString(36).slice(2),Xr="__reactFiber$"+Yr,Kr="__reactProps$"+Yr,Qr="__reactContainer$"+Yr,Jr="__reactEvents$"+Yr;function Zr(e){var t=e[Xr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Qr]||n[Xr]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=qr(e);null!==e;){if(n=e[Xr])return n;e=qr(e)}return t}n=(e=n).parentNode}return null}function ei(e){return!(e=e[Xr]||e[Qr])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function ti(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(a(33))}function ni(e){return e[Kr]||null}function ri(e){var t=e[Jr];return void 0===t&&(t=e[Jr]=new Set),t}var ii=[],oi=-1;function ai(e){return{current:e}}function si(e){0>oi||(e.current=ii[oi],ii[oi]=null,oi--)}function li(e,t){oi++,ii[oi]=e.current,e.current=t}var ui={},ci=ai(ui),di=ai(!1),fi=ui;function pi(e,t){var n=e.type.contextTypes;if(!n)return ui;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i,o={};for(i in n)o[i]=t[i];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function hi(e){return null!=(e=e.childContextTypes)}function mi(){si(di),si(ci)}function vi(e,t,n){if(ci.current!==ui)throw Error(a(168));li(ci,t),li(di,n)}function gi(e,t,n){var r=e.stateNode;if(e=t.childContextTypes,"function"!=typeof r.getChildContext)return n;for(var o in r=r.getChildContext())if(!(o in e))throw Error(a(108,G(t)||"Unknown",o));return i({},n,r)}function yi(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ui,fi=ci.current,li(ci,e),li(di,di.current),!0}function bi(e,t,n){var r=e.stateNode;if(!r)throw Error(a(169));n?(e=gi(e,t,fi),r.__reactInternalMemoizedMergedChildContext=e,si(di),si(ci),li(ci,e)):si(di),li(di,n)}var wi=null,xi=null,ki=o.unstable_runWithPriority,Si=o.unstable_scheduleCallback,Ci=o.unstable_cancelCallback,_i=o.unstable_shouldYield,Ei=o.unstable_requestPaint,Ti=o.unstable_now,ji=o.unstable_getCurrentPriorityLevel,Oi=o.unstable_ImmediatePriority,Ni=o.unstable_UserBlockingPriority,Mi=o.unstable_NormalPriority,Li=o.unstable_LowPriority,Pi=o.unstable_IdlePriority,Ai={},Di=void 0!==Ei?Ei:function(){},Ri=null,Ii=null,Fi=!1,zi=Ti(),Hi=1e4>zi?Ti:function(){return Ti()-zi};function Ui(){switch(ji()){case Oi:return 99;case Ni:return 98;case Mi:return 97;case Li:return 96;case Pi:return 95;default:throw Error(a(332))}}function Bi(e){switch(e){case 99:return Oi;case 98:return Ni;case 97:return Mi;case 96:return Li;case 95:return Pi;default:throw Error(a(332))}}function Wi(e,t){return e=Bi(e),ki(e,t)}function $i(e,t,n){return e=Bi(e),Si(e,t,n)}function Vi(){if(null!==Ii){var e=Ii;Ii=null,Ci(e)}qi()}function qi(){if(!Fi&&null!==Ri){Fi=!0;var e=0;try{var t=Ri;Wi(99,(function(){for(;e<t.length;e++){var n=t[e];do{n=n(!0)}while(null!==n)}})),Ri=null}catch(t){throw null!==Ri&&(Ri=Ri.slice(e+1)),Si(Oi,Vi),t}finally{Fi=!1}}}var Gi=x.ReactCurrentBatchConfig;function Yi(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 Xi=ai(null),Ki=null,Qi=null,Ji=null;function Zi(){Ji=Qi=Ki=null}function eo(e){var t=Xi.current;si(Xi),e.type._context._currentValue=t}function to(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 no(e,t){Ki=e,Ji=Qi=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!=(e.lanes&t)&&(Aa=!0),e.firstContext=null)}function ro(e,t){if(Ji!==e&&!1!==t&&0!==t)if("number"==typeof t&&1073741823!==t||(Ji=e,t=1073741823),t={context:e,observedBits:t,next:null},null===Qi){if(null===Ki)throw Error(a(308));Qi=t,Ki.dependencies={lanes:0,firstContext:t,responders:null}}else Qi=Qi.next=t;return e._currentValue}var io=!1;function oo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null},effects:null}}function ao(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 so(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function lo(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 uo(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var i=null,o=null;if(null!==(n=n.firstBaseUpdate)){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===o?i=o=a:o=o.next=a,n=n.next}while(null!==n);null===o?i=o=t:o=o.next=t}else i=o=t;return n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function co(e,t,n,r){var o=e.updateQueue;io=!1;var a=o.firstBaseUpdate,s=o.lastBaseUpdate,l=o.shared.pending;if(null!==l){o.shared.pending=null;var u=l,c=u.next;u.next=null,null===s?a=c:s.next=c,s=u;var d=e.alternate;if(null!==d){var f=(d=d.updateQueue).lastBaseUpdate;f!==s&&(null===f?d.firstBaseUpdate=c:f.next=c,d.lastBaseUpdate=u)}}if(null!==a){for(f=o.baseState,s=0,d=c=u=null;;){l=a.lane;var p=a.eventTime;if((r&l)===l){null!==d&&(d=d.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var h=e,m=a;switch(l=t,p=n,m.tag){case 1:if("function"==typeof(h=m.payload)){f=h.call(p,f,l);break e}f=h;break e;case 3:h.flags=-4097&h.flags|64;case 0:if(null==(l="function"==typeof(h=m.payload)?h.call(p,f,l):h))break e;f=i({},f,l);break e;case 2:io=!0}}null!==a.callback&&(e.flags|=32,null===(l=o.effects)?o.effects=[a]:l.push(a))}else p={eventTime:p,lane:l,tag:a.tag,payload:a.payload,callback:a.callback,next:null},null===d?(c=d=p,u=f):d=d.next=p,s|=l;if(null===(a=a.next)){if(null===(l=o.shared.pending))break;a=l.next,l.next=null,o.lastBaseUpdate=l,o.shared.pending=null}}null===d&&(u=f),o.baseState=u,o.firstBaseUpdate=c,o.lastBaseUpdate=d,Fs|=s,e.lanes=s,e.memoizedState=f}}function fo(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(a(191,i));i.call(r)}}}var po=(new r.Component).refs;function ho(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 mo={isMounted:function(e){return!!(e=e._reactInternals)&&Ke(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=ul(),i=cl(e),o=so(r,i);o.payload=t,null!=n&&(o.callback=n),lo(e,o),dl(e,i,r)},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=ul(),i=cl(e),o=so(r,i);o.tag=1,o.payload=t,null!=n&&(o.callback=n),lo(e,o),dl(e,i,r)},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=ul(),r=cl(e),i=so(n,r);i.tag=2,null!=t&&(i.callback=t),lo(e,i),dl(e,r,n)}};function vo(e,t,n,r,i,o,a){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,o,a):!t.prototype||!t.prototype.isPureReactComponent||(!ur(n,r)||!ur(i,o))}function go(e,t,n){var r=!1,i=ui,o=t.contextType;return"object"==typeof o&&null!==o?o=ro(o):(i=hi(t)?fi:ci.current,o=(r=null!=(r=t.contextTypes))?pi(e,i):ui),t=new t(n,o),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=mo,e.stateNode=t,t._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=o),t}function yo(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&&mo.enqueueReplaceState(t,t.state,null)}function bo(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs=po,oo(e);var o=t.contextType;"object"==typeof o&&null!==o?i.context=ro(o):(o=hi(t)?fi:ci.current,i.context=pi(e,o)),co(e,n,i,r),i.state=e.memoizedState,"function"==typeof(o=t.getDerivedStateFromProps)&&(ho(e,t,o,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&&mo.enqueueReplaceState(i,i.state,null),co(e,n,i,r),i.state=e.memoizedState),"function"==typeof i.componentDidMount&&(e.flags|=4)}var wo=Array.isArray;function xo(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(a(309));var r=n.stateNode}if(!r)throw Error(a(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===po&&(t=r.refs={}),null===e?delete t[i]:t[i]=e})._stringRef=i,t)}if("string"!=typeof e)throw Error(a(284));if(!n._owner)throw Error(a(290,e))}return e}function ko(e,t){if("textarea"!==e.type)throw Error(a(31,"[object Object]"===Object.prototype.toString.call(t)?"object with keys {"+Object.keys(t).join(", ")+"}":t))}function So(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=Wl(e,t)).index=0,e.sibling=null,e}function o(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=Gl(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=xo(e,t,n),r.return=e,r):((r=$l(n.type,n.key,n.props,null,e.mode,r)).ref=xo(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=Yl(n,e.mode,r)).return=e,t):((t=i(t,n.children||[])).return=e,t)}function d(e,t,n,r,o){return null===t||7!==t.tag?((t=Vl(n,e.mode,r,o)).return=e,t):((t=i(t,n)).return=e,t)}function f(e,t,n){if("string"==typeof t||"number"==typeof t)return(t=Gl(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case k:return(n=$l(t.type,t.key,t.props,null,e.mode,n)).ref=xo(e,null,t),n.return=e,n;case S:return(t=Yl(t,e.mode,n)).return=e,t}if(wo(t)||B(t))return(t=Vl(t,e.mode,n,null)).return=e,t;ko(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===C?d(e,t,n.props.children,r,i):u(e,t,n,r):null;case S:return n.key===i?c(e,t,n,r):null}if(wo(n)||B(n))return null!==i?null:d(e,t,n,r,null);ko(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===C?d(t,e,r.props.children,i,r.key):u(t,e,r,i);case S:return c(t,e=e.get(null===r.key?n:r.key)||null,r,i)}if(wo(r)||B(r))return d(t,e=e.get(n)||null,r,i,null);ko(t,r)}return null}function m(i,a,s,l){for(var u=null,c=null,d=a,m=a=0,v=null;null!==d&&m<s.length;m++){d.index>m?(v=d,d=null):v=d.sibling;var g=p(i,d,s[m],l);if(null===g){null===d&&(d=v);break}e&&d&&null===g.alternate&&t(i,d),a=o(g,a,m),null===c?u=g:c.sibling=g,c=g,d=v}if(m===s.length)return n(i,d),u;if(null===d){for(;m<s.length;m++)null!==(d=f(i,s[m],l))&&(a=o(d,a,m),null===c?u=d:c.sibling=d,c=d);return u}for(d=r(i,d);m<s.length;m++)null!==(v=h(d,i,m,s[m],l))&&(e&&null!==v.alternate&&d.delete(null===v.key?m:v.key),a=o(v,a,m),null===c?u=v:c.sibling=v,c=v);return e&&d.forEach((function(e){return t(i,e)})),u}function v(i,s,l,u){var c=B(l);if("function"!=typeof c)throw Error(a(150));if(null==(l=c.call(l)))throw Error(a(151));for(var d=c=null,m=s,v=s=0,g=null,y=l.next();null!==m&&!y.done;v++,y=l.next()){m.index>v?(g=m,m=null):g=m.sibling;var b=p(i,m,y.value,u);if(null===b){null===m&&(m=g);break}e&&m&&null===b.alternate&&t(i,m),s=o(b,s,v),null===d?c=b:d.sibling=b,d=b,m=g}if(y.done)return n(i,m),c;if(null===m){for(;!y.done;v++,y=l.next())null!==(y=f(i,y.value,u))&&(s=o(y,s,v),null===d?c=y:d.sibling=y,d=y);return c}for(m=r(i,m);!y.done;v++,y=l.next())null!==(y=h(m,i,v,y.value,u))&&(e&&null!==y.alternate&&m.delete(null===y.key?v:y.key),s=o(y,s,v),null===d?c=y:d.sibling=y,d=y);return e&&m.forEach((function(e){return t(i,e)})),c}return function(e,r,o,l){var u="object"==typeof o&&null!==o&&o.type===C&&null===o.key;u&&(o=o.props.children);var c="object"==typeof o&&null!==o;if(c)switch(o.$$typeof){case k:e:{for(c=o.key,u=r;null!==u;){if(u.key===c){switch(u.tag){case 7:if(o.type===C){n(e,u.sibling),(r=i(u,o.props.children)).return=e,e=r;break e}break;default:if(u.elementType===o.type){n(e,u.sibling),(r=i(u,o.props)).ref=xo(e,u,o),r.return=e,e=r;break e}}n(e,u);break}t(e,u),u=u.sibling}o.type===C?((r=Vl(o.props.children,e.mode,l,o.key)).return=e,e=r):((l=$l(o.type,o.key,o.props,null,e.mode,l)).ref=xo(e,r,o),l.return=e,e=l)}return s(e);case S:e:{for(u=o.key;null!==r;){if(r.key===u){if(4===r.tag&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),(r=i(r,o.children||[])).return=e,e=r;break e}n(e,r);break}t(e,r),r=r.sibling}(r=Yl(o,e.mode,l)).return=e,e=r}return s(e)}if("string"==typeof o||"number"==typeof o)return o=""+o,null!==r&&6===r.tag?(n(e,r.sibling),(r=i(r,o)).return=e,e=r):(n(e,r),(r=Gl(o,e.mode,l)).return=e,e=r),s(e);if(wo(o))return m(e,r,o,l);if(B(o))return v(e,r,o,l);if(c&&ko(e,o),void 0===o&&!u)switch(e.tag){case 1:case 22:case 0:case 11:case 15:throw Error(a(152,G(e.type)||"Component"))}return n(e,r)}}var Co=So(!0),_o=So(!1),Eo={},To=ai(Eo),jo=ai(Eo),Oo=ai(Eo);function No(e){if(e===Eo)throw Error(a(174));return e}function Mo(e,t){switch(li(Oo,t),li(jo,e),li(To,Eo),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:he(null,"");break;default:t=he(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}si(To),li(To,t)}function Lo(){si(To),si(jo),si(Oo)}function Po(e){No(Oo.current);var t=No(To.current),n=he(t,e.type);t!==n&&(li(jo,e),li(To,n))}function Ao(e){jo.current===e&&(si(To),si(jo))}var Do=ai(0);function Ro(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(0!=(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 Io=null,Fo=null,zo=!1;function Ho(e,t){var n=Ul(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 Uo(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);case 13:default:return!1}}function Bo(e){if(zo){var t=Fo;if(t){var n=t;if(!Uo(e,t)){if(!(t=Vr(n.nextSibling))||!Uo(e,t))return e.flags=-1025&e.flags|2,zo=!1,void(Io=e);Ho(Io,n)}Io=e,Fo=Vr(t.firstChild)}else e.flags=-1025&e.flags|2,zo=!1,Io=e}}function Wo(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;Io=e}function $o(e){if(e!==Io)return!1;if(!zo)return Wo(e),zo=!0,!1;var t=e.type;if(5!==e.tag||"head"!==t&&"body"!==t&&!Ur(t,e.memoizedProps))for(t=Fo;t;)Ho(e,t),t=Vr(t.nextSibling);if(Wo(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(a(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n){if(0===t){Fo=Vr(e.nextSibling);break e}t--}else"$"!==n&&"$!"!==n&&"$?"!==n||t++}e=e.nextSibling}Fo=null}}else Fo=Io?Vr(e.stateNode.nextSibling):null;return!0}function Vo(){Fo=Io=null,zo=!1}var qo=[];function Go(){for(var e=0;e<qo.length;e++)qo[e]._workInProgressVersionPrimary=null;qo.length=0}var Yo=x.ReactCurrentDispatcher,Xo=x.ReactCurrentBatchConfig,Ko=0,Qo=null,Jo=null,Zo=null,ea=!1,ta=!1;function na(){throw Error(a(321))}function ra(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!sr(e[n],t[n]))return!1;return!0}function ia(e,t,n,r,i,o){if(Ko=o,Qo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Yo.current=null===e||null===e.memoizedState?Na:Ma,e=n(r,i),ta){o=0;do{if(ta=!1,!(25>o))throw Error(a(301));o+=1,Zo=Jo=null,t.updateQueue=null,Yo.current=La,e=n(r,i)}while(ta)}if(Yo.current=Oa,t=null!==Jo&&null!==Jo.next,Ko=0,Zo=Jo=Qo=null,ea=!1,t)throw Error(a(300));return e}function oa(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===Zo?Qo.memoizedState=Zo=e:Zo=Zo.next=e,Zo}function aa(){if(null===Jo){var e=Qo.alternate;e=null!==e?e.memoizedState:null}else e=Jo.next;var t=null===Zo?Qo.memoizedState:Zo.next;if(null!==t)Zo=t,Jo=e;else{if(null===e)throw Error(a(310));e={memoizedState:(Jo=e).memoizedState,baseState:Jo.baseState,baseQueue:Jo.baseQueue,queue:Jo.queue,next:null},null===Zo?Qo.memoizedState=Zo=e:Zo=Zo.next=e}return Zo}function sa(e,t){return"function"==typeof t?t(e):t}function la(e){var t=aa(),n=t.queue;if(null===n)throw Error(a(311));n.lastRenderedReducer=e;var r=Jo,i=r.baseQueue,o=n.pending;if(null!==o){if(null!==i){var s=i.next;i.next=o.next,o.next=s}r.baseQueue=i=o,n.pending=null}if(null!==i){i=i.next,r=r.baseState;var l=s=o=null,u=i;do{var c=u.lane;if((Ko&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 d={lane:c,action:u.action,eagerReducer:u.eagerReducer,eagerState:u.eagerState,next:null};null===l?(s=l=d,o=r):l=l.next=d,Qo.lanes|=c,Fs|=c}u=u.next}while(null!==u&&u!==i);null===l?o=r:l.next=s,sr(r,t.memoizedState)||(Aa=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=l,n.lastRenderedState=r}return[t.memoizedState,n.dispatch]}function ua(e){var t=aa(),n=t.queue;if(null===n)throw Error(a(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(null!==i){n.pending=null;var s=i=i.next;do{o=e(o,s.action),s=s.next}while(s!==i);sr(o,t.memoizedState)||(Aa=!0),t.memoizedState=o,null===t.baseQueue&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function ca(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=(Ko&e)===e)&&(t._workInProgressVersionPrimary=r,qo.push(t))),e)return n(t._source);throw qo.push(t),Error(a(350))}function da(e,t,n,r){var i=Ns;if(null===i)throw Error(a(349));var o=t._getVersion,s=o(t._source),l=Yo.current,u=l.useState((function(){return ca(i,t,n)})),c=u[1],d=u[0];u=Zo;var f=e.memoizedState,p=f.refs,h=p.getSnapshot,m=f.source;f=f.subscribe;var v=Qo;return e.memoizedState={refs:p,source:t,subscribe:r},l.useEffect((function(){p.getSnapshot=n,p.setSnapshot=c;var e=o(t._source);if(!sr(s,e)){e=n(t._source),sr(d,e)||(c(e),e=cl(v),i.mutableReadLanes|=e&i.pendingLanes),e=i.mutableReadLanes,i.entangledLanes|=e;for(var r=i.entanglements,a=e;0<a;){var l=31-$t(a),u=1<<l;r[l]|=e,a&=~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=cl(v);i.mutableReadLanes|=r&i.pendingLanes}catch(e){n((function(){throw e}))}}))}),[t,r]),sr(h,n)&&sr(m,t)&&sr(f,r)||((e={pending:null,dispatch:null,lastRenderedReducer:sa,lastRenderedState:d}).dispatch=c=ja.bind(null,Qo,e),u.queue=e,u.baseQueue=null,d=ca(i,t,n),u.memoizedState=u.baseState=d),d}function fa(e,t,n){return da(aa(),e,t,n)}function pa(e){var t=oa();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={pending:null,dispatch:null,lastRenderedReducer:sa,lastRenderedState:e}).dispatch=ja.bind(null,Qo,e),[t.memoizedState,e]}function ha(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=Qo.updateQueue)?(t={lastEffect:null},Qo.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 ma(e){return e={current:e},oa().memoizedState=e}function va(){return aa().memoizedState}function ga(e,t,n,r){var i=oa();Qo.flags|=e,i.memoizedState=ha(1|t,n,void 0,void 0===r?null:r)}function ya(e,t,n,r){var i=aa();r=void 0===r?null:r;var o=void 0;if(null!==Jo){var a=Jo.memoizedState;if(o=a.destroy,null!==r&&ra(r,a.deps))return void ha(t,n,o,r)}Qo.flags|=e,i.memoizedState=ha(1|t,n,o,r)}function ba(e,t){return ga(516,4,e,t)}function wa(e,t){return ya(516,4,e,t)}function xa(e,t){return ya(4,2,e,t)}function ka(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 Sa(e,t,n){return n=null!=n?n.concat([e]):null,ya(4,2,ka.bind(null,t,e),n)}function Ca(){}function _a(e,t){var n=aa();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&ra(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ea(e,t){var n=aa();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&ra(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Ta(e,t){var n=Ui();Wi(98>n?98:n,(function(){e(!0)})),Wi(97<n?97:n,(function(){var n=Xo.transition;Xo.transition=1;try{e(!1),t()}finally{Xo.transition=n}}))}function ja(e,t,n){var r=ul(),i=cl(e),o={lane:i,action:n,eagerReducer:null,eagerState:null,next:null},a=t.pending;if(null===a?o.next=o:(o.next=a.next,a.next=o),t.pending=o,a=e.alternate,e===Qo||null!==a&&a===Qo)ta=ea=!0;else{if(0===e.lanes&&(null===a||0===a.lanes)&&null!==(a=t.lastRenderedReducer))try{var s=t.lastRenderedState,l=a(s,n);if(o.eagerReducer=a,o.eagerState=l,sr(l,s))return}catch(e){}dl(e,i,r)}}var Oa={readContext:ro,useCallback:na,useContext:na,useEffect:na,useImperativeHandle:na,useLayoutEffect:na,useMemo:na,useReducer:na,useRef:na,useState:na,useDebugValue:na,useDeferredValue:na,useTransition:na,useMutableSource:na,useOpaqueIdentifier:na,unstable_isNewReconciler:!1},Na={readContext:ro,useCallback:function(e,t){return oa().memoizedState=[e,void 0===t?null:t],e},useContext:ro,useEffect:ba,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,ga(4,2,ka.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ga(4,2,e,t)},useMemo:function(e,t){var n=oa();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=oa();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=ja.bind(null,Qo,e),[r.memoizedState,e]},useRef:ma,useState:pa,useDebugValue:Ca,useDeferredValue:function(e){var t=pa(e),n=t[0],r=t[1];return ba((function(){var t=Xo.transition;Xo.transition=1;try{r(e)}finally{Xo.transition=t}}),[e]),n},useTransition:function(){var e=pa(!1),t=e[0];return ma(e=Ta.bind(null,e[1])),[e,t]},useMutableSource:function(e,t,n){var r=oa();return r.memoizedState={refs:{getSnapshot:t,setSnapshot:null},source:e,subscribe:n},da(r,e,t,n)},useOpaqueIdentifier:function(){if(zo){var e=!1,t=function(e){return{$$typeof:D,toString:e,valueOf:e}}((function(){throw e||(e=!0,n("r:"+(Gr++).toString(36))),Error(a(355))})),n=pa(t)[1];return 0==(2&Qo.mode)&&(Qo.flags|=516,ha(5,(function(){n("r:"+(Gr++).toString(36))}),void 0,null)),t}return pa(t="r:"+(Gr++).toString(36)),t},unstable_isNewReconciler:!1},Ma={readContext:ro,useCallback:_a,useContext:ro,useEffect:wa,useImperativeHandle:Sa,useLayoutEffect:xa,useMemo:Ea,useReducer:la,useRef:va,useState:function(){return la(sa)},useDebugValue:Ca,useDeferredValue:function(e){var t=la(sa),n=t[0],r=t[1];return wa((function(){var t=Xo.transition;Xo.transition=1;try{r(e)}finally{Xo.transition=t}}),[e]),n},useTransition:function(){var e=la(sa)[0];return[va().current,e]},useMutableSource:fa,useOpaqueIdentifier:function(){return la(sa)[0]},unstable_isNewReconciler:!1},La={readContext:ro,useCallback:_a,useContext:ro,useEffect:wa,useImperativeHandle:Sa,useLayoutEffect:xa,useMemo:Ea,useReducer:ua,useRef:va,useState:function(){return ua(sa)},useDebugValue:Ca,useDeferredValue:function(e){var t=ua(sa),n=t[0],r=t[1];return wa((function(){var t=Xo.transition;Xo.transition=1;try{r(e)}finally{Xo.transition=t}}),[e]),n},useTransition:function(){var e=ua(sa)[0];return[va().current,e]},useMutableSource:fa,useOpaqueIdentifier:function(){return ua(sa)[0]},unstable_isNewReconciler:!1},Pa=x.ReactCurrentOwner,Aa=!1;function Da(e,t,n,r){t.child=null===e?_o(t,null,n,r):Co(t,e.child,n,r)}function Ra(e,t,n,r,i){n=n.render;var o=t.ref;return no(t,i),r=ia(e,t,n,r,o,i),null===e||Aa?(t.flags|=1,Da(e,t,r,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-517,e.lanes&=~i,ns(e,t,i))}function Ia(e,t,n,r,i,o){if(null===e){var a=n.type;return"function"!=typeof a||Bl(a)||void 0!==a.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=$l(n.type,null,r,t,t.mode,o)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=a,Fa(e,t,a,r,i,o))}return a=e.child,0==(i&o)&&(i=a.memoizedProps,(n=null!==(n=n.compare)?n:ur)(i,r)&&e.ref===t.ref)?ns(e,t,o):(t.flags|=1,(e=Wl(a,r)).ref=t.ref,e.return=t,t.child=e)}function Fa(e,t,n,r,i,o){if(null!==e&&ur(e.memoizedProps,r)&&e.ref===t.ref){if(Aa=!1,0==(o&i))return t.lanes=e.lanes,ns(e,t,o);0!=(16384&e.flags)&&(Aa=!0)}return Ua(e,t,n,r,o)}function za(e,t,n){var r=t.pendingProps,i=r.children,o=null!==e?e.memoizedState:null;if("hidden"===r.mode||"unstable-defer-without-hiding"===r.mode)if(0==(4&t.mode))t.memoizedState={baseLanes:0},bl(t,n);else{if(0==(1073741824&n))return e=null!==o?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e},bl(t,e),null;t.memoizedState={baseLanes:0},bl(t,null!==o?o.baseLanes:n)}else null!==o?(r=o.baseLanes|n,t.memoizedState=null):r=n,bl(t,r);return Da(e,t,i,n),t.child}function Ha(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=128)}function Ua(e,t,n,r,i){var o=hi(n)?fi:ci.current;return o=pi(t,o),no(t,i),n=ia(e,t,n,r,o,i),null===e||Aa?(t.flags|=1,Da(e,t,n,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-517,e.lanes&=~i,ns(e,t,i))}function Ba(e,t,n,r,i){if(hi(n)){var o=!0;yi(t)}else o=!1;if(no(t,i),null===t.stateNode)null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),go(t,n,r),bo(t,n,r,i),r=!0;else if(null===e){var a=t.stateNode,s=t.memoizedProps;a.props=s;var l=a.context,u=n.contextType;"object"==typeof u&&null!==u?u=ro(u):u=pi(t,u=hi(n)?fi:ci.current);var c=n.getDerivedStateFromProps,d="function"==typeof c||"function"==typeof a.getSnapshotBeforeUpdate;d||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(s!==r||l!==u)&&yo(t,a,r,u),io=!1;var f=t.memoizedState;a.state=f,co(t,r,a,i),l=t.memoizedState,s!==r||f!==l||di.current||io?("function"==typeof c&&(ho(t,n,c,r),l=t.memoizedState),(s=io||vo(t,n,s,r,f,l,u))?(d||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||("function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"==typeof a.componentDidMount&&(t.flags|=4)):("function"==typeof a.componentDidMount&&(t.flags|=4),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=u,r=s):("function"==typeof a.componentDidMount&&(t.flags|=4),r=!1)}else{a=t.stateNode,ao(e,t),s=t.memoizedProps,u=t.type===t.elementType?s:Yi(t.type,s),a.props=u,d=t.pendingProps,f=a.context,"object"==typeof(l=n.contextType)&&null!==l?l=ro(l):l=pi(t,l=hi(n)?fi:ci.current);var p=n.getDerivedStateFromProps;(c="function"==typeof p||"function"==typeof a.getSnapshotBeforeUpdate)||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(s!==d||f!==l)&&yo(t,a,r,l),io=!1,f=t.memoizedState,a.state=f,co(t,r,a,i);var h=t.memoizedState;s!==d||f!==h||di.current||io?("function"==typeof p&&(ho(t,n,p,r),h=t.memoizedState),(u=io||vo(t,n,u,r,f,h,l))?(c||"function"!=typeof a.UNSAFE_componentWillUpdate&&"function"!=typeof a.componentWillUpdate||("function"==typeof a.componentWillUpdate&&a.componentWillUpdate(r,h,l),"function"==typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(r,h,l)),"function"==typeof a.componentDidUpdate&&(t.flags|=4),"function"==typeof a.getSnapshotBeforeUpdate&&(t.flags|=256)):("function"!=typeof a.componentDidUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=256),t.memoizedProps=r,t.memoizedState=h),a.props=r,a.state=h,a.context=l,r=u):("function"!=typeof a.componentDidUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=256),r=!1)}return Wa(e,t,n,r,o,i)}function Wa(e,t,n,r,i,o){Ha(e,t);var a=0!=(64&t.flags);if(!r&&!a)return i&&bi(t,n,!1),ns(e,t,o);r=t.stateNode,Pa.current=t;var s=a&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&a?(t.child=Co(t,e.child,null,o),t.child=Co(t,null,s,o)):Da(e,t,s,o),t.memoizedState=r.state,i&&bi(t,n,!0),t.child}function $a(e){var t=e.stateNode;t.pendingContext?vi(0,t.pendingContext,t.pendingContext!==t.context):t.context&&vi(0,t.context,!1),Mo(e,t.containerInfo)}var Va,qa,Ga,Ya={dehydrated:null,retryLane:0};function Xa(e,t,n){var r,i=t.pendingProps,o=Do.current,a=!1;return(r=0!=(64&t.flags))||(r=(null===e||null!==e.memoizedState)&&0!=(2&o)),r?(a=!0,t.flags&=-65):null!==e&&null===e.memoizedState||void 0===i.fallback||!0===i.unstable_avoidThisFallback||(o|=1),li(Do,1&o),null===e?(void 0!==i.fallback&&Bo(t),e=i.children,o=i.fallback,a?(e=Ka(t,e,o,n),t.child.memoizedState={baseLanes:n},t.memoizedState=Ya,e):"number"==typeof i.unstable_expectedLoadTime?(e=Ka(t,e,o,n),t.child.memoizedState={baseLanes:n},t.memoizedState=Ya,t.lanes=33554432,e):((n=ql({mode:"visible",children:e},t.mode,n,null)).return=t,t.child=n)):(e.memoizedState,a?(i=Ja(e,t,i.children,i.fallback,n),a=t.child,o=e.child.memoizedState,a.memoizedState=null===o?{baseLanes:n}:{baseLanes:o.baseLanes|n},a.childLanes=e.childLanes&~n,t.memoizedState=Ya,i):(n=Qa(e,t,i.children,n),t.memoizedState=null,n))}function Ka(e,t,n,r){var i=e.mode,o=e.child;return t={mode:"hidden",children:t},0==(2&i)&&null!==o?(o.childLanes=0,o.pendingProps=t):o=ql(t,i,0,null),n=Vl(n,i,r,null),o.return=e,n.return=e,o.sibling=n,e.child=o,n}function Qa(e,t,n,r){var i=e.child;return e=i.sibling,n=Wl(i,{mode:"visible",children:n}),0==(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 Ja(e,t,n,r,i){var o=t.mode,a=e.child;e=a.sibling;var s={mode:"hidden",children:n};return 0==(2&o)&&t.child!==a?((n=t.child).childLanes=0,n.pendingProps=s,null!==(a=n.lastEffect)?(t.firstEffect=n.firstEffect,t.lastEffect=a,a.nextEffect=null):t.firstEffect=t.lastEffect=null):n=Wl(a,s),null!==e?r=Wl(e,r):(r=Vl(r,o,i,null)).flags|=2,r.return=t,n.return=t,n.sibling=r,t.child=n,r}function Za(e,t){e.lanes|=t;var n=e.alternate;null!==n&&(n.lanes|=t),to(e.return,t)}function es(e,t,n,r,i,o){var a=e.memoizedState;null===a?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,lastEffect:o}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i,a.lastEffect=o)}function ts(e,t,n){var r=t.pendingProps,i=r.revealOrder,o=r.tail;if(Da(e,t,r.children,n),0!=(2&(r=Do.current)))r=1&r|2,t.flags|=64;else{if(null!==e&&0!=(64&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Za(e,n);else if(19===e.tag)Za(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(li(Do,r),0==(2&t.mode))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;null!==n;)null!==(e=n.alternate)&&null===Ro(e)&&(i=n),n=n.sibling;null===(n=i)?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),es(t,!1,i,n,o,t.lastEffect);break;case"backwards":for(n=null,i=t.child,t.child=null;null!==i;){if(null!==(e=i.alternate)&&null===Ro(e)){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}es(t,!0,n,null,o,t.lastEffect);break;case"together":es(t,!1,null,null,void 0,t.lastEffect);break;default:t.memoizedState=null}return t.child}function ns(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),Fs|=t.lanes,0!=(n&t.childLanes)){if(null!==e&&t.child!==e.child)throw Error(a(153));if(null!==t.child){for(n=Wl(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=Wl(e,e.pendingProps)).return=t;n.sibling=null}return t.child}return null}function rs(e,t){if(!zo)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 is(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:return hi(t.type)&&mi(),null;case 3:return Lo(),si(di),si(ci),Go(),(r=t.stateNode).pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==e&&null!==e.child||($o(t)?t.flags|=4:r.hydrate||(t.flags|=256)),null;case 5:Ao(t);var o=No(Oo.current);if(n=t.type,null!==e&&null!=t.stateNode)qa(e,t,n,r),e.ref!==t.ref&&(t.flags|=128);else{if(!r){if(null===t.stateNode)throw Error(a(166));return null}if(e=No(To.current),$o(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[Xr]=t,r[Kr]=s,n){case"dialog":Tr("cancel",r),Tr("close",r);break;case"iframe":case"object":case"embed":Tr("load",r);break;case"video":case"audio":for(e=0;e<Sr.length;e++)Tr(Sr[e],r);break;case"source":Tr("error",r);break;case"img":case"image":case"link":Tr("error",r),Tr("load",r);break;case"details":Tr("toggle",r);break;case"input":ee(r,s),Tr("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},Tr("invalid",r);break;case"textarea":le(r,s),Tr("invalid",r)}for(var u in Ce(n,s),e=null,s)s.hasOwnProperty(u)&&(o=s[u],"children"===u?"string"==typeof o?r.textContent!==o&&(e=["children",o]):"number"==typeof o&&r.textContent!==""+o&&(e=["children",""+o]):l.hasOwnProperty(u)&&null!=o&&"onScroll"===u&&Tr("scroll",r));switch(n){case"input":K(r),re(r,s,!0);break;case"textarea":K(r),ce(r);break;case"select":case"option":break;default:"function"==typeof s.onClick&&(r.onclick=Ir)}r=e,t.updateQueue=r,null!==r&&(t.flags|=4)}else{switch(u=9===o.nodeType?o:o.ownerDocument,e===de&&(e=pe(n)),e===de?"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[Xr]=t,e[Kr]=r,Va(e,t),t.stateNode=e,u=_e(n,r),n){case"dialog":Tr("cancel",e),Tr("close",e),o=r;break;case"iframe":case"object":case"embed":Tr("load",e),o=r;break;case"video":case"audio":for(o=0;o<Sr.length;o++)Tr(Sr[o],e);o=r;break;case"source":Tr("error",e),o=r;break;case"img":case"image":case"link":Tr("error",e),Tr("load",e),o=r;break;case"details":Tr("toggle",e),o=r;break;case"input":ee(e,r),o=Z(e,r),Tr("invalid",e);break;case"option":o=oe(e,r);break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=i({},r,{value:void 0}),Tr("invalid",e);break;case"textarea":le(e,r),o=se(e,r),Tr("invalid",e);break;default:o=r}Ce(n,o);var c=o;for(s in c)if(c.hasOwnProperty(s)){var d=c[s];"style"===s?ke(e,d):"dangerouslySetInnerHTML"===s?null!=(d=d?d.__html:void 0)&&ge(e,d):"children"===s?"string"==typeof d?("textarea"!==n||""!==d)&&ye(e,d):"number"==typeof d&&ye(e,""+d):"suppressContentEditableWarning"!==s&&"suppressHydrationWarning"!==s&&"autoFocus"!==s&&(l.hasOwnProperty(s)?null!=d&&"onScroll"===s&&Tr("scroll",e):null!=d&&w(e,s,d,u))}switch(n){case"input":K(e),re(e,r,!1);break;case"textarea":K(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)?ae(e,!!r.multiple,s,!1):null!=r.defaultValue&&ae(e,!!r.multiple,r.defaultValue,!0);break;default:"function"==typeof o.onClick&&(e.onclick=Ir)}Hr(n,r)&&(t.flags|=4)}null!==t.ref&&(t.flags|=128)}return null;case 6:if(e&&null!=t.stateNode)Ga(0,t,e.memoizedProps,r);else{if("string"!=typeof r&&null===t.stateNode)throw Error(a(166));n=No(Oo.current),No(To.current),$o(t)?(r=t.stateNode,n=t.memoizedProps,r[Xr]=t,r.nodeValue!==n&&(t.flags|=4)):((r=(9===n.nodeType?n:n.ownerDocument).createTextNode(r))[Xr]=t,t.stateNode=r)}return null;case 13:return si(Do),r=t.memoizedState,0!=(64&t.flags)?(t.lanes=n,t):(r=null!==r,n=!1,null===e?void 0!==t.memoizedProps.fallback&&$o(t):n=null!==e.memoizedState,r&&!n&&0!=(2&t.mode)&&(null===e&&!0!==t.memoizedProps.unstable_avoidThisFallback||0!=(1&Do.current)?0===Ds&&(Ds=3):(0!==Ds&&3!==Ds||(Ds=4),null===Ns||0==(134217727&Fs)&&0==(134217727&zs)||ml(Ns,Ls))),(r||n)&&(t.flags|=4),null);case 4:return Lo(),null===e&&Or(t.stateNode.containerInfo),null;case 10:return eo(t),null;case 17:return hi(t.type)&&mi(),null;case 19:if(si(Do),null===(r=t.memoizedState))return null;if(s=0!=(64&t.flags),null===(u=r.rendering))if(s)rs(r,!1);else{if(0!==Ds||null!==e&&0!=(64&e.flags))for(e=t.child;null!==e;){if(null!==(u=Ro(e))){for(t.flags|=64,rs(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 li(Do,1&Do.current|2),t.child}e=e.sibling}null!==r.tail&&Hi()>Ws&&(t.flags|=64,s=!0,rs(r,!1),t.lanes=33554432)}else{if(!s)if(null!==(e=Ro(u))){if(t.flags|=64,s=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.flags|=4),rs(r,!0),null===r.tail&&"hidden"===r.tailMode&&!u.alternate&&!zo)return null!==(t=t.lastEffect=r.lastEffect)&&(t.nextEffect=null),null}else 2*Hi()-r.renderingStartTime>Ws&&1073741824!==n&&(t.flags|=64,s=!0,rs(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=Hi(),n.sibling=null,t=Do.current,li(Do,s?1&t|2:1&t),n):null;case 23:case 24:return wl(),null!==e&&null!==e.memoizedState!=(null!==t.memoizedState)&&"unstable-defer-without-hiding"!==r.mode&&(t.flags|=4),null}throw Error(a(156,t.tag))}function os(e){switch(e.tag){case 1:hi(e.type)&&mi();var t=e.flags;return 4096&t?(e.flags=-4097&t|64,e):null;case 3:if(Lo(),si(di),si(ci),Go(),0!=(64&(t=e.flags)))throw Error(a(285));return e.flags=-4097&t|64,e;case 5:return Ao(e),null;case 13:return si(Do),4096&(t=e.flags)?(e.flags=-4097&t|64,e):null;case 19:return si(Do),null;case 4:return Lo(),null;case 10:return eo(e),null;case 23:case 24:return wl(),null;default:return null}}function as(e,t){try{var n="",r=t;do{n+=q(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 ss(e,t){try{console.error(t.value)}catch(e){setTimeout((function(){throw e}))}}Va=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}},qa=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,No(To.current);var a,s=null;switch(n){case"input":o=Z(e,o),r=Z(e,r),s=[];break;case"option":o=oe(e,o),r=oe(e,r),s=[];break;case"select":o=i({},o,{value:void 0}),r=i({},r,{value:void 0}),s=[];break;case"textarea":o=se(e,o),r=se(e,r),s=[];break;default:"function"!=typeof o.onClick&&"function"==typeof r.onClick&&(e.onclick=Ir)}for(d in Ce(n,r),n=null,o)if(!r.hasOwnProperty(d)&&o.hasOwnProperty(d)&&null!=o[d])if("style"===d){var u=o[d];for(a in u)u.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else"dangerouslySetInnerHTML"!==d&&"children"!==d&&"suppressContentEditableWarning"!==d&&"suppressHydrationWarning"!==d&&"autoFocus"!==d&&(l.hasOwnProperty(d)?s||(s=[]):(s=s||[]).push(d,null));for(d in r){var c=r[d];if(u=null!=o?o[d]:void 0,r.hasOwnProperty(d)&&c!==u&&(null!=c||null!=u))if("style"===d)if(u){for(a in u)!u.hasOwnProperty(a)||c&&c.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in c)c.hasOwnProperty(a)&&u[a]!==c[a]&&(n||(n={}),n[a]=c[a])}else n||(s||(s=[]),s.push(d,n)),n=c;else"dangerouslySetInnerHTML"===d?(c=c?c.__html:void 0,u=u?u.__html:void 0,null!=c&&u!==c&&(s=s||[]).push(d,c)):"children"===d?"string"!=typeof c&&"number"!=typeof c||(s=s||[]).push(d,""+c):"suppressContentEditableWarning"!==d&&"suppressHydrationWarning"!==d&&(l.hasOwnProperty(d)?(null!=c&&"onScroll"===d&&Tr("scroll",e),s||u===c||(s=[])):"object"==typeof c&&null!==c&&c.$$typeof===D?c.toString():(s=s||[]).push(d,c))}n&&(s=s||[]).push("style",n);var d=s;(t.updateQueue=d)&&(t.flags|=4)}},Ga=function(e,t,n,r){n!==r&&(t.flags|=4)};var ls="function"==typeof WeakMap?WeakMap:Map;function us(e,t,n){(n=so(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Gs||(Gs=!0,Ys=r),ss(0,t)},n}function cs(e,t,n){(n=so(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var i=t.value;n.payload=function(){return ss(0,t),r(i)}}var o=e.stateNode;return null!==o&&"function"==typeof o.componentDidCatch&&(n.callback=function(){"function"!=typeof r&&(null===Xs?Xs=new Set([this]):Xs.add(this),ss(0,t));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}var ds="function"==typeof WeakSet?WeakSet:Set;function fs(e){var t=e.ref;if(null!==t)if("function"==typeof t)try{t(null)}catch(t){Il(e,t)}else t.current=null}function ps(e,t){switch(t.tag){case 0:case 11:case 15:case 22: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:Yi(t.type,n),r),e.__reactInternalSnapshotBeforeUpdate=t}return;case 3:return void(256&t.flags&&$r(t.stateNode.containerInfo));case 5:case 6:case 4:case 17:return}throw Error(a(163))}function hs(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==(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,0!=(4&(i=i.tag))&&0!=(1&i)&&(Al(n,e),Pl(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:Yi(n.type,t.memoizedProps),e.componentDidUpdate(r,t.memoizedState,e.__reactInternalSnapshotBeforeUpdate))),void(null!==(t=n.updateQueue)&&fo(n,t,e));case 3:if(null!==(t=n.updateQueue)){if(e=null,null!==n.child)switch(n.child.tag){case 5:e=n.child.stateNode;break;case 1:e=n.child.stateNode}fo(n,t,e)}return;case 5:return e=n.stateNode,void(null===t&&4&n.flags&&Hr(n.type,n.memoizedProps)&&e.focus());case 6:case 4:case 12:return;case 13:return void(null===n.memoizedState&&(n=n.alternate,null!==n&&(n=n.memoizedState,null!==n&&(n=n.dehydrated,null!==n&&kt(n)))));case 19:case 17:case 20:case 21:case 23:case 24:return}throw Error(a(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=xe("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 vs(e,t){if(xi&&"function"==typeof xi.onCommitFiberUnmount)try{xi.onCommitFiberUnmount(wi,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(0!=(4&r))Al(t,n);else{r=t;try{i()}catch(e){Il(r,e)}}n=n.next}while(n!==e)}break;case 1:if(fs(t),"function"==typeof(e=t.stateNode).componentWillUnmount)try{e.props=t.memoizedProps,e.state=t.memoizedState,e.componentWillUnmount()}catch(e){Il(t,e)}break;case 5:fs(t);break;case 4:ks(e,t)}}function gs(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 ys(e){return 5===e.tag||3===e.tag||4===e.tag}function bs(e){e:{for(var t=e.return;null!==t;){if(ys(t))break e;t=t.return}throw Error(a(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(a(161))}16&n.flags&&(ye(t,""),n.flags&=-17);e:t:for(n=e;;){for(;null===n.sibling;){if(null===n.return||ys(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?ws(e,n,t):xs(e,n,t)}function ws(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=Ir));else if(4!==r&&null!==(e=e.child))for(ws(e,t,n),e=e.sibling;null!==e;)ws(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 ks(e,t){for(var n,r,i=t,o=!1;;){if(!o){o=i.return;e:for(;;){if(null===o)throw Error(a(160));switch(n=o.stateNode,o.tag){case 5:r=!1;break e;case 3:case 4:n=n.containerInfo,r=!0;break e}o=o.return}o=!0}if(5===i.tag||6===i.tag){e:for(var s=e,l=i,u=l;;)if(vs(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(vs(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&&(o=!1)}i.sibling.return=i.return,i=i.sibling}}function Ss(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==(3&r.tag)&&(e=r.destroy,r.destroy=void 0,void 0!==e&&e()),r=r.next}while(r!==n)}return;case 1:return;case 5:if(null!=(n=t.stateNode)){r=t.memoizedProps;var i=null!==e?e.memoizedProps:r;e=t.type;var o=t.updateQueue;if(t.updateQueue=null,null!==o){for(n[Kr]=r,"input"===e&&"radio"===r.type&&null!=r.name&&te(n,r),_e(e,i),t=_e(e,r),i=0;i<o.length;i+=2){var s=o[i],l=o[i+1];"style"===s?ke(n,l):"dangerouslySetInnerHTML"===s?ge(n,l):"children"===s?ye(n,l):w(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!=(o=r.value)?ae(n,!!r.multiple,o,!1):e!==!!r.multiple&&(null!=r.defaultValue?ae(n,!!r.multiple,r.defaultValue,!0):ae(n,!!r.multiple,r.multiple?[]:"",!1))}}}return;case 6:if(null===t.stateNode)throw Error(a(162));return void(t.stateNode.nodeValue=t.memoizedProps);case 3:return void((n=t.stateNode).hydrate&&(n.hydrate=!1,kt(n.containerInfo)));case 12:return;case 13:return null!==t.memoizedState&&(Bs=Hi(),ms(t.child,!0)),void Cs(t);case 19:return void Cs(t);case 17:return;case 23:case 24:return void ms(t,null!==t.memoizedState)}throw Error(a(163))}function Cs(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new ds),t.forEach((function(t){var r=zl.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}}function _s(e,t){return null!==e&&(null===(e=e.memoizedState)||null!==e.dehydrated)&&(null!==(t=t.memoizedState)&&null===t.dehydrated)}var Es=Math.ceil,Ts=x.ReactCurrentDispatcher,js=x.ReactCurrentOwner,Os=0,Ns=null,Ms=null,Ls=0,Ps=0,As=ai(0),Ds=0,Rs=null,Is=0,Fs=0,zs=0,Hs=0,Us=null,Bs=0,Ws=1/0;function $s(){Ws=Hi()+500}var Vs,qs=null,Gs=!1,Ys=null,Xs=null,Ks=!1,Qs=null,Js=90,Zs=[],el=[],tl=null,nl=0,rl=null,il=-1,ol=0,al=0,sl=null,ll=!1;function ul(){return 0!=(48&Os)?Hi():-1!==il?il:il=Hi()}function cl(e){if(0==(2&(e=e.mode)))return 1;if(0==(4&e))return 99===Ui()?1:2;if(0===ol&&(ol=Is),0!==Gi.transition){0!==al&&(al=null!==Us?Us.pendingLanes:0),e=ol;var t=4186112&~al;return 0===(t&=-t)&&(0===(t=(e=4186112&~e)&-e)&&(t=8192)),t}return e=Ui(),0!=(4&Os)&&98===e?e=Ht(12,ol):e=Ht(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),ol),e}function dl(e,t,n){if(50<nl)throw nl=0,rl=null,Error(a(185));if(null===(e=fl(e,t)))return null;Wt(e,t,n),e===Ns&&(zs|=t,4===Ds&&ml(e,Ls));var r=Ui();1===t?0!=(8&Os)&&0==(48&Os)?vl(e):(pl(e,n),0===Os&&($s(),Vi())):(0==(4&Os)||98!==r&&99!==r||(null===tl?tl=new Set([e]):tl.add(e)),pl(e,n)),Us=e}function fl(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 pl(e,t){for(var n=e.callbackNode,r=e.suspendedLanes,i=e.pingedLanes,o=e.expirationTimes,s=e.pendingLanes;0<s;){var l=31-$t(s),u=1<<l,c=o[l];if(-1===c){if(0==(u&r)||0!=(u&i)){c=t,It(u);var d=Rt;o[l]=10<=d?c+250:6<=d?c+5e3:-1}}else c<=t&&(e.expiredLanes|=u);s&=~u}if(r=Ft(e,e===Ns?Ls:0),t=Rt,0===r)null!==n&&(n!==Ai&&Ci(n),e.callbackNode=null,e.callbackPriority=0);else{if(null!==n){if(e.callbackPriority===t)return;n!==Ai&&Ci(n)}15===t?(n=vl.bind(null,e),null===Ri?(Ri=[n],Ii=Si(Oi,qi)):Ri.push(n),n=Ai):14===t?n=$i(99,vl.bind(null,e)):n=$i(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(a(358,e))}}(t),hl.bind(null,e)),e.callbackPriority=t,e.callbackNode=n}}function hl(e){if(il=-1,al=ol=0,0!=(48&Os))throw Error(a(327));var t=e.callbackNode;if(Ll()&&e.callbackNode!==t)return null;var n=Ft(e,e===Ns?Ls:0);if(0===n)return null;var r=n,i=Os;Os|=16;var o=Sl();for(Ns===e&&Ls===r||($s(),xl(e,r));;)try{El();break}catch(t){kl(e,t)}if(Zi(),Ts.current=o,Os=i,null!==Ms?r=0:(Ns=null,Ls=0,r=Ds),0!=(Is&zs))xl(e,0);else if(0!==r){if(2===r&&(Os|=64,e.hydrate&&(e.hydrate=!1,$r(e.containerInfo)),0!==(n=zt(e))&&(r=Cl(e,n))),1===r)throw t=Rs,xl(e,0),ml(e,n),pl(e,Hi()),t;switch(e.finishedWork=e.current.alternate,e.finishedLanes=n,r){case 0:case 1:throw Error(a(345));case 2:Ol(e);break;case 3:if(ml(e,n),(62914560&n)===n&&10<(r=Bs+500-Hi())){if(0!==Ft(e,0))break;if(((i=e.suspendedLanes)&n)!==n){ul(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Br(Ol.bind(null,e),r);break}Ol(e);break;case 4:if(ml(e,n),(4186112&n)===n)break;for(r=e.eventTimes,i=-1;0<n;){var s=31-$t(n);o=1<<s,(s=r[s])>i&&(i=s),n&=~o}if(n=i,10<(n=(120>(n=Hi()-n)?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Es(n/1960))-n)){e.timeoutHandle=Br(Ol.bind(null,e),n);break}Ol(e);break;case 5:Ol(e);break;default:throw Error(a(329))}}return pl(e,Hi()),e.callbackNode===t?hl.bind(null,e):null}function ml(e,t){for(t&=~Hs,t&=~zs,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-$t(t),r=1<<n;e[n]=-1,t&=~r}}function vl(e){if(0!=(48&Os))throw Error(a(327));if(Ll(),e===Ns&&0!=(e.expiredLanes&Ls)){var t=Ls,n=Cl(e,t);0!=(Is&zs)&&(n=Cl(e,t=Ft(e,t)))}else n=Cl(e,t=Ft(e,0));if(0!==e.tag&&2===n&&(Os|=64,e.hydrate&&(e.hydrate=!1,$r(e.containerInfo)),0!==(t=zt(e))&&(n=Cl(e,t))),1===n)throw n=Rs,xl(e,0),ml(e,t),pl(e,Hi()),n;return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ol(e),pl(e,Hi()),null}function gl(e,t){var n=Os;Os|=1;try{return e(t)}finally{0===(Os=n)&&($s(),Vi())}}function yl(e,t){var n=Os;Os&=-2,Os|=8;try{return e(t)}finally{0===(Os=n)&&($s(),Vi())}}function bl(e,t){li(As,Ps),Ps|=t,Is|=t}function wl(){Ps=As.current,si(As)}function xl(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,Wr(n)),null!==Ms)for(n=Ms.return;null!==n;){var r=n;switch(r.tag){case 1:null!=(r=r.type.childContextTypes)&&mi();break;case 3:Lo(),si(di),si(ci),Go();break;case 5:Ao(r);break;case 4:Lo();break;case 13:case 19:si(Do);break;case 10:eo(r);break;case 23:case 24:wl()}n=n.return}Ns=e,Ms=Wl(e.current,null),Ls=Ps=Is=t,Ds=0,Rs=null,Hs=zs=Fs=0}function kl(e,t){for(;;){var n=Ms;try{if(Zi(),Yo.current=Oa,ea){for(var r=Qo.memoizedState;null!==r;){var i=r.queue;null!==i&&(i.pending=null),r=r.next}ea=!1}if(Ko=0,Zo=Jo=Qo=null,ta=!1,js.current=null,null===n||null===n.return){Ds=1,Rs=t,Ms=null;break}e:{var o=e,a=n.return,s=n,l=t;if(t=Ls,s.flags|=2048,s.firstEffect=s.lastEffect=null,null!==l&&"object"==typeof l&&"function"==typeof l.then){var u=l;if(0==(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 d=0!=(1&Do.current),f=a;do{var p;if(p=13===f.tag){var h=f.memoizedState;if(null!==h)p=null!==h.dehydrated;else{var m=f.memoizedProps;p=void 0!==m.fallback&&(!0!==m.unstable_avoidThisFallback||!d)}}if(p){var v=f.updateQueue;if(null===v){var g=new Set;g.add(u),f.updateQueue=g}else v.add(u);if(0==(2&f.mode)){if(f.flags|=64,s.flags|=16384,s.flags&=-2981,1===s.tag)if(null===s.alternate)s.tag=17;else{var y=so(-1,1);y.tag=2,lo(s,y)}s.lanes|=1;break e}l=void 0,s=t;var b=o.pingCache;if(null===b?(b=o.pingCache=new ls,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 w=Fl.bind(null,o,u,s);u.then(w,w)}f.flags|=4096,f.lanes=t;break e}f=f.return}while(null!==f);l=Error((G(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!==Ds&&(Ds=2),l=as(l,s),f=a;do{switch(f.tag){case 3:o=l,f.flags|=4096,t&=-t,f.lanes|=t,uo(f,us(0,o,t));break e;case 1:o=l;var x=f.type,k=f.stateNode;if(0==(64&f.flags)&&("function"==typeof x.getDerivedStateFromError||null!==k&&"function"==typeof k.componentDidCatch&&(null===Xs||!Xs.has(k)))){f.flags|=4096,t&=-t,f.lanes|=t,uo(f,cs(f,o,t));break e}}f=f.return}while(null!==f)}jl(n)}catch(e){t=e,Ms===n&&null!==n&&(Ms=n=n.return);continue}break}}function Sl(){var e=Ts.current;return Ts.current=Oa,null===e?Oa:e}function Cl(e,t){var n=Os;Os|=16;var r=Sl();for(Ns===e&&Ls===t||xl(e,t);;)try{_l();break}catch(t){kl(e,t)}if(Zi(),Os=n,Ts.current=r,null!==Ms)throw Error(a(261));return Ns=null,Ls=0,Ds}function _l(){for(;null!==Ms;)Tl(Ms)}function El(){for(;null!==Ms&&!_i();)Tl(Ms)}function Tl(e){var t=Vs(e.alternate,e,Ps);e.memoizedProps=e.pendingProps,null===t?jl(e):Ms=t,js.current=null}function jl(e){var t=e;do{var n=t.alternate;if(e=t.return,0==(2048&t.flags)){if(null!==(n=is(n,t,Ps)))return void(Ms=n);if(24!==(n=t).tag&&23!==n.tag||null===n.memoizedState||0!=(1073741824&Ps)||0==(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&&0==(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))}else{if(null!==(n=os(t)))return n.flags&=2047,void(Ms=n);null!==e&&(e.firstEffect=e.lastEffect=null,e.flags|=2048)}if(null!==(t=t.sibling))return void(Ms=t);Ms=t=e}while(null!==t);0===Ds&&(Ds=5)}function Ol(e){var t=Ui();return Wi(99,Nl.bind(null,e,t)),null}function Nl(e,t){do{Ll()}while(null!==Qs);if(0!=(48&Os))throw Error(a(327));var n=e.finishedWork;if(null===n)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(a(177));e.callbackNode=null;var r=n.lanes|n.childLanes,i=r,o=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<o;){var u=31-$t(o),c=1<<u;i[u]=0,s[u]=-1,l[u]=-1,o&=~c}if(null!==tl&&0==(24&r)&&tl.has(e)&&tl.delete(e),e===Ns&&(Ms=Ns=null,Ls=0),1<n.flags?null!==n.lastEffect?(n.lastEffect.nextEffect=n,r=n.firstEffect):r=n:r=n.firstEffect,null!==r){if(i=Os,Os|=32,js.current=null,Fr=Xt,hr(s=pr())){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,o=c.anchorOffset,u=c.focusNode,c=c.focusOffset;try{l.nodeType,u.nodeType}catch(e){l=null;break e}var d=0,f=-1,p=-1,h=0,m=0,v=s,g=null;t:for(;;){for(var y;v!==l||0!==o&&3!==v.nodeType||(f=d+o),v!==u||0!==c&&3!==v.nodeType||(p=d+c),3===v.nodeType&&(d+=v.nodeValue.length),null!==(y=v.firstChild);)g=v,v=y;for(;;){if(v===s)break t;if(g===l&&++h===o&&(f=d),g===u&&++m===c&&(p=d),null!==(y=v.nextSibling))break;g=(v=g).parentNode}v=y}l=-1===f||-1===p?null:{start:f,end:p}}else l=null;l=l||{start:0,end:0}}else l=null;zr={focusedElem:s,selectionRange:l},Xt=!1,sl=null,ll=!1,qs=r;do{try{Ml()}catch(e){if(null===qs)throw Error(a(330));Il(qs,e),qs=qs.nextEffect}}while(null!==qs);sl=null,qs=r;do{try{for(s=e;null!==qs;){var b=qs.flags;if(16&b&&ye(qs.stateNode,""),128&b){var w=qs.alternate;if(null!==w){var x=w.ref;null!==x&&("function"==typeof x?x(null):x.current=null)}}switch(1038&b){case 2:bs(qs),qs.flags&=-3;break;case 6:bs(qs),qs.flags&=-3,Ss(qs.alternate,qs);break;case 1024:qs.flags&=-1025;break;case 1028:qs.flags&=-1025,Ss(qs.alternate,qs);break;case 4:Ss(qs.alternate,qs);break;case 8:ks(s,l=qs);var k=l.alternate;gs(l),null!==k&&gs(k)}qs=qs.nextEffect}}catch(e){if(null===qs)throw Error(a(330));Il(qs,e),qs=qs.nextEffect}}while(null!==qs);if(x=zr,w=pr(),b=x.focusedElem,s=x.selectionRange,w!==b&&b&&b.ownerDocument&&fr(b.ownerDocument.documentElement,b)){null!==s&&hr(b)&&(w=s.start,void 0===(x=s.end)&&(x=w),"selectionStart"in b?(b.selectionStart=w,b.selectionEnd=Math.min(x,b.value.length)):(x=(w=b.ownerDocument||document)&&w.defaultView||window).getSelection&&(x=x.getSelection(),l=b.textContent.length,k=Math.min(s.start,l),s=void 0===s.end?k:Math.min(s.end,l),!x.extend&&k>s&&(l=s,s=k,k=l),l=dr(b,k),o=dr(b,s),l&&o&&(1!==x.rangeCount||x.anchorNode!==l.node||x.anchorOffset!==l.offset||x.focusNode!==o.node||x.focusOffset!==o.offset)&&((w=w.createRange()).setStart(l.node,l.offset),x.removeAllRanges(),k>s?(x.addRange(w),x.extend(o.node,o.offset)):(w.setEnd(o.node,o.offset),x.addRange(w))))),w=[];for(x=b;x=x.parentNode;)1===x.nodeType&&w.push({element:x,left:x.scrollLeft,top:x.scrollTop});for("function"==typeof b.focus&&b.focus(),b=0;b<w.length;b++)(x=w[b]).element.scrollLeft=x.left,x.element.scrollTop=x.top}Xt=!!Fr,zr=Fr=null,e.current=n,qs=r;do{try{for(b=e;null!==qs;){var S=qs.flags;if(36&S&&hs(b,qs.alternate,qs),128&S){w=void 0;var C=qs.ref;if(null!==C){var _=qs.stateNode;switch(qs.tag){case 5:w=_;break;default:w=_}"function"==typeof C?C(w):C.current=w}}qs=qs.nextEffect}}catch(e){if(null===qs)throw Error(a(330));Il(qs,e),qs=qs.nextEffect}}while(null!==qs);qs=null,Di(),Os=i}else e.current=n;if(Ks)Ks=!1,Qs=e,Js=t;else for(qs=r;null!==qs;)t=qs.nextEffect,qs.nextEffect=null,8&qs.flags&&((S=qs).sibling=null,S.stateNode=null),qs=t;if(0===(r=e.pendingLanes)&&(Xs=null),1===r?e===rl?nl++:(nl=0,rl=e):nl=0,n=n.stateNode,xi&&"function"==typeof xi.onCommitFiberRoot)try{xi.onCommitFiberRoot(wi,n,void 0,64==(64&n.current.flags))}catch(e){}if(pl(e,Hi()),Gs)throw Gs=!1,e=Ys,Ys=null,e;return 0!=(8&Os)||Vi(),null}function Ml(){for(;null!==qs;){var e=qs.alternate;ll||null===sl||(0!=(8&qs.flags)?et(qs,sl)&&(ll=!0):13===qs.tag&&_s(e,qs)&&et(qs,sl)&&(ll=!0));var t=qs.flags;0!=(256&t)&&ps(e,qs),0==(512&t)||Ks||(Ks=!0,$i(97,(function(){return Ll(),null}))),qs=qs.nextEffect}}function Ll(){if(90!==Js){var e=97<Js?97:Js;return Js=90,Wi(e,Dl)}return!1}function Pl(e,t){Zs.push(t,e),Ks||(Ks=!0,$i(97,(function(){return Ll(),null})))}function Al(e,t){el.push(t,e),Ks||(Ks=!0,$i(97,(function(){return Ll(),null})))}function Dl(){if(null===Qs)return!1;var e=Qs;if(Qs=null,0!=(48&Os))throw Error(a(331));var t=Os;Os|=32;var n=el;el=[];for(var r=0;r<n.length;r+=2){var i=n[r],o=n[r+1],s=i.destroy;if(i.destroy=void 0,"function"==typeof s)try{s()}catch(e){if(null===o)throw Error(a(330));Il(o,e)}}for(n=Zs,Zs=[],r=0;r<n.length;r+=2){i=n[r],o=n[r+1];try{var l=i.create;i.destroy=l()}catch(e){if(null===o)throw Error(a(330));Il(o,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 Os=t,Vi(),!0}function Rl(e,t,n){lo(e,t=us(0,t=as(n,t),1)),t=ul(),null!==(e=fl(e,1))&&(Wt(e,1,t),pl(e,t))}function Il(e,t){if(3===e.tag)Rl(e,e,t);else for(var n=e.return;null!==n;){if(3===n.tag){Rl(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=cs(n,e=as(t,e),1);if(lo(n,i),i=ul(),null!==(n=fl(n,1)))Wt(n,1,i),pl(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 Fl(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),t=ul(),e.pingedLanes|=e.suspendedLanes&n,Ns===e&&(Ls&n)===n&&(4===Ds||3===Ds&&(62914560&Ls)===Ls&&500>Hi()-Bs?xl(e,0):Hs|=n),pl(e,t)}function zl(e,t){var n=e.stateNode;null!==n&&n.delete(t),0===(t=0)&&(0==(2&(t=e.mode))?t=1:0==(4&t)?t=99===Ui()?1:2:(0===ol&&(ol=Is),0===(t=Ut(62914560&~ol))&&(t=4194304))),n=ul(),null!==(e=fl(e,t))&&(Wt(e,t,n),pl(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 Ul(e,t,n,r){return new Hl(e,t,n,r)}function Bl(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Wl(e,t){var n=e.alternate;return null===n?((n=Ul(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 $l(e,t,n,r,i,o){var s=2;if(r=e,"function"==typeof e)Bl(e)&&(s=1);else if("string"==typeof e)s=5;else e:switch(e){case C:return Vl(n.children,i,o,t);case R:s=8,i|=16;break;case _:s=8,i|=1;break;case E:return(e=Ul(12,n,t,8|i)).elementType=E,e.type=E,e.lanes=o,e;case N:return(e=Ul(13,n,t,i)).type=N,e.elementType=N,e.lanes=o,e;case M:return(e=Ul(19,n,t,i)).elementType=M,e.lanes=o,e;case I:return ql(n,i,o,t);case F:return(e=Ul(24,n,t,i)).elementType=F,e.lanes=o,e;default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case T:s=10;break e;case j:s=9;break e;case O:s=11;break e;case L:s=14;break e;case P:s=16,r=null;break e;case A:s=22;break e}throw Error(a(130,null==e?e:typeof e,""))}return(t=Ul(s,n,t,i)).elementType=e,t.type=r,t.lanes=o,t}function Vl(e,t,n,r){return(e=Ul(7,e,r,t)).lanes=n,e}function ql(e,t,n,r){return(e=Ul(23,e,r,t)).elementType=I,e.lanes=n,e}function Gl(e,t,n){return(e=Ul(6,e,null,t)).lanes=n,e}function Yl(e,t,n){return(t=Ul(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=Bt(0),this.expirationTimes=Bt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Bt(0),this.mutableSourceEagerHydrationData=null}function Kl(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:S,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}function Ql(e,t,n,r){var i=t.current,o=ul(),s=cl(i);e:if(n){t:{if(Ke(n=n._reactInternals)!==n||1!==n.tag)throw Error(a(170));var l=n;do{switch(l.tag){case 3:l=l.stateNode.context;break t;case 1:if(hi(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break t}}l=l.return}while(null!==l);throw Error(a(171))}if(1===n.tag){var u=n.type;if(hi(u)){n=gi(n,u,l);break e}}n=l}else n=ui;return null===t.context?t.context=n:t.pendingContext=n,(t=so(o,s)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),lo(i,t),dl(i,s,o),s}function Jl(e){if(!(e=e.current).child)return null;switch(e.child.tag){case 5:default:return e.child.stateNode}}function Zl(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function eu(e,t){Zl(e,t),(e=e.alternate)&&Zl(e,t)}function tu(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=Ul(3,null,null,2===t?7:1===t?3:0),n.current=t,t.stateNode=n,oo(t),e[Qr]=n.current,Or(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 nu(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function ru(e,t,n,r,i){var o=n._reactRootContainer;if(o){var a=o._internalRoot;if("function"==typeof i){var s=i;i=function(){var e=Jl(a);s.call(e)}}Ql(t,a,e,i)}else{if(o=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 tu(e,0,t?{hydrate:!0}:void 0)}(n,r),a=o._internalRoot,"function"==typeof i){var l=i;i=function(){var e=Jl(a);l.call(e)}}yl((function(){Ql(t,a,e,i)}))}return Jl(a)}function iu(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!nu(t))throw Error(a(200));return Kl(e,t,null,n)}Vs=function(e,t,n){var r=t.lanes;if(null!==e)if(e.memoizedProps!==t.pendingProps||di.current)Aa=!0;else{if(0==(n&r)){switch(Aa=!1,t.tag){case 3:$a(t),Vo();break;case 5:Po(t);break;case 1:hi(t.type)&&yi(t);break;case 4:Mo(t,t.stateNode.containerInfo);break;case 10:r=t.memoizedProps.value;var i=t.type._context;li(Xi,i._currentValue),i._currentValue=r;break;case 13:if(null!==t.memoizedState)return 0!=(n&t.child.childLanes)?Xa(e,t,n):(li(Do,1&Do.current),null!==(t=ns(e,t,n))?t.sibling:null);li(Do,1&Do.current);break;case 19:if(r=0!=(n&t.childLanes),0!=(64&e.flags)){if(r)return ts(e,t,n);t.flags|=64}if(null!==(i=t.memoizedState)&&(i.rendering=null,i.tail=null,i.lastEffect=null),li(Do,Do.current),r)break;return null;case 23:case 24:return t.lanes=0,za(e,t,n)}return ns(e,t,n)}Aa=0!=(16384&e.flags)}else Aa=!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=pi(t,ci.current),no(t,n),i=ia(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,hi(r)){var o=!0;yi(t)}else o=!1;t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,oo(t);var s=r.getDerivedStateFromProps;"function"==typeof s&&ho(t,r,s,e),i.updater=mo,t.stateNode=i,i._reactInternals=t,bo(t,r,e,n),t=Wa(null,t,r,!0,o,n)}else t.tag=0,Da(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=(o=i._init)(i._payload),t.type=i,o=t.tag=function(e){if("function"==typeof e)return Bl(e)?1:0;if(null!=e){if((e=e.$$typeof)===O)return 11;if(e===L)return 14}return 2}(i),e=Yi(i,e),o){case 0:t=Ua(null,t,i,e,n);break e;case 1:t=Ba(null,t,i,e,n);break e;case 11:t=Ra(null,t,i,e,n);break e;case 14:t=Ia(null,t,i,Yi(i.type,e),r,n);break e}throw Error(a(306,i,""))}return t;case 0:return r=t.type,i=t.pendingProps,Ua(e,t,r,i=t.elementType===r?i:Yi(r,i),n);case 1:return r=t.type,i=t.pendingProps,Ba(e,t,r,i=t.elementType===r?i:Yi(r,i),n);case 3:if($a(t),r=t.updateQueue,null===e||null===r)throw Error(a(282));if(r=t.pendingProps,i=null!==(i=t.memoizedState)?i.element:null,ao(e,t),co(t,r,null,n),(r=t.memoizedState.element)===i)Vo(),t=ns(e,t,n);else{if((o=(i=t.stateNode).hydrate)&&(Fo=Vr(t.stateNode.containerInfo.firstChild),Io=t,o=zo=!0),o){if(null!=(e=i.mutableSourceEagerHydrationData))for(i=0;i<e.length;i+=2)(o=e[i])._workInProgressVersionPrimary=e[i+1],qo.push(o);for(n=_o(t,null,r,n),t.child=n;n;)n.flags=-3&n.flags|1024,n=n.sibling}else Da(e,t,r,n),Vo();t=t.child}return t;case 5:return Po(t),null===e&&Bo(t),r=t.type,i=t.pendingProps,o=null!==e?e.memoizedProps:null,s=i.children,Ur(r,i)?s=null:null!==o&&Ur(r,o)&&(t.flags|=16),Ha(e,t),Da(e,t,s,n),t.child;case 6:return null===e&&Bo(t),null;case 13:return Xa(e,t,n);case 4:return Mo(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=Co(t,null,r,n):Da(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,Ra(e,t,r,i=t.elementType===r?i:Yi(r,i),n);case 7:return Da(e,t,t.pendingProps,n),t.child;case 8:case 12:return Da(e,t,t.pendingProps.children,n),t.child;case 10:e:{r=t.type._context,i=t.pendingProps,s=t.memoizedProps,o=i.value;var l=t.type._context;if(li(Xi,l._currentValue),l._currentValue=o,null!==s)if(l=s.value,0===(o=sr(l,o)?0:0|("function"==typeof r._calculateChangedBits?r._calculateChangedBits(l,o):1073741823))){if(s.children===i.children&&!di.current){t=ns(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&&0!=(c.observedBits&o)){1===l.tag&&((c=so(-1,n&-n)).tag=2,lo(l,c)),l.lanes|=n,null!==(c=l.alternate)&&(c.lanes|=n),to(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}Da(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=(o=t.pendingProps).children,no(t,n),r=r(i=ro(i,o.unstable_observedBits)),t.flags|=1,Da(e,t,r,n),t.child;case 14:return o=Yi(i=t.type,t.pendingProps),Ia(e,t,i,o=Yi(i.type,o),r,n);case 15:return Fa(e,t,t.type,t.pendingProps,r,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Yi(r,i),null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),t.tag=1,hi(r)?(e=!0,yi(t)):e=!1,no(t,n),go(t,r,i),bo(t,r,i,n),Wa(null,t,r,!0,e,n);case 19:return ts(e,t,n);case 23:case 24:return za(e,t,n)}throw Error(a(156,t.tag))},tu.prototype.render=function(e){Ql(e,this._internalRoot,null,null)},tu.prototype.unmount=function(){var e=this._internalRoot,t=e.containerInfo;Ql(null,e,null,(function(){t[Qr]=null}))},tt=function(e){13===e.tag&&(dl(e,4,ul()),eu(e,4))},nt=function(e){13===e.tag&&(dl(e,67108864,ul()),eu(e,67108864))},rt=function(e){if(13===e.tag){var t=ul(),n=cl(e);dl(e,n,t),eu(e,n)}},it=function(e,t){return t()},Te=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=ni(r);if(!i)throw Error(a(90));Q(r),ne(r,i)}}}break;case"textarea":ue(e,n);break;case"select":null!=(t=n.value)&&ae(e,!!n.multiple,t,!1)}},Pe=gl,Ae=function(e,t,n,r,i){var o=Os;Os|=4;try{return Wi(98,e.bind(null,t,n,r,i))}finally{0===(Os=o)&&($s(),Vi())}},De=function(){0==(49&Os)&&(function(){if(null!==tl){var e=tl;tl=null,e.forEach((function(e){e.expiredLanes|=24&e.pendingLanes,pl(e,Hi())}))}Vi()}(),Ll())},Re=function(e,t){var n=Os;Os|=2;try{return e(t)}finally{0===(Os=n)&&($s(),Vi())}};var ou={Events:[ei,ti,ni,Me,Le,Ll,{current:!1}]},au={findFiberByHostInstance:Zr,bundleType:0,version:"17.0.1",rendererPackageName:"react-dom"},su={bundleType:au.bundleType,version:au.version,rendererPackageName:au.rendererPackageName,rendererConfig:au.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:x.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=Ze(e))?null:e.stateNode},findFiberByHostInstance:au.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var lu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!lu.isDisabled&&lu.supportsFiber)try{wi=lu.inject(su),xi=lu}catch(ve){}}t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ou,t.createPortal=iu,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(a(188));throw Error(a(268,Object.keys(e)))}return e=null===(e=Ze(t))?null:e.stateNode},t.flushSync=function(e,t){var n=Os;if(0!=(48&n))return e(t);Os|=1;try{if(e)return Wi(99,e.bind(null,t))}finally{Os=n,Vi()}},t.hydrate=function(e,t,n){if(!nu(t))throw Error(a(200));return ru(null,e,t,!0,n)},t.render=function(e,t,n){if(!nu(t))throw Error(a(200));return ru(null,e,t,!1,n)},t.unmountComponentAtNode=function(e){if(!nu(e))throw Error(a(40));return!!e._reactRootContainer&&(yl((function(){ru(null,null,e,!1,(function(){e._reactRootContainer=null,e[Qr]=null}))})),!0)},t.unstable_batchedUpdates=gl,t.unstable_createPortal=function(e,t){return iu(e,t,2<arguments.length&&void 0!==arguments[2]?arguments[2]:null)},t.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!nu(n))throw Error(a(200));if(null==e||void 0===e._reactInternals)throw Error(a(38));return ru(e,t,n,!1,r)},t.version="17.0.1"},3935:(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(4448)},9921:(e,t)=>{"use strict";var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,i=n?Symbol.for("react.portal"):60106,o=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,s=n?Symbol.for("react.profiler"):60114,l=n?Symbol.for("react.provider"):60109,u=n?Symbol.for("react.context"):60110,c=n?Symbol.for("react.async_mode"):60111,d=n?Symbol.for("react.concurrent_mode"):60111,f=n?Symbol.for("react.forward_ref"):60112,p=n?Symbol.for("react.suspense"):60113,h=n?Symbol.for("react.suspense_list"):60120,m=n?Symbol.for("react.memo"):60115,v=n?Symbol.for("react.lazy"):60116,g=n?Symbol.for("react.block"):60121,y=n?Symbol.for("react.fundamental"):60117,b=n?Symbol.for("react.responder"):60118,w=n?Symbol.for("react.scope"):60119;function x(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case c:case d:case o:case s:case a:case p:return e;default:switch(e=e&&e.$$typeof){case u:case f:case v:case m:case l:return e;default:return t}}case i:return t}}}function k(e){return x(e)===d}t.AsyncMode=c,t.ConcurrentMode=d,t.ContextConsumer=u,t.ContextProvider=l,t.Element=r,t.ForwardRef=f,t.Fragment=o,t.Lazy=v,t.Memo=m,t.Portal=i,t.Profiler=s,t.StrictMode=a,t.Suspense=p,t.isAsyncMode=function(e){return k(e)||x(e)===c},t.isConcurrentMode=k,t.isContextConsumer=function(e){return x(e)===u},t.isContextProvider=function(e){return x(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return x(e)===f},t.isFragment=function(e){return x(e)===o},t.isLazy=function(e){return x(e)===v},t.isMemo=function(e){return x(e)===m},t.isPortal=function(e){return x(e)===i},t.isProfiler=function(e){return x(e)===s},t.isStrictMode=function(e){return x(e)===a},t.isSuspense=function(e){return x(e)===p},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===d||e===s||e===a||e===p||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===v||e.$$typeof===m||e.$$typeof===l||e.$$typeof===u||e.$$typeof===f||e.$$typeof===y||e.$$typeof===b||e.$$typeof===w||e.$$typeof===g)},t.typeOf=x},9864:(e,t,n)=>{"use strict";e.exports=n(9921)},2686:(e,t,n)=>{var r=n(3888),i=n(3138),o=n(1855),a=o.MUST_USE_PROPERTY,s=o.HAS_BOOLEAN_VALUE,l=o.HAS_NUMERIC_VALUE,u=o.HAS_POSITIVE_NUMERIC_VALUE,c=o.HAS_OVERLOADED_BOOLEAN_VALUE;function d(e,t){return(e&t)===t}function f(e,t,n){var r,i,o,f=e.Properties,p=e.DOMAttributeNames;for(i in f)r=p[i]||(n?i:i.toLowerCase()),o=f[i],t[r]={attributeName:r,propertyName:i,mustUseProperty:d(o,a),hasBooleanValue:d(o,s),hasNumericValue:d(o,l),hasPositiveNumericValue:d(o,u),hasOverloadedBooleanValue:d(o,c)}}var p={};f(r,p);var h={};f(i,h,!0);var m={};f(r,m),f(i,m,!0);e.exports={html:p,svg:h,properties:m,isCustomAttribute:RegExp.prototype.test.bind(new RegExp("^(data|aria)-[: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]*$"))}},3888:e=>{e.exports={Properties:{autoFocus:4,accept:0,acceptCharset:0,accessKey:0,action:0,allowFullScreen:4,allowTransparency:0,alt:0,as:0,async:4,autoComplete:0,autoPlay:4,capture:4,cellPadding:0,cellSpacing:0,charSet:0,challenge:0,checked:5,cite:0,classID:0,className:0,cols:24,colSpan:0,content:0,contentEditable:0,contextMenu:0,controls:4,controlsList:0,coords:0,crossOrigin:0,data:0,dateTime:0,default:4,defer:4,dir:0,disabled:4,download:32,draggable:0,encType:0,form:0,formAction:0,formEncType:0,formMethod:0,formNoValidate:4,formTarget:0,frameBorder:0,headers:0,height:0,hidden:4,high:0,href:0,hrefLang:0,htmlFor:0,httpEquiv:0,icon:0,id:0,inputMode:0,integrity:0,is:0,keyParams:0,keyType:0,kind:0,label:0,lang:0,list:0,loop:4,low:0,manifest:0,marginHeight:0,marginWidth:0,max:0,maxLength:0,media:0,mediaGroup:0,method:0,min:0,minLength:0,multiple:5,muted:5,name:0,nonce:0,noValidate:4,open:4,optimum:0,pattern:0,placeholder:0,playsInline:4,poster:0,preload:0,profile:0,radioGroup:0,readOnly:4,referrerPolicy:0,rel:0,required:4,reversed:4,role:0,rows:24,rowSpan:8,sandbox:0,scope:0,scoped:4,scrolling:0,seamless:4,selected:5,shape:0,size:24,sizes:0,span:24,spellCheck:0,src:0,srcDoc:0,srcLang:0,srcSet:0,start:8,step:0,style:0,summary:0,tabIndex:0,target:0,title:0,type:0,useMap:0,value:0,width:0,wmode:0,wrap:0,about:0,datatype:0,inlist:0,prefix:0,property:0,resource:0,typeof:0,vocab:0,autoCapitalize:0,autoCorrect:0,autoSave:0,color:0,itemProp:0,itemScope:4,itemType:0,itemID:0,itemRef:0,results:0,security:0,unselectable:0},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"}}},3138:e=>{e.exports={Properties:{accentHeight:0,accumulate:0,additive:0,alignmentBaseline:0,allowReorder:0,alphabetic:0,amplitude:0,arabicForm:0,ascent:0,attributeName:0,attributeType:0,autoReverse:0,azimuth:0,baseFrequency:0,baseProfile:0,baselineShift:0,bbox:0,begin:0,bias:0,by:0,calcMode:0,capHeight:0,clip:0,clipPath:0,clipRule:0,clipPathUnits:0,colorInterpolation:0,colorInterpolationFilters:0,colorProfile:0,colorRendering:0,contentScriptType:0,contentStyleType:0,cursor:0,cx:0,cy:0,d:0,decelerate:0,descent:0,diffuseConstant:0,direction:0,display:0,divisor:0,dominantBaseline:0,dur:0,dx:0,dy:0,edgeMode:0,elevation:0,enableBackground:0,end:0,exponent:0,externalResourcesRequired:0,fill:0,fillOpacity:0,fillRule:0,filter:0,filterRes:0,filterUnits:0,floodColor:0,floodOpacity:0,focusable:0,fontFamily:0,fontSize:0,fontSizeAdjust:0,fontStretch:0,fontStyle:0,fontVariant:0,fontWeight:0,format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:0,glyphOrientationHorizontal:0,glyphOrientationVertical:0,glyphRef:0,gradientTransform:0,gradientUnits:0,hanging:0,horizAdvX:0,horizOriginX:0,ideographic:0,imageRendering:0,in:0,in2:0,intercept:0,k:0,k1:0,k2:0,k3:0,k4:0,kernelMatrix:0,kernelUnitLength:0,kerning:0,keyPoints:0,keySplines:0,keyTimes:0,lengthAdjust:0,letterSpacing:0,lightingColor:0,limitingConeAngle:0,local:0,markerEnd:0,markerMid:0,markerStart:0,markerHeight:0,markerUnits:0,markerWidth:0,mask:0,maskContentUnits:0,maskUnits:0,mathematical:0,mode:0,numOctaves:0,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:0,overlineThickness:0,paintOrder:0,panose1:0,pathLength:0,patternContentUnits:0,patternTransform:0,patternUnits:0,pointerEvents:0,points:0,pointsAtX:0,pointsAtY:0,pointsAtZ:0,preserveAlpha:0,preserveAspectRatio:0,primitiveUnits:0,r:0,radius:0,refX:0,refY:0,renderingIntent:0,repeatCount:0,repeatDur:0,requiredExtensions:0,requiredFeatures:0,restart:0,result:0,rotate:0,rx:0,ry:0,scale:0,seed:0,shapeRendering:0,slope:0,spacing:0,specularConstant:0,specularExponent:0,speed:0,spreadMethod:0,startOffset:0,stdDeviation:0,stemh:0,stemv:0,stitchTiles:0,stopColor:0,stopOpacity:0,strikethroughPosition:0,strikethroughThickness:0,string:0,stroke:0,strokeDasharray:0,strokeDashoffset:0,strokeLinecap:0,strokeLinejoin:0,strokeMiterlimit:0,strokeOpacity:0,strokeWidth:0,surfaceScale:0,systemLanguage:0,tableValues:0,targetX:0,targetY:0,textAnchor:0,textDecoration:0,textRendering:0,textLength:0,to:0,transform:0,u1:0,u2:0,underlinePosition:0,underlineThickness:0,unicode:0,unicodeBidi:0,unicodeRange:0,unitsPerEm:0,vAlphabetic:0,vHanging:0,vIdeographic:0,vMathematical:0,values:0,vectorEffect:0,version:0,vertAdvY:0,vertOriginX:0,vertOriginY:0,viewBox:0,viewTarget:0,visibility:0,widths:0,wordSpacing:0,writingMode:0,x:0,xHeight:0,x1:0,x2:0,xChannelSelector:0,xlinkActuate:0,xlinkArcrole:0,xlinkHref:0,xlinkRole:0,xlinkShow:0,xlinkTitle:0,xlinkType:0,xmlBase:0,xmlns:0,xmlnsXlink:0,xmlLang:0,xmlSpace:0,y:0,y1:0,y2:0,yChannelSelector:0,z:0,zoomAndPan:0},DOMAttributeNames:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDasharray:"stroke-dasharray",strokeDashoffset:"stroke-dashoffset",strokeLinecap:"stroke-linecap",strokeLinejoin:"stroke-linejoin",strokeMiterlimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",xlinkActuate:"xlink:actuate",xlinkArcrole:"xlink:arcrole",xlinkHref:"xlink:href",xlinkRole:"xlink:role",xlinkShow:"xlink:show",xlinkTitle:"xlink:title",xlinkType:"xlink:type",xmlBase:"xml:base",xmlnsXlink:"xmlns:xlink",xmlLang:"xml:lang",xmlSpace:"xml:space"}}},1855:e=>{e.exports={MUST_USE_PROPERTY:1,HAS_BOOLEAN_VALUE:4,HAS_NUMERIC_VALUE:8,HAS_POSITIVE_NUMERIC_VALUE:24,HAS_OVERLOADED_BOOLEAN_VALUE:32}},5251:(e,t,n)=>{"use strict";n(7418);var r=n(7294),i=60103;if(t.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var o=Symbol.for;i=o("react.element"),t.Fragment=o("react.fragment")}var a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s=Object.prototype.hasOwnProperty,l={key:!0,ref:!0,__self:!0,__source:!0};function u(e,t,n){var r,o={},u=null,c=null;for(r in void 0!==n&&(u=""+n),void 0!==t.key&&(u=""+t.key),void 0!==t.ref&&(c=t.ref),t)s.call(t,r)&&!l.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===o[r]&&(o[r]=t[r]);return{$$typeof:i,type:e,key:u,ref:c,props:o,_owner:a.current}}t.jsx=u,t.jsxs=u},2408:(e,t,n)=>{"use strict";var r=n(7418),i=60103,o=60106;t.Fragment=60107,t.StrictMode=60108,t.Profiler=60114;var a=60109,s=60110,l=60112;t.Suspense=60113;var u=60115,c=60116;if("function"==typeof Symbol&&Symbol.for){var d=Symbol.for;i=d("react.element"),o=d("react.portal"),t.Fragment=d("react.fragment"),t.StrictMode=d("react.strict_mode"),t.Profiler=d("react.profiler"),a=d("react.provider"),s=d("react.context"),l=d("react.forward_ref"),t.Suspense=d("react.suspense"),u=d("react.memo"),c=d("react.lazy")}var f="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(){}},m={};function v(e,t,n){this.props=e,this.context=t,this.refs=m,this.updater=n||h}function g(){}function y(e,t,n){this.props=e,this.context=t,this.refs=m,this.updater=n||h}v.prototype.isReactComponent={},v.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")},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},g.prototype=v.prototype;var b=y.prototype=new g;b.constructor=y,r(b,v.prototype),b.isPureReactComponent=!0;var w={current:null},x=Object.prototype.hasOwnProperty,k={key:!0,ref:!0,__self:!0,__source:!0};function S(e,t,n){var r,o={},a=null,s=null;if(null!=t)for(r in void 0!==t.ref&&(s=t.ref),void 0!==t.key&&(a=""+t.key),t)x.call(t,r)&&!k.hasOwnProperty(r)&&(o[r]=t[r]);var l=arguments.length-2;if(1===l)o.children=n;else if(1<l){for(var u=Array(l),c=0;c<l;c++)u[c]=arguments[c+2];o.children=u}if(e&&e.defaultProps)for(r in l=e.defaultProps)void 0===o[r]&&(o[r]=l[r]);return{$$typeof:i,type:e,key:a,ref:s,props:o,_owner:w.current}}function C(e){return"object"==typeof e&&null!==e&&e.$$typeof===i}var _=/\/+/g;function E(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,a){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 o:l=!0}}if(l)return a=a(l=e),e=""===r?"."+E(l,0):r,Array.isArray(a)?(n="",null!=e&&(n=e.replace(_,"$&/")+"/"),T(a,t,n,"",(function(e){return e}))):null!=a&&(C(a)&&(a=function(e,t){return{$$typeof:i,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(a,n+(!a.key||l&&l.key===a.key?"":(""+a.key).replace(_,"$&/")+"/")+e)),t.push(a)),1;if(l=0,r=""===r?".":r+":",Array.isArray(e))for(var u=0;u<e.length;u++){var c=r+E(s=e[u],u);l+=T(s,t,n,c,a)}else if("function"==typeof(c=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=f&&e[f]||e["@@iterator"])?e:null}(e)))for(e=c.call(e),u=0;!(s=e.next()).done;)l+=T(s=s.value,t,n,c=r+E(s,u++),a);else if("object"===s)throw t=""+e,Error(p(31,"[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t));return l}function j(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 M(){var e=N.current;if(null===e)throw Error(p(321));return e}var L={ReactCurrentDispatcher:N,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:w,IsSomeRendererActing:{current:!1},assign:r};t.Children={map:j,forEach:function(e,t,n){j(e,(function(){t.apply(this,arguments)}),n)},count:function(e){var t=0;return j(e,(function(){t++})),t},toArray:function(e){return j(e,(function(e){return e}))||[]},only:function(e){if(!C(e))throw Error(p(143));return e}},t.Component=v,t.PureComponent=y,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=L,t.cloneElement=function(e,t,n){if(null==e)throw Error(p(267,e));var o=r({},e.props),a=e.key,s=e.ref,l=e._owner;if(null!=t){if(void 0!==t.ref&&(s=t.ref,l=w.current),void 0!==t.key&&(a=""+t.key),e.type&&e.type.defaultProps)var u=e.type.defaultProps;for(c in t)x.call(t,c)&&!k.hasOwnProperty(c)&&(o[c]=void 0===t[c]&&void 0!==u?u[c]:t[c])}var c=arguments.length-2;if(1===c)o.children=n;else if(1<c){u=Array(c);for(var d=0;d<c;d++)u[d]=arguments[d+2];o.children=u}return{$$typeof:i,type:e.type,key:a,ref:s,props:o,_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:a,_context:e},e.Consumer=e},t.createElement=S,t.createFactory=function(e){var t=S.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=C,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 M().useCallback(e,t)},t.useContext=function(e,t){return M().useContext(e,t)},t.useDebugValue=function(){},t.useEffect=function(e,t){return M().useEffect(e,t)},t.useImperativeHandle=function(e,t,n){return M().useImperativeHandle(e,t,n)},t.useLayoutEffect=function(e,t){return M().useLayoutEffect(e,t)},t.useMemo=function(e,t){return M().useMemo(e,t)},t.useReducer=function(e,t,n){return M().useReducer(e,t,n)},t.useRef=function(e){return M().useRef(e)},t.useState=function(e){return M().useState(e)},t.version="17.0.1"},7294:(e,t,n)=>{"use strict";e.exports=n(2408)},5893:(e,t,n)=>{"use strict";e.exports=n(5251)},53:(e,t)=>{"use strict";var n,r,i,o;if("object"==typeof performance&&"function"==typeof performance.now){var a=performance;t.unstable_now=function(){return a.now()}}else{var s=Date,l=s.now();t.unstable_now=function(){return s.now()-l}}if("undefined"==typeof window||"function"!=typeof MessageChannel){var u=null,c=null,d=function(){if(null!==u)try{var e=t.unstable_now();u(!0,e),u=null}catch(e){throw setTimeout(d,0),e}};n=function(e){null!==u?setTimeout(n,0,e):(u=e,setTimeout(d,0))},r=function(e,t){c=setTimeout(e,t)},i=function(){clearTimeout(c)},t.unstable_shouldYield=function(){return!1},o=t.unstable_forceFrameRate=function(){}}else{var f=window.setTimeout,p=window.clearTimeout;if("undefined"!=typeof console){var h=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://reactjs.org/link/react-polyfills"),"function"!=typeof h&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")}var m=!1,v=null,g=-1,y=5,b=0;t.unstable_shouldYield=function(){return t.unstable_now()>=b},o=function(){},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):y=0<e?Math.floor(1e3/e):5};var w=new MessageChannel,x=w.port2;w.port1.onmessage=function(){if(null!==v){var e=t.unstable_now();b=e+y;try{v(!0,e)?x.postMessage(null):(m=!1,v=null)}catch(e){throw x.postMessage(null),e}}else m=!1},n=function(e){v=e,m||(m=!0,x.postMessage(null))},r=function(e,n){g=f((function(){e(t.unstable_now())}),n)},i=function(){p(g),g=-1}}function k(e,t){var n=e.length;e.push(t);e:for(;;){var r=n-1>>>1,i=e[r];if(!(void 0!==i&&0<_(i,t)))break e;e[r]=t,e[n]=i,n=r}}function S(e){return void 0===(e=e[0])?null:e}function C(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 o=2*(r+1)-1,a=e[o],s=o+1,l=e[s];if(void 0!==a&&0>_(a,n))void 0!==l&&0>_(l,a)?(e[r]=l,e[s]=n,r=s):(e[r]=a,e[o]=n,r=o);else{if(!(void 0!==l&&0>_(l,n)))break e;e[r]=l,e[s]=n,r=s}}}return t}return null}function _(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var E=[],T=[],j=1,O=null,N=3,M=!1,L=!1,P=!1;function A(e){for(var t=S(T);null!==t;){if(null===t.callback)C(T);else{if(!(t.startTime<=e))break;C(T),t.sortIndex=t.expirationTime,k(E,t)}t=S(T)}}function D(e){if(P=!1,A(e),!L)if(null!==S(E))L=!0,n(R);else{var t=S(T);null!==t&&r(D,t.startTime-e)}}function R(e,n){L=!1,P&&(P=!1,i()),M=!0;var o=N;try{for(A(n),O=S(E);null!==O&&(!(O.expirationTime>n)||e&&!t.unstable_shouldYield());){var a=O.callback;if("function"==typeof a){O.callback=null,N=O.priorityLevel;var s=a(O.expirationTime<=n);n=t.unstable_now(),"function"==typeof s?O.callback=s:O===S(E)&&C(E),A(n)}else C(E);O=S(E)}if(null!==O)var l=!0;else{var u=S(T);null!==u&&r(D,u.startTime-n),l=!1}return l}finally{O=null,N=o,M=!1}}var I=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(){L||M||(L=!0,n(R))},t.unstable_getCurrentPriorityLevel=function(){return N},t.unstable_getFirstCallbackNode=function(){return S(E)},t.unstable_next=function(e){switch(N){case 1:case 2:case 3:var t=3;break;default:t=N}var n=N;N=t;try{return e()}finally{N=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=I,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=N;N=e;try{return t()}finally{N=n}},t.unstable_scheduleCallback=function(e,o,a){var s=t.unstable_now();switch("object"==typeof a&&null!==a?a="number"==typeof(a=a.delay)&&0<a?s+a:s:a=s,e){case 1:var l=-1;break;case 2:l=250;break;case 5:l=1073741823;break;case 4:l=1e4;break;default:l=5e3}return e={id:j++,callback:o,priorityLevel:e,startTime:a,expirationTime:l=a+l,sortIndex:-1},a>s?(e.sortIndex=a,k(T,e),null===S(E)&&e===S(T)&&(P?i():P=!0,r(D,a-s))):(e.sortIndex=l,k(E,e),L||M||(L=!0,n(R))),e},t.unstable_wrapCallback=function(e){var t=N;return function(){var n=N;N=t;try{return e.apply(this,arguments)}finally{N=n}}}},3840:(e,t,n)=>{"use strict";e.exports=n(53)},1476:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0;var i=r(n(7848)),o=n(6678);t.default=function(e,t){var n={};return e&&"string"==typeof e?(i.default(e,(function(e,r){e&&r&&(n[o.camelCase(e,t)]=r)})),n):n}},6678:(e,t)=>{"use strict";t.__esModule=!0,t.camelCase=void 0;var n=/^--[a-zA-Z0-9-]+$/,r=/-([a-z])/g,i=/^[^-]+$/,o=/^-(webkit|moz|ms|o|khtml)-/,a=function(e,t){return t.toUpperCase()},s=function(e,t){return t+"-"};t.camelCase=function(e,t){return void 0===t&&(t={}),function(e){return!e||i.test(e)||n.test(e)}(e)?e:(e=e.toLowerCase(),t.reactCompat||(e=e.replace(o,s)),e.replace(r,a))}},7848:(e,t,n)=>{var r=n(8139);e.exports=function(e,t){var n,i=null;if(!e||"string"!=typeof e)return i;for(var o,a,s=r(e),l="function"==typeof t,u=0,c=s.length;u<c;u++)o=(n=s[u]).property,a=n.value,l?t(o,a,n):a&&(i||(i={}),i[o]=a);return i}},2963:e=>{"use strict";e.exports=function(e,t,n,r){if(null===e)return"";var i=e.length;return n=~~n,r=r||"&hellip;",0===(t=~~t)&&0===n||t>=i||n>=i||t+n>=i?e:0===n?e.slice(0,t)+r:e.slice(0,t)+r+e.slice(i-n)}},655:(e,t,n)=>{"use strict";n.d(t,{ZT:()=>i,pi:()=>o,_T:()=>a,XA:()=>s,CR:()=>l,fl:()=>u});var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function i(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var o=function(){return(o=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}).apply(this,arguments)};function a(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 s(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 l(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function u(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(l(arguments[t]));return e}}},t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},("undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"label-studio@1.1.0-frontend"},(()=>{"use strict";var e={};n.r(e),n.d(e,{Express:()=>fn,Mongo:()=>bn,Mysql:()=>vn,Postgres:()=>mn});var t={};function r(){return(r=Object.assign||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}).apply(this,arguments)}function i(e){return"/"===e.charAt(0)}function o(e,t){for(var n=t,r=n+1,i=e.length;r<i;n+=1,r+=1)e[n]=e[r];e.pop()}n.r(t),n.d(t,{json:()=>Is,matchPattern:()=>Rs,regexp:()=>Fs,required:()=>Ds});const a=function(e,t){void 0===t&&(t="");var n,r=e&&e.split("/")||[],a=t&&t.split("/")||[],s=e&&i(e),l=t&&i(t),u=s||l;if(e&&i(e)?a=r:r.length&&(a.pop(),a=a.concat(r)),!a.length)return"/";if(a.length){var c=a[a.length-1];n="."===c||".."===c||""===c}else n=!1;for(var d=0,f=a.length;f>=0;f--){var p=a[f];"."===p?o(a,f):".."===p?(o(a,f),d++):d&&(o(a,f),d--)}if(!u)for(;d--;d)a.unshift("..");!u||""===a[0]||a[0]&&i(a[0])||a.unshift("");var h=a.join("/");return n&&"/"!==h.substr(-1)&&(h+="/"),h};var s="Invariant failed";const l=function(e,t){if(!e)throw new Error(s)};function u(e){return"/"===e.charAt(0)?e:"/"+e}function c(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function d(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function f(e){var t=e.pathname,n=e.search,r=e.hash,i=t||"/";return n&&"?"!==n&&(i+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(i+="#"===r.charAt(0)?r:"#"+r),i}function p(e,t,n,i){var o;"string"==typeof e?(o=function(e){var t=e||"/",n="",r="",i=t.indexOf("#");-1!==i&&(r=t.substr(i),t=t.substr(0,i));var o=t.indexOf("?");return-1!==o&&(n=t.substr(o),t=t.substr(0,o)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e)).state=t:(void 0===(o=r({},e)).pathname&&(o.pathname=""),o.search?"?"!==o.search.charAt(0)&&(o.search="?"+o.search):o.search="",o.hash?"#"!==o.hash.charAt(0)&&(o.hash="#"+o.hash):o.hash="",void 0!==t&&void 0===o.state&&(o.state=t));try{o.pathname=decodeURI(o.pathname)}catch(e){throw e instanceof URIError?new URIError('Pathname "'+o.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):e}return n&&(o.key=n),i?o.pathname?"/"!==o.pathname.charAt(0)&&(o.pathname=a(o.pathname,i.pathname)):o.pathname=i.pathname:o.pathname||(o.pathname="/"),o}function h(){var e=null;var t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,i){if(null!=e){var o="function"==typeof e?e(t,n):e;"string"==typeof o?"function"==typeof r?r(o,i):i(!0):i(!1!==o)}else i(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t.forEach((function(e){return e.apply(void 0,n)}))}}}var m=!("undefined"==typeof window||!window.document||!window.document.createElement);function v(e,t){t(window.confirm(e))}var g="popstate",y="hashchange";function b(){try{return window.history.state||{}}catch(e){return{}}}var w=n(7294),x=n(3935);function k(e,t){return(k=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function S(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,k(e,t)}var C=n(5697),_=n.n(C);function E(e){return e.valueOf?e.valueOf():Object.prototype.valueOf.call(e)}const T=function e(t,n){if(t===n)return!0;if(null==t||null==n)return!1;if(Array.isArray(t))return Array.isArray(n)&&t.length===n.length&&t.every((function(t,r){return e(t,n[r])}));if("object"==typeof t||"object"==typeof n){var r=E(t),i=E(n);return r!==t||i!==n?e(r,i):Object.keys(Object.assign({},t,n)).every((function(r){return e(t[r],n[r])}))}return!1};function j(e){var t=e.pathname,n=e.search,r=e.hash,i=t||"/";return n&&"?"!==n&&("?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&("#"===r.charAt(0)?r:"#"+r),i}function O(e,t,n,i){var o;"string"==typeof e?(o=function(e){var t=e||"/",n="",r="",i=t.indexOf("#");-1!==i&&(r=t.substr(i),t=t.substr(0,i));var o=t.indexOf("?");return-1!==o&&(n=t.substr(o),t=t.substr(0,o)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e)).state=t:(void 0===(o=r({},e)).pathname&&(o.pathname=""),o.search?"?"!==o.search.charAt(0)&&(o.search="?"+o.search):o.search="",o.hash?"#"!==o.hash.charAt(0)&&(o.hash="#"+o.hash):o.hash="",void 0!==t&&void 0===o.state&&(o.state=t));try{o.pathname=decodeURI(o.pathname)}catch(e){throw e instanceof URIError?new URIError('Pathname "'+o.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):e}return n&&(o.key=n),i?o.pathname?"/"!==o.pathname.charAt(0)&&(o.pathname=a(o.pathname,i.pathname)):o.pathname=i.pathname:o.pathname||(o.pathname="/"),o}function N(){var e=null;var t=[];return{setPrompt:function(t){return t,function(){e===t&&null}},confirmTransitionTo:function(t,n,r,i){if(null!=e){var o="function"==typeof e?e(t,n):e;"string"==typeof o?"function"==typeof r?r(o,i):i(!0):i(!1!==o)}else i(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){!1,t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t.forEach((function(e){return e.apply(void 0,n)}))}}}"undefined"==typeof window||!window.document||window.document.createElement;function M(e,t,n){return Math.min(Math.max(e,t),n)}function L(e){void 0===e&&{};var t=e,n=t.getUserConfirmation,i=t.initialEntries,o=void 0===i?["/"]:i,a=t.initialIndex,s=void 0===a?0:a,l=t.keyLength,u=void 0===l?6:l,c=N();function d(e){r(g,e),g.length=g.entries.length,c.notifyListeners(g.location,g.action)}function f(){return Math.random().toString(36).substr(2,u)}var p=M(s,0,o.length-1),h=o.map((function(e){return O(e,void 0,"string"==typeof e?f():e.key||f())})),m=j;function v(e){var t=M(g.index+e,0,g.entries.length-1),r=g.entries[t];c.confirmTransitionTo(r,"POP",n,(function(e){e?d({action:"POP",location:r,index:t}):d()}))}var g={length:h.length,action:"POP",location:h[p],index:p,entries:h,createHref:m,push:function(e,t){var r="PUSH",i=O(e,t,f(),g.location);c.confirmTransitionTo(i,r,n,(function(e){if(e){var t=g.index+1,n=g.entries.slice(0);n.length>t?n.splice(t,n.length-t,i):n.push(i),d({action:r,location:i,index:t,entries:n})}}))},replace:function(e,t){var r="REPLACE",i=O(e,t,f(),g.location);c.confirmTransitionTo(i,r,n,(function(e){e&&(g.entries[g.index]=i,d({action:r,location:i}))}))},go:v,goBack:function(){v(-1)},goForward:function(){v(1)},canGo:function(e){var t=g.index+e;return t>=0&&t<g.entries.length},block:function(e){return void 0===e&&!1,c.setPrompt(e)},listen:function(e){return c.appendListener(e)}};return g}var P=1073741823,A="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:{};function D(e){var t=[];return{on:function(e){t.push(e)},off:function(e){t=t.filter((function(t){return t!==e}))},get:function(){return e},set:function(n,r){e=n,t.forEach((function(t){return t(e,r)}))}}}const R=w.createContext||function(e,t){var n,r,i="__create-react-context-"+function(){var e="__global_unique_id__";return A[e]=(A[e]||0)+1}()+"__",o=function(e){function n(){var t;return(t=e.apply(this,arguments)||this).emitter=D(t.props.value),t}S(n,e);var r=n.prototype;return r.getChildContext=function(){var e;return(e={})[i]=this.emitter,e},r.componentWillReceiveProps=function(e){if(this.props.value!==e.value){var n,r=this.props.value,i=e.value;((o=r)===(a=i)?0!==o||1/o==1/a:o!=o&&a!=a)?n=0:(n="function"==typeof t?t(r,i):P,0!==(n|=0)&&this.emitter.set(e.value,n))}var o,a},r.render=function(){return this.props.children},n}(w.Component);o.childContextTypes=((n={})[i]=_().object.isRequired,n);var a=function(t){function n(){var e;return(e=t.apply(this,arguments)||this).state={value:e.getValue()},e.onUpdate=function(t,n){0!=((0|e.observedBits)&n)&&e.setState({value:e.getValue()})},e}S(n,t);var r=n.prototype;return r.componentWillReceiveProps=function(e){var t=e.observedBits;this.observedBits=null==t?P:t},r.componentDidMount=function(){this.context[i]&&this.context[i].on(this.onUpdate);var e=this.props.observedBits;this.observedBits=null==e?P:e},r.componentWillUnmount=function(){this.context[i]&&this.context[i].off(this.onUpdate)},r.getValue=function(){return this.context[i]?this.context[i].get():e},r.render=function(){return(e=this.props.children,Array.isArray(e)?e[0]:e)(this.state.value);var e},n}(w.Component);return a.contextTypes=((r={})[i]=_().object,r),{Provider:o,Consumer:a}};var I=n(4779),F=n.n(I);n(9864);function z(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}var H=n(8679),U=n.n(H),B=function(e){var t=R();return t.displayName=e,t}("Router-History"),W=function(e){var t=R();return t.displayName=e,t}("Router"),$=function(e){function t(t){var n;return(n=e.call(this,t)||this).state={location:t.history.location},n._isMounted=!1,n._pendingLocation=null,t.staticContext||(n.unlisten=t.history.listen((function(e){n._isMounted?n.setState({location:e}):n._pendingLocation=e}))),n}S(t,e),t.computeRootMatch=function(e){return{path:"/",url:"/",params:{},isExact:"/"===e}};var n=t.prototype;return n.componentDidMount=function(){this._isMounted=!0,this._pendingLocation&&this.setState({location:this._pendingLocation})},n.componentWillUnmount=function(){this.unlisten&&this.unlisten()},n.render=function(){return w.createElement(W.Provider,{value:{history:this.props.history,location:this.state.location,match:t.computeRootMatch(this.state.location.pathname),staticContext:this.props.staticContext}},w.createElement(B.Provider,{children:this.props.children||null,value:this.props.history}))},t}(w.Component);w.Component;var V=function(e){function t(){return e.apply(this,arguments)||this}S(t,e);var n=t.prototype;return n.componentDidMount=function(){this.props.onMount&&this.props.onMount.call(this,this)},n.componentDidUpdate=function(e){this.props.onUpdate&&this.props.onUpdate.call(this,this,e)},n.componentWillUnmount=function(){this.props.onUnmount&&this.props.onUnmount.call(this,this)},n.render=function(){return null},t}(w.Component);var q={},G=0;function Y(e,t){return void 0===e&&(e="/"),void 0===t&&(t={}),"/"===e?e:function(e){if(q[e])return q[e];var t=F().compile(e);return G<1e4&&(q[e]=t,G++),t}(e)(t,{pretty:!0})}function X(e){var t=e.computedMatch,n=e.to,i=e.push,o=void 0!==i&&i;return w.createElement(W.Consumer,null,(function(e){e||l(!1);var i=e.history,a=e.staticContext,s=o?i.push:i.replace,u=O(t?"string"==typeof n?Y(n,t.params):r({},n,{pathname:Y(n.pathname,t.params)}):n);return a?(s(u),null):w.createElement(V,{onMount:function(){s(u)},onUpdate:function(e,t){var n,i,o=O(t.to);n=o,i=r({},u,{key:o.key}),n.pathname===i.pathname&&n.search===i.search&&n.hash===i.hash&&n.key===i.key&&T(n.state,i.state)||s(u)},to:n})}))}var K={},Q=0;function J(e,t){void 0===t&&(t={}),("string"==typeof t||Array.isArray(t))&&(t={path:t});var n=t,r=n.path,i=n.exact,o=void 0!==i&&i,a=n.strict,s=void 0!==a&&a,l=n.sensitive,u=void 0!==l&&l;return[].concat(r).reduce((function(t,n){if(!n&&""!==n)return null;if(t)return t;var r=function(e,t){var n=""+t.end+t.strict+t.sensitive,r=K[n]||(K[n]={});if(r[e])return r[e];var i=[],o={regexp:F()(e,i,t),keys:i};return Q<1e4&&(r[e]=o,Q++),o}(n,{end:o,strict:s,sensitive:u}),i=r.regexp,a=r.keys,l=i.exec(e);if(!l)return null;var c=l[0],d=l.slice(1),f=e===c;return o&&!f?null:{path:n,url:"/"===n&&""===c?"/":c,isExact:f,params:a.reduce((function(e,t,n){return e[t.name]=d[n],e}),{})}}),null)}var Z=function(e){function t(){return e.apply(this,arguments)||this}return S(t,e),t.prototype.render=function(){var e=this;return w.createElement(W.Consumer,null,(function(t){t||l(!1);var n=e.props.location||t.location,i=r({},t,{location:n,match:e.props.computedMatch?e.props.computedMatch:e.props.path?J(n.pathname,e.props):t.match}),o=e.props,a=o.children,s=o.component,u=o.render;return Array.isArray(a)&&0===a.length&&(a=null),w.createElement(W.Provider,{value:i},i.match?a?"function"==typeof a?a(i):a:s?w.createElement(s,i):u?u(i):null:"function"==typeof a?a(i):null)}))},t}(w.Component);function ee(e){return"/"===e.charAt(0)?e:"/"+e}function te(e,t){if(!e)return t;var n=ee(e);return 0!==t.pathname.indexOf(n)?t:r({},t,{pathname:t.pathname.substr(n.length)})}function ne(e){return"string"==typeof e?e:j(e)}function re(e){return function(){l(!1)}}function ie(){}w.Component;var oe=function(e){function t(){return e.apply(this,arguments)||this}return S(t,e),t.prototype.render=function(){var e=this;return w.createElement(W.Consumer,null,(function(t){t||l(!1);var n,i,o=e.props.location||t.location;return w.Children.forEach(e.props.children,(function(e){if(null==i&&w.isValidElement(e)){n=e;var a=e.props.path||e.props.from;i=a?J(o.pathname,r({},e.props,{path:a})):t.match}})),i?w.cloneElement(n,{location:o,computedMatch:i}):null}))},t}(w.Component);var ae=w.useContext;function se(){return ae(B)}function le(){return ae(W).location}var ue=n(2162),ce=n(2343);var de,fe=n(655),pe=n(6769),he=n(2844),me=n(7321),ve=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],ge=function(){function e(t){void 0===t&&(t={}),this._options=t,this.name=e.id}return e.prototype.setupOnce=function(){(0,pe.c)((function(t){var n=(0,ue.Gd)();if(!n)return t;var r=n.getIntegration(e);if(r){var i=n.getClient(),o=i?i.getOptions():{},a="function"==typeof r._mergeOptions?r._mergeOptions(o):{};return"function"!=typeof r._shouldDropEvent?t:r._shouldDropEvent(t,a)?null:t}return t}))},e.prototype._shouldDropEvent=function(e,t){return this._isSentryError(e,t)?(ce.k.warn("Event dropped due to being internal Sentry Error.\nEvent: "+(0,he.jH)(e)),!0):this._isIgnoredError(e,t)?(ce.k.warn("Event dropped due to being matched by `ignoreErrors` option.\nEvent: "+(0,he.jH)(e)),!0):this._isDeniedUrl(e,t)?(ce.k.warn("Event dropped due to being matched by `denyUrls` option.\nEvent: "+(0,he.jH)(e)+".\nUrl: "+this._getEventFilterUrl(e)),!0):!this._isAllowedUrl(e,t)&&(ce.k.warn("Event dropped due to not being matched by `allowUrls` option.\nEvent: "+(0,he.jH)(e)+".\nUrl: "+this._getEventFilterUrl(e)),!0)},e.prototype._isSentryError=function(e,t){if(!t.ignoreInternal)return!1;try{return e&&e.exception&&e.exception.values&&e.exception.values[0]&&"SentryError"===e.exception.values[0].type||!1}catch(e){return!1}},e.prototype._isIgnoredError=function(e,t){return!(!t.ignoreErrors||!t.ignoreErrors.length)&&this._getPossibleEventMessages(e).some((function(e){return t.ignoreErrors.some((function(t){return(0,me.zC)(e,t)}))}))},e.prototype._isDeniedUrl=function(e,t){if(!t.denyUrls||!t.denyUrls.length)return!1;var n=this._getEventFilterUrl(e);return!!n&&t.denyUrls.some((function(e){return(0,me.zC)(n,e)}))},e.prototype._isAllowedUrl=function(e,t){if(!t.allowUrls||!t.allowUrls.length)return!0;var n=this._getEventFilterUrl(e);return!n||t.allowUrls.some((function(e){return(0,me.zC)(n,e)}))},e.prototype._mergeOptions=function(e){return void 0===e&&(e={}),{allowUrls:(0,fe.fl)(this._options.whitelistUrls||[],this._options.allowUrls||[],e.whitelistUrls||[],e.allowUrls||[]),denyUrls:(0,fe.fl)(this._options.blacklistUrls||[],this._options.denyUrls||[],e.blacklistUrls||[],e.denyUrls||[]),ignoreErrors:(0,fe.fl)(this._options.ignoreErrors||[],e.ignoreErrors||[],ve),ignoreInternal:void 0===this._options.ignoreInternal||this._options.ignoreInternal}},e.prototype._getPossibleEventMessages=function(e){if(e.message)return[e.message];if(e.exception)try{var t=e.exception.values&&e.exception.values[0]||{},n=t.type,r=void 0===n?"":n,i=t.value,o=void 0===i?"":i;return[""+o,r+": "+o]}catch(t){return ce.k.error("Cannot extract message for event "+(0,he.jH)(e)),[]}return[]},e.prototype._getEventFilterUrl=function(e){try{if(e.stacktrace){var t=e.stacktrace.frames;return t&&t[t.length-1].filename||null}if(e.exception){var n=e.exception.values&&e.exception.values[0].stacktrace&&e.exception.values[0].stacktrace.frames;return n&&n[n.length-1].filename||null}return null}catch(t){return ce.k.error("Cannot extract url for event "+(0,he.jH)(e)),null}},e.id="InboundFilters",e}(),ye=function(){function e(){this.name=e.id}return e.prototype.setupOnce=function(){de=Function.prototype.toString,Function.prototype.toString=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this.__sentry_original__||this;return de.apply(n,e)}},e.id="FunctionToString",e}(),be=n(9732),we="6.8.0",xe=n(7199),ke=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){return e.__proto__=t,e}:function(e,t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n]);return e});var Se=function(e){function t(t){var n=this.constructor,r=e.call(this,t)||this;return r.message=t,r.name=n.prototype.constructor.name,ke(r,n.prototype),r}return(0,fe.ZT)(t,e),t}(Error),Ce=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+))?@)([\w.-]+)(?::(\d+))?\/(.+)/,_e="Invalid Dsn",Ee=function(){function e(e){"string"==typeof e?this._fromString(e):this._fromComponents(e),this._validate()}return e.prototype.toString=function(e){void 0===e&&(e=!1);var t=this,n=t.host,r=t.path,i=t.pass,o=t.port,a=t.projectId;return t.protocol+"://"+t.publicKey+(e&&i?":"+i:"")+"@"+n+(o?":"+o:"")+"/"+(r?r+"/":r)+a},e.prototype._fromString=function(e){var t=Ce.exec(e);if(!t)throw new Se(_e);var n=(0,fe.CR)(t.slice(1),6),r=n[0],i=n[1],o=n[2],a=void 0===o?"":o,s=n[3],l=n[4],u=void 0===l?"":l,c="",d=n[5],f=d.split("/");if(f.length>1&&(c=f.slice(0,-1).join("/"),d=f.pop()),d){var p=d.match(/^\d+/);p&&(d=p[0])}this._fromComponents({host:s,pass:a,path:c,projectId:d,port:u,protocol:r,publicKey:i})},e.prototype._fromComponents=function(e){"user"in e&&!("publicKey"in e)&&(e.publicKey=e.user),this.user=e.publicKey||"",this.protocol=e.protocol,this.publicKey=e.publicKey||"",this.pass=e.pass||"",this.host=e.host,this.port=e.port||"",this.path=e.path||"",this.projectId=e.projectId},e.prototype._validate=function(){var e=this;if(["protocol","publicKey","host","projectId"].forEach((function(t){if(!e[t])throw new Se("Invalid Dsn: "+t+" missing")})),!this.projectId.match(/^\d+$/))throw new Se("Invalid Dsn: Invalid projectId "+this.projectId);if("http"!==this.protocol&&"https"!==this.protocol)throw new Se("Invalid Dsn: Invalid protocol "+this.protocol);if(this.port&&isNaN(parseInt(this.port,10)))throw new Se("Invalid Dsn: Invalid port "+this.port)},e}(),Te=n(7597),je=n(6893),Oe=n(1170),Ne=n(2470),Me=[];function Le(e){return e.reduce((function(e,t){return e.every((function(e){return t.name!==e.name}))&&e.push(t),e}),[])}function Pe(e){var t={};return function(e){var t=e.defaultIntegrations&&(0,fe.fl)(e.defaultIntegrations)||[],n=e.integrations,r=(0,fe.fl)(Le(t));Array.isArray(n)?r=(0,fe.fl)(r.filter((function(e){return n.every((function(t){return t.name!==e.name}))})),Le(n)):"function"==typeof n&&(r=n(r),r=Array.isArray(r)?r:[r]);var i=r.map((function(e){return e.name})),o="Debug";return-1!==i.indexOf(o)&&r.push.apply(r,(0,fe.fl)(r.splice(i.indexOf(o),1))),r}(e).forEach((function(e){t[e.name]=e,function(e){-1===Me.indexOf(e.name)&&(e.setupOnce(pe.c,ue.Gd),Me.push(e.name),ce.k.log("Integration installed: "+e.name))}(e)})),t}var Ae,De=function(){function e(e,t){this._integrations={},this._processing=0,this._backend=new e(t),this._options=t,t.dsn&&(this._dsn=new Ee(t.dsn))}return e.prototype.captureException=function(e,t,n){var r=this,i=t&&t.event_id;return this._process(this._getBackend().eventFromException(e,t).then((function(e){return r._captureEvent(e,t,n)})).then((function(e){i=e}))),i},e.prototype.captureMessage=function(e,t,n,r){var i=this,o=n&&n.event_id,a=(0,Te.pt)(e)?this._getBackend().eventFromMessage(String(e),t,n):this._getBackend().eventFromException(e,n);return this._process(a.then((function(e){return i._captureEvent(e,n,r)})).then((function(e){o=e}))),o},e.prototype.captureEvent=function(e,t,n){var r=t&&t.event_id;return this._process(this._captureEvent(e,t,n).then((function(e){r=e}))),r},e.prototype.captureSession=function(e){this._isEnabled()?"string"!=typeof e.release?ce.k.warn("Discarded session because of missing or non-string release"):(this._sendSession(e),e.update({init:!1})):ce.k.warn("SDK not enabled, will not capture session.")},e.prototype.getDsn=function(){return this._dsn},e.prototype.getOptions=function(){return this._options},e.prototype.flush=function(e){var t=this;return this._isClientProcessing(e).then((function(n){return t._getBackend().getTransport().close(e).then((function(e){return n&&e}))}))},e.prototype.close=function(e){var t=this;return this.flush(e).then((function(e){return t.getOptions().enabled=!1,e}))},e.prototype.setupIntegrations=function(){this._isEnabled()&&(this._integrations=Pe(this._options))},e.prototype.getIntegration=function(e){try{return this._integrations[e.id]||null}catch(t){return ce.k.warn("Cannot retrieve integration "+e.id+" from the current Client"),null}},e.prototype._updateSessionFromEvent=function(e,t){var n,r,i=!1,o=!1,a=t.exception&&t.exception.values;if(a){o=!0;try{for(var s=(0,fe.XA)(a),l=s.next();!l.done;l=s.next()){var u=l.value.mechanism;if(u&&!1===u.handled){i=!0;break}}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}}var c=e.status===xe.$.Ok;(c&&0===e.errors||c&&i)&&(e.update((0,fe.pi)((0,fe.pi)({},i&&{status:xe.$.Crashed}),{errors:e.errors||Number(o||i)})),this.captureSession(e))},e.prototype._sendSession=function(e){this._getBackend().sendSession(e)},e.prototype._isClientProcessing=function(e){var t=this;return new je.c((function(n){var r=0,i=setInterval((function(){0==t._processing?(clearInterval(i),n(!0)):(r+=1,e&&r>=e&&(clearInterval(i),n(!1)))}),1)}))},e.prototype._getBackend=function(){return this._backend},e.prototype._isEnabled=function(){return!1!==this.getOptions().enabled&&void 0!==this._dsn},e.prototype._prepareEvent=function(e,t,n){var r=this,i=this.getOptions().normalizeDepth,o=void 0===i?3:i,a=(0,fe.pi)((0,fe.pi)({},e),{event_id:e.event_id||(n&&n.event_id?n.event_id:(0,he.DM)()),timestamp:e.timestamp||(0,Oe.yW)()});this._applyClientOptions(a),this._applyIntegrationsMetadata(a);var s=t;n&&n.captureContext&&(s=pe.s.clone(s).update(n.captureContext));var l=je.c.resolve(a);return s&&(l=s.applyToEvent(a,n)),l.then((function(e){return"number"==typeof o&&o>0?r._normalizeEvent(e,o):e}))},e.prototype._normalizeEvent=function(e,t){if(!e)return null;var n=(0,fe.pi)((0,fe.pi)((0,fe.pi)((0,fe.pi)((0,fe.pi)({},e),e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map((function(e){return(0,fe.pi)((0,fe.pi)({},e),e.data&&{data:(0,Ne.Fv)(e.data,t)})}))}),e.user&&{user:(0,Ne.Fv)(e.user,t)}),e.contexts&&{contexts:(0,Ne.Fv)(e.contexts,t)}),e.extra&&{extra:(0,Ne.Fv)(e.extra,t)});return e.contexts&&e.contexts.trace&&(n.contexts.trace=e.contexts.trace),n},e.prototype._applyClientOptions=function(e){var t=this.getOptions(),n=t.environment,r=t.release,i=t.dist,o=t.maxValueLength,a=void 0===o?250:o;"environment"in e||(e.environment="environment"in t?n:"production"),void 0===e.release&&void 0!==r&&(e.release=r),void 0===e.dist&&void 0!==i&&(e.dist=i),e.message&&(e.message=(0,me.$G)(e.message,a));var s=e.exception&&e.exception.values&&e.exception.values[0];s&&s.value&&(s.value=(0,me.$G)(s.value,a));var l=e.request;l&&l.url&&(l.url=(0,me.$G)(l.url,a))},e.prototype._applyIntegrationsMetadata=function(e){var t=Object.keys(this._integrations);t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=(0,fe.fl)(e.sdk.integrations||[],t))},e.prototype._sendEvent=function(e){this._getBackend().sendEvent(e)},e.prototype._captureEvent=function(e,t,n){return this._processEvent(e,t,n).then((function(e){return e.event_id}),(function(e){ce.k.error(e)}))},e.prototype._processEvent=function(e,t,n){var r=this,i=this.getOptions(),o=i.beforeSend,a=i.sampleRate;if(!this._isEnabled())return je.c.reject(new Se("SDK not enabled, will not capture event."));var s="transaction"===e.type;return!s&&"number"==typeof a&&Math.random()>a?je.c.reject(new Se("Discarding event because it's not included in the random sample (sampling rate = "+a+")")):this._prepareEvent(e,n,t).then((function(e){if(null===e)throw new Se("An event processor returned null, will not send event.");if(t&&t.data&&!0===t.data.__sentry__||s||!o)return e;var n=o(e,t);return r._ensureBeforeSendRv(n)})).then((function(e){if(null===e)throw new Se("`beforeSend` returned `null`, will not send event.");var t=n&&n.getSession&&n.getSession();return!s&&t&&r._updateSessionFromEvent(t,e),r._sendEvent(e),e})).then(null,(function(e){if(e instanceof Se)throw e;throw r.captureException(e,{data:{__sentry__:!0},originalException:e}),new Se("Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: "+e)}))},e.prototype._process=function(e){var t=this;this._processing+=1,e.then((function(e){return t._processing-=1,e}),(function(e){return t._processing-=1,e}))},e.prototype._ensureBeforeSendRv=function(e){var t="`beforeSend` method has to return `null` or a valid event.";if((0,Te.J8)(e))return e.then((function(e){if(!(0,Te.PO)(e)&&null!==e)throw new Se(t);return e}),(function(e){throw new Se("beforeSend rejected with "+e)}));if(!(0,Te.PO)(e)&&null!==e)throw new Se(t);return e},e}();!function(e){e.Unknown="unknown",e.Skipped="skipped",e.Success="success",e.RateLimit="rate_limit",e.Invalid="invalid",e.Failed="failed"}(Ae||(Ae={})),function(e){e.fromHttpCode=function(t){return t>=200&&t<300?e.Success:429===t?e.RateLimit:t>=400&&t<500?e.Invalid:t>=500?e.Failed:e.Unknown}}(Ae||(Ae={}));var Re,Ie=function(){function e(){}return e.prototype.sendEvent=function(e){return je.c.resolve({reason:"NoopTransport: Event has been skipped because no Dsn is configured.",status:Ae.Skipped})},e.prototype.close=function(e){return je.c.resolve(!0)},e}(),Fe=function(){function e(e){this._options=e,this._options.dsn||ce.k.warn("No DSN provided, backend will not do anything."),this._transport=this._setupTransport()}return e.prototype.eventFromException=function(e,t){throw new Se("Backend has to implement `eventFromException` method")},e.prototype.eventFromMessage=function(e,t,n){throw new Se("Backend has to implement `eventFromMessage` method")},e.prototype.sendEvent=function(e){this._transport.sendEvent(e).then(null,(function(e){ce.k.error("Error while sending event: "+e)}))},e.prototype.sendSession=function(e){this._transport.sendSession?this._transport.sendSession(e).then(null,(function(e){ce.k.error("Error while sending session: "+e)})):ce.k.warn("Dropping session because custom transport doesn't implement sendSession")},e.prototype.getTransport=function(){return this._transport},e.prototype._setupTransport=function(){return new Ie},e}();!function(e){e.Fatal="fatal",e.Error="error",e.Warning="warning",e.Log="log",e.Info="info",e.Debug="debug",e.Critical="critical"}(Re||(Re={})),function(e){e.fromString=function(t){switch(t){case"debug":return e.Debug;case"info":return e.Info;case"warn":case"warning":return e.Warning;case"error":return e.Error;case"fatal":return e.Fatal;case"critical":return e.Critical;case"log":default:return e.Log}}}(Re||(Re={}));var ze=n(8823),He="?",Ue=/^\s*at (?:(.*?) ?\()?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Be=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|capacitor).*?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,We=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,$e=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Ve=/\((\S*)(?::(\d+))(?::(\d+))\)/,qe=/Minified React error #\d+;/i;function Ge(e){var t=null,n=0;e&&("number"==typeof e.framesToPop?n=e.framesToPop:qe.test(e.message)&&(n=1));try{if(t=function(e){if(!e||!e.stacktrace)return null;for(var t,n=e.stacktrace,r=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,i=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\((.*)\))? in (.*):\s*$/i,o=n.split("\n"),a=[],s=0;s<o.length;s+=2){var l=null;(t=r.exec(o[s]))?l={url:t[2],func:t[3],args:[],line:+t[1],column:null}:(t=i.exec(o[s]))&&(l={url:t[6],func:t[3]||t[4],args:t[5]?t[5].split(","):[],line:+t[1],column:+t[2]}),l&&(!l.func&&l.line&&(l.func=He),a.push(l))}if(!a.length)return null;return{message:Xe(e),name:e.name,stack:a}}(e))return Ye(t,n)}catch(e){}try{if(t=function(e){if(!e||!e.stack)return null;for(var t,n,r,i=[],o=e.stack.split("\n"),a=0;a<o.length;++a){if(n=Ue.exec(o[a])){var s=n[2]&&0===n[2].indexOf("native");n[2]&&0===n[2].indexOf("eval")&&(t=Ve.exec(n[2]))&&(n[2]=t[1],n[3]=t[2],n[4]=t[3]);var l=n[2]&&0===n[2].indexOf("address at ")?n[2].substr("address at ".length):n[2],u=n[1]||He,c=-1!==u.indexOf("safari-extension"),d=-1!==u.indexOf("safari-web-extension");(c||d)&&(u=-1!==u.indexOf("@")?u.split("@")[0]:He,l=c?"safari-extension:"+l:"safari-web-extension:"+l),r={url:l,func:u,args:s?[n[2]]:[],line:n[3]?+n[3]:null,column:n[4]?+n[4]:null}}else if(n=We.exec(o[a]))r={url:n[2],func:n[1]||He,args:[],line:+n[3],column:n[4]?+n[4]:null};else{if(!(n=Be.exec(o[a])))continue;n[3]&&n[3].indexOf(" > eval")>-1&&(t=$e.exec(n[3]))?(n[1]=n[1]||"eval",n[3]=t[1],n[4]=t[2],n[5]=""):0!==a||n[5]||void 0===e.columnNumber||(i[0].column=e.columnNumber+1),r={url:n[3],func:n[1]||He,args:n[2]?n[2].split(","):[],line:n[4]?+n[4]:null,column:n[5]?+n[5]:null}}!r.func&&r.line&&(r.func=He),i.push(r)}if(!i.length)return null;return{message:Xe(e),name:e.name,stack:i}}(e))return Ye(t,n)}catch(e){}return{message:Xe(e),name:e&&e.name,stack:[],failed:!0}}function Ye(e,t){try{return(0,fe.pi)((0,fe.pi)({},e),{stack:e.stack.slice(t)})}catch(t){return e}}function Xe(e){var t=e&&e.message;return t?t.error&&"string"==typeof t.error.message?t.error.message:t:"No error message"}function Ke(e){var t=Je(e.stack),n={type:e.name,value:e.message};return t&&t.length&&(n.stacktrace={frames:t}),void 0===n.type&&""===n.value&&(n.value="Unrecoverable error caught"),n}function Qe(e){return{exception:{values:[Ke(e)]}}}function Je(e){if(!e||!e.length)return[];var t=e,n=t[0].func||"",r=t[t.length-1].func||"";return-1===n.indexOf("captureMessage")&&-1===n.indexOf("captureException")||(t=t.slice(1)),-1!==r.indexOf("sentryWrapped")&&(t=t.slice(0,-1)),t.slice(0,50).map((function(e){return{colno:null===e.column?void 0:e.column,filename:e.url||t[0].url,function:e.func||"?",in_app:!0,lineno:null===e.line?void 0:e.line}})).reverse()}function Ze(e,t,n){var r;if(void 0===n&&(n={}),(0,Te.VW)(e)&&e.error)return r=Qe(Ge(e=e.error));if((0,Te.TX)(e)||(0,Te.fm)(e)){var i=e,o=i.name||((0,Te.TX)(i)?"DOMError":"DOMException"),a=i.message?o+": "+i.message:o;return r=et(a,t,n),(0,he.Db)(r,a),"code"in i&&(r.tags=(0,fe.pi)((0,fe.pi)({},r.tags),{"DOMException.code":""+i.code})),r}return(0,Te.VZ)(e)?r=Qe(Ge(e)):(0,Te.PO)(e)||(0,Te.cO)(e)?(r=function(e,t,n){var r={exception:{values:[{type:(0,Te.cO)(e)?e.constructor.name:n?"UnhandledRejection":"Error",value:"Non-Error "+(n?"promise rejection":"exception")+" captured with keys: "+(0,Ne.zf)(e)}]},extra:{__serialized__:(0,Ne.Qy)(e)}};if(t){var i=Je(Ge(t).stack);r.stacktrace={frames:i}}return r}(e,t,n.rejection),(0,he.EG)(r,{synthetic:!0}),r):(r=et(e,t,n),(0,he.Db)(r,""+e,void 0),(0,he.EG)(r,{synthetic:!0}),r)}function et(e,t,n){void 0===n&&(n={});var r={message:e};if(n.attachStacktrace&&t){var i=Je(Ge(t).stack);r.stacktrace={frames:i}}return r}function tt(e){if(e.metadata&&e.metadata.sdk){var t=e.metadata.sdk;return{name:t.name,version:t.version}}}function nt(e,t){return t?(e.sdk=e.sdk||{},e.sdk.name=e.sdk.name||t.name,e.sdk.version=e.sdk.version||t.version,e.sdk.integrations=(0,fe.fl)(e.sdk.integrations||[],t.integrations||[]),e.sdk.packages=(0,fe.fl)(e.sdk.packages||[],t.packages||[]),e):e}function rt(e,t){var n=tt(t),r="aggregates"in e?"sessions":"session";return{body:JSON.stringify((0,fe.pi)((0,fe.pi)({sent_at:(new Date).toISOString()},n&&{sdk:n}),t.forceEnvelope()&&{dsn:t.getDsn().toString()}))+"\n"+JSON.stringify({type:r})+"\n"+JSON.stringify(e),type:r,url:t.getEnvelopeEndpointWithUrlEncodedAuth()}}function it(e,t){var n=tt(t),r=e.type||"event",i="transaction"===r||t.forceEnvelope(),o=e.debug_meta||{},a=o.transactionSampling,s=(0,fe._T)(o,["transactionSampling"]),l=a||{},u=l.method,c=l.rate;0===Object.keys(s).length?delete e.debug_meta:e.debug_meta=s;var d={body:JSON.stringify(n?nt(e,t.metadata.sdk):e),type:r,url:i?t.getEnvelopeEndpointWithUrlEncodedAuth():t.getStoreEndpointWithUrlEncodedAuth()};if(i){var f=JSON.stringify((0,fe.pi)((0,fe.pi)({event_id:e.event_id,sent_at:(new Date).toISOString()},n&&{sdk:n}),t.forceEnvelope()&&{dsn:t.getDsn().toString()}))+"\n"+JSON.stringify({type:r,sample_rates:[{id:u,rate:c}]})+"\n"+d.body;d.body=f}return d}var ot=function(){function e(e,t,n){void 0===t&&(t={}),this.dsn=e,this._dsnObject=new Ee(e),this.metadata=t,this._tunnel=n}return e.prototype.getDsn=function(){return this._dsnObject},e.prototype.forceEnvelope=function(){return!!this._tunnel},e.prototype.getBaseApiEndpoint=function(){var e=this.getDsn(),t=e.protocol?e.protocol+":":"",n=e.port?":"+e.port:"";return t+"//"+e.host+n+(e.path?"/"+e.path:"")+"/api/"},e.prototype.getStoreEndpoint=function(){return this._getIngestEndpoint("store")},e.prototype.getStoreEndpointWithUrlEncodedAuth=function(){return this.getStoreEndpoint()+"?"+this._encodedAuth()},e.prototype.getEnvelopeEndpointWithUrlEncodedAuth=function(){return this.forceEnvelope()?this._tunnel:this._getEnvelopeEndpoint()+"?"+this._encodedAuth()},e.prototype.getStoreEndpointPath=function(){var e=this.getDsn();return(e.path?"/"+e.path:"")+"/api/"+e.projectId+"/store/"},e.prototype.getRequestHeaders=function(e,t){var n=this.getDsn(),r=["Sentry sentry_version=7"];return r.push("sentry_client="+e+"/"+t),r.push("sentry_key="+n.publicKey),n.pass&&r.push("sentry_secret="+n.pass),{"Content-Type":"application/json","X-Sentry-Auth":r.join(", ")}},e.prototype.getReportDialogEndpoint=function(e){void 0===e&&(e={});var t=this.getDsn(),n=this.getBaseApiEndpoint()+"embed/error-page/",r=[];for(var i in r.push("dsn="+t.toString()),e)if("dsn"!==i)if("user"===i){if(!e.user)continue;e.user.name&&r.push("name="+encodeURIComponent(e.user.name)),e.user.email&&r.push("email="+encodeURIComponent(e.user.email))}else r.push(encodeURIComponent(i)+"="+encodeURIComponent(e[i]));return r.length?n+"?"+r.join("&"):n},e.prototype._getEnvelopeEndpoint=function(){return this._getIngestEndpoint("envelope")},e.prototype._getIngestEndpoint=function(e){return this._tunnel?this._tunnel:""+this.getBaseApiEndpoint()+this.getDsn().projectId+"/"+e+"/"},e.prototype._encodedAuth=function(){var e={sentry_key:this.getDsn().publicKey,sentry_version:"7"};return(0,Ne._j)(e)},e}(),at=function(){function e(e){this._limit=e,this._buffer=[]}return e.prototype.isReady=function(){return void 0===this._limit||this.length()<this._limit},e.prototype.add=function(e){var t=this;if(!this.isReady())return je.c.reject(new Se("Not adding Promise due to buffer limit reached."));var n=e();return-1===this._buffer.indexOf(n)&&this._buffer.push(n),n.then((function(){return t.remove(n)})).then(null,(function(){return t.remove(n).then(null,(function(){}))})),n},e.prototype.remove=function(e){return this._buffer.splice(this._buffer.indexOf(e),1)[0]},e.prototype.length=function(){return this._buffer.length},e.prototype.drain=function(e){var t=this;return new je.c((function(n){var r=setTimeout((function(){e&&e>0&&n(!1)}),e);je.c.all(t._buffer).then((function(){clearTimeout(r),n(!0)})).then(null,(function(){n(!0)}))}))},e}(),st={event:"error",transaction:"transaction",session:"session",attachment:"attachment"},lt=function(){function e(e){this.options=e,this._buffer=new at(30),this._rateLimits={},this._api=new ot(e.dsn,e._metadata,e.tunnel),this.url=this._api.getStoreEndpointWithUrlEncodedAuth()}return e.prototype.sendEvent=function(e){throw new Se("Transport Class has to implement `sendEvent` method")},e.prototype.close=function(e){return this._buffer.drain(e)},e.prototype._handleResponse=function(e){var t=e.requestType,n=e.response,r=e.headers,i=e.resolve,o=e.reject,a=Ae.fromHttpCode(n.status);this._handleRateLimit(r)&&ce.k.warn("Too many "+t+" requests, backing off until: "+this._disabledUntil(t)),a!==Ae.Success?o(n):i({status:a})},e.prototype._disabledUntil=function(e){var t=st[e];return this._rateLimits[t]||this._rateLimits.all},e.prototype._isRateLimited=function(e){return this._disabledUntil(e)>new Date(Date.now())},e.prototype._handleRateLimit=function(e){var t,n,r,i,o=Date.now(),a=e["x-sentry-rate-limits"],s=e["retry-after"];if(a){try{for(var l=(0,fe.XA)(a.trim().split(",")),u=l.next();!u.done;u=l.next()){var c=u.value.split(":",2),d=parseInt(c[0],10),f=1e3*(isNaN(d)?60:d);try{for(var p=(r=void 0,(0,fe.XA)(c[1].split(";"))),h=p.next();!h.done;h=p.next()){var m=h.value;this._rateLimits[m||"all"]=new Date(o+f)}}catch(e){r={error:e}}finally{try{h&&!h.done&&(i=p.return)&&i.call(p)}finally{if(r)throw r.error}}}}catch(e){t={error:e}}finally{try{u&&!u.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}return!0}return!!s&&(this._rateLimits.all=new Date(o+(0,he.JY)(o,s)),!0)},e}();var ut=function(e){function t(t,n){void 0===n&&(n=function(){var e,t,n=(0,he.Rf)();if((0,ze.Du)(n.fetch))return n.fetch.bind(n);var r=n.document,i=n.fetch;if("function"==typeof(null===(e=r)||void 0===e?void 0:e.createElement))try{var o=r.createElement("iframe");o.hidden=!0,r.head.appendChild(o),(null===(t=o.contentWindow)||void 0===t?void 0:t.fetch)&&(i=o.contentWindow.fetch),r.head.removeChild(o)}catch(e){ce.k.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return i.bind(n)}());var r=e.call(this,t)||this;return r._fetch=n,r}return(0,fe.ZT)(t,e),t.prototype.sendEvent=function(e){return this._sendRequest(it(e,this._api),e)},t.prototype.sendSession=function(e){return this._sendRequest(rt(e,this._api),e)},t.prototype._sendRequest=function(e,t){var n=this;if(this._isRateLimited(e.type))return Promise.reject({event:t,type:e.type,reason:"Transport for "+e.type+" requests locked till "+this._disabledUntil(e.type)+" due to too many requests.",status:429});var r={body:e.body,method:"POST",referrerPolicy:(0,ze.hv)()?"origin":""};return void 0!==this.options.fetchParameters&&Object.assign(r,this.options.fetchParameters),void 0!==this.options.headers&&(r.headers=this.options.headers),this._buffer.add((function(){return new je.c((function(t,i){n._fetch(e.url,r).then((function(r){var o={"x-sentry-rate-limits":r.headers.get("X-Sentry-Rate-Limits"),"retry-after":r.headers.get("Retry-After")};n._handleResponse({requestType:e.type,response:r,headers:o,resolve:t,reject:i})})).catch(i)}))}))},t}(lt),ct=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,fe.ZT)(t,e),t.prototype.sendEvent=function(e){return this._sendRequest(it(e,this._api),e)},t.prototype.sendSession=function(e){return this._sendRequest(rt(e,this._api),e)},t.prototype._sendRequest=function(e,t){var n=this;return this._isRateLimited(e.type)?Promise.reject({event:t,type:e.type,reason:"Transport for "+e.type+" requests locked till "+this._disabledUntil(e.type)+" due to too many requests.",status:429}):this._buffer.add((function(){return new je.c((function(t,r){var i=new XMLHttpRequest;for(var o in i.onreadystatechange=function(){if(4===i.readyState){var o={"x-sentry-rate-limits":i.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":i.getResponseHeader("Retry-After")};n._handleResponse({requestType:e.type,response:i,headers:o,resolve:t,reject:r})}},i.open("POST",e.url),n.options.headers)n.options.headers.hasOwnProperty(o)&&i.setRequestHeader(o,n.options.headers[o]);i.send(e.body)}))}))},t}(lt),dt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,fe.ZT)(t,e),t.prototype.eventFromException=function(e,t){return function(e,t,n){var r=Ze(t,n&&n.syntheticException||void 0,{attachStacktrace:e.attachStacktrace});return(0,he.EG)(r,{handled:!0,type:"generic"}),r.level=Re.Error,n&&n.event_id&&(r.event_id=n.event_id),je.c.resolve(r)}(this._options,e,t)},t.prototype.eventFromMessage=function(e,t,n){return void 0===t&&(t=Re.Info),function(e,t,n,r){void 0===n&&(n=Re.Info);var i=et(t,r&&r.syntheticException||void 0,{attachStacktrace:e.attachStacktrace});return i.level=n,r&&r.event_id&&(i.event_id=r.event_id),je.c.resolve(i)}(this._options,e,t,n)},t.prototype._setupTransport=function(){if(!this._options.dsn)return e.prototype._setupTransport.call(this);var t=(0,fe.pi)((0,fe.pi)({},this._options.transportOptions),{dsn:this._options.dsn,tunnel:this._options.tunnel,_metadata:this._options._metadata});return this._options.transport?new this._options.transport(t):(0,ze.Ak)()?new ut(t):new ct(t)},t}(Fe);function ft(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=(0,ue.Gd)();if(r&&r[e])return r[e].apply(r,(0,fe.fl)(t));throw new Error("No hub defined or "+e+" was not found on the hub, please open a bug report.")}function pt(e,t){var n;try{throw new Error("Sentry syntheticException")}catch(e){n=e}return ft("captureException",e,{captureContext:t,originalException:e,syntheticException:n})}function ht(e){ft("withScope",e)}var mt=0;function vt(){return mt>0}function gt(){mt+=1,setTimeout((function(){mt-=1}))}function yt(e,t,n){if(void 0===t&&(t={}),"function"!=typeof e)return e;try{if(e.__sentry__)return e;if(e.__sentry_wrapped__)return e.__sentry_wrapped__}catch(t){return e}var r=function(){var r=Array.prototype.slice.call(arguments);try{n&&"function"==typeof n&&n.apply(this,arguments);var i=r.map((function(e){return yt(e,t)}));return e.handleEvent?e.handleEvent.apply(this,i):e.apply(this,i)}catch(e){throw gt(),ht((function(n){n.addEventProcessor((function(e){var n=(0,fe.pi)({},e);return t.mechanism&&((0,he.Db)(n,void 0,void 0),(0,he.EG)(n,t.mechanism)),n.extra=(0,fe.pi)((0,fe.pi)({},n.extra),{arguments:r}),n})),pt(e)})),e}};try{for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}catch(e){}e.prototype=e.prototype||{},r.prototype=e.prototype,Object.defineProperty(e,"__sentry_wrapped__",{enumerable:!1,value:r}),Object.defineProperties(r,{__sentry__:{enumerable:!1,value:!0},__sentry_original__:{enumerable:!1,value:e}});try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get:function(){return e.name}})}catch(e){}return r}function bt(e){if(void 0===e&&(e={}),e.eventId)if(e.dsn){var t=document.createElement("script");t.async=!0,t.src=new ot(e.dsn).getReportDialogEndpoint(e),e.onLoad&&(t.onload=e.onLoad),(document.head||document.body).appendChild(t)}else ce.k.error("Missing dsn option in showReportDialog call");else ce.k.error("Missing eventId option in showReportDialog call")}var wt=n(8464),xt=function(){function e(t){this.name=e.id,this._options=(0,fe.pi)({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},t)}return e.prototype.addSentryBreadcrumb=function(e){this._options.sentry&&(0,ue.Gd)().addBreadcrumb({category:"sentry."+("transaction"===e.type?"transaction":"event"),event_id:e.event_id,level:e.level,message:(0,he.jH)(e)},{event:e})},e.prototype.setupOnce=function(){var e=this;this._options.console&&(0,be.o)({callback:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];e._consoleBreadcrumb.apply(e,(0,fe.fl)(t))},type:"console"}),this._options.dom&&(0,be.o)({callback:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];e._domBreadcrumb.apply(e,(0,fe.fl)(t))},type:"dom"}),this._options.xhr&&(0,be.o)({callback:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];e._xhrBreadcrumb.apply(e,(0,fe.fl)(t))},type:"xhr"}),this._options.fetch&&(0,be.o)({callback:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];e._fetchBreadcrumb.apply(e,(0,fe.fl)(t))},type:"fetch"}),this._options.history&&(0,be.o)({callback:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];e._historyBreadcrumb.apply(e,(0,fe.fl)(t))},type:"history"})},e.prototype._consoleBreadcrumb=function(e){var t={category:"console",data:{arguments:e.args,logger:"console"},level:Re.fromString(e.level),message:(0,me.nK)(e.args," ")};if("assert"===e.level){if(!1!==e.args[0])return;t.message="Assertion failed: "+((0,me.nK)(e.args.slice(1)," ")||"console.assert"),t.data.arguments=e.args.slice(1)}(0,ue.Gd)().addBreadcrumb(t,{input:e.args,level:e.level})},e.prototype._domBreadcrumb=function(e){var t,n="object"==typeof this._options.dom?this._options.dom.serializeAttribute:void 0;"string"==typeof n&&(n=[n]);try{t=e.event.target?(0,wt.R)(e.event.target,n):(0,wt.R)(e.event,n)}catch(e){t="<unknown>"}0!==t.length&&(0,ue.Gd)().addBreadcrumb({category:"ui."+e.name,message:t},{event:e.event,name:e.name,global:e.global})},e.prototype._xhrBreadcrumb=function(e){if(e.endTimestamp){if(e.xhr.__sentry_own_request__)return;var t=e.xhr.__sentry_xhr__||{},n=t.method,r=t.url,i=t.status_code,o=t.body;(0,ue.Gd)().addBreadcrumb({category:"xhr",data:{method:n,url:r,status_code:i},type:"http"},{xhr:e.xhr,input:o})}else;},e.prototype._fetchBreadcrumb=function(e){e.endTimestamp&&(e.fetchData.url.match(/sentry_key/)&&"POST"===e.fetchData.method||(e.error?(0,ue.Gd)().addBreadcrumb({category:"fetch",data:e.fetchData,level:Re.Error,type:"http"},{data:e.error,input:e.args}):(0,ue.Gd)().addBreadcrumb({category:"fetch",data:(0,fe.pi)((0,fe.pi)({},e.fetchData),{status_code:e.response.status}),type:"http"},{input:e.args,response:e.response})))},e.prototype._historyBreadcrumb=function(e){var t=(0,he.Rf)(),n=e.from,r=e.to,i=(0,he.en)(t.location.href),o=(0,he.en)(n),a=(0,he.en)(r);o.path||(o=i),i.protocol===a.protocol&&i.host===a.host&&(r=a.relative),i.protocol===o.protocol&&i.host===o.host&&(n=o.relative),(0,ue.Gd)().addBreadcrumb({category:"navigation",data:{from:n,to:r}})},e.id="Breadcrumbs",e}(),kt=function(e){function t(t){void 0===t&&(t={});return t._metadata=t._metadata||{},t._metadata.sdk=t._metadata.sdk||{name:"sentry.javascript.browser",packages:[{name:"npm:@sentry/browser",version:we}],version:we},e.call(this,dt,t)||this}return(0,fe.ZT)(t,e),t.prototype.showReportDialog=function(e){void 0===e&&(e={}),(0,he.Rf)().document&&(this._isEnabled()?bt((0,fe.pi)((0,fe.pi)({},e),{dsn:e.dsn||this.getDsn()})):ce.k.error("Trying to call showReportDialog with Sentry Client disabled"))},t.prototype._prepareEvent=function(t,n,r){return t.platform=t.platform||"javascript",e.prototype._prepareEvent.call(this,t,n,r)},t.prototype._sendEvent=function(t){var n=this.getIntegration(xt);n&&n.addSentryBreadcrumb(t),e.prototype._sendEvent.call(this,t)},t}(De),St=n(360),Ct=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],_t=function(){function e(t){this.name=e.id,this._options=(0,fe.pi)({XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0},t)}return e.prototype.setupOnce=function(){var e=(0,he.Rf)();(this._options.setTimeout&&(0,Ne.hl)(e,"setTimeout",this._wrapTimeFunction.bind(this)),this._options.setInterval&&(0,Ne.hl)(e,"setInterval",this._wrapTimeFunction.bind(this)),this._options.requestAnimationFrame&&(0,Ne.hl)(e,"requestAnimationFrame",this._wrapRAF.bind(this)),this._options.XMLHttpRequest&&"XMLHttpRequest"in e&&(0,Ne.hl)(XMLHttpRequest.prototype,"send",this._wrapXHR.bind(this)),this._options.eventTarget)&&(Array.isArray(this._options.eventTarget)?this._options.eventTarget:Ct).forEach(this._wrapEventTarget.bind(this))},e.prototype._wrapTimeFunction=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=t[0];return t[0]=yt(r,{mechanism:{data:{function:(0,St.$)(e)},handled:!0,type:"instrument"}}),e.apply(this,t)}},e.prototype._wrapRAF=function(e){return function(t){return e.call(this,yt(t,{mechanism:{data:{function:"requestAnimationFrame",handler:(0,St.$)(e)},handled:!0,type:"instrument"}}))}},e.prototype._wrapEventTarget=function(e){var t=(0,he.Rf)(),n=t[e]&&t[e].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&((0,Ne.hl)(n,"addEventListener",(function(t){return function(n,r,i){try{"function"==typeof r.handleEvent&&(r.handleEvent=yt(r.handleEvent.bind(r),{mechanism:{data:{function:"handleEvent",handler:(0,St.$)(r),target:e},handled:!0,type:"instrument"}}))}catch(e){}return t.call(this,n,yt(r,{mechanism:{data:{function:"addEventListener",handler:(0,St.$)(r),target:e},handled:!0,type:"instrument"}}),i)}})),(0,Ne.hl)(n,"removeEventListener",(function(e){return function(t,n,r){var i,o=n;try{var a=null===(i=o)||void 0===i?void 0:i.__sentry_wrapped__;a&&e.call(this,t,a,r)}catch(e){}return e.call(this,t,o,r)}})))},e.prototype._wrapXHR=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=this,i=["onload","onerror","onprogress","onreadystatechange"];return i.forEach((function(e){e in r&&"function"==typeof r[e]&&(0,Ne.hl)(r,e,(function(t){var n={mechanism:{data:{function:e,handler:(0,St.$)(t)},handled:!0,type:"instrument"}};return t.__sentry_original__&&(n.mechanism.data.handler=(0,St.$)(t.__sentry_original__)),yt(t,n)}))})),e.apply(this,t)}},e.id="TryCatch",e}(),Et=function(){function e(t){this.name=e.id,this._onErrorHandlerInstalled=!1,this._onUnhandledRejectionHandlerInstalled=!1,this._options=(0,fe.pi)({onerror:!0,onunhandledrejection:!0},t)}return e.prototype.setupOnce=function(){Error.stackTraceLimit=50,this._options.onerror&&(ce.k.log("Global Handler attached: onerror"),this._installGlobalOnErrorHandler()),this._options.onunhandledrejection&&(ce.k.log("Global Handler attached: onunhandledrejection"),this._installGlobalOnUnhandledRejectionHandler())},e.prototype._installGlobalOnErrorHandler=function(){var t=this;this._onErrorHandlerInstalled||((0,be.o)({callback:function(n){var r=n.error,i=(0,ue.Gd)(),o=i.getIntegration(e),a=r&&!0===r.__sentry_own_request__;if(o&&!vt()&&!a){var s=i.getClient(),l=void 0===r&&(0,Te.HD)(n.msg)?t._eventFromIncompleteOnError(n.msg,n.url,n.line,n.column):t._enhanceEventWithInitialFrame(Ze(r||n.msg,void 0,{attachStacktrace:s&&s.getOptions().attachStacktrace,rejection:!1}),n.url,n.line,n.column);(0,he.EG)(l,{handled:!1,type:"onerror"}),i.captureEvent(l,{originalException:r})}},type:"error"}),this._onErrorHandlerInstalled=!0)},e.prototype._installGlobalOnUnhandledRejectionHandler=function(){var t=this;this._onUnhandledRejectionHandlerInstalled||((0,be.o)({callback:function(n){var r=n;try{"reason"in n?r=n.reason:"detail"in n&&"reason"in n.detail&&(r=n.detail.reason)}catch(e){}var i=(0,ue.Gd)(),o=i.getIntegration(e),a=r&&!0===r.__sentry_own_request__;if(!o||vt()||a)return!0;var s=i.getClient(),l=(0,Te.pt)(r)?t._eventFromRejectionWithPrimitive(r):Ze(r,void 0,{attachStacktrace:s&&s.getOptions().attachStacktrace,rejection:!0});l.level=Re.Error,(0,he.EG)(l,{handled:!1,type:"onunhandledrejection"}),i.captureEvent(l,{originalException:r})},type:"unhandledrejection"}),this._onUnhandledRejectionHandlerInstalled=!0)},e.prototype._eventFromIncompleteOnError=function(e,t,n,r){var i,o=(0,Te.VW)(e)?e.message:e,a=o.match(/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i);a&&(i=a[1],o=a[2]);var s={exception:{values:[{type:i||"Error",value:o}]}};return this._enhanceEventWithInitialFrame(s,t,n,r)},e.prototype._eventFromRejectionWithPrimitive=function(e){return{exception:{values:[{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(e)}]}}},e.prototype._enhanceEventWithInitialFrame=function(e,t,n,r){e.exception=e.exception||{},e.exception.values=e.exception.values||[],e.exception.values[0]=e.exception.values[0]||{},e.exception.values[0].stacktrace=e.exception.values[0].stacktrace||{},e.exception.values[0].stacktrace.frames=e.exception.values[0].stacktrace.frames||[];var i=isNaN(parseInt(r,10))?void 0:r,o=isNaN(parseInt(n,10))?void 0:n,a=(0,Te.HD)(t)&&t.length>0?t:(0,he.l4)();return 0===e.exception.values[0].stacktrace.frames.length&&e.exception.values[0].stacktrace.frames.push({colno:i,filename:a,function:"?",in_app:!0,lineno:o}),e},e.id="GlobalHandlers",e}(),Tt=function(){function e(t){void 0===t&&(t={}),this.name=e.id,this._key=t.key||"cause",this._limit=t.limit||5}return e.prototype.setupOnce=function(){(0,pe.c)((function(t,n){var r=(0,ue.Gd)().getIntegration(e);return r?r._handler(t,n):t}))},e.prototype._handler=function(e,t){if(!(e.exception&&e.exception.values&&t&&(0,Te.V9)(t.originalException,Error)))return e;var n=this._walkErrorTree(t.originalException,this._key);return e.exception.values=(0,fe.fl)(n,e.exception.values),e},e.prototype._walkErrorTree=function(e,t,n){if(void 0===n&&(n=[]),!(0,Te.V9)(e[t],Error)||n.length+1>=this._limit)return n;var r=Ke(Ge(e[t]));return this._walkErrorTree(e[t],t,(0,fe.fl)([r],n))},e.id="LinkedErrors",e}(),jt=function(){function e(){this.name=e.id}return e.prototype.setupOnce=function(t,n){t((function(t){var r=n().getIntegration(e);if(r){try{if(r._shouldDropEvent(t,r._previousEvent))return null}catch(e){return r._previousEvent=t}return r._previousEvent=t}return t}))},e.prototype._shouldDropEvent=function(e,t){return!!t&&(!!this._isSameMessageEvent(e,t)||!!this._isSameExceptionEvent(e,t))},e.prototype._isSameMessageEvent=function(e,t){var n=e.message,r=t.message;return!(!n&&!r)&&(!(n&&!r||!n&&r)&&(n===r&&(!!this._isSameFingerprint(e,t)&&!!this._isSameStacktrace(e,t))))},e.prototype._getFramesFromEvent=function(e){var t=e.exception;if(t)try{return t.values[0].stacktrace.frames}catch(e){return}else if(e.stacktrace)return e.stacktrace.frames},e.prototype._isSameStacktrace=function(e,t){var n=this._getFramesFromEvent(e),r=this._getFramesFromEvent(t);if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;if(n=n,(r=r).length!==n.length)return!1;for(var i=0;i<r.length;i++){var o=r[i],a=n[i];if(o.filename!==a.filename||o.lineno!==a.lineno||o.colno!==a.colno||o.function!==a.function)return!1}return!0},e.prototype._getExceptionFromEvent=function(e){return e.exception&&e.exception.values&&e.exception.values[0]},e.prototype._isSameExceptionEvent=function(e,t){var n=this._getExceptionFromEvent(t),r=this._getExceptionFromEvent(e);return!(!n||!r)&&(n.type===r.type&&n.value===r.value&&(!!this._isSameFingerprint(e,t)&&!!this._isSameStacktrace(e,t)))},e.prototype._isSameFingerprint=function(e,t){var n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;n=n,r=r;try{return!(n.join("")!==r.join(""))}catch(e){return!1}},e.id="Dedupe",e}(),Ot=(0,he.Rf)(),Nt=function(){function e(){this.name=e.id}return e.prototype.setupOnce=function(){(0,pe.c)((function(t){var n,r,i;if((0,ue.Gd)().getIntegration(e)){if(!Ot.navigator&&!Ot.location&&!Ot.document)return t;var o=(null===(n=t.request)||void 0===n?void 0:n.url)||(null===(r=Ot.location)||void 0===r?void 0:r.href),a=(Ot.document||{}).referrer,s=(Ot.navigator||{}).userAgent,l=(0,fe.pi)((0,fe.pi)((0,fe.pi)({},null===(i=t.request)||void 0===i?void 0:i.headers),a&&{Referer:a}),s&&{"User-Agent":s}),u=(0,fe.pi)((0,fe.pi)({},o&&{url:o}),{headers:l});return(0,fe.pi)((0,fe.pi)({},t),{request:u})}return t}))},e.id="UserAgent",e}(),Mt=[new ge,new ye,new _t,new xt,new Et,new Tt,new jt,new Nt];function Lt(e){if(void 0===e&&(e={}),void 0===e.defaultIntegrations&&(e.defaultIntegrations=Mt),void 0===e.release){var t=(0,he.Rf)();t.SENTRY_RELEASE&&t.SENTRY_RELEASE.id&&(e.release=t.SENTRY_RELEASE.id)}void 0===e.autoSessionTracking&&(e.autoSessionTracking=!0),function(e,t){var n;!0===t.debug&&ce.k.enable();var r=(0,ue.Gd)();null===(n=r.getScope())||void 0===n||n.update(t.initialScope);var i=new e(t);r.bindClient(i)}(kt,e),e.autoSessionTracking&&function(){if(void 0===(0,he.Rf)().document)return void ce.k.warn("Session tracking in non-browser environment with @sentry/browser is not supported.");var e=(0,ue.Gd)();if("function"!=typeof e.startSession||"function"!=typeof e.captureSession)return;e.startSession({ignoreDuration:!0}),e.captureSession(),(0,be.o)({callback:function(t){var n=t.from,r=t.to;void 0!==n&&n!==r&&(e.startSession({ignoreDuration:!0}),e.captureSession())},type:"history"})}()}var Pt,At=(0,he.Rf)();function Dt(e,t,n){return Rt(e,"react-router-v5",t,n)}function Rt(e,t,n,r){function i(e){if(n===[]||!r)return e;for(var t=It(n,e,r),i=0;i<t.length;i++)if(t[i].match.isExact)return t[i].match.path;return e}return void 0===n&&(n=[]),function(n,r,o){void 0===r&&(r=!0),void 0===o&&(o=!0);var a=e&&e.location?e.location.pathname:At&&At.location?At.location.pathname:void 0;r&&a&&(Pt=n({name:i(a),op:"pageload",tags:{"routing.instrumentation":t}})),o&&e.listen&&e.listen((function(e,r){if(r&&("PUSH"===r||"POP"===r)){Pt&&Pt.finish();var o={"routing.instrumentation":t};Pt=n({name:i(e.pathname),op:"navigation",tags:o})}}))}}function It(e,t,n,r){return void 0===r&&(r=[]),e.some((function(e){var i=e.path?n(t,e):r.length?r[r.length-1].match:function(e){return{path:"/",url:"/",params:{},isExact:"/"===e}}(t);return i&&(r.push({route:e,match:i}),e.routes&&It(e.routes,t,n,r)),!!i})),r}var Ft=n(1109),zt=n(6458),Ht=n(5734),Ut=n(3233),Bt=(0,he.Rf)();var Wt,$t,Vt=n(1422),qt=function(e,t,n,r){var i;return function(){n&&t.isFinal&&n.disconnect(),t.value>=0&&(r||t.isFinal||"hidden"===document.visibilityState)&&(t.delta=t.value-(i||0),(t.delta||t.isFinal||void 0===i)&&(e(t),i=t.value))}},Gt=function(e,t){return void 0===t&&(t=-1),{name:e,value:t,delta:0,entries:[],id:Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),isFinal:!1}},Yt=function(e,t){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var n=new PerformanceObserver((function(e){return e.getEntries().map(t)}));return n.observe({type:e,buffered:!0}),n}}catch(e){}},Xt=!1,Kt=!1,Qt=function(e){Xt=!e.persisted},Jt=function(e,t){void 0===t&&(t=!1),Kt||(addEventListener("pagehide",Qt),addEventListener("beforeunload",(function(){})),Kt=!0),addEventListener("visibilitychange",(function(t){var n=t.timeStamp;"hidden"===document.visibilityState&&e({timeStamp:n,isUnloading:Xt})}),{capture:!0,once:t})},Zt=function(){return void 0===Wt&&(Wt="hidden"===document.visibilityState?0:1/0,Jt((function(e){var t=e.timeStamp;return Wt=t}),!0)),{get timeStamp(){return Wt}}},en=function(e,t){void 0===t&&(t=!1);var n,r=Gt("LCP"),i=Zt(),o=function(e){var t=e.startTime;t<i.timeStamp?(r.value=t,r.entries.push(e)):r.isFinal=!0,n()},a=Yt("largest-contentful-paint",o);if(a){n=qt(e,r,a,t);var s=function(){r.isFinal||(a.takeRecords().map(o),r.isFinal=!0,n())};($t||($t=new Promise((function(e){return["scroll","keydown","pointerdown"].map((function(t){addEventListener(t,e,{once:!0,passive:!0,capture:!0})}))}))),$t).then(s),Jt(s,!0)}},tn=(0,he.Rf)(),nn=function(){function e(){var e;this._measurements={},this._performanceCursor=0,!(0,Vt.KV)()&&(null===(e=tn)||void 0===e?void 0:e.performance)&&(tn.performance.mark&&tn.performance.mark("sentry-tracing-init"),this._trackCLS(),this._trackLCP(),this._trackFID())}return e.prototype.addPerformanceEntries=function(e){var t=this;if(tn&&tn.performance&&tn.performance.getEntries&&Oe.Z1){ce.k.log("[Tracing] Adding & adjusting spans using Performance API");var n,r,i,o,a,s=(0,Ut.XL)(Oe.Z1);if(tn.document)for(var l=0;l<document.scripts.length;l++)if("true"===document.scripts[l].dataset.entry){n=document.scripts[l].src;break}if(tn.performance.getEntries().slice(this._performanceCursor).forEach((function(l){var u=(0,Ut.XL)(l.startTime),c=(0,Ut.XL)(l.duration);if(!("navigation"===e.op&&s+u<e.startTimestamp))switch(l.entryType){case"navigation":!function(e,t,n){rn({transaction:e,entry:t,event:"unloadEvent",timeOrigin:n}),rn({transaction:e,entry:t,event:"redirect",timeOrigin:n}),rn({transaction:e,entry:t,event:"domContentLoadedEvent",timeOrigin:n}),rn({transaction:e,entry:t,event:"loadEvent",timeOrigin:n}),rn({transaction:e,entry:t,event:"connect",timeOrigin:n}),rn({transaction:e,entry:t,event:"secureConnection",timeOrigin:n,eventEnd:"connectEnd",description:"TLS/SSL"}),rn({transaction:e,entry:t,event:"fetch",timeOrigin:n,eventEnd:"domainLookupStart",description:"cache"}),rn({transaction:e,entry:t,event:"domainLookup",timeOrigin:n,description:"DNS"}),function(e,t,n){on(e,{op:"browser",description:"request",startTimestamp:n+(0,Ut.XL)(t.requestStart),endTimestamp:n+(0,Ut.XL)(t.responseEnd)}),on(e,{op:"browser",description:"response",startTimestamp:n+(0,Ut.XL)(t.responseStart),endTimestamp:n+(0,Ut.XL)(t.responseEnd)})}(e,t,n)}(e,l,s),o=s+(0,Ut.XL)(l.responseStart),a=s+(0,Ut.XL)(l.requestStart);break;case"mark":case"paint":case"measure":var d=function(e,t,n,r,i){var o=i+n,a=o+r;return on(e,{description:t.name,endTimestamp:a,op:t.entryType,startTimestamp:o}),o}(e,l,u,c,s);void 0===i&&"sentry-tracing-init"===l.name&&(i=d);var f=Zt(),p=l.startTime<f.timeStamp;"first-paint"===l.name&&p&&(ce.k.log("[Measurements] Adding FP"),t._measurements.fp={value:l.startTime},t._measurements["mark.fp"]={value:d}),"first-contentful-paint"===l.name&&p&&(ce.k.log("[Measurements] Adding FCP"),t._measurements.fcp={value:l.startTime},t._measurements["mark.fcp"]={value:d});break;case"resource":var h=l.name.replace(window.location.origin,""),m=function(e,t,n,r,i,o){if("xmlhttprequest"===t.initiatorType||"fetch"===t.initiatorType)return;var a={};"transferSize"in t&&(a["Transfer Size"]=t.transferSize);"encodedBodySize"in t&&(a["Encoded Body Size"]=t.encodedBodySize);"decodedBodySize"in t&&(a["Decoded Body Size"]=t.decodedBodySize);var s=o+r,l=s+i;return on(e,{description:n,endTimestamp:l,op:t.initiatorType?"resource."+t.initiatorType:"resource",startTimestamp:s,data:a}),l}(e,l,h,u,c,s);void 0===r&&(n||"").indexOf(h)>-1&&(r=m)}})),void 0!==r&&void 0!==i&&on(e,{description:"evaluation",endTimestamp:i,op:"script",startTimestamp:r}),this._performanceCursor=Math.max(performance.getEntries().length-1,0),this._trackNavigator(e),"pageload"===e.op){var u=(0,Ut.XL)(Oe.Z1);"number"==typeof o&&(ce.k.log("[Measurements] Adding TTFB"),this._measurements.ttfb={value:1e3*(o-e.startTimestamp)},"number"==typeof a&&a<=o&&(this._measurements["ttfb.requestTime"]={value:1e3*(o-a)})),["fcp","fp","lcp"].forEach((function(n){if(t._measurements[n]&&!(u>=e.startTimestamp)){var r=t._measurements[n].value,i=u+(0,Ut.XL)(r),o=Math.abs(1e3*(i-e.startTimestamp)),a=o-r;ce.k.log("[Measurements] Normalized "+n+" from "+r+" to "+o+" ("+a+")"),t._measurements[n].value=o}})),this._measurements["mark.fid"]&&this._measurements.fid&&on(e,{description:"first input delay",endTimestamp:this._measurements["mark.fid"].value+(0,Ut.XL)(this._measurements.fid.value),op:"web.vitals",startTimestamp:this._measurements["mark.fid"].value}),e.setMeasurements(this._measurements),this._tagMetricInfo(e)}}},e.prototype._tagMetricInfo=function(e){this._lcpEntry&&(ce.k.log("[Measurements] Adding LCP Data"),this._lcpEntry.element&&e.setTag("lcp.element",(0,wt.R)(this._lcpEntry.element)),this._lcpEntry.id&&e.setTag("lcp.id",this._lcpEntry.id),this._lcpEntry.url&&e.setTag("lcp.url",this._lcpEntry.url.trim().slice(0,200)),e.setTag("lcp.size",this._lcpEntry.size)),this._clsEntry&&(ce.k.log("[Measurements] Adding CLS Data"),this._clsEntry.sources.map((function(t,n){return e.setTag("cls.source."+(n+1),(0,wt.R)(t.node))})))},e.prototype._trackCLS=function(){var e=this;!function(e,t){void 0===t&&(t=!1);var n,r=Gt("CLS",0),i=function(e){e.hadRecentInput||(r.value+=e.value,r.entries.push(e),n())},o=Yt("layout-shift",i);o&&(n=qt(e,r,o,t),Jt((function(e){var t=e.isUnloading;o.takeRecords().map(i),t&&(r.isFinal=!0),n()})))}((function(t){var n=t.entries.pop();n&&(ce.k.log("[Measurements] Adding CLS"),e._measurements.cls={value:t.value},e._clsEntry=n)}))},e.prototype._trackNavigator=function(e){var t=tn.navigator;if(t){var n=t.connection;n&&(n.effectiveType&&e.setTag("effectiveConnectionType",n.effectiveType),n.type&&e.setTag("connectionType",n.type),an(n.rtt)&&(this._measurements["connection.rtt"]={value:n.rtt}),an(n.downlink)&&(this._measurements["connection.downlink"]={value:n.downlink})),an(t.deviceMemory)&&e.setTag("deviceMemory",String(t.deviceMemory)),an(t.hardwareConcurrency)&&e.setTag("hardwareConcurrency",String(t.hardwareConcurrency))}},e.prototype._trackLCP=function(){var e=this;en((function(t){var n=t.entries.pop();if(n){var r=(0,Ut.XL)(Oe.Z1),i=(0,Ut.XL)(n.startTime);ce.k.log("[Measurements] Adding LCP"),e._measurements.lcp={value:t.value},e._measurements["mark.lcp"]={value:r+i},e._lcpEntry=n}}))},e.prototype._trackFID=function(){var e,t,n,r,i,o,a=this;e=function(e){var t=e.entries.pop();if(t){var n=(0,Ut.XL)(Oe.Z1),r=(0,Ut.XL)(t.startTime);ce.k.log("[Measurements] Adding FID"),a._measurements.fid={value:e.value},a._measurements["mark.fid"]={value:n+r}}},t=Gt("FID"),n=Zt(),i=Yt("first-input",r=function(e){e.startTime<n.timeStamp&&(t.value=e.processingStart-e.startTime,t.entries.push(e),t.isFinal=!0,o())}),o=qt(e,t,i),i?Jt((function(){i.takeRecords().map(r),i.disconnect()}),!0):window.perfMetrics&&window.perfMetrics.onFirstInputDelay&&window.perfMetrics.onFirstInputDelay((function(e,r){r.timeStamp<n.timeStamp&&(t.value=e,t.isFinal=!0,t.entries=[{entryType:"first-input",name:r.type,target:r.target,cancelable:r.cancelable,startTime:r.timeStamp,processingStart:r.timeStamp+e}],o())}))},e}();function rn(e){var t=e.transaction,n=e.entry,r=e.event,i=e.timeOrigin,o=e.eventEnd,a=e.description,s=o?n[o]:n[r+"End"],l=n[r+"Start"];l&&s&&on(t,{op:"browser",description:null!=a?a:r,startTimestamp:i+(0,Ut.XL)(l),endTimestamp:i+(0,Ut.XL)(s)})}function on(e,t){var n=t.startTimestamp,r=(0,fe._T)(t,["startTimestamp"]);return n&&e.startTimestamp>n&&(e.startTimestamp=n),e.startChild((0,fe.pi)({startTimestamp:n},r))}function an(e){return"number"==typeof e&&isFinite(e)}var sn={traceFetch:!0,traceXHR:!0,tracingOrigins:["localhost",/^\//]};function ln(e){var t=(0,fe.pi)((0,fe.pi)({},sn),e),n=t.traceFetch,r=t.traceXHR,i=t.tracingOrigins,o=t.shouldCreateSpanForRequest,a={},s=function(e){if(a[e])return a[e];var t=i;return a[e]=t.some((function(t){return(0,me.zC)(e,t)}))&&!(0,me.zC)(e,"sentry_key"),a[e]},l=s;"function"==typeof o&&(l=function(e){return s(e)&&o(e)});var u={};n&&(0,be.o)({callback:function(e){!function(e,t,n){if(!(0,Ut.zu)()||!e.fetchData||!t(e.fetchData.url))return;if(e.endTimestamp&&e.fetchData.__span){return void((i=n[e.fetchData.__span])&&(e.response?i.setHttpStatus(e.response.status):e.error&&i.setStatus(Ht.p.InternalError),i.finish(),delete n[e.fetchData.__span]))}var r=(0,Ut.x1)();if(r){var i=r.startChild({data:(0,fe.pi)((0,fe.pi)({},e.fetchData),{type:"fetch"}),description:e.fetchData.method+" "+e.fetchData.url,op:"http"});e.fetchData.__span=i.spanId,n[i.spanId]=i;var o=e.args[0]=e.args[0],a=e.args[1]=e.args[1]||{},s=a.headers;(0,Te.V9)(o,Request)&&(s=o.headers),s?"function"==typeof s.append?s.append("sentry-trace",i.toTraceparent()):s=Array.isArray(s)?(0,fe.fl)(s,[["sentry-trace",i.toTraceparent()]]):(0,fe.pi)((0,fe.pi)({},s),{"sentry-trace":i.toTraceparent()}):s={"sentry-trace":i.toTraceparent()},a.headers=s}}(e,l,u)},type:"fetch"}),r&&(0,be.o)({callback:function(e){!function(e,t,n){var r,i;if(!(0,Ut.zu)()||(null===(r=e.xhr)||void 0===r?void 0:r.__sentry_own_request__)||!(null===(i=e.xhr)||void 0===i?void 0:i.__sentry_xhr__)||!t(e.xhr.__sentry_xhr__.url))return;var o=e.xhr.__sentry_xhr__;if(e.endTimestamp&&e.xhr.__sentry_xhr_span_id__){return void((s=n[e.xhr.__sentry_xhr_span_id__])&&(s.setHttpStatus(o.status_code),s.finish(),delete n[e.xhr.__sentry_xhr_span_id__]))}var a=(0,Ut.x1)();if(a){var s=a.startChild({data:(0,fe.pi)((0,fe.pi)({},o.data),{type:"xhr",method:o.method,url:o.url}),description:o.method+" "+o.url,op:"http"});if(e.xhr.__sentry_xhr_span_id__=s.spanId,n[e.xhr.__sentry_xhr_span_id__]=s,e.xhr.setRequestHeader)try{e.xhr.setRequestHeader("sentry-trace",s.toTraceparent())}catch(e){}}}(e,l,u)},type:"xhr"})}var un=(0,he.Rf)();var cn=(0,fe.pi)({idleTimeout:zt.nT,markBackgroundTransactions:!0,maxTransactionDuration:600,routingInstrumentation:function(e,t,n){if(void 0===t&&(t=!0),void 0===n&&(n=!0),un&&un.location){var r,i=un.location.href;t&&(r=e({name:un.location.pathname,op:"pageload"})),n&&(0,be.o)({callback:function(t){var n=t.to,o=t.from;void 0===o&&i&&-1!==i.indexOf(n)?i=void 0:o!==n&&(i=void 0,r&&(ce.k.log("[Tracing] Finishing current transaction with op: "+r.op),r.finish()),r=e({name:un.location.pathname,op:"navigation"}))},type:"history"})}else ce.k.warn("Could not initialize routing instrumentation due to invalid location")},startTransactionOnLocationChange:!0,startTransactionOnPageLoad:!0},sn),dn=function(){function e(t){this.name=e.id,this._metrics=new nn,this._emitOptionsWarning=!1;var n=sn.tracingOrigins;t&&t.tracingOrigins&&Array.isArray(t.tracingOrigins)&&0!==t.tracingOrigins.length?n=t.tracingOrigins:this._emitOptionsWarning=!0,this.options=(0,fe.pi)((0,fe.pi)((0,fe.pi)({},cn),t),{tracingOrigins:n})}return e.prototype.setupOnce=function(e,t){var n=this;this._getCurrentHub=t,this._emitOptionsWarning&&(ce.k.warn("[Tracing] You need to define `tracingOrigins` in the options. Set an array of urls or patterns to trace."),ce.k.warn("[Tracing] We added a reasonable default for you: "+sn.tracingOrigins));var r=this.options,i=r.routingInstrumentation,o=r.startTransactionOnLocationChange,a=r.startTransactionOnPageLoad,s=r.markBackgroundTransactions,l=r.traceFetch,u=r.traceXHR,c=r.tracingOrigins,d=r.shouldCreateSpanForRequest;i((function(e){return n._createRouteTransaction(e)}),a,o),s&&(Bt&&Bt.document?Bt.document.addEventListener("visibilitychange",(function(){var e=(0,Ut.x1)();Bt.document.hidden&&e&&(ce.k.log("[Tracing] Transaction: "+Ht.p.Cancelled+" -> since tab moved to the background, op: "+e.op),e.status||e.setStatus(Ht.p.Cancelled),e.setTag("visibilitychange","document.hidden"),e.finish())})):ce.k.warn("[Tracing] Could not set up background tab detection due to lack of global document")),ln({traceFetch:l,traceXHR:u,tracingOrigins:c,shouldCreateSpanForRequest:d})},e.prototype._createRouteTransaction=function(e){var t=this;if(this._getCurrentHub){var n=this.options,r=n.beforeNavigate,i=n.idleTimeout,o=n.maxTransactionDuration,a="pageload"===e.op?function(){var e=(t="sentry-trace",n=document.querySelector("meta[name="+t+"]"),n?n.getAttribute("content"):null);var t,n;if(e)return(0,Ut.qG)(e);return}():void 0,s=(0,fe.pi)((0,fe.pi)((0,fe.pi)({},e),a),{trimEnd:!0}),l="function"==typeof r?r(s):s,u=void 0===l?(0,fe.pi)((0,fe.pi)({},s),{sampled:!1}):l;!1===u.sampled&&ce.k.log("[Tracing] Will not send "+u.op+" transaction because of beforeNavigate."),ce.k.log("[Tracing] Starting "+u.op+" transaction on scope");var c=this._getCurrentHub(),d=(0,he.Rf)().location,f=(0,Ft.lb)(c,u,i,!0,{location:d});return f.registerBeforeFinishCallback((function(e,n){t._metrics.addPerformanceEntries(e),function(e,t,n){var r=n-t.startTimestamp;n&&(r>e||r<0)&&(t.setStatus(Ht.p.DeadlineExceeded),t.setTag("maxTransactionDurationExceeded","true"))}((0,Ut.WB)(o),e,n)})),f}ce.k.warn("[Tracing] Did not create "+e.op+" transaction because _getCurrentHub is invalid.")},e.id="BrowserTracing",e}();var fn=function(){function e(t){void 0===t&&(t={}),this.name=e.id,this._router=t.router||t.app,this._methods=(Array.isArray(t.methods)?t.methods:[]).concat("use")}return e.prototype.setupOnce=function(){this._router?function(e,t){void 0===t&&(t=[]);t.forEach((function(t){return function(e,t){var n=e[t];return e[t]=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return n.call.apply(n,(0,fe.fl)([this],hn(e,t)))},e}(e,t)}))}(this._router,this._methods):ce.k.error("ExpressIntegration is missing an Express instance")},e.id="Express",e}();function pn(e,t){var n=e.length;switch(n){case 2:return function(n,r){var i=r.__sentry_transaction;if(i){var o=i.startChild({description:e.name,op:"middleware."+t});r.once("finish",(function(){o.finish()}))}return e.call(this,n,r)};case 3:return function(n,r,i){var o,a=null===(o=r.__sentry_transaction)||void 0===o?void 0:o.startChild({description:e.name,op:"middleware."+t});e.call(this,n,r,(function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];null===(e=a)||void 0===e||e.finish(),i.call.apply(i,(0,fe.fl)([this],t))}))};case 4:return function(n,r,i,o){var a,s=null===(a=i.__sentry_transaction)||void 0===a?void 0:a.startChild({description:e.name,op:"middleware."+t});e.call(this,n,r,i,(function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];null===(e=s)||void 0===e||e.finish(),o.call.apply(o,(0,fe.fl)([this],t))}))};default:throw new Error("Express middleware takes 2-4 arguments. Got: "+n)}}function hn(e,t){return e.map((function(e){return"function"==typeof e?pn(e,t):Array.isArray(e)?e.map((function(e){return"function"==typeof e?pn(e,t):e})):e}))}var mn=function(){function e(){this.name=e.id}return e.prototype.setupOnce=function(e,t){var n=(0,Vt.$y)("pg");n?(0,Ne.hl)(n.Client.prototype,"query",(function(e){return function(n,r,i){var o,a,s,l=null===(a=null===(o=t().getScope())||void 0===o?void 0:o.getSpan())||void 0===a?void 0:a.startChild({description:"string"==typeof n?n:n.text,op:"db"});if("function"==typeof i)return e.call(this,n,r,(function(e,t){var n;null===(n=l)||void 0===n||n.finish(),i(e,t)}));if("function"==typeof r)return e.call(this,n,(function(e,t){var n;null===(n=l)||void 0===n||n.finish(),r(e,t)}));var u=void 0!==r?e.call(this,n,r):e.call(this,n);return(0,Te.J8)(u)?u.then((function(e){var t;return null===(t=l)||void 0===t||t.finish(),e})):(null===(s=l)||void 0===s||s.finish(),u)}})):ce.k.error("Postgres Integration was unable to require `pg` package.")},e.id="Postgres",e}(),vn=function(){function e(){this.name=e.id}return e.prototype.setupOnce=function(e,t){var n=(0,Vt.$y)("mysql/lib/Connection.js");n?(0,Ne.hl)(n,"createQuery",(function(e){return function(n,r,i){var o,a,s=null===(a=null===(o=t().getScope())||void 0===o?void 0:o.getSpan())||void 0===a?void 0:a.startChild({description:"string"==typeof n?n:n.sql,op:"db"});return"function"==typeof i?e.call(this,n,r,(function(e,t,n){var r;null===(r=s)||void 0===r||r.finish(),i(e,t,n)})):"function"==typeof r?e.call(this,n,(function(e,t,n){var i;null===(i=s)||void 0===i||i.finish(),r(e,t,n)})):e.call(this,n,r,i)}})):ce.k.error("Mysql Integration was unable to require `mysql` package.")},e.id="Mysql",e}(),gn=["aggregate","bulkWrite","countDocuments","createIndex","createIndexes","deleteMany","deleteOne","distinct","drop","dropIndex","dropIndexes","estimatedDocumentCount","find","findOne","findOneAndDelete","findOneAndReplace","findOneAndUpdate","indexes","indexExists","indexInformation","initializeOrderedBulkOp","insertMany","insertOne","isCapped","mapReduce","options","parallelCollectionScan","rename","replaceOne","stats","updateMany","updateOne"],yn={bulkWrite:["operations"],countDocuments:["query"],createIndex:["fieldOrSpec"],createIndexes:["indexSpecs"],deleteMany:["filter"],deleteOne:["filter"],distinct:["key","query"],dropIndex:["indexName"],find:["query"],findOne:["query"],findOneAndDelete:["filter"],findOneAndReplace:["filter","replacement"],findOneAndUpdate:["filter","update"],indexExists:["indexes"],insertMany:["docs"],insertOne:["doc"],mapReduce:["map","reduce"],rename:["newName"],replaceOne:["filter","doc"],updateMany:["filter","update"],updateOne:["filter","update"]},bn=function(){function e(t){void 0===t&&(t={}),this.name=e.id,this._operations=Array.isArray(t.operations)?t.operations:gn,this._describeOperations=!("describeOperations"in t)||t.describeOperations,this._useMongoose=!!t.useMongoose}return e.prototype.setupOnce=function(e,t){var n=this._useMongoose?"mongoose":"mongodb",r=(0,Vt.$y)(n);r?this._instrumentOperations(r.Collection,this._operations,t):ce.k.error("Mongo Integration was unable to require `"+n+"` package.")},e.prototype._instrumentOperations=function(e,t,n){var r=this;t.forEach((function(t){return r._patchOperation(e,t,n)}))},e.prototype._patchOperation=function(e,t,n){if(t in e.prototype){var r=this._getSpanContextFromOperationArguments.bind(this);(0,Ne.hl)(e.prototype,t,(function(e){return function(){for(var i,o,a,s,l=[],u=0;u<arguments.length;u++)l[u]=arguments[u];var c=l[l.length-1],d=n().getScope(),f=null===(i=d)||void 0===i?void 0:i.getSpan();if("function"!=typeof c||"mapReduce"===t&&2===l.length){var p=null===(o=f)||void 0===o?void 0:o.startChild(r(this,t,l)),h=e.call.apply(e,(0,fe.fl)([this],l));return(0,Te.J8)(h)?h.then((function(e){var t;return null===(t=p)||void 0===t||t.finish(),e})):(null===(a=p)||void 0===a||a.finish(),h)}var m=null===(s=f)||void 0===s?void 0:s.startChild(r(this,t,l.slice(0,-1)));return e.call.apply(e,(0,fe.fl)([this],l.slice(0,-1),[function(e,t){var n;null===(n=m)||void 0===n||n.finish(),c(e,t)}]))}}))}},e.prototype._getSpanContextFromOperationArguments=function(e,t,n){var r={collectionName:e.collectionName,dbName:e.dbName,namespace:e.namespace},i={op:"db",description:t,data:r},o=yn[t],a=Array.isArray(this._describeOperations)?this._describeOperations.includes(t):this._describeOperations;if(!o||!a)return i;try{if("mapReduce"===t){var s=(0,fe.CR)(n,2),l=s[0],u=s[1];r[o[0]]="string"==typeof l?l:l.name||"<anonymous>",r[o[1]]="string"==typeof u?u:u.name||"<anonymous>"}else for(var c=0;c<o.length;c++)r[o[c]]=JSON.stringify(n[c])}catch(e){}return i},e.id="Mongo",e}(),wn=(0,fe.pi)((0,fe.pi)({},e),{BrowserTracing:dn});(0,Ft.ro)();const xn=()=>{const e={};APP_SETTINGS.user.email&&ft("setUser",{email:APP_SETTINGS.user.email,username:APP_SETTINGS.user.username}),APP_SETTINGS.version&&Object.entries(APP_SETTINGS.version).forEach((([t,n])=>{const{version:r,commit:i}=null!=n?n:{};r&&(e["version-"+t]=r),i&&(e["commit-"+t]=i)})),function(e){ft("setTags",e)}(e)},kn=function(e){var t=e.displayName||e.name,n=function(t){return Pt&&t&&t.computedMatch&&t.computedMatch.isExact&&Pt.setName(t.computedMatch.path),w.createElement(e,(0,fe.pi)({},t))};return n.displayName="sentryRoute("+t+")",U()(n,e),n}(Z);function Sn(){return(Sn=Object.assign||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}).apply(this,arguments)}var Cn=w.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 0a1.5 1.5 0 00-1.5 1.5V5h3V1.5A1.5 1.5 0 009 0zm0 20c1.38 0 2.5-1.343 2.5-3s-1.12-3-2.5-3-2.5 1.343-2.5 3 1.12 3 2.5 3z",fill:"#07F",fillOpacity:.5}),_n=w.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M.5 14a1.172 1.172 0 00.828 2h15.344a1.172 1.172 0 00.828-2c-1.521-1.521-2.161-.232-2.5-5-.315-4.433-2-6.5-6-6.5S3.32 4.592 3 9c-.346 4.764-.97 3.47-2.5 5z",fill:"#07F"});function En(e,t){return w.createElement("svg",Sn({width:18,height:20,viewBox:"0 0 18 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t},e),Cn,_n)}const Tn=w.forwardRef(En);function jn(){return(jn=Object.assign||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}).apply(this,arguments)}var On=w.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 2.992c0-1.023 0-1.535.211-1.89a1.5 1.5 0 01.82-.657c.392-.129.891-.018 1.89.204l5.038 1.12c.388.086.583.13.779.146a3 3 0 00.524 0c.196-.017.39-.06.78-.146l5.037-1.12c.999-.222 1.498-.333 1.89-.204a1.5 1.5 0 01.82.658c.211.354.211.866.211 1.889v9.441c0 .916 0 1.374-.162 1.752a2.001 2.001 0 01-.669.833c-.334.24-.78.34-1.675.539l-5.106 1.135c-.518.115-.777.172-1.039.195-.232.02-.466.02-.698 0-.262-.023-.521-.08-1.04-.195l-5.105-1.135c-.894-.199-1.341-.298-1.675-.539a2 2 0 01-.669-.833C0 13.807 0 13.349 0 12.433V2.992z",fill:"#000",fillOpacity:.4}),Nn=w.createElement("mask",{id:"book_svg__a",maskUnits:"userSpaceOnUse",x:0,y:0,width:18,height:17},w.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 2.992c0-1.023 0-1.535.211-1.89a1.5 1.5 0 01.82-.657c.392-.129.891-.018 1.89.204l5.038 1.12c.388.086.583.13.779.146a3 3 0 00.524 0c.196-.017.39-.06.78-.146l5.037-1.12c.999-.222 1.498-.333 1.89-.204a1.5 1.5 0 01.82.658c.211.354.211.866.211 1.889v9.441c0 .916 0 1.374-.162 1.752a2.001 2.001 0 01-.669.833c-.334.24-.78.34-1.675.539l-5.106 1.135c-.518.115-.777.172-1.039.195-.232.02-.466.02-.698 0-.262-.023-.521-.08-1.04-.195l-5.105-1.135c-.894-.199-1.341-.298-1.675-.539a2 2 0 01-.669-.833C0 13.807 0 13.349 0 12.433V2.992z",fill:"#fff"})),Mn=w.createElement("g",{mask:"url(#book_svg__a)",fill:"#000"},w.createElement("path",{d:"M10-1h9v19h-9zM-1-1h9v19h-9z"}));function Ln(e,t){return w.createElement("svg",jn({width:18,height:17,viewBox:"0 0 18 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t},e),On,Nn,Mn)}const Pn=w.forwardRef(Ln);function An(){return(An=Object.assign||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}).apply(this,arguments)}var Dn=w.createElement("path",{opacity:.9,d:"M4 11h2M3 8c0-2-1.5-2.5-1.5-4s1-3 3.5-3 3.5 1.5 3.5 3S7 6 7 8",stroke:"currentColor",strokeWidth:2,strokeLinecap:"square"});function Rn(e,t){return w.createElement("svg",An({width:10,height:12,viewBox:"0 0 10 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t},e),Dn)}const In=w.forwardRef(Rn);function Fn(){return(Fn=Object.assign||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}).apply(this,arguments)}var zn=w.createElement("path",{d:"M2 4l3 3 5-5",stroke:"currentColor",strokeWidth:2,strokeLinecap:"square"});function Hn(e,t){return w.createElement("svg",Fn({width:12,height:9,viewBox:"0 0 12 9",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t},e),zn)}const Un=w.forwardRef(Hn);function Bn(){return(Bn=Object.assign||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}).apply(this,arguments)}var Wn=w.createElement("path",{d:"M14 2L2 14M2 2l12 12",stroke:"currentColor",strokeWidth:2,strokeLinecap:"square"});function $n(e,t){return w.createElement("svg",Bn({width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t},e),Wn)}const Vn=w.forwardRef($n);function qn(){return(qn=Object.assign||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}).apply(this,arguments)}var Gn=w.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M.163.819C0 1.139 0 1.559 0 2.4v13.2c0 .84 0 1.26.163 1.581a1.5 1.5 0 00.656.655c.32.164.74.164 1.581.164h9.2c.84 0 1.26 0 1.581-.163a1.5 1.5 0 00.655-.656c.164-.32.164-.74.164-1.581V2.4c0-.84 0-1.26-.164-1.581a1.5 1.5 0 00-.655-.656C12.861 0 12.441 0 11.6 0H2.4C1.56 0 1.14 0 .819.163A1.5 1.5 0 00.163.82zM10 11a2 2 0 100-4 2 2 0 000 4z",fill:"#000"});function Yn(e,t){return w.createElement("svg",qn({width:14,height:18,viewBox:"0 0 14 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t},e),Gn)}const Xn=w.forwardRef(Yn);function Kn(){return(Kn=Object.assign||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}).apply(this,arguments)}var Qn=w.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 7a2 2 0 100 4 2 2 0 000-4zm5 2a2 2 0 114 0 2 2 0 01-4 0zm7 0a2 2 0 114 0 2 2 0 01-4 0z",fill:"currentColor"});function Jn(e,t){return w.createElement("svg",Kn({width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t},e),Qn)}const Zn=w.forwardRef(Jn);function er(){return(er=Object.assign||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}).apply(this,arguments)}var tr=w.createElement("path",{d:"M13.348 10.313c.433.75-.11 1.687-.974 1.687H1.126a1.126 1.126 0 01-.974-1.687L5.776.563a1.126 1.126 0 011.948 0l5.624 9.75zM6.75 8.297a1.078 1.078 0 100 2.156 1.078 1.078 0 000-2.156zM5.726 4.422L5.9 7.609c.008.15.132.266.281.266H7.32c.15 0 .273-.117.28-.266l.175-3.187a.281.281 0 00-.281-.297H6.007a.281.281 0 00-.28.297z",fill:"#F5222D"});function nr(e,t){return w.createElement("svg",er({width:14,height:12,viewBox:"0 0 14 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t},e),tr)}const rr=w.forwardRef(nr);function ir(){return(ir=Object.assign||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}).apply(this,arguments)}var or=w.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 3.2c0-1.12 0-1.68.218-2.108a2 2 0 01.874-.874C1.52 0 2.08 0 3.2 0h2.4c.88 0 1.32 0 1.724.115a3 3 0 01.99.495c.334.254.598.606 1.126 1.31L11 4H0v-.8z",fill:"#000",fillOpacity:.4}),ar=w.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 5.4c0-.84 0-1.26.163-1.581a1.5 1.5 0 01.656-.656C1.139 3 1.559 3 2.4 3h13.2c.84 0 1.26 0 1.581.163a1.5 1.5 0 01.655.656c.164.32.164.74.164 1.581v8.2c0 .84 0 1.26-.163 1.581a1.5 1.5 0 01-.656.655c-.32.164-.74.164-1.581.164H2.4c-.84 0-1.26 0-1.581-.164a1.5 1.5 0 01-.656-.655C0 14.861 0 14.441 0 13.6V5.4z",fill:"#000"});function sr(e,t){return w.createElement("svg",ir({width:18,height:16,viewBox:"0 0 18 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t},e),or,ar)}const lr=w.forwardRef(sr);function ur(){return(ur=Object.assign||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}).apply(this,arguments)}var cr=w.createElement("g",{clipPath:"url(#github_svg__clip0)",fill:"#231E1B"},w.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 .223a9 9 0 00-2.845 17.54c.45.083.615-.196.615-.435 0-.214-.008-.924-.011-1.675-2.506.544-3.033-1.06-3.033-1.06-.41-1.041-.999-1.318-.999-1.318-.816-.559.061-.547.061-.547.904.064 1.38.927 1.38.927.804 1.375 2.106.978 2.619.748.08-.581.314-.98.57-1.204-1.998-.228-4.1-1-4.1-4.447 0-.982.353-1.786.928-2.416-.094-.227-.401-1.142.086-2.382 0 0 .756-.241 2.476.923.718-.2 1.487-.3 2.253-.303a8.624 8.624 0 012.255.303c1.718-1.164 2.472-.923 2.472-.923.49 1.24.182 2.155.088 2.382.577.63.926 1.434.926 2.416 0 3.456-2.106 4.217-4.11 4.44.324.28.612.828.612 1.667 0 1.204-.01 2.173-.01 2.47 0 .24.162.52.618.432A9 9 0 009 .223z"}),w.createElement("path",{d:"M3.408 13.144c-.02.044-.091.058-.155.027-.066-.03-.101-.091-.08-.136.019-.046.089-.058.154-.028.066.03.103.092.08.137zM3.773 13.55c-.043.04-.127.02-.183-.042-.06-.063-.07-.146-.027-.186.045-.04.125-.021.185.042.058.062.07.146.025.186zM4.128 14.069c-.055.039-.146.003-.201-.078-.055-.08-.055-.175.001-.214.056-.039.145-.005.202.076.055.08.055.177-.002.216zM4.614 14.57c-.05.055-.155.04-.231-.034-.08-.073-.1-.176-.05-.23.05-.055.154-.038.232.035.077.071.1.175.049.229zM5.285 14.86c-.023.07-.124.104-.225.074-.102-.031-.169-.114-.148-.185.02-.072.122-.104.225-.073.103.031.168.113.148.185zM6.02 14.914c.004.075-.083.136-.19.138-.107.003-.195-.059-.195-.132 0-.074.085-.135.192-.137.106-.001.194.058.194.131zM6.706 14.798c.013.073-.061.146-.169.167-.104.02-.2-.025-.214-.097-.014-.074.062-.149.167-.168.107-.02.202.025.216.098z"})),dr=w.createElement("defs",null,w.createElement("clipPath",{id:"github_svg__clip0"},w.createElement("path",{fill:"#fff",transform:"translate(0 .223)",d:"M0 0h18v17.554H0z"})));function fr(e,t){return w.createElement("svg",ur({width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t},e),cr,dr)}const pr=w.forwardRef(fr);function hr(){return(hr=Object.assign||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}).apply(this,arguments)}var mr=w.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16 2c2.702 0 5.158.655 7.232 1.828a13.01 13.01 0 014.94 4.94C29.345 10.842 30 13.298 30 16s-.655 5.158-1.828 7.232a13.01 13.01 0 01-4.94 4.94C21.158 29.345 18.702 30 16 30s-5.158-.655-7.232-1.828a13.01 13.01 0 01-4.94-4.94C2.655 21.158 2 18.702 2 16s.655-5.158 1.828-7.232a13.009 13.009 0 014.94-4.94C10.842 2.655 13.298 2 16 2z",fill:"#09F"}),vr=w.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.501 12.5c.552 0 .98.456.957 1.002l-.416 9.995a1.053 1.053 0 01-.924.996L16 24.5a1.058 1.058 0 01-1.042-1.003l-.355-8.502c-.013-.273-.23-.595-.474-.712l-1.322-.635a.599.599 0 01-.307-.498V13c0-.276.23-.5.502-.5H16.5zM16 7.5a1.5 1.5 0 110 3 1.5 1.5 0 010-3z",fill:"#fff"});function gr(e,t){return w.createElement("svg",hr({width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t},e),mr,vr)}const yr=w.forwardRef(gr);function br(){return(br=Object.assign||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}).apply(this,arguments)}var wr=w.createElement("path",{opacity:.9,d:"M1 1h8",stroke:"currentColor",strokeWidth:2,strokeLinecap:"square"});function xr(e,t){return w.createElement("svg",br({width:10,height:2,viewBox:"0 0 10 2",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t},e),wr)}const kr=w.forwardRef(xr);function Sr(){return(Sr=Object.assign||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}).apply(this,arguments)}var Cr=w.createElement("mask",{id:"person-circle_svg__a",height:20,maskUnits:"userSpaceOnUse",width:20,x:0,y:0},w.createElement("circle",{cx:10,cy:10,fill:"#fff",r:10})),_r=w.createElement("circle",{cx:10,cy:10,fill:"#000",fillOpacity:.4,r:10}),Er=w.createElement("g",{mask:"url(#person-circle_svg__a)"},w.createElement("path",{d:"M3.605 17.411a3 3 0 011.32-2.198l2.183-1.454c.563-.376.608-1.204.153-1.705-.7-.77-1.515-1.912-1.515-3.054 0-2 .25-6 4.25-6s4.25 4 4.25 6c0 1.142-.815 2.284-1.515 3.054-.455.5-.41 1.33.153 1.705l2.182 1.454a3 3 0 011.321 2.198l.249 2.49A1 1 0 0115.641 21H4.351a1 1 0 01-.995-1.1z",fill:"#000"}));function Tr(e,t){return w.createElement("svg",Sr({fill:"none",height:20,viewBox:"0 0 20 20",width:20,xmlns:"http://www.w3.org/2000/svg",ref:t},e),Cr,_r,Er)}const jr=w.forwardRef(Tr);function Or(){return(Or=Object.assign||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}).apply(this,arguments)}var Nr=w.createElement("g",{fillRule:"evenodd",clipRule:"evenodd",fill:"#000"},w.createElement("path",{d:"M5.08 11.074c.2-.234.3-.351.406-.425a1 1 0 011.076-.04c.11.064.22.173.438.391.218.218.327.327.392.438a1 1 0 01-.041 1.076c-.074.105-.19.206-.425.406l-5.39 4.62A.764.764 0 01.46 16.463l4.62-5.39z",fillOpacity:.6}),w.createElement("path",{d:"M10.303 1.697c.594-.594.891-.891 1.233-1.002a1.5 1.5 0 01.928 0c.342.111.639.408 1.233 1.002l2.606 2.606c.594.594.891.891 1.002 1.233a1.5 1.5 0 010 .928c-.111.342-.408.639-1.002 1.233l-2.769 2.769c-.2.2-.299.299-.383.41-.074.099-.14.204-.194.315a4.174 4.174 0 00-.196.526l-.942 2.827c-.271.813-.407 1.22-.66 1.408a1 1 0 01-.77.182c-.31-.055-.613-.359-1.22-.965L2.831 8.831c-.607-.607-.91-.91-.964-1.22a1 1 0 01.181-.77c.188-.253.595-.389 1.408-.66l2.827-.942c.268-.09.401-.134.526-.196a2 2 0 00.315-.194c.111-.084.211-.184.41-.383l2.769-2.769z"}));function Mr(e,t){return w.createElement("svg",Or({width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t},e),Nr)}const Lr=w.forwardRef(Mr);function Pr(){return(Pr=Object.assign||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}).apply(this,arguments)}var Ar=w.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 0v6h6v2H8v6H6V8H0V6h6V0h2z",fill:"currentColor"});function Dr(e,t){return w.createElement("svg",Pr({width:14,height:14,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t},e),Ar)}const Rr=w.forwardRef(Dr);function Ir(){return(Ir=Object.assign||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}).apply(this,arguments)}var Fr=w.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 0a4 4 0 100 8h10a4 4 0 000-8H4zm0 10a4 4 0 000 8h10a4 4 0 000-8H4zm2 4a2 2 0 11-4 0 2 2 0 014 0zm8-8a2 2 0 100-4 2 2 0 000 4z",fill:"#000"});function zr(e,t){return w.createElement("svg",Ir({width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t},e),Fr)}const Hr=w.forwardRef(zr);function Ur(){return(Ur=Object.assign||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}).apply(this,arguments)}var Br=w.createElement("path",{d:"M3.781 11.375c0 1.041-.85 1.891-1.89 1.891-1.041 0-1.891-.85-1.891-1.89 0-1.041.85-1.892 1.89-1.892h1.891v1.891zM4.734 11.375c0-1.04.85-1.89 1.891-1.89s1.891.85 1.891 1.89v4.735c0 1.04-.85 1.891-1.89 1.891-1.041 0-1.892-.85-1.892-1.891v-4.735z",fill:"#E01E5A"}),Wr=w.createElement("path",{d:"M6.625 3.782c-1.04 0-1.89-.85-1.89-1.891C4.734.85 5.584 0 6.624 0c1.041 0 1.891.85 1.891 1.891v1.89h-1.89zM6.625 4.734c1.04 0 1.891.85 1.891 1.891s-.85 1.891-1.89 1.891H1.89C.85 8.516 0 7.666 0 6.626c0-1.041.85-1.892 1.89-1.892h4.735z",fill:"#36C5F0"}),$r=w.createElement("path",{d:"M14.219 6.625c0-1.04.85-1.89 1.89-1.89 1.041 0 1.892.85 1.892 1.89 0 1.041-.85 1.891-1.891 1.891h-1.891v-1.89zM13.266 6.626c0 1.04-.85 1.89-1.891 1.89-1.04 0-1.891-.85-1.891-1.89V1.89c0-1.04.85-1.891 1.89-1.891 1.042 0 1.892.85 1.892 1.891v4.735z",fill:"#2EB67D"}),Vr=w.createElement("path",{d:"M11.374 14.219c1.04 0 1.89.85 1.89 1.89 0 1.041-.85 1.892-1.89 1.892s-1.891-.85-1.891-1.891v-1.891h1.89zM11.374 13.266c-1.04 0-1.89-.85-1.89-1.89 0-1.041.85-1.892 1.89-1.892h4.735c1.04 0 1.891.85 1.891 1.891s-.85 1.891-1.891 1.891h-4.735z",fill:"#ECB22E"});function qr(e,t){return w.createElement("svg",Ur({width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t},e),Br,Wr,$r,Vr)}const Gr=w.forwardRef(qr);function Yr(){return(Yr=Object.assign||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}).apply(this,arguments)}var Xr=w.createElement("g",{fillRule:"evenodd",clipRule:"evenodd",fill:"#000"},w.createElement("path",{d:"M1 1h18v14H1V1z",fillOpacity:.4}),w.createElement("path",{d:"M.163.819C0 1.139 0 1.559 0 2.4v11.2c0 .84 0 1.26.163 1.581a1.5 1.5 0 00.656.655c.32.164.74.164 1.581.164h15.2c.84 0 1.26 0 1.581-.164a1.5 1.5 0 00.655-.655c.164-.32.164-.74.164-1.581V2.4c0-.84 0-1.26-.163-1.581a1.5 1.5 0 00-.656-.656C18.861 0 18.441 0 17.6 0H2.4C1.56 0 1.14 0 .819.163A1.5 1.5 0 00.163.82zM5.42 3.815a1.5 1.5 0 00-1.98.124l-.124.142a1.5 1.5 0 00.124 1.98L5.378 8 3.439 9.94l-.124.14a1.5 1.5 0 002.246 1.98l3-3 .124-.14a1.5 1.5 0 00-.124-1.98l-3-3-.142-.125z"}));function Kr(e,t){return w.createElement("svg",Yr({width:20,height:16,viewBox:"0 0 20 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t},e),Xr)}const Qr=w.forwardRef(Kr);function Jr(){return(Jr=Object.assign||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}).apply(this,arguments)}var Zr=w.createElement("path",{d:"M28 17V0H3C1.337 0 0 1.337 0 3v58c0 1.663 1.337 3 3 3h42c1.663 0 3-1.337 3-3V20H31c-1.65 0-3-1.35-3-3zm8.148 27.001H28v10a2 2 0 01-2 2h-4a2 2 0 01-2-2v-10h-8.148c-1.784 0-2.676-2.161-1.408-3.42L22.496 28.62a2.131 2.131 0 013.005 0L37.554 40.58c1.268 1.259.378 3.42-1.407 3.42zm10.977-30.876L34.888.875A2.998 2.998 0 0032.763 0H32v16h16v-.762a2.99 2.99 0 00-.875-2.113z"});function ei(e,t){return w.createElement("svg",Jr({width:48,height:64,viewBox:"0 0 48 64",fill:"#1890FF",xmlns:"http://www.w3.org/2000/svg",ref:t},e),Zr)}const ti=w.forwardRef(ei);var ni=n(5893);const ri=null!=="ls-"?"ls-":"dm-",ii=w.createContext(null),oi=(e,t={})=>{const{elem:n,mix:r,mod:i}=null!=t?t:{},o=e,a={block:e=>oi(e,{elem:n,mix:r,mod:i}),elem:t=>oi(e,{elem:t,mix:r,mod:i}),mod(t={}){const a=Object.assign({},null!=i?i:{},t);return oi(null!=e?e:o,{elem:n,mix:r,mod:a})},mix:(...t)=>oi(e,{elem:n,mix:t,mod:i}),select(e=document){return e.querySelector(this.toCSSSelector())},selectAll(e=document){return e.querySelectorAll(this.toCSSSelector())},closest(e){return e.closest(this.toCSSSelector())},toString:()=>((e,t,n,r)=>{const i=e,o=t?`${i}__${t}`:null,a=Object.entries(null!=r?r:{}).reduce(((e,[t,n])=>{const r=[null!=o?o:i];return null==n||!1!==n&&(r.push(t),!0!==n&&r.push(n),e.push(r.join("_"))),e}),[]),s=[];if(s.push(null!=o?o:i),s.push(...a),n){const e=Array.isArray(n)?n:[n],t=[].concat(...e).filter((e=>null!=e&&""!==e)).map((e=>{return"string"==typeof e?e:null==e||null===(t=e.toClassName)||void 0===t?void 0:t.call(e);var t})).reduce(((e,t)=>[...e,...t.split(/\s+/)]),[]);s.push(...t)}return s.map((e=>new RegExp(ri).test(e)?e:`${ri}${e}`)).join(" ")})(e,n,r,i),toClassName(){return this.toString()},toCSSSelector(){return`.${this.toClassName().replace(/(\s+)/g,".")}`}};return Object.defineProperty(a,"Block",{value:si}),Object.defineProperty(a,"Elem",{value:li}),Object.defineProperty(a,"__class",{value:{block:e,elem:n,mix:r,mod:i}}),a},ai=e=>{const t=null!=e?e:w.createContext(null),n=w.forwardRef((({tag:e="div",name:n,mod:r,mix:i,...o},a)=>{const s=oi(n),l=[].concat(i).filter((e=>!!e)),u=s.mod(r).mix(...l,o.className).toClassName(),c={...o,ref:a,className:u};return(0,ni.jsx)(t.Provider,{value:s,children:w.createElement(e,c)})}));n.displayName="Block";const r=w.forwardRef((({tag:e="div",component:n,block:r,name:i,mod:o,mix:a,...s},l)=>{const u=w.useContext(t),c=[].concat(a).filter((e=>!!e)),d=(r?oi(r):u).elem(i).mod(o).mix(...c,s.className).toClassName(),f={...s,ref:l,className:d};return"string"!=typeof e&&(f.block=u),n&&(f.tag=e),w.createElement(null!=n?n:e,f)}));return r.displayName="Elem",{Block:n,Elem:r,Context:t}},{Block:si,Elem:li}=ai(ii),ui=(e,t=((e,t)=>e===t))=>e.reduce(((e,n)=>(e.findIndex((e=>t(e,n)))<0&&e.push(n),e)),[]),ci=e=>null!=e,di=e=>"string"==typeof e&&""===e.trim(),fi=e=>{const t=Object.entries(e).filter((e=>ci(e[1])&&""!==e[1])).map((([e,t])=>"[object Object]"===Object.prototype.toString.call(t)?[e,fi(t)]:[e,t]));return Object.fromEntries(t)},pi=(e="")=>e.match(/^https?/)||e.match(/^\/\//)?e:[APP_SETTINGS.hostname.replace(/([/]+)$/,""),e.replace(/^([/]+)/,"")].join("/"),hi=e=>{const t=document.createElement("textarea");document.body.appendChild(t),t.value=e,t.focus(),t.select(),document.execCommand("copy"),t.remove()},mi=(0,w.createContext)();mi.displayName="FormContext";const vi=(0,w.createContext)();vi.displayName="FormValidationContext";const gi=(0,w.createContext)();gi.displayName="FormSubmissionContext";const yi=(0,w.createContext)();yi.displayName="FormStateContext";const bi=(0,w.createContext)();bi.displayName="FormResponseContext";const wi=w.forwardRef((({children:e,type:t,extra:n,className:r,size:i,waiting:o,icon:a,tag:s,look:l,...u},c)=>{const d=null!=s?s:u.href?"a":"button",f={size:i,waiting:o,type:t,look:null!=l?l:[],withIcon:!!a,withExtra:!!n};var p,h;!0===w.useContext(gi)&&(null!==(p=f.look)&&void 0!==p&&null!==(h=p.includes)&&void 0!==h&&h.call(p,"primary")&&"submit"===t?f.waiting=!0:u.disabled=!0);u.primary&&(f.look="primary",delete u.primary);const m=w.useMemo((()=>{if(!a)return null;if(ci(a.props.size))return a;switch(i){case"small":return w.cloneElement(a,{...a.props,size:12,width:12,height:12});case"compact":return w.cloneElement(a,{...a.props,size:14,width:14,height:14});default:return a}}),[a,i]);return(0,ni.jsx)(si,{name:"button",mod:f,mix:r,ref:c,tag:d,type:t,...u,children:(0,ni.jsxs)(ni.Fragment,{children:[m&&(0,ni.jsx)(li,{tag:"span",name:"icon",children:m}),m&&e?(0,ni.jsx)("span",{children:e}):e,void 0!==n?(0,ni.jsx)(li,{name:"extra",children:n}):null]})})}));wi.displayName="Button",wi.Group=({className:e,children:t,collapsed:n})=>(0,ni.jsx)(si,{name:"button-group",mod:{collapsed:n},mix:e,children:t});const{Block:xi}=ai(),ki=({direction:e="horizontal",size:t,className:n,style:r,children:i,spread:o,stretch:a,align:s})=>(0,ni.jsx)(xi,{name:"space",mod:{direction:e,size:t,spread:o,stretch:a,align:s},mix:n,style:r,children:i}),Si=({title:e,message:t,errorId:n,stacktrace:r,validation:i,version:o,onGoBack:a,onReload:s,possum:l=!1})=>{const u=(0,w.useMemo)((()=>(null!=r?r:"").trim()),[r]),[c,d]=(0,w.useState)(!1),f=(0,w.useCallback)((()=>{d(!0),hi(u),setTimeout((()=>d(!1)),1200)}),[u]);return(0,ni.jsxs)(si,{name:"error-message",children:[!1!==l&&(0,ni.jsx)(li,{tag:"img",name:"heidi",src:pi("/static/images/opossum_broken.svg"),height:"111",alt:"Heidi's down"}),e&&(0,ni.jsx)(li,{name:"title",children:e}),t&&(0,ni.jsx)(li,{name:"detail",dangerouslySetInnerHTML:{__html:String(t)}}),u&&(0,ni.jsx)(li,{name:"stracktrace",dangerouslySetInnerHTML:{__html:u.replace(/(\n)/g,"<br>")}}),(null==i?void 0:i.length)>0&&(0,ni.jsx)(li,{tag:"ul",name:"validation",children:i.map((([e,t])=>(0,ni.jsx)(w.Fragment,{children:[].concat(t).map(((e,t)=>(0,ni.jsx)(li,{tag:"li",name:"message",dangerouslySetInnerHTML:{__html:e}},t)))},e)))}),(o||n)&&(0,ni.jsx)(li,{name:"version",children:(0,ni.jsxs)(ki,{children:[o&&`Version: ${o}`,n&&`Error ID: ${n}`]})}),(0,ni.jsx)(li,{name:"actions",children:(0,ni.jsxs)(ki,{spread:!0,children:[(0,ni.jsx)(li,{tag:wi,name:"action-slack",target:"_blank",icon:(0,ni.jsx)(Gr,{}),href:"http://slack.labelstud.io.s3-website-us-east-1.amazonaws.com?source=product-error-msg",children:"Ask on Slack"}),(0,ni.jsxs)(ki,{size:"small",children:[u&&(0,ni.jsx)(wi,{disabled:c,onClick:f,style:{width:180},children:c?"Copied":"Copy Stacktrace"}),a&&(0,ni.jsx)(wi,{onClick:a,children:"Go Back"}),s&&(0,ni.jsx)(wi,{onClick:s,children:"Reload"})]})]})})]})},Ci=(0,w.createContext)(window.APP_SETTINGS);Ci.displayName="ConfigContext";Ci.Consumer;const _i=({children:e})=>{var t;const[n,r]=(0,w.useState)(null!==(t=window.APP_SETTINGS)&&void 0!==t?t:{}),i=e=>{e&&r(e)},o=(0,w.useMemo)((()=>({...n,update:i})),[n]);return(0,ni.jsx)(Ci.Provider,{value:o,children:e})},Ei=()=>(0,w.useContext)(Ci),Ti=(0,w.createContext)(),ji=({children:e})=>{const t=Vi(),[n,r]=(0,w.useState)(),i=(0,w.useCallback)((()=>{t.callApi("me").then((e=>{r(e)}))}),[t.callApi]);return(0,w.useEffect)((()=>{i()}),[i]),(0,ni.jsx)(Ti.Provider,{value:{user:n,fetch:i},children:e})},Oi=e=>{var t;let n=e.children||null;if(!e.providers)throw"MultiProvider: Missing providers prop";if(!e.children)throw"MultiProvider: Missing children";return e.providers.length?([...null!==(t=e.providers)&&void 0!==t?t:[]].reverse().forEach((e=>{n=w.cloneElement(e,null,n)})),n):n},Ni=(e,{init:t,transition:n,onStart:r,beforeTransition:i,afterTransition:o}={})=>new Promise((async a=>{null==t||t(e);const s=()=>{null==r||r(e)},l=async()=>{await(null==o?void 0:o(e)),e.removeEventListener("transitionstart",s),e.removeEventListener("transitionend",l),a()};e.addEventListener("transitionstart",s),e.addEventListener("transitionend",l),await(null==i?void 0:i()),setTimeout((()=>n(e)),30)}));function Mi(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const{Block:Li,Elem:Pi}=ai(),Ai=(0,w.createContext)();class Di extends w.Component{constructor(e){var t;super(e),Mi(this,"modalRef",w.createRef()),Mi(this,"onClickOutside",(e=>{if(!this.modalRef.current)return;const{closeOnClickOutside:t}=this.props,n=!1!==this.props.allowClose,r=this.modalRef.current.contains(e.target),i=oi("modal").elem("content").closest(e.target),o=oi("modal").elem("close").closest(e.target);n&&(r&&o||null===i&&!1!==t)&&this.hide()})),Mi(this,"closeOnEscape",(e=>{!1!==this.props.allowClose&&"Escape"===e.key&&this.state.visible&&(e.stopPropagation(),e.preventDefault(),this.hide())})),this.state={title:e.title,body:e.body,footer:e.footer,visible:!e.animateAppearance&&(null!==(t=e.visible)&&void 0!==t&&t),transition:e.visible?"visible":null}}componentDidMount(){this.props.animateAppearance&&setTimeout((()=>this.show()),30),document.addEventListener("keydown",this.closeOnEscape,{capture:!0})}componentWillUnmount(){document.removeEventListener("keydown",this.closeOnEscape,{capture:!0})}componentDidUpdate(e,t){t.visible!==this.state.visible&&(document.body.style.overflow=this.state.visible?"hidden":"")}setBody(e){this.setState({body:e})}show(e){return new Promise((t=>{this.setState({visible:!0},(async()=>{var n,r;null==e||e(),null===(n=(r=this.props).onShow)||void 0===n||n.call(r),await this.transition("appear",t)}))}))}hide(e){return new Promise((t=>{this.transition("disappear",(()=>{this.setState({visible:!1},(()=>{var n,r;null===(n=(r=this.props).onHide)||void 0===n||n.call(r),t(),null==e||e()}))}))}))}render(){if(!this.state.visible)return null;const e=this.props.bare,t={fullscreen:!!this.props.fullscreen,bare:this.props.bare,visible:this.props.visible||this.state.visible},n=[this.transitionClass,this.props.className],r={};this.props.width&&(r.width=this.props.width),this.props.height&&(r.height=this.props.height);const i=(0,ni.jsx)(Ai.Provider,{value:this,children:(0,ni.jsx)(Li,{name:"modal",ref:this.modalRef,mod:t,mix:n,onClick:this.onClickOutside,children:(0,ni.jsx)(Pi,{name:"wrapper",children:(0,ni.jsxs)(Pi,{name:"content",style:Object.assign({},this.props.style,r),children:[!e&&(0,ni.jsxs)(Di.Header,{children:[(0,ni.jsx)(Pi,{name:"title",children:this.state.title}),!1!==this.props.allowClose&&(0,ni.jsx)(Pi,{tag:wi,name:"close",type:"text",icon:(0,ni.jsx)(Vn,{})})]}),(0,ni.jsx)(Pi,{name:"body",mod:{bare:e},children:this.body}),this.props.footer&&(0,ni.jsx)(Di.Footer,{bare:this.props.bareFooter,children:this.footer})]})})})});return(0,x.createPortal)(i,document.body)}transition(e,t){return Ni(this.modalRef.current,{transition:async()=>new Promise((t=>{this.setState({transition:e},(()=>{t()}))})),beforeTransition:async()=>new Promise((t=>{this.setState({transition:`before-${e}`},(()=>{t()}))})),afterTransition:async()=>new Promise((n=>{this.setState({transition:"appear"===e?"visible":null},(()=>{null==t||t(),n()}))}))})}get transitionClass(){switch(this.state.transition){case"before-appear":return"before-appear";case"appear":return"appear before-appear";case"before-disappear":return"before-disappear";case"disappear":return"disappear before-disappear";case"visible":return"visible"}return null}get body(){if(this.state.body){const e=this.state.body;return e instanceof Function?(0,ni.jsx)(e,{}):e}return this.props.children}get footer(){if(this.state.footer){const e=this.state.footer;return e instanceof Function?(0,ni.jsx)(e,{}):e}return null}}Di.Header=({children:e,divided:t})=>(0,ni.jsx)(Pi,{name:"header",mod:{divided:t},children:e}),Di.Footer=({children:e,bare:t})=>(0,ni.jsx)(Pi,{name:"footer",mod:{bare:t},children:e});const Ri=e=>{const t=(0,w.createRef)(),n=document.createElement("div");let r=0;n.className=oi("modal-holder").toClassName(),document.body.appendChild(n);const i=(e,i)=>{r++,(0,x.render)((0,ni.jsx)(Oi,{providers:e.simple?[]:[(0,ni.jsx)(_i,{},"config"),(0,ni.jsx)($i,{},"api"),(0,ni.jsx)(ji,{},"current-user")],children:(0,ni.jsx)(Di,{ref:t,...e,onHide:()=>{var t;null===(t=e.onHidden)||void 0===t||t.call(e),(0,x.unmountComponentAtNode)(n),n.remove()},animateAppearance:i})},`modal-${r}`),n)};return i(e,!0),{update(t){i({...e,...null!=t?t:{},visible:!0},!1)},close(){const e=t.current.hide();return(0,x.unmountComponentAtNode)(n),n.remove(),e}}},Ii=({okText:e,onOk:t,cancelText:n,onCancel:r,buttonLook:i,...o})=>{const a=Ri({...o,allowClose:!1,footer:(0,ni.jsxs)(ki,{align:"end",children:[(0,ni.jsx)(wi,{onClick:()=>{null==r||r(),a.close()},size:"compact",autoFocus:!0,children:null!=n?n:"Cancel"}),(0,ni.jsx)(wi,{onClick:()=>{null==t||t(),a.close()},size:"compact",look:null!=i?i:"primary",children:null!=e?e:"OK"})]})});return a};Object.assign(Di,{info:({okText:e,onOkPress:t,...n})=>{const r=Ri({...n,footer:(0,ni.jsx)(ki,{align:"end",children:(0,ni.jsx)(wi,{onClick:()=>{null==t||t(),r.close()},look:"primary",size:"compact",children:null!=e?e:"OK"})})});return r},confirm:Ii,modal:Ri});const Fi={gateway:`${window.APP_SETTINGS.hostname}/api`,endpoints:{users:"/users",me:"/current-user/whoami",memberships:"/organizations/:pk/memberships",inviteLink:"/invite",resetInviteLink:"POST:/invite/reset-token",projects:"/projects",project:"/projects/:pk",updateProject:"PATCH:/projects/:pk",createProject:"POST:/projects",deleteProject:"DELETE:/projects/:pk",configTemplates:"/templates",validateConfig:"POST:/projects/:pk/validate",createSampleTask:"POST:/projects/:pk/sample-task",fileUploads:"/projects/:pk/file-uploads",deleteFileUploads:"DELETE:/projects/:pk/file-uploads",importFiles:"POST:/projects/:pk/import",reimportFiles:"POST:/projects/:pk/reimport",dataSummary:"/projects/:pk/summary",deleteTabs:"DELETE:/dm/views/reset",listStorages:"/storages/:target?",storageTypes:"/storages/:target?/types",storageForms:"/storages/:target?/:type/form",createStorage:"POST:/storages/:target?/:type",deleteStorage:"DELETE:/storages/:target?/:type/:pk",updateStorage:"PATCH:/storages/:target?/:type/:pk",syncStorage:"POST:/storages/:target?/:type/:pk/sync",validateStorage:"POST:/storages/:target?/:type/validate",mlBackends:"GET:/ml",mlBackend:"GET:/ml/:pk",addMLBackend:"POST:/ml",updateMLBackend:"PATCH:/ml/:pk",deleteMLBackend:"DELETE:/ml/:pk",trainMLBackend:"POST:/ml/:pk/train",predictWithML:"POST:/ml/:pk/predict",modelVersions:"/projects/:pk/model-versions",export:"/projects/:pk/export",previousExports:"/projects/:pk/export/files",exportFormats:"/projects/:pk/export/formats",version:"/version"},alwaysExpectJSON:!1};function zi(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Hi=new class{constructor(e){var t,n,r,i,o;zi(this,"gateway",null),zi(this,"commonHeaders",{}),zi(this,"mockDelay",0),zi(this,"mockDisabled",!1),zi(this,"requestMode","same-origin"),zi(this,"sharedParams",{}),this.commonHeaders=null!==(t=e.commonHeaders)&&void 0!==t?t:{},this.gateway=this.resolveGateway(e.gateway),this.requestMode=this.detectMode(),this.mockDelay=null!==(n=e.mockDelay)&&void 0!==n?n:0,this.mockDisabled=null!==(r=e.mockDisabled)&&void 0!==r&&r,this.sharedParams=null!==(i=e.sharedParams)&&void 0!==i?i:{},this.alwaysExpectJSON=null===(o=e.alwaysExpectJSON)||void 0===o||o,this.resolveMethods(e.endpoints)}isValidMethod(e){return this[e]instanceof Function}resolveGateway(e){if(e instanceof URL)return e.toString();try{return new URL(e).toString()}catch(t){const n=new URL(window.location.href);return n.search="",n.hash="","/"===e[0]?n.pathname=e.replace(/([/])$/,""):n.pathname=`${n.pathname}/${e}`.replace(/([/]+)/g,"/").replace(/([/])$/,""),n.toString()}}detectMode(){return window.location.origin===new URL(this.gateway).origin?"same-origin":"cors"}resolveMethods(e,t){if(e){new Map(Object.entries(e)).forEach(((e,n)=>{const{scope:r,...i}=this.getSettings(e);Object.defineProperty(this,n,{value:this.createApiCallExecutor(i,[t])}),Object.defineProperty(this,`${n}Raw`,{value:this.createApiCallExecutor(i,[t],!0)}),r&&this.resolveMethods(r,[...null!=t?t:[],i.path])}))}}createApiCallExecutor(e,t,n=!1){return async(r,{headers:i,body:o}={})=>{let a,s;try{var l,u,c,d;const f={...null!=r?r:{},...null!==(l=this.sharedParams)&&void 0!==l?l:{}},{method:p,url:h}=this.createUrl(e.path,f,t),m=null!=p?p:(null!==(u=e.method)&&void 0!==u?u:"get").toUpperCase(),v=Object.assign(this.getDefaultHeaders(m),null!==(c=this.commonHeaders)&&void 0!==c?c:{},null!==(d=e.headers)&&void 0!==d?d:{},null!=i?i:{}),g=new Headers(v),y={method:m,headers:g,mode:this.requestMode,credentials:"cors"===this.requestMode?"omit":"same-origin"};if("GET"!==m){const e=g.get("Content-Type"),{sharedParams:t}=this;let n=null!=o?o:{};n instanceof FormData?Object.entries(null!=t?t:{}).forEach((([e,t])=>{n.append(e,t)})):Object.assign(n,{...null!=t?t:{},...null!=o?o:{}}),n instanceof FormData?y.body=n:y.body="multipart/form-data"===e?this.createRequestBody(n):"application/json"===e?this.bodyToJSON(n):n,"multipart/form-data"===e&&g.delete("Content-Type")}let b;if(e.mock,b=await fetch(h,y),s={headers:new Map(Array.from(b.headers)),status:b.status,url:b.url},n)return b;if(b.ok){const t=await b.text();try{const n=204!==b.status?JSON.parse(this.alwaysExpectJSON?t:t||"{}"):{ok:!0};if(e.convert instanceof Function)return await e.convert(n);a=n}catch(e){a=this.generateException(e,t)}}else a=this.generateError(b)}catch(e){a=this.generateException(e)}return Object.defineProperty(a,"$meta",{value:s,configurable:!1,enumerable:!1,writable:!1}),a}}getSettings(e){return"string"==typeof e&&(e={path:e}),{method:"GET",mock:void 0,convert:void 0,scope:void 0,...e}}getDefaultHeaders(e){switch(e){case"POST":case"PATCH":case"DELETE":return{"Content-Type":"application/json"};default:return{}}}createUrl(e,t={},n){const r=new URL(this.gateway),i=[],{path:o,method:a}=this.resolveEndpoint(e,t),s=[].concat(...null!=n?n:[],o).filter((e=>void 0!==e)).join("/").replace(/([/]+)/g,"/").replace(/:([^/]+)/g,((...e)=>{const n=e[1],[r,o]=n.match(/([^?]+)(\??)/).slice(1,3),a=t[r];if(i.push(r),void 0===a){if("?"===o)return"";throw new Error(`Can't find key \`${r}\` in data`)}return a}));return r.pathname+=s.replace(/\/+/g,"/").replace(/\/+$/g,""),t&&"object"==typeof t&&Object.entries(t).forEach((([e,t])=>{i.includes(e)||r.searchParams.set(e,t)})),{url:r.toString(),method:a}}resolveEndpoint(e,t){var n;let r;r=e instanceof Function?e(t):e;const i=/^(GET|POST|PATCH|DELETE|PUT|HEAD|OPTIONS):/;return{method:null===(n=r.match(i))||void 0===n?void 0:n[1],path:r.replace(i,"")}}createRequestBody(e){if(e instanceof FormData)return e;const t=new FormData;return Object.entries(e).forEach((([e,n])=>{t.append(e,n)})),t}bodyToJSON(e){const t=(n=e)instanceof FormData==0?n:Array.from(n.entries()).reduce(((e,[t,n])=>({...e,[t]:n})),{});var n;return JSON.stringify(t)}async generateError(e,t){var n;const r=(async()=>{const t=await e.text();try{return JSON.parse(t)}catch(e){return t}})();return{status:e.status,error:(null!==(n=null==t?void 0:t.message)&&void 0!==n?n:e.statusText)||"Server Error",response:await r}}generateException(e,t){console.error(e);return{error:e.message,details:(()=>{try{return JSON.parse(t)}catch(e){return t}})()}}mockRequest(e,t,n,r){return new Promise((async i=>{let o=null,a=!0;try{const i=new Request(n);"string"==typeof n.body&&(i.body=JSON.parse(n.body)),o=await r.mock(e,null!=t?t:{},i)}catch(e){console.error(e),a=!1}setTimeout((()=>{i({ok:a,json:()=>Promise.resolve(o)})}),this.mockDelay)}))}}(Fi),Ui=(0,w.createContext)();Ui.displayName="ApiContext";const Bi=e=>{var t,n,r,i;const{response:o}=e;return{isShutdown:"Failed to fetch"===String(null!==(t=null==o?void 0:o.detail)&&void 0!==t?t:null==e?void 0:e.error),title:e.error?"Runtime error":"Server error",message:null!==(n=null==o?void 0:o.detail)&&void 0!==n?n:null==e?void 0:e.error,stacktrace:null!==(r=null==o?void 0:o.exc_info)&&void 0!==r?r:null,version:null==o?void 0:o.version,validation:Object.entries(null!==(i=null==o?void 0:o.validation_errors)&&void 0!==i?i:{})}},Wi=async(e,t=!0)=>{let n=e;if(n instanceof Response&&(n=await Hi.generateError(e)),401!==e.status){if(t){const{isShutdown:e,...t}=Bi(n);Ri({allowClose:!e,simple:!0,body:e?(0,ni.jsx)(Si,{possum:!1,title:"Connection refused",message:"Server not responding. Is it still running?"}):(0,ni.jsx)(Si,{...t}),simple:!0,style:{width:680}})}}else location.href=pi("/")},$i=(0,w.forwardRef)((({children:e},t)=>{const[n,r]=(0,w.useState)(null),i=(0,w.useCallback)((async(e,{params:t={},errorFilter:n,...i}={})=>{r(null);const a=await Hi[e](t,i);if(a.error){const e=!1===(null==n?void 0:n(a));if(!n||e)return r(a),Wi(a,o.showModal),null}return a}),[]),o=(0,w.useMemo)((()=>({api:Hi,callApi:i,handleError:Wi,error:n,showModal:!0,errorFormatter:Bi,isValidMethod:(...e)=>Hi.isValidMethod(...e)})),[n]);return(0,w.useEffect)((()=>{t&&(t.current=o)}),[t]),(0,ni.jsx)(Ui.Provider,{value:o,children:e})})),Vi=()=>(0,w.useContext)(Ui),qi=w.createContext({});qi.displayName="AppStoreContext";const Gi=({children:e})=>{const[t,n]=w.useState({}),r=w.useCallback((e=>{n({...t,...null!=e?e:{}})}),[t]),i=w.useMemo((()=>({store:t,update:r})),[t,r]);return(0,ni.jsx)(qi.Provider,{value:i,children:e})},Yi=()=>w.useContext(qi),Xi=new Map,Ki=new Map,Qi=(0,w.createContext)({}),Ji=({libraries:e,children:t})=>{const n=(0,w.useMemo)((()=>(e=>async t=>{var n;const{scriptSrc:r,cssSrc:i,checkAvailability:o}=e[t],a=o(),s=null!==(n=Xi.get(t))&&void 0!==n?n:new Set;if(Xi.set(t,s),a)return a;const l=new Promise((e=>{s.add((()=>{setTimeout((()=>{e(o())}),10)}))}));return Ki.has(t)||Ki.set(t,(async()=>{const e=[];r&&e.push(new Promise((e=>{const t=document.createElement("script");t.type="text/javascript",t.onload=()=>{e()},t.src=r,t.dataset.replaced=!0,document.head.appendChild(t)}))),i&&e.push(new Promise((e=>{const t=document.createElement("link");t.rel="stylesheet",t.type="text/css",t.onload=()=>{e()},t.href=i,t.dataset.replaced=!0,document.head.appendChild(t)}))),await Promise.all(e),s.forEach((e=>e()))})()),l})(e)),[e]);return(0,ni.jsx)(Qi.Provider,{value:{requestLibrary:n},children:t})},Zi=e=>{const t=(0,w.useContext)(Qi),[n,r]=(0,w.useState)(),i=(0,w.useCallback)((async()=>{const n=await t.requestLibrary(e);r(!!n)}),[t,e]);return(0,w.useEffect)((()=>{i()}),[i]),n};function eo(e,t){if(e===t)return!0;if(!e||!t)return!1;var n=Object.keys(e),r=Object.keys(t),i=n.length;if(r.length!==i)return!1;for(var o=0;o<i;o++){var a=n[o];if(e[a]!==t[a]||!Object.prototype.hasOwnProperty.call(t,a))return!1}return!0}function to(e){return"/"===e.charAt(0)?e:"/"+e}function no(e){return"/"===e.charAt(0)?e.substr(1):e}function ro(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function io(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function oo(e){var t=e.pathname,n=e.search,r=e.hash,i=t||"/";return n&&"?"!==n&&("?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&("#"===r.charAt(0)?r:"#"+r),i}function ao(e,t,n,i){var o;"string"==typeof e?(o=function(e){var t=e||"/",n="",r="",i=t.indexOf("#");-1!==i&&(r=t.substr(i),t=t.substr(0,i));var o=t.indexOf("?");return-1!==o&&(n=t.substr(o),t=t.substr(0,o)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e)).state=t:(void 0===(o=r({},e)).pathname&&(o.pathname=""),o.search?"?"!==o.search.charAt(0)&&(o.search="?"+o.search):o.search="",o.hash?"#"!==o.hash.charAt(0)&&(o.hash="#"+o.hash):o.hash="",void 0!==t&&void 0===o.state&&(o.state=t));try{o.pathname=decodeURI(o.pathname)}catch(e){throw e instanceof URIError?new URIError('Pathname "'+o.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):e}return n&&(o.key=n),i?o.pathname?"/"!==o.pathname.charAt(0)&&(o.pathname=a(o.pathname,i.pathname)):o.pathname=i.pathname:o.pathname||(o.pathname="/"),o}function so(){var e=null;var t=[];return{setPrompt:function(t){return t,function(){e===t&&null}},confirmTransitionTo:function(t,n,r,i){if(null!=e){var o="function"==typeof e?e(t,n):e;"string"==typeof o?"function"==typeof r?r(o,i):i(!0):i(!1!==o)}else i(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){!1,t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t.forEach((function(e){return e.apply(void 0,n)}))}}}var lo=!("undefined"==typeof window||!window.document||!window.document.createElement);function uo(e,t){t(window.confirm(e))}var co="popstate",fo="hashchange";function po(){try{return window.history.state||{}}catch(e){return{}}}function ho(e){void 0===e&&{},lo||l(!1);var t,n=window.history,i=(-1===window.navigator.userAgent.indexOf("Android 2.")&&-1===t.indexOf("Android 4.0")||-1===t.indexOf("Mobile Safari")||-1!==t.indexOf("Chrome")||-1!==t.indexOf("Windows Phone"))&&window.history&&"pushState"in window.history,o=!(-1===window.navigator.userAgent.indexOf("Trident")),a=e,s=a.forceRefresh,u=void 0!==s&&s,c=a.getUserConfirmation,d=void 0===c?uo:c,f=a.keyLength,p=void 0===f?6:f,h=e.basename?io(to(e.basename)):"";function m(e){var t=e||{},n=t.key,r=t.state,i=window.location,o=i.pathname+i.search+i.hash;return h&&ro(o,h),ao(o,r,n)}function v(){return Math.random().toString(36).substr(2,p)}var g=so();function y(e){r(N,e),N.length=n.length,g.notifyListeners(N.location,N.action)}function b(e){(function(e){return void 0===e.state&&-1===navigator.userAgent.indexOf("CriOS")})(e)||k(m(e.state))}function w(){k(m(po()))}var x=!1;function k(e){if(x)!1,y();else{g.confirmTransitionTo(e,"POP",d,(function(t){t?y({action:"POP",location:e}):function(e){var t=N.location,n=C.indexOf(t.key);-1===n&&0;var r=C.indexOf(e.key);-1===r&&0;var i=n-r;i&&(!0,E(i))}(e)}))}}var S=m(po()),C=[S.key];function _(e){return h+oo(e)}function E(e){n.go(e)}var T=0;function j(e){1===(T+=e)&&1===e?(window.addEventListener(co,b),o&&window.addEventListener(fo,w)):0===T&&(window.removeEventListener(co,b),o&&window.removeEventListener(fo,w))}var O=!1;var N={length:n.length,action:"POP",location:S,createHref:_,push:function(e,t){var r="PUSH",o=ao(e,t,v(),N.location);g.confirmTransitionTo(o,r,d,(function(e){if(e){var t=_(o),a=o.key,s=o.state;if(i)if(n.pushState({key:a,state:s},null,t),u)window.location.href=t;else{var l=C.indexOf(N.location.key),c=C.slice(0,l+1);c.push(o.key),c,y({action:r,location:o})}else window.location.href=t}}))},replace:function(e,t){var r="REPLACE",o=ao(e,t,v(),N.location);g.confirmTransitionTo(o,r,d,(function(e){if(e){var t=_(o),a=o.key,s=o.state;if(i)if(n.replaceState({key:a,state:s},null,t),u)window.location.replace(t);else{var l=C.indexOf(N.location.key);-1!==l&&(C[l]=o.key),y({action:r,location:o})}else window.location.replace(t)}}))},go:E,goBack:function(){E(-1)},goForward:function(){E(1)},block:function(e){void 0===e&&!1;var t=g.setPrompt(e);return O||(j(1),!0),function(){return O&&(!1,j(-1)),t()}},listen:function(e){var t=g.appendListener(e);return j(1),function(){j(-1),t()}}};return N}var mo="hashchange",vo={hashbang:{encodePath:function(e){return"!"===e.charAt(0)?e:"!/"+no(e)},decodePath:function(e){return"!"===e.charAt(0)?e.substr(1):e}},noslash:{encodePath:no,decodePath:to},slash:{encodePath:to,decodePath:to}};function go(e){var t=e.indexOf("#");return-1===t?e:e.slice(0,t)}function yo(){var e=window.location.href,t=e.indexOf("#");return-1===t?"":e.substring(t+1)}function bo(e){window.location.replace(go(window.location.href)+"#"+e)}function wo(e){void 0===e&&{},lo||l(!1);var t=window.history,n=(window.navigator.userAgent.indexOf("Firefox"),e),i=n.getUserConfirmation,o=void 0===i?uo:i,a=n.hashType,s=void 0===a?"slash":a,u=e.basename?io(to(e.basename)):"",c=vo[s],d=c.encodePath,f=c.decodePath;function p(){var e=f(yo());return u&&ro(e,u),ao(e)}var h=so();function m(e){r(T,e),T.length=t.length,h.notifyListeners(T.location,T.action)}var v=!1,g=null;function y(){var e,t,n=yo(),r=d(n);if(n!==r)bo(r);else{var i=p(),a=T.location;if(!v&&(i,a.pathname===t.pathname&&e.search===t.search&&e.hash===t.hash))return;if(g===oo(i))return;null,function(e){if(v)!1,m();else{var t="POP";h.confirmTransitionTo(e,t,o,(function(n){n?m({action:t,location:e}):function(e){var t=T.location,n=k.lastIndexOf(oo(t));-1===n&&0;var r=k.lastIndexOf(oo(e));-1===r&&0;var i=n-r;i&&(!0,S(i))}(e)}))}}(i)}}var b=yo(),w=d(b);b!==w&&bo(w);var x=p(),k=[oo(x)];function S(e){t.go(e)}var C=0;function _(e){1===(C+=e)&&1===e?window.addEventListener(mo,y):0===C&&window.removeEventListener(mo,y)}var E=!1;var T={length:t.length,action:"POP",location:x,createHref:function(e){var t=document.querySelector("base"),n="";return t&&t.getAttribute("href")&&go(window.location.href),n+"#"+d(u+oo(e))},push:function(e,t){var n="PUSH",r=ao(e,void 0,void 0,T.location);h.confirmTransitionTo(r,n,o,(function(e){if(e){var t=oo(r),i=d(u+t);if(yo()!==i){t,function(e){window.location.hash=e}(i);var o=k.lastIndexOf(oo(T.location)),a=k.slice(0,o+1);a.push(t),a,m({action:n,location:r})}else m()}}))},replace:function(e,t){var n="REPLACE",r=ao(e,void 0,void 0,T.location);h.confirmTransitionTo(r,n,o,(function(e){if(e){var t=oo(r),i=d(u+t);yo()!==i&&(t,bo(i));var o=k.indexOf(oo(T.location));-1!==o&&(k[o]=t),m({action:n,location:r})}}))},go:S,goBack:function(){S(-1)},goForward:function(){S(1)},block:function(e){void 0===e&&!1;var t=h.setPrompt(e);return E||(_(1),!0),function(){return E&&(!1,_(-1)),t()}},listen:function(e){var t=h.appendListener(e);return _(1),function(){_(-1),t()}}};return T}w.Component;w.Component;var xo=function(e,t){return"function"==typeof e?e(t):e},ko=function(e,t){return"string"==typeof e?ao(e,null,null,t):e},So=function(e){return e},Co=w.forwardRef;void 0===Co&&(Co=So);var _o=Co((function(e,t){var n=e.innerRef,i=e.navigate,o=e.onClick,a=z(e,["innerRef","navigate","onClick"]),s=a.target,l=r({},a,{onClick:function(e){try{o&&o(e)}catch(t){throw e.preventDefault(),t}e.defaultPrevented||0!==e.button||s&&"_self"!==s||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)||(e.preventDefault(),i())}});return l.ref=So!==Co&&t||n,w.createElement("a",l)}));var Eo=Co((function(e,t){var n=e.component,i=void 0===n?_o:n,o=e.replace,a=e.to,s=e.innerRef,u=z(e,["component","replace","to","innerRef"]);return w.createElement(W.Consumer,null,(function(e){e||l(!1);var n=e.history,c=ko(xo(a,e.location),e.location),d=c?n.createHref(c):"",f=r({},u,{href:d,navigate:function(){var t=xo(a,e.location);(o?n.replace:n.push)(t)}});return So!==Co?f.ref=t||s:f.innerRef=s,w.createElement(i,f)}))})),To=function(e){return e},jo=w.forwardRef;void 0===jo&&(jo=To);var Oo=jo((function(e,t){var n=e["aria-current"],i=void 0===n?"page":n,o=e.activeClassName,a=void 0===o?"active":o,s=e.activeStyle,u=e.className,c=e.exact,d=e.isActive,f=e.location,p=e.sensitive,h=e.strict,m=e.style,v=e.to,g=e.innerRef,y=z(e,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return w.createElement(W.Consumer,null,(function(e){e||l(!1);var n=f||e.location,o=ko(xo(v,n),n),b=o.pathname,x=b&&b.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),k=x?J(n.pathname,{path:x,exact:c,sensitive:p,strict:h}):null,S=!!(d?d(k,n):k),C=S?function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter((function(e){return e})).join(" ")}(u,a):u,_=S?r({},m,{},s):m,E=r({"aria-current":S&&i||null,className:C,style:_,to:o},y);return To!==jo?E.ref=t||g:E.innerRef=g,w.createElement(Eo,E)}))}));const No=(e,t,n="bottom-left",r=0)=>{let i=0,o=0;const a=((e,t)=>{const n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return{source:n,target:r,get top(){return n.top-r.height},get bottom(){return n.top+n.height},get horizontalCenter(){return n.left+n.width/2-r.width/2},get horizontalLeft(){return n.left},get horizontalRight(){return n.left+n.width-r.width}}})(e,t);let s=n.split("-");switch(n){case"top-center":o=a.top-r,i=a.horizontalCenter;break;case"top-left":o=a.top-r,i=a.horizontalLeft;break;case"top-right":o=a.top-r,i=a.horizontalRight;break;case"bottom-center":o=a.bottom+r,i=a.horizontalCenter;break;case"bottom-left":o=a.bottom+r,i=a.horizontalLeft;break;case"bottom-right":o=a.bottom+r,i=a.horizontalRight}return o<window.scrollX?(o=a.bottom+r,s[0]="bottom"):o+a.target.height>window.scrollX+window.innerHeight&&(o=a.top-r,s[0]="top"),i<0?(i=a.horizontalLeft,s[1]="left"):i+a.target.width>window.innerWidth&&(i=a.horizontalRight,s[1]="right"),{top:o,left:i,pos:a,align:s.join("-")}},Mo=w.createContext(),Lo=(0,w.forwardRef)((({tag:e,children:t,dropdown:n,content:r,toggle:i,closeOnClickOutside:o=!0,...a},s)=>{var l,u,c;const d=null!==(l=null!=s?s:n)&&void 0!==l?l:(0,w.useRef)(),f=w.Children.only(t),[p]=(0,w.useState)(new Set),h=null!==(u=f.props.ref)&&void 0!==u?u:(0,w.useRef)(),m=(0,w.useContext)(Mo),v=(0,w.useCallback)((e=>{var t,n,r,i,o;const a=null===(t=h.current)||void 0===t||null===(n=t.contains)||void 0===n?void 0:n.call(t,e),s=null===(r=d.current)||void 0===r||null===(i=r.dropdown)||void 0===i||null===(o=i.contains)||void 0===o?void 0:o.call(i,e),l=Array.from(p).reduce(((t,n)=>t||n.hasTarget(e)),!1);return a||s||l}),[h,d]),g=(0,w.useCallback)((e=>{var t,n;o&&(v(e.target)||null===(t=d.current)||void 0===t||null===(n=t.close)||void 0===n||n.call(t))}),[o,v]),y=(0,w.useCallback)((e=>{var t,n,r,o,a;return(null===(t=d.current)||void 0===t||null===(n=t.dropdown)||void 0===n||null===(r=n.contains)||void 0===r?void 0:r.call(n,e.target))?e.stopPropagation():!1===i?null==d||null===(o=d.current)||void 0===o?void 0:o.open():void(null==d||null===(a=d.current)||void 0===a||a.toggle())}),[d]),b=(0,w.cloneElement)(f,{...f.props,tag:e,key:"dd-trigger",ref:h,onClickCapture:null!==(c=f.props)&&void 0!==c&&c.onClick?null:y}),x=r?(0,ni.jsx)(Ao,{...a,ref:d,children:r}):null;(0,w.useEffect)((()=>(document.addEventListener("click",g,{capture:!0}),()=>document.removeEventListener("click",g,{capture:!0}))),[g]);const k=(0,w.useMemo)((()=>({triggerRef:h,dropdown:d,hasTarget:v,addChild:e=>p.add(e),removeChild:e=>p.delete(e),open:()=>{var e,t;return null==d||null===(e=d.current)||void 0===e||null===(t=e.open)||void 0===t?void 0:t.call(e)},close:()=>{var e,t;return null==d||null===(e=d.current)||void 0===e||null===(t=e.close)||void 0===t?void 0:t.call(e)}})),[h,d]);return(0,w.useEffect)((()=>{if(m)return m.addChild(k),()=>m.removeChild(k)}),[]),(0,ni.jsxs)(Mo.Provider,{value:k,children:[b,x]})}));let Po=1;const Ao=(0,w.forwardRef)((({animated:e=!0,visible:t=!1,...n},r)=>{var i,o;const a=oi("dropdown"),s=(0,w.useRef)(),{triggerRef:l}=null!==(i=(0,w.useContext)(Mo))&&void 0!==i?i:{},u=void 0===l,{children:c}=n,[d,f]=(0,w.useState)(t),[p,h]=(0,w.useState)(t),[m,v]=(0,w.useState)({}),[g,y]=(0,w.useState)(t?"visible":null),b=(0,w.useCallback)((()=>{var e,t;const r=s.current,i=null!==(e=null==l?void 0:l.current)&&void 0!==e?e:r.parentNode,{left:o,top:a}=No(i,r,`bottom-${null!==(t=n.align)&&void 0!==t?t:"left"}`);v({left:o,top:a})}),[l]),k=(0,w.useMemo)((()=>Po++),[]),S=(0,w.useCallback)((async(t=!1)=>{if(!1!==n.enabled||!0!==t)return new Promise((n=>{const r=s.current;!1!==e?Ni(r,{transition:()=>{y(t?"appear":"disappear")},beforeTransition:()=>{y(t?"before-appear":"before-disappear")},afterTransition:()=>{y(t?"visible":null),n()}}):(y(t?"visible":null),n())}))}),[e]),C=(0,w.useCallback)((async e=>{var t,r;null===(t=n.onToggle)||void 0===t||t.call(n,e),await S(e),h(e),null===(r=n.onVisibilityChanged)||void 0===r||r.call(n,e)}),[n,S]),_=(0,w.useCallback)((async()=>{!1!==p&&!1!==d&&(await C(!1),f(!1))}),[p,S,n,d]),E=(0,w.useCallback)((async()=>{!0!==p&&!0!==d&&f(!0)}),[p,S,n,d]),T=(0,w.useCallback)((async()=>{!p?E():_()}),[_,p,E]);(0,w.useEffect)((()=>{r&&(r.current={dropdown:s.current,visible:null!==g,toggle:T,open:E,close:_})}),[_,E,r,T,s,g]),(0,w.useEffect)((()=>{h(t)}),[t]),(0,w.useEffect)((()=>{u||"before-appear"!==g||b()}),[g,b,u]),(0,w.useEffect)((()=>{!1===n.enabled&&S(!1)}),[n.enabled]),(0,w.useEffect)((()=>{d&&C(!0)}),[d]);const j=c.props&&"Menu"===c.props.type?(0,w.cloneElement)(c,{...c.props,className:a.elem("menu").mix(c.props.className)}):c,O=(0,w.useMemo)((()=>{switch(g){case"before-appear":return"before-appear";case"appear":return"appear before-appear";case"before-disappear":return"before-disappear";case"disappear":return"disappear before-disappear";case"visible":return"visible";default:return t?"visible":null}}),[g,t]),N={...null!==(o=n.style)&&void 0!==o?o:{},...null!=m?m:{},zIndex:1e3+k},M=(0,ni.jsx)(si,{ref:s,name:"dropdown",mix:[n.className,O],style:N,onClick:e=>e.stopPropagation(),children:j});return d?!0===n.inline?M:x.createPortal(M,document.body):null}));Ao.displayName="Dropdown",Ao.Trigger=Lo,Ao.Trigger=Lo;const Do=w.createContext(),{Block:Ro,Elem:Io}=ai(),Fo=(0,w.forwardRef)((({children:e,className:t,style:n,size:r,selectedKeys:i,closeDropdownOnItemClick:o},a)=>{const s=(0,w.useContext)(Mo),l=(0,w.useMemo)((()=>new Set(null!=i?i:[])),[i]),u=(0,w.useCallback)((e=>{const t=oi("main-menu").elem("item").closest(e.target);s&&t&&!1!==o&&s.close()}),[s]),c=(0,w.useMemo)((()=>!!s),[s]);return(0,ni.jsx)(Do.Provider,{value:{selected:l},children:(0,ni.jsx)(Ro,{ref:a,tag:"ul",name:"main-menu",mod:{size:r,collapsed:c},mix:t,style:n,onClick:u,children:e})})}));Fo.Item=({children:e,label:t,icon:n,to:r,className:i,href:o,exact:a=!1,forceReload:s=!1,active:l=!1,onClick:u,...c})=>{const d=oi("main-menu",{elem:"item"}),f=[d.toClassName()];((()=>{const e=location.pathname.replace(/\/$/,""),t=null!=r?r:o;return a?e===t:e.includes(t)})()||l)&&f.push(d.mod({active:!0})),i&&f.push(i);const p=(0,ni.jsxs)(ni.Fragment,{children:[n&&(0,ni.jsx)("span",{className:d.elem("item-icon"),children:n}),null!=e?e:t]}),h={className:f.join(" "),onClick:u,...c},m=d.mod({active:!0}).toClassName(),v=null!=r?r:o;return s&&(h.onClick=()=>location.href=null!=r?r:o),(0,ni.jsx)("li",{children:r?(0,ni.jsx)(Oo,{to:v,...h,exact:a,activeClassName:m,"data-external":!0,children:p}):v?(0,ni.jsx)("a",{href:pi(v),...h,children:p}):(0,ni.jsx)("span",{...h,children:p})})},Fo.Spacer=()=>(0,ni.jsx)(Io,{block:"main-menu",tag:"li",name:"spacer"}),Fo.Divider=()=>(0,ni.jsx)(Io,{block:"main-menu",tag:"li",name:"divider"}),Fo.Builder=(e,t)=>(null!=t?t:[]).map(((t,n)=>{if("SPACER"===t)return(0,ni.jsx)(Fo.Spacer,{},n);if("DIVIDER"===t)return(0,ni.jsx)(Fo.Divider,{},n);let r,i;if(Array.isArray(t))[i,r]=t;else{const{menuItem:e,title:n,path:o}=t;r=null!=n?n:e,i=o}if("function"==typeof i)return(0,ni.jsx)(Fo.Item,{onClick:i,children:r},n);const o=`${e}${i}`.replace(/([/]+)/g,"/");return(0,ni.jsx)(Fo.Item,{to:o,exact:!0,children:r},n)})),Fo.Group=({children:e,title:t,className:n,style:r})=>(0,ni.jsxs)(Ro,{name:"menu-group",mix:n,style:r,children:[(0,ni.jsx)(Io,{name:"title",children:t}),(0,ni.jsx)(Io,{tag:"ul",name:"list",children:e})]});const{Block:zo,Elem:Ho}=ai(),Uo=()=>{const e=Ei(),t=wc(),n=bc(),[r,i]=(0,w.useState)(t);return(0,w.useEffect)((()=>{t.length?i(t):e.breadcrumbs&&i(e.breadcrumbs)}),[t,e]),(0,ni.jsx)(zo,{name:"breadcrumbs",children:(0,ni.jsx)(Ho,{tag:"ul",name:"list",children:r.map(((e,t,r)=>{var i;const o=t===r.length-1,a=`item-${t}-${e.title}`,s=null!==(i=e.href)&&void 0!==i?i:e.path,l=null!==n(s),u=(0,ni.jsx)(Ho,{tag:"span",name:"label",mod:{faded:t===e.length-1},children:e.title}),c=e.submenu?(0,ni.jsx)(Ao,{children:(0,ni.jsx)(Fo,{children:e.submenu.map(((t,n)=>{var r;return(0,ni.jsx)(Fo.Item,{label:t.title,icon:t.icon,href:null!==(r=t.href)&&void 0!==r?r:t.path,active:t.active},`${n}-${e.title}`)}))})}):null;return e.onClick?(0,ni.jsx)(Ho,{tag:"li",name:"item",mod:{last:o},children:(0,ni.jsx)("span",{onClick:e.onClick,children:u})},a):c?(0,ni.jsx)(Ho,{tag:"li",component:Ao.Trigger,name:"item",mod:{last:o},content:c,children:(0,ni.jsx)("span",{children:u})},a):s&&!o?(0,ni.jsx)(Ho,{tag:"li",name:"item",mod:{last:o},children:l?(0,ni.jsx)(Oo,{to:s,"data-external":!0,children:u}):(0,ni.jsx)("a",{href:pi(s),children:u})},a):(0,ni.jsx)(Ho,{tag:"li",name:"item",mod:{last:o},children:u},a)}))})})},Bo=({header:e,extra:t,children:n,style:r})=>{const i=oi("card");return(0,ni.jsxs)("div",{className:i,style:r,children:[(e||t)&&(0,ni.jsxs)("div",{className:i.elem("header"),children:[(0,ni.jsx)("div",{className:i.elem("header-content"),children:e}),t&&(0,ni.jsx)("div",{className:i.elem("header-extra"),children:t})]}),(0,ni.jsx)("div",{className:i.elem("content"),children:n})]})},Wo=({children:e,count:t,size:n,gap:r})=>{const i=w.useRef(),o={"--columns":Math.max(1,null!=t?t:1),"--column-width":n,"--column-gap":r};return(0,ni.jsx)("div",{ref:i,className:oi("columns"),style:o,children:e})};Wo.Column=({title:e,children:t})=>(0,ni.jsxs)("div",{className:oi("columns").elem("item"),children:[(0,ni.jsx)("div",{className:oi("columns").elem("title"),children:e}),t]});const $o=({opened:e,animated:t=!0})=>{const n=oi("hamburger");return(0,ni.jsxs)("span",{className:n.mod({animated:t,opened:e}),children:[(0,ni.jsx)("span",{}),(0,ni.jsx)("span",{}),(0,ni.jsx)("span",{})]})};var Vo=n(488);Vo.domToReact,Vo.htmlToDOM,Vo.attributesToProps;const qo=Vo,Go=new Set,Yo=(e,t)=>!![null,void 0,"","text/javascript"].includes(e.type)&&((void 0!==e.dataset.alwaysReload||!0===t||!Go.has(e.outerHTML))&&!!e.parentNode),Xo=(e,t)=>new Promise((n=>{var r;const i=document.createElement("script"),o=(t=null!==(r=t)&&void 0!==r?r:e).src||(e=>{const t=new Blob([e],{type:"text/javascript"});return URL.createObjectURL(t).toString()})(t.text);if(Go.add(t.outerHTML),t.async)n();else{const e=({type:t})=>{i.removeEventListener("load",e),i.removeEventListener("error",e),n("error"!==t&&i)};i.addEventListener("load",e),i.addEventListener("error",e)}void 0!==t.dataset.alwaysReload&&(i.dataset.alwaysReload=""),t.id&&(i.id=t.id),t.className&&(i.className=t.className),i.dataset.replaced="true",i.async=t.async,i.defer=t.defer,i.type="text/javascript",i.src=o,e.parentNode.insertBefore(i,e),e.remove()})),Ko=async(e,{sourceScript:t,forceUpdate:n=!1}={})=>{var r;if(t=null!==(r=t)&&void 0!==r?r:e,Yo(e,n)&&(t===e||Yo(t,n)))return Xo(e,t)},Qo=async e=>{const t=e.querySelectorAll("script");if(!t.length)return[];const n=function*(e){for(;e.length;){const t=e.shift();yield Ko(t).then((e=>e))}}(Array.from(t)),r=[];for await(const e of n)r.push(e);return r},Jo=new Map,Zo=async(e,t)=>{e&&t&&(e.replaceWith(t),await Qo(t))},ea=async(e,t)=>{const n=["style:not([data-replaced])","link[rel=stylesheet]:not([data-replaced])"].join(", "),r=Array.from(e.querySelectorAll(n)),i=Array.from(t.querySelectorAll(n)),o=(a=r,new Set(Array.from(a).map((e=>e.outerHTML))));var a;const s=i.filter((e=>!o.has(e.outerHTML)));await Promise.all(s.map((e=>new Promise((t=>{e.onload=()=>t(e.outerHTML),document.head.append(e)})))))},ta=async(e,t)=>{document.title=e.title,await ea(document,e),await(async(e,t)=>{Zo(e.querySelector("title"),t.querySelector("title"));const n=document.createDocumentFragment();Array.from(t.querySelectorAll("script")).filter((e=>Yo(e))).forEach((e=>n.appendChild(e))),Array.from(e.querySelectorAll("script")).filter((e=>Yo(e))).forEach((e=>e.remove())),e.appendChild(n),await Qo(e)})(document.head,e.head),await(async(e,t)=>{const n=e.querySelector("script#app-settings"),r=t.querySelector("script#app-settings");n&&r&&await Ko(n,{sourceScript:r,forceUpdate:!0})})(document,e),await(async(e,t)=>{const n=e.querySelector("#dynamic-content"),r=t.querySelector("#dynamic-content");n&&r?await Zo(n,r):await Zo(e.body.children[0],r)})(document,e),null==t||t()},na=()=>{const{href:e}=location;return e.replace(/#(.*)/g,"")},ra=async e=>{const t=await(async e=>{try{if(Jo.has(e))return Jo.get(e);{const t=await fetch(e),n=await t.text();return 401===t.status?void(location.href=pi("/")):t.ok?(Jo.set(e,n),n):(Ri({body:()=>(0,ni.jsx)(Si,{title:`Error ${t.status}: ${t.statusText}`,errorId:t.status,stacktrace:`Cannot load url ${e}\n\n${n}`}),allowClose:!1,style:{width:680}}),null)}}catch(e){return Ri({body:()=>(0,ni.jsx)(Si,{possum:!1,title:"Connection refused",message:"Server not responding. Is it still running?"}),allowClose:!1,style:{width:680}}),null}})(e);return t?(e=>(new DOMParser).parseFromString(e,"text/html"))(t):null};let ia=na();const oa=(e,t)=>{const[n,r]=(0,w.useState)(e);return[n,(0,w.useCallback)((async e=>{ia=e,Go.clear();const n=await ra(e);return!!n&&(await ta(n,t),r(n),!0)}),[])]},aa=(0,w.createContext)(null),sa=(aa.Consumer,({children:e})=>{const t=document,n=se(),r=(0,w.useContext)(Ci),i=(0,w.useCallback)((()=>{r.update(window.APP_SETTINGS)}),[]),[o,a]=oa(t,i),s=(0,w.useCallback)((async e=>{const t=e.target.closest("a[href]:not([target]):not([download])");if(!(e=>!!e&&!e.dataset.external&&!e.getAttribute("href").match(/#/)&&e.origin===location.origin)(t))return;if(t.matches("[data-external]"))return;if(e.metaKey||e.ctrlKey)return;e.preventDefault();await a(t.href)&&n.push(`${(e=>{if(APP_SETTINGS.hostname){const t=APP_SETTINGS.hostname,n=new URL(t).pathname.replace(/([/]+)$/,"");return e.replace(new RegExp(`^${n}`),"")}return e||"/"})(t.pathname)}${t.search}`)}),[]),l=(0,w.useCallback)((()=>{const e=na();e===ia||(ia=e,a(e))}),[]);return(0,w.useEffect)((()=>(document.addEventListener("click",s,{capture:!0}),window.addEventListener("popstate",l),()=>{document.removeEventListener("click",s,{capture:!0}),window.removeEventListener("popstate",l)})),[]),(0,ni.jsx)(aa.Provider,{value:o,children:e})}),la=(e,t,n,r)=>{let i,o=!1;if(!n||0===n.length||n instanceof Function){var a;const s=t.querySelector(`template#${e}`),l=null!==(a=s.innerHTML)&&void 0!==a?a:"";if(r){const e=qo(l);i=n instanceof Function&&n(e)||e}else{const e=n instanceof Function&&n(s);e?i=e:(i=l,o=!0)}}else i=n;return{children:i,setInnerHTML:o}},ua=w.forwardRef((({id:e,tagName:t,children:n,source:r,onRenderFinished:i,parse:o=!1,raw:a=!1,...s},l)=>{const u=null!=l?l:w.useRef(),[c,d]=w.useState(la(e,r,n,o));return w.useEffect((()=>{d(la(e,r,n,o))}),[r,n]),w.useEffect((()=>{u.current&&Qo(u.current),null==i||i()}),[c]),c.setInnerHTML?s.dangerouslySetInnerHTML={__html:c.children}:s.children=c.children,!0===a&&c.children?(0,ni.jsx)(w.Fragment,{children:c.children}):w.createElement(null!=t?t:"div",{...s,ref:u})})),ca=w.forwardRef(((e,t)=>{const n=w.useContext(aa);return n?(0,ni.jsx)(ua,{...e,source:n,ref:t}):null})),da=(0,w.forwardRef)((({title:e,children:t,defaultVisible:n,disabled:r,style:i},o)=>{if(!t||Array.isArray(t))throw new Error("Tooltip does accept a single child only");const a=null!=o?o:(0,w.useRef)(),s=(0,w.useRef)(),[l,u]=(0,w.useState)({}),[c,d]=(0,w.useState)(n?"visible":null),[f,p]=(0,w.useState)(!1),[h,m]=(0,w.useState)("top-center"),v=(0,w.useCallback)((()=>{const{left:e,top:t,align:n}=No(a.current,s.current,h,10);u({left:e,top:t}),m(n)}),[a.current,s.current]),g=(0,w.useCallback)((e=>{s.current&&Ni(s.current,{beforeTransition(){d(e?"before-appear":"before-disappear")},transition(){e&&v(),d(e?"appear":"disappear")},afterTransition(){d(e?"visible":null),!1===e&&p(!1)}})}),[f,v,s]),y=(0,w.useMemo)((()=>{switch(c){case"before-appear":return"before-appear";case"appear":return"appear before-appear";case"before-disappear":return"before-disappear";case"disappear":return"disappear before-disappear";case"visible":return"visible";default:return c?"visible":null}}),[c]),b=(0,w.useMemo)((()=>f?(0,ni.jsx)(si,{ref:s,name:"tooltip",mod:{align:h},mix:y,style:{...l,...null!=i?i:{}},children:(0,ni.jsx)(li,{name:"body",children:e})}):null),[f,l,e,y,s]),k=w.Children.only(t),S=(0,w.cloneElement)(k,{...k.props,ref:a,onMouseEnter(e){var t,n;!0!==r&&(p(!0),null===(t=(n=k.props).onMouseEnter)||void 0===t||t.call(n,e))},onMouseLeave(e){var t,n;!0!==r&&(g(!1),null===(t=(n=k.props).onMouseLeave)||void 0===t||t.call(n,e))}});return(0,w.useEffect)((()=>{f&&g(!0)}),[f]),(0,ni.jsxs)(ni.Fragment,{children:[S,(0,x.createPortal)(b,document.body)]})}));da.displayName="Tooltip";const fa="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=",pa=(0,w.forwardRef)((({username:e,size:t,src:n,user:r,className:i,showUsername:o,style:a,...s},l)=>{var u;const c=(0,w.useRef)(),[d,f]=(0,w.useState)(e),[p,h]=(0,w.useState)(null!==(u=null==r?void 0:r.avatar)&&void 0!==u?u:n),[m,v]=(0,w.useState)(!1),[g,y]=(0,w.useState)(!0);t&&(a=Object.assign({width:t,height:t,fontSize:.4*t},a)),(0,w.useEffect)((()=>{if(r){const{first_name:e,last_name:t,email:n,initials:i,username:o}=r;i?f(i):o?f(o):e&&t?f(`${e[0]}${t[0]}`):n&&f(n.substring(0,2)),r.avatar&&h(r.avatar)}else f(e),h(n)}),[r]);const b=(0,w.useCallback)((()=>{v(!0),p!==fa&&y(!1)}),[p]),x=(0,ni.jsxs)(si,{ref:l,name:"userpic",mix:i,style:a,...s,children:[(0,ni.jsx)(li,{tag:"img",name:"avatar",ref:c,src:p,alt:(null!=d?d:"").toUpperCase(),style:{opacity:m?1:0},onLoad:b,onError:()=>h(fa)}),g&&(0,ni.jsx)(li,{tag:"span",name:"username",children:(null!=d?d:"").toUpperCase()})]}),k=(0,w.useMemo)((()=>{var t,n;return null!=r&&r.first_name||null!=r&&r.last_name?`${null!==(t=null==r?void 0:r.first_name)&&void 0!==t?t:""} ${null!==(n=null==r?void 0:r.last_name)&&void 0!==n?n:""}`.trim():null!=r&&r.email?r.email:e}),[r,e]);return o&&k?(0,ni.jsx)(da,{title:k,children:x}):x}));function ha(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function ma(e){ha(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"),console.warn((new Error).stack)),new Date(NaN))}function va(e){ha(1,arguments);var t=ma(e);return!isNaN(t)}pa.displayName="Userpic";var ga={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function ya(e){return function(t){var n=t||{},r=n.width?String(n.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}var ba={date:ya({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:ya({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:ya({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})};var wa={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function xa(e){return function(t,n){var r,i=n||{};if("formatting"===(i.context?String(i.context):"standalone")&&e.formattingValues){var o=e.defaultFormattingWidth||e.defaultWidth,a=i.width?String(i.width):o;r=e.formattingValues[a]||e.formattingValues[o]}else{var s=e.defaultWidth,l=i.width?String(i.width):e.defaultWidth;r=e.values[l]||e.values[s]}return r[e.argumentCallback?e.argumentCallback(t):t]}}function ka(e){return function(t,n){var r=String(t),i=n||{},o=i.width,a=o&&e.matchPatterns[o]||e.matchPatterns[e.defaultMatchWidth],s=r.match(a);if(!s)return null;var l,u=s[0],c=o&&e.parsePatterns[o]||e.parsePatterns[e.defaultParseWidth];return l="[object Array]"===Object.prototype.toString.call(c)?function(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n}(c,(function(e){return e.test(u)})):function(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}(c,(function(e){return e.test(u)})),l=e.valueCallback?e.valueCallback(l):l,{value:l=i.valueCallback?i.valueCallback(l):l,rest:r.slice(u.length)}}}var Sa;const Ca={code:"en-US",formatDistance:function(e,t,n){var r;return n=n||{},r="string"==typeof ga[e]?ga[e]:1===t?ga[e].one:ga[e].other.replace("{{count}}",t),n.addSuffix?n.comparison>0?"in "+r:r+" ago":r},formatLong:ba,formatRelative:function(e,t,n,r){return wa[e]},localize:{ordinalNumber:function(e,t){var n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:xa({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:xa({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:xa({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:xa({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:xa({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(Sa={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}},function(e,t){var n=String(e),r=t||{},i=n.match(Sa.matchPattern);if(!i)return null;var o=i[0],a=n.match(Sa.parsePattern);if(!a)return null;var s=Sa.valueCallback?Sa.valueCallback(a[0]):a[0];return{value:s=r.valueCallback?r.valueCallback(s):s,rest:n.slice(o.length)}}),era:ka({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:ka({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:ka({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:ka({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:ka({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function _a(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function Ea(e,t){ha(2,arguments);var n=ma(e).getTime(),r=_a(t);return new Date(n+r)}function Ta(e,t){ha(2,arguments);var n=_a(t);return Ea(e,-n)}function ja(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length<t;)r="0"+r;return n+r}const Oa={y:function(e,t){var n=e.getUTCFullYear(),r=n>0?n:1-n;return ja("yy"===t?r%100:r,t.length)},M:function(e,t){var n=e.getUTCMonth();return"M"===t?String(n+1):ja(n+1,2)},d:function(e,t){return ja(e.getUTCDate(),t.length)},a:function(e,t){var n=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return"am"===n?"a.m.":"p.m."}},h:function(e,t){return ja(e.getUTCHours()%12||12,t.length)},H:function(e,t){return ja(e.getUTCHours(),t.length)},m:function(e,t){return ja(e.getUTCMinutes(),t.length)},s:function(e,t){return ja(e.getUTCSeconds(),t.length)},S:function(e,t){var n=t.length,r=e.getUTCMilliseconds();return ja(Math.floor(r*Math.pow(10,n-3)),t.length)}};var Na=864e5;function Ma(e){ha(1,arguments);var t=1,n=ma(e),r=n.getUTCDay(),i=(r<t?7:0)+r-t;return n.setUTCDate(n.getUTCDate()-i),n.setUTCHours(0,0,0,0),n}function La(e){ha(1,arguments);var t=ma(e),n=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var i=Ma(r),o=new Date(0);o.setUTCFullYear(n,0,4),o.setUTCHours(0,0,0,0);var a=Ma(o);return t.getTime()>=i.getTime()?n+1:t.getTime()>=a.getTime()?n:n-1}function Pa(e){ha(1,arguments);var t=La(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var r=Ma(n);return r}var Aa=6048e5;function Da(e,t){ha(1,arguments);var n=t||{},r=n.locale,i=r&&r.options&&r.options.weekStartsOn,o=null==i?0:_a(i),a=null==n.weekStartsOn?o:_a(n.weekStartsOn);if(!(a>=0&&a<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var s=ma(e),l=s.getUTCDay(),u=(l<a?7:0)+l-a;return s.setUTCDate(s.getUTCDate()-u),s.setUTCHours(0,0,0,0),s}function Ra(e,t){ha(1,arguments);var n=ma(e,t),r=n.getUTCFullYear(),i=t||{},o=i.locale,a=o&&o.options&&o.options.firstWeekContainsDate,s=null==a?1:_a(a),l=null==i.firstWeekContainsDate?s:_a(i.firstWeekContainsDate);if(!(l>=1&&l<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var u=new Date(0);u.setUTCFullYear(r+1,0,l),u.setUTCHours(0,0,0,0);var c=Da(u,t),d=new Date(0);d.setUTCFullYear(r,0,l),d.setUTCHours(0,0,0,0);var f=Da(d,t);return n.getTime()>=c.getTime()?r+1:n.getTime()>=f.getTime()?r:r-1}function Ia(e,t){ha(1,arguments);var n=t||{},r=n.locale,i=r&&r.options&&r.options.firstWeekContainsDate,o=null==i?1:_a(i),a=null==n.firstWeekContainsDate?o:_a(n.firstWeekContainsDate),s=Ra(e,t),l=new Date(0);l.setUTCFullYear(s,0,a),l.setUTCHours(0,0,0,0);var u=Da(l,t);return u}var Fa=6048e5;var za="midnight",Ha="noon",Ua="morning",Ba="afternoon",Wa="evening",$a="night";function Va(e,t){var n=e>0?"-":"+",r=Math.abs(e),i=Math.floor(r/60),o=r%60;if(0===o)return n+String(i);var a=t||"";return n+String(i)+a+ja(o,2)}function qa(e,t){return e%60==0?(e>0?"-":"+")+ja(Math.abs(e)/60,2):Ga(e,t)}function Ga(e,t){var n=t||"",r=e>0?"-":"+",i=Math.abs(e);return r+ja(Math.floor(i/60),2)+n+ja(i%60,2)}const Ya={G:function(e,t,n){var r=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){var r=e.getUTCFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return Oa.y(e,t)},Y:function(e,t,n,r){var i=Ra(e,r),o=i>0?i:1-i;return"YY"===t?ja(o%100,2):"Yo"===t?n.ordinalNumber(o,{unit:"year"}):ja(o,t.length)},R:function(e,t){return ja(La(e),t.length)},u:function(e,t){return ja(e.getUTCFullYear(),t.length)},Q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return ja(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return ja(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){var r=e.getUTCMonth();switch(t){case"M":case"MM":return Oa.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){var r=e.getUTCMonth();switch(t){case"L":return String(r+1);case"LL":return ja(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){var i=function(e,t){ha(1,arguments);var n=ma(e),r=Da(n,t).getTime()-Ia(n,t).getTime();return Math.round(r/Fa)+1}(e,r);return"wo"===t?n.ordinalNumber(i,{unit:"week"}):ja(i,t.length)},I:function(e,t,n){var r=function(e){ha(1,arguments);var t=ma(e),n=Ma(t).getTime()-Pa(t).getTime();return Math.round(n/Aa)+1}(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):ja(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):Oa.d(e,t)},D:function(e,t,n){var r=function(e){ha(1,arguments);var t=ma(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var r=t.getTime(),i=n-r;return Math.floor(i/Na)+1}(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):ja(r,t.length)},E:function(e,t,n){var r=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){var i=e.getUTCDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return ja(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){var i=e.getUTCDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return ja(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){var r=e.getUTCDay(),i=0===r?7:r;switch(t){case"i":return String(i);case"ii":return ja(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){var r=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){var r,i=e.getUTCHours();switch(r=12===i?Ha:0===i?za:i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){var r,i=e.getUTCHours();switch(r=i>=17?Wa:i>=12?Ba:i>=4?Ua:$a,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){var r=e.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Oa.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):Oa.H(e,t)},K:function(e,t,n){var r=e.getUTCHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):ja(r,t.length)},k:function(e,t,n){var r=e.getUTCHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):ja(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):Oa.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):Oa.s(e,t)},S:function(e,t){return Oa.S(e,t)},X:function(e,t,n,r){var i=(r._originalDate||e).getTimezoneOffset();if(0===i)return"Z";switch(t){case"X":return qa(i);case"XXXX":case"XX":return Ga(i);case"XXXXX":case"XXX":default:return Ga(i,":")}},x:function(e,t,n,r){var i=(r._originalDate||e).getTimezoneOffset();switch(t){case"x":return qa(i);case"xxxx":case"xx":return Ga(i);case"xxxxx":case"xxx":default:return Ga(i,":")}},O:function(e,t,n,r){var i=(r._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Va(i,":");case"OOOO":default:return"GMT"+Ga(i,":")}},z:function(e,t,n,r){var i=(r._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Va(i,":");case"zzzz":default:return"GMT"+Ga(i,":")}},t:function(e,t,n,r){var i=r._originalDate||e;return ja(Math.floor(i.getTime()/1e3),t.length)},T:function(e,t,n,r){return ja((r._originalDate||e).getTime(),t.length)}};function Xa(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}}function Ka(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}}const Qa={p:Ka,P:function(e,t){var n,r=e.match(/(P+)(p+)?/),i=r[1],o=r[2];if(!o)return Xa(e,t);switch(i){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;case"PPPP":default:n=t.dateTime({width:"full"})}return n.replace("{{date}}",Xa(i,t)).replace("{{time}}",Ka(o,t))}};var Ja=6e4;function Za(e){return e.getTime()%Ja}function es(e){var t=new Date(e.getTime()),n=Math.ceil(t.getTimezoneOffset());t.setSeconds(0,0);var r=n>0?(Ja+Za(t))%Ja:Za(t);return n*Ja+r}var ts=["D","DD"],ns=["YY","YYYY"];function rs(e){return-1!==ts.indexOf(e)}function is(e){return-1!==ns.indexOf(e)}function os(e,t,n){if("YYYY"===e)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("YY"===e)throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("D"===e)throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("DD"===e)throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://git.io/fxCyr"))}var as=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ss=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ls=/^'([^]*?)'?$/,us=/''/g,cs=/[a-zA-Z]/;function ds(e,t,n){ha(2,arguments);var r=String(t),i=n||{},o=i.locale||Ca,a=o.options&&o.options.firstWeekContainsDate,s=null==a?1:_a(a),l=null==i.firstWeekContainsDate?s:_a(i.firstWeekContainsDate);if(!(l>=1&&l<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var u=o.options&&o.options.weekStartsOn,c=null==u?0:_a(u),d=null==i.weekStartsOn?c:_a(i.weekStartsOn);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!o.localize)throw new RangeError("locale must contain localize property");if(!o.formatLong)throw new RangeError("locale must contain formatLong property");var f=ma(e);if(!va(f))throw new RangeError("Invalid time value");var p=es(f),h=Ta(f,p),m={firstWeekContainsDate:l,weekStartsOn:d,locale:o,_originalDate:f},v=r.match(ss).map((function(e){var t=e[0];return"p"===t||"P"===t?(0,Qa[t])(e,o.formatLong,m):e})).join("").match(as).map((function(n){if("''"===n)return"'";var r=n[0];if("'"===r)return fs(n);var a=Ya[r];if(a)return!i.useAdditionalWeekYearTokens&&is(n)&&os(n,t,e),!i.useAdditionalDayOfYearTokens&&rs(n)&&os(n,t,e),a(h,n,o.localize,m);if(r.match(cs))throw new RangeError("Format string contains an unescaped latin alphabet character `"+r+"`");return n})).join("");return v}function fs(e){return e.match(ls)[1].replace(us,"'")}const ps=(0,w.createContext)(),hs=({children:e})=>{const t=Vi(),[n,r]=(0,w.useReducer)(((e,t)=>{if("fetch-version"===t.type)return{...e,...t.payload}})),i=(0,w.useCallback)((async()=>{const e=await t.callApi("version");if(null!==e){const t=e["label-studio-os-package"];r({type:"fetch-version",payload:{version:t.version,latestVersion:t.latest_version_from_pypi,newVersion:t.current_version_is_outdated,updateTime:ds(new Date(t.latest_version_upload_time),"MMM d")}})}}),[t]);return(0,w.useEffect)((()=>{i()}),[]),(0,ni.jsx)(ps.Provider,{value:n,children:e})},ms=({showNewVersion:e,showCurrentVersion:t})=>{var n;const{newVersion:r,updateTime:i,latestVersion:o,version:a}=null!==(n=(0,w.useContext)(ps))&&void 0!==n?n:{};return r&&e?(0,ni.jsx)(si,{tag:"li",name:"version-notifier",children:(0,ni.jsxs)("a",{href:"https://pypi.org/project/label-studio/#history",target:"_blank",children:[(0,ni.jsx)(li,{name:"icon",children:(0,ni.jsx)(Tn,{})}),(0,ni.jsxs)(li,{name:"content",children:[(0,ni.jsxs)(li,{name:"title","data-date":i,children:[o," Available"]}),(0,ni.jsxs)(li,{name:"description",children:["Current version: ",a]})]})]})}):a&&t?(0,ni.jsxs)(si,{tag:Eo,name:"current-version",to:"/version",target:"_blank",children:["v",a]}):null},vs=(0,w.createContext)(),gs=({className:e})=>(0,ni.jsx)(ca,{id:"context-menu-left",className:e,children:e=>(0,ni.jsx)(Uo,{fromTemplate:e})}),ys=({className:e,...t})=>{const{ContextComponent:n,contextProps:r}=kc();return n?(0,ni.jsx)("div",{className:e,children:(0,ni.jsx)(n,{...t,...null!=r?r:{}})}):(0,ni.jsx)(ca,{id:"context-menu-right",className:e})},bs=({enabled:e,defaultOpened:t,defaultPinned:n,children:r,onSidebarToggle:i,onSidebarPin:o})=>{const a=(0,w.useRef)(),s=(0,w.useRef)(),l=Sc(),u=Ei(),[c,d]=(0,w.useState)(null!=t&&t),[f,p]=(0,w.useState)(null!=n&&n),[h,m]=(0,w.useState)({Component:null,props:{}}),v=oi("menu-header"),g=v.elem("context"),y=oi("sidebar"),b=oi("content-wrapper"),x=v.elem("context-item"),k=(0,w.useCallback)((e=>{e.preventDefault();const t=!f;p(t),null==o||o(t)}),[f]),S=(0,w.useCallback)((e=>{const t=e;d(t),null==i||i(t)}),[c]),C=(0,w.useMemo)((()=>({PageContext:h,setContext(e){setTimeout((()=>{m({...h,Component:e})}))},setProps(e){setTimeout((()=>{m({...h,props:e})}))},contextIsSet:e=>h.Component===e})),[h]);return(0,w.useEffect)((()=>{var e,t;f||(null==a||null===(t=a.current)||void 0===t||t.close());null==s||null===(e=s.current)||void 0===e||e.close()}),[l]),(0,ni.jsxs)("div",{className:b,children:[e&&(0,ni.jsxs)("div",{className:v,children:[(0,ni.jsx)(Ao.Trigger,{dropdown:a,closeOnClickOutside:!f,children:(0,ni.jsxs)("div",{className:`${v.elem("trigger")} main-menu-trigger`,children:[(0,ni.jsx)("img",{src:pi("/static/icons/logo-black.svg"),alt:"Label Studio Logo",height:"22"}),(0,ni.jsx)($o,{opened:c})]})}),(0,ni.jsxs)("div",{className:g,children:[(0,ni.jsx)(gs,{className:x.mod({left:!0})}),(0,ni.jsx)(ys,{className:x.mod({right:!0})})]}),(0,ni.jsx)(Ao.Trigger,{ref:s,align:"right",content:(0,ni.jsxs)(Fo,{children:[(0,ni.jsx)(Fo.Item,{icon:(0,ni.jsx)(Hr,{}),label:"Account & Settings",href:"/user/account","data-external":!0}),(0,ni.jsx)(Fo.Item,{icon:(0,ni.jsx)(Xn,{}),label:"Log Out",href:pi("/logout"),"data-external":!0})]}),children:(0,ni.jsx)("div",{className:v.elem("user"),children:(0,ni.jsx)(pa,{user:u.user})})})]}),(0,ni.jsx)(hs,{children:(0,ni.jsxs)("div",{className:b.elem("body"),children:[e&&(0,ni.jsx)(Ao,{ref:a,onToggle:S,onVisibilityChanged:()=>window.dispatchEvent(new Event("resize")),visible:c,className:[y,y.mod({floating:!f})].join(" "),style:{width:240},children:(0,ni.jsxs)(Fo,{children:[(0,ni.jsx)(Fo.Item,{label:"Projects",to:"/projects",icon:(0,ni.jsx)(lr,{}),"data-external":!0,exact:!0}),(0,ni.jsx)(Fo.Item,{label:"Organization",to:"/people",icon:(0,ni.jsx)(jr,{}),"data-external":!0,exact:!0}),(0,ni.jsx)(Fo.Spacer,{}),(0,ni.jsx)(ms,{showNewVersion:!0}),(0,ni.jsx)(Fo.Item,{label:"API",href:"/docs/api",icon:(0,ni.jsx)(Qr,{}),target:"_blank"}),(0,ni.jsx)(Fo.Item,{label:"Docs",href:"https://labelstud.io/guide",icon:(0,ni.jsx)(Pn,{}),target:"_blank"}),(0,ni.jsx)(Fo.Item,{label:"GitHub",href:"https://github.com/heartexlabs/label-studio",icon:(0,ni.jsx)(pr,{}),target:"_blank"}),(0,ni.jsx)(Fo.Item,{label:"Slack Community",href:"http://slack.labelstud.io.s3-website-us-east-1.amazonaws.com?source=product-menu",icon:(0,ni.jsx)(Gr,{}),target:"_blank"}),(0,ni.jsx)(ms,{showCurrentVersion:!0}),(0,ni.jsx)(Fo.Divider,{}),(0,ni.jsx)(Fo.Item,{icon:(0,ni.jsx)(Lr,{}),className:y.elem("pin"),onClick:k,active:f,children:f?"Unpin menu":"Pin menu"})]})}),(0,ni.jsx)(vs.Provider,{value:C,children:(0,ni.jsx)("div",{className:b.elem("content").mod({withSidebar:f&&c}),children:r})})]})})]})},ws=({children:e,menu:t,path:n,menuItems:r})=>{const i=oi("sidebar-menu");return(0,ni.jsxs)("div",{className:i,children:[(0,ni.jsx)("div",{className:i.elem("navigation"),children:(0,ni.jsx)(Fo,{children:r?Fo.Builder(n,r):t})}),(0,ni.jsx)("div",{className:i.elem("content"),children:e})]})},xs=({className:e,style:t,size:n=32,stopped:r=!1})=>{const i=oi("spinner"),o="number"==typeof n?`${n}px`:n;return(0,ni.jsx)("div",{className:i.mix(e),style:{...null!=t?t:{},"--spinner-size":o},children:(0,ni.jsxs)("div",{className:i.elem("body").mod({stopped:r}),children:[(0,ni.jsx)("span",{}),(0,ni.jsx)("span",{}),(0,ni.jsx)("span",{}),(0,ni.jsx)("span",{})]})})},ks=({className:e,style:t,big:n,items:r,active:i,onSelect:o})=>{const a=oi("toggle-items");return(0,ni.jsx)("ul",{className:a.mod({big:n}).mix(e).toString(),style:t,children:Object.keys(r).map((e=>(0,ni.jsx)("li",{className:a.elem("item").mod({active:e===i}).toString(),onClick:()=>o(e),children:r[e]},e)))})},Ss=({children:e,className:t,size:n="medium",noOffset:r=!1,...i})=>(0,ni.jsx)(si,{name:"description",mod:{size:n,noOffset:r},mix:t,...i,children:e});var Cs={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},_s=w.createContext&&w.createContext(Cs),Es=function(){return(Es=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}).apply(this,arguments)},Ts=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 js(e){return e&&e.map((function(e,t){return w.createElement(e.tag,Es({key:t},e.attr),js(e.child))}))}function Os(e){return function(t){return w.createElement(Ns,Es({attr:Es({},e.attr)},t),js(e.child))}}function Ns(e){var t=function(t){var n,r=e.attr,i=e.size,o=e.title,a=Ts(e,["attr","size","title"]),s=i||t.size||"1em";return t.className&&(n=t.className),e.className&&(n=(n?n+" ":"")+e.className),w.createElement("svg",Es({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,r,a,{className:n,style:Es(Es({color:e.color||t.color},t.style),e.style),height:s,width:s,xmlns:"http://www.w3.org/2000/svg"}),o&&w.createElement("title",null,o),e.children)};return void 0!==_s?w.createElement(_s.Consumer,null,(function(e){return t(e)})):t(Cs)}function Ms(e){return Os({tag:"svg",attr:{viewBox:"0 0 192 512"},child:[{tag:"path",attr:{d:"M96 184c39.8 0 72 32.2 72 72s-32.2 72-72 72-72-32.2-72-72 32.2-72 72-72zM24 80c0 39.8 32.2 72 72 72s72-32.2 72-72S135.8 8 96 8 24 40.2 24 80zm0 352c0 39.8 32.2 72 72 72s72-32.2 72-72-32.2-72-72-72-72 32.2-72 72z"}}]})(e)}function Ls(e){return Os({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"}}]})(e)}function Ps(e){return Os({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"}}]})(e)}const As=({value:e,children:t,className:n})=>{const r=(0,w.useMemo)((()=>Array.isArray(t)?t.find((t=>t.props.case===e))||null:t.props.case===e?t:void 0),[t,e]);return r?w.cloneElement(r,{...r.props,className:[n,r.props.className].join(" ")}):null},Ds=(e,t)=>{if(!ci(t)||di(t))return`${e} is required`},Rs=e=>(t,n)=>{if(e="string"==typeof e?new RegExp(e):e,!di(n)&&null===n.match(e))return`${t} must match the pattern ${e}`},Is=(e,t)=>{const n=`${e} must be valid JSON string`;if(ci(t)&&0!==t.trim().length){if(!1===/^(\{|\[)/.test(t)||!1===/(\}|\])$/.test(t))return n;try{JSON.parse(t)}catch(e){return n}}},Fs=(e,t)=>{try{new RegExp(t)}catch(t){return`${e} must be a valid regular expression`}},zs=(0,w.forwardRef)((({label:e,name:n,children:r,required:i,validate:o,skip:a,setValue:s,dependency:l,validators:u,...c},d)=>{var f;const p=(0,w.useContext)(mi),[h,m]=(0,w.useState)(null),v=null!=d?d:(0,w.useRef)(),g=[...null!=o?o:[]];null==u||null===(f=u.forEach)||void 0===f||f.call(u,(e=>{const[n,r]=e.split(/:(.+)/).slice(0,2),i=t[n];ci(i)&&(ci(r)?g.push(i(r)):g.push(i))})),i&&g.push(Ds),(0,w.useEffect)((()=>{if(!p||!l)return;let e=null;const t=p.getFieldContext(l),n=()=>{var e;null===(e=c.onDependencyChanged)||void 0===e||e.call(c,t.field)};return t?(t.field.addEventListener("change",n),e=t.field):console.warn(`Dependency field not found ${l}`),m(e),()=>t.field.removeEventListener("change",n)}),[p,v,l]);const y=(0,w.useCallback)((e=>{if(!v||!v.current)return;const t=v.current;s instanceof Function?s(e):"checkbox"===t.type||"radio"===t.type?t.checked=null!=e?e:t.checked:t.value=null===e?"":e;const n=document.createEvent("HTMLEvents");n.initEvent("change",!1,!0),t.dispatchEvent(n)}),[v]);return(0,w.useEffect)((()=>(null==p||p.registerField({label:e,name:n,validation:g,skip:a,field:v.current,setValue:y}),()=>null==p?void 0:p.unregisterField(n))),[v,y]),r(v,h,p)})),Hs=({text:e,children:t,required:n,placement:r,description:i,size:o,large:a,style:s,simple:l,flat:u})=>{const c=oi("label"),d=[c],f=l?"div":"label",p={size:o,large:a,flat:u,placement:r,withDescription:!!i,empty:!t};return d.push(c.mod(p)),(0,w.createElement)(f,{className:d.join(" "),"data-required":n,style:s},(0,ni.jsxs)(ni.Fragment,{children:[(0,ni.jsx)("div",{className:c.elem("text"),children:(0,ni.jsxs)("div",{className:c.elem("content"),children:[e,i&&(0,ni.jsx)("div",{className:c.elem("description"),children:i})]})}),(0,ni.jsx)("div",{className:c.elem("field"),children:t})]}))},Us=["ArrowUp","ArrowDown","Backspace","Delete",/[0-9]/],Bs=w.createContext(null),Ws=({type:e})=>{const{currentValue:t,min:n,max:r,disabled:i,ref:o,onClickHandler:a}=w.useContext(Bs),s="increase"===e?r:n;return(0,ni.jsx)(li,{tag:"a",href:"#",name:"btn",mod:{type:e,disabled:t===s||i},onClick:a(e,o),onMouseDownCapture:e=>e.preventDefault(),children:(0,ni.jsxs)(As,{value:e,children:[(0,ni.jsx)(Ls,{case:"decrease"}),(0,ni.jsx)(Ps,{case:"increase"})]})})},$s=({label:e,className:t,validate:n,required:r,skip:i,labelProps:o,...a})=>{var s,l,u,c,d;const[f,p]=[null!==(s=a.min)&&void 0!==s?s:-1/0,null!==(l=a.max)&&void 0!==l?l:1/0],h=e=>Math.max(f,Math.min(p,e)),[m,v]=w.useState(h(null!==(u=a.value)&&void 0!==u?u:0)),[g,y]=w.useState(null!==(c=a.autofocus)&&void 0!==c&&c),[b,x]=w.useState(null!==(d=a.disabled)&&void 0!==d?d:null),k=e=>{v(h(Number(e)))},S=w.useCallback((()=>{var e;k((null!=m?m:0)+(null!==(e=a.step)&&void 0!==e?e:1))}),[m,a.step]),C=w.useCallback((()=>{var e;k((null!=m?m:0)-(null!==(e=a.step)&&void 0!==e?e:1))}),[m,a.step]),_=e=>{const t=Us.find((t=>t instanceof RegExp?t.test(e.key):t===e.key));t||e.metaKey||e.preventDefault(),"ArrowUp"===t?(S(),e.preventDefault()):"ArrowDown"===t&&(C(),e.preventDefault())},E=e=>{const t=e.nativeEvent.clipboardData.getData("text");/([0-9]+)/.test(t)||e.preventDefault()},T=e=>{var t;e.target.value?v(h(Number(e.target.value))):v(""),null===(t=a.onChange)||void 0===t||t.call(a,e)},j=e=>{var t;y(!0),null===(t=a.onFocus)||void 0===t||t.call(a,e)},O=e=>{var t;y(!1),null===(t=a.onBlur)||void 0===t||t.call(a,e)},N=(e,t)=>n=>{var r;return n.preventDefault(),n.stopPropagation(),null===(r=document.activeElement)||void 0===r||r.blur(),y(),t.current.focus(),getSelection().removeAllRanges(),"increase"===e?S():"decrease"===e?C():void 0},M=(0,ni.jsx)(zs,{label:e,name:a.name,validate:n,required:r,setValue:k,skip:i,onDependencyChanged:e=>{"checkbox"===e.type&&x(!e.checked)},...a,children:(e,n)=>{const r="checkbox"===(null==n?void 0:n.type)&&!1===(null==n?void 0:n.checked)||!1,i=null!=b?b:r,o={currentValue:m,min:f,max:p,disabled:i,ref:e,onClickHandler:N};return(0,ni.jsx)(Bs.Provider,{value:o,children:(0,ni.jsxs)(si,{name:"counter",mod:{focused:g,disabled:i},mix:t,children:[(0,ni.jsx)(Ws,{type:"decrease"}),(0,ni.jsx)(li,{ref:e,tag:"input",name:"input",type:"text",disabled:i,value:m,onKeyDown:_,onPaste:E,onChange:T,onFocus:j,onBlur:O}),(0,ni.jsx)(Ws,{type:"increase"})]})})}});return e?(0,ni.jsx)(Hs,{...null!=o?o:{},text:e,required:r,children:M}):M},Vs=({label:e,className:t,validate:n,required:r,skip:i,labelProps:o,ghost:a,...s})=>{const l=[oi("input").mod({ghost:a}),t].join(" ").trim(),u=(0,ni.jsx)(zs,{label:e,name:s.name,validate:n,required:r,skip:i,...s,children:e=>(0,ni.jsx)("input",{...s,ref:e,className:l})});return e?(0,ni.jsx)(Hs,{...null!=o?o:{},text:e,required:r,children:u}):u},qs=({label:e,className:t,options:n,validate:r,required:i,skip:o,labelProps:a,ghost:s,...l})=>{const u=oi("select"),c=(0,w.useMemo)((()=>{var e;return null!==(e=l.value)&&void 0!==e?e:""}),[l.value]),[d,f]=(0,w.useState)(c),p=u.mod({ghost:s}).mix(t);(0,w.useEffect)((()=>{f(c)}),[c]);const h=(0,ni.jsx)(zs,{name:l.name,label:e,validate:r,required:i,skip:o,setValue:e=>f(e),...l,children:e=>(0,ni.jsx)("div",{className:p,children:(0,ni.jsxs)("select",{...l,value:d,onChange:e=>{var t;f(e.target.value),null===(t=l.onChange)||void 0===t||t.call(l,e)},ref:e,className:u.elem("list"),children:[l.placeholder&&(!l.defaulValue||!l.value)&&(0,ni.jsx)("option",{value:"",disabled:!0,hidden:!0,children:l.placeholder}),(null!=n?n:[]).map((e=>{var t,n,r,i;const o=null!==(t=e.value)&&void 0!==t?t:e,a=null!==(n=e.label)&&void 0!==n?n:o,s=null!==(r=e.disabled)&&void 0!==r&&r,l=null!==(i=e.hidden)&&void 0!==i&&i;return(0,ni.jsx)("option",{value:o,disabled:s,hidden:l,children:a},o)}))]})})});return e?(0,ni.jsx)(Hs,{...null!=a?a:{},text:e,required:i,children:h}):h},Gs=({label:e,className:t,validate:n,required:r,skip:i,labelProps:o,...a})=>{const s=[oi("textarea"),t].join(" ").trim(),l=(0,ni.jsx)(zs,{label:e,name:a.name,validate:n,required:r,skip:i,...a,children:e=>(0,ni.jsx)("textarea",{...a,ref:e,className:s})});return e?(0,ni.jsx)(Hs,{...null!=o?o:{},text:e,required:r,children:l}):l},Ys=(0,w.forwardRef)((({className:e,label:t,labelProps:n,description:r,checked:i,defaultChecked:o,onChange:a,validate:s,required:l,skip:u,...c},d)=>{var f;const p=oi("toggle"),h=(0,w.useMemo)((()=>{var e;return null!==(e=null!=o?o:i)&&void 0!==e&&e}),[o,i]),[m,v]=(0,w.useState)(null!==(f=null!=o?o:i)&&void 0!==f&&f),g=[p],y={};(0,w.useEffect)((()=>{v(h)}),[h]),m&&(y.checked=m),y.disabled=c.disabled,g.push(p.mod(y),e);const b=(0,ni.jsx)(zs,{ref:t?null:d,label:t,name:c.name,validate:s,required:l,skip:u,setValue:e=>v(e),...c,children:e=>(0,ni.jsxs)("div",{className:g.join(" "),children:[(0,ni.jsx)("input",{ref:e,...c,className:p.elem("input"),type:"checkbox",checked:m,onChange:e=>{v(e.target.checked),null==a||a(e)}}),(0,ni.jsx)("span",{className:p.elem("indicator")})]})});return t?(0,ni.jsx)(Hs,{ref:d,placement:"right",required:l,text:t,children:b,description:r,...null!=n?n:{}}):b}));function Xs(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class Ks extends w.Component{constructor(...e){super(...e),Xs(this,"state",{validation:null,showValidation:!0,submitting:!1}),Xs(this,"formElement",w.createRef()),Xs(this,"apiRef",w.createRef()),Xs(this,"fields",new Set),Xs(this,"validation",new Map),Xs(this,"onFormSubmitted",(async e=>{e.preventDefault(),this.validateFields(),this.validation.size?this.setState({step:"invalid"}):(this.setState({step:"submitting"}),this.submit())})),Xs(this,"_onAutoSubmit",(()=>{this.validateFields(),this.validation.size||this.submit()})),Xs(this,"onAutoSubmit",this.props.debounce?function(e,t,n){let r;return function(...i){const o=n&&!r;clearTimeout(r),r=setTimeout((()=>{r=null,n||e.apply(this,i)}),t),o&&e.apply(this,i)}}(this._onAutoSubmit,this.props.debounce):this._onAutoSubmit),Xs(this,"onFormChanged",(async e=>{var t,n;e.stopPropagation(),null===(t=(n=this.props).onChange)||void 0===t||t.call(n,e),this.autosubmit()}))}get api(){return this.apiRef.current}componentDidMount(){this.props.formData&&this.fillFormData()}componentDidUpdate(e){var t,n;eo(null!==(t=e.formData)&&void 0!==t?t:{},null!==(n=this.props.formData)&&void 0!==n?n:{})||this.fillFormData()}render(){const e=[(0,ni.jsx)(mi.Provider,{value:this},"form-ctx"),(0,ni.jsx)(vi.Provider,{value:this.state.validation},"form-validation-ctx"),(0,ni.jsx)(gi.Provider,{value:this.state.submitting},"form-submission-ctx"),(0,ni.jsx)(yi.Provider,{value:this.state.state},"form-state-ctx"),(0,ni.jsx)(bi.Provider,{value:this.state.lastResponse},"form-response"),(0,ni.jsx)($i,{ref:this.apiRef},"form-api")];return(0,ni.jsx)(Oi,{providers:e,children:(0,ni.jsxs)("form",{ref:this.formElement,className:oi("form"),action:this.props.action,onSubmit:this.onFormSubmitted,onChange:this.onFormChanged,autoComplete:this.props.autoComplete,autoSave:this.props.autoSave,style:this.props.style,children:[this.props.children,this.state.validation&&this.state.showValidation&&(0,ni.jsx)(Qs,{validation:this.state.validation})]})})}registerField(e){const t=this.getFieldContext(e.name);t?Object.assign(t,e):(this.fields.add(e),this.fillFormData())}unregisterField(e){const t=this.getFieldContext(e);t&&this.fields.delete(t)}getField(e){var t;return null===(t=this.getFieldContext(e))||void 0===t?void 0:t.field}getFieldContext(e){return Array.from(this.fields).find((t=>t.name===e))}disableValidationMessage(){this.setState({showValidation:!1})}enableValidationMessage(){this.setState({showValidation:!0})}autosubmit(){this.props.autosubmit&&setTimeout((()=>{this.onAutoSubmit()}),100)}assembleFormData({asJSON:e=!1,full:t=!1,booleansAsNumbers:n=!1,fieldsFilter:r}={}){let i=Array.from(this.fields);r instanceof Function&&(i=i.filter(r));const o=i.reduce(((e,{name:r,field:i,skip:o})=>{const a=o||this.props.skipEmpty&&!i.value;if(!0===t||!a){const t=(()=>{const e=i.value;return["checkbox","radio"].includes(i.type)?null!==e&&"on"!==e&&"true"!==e?i.checked?e:null:n?Number(i.checked):i.checked:e})();null!==t&&e.push([r,t])}return e}),[]);if(e)return o.reduce(((e,[t,n])=>({...e,[t]:n})),{});{const e=new FormData;return o.forEach((([t,n])=>e.append(t,n))),e}}async submit({fieldsFilter:e}={}){var t,n,r;this.setState({submitting:!0,lastResponse:null});const i=this.formElement.current.getAttribute("action"),o=this.api.isValidMethod(i),a=this.assembleFormData({asJSON:o,fieldsFilter:e}),s=null!==(t=null===(n=(r=this.props).prepareData)||void 0===n?void 0:n.call(r,a))&&void 0!==t?t:a;let l=!1;l=o?await this.submitWithAPI(i,s):await this.submitWithFetch(s),this.setState({submitting:!1,state:l?"success":"fail"},(()=>{setTimeout((()=>{this.setState({state:null})}),1500)}))}async submitWithAPI(e,t){var n;const r=fi(null!==(n=this.props.params)&&void 0!==n?n:{}),i=await this.api.callApi(e,{params:r,body:t});var o,a,s,l;return this.setState({lastResponse:i}),null===i?(null===(o=(a=this.props).onError)||void 0===o||o.call(a),!1):(null===(s=(l=this.props).onSubmit)||void 0===s||s.call(l,i),!0)}async submitWithFetch(e){var t;const n=this.formElement.current.action,r=(null!==(t=this.props.method)&&void 0!==t?t:"POST").toUpperCase(),i=await fetch(n,{method:r,body:e});try{const e=await i.json();var o,a,s,l;if(this.setState({lastResponse:e}),e.validation_errors&&(Object.entries(e.validation_errors).forEach((([e,t])=>{const n=this.getField(e);this.validation.set(n.name,{label:n.label,field:n.field,messages:t})})),this.setState({validation:this.validation})),i.ok)return null===(o=(a=this.props).onSubmit)||void 0===o||o.call(a,e),!0;null===(s=(l=this.props).onError)||void 0===s||s.call(l,e)}catch(e){var u,c;console.log(e),null===(u=(c=this.props).onError)||void 0===u||u.call(c,e)}return!1}validateFields(){this.validation.clear();for(const e of this.fields){const t=this.validateField(e);t.length&&this.validation.set(e.name,{label:e.label,messages:t,field:e.field})}return this.validation.size?this.setState({validation:this.validation}):this.setState({validation:null}),0===this.validation.size}validateField(e){var t;const n=[],{validation:r,field:i}=e,o=(null===(t=i.value)||void 0===t?void 0:t.trim())||null;return r.forEach((t=>{const r=t(e.label,o);r&&n.push(r)})),n}fillFormData(){this.props.formData&&0!==this.fields.size&&Object.entries(this.props.formData).forEach((([e,t])=>{const n=this.getFieldContext(e);n&&n.value!==t&&n.setValue(t)}))}}const Qs=({validation:e})=>{const t=oi("form-validation");return(0,ni.jsx)("div",{className:t,children:Array.from(e).map((([e,n])=>(0,ni.jsxs)("div",{className:t.elem("group"),onClick:()=>n.field.focus(),children:[(0,ni.jsx)("div",{className:t.elem("field"),children:n.label}),(0,ni.jsx)("div",{className:t.elem("messages"),children:n.messages.map(((n,r)=>(0,ni.jsx)("div",{className:t.elem("message"),children:n},`${e}-${r}`)))})]},e)))})};Ks.Validator=t,Ks.Row=({columnCount:e,rowGap:t,children:n,style:r,spread:i=!1})=>{const o={};return e&&(o["--column-count"]=e),t&&(o["--row-gap"]=t),(0,ni.jsx)("div",{className:oi("form").elem("row").mod({spread:i}),style:{...null!=r?r:{},...o},children:n})},Ks.Builder=w.forwardRef((({fields:e,formData:t,fetchFields:n,fetchFormData:r,children:i,formRowStyle:o,onSubmit:a,withActions:s,...l},u)=>{const c=null!=u?u:(0,w.useRef)(),[d,f]=(0,w.useState)(null!=e?e:[]),[p,h]=(0,w.useState)(null!=t?t:{}),m=e=>e.map(((e,t)=>{var n,r;if(!e)return(0,ni.jsx)("div",{},`spacer-${t}`);const i=null!==(n=null==p?void 0:p[e.name])&&void 0!==n?n:void 0,o=!0!==l.autosubmit&&!0===e.trigger_form_update,a={key:null!==(r=e.name)&&void 0!==r?r:t,...e};return o&&(a.onChange=async()=>{await c.current.submit({fieldsFilter:t=>t.name===e.name}),await g(),await y()}),"select"===e.type?(0,ni.jsx)(qs,{...a,defaultValue:null!=i?i:e.value}):"counter"===e.type?(0,ni.jsx)($s,{...a,defaultValue:null!=i?i:e.value}):"toggle"===e.type?(0,ni.jsx)(Ys,{...a,checked:null!=i?i:e.value}):(0,ni.jsx)(Vs,{...a,defaultValue:null!=i?i:e.value})})),v=e=>e.map(((e,t)=>(0,ni.jsx)("div",{className:oi("form").elem("column"),style:{width:e.width},children:m(e.fields)},t))),g=(0,w.useCallback)((async()=>{if(n){const e=await n();JSON.stringify(d)!==JSON.stringify(e)&&f(e)}}),[n]),y=(0,w.useCallback)((async()=>{if(r){const e=await r();!1===eo(p,e)&&h(e)}}),[r]),b=(0,w.useCallback)((async(...e)=>{null==a||a(...e),await g(),await y()}),[a,r]);return(0,w.useEffect)((()=>{g()}),[g]),(0,w.useEffect)((()=>{y()}),[y]),(0,w.useEffect)((()=>{f(e)}),[e]),(0,ni.jsxs)(Ks,{...l,onSubmit:b,ref:c,children:[(null!=d?d:[]).map((({columnCount:e,fields:t,columns:n},r)=>(0,ni.jsx)(Ks.Row,{columnCount:e,style:o,spread:!0,children:n?v(n):m(t)},r))),i,!0!==l.autosubmit&&!0===s&&(0,ni.jsx)(Ks.Actions,{children:(0,ni.jsx)(wi,{type:"submit",look:"primary",style:{width:120},children:"Save"})})]})})),Ks.Actions=({children:e,valid:t,extra:n,size:r})=>{const i=oi("form");return(0,ni.jsxs)("div",{className:i.elem("submit").mod({size:r}),children:[(0,ni.jsx)("div",{className:i.elem("info").mod({valid:t}),children:n}),(0,ni.jsx)(ki,{children:e})]})},Ks.Indicator=()=>{const e=w.useContext(yi);return(0,ni.jsx)(si,{name:"form-indicator",children:(0,ni.jsx)(As,{value:e,children:(0,ni.jsx)(li,{tag:"span",mod:{type:e},name:"item",case:"success",children:"Saved!"})})})},Ks.ResponseParser=({children:e})=>{const t=e;if(t instanceof Function==!1)throw new Error("Response Parser only accepts function as a child");const n=(0,w.useContext)(bi);return(0,ni.jsx)(ni.Fragment,{children:n?t(n):null})};function Js(e,t){ha(2,arguments);var n=ma(e),r=ma(t),i=n.getTime()-r.getTime();return i<0?-1:i>0?1:i}function Zs(e,t){ha(2,arguments);var n=ma(e),r=ma(t),i=n.getFullYear()-r.getFullYear(),o=n.getMonth()-r.getMonth();return 12*i+o}function el(e){ha(1,arguments);var t=ma(e);return t.setHours(23,59,59,999),t}function tl(e){ha(1,arguments);var t=ma(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function nl(e){ha(1,arguments);var t=ma(e);return el(t).getTime()===tl(t).getTime()}function rl(e,t){ha(2,arguments);var n=ma(e),r=ma(t),i=Js(n,r),o=Math.abs(Zs(n,r));1===n.getMonth()&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-i*o);var a=Js(n,r)===-i;nl(ma(e))&&1===o&&1===Js(e,r)&&(a=!1);var s=i*(o-a);return 0===s?0:s}function il(e,t){ha(2,arguments);var n=ma(e),r=ma(t);return n.getTime()-r.getTime()}function ol(e,t){ha(2,arguments);var n=il(e,t)/1e3;return n>0?Math.floor(n):Math.ceil(n)}function al(e){return function(e,t){if(null==e)throw new TypeError("assign requires that input parameter not be null or undefined");for(var n in t=t||{})t.hasOwnProperty(n)&&(e[n]=t[n]);return e}({},e)}var sl=1440,ll=43200;function ul(e,t,n){ha(2,arguments);var r=n||{},i=r.locale||Ca;if(!i.formatDistance)throw new RangeError("locale must contain formatDistance property");var o=Js(e,t);if(isNaN(o))throw new RangeError("Invalid time value");var a,s,l=al(r);l.addSuffix=Boolean(r.addSuffix),l.comparison=o,o>0?(a=ma(t),s=ma(e)):(a=ma(e),s=ma(t));var u,c=ol(s,a),d=(es(s)-es(a))/1e3,f=Math.round((c-d)/60);if(f<2)return r.includeSeconds?c<5?i.formatDistance("lessThanXSeconds",5,l):c<10?i.formatDistance("lessThanXSeconds",10,l):c<20?i.formatDistance("lessThanXSeconds",20,l):c<40?i.formatDistance("halfAMinute",null,l):c<60?i.formatDistance("lessThanXMinutes",1,l):i.formatDistance("xMinutes",1,l):0===f?i.formatDistance("lessThanXMinutes",1,l):i.formatDistance("xMinutes",f,l);if(f<45)return i.formatDistance("xMinutes",f,l);if(f<90)return i.formatDistance("aboutXHours",1,l);if(f<sl){var p=Math.round(f/60);return i.formatDistance("aboutXHours",p,l)}if(f<2520)return i.formatDistance("xDays",1,l);if(f<ll){var h=Math.round(f/sl);return i.formatDistance("xDays",h,l)}if(f<86400)return u=Math.round(f/ll),i.formatDistance("aboutXMonths",u,l);if((u=rl(s,a))<12){var m=Math.round(f/ll);return i.formatDistance("xMonths",m,l)}var v=u%12,g=Math.floor(u/12);return v<3?i.formatDistance("aboutXYears",g,l):v<9?i.formatDistance("overXYears",g,l):i.formatDistance("almostXYears",g+1,l)}const cl=({onSelect:e,selectedUser:t,defaultSelected:n})=>{const r=Vi(),[i,o]=(0,w.useState)(),a=(0,w.useCallback)((async()=>{const e=await r.callApi("memberships",{params:{pk:1}});o(e)}),[r]),s=(0,w.useCallback)((n=>{(null==t?void 0:t.id)===n.id?null==e||e(null):null==e||e(n)}),[t]);return(0,w.useEffect)((()=>{a()}),[]),(0,w.useEffect)((()=>{if(ci(n)&&i){const e=i.find((({user:e})=>e.id===Number(n)));e&&s(e.user)}}),[i,n]),(0,ni.jsx)(si,{name:"people-list",children:i?(0,ni.jsxs)(li,{name:"users",children:[(0,ni.jsxs)(li,{name:"header",children:[(0,ni.jsx)(li,{name:"column",mix:"avatar"}),(0,ni.jsx)(li,{name:"column",mix:"email",children:"Email"}),(0,ni.jsx)(li,{name:"column",mix:"name",children:"Name"}),(0,ni.jsx)(li,{name:"column",mix:"last-activity",children:"Last Activity"})]}),(0,ni.jsx)(li,{name:"body",children:i.map((({user:e})=>{const n=e.id===(null==t?void 0:t.id);return(0,ni.jsxs)(li,{name:"user",mod:{active:n},onClick:()=>s(e),children:[(0,ni.jsx)(li,{name:"field",mix:"avatar",children:(0,ni.jsx)(pa,{user:e,style:{width:28,height:28}})}),(0,ni.jsx)(li,{name:"field",mix:"email",children:e.email}),(0,ni.jsxs)(li,{name:"field",mix:"name",children:[e.first_name," ",e.last_name]}),(0,ni.jsx)(li,{name:"field",mix:"last-activity",children:ul(new Date(e.last_activity),new Date,{addSuffix:!0})})]},`user-${e.id}`)}))})]}):(0,ni.jsx)(li,{name:"loading",children:(0,ni.jsx)(xs,{size:36})})})},dl=({projects:e})=>(0,ni.jsx)(li,{name:"links-list",children:e.map((e=>(0,ni.jsx)(li,{tag:Oo,name:"project-link",to:`/projects/${e.id}`,"data-external":!0,children:e.title},`project-${e.id}`)))}),fl=({user:e,onClose:t})=>{const n=[e.first_name,e.last_name].filter((e=>!!e)).join(" ").trim();return(0,ni.jsxs)(si,{name:"user-info",children:[(0,ni.jsx)(li,{name:"close",tag:wi,type:"link",onClick:t,children:(0,ni.jsx)(Vn,{})}),(0,ni.jsxs)(li,{name:"header",children:[(0,ni.jsx)(pa,{user:e,style:{width:64,height:64,fontSize:28}}),n&&(0,ni.jsx)(li,{name:"full-name",children:n}),(0,ni.jsx)(li,{tag:"p",name:"email",children:e.email})]}),e.phone&&(0,ni.jsx)(li,{name:"section",children:(0,ni.jsx)("a",{href:`tel:${e.phone}`,children:e.phone})}),!!e.created_projects.length&&(0,ni.jsxs)(li,{name:"section",children:[(0,ni.jsx)(li,{name:"section-title",children:"Created Projects"}),(0,ni.jsx)(dl,{projects:e.created_projects})]}),!!e.contributed_to_projects.length&&(0,ni.jsxs)(li,{name:"section",children:[(0,ni.jsx)(li,{name:"section-title",children:"Contributed to"}),(0,ni.jsx)(dl,{projects:e.contributed_to_projects})]}),(0,ni.jsxs)(li,{tag:"p",name:"last-active",children:["Last activity on: ",ds(new Date(e.last_activity),"dd MMM yyyy, KK:mm a")]})]})},pl=({link:e})=>(0,ni.jsxs)(si,{name:"invite",children:[(0,ni.jsx)(Vs,{value:e,style:{width:"100%"},readOnly:!0}),(0,ni.jsxs)(Ss,{style:{width:"70%",marginTop:16},children:["Invite people to join your Label Studio instance. People that you invite have full access to all of your projects. ",(0,ni.jsx)("a",{href:"https://labelstud.io/guide/signup.html",children:"Learn more"}),"."]})]}),hl=()=>{const e=Vi(),t=(0,w.useRef)(),n=Ei(),[r,i]=(0,w.useState)(null),[o,a]=(0,w.useState)(),s=(0,w.useCallback)((e=>{i(e),localStorage.setItem("selectedUser",null==e?void 0:e.id)}),[i]),l=(0,w.useCallback)((e=>{const t=n.hostname||location.origin;a(`${t}${e}`)}),[n,a]),u=(0,w.useCallback)((()=>{e.callApi("resetInviteLink").then((({invite_url:e})=>{l(e)}))}),[l]),c=(0,w.useCallback)((e=>({title:"Invite people",style:{width:640,height:472},body:()=>(0,ni.jsx)(pl,{link:e}),footer:()=>{const[t,n]=(0,w.useState)(!1),r=(0,w.useCallback)((()=>{n(!0),hi(e),setTimeout((()=>n(!1)),1500)}),[]);return(0,ni.jsxs)(ki,{spread:!0,children:[(0,ni.jsx)(ki,{children:(0,ni.jsx)(wi,{style:{width:170},onClick:()=>u(),children:"Reset Link"})}),(0,ni.jsx)(ki,{children:(0,ni.jsx)(wi,{primary:!0,style:{width:170},onClick:r,children:t?"Copied!":"Copy link"})})]})},bareFooter:!0})),[]),d=(0,w.useCallback)((()=>{t.current=Ri(c(o))}),[c,o]),f=(0,w.useMemo)((()=>localStorage.getItem("selectedUser")),[]);return(0,w.useEffect)((()=>{e.callApi("inviteLink").then((({invite_url:e})=>{l(e)}))}),[]),(0,w.useEffect)((()=>{var e;null===(e=t.current)||void 0===e||e.update(c(o))}),[o]),(0,ni.jsxs)(si,{name:"people",children:[(0,ni.jsx)(li,{name:"controls",children:(0,ni.jsxs)(ki,{spread:!0,children:[(0,ni.jsx)(ki,{}),(0,ni.jsx)(ki,{children:(0,ni.jsx)(wi,{icon:(0,ni.jsx)(Rr,{}),primary:!0,onClick:d,children:"Add People"})})]})}),(0,ni.jsxs)(li,{name:"content",children:[(0,ni.jsx)(cl,{selectedUser:r,defaultSelected:f,onSelect:e=>s(e)}),r&&(0,ni.jsx)(fl,{user:r,onClose:()=>s(null)})]})]})};hl.title="People",hl.path="/people";n(9589);var ml=n(9656);const vl="FFA39E D4380D FFC069 AD8B00 D3F261 389E0D 5CDBD3 096DD9 ADC6FF 9254DE F759AB".split(" ").map((e=>"#"+e));function*gl(e=vl){let t=0;for(;;)yield e[t],t=(t+1)%e.length}window.Palette=gl;const yl={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},bl={Image:{type:"Image",settings:{strokeWidth:{title:"Width of region borders",type:Number,param:(e,t)=>e.$controls.forEach((e=>e.setAttribute("strokeWidth",t))),value:e=>{var t,n;return null!==(t=null===(n=e.$controls[0])||void 0===n?void 0:n.getAttribute("strokeWidth"))&&void 0!==t?t:1}},zoom:{title:"Allow image zoom (ctrl+wheel)",type:Boolean,param:"zoom"},zoomControl:{title:"Show controls to zoom in and out",type:Boolean,param:"zoomControl"},rotateControl:{title:"Show controls to rotate image",type:Boolean,param:"rotateControl"}}},Text:{type:"Text",settings:{granularity:{title:"Select text by words",type:Boolean,param:(e,t)=>t?e.setAttribute("granularity","word"):e.removeAttribute("granularity"),value:e=>"word"===e.getAttribute("granularity"),when:e=>e.$controls.filter((e=>e.tagName.endsWith("Labels"))).length>0}}},HyperText:{type:"HyperText"},Audio:{type:"Audio"},AudioPlus:{type:"AudioPlus"},TimeSeries:{type:"TimeSeries"},Paragraphs:{type:"Paragraphs"},Table:{type:"Table"}},wl={type:"Labels",settings:{placeLabelsLeft:{title:"Display labels:",type:["bottom","left","right","top"],control:!0,param:(e,t)=>{var n,r,i;let o=e.parentNode,a=e;"FILTER"===(null===(n=o.firstChild)||void 0===n||null===(r=n.tagName)||void 0===r?void 0:r.toUpperCase())&&(a=o,o=a.parentNode);const s=e.$object,l=["top","bottom"].includes(t),u=(l?"column":"row")+(["top","left"].includes(t)?"-reverse":"");(null===(i=o.getAttribute("style"))||void 0===i?void 0:i.includes("flex"))||(o=s.ownerDocument.createElement("View"),a.parentNode.insertBefore(o,s),o.appendChild(s),o.appendChild(a)),e.setAttribute("showInline",JSON.stringify(l)),o.setAttribute("style","display:flex;align-items:start;gap:8px;flex-direction:"+u)},value:e=>{var t,n;let r=e.parentNode;"FILTER"===(null===(t=r.firstChild)||void 0===t||null===(n=t.tagName)||void 0===n?void 0:n.toUpperCase())&&(r=r.parentNode);const i=r.getAttribute("style"),o=null==i?void 0:i.match(/direction:(row|column)(-reverse)?/);if(!o){return e.compareDocumentPosition(e.$object)&Node.DOCUMENT_POSITION_FOLLOWING?"top":"bottom"}return"column"===o[1]?o[2]?"top":"bottom":o[2]?"left":"right"}},filter:{title:"Add filter for long list of labels",type:Boolean,control:!0,param:(e,t)=>{if(t){const t=e.ownerDocument.createElement("Filter"),n=e.ownerDocument.createElement("View");t.setAttribute("toName",e.getAttribute("name")),t.setAttribute("minlength",0),t.setAttribute("name","filter"),e.parentNode.insertBefore(n,e),n.appendChild(t),n.appendChild(e)}else{if("FILTER"===e.previousElementSibling.tagName.toUpperCase()){const t=e.parentNode;t.parentNode.insertBefore(e,t),t.parentNode.removeChild(t)}}},value:e=>{var t;return"FILTER"===(null===(t=e.previousElementSibling)||void 0===t?void 0:t.tagName.toUpperCase())}}}},xl={Labels:wl,RectangleLabels:wl};function kl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Sl="<View></View>",Cl="$undefined$",_l=e=>["",Sl].includes(e.replace(/\s+/g,""));class El{constructor(e){kl(this,"objects",[]),kl(this,"controls",[]),kl(this,"details",!1),kl(this,"palette",gl()),this.tpl=e,this.config=e.config;const t=new DOMParser;this.$root=t.parseFromString(this.config,"application/xml"),this.serializer=new XMLSerializer,this.initRoot()}flatten(e){const t=[];for(let n of e.children)t.push(n),n.children.length&&t.push(...this.flatten(n));return t}onConfigUpdate(){}render(){const e=this.serializer.serializeToString(this.$root);this.onConfigUpdate(e)}initRoot(){const e=this.flatten(this.$root);this.objects=e.filter((e=>e.tagName in bl));const t=this.objects.map((e=>e.getAttribute("name")));this.controls=e.filter((e=>t.includes(e.getAttribute("toName"))));for(let e of this.objects){const t=bl[e.tagName];e.$controls=this.controls.filter((t=>t.getAttribute("toName")===e.getAttribute("name"))),e.$controls.forEach((t=>t.$object=e));let n={...t.settings};e.$controls.forEach((e=>{let t=xl[e.tagName];t&&(n={...n,...t.settings})})),this.settings=n}}fixColumns(e){if(1===e.length&&e[0]===Cl)return;const t=this.objects.map((e=>e.getAttribute("value").replace(/^\$/,"")));let n=e.filter((e=>!t.includes(e)));for(let t of this.objects){var r;if(!e.includes(t.getAttribute("value").replace(/^\$/,"")))t.setAttribute("value","$"+(null!==(r=n.shift())&&void 0!==r?r:e[0]))}this.render()}addLabels(e,t){if(!t)return;if(Array.isArray(t)||(t=t.split("\n").map((e=>e.trim())).filter(Boolean)),!t.length)return;const n=[...e.children].map((e=>e.getAttribute("value"))),r="Choices"===e.tagName;t.forEach((t=>{if(n.includes(t))return;n.push(t);const i=this.$root.createElement(r?"Choice":"Label");i.setAttribute("value",t),r||i.setAttribute("background",this.palette.next().value),e.appendChild(i)})),this.render()}removeLabel(e){e.parentNode.removeChild(e),this.render()}changeLabel(e,t){for(let n of Object.keys(t))e.setAttribute(n,t[n]);this.render()}}const Tl=oi("configure"),jl=({config:e,data:t,error:n})=>{var r,i,o,a,s,l,u,c;const d=Zi("lsf"),f=(0,w.useRef)(),p=(0,w.useRef)();return(0,w.useEffect)((()=>{if(!d)return;if(!f.current)return;if(n)return;if(!t)return;const r=window.LabelStudio;try{var i;null===(i=p.current)||void 0===i||i.destroy(),p.current=new r(f.current,{config:e||Sl,interfaces:["side-column"],task:{annotations:[],predictions:[],id:1,data:t},onLabelStudioLoad:function(e){e.settings.bottomSidePanel=!0;var t=e.annotationStore.addAnnotation({userGenerate:!0});e.annotationStore.selectAnnotation(t.id)}})}catch(e){console.error(e)}}),[e,t,d,f]),(0,ni.jsxs)("div",{className:Tl.elem("preview"),children:[(0,ni.jsx)("h3",{children:"UI Preview"}),n&&(0,ni.jsxs)("div",{className:Tl.elem("preview-error"),children:[(0,ni.jsxs)("h2",{children:[n.detail," ",n.id]}),null===(r=n.validation_errors)||void 0===r||null===(i=r.non_field_errors)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,(e=>(0,ni.jsx)("p",{children:e},e))),null===(a=n.validation_errors)||void 0===a||null===(s=a.label_config)||void 0===s||null===(l=s.map)||void 0===l?void 0:l.call(s,(e=>(0,ni.jsx)("p",{children:e},e))),null===(u=n.validation_errors)||void 0===u||null===(c=u.map)||void 0===c?void 0:c.call(u,(e=>(0,ni.jsx)("p",{children:e},e)))]}),!t&&(0,ni.jsx)(xs,{style:{width:"100%",height:"50vh"}}),(0,ni.jsx)("div",{id:"label-studio",ref:f})]})},Ol=oi("templates-list"),Nl=()=>(0,ni.jsx)("svg",{width:"8",height:"12",viewBox:"0 0 8 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,ni.jsx)("path",{opacity:"0.9",d:"M2 10L6 6L2 2",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"square"})}),Ml=({templates:e,group:t,onSelectRecipe:n})=>{const r=e.filter((e=>e.group===t)).sort(((e,t)=>{var n,r;return(null!==(n=e.order)&&void 0!==n?n:1/0)-(null!==(r=t.order)&&void 0!==r?r:1/0)}));return(0,ni.jsx)("ul",{children:r.map((e=>(0,ni.jsxs)("li",{onClick:()=>n(e),className:Ol.elem("template"),children:[(0,ni.jsx)("img",{src:e.image}),(0,ni.jsx)("h3",{children:e.title})]},e.title)))})},Ll=({selectedGroup:e,selectedRecipe:t,onCustomTemplate:n,onSelectGroup:r,onSelectRecipe:i})=>{const[o,a]=w.useState([]),[s,l]=w.useState(),u=Vi();w.useEffect((async()=>{const e=await u.callApi("configTemplates");if(!e)return;const{templates:t,groups:n}=e;l(t),a(n)}),[]);const c=e||o[0];return(0,ni.jsxs)("div",{className:Ol,children:[(0,ni.jsxs)("aside",{className:Ol.elem("sidebar"),children:[(0,ni.jsx)("ul",{children:o.map((e=>(0,ni.jsxs)("li",{onClick:()=>r(e),className:Ol.elem("group").mod({active:c===e,selected:(null==t?void 0:t.group)===e}),children:[e,(0,ni.jsx)(Nl,{})]},e)))}),(0,ni.jsx)("button",{type:"button",onClick:n,className:Ol.elem("custom-template"),children:"Custom template"})]}),(0,ni.jsxs)("main",{children:[!s&&(0,ni.jsx)(xs,{style:{width:"100%",height:200}}),(0,ni.jsx)(Ml,{templates:s||[],group:c,onSelectRecipe:i})]}),(0,ni.jsxs)("footer",{children:[(0,ni.jsx)(yr,{className:Ol.elem("info-icon"),width:"20",height:"20"}),"See the documentation to ",(0,ni.jsx)("a",{href:"https://labelstud.io/guide",target:"_blank",children:"contribute a template"}),"."]})]})},Pl=e=>{let t=0;try{return e.replace(/<(\/)?.*?(\/)?>[\s\n]*/g,((e,n,r)=>{if(n)return t--,"  ".repeat(t)+e.trim()+"\n";{const n="  ".repeat(t)+e.trim()+"\n";return r||t++,n}}))}catch(t){return e}},Al=oi("wizard"),Dl=oi("configure"),Rl=()=>(0,ni.jsxs)("div",{className:Dl.elem("empty-config"),children:[(0,ni.jsx)("p",{children:"Your labeling configuration is empty. It is required to label your data."}),(0,ni.jsxs)("p",{children:["Start from one of our predefined templates or create your own config on the Code panel. The labeling config is XML-based and you can ",(0,ni.jsx)("a",{href:"https://labelstud.io/tags/",target:"_blank",children:"read about the available tags in our documentation"}),"."]})]}),Il=({label:e,template:t,color:n})=>{const r=e.getAttribute("value");return(0,ni.jsxs)("li",{className:Dl.elem("label").mod({choice:"Choice"===e.tagName}),children:[(0,ni.jsx)("label",{style:{background:n},children:(0,ni.jsx)("input",{type:"color",className:Dl.elem("label-color"),value:yl[n]||n,onChange:n=>t.changeLabel(e,{background:n.target.value})})}),(0,ni.jsx)("span",{children:r}),(0,ni.jsx)("button",{type:"button",className:Dl.elem("delete-label"),onClick:()=>t.removeLabel(e),children:(0,ni.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"red",strokeWidth:"2",strokeLinecap:"square",xmlns:"http://www.w3.org/2000/svg",children:[(0,ni.jsx)("path",{d:"M2 12L12 2"}),(0,ni.jsx)("path",{d:"M12 12L2 2"})]})})]})},Fl=({control:e,template:t})=>{const n=w.useRef(),r=e.tagName;if("Choices"!==r&&!r.endsWith("Labels"))return null;const i=gl(),o=()=>{n.current&&(t.addLabels(e,n.current.value),n.current.value="")};return(0,ni.jsxs)("div",{className:Dl.elem("labels"),children:[(0,ni.jsxs)("form",{className:Dl.elem("add-labels"),action:"",children:[(0,ni.jsx)("h4",{children:"Choices"===r?"Add choices":"Add label names"}),(0,ni.jsx)("textarea",{name:"labels",id:"",cols:"30",rows:"5",ref:n,onKeyPress:e=>{"Enter"===e.key&&e.ctrlKey&&(e.preventDefault(),o())}}),(0,ni.jsx)("input",{type:"button",value:"Add",onClick:o})]}),(0,ni.jsxs)("div",{className:Dl.elem("current-labels"),children:[(0,ni.jsxs)("h3",{children:["Choices"===r?"Choices":"Labels"," (",e.children.length,")"]}),(0,ni.jsx)("ul",{children:Array.from(e.children).map((e=>(0,ni.jsx)(Il,{label:e,template:t,color:e.getAttribute("background")||i.next().value},e.getAttribute("value"))))})]})]})},zl=({template:e})=>{const{settings:t}=e;if(!t)return null;const n=Object.keys(t).map((n=>{const r=t[n],i=Array.isArray(r.type)?Array:r.type,o=e.objects[0],a=r.control?o.$controls[0]:o;if(!a)return null;if(r.when&&!r.when(a))return;let s,l,u=!1;switch(r.value?u=r.value(a):"string"==typeof r.param&&(u=a.getAttribute(r.param)),"true"===u&&(u=!0),"false"===u&&(u=!1),i){case Array:return s=t=>{"function"==typeof r.param?r.param(a,t.target.value):o.setAttribute(r.param,t.target.value),e.render()},(0,ni.jsx)("li",{children:(0,ni.jsxs)("label",{children:[r.title," ",(0,ni.jsx)("select",{value:u,onChange:s,children:r.type.map((e=>(0,ni.jsx)("option",{value:e,children:e},e)))})]})},n);case Boolean:return s=t=>{"function"==typeof r.param?r.param(a,t.target.checked):o.setAttribute(r.param,t.target.checked?"true":"false"),e.render()},(0,ni.jsx)("li",{children:(0,ni.jsxs)("label",{children:[(0,ni.jsx)("input",{type:"checkbox",checked:u,onChange:s})," ",r.title]})},n);case String:case Number:return l=r.type===Number?5:void 0,s=t=>{"function"==typeof r.param?r.param(o,t.target.value):o.setAttribute(r.param,t.target.value),e.render()},(0,ni.jsx)("li",{children:(0,ni.jsxs)("label",{children:[r.title," ",(0,ni.jsx)("input",{type:"text",onInput:s,value:u,size:l})]})},n)}}));return n.filter(Boolean).length?(0,ni.jsx)("ul",{className:Dl.elem("settings"),children:(0,ni.jsxs)("li",{children:[(0,ni.jsx)("h4",{children:"Configure settings"}),(0,ni.jsx)("ul",{className:Dl.elem("object-settings"),children:n})]})}):null},Hl=({columns:e,template:t})=>{const n=e=>n=>{const r=n.target.value.replace(/^\$/,"");e.setAttribute("value","$"+r),t.render()};return t.objects.length?(0,ni.jsxs)("div",{className:Dl.elem("object"),children:[(0,ni.jsx)("h4",{children:"Configure data"}),t.objects.length>1&&(null==e?void 0:e.length)>0&&e.length<t.objects.length&&(0,ni.jsx)("p",{className:Dl.elem("object-error"),children:"This template requires more data then you have for now"}),0===(null==e?void 0:e.length)&&(0,ni.jsx)("p",{className:Dl.elem("object-error"),children:"To select which field(s) to label you need to upload the data. Alternatively, you can provide it using Code mode."}),t.objects.map((r=>{var i,o;return(0,ni.jsxs)("p",{children:["Use ",r.tagName.toLowerCase(),t.objects>1&&` for ${r.getAttribute("name")}`," from ",(null==e?void 0:e.length)>0&&e[0]!==Cl&&"field ",(0,ni.jsxs)("select",{onChange:n(r),value:null===(i=r.getAttribute("value"))||void 0===i?void 0:i.replace(/^\$/,""),children:[null==e?void 0:e.map((e=>(0,ni.jsx)("option",{value:e,children:e===Cl?"<imported file>":`$${e}`},e))),!(null!=e&&e.length)&&(0,ni.jsx)("option",{value:null===(o=r.getAttribute("value"))||void 0===o?void 0:o.replace(/^\$/,""),children:"<imported file>"})]})]},r.getAttribute("name"))}))]}):null},Ul=({columns:e,config:t,project:n,template:r,setTemplate:i,onBrowse:o,onSaveClick:a,onValidate:s,disableSaveButton:l})=>{const[u,c]=w.useState(_l(t)?"code":"visual"),[d,f]=w.useState("visual"===u),[p,h]=w.useState(!1),[m,v]=w.useState(),[g,y]=w.useState(),[b,x]=w.useState(),k=w.useRef(),S=Vi();w.useEffect((()=>(k.current=window.setTimeout((()=>y(t)),g?500:30),()=>window.clearTimeout(k.current))),[t]),w.useEffect((async()=>{if(!g)return;const e=await S.callApi("validateConfig",{params:{pk:n.id},body:{label_config:g},errorFilter:()=>!0});if(null!=e&&e.error)return void v(e.response);v(null),null==s||s(e);const t=await S.callApi("createSampleTask",{params:{pk:n.id},body:{label_config:g},errorFilter:()=>!0});t&&!t.error?x(t.sample_task):v(null==t?void 0:t.response)}),[g]),w.useEffect((()=>{v(null)}),[r,t]);const C=(0,ni.jsxs)("p",{className:Dl.elem("tags-link"),children:["Configure the labeling interface with tags.",(0,ni.jsx)("br",{}),(0,ni.jsx)("a",{href:"https://labelstud.io/tags/",target:"_blank",children:"See all available tags"}),"."]});return(0,ni.jsxs)("div",{className:Dl,children:[(0,ni.jsxs)("div",{className:Dl.elem("container"),children:[(0,ni.jsxs)("header",{children:[(0,ni.jsx)("button",{onClick:o,children:"Browse Templates"}),(0,ni.jsx)(ks,{items:{code:"Code",visual:"Visual"},active:u,onSelect:e=>{c(e),"visual"===e&&f(!0)}})]}),(0,ni.jsxs)("div",{className:Dl.elem("editor"),children:["code"===u&&(0,ni.jsx)("div",{className:Dl.elem("code"),style:{display:"code"===u?void 0:"none"},children:(0,ni.jsx)(ml.Rt,{name:"code",id:"edit_code",value:Pl(t),detach:!0,options:{mode:"xml",theme:"default",lineNumbers:!0},onChange:(e,t,n)=>i(n)})}),d&&(0,ni.jsxs)("div",{className:Dl.elem("visual"),style:{display:"visual"===u?void 0:"none"},children:[_l(t)&&(0,ni.jsx)(Rl,{}),(0,ni.jsx)(Hl,{columns:e,project:n,template:r}),r.controls.map((e=>(0,ni.jsx)(Fl,{control:e,template:r},e.getAttribute("name")))),(0,ni.jsx)(zl,{template:r})]})]}),!0!==l&&a&&(0,ni.jsx)(Ks.Actions,{size:"small",extra:"code"===u&&C,valid:!0,children:(0,ni.jsx)(wi,{look:"primary",size:"compact",style:{width:120},onClick:async()=>{v(null),h(!0);const e=await a();h(!1),!0!==e&&v(e)},waiting:p,children:"Save"})})]}),(0,ni.jsx)(jl,{config:t,data:b,error:m})]})},Bl=({config:e="",columns:t,project:n,onUpdate:r,onSaveClick:i,onValidate:o,disableSaveButton:a,show:s=!0})=>{const[l,u]=w.useState(""),[c,d]=w.useState("list"),[f,p]=w.useState(null),[h,m]=w.useState(null),[v,g]=w.useState(null),y=Vi(),b=w.useCallback((e=>{u(e),r(e)}),[u,r]),x=w.useCallback((e=>{const t=new El({config:e});t.onConfigUpdate=b,b(e),g(t)}),[b,g]),[k,S]=w.useState();w.useEffect((()=>{null!=t&&t.length&&S(t)}),[t]),w.useEffect((async()=>{if(!n||k)return;const e=await y.callApi("dataSummary",{params:{pk:n.id},errorFilter:()=>!0});null!=e&&e.common_data_columns&&S(e.common_data_columns)}),[k,n]),w.useEffect((()=>{null!=k&&k.length&&v&&v.fixColumns(k)}),[k,v]);const C=w.useCallback((e=>{if(!e)return m(null),void d("list");x(e.config),m(e),d("view")})),_=w.useCallback((()=>{x(Sl),d("view")}));return w.useEffect((()=>{e&&(x(e),d("view"))}),[]),s?(0,ni.jsx)("div",{className:Al,"data-mode":"list",id:"config-wizard",children:(0,ni.jsxs)(As,{value:c,children:[(0,ni.jsx)(Ll,{case:"list",selectedGroup:f,selectedRecipe:h,onSelectGroup:p,onSelectRecipe:C,onCustomTemplate:_}),(0,ni.jsx)(Ul,{case:"view",columns:k,config:l,project:n,selectedRecipe:h,template:v,setTemplate:x,onBrowse:d.bind(null,"list"),onValidate:o,disableSaveButton:a,onSaveClick:i})]})}):null},Wl=oi("upload_page"),$l=oi("dropzone");function Vl(e){return[].concat(...e)}function ql(e,t){return new Promise((n=>{if(t=t||"",e.isFile){if("."===e.name[0])return n([]);n([e])}else if(e.isDirectory){const r=e.createReader(),i=t+e.name+"/";r.readEntries((function(e){Promise.all(e.map((e=>ql(e,i)))).then(Vl).then(n)}))}}))}const Gl=()=>(0,ni.jsxs)(Di.Footer,{children:[(0,ni.jsx)(yr,{className:Wl.elem("info-icon"),width:"20",height:"20"}),"See the documentation to ",(0,ni.jsx)("a",{target:"_blank",href:"https://labelstud.io/guide/predictions.html",children:"import preannotated data"})," ","or to ",(0,ni.jsx)("a",{target:"_blank",href:"https://labelstud.io/guide/storage.html",children:"sync data from a database or cloud storage"}),"."]}),Yl=({children:e,sendFiles:t})=>{const[n,r]=(0,w.useState)(!1),i=e=>{e.preventDefault(),r(!0)},o=r.bind(null,!1),a=(0,w.useRef)(),s=(0,w.useCallback)((e=>{var n;e.preventDefault(),o(),(n=e.dataTransfer.items,new Promise((e=>{if(!n.length)return e([]);if(!n[0].webkitGetAsEntry)return e(n);const t=Array.from(n).map((e=>e.webkitGetAsEntry()));Promise.all(t.map(ql)).then(Vl).then((e=>e.map((e=>new Promise((t=>e.file(t))))))).then((e=>Promise.all(e))).then(e)}))).then((e=>t(e)))}),[o,t]);return(0,ni.jsx)("div",{id:"holder",className:$l.mod({hovered:n}),ref:a,onDragStart:i,onDragOver:i,onDragLeave:o,onDrop:s,children:e})},Xl=({error:e})=>{var t;if(!e)return null;let n=null!==(t=e.validation_errors)&&void 0!==t?t:e.extra;var r;n&&"object"==typeof n&&!Array.isArray(n)&&(n=null!==(r=n.non_field_errors)&&void 0!==r?r:Object.values(n));return Array.isArray(n)&&(n=n.join("; ")),(0,ni.jsxs)("div",{className:Wl.elem("error"),children:[(0,ni.jsx)(rr,{style:{marginRight:8}}),e.id&&`[${e.id}] `,e.detail||e.message,n&&` (${n})`]})},Kl=({project:e,show:t=!0,onWaiting:n,onFileListUpdate:r,highlightCsvHandling:i,dontCommitToProject:o=!1,csvHandling:a,setCsvHandling:s,addColumns:l})=>{var u,c;const[d,f]=(0,w.useState)(!1),[p,h]=(0,w.useState)(),[m,v]=(0,w.useState)([]),g=Vi(),[y,b]=(0,w.useReducer)(((e,t)=>t.sending?{...e,uploading:[...t.sending,...e.uploading]}:t.sent?{...e,uploading:e.uploading.filter((e=>!t.sent.includes(e)))}:t.uploaded?{...e,uploaded:ui([...e.uploaded,...t.uploaded],((e,t)=>e.id===t.id))}:e),{uploaded:[],uploading:[]}),x=Boolean((null===(u=y.uploaded)||void 0===u?void 0:u.length)||(null===(c=y.uploading)||void 0===c?void 0:c.length)),k=e=>{v(e),null==r||r(e)},S=(0,w.useCallback)((async t=>{const n={};t&&(n.ids=JSON.stringify(t));const r=await g.callApi("fileUploads",{params:{pk:e.id,...n}});return b({uploaded:null!=r?r:[]}),null!=r&&r.length&&k(ui([...m,...r.map((e=>e.id))])),r}),[e]),C=()=>{f(!0),h(null)},_=e=>{if(console.error(e),"string"==typeof e&&e.includes("RequestDataTooBig")){var t;const n="Imported file is too big",r=null===(t=e.match(/"exception_value">(.*)<\/pre>/))||void 0===t?void 0:t[1];e={message:n,extra:r}}h(e),f(!1),null==n||n(!1)},E=(0,w.useCallback)((e=>{const{could_be_tasks_list:t,data_columns:r,file_upload_ids:i}=e,o=[...m,...i];return k(o),t&&!a&&s("choose"),f(!0),null==n||n(!1),l(r),S(o).then((()=>f(!1)))}),[l,S,k,m,f]),T=(0,w.useCallback)((async(t,n)=>{b({sending:t});const r=o?{commit_to_project:"false"}:{},i=n instanceof FormData?"multipart/form-data":"application/x-www-form-urlencoded",a=await g.callApi("importFiles",{params:{pk:e.id,...r},headers:{"Content-Type":i},body:n,errorFilter:()=>!0});a&&!a.error?null==E||E(a):null==_||_(null==a?void 0:a.response),b({sent:t})}),[e,E]),j=(0,w.useCallback)((e=>{C(),null==n||n(!0),e=[...e];const t=new FormData;for(let n of e)t.append(n.name,n);return T(e,t)}),[T,C]),O=(0,w.useCallback)((e=>{j(e.target.files),e.target.value=""}),[j]),N=(0,w.useCallback)((e=>{var t;e.preventDefault(),C();const r=null===(t=M.current)||void 0===t?void 0:t.value;if(!r)return void f(!1);M.current.value="",null==n||n(!0);const i=new URLSearchParams({url:r});T([{name:r}],i)}),[T]);(0,w.useEffect)((()=>{void 0!==(null==e?void 0:e.id)&&S().then((e=>{a||Array.isArray(e)&&e.some((({file:e})=>/\.[ct]sv$/.test(e)))&&s("choose")}))}),[e,S]);const M=(0,w.useRef)();if(!e)return null;if(!t)return null;const L={name:"csv",type:"radio",onChange:e=>s(e.target.value)};return(0,ni.jsxs)("div",{className:Wl,children:[i&&(0,ni.jsx)("div",{className:Wl.elem("csv-splash")}),(0,ni.jsx)("input",{id:"file-input",type:"file",name:"file",multiple:!0,onChange:O,style:{display:"none"}}),(0,ni.jsxs)("header",{children:[(0,ni.jsxs)("form",{className:Wl.elem("url-form")+" inline",method:"POST",onSubmit:N,children:[(0,ni.jsx)("input",{placeholder:"Dataset URL",name:"url",ref:M}),(0,ni.jsx)("button",{type:"submit",children:"Add URL"})]}),(0,ni.jsx)("span",{children:"or"}),(0,ni.jsxs)("button",{onClick:()=>document.getElementById("file-input").click(),className:Wl.elem("upload-button"),children:[(0,ni.jsx)(ti,{width:"16",height:"16",className:Wl.elem("upload-icon")}),"Upload ",y.uploaded.length?"More ":"","Files"]}),(0,ni.jsxs)("div",{className:Wl.elem("csv-handling").mod({highlighted:i,hidden:!a}),children:[(0,ni.jsx)("span",{children:"Treat CSV/TSV as"}),(0,ni.jsxs)("label",{children:[(0,ni.jsx)("input",{...L,value:"tasks",checked:"tasks"===a})," List of tasks"]}),(0,ni.jsxs)("label",{children:[(0,ni.jsx)("input",{...L,value:"ts",checked:"ts"===a})," Time Series"]})]}),(0,ni.jsx)("div",{className:Wl.elem("status"),children:y.uploaded.length?`${y.uploaded.length} files uploaded`:""})]}),(0,ni.jsx)(Xl,{error:p}),(0,ni.jsx)("main",{children:(0,ni.jsxs)(Yl,{sendFiles:j,project:e,children:[!x&&(0,ni.jsx)("label",{htmlFor:"file-input",children:(0,ni.jsxs)("div",{className:$l.elem("content"),children:[(0,ni.jsxs)("header",{children:["Drag & drop files here",(0,ni.jsx)("br",{}),"or click to browse"]}),(0,ni.jsx)(ti,{height:"64",className:$l.elem("icon")}),(0,ni.jsxs)("dl",{children:[(0,ni.jsx)("dt",{children:"Text"}),(0,ni.jsx)("dd",{children:"txt"}),(0,ni.jsx)("dt",{children:"Audio"}),(0,ni.jsx)("dd",{children:"wav, aiff, mp3, au, flac, m4a, ogg"}),(0,ni.jsx)("dt",{children:"Images"}),(0,ni.jsx)("dd",{children:"jpg, png, gif, bmp, svg, webp"}),(0,ni.jsx)("dt",{children:"HTML"}),(0,ni.jsx)("dd",{children:"html, htm, xml"}),(0,ni.jsx)("dt",{children:"Time Series"}),(0,ni.jsx)("dd",{children:"csv, tsv"}),(0,ni.jsx)("dt",{children:"Common Formats"}),(0,ni.jsx)("dd",{children:"csv, tsv, txt, json"})]})]})}),x&&(0,ni.jsx)("table",{children:(0,ni.jsxs)("tbody",{children:[y.uploading.map((e=>(0,ni.jsxs)("tr",{children:[(0,ni.jsx)("td",{children:e.name}),(0,ni.jsx)("td",{children:(0,ni.jsx)("span",{className:Wl.elem("file-status").mod({uploading:!0})})})]},e.name))),y.uploaded.map((e=>(0,ni.jsxs)("tr",{children:[(0,ni.jsx)("td",{children:e.file}),(0,ni.jsx)("td",{children:(0,ni.jsx)("span",{className:Wl.elem("file-status")})}),(0,ni.jsx)("td",{children:e.size})]},e.file)))]})})]})}),(0,ni.jsx)(Gl,{})]})},Ql=e=>{const[t,n]=w.useState(!1),[r,i]=w.useState([]),[o,a]=w.useState([]),[s,l]=w.useState(),u="choose"===s,c=Vi();return{columns:["choose","ts"].includes(s)?["$undefined$"]:o,uploading:t,uploadDisabled:u,finishUpload:async()=>{n(!0);const t=await c.callApi("reimportFiles",{params:{pk:e.id},body:{file_upload_ids:r,files_as_tasks_list:"tasks"===s}});return n(!1),t},fileIds:r,pageProps:{onWaiting:n,highlightCsvHandling:u,addColumns:e=>a((t=>ui(t.concat(e)))),csvHandling:s,setCsvHandling:l,onFileListUpdate:i,dontCommitToProject:!0}}},Jl=({name:e,setName:t,onSaveName:n,onSubmit:r,error:i,description:o,setDescription:a,show:s=!0})=>s?(0,ni.jsxs)("form",{className:oi("project-name"),onSubmit:e=>{e.preventDefault(),r()},children:[(0,ni.jsxs)("div",{className:"field field--wide",children:[(0,ni.jsx)("label",{htmlFor:"project_name",children:"Project Name"}),(0,ni.jsx)("input",{name:"name",id:"project_name",value:e,onChange:e=>t(e.target.value),onBlur:n}),i&&(0,ni.jsx)("span",{className:"error",children:i})]}),(0,ni.jsxs)("div",{className:"field field--wide",children:[(0,ni.jsx)("label",{htmlFor:"project_description",children:"Description"}),(0,ni.jsx)("textarea",{name:"description",id:"project_description",placeholder:"Optional description of your project",rows:"4",value:o,onChange:e=>a(e.target.value)})]})]}):null,Zl=({onClose:e})=>{const[t,n]=w.useState("name"),[r,i]=w.useState(!1),o=(()=>{const e=Vi(),[t,n]=w.useState(),r=w.useCallback((async()=>{const t=await e.callApi("projects");let r=(null!=t?t:[]).length+1,i=`New Project #${r}`;for(;t.find((({title:e})=>e===i));)r++,i=`New Project #${r}`;const o=await e.callApi("createProject",{body:{title:i}});o&&n(o)}),[]);return w.useEffect((()=>{r()}),[]),t})(),a=se(),s=Vi(),[l,u]=w.useState(""),[c,d]=w.useState(),[f,p]=w.useState(""),[h,m]=w.useState("<View></View>");w.useEffect((()=>{d(null)}),[l]);const{columns:v,uploading:g,uploadDisabled:y,finishUpload:b,pageProps:x}=Ql(o),k=oi("create-project"),S=k.elem("tab"),C={name:(0,ni.jsx)("span",{className:S.mod({disabled:!!c}),children:"Project Name"}),import:(0,ni.jsx)("span",{className:S.mod({disabled:y}),children:"Data Import"}),config:"Labeling Setup"};w.useEffect((()=>o&&!l&&u(o.title)),[o]);const _=w.useMemo((()=>({title:l,description:f,label_config:h})),[l,f,h]),E=w.useCallback((async()=>{if(!await b())return;i(!0);const e=await s.callApi("updateProject",{params:{pk:o.id},body:_});i(!1),null!==e&&a.push(`/projects/${e.id}/data`)}),[o,_,b]),T=w.useCallback((async()=>{i(!0),o&&await s.callApi("deleteProject",{params:{pk:o.id}}),i(!1),a.replace("/projects"),null==e||e()}),[o]);return(0,ni.jsx)(Di,{onHide:T,fullscreen:!0,visible:!0,bare:!0,closeOnClickOutside:!1,children:(0,ni.jsxs)("div",{className:k,children:[(0,ni.jsxs)(Di.Header,{children:[(0,ni.jsx)("h1",{children:"Create Project"}),(0,ni.jsx)(ks,{items:C,active:t,onSelect:n}),(0,ni.jsxs)(ki,{children:[(0,ni.jsx)(wi,{look:"danger",size:"compact",onClick:T,waiting:r,children:"Delete"}),(0,ni.jsx)(wi,{look:"primary",size:"compact",onClick:E,waiting:r||g,disabled:!o||y||c,children:"Save"})]})]}),(0,ni.jsx)(Jl,{name:l,setName:u,error:c,onSaveName:async()=>{var e;if(c)return;const t=await s.callApi("updateProjectRaw",{params:{pk:o.id},body:{title:l}});if(t.ok)return;const n=await t.json();d(null===(e=n.validation_errors)||void 0===e?void 0:e.title)},onSubmit:E,description:f,setDescription:p,show:"name"===t}),(0,ni.jsx)(Kl,{project:o,show:"import"===t,...x}),(0,ni.jsx)(Bl,{project:o,onUpdate:m,show:"config"===t,columns:v,disableSaveButton:!0})]})})};var eu=function(e){var t=e.initValue,n=e.useHookBody,r=e.applyStateChange,i=(0,w.useRef)(t);if("function"!=typeof n)throw new Error("function expected as hook body parameter. got "+typeof n);var o=n();return(0,w.useLayoutEffect)((function(){i.current!==o&&(i.current=o,r(o))}),[r,o]),null},tu=function(e){console&&console.warn&&console.warn(e)};function nu(){return(nu=Object.assign||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}).apply(this,arguments)}var ru=!1,iu=!1,ou=!1,au=[],su=function(e){au.push(e)},lu=su,uu=function(){iu=!0,(0,w.useEffect)((function(){return ru&&tu("SingletonHooksContainer is mounted second time. You should mount SingletonHooksContainer before any other component and never unmount it.Alternatively, dont use SingletonHooksContainer it at all, we will handle that for you."),ru=!0,function(){return tu("SingletonHooksContainer is removed from DOM. its not supported, singleton hooks will stop updating.")}}),[]);var e=(0,w.useState)([]),t=e[0],n=e[1];return(0,w.useEffect)((function(){lu=function(e){return n((function(t){return[].concat(t,[e])}))},n(au)}),[]),w.createElement(w.Fragment,null,t.map((function(e,t){return w.createElement(eu,nu({},e,{key:t}))})))},cu=function(e){var t;iu||ou||(ou=!0,t=uu,window&&window.document?(0,x.render)(w.createElement(t,null),window.document.createElement("div")):tu("Can not mount SingletonHooksContainer on server side. Did you manage to run useEffect on server? Please mount SingletonHooksContainer into your components tree manually.")),lu(e)},du=function(e,t){var n=!1,r=!1,i=void 0,o=[],a=function(e){var t;i=e,t=function(){return o.forEach((function(t){return t(e)}))},(0,x.unstable_batchedUpdates)(t)},s=function(){return r||(i="function"==typeof e?e():e,r=!0),i};return function(){var r=(0,w.useState)(s),l=r[0],u=r[1];return(0,w.useEffect)((function(){return n||(n=!0,cu({initValue:e,useHookBody:t,applyStateChange:a})),o.push(u),i!==l&&u(i),function(){o.splice(o.indexOf(u),1)}}),[]),l}};const fu=[],pu=()=>{0};let hu=pu,mu=pu,vu=pu,gu=pu,yu=pu,bu=[];const wu=du(fu,(()=>{const[e,t]=(0,w.useState)(fu);return bu=e,hu=e=>{const n=[...null!=e?e:[]];t(n),bu=n},mu=(0,w.useCallback)((e=>{if(!ci(null==e?void 0:e.key))throw Error("Crumb must have a key");const t=[...bu,e];hu(t),bu=t}),[e]),vu=(0,w.useCallback)((e=>{const t=bu.filter((t=>t.key!==e));hu(t),bu=t}),[e]),gu=(0,w.useCallback)(((e,t)=>{const n=bu.map((n=>n.key===e?{...n,onClick:t}:n));hu(n),bu=n}),[e]),yu=(0,w.useCallback)((e=>{const t=bu.map((t=>(t.key===e&&delete t.onClick,t)));hu(t),bu=t}),[e]),e})),xu=()=>{const e=se(),t=Sc(),n=(0,w.useRef)(),r=(()=>{const e=se(),{pathname:t}=Sc();return(0,w.useCallback)((n=>(e.replace("/"),setTimeout((()=>{e.replace(null!=n?n:t)}),10),t)),[t])})(),{project:i}=jc(),[o,a]=(0,w.useState)(!1),s=Vi(),{uploading:l,uploadDisabled:u,finishUpload:c,fileIds:d,pageProps:f}=Ql(i),p=(0,w.useCallback)((()=>{const e=t.pathname.replace(ku.path,""),n=t.search;return r(`${e}${"?"!==n?n:""}`)}),[t,e]),h=(0,w.useCallback)((async()=>{var e;a(!0),await s.callApi("deleteFileUploads",{params:{pk:i.id},body:{file_upload_ids:d}}),a(!1),null==n||null===(e=n.current)||void 0===e||e.hide(),p()}),[n,i,d,p]),m=(0,w.useCallback)((async()=>{await c()&&p()}),[p,c]);return(0,ni.jsxs)(Di,{title:"Import data",ref:n,onHide:()=>p(),closeOnClickOutside:!1,fullscreen:!0,visible:!0,bare:!0,children:[(0,ni.jsxs)(Di.Header,{divided:!0,children:[(0,ni.jsx)(li,{block:"modal",name:"title",children:"Import Data"}),(0,ni.jsxs)(ki,{children:[(0,ni.jsx)(wi,{waiting:o,onClick:h,children:"Cancel"}),(0,ni.jsx)(wi,{look:"primary",onClick:m,waiting:o||l,disabled:u,children:"Import"})]})]}),(0,ni.jsx)(Kl,{project:i,...f})]})},ku=()=>(0,ni.jsx)(Tc,{children:(0,ni.jsx)(xu,{})});ku.path="/import",ku.modal=!0;const{Block:Su,Elem:Cu}=ai(),_u=()=>{const e=se(),t=Sc(),n=xc(),r=Vi(),[i,o]=(0,w.useState)([]),[a,s]=(0,w.useState)(!1),[l,u]=(0,w.useState)(!1),[c,d]=(0,w.useState)([]),[f,p]=(0,w.useState)("JSON"),h=(0,w.useRef)();return(0,w.useEffect)((()=>{ci(n.id)&&(r.callApi("previousExports",{params:{pk:n.id}}).then((({export_files:e})=>{o(e.slice(0,1))})),r.callApi("exportFormats",{params:{pk:n.id}}).then((e=>{var t;d(e),p(null===(t=e[0])||void 0===t?void 0:t.name)})))}),[n]),(0,ni.jsx)(Di,{onHide:()=>{const n=t.pathname.replace(_u.path,""),r=t.search;e.replace(`${n}${"?"!==r?r:""}`)},title:"Export data",style:{width:720},closeOnClickOutside:!1,allowClose:!a,visible:!0,children:(0,ni.jsxs)(Su,{name:"export-page",children:[(0,ni.jsx)(Eu,{availableFormats:c,selected:f,onClick:e=>p(e.name)}),(0,ni.jsx)(Ks,{ref:h,children:(0,ni.jsx)(Vs,{type:"hidden",name:"exportType",value:f})}),(0,ni.jsx)(Cu,{name:"footer",children:(0,ni.jsxs)(ki,{style:{width:"100%"},spread:!0,children:[(0,ni.jsx)(Cu,{name:"recent"}),(0,ni.jsx)(Cu,{name:"actions",children:(0,ni.jsxs)(ki,{children:[l&&"Files are being prepared. It might take some time.",(0,ni.jsx)(Cu,{tag:wi,name:"finish",look:"primary",onClick:async()=>{s(!0);const e=setTimeout((()=>{u(!0)}),1e3),t=h.current.assembleFormData({asJSON:!0,full:!0,booleansAsNumbers:!0}),i=await r.callApi("exportRaw",{params:{pk:n.id,...t}});if(i.ok){((e,t)=>{const n=document.createElement("a");n.href=URL.createObjectURL(e),n.download=t,n.click()})(await i.blob(),i.headers.get("filename"))}else r.handleError(i);s(!1),u(!1),clearTimeout(e)},waiting:a,children:"Export"})]})})]})})]})})},Eu=({availableFormats:e,selected:t,onClick:n})=>(0,ni.jsxs)(Su,{name:"formats",children:[(0,ni.jsx)(Cu,{name:"info",children:"You can export dataset in one of the following formats:"}),(0,ni.jsx)(Cu,{name:"list",children:e.map((e=>{var r,i;return(0,ni.jsxs)(Cu,{name:"item",mod:{active:!e.disabled,selected:e.name===t},onClick:e.disabled?null:()=>n(e),children:[(0,ni.jsxs)(Cu,{name:"name",children:[e.title,(0,ni.jsx)(ki,{size:"small",children:null===(r=e.tags)||void 0===r||null===(i=r.map)||void 0===i?void 0:i.call(r,((e,t)=>(0,ni.jsx)(Cu,{name:"tag",children:e},t)))})]}),e.description&&(0,ni.jsx)(Cu,{name:"description",children:e.description})]},e.name)}))}),(0,ni.jsxs)(Cu,{name:"feedback",children:["Can't find an export format?",(0,ni.jsx)("br",{}),"Please let us know in ",(0,ni.jsx)("a",{className:"no-go",href:"http://slack.labelstud.io.s3-website-us-east-1.amazonaws.com?source=product-export",children:"Slack"})," or submit an issue to the ",(0,ni.jsx)("a",{className:"no-go",href:"https://github.com/heartexlabs/label-studio-converter/issues",children:"Repository"})]})]});_u.path="/export",_u.modal=!0;const Tu={gateway:"/api/dm",endpoints:{project:"/project",columns:"/columns",tabs:"/views",createTab:"POST:/views",updateTab:"PATCH:/views/:tabID",deleteTab:"DELETE:/views/:tabID",annotations:"/views/:tabID/annotations",task:"/tasks/:taskID",tasks:"/views/:tabID/tasks",nextTask:"/tasks/next",annotation:"/../annotations/:id",skipTask:{method:"post",path:e=>{const t="/../tasks/:taskID/annotations";return!ci(e.annotationID)?t:`${t}/:annotationID`}},submitAnnotation:"POST:/../tasks/:taskID/annotations",updateAnnotation:"PATCH:/../annotations/:annotationID",deleteAnnotation:"DELETE:/../annotations/:annotationID",setSelectedItems:"POST:/views/:tabID/selected-items",addSelectedItem:"PATCH:/views/:tabID/selected-items",actions:"/actions",deleteSelectedItem:"DELETE:/views/:tabID/selected-items",invokeAction:"POST:/actions"}},ju=(e,t)=>Y(`/projects/:id${e}`,t),Ou=({...e})=>{const t=(0,w.useRef)(),n=xc(),r=se(),i=Zi("lsf"),o=Zi("dm"),a=Cc(),[s,l]=(0,w.useState)(!1),u=(0,w.useRef)(),c=(0,w.useCallback)((async()=>{var s;if(!i)return;if(!o)return;if(!t.current)return;if(u.current)return;u.current=null!==(s=u.current)&&void 0!==s?s:await(async(e,t,n)=>{if(!window.LabelStudio)throw Error("Label Studio Frontend doesn't exist on the page");if(!e&&e.dataset.dmInitialized)return;e.dataset.dmInitialized=!0;const{...r}=e.dataset,i={root:e,projectId:n.id,apiGateway:`${window.APP_SETTINGS.hostname}/api/dm`,apiVersion:2,polling:!window.APP_SETTINGS,showPreviews:!1,apiEndpoints:Tu.endpoints,interfaces:{import:!1,export:!1,backButton:!1,labelingHeader:!1},...t,...r};return new window.DataManager(i)})(t.current,e,n);const{current:c}=u;c.on("crash",(()=>l())),c.on("settingsClicked",(()=>{r.push(ju("/settings/labeling",{id:n.id}))})),c.on("importClicked",(()=>{r.push(ju("/data/import",{id:n.id}))})),c.on("exportClicked",(()=>{r.push(ju("/data/export",{id:n.id}))})),a({dmRef:c})}),[i,o]),d=(0,w.useCallback)((()=>{u.current&&(u.current.destroy(),u.current=null)}),[u]);return(0,w.useEffect)((()=>(c(),()=>d())),[t,c]),s?(0,ni.jsxs)(si,{name:"crash",children:[(0,ni.jsx)(li,{name:"info",children:"Project was deleted or not yet created"}),(0,ni.jsx)(wi,{to:"/projects",children:"Back to projects"})]}):(0,ni.jsx)(si,{ref:t,name:"datamanager"})};Ou.path="/data",Ou.pages={ExportPage:_u,ImportModal:ku},Ou.context=({dmRef:e})=>{var t;const n=Sc(),{project:r}=jc(),[i,o]=(0,w.useState)(null!==(t=null==e?void 0:e.mode)&&void 0!==t?t:"explorer"),a=t=>{o(t),(t=>{const r="explorer"===t,i=n.pathname.replace(Ou.path,"");r?(yu(i),vu("dm-crumb")):(gu(i,(t=>{var n,r;t.preventDefault(),t.stopPropagation(),null==e||null===(n=e.store)||void 0===n||null===(r=n.closeLabeling)||void 0===r||r.call(n)})),mu({key:"dm-crumb",title:"Labeling"}))})(t),(e=>{const t="labelstream"===e,{expert_instruction:n,show_instruction:i}=r;t&&i&&n&&Ri({title:"Labeling Instructions",body:(0,ni.jsx)("div",{dangerouslySetInnerHTML:{__html:n}}),style:{width:680}})})(t)};return(0,w.useEffect)((()=>(e&&e.on("modeChanged",a),()=>{var t;null==e||null===(t=e.off)||void 0===t||t.call(e,"modeChanged",a)})),[e,r]),r&&r.id?(0,ni.jsxs)(ki,{size:"small",children:[r.expert_instruction&&"explorer"!==i&&(0,ni.jsx)(wi,{size:"compact",onClick:()=>{Ri({title:"Instructions",body:()=>(0,ni.jsx)("div",{dangerouslySetInnerHTML:{__html:r.expert_instruction}})})},children:"Instructions"}),Object.entries({"/settings":"Settings","/data/import":"Import","/data/export":"Export"}).map((([e,t])=>(0,ni.jsx)(wi,{tag:Oo,size:"compact",to:`/projects/${r.id}${e}`,"data-external":!0,children:t},e)))]}):null};const Nu=()=>{const{project:e}=jc(),t=Vi(),n=se(),[r,i]=(0,w.useState)(null),o=(0,w.useMemo)((()=>[{type:"annotations",disabled:!0,label:`Delete ${e.total_annotations_number} Annotations`},{type:"tasks",disabled:!0,label:`Delete ${e.task_number} Tasks`},{type:"predictions",disabled:!0,label:`Delete ${e.total_predictions_number} Predictions`},{type:"tabs",label:"Drop All Tabs"},{type:"project",label:"Delete Project"}]),[e]);return(0,ni.jsxs)("div",{style:{width:480},children:[(0,ni.jsx)(Hs,{text:"Delete Annotations, Tasks, or Project",description:"Perform these actions at your own risk. Actions you take on this page can't be reverted. Make sure your data is backed up.",style:{display:"block",width:415}}),e.id?(0,ni.jsx)(ki,{direction:"vertical",spread:!0,style:{marginTop:32},children:o.map((o=>{const a=r===o.type,s=o.disabled||r&&!a;return!0!==o.disabled&&(0,ni.jsx)(wi,{look:"danger",disabled:s,waiting:a,onClick:(l=o.type,()=>{Ii({title:"Action confirmation",body:"You're about to delete all things. This action cannot be undone.",okText:"Proceed",buttonLook:"destructive",onOk:async()=>{i(l),"annotations"===l||"tasks"===l||"predictions"===l||("tabs"===l?await t.callApi("deleteTabs",{body:{project:e.id}}):"project"===l&&(await t.callApi("deleteProject",{params:{pk:e.id}}),n.replace("/projects"))),i(null)}})}),children:o.label},o.type);var l}))}):(0,ni.jsx)("div",{style:{display:"flex",justifyContent:"center",marginTop:32},children:(0,ni.jsx)(xs,{size:32})})]})};Nu.title="Danger Zone",Nu.path="/danger-zone";const Mu=(0,w.createContext)(),{Block:Lu,Elem:Pu}=ai(),Au=({label:e,className:t,validate:n,required:r,skip:i,simple:o,labelProps:a,size:s,value:l,onChange:u,children:c,...d})=>{const[f,p]=(0,w.useState)(l),h=(0,ni.jsx)(zs,{name:d.name,label:e,validate:n,required:r,skip:i,setValue:e=>p(e),...d,children:(e,n,r)=>(0,ni.jsx)(Mu.Provider,{value:{value:f,onChange:e=>{(e=>{p(e),null==u||u(e)})(e),r.autosubmit()},setValue:p,isSimple:!0===o},children:(0,ni.jsxs)(Lu,{name:"radio-group",mod:{size:s,simple:o},mix:t,children:[(0,ni.jsx)("input",{ref:e,name:d.name,type:"hidden",defaultValue:f}),(0,ni.jsx)(Pu,{name:"buttons",children:c})]})})});return e?(0,ni.jsx)(Hs,{...null!=a?a:{},text:e,simple:o,required:r,children:h}):h};Au.Button=({value:e,disabled:t,children:n,label:r,description:i,...o})=>{const{onChange:a,setValue:s,value:l,isSimple:u}=(0,w.useContext)(Mu),c=e===l,d=(0,w.useCallback)((t=>{t.preventDefault(),t.stopPropagation(),a(e)}),[e]);return(0,w.useEffect)((()=>{o.checked&&s(e)}),[o.checked]),(0,ni.jsx)(Pu,{name:"button",mod:{checked:c,disabled:t},onClickCapture:d,children:u?(0,ni.jsx)(Hs,{placement:"right",text:r,description:i,children:(0,ni.jsx)("input",{type:"radio",value:e,checked:c,readOnly:!0,style:{pointerEvents:"none"}})}):n})};const Du=()=>{const{project:e,fetchProject:t}=(0,w.useContext)(_c),n=(0,w.useCallback)((()=>{e.id&&t(e.id,!0)}),[e]);return(0,ni.jsx)("div",{style:{width:480},children:(0,ni.jsxs)(Ks,{action:"updateProject",formData:{...e},params:{pk:e.id},onSubmit:n,children:[(0,ni.jsxs)(Ks.Row,{columnCount:1,rowGap:"32px",children:[(0,ni.jsx)(Vs,{name:"title",label:"Project Name",labelProps:{large:!0}}),(0,ni.jsx)(Gs,{name:"description",label:"Description",labelProps:{large:!0},style:{minHeight:128}}),(0,ni.jsx)(Au,{name:"color",label:"Color",size:"large",labelProps:{size:"large"},children:["#FFFFFF","#F52B4F","#FA8C16","#F6C549","#9ACA4F","#51AAFD","#7F64FF","#D55C9D"].map((e=>(0,ni.jsx)(Au.Button,{value:e,children:(0,ni.jsx)(si,{name:"color",style:{"--background":e}})},e)))}),(0,ni.jsx)(Au,{label:"Task Sampling",labelProps:{size:"large"},name:"sampling",simple:!0,children:[{value:"Sequential",label:"Sequential",description:"Tasks are ordered by Data manager ordering"},{value:"Uniform",label:"Random",description:"Tasks are chosen with uniform random"}].map((({value:e,label:t,description:n})=>(0,ni.jsx)(Au.Button,{value:`${e} sampling`,label:`${t} sampling`,description:n},e)))})]}),(0,ni.jsxs)(Ks.Actions,{children:[(0,ni.jsx)(Ks.Indicator,{children:(0,ni.jsx)("span",{case:"success",children:"Saved!"})}),(0,ni.jsx)(wi,{type:"submit",look:"primary",style:{width:120},children:"Save"})]})]})})};Du.menuItem="General",Du.path="/",Du.exact=!0;const Ru=()=>{const{project:e,fetchProject:t}=(0,w.useContext)(_c),n=(0,w.useContext)(vs),r=(0,w.useRef)();(0,w.useEffect)((()=>{n.setProps({formRef:r})}),[r]);const i=(0,w.useCallback)((()=>{t(e.id,!0)}),[e]);return(0,ni.jsx)("div",{style:{width:480},children:(0,ni.jsxs)(Ks,{ref:r,action:"updateProject",formData:{...e},params:{pk:e.id},onSubmit:i,children:[(0,ni.jsxs)(Ks.Row,{columnCount:1,children:[(0,ni.jsx)(Hs,{text:"Labeling Instructions",large:!0}),(0,ni.jsx)("div",{style:{paddingLeft:16},children:(0,ni.jsx)(Ys,{label:"Show before labeling",name:"show_instruction"})}),(0,ni.jsx)("div",{style:{color:"rgba(0,0,0,0.4)",paddingLeft:16},children:"Write instructions to help users complete labeling tasks."})]}),(0,ni.jsx)(Ks.Row,{columnCount:1,children:(0,ni.jsx)(Gs,{name:"expert_instruction",style:{minHeight:128}})}),(0,ni.jsxs)(Ks.Actions,{children:[(0,ni.jsx)(Ks.Indicator,{children:(0,ni.jsx)("span",{case:"success",children:"Saved!"})}),(0,ni.jsx)(wi,{type:"submit",look:"primary",style:{width:120},children:"Save"})]})]})})};Ru.title="Instructions",Ru.path="/instruction";const Iu=()=>{const e=se(),{project:t,fetchProject:n}=jc(),[r,i]=(0,w.useState)(""),[o,a]=(0,w.useState)(!1),s=Vi(),l=(0,w.useCallback)((async()=>{const i=await s.callApi("updateProjectRaw",{params:{pk:t.id},body:{label_config:r}});if(i.ok)return e.push(`/projects/${t.id}/data`),!0;const o=await i.json();return n(),o}),[t,r]),u=(0,w.useMemo)((()=>{if(t.label_config){const e=!di(t.label_config),n="<View></View>"===t.label_config.replace(/\s/g,""),r=t.task_number>0;return console.log({hasConfig:e,configIsEmpty:n,hasTasks:r,project:t}),e&&!n&&r}return!1}),[t]),c=(0,w.useCallback)((async()=>{o&&u?Ii({title:"Config data changed",body:"Labeling config has essential changes that affect data displaying. Saving the config may lead to deleting all tabs previously created in the Data Manager.",buttonLook:"destructive",onOk:()=>l(),okText:"Save"}):l()}),[o,l]),d=(0,w.useCallback)((e=>{i(e),n()})),f=(0,w.useCallback)((e=>{a(e.config_essential_data_has_changed)}),[]);return t.id?(0,ni.jsx)(Bl,{config:t.label_config,project:t,onUpdate:d,onSaveClick:c,onValidate:f}):null};Iu.title="Labeling Interface",Iu.path="/labeling";const Fu=({height:e})=>(0,ni.jsx)("div",{style:{height:e}}),zu=({children:e,includeValidation:t,className:n,style:r})=>{const i=w.useContext(Ui);return w.useEffect((()=>{i.showModal=!1}),[i]),i.error?(0,ni.jsxs)(si,{name:"inline-error",mix:n,style:r,children:[(0,ni.jsx)(Si,{possum:!1,...i.errorFormatter(i.error,{includeValidation:t})}),e]}):null};var Hu=n(2963),Uu=n.n(Hu);const Bu=({style:e,className:t,children:n})=>(0,ni.jsx)("dl",{className:oi("dl").mix(t),style:e,children:n});Bu.Item=({retmClassName:e,descriptionClassName:t,term:n,descriptionStyle:r,termStyle:i,children:o})=>(0,ni.jsxs)(ni.Fragment,{children:[(0,ni.jsx)("dt",{className:oi("dl").elem("dt").mix(e),style:r,children:n}),(0,ni.jsx)("dd",{className:oi("dl").elem("dd").mix(t),style:i,children:o})]});const Wu=({backends:e,fetchBackends:t,onEdit:n})=>{const r=oi("ml"),i=(0,w.useContext)(Ui),o=(0,w.useCallback)((async e=>{await i.callApi("deleteMLBackend",{params:{pk:e.id}}),await t()}),[t,i]),a=(0,w.useCallback)((async e=>{await i.callApi("trainMLBackend",{params:{pk:e.id}}),await t()}),[t,i]);return(0,ni.jsx)("div",{className:r,children:e.map((e=>(0,ni.jsx)($u,{backend:e,onStartTrain:a,onDelete:o,onEdit:n},e.id)))})},$u=({backend:e,onStartTrain:t,onEdit:n,onDelete:r})=>{const i=(0,w.useCallback)((e=>{Ii({title:"Delete ML Backend",body:"This action cannot be undone. Are you sure?",buttonLook:"destructive",onOk(){null==r||r(e)}})}),[e,r]);return(0,ni.jsxs)(Bo,{style:{marginTop:0},header:e.title,extra:(0,ni.jsxs)("div",{className:oi("ml").elem("info"),children:[(0,ni.jsx)(Vu,{backend:e}),(0,ni.jsx)(Ao.Trigger,{align:"right",content:(0,ni.jsxs)(Fo,{size:"small",children:[(0,ni.jsx)(Fo.Item,{onClick:()=>n(e),children:"Edit"}),(0,ni.jsx)(Fo.Item,{onClick:()=>i(e),children:"Delete"})]}),children:(0,ni.jsx)(wi,{type:"link",icon:(0,ni.jsx)(Ms,{})})})]}),children:[(0,ni.jsxs)(Bu,{className:oi("ml").elem("summary"),children:[(0,ni.jsx)(Bu.Item,{term:"URL",termStyle:{whiteSpace:"nowrap"},children:Uu()(e.url,20,10,"...")}),e.description&&(0,ni.jsx)(Bu.Item,{term:"Description",children:e.description}),(0,ni.jsx)(Bu.Item,{term:"Version",children:e.version?ds(new Date(e.version),"MMMM dd, yyyy ∙ HH:mm:ss"):"unknown"})]}),(0,ni.jsx)(wi,{disabled:"CO"!==e.state,onClick:()=>t(e),children:"Start Training"})]})},Vu=({backend:e})=>{const{state:t}=e;return(0,ni.jsxs)("div",{className:oi("ml").elem("status"),children:[(0,ni.jsx)("span",{className:oi("ml").elem("indicator").mod({state:t})}),(0,ni.jsxs)(As,{value:t,className:oi("ml").elem("status-label"),children:[(0,ni.jsx)("span",{case:"DI",children:"Disconnected"}),(0,ni.jsx)("span",{case:"CO",children:"Connected"}),(0,ni.jsx)("span",{case:"ER",children:"Error"}),(0,ni.jsx)("span",{case:"TR",children:"Training"}),(0,ni.jsx)("span",{case:"PR",children:"Predicting"})]})]})},qu=()=>{const e=Vi(),{project:t,fetchProject:n,updateProject:r}=(0,w.useContext)(_c),[i,o]=(0,w.useState)(),[a,s]=(0,w.useState)([]),[l,u]=(0,w.useState)([]),c=(0,w.useCallback)((async e=>{e.preventDefault(),e.stopPropagation(),await r({model_version:null})}),[e,t]),d=(0,w.useCallback)((async()=>{const n=await e.callApi("mlBackends",{params:{project:t.id}});n&&s(n)}),[e,t,s]),f=(0,w.useCallback)((async()=>{const n=await e.callApi("modelVersions",{params:{pk:t.id}});u(n)}),[e,t.id]),p=(0,w.useCallback)((e=>{const n=e?"updateMLBackend":"addMLBackend",r={title:(e?"Edit":"Add")+" model",style:{width:760},closeOnClickOutside:!1,body:(0,ni.jsxs)(Ks,{action:n,formData:{...null!=e?e:{}},params:{pk:null==e?void 0:e.id},onSubmit:async e=>{e.error_message||(await d(),i.close())},children:[(0,ni.jsx)(Vs,{type:"hidden",name:"project",value:t.id}),(0,ni.jsxs)(Ks.Row,{columnCount:2,children:[(0,ni.jsx)(Vs,{name:"title",label:"Title",placeholder:"ML Model"}),(0,ni.jsx)(Vs,{name:"url",label:"URL",required:!0})]}),(0,ni.jsx)(Ks.Row,{columnCount:1,children:(0,ni.jsx)(Gs,{name:"description",label:"Description",style:{minHeight:120}})}),(0,ni.jsx)(Ks.Actions,{children:(0,ni.jsx)(wi,{type:"submit",look:"primary",onClick:()=>o(null),children:"Validate and Save"})}),(0,ni.jsx)(Ks.ResponseParser,{children:t=>(0,ni.jsx)(ni.Fragment,{children:t.error_message&&(0,ni.jsx)(Si,{error:{response:{detail:`Failed to ${e?"save":"add new"} ML backend.`,exc_info:t.error_message}}})})}),(0,ni.jsx)(zu,{})]})},i=Ri(r)}),[t,d,i]);return(0,w.useEffect)((()=>{t.id&&(d(),f())}),[t]),(0,ni.jsxs)(ni.Fragment,{children:[(0,ni.jsxs)(Ss,{style:{marginTop:0,maxWidth:680},children:["Add one or more machine learning models to predict labels for your data. To import predictions without connecting a model,"," ",(0,ni.jsx)("a",{href:"https://labelstud.io/guide/predictions.html",target:"_blank",children:"see the documentation"}),"."]}),(0,ni.jsx)(wi,{onClick:()=>p(),children:"Add Model"}),(0,ni.jsx)(Fu,{height:32}),(0,ni.jsxs)(Ks,{action:"updateProject",formData:{...t},params:{pk:t.id},onSubmit:()=>n(),autosubmit:!0,children:[(0,ni.jsxs)(Ks.Row,{columnCount:1,children:[(0,ni.jsx)(Hs,{text:"ML-Assisted Labeling",large:!0}),(0,ni.jsx)("div",{style:{paddingLeft:16},children:(0,ni.jsx)(Ys,{label:"Start model training after any annotations are submitted or updated",name:"start_training_on_annotation_update"})}),(0,ni.jsx)("div",{style:{paddingLeft:16},children:(0,ni.jsx)(Ys,{label:"Retrieve predictions when loading a task automatically",name:"evaluate_predictions_automatically"})}),(0,ni.jsx)("div",{style:{paddingLeft:16},children:(0,ni.jsx)(Ys,{label:"Show predictions to annotators in the Label Stream and Quick View",name:"show_collab_predictions"})})]}),l.length>1&&(0,ni.jsxs)(Ks.Row,{columnCount:1,children:[(0,ni.jsx)(Hs,{text:"Model Version",description:"Model version allows you to specify which prediction will be shown to the annotators.",style:{marginTop:16},large:!0}),(0,ni.jsxs)("div",{style:{display:"flex",alignItems:"center",width:400,paddingLeft:16},children:[(0,ni.jsx)("div",{style:{flex:1,paddingRight:16},children:(0,ni.jsx)(qs,{name:"model_version",defaultValue:null,options:[...l],placeholder:"No model version selected"})}),(0,ni.jsx)(wi,{onClick:c,children:"Reset"})]})]})]}),(0,ni.jsx)(Wu,{onEdit:e=>p(e),fetchBackends:d,backends:a})]})};qu.title="Machine Learning",qu.path="/ml";const Gu=({storage:e,className:t,enableLastSync:n=!1,storageTypes:r=[]})=>{var i,o;return(0,ni.jsx)("div",{className:t,children:(0,ni.jsxs)(Bu,{children:[(0,ni.jsx)(Bu.Item,{term:"Type",children:null!==(i=null===(o=r.find((t=>t.name===e.type)))||void 0===o?void 0:o.title)&&void 0!==i?i:e.type}),(0,ni.jsxs)(As,{value:e.type,children:[(0,ni.jsx)(Yu,{case:"s3",storage:e}),(0,ni.jsx)(Xu,{case:"gcs",storage:e}),(0,ni.jsx)(Ku,{case:"azure",storage:e}),(0,ni.jsx)(Qu,{case:"redis",storage:e}),(0,ni.jsx)(Ju,{case:"localfiles",storage:e})]}),n&&(0,ni.jsx)(Bu.Item,{term:"Last Sync",children:e.last_sync?ds(new Date(e.last_sync),"MMMM dd, yyyy ∙ HH:mm:ss"):"Never synced"})]})})},Yu=({storage:e})=>(0,ni.jsx)(Bu.Item,{term:"Bucket",children:e.bucket}),Xu=({storage:e})=>(0,ni.jsx)(Bu.Item,{term:"Bucket",children:e.bucket}),Ku=({storage:e})=>(0,ni.jsx)(Bu.Item,{term:"Container",children:e.container}),Qu=({storage:e})=>(0,ni.jsxs)(ni.Fragment,{children:[(0,ni.jsx)(Bu.Item,{term:"Path",children:e.path}),(0,ni.jsxs)(Bu.Item,{term:"Host",children:[e.host,e.port?`:${e.post}`:""]})]}),Ju=({storage:e})=>(0,ni.jsx)(Bu.Item,{term:"Path",children:e.path}),Zu=({rootClass:e,target:t,storage:n,onEditStorage:r,onDeleteStorage:i,storageTypes:o})=>{var a;const[s,l]=(0,w.useState)(!1),u=(0,w.useContext)(Ui),[c,d]=(0,w.useState)({...n}),[f,p]=(0,w.useState)(null),h=(0,w.useCallback)((async()=>{l(!0),p(null);const e=await u.callApi("syncStorage",{params:{target:t,type:c.type,pk:c.id}});e&&(d(e),p(e.last_sync_count)),l(!1)}),[n]);return(0,w.useEffect)((()=>{d(n)}),[n]),(0,ni.jsxs)(Bo,{header:null!==(a=c.title)&&void 0!==a?a:`Untitled ${c.type}`,extra:(0,ni.jsx)(Ao.Trigger,{align:"right",content:(0,ni.jsxs)(Fo,{size:"compact",style:{width:110},children:[(0,ni.jsx)(Fo.Item,{onClick:()=>r(c),children:"Edit"}),(0,ni.jsx)(Fo.Item,{onClick:()=>i(c),children:"Delete"})]}),children:(0,ni.jsx)(wi,{type:"link",style:{width:32,height:32,marginRight:-10},icon:(0,ni.jsx)(Ms,{})})}),children:[(0,ni.jsx)(Gu,{storage:c,enableLastSync:"export"!==t,className:e.elem("summary"),storageTypes:o}),"export"!==t&&(0,ni.jsx)("div",{className:e.elem("sync"),children:(0,ni.jsxs)(ki,{size:"small",children:[(0,ni.jsx)(wi,{waiting:s,onClick:h,children:"Sync Storage"}),null!==f?(0,ni.jsxs)("div",{className:e.elem("sync-count"),children:["Synced ",f," task(s)"]}):null]})})]})},ec=(0,w.forwardRef)((({onSubmit:e,target:t,project:n,rootClass:r,storage:i,storageTypes:o},a)=>{var s,l,u,c;const d=(0,w.useContext)(Ui),f=null!=a?a:(0,w.useRef)(),[p,h]=(0,w.useState)(null!==(s=null!==(l=null==i?void 0:i.type)&&void 0!==l?l:null==o||null===(u=o[0])||void 0===u?void 0:u.name)&&void 0!==s?s:"s3"),[m,v]=(0,w.useState)(!1),[g,y]=(0,w.useState)(null),[b,x]=(0,w.useState)([]);(0,w.useEffect)((()=>{d.callApi("storageForms",{params:{target:t,type:p}}).then((e=>x(null!=e?e:[])))}),[p]);const k={columnCount:1,fields:[{skip:!0,type:"select",name:"storage_type",label:"Storage Type",disabled:!!i,options:o.map((({name:e,title:t})=>({value:e,label:t}))),value:null!==(c=null==i?void 0:i.type)&&void 0!==c?c:p,onChange:e=>{h(e.target.value)}}]},S=(0,w.useCallback)((async()=>{v(!0),y(null);const e=f.current;if(e&&e.validateFields()){const n=e.assembleFormData({asJSON:!0}),r=e.getField("storage_type").value,i=await e.api.callApi("validateStorage",{params:{target:t,type:r},body:n});y(null!==i)}v(!1)}),[f,t,p]),C=(0,w.useMemo)((()=>i?"updateStorage":"createStorage"),[i]);return(0,ni.jsxs)(Ks.Builder,{ref:f,action:C,params:{target:t,type:p,project:n,pk:null==i?void 0:i.id},fields:[k,...null!=b?b:[]],formData:{...null!=i?i:{}},skipEmpty:!0,onSubmit:e,autoFill:"off",autoComplete:"off",children:[(0,ni.jsx)(Vs,{type:"hidden",name:"project",value:n}),(0,ni.jsxs)(Ks.Actions,{valid:g,extra:null!==g&&(0,ni.jsx)(si,{name:"form-indicator",children:(0,ni.jsxs)(As,{value:g,children:[(0,ni.jsx)(li,{tag:"span",mod:{type:"success"},name:"item",case:!0,children:"Successfully connected!"}),(0,ni.jsx)(li,{tag:"span",mod:{type:"fail"},name:"item",case:!1,children:"Connection failed"})]})}),children:[(0,ni.jsx)(Vs,{type:"hidden",name:"project",value:n}),(0,ni.jsxs)(wi.Group,{className:r.elem("buttons"),children:[(0,ni.jsx)(wi,{type:"button",waiting:m,onClick:S,children:"Check Connection"}),(0,ni.jsx)(wi,{type:"submit",look:"primary",children:i?"Save":"Add Storage"})]})]}),(0,ni.jsx)(zu,{})]})})),tc=({title:e,target:t,rootClass:n,buttonLabel:r})=>{const i=(0,w.useContext)(Ui),{project:o}=jc(),[a,s]=(0,w.useState)([]),[l,u]=(0,w.useState)(!1),[c,d]=(0,w.useState)(!1),[f,p]=(0,w.useState)([]);(0,w.useEffect)((()=>{i.callApi("storageTypes",{params:{target:t}}).then((e=>{p(e)}))}),[]);const h=(0,w.useCallback)((async()=>{if(!o.id)return void console.warn("Project ID not provided");u(!0);const e=await i.callApi("listStorages",{params:{project:o.id,target:t}}),n=await i.callApi("storageTypes",{params:{target:t}});p(n),null!==e&&(s(e),d(!0)),u(!1)}),[o]),m=(0,w.useCallback)((e=>{const r=Ri({title:`${e?"Edit":"Add"} ${"export"===t?"Target":"Source"} Storage`,closeOnClickOutside:!1,style:{width:760},body:(0,ni.jsx)(ec,{target:t,storage:e,project:o.id,rootClass:n,storageTypes:f,onSubmit:async()=>{await h(),r.close()}}),footer:(0,ni.jsxs)(ni.Fragment,{children:["Save completed annotations to Amazon S3, Google Cloud, Microsoft Azure, or Redis.",(0,ni.jsx)("br",{}),(0,ni.jsx)("a",{href:"https://labelstud.io/guide/storage.html",children:"See more in the documentation"}),"."]})})}),[o,h,t,n]),v=(0,w.useCallback)((async e=>{m(e)}),[m]),g=(0,w.useCallback)((async e=>{Ii({title:"Deleting storage",body:"This action cannot be undone. Are you sure?",buttonLook:"destructive",onOk:async()=>{null!==await i.callApi("deleteStorage",{params:{type:e.type,pk:e.id,target:t}})&&h()}})}),[h]);return(0,w.useEffect)((()=>{h()}),[h]),(0,ni.jsxs)(Wo.Column,{title:e,children:[(0,ni.jsx)("div",{className:n.elem("controls"),children:(0,ni.jsx)(wi,{onClick:()=>m(),children:r})}),l&&!c?(0,ni.jsx)("div",{className:n.elem("empty"),children:(0,ni.jsx)(xs,{size:32})}):0===a.length?null:a.map((e=>(0,ni.jsx)(Zu,{storage:e,target:t,rootClass:n,storageTypes:f,onEditStorage:v,onDeleteStorage:g},e.id)))]})},nc=()=>{const e=oi("storage-settings");return(0,ni.jsxs)(si,{name:"storage-settings",children:[(0,ni.jsx)(Ss,{style:{marginTop:0},children:"Use cloud or database storage as the source for your labeling tasks or the target of your completed annotations."}),(0,ni.jsxs)(Wo,{count:2,gap:"40px",size:"320px",className:e,children:[(0,ni.jsx)(tc,{title:"Source Cloud Storage",buttonLabel:"Add Source Storage",rootClass:e}),(0,ni.jsx)(tc,{title:"Target Cloud Storage",target:"export",buttonLabel:"Add Target Storage",rootClass:e})]})]})};nc.title="Cloud Storage",nc.path="/storage";const rc={title:"Settings",path:"/settings",exact:!0,layout:({children:e,...t})=>(0,ni.jsx)(ws,{menuItems:[Du,Iu,Ru,qu,nc,Nu],path:t.match.url,children:e}),component:Du,pages:{InstructionsSettings:Ru,LabelingSettings:Iu,MachineLearningSettings:qu,StorageSettings:nc,DangerZone:Nu}};var ic=n(5792),oc=n.n(ic);const ac=({projects:e})=>{const t=se();return(0,ni.jsx)(li,{name:"list",children:e.map((e=>(0,ni.jsx)(lc,{project:e,history:t},e.id)))})},sc=({openModal:e})=>(0,ni.jsxs)(si,{name:"empty-projects-page",children:[(0,ni.jsx)(li,{name:"heidi",tag:"img",src:pi("/static/images/opossum_looking.png")}),(0,ni.jsx)(li,{name:"header",tag:"h1",children:"Heidi doesn’t see any projects here"}),(0,ni.jsx)("p",{children:"Create one and start labeling your data"}),(0,ni.jsx)(li,{name:"action",tag:wi,onClick:e,look:"primary",children:"Create Project"})]}),lc=({project:e,history:t})=>{var n;const r=(0,w.useMemo)((()=>"#FFFFFF"===e.color?null:e.color),[e]),i=(0,w.useMemo)((()=>r?{"--header-color":r,"--background-color":oc()(r).alpha(.2).css()}:{}),[r]);return(0,ni.jsx)(li,{tag:Oo,name:"link",to:`/projects/${e.id}/data`,"data-external":!0,children:(0,ni.jsxs)(si,{name:"project-card",mod:{colored:!!r},style:i,children:[(0,ni.jsxs)(li,{name:"header",children:[(0,ni.jsxs)(li,{name:"title",children:[(0,ni.jsx)(li,{name:"title-text",children:null!==(n=e.title)&&void 0!==n?n:"New project"}),(0,ni.jsx)(li,{name:"menu",onClick:e=>{e.stopPropagation(),e.preventDefault()},children:(0,ni.jsx)(Ao.Trigger,{content:(0,ni.jsxs)(Fo,{children:[(0,ni.jsx)(Fo.Item,{href:`/projects/${e.id}/settings`,children:"Settings"}),(0,ni.jsx)(Fo.Item,{href:`/projects/${e.id}/data?labeling=1`,children:"Label"})]}),children:(0,ni.jsx)(wi,{size:"small",type:"text",icon:(0,ni.jsx)(Zn,{})})})})]}),(0,ni.jsx)(li,{name:"summary",children:(0,ni.jsxs)(li,{name:"annotation",children:[(0,ni.jsxs)(li,{name:"total",children:[e.num_tasks_with_annotations," / ",e.task_number]}),(0,ni.jsxs)(li,{name:"detail",children:[(0,ni.jsxs)(li,{name:"detail-item",mod:{type:"completed"},children:[(0,ni.jsx)(li,{tag:Un,name:"icon"}),e.total_annotations_number]}),(0,ni.jsxs)(li,{name:"detail-item",mod:{type:"rejected"},children:[(0,ni.jsx)(li,{tag:kr,name:"icon"}),e.skipped_annotations_number]}),(0,ni.jsxs)(li,{name:"detail-item",mod:{type:"predictions"},children:[(0,ni.jsx)(li,{tag:In,name:"icon"}),e.total_predictions_number]})]})]})})]}),(0,ni.jsx)(li,{name:"description",children:e.description}),(0,ni.jsxs)(li,{name:"info",children:[(0,ni.jsx)(li,{name:"created-date",children:ds(new Date(e.created_at),"dd MMM ’yy, HH:mm")}),(0,ni.jsx)(li,{name:"created-by",children:(0,ni.jsx)(pa,{src:"#",user:e.created_by,showUsername:!0})})]})]})})},uc=()=>{const e=w.useContext(Ui),[t,n]=w.useState([]),[r,i]=w.useState(null),o=Cc(),[a,s]=w.useState(!1),l=s.bind(null,!0),u=s.bind(null,!1);return w.useEffect((()=>{(async()=>{i("loading");const t=await e.callApi("projects");n(null!=t?t:[]),i("loaded")})()}),[]),w.useEffect((()=>{o({openModal:l,showButton:t.length>0})}),[t.length]),(0,ni.jsx)(si,{name:"projects-page",children:(0,ni.jsxs)(As,{value:r,children:[(0,ni.jsx)(li,{name:"loading",case:"loading",children:(0,ni.jsx)(xs,{size:64})}),(0,ni.jsxs)(li,{name:"content",case:"loaded",children:[t.length?(0,ni.jsx)(ac,{projects:t}):(0,ni.jsx)(sc,{openModal:l}),a&&(0,ni.jsx)(Zl,{onClose:u})]})]})})};uc.title="Projects",uc.path="/projects",uc.exact=!0,uc.routes=({store:e})=>[{title:()=>{var t;return null===(t=e.project)||void 0===t?void 0:t.title},path:"/:id(\\d+)",exact:!0,component:()=>{const e=function(){var e=ae(W).match;return e?e.params:{}}();return(0,ni.jsx)(X,{to:`/projects/${e.id}/data`})},pages:{DataManagerPage:Ou,SettingsPage:rc}}],uc.context=({openModal:e,showButton:t})=>t?(0,ni.jsx)(wi,{onClick:e,look:"primary",size:"compact",children:"Create"}):null;const cc=[hl,uc],dc=e=>{const t=[],n=[];try{w.Children.toArray(e).forEach((e=>{var r;null!=e&&null!==(r=e.props)&&void 0!==r&&r.modal?t.push(e):n.push(e)}))}catch(t){console.log(t),console.log({children:e})}return[t,n]},fc=({children:e,render:t,route:n,component:r,staticComponent:i,...o})=>{const a=w.useContext(vs),s=e=>{let t=[],n=[];e.props&&e.props.children?([t,n]=dc(e.props.children),e=w.cloneElement(e,{children:n})):Array.isArray(e)&&([t,n]=dc(e),e=n);const r=()=>(!1===(null==a?void 0:a.contextIsSet(null))&&(null==a||a.setContext(null)),null!=i?i:(0,ni.jsx)(ca,{id:"main-content"})),o=t.reduce(((e,t)=>(t.props.exact?e.exact.push(t):e.modal.push(t),e)),{exact:[],modal:[]});return(0,ni.jsxs)(ni.Fragment,{children:[o.modal,(0,ni.jsxs)(oe,{children:[o.exact,e,(0,ni.jsx)(kn,{exact:!0,children:(0,ni.jsx)(r,{})})]})]})},l={};return t?l.render=e=>s(t(e)):e instanceof Function?l.children=t=>s(e(t)):r?l.component=e=>s(r(e)):l.children=s(e),!1!==n?(0,ni.jsx)(kn,{...o,...l}):s(e)},pc=(e,t)=>e instanceof Function?e(t):e,hc=(e,t)=>{const n=([e,n])=>{var r;const i={path:n.path};return i.exact=!!n.exact,i.modal=!!n.modal,n.title&&(i.title=n.title),n.render&&(i.render=n.render),n instanceof w.Component||n instanceof Function?e&&/Layout/.test(e)?i.layout=n:i.component=n:(i.component=n.component,i.layout=n.layout),n.pages?i.routes=hc(pc(n.pages,t),t):n.routes&&(i.routes=hc(pc(n.routes,t),t)),null!==(r=i.component)&&void 0!==r&&r.context&&(i.context=i.component.context),i};try{return Array.isArray(e)?e.map((e=>n([null,e]))):Object.entries(e).map(n)}catch(e){return console.log(e),[]}},mc=(e,t)=>{const n=(e,r)=>e.map((e=>((e,r)=>{const{component:i,layout:o,path:a,modal:s,routes:l,...u}=e,c=r?`${r}${a}`:a;if(l){const e=n(l,c),t=t=>{const l=[];return i&&l.push(n([{path:a,modal:s,...u,component:i}],r)),l.push(...e),o?(0,ni.jsx)(o,{...t,children:l}):l};return(0,ni.jsx)(fc,{path:c,render:t},c)}{const e={key:c,path:c,modal:!!i.modal};return(0,ni.jsx)(kn,{...e,exact:!0,render:()=>(0,ni.jsx)(i,{...null!=t?t:{}}),...u})}})(e,r)));return n(e)},vc=(0,w.createContext)(),gc=(e,t,n="")=>{const r=[],i=t.find((t=>{const r=`${n}${t.path}`;return J(e,{path:r})}));if(i){const t=`${n}${i.path}`;r.push({...i,path:t}),i.routes&&r.push(...gc(e,i.routes,t))}return r},yc=({children:e})=>{const t=se(),n=Sc(),r=Ei(),{store:i}=Yi(),o=wu(),[a,s]=(0,w.useState)(null),[l,u]=(0,w.useState)(null),c=(0,w.useMemo)((()=>hc(cc,{config:r,store:i})),[n,r,i,t]),d=(0,w.useMemo)((()=>gc(n.pathname,c)),[n,c]),f=(0,w.useMemo)((()=>d.filter((e=>!e.modal)).slice(-1)[0]),[d]),[p,h]=(0,w.useState)(null==f?void 0:f.path),m=(0,w.useMemo)((()=>({routesMap:c,breadcrumbs:o,currentContext:a,setContextProps:u,path:p,findComponent:e=>gc(e,c)})),[o,c,a,p,s]);return(0,w.useEffect)((()=>{const e=null==f?void 0:f.context;s({component:null!=e?e:null,props:l}),h(null==f?void 0:f.path);try{const e=d.map((e=>{var t,r,i;const o=J(n.pathname,{path:e.path}),a=Y(e.path,o.params);return{path:a,title:e.title instanceof Function?e.title():e.title,key:null!==(t=null!==(r=null===(i=e.component)||void 0===i?void 0:i.displayName)&&void 0!==r?r:e.key)&&void 0!==t?t:a}})).filter((e=>!!e.title));hu(e)}catch(e){console.log(e)}}),[n,c,l,d,f]),(0,ni.jsx)(vc.Provider,{value:m,children:e})},bc=()=>{var e,t;return null!==(e=null===(t=(0,w.useContext)(vc))||void 0===t?void 0:t.findComponent)&&void 0!==e?e:()=>null},wc=()=>{var e,t;return null!==(e=null===(t=(0,w.useContext)(vc))||void 0===t?void 0:t.breadcrumbs)&&void 0!==e?e:[]},xc=()=>{const e=Sc(),t=null===(n=(0,w.useContext)(vc))||void 0===n?void 0:n.path;var n;const r=(0,w.useMemo)((()=>{var n;const r=e.search.replace(/^\?/,"").split("&").map((e=>{const[t,n]=e.split("=").map((e=>decodeURIComponent(e)));return[t,n]})),i=Object.fromEntries(r),o=J(e.pathname,null!=t?t:"");return{...i,...null!==(n=null==o?void 0:o.params)&&void 0!==n?n:{}}}),[e,t]);return null!=r?r:{}},kc=()=>{var e;const t=(0,w.useContext)(vc),{component:n,props:r}=null!==(e=null==t?void 0:t.currentContext)&&void 0!==e?e:{};return{ContextComponent:n,contextProps:r}},Sc=()=>{const e=le();return(0,w.useMemo)((()=>{var t;return null!==(t=e.location)&&void 0!==t?t:e}),[e])},Cc=()=>{const e=(0,w.useContext)(vc).setContextProps;return(0,w.useMemo)((()=>e),[e])},_c=(0,w.createContext)({});_c.displayName="ProjectContext";const Ec=new Map,Tc=({children:e})=>{var t;const n=Vi(),r=xc(),{update:i}=Yi(),[o,a]=(0,w.useState)(null!==(t=Ec.get(+r.id))&&void 0!==t?t:{}),s=(0,w.useCallback)((async(e,t=!1)=>{const s=+(null!=e?e:r.id);if(isNaN(s))return;!t&&Ec.has(s)&&a({...Ec.get(s)});const l=await n.callApi("project",{params:{pk:s},errorFilter:()=>!1});return!1===eo(o,l)&&(a(l),i({project:l}),Ec.set(l.id,l)),l}),[r]),l=(0,w.useCallback)((async e=>{const t=await n.callApi("updateProject",{params:{pk:o.id},body:e});return t.$meta&&(a(t),i({project:t})),t}),[o,a,i]);return(0,w.useEffect)((()=>{+r.id!==(null==o?void 0:o.id)&&a({}),s()}),[r]),(0,w.useEffect)((()=>()=>Ec.clear()),[]),(0,ni.jsx)(_c.Provider,{value:{project:o,fetchProject:s,updateProject:l,invalidateCache(){Ec.clear(),a({})}},children:e})},jc=()=>{var e;return null!==(e=(0,w.useContext)(_c))&&void 0!==e?e:{}},Oc=w.createContext();class Nc extends w.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,{componentStack:t}){this.setState({error:e,hasError:!0,errorInfo:t})}render(){if(this.state.hasError){var e,t;const{error:n,errorInfo:r}=this.state,i=()=>{history.back(),setTimeout((()=>location.reload()),32)};return(0,ni.jsx)(Di,{onHide:()=>location.reload(),style:{width:"60vw"},visible:!0,bare:!0,children:(0,ni.jsx)("div",{style:{padding:40},children:(0,ni.jsx)(Si,{title:"Runtime error",message:n,stacktrace:`${r?`Component Stack: ${r}`:""}\n\n${null!==(e=null===(t=this.state.error)||void 0===t?void 0:t.stack)&&void 0!==e?e:""}`,onGoBack:i,onReload:()=>location.reload()})})})}return(0,ni.jsx)(Oc.Provider,{value:{hasError:this.state.hasError,error:this.state.error,errorInfo:this.state.errorInfo,silence:this.silence,unsilence:this.unsilence},children:this.props.children})}}const Mc=({content:e})=>{const t=null!==(n=null===(r=(0,w.useContext)(vc))||void 0===r?void 0:r.routesMap)&&void 0!==n?n:[];var n,r;const i=mc(t,{content:e});return i?(0,ni.jsx)(fc,{path:"/",children:i}):null},Lc=({content:e})=>{const t="true"===localStorage.getItem("sidebar-pinned"),n=t&&"true"===localStorage.getItem("sidebar-opened");return(0,ni.jsx)(bs,{enabled:!0,defaultOpened:n,defaultPinned:t,onSidebarToggle:e=>localStorage.setItem("sidebar-opened",e),onSidebarPin:e=>localStorage.setItem("sidebar-pinned",e),children:(0,ni.jsx)(Mc,{content:e})})},Pc=function(e){void 0===e&&(e={}),m||l(!1);var t,n=window.history,i=(-1===(t=window.navigator.userAgent).indexOf("Android 2.")&&-1===t.indexOf("Android 4.0")||-1===t.indexOf("Mobile Safari")||-1!==t.indexOf("Chrome")||-1!==t.indexOf("Windows Phone"))&&window.history&&"pushState"in window.history,o=!(-1===window.navigator.userAgent.indexOf("Trident")),a=e,s=a.forceRefresh,w=void 0!==s&&s,x=a.getUserConfirmation,k=void 0===x?v:x,S=a.keyLength,C=void 0===S?6:S,_=e.basename?d(u(e.basename)):"";function E(e){var t=e||{},n=t.key,r=t.state,i=window.location,o=i.pathname+i.search+i.hash;return _&&(o=c(o,_)),p(o,r,n)}function T(){return Math.random().toString(36).substr(2,C)}var j=h();function O(e){r(U,e),U.length=n.length,j.notifyListeners(U.location,U.action)}function N(e){(function(e){return void 0===e.state&&-1===navigator.userAgent.indexOf("CriOS")})(e)||P(E(e.state))}function M(){P(E(b()))}var L=!1;function P(e){if(L)L=!1,O();else{j.confirmTransitionTo(e,"POP",k,(function(t){t?O({action:"POP",location:e}):function(e){var t=U.location,n=D.indexOf(t.key);-1===n&&(n=0);var r=D.indexOf(e.key);-1===r&&(r=0);var i=n-r;i&&(L=!0,I(i))}(e)}))}}var A=E(b()),D=[A.key];function R(e){return _+f(e)}function I(e){n.go(e)}var F=0;function z(e){1===(F+=e)&&1===e?(window.addEventListener(g,N),o&&window.addEventListener(y,M)):0===F&&(window.removeEventListener(g,N),o&&window.removeEventListener(y,M))}var H=!1,U={length:n.length,action:"POP",location:A,createHref:R,push:function(e,t){var r="PUSH",o=p(e,t,T(),U.location);j.confirmTransitionTo(o,r,k,(function(e){if(e){var t=R(o),a=o.key,s=o.state;if(i)if(n.pushState({key:a,state:s},null,t),w)window.location.href=t;else{var l=D.indexOf(U.location.key),u=D.slice(0,l+1);u.push(o.key),D=u,O({action:r,location:o})}else window.location.href=t}}))},replace:function(e,t){var r="REPLACE",o=p(e,t,T(),U.location);j.confirmTransitionTo(o,r,k,(function(e){if(e){var t=R(o),a=o.key,s=o.state;if(i)if(n.replaceState({key:a,state:s},null,t),w)window.location.replace(t);else{var l=D.indexOf(U.location.key);-1!==l&&(D[l]=o.key),O({action:r,location:o})}else window.location.replace(t)}}))},go:I,goBack:function(){I(-1)},goForward:function(){I(1)},block:function(e){void 0===e&&(e=!1);var t=j.setPrompt(e);return H||(z(1),H=!0),function(){return H&&(H=!1,z(-1)),t()}},listen:function(e){var t=j.appendListener(e);return z(1),function(){z(-1),t()}}};return U}({basename:new URL(APP_SETTINGS.hostname||location.origin).pathname||"/"});window.LSH=Pc,(e=>{xn(),Lt({dsn:"https://5f51920ff82a4675a495870244869c6b@o227124.ingest.sentry.io/5838868",integrations:[new wn.BrowserTracing({routingInstrumentation:Dt(e)})],environment:"production",tracesSampleRate:.25,release:"label-studio@1.1.0-frontend"})})(Pc);const Ac=({content:e})=>{const t={lsf:{scriptSrc:window.EDITOR_JS,cssSrc:window.EDITOR_CSS,checkAvailability:()=>!!window.LabelStudio},dm:{scriptSrc:window.DM_JS,cssSrc:window.DM_CSS,checkAvailability:()=>!!window.DataManager}};return(0,ni.jsx)(Nc,{children:(0,ni.jsx)($,{history:Pc,children:(0,ni.jsx)(Oi,{providers:[(0,ni.jsx)(Gi,{},"app-store"),(0,ni.jsx)($i,{},"api"),(0,ni.jsx)(_i,{},"config"),(0,ni.jsx)(Ji,{libraries:t},"lsf"),(0,ni.jsx)(yc,{},"rotes"),(0,ni.jsx)(Tc,{},"project")],children:(0,ni.jsx)(sa,{children:(0,ni.jsx)(Lc,{content:e})})})})})},Dc=document.querySelector(".app-wrapper"),Rc=document.querySelector("#main-content");(0,x.render)((0,ni.jsx)(Ac,{content:Rc.innerHTML}),Dc)})()})();
  //# sourceMappingURL=index.js.map